This commit is contained in:
@@ -51,7 +51,6 @@ func (e *StatusTired) ActionStart(attacker, defender *action.SelectSkillAction)
|
||||
// 睡眠状态:受击后解除
|
||||
type StatusSleep struct {
|
||||
StatusCannotAct
|
||||
hasTriedAct bool
|
||||
}
|
||||
|
||||
// 睡眠在“被攻击且未 miss”后立即解除,而不是等到技能使用后节点。
|
||||
@@ -66,28 +65,17 @@ func (e *StatusSleep) DamageSubEx(zone *info.DamageZone) bool {
|
||||
}
|
||||
|
||||
func (e *StatusSleep) ActionStart(attacker, defender *action.SelectSkillAction) bool {
|
||||
if e.Duration() <= 0 {
|
||||
e.hasTriedAct = false
|
||||
return true
|
||||
}
|
||||
e.hasTriedAct = true
|
||||
|
||||
return e.StatusCannotAct.ActionStart(attacker, defender)
|
||||
}
|
||||
|
||||
func (e *StatusSleep) Skill_Use_ex() bool {
|
||||
if !e.hasTriedAct {
|
||||
return true
|
||||
}
|
||||
|
||||
if e.Duration() <= 0 && e.Ctx().SkillEntity != nil && e.Ctx().Category() != info.Category.STATUS {
|
||||
e.Alive(false)
|
||||
}
|
||||
e.hasTriedAct = false
|
||||
return true
|
||||
}
|
||||
|
||||
func (e *StatusSleep) TurnEnd() {
|
||||
e.hasTriedAct = false
|
||||
e.StatusCannotAct.TurnEnd()
|
||||
return true
|
||||
}
|
||||
|
||||
// 持续伤害状态基类(中毒、冻伤、烧伤等)
|
||||
@@ -300,6 +288,7 @@ func init() {
|
||||
info.PetStatus.Paralysis, // 麻痹
|
||||
info.PetStatus.Fear, // 害怕
|
||||
info.PetStatus.Petrified, // 石化
|
||||
info.PetStatus.Tired, // 疲惫
|
||||
}
|
||||
for _, status := range nonActingStatuses {
|
||||
effect := &StatusCannotAct{}
|
||||
@@ -307,10 +296,6 @@ func init() {
|
||||
input.InitEffect(input.EffectType.Status, int(status), effect)
|
||||
}
|
||||
|
||||
tired := &StatusTired{}
|
||||
tired.Status = info.PetStatus.Tired
|
||||
input.InitEffect(input.EffectType.Status, int(info.PetStatus.Tired), tired)
|
||||
|
||||
// 注册睡眠状态(使用枚举常量替代硬编码8)
|
||||
input.InitEffect(input.EffectType.Status, int(info.PetStatus.Sleep), &StatusSleep{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user