| | |
| | | import ShareDefine
|
| | | import IpyGameDataPY
|
| | | import PlayerControl
|
| | | import PlayerActivity
|
| | | import ChPyNetSendPack
|
| | | import ItemControler
|
| | | import IPY_GameWorld
|
| | | import NetPackCommon
|
| | | import PlayerArena
|
| | | import PlayerLLMJ
|
| | | import ItemCommon
|
| | | import PlayerTask
|
| | | import NPCCommon
|
| | |
| | | def __doKillAward(curPlayer, atkObj, killObjList):
|
| | | ## 计算击杀奖励
|
| | | if not killObjList:
|
| | | GameWorld.DebugLog("没有击杀不需要处理!")
|
| | | #GameWorld.DebugLog("没有击杀不需要处理主线奖励!")
|
| | | return
|
| | | # 结算经验
|
| | | unXiantaoCntExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntExp)
|
| | | if unXiantaoCntExp:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntExp, 0)
|
| | | perExp = IpyGameDataPY.GetFuncCfg("Mainline", 1) # 每个战锤增加经验
|
| | | totalExp = unXiantaoCntExp * perExp
|
| | | GameWorld.DebugLog("增加经验: totalExp=%s,unXiantaoCntExp=%s" % (totalExp, unXiantaoCntExp))
|
| | | PlayerControl.PlayerControl(curPlayer).AddExp(totalExp, ShareDefine.Def_ViewExpType_KillNPC)
|
| | | |
| | | baseExp = unXiantaoCntExp * perExp
|
| | | mjExPer, exRemain = PlayerLLMJ.GetAddExpPerInfo(curPlayer)
|
| | | mjEx = min(int(baseExp * mjExPer / 100.0), exRemain)
|
| | | totalExp = baseExp + mjEx
|
| | | GameWorld.DebugLog("增加经验: totalExp=%s,unXiantaoCntExp=%s,baseExp=%s,mjEx=%s,mjExPer=%s,exRemain=%s" |
| | | % (totalExp, unXiantaoCntExp, baseExp, mjEx, mjExPer, exRemain))
|
| | | finalAddExp = PlayerControl.PlayerControl(curPlayer).AddExp(totalExp, ShareDefine.Def_ViewExpType_KillNPC)
|
| | | if mjEx and finalAddExp:
|
| | | PlayerLLMJ.AddExpEx(curPlayer, mjEx)
|
| | | |
| | | __doMainDrop(curPlayer, killObjList)
|
| | | return
|
| | |
|
| | |
| | |
|
| | | equipCnt = len(equipDict)
|
| | | unXiantaoCntEquip = PlayerControl.GetUnXiantaoCntEquip(curPlayer)
|
| | | perEquipXiantao = unXiantaoCntEquip / float(equipCnt) if equipCnt > 1 else unXiantaoCntEquip
|
| | | perEquipXiantao = unXiantaoCntEquip / float(equipCnt) if equipCnt > 1 else unXiantaoCntEquip # 均分支持小数
|
| | | decomposeMoney = max(1, moneyBase * perEquipXiantao) # 至少1个
|
| | | mjExPer, exRemain = PlayerLLMJ.GetAddDecomposePer(curPlayer)
|
| | | mjEx = int(decomposeMoney * mjExPer / 100.0)
|
| | | GameWorld.DebugLog("unXiantaoCntEquip=%s,equipCnt=%s,perEquipXiantao=%s,equipIndexList=%s"
|
| | | % (unXiantaoCntEquip, equipCnt, perEquipXiantao, equipDict.keys()), playerID)
|
| | | GameWorld.DebugLog("moneyBase=%s,decomposeMoney=%s" % (moneyBase, decomposeMoney), playerID)
|
| | | GameWorld.DebugLog("moneyBase=%s,decomposeMoney=%s,mjExPer=%s,exRemain=%s,mjEx=%s" % (moneyBase, decomposeMoney, mjExPer, exRemain, mjEx), playerID)
|
| | |
|
| | | moneyTotal = 0
|
| | | |
| | | mjExTotal = 0
|
| | | decomposeCnt = 0
|
| | | decomposeIndexList = []
|
| | | for itemIndex in itemIndexList:
|
| | |
| | | curEquip = equipDict[itemIndex]
|
| | |
|
| | | moneyTotal += decomposeMoney
|
| | | GameWorld.DebugLog(" itemIndex=%s,moneyBase=%s,perEquipXiantao=%s,decomposeMoney=%s,总:%s" |
| | | % (itemIndex, moneyBase, perEquipXiantao, decomposeMoney, moneyTotal), playerID)
|
| | | if mjEx > 0:
|
| | | mjEx = min(mjEx, exRemain)
|
| | | exRemain -= mjEx
|
| | | moneyTotal += mjEx
|
| | | mjExTotal += mjEx
|
| | | GameWorld.DebugLog(" itemIndex=%s,moneyBase=%s,perEquipXiantao=%s,decomposeMoney=%s,mjEx=%s,exRemain=%s,总:%s" |
| | | % (itemIndex, moneyBase, perEquipXiantao, decomposeMoney, mjEx, exRemain, moneyTotal), playerID)
|
| | |
|
| | | ItemCommon.DelItem(curPlayer, curEquip, curEquip.GetCount(), True, ChConfig.ItemDel_EquipDecompose)
|
| | | decomposeIndexList.append(itemIndex)
|
| | |
| | |
|
| | | moneyTotal = int(round(moneyTotal)) # 四舍五入取整
|
| | | unXiantaoCntEquip = PlayerControl.SetUnXiantaoCntEquip(curPlayer, unXiantaoCntEquip)
|
| | | GameWorld.DebugLog("moneyTotal=%s,unXiantaoCntEquip=%s" % (moneyTotal, unXiantaoCntEquip), playerID)
|
| | | |
| | | GameWorld.DebugLog("moneyTotal=%s,mjExTotal=%s,unXiantaoCntEquip=%s" % (moneyTotal, mjExTotal, unXiantaoCntEquip), playerID)
|
| | | |
| | | PlayerControl.GiveMoney(curPlayer, moneyType, moneyTotal, "DecomposeMainEquip", isSysHint=False)
|
| | | PlayerLLMJ.AddExpDecompose(curPlayer, mjExTotal)
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_EquipDecompose, decomposeCnt)
|
| | | PlayerActivity.AddDailyTaskValue(curPlayer, ChConfig.DailyTask_EquipDecompose, decomposeCnt)
|
| | | return
|
| | |
|
| | | def __doPickupMainItem(curPlayer, itemIndexList):
|