| | |
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE DogzID; // 神兽ID
|
| | | # BYTE EquipIndex; //神兽装备所在神兽背包索引
|
| | | # BYTE EquipIndexCount;
|
| | | # BYTE EquipIndexList[EquipIndexCount]; //神兽装备所在神兽背包索引列表
|
| | | #};
|
| | | def OnDogzEquipItem(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | dogzID = clientData.DogzID
|
| | | equipIndex = clientData.EquipIndex
|
| | | equipIndexList = clientData.EquipIndexList
|
| | |
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("Dogz", dogzID)
|
| | | if not ipyData:
|
| | | return
|
| | |
|
| | | dogzItemPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzItem)
|
| | | curEquip = dogzItemPack.GetAt(equipIndex)
|
| | | if not ItemCommon.CheckItemCanUse(curEquip):
|
| | | GameWorld.DebugLog("物品不可用: equipIndex=%s" % equipIndex)
|
| | | return
|
| | | if not ItemCommon.GetIsDogzEquip(curEquip):
|
| | | GameWorld.DebugLog("非神兽装备: equipIndex=%s" % equipIndex)
|
| | | GameWorld.DebugLog("神兽穿戴装备: dogzID=%s,equipIndexList=%s" % (dogzID, equipIndexList), playerID)
|
| | | if not equipIndexList:
|
| | | return
|
| | |
|
| | | equipPlace = curEquip.GetEquipPlace()
|
| | | equipPlaceIndex = GetDogzEquipPlaceIndex(equipPlace)
|
| | | equipPlaceColorList = ipyData.GetEquipPlaceColorList()
|
| | | if equipPlaceIndex < 0 or equipPlaceIndex >= len(equipPlaceColorList):
|
| | | GameWorld.ErrLog("神兽装备位异常: equipPlace=%s,equipPlaceIndex=%s" % (equipPlace, equipPlaceIndex))
|
| | | return
|
| | | succIndexList = []
|
| | | for equipIndex in equipIndexList:
|
| | | dogzItemPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzItem)
|
| | | curEquip = dogzItemPack.GetAt(equipIndex)
|
| | | if not ItemCommon.CheckItemCanUse(curEquip):
|
| | | GameWorld.DebugLog("物品为空或不可用: equipIndex=%s" % equipIndex, playerID)
|
| | | continue
|
| | | if not ItemCommon.GetIsDogzEquip(curEquip):
|
| | | GameWorld.DebugLog("非神兽装备: equipIndex=%s" % equipIndex, playerID)
|
| | | continue
|
| | | |
| | | equipPlace = curEquip.GetEquipPlace()
|
| | | equipPlaceIndex = GetDogzEquipPlaceIndex(equipPlace)
|
| | | equipPlaceColorList = ipyData.GetEquipPlaceColorList()
|
| | | if equipPlaceIndex < 0 or equipPlaceIndex >= len(equipPlaceColorList):
|
| | | GameWorld.ErrLog("神兽装备位异常: equipIndex=%s,equipPlace=%s,equipPlaceIndex=%s" |
| | | % (equipIndex, equipPlace, equipPlaceIndex), playerID)
|
| | | continue
|
| | | |
| | | dogzEquipPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzEquip)
|
| | | equipPackIndex = GetDogzEquipPackIndex(dogzID, equipPlaceIndex)
|
| | | if equipPackIndex < 0 or equipPackIndex >= dogzEquipPack.GetCount():
|
| | | GameWorld.ErrLog("神兽装备背包索引异常: dogzID=%s,equipIndex=%s,equipPlace=%s,equipPackIndex=%s" |
| | | % (dogzID, equipIndex, equipPlace, equipPackIndex), playerID)
|
| | | continue
|
| | | |
| | | equipColor = curEquip.GetItemColor()
|
| | | limitColor = equipPlaceColorList[equipPlaceIndex]
|
| | | if equipColor < limitColor:
|
| | | GameWorld.Log("神兽装备位穿戴颜色限制:dogzID=%s,equipIndex=%s,equipPlaceIndex=%s,limitColor=%s > equipColor=%s" |
| | | % (dogzID, equipIndex, equipPlaceIndex, limitColor, equipColor), playerID)
|
| | | continue
|
| | | |
| | | destEquip = dogzEquipPack.GetAt(equipPackIndex)
|
| | | if ItemCommon.DoLogicSwitchItem(curPlayer, curEquip, destEquip, ShareDefine.rptDogzEquip):
|
| | | succIndexList.append(equipIndex)
|
| | |
|
| | | dogzEquipPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzEquip)
|
| | | equipPackIndex = GetDogzEquipPackIndex(dogzID, equipPlaceIndex)
|
| | | if equipPackIndex < 0 or equipPackIndex >= dogzEquipPack.GetCount():
|
| | | GameWorld.ErrLog("神兽装备背包索引异常: dogzID=%s,equipPlace=%s,equipPackIndex=%s" % (dogzID, equipPlace, equipPackIndex))
|
| | | return
|
| | | |
| | | equipColor = curEquip.GetItemColor()
|
| | | limitColor = equipPlaceColorList[equipPlaceIndex]
|
| | | if equipColor < limitColor:
|
| | | GameWorld.Log("神兽装备位穿戴颜色限制:dogzID=%s,equipPlaceIndex=%s,limitColor=%s > equipColor=%s" |
| | | % (dogzID, equipPlaceIndex, limitColor, equipColor), playerID)
|
| | | return
|
| | | |
| | | destEquip = dogzEquipPack.GetAt(equipPackIndex)
|
| | | isOK = ItemCommon.DoLogicSwitchItem(curPlayer, curEquip, destEquip, ShareDefine.rptDogzEquip)
|
| | | if not isOK:
|
| | | GameWorld.DebugLog(" 穿戴成功索引列表: %s" % succIndexList, playerID)
|
| | | if not succIndexList:
|
| | | return
|
| | |
|
| | | # 助战状态换装需要刷属性
|
| | |
| | |
|
| | | # 技能属性,从Def_CalcAttrFunc_Dogz获取
|
| | | skillAttrList = CalcDogzBattleSkillAttr(curPlayer)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_HorseSkill, skillAttrList)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_DogzBattleSkill, skillAttrList)
|
| | | return
|
| | |
|
| | |
|
| | | # 助战神兽技能属性,必须在 SetDogzIsHelpFight后调用
|
| | | def CalcDogzBattleSkillAttr(curPlayer):
|
| | |
| | | curEffect = curSkill.GetEffect(effectIndex)
|
| | | SkillShell.CalcBuffEffAttr(curPlayer, curEffect, skillAttrList)
|
| | |
|
| | | # Def_SkillType_AttrSkillNoLearn 非学习属性技能 叠加属性计算
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyDataMgr.GetDogzCount()):
|
| | | ipyData = ipyDataMgr.GetDogzByIndex(i)
|
| | | if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_DogzFightState, i):
|
| | | #未助战
|
| | | continue
|
| | | |
| | | for skillID in ipyData.GetHelpBattleSkills():
|
| | |
|
| | | skillData = GameWorld.GetGameData().GetSkillBySkillID(skillID)
|
| | | if not skillData:
|
| | | continue
|
| | | # 同技能类型ID可多个叠加的属性时直接取表
|
| | | if skillData.GetSkillType() != ChConfig.Def_SkillType_AttrSkillNoLearn:
|
| | | continue
|
| | | |
| | | for effectIndex in xrange(skillData.GetEffectCount()):
|
| | | curEffect = skillData.GetEffect(effectIndex)
|
| | | SkillShell.CalcBuffEffAttr(curPlayer, curEffect, skillAttrList)
|
| | |
|
| | | #GameWorld.DebugLog("神兽技能属性: skillFPEx=%s, %s" % ( skillFPEx, skillAttrList))
|
| | | return skillAttrList
|