This commit is contained in:
@@ -140,7 +140,7 @@ func (e *Effect1181) OnSkill() bool {
|
||||
type Effect1182 struct{ node.EffectNode }
|
||||
|
||||
func (e *Effect1182) Skill_Use() bool {
|
||||
if len(e.Args()) < 2 || e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil || e.Ctx().Opp == nil || e.Ctx().Opp.CurPet[0] == nil {
|
||||
if len(e.Args()) < 2 || e.Ctx().Our == nil || e.Ctx().Our.CurPet[0] == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -153,9 +153,15 @@ func (e *Effect1182) Skill_Use() bool {
|
||||
if targetHP.Cmp(alpacadecimal.Zero) < 0 {
|
||||
targetHP = alpacadecimal.Zero
|
||||
}
|
||||
if e.Ctx().Opp.CurPet[0].GetHP().Cmp(targetHP) > 0 {
|
||||
e.Ctx().Opp.CurPet[0].Info.Hp = uint32(targetHP.IntPart())
|
||||
}
|
||||
forEachEnemyTargetBySkill(e.Ctx().Our, e.Ctx().Opp, e.Ctx().SkillEntity, func(target *input.Input) bool {
|
||||
if target == nil || target.CurrentPet() == nil {
|
||||
return true
|
||||
}
|
||||
if target.CurrentPet().GetHP().Cmp(targetHP) > 0 {
|
||||
target.CurrentPet().Info.Hp = uint32(targetHP.IntPart())
|
||||
}
|
||||
return true
|
||||
})
|
||||
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1182, int(e.Args()[1].IntPart()))
|
||||
if sub != nil {
|
||||
|
||||
@@ -207,9 +207,15 @@ func registerSelfDamageOnSkillEffects() {
|
||||
})
|
||||
}
|
||||
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: opponentDamage,
|
||||
forEachEnemyTargetBySkill(e.Ctx().Our, e.Ctx().Opp, e.Ctx().SkillEntity, func(target *input.Input) bool {
|
||||
if target == nil || target.CurrentPet() == nil {
|
||||
return true
|
||||
}
|
||||
target.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: opponentDamage,
|
||||
})
|
||||
return true
|
||||
})
|
||||
return true
|
||||
},
|
||||
@@ -241,9 +247,15 @@ func registerSelfDamageSkillUseEffects() {
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: damage,
|
||||
})
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: damage,
|
||||
forEachEnemyTargetBySkill(e.Ctx().Our, e.Ctx().Opp, e.Ctx().SkillEntity, func(target *input.Input) bool {
|
||||
if target == nil || target.CurrentPet() == nil {
|
||||
return true
|
||||
}
|
||||
target.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: damage,
|
||||
})
|
||||
return true
|
||||
})
|
||||
return true
|
||||
},
|
||||
@@ -253,9 +265,23 @@ func registerSelfDamageSkillUseEffects() {
|
||||
Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurPet[0].Info.MaxHp)),
|
||||
})
|
||||
damage := int64(grand.N(250, 300))
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: alpacadecimal.Min(alpacadecimal.NewFromInt(damage), e.Ctx().Opp.CurPet[0].GetHP().Sub(alpacadecimal.NewFromInt(1))),
|
||||
forEachEnemyTargetBySkill(e.Ctx().Our, e.Ctx().Opp, e.Ctx().SkillEntity, func(target *input.Input) bool {
|
||||
if target == nil {
|
||||
return true
|
||||
}
|
||||
targetPet := target.CurrentPet()
|
||||
if targetPet == nil {
|
||||
return true
|
||||
}
|
||||
remainHP := targetPet.GetHP().Sub(alpacadecimal.NewFromInt(1))
|
||||
if remainHP.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
target.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: alpacadecimal.Min(alpacadecimal.NewFromInt(damage), remainHP),
|
||||
})
|
||||
return true
|
||||
})
|
||||
return true
|
||||
},
|
||||
@@ -280,15 +306,25 @@ func registerSelfDamageSkillUseEffects() {
|
||||
randomDamage = grand.N(minDamage, maxDamage)
|
||||
}
|
||||
|
||||
remainHP := e.Ctx().Opp.CurPet[0].GetHP().Sub(alpacadecimal.NewFromInt(1))
|
||||
if remainHP.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
forEachEnemyTargetBySkill(e.Ctx().Our, e.Ctx().Opp, e.Ctx().SkillEntity, func(target *input.Input) bool {
|
||||
if target == nil {
|
||||
return true
|
||||
}
|
||||
targetPet := target.CurrentPet()
|
||||
if targetPet == nil {
|
||||
return true
|
||||
}
|
||||
remainHP := targetPet.GetHP().Sub(alpacadecimal.NewFromInt(1))
|
||||
if remainHP.Cmp(alpacadecimal.Zero) <= 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
damage := alpacadecimal.Min(alpacadecimal.NewFromInt(int64(randomDamage)), remainHP)
|
||||
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: damage,
|
||||
damage := alpacadecimal.Min(alpacadecimal.NewFromInt(int64(randomDamage)), remainHP)
|
||||
target.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: damage,
|
||||
})
|
||||
return true
|
||||
})
|
||||
return true
|
||||
},
|
||||
@@ -297,11 +333,17 @@ func registerSelfDamageSkillUseEffects() {
|
||||
return true
|
||||
}
|
||||
|
||||
applyAllPropDown(e.Ctx().Our, e.Ctx().Opp, int8(e.Args()[0].IntPart()))
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1380, int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
|
||||
if sub != nil {
|
||||
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
forEachEnemyTargetBySkill(e.Ctx().Our, e.Ctx().Opp, e.Ctx().SkillEntity, func(target *input.Input) bool {
|
||||
if target == nil || target.CurrentPet() == nil {
|
||||
return true
|
||||
}
|
||||
applyAllPropDown(e.Ctx().Our, target, int8(e.Args()[0].IntPart()))
|
||||
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1380, int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
|
||||
if sub != nil {
|
||||
target.AddEffect(e.Ctx().Our, sub)
|
||||
}
|
||||
return true
|
||||
})
|
||||
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
|
||||
Type: info.DamageType.Fixed,
|
||||
Damage: e.Ctx().Our.CurPet[0].GetHP(),
|
||||
|
||||
Reference in New Issue
Block a user