| | |
| | | import PlayerActLunhuidian
|
| | | import PlayerActYunshi
|
| | | import PlayerActTask
|
| | | import PlayerGubao
|
| | | import ItemCommon
|
| | | import PlayerHero
|
| | | import PyGameData
|
| | | import ChConfig
|
| | |
|
| | | import random
|
| | |
| | | TreasureType_HeroComm = 11 # 英雄招募 - 普通
|
| | | TreasureType_HeroHigh = 12 # 英雄招募 - 高级
|
| | | TreasureType_HeroScore = 13 # 英雄招募 - 积分
|
| | |
|
| | | def DoTreasureOpen(curPlayer):
|
| | | ## 寻宝开启
|
| | | Sync_TreasureInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def OnTreasureLogin(curPlayer):
|
| | | Sync_TreasureInfo(curPlayer)
|
| | |
| | | GameWorld.ErrLog("寻宝格子不存在!treasureType=%s,gridNum=%s" % (treasureType, gridNum), playerID)
|
| | | return
|
| | |
|
| | | treasureResult.append([gridNum, itemID, itemCount, isBind])
|
| | | isTrans = 0 # 是否转化
|
| | | treasureResult.append([gridNum, itemID, itemCount, isTrans])
|
| | |
|
| | | # 扣消耗
|
| | | if costType == 1:
|
| | |
| | | PlayerFeastTravel.AddFeastTravelTaskValue(curPlayer, ChConfig.Def_FeastTravel_JSTreasure, treasureCount)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_JSTreasure, treasureCount)
|
| | | PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_TreasureJueshi, treasureCount)
|
| | | elif treasureType == TreasureType_Gubao:
|
| | | PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_TreasureGubao, treasureCount)
|
| | | #elif treasureType == TreasureType_Gubao:
|
| | | # PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_TreasureGubao, treasureCount)
|
| | |
|
| | | PlayerActLunhuidian.AddLunhuidianValue(curPlayer, PlayerActLunhuidian.AwardType_Treasure, treasureType, treasureCount)
|
| | |
|
| | | # 给物品
|
| | | mailItemList = []
|
| | | itemControl = ItemControler.PlayerItemControler(curPlayer)
|
| | | for gridNum, itemID, itemCount, isBind in treasureResult:
|
| | | itemObj = ItemControler.GetOutPutItemObj(itemID, itemCount, False, curPlayer=curPlayer)
|
| | | for tResult in treasureResult:
|
| | | gridNum, itemID, itemCount = tResult[:3]
|
| | | PyGameData.g_transItemSign = 0
|
| | | itemObj = ItemControler.GetOutPutItemObj(itemID, itemCount, isBind, curPlayer=curPlayer)
|
| | | mailItemDict = ItemCommon.GetMailItemDict(itemObj)
|
| | |
|
| | | if int(gridNum) in notifyGridNumList and notifyKey:
|
| | |
| | | mailItemList.append(mailItemDict)
|
| | | itemObj.Clear()
|
| | |
|
| | | # 检查物品转化
|
| | | if PyGameData.g_transItemSign:
|
| | | tResult[3] = 1 # 有转化物品时设置转化标记
|
| | | |
| | | if mailItemList:
|
| | | PlayerControl.SendMailByKey("HappyXBUnEnough", [playerID], mailItemList)
|
| | |
|