Files
bl/logic/service/fight/battle/effect/effect_stat.go
昔念 6376d94487 feat(fight): 实现技能结算和伤害计算功能
- 新增 AI_player 的 SendAttackValue 方法
- 修改 BattleAction 的 SelectSkillAction 结构,增加 Attack 字段
- 更新 FightC 的战斗循环逻辑,实现技能结算和伤害计算
- 增加 FightC 的 BroadcastSkill 方法,用于广播技能效果
- 更新 Player 的 SendAttackValue 方法,发送技能效果数据
- 调整 AttackValue 和 StatusDict 结构,优化数据存储
2025-09-06 01:47:08 +08:00

50 lines
1.0 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/battle/node"
"blazing/logic/service/fight/info"
)
func init() {
//技能使用成功时m%自身XX等级+/-n
info.InitEffect(4, NewEffectStat(false))
//技能使用成功时m%对方XX等级+/-n
info.InitEffect(5, NewEffectStat(true))
}
func NewEffectStat(b bool) info.Effect {
return &EffectStat{
node.EffectNode{
ArgSize: 3,
},
b,
}
}
type EffectStat struct {
node.EffectNode
etype bool
}
// func (this *EffectStat) GetPet() {
// ff := this.EffectNode.GetOwnerPet()
// offsetC := unsafe.Offsetof(ff.Atk) // c字段的偏移量通常为4+16=20
// // 2. 将结构体指针转换为原始内存地址uintptr
// baseAddr := uintptr(unsafe.Pointer(&offsetC))
// // 3. 计算字段地址并赋值
// // 给a字段赋值通过偏移量
// addrA := unsafe.Pointer(baseAddr + 4) //根据攻击算其他字段
// *(*uint32)(addrA) = 100
// }
func (this *EffectStat) SkillUseEnd() {
if !this.etype { //自身
} else { //对方
}
}