新纪元

This commit is contained in:
xinian
2026-04-04 06:27:15 +08:00
committed by cnb
parent 3a9932e307
commit 0ac84a9509
11 changed files with 153 additions and 69 deletions

View File

@@ -21,13 +21,13 @@ func (f *FightC) processSkillAttack(attacker, defender *input.Input, skill *info
}
skill.AttackTimeC(attacker.Prop[5]) //计算命中
defender.Exec(func(effect input.Effect) bool { //计算闪避,然后修改对方命中),同时相当于计算属性无效这种
defender.ExecWithOpponent(attacker, func(effect input.Effect) bool { //计算闪避,然后修改对方命中),同时相当于计算属性无效这种
effect.Ctx().SkillEntity = skill
effect.SkillHit_ex()
return true
})
attacker.Exec(func(effect input.Effect) bool {
attacker.ExecWithOpponent(defender, func(effect input.Effect) bool {
//计算变威力
effect.Ctx().SkillEntity = skill
effect.SkillHit() //相当于先调整基础命中,不光调整命中,这里还能调整技能属性,暴击率
@@ -38,7 +38,7 @@ func (f *FightC) processSkillAttack(attacker, defender *input.Input, skill *info
//复制属性
originalProps[0], originalProps[1] = attacker.Prop, defender.Prop
originalPetInfo[0], originalPetInfo[1] = attacker.CurPet[0].Info, defender.CurPet[0].Info
attacker.Exec(func(effect input.Effect) bool {
attacker.ExecWithOpponent(defender, func(effect input.Effect) bool {
//计算变威力
effect.Ctx().SkillEntity = skill
effect.CalculatePre() //相当于先调整基础命中,不光调整命中,这里还能调整技能属性,暴击率
@@ -88,7 +88,7 @@ func (f *FightC) processSkillAttack(attacker, defender *input.Input, skill *info
}
// 扣减防御方血量
attacker.Exec(func(effect input.Effect) bool {
attacker.ExecWithOpponent(defender, func(effect input.Effect) bool {
effect.Ctx().SkillEntity = skill
effect.OnSkill() //调用伤害计算
return true
@@ -235,14 +235,14 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
}
currentSkill = originalSkill
defender.Exec(func(effect input.Effect) bool { //这个是能否使用技能
effect.Ctx().SkillEntity = currentSkill
return effect.ActionStartEx(firstAttack, secondAttack)
})
canUseSkill := attacker.Exec(func(effect input.Effect) bool { //这个是能否使用技能
effect.Ctx().SkillEntity = currentSkill
return effect.ActionStart(firstAttack, secondAttack)
})
defender.ExecWithOpponent(attacker, func(effect input.Effect) bool { //这个是能否使用技能
effect.Ctx().SkillEntity = currentSkill
return effect.ActionStartEx(firstAttack, secondAttack)
})
canUseSkill := attacker.ExecWithOpponent(defender, func(effect input.Effect) bool { //这个是能否使用技能
effect.Ctx().SkillEntity = currentSkill
return effect.ActionStart(firstAttack, secondAttack)
})
canUse := canUseSkill && action.CanUse(currentSkill) && attacker != nil && attacker.CurPet[0].Info.Hp > 0
@@ -273,7 +273,7 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
})
if ok {
usecount := 1
attacker.Exec(func(effect input.Effect) bool { //技能使用后的我方效果
attacker.ExecWithOpponent(defender, func(effect input.Effect) bool { //技能使用后的我方效果
effect.Ctx().SkillEntity = currentSkill
effect.HookPP(&usecount)
return true
@@ -283,7 +283,7 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
}
if defender.CurPet[0].Info.Hp > 0 {
//技能使用后
defender.Exec(func(effect input.Effect) bool { //技能使用后的我方效果
defender.ExecWithOpponent(attacker, func(effect input.Effect) bool { //技能使用后的我方效果
effect.Ctx().SkillEntity = currentSkill
effect.Skill_Use_ex()
return true
@@ -292,20 +292,20 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction)
if attacker.CurPet[0].Info.Hp > 0 {
//技能使用后
attacker.Exec(func(effect input.Effect) bool { //技能使用后的我方效果
attacker.ExecWithOpponent(defender, func(effect input.Effect) bool { //技能使用后的我方效果
effect.Ctx().SkillEntity = currentSkill
effect.Skill_Use()
return true
})
}
//技能使用后
defender.Exec(func(effect input.Effect) bool { //技能使用后的我方效果
defender.ExecWithOpponent(attacker, func(effect input.Effect) bool { //技能使用后的我方效果
effect.Ctx().SkillEntity = currentSkill
effect.Action_end_ex()
return true
})
//技能使用后
attacker.Exec(func(effect input.Effect) bool { //技能使用后的我方效果
attacker.ExecWithOpponent(defender, func(effect input.Effect) bool { //技能使用后的我方效果
effect.Ctx().SkillEntity = currentSkill
effect.Action_end()
return true