| | |
| | | import GameWorld
|
| | | import ItemCommon
|
| | | import IpyGameDataPY
|
| | | import PlayerControl
|
| | | #---------------------------------------------------------------------
|
| | | #逻辑实现
|
| | | ## GM命令执行入口
|
| | |
| | | return
|
| | | packType = IPY_GameWorld.rptEquip
|
| | | curPack = curPlayer.GetItemManager().GetPack(packType)
|
| | | if len(cmdList) == 2:
|
| | | setStarLV = cmdList[1]
|
| | | |
| | | if len(cmdList) == 1: #设置所有
|
| | | setStarLV = cmdList[0]
|
| | | equipMaxClasslv = IpyGameDataPY.GetFuncCfg('EquipMaxClasslv')
|
| | | for equipPlace in ChConfig.Pack_EquipPart_CanPlusStar.get(packType, []):
|
| | | for classlv in xrange(1, equipMaxClasslv+1):
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classlv, equipPlace)
|
| | | if not ipyData:
|
| | | continue |
| | | gridIndex = ipyData.GetGridIndex()
|
| | | curEquip = curPack.GetAt(gridIndex)
|
| | | ChEquip.SetEquipPartPlusLV(curPlayer, packType, gridIndex, curEquip, setStarLV)
|
| | | ChEquip.SetEquipPartProficiency(curPlayer, packType, gridIndex, 0)
|
| | | ChEquip.SetEquipPartPlusEvolveLV(curPlayer, packType, gridIndex, 0)
|
| | | #刷新所有属性
|
| | | ChEquip.RefreshPlayerEquipAttribute(curPlayer)
|
| | | playControl = PlayerControl.PlayerControl(curPlayer)
|
| | | playControl.RefreshPlayerAttrState()
|
| | | ChEquip.NotifyEquipPartPlusLV(curPlayer)
|
| | | GameWorld.DebugAnswer(curPlayer, "设置所有部位强化等级为: %s" % (setStarLV))
|
| | | elif len(cmdList) == 2:
|
| | | classLV = cmdList[0]
|
| | | setStarLV = cmdList[1]
|
| | | for equipPlace in ChConfig.Pack_EquipPart_CanPlusStar.get(packType, []):
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
|
| | | if not ipyData:
|
| | |
| | | ChEquip.SetEquipPartPlusLV(curPlayer, packType, gridIndex, curEquip, setStarLV)
|
| | | ChEquip.SetEquipPartProficiency(curPlayer, packType, gridIndex, 0)
|
| | | ChEquip.SetEquipPartPlusEvolveLV(curPlayer, packType, gridIndex, 0)
|
| | | Operate_EquipPlus.DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV)
|
| | | Operate_EquipPlus.DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV)
|
| | | ChEquip.NotifyEquipPartPlusLV(curPlayer)
|
| | | GameWorld.DebugAnswer(curPlayer, "设置%s阶所有部位强化等级为: %s" % (classLV, setStarLV))
|
| | | return
|
| | |
| | | return
|
| | |
|
| | | classLV, equipPlace, starLV = cmdList
|
| | | if packType not in ChConfig.Pack_EquipPart_CanPlusStar:
|
| | | __GMHelpAnswer(curPlayer, "packType不存在!")
|
| | | return
|
| | |
|
| | | if equipPlace not in ChConfig.Pack_EquipPart_CanPlusStar[packType]:
|
| | | __GMHelpAnswer(curPlayer, "index索引不存在!")
|
| | | __GMHelpAnswer(curPlayer, "部位不存在!")
|
| | | return
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
|
| | | if not ipyData:
|
| | | return
|
| | | gridIndex = ipyData.GetGridIndex()
|
| | | curEquip = curPack.GetAt(gridIndex)
|
| | | if not ItemCommon.CheckItemCanUse(curEquip):
|
| | | return
|
| | | maxStarLV = ItemCommon.GetItemMaxPlusLV(curPlayer, gridIndex, curEquip)
|
| | | starLV = min(starLV, maxStarLV)
|
| | | # if not ItemCommon.CheckItemCanUse(curEquip):
|
| | | # return
|
| | | # maxStarLV = ItemCommon.GetItemMaxPlusLV(curPlayer, gridIndex, curEquip)
|
| | | # starLV = min(starLV, maxStarLV)
|
| | | ChEquip.SetEquipPartPlusLV(curPlayer, packType, gridIndex, curEquip, starLV)
|
| | | ChEquip.SetEquipPartProficiency(curPlayer, packType, gridIndex, 0)
|
| | | Operate_EquipPlus.DoLogic_OnEquipPartStarLVChange(curPlayer, packType, classLV)
|
| | | ChEquip.NotifyEquipPartPlusLV(curPlayer, packType, gridIndex)
|
| | | GameWorld.DebugAnswer(curPlayer, "设置%s阶%s部位强化等级为: %s" % (classLV, equipPlace, starLV))
|
| | | return
|
| | |
|
| | |
|
| | | def __GMHelpAnswer(curPlayer, errorMsg=""):
|
| | | if errorMsg:
|
| | | GameWorld.DebugAnswer(curPlayer, "%s" % errorMsg)
|
| | | GameWorld.DebugAnswer(curPlayer, "SetEquipPartPlusLV 等级 设置所有")
|
| | | GameWorld.DebugAnswer(curPlayer, "SetEquipPartPlusLV 阶级 强化等级")
|
| | | GameWorld.DebugAnswer(curPlayer, "SetEquipPartPlusLV 阶级 部位 强化等级")
|
| | |
|
| | | packTypeStrDict = {
|
| | | IPY_GameWorld.rptEquip:"装备背包",
|
| | | IPY_GameWorld.rptHorseEquip:"坐骑装备背包",
|
| | | }
|
| | | |
| | | #===============================================================================
|
| | | # indexStrDict = {
|
| | | # "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retMask):"头盔",
|
| | | # "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retClothes):"衣服",
|
| | | # "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retArm):"护手",
|
| | | # "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retTrousers):"裤子",
|
| | | # "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retShoes):"鞋子",
|
| | | # "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retNeck):"项链",
|
| | | # "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retRingLeft):"左戒指",
|
| | | # "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retRingRight):"右戒指",
|
| | | # "%s_%s" % (IPY_GameWorld.rptEquip, ShareDefine.retWeapon):"右手武器",
|
| | | # "%s_%s" % (IPY_GameWorld.rptEquip, ShareDefine.retWeapon2):"左手武器",
|
| | | # "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retAmulet):"护符",
|
| | | # "%s_%s" % (IPY_GameWorld.rptEquip, IPY_GameWorld.retBelt):"腰带",
|
| | | # |
| | | # }
|
| | | #===============================================================================
|
| | | |
| | | #===========================================================================
|
| | | # GameWorld.DebugAnswer(curPlayer, "SetEquipPartPlusLV 参数[packType, index, starLV]")
|
| | | # for pType, indexList in ChConfig.Pack_EquipPart_CanPlusStar.items():
|
| | | # GameWorld.DebugAnswer(curPlayer, " packType=%s(%s)ʱ" % (pType, packTypeStrDict.get(pType, "")))
|
| | | # indexStr = "index="
|
| | | # for i in indexList:
|
| | | # indexStr += "%s(%s)," % (i, indexStrDict.get("%s_%s" % (pType, i), ""))
|
| | | # GameWorld.DebugAnswer(curPlayer, " %s" % indexStr)
|
| | | # |
| | | # GameWorld.DebugAnswer(curPlayer, " SetEquipPartPlusLV 强化等级 可重置所有部位为对应的强化等级")
|
| | | # GameWorld.DebugAnswer(curPlayer, "------------------------------")
|
| | |
|
| | | #===========================================================================
|
| | | return
|