Merge branch 'main' of https://cnb.cool/blzing/blazing
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -3,6 +3,13 @@ package bitset32
|
|||||||
import "math/bits"
|
import "math/bits"
|
||||||
|
|
||||||
func popcntSlice(s []uint32) uint64 {
|
func popcntSlice(s []uint32) uint64 {
|
||||||
|
|
||||||
|
// int r = 0;
|
||||||
|
// while(n)
|
||||||
|
// {
|
||||||
|
// n &= (n - 1);
|
||||||
|
// ++r;
|
||||||
|
// }
|
||||||
var cnt int
|
var cnt int
|
||||||
for _, x := range s {
|
for _, x := range s {
|
||||||
cnt += bits.OnesCount32(x)
|
cnt += bits.OnesCount32(x)
|
||||||
|
|||||||
@@ -203,23 +203,26 @@ func (Controller) OnPlayerFightNpcMonster(data1 *fight.FightNpcMonsterInboundInf
|
|||||||
exp := uint32(xmlres.PetMAP[int(monster.ID)].YieldingExp) * monster.Level / 7
|
exp := uint32(xmlres.PetMAP[int(monster.ID)].YieldingExp) * monster.Level / 7
|
||||||
addlevel, poolevel := p.CanGetExp()
|
addlevel, poolevel := p.CanGetExp()
|
||||||
addexp := gconv.Float32(addlevel * gconv.Float32(exp))
|
addexp := gconv.Float32(addlevel * gconv.Float32(exp))
|
||||||
poolexp := gconv.Float32(poolevel) * gconv.Float32((exp))
|
if addexp != 0 {
|
||||||
items := &info.S2C_GET_BOSS_MONSTER{}
|
poolexp := gconv.Float32(poolevel) * gconv.Float32((exp))
|
||||||
|
items := &info.S2C_GET_BOSS_MONSTER{}
|
||||||
|
|
||||||
p.ItemAdd(3, int64(poolexp+addexp))
|
p.ItemAdd(3, int64(poolexp+addexp))
|
||||||
items.ItemList = append(items.ItemList, data.ItemInfo{
|
|
||||||
ItemId: 3,
|
|
||||||
ItemCnt: int64(poolexp),
|
|
||||||
})
|
|
||||||
p.AddPetExp(foi.Winpet, int64(addexp))
|
|
||||||
if refPet.Item != 0 {
|
|
||||||
count := int64(grand.Intn(2) + 1)
|
|
||||||
p.ItemAdd(refPet.Item, count)
|
|
||||||
items.ItemList = append(items.ItemList, data.ItemInfo{
|
items.ItemList = append(items.ItemList, data.ItemInfo{
|
||||||
ItemId: refPet.Item,
|
ItemId: 3,
|
||||||
ItemCnt: count,
|
ItemCnt: int64(poolexp),
|
||||||
})
|
})
|
||||||
|
p.AddPetExp(foi.Winpet, int64(addexp))
|
||||||
|
if refPet.Item != 0 {
|
||||||
|
count := int64(grand.Intn(2) + 1)
|
||||||
|
p.ItemAdd(refPet.Item, count)
|
||||||
|
items.ItemList = append(items.ItemList, data.ItemInfo{
|
||||||
|
ItemId: refPet.Item,
|
||||||
|
ItemCnt: count,
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
p.SendPackCmd(8004, items)
|
||||||
}
|
}
|
||||||
|
|
||||||
evs := gconv.Int64s(strings.Split(xmlres.PetMAP[int(monster.ID)].YieldingEV, " "))
|
evs := gconv.Int64s(strings.Split(xmlres.PetMAP[int(monster.ID)].YieldingEV, " "))
|
||||||
@@ -231,8 +234,6 @@ func (Controller) OnPlayerFightNpcMonster(data1 *fight.FightNpcMonsterInboundInf
|
|||||||
// p.Info.EVPool += lo.Sum(evs) //给予累计学习力
|
// p.Info.EVPool += lo.Sum(evs) //给予累计学习力
|
||||||
// }
|
// }
|
||||||
|
|
||||||
p.SendPackCmd(8004, items)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -148,6 +148,11 @@ func (h Controller) UseSpeedupItem(data *item.C2S_USE_SPEEDUP_ITEM, c *player.Pl
|
|||||||
return nil, errorcode.ErrorCodes.ErrItemInUse
|
return nil, errorcode.ErrorCodes.ErrItemInUse
|
||||||
}
|
}
|
||||||
c.Info.TwoTimes += 50 // 玩家对象新增 TwoTimesExp 字段存储双倍剩余次数
|
c.Info.TwoTimes += 50 // 玩家对象新增 TwoTimesExp 字段存储双倍剩余次数
|
||||||
|
case 300067:
|
||||||
|
if c.Info.TwoTimes != 0 {
|
||||||
|
return nil, errorcode.ErrorCodes.ErrItemInUse
|
||||||
|
}
|
||||||
|
c.Info.TwoTimes += 25 // 玩家对象新增 TwoTimesExp 字段存储双倍剩余次数
|
||||||
case 300051: // 假设1002是三倍经验加速器道具ID
|
case 300051: // 假设1002是三倍经验加速器道具ID
|
||||||
if c.Info.ThreeTimes != 0 {
|
if c.Info.ThreeTimes != 0 {
|
||||||
return nil, errorcode.ErrorCodes.ErrItemInUse
|
return nil, errorcode.ErrorCodes.ErrItemInUse
|
||||||
|
|||||||
Reference in New Issue
Block a user