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

This commit is contained in:
xinian
2026-02-16 02:43:17 +08:00
committed by cnb
parent 3d110af911
commit c26ecff9f2
2 changed files with 10 additions and 9 deletions

View File

@@ -200,14 +200,15 @@ func (Controller) OnPlayerFightNpcMonster(data1 *fight.FightNpcMonsterInboundInf
if foi.Reason == 0 && foi.WinnerId == p.Info.UserID { if foi.Reason == 0 && foi.WinnerId == p.Info.UserID {
exp := uint32(xmlres.PetMAP[int(monster.ID)].YieldingExp) * monster.Level / 7 exp := uint32(xmlres.PetMAP[int(monster.ID)].YieldingExp) * monster.Level / 7
leve := p.CanGetExp() addlevel, pookevel := p.CanGetExp()
exp = uint32(leve) * (exp) addexp := uint32(addlevel) * (exp)
poolexp := uint32(pookevel) * (exp)
items := &info.S2C_GET_BOSS_MONSTER{ items := &info.S2C_GET_BOSS_MONSTER{
//EV: 45, //EV: 45,
EXP: exp / 2, EXP: addexp,
} }
p.Info.ExpPool += int64(exp) p.Info.ExpPool += int64(poolexp + addexp)
p.AddPetExp(foi.Winpet, int64((exp)/2)) p.AddPetExp(foi.Winpet, int64(addexp))
if refPet.Item != 0 { if refPet.Item != 0 {
count := int64(grand.Intn(2) + 1) count := int64(grand.Intn(2) + 1)
p.ItemAdd(refPet.Item, count) p.ItemAdd(refPet.Item, count)

View File

@@ -64,15 +64,15 @@ func (p *Player) Save() {
} }
// 经验倍数返回 // 经验倍数返回
func (p *Player) CanGetExp() int { func (p *Player) CanGetExp() (int, int) {
if p.Info.TimeToday >= p.Info.TimeLimit { if p.Info.TimeToday >= p.Info.TimeLimit {
return 0 return 0, 0
} }
islogintime := (int64(time.Now().Unix()) - int64(p.Logintime)) islogintime := (int64(time.Now().Unix()) - int64(p.Logintime))
if islogintime > (p.Info.TimeLimit - p.Info.TimeToday) { if islogintime > (p.Info.TimeLimit - p.Info.TimeToday) {
return 0 return 0, 0
} }
base := 1 base := 1
if p.Info.TwoTimes != 0 { if p.Info.TwoTimes != 0 {
@@ -85,5 +85,5 @@ func (p *Player) CanGetExp() int {
base *= 3 base *= 3
} }
return base return base, 1
} }