| | |
| | | if not PlayerControl.HaveMoney(curPlayer, costMoneyType, costMoneyValue):
|
| | | return
|
| | |
|
| | | # 重置保留激活的1级,从2级开始返还所有
|
| | | resetLV = soulLV
|
| | | pieceTotal = 0
|
| | | soulValueTotal = 0
|
| | | for resetLV in range(2, 1 + soulLV):
|
| | | resetIpyData = IpyGameDataPY.GetIpyGameData("GatherTheSoulLV", soulID, resetLV)
|
| | | for sLV in range(2, 1 + soulLV)[::-1]:
|
| | | resetIpyData = IpyGameDataPY.GetIpyGameData("GatherTheSoulLV", soulID, sLV)
|
| | | if not resetIpyData:
|
| | | continue
|
| | | resetLV = sLV
|
| | | soulValue = resetIpyData.GetNeedSoulValue()
|
| | | if not soulValue:
|
| | | # 重置到不需要公共材料的等级
|
| | | break
|
| | | pieceTotal += resetIpyData.GetNeedPiece()
|
| | | soulValueTotal += resetIpyData.GetNeedSoulValue()
|
| | | soulValueTotal += soulValue
|
| | |
|
| | | GameWorld.DebugLog("重置聚魂: soulID=%s,soulLV=%s,pieceTotal=%s,soulValueTotal=%s" % (soulID, soulLV, pieceTotal, soulValueTotal))
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GatherTheSoulLV % soulID, 1) # 重置到1级
|
| | | if resetLV >= soulLV:
|
| | | return
|
| | | |
| | | GameWorld.DebugLog("重置聚魂: soulID=%s,soulLV=%s,resetLV=%s,pieceTotal=%s,soulValueTotal=%s" % (soulID, soulLV, resetLV, pieceTotal, soulValueTotal))
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GatherTheSoulLV % soulID, resetLV)
|
| | | if costMoneyType and costMoneyValue:
|
| | | PlayerControl.PayMoney(curPlayer, costMoneyType, costMoneyValue, "GatherTheSoulReset", {"soulID":soulID})
|
| | | ItemControler.GivePlayerItem(curPlayer, pieceItemID, pieceTotal, False, event=["GatherTheSoulReset", False, {"soulID":soulID}])
|