| | |
| | | # @return 返回值, 是否判断成功
|
| | | # @remarks <QualityEquipCnt quality="装备品质" value="期望数量"/>
|
| | | def ConditionType_Qualityequipcnt(curPlayer, curMission, curConditionNode):
|
| | | conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)
|
| | | quality = GameWorld.ToIntDef(curConditionNode.GetAttribute("quality"), 0)
|
| | | conditionType = curConditionNode.GetAttribute("type")
|
| | | curQualityEquipCnt = 0 #达到该品质的装备数量,品质高的兼容品质低的
|
| | | equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | for equipIndex in range(0, equipPack.GetCount()):
|
| | | #备用装备栏不处理
|
| | | if equipIndex not in ShareDefine.RoleEquipType:
|
| | | continue
|
| | | curEquip = equipPack.GetAt(equipIndex)
|
| | | if curEquip.IsEmpty():
|
| | | continue
|
| | | if curEquip.GetItemQuality() < quality:
|
| | | continue
|
| | | curQualityEquipCnt += 1
|
| | | |
| | | return QuestRunnerValue.GetEval(conditionType, curQualityEquipCnt, conditionValue)
|
| | | return ChEquip.GetEquipOrangeCount(curPlayer)
|
| | |
|
| | | ##强化 X件装备强化到X级
|
| | | # @param curPlayer 玩家实例
|
| | |
| | | realmlv = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return curPlayer.GetOfficialRank() >= realmlv
|
| | |
|
| | | ##灵根品级是否达到X级
|
| | | # @param None
|
| | | # @return None <Linggenqualitylv attrid="灵根ID" value="期望等级"/>
|
| | | def ConditionType_Linggenqualitylv(curPlayer, curMission, curActionNode):
|
| | | attrID = GameWorld.ToIntDef(curActionNode.GetAttribute("attrid"), 0)
|
| | | qualityLV = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | funcDict = {ShareDefine.Def_Effect_Metal:lambda curObj:PlayerControl.GetMetalQualityLV(curObj),
|
| | | ShareDefine.Def_Effect_Wood:lambda curObj:PlayerControl.GetWoodQualityLV(curObj),
|
| | | ShareDefine.Def_Effect_Water:lambda curObj:PlayerControl.GetWaterQualityLV(curObj),
|
| | | ShareDefine.Def_Effect_Fire:lambda curObj:PlayerControl.GetFireQualityLV(curObj),
|
| | | ShareDefine.Def_Effect_Earth:lambda curObj:PlayerControl.GetEarthQualityLV(curObj),
|
| | | }
|
| | | curQualityLV = 0
|
| | | if attrID in funcDict:
|
| | | curQualityLV = funcDict[attrID](curPlayer)
|
| | | return curQualityLV >= qualityLV
|
| | |
|
| | | ##X级通关X层娲皇遗迹
|
| | | # @param None
|
| | |
| | | totallv = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return PlayerHorse.GetHorseSumLV(curPlayer) >= totallv
|
| | |
|
| | | ##已选择的专精技能数量是否达到
|
| | | ##某主技能对应专精技能达到激活X等级的数量是否达到
|
| | | # @param None
|
| | | # @return None <Elementskillcnt value="cnt"/>
|
| | | # @return None <Elementskillcnt value="cnt" mainskill="[]" activelv="" elementtype="专精类型"/>
|
| | | def ConditionType_Elementskillcnt(curPlayer, curMission, curActionNode):
|
| | | cnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return SkillShell.GetElementSkillCnt(curPlayer) >= cnt
|
| | | mainskill = curActionNode.GetAttribute("mainskill")
|
| | | mainSkillIDList = eval(mainskill) if mainskill else []
|
| | | activeLV = GameWorld.ToIntDef(curActionNode.GetAttribute("activelv"), 1)
|
| | | elementType = GameWorld.ToIntDef(curActionNode.GetAttribute("elementtype"), 0)
|
| | | return SkillShell.GetElementSkillCnt(curPlayer, mainSkillIDList, activeLV, elementType) >= cnt
|
| | |
|
| | | ##设置已选择的专精技能数量
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Set_Elementskillcnt key="" />
|
| | | # @remarks <Set_Elementskillcnt key="" mainskill="[]" activelv="" elementtype="专精类型"/>
|
| | | def DoType_Set_Elementskillcnt(curPlayer, curMission, curActionNode):
|
| | | key = curActionNode.GetAttribute("key")
|
| | | questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | | mainskill = curActionNode.GetAttribute("mainskill")
|
| | | mainSkillIDList = eval(mainskill) if mainskill else []
|
| | | activeLV = GameWorld.ToIntDef(curActionNode.GetAttribute("activelv"), 1)
|
| | | if questID != 0:
|
| | | curMission = curPlayer.FindMission(questID)
|
| | | curMission.SetProperty(key, SkillShell.GetElementSkillCnt(curPlayer))
|
| | | elementType = GameWorld.ToIntDef(curActionNode.GetAttribute("elementtype"), 0)
|
| | | curMission.SetProperty(key, SkillShell.GetElementSkillCnt(curPlayer, mainSkillIDList, activeLV, elementType))
|
| | | return
|
| | |
|
| | | ##设置符合条件的已穿基础装备数量
|
| | |
| | | curMission = curPlayer.FindMission(questID)
|
| | | curMission.SetProperty(key, haveCnt)
|
| | | return
|
| | | def __GetBaseequipcnt(curPlayer, classLV, color, suiteIDList):
|
| | | def __GetBaseequipcnt(curPlayer, classLV, color, suiteIDList, needCnt=0):
|
| | | #classLV 为0代表任意阶
|
| | | haveCnt = 0
|
| | | equipMaxClasslv = IpyGameDataPY.GetFuncCfg('EquipMaxClasslv')
|
| | | classlVList = [classLV] if classLV else range(1, equipMaxClasslv+1)
|
| | | |
| | | equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | for place in ChConfig.EquipPlace_Base:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, place)
|
| | | if not ipyData:
|
| | | break
|
| | | gridIndex = ipyData.GetGridIndex()
|
| | | curEquip = equipPack.GetAt(gridIndex)
|
| | | if not ItemCommon.CheckItemCanUse(curEquip):
|
| | | continue
|
| | | if curEquip.GetItemColor() < color:
|
| | | continue
|
| | | if suiteIDList and curEquip.GetSuiteID() not in suiteIDList:
|
| | | continue
|
| | | haveCnt += 1
|
| | | for classlv in classlVList:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classlv, place)
|
| | | if not ipyData:
|
| | | continue
|
| | | gridIndex = ipyData.GetGridIndex()
|
| | | curEquip = equipPack.GetAt(gridIndex)
|
| | | if not ItemCommon.CheckItemCanUse(curEquip):
|
| | | continue
|
| | | if curEquip.GetItemColor() < color:
|
| | | continue
|
| | | if suiteIDList and curEquip.GetSuiteID() not in suiteIDList:
|
| | | continue
|
| | | haveCnt += 1
|
| | | if needCnt and haveCnt >= needCnt:
|
| | | break
|
| | | return haveCnt
|
| | |
|
| | | ##判断符合条件的已穿基础装备数量
|
| | |
| | | color = GameWorld.ToIntDef(curActionNode.GetAttribute("color"), 0)
|
| | | suite = curActionNode.GetAttribute("suite")
|
| | | suiteIDList = eval(suite) if suite else []
|
| | | haveCnt = __GetBaseequipcnt(curPlayer, classLV, color, suiteIDList)
|
| | | haveCnt = __GetBaseequipcnt(curPlayer, classLV, color, suiteIDList, totalcnt)
|
| | | return haveCnt >= totalcnt
|
| | |
|
| | | ##法宝激活个数
|
| | |
| | | totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return PlayerMagicWeapon.GetMWActiveCntTotal(curPlayer) >= totalcnt
|
| | |
|
| | | ##总强化进化等级
|
| | | # @param None
|
| | | # @return None <Totalplusevolvelv value="cnt"/>
|
| | | def ConditionType_Totalplusevolvelv(curPlayer, curMission, curActionNode):
|
| | | totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | return ChEquip.GetTotalPlusEvolveLV(curPlayer) >= totalcnt
|
| | | ##总强化等级
|
| | | # @param None
|
| | | # @return None <Totalpluslv value="cnt"/>
|
| | |
| | |
|
| | | ##技能总等级
|
| | | # @param None
|
| | | # @return None <Totalskilllv value="" funcType=""/>
|
| | | # @return None <Totalskilllv value="" funcType="" skilllv=""/>
|
| | | def ConditionType_Totalskilllv(curPlayer, curMission, curActionNode):
|
| | | totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | funcType = GameWorld.ToIntDef(curActionNode.GetAttribute("funcType"), 0)
|
| | | return SkillShell.GetAllSkillLV(curPlayer, funcType) >= totalcnt
|
| | | skilllv = GameWorld.ToIntDef(curActionNode.GetAttribute("skilllv"), 0)
|
| | | return SkillShell.GetSkillCntByFunc(curPlayer, funcType, skilllv) >= totalcnt
|
| | |
|
| | | ##设置已达到X等级的技能数量
|
| | | # @param curPlayer 玩家实例
|
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Set_Skillcnt key="" funcType="" skilllv=""/>
|
| | | def DoType_Set_Skillcnt(curPlayer, curMission, curActionNode):
|
| | | key = curActionNode.GetAttribute("key")
|
| | | funcType = GameWorld.ToIntDef(curActionNode.GetAttribute("funcType"), 0)
|
| | | skilllv = GameWorld.ToIntDef(curActionNode.GetAttribute("skilllv"), 0)
|
| | | questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | | if questID != 0:
|
| | | curMission = curPlayer.FindMission(questID)
|
| | | curMission.SetProperty(key, SkillShell.GetSkillCntByFunc(curPlayer, funcType, skilllv))
|
| | | return
|
| | |
|
| | | ##激活法宝,确认与成就逻辑后使用
|
| | | # @param None
|
| | |
| | |
|
| | |
|
| | | def DoType_Setfairydomain(curPlayer, curMission, curActionNode):
|
| | | GameWorld.DebugLog("DoType_Setfairydomain", curPlayer.GetID())
|
| | | ## 任务开启缥缈仙域 (做标记可寻访) <Setfairydomain/>
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainState):
|
| | | #若已在寻访中则先结束寻访
|