| | |
| | | import SkillCommon
|
| | | import SkillShell
|
| | | import PlayerSuccess
|
| | | import DataRecordPack
|
| | | import PlayerWeekParty
|
| | | import ItemControler
|
| | |
|
| | | import time
|
| | |
|
| | |
| | |
|
| | | # 设置成功后才能刷技能
|
| | | PassiveBuffEffMng.PlayerDogzSkill(curPlayer)
|
| | | if not isFight:
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_Dogz, {'dogzID':dogzID})
|
| | | return
|
| | |
|
| | |
|
| | |
| | | for equipIndex in equipIndexList:
|
| | | dogzItemPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzItem)
|
| | | curEquip = dogzItemPack.GetAt(equipIndex)
|
| | | if not ItemCommon.CheckItemCanUse(curEquip):
|
| | | if not ItemCommon.CheckItemCanUse(curEquip) or ItemControler.GetIsAuctionItem(curEquip):
|
| | | GameWorld.DebugLog("物品为空或不可用: equipIndex=%s" % equipIndex, playerID)
|
| | | continue
|
| | | if not ItemCommon.GetIsDogzEquip(curEquip):
|
| | |
| | | continue
|
| | |
|
| | | destEquip = dogzEquipPack.GetAt(equipPackIndex)
|
| | | desItemID, desUserData = [0, ''] if destEquip.IsEmpty() else [destEquip.GetItemTypeID(), destEquip.GetUserData()]
|
| | | srcItemID, srcUserData = curEquip.GetItemTypeID(), curEquip.GetUserData()
|
| | | if ItemCommon.DoLogicSwitchItem(curPlayer, curEquip, destEquip, ShareDefine.rptDogzEquip):
|
| | | succIndexList.append(equipIndex)
|
| | | dataDict = {'dotype':'EquipDogzItem', 'desItemID':desItemID, 'desUserData':desUserData,'srcItemID':srcItemID,'srcUserData':srcUserData}
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_EquipChange, dataDict)
|
| | |
|
| | | GameWorld.DebugLog(" 穿戴成功索引列表: %s" % succIndexList, playerID)
|
| | | if not succIndexList:
|
| | |
| | | GameWorld.DebugLog("神兽有装备未穿戴,无法助战!dogzID=%s,packIndex=%s" % (dogzID, i), playerID)
|
| | | return
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_DogzBattle, 1, [dogzID])
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Dogz, dogzID, False)
|
| | |
|
| | | isFight = True if batteState else False
|
| | | GameWorld.DebugLog("神兽助战状态变更!dogzID=%s,isFight=%s" % (dogzID, isFight), playerID)
|
| | |
| | | totalPlusLv = 0 #出战神兽装备总强化等级
|
| | | fightPowerEx = 0
|
| | | allAttrList = [{} for _ in range(4)]
|
| | | allAttrListEquip = [{} for _ in range(4)]
|
| | | allAttrListEquipPlus = [{} for _ in range(4)]
|
| | | equipScoreTotal = 0 #为解决装备评分、战力不一致的情况,装备战力改为由评分作为参数计算战力
|
| | |
|
| | | dogzEquipPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzEquip)
|
| | | equipPackCount = dogzEquipPack.GetCount()
|
| | |
| | | if curEquip.IsEmpty():
|
| | | continue
|
| | |
|
| | | equipScoreTotal += ItemCommon.GetEquipGearScore(curEquip)
|
| | | |
| | | #itemID = curEquip.GetItemTypeID()
|
| | | # 装备基础属性
|
| | | for effIndex in xrange(curEquip.GetEffectCount()):
|
| | |
| | | if not effID or effID == ChConfig.Def_Effect_DogzEquipPlusExp:
|
| | | continue
|
| | | effValue = curEffect.GetEffectValue(0)
|
| | | PlayerControl.CalcAttrDict_Type(effID, effValue, allAttrList)
|
| | | #GameWorld.DebugLog(" 装备基础: itemID=%s,effID=%s,effValue=%s, %s" % (itemID, effID, effValue, allAttrList))
|
| | | PlayerControl.CalcAttrDict_Type(effID, effValue, allAttrListEquip)
|
| | | #GameWorld.DebugLog(" 装备基础: itemID=%s,effID=%s,effValue=%s, %s" % (itemID, effID, effValue, allAttrListEquip))
|
| | |
|
| | | # 强化属性
|
| | | curPlusLV = curEquip.GetUserAttrByIndex(ShareDefine.Def_IudetDogzEquipPlus, 0)
|
| | |
| | | if plusAttrTypeList and len(plusAttrTypeList) == len(plusAttrValueList):
|
| | | for plusIndex, plusAttrID in enumerate(plusAttrTypeList):
|
| | | plusAttrValue = plusAttrValueList[plusIndex]
|
| | | PlayerControl.CalcAttrDict_Type(plusAttrID, plusAttrValue, allAttrList)
|
| | | #GameWorld.DebugLog(" 装备强化: itemID=%s,plusAttrID=%s, plusAttrValue=%s, %s" % (itemID, plusAttrID, plusAttrValue, allAttrList))
|
| | | PlayerControl.CalcAttrDict_Type(plusAttrID, plusAttrValue, allAttrListEquipPlus)
|
| | | #GameWorld.DebugLog(" 装备强化: itemID=%s,plusAttrID=%s, plusAttrValue=%s, %s" % (itemID, plusAttrID, plusAttrValue, allAttrListEquipPlus))
|
| | |
|
| | | # 传奇属性
|
| | | ChEquip.CalcAttr_LegendAttr(curPlayer, curEquip, allAttrList)
|
| | | #GameWorld.DebugLog(" 装备传奇: itemID=%s,%s" % (itemID, allAttrList))
|
| | | ChEquip.CalcAttr_LegendAttr(curPlayer, curEquip, allAttrListEquip)
|
| | | #GameWorld.DebugLog(" 装备传奇: itemID=%s,%s" % (itemID, allAttrListEquip))
|
| | |
|
| | | # 附加战力
|
| | | fightPowerEx += ipyData.GetFightPowerEx()
|
| | |
|
| | | # 保存计算值
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Dogz, allAttrList)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_DogzEquip, allAttrListEquip)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_DogzEquipPlus, allAttrListEquipPlus)
|
| | | |
| | | #计算装备基础属性附加战力 (目前组成: 评分战力 + ...)
|
| | | equipFightPowerEx = eval(IpyGameDataPY.GetFuncCompileCfg("FightpowerFormula", 2))
|
| | | #GameWorld.DebugLog("神兽装备评分战力: equipScoreTotal=%s,equipFightPowerEx=%s" % (equipScoreTotal, equipFightPowerEx))
|
| | | fightPowerEx += equipFightPowerEx
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_Dogz, fightPowerEx)
|
| | |
|
| | | # 技能属性,从Def_CalcAttrFunc_Dogz获取
|