This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// processSkillAttack 处理技能攻击逻辑
|
// processSkillAttack 处理技能攻击逻辑
|
||||||
func (*FightC) processSkillAttack(attacker, defender *input.Input, skill *info.SkillEntity) {
|
func (f *FightC) processSkillAttack(attacker, defender *input.Input, skill *info.SkillEntity) {
|
||||||
skill.AttackTimeC(attacker.GetProp(5, true)) //计算命中
|
skill.AttackTimeC(attacker.GetProp(5, true)) //计算命中
|
||||||
|
|
||||||
defender.Exec(func(effect input.Effect) bool { //计算闪避,然后修改对方命中),同时相当于计算属性无效这种
|
defender.Exec(func(effect input.Effect) bool { //计算闪避,然后修改对方命中),同时相当于计算属性无效这种
|
||||||
@@ -32,14 +32,9 @@ func (*FightC) processSkillAttack(attacker, defender *input.Input, skill *info.S
|
|||||||
})
|
})
|
||||||
var originalProps [2][6]int8
|
var originalProps [2][6]int8
|
||||||
var originalPetInfo [2]model.PetInfo
|
var originalPetInfo [2]model.PetInfo
|
||||||
originalProps[0], originalProps[1] = attacker.Prop, defender.Prop //先复制能力提升
|
//复制属性
|
||||||
if attacker != nil {
|
originalProps[0], originalProps[1] = f.Our.Prop, f.Opp.Prop //先复制能力提升
|
||||||
originalPetInfo[0] = attacker.CurrentPet.Info
|
originalPetInfo[0], originalPetInfo[1] = f.Our.CurrentPet.Info, f.Opp.CurrentPet.Info //先复制宠物信息
|
||||||
}
|
|
||||||
if defender != nil {
|
|
||||||
originalPetInfo[1] = defender.CurrentPet.Info
|
|
||||||
}
|
|
||||||
|
|
||||||
attacker.Exec(func(effect input.Effect) bool {
|
attacker.Exec(func(effect input.Effect) bool {
|
||||||
//计算变威力
|
//计算变威力
|
||||||
effect.Ctx().SkillEntity = skill
|
effect.Ctx().SkillEntity = skill
|
||||||
@@ -57,13 +52,9 @@ func (*FightC) processSkillAttack(attacker, defender *input.Input, skill *info.S
|
|||||||
attacker.SumDamage = attacker.CalculatePower(defender, skill)
|
attacker.SumDamage = attacker.CalculatePower(defender, skill)
|
||||||
}
|
}
|
||||||
|
|
||||||
attacker.Prop, defender.Prop = originalProps[0], originalProps[1]
|
//还原属性
|
||||||
if attacker != nil {
|
f.Our.Prop, f.Opp.Prop = originalProps[0], originalProps[1]
|
||||||
attacker.CurrentPet.Info = originalPetInfo[0]
|
f.Our.CurrentPet.Info, f.Opp.CurrentPet.Info = originalPetInfo[0], originalPetInfo[1]
|
||||||
}
|
|
||||||
if defender != nil {
|
|
||||||
defender.CurrentPet.Info = originalPetInfo[1]
|
|
||||||
}
|
|
||||||
|
|
||||||
if attacker.IsCritical == 1 { //命中了才有暴击
|
if attacker.IsCritical == 1 { //命中了才有暴击
|
||||||
//暴击破防
|
//暴击破防
|
||||||
|
|||||||
Reference in New Issue
Block a user