This commit is contained in:
1
2025-11-11 06:23:59 +00:00
parent a1107b57eb
commit a0905a59b4
2 changed files with 12 additions and 5 deletions

View File

@@ -15,6 +15,7 @@ import (
// 处理技能攻击逻辑
func (f *FightC) processSkillAttack(attacker, defender *input.Input, a *info.SkillEntity) {
//oldpet := f.copypet(attacker.CurrentPet)
a.AttackTimeC(attacker.GetProp(5, true)) //计算命中
defender.ExecCace(func(t input.Effect) bool { //计算闪避 ,然后修改对方命中),同时相当于计算属性无效这种
@@ -33,7 +34,7 @@ func (f *FightC) processSkillAttack(attacker, defender *input.Input, a *info.Ski
return true
})
attacker.ExecCace(func(t input.Effect) bool { //计算命中 miss改命中
attacker.ExecCace(func(t input.Effect) bool {
//计算变威力
t.Ctx().SkillEntity = a
t.Skill_Hit() //相当于先调整基础命中,不光调整命中,这里还能调整技能属性,暴击率
@@ -117,6 +118,12 @@ func (f *FightC) copyskill(t *action.SelectSkillAction) *info.SkillEntity {
oldskill.(*info.SkillEntity).Rand = f.rand //拷贝后随机数丢失
return oldskill.(*info.SkillEntity)
}
func (f *FightC) copypet(t *info.BattlePetEntity) *info.BattlePetEntity {
oldskill, _ := deepcopy.Anything(t) //备份技能
// oldskill.(*info.BattlePetEntity).Rand = f.rand //拷贝后随机数丢失
return oldskill.(*info.BattlePetEntity)
}
//回合有先手方和后手方,同时有攻击方和被攻击方
@@ -207,7 +214,7 @@ func (f *FightC) enterturn(fattack, sattack *action.SelectSkillAction) {
}
currentskill = oldskill
attacker.Initeffectcache()
// fmt.Println("开始攻击威力", oldskill.Power)
canuseskill := attacker.ExecCace(func(t input.Effect) bool { //这个是能否使用技能
@@ -224,7 +231,7 @@ func (f *FightC) enterturn(fattack, sattack *action.SelectSkillAction) {
attacker.CurrentPet.Info.Hp > 0 { //可以使用技能
f.processSkillAttack(attacker, defender, currentskill)
currentskill = oldskill
currentskill = oldskill //还原技能
// fmt.Println("结束攻击1", oldskill.Power)
// fmt.Println("结束攻击", currentskill.Power)
_, skill, ok := utils.FindWithIndex(attacker.CurrentPet.Info.SkillList, func(item model.SkillInfo) bool {

View File

@@ -142,7 +142,7 @@ func (our *Input) GetStatusBonus() float64 {
return maxBonus
}
func (our *Input) initeffectcache() {
func (our *Input) Initeffectcache() {
our.EffectCache = make([]Effect, 0) //先把上一回合数据清空,但是应该把本身延续类效果集成过来
for _, v := range our.Effects {
@@ -160,7 +160,7 @@ func (our *Input) initeffectcache() {
// 解析并 施加effect
func (our *Input) Parseskill(defender *Input, skill *action.SelectSkillAction) {
our.initeffectcache() //这里说明是延续的效果,每次复制出来一个新的就好了
our.Initeffectcache() //这里说明是延续的效果,每次复制出来一个新的就好了
//i.NewEffects = make([]Effect, 0) //这里说明是新增的效果
temparg := skill.SideEffectArgS