3428 子 【开发】神兽技能 / 【后端】神兽技能
| | |
| | | psFemale = _IPY_PlayerDefine.psFemale
|
| | | gitNormal = _IPY_PlayerDefine.gitNormal
|
| | | gitFreeSDK = _IPY_PlayerDefine.gitFreeSDK
|
| | | gitMRGame = _IPY_PlayerDefine.gitMRGame
|
| | | gitSPGame = _IPY_PlayerDefine.gitSPGame
|
| | | gitFaceBook = _IPY_PlayerDefine.gitFaceBook
|
| | | gitToken = _IPY_PlayerDefine.gitToken
|
| | | gitMax = _IPY_PlayerDefine.gitMax
|
| | |
| | | def GetPhone(self): return _IPY_Recv.IPY_CPlayerLogin_GetPhone(self)
|
| | | def GetServerID(self): return _IPY_Recv.IPY_CPlayerLogin_GetServerID(self)
|
| | | def GetAdult(self): return _IPY_Recv.IPY_CPlayerLogin_GetAdult(self)
|
| | | def GetExtraLen(self): return _IPY_Recv.IPY_CPlayerLogin_GetExtraLen(self)
|
| | | def GetExtra(self): return _IPY_Recv.IPY_CPlayerLogin_GetExtra(self)
|
| | | def __init__(self):
|
| | | this = _IPY_Recv.new_IPY_CPlayerLogin()
|
| | | try: self.this.append(this)
|
| | |
| | |
|
| | | # 血盾
|
| | | hurtValue = CalcBloodShield(atkObj, defObj, hurtValue)
|
| | | |
| | | remainHP = min(dMaxHP, max(0, dHP - hurtValue)) # 剩余血量
|
| | |
|
| | | remainHP = int(remainHP) #防范
|
| | |
| | | else:
|
| | | GameWorld.ErrLog('计算伤血值时,防守方类型错误:defObjType = %s' % (defObjType))
|
| | | return resultHurtType
|
| | |
|
| | | if GameObj.GetHP(defObj) > 0:
|
| | | # 被攻击者将部分伤害转化为血量, 返回转化的百分比(小数点)
|
| | | changePer = PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(defObj, atkObj, None, ChConfig.TriggerType_ChangeHurtToHP)
|
| | | if changePer:
|
| | | SkillCommon.SkillAddHP(defObj, 0, int(changePer*hurtValue))
|
| | |
|
| | | lostValue = dHP - GameObj.GetHP(defObj) # 实际掉血量
|
| | | resultHurtType.LostHP = lostValue
|
| | |
| | | atkBackHP += PlayerControl.GetPVPAtkBackHP(atkObj)
|
| | | # 百分比吸血
|
| | | atkBackHPPer = PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(atkObj, None, None, ChConfig.TriggerType_Buff_SuckBloodPer)
|
| | | atkBackHPPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, None, None, ChConfig.TriggerType_Buff_SuckBloodPer)
|
| | | atkBackHP += int(hurtValue * atkBackHPPer*1.0 / ChConfig.Def_MaxRateValue)
|
| | |
|
| | | suckHP += atkBackHP
|
| | |
| | | Def_CalcAttrFunc_PetSign, # 宠物签到 33
|
| | | Def_CalcAttrFunc_MagicWeaponSoul, # 法宝之魂属性34
|
| | | Def_CalcAttrFunc_Dogz, # 神兽35
|
| | | ) = range(36)
|
| | | Def_CalcAttrFunc_DogzBattleSkill, # 助战神兽技能36
|
| | | ) = range(37)
|
| | |
|
| | |
|
| | | # 在此列表中的功能属性,不享受百分比加成,--属性参与战力计算
|
| | |
| | | ]
|
| | |
|
| | | # 在此列表中的功能属性,不享受百分比加成,--属性不参与战力计算,战力由技能配置决定
|
| | | CalcAttrExFuncListNoFightPower = [Def_CalcAttrFunc_HorseSkill, Def_CalcAttrFunc_PetSkill]
|
| | | CalcAttrExFuncListNoFightPower = [Def_CalcAttrFunc_HorseSkill, Def_CalcAttrFunc_PetSkill, Def_CalcAttrFunc_DogzBattleSkill]
|
| | |
|
| | |
|
| | | #战斗力分组类型对应功能点属性分类索引列表,并不是一一对应的,有些战斗力类型可由多个功能点组成
|
| | |
| | | TriggerType_Buff_BeAttackSubLayer, # BUFF类:被攻击减buff层,0消失 48
|
| | | TriggerType_OneDamage, # 伤害降低到1点 49
|
| | | TriggerType_LuckyHit, # 会心一击时增加会心伤害百分比 50
|
| | | ) = range(1, 51)
|
| | | TriggerType_ChangeHurtToHP, # 把受到伤害的xx%转化为生命值 51
|
| | | ) = range(1, 52)
|
| | |
|
| | |
|
| | | # NPC功能类型定义
|
| | |
| | | def GetPhone(self): return _IPY_ClientToServer.IPY_CPlayerLogin_GetPhone(self)
|
| | | def GetServerID(self): return _IPY_ClientToServer.IPY_CPlayerLogin_GetServerID(self)
|
| | | def GetAdult(self): return _IPY_ClientToServer.IPY_CPlayerLogin_GetAdult(self)
|
| | | def GetExtraLen(self): return _IPY_ClientToServer.IPY_CPlayerLogin_GetExtraLen(self)
|
| | | def GetExtra(self): return _IPY_ClientToServer.IPY_CPlayerLogin_GetExtra(self)
|
| | | def __init__(self):
|
| | | this = _IPY_ClientToServer.new_IPY_CPlayerLogin()
|
| | | try: self.this.append(this)
|
| | |
| | | psFemale = _IPY_PlayerDefine.psFemale
|
| | | gitNormal = _IPY_PlayerDefine.gitNormal
|
| | | gitFreeSDK = _IPY_PlayerDefine.gitFreeSDK
|
| | | gitMRGame = _IPY_PlayerDefine.gitMRGame
|
| | | gitSPGame = _IPY_PlayerDefine.gitSPGame
|
| | | gitFaceBook = _IPY_PlayerDefine.gitFaceBook
|
| | | gitToken = _IPY_PlayerDefine.gitToken
|
| | | gitMax = _IPY_PlayerDefine.gitMax
|
| | |
| | | import IpyGameDataPY
|
| | | import ChConfig
|
| | | import ChEquip
|
| | | import PassiveBuffEffMng
|
| | | import SkillCommon
|
| | | import SkillShell
|
| | |
|
| | | '''
|
| | | 神兽编号: 1~20,上线后不可修改
|
| | |
| | | ## 设置神兽是否助战状态
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_DogzFightState, dogzID - 1, 1 if isFight else 0)
|
| | | Sync_DogzHelpbattleState(curPlayer, dogzID, isFight)
|
| | | |
| | | # 设置成功后才能刷技能
|
| | | PassiveBuffEffMng.PlayerDogzSkill(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | # 保存计算值
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Dogz, allAttrList)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_Dogz, fightPowerEx)
|
| | | |
| | | # 技能属性,从Def_CalcAttrFunc_Dogz获取
|
| | | skillAttrList = CalcDogzBattleSkillAttr(curPlayer)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_HorseSkill, skillAttrList)
|
| | | return
|
| | |
|
| | | # 助战神兽技能属性,必须在 SetDogzIsHelpFight后调用
|
| | | def CalcDogzBattleSkillAttr(curPlayer):
|
| | | skillAttrList = [{} for _ in range(4)]
|
| | | skillManager = curPlayer.GetSkillManager()
|
| | |
|
| | | for i in range(0 , skillManager.GetSkillCount()):
|
| | | curSkill = skillManager.GetSkillByIndex(i)
|
| | | if not curSkill:
|
| | | continue
|
| | | |
| | | if curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_Dogz:
|
| | | continue
|
| | | |
| | | if not SkillCommon.isPassiveAttr(curSkill):
|
| | | continue
|
| | | |
| | | |
| | | for effectIndex in xrange(curSkill.GetEffectCount()):
|
| | | curEffect = curSkill.GetEffect(effectIndex)
|
| | | SkillShell.CalcBuffEffAttr(curPlayer, curEffect, skillAttrList)
|
| | | |
| | | |
| | | #GameWorld.DebugLog("神兽技能属性: skillFPEx=%s, %s" % ( skillFPEx, skillAttrList))
|
| | | return skillAttrList
|
| | |
|
| | |
|
| | | def Sync_DogzInfo(curPlayer):
|
| | | ## 同步神兽信息
|
| | | dogzInfoPack = ChPyNetSendPack.tagMCDogzInfo()
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #
|
| | | # @todo: 全体出战神兽(包括装备)XX属性值+xx%
|
| | | #
|
| | | # @author: Alee
|
| | | # @date 2018-1-20 下午02:50:26
|
| | | # @version 1.0
|
| | | #
|
| | | # @note: |
| | | #
|
| | | #---------------------------------------------------------------------
|
| | | #导入
|
| | | import ChConfig
|
| | | import PlayerControl
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ## buff线性增加属性
|
| | | # @param defender Buff承受者
|
| | | # @param curEffect 技能效果
|
| | | # @param calcDict 技能效果累加总表
|
| | | # @return None
|
| | | def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
|
| | | attrType = curEffect.GetEffectValue(1)
|
| | | attrList = PlayerControl.GetCalcAttrListValue(defender, ChConfig.Def_CalcAttrFunc_DogzBattleSkill)
|
| | | value = int(attrList[2].get(attrType, 0)*curEffect.GetEffectValue(0)*1.0/ChConfig.Def_MaxRateValue)
|
| | | |
| | | calcDict[attrType] = calcDict.get(attrType, 0) + value
|
| | | |
| | | return
|
| | |
|
| | |
|
| | | ## 返回buff类型,线性与否
|
| | | # @param |
| | | # @return None
|
| | | # @remarks 函数详细说明. |
| | | def GetCalcType():
|
| | | return ChConfig.TYPE_Linear
|
| | |
|
| | |
|
| | |
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #
|
| | | # @todo: 当前神兽(包括装备)属性项(如生命)+xx%,可多配
|
| | | #
|
| | | # @author: Alee
|
| | | # @date 2018-1-20 下午02:50:26
|
| | | # @version 1.0
|
| | | #
|
| | | # @note: |
| | | #
|
| | | #---------------------------------------------------------------------
|
| | | #导入
|
| | | import ChConfig
|
| | | import PlayerControl
|
| | | import ShareDefine
|
| | | import IpyGameDataPY
|
| | | import PlayerDogz
|
| | | import ChEquip
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ## buff线性增加属性
|
| | | # @param defender Buff承受者
|
| | | # @param curEffect 技能效果
|
| | | # @param calcDict 技能效果累加总表
|
| | | # @return None
|
| | | def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
|
| | | attrType = curEffect.GetEffectValue(1)
|
| | | attrList = GetTheDogzAttr(defender, curEffect.GetEffectValue(2))
|
| | | value = int(attrList[2].get(attrType, 0)*curEffect.GetEffectValue(0)*1.0/ChConfig.Def_MaxRateValue)
|
| | | |
| | | calcDict[attrType] = calcDict.get(attrType, 0) + value
|
| | | |
| | | return
|
| | |
|
| | |
|
| | | ## 返回buff类型,线性与否
|
| | | # @param |
| | | # @return None
|
| | | # @remarks 函数详细说明. |
| | | def GetCalcType():
|
| | | return ChConfig.TYPE_Linear
|
| | |
|
| | | # 指定神兽属性
|
| | | def GetTheDogzAttr(curPlayer, dogzID):
|
| | | allAttrList = [{} for _ in range(4)]
|
| | | |
| | | dogzEquipPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzEquip)
|
| | | equipPackCount = dogzEquipPack.GetCount()
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("Dogz", dogzID)
|
| | | if not ipyData:
|
| | | return allAttrList
|
| | | |
| | | # 1. 基础属性
|
| | | attrTypeList = ipyData.GetBaseAttrTypes()
|
| | | attrValueList = ipyData.GetBaseAttrValues()
|
| | | if attrTypeList and len(attrTypeList) == len(attrValueList):
|
| | | for attrIndex, baseAttrID in enumerate(attrTypeList):
|
| | | baseAttrValue = attrValueList[attrIndex]
|
| | | PlayerControl.CalcAttrDict_Type(baseAttrID, baseAttrValue, allAttrList)
|
| | | #GameWorld.DebugLog(" 基础属性: baseAttrID=%s,baseAttrValue=%s, %s" % (baseAttrID, baseAttrValue, allAttrList))
|
| | | |
| | | # 2. 装备属性
|
| | | startIndex = (dogzID - 1) * PlayerDogz.DogzEquipCount
|
| | | for equipIndex in range(startIndex, startIndex + PlayerDogz.DogzEquipCount):
|
| | | if equipIndex < 0 or equipIndex >= equipPackCount:
|
| | | break
|
| | | curEquip = dogzEquipPack.GetAt(equipIndex) |
| | | if curEquip.IsEmpty():
|
| | | continue
|
| | | |
| | | #itemID = curEquip.GetItemTypeID()
|
| | | # 装备基础属性
|
| | | for effIndex in xrange(curEquip.GetEffectCount()):
|
| | | curEffect = curEquip.GetEffectByIndex(effIndex)
|
| | | if not curEffect or not curEffect.GetEffectID():
|
| | | break
|
| | | effID = curEffect.GetEffectID()
|
| | | 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))
|
| | | |
| | | # 强化属性
|
| | | curPlusLV = curEquip.GetUserAttrByIndex(ShareDefine.Def_IudetDogzEquipPlus, 0)
|
| | | plusIpyData = IpyGameDataPY.GetIpyGameData("DogzEquipPlus", curEquip.GetEquipPlace(), curPlusLV)
|
| | | if plusIpyData:
|
| | | plusAttrTypeList = plusIpyData.GetPlusAttrTypes()
|
| | | plusAttrValueList = plusIpyData.GetPlusAttrValues()
|
| | | 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))
|
| | | |
| | | # 传奇属性
|
| | | ChEquip.CalcAttr_LegendAttr(curPlayer, curEquip, allAttrList)
|
| | |
|
| | | return allAttrList
|
| | |
|
| | |
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #
|
| | | # @todo: buff中把受到伤害的xx%转化为生命值
|
| | | #
|
| | | # @author: Alee
|
| | | # @date 2018-1-30 下午05:11:45
|
| | | # @version 1.0
|
| | | #
|
| | | # @note: |
| | | #
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | |
|
| | | def CheckCanHappen(attacker, defender, passiveEffect, skillID):
|
| | | return True
|
| | |
|
| | |
|
| | | def GetValue(attacker, defender, passiveEffect):
|
| | | return float(passiveEffect.GetEffectValue(0))/ChConfig.Def_MaxRateValue
|
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #
|
| | | # @todo: 增加所有攻击伤害 含普攻
|
| | | # @todo: 增加所有攻击伤害 含普攻 附加血量判断 --(PVP)主角生命值低于30%时,所有技能伤害再增加60%
|
| | | #
|
| | | # @author: Alee
|
| | | # @date 2018-1-9 下午09:39:37
|
| | |
| | |
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | # 未配置不验证血量百分比
|
| | | hpPer = effect.GetEffectValue(2)
|
| | | if hpPer:
|
| | | if GameObj.GetHP(attacker)*ChConfig.Def_MaxRateValue/GameObj.GetMaxHP(attacker) >= hpPer:
|
| | | return False
|
| | | |
| | | |
| | | return GameWorld.CanHappen(effect.GetEffectValue(1))
|
| | |
|
| | |
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #
|
| | | # @todo: 生命值低于15%时,每次攻击将造成伤害的30%转化为自身生命
|
| | | #
|
| | | # @author: Alee
|
| | | # @date 2018-1-9 下午09:39:37
|
| | | # @version 1.0
|
| | | #
|
| | | # @note: |
| | | #
|
| | | #---------------------------------------------------------------------
|
| | | import GameObj
|
| | | import ChConfig
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill): |
| | | hpPer = effect.GetEffectValue(0)
|
| | | if GameObj.GetHP(attacker)*ChConfig.Def_MaxRateValue/GameObj.GetMaxHP(attacker) >= hpPer:
|
| | | return False
|
| | | |
| | | return True
|
| | | |
| | |
|
| | | def GetValue(attacker, defender, effect):
|
| | | return effect.GetEffectValue(1)
|
| | |
| | |
|
| | | GetPassiveEffManager().RegistPassiveBuff(curPlayer)
|
| | |
|
| | | # 助战神兽技能
|
| | | GetPassiveEffManager().RegistPassiveEffDogz(curPlayer)
|
| | |
|
| | | #-被动逻辑处理--------------------------------------------------------------------------------------------------
|
| | | ##离开地图处理
|
| | |
| | | 4049:ChConfig.TriggerType_MissSuccessPer, # 闪避成功率提升
|
| | | 4050:ChConfig.TriggerType_OneDamage, # 伤害降低到1点
|
| | | 4051:ChConfig.TriggerType_LuckyHit, # 会心一击时增加会心伤害百分比 50
|
| | | 4052:ChConfig.TriggerType_Buff_SuckBloodPer, # 攻击 百分比吸血
|
| | | }
|
| | | return tdict.get(effectID, -1)
|
| | | #===========================================================================
|
| | |
| | | 4511:ChConfig.TriggerType_AttackAddFinalValue, #攻击增加输出伤害11
|
| | | 4512:ChConfig.TriggerType_ReduceHurtHPPer, # 百分比减少攻击计算后伤害
|
| | | 4513:ChConfig.TriggerType_AttackAddFinalValue, #攻击增加输出伤害11
|
| | | 4515:ChConfig.TriggerType_AddIceAtkPer, # BUFF类:攻击附加真实伤害百分比 |
| | | 4515:ChConfig.TriggerType_AddIceAtkPer, # BUFF类:攻击附加真实伤害百分比
|
| | | 4516:ChConfig.TriggerType_ChangeHurtToHP, # BUFF类:buff中把受到伤害的xx%转化为生命值
|
| | | 803:ChConfig.TriggerType_BloodShield, # 血盾
|
| | | 806:ChConfig.TriggerType_BloodShield, # 血盾
|
| | | 808:ChConfig.TriggerType_BloodShield, # 血盾
|
| | |
| | | self.AffectBuffDict = {} # 当前正受影响的效果buff, key为触发点
|
| | | self.AffectSkillDict = {} # 被动技能 {(触发模式, 被影响的技能ID):[被动技能ID,效果]
|
| | | self.AffectPassiveSkillSetDict = {} # 被动技能装备 {(触发模式, 被影响的技能ID):[被动技能ID,效果]
|
| | | |
| | | self.AffectDogzSkillDict = {} # 神兽助战技能
|
| | |
|
| | | #记录会影响其他技能或者被动触发释放技能的BUFF
|
| | | def AddBuffInfoByEffect(self, effect, skillID):
|
| | |
| | | return self.AffectBuffDict.get((triggerType, 0), {})
|
| | |
|
| | |
|
| | | # 重刷神兽助战技能
|
| | | def RefreshDogzBattleSkill(self):
|
| | | self.AffectDogzSkillDict = {}
|
| | | skills = FindDogzBattleSkills(self.gameObj)
|
| | | |
| | | for curSkill in skills:
|
| | | if not SkillCommon.isPassiveTriggerSkill(curSkill):
|
| | | continue
|
| | | |
| | | skillTypeID = curSkill.GetSkillTypeID()
|
| | | |
| | | connSkillID = SkillShell.GetConnectSkillID(curSkill) # 关联技能ID, 0代表不限技能
|
| | | for i in xrange(curSkill.GetEffectCount()):
|
| | | curEffect = curSkill.GetEffect(i)
|
| | | effectID = curEffect.GetEffectID()
|
| | | if effectID == 0:
|
| | | continue
|
| | | |
| | | triggerType = GetTriggerTypeByEffectID(effectID)
|
| | | if triggerType == -1:
|
| | | continue
|
| | | |
| | | key = (triggerType,connSkillID)
|
| | | if key not in self.AffectDogzSkillDict:
|
| | | self.AffectDogzSkillDict[key] = []
|
| | | |
| | | self.AffectDogzSkillDict[key].append((skillTypeID, effectID))
|
| | | |
| | | return self.AffectDogzSkillDict
|
| | | |
| | | |
| | | # 重刷可装备的被动技能
|
| | | def RefreshPassiveSkillSet(self):
|
| | | self.AffectPassiveSkillSetDict = {}
|
| | |
| | | if not SkillCommon.isPassiveTriggerSkill(curSkill):
|
| | | continue
|
| | |
|
| | | if curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_FbPassiveSkill:
|
| | | # 被动技能需装备
|
| | | if curSkill.GetFuncType() in [ChConfig.Def_SkillFuncType_FbPassiveSkill,
|
| | | ChConfig.Def_SkillFuncType_Dogz]:
|
| | | # 被动技能和神兽需设置才有效
|
| | | continue
|
| | |
|
| | | skillTypeID = curSkill.GetSkillTypeID()
|
| | |
| | | ## skillList=self.AffectSkillDict.get((triggerType, connSkillID), [])再用extend会导致AffectSkillDict无限增长
|
| | | skillList.extend(self.AffectSkillDict.get((triggerType, connSkillID), []))
|
| | | skillList.extend(self.AffectPassiveSkillSetDict.get((triggerType, connSkillID), []))
|
| | | skillList.extend(self.AffectDogzSkillDict.get((triggerType, connSkillID), []))
|
| | | if connSkillID != 0 and connSkillID != ChConfig.Def_SkillID_Somersault:
|
| | | skillList.extend(self.AffectSkillDict.get((triggerType, 0), []))
|
| | | skillList.extend(self.AffectPassiveSkillSetDict.get((triggerType, 0), []))
|
| | | |
| | | skillList.extend(self.AffectDogzSkillDict.get((triggerType, 0), []))
|
| | | return skillList
|
| | |
|
| | | #所有obj的被动效果管理
|
| | |
| | | self.AddPassiveEff(gameObj, passiveEff)
|
| | | else:
|
| | | passiveEff.RefreshPassiveSkillSet()
|
| | | return
|
| | | |
| | | |
| | | # 人物需同步注册神兽技能
|
| | | def RegistPassiveEffDogz(self, gameObj):
|
| | | passiveEff = self.GetPassiveEff(gameObj)
|
| | | if not passiveEff:
|
| | | # 强制刷新所有被动技能
|
| | | passiveEff = PassiveEff(gameObj)
|
| | | if not passiveEff.RefreshDogzBattleSkill():
|
| | | return
|
| | | self.AddPassiveEff(gameObj, passiveEff)
|
| | | else:
|
| | | passiveEff.RefreshDogzBattleSkill()
|
| | | return
|
| | |
|
| | |
|
| | |
| | |
|
| | | return curValue
|
| | |
|
| | |
|
| | | # 因为要兼容低等级技能,所以技能只能是在助战的时候,先删除神兽技能再学习新的助战神兽技能
|
| | | def PlayerDogzSkill(curPlayer):
|
| | |
|
| | | dogzSkills = [] # 需要学习的技能
|
| | | 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
|
| | | |
| | | dogzSkills.extend(ipyData.GetHelpBattleSkills())
|
| | | |
| | | delDogzSkills = [] # 删除不在助战神兽队列的技能
|
| | | skillManager = curPlayer.GetSkillManager()
|
| | | for i in xrange(skillManager.GetSkillCount()):
|
| | | curSkill = skillManager.GetSkillByIndex(i)
|
| | | if curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_Dogz:
|
| | | continue
|
| | | skillID = curSkill.GetSkillID()
|
| | | if skillID in dogzSkills:
|
| | | dogzSkills.pop(skillID)
|
| | | continue
|
| | | |
| | | delDogzSkills.append(skillID)
|
| | | |
| | | GameWorld.DebugLog("PlayerDogzSkill:%s - 删除%s"%(dogzSkills, delDogzSkills))
|
| | | |
| | | # 删除非助战技能
|
| | | for skillID in delDogzSkills:
|
| | | skillManager.DeleteSkillBySkillID(skillID, False)
|
| | | |
| | | # 添加助战技能,同类技能取最高
|
| | | dogzSkills.sort()
|
| | | for skillID in dogzSkills:
|
| | | skillManager.LearnSkillByID(skillID, False)
|
| | | |
| | | # 刷被动效果
|
| | | GetPassiveEffManager().RegistPassiveEffDogz(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | # 获取助战神兽的技能列表
|
| | | def FindDogzBattleSkills(gameObj):
|
| | | skills = []
|
| | | if gameObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
| | | return skills
|
| | | |
| | | skillManager = gameObj.GetSkillManager()
|
| | | for i in xrange(skillManager.GetSkillCount()):
|
| | | curSkill = skillManager.GetSkillByIndex(i)
|
| | | if not curSkill:
|
| | | continue
|
| | | |
| | | if curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_Dogz:
|
| | | continue
|
| | | skills.append(curSkill)
|
| | | |
| | | return skills
|