This commit is contained in:
@@ -28,7 +28,7 @@ func (h Controller) EggGamePlay(data1 *egg.C2S_EGG_GAME_PLAY, c *player.Player)
|
||||
result = &egg.S2C_EGG_GAME_PLAY{ListInfo: []data.ItemInfo{}}
|
||||
if grand.Meet(int(data1.EggNum), 100) {
|
||||
r := service.NewPetRewardService().GetEgg()
|
||||
newPet := model.GenPetInfo(int(r.MonID), int(r.DV), int(r.Nature), int(r.Effect), int(r.Lv), nil)
|
||||
newPet := model.GenPetInfo(int(r.MonID), int(r.DV), int(r.Nature), int(r.Effect), int(r.Lv), nil, 0)
|
||||
if grand.Meet(int(data1.EggNum), 100) {
|
||||
newPet.RandShiny()
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ func (Controller) PlayerFightBoss(data *fight.ChallengeBossInboundInfo, p *playe
|
||||
-1,
|
||||
0, //野怪没特性
|
||||
|
||||
bm.Lv, nil)
|
||||
bm.Lv, nil, 0)
|
||||
monster.CatchTime = uint32(i)
|
||||
if bm.Hp != 0 {
|
||||
monster.Hp = uint32(bm.Hp)
|
||||
@@ -158,21 +158,21 @@ func (Controller) OnPlayerFightNpcMonster(data1 *fight.FightNpcMonsterInboundInf
|
||||
return nil, errorcode.ErrorCodes.ErrSystemError
|
||||
}
|
||||
refPet := p.OgreInfo.Data[data1.Number]
|
||||
if refPet.Id == 0 {
|
||||
if refPet.ID == 0 {
|
||||
|
||||
return nil, errorcode.ErrorCodes.ErrPokemonNotExists
|
||||
}
|
||||
if refPet.Ext != 0 {
|
||||
refPet.Id = refPet.Ext
|
||||
refPet.ID = refPet.Ext
|
||||
|
||||
}
|
||||
monster := model.GenPetInfo(
|
||||
int(refPet.Id), -1,
|
||||
int(refPet.ID), -1,
|
||||
-1,
|
||||
0, //野怪没特性
|
||||
|
||||
int(refPet.Lv),
|
||||
refPet.ShinyInfo)
|
||||
refPet.ShinyInfo, -1)
|
||||
if refPet.Ext != 0 {
|
||||
if grand.Meet(3, 100) {
|
||||
monster.RandShiny()
|
||||
|
||||
@@ -140,7 +140,7 @@ func (h Controller) PetTawor(data *fight.StartTwarInboundInfo, c *player.Player)
|
||||
r := service.NewBossService().Get(v)
|
||||
if r != nil {
|
||||
|
||||
monster := model.GenPetInfo(int(r.MonID), 24, int(r.Nature), 0, int(r.Lv), nil)
|
||||
monster := model.GenPetInfo(int(r.MonID), 24, int(r.Nature), 0, int(r.Lv), nil, 0)
|
||||
if r.Hp != 0 {
|
||||
monster.Hp = uint32(r.Hp)
|
||||
monster.MaxHp = uint32(r.Hp)
|
||||
|
||||
@@ -53,7 +53,7 @@ func (h Controller) Collect(
|
||||
}
|
||||
|
||||
c.Info.SetTask(1335+int(data.Type), model.Completed)
|
||||
r := model.GenPetInfo(int(data.ID), -1, -1, 0, 1, nil)
|
||||
r := model.GenPetInfo(int(data.ID), -1, -1, 0, 1, nil, 0)
|
||||
c.Service.Pet.PetAdd(r)
|
||||
result.CatchTime = r.CatchTime
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result
|
||||
dv1 := alpacadecimal.NewFromInt(2).Div(alpacadecimal.NewFromInt(3)).Mul(alpacadecimal.NewFromInt(int64(Mcatchpetinfo.Dv)))
|
||||
dv2 := alpacadecimal.NewFromInt(1).Div(alpacadecimal.NewFromInt(3)).Mul(alpacadecimal.NewFromInt(int64(Auxpetinfo.Dv)))
|
||||
dv := dv1.Add(dv2).Add(alpacadecimal.NewFromInt(1)).IntPart()
|
||||
r := model.GenPetInfo(resid, int(dv), int(natureId), effect, 1, nil)
|
||||
r := model.GenPetInfo(resid, int(dv), int(natureId), effect, 1, nil, -1)
|
||||
r.OldCatchTime = Mcatchpetinfo.CatchTime
|
||||
|
||||
shinycont := 1
|
||||
|
||||
@@ -31,7 +31,7 @@ func (h Controller) CDK(data *user.C2S_GET_GIFT_COMPLETE, player *player.Player)
|
||||
for _, v := range r.ElfRewardIds {
|
||||
pet := service.NewPetRewardService().Get(v)
|
||||
if pet != nil {
|
||||
peti := model.GenPetInfo(int(pet.MonID), int(pet.DV), int(pet.Nature), int(pet.Effect), int(pet.Lv), nil)
|
||||
peti := model.GenPetInfo(int(pet.MonID), int(pet.DV), int(pet.Nature), int(pet.Effect), int(pet.Lv), nil, 0)
|
||||
player.Service.Pet.PetAdd(peti)
|
||||
result.PetGift = append(result.PetGift, user.PetGiftInfo{PetID: peti.ID, CacthTime: peti.CatchTime})
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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]获取伤害值)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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:判断对方是否处于任意异常状态
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user