1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-02-08 17:57:42 +08:00
parent 2edd1ba852
commit ffe3ff18bf
25 changed files with 180 additions and 117 deletions

View File

@@ -21,7 +21,7 @@ func (e *NewSel69) DamageAdd(t *info.DamageZone) bool {
}
// 检查对手性别
if e.Ctx().Opp.CurrentPet.Gender != int(e.Args()[0].IntPart()) {
if e.Ctx().Opp.CurrentPet.Info.Gender != int(e.Args()[0].IntPart()) {
return true
}

View File

@@ -18,7 +18,7 @@ type Effect130 struct {
func (e *Effect130) OnSkill() bool {
// 1. 命中判定失败,不触发
if e.Ctx().Opp.CurrentPet.PetInfo.Gender != int(e.Args()[0].IntPart()) {
if e.Ctx().Opp.CurrentPet.Info.Gender != int(e.Args()[0].IntPart()) {
return true
}
// 4. 附加固定伤害从SideEffectArgs[0]获取伤害值)

View File

@@ -34,7 +34,7 @@ func (e *Effect131) DamageLockEx(t *info.DamageZone) bool {
// 4. 对比对手性别与目标性别,匹配则免疫伤害
// 注需确保BattlePetEntity的Gender字段类型为int/int8与xGender类型匹配
if int(e.Ctx().Opp.CurrentPet.Gender) == int(xGender) {
if int(e.Ctx().Opp.CurrentPet.Info.Gender) == int(xGender) {
// 将伤害置为0实现当前回合伤害免疫
t.Damage = alpacadecimal.Zero
}

View File

@@ -35,7 +35,7 @@ func (e *Effect83) ComparePre(fattack *action.SelectSkillAction, sattack *action
return true
}
if e.Ctx().Our.CurrentPet.Gender != 1 {
if e.Ctx().Our.CurrentPet.Info.Gender != 1 {
return true
}
@@ -70,7 +70,7 @@ func (e *Effect83) ActionStart(a, b *action.SelectSkillAction) bool {
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
return true
}
if e.Ctx().Our.CurrentPet.Gender != 2 {
if e.Ctx().Our.CurrentPet.Info.Gender != 2 {
return true
}

View File

@@ -25,7 +25,7 @@ type Effect98 struct {
func (e *Effect98) Damage_Mul(t *info.DamageZone) bool {
if e.Ctx().Opp.CurrentPet.Gender != 1 {
if e.Ctx().Opp.CurrentPet.Info.Gender != 1 {
return true
}

View File

@@ -95,7 +95,7 @@ func conditionIsFrozen(e *EffectConditionalAddDamage) bool {
// conditionIsTypeX判断对方是否为X属性对方为X性则附加n点伤害
func conditionIsTypeX(e *EffectConditionalAddDamage) bool {
// 示例假设Args[0]为目标属性值,判断对方属性是否匹配
return e.Ctx().Opp.CurrentPet.PetInfo.Gender == int(e.Args()[0].IntPart())
return e.Ctx().Opp.CurrentPet.Info.Gender == int(e.Args()[0].IntPart())
}
// conditionIsAbnormal判断对方是否处于任意异常状态

View File

@@ -89,7 +89,7 @@ type Effect129 struct {
}
func (e *Effect129) SkillHit() bool {
if e.Ctx().Opp.CurrentPet.Gender != e.SideEffectArgs[0] {
if e.Ctx().Opp.CurrentPet.Info.Gender != e.SideEffectArgs[0] {
return true
}
e.Ctx().SkillEntity.Power *= 2

View File

@@ -170,7 +170,7 @@ func (f *FightC) initplayer(c common.PlayerI) (*input.Input, errorcode.ErrorCode
// effect = int(v.Effect[0])
// }
pet := model.GenPetInfo(int(v.MonID), 24, int(v.Nature), int(v.Effect[0]), int(v.Lv), nil)
pet := model.GenPetInfo(int(v.MonID), 24, int(v.Nature), int(v.Effect[0]), int(v.Lv), nil, 0)
var color data.GlowFilter
err := json.Unmarshal([]byte(v.Color), &color)
if err == nil {

View File

@@ -66,9 +66,9 @@ func (p *Player) GenMonster() {
lv := strings.Split(m.Lv, " ")
p.OgreInfo.Data[i] = OgrePetInfo{}
p.OgreInfo.Data[i].Id = gconv.Uint32(RandomStringFromSlice(id))
p.OgreInfo.Data[i].ID = gconv.Uint32(RandomStringFromSlice(id))
if p.OgreInfo.Data[i].Id != 0 {
if p.OgreInfo.Data[i].ID != 0 {
p.OgreInfo.Data[i].Lv = gconv.Uint32(RandomStringFromSlice(lv))
@@ -88,7 +88,7 @@ func (p *Player) GenMonster() {
if cool.Config.ServerInfo.IsVip != 0 { //测试服,百分百异色
p.OgreInfo.Data[i].FixSHiny()
}
if xmlres.PetMAP[int(p.OgreInfo.Data[i].Id)].CatchRate != 0 && grand.Meet(3, 1000) {
if xmlres.PetMAP[int(p.OgreInfo.Data[i].ID)].CatchRate != 0 && grand.Meet(3, 1000) {
p.OgreInfo.Data[i].RandSHiny()
}
if ok {

View File

@@ -18,6 +18,8 @@ import (
blservice "blazing/modules/player/service"
"context"
"blazing/modules/config/model"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/util/gconv"
csmap "github.com/mhmtszr/concurrent-swiss-map"
@@ -28,7 +30,7 @@ import (
var Mainplayer = csmap.New[uint32, *Player]()
type OgrePetInfo struct {
Id uint32
ID uint32
ShinyLen uint32 `json:"-" struc:"sizeof=ShinyInfo"`
ShinyInfo []data.GlowFilter `json:"ShinyInfo,omitempty"`
Lv uint32 `struc:"skip"` //等级
@@ -37,26 +39,26 @@ type OgrePetInfo struct {
}
func (o *OgrePetInfo) RandSHiny() {
var co *data.GlowFilter
var co *model.ColorfulSkin
if o.Ext == 0 {
co = config.NewShinyService().RandShiny(o.Id)
co = config.NewShinyService().RandShiny(o.ID)
}
if co != nil && len(o.ShinyInfo) == 0 {
o.ShinyInfo = append(o.ShinyInfo, *co)
o.ShinyInfo = append(o.ShinyInfo, co.Color)
}
}
func (o *OgrePetInfo) FixSHiny() {
var co *data.GlowFilter
var co *model.ColorfulSkin
if o.Ext == 0 {
co = config.NewShinyService().FixShiny(o.Id)
co = config.NewShinyService().FixShiny(o.ID)
}
if co != nil && len(o.ShinyInfo) == 0 {
o.ShinyInfo = append(o.ShinyInfo, *co)
o.ShinyInfo = append(o.ShinyInfo, co.Color)
}
}

View File

@@ -24,7 +24,7 @@ func GetTaskInfo(id, ot int) *TaskResult {
pet := service.NewPetRewardService().Get(r.ElfRewardIds)
if pet != nil {
ret.Pet = model.GenPetInfo(int(pet.MonID), int(pet.DV), int(pet.Nature), int(pet.Effect), int(pet.Lv), nil)
ret.Pet = model.GenPetInfo(int(pet.MonID), int(pet.DV), int(pet.Nature), int(pet.Effect), int(pet.Lv), nil, 0)
}
for _, itemID := range r.ItemRewardIds {