diff --git a/logic/controller/fight.go b/logic/controller/fight.go index 0d42187e..da198c24 100644 --- a/logic/controller/fight.go +++ b/logic/controller/fight.go @@ -78,7 +78,7 @@ func (h Controller) Escape(data *fight.EscapeFightInboundInfo, c *service.Player c.SendPack(ttt.Pack(&fight.FightOverInfo{ Reason: 0, })) - + c.FightC = nil }() return nil, 0 diff --git a/logic/service/fight.go b/logic/service/fight.go index 2bd95855..ddb08fc4 100644 --- a/logic/service/fight.go +++ b/logic/service/fight.go @@ -16,7 +16,7 @@ type PlayerI interface { SendNoteReadyToFightInfo(info.NoteReadyToFightInfo) } type FightC struct { - Info info.NoteReadyToFightInfo + Info *info.NoteReadyToFightInfo Our PlayerI Opp PlayerI } @@ -64,11 +64,8 @@ func (f *FightC) ReadyFight(c PlayerI) { } func (f *FightC) NewFight(i *info.NoteReadyToFightInfo, plays PlayerI) { f.Our = plays + f.Info = i - // t12, _ := uuid.NewV7() - // uuid := strings.Replace(t12.String(), "-", "", -1) //绑定战斗ID - // /FightCache[uuid] = i - //先发送战斗准备包 f.Info.FightId = i.FightId switch i.FightId { case 1: diff --git a/logic/service/fight/battle/effect/effect_1.go b/logic/service/fight/battle/effect/effect_1.go index 9080fd2a..5d0e1cb4 100644 --- a/logic/service/fight/battle/effect/effect_1.go +++ b/logic/service/fight/battle/effect/effect_1.go @@ -28,6 +28,7 @@ func (this *Effect1) ID() int { func (this *Effect1) PostDamage() bool { off := this.GetSkill().DamageValue.Div(decimal.NewFromInt(2)) //伤害的一半 - this.GetOwnerPet().Hp += uint32(off.IntPart()) //这里是effect在对方挂载,故回血给自己回血 + this.GetOwnerPet().HP += int(off.IntPart()) //这里是effect在对方挂载,故回血给自己回血 + //待重写实现 return true } diff --git a/logic/service/fight/battle/node/node.go b/logic/service/fight/battle/node/node.go index de4c3108..3182d3f1 100644 --- a/logic/service/fight/battle/node/node.go +++ b/logic/service/fight/battle/node/node.go @@ -19,6 +19,7 @@ type EffectNode struct { SideEffectArgs []int // 附加效果参数 Success bool // 是否执行成功 成功XXX,失败XXX + efftype int // 传出作用对象,默认0是自身,1是作用于对面 } @@ -26,6 +27,13 @@ func (this *EffectNode) ID() int { return 0 +} + +// 传出作用对象,默认0是自身,1是作用于对面 +func (this *EffectNode) Type() int { + + return this.efftype + } func (this *EffectNode) Stack(t int) int { if t != 0 { diff --git a/logic/service/fight/info.go b/logic/service/fight/cmd.go similarity index 100% rename from logic/service/fight/info.go rename to logic/service/fight/cmd.go diff --git a/logic/service/fight/info/BattlePetEntity.go b/logic/service/fight/info/BattlePetEntity.go index 8358245a..b06c858f 100644 --- a/logic/service/fight/info/BattlePetEntity.go +++ b/logic/service/fight/info/BattlePetEntity.go @@ -6,8 +6,6 @@ import ( "blazing/modules/blazing/model" "context" "sync" - - "github.com/tnnmigga/enum" ) // 战斗属性类型 @@ -17,16 +15,6 @@ type EnumAttrType int const Pet_O_Ctx = "PET_O" const Pet_T_Ctx = "PET_T" -var AttrType = enum.New[struct { - Attack EnumAttrType `enum:"1"` //`enum:"攻击"` - Defense EnumAttrType `enum:"2"` //`enum:"防御"` - SpecialAttack EnumAttrType `enum:"3"` //`enum:"特殊攻击"` - SpecialDefense EnumAttrType `enum:"4"` //`enum:"特殊防御"` - Speed EnumAttrType `enum:"5"` //`enum:"速度"` - Accuracy EnumAttrType `enum:"6"` //`enum:"命中率"` - HP EnumAttrType `enum:"7"` //血量 -}]() - // 属性封装结构:Ext 存储临时血量增量(key=状态ID,value=增量值) type Attribute struct { //CanSet bool // 是否允许修改 diff --git a/logic/service/fight/info/battle.go b/logic/service/fight/info/battle.go index 9a7a3520..fe3dfa37 100644 --- a/logic/service/fight/info/battle.go +++ b/logic/service/fight/info/battle.go @@ -12,7 +12,7 @@ type Battle struct { Round int //回合数 BattleMode EnumBattleMode //战斗模式 opposite []BattleInputSourceEntity //不同阵营 - Effects map[uint32]*NodeManagerE //挂载effect,实际上是给每个输入源,然后触发时候循环调用Effects , + Effects NodeManagerE //挂载effect,实际上是给每个输入源,然后触发时候循环调用Effects , //A的effect->触发死亡->这时候就应该调用对手的切换,实现effect62 }