docs(effects): 移除已完成的技能效果任务文档 移除 effects 956-1005、1263-1312、1695-1734 等范围内的未实现技能效果任务文档, 这些任务已经完成实现,相关文档不再需要维护。 ```
339 lines
9.6 KiB
Go
339 lines
9.6 KiB
Go
package effect
|
||
|
||
import (
|
||
"blazing/logic/service/fight/action"
|
||
"blazing/logic/service/fight/info"
|
||
"blazing/logic/service/fight/input"
|
||
"blazing/logic/service/fight/node"
|
||
|
||
"github.com/alpacahq/alpacadecimal"
|
||
"github.com/gogf/gf/v2/util/grand"
|
||
)
|
||
|
||
func addRandomControlStatus(owner, target *input.Input, count int) {
|
||
if owner == nil || target == nil || count <= 0 {
|
||
return
|
||
}
|
||
statuses := []int{
|
||
int(info.PetStatus.Paralysis),
|
||
int(info.PetStatus.Fear),
|
||
int(info.PetStatus.Tired),
|
||
int(info.PetStatus.Petrified),
|
||
int(info.PetStatus.Sleep),
|
||
}
|
||
for _, idx := range grand.Perm(len(statuses))[:minInt(count, len(statuses))] {
|
||
applyStatusToOpp(owner, target, statuses[idx])
|
||
}
|
||
}
|
||
|
||
// Effect 1995: 对手每损失一定体力则额外附加固定伤害
|
||
type Effect1995 struct{ node.EffectNode }
|
||
|
||
func (e *Effect1995) OnSkill() bool { return true }
|
||
|
||
// Effect 1996: 本次技能PP消耗降低
|
||
type Effect1996 struct{ node.EffectNode }
|
||
|
||
func (e *Effect1996) HookPP(count *int) bool {
|
||
if count != nil && len(e.Args()) > 0 {
|
||
*count = *count - int(e.Args()[0].IntPart())
|
||
if *count < 0 {
|
||
*count = 0
|
||
}
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 1997: 命中后随机附加控制类异常状态
|
||
type Effect1997 struct{ node.EffectNode }
|
||
|
||
func (e *Effect1997) OnSkill() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
addRandomControlStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
||
return true
|
||
}
|
||
|
||
// Effect 1998: 若当前体力低于对手则伤害提升
|
||
type Effect1998 struct{ node.EffectNode }
|
||
|
||
func (e *Effect1998) SkillHit() bool {
|
||
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
|
||
return true
|
||
}
|
||
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Opp.CurrentPet.GetHP()) < 0 {
|
||
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 1999: 先出手时提高先制
|
||
type Effect1999 struct{ node.EffectNode }
|
||
|
||
func (e *Effect1999) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||
if e.Ctx().SkillEntity != nil {
|
||
e.Ctx().SkillEntity.XML.Priority++
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2000: 消除双方能力变化,消除成功则自身获得护盾
|
||
type Effect2000 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2000) OnSkill() bool {
|
||
clearPositiveProps(e.Ctx().Opp, e.Ctx().Our)
|
||
if len(e.Args()) > 0 {
|
||
e.Ctx().Our.AddShield(e.Args()[0])
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2001: 若自身处于能力提升状态则伤害提升
|
||
type Effect2001 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2001) SkillHit() bool {
|
||
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || !e.Ctx().Our.HasPropADD() {
|
||
return true
|
||
}
|
||
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
|
||
return true
|
||
}
|
||
|
||
// Effect 2002: 若对手处于异常状态则造成额外固定伤害
|
||
type Effect2002 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2002) OnSkill() bool {
|
||
if len(e.Args()) == 0 || !e.Ctx().Opp.StatEffect_Exist_all() {
|
||
return true
|
||
}
|
||
addFixedDamageToOpp(&e.EffectNode, e.Args()[0])
|
||
return true
|
||
}
|
||
|
||
// Effect 2003: 使用技能后恢复自身PP
|
||
type Effect2003 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2003) Skill_Use() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
e.Ctx().Our.HealPP(int(e.Args()[0].IntPart()))
|
||
return true
|
||
}
|
||
|
||
// Effect 2004: 对手使用属性技能时使其随机进入控制类异常状态
|
||
type Effect2004 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2004) OnSkill() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||
addRandomControlStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2005: 对手当前体力高于自身时伤害提升
|
||
type Effect2005 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2005) SkillHit() bool {
|
||
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
|
||
return true
|
||
}
|
||
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetHP()) > 0 {
|
||
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2006: 先出手时令对手下次技能PP消耗增加
|
||
type Effect2006 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2006) HookPP(count *int) bool {
|
||
if count != nil && len(e.Args()) > 0 {
|
||
*count += int(e.Args()[0].IntPart())
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2007: 若本次攻击命中则附加控制类异常状态
|
||
type Effect2007 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2007) OnSkill() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
addRandomControlStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
||
return true
|
||
}
|
||
|
||
// Effect 2008: 若自身不处于能力提升状态则恢复PP
|
||
type Effect2008 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2008) Skill_Use() bool {
|
||
if len(e.Args()) == 0 || e.Ctx().Our.HasPropADD() {
|
||
return true
|
||
}
|
||
e.Ctx().Our.HealPP(int(e.Args()[0].IntPart()))
|
||
return true
|
||
}
|
||
|
||
// Effect 2009: 若对手不处于异常状态则先制+1
|
||
type Effect2009 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2009) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||
if e.Ctx().SkillEntity != nil && !e.Ctx().Opp.StatEffect_Exist_all() {
|
||
e.Ctx().SkillEntity.XML.Priority++
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2010: 对手处于异常状态时伤害提升
|
||
type Effect2010 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2010) SkillHit() bool {
|
||
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil || !e.Ctx().Opp.StatEffect_Exist_all() {
|
||
return true
|
||
}
|
||
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
|
||
return true
|
||
}
|
||
|
||
// Effect 2011: 命中后若对手体力高于自身则附加固定伤害
|
||
type Effect2011 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2011) OnSkill() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
if e.Ctx().Opp.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetHP()) > 0 {
|
||
addFixedDamageToOpp(&e.EffectNode, e.Args()[0])
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2012: 自身体力越低伤害越高
|
||
type Effect2012 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2012) SkillHit() bool {
|
||
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
|
||
return true
|
||
}
|
||
if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(2))) < 0 {
|
||
addSkillPowerPercent(e.Ctx().SkillEntity, e.Args()[0])
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2013: 对手切换时附加异常状态
|
||
type Effect2013 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2013) OnSkill() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
addRandomControlStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
||
return true
|
||
}
|
||
|
||
// Effect 2014: 吸取对手体力
|
||
type Effect2014 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2014) OnSkill() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
heal := e.Ctx().Opp.CurrentPet.GetMaxHP().Div(e.Args()[0])
|
||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal)
|
||
return true
|
||
}
|
||
|
||
// Effect 2015: 先出手时恢复PP
|
||
type Effect2015 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2015) SkillHit() bool {
|
||
if len(e.Args()) == 0 || e.Ctx().SkillEntity == nil {
|
||
return true
|
||
}
|
||
if e.Ctx().SkillEntity.AttackTime == 1 {
|
||
e.Ctx().Our.HealPP(int(e.Args()[0].IntPart()))
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2016: 对手使用属性技能时降低其PP
|
||
type Effect2016 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2016) OnSkill() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
||
e.Ctx().Opp.DelPP(int(e.Args()[0].IntPart()))
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2017: 自身不处于异常状态时先制+1
|
||
type Effect2017 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2017) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
|
||
if e.Ctx().SkillEntity != nil && !e.Ctx().Our.StatEffect_Exist_all() {
|
||
e.Ctx().SkillEntity.XML.Priority++
|
||
}
|
||
return true
|
||
}
|
||
|
||
// Effect 2018: 命中后对手随机进入异常状态
|
||
type Effect2018 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2018) OnSkill() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
addRandomControlStatus(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[0].IntPart()))
|
||
return true
|
||
}
|
||
|
||
// Effect 2019: 消除对手能力提升状态,消除成功则自身恢复PP
|
||
type Effect2019 struct{ node.EffectNode }
|
||
|
||
func (e *Effect2019) OnSkill() bool {
|
||
if len(e.Args()) == 0 {
|
||
return true
|
||
}
|
||
clearPositiveProps(e.Ctx().Opp, e.Ctx().Our)
|
||
e.Ctx().Our.HealPP(int(e.Args()[0].IntPart()))
|
||
return true
|
||
}
|
||
|
||
func init() {
|
||
input.InitEffect(input.EffectType.Skill, 1995, &Effect1995{})
|
||
input.InitEffect(input.EffectType.Skill, 1996, &Effect1996{})
|
||
input.InitEffect(input.EffectType.Skill, 1997, &Effect1997{})
|
||
input.InitEffect(input.EffectType.Skill, 1998, &Effect1998{})
|
||
input.InitEffect(input.EffectType.Skill, 1999, &Effect1999{})
|
||
input.InitEffect(input.EffectType.Skill, 2000, &Effect2000{})
|
||
input.InitEffect(input.EffectType.Skill, 2001, &Effect2001{})
|
||
input.InitEffect(input.EffectType.Skill, 2002, &Effect2002{})
|
||
input.InitEffect(input.EffectType.Skill, 2003, &Effect2003{})
|
||
input.InitEffect(input.EffectType.Skill, 2004, &Effect2004{})
|
||
input.InitEffect(input.EffectType.Skill, 2005, &Effect2005{})
|
||
input.InitEffect(input.EffectType.Skill, 2006, &Effect2006{})
|
||
input.InitEffect(input.EffectType.Skill, 2007, &Effect2007{})
|
||
input.InitEffect(input.EffectType.Skill, 2008, &Effect2008{})
|
||
input.InitEffect(input.EffectType.Skill, 2009, &Effect2009{})
|
||
input.InitEffect(input.EffectType.Skill, 2010, &Effect2010{})
|
||
input.InitEffect(input.EffectType.Skill, 2011, &Effect2011{})
|
||
input.InitEffect(input.EffectType.Skill, 2012, &Effect2012{})
|
||
input.InitEffect(input.EffectType.Skill, 2013, &Effect2013{})
|
||
input.InitEffect(input.EffectType.Skill, 2014, &Effect2014{})
|
||
input.InitEffect(input.EffectType.Skill, 2015, &Effect2015{})
|
||
input.InitEffect(input.EffectType.Skill, 2016, &Effect2016{})
|
||
input.InitEffect(input.EffectType.Skill, 2017, &Effect2017{})
|
||
input.InitEffect(input.EffectType.Skill, 2018, &Effect2018{})
|
||
input.InitEffect(input.EffectType.Skill, 2019, &Effect2019{})
|
||
}
|