diff --git a/logic/controller/fight_boss野怪和地图怪.go b/logic/controller/fight_boss野怪和地图怪.go index a5c4f59b..5efcaea1 100644 --- a/logic/controller/fight_boss野怪和地图怪.go +++ b/logic/controller/fight_boss野怪和地图怪.go @@ -61,7 +61,15 @@ func (Controller) PlayerFightBoss(data1 *fight.ChallengeBossInboundInfo, p *play int(bm.Lv), nil, 0) monster.CatchTime = uint32(i) monster.ConfigBoss(bm.PetBaseConfig) + effects := service.NewEffectService().Args(bm.Effect) + for _, v := range effects { + monster.EffectInfo = append(monster.EffectInfo, model.PetEffectInfo{ + Idx: uint16(v.SeIdx), + EID: gconv.Uint16(v.Eid), + Args: gconv.Ints(v.Args), + }) + } monsterInfo.PetList = append(monsterInfo.PetList, *monster) } if bosinfo[0].IsCapture == 1 { diff --git a/logic/service/fight/effect/effct_122.go b/logic/service/fight/effect/effct_122.go new file mode 100644 index 00000000..c7fb02de --- /dev/null +++ b/logic/service/fight/effect/effct_122.go @@ -0,0 +1,59 @@ +package effect + +import ( + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" +) + +func init() { + + input.InitEffect(input.EffectType.Skill, 122, &Effect122{ + isfrist: true, + rev: true, + }) + input.InitEffect(input.EffectType.Skill, 148, &Effect122{ + isfrist: false, + rev: true, + }) + input.InitEffect(input.EffectType.Skill, 588, &Effect122{ + isfrist: true, + rev: false, + }) + input.InitEffect(input.EffectType.Skill, 186, &Effect122{ + isfrist: false, + rev: false, + }) +} + +// ----------------------------------------------------------- +// 效果122:先出手时,{1}%改变对方{0}等级{2} +// ----------------------------------------------------------- +type Effect122 struct { + node.EffectNode + isfrist bool + rev bool +} + +func (e *Effect122) OnSkill() bool { + + if e.Input.FightC.IsFirst(e.Input.Player) == e.isfrist { + propIndex := int(e.Args()[0].IntPart()) + chance := int(e.Args()[1].IntPart()) + changeAmount := int(e.Args()[2].IntPart()) + + ok, _, _ := e.Input.Player.Roll(chance, 100) + if ok { + + if e.rev { + + e.Ctx().Opp.SetProp(e.Ctx().Our, int8(propIndex), int8(changeAmount), info.AbilityOpType.SUB) + } else { + e.Ctx().Our.SetProp(e.Ctx().Our, int8(propIndex), int8(changeAmount), info.AbilityOpType.ADD) + } + + } + + } + return true +} diff --git a/logic/service/fight/effect/effect_119_123.go b/logic/service/fight/effect/effect_119_123.go index ec2837e8..f22f1556 100644 --- a/logic/service/fight/effect/effect_119_123.go +++ b/logic/service/fight/effect/effect_119_123.go @@ -119,41 +119,6 @@ func (e *Effect121) OnSkill() bool { return true } -// ----------------------------------------------------------- -// 效果122:先出手时,{1}%改变对方{0}等级{2} -// ----------------------------------------------------------- -type Effect122 struct { - node.EffectNode - can bool -} - -func (e *Effect122) SkillHit() bool { - if e.Input.FightC.IsFirst(e.Input.Player) { - e.can = true - } - return true -} - -func (e *Effect122) OnSkill() bool { - - if e.can { - propIndex := int(e.Args()[0].IntPart()) - chance := int(e.Args()[1].IntPart()) - changeAmount := int(e.Args()[2].IntPart()) - - ok, _, _ := e.Input.Player.Roll(chance, 100) - if ok { - opType := info.AbilityOpType.ADD - if changeAmount < 0 { - opType = info.AbilityOpType.SUB - } - e.Ctx().Opp.SetProp(e.Ctx().Our, int8(propIndex), int8(changeAmount), opType) - } - e.can = false - } - return true -} - // ----------------------------------------------------------- // 效果123:{0}回合内受到任何伤害,自身{1}提高{2}个等级 // ----------------------------------------------------------- @@ -191,6 +156,6 @@ func init() { input.InitEffect(input.EffectType.Skill, 119, &Effect119{}) input.InitEffect(input.EffectType.Skill, 120, &Effect120{}) input.InitEffect(input.EffectType.Skill, 121, &Effect121{}) - input.InitEffect(input.EffectType.Skill, 122, &Effect122{}) + input.InitEffect(input.EffectType.Skill, 123, &Effect123{}) } diff --git a/logic/service/fight/effect/effect_164.go b/logic/service/fight/effect/effect_164.go new file mode 100644 index 00000000..0ef5a758 --- /dev/null +++ b/logic/service/fight/effect/effect_164.go @@ -0,0 +1,47 @@ +package effect + +import ( + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" +) + +type Effect164 struct { + node.EffectNode +} + +func (e *Effect164) SetArgs(t *input.Input, a ...int) { + + e.EffectNode.SetArgs(t, a...) + e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0]) + +} +func (e *Effect164) ActionEndEx() bool { + //魂印特性有不在场的情况,绑定时候将精灵和特性绑定 + if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { + return true + } + if e.Ctx().SkillEntity == nil { + return true + } + + // 3. 概率判定(Args()[1]为触发概率) + success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) + if !success { + return true + } + + // 5. 获取状态效果实例并设置参数 + statusEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(e.Args()[2].IntPart())) + if statusEffect == nil { + return true + } + + // 6. 给对手添加状态 + //然后这里是被动添加,所以对方不能消除 + e.Ctx().Opp.AddEffect(e.Ctx().Our, statusEffect) + + return true +} +func init() { + input.InitEffect(input.EffectType.Skill, 164, &Effect164{}) +} diff --git a/logic/service/fight/effect/effect_405_402.go b/logic/service/fight/effect/effect_405_402.go new file mode 100644 index 00000000..5b103946 --- /dev/null +++ b/logic/service/fight/effect/effect_405_402.go @@ -0,0 +1,36 @@ +package effect + +import ( + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" +) + +func init() { + + input.InitEffect(input.EffectType.Skill, 405, &Effect405{ + EffectNode: node.EffectNode{}, + isfrist: true, + }) + input.InitEffect(input.EffectType.Skill, 402, &Effect405{ + EffectNode: node.EffectNode{}, + isfrist: false, + }) +} + +type Effect405 struct { + node.EffectNode + isfrist bool +} + +func (e *Effect405) OnSkill() bool { + + if e.Input.FightC.IsFirst(e.Input.Player) == e.isfrist { + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Fixed, + Damage: e.Ctx().Opp.CurrentPet.GetHP().Div(e.Args()[0]), + }) + } + + return true +} diff --git a/logic/service/fight/effect/effect_467.go b/logic/service/fight/effect/effect_467.go new file mode 100644 index 00000000..934c3b26 --- /dev/null +++ b/logic/service/fight/effect/effect_467.go @@ -0,0 +1,33 @@ +package effect + +import ( + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" +) + +/** + * 467 + */ + +func init() { + + input.InitEffect(input.EffectType.Skill, 467, &Effect467{}) + +} + +type Effect467 struct { + node.EffectNode +} + +func (e *Effect467) OnSkill() bool { + + if e.Ctx().Our.StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) { + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Fixed, + Damage: e.Args()[1], + }) + } + + return true +} diff --git a/logic/service/fight/init.go b/logic/service/fight/init.go new file mode 100644 index 00000000..51803516 --- /dev/null +++ b/logic/service/fight/init.go @@ -0,0 +1,43 @@ +package fight + +import ( + "blazing/common/data/xmlres" + "blazing/logic/service/fight/input" + + "github.com/gogf/gf/v2/frame/g" +) + +func TestSKill() { + // var root xmlres.Monsters + + // // // 解析XML字符串 + // err := xml.Unmarshal(gfile.GetBytes("/public/binaryData/69_com.robot.core.config.xml.PetXMLInfo_xmlClass_com.robot.core.config.xml.PetXMLInfo_xmlClass.bin"), &root) + // if err != nil { + // panic(err) + // } + var skimap = make(map[int]int) + for _, v := range xmlres.PetMAP { + if v.ID > 2000 { + continue + } + for _, v1 := range v.LearnableMoves.Moves { + for _, v3 := range xmlres.SkillMap[int(v1.ID)].SideEffectS { + t := input.Geteffect(input.EffectType.Skill, v3) + if t == nil { + k, ok := skimap[v3] + if ok { + skimap[v3] = k + 1 + } else { + + skimap[v3] = 1 + } + //println("技能效果不存在", v3) + } + } + + } + + } + + g.Dump(skimap) +} diff --git a/logic/service/fight/input/input.go b/logic/service/fight/input/input.go index 0310d546..7ba7381b 100644 --- a/logic/service/fight/input/input.go +++ b/logic/service/fight/input/input.go @@ -267,9 +267,6 @@ func (our *Input) Parseskill(skill *action.SelectSkillAction) { // t.Alive() //先让效果保持存活 our.EffectCache = append(our.EffectCache, t) // i.NewEffects = append(i.NewEffects, t) - } else { - println("技能效果不存在", v) - } temparg = temparg[args:] diff --git a/login/main.go b/login/main.go index 571934d1..fad65e39 100644 --- a/login/main.go +++ b/login/main.go @@ -42,6 +42,7 @@ func init() { } func main() { + //fight.TestSKill() // // 初始化根结构体 // var root Root diff --git a/modules/player/model/pet.go b/modules/player/model/pet.go index 6b8908ec..49a34c18 100644 --- a/modules/player/model/pet.go +++ b/modules/player/model/pet.go @@ -153,15 +153,7 @@ func (pet *PetInfo) ConfigBoss(bm model.PetBaseConfig) { } } - effects := service.NewEffectService().Args(bm.Effect) - for _, v := range effects { - pet.EffectInfo = append(pet.EffectInfo, PetEffectInfo{ - Idx: uint16(v.SeIdx), - EID: gconv.Uint16(v.Eid), - Args: gconv.Ints(v.Args), - }) - } } func (pet *PetInfo) Type() int {