fix(fight): 战斗修改
This commit is contained in:
@@ -20,7 +20,7 @@ type StatusNotSkill struct {
|
||||
}
|
||||
|
||||
// 不能出手
|
||||
func (e *StatusNotSkill) Skill_Hit_Pre(ctx input.Ctx) bool {
|
||||
func (e *StatusNotSkill) Skill_Hit_Pre() bool {
|
||||
|
||||
return false
|
||||
|
||||
@@ -31,20 +31,20 @@ type StatusSleep struct { //睡眠不能出手 ,这个挂载到对面来实现
|
||||
can bool
|
||||
}
|
||||
|
||||
func (e *StatusSleep) Skill_Hit_Pre(ctx input.Ctx) bool {
|
||||
e.StatusNotSkill.Skill_Hit_Pre(ctx)
|
||||
func (e *StatusSleep) Skill_Hit_Pre() bool {
|
||||
e.StatusNotSkill.Skill_Hit_Pre()
|
||||
e.can = true
|
||||
return false
|
||||
|
||||
}
|
||||
func (e *StatusSleep) Skill_Use(ctx input.Ctx) bool {
|
||||
func (e *StatusSleep) Skill_Use_ex() bool {
|
||||
if !e.can {
|
||||
return true
|
||||
}
|
||||
if ctx.SkillEntity == nil {
|
||||
if e.Ctx().SkillEntity == nil {
|
||||
return true
|
||||
}
|
||||
if ctx.SkillEntity.Category() != info.Category.STATUS {
|
||||
if e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
||||
t := e.Input.GetEffect(input.EffectType.Status, int(info.PetStatus.Sleep))
|
||||
if t != nil {
|
||||
t.Alive(false)
|
||||
@@ -60,13 +60,15 @@ type DrainHP struct {
|
||||
damage decimal.Decimal
|
||||
}
|
||||
|
||||
func (e *DrainHP) Skill_Hit_Pre(input input.Ctx) bool {
|
||||
func (e *DrainHP) Skill_Hit_Pre() bool {
|
||||
e.damage = decimal.NewFromUint64(uint64(e.Input.CurrentPet.Info.MaxHp)).
|
||||
Div(decimal.NewFromInt(8))
|
||||
input.DamageZone.Type = info.DamageType.True
|
||||
input.DamageZone.Damage = e.damage
|
||||
|
||||
e.Input.Damage(input)
|
||||
e.Input.Damage(&info.DamageZone{
|
||||
|
||||
Type: info.DamageType.True,
|
||||
Damage: e.damage,
|
||||
})
|
||||
|
||||
return true
|
||||
}
|
||||
@@ -76,16 +78,16 @@ type DrainedHP struct {
|
||||
DrainHP
|
||||
}
|
||||
|
||||
func (e *DrainedHP) Skill_Hit_Pre(input input.Ctx) bool {
|
||||
func (e *DrainedHP) Skill_Hit_Pre() bool {
|
||||
|
||||
if gconv.Int(e.Input.CurrentPet.Type) == 1 {
|
||||
return true
|
||||
}
|
||||
e.DrainHP.Skill_Hit_Pre(input) //先调用父类扣血
|
||||
e.DrainHP.Skill_Hit_Pre() //先调用父类扣血
|
||||
//TODO 寄生种子 给对面回血,待实现回血buff
|
||||
|
||||
//这个回血不属于任何类型,所以不会被阻止回血
|
||||
input.Heal(nil, e.damage)
|
||||
e.Ctx().Opp.Heal(nil, e.damage)
|
||||
// input.CurrentPet.Info.Hp = -e.Input.CurrentPet.Info.MaxHp / 8
|
||||
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user