diff --git a/common/data/xmlres/skill.go b/common/data/xmlres/skill.go index d1b6b22d..b84d3949 100644 --- a/common/data/xmlres/skill.go +++ b/common/data/xmlres/skill.go @@ -44,24 +44,24 @@ type Move struct { ID int `xml:"ID,attr"` Name string `xml:"Name,attr"` - Category int `xml:"Category,attr"` //属性 - Type int `xml:"Type,attr"` //类型 - Power int `xml:"Power,attr"` //威力 - MaxPP int `xml:"MaxPP,attr"` //最大PP - Accuracy int `xml:"Accuracy,attr"` //命中率 - CritRate int `xml:"CritRate,attr,omitempty"` //暴击率 - Priority int `xml:"Priority,attr,omitempty"` //优先级 - MustHit int `xml:"MustHit,attr,omitempty"` //是否必中 - SwapElemType int `xml:"SwapElemType,attr,omitempty"` //技能交换属性 - CopyElemType int `xml:"CopyElemType,attr,omitempty"` // 技能复制属性 - CritAtkFirst int `xml:"CritAtkFirst,attr,omitempty"` // 先出手时必定致命一击 - CritAtkSecond int `xml:"CritAtkSecond,attr,omitempty"` //后出手时必定致命一击 - CritSelfHalfHp int `xml:"CritSelfHalfHp,attr,omitempty"` //自身体力低于一半时必定致命一击 - CritFoeHalfHp int `xml:"CritFoeHalfHp,attr,omitempty"` //对方体力低于一半时必定致命一击 - 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"` //使对方受到的伤害值等于自身的体力值 + Category int `xml:"Category,attr"` //属性 + Type int `xml:"Type,attr"` //类型 + Power int `xml:"Power,attr"` //威力 + MaxPP int `xml:"MaxPP,attr"` //最大PP + Accuracy int `xml:"Accuracy,attr"` //命中率 + CritRate int `xml:"CritRate,attr,omitempty"` //暴击率 + Priority int `xml:"Priority,attr,omitempty"` //优先级 + MustHit int `xml:"MustHit,attr,omitempty"` //是否必中 + SwapElemType int `xml:"SwapElemType,attr,omitempty"` //技能交换属性 + CopyElemType int `xml:"CopyElemType,attr,omitempty"` // 技能复制属性 + CritAtkFirst int `xml:"CritAtkFirst,attr,omitempty"` // 先出手时必定致命一击 + CritAtkSecond int `xml:"CritAtkSecond,attr,omitempty"` //后出手时必定致命一击 + CritSelfHalfHp int `xml:"CritSelfHalfHp,attr,omitempty"` //自身体力低于一半时必定致命一击 + CritFoeHalfHp int `xml:"CritFoeHalfHp,attr,omitempty"` //对方体力低于一半时必定致命一击 + 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 @@ -71,7 +71,7 @@ type Move struct { Info string `xml:"info,attr,omitempty"` - CD int `xml:"CD,attr"` + CD *int `xml:"CD,attr"` } type SideEffect struct { diff --git a/logic/service/fight/effect/effect_87.go b/logic/service/fight/effect/effect_87.go index aa2b3720..62abb1b5 100644 --- a/logic/service/fight/effect/effect_87.go +++ b/logic/service/fight/effect/effect_87.go @@ -3,7 +3,6 @@ package effect import ( "blazing/logic/service/fight/input" "blazing/logic/service/fight/node" - "math" ) /** @@ -24,6 +23,6 @@ func (e *Effect87) OnSkill() bool { return true } - e.Ctx().Our.HealPP(math.MaxInt) + e.Ctx().Our.HealPP(-1) return true } diff --git a/logic/service/fight/input/fight.go b/logic/service/fight/input/fight.go index c60ad301..2a372443 100644 --- a/logic/service/fight/input/fight.go +++ b/logic/service/fight/input/fight.go @@ -72,9 +72,12 @@ func (our *Input) Heal(in *Input, ac action.BattleActionI, value decimal.Decimal func (our *Input) HealPP(value int) { for i := 0; i < len(our.CurrentPet.Info.SkillList); i++ { - - our.CurrentPet.Info.SkillList[i].PP += uint32(value) - our.CurrentPet.Info.SkillList[i].PP = utils.Min(our.CurrentPet.Info.SkillList[i].PP, uint32(xmlres.SkillMap[int(our.CurrentPet.Info.SkillList[i].ID)].MaxPP)) + if value == -1 { + our.CurrentPet.Info.SkillList[i].PP = uint32(xmlres.SkillMap[int(our.CurrentPet.Info.SkillList[i].ID)].MaxPP) + } else { + our.CurrentPet.Info.SkillList[i].PP += uint32(value) + our.CurrentPet.Info.SkillList[i].PP = utils.Min(our.CurrentPet.Info.SkillList[i].PP, uint32(xmlres.SkillMap[int(our.CurrentPet.Info.SkillList[i].ID)].MaxPP)) + } } diff --git a/logic/service/fight/loop.go b/logic/service/fight/loop.go index c3b2dea3..b4473e01 100644 --- a/logic/service/fight/loop.go +++ b/logic/service/fight/loop.go @@ -156,7 +156,11 @@ func (f *FightC) resolveRound(p1Action, p2Action action.BattleActionI) { f.GetInputByAction(a, false).CurrentPet.Info.Hp = 1 } if b2k, ok := b2.(*action.SelectSkillAction); ok { - f.waittime = b2k.CD + + if b2k.CD != nil { + f.waittime = *b2k.CD + } + f.enterturn(b2.(*action.SelectSkillAction), nil) } else { @@ -169,7 +173,9 @@ func (f *FightC) resolveRound(p1Action, p2Action action.BattleActionI) { f.GetInputByAction(a, false).CurrentPet.Info.Hp = 1 } if b2k, ok := b2.(*action.SelectSkillAction); ok { - f.waittime = b2k.CD + if b2k.CD != nil { + f.waittime = *b2k.CD + } f.enterturn(b2.(*action.SelectSkillAction), nil) } else { if a1, ok := b2.(*action.UseItemAction); ok { @@ -254,15 +260,25 @@ func (f *FightC) handleSkillActions(a1, a2 action.BattleActionI) { switch { case s1 == nil || s1.SkillEntity == nil: - f.waittime = s2.CD + if s2.CD != nil { + f.waittime = *s2.CD + } f.enterturn(s2, nil) fmt.Println("1 空过 2玩家执行技能:", s2.PlayerID, s2.Info.ID) case s2 == nil || s2.SkillEntity == nil: - f.waittime = s1.CD + if s1.CD != nil { + f.waittime = *s1.CD + } f.enterturn(s1, nil) fmt.Println("2 空过 玩家执行技能:", s1.PlayerID, s1.Info.ID) default: - f.waittime = s1.CD + s2.CD + if s1.CD != nil { + f.waittime = *s1.CD + } + if s2.CD != nil { + f.waittime += *s2.CD + } + f.enterturn(s1, s2) fmt.Println("玩家执行技能:", s1.PlayerID, s1.Info.ID, s2.PlayerID, s2.Info.ID) }