bug修复
This commit is contained in:
parent
0d7eea6356
commit
7dff488a44
@ -59,6 +59,9 @@ func ReqGmCommand(args []interface{}) error {
|
||||
player.GetPlayerBaseMod().Data.Exp = 0
|
||||
player.PushClientRes(&player.GetPlayerBaseMod().Data)
|
||||
case "zeroUpdate":
|
||||
VarMod := player.PlayMod.getVarMod()
|
||||
VarMod.DailyResetTime = 0
|
||||
player.ZeroUpdate(nil)
|
||||
G_GameLogicPtr.ZeroFlush()
|
||||
case "setSevenLoginActive":
|
||||
num, _ := strconv.Atoi(arg[1])
|
||||
@ -190,6 +193,9 @@ func ReqGmCommand(args []interface{}) error {
|
||||
TimeSortF, _ := strconv.ParseFloat(TimeSort, 64)
|
||||
db.RedisZAdd(RANK_USER, Uid, v.Score+TimeSortF)
|
||||
}
|
||||
case "addFriendStar":
|
||||
FriendTreasureMod := player.PlayMod.getFriendTreasureMod()
|
||||
FriendTreasureMod.AddStar(200)
|
||||
case "setDecorateArea":
|
||||
S, _ := strconv.Atoi(arg[1])
|
||||
DecorateMod := player.PlayMod.getDecorateMod()
|
||||
|
||||
@ -12,7 +12,6 @@ import (
|
||||
"server/game/mod/quest"
|
||||
"server/msg"
|
||||
"server/pkg/github.com/name5566/leaf/log"
|
||||
telog "server/thinkdata"
|
||||
"time"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
@ -471,7 +470,7 @@ func (p *PlayerBaseData) AddExp(player *Player, exp int) (int, error) {
|
||||
BaseMod := player.PlayMod.getBaseMod()
|
||||
BaseMod.Exp += exp
|
||||
upLv := 0
|
||||
upExp := userCfg.GetLevUpExp(int(p.Data.Level))
|
||||
upExp := userCfg.GetLevUpExp(BaseMod.Level)
|
||||
Num := 0
|
||||
UpLevelItem := make([]*item.Item, 0)
|
||||
for BaseMod.Exp >= upExp {
|
||||
@ -481,11 +480,11 @@ func (p *PlayerBaseData) AddExp(player *Player, exp int) (int, error) {
|
||||
Num++
|
||||
BaseMod.Level++
|
||||
BaseMod.Exp -= upExp
|
||||
upExp = userCfg.GetLevUpExp(int(p.Data.Level))
|
||||
upExp = userCfg.GetLevUpExp(BaseMod.Level)
|
||||
// 日常任务解锁
|
||||
DailyTaskMod := player.PlayMod.getDailyTaskMod()
|
||||
DecorateMod := player.PlayMod.getDecorateMod()
|
||||
if DailyTaskMod.LevUpTrigger(int(p.Data.Level), DecorateMod.GetAreaId()) {
|
||||
if DailyTaskMod.LevUpTrigger(BaseMod.Level, DecorateMod.GetAreaId()) {
|
||||
player.PushClientRes(DailyTaskMod.BackData())
|
||||
}
|
||||
upLv = BaseMod.Level
|
||||
@ -503,10 +502,10 @@ func (p *PlayerBaseData) AddExp(player *Player, exp int) (int, error) {
|
||||
player.PushClientRes(ChargeMod.BackData())
|
||||
// 重载活动
|
||||
player.initAcitivity()
|
||||
telog.Te.Track(p.Data.UserName, p.Data.UserName, "level_up", map[string]interface{}{
|
||||
p.p.TeLog("level_up", map[string]interface{}{
|
||||
"after_level": BaseMod.Level,
|
||||
})
|
||||
telog.Te.Track(p.Data.UserName, p.Data.UserName, "property_level_up", map[string]interface{}{
|
||||
p.p.TeLog("property_level_up", map[string]interface{}{
|
||||
"property_level": BaseMod.Level,
|
||||
"property_level_reward": userCfg.GetUnlock(int(BaseMod.Level)),
|
||||
})
|
||||
@ -568,7 +567,8 @@ func (p *PlayerBaseData) BackAsset() *msg.ResPlayerAsset {
|
||||
}
|
||||
|
||||
func (p *PlayerBaseData) GetSevenLoginAdd() int {
|
||||
return userCfg.GetSevenloginAdd(int(p.Data.Level))
|
||||
BaseMod := p.p.PlayMod.getBaseMod()
|
||||
return userCfg.GetSevenloginAdd(BaseMod.GetLevel())
|
||||
}
|
||||
|
||||
func (p *PlayerBaseData) GetLastLoginTime() int {
|
||||
|
||||
@ -101,7 +101,7 @@ func (dt *DailyTaskMod) WeekUpdate() {
|
||||
}
|
||||
weekReward[6] = WeekReward{
|
||||
Id: 9,
|
||||
Items: []*item.Item{{Id: 100008, Num: 1}},
|
||||
Items: []*item.Item{{Id: item.ITEM_FIVE_STAR_CARD_PACK, Num: 1}},
|
||||
}
|
||||
dt.WeekReward = weekReward
|
||||
}
|
||||
|
||||
@ -12,7 +12,6 @@ type FriendTreasureMod struct {
|
||||
Star int // 星级
|
||||
Shift int // 挡位
|
||||
Pos []int
|
||||
Num int
|
||||
List map[int]*msg.TreasureInfo
|
||||
List2 []int32 // 选择的好友
|
||||
Status int
|
||||
@ -47,7 +46,7 @@ func (f *FriendTreasureMod) InitGame(List []*msg.TreasureInfo, List2 []int32) {
|
||||
}
|
||||
|
||||
func (f *FriendTreasureMod) AddStar(Star int) {
|
||||
f.Star += min(200, Star)
|
||||
f.Star = min(200, f.Star+Star)
|
||||
}
|
||||
|
||||
func (f *FriendTreasureMod) Flip(Pos int) ([]*item.Item, error) {
|
||||
@ -57,7 +56,7 @@ func (f *FriendTreasureMod) Flip(Pos int) ([]*item.Item, error) {
|
||||
f.Shift++
|
||||
Info := f.List[Pos]
|
||||
|
||||
if Info.Type == FRIEND_TYPE_ALIVE && Info.Status == 0 {
|
||||
if Info.Type == FRIEND_TYPE_ALIVE {
|
||||
ProbMap := friendTreasureCfg.GetChestProb()
|
||||
Prob := GoUtil.RandMap(ProbMap)
|
||||
Info.Status = 1
|
||||
@ -71,16 +70,16 @@ func (f *FriendTreasureMod) EndGame() ([]*item.Item, int, error) {
|
||||
if f.Status == 0 {
|
||||
return nil, 0, fmt.Errorf("game is over")
|
||||
}
|
||||
ProbAdd := friendTreasureCfg.GetProbAdd(f.Num)
|
||||
ItemNum := int(float64(f.Star) * float64((1+ProbAdd)/100))
|
||||
f.Shift++
|
||||
ProbAdd := friendTreasureCfg.GetProbAdd(f.Shift)
|
||||
ItemNum := int(float64(f.Star) * (100.0 + float64(ProbAdd)) / 100.0)
|
||||
FriendItemNum := ItemNum / 10
|
||||
Reward := []*item.Item{
|
||||
{Id: 1, Num: ItemNum},
|
||||
{Id: item.ITEM_STAR_ID, Num: ItemNum},
|
||||
}
|
||||
f.Star = 0
|
||||
f.Shift = 0
|
||||
f.Status = 2
|
||||
f.Num = 0
|
||||
return Reward, FriendItemNum, nil
|
||||
}
|
||||
|
||||
|
||||
@ -16,9 +16,10 @@ type ItemMod struct {
|
||||
}
|
||||
|
||||
const (
|
||||
ITEM_ENERGY_ID = 100001
|
||||
ITEM_STAR_ID = 100002
|
||||
ITEM_DIAMOND_ID = 100003
|
||||
ITEM_ENERGY_ID = 100001
|
||||
ITEM_STAR_ID = 100002
|
||||
ITEM_DIAMOND_ID = 100003
|
||||
ITEM_FIVE_STAR_CARD_PACK = 100008
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user