| | |
| | | import BuffSkill
|
| | | import PyGameData
|
| | |
|
| | | def DoPlayerOnDay(curPlayer): |
| | | def DoPlayerOnDay(curPlayer):
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LoveEatCandyToday):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LoveEatCandyToday, 0)
|
| | | Sync_LoveInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def DoPlayerLogin(curPlayer):
|
| | | Sync_LoveInfo(curPlayer)
|
| | | Sync_LoveRingInfo(curPlayer)
|
| | | return
|
| | |
|
| | |
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | |
|
| | | EatCandyMax = IpyGameDataPY.GetFuncCfg("LoveCandy", 4)
|
| | | if EatCandyMax:
|
| | | eatCandyToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LoveEatCandyToday)
|
| | | if eatCandyToday >= EatCandyMax:
|
| | | GameWorld.DebugLog("已达今日吃喜糖次数上限. eatCandyToday=%s >= %s" % (eatCandyToday, EatCandyMax), playerID)
|
| | | return
|
| | | |
| | | if not GameWorld.SetPlayerTickTime(curPlayer, ChConfig.TYPE_Player_Tick_Love, tick):
|
| | | PlayerControl.NotifyCode(curPlayer, "RequestLater")
|
| | | return
|
| | |
| | | if not canBuy:
|
| | | return
|
| | |
|
| | | GameWorld.Log("吃喜糖结果: isFree=%s" % (isFree), curPlayer.GetPlayerID())
|
| | | updEatCandyToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LoveEatCandyToday) + 1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_LoveEatCandyToday, updEatCandyToday)
|
| | | Sync_LoveInfo(curPlayer)
|
| | | |
| | | GameWorld.Log("吃喜糖结果: isFree=%s,updEatCandyToday=%s" % (isFree, updEatCandyToday), curPlayer.GetPlayerID())
|
| | |
|
| | | if not isFree:
|
| | | infoDict = {ChConfig.Def_Cost_Reason_SonKey:"EatCandy"}
|
| | |
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | def Sync_LoveInfo(curPlayer):
|
| | | ## 同步情缘相关信息
|
| | | clientPack = ChPyNetSendPack.tagMCLoveInfo()
|
| | | clientPack.EatCandyToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LoveEatCandyToday)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | def SyncMapServerIntimacy(curPlayer, dataMsg):
|
| | | tagID, intimacyValue = dataMsg
|
| | | coupleID = PlayerControl.GetCoupleID(curPlayer)
|