feat(fight): 增加效果节点的战斗类型过滤和回合结束效果功能

- 在 EffectNode 结构中添加 Flag 字段,用于过滤不同类型的战斗(PvP、PvE、BOSS战等)
- 增加注释,说明在 EffectNode 中添加 Owner 和 Target 字段的计划
- 在 BattlePetEntity 中添加注释,解释战斗相关属性的索引
This commit is contained in:
2025-09-05 00:07:04 +08:00
parent 7d48e9ab64
commit d0d897337e
2 changed files with 4 additions and 1 deletions

View File

@@ -20,7 +20,8 @@ type EffectNode struct {
Success bool // 是否执行成功 成功XXX失败XXX
efftype int // 传出作用对象,默认0是自身,1是作用于对面
Flag int //过滤掉的战斗类型 pvp pve boss战斗,野怪全部生效
//增加owner target如果owner target都为自身就回合效果结束后再使用回合效果
}
func (this *EffectNode) ID() int {

View File

@@ -17,6 +17,8 @@ const Pet_O_Ctx = "PET_O"
const Pet_T_Ctx = "PET_T"
// 这里获得攻击,防御,特工,特防,速度
// * battle_lv: atk(0), def(1), sp_atk(2), sp_def(3), spd(4), accuracy(5)
// * battle_attr: 0:hp, 1:atk, 2:def, 3:sp_atk, 4:sp_def, 5:spd
func (a *BattlePetEntity) Value(tt uint32) uint32 {
offsetAtk := unsafe.Offsetof(a.info.Attack) // c字段的偏移量通常为4+16=20