`` refactor(fight): 重构状态效果处理逻辑,统一使用Skill_Hit_Pre方法并修复回合开始触发时机``
待实现寄生种子
This commit is contained in:
@@ -18,7 +18,8 @@ type StatusNotSkill struct {
|
||||
EffectStatus
|
||||
}
|
||||
|
||||
func (e *StatusNotSkill) CanSkill(opp *input.Input) bool {
|
||||
// 不能出手
|
||||
func (e *StatusNotSkill) Skill_Hit_Pre(input.Ctx) bool {
|
||||
return false
|
||||
|
||||
}
|
||||
@@ -28,19 +29,16 @@ type DrainHP struct {
|
||||
EffectStatus
|
||||
}
|
||||
|
||||
func (e *DrainHP) OnTurnStart(opp *input.Input) {
|
||||
func (e *DrainHP) Skill_Hit_Pre(input input.Ctx) bool {
|
||||
input.DamageZone = &info.DamageZone{
|
||||
|
||||
e.Input.Damage(input.Ctx{
|
||||
|
||||
Input: opp,
|
||||
DamageZone: &info.DamageZone{
|
||||
|
||||
Type: info.DamageType.Red,
|
||||
Damage: decimal.NewFromUint64(uint64(opp.CurrentPet.Info.MaxHp)).
|
||||
Div(decimal.NewFromInt(8)),
|
||||
},
|
||||
})
|
||||
Type: info.DamageType.True, //状态类扣除无法被减伤
|
||||
Damage: decimal.NewFromUint64(uint64(e.Input.CurrentPet.Info.MaxHp)).
|
||||
Div(decimal.NewFromInt(8)),
|
||||
}
|
||||
e.Input.Damage(input)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// 被寄生种子 扣血类
|
||||
@@ -48,10 +46,13 @@ type StatusDrainedHP struct {
|
||||
DrainHP
|
||||
}
|
||||
|
||||
func (e *StatusDrainedHP) OnTurnStart(opp *input.Input) {
|
||||
e.DrainHP.OnTurnStart(opp)
|
||||
func (e *StatusDrainedHP) Skill_Hit_Pre(input input.Ctx) bool {
|
||||
e.DrainHP.Skill_Hit_Pre(input) //先调用父类扣血
|
||||
//TODO 寄生种子 给对面回血,待实现回血buff
|
||||
|
||||
opp.CurrentPet.Info.Hp = -e.Input.CurrentPet.Info.MaxHp / 8
|
||||
// input.CurrentPet.Info.Hp = -e.Input.CurrentPet.Info.MaxHp / 8
|
||||
|
||||
return true
|
||||
|
||||
}
|
||||
func init() {
|
||||
|
||||
Reference in New Issue
Block a user