fix(fight): 修复空变更提交问题

This commit is contained in:
1
2025-11-09 03:06:18 +00:00
parent f3c5a5106c
commit d304955ffa
3 changed files with 38 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ type Move struct {
DmgBindLv int `xml:"DmgBindLv,attr,omitempty"` //使对方受到的伤害值等于自身的等级
PwrBindDv int `xml:"PwrBindDv,attr,omitempty"` //威力power取决于自身的潜力个体值
PwrDouble int `xml:"PwrDouble,attr,omitempty"` //攻击时,若对方处于异常状态, 则威力翻倍;
DmgBindHpDv int `xml:"DmgBindHpDv,attr,omitempty"` //使对方受到的伤害值等于自身的体力值
SideEffect string `xml:"SideEffect,attr,omitempty"`
SideEffectArg string `xml:"SideEffectArg,attr,omitempty"`
SideEffectS []int

View File

@@ -418,7 +418,34 @@ func (i *Input) CalculatePower(deftype *Input, skill *info.SkillEntity) decimal.
t, _ := element.Calculator.GetOffensiveMultiplier(skill.Type().ID, deftype.CurrentPet.Type().ID)
typeRate = decimal.NewFromFloat(t)
// 8. DmgBindLv: 使对方受到的伤害值等于等级; 默认: 0
// 9. PwrBindDv: 1,威力power取决于潜力个体值*5; 2,威力power取决于最大体力*1/3+潜力(个体值); 默认: 0
// 10. PwrDouble: 攻击时,若对方处于异常状态, 则威力翻倍;
// 11. DmgBindHpDv: 造成的伤害等于自身剩余体力*1/2+潜力(个体值); 默认: 0
if skill.DmgBindLv != 0 {
baseDamage = decimal.NewFromInt(int64(deftype.CurrentPet.Info.Level))
}
if skill.PwrBindDv != 0 {
if skill.PwrBindDv == 1 {
baseDamage = decimal.NewFromInt(int64(i.CurrentPet.Info.Dv * 5))
}
if skill.PwrBindDv == 2 {
baseDamage = decimal.NewFromInt(int64(i.CurrentPet.Info.Hp/3 + i.CurrentPet.Info.Dv))
}
}
if skill.PwrDouble != 0 {
if deftype.StatEffect_Exist_all() {
baseDamage = baseDamage.Mul(decimal.NewFromInt(2))
}
}
if skill.DmgBindHpDv != 0 {
baseDamage = decimal.NewFromInt(int64(i.CurrentPet.Info.Hp/2 + i.CurrentPet.Info.Dv))
}
damage := baseDamage.
Mul(skill.CriticalsameTypeBonus()). // 同属性加成
Mul(typeRate). // 克制系数

View File

@@ -85,7 +85,7 @@ func (c *Input) GetEffect(etype EnumEffectType, id int) Effect {
}
func (c *Input) StatEffect_Exist(id int) bool {
for _, v := range c.Effects {
if v.ID() == id && v.Alive() {
if v.ID()+int(EffectType.Status) == id && v.Alive() {
return true
}
@@ -93,7 +93,16 @@ func (c *Input) StatEffect_Exist(id int) bool {
return false
}
func (c *Input) StatEffect_Exist_all() bool {
for _, v := range c.Effects {
if v.ID() >= int(EffectType.Status) && v.ID() < int(EffectType.Sub) && v.Alive() {
return true
}
}
return false
}
func (c *Input) GetCurrAttr(id int) *model.PetInfo {
//todo 获取前GetEffect