Files
bl/logic/service/fight/effect/effect_112.go
昔念 aad1e2f44c feat(fight): 添加战斗前状态检查与经验获取限制判断
- 在挑战BOSS和野外怪物战斗前,增加 CanFight 状态检查,防止非法战斗
- 修复战斗胜利后经验与物品发放逻辑,增加 CanGetExp 判断避免重复获取
- 优化战斗中精灵切换逻辑与相关伤害效果处理,确保死亡标记正确设置
- 修正战斗轮次中被动切换行为及技能执行顺序问题
- 移除无用的管理员会话控制器和宠物融合模型代码
- 调整战斗输入结构体中的 Switch 类型为 Map 以提高查找效率
- 修复战斗中精灵存活判定条件,
2025-12-01 23:31:48 +08:00

43 lines
983 B
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/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/shopspring/decimal"
)
/**
* 牺牲全部体力造成对手250~300点伤害造成致命伤害时对手剩下1点体力
*/
type Effect112 struct {
node.EffectNode
can bool
}
func init() {
input.InitEffect(input.EffectType.Skill, 112, &Effect112{})
}
// 命中之后
func (e *Effect112) OnSkill() bool {
if !e.Hit() {
return true
}
e.can = true
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: decimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)),
})
n := int64(e.Input.FightC.GetRand().Int31n(int32(50+1))) + 250
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: decimal.Min(decimal.NewFromInt(n), e.Ctx().Opp.CurrentPet.GetHP().Sub(decimal.NewFromInt(1))),
})
e.Ctx().Our.CurrentPet.NotAlive = true
return true
}