From b9985bff3b6b2cffa72467222d1d87a2b55cd97b Mon Sep 17 00:00:00 2001 From: xinian Date: Fri, 13 Mar 2026 11:07:46 +0800 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=95=88?= =?UTF-8?q?=E6=9E=9C1146=E5=B9=B6=E4=BC=98=E5=8C=96=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logic/service/fight/effect/1146.go | 37 +++++++++++++++++++ .../effect_EffectConditionalAddDamage.go | 14 ++----- login/main.go | 1 + 3 files changed, 41 insertions(+), 11 deletions(-) create mode 100644 logic/service/fight/effect/1146.go diff --git a/logic/service/fight/effect/1146.go b/logic/service/fight/effect/1146.go new file mode 100644 index 000000000..4e8dfc036 --- /dev/null +++ b/logic/service/fight/effect/1146.go @@ -0,0 +1,37 @@ +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, 1146, &Effect1146{}) + +} + +type Effect1146 struct { + node.EffectNode +} + +func (e *Effect1146) OnSkill() bool { + // 1. 命中判定失败,不触发 + count := 0 + for _, v := range e.Ctx().Opp.Prop[:] { + if v > 0 { + count++ + } + + } + if count < e.SideEffectArgs[0] { + return true + } + + 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/effect/effect_EffectConditionalAddDamage.go b/logic/service/fight/effect/effect_EffectConditionalAddDamage.go index aea24cd90..0231de930 100644 --- a/logic/service/fight/effect/effect_EffectConditionalAddDamage.go +++ b/logic/service/fight/effect/effect_EffectConditionalAddDamage.go @@ -4,8 +4,6 @@ import ( "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" "blazing/logic/service/fight/node" - - "github.com/alpacahq/alpacadecimal" ) // ----------------------------------------------------------- @@ -68,11 +66,9 @@ func (e *EffectConditionalAddDamage) OnSkill() bool { return true } - // 4. 附加固定伤害(从SideEffectArgs[0]获取伤害值) - damageValue := alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0])) e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ Type: info.DamageType.Fixed, - Damage: damageValue, + Damage: e.Args()[0], }) return true @@ -105,10 +101,6 @@ func conditionIsAbnormal(e *EffectConditionalAddDamage) bool { // conditionPropDown:判断对方是否处于能力下降状态 func conditionPropDown(e *EffectConditionalAddDamage) bool { - for _, v := range e.Ctx().Opp.Prop { - if v < 0 { - return true - } - } - return false + + return e.Ctx().Opp.HasPropSub() } diff --git a/login/main.go b/login/main.go index 7c3e7d1b2..b1ce5a9d9 100644 --- a/login/main.go +++ b/login/main.go @@ -42,6 +42,7 @@ func init() { } func main() { + // fight.TestSKill() // // 初始化根结构体 // var root Root From 0d44de2ea7774d54ff90fc4471f864ec3fe9b9ad Mon Sep 17 00:00:00 2001 From: xinian Date: Fri, 13 Mar 2026 12:04:35 +0800 Subject: [PATCH 2/6] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DPVP=E8=B5=9B?= =?UTF-8?q?=E5=AD=A3=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84=E5=8F=8A=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/rpc/user.go | 6 +++--- common/utils/help.go | 16 ++++++++++++++++ modules/player/model/pvp.go | 12 +++++------- modules/player/service/info.go | 3 ++- modules/player/service/pet.go | 8 +++++++- modules/player/service/talk.go | 3 ++- modules/player/service/task.go | 15 --------------- 7 files changed, 35 insertions(+), 28 deletions(-) diff --git a/common/rpc/user.go b/common/rpc/user.go index db541cbb6..25649736d 100644 --- a/common/rpc/user.go +++ b/common/rpc/user.go @@ -22,16 +22,16 @@ func (r *RPCfight) join(pvp info.RPCFightinfo) { ret := service.NewPVPService(pvp.PlayerID).Get(pvp.PlayerID) score := 800 if ret != nil { - score = int(ret.RankInfo.Score) + score = int(ret.RankInfo[len(ret.RankInfo)-1].Score) } r.zs.Add(pvp.PlayerID, ret) if r.zs.Length() > 2 { - u, s := r.zs.FindPrev(func(i *model.PVP) bool { return i.RankInfo.Score > score }) + u, s := r.zs.FindPrev(func(i *model.PVP) bool { return i.RankInfo[len(ret.RankInfo)-1].Score > score }) diff := s - score // 等待越久,允许区间越大 - wait := time.Now().Sub(u.RankInfo.LastMatchTime.Time).Seconds() + wait := time.Now().Sub(u.RankInfo[len(ret.RankInfo)-1].LastMatchTime.Time).Seconds() maxAllow := 100 + int(wait)*10 if diff < maxAllow { //找到上一个,如果区间分数少于一定, diff --git a/common/utils/help.go b/common/utils/help.go index 799f33c88..b35cf44be 100644 --- a/common/utils/help.go +++ b/common/utils/help.go @@ -6,10 +6,26 @@ import ( "math/rand/v2" "time" + "github.com/gogf/gf/v2/os/gtime" "github.com/gogf/gf/v2/util/gconv" "github.com/gogf/gf/v2/util/grand" ) +// IsToday 判断给定时间是否是今天 +func IsToday(t1 *gtime.Time) bool { + if t1 == nil { + return false + } + t := t1.Time + + // 获取当前时间 + now := time.Now() + + // 比较年、月、日是否相同 + return t.Year() == now.Year() && + t.Month() == now.Month() && + t.Day() == now.Day() +} func FindWithIndex[T any](slice []T, predicate func(item T) bool) (int, *T, bool) { for i := range slice { if predicate(slice[i]) { diff --git a/modules/player/model/pvp.go b/modules/player/model/pvp.go index 85d5f791d..53d1137e0 100644 --- a/modules/player/model/pvp.go +++ b/modules/player/model/pvp.go @@ -15,10 +15,8 @@ const TableNamePlayerPVP = "player_pvp" type PVP struct { *cool.Model PlayerID uint64 `gorm:"not null;index:idx_pvp_player_id;comment:'所属玩家ID'" json:"player_id"` - - SeasonData []PVPRankInfo `gorm:"type:jsonb;not null;comment:'赛季核心数据'" json:"season_data"` - - RankInfo PVPRankInfo `gorm:"type:jsonb;not null;comment:'本赛季排名信息'" json:"rank_info"` + //本赛季排名信息'通过下标来确认当前赛季 + RankInfo []PVPRankInfo `gorm:"type:jsonb;not null;comment:'赛季核心数据'" json:"season_data"` } func (u *PVP) Key() uint32 { @@ -27,10 +25,10 @@ func (u *PVP) Key() uint32 { // 如果分数不对的话,就按时间排序 func (u *PVP) Less(than *PVP) bool { - if u.RankInfo.Score == than.RankInfo.Score { - return u.RankInfo.LastMatchTime.Unix() < than.RankInfo.LastMatchTime.Unix() + if u.RankInfo[len(u.RankInfo)-1].Score == than.RankInfo[len(u.RankInfo)-1].Score { + return u.RankInfo[len(u.RankInfo)-1].LastMatchTime.Unix() < than.RankInfo[len(u.RankInfo)-1].LastMatchTime.Unix() } - return u.RankInfo.Score < than.RankInfo.Score + return u.RankInfo[len(u.RankInfo)-1].Score < than.RankInfo[len(u.RankInfo)-1].Score } func NewPVP() *PVP { return &PVP{ diff --git a/modules/player/service/info.go b/modules/player/service/info.go index ecd1d98dd..e58aa7276 100644 --- a/modules/player/service/info.go +++ b/modules/player/service/info.go @@ -2,6 +2,7 @@ package service import ( "blazing/common/data/share" + "blazing/common/utils" "blazing/cool" "blazing/modules/config/service" "blazing/modules/player/model" @@ -93,7 +94,7 @@ func (s *InfoService) GetLogin() *model.PlayerInfo { } - if !IsToday(tt.LastResetTime) && cool.Config.ServerInfo.IsVip == 0 { //判断是否是今天 + if !utils.IsToday(tt.LastResetTime) && cool.Config.ServerInfo.IsVip == 0 { //判断是否是今天 //每天login时候检查重置时间,然后把电池,任务,挖矿重置 //挖矿需要单独存,因为防止多开挖矿 diff --git a/modules/player/service/pet.go b/modules/player/service/pet.go index ab639e04a..a97a08f30 100644 --- a/modules/player/service/pet.go +++ b/modules/player/service/pet.go @@ -1,6 +1,7 @@ package service import ( + "blazing/common/utils" "blazing/cool" basemodel "blazing/modules/base/model" "blazing/modules/base/service" @@ -56,7 +57,11 @@ func (s *PetService) UPdatePrice(ctime uint32, Price uint32, is_sale uint32) err return fmt.Errorf("精灵数量已满") } } - + var p model.Pet + s.dbm(s.Model).Where("catch_time", ctime).Scan(&p) + if p.SalePrice != Price && utils.IsToday(p.UpdateTime) { //说明要修改价格 + return fmt.Errorf("一天只允许改价一次") + } res0, err := s.dbm(s.Model). Where("catch_time", ctime). // 限定 ctime,避免全表更新 Where("sale_price = ?", 0). // 只筛选 sale_price=0 的记录 @@ -145,6 +150,7 @@ RETURNING max_ts; player.Data = tt.Data player.CatchTime = tt.CatchTime player.Free = 0 + player.SalePrice = tt.SalePrice player.SaleCount = tt.SaleCount + 1 player.IsVip = cool.Config.ServerInfo.IsVip diff --git a/modules/player/service/talk.go b/modules/player/service/talk.go index 864cd8525..23e17481e 100644 --- a/modules/player/service/talk.go +++ b/modules/player/service/talk.go @@ -1,6 +1,7 @@ package service import ( + "blazing/common/utils" "blazing/cool" config "blazing/modules/config/service" "blazing/modules/player/model" @@ -35,7 +36,7 @@ func (s *TalkService) Cheak(mapid uint32, flag int) (int, bool) { } //因为这个是挖一次更新一次,而且是实时更新的,如果更新日期是今天,那么就可以确认不用再重置,否则就需要重置挖矿记录 - if !IsToday(talks.UpdateTime) { + if !utils.IsToday(talks.UpdateTime) { talks.Count = 0 m1.Save(talks) diff --git a/modules/player/service/task.go b/modules/player/service/task.go index 35da22cb5..7bc8d224b 100644 --- a/modules/player/service/task.go +++ b/modules/player/service/task.go @@ -65,21 +65,6 @@ func (s *TaskService) Exec(id uint32, t func(*model.Task) bool) { } -// IsToday 判断给定时间是否是今天 -func IsToday(t1 *gtime.Time) bool { - if t1 == nil { - return false - } - t := t1.Time - - // 获取当前时间 - now := time.Now() - - // 比较年、月、日是否相同 - return t.Year() == now.Year() && - t.Month() == now.Month() && - t.Day() == now.Day() -} func IsWEEK(t1 *gtime.Time) bool { if t1 == nil { return false From faad50b1df370d92945e06290bc985e53beb56e4 Mon Sep 17 00:00:00 2001 From: xinian Date: Fri, 13 Mar 2026 16:05:43 +0800 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=88=98?= =?UTF-8?q?=E6=96=97=E6=8A=80=E8=83=BD=E6=95=88=E6=9E=9C=E5=B9=B6=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=88=9D=E5=A7=8B=E5=8C=96=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logic/service/fight/effect/430.go | 2 +- logic/service/fight/effect/445.go | 14 ------- logic/service/fight/effect/446_626.go | 39 +++++++++++++++++++ logic/service/fight/effect/470.go | 2 +- logic/service/fight/effect/513.go | 27 ++++++++++++- .../{addlevel.go => effect_addlevel.go} | 10 ++++- .../service/fight/effect/{201.go => none.go} | 24 +++++++++++- logic/service/fight/node/node.go | 5 ++- 8 files changed, 102 insertions(+), 21 deletions(-) delete mode 100644 logic/service/fight/effect/445.go create mode 100644 logic/service/fight/effect/446_626.go rename logic/service/fight/effect/{addlevel.go => effect_addlevel.go} (95%) rename logic/service/fight/effect/{201.go => none.go} (55%) diff --git a/logic/service/fight/effect/430.go b/logic/service/fight/effect/430.go index eeb8cc6c3..44df28216 100644 --- a/logic/service/fight/effect/430.go +++ b/logic/service/fight/effect/430.go @@ -36,6 +36,6 @@ func (e *Effect430) Skill_Use() bool { } func init() { - input.InitEffect(input.EffectType.Skill, 184, &Effect184{}) + input.InitEffect(input.EffectType.Skill, 430, &Effect430{}) } diff --git a/logic/service/fight/effect/445.go b/logic/service/fight/effect/445.go deleted file mode 100644 index 7ed1459fc..000000000 --- a/logic/service/fight/effect/445.go +++ /dev/null @@ -1,14 +0,0 @@ -package effect - -import "blazing/logic/service/fight/node" - -// 445 - 使用后在战斗结束时可以获得500赛尔豆,每日上限5000 -type Effect445 struct { - node.EffectNode -} - -// func (e *Effect445) OnSkill() bool { -// // 这个效果需要在战斗结束后执行,暂时记录奖励 -// e.Ctx().Our.EndReward = 500 -// return true -// } diff --git a/logic/service/fight/effect/446_626.go b/logic/service/fight/effect/446_626.go new file mode 100644 index 000000000..bf4ea5d8f --- /dev/null +++ b/logic/service/fight/effect/446_626.go @@ -0,0 +1,39 @@ +package effect + +import ( + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" + + "github.com/gogf/gf/v2/util/grand" +) + +// "id": 446, +// "argsNum": 0, +// "info": "随机自身3项属性+1" + +// { +// "id": 626, +// "argsNum": 2, +// "info": "随机使自己{0}项能力+{1}" +// }, +// +// 626 - 消除对手能力强化状态,若消除状态成功,则自身XX等级m +type Effect626 struct { + node.EffectNode +} + +func (e *Effect626) Skill_Use() bool { + + for i := 0; i < e.SideEffectArgs[0]; i++ { + e.Ctx().Our.SetProp(e.Ctx().Our, int8(grand.Intn(6)), int8(e.SideEffectArgs[1])) + } + + return true +} + +func init() { + input.InitEffect(input.EffectType.Skill, 626, &Effect626{}) + t := &Effect626{} + t.SideEffectArgs = []int{3, 1} + input.InitEffect(input.EffectType.Skill, 446, t) +} diff --git a/logic/service/fight/effect/470.go b/logic/service/fight/effect/470.go index 96c218aad..cb8312b82 100644 --- a/logic/service/fight/effect/470.go +++ b/logic/service/fight/effect/470.go @@ -33,6 +33,6 @@ func (e *Effect470) SetArgs(t *input.Input, a ...int) { e.EffectNode.Duration(a[0]) // 持续n回合 } func init() { - input.InitEffect(input.EffectType.Skill, 513, &Effect513{}) + input.InitEffect(input.EffectType.Skill, 470, &Effect470{}) } diff --git a/logic/service/fight/effect/513.go b/logic/service/fight/effect/513.go index d37e84493..c56bce22c 100644 --- a/logic/service/fight/effect/513.go +++ b/logic/service/fight/effect/513.go @@ -38,5 +38,30 @@ func (e *Effect513) SkillHit() bool { } func init() { input.InitEffect(input.EffectType.Skill, 513, &Effect513{}) - + input.InitEffect(input.EffectType.Skill, 544, &Effect544{}) +} + +type Effect544 struct { + node.EffectNode +} + +func (e *Effect544) Skill_Use() bool { + if e.Ctx().SkillEntity == nil { + return true + } + stas := []info.EnumPetStatus{ + info.PetStatus.Burned, + info.PetStatus.Poisoned, + info.PetStatus.Frozen, + } + + for _, sta := range stas { + if e.Ctx().Our.StatEffect_Exist(sta) { + + r := e.Ctx().Our.GetEffect(input.EffectType.Status, int(sta)) + r.Alive(false) + } + } + + return true } diff --git a/logic/service/fight/effect/addlevel.go b/logic/service/fight/effect/effect_addlevel.go similarity index 95% rename from logic/service/fight/effect/addlevel.go rename to logic/service/fight/effect/effect_addlevel.go index adada21c6..67193d381 100644 --- a/logic/service/fight/effect/addlevel.go +++ b/logic/service/fight/effect/effect_addlevel.go @@ -102,7 +102,7 @@ func init() { input.InitEffect(input.EffectType.Skill, 497, &Effect429{ ispower: true, }) - input.InitEffect(input.EffectType.Skill, 497, &Effect429{}) + input.InitEffect(input.EffectType.Skill, 429, &Effect429{}) } // 497 - 附加m点固定伤害,每次使用额外附加n点,最高k点,遇到天敌时效果翻倍 @@ -150,6 +150,10 @@ func (e *Effect181) Skill_Use() bool { return true } +func init() { + + input.InitEffect(input.EffectType.Skill, 441, &Effect441{}) +} // 441 - 每次攻击提升n%的致命几率,最高提升m% type Effect441 struct { @@ -171,6 +175,10 @@ func (e *Effect441) ActionStart(a, b *action.SelectSkillAction) bool { return true } +func init() { + + input.InitEffect(input.EffectType.Skill, 465, &Effect465{}) +} // 465 - m%令对手疲惫n回合,每次使用几率提升x%,最高y% type Effect465 struct { diff --git a/logic/service/fight/effect/201.go b/logic/service/fight/effect/none.go similarity index 55% rename from logic/service/fight/effect/201.go rename to logic/service/fight/effect/none.go index 1174f71eb..23c8b0e9f 100644 --- a/logic/service/fight/effect/201.go +++ b/logic/service/fight/effect/none.go @@ -1,9 +1,25 @@ package effect import ( + "blazing/logic/service/fight/input" "blazing/logic/service/fight/node" ) +// 445 - 使用后在战斗结束时可以获得500赛尔豆,每日上限5000 +type Effect445 struct { + node.EffectNode +} + +// func (e *Effect445) OnSkill() bool { +// // 这个效果需要在战斗结束后执行,暂时记录奖励 +// e.Ctx().Our.EndReward = 500 +// return true +// } +func init() { + input.InitEffect(input.EffectType.Skill, 445, &Effect445{}) + +} + // 201 - 组队时恢复己方1/n的体力 type Effect201 struct { node.EffectNode @@ -25,5 +41,9 @@ type Effect201 struct { // } // } -// return true -// } +// return true +// } +func init() { + input.InitEffect(input.EffectType.Skill, 201, &Effect201{}) + +} diff --git a/logic/service/fight/node/node.go b/logic/service/fight/node/node.go index 67fc164f1..c603194b7 100644 --- a/logic/service/fight/node/node.go +++ b/logic/service/fight/node/node.go @@ -109,7 +109,10 @@ func (e *EffectNode) Duration(t ...int) int { // 设置参数,加上设置输入源 func (e *EffectNode) SetArgs(t *input.Input, a ...int) { e.Input = t - e.SideEffectArgs = a + if len(a)>0 { + e.SideEffectArgs = a + } + } func (e *EffectNode) Args() []alpacadecimal.Decimal { From 49b8b6d3011ee0b6876f2e9fccb55ebcefb2c947 Mon Sep 17 00:00:00 2001 From: xinian Date: Fri, 13 Mar 2026 16:06:49 +0800 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=94=B9=E4=BB=B7?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=88=A4=E6=96=AD=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/player/service/pet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/player/service/pet.go b/modules/player/service/pet.go index a97a08f30..62d5d0807 100644 --- a/modules/player/service/pet.go +++ b/modules/player/service/pet.go @@ -59,7 +59,7 @@ func (s *PetService) UPdatePrice(ctime uint32, Price uint32, is_sale uint32) err } var p model.Pet s.dbm(s.Model).Where("catch_time", ctime).Scan(&p) - if p.SalePrice != Price && utils.IsToday(p.UpdateTime) { //说明要修改价格 + if p.SalePrice!=0&&p.SalePrice != Price && utils.IsToday(p.UpdateTime) { //说明要修改价格 return fmt.Errorf("一天只允许改价一次") } res0, err := s.dbm(s.Model). From 23649b2c20195622f27611f5db5a5fbbc5226390 Mon Sep 17 00:00:00 2001 From: xinian Date: Fri, 13 Mar 2026 21:31:49 +0800 Subject: [PATCH 5/6] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=20Effect71=20?= =?UTF-8?q?=E6=8A=80=E8=83=BD=E9=80=BB=E8=BE=91=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logic/service/fight/effect/selfkill.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/logic/service/fight/effect/selfkill.go b/logic/service/fight/effect/selfkill.go index 4bc63c97a..0e6e6e248 100644 --- a/logic/service/fight/effect/selfkill.go +++ b/logic/service/fight/effect/selfkill.go @@ -90,12 +90,13 @@ func (e *Effect71) ActionStart(a, b *action.SelectSkillAction) bool { if e.Ctx().SkillEntity.Category() == info.Category.STATUS { return true } + + e.Ctx().SkillEntity.XML.CritRate = 16 + e.count-- if e.count <= 0 { e.Alive(false) - } - e.count-- - e.Ctx().SkillEntity.XML.CritRate = 16 + } return true } func init() { From 5bd32c61c25ac851c4ac7c755f8a1378bfc63735 Mon Sep 17 00:00:00 2001 From: xinian Date: Fri, 13 Mar 2026 21:48:30 +0800 Subject: [PATCH 6/6] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=95=88?= =?UTF-8?q?=E6=9E=9C526=E5=92=8C542=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logic/service/fight/effect/469.go | 30 ++++++++++++++++++++++- logic/service/fight/effect/542.go | 40 +++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 logic/service/fight/effect/542.go diff --git a/logic/service/fight/effect/469.go b/logic/service/fight/effect/469.go index 49b25b3bd..ac1b0a5f1 100644 --- a/logic/service/fight/effect/469.go +++ b/logic/service/fight/effect/469.go @@ -34,5 +34,33 @@ func (e *Effect469) SetArgs(t *input.Input, a ...int) { } func init() { input.InitEffect(input.EffectType.Skill, 469, &Effect469{}) - + input.InitEffect(input.EffectType.Skill, 526, &Effect526{}) +} + +// { +// "id": 526, +// "argsNum": 2, +// "info": "{0}回合内若对手成功使用属性技能则受到{1}点固定伤害" +// }, +// +// 469 - m回合内若对手使用属性技能则n%几率另对手XX +type Effect526 struct { + node.EffectNode +} + +func (e *Effect526) Skill_Use_ex() bool { + if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() == info.Category.STATUS { + + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Fixed, + Damage: e.Args()[0], + }) + } + + return true +} + +func (e *Effect526) SetArgs(t *input.Input, a ...int) { + e.EffectNode.SetArgs(t, a...) + e.EffectNode.Duration(a[0]) // 持续m回合 } diff --git a/logic/service/fight/effect/542.go b/logic/service/fight/effect/542.go new file mode 100644 index 000000000..736dd57a7 --- /dev/null +++ b/logic/service/fight/effect/542.go @@ -0,0 +1,40 @@ +package effect + +import ( + "blazing/logic/service/fight/info" + "blazing/logic/service/fight/input" + "blazing/logic/service/fight/node" + + "github.com/alpacahq/alpacadecimal" +) + +// { +// "id": 542, +// "argsNum": 1, +// "info": "对手每处于一种能力下降状态时附加{0}点固定伤害" +// }, +type Effect542 struct { + node.EffectNode +} + +func (e *Effect542) Skill_Use() bool { + + r := alpacadecimal.Zero + for _, v := range e.Ctx().Opp.Prop[:] { + if v < 0 { + r.Add(alpacadecimal.NewFromInt(1)) + + } + + } + e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ + Type: info.DamageType.Fixed, + Damage: e.Args()[0].Mul(r), + }) + + return true +} +func init() { + input.InitEffect(input.EffectType.Skill, 542, &Effect542{}) + +}