| | |
| | | import PlayerControl
|
| | | import GameWorld
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #逻辑实现
|
| | | ## GM命令执行入口
|
| | | # @param curPlayer 当前玩家
|
| | |
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def OnExec(curPlayer, msgList):
|
| | | GameWorld.DebugAnswer(curPlayer, "ClearInvest 投资类型(不写则全部重置)")
|
| | | investTypeList = [msgList[0]] if msgList else ChConfig.GoldInvestTypeList
|
| | | for itype in investTypeList:
|
| | | valueKey = ChConfig.Def_PDict_GoldInvest_Time % itype
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, valueKey, 0, ChConfig.Def_PDictType_GoldInvest)
|
| | | |
| | | valueKey = ChConfig.Def_PDict_GoldInvest_Gold % itype
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, valueKey, 0, ChConfig.Def_PDictType_GoldInvest)
|
| | | |
| | | valueKey = ChConfig.Def_PDict_GoldInvest_AwardData % itype
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, valueKey, 0, ChConfig.Def_PDictType_GoldInvest)
|
| | | for i in range(1, 32):
|
| | | valueKey = ChConfig.Def_PDict_GoldInvest_GotRewardValue % (itype, i)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, valueKey, 0, ChConfig.Def_PDictType_GoldInvest)
|
| | |
|
| | | PlayerGoldInvest.Sync_GoldInvestInfo(curPlayer, itype, isForce=True)
|
| | | if not msgList:
|
| | | GameWorld.DebugAnswer(curPlayer, "重置所有投资: ClearInvest 0")
|
| | | GameWorld.DebugAnswer(curPlayer, "重置指定投资: ClearInvest 类型")
|
| | | GameWorld.DebugAnswer(curPlayer, "类型:7-永久卡;8-周卡;9-登录卡;10-等级卡;11-boss卡;")
|
| | | return
|
| | | |
| | | investType = msgList[0]
|
| | | if not investType:
|
| | | investTypeList = ChConfig.InvestTypeList
|
| | | elif investType not in ChConfig.InvestTypeList:
|
| | | GameWorld.DebugAnswer(curPlayer, "不存在该投资类型!")
|
| | | return
|
| | | else:
|
| | | investTypeList = [investType]
|
| | | |
| | | for itype in investTypeList:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestTime % itype, 0)
|
| | | for keyNum in range(ChConfig.Def_PDict_InvestKeyCount):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestReward % (itype, keyNum), 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestProgress % (itype, keyNum), 0)
|
| | | PlayerGoldInvest.Sync_InvestInfo(curPlayer, itype)
|
| | |
|
| | | return
|
| | |
|