| | |
| | | # @param curMission 任务实例
|
| | | # @param curConditionNode 节点信息
|
| | | # @return 返回值, 是否判断成功
|
| | | # @remarks <Have_Money value="期望值" check="查找对话中的货币" moneytype="货币类型 1元宝2礼券3银两" type="__Eval+替换的名字"/>
|
| | | # @remarks <Have_Money value="期望值" check="查找对话中的货币" moneytype="货币类型 1元宝2礼券3银两" type="__Eval+替换的名字" maxItem="需要物品数量" itemID="20410"/>
|
| | | def ConditionType_Have_Money(curPlayer, curMission, curConditionNode):
|
| | | #格式<have_money value="" type="" moneytype=""/>
|
| | | value = curConditionNode.GetAttribute("value")
|
| | |
| | | conditionValue = int(value)
|
| | | elif check != "":
|
| | | conditionValue = int(QuestRunnerValue.GetNPCTalkReplaceValue(curPlayer, curMission, check))
|
| | | |
| | | maxItemCnt = GameWorld.ToIntDef(curConditionNode.GetAttribute("maxItem"), 0)
|
| | | itemID = GameWorld.ToIntDef(curConditionNode.GetAttribute("itemID"), 0)
|
| | | if maxItemCnt and itemID: #未收集的道具个数乘以单价
|
| | | haveCnt = ItemControler.FindPlayerItemCountByItemID(curPlayer, IPY_GameWorld.rptItem, itemID)
|
| | | conditionValue = max(0, maxItemCnt-haveCnt)*value
|
| | | |
| | | conditionType = curConditionNode.GetAttribute("type")
|
| | | moneyType = int(curConditionNode.GetAttribute("moneytype"))
|
| | | |
| | | |
| | | |
| | | goldValue = curPlayer.GetGold()
|
| | | goldPaperValue = curPlayer.GetGoldPaper()
|
| | | silverValue = PlayerControl.GetSilver(curPlayer)
|
| | |
| | | return QuestRunnerValue.GetEval(conditionType, goldPaperValue, conditionValue)
|
| | | elif moneyType == IPY_GameWorld.TYPE_Price_Silver_Money:
|
| | | return QuestRunnerValue.GetEval(conditionType, silverValue, conditionValue)
|
| | | elif moneyType == ShareDefine.TYPE_Price_Gold_Paper_Money:
|
| | | return QuestRunnerValue.GetEval(conditionType, goldValue + goldPaperValue, conditionValue)
|
| | | else:
|
| | | GameWorld.Log("任务 = %s , moneytype = %s填错拉" % (curMission.GetMissionID() , moneyType) , curPlayer.GetPlayerID())
|
| | | return
|
| | |
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Del_Money form_value="是否取对话的值" value="form_value为空取" moneytype="1元宝2礼券3银两" /> |
| | | # @remarks <Del_Money form_value="是否取对话的值" value="form_value为空取" moneytype="1元宝2礼券3银两" maxItem="需要物品数量" itemID="20410"/> |
| | | def DoType_Del_Money(curPlayer, curMission, curActionNode):
|
| | | #扣钱
|
| | | #格式<del_money form_value = ""value="" moneytype=""/>
|
| | |
| | | else:
|
| | | value = int(curActionNode.GetAttribute("value"))
|
| | |
|
| | | maxItemCnt = GameWorld.ToIntDef(curActionNode.GetAttribute("maxItem"), 0)
|
| | | itemID = GameWorld.ToIntDef(curActionNode.GetAttribute("itemID"), 0)
|
| | | if maxItemCnt and itemID: #未收集的道具个数乘以单价
|
| | | haveCnt = ItemControler.FindPlayerItemCountByItemID(curPlayer, IPY_GameWorld.rptItem, itemID)
|
| | | value = max(0, maxItemCnt-haveCnt)*value
|
| | | |
| | | moneytype = int(curActionNode.GetAttribute("moneytype"))
|
| | |
|
| | | if moneytype not in ChConfig.Def_MoneyType_All:
|
| | | GameWorld.Log("##异常moneytype = %s填错拉" % (moneytype))
|
| | | return
|
| | | # if moneytype not in ChConfig.Def_MoneyType_All:
|
| | | # GameWorld.Log("##异常moneytype = %s填错拉" % (moneytype))
|
| | | # return
|
| | |
|
| | | curMissionID = 0
|
| | | if curMission == None:
|
| | | curMissionID = 0
|
| | | else:
|
| | | curMissionID = curMission.GetMissionID()
|
| | | |
| | | #付钱
|
| | | if not PlayerControl.PayMoney(curPlayer, moneytype, value, ChConfig.Def_Cost_MissionDel, {"MissionID":curMissionID}):
|
| | | costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, moneytype, value)
|
| | | if not costMoneyList:
|
| | | GameWorld.Log("##付费异常,玩家金钱不足,任务missionID = %s" % (curMissionID) , curPlayer.GetPlayerID())
|
| | | EventShell.DoExitEvent(curPlayer)
|
| | | return
|
| | | #付钱
|
| | | for moneyType, moneyNum in costMoneyList:
|
| | | if not PlayerControl.PayMoney(curPlayer, moneyType, moneyNum, ChConfig.Def_Cost_MissionDel, {"MissionID":curMissionID}):
|
| | | GameWorld.Log("##付费异常,玩家金钱不足,任务missionID = %s" % (curMissionID) , curPlayer.GetPlayerID())
|
| | | EventShell.DoExitEvent(curPlayer)
|
| | | return
|
| | |
|
| | | GameWorld.Login_Interface_GoldRec(curPlayer , 0 , 0 , 'MissionID_%s_Cost' % (curMissionID), moneytype, value)
|
| | | return
|
| | |
| | | key = curActionNode.GetAttribute("key")
|
| | | curMission.SetProperty(key, PlayerMagicWeapon.GetMWActiveCntTotal(curPlayer))
|
| | | return
|
| | |
|
| | | ##设置坐骑总等级
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Set_Horsetotallv key="" />
|
| | | def DoType_Set_Horsetotallv(curPlayer, curMission, curActionNode):
|
| | | key = curActionNode.GetAttribute("key")
|
| | | questID = GameWorld.ToIntDef(curMission.GetProperty("id"), 0)
|
| | | if questID != 0:
|
| | | curMission = curPlayer.FindMission(questID)
|
| | | curMission.SetProperty(key, PlayerHorse.GetHorseSumLV(curPlayer))
|
| | | return
|
| | | #---------------------------------------------------------------------
|
| | | ##DoType_调度器
|
| | | # @param curPlayer 玩家实例
|
| | |
| | | soulID = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return bool(PlayerMagicWeapon.GetIsActiveMWSoul(curPlayer, soulID))
|
| | |
|
| | | ##S级通关X层娲皇遗迹
|
| | | # @param None
|
| | | # @return None <Passqueenrelecs value="lineID"/>
|
| | | def ConditionType_Passqueenrelecs(curPlayer, curMission, curActionNode):
|
| | | lineID = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | grade = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [ChConfig.Def_FBMapID_QueenRelics])
|
| | | maxGrade = len(FBCommon.GetFBLineGrade(ChConfig.Def_FBMapID_QueenRelics, lineID))
|
| | | return grade >=maxGrade
|
| | |
|
| | | ##坐骑总等级
|
| | | # @param None
|
| | | # @return None <Horsetotallv value="lv"/>
|
| | | def ConditionType_Horsetotallv(curPlayer, curMission, curActionNode):
|
| | | totallv = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return PlayerHorse.GetHorseSumLV(curPlayer) >= totallv
|
| | |
|
| | | ##2阶强化防具套装件数
|
| | | # @param None
|
| | | # @return None <Suitplus value="cnt"/>
|
| | | def ConditionType_Suitplus(curPlayer, curMission, curActionNode):
|
| | | needCnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | |
| | | equipSuitTypeDict = IpyGameDataPY.GetFuncEvalCfg('EquipSuitType')
|
| | | groupCnt = 0 #2阶强化防具套装件数
|
| | | for groupType, equipIndexList in equipSuitTypeDict.items():
|
| | | for i in equipIndexList:
|
| | | suiteInfo = ChEquip.GetSuiteInfoByPlace(curPlayer, i)
|
| | | for suiteType, lv in suiteInfo.items():
|
| | | if lv >= 2 and groupType == 1 and suiteType == 2:
|
| | | groupCnt +=1
|
| | | return groupCnt >= needCnt
|
| | |
|
| | |
|
| | | ##激活法宝,确认与成就逻辑后使用
|
| | | # @param None
|
| | | # @return None <Active_Magicweapon id="法宝ID"/>
|