| | |
| | | global g_ClientHurtDict
|
| | | g_ClientHurtDict = collections.OrderedDict()
|
| | |
|
| | | # 缓存单次技能攻击的最大伤害, 减少计算量
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientMaxHurtValue, 0)
|
| | | |
| | |
|
| | | def GetClientHurtByObj(objID, objType):
|
| | | global g_ClientHurtDict
|
| | |
| | | #使用技能行为状态, 客户端限制
|
| | | if not OperControlManager.IsObjCanDoAction(curPlayer,
|
| | | ChConfig.Def_Obj_ActState_ClientSkill,
|
| | | curSkill.GetSkillOfSeries()):
|
| | | curSkill.GetSkillOfSeries(), curSkill):
|
| | | AttackFailNotify(curPlayer, curSkill)
|
| | | return
|
| | |
|
| | |
| | |
|
| | | #获得技能等级
|
| | | curSkillLV = curSkill.GetSkillLV()
|
| | | |
| | | DataRecordPack.DR_LearnORUPSkill(curPlayer, curSkillID, curSkillLV)
|
| | |
|
| | | EventShell.EventRespons_SkillUp(curPlayer, curSkill.GetFuncType())
|
| | | GameWorld.Log("升级技能名 = %s 成功, 当前等级 = %s"%(curSkill.GetSkillName(), curSkill.GetSkillLV()), curPlayer.GetPlayerID())
|
| | | return True
|
| | |
|
| | |
| | | return False
|
| | |
|
| | | #玩家属性点要求
|
| | | stateSkillLV = curSkill.GetStateSkillLV() #需要基础属性ID*10000+需要属性点
|
| | | needBaseAttrID, needBaseAttrValue = stateSkillLV /10000, stateSkillLV%10000
|
| | | stateSkillLV = curSkill.GetStateSkillLV() #需要基础属性ID*100000+需要属性点
|
| | | needBaseAttrID, needBaseAttrValue = GetSkillUpNeedAttr(stateSkillLV)
|
| | | if needBaseAttrID and needBaseAttrValue:
|
| | | baseAttrDict = {
|
| | | ShareDefine.Def_Effect_Metal:PlayerControl.GetMetal(curPlayer),
|
| | |
| | | return False
|
| | |
|
| | | return True
|
| | | ## 获取技能升级属性需求 rutrun attrID, attrvalue
|
| | | def GetSkillUpNeedAttr(stateSkillLV):return stateSkillLV /100000, stateSkillLV%100000
|
| | |
|
| | | #// A5 16 选择技能五行专精 #tagCMSelectSkillElement
|
| | | #
|
| | |
| | | if not ipyData:
|
| | | return
|
| | | mainSkillID = ipyData.GetMainSkillID()
|
| | | |
| | | if curPlayer.GetLV() < ipyData.GetNeedLV():
|
| | | GameWorld.DebugLog('选择技能五行专精等级不足!')
|
| | | return
|
| | | |
| | | curElementSkillID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SkillElementID % mainSkillID)
|
| | | if selectSkillID == curElementSkillID:
|
| | | GameWorld.DebugLog('已经是该专精技能!')
|
| | |
| | | #更新新技能
|
| | | RefreshElementSkill(curPlayer, selectSkillID)
|
| | | # 重刷被动技能
|
| | | PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curPlayer) |
| | | PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curPlayer)
|
| | | # 重刷技能战力
|
| | | PlayerControl.PlayerControl(curPlayer).RefreshAllSkill()
|
| | | PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
|
| | |
|
| | | NotifyElementSkillInfo(curPlayer, mainSkillID)
|
| | | return
|
| | |
| | | maxSkillLV = len(limitInfoList)
|
| | | updSkillLV = 0
|
| | | for i, limitInfo in enumerate(limitInfoList):
|
| | | needAttrID, needAttrValue = limitInfo /10000, limitInfo%10000
|
| | | needAttrID, needAttrValue = GetSkillUpNeedAttr(limitInfo)
|
| | | curAttrValue = baseAttrDict.get(needAttrID, 0)
|
| | | if curAttrValue >= needAttrValue:
|
| | | updSkillLV = maxSkillLV - i
|
| | |
| | | skillManager = curPlayer.GetSkillManager()
|
| | | curSkill = skillManager.FindSkillBySkillTypeID(skillTypeID)
|
| | | curSkillLV = curSkill.GetSkillLV() if curSkill else 0
|
| | | |
| | |
|
| | | if updSkillLV == curSkillLV:
|
| | | return
|
| | | elif updSkillLV < curSkillLV:
|
| | |
| | | def RefreshElementSkillByAttr(curPlayer, attrIDList):
|
| | | #加点、丹药、境界、洗点 会影响灵根点
|
| | | __InitElementSkillInfo()
|
| | | isRefresh = False
|
| | | |
| | | needRefreshSkillIDList = []
|
| | | skillManager = curPlayer.GetSkillManager()
|
| | | for i in xrange(skillManager.GetSkillCount()):
|
| | | hasSkill = skillManager.GetSkillByIndex(i)
|
| | | hasSkillID = hasSkill.GetSkillID()
|
| | | hasSkillID = hasSkill.GetSkillTypeID()
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('SkillElement', {'MainSkillID':hasSkillID}, False, False)
|
| | | if not ipyData:
|
| | | continue
|
| | |
| | | continue
|
| | | if curElementSkillID not in PyGameData.g_elemntSkillDict:
|
| | | continue
|
| | | if PyGameData.g_elemntSkillDict[curElementSkillID][0] /10000 not in attrIDList:
|
| | | attrID = GetSkillUpNeedAttr(PyGameData.g_elemntSkillDict[curElementSkillID][0])[0]
|
| | | if attrID not in attrIDList:
|
| | | continue
|
| | | if RefreshElementSkill(curPlayer, curElementSkillID):
|
| | | needRefreshSkillIDList.append(curElementSkillID)
|
| | | |
| | | isRefresh = False
|
| | | for skillID in needRefreshSkillIDList:
|
| | | if RefreshElementSkill(curPlayer, skillID):
|
| | | isRefresh = True
|
| | | if isRefresh:
|
| | | # 重刷被动技能
|
| | | PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curPlayer)
|
| | | # 重刷技能战力
|
| | | PlayerControl.PlayerControl(curPlayer).RefreshAllSkill()
|
| | | PlayerControl.PlayerControl(curPlayer).RefreshPlayerAttrState()
|
| | | return
|
| | |
|
| | | def GetElementSkillCnt(curPlayer):
|
| | |
| | | skillManager = curPlayer.GetSkillManager()
|
| | | for i in xrange(skillManager.GetSkillCount()):
|
| | | hasSkill = skillManager.GetSkillByIndex(i)
|
| | | hasSkillID = hasSkill.GetSkillID()
|
| | | hasSkillID = hasSkill.GetSkillTypeID()
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('SkillElement', {'MainSkillID':hasSkillID}, False, False)
|
| | | if not ipyData:
|
| | | continue
|
| | |
| | | return cnt
|
| | |
|
| | | def __InitElementSkillInfo():
|
| | | #缓存技能专精信息{skillID:[attrID*10000+needValue,..]}
|
| | | #缓存技能专精信息{skillID:[attrID*100000+needValue,..]}
|
| | | if not PyGameData.g_elemntSkillDict:
|
| | | ipyMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyMgr.GetSkillElementCount()):
|
| | |
| | | skillManager = curPlayer.GetSkillManager()
|
| | | for i in xrange(skillManager.GetSkillCount()):
|
| | | hasSkill = skillManager.GetSkillByIndex(i)
|
| | | hasSkillID = hasSkill.GetSkillID()
|
| | | hasSkillID = hasSkill.GetSkillTypeID()
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('SkillElement', {'MainSkillID':hasSkillID}, False, False)
|
| | | if not ipyData:
|
| | | continue
|
| | |
| | | callFunc = GameWorld.GetExecFunc(GameBuffs, "Buff_%s.%s"%(moduleSuffix, "OnCalcBuffEx"))
|
| | | if callFunc:
|
| | | callFunc(objDetel, curEffect, allAttrList[index], curBuff)
|
| | | |
| | | # 持续性属性变化的buff,目前只有持续减益
|
| | | callFunc = GameWorld.GetExecFunc(GameBuffs, "BuffProcess_%s.%s"%(moduleSuffix, "OnCalcBuffEx"))
|
| | | if callFunc:
|
| | | callFunc(objDetel, curEffect, allAttrList[index], curBuff)
|
| | | return
|
| | |
|
| | | ## 获得buff效果的计算模块文件后缀
|
| | |
| | | OperControlManager.SetObjActState(curObj, buffSkill)
|
| | |
|
| | |
|
| | | # 非属性技能算属性 特殊处理
|
| | | # 法宝SP技能 如1-4级为增加属性,第5级为伤害效果,第6-10级就要包含属性和伤害效果
|
| | | def CalcFabaoSPSkillAttr(curPlayer, curPlayerSkill, allAttrList):
|
| | | if curPlayerSkill.GetFuncType() != ChConfig.Def_SkillFuncType_FbSPSkill:
|
| | | return
|
| | | |
| | | value = GetMaxHPAttrValue(curPlayerSkill)
|
| | | if value == 0:
|
| | | return
|
| | | |
| | | PlayerControl.CalcAttrDict_Type(ShareDefine.Def_Effect_MaxHP, value, allAttrList)
|
| | | return
|
| | |
|
| | |
|
| | | # 计算属性类技能的属性,同buff层不算战力
|
| | | def CalcPassiveAttr_Effect(curPlayer, allAttrList):
|
| | |
| | | if curPlayerSkill == None:
|
| | | continue
|
| | |
|
| | | CalcFabaoSPSkillAttr(curPlayer, curPlayerSkill, allAttrList)
|
| | | if not SkillCommon.isPassiveAttr(curPlayerSkill):
|
| | | continue
|
| | |
|
| | |
| | | def CalcBuffers_Effect(curPlayer, allAttrList, calcEffectIDList=[]):
|
| | |
|
| | | for buffType in range(IPY_GameWorld.bfBuff, IPY_GameWorld.btBufMax):
|
| | | #这些类型不影响玩家计算属性
|
| | | if buffType in [IPY_GameWorld.bfProcessBuff, #IPY_GameWorld.bfProcessDeBuff, |
| | | IPY_GameWorld.bfMapBuff,
|
| | | IPY_GameWorld.bfEquipBuff]:
|
| | | continue
|
| | | |
| | | buffTuple = SkillCommon.GetBuffManagerByBuffType(curPlayer, buffType)
|
| | | #通过类型获取目标的buff管理器为空,则跳出
|
| | | if buffTuple == ():
|
| | | continue
|
| | | |
| | | #这些类型不影响玩家计算属性
|
| | | if buffType in [IPY_GameWorld.bfProcessBuff,
|
| | | IPY_GameWorld.bfProcessDeBuff, IPY_GameWorld.bfMapBuff,
|
| | | IPY_GameWorld.bfEquipBuff]:
|
| | | continue
|
| | |
|
| | | buffManager = buffTuple[0]
|
| | |
| | |
|
| | | # 不受限制和影响的技能
|
| | | def Trigger_UseSkill(attacker, defender, curSkill, tick, tagRoundPosX = 0, tagRoundPosY = 0, isEnhanceSkill = False):
|
| | |
|
| | |
|
| | | #这个技能是Buff
|
| | | if SkillCommon.IsBuff(curSkill):
|
| | |
| | | return True
|
| | |
|
| | |
|
| | | #===============================================================================
|
| | | # Def_Effect_GoddessAddHP = 1300 # 加血 (压总值血量百分比)
|
| | | # Def_Effect_AddHPValue_All = 1027 # 持续加血(压总值攻击)
|
| | | # Def_Effect_LostHPValue_All = 1033 # 持续减血(压总值攻击)
|
| | | # Def_Effect_LostAndAddHPValue_All = 1050 # 持续吸血(压总值攻击)
|
| | | # Def_Effect_LostHPValue_Single = 1201 # 持续单次减血计算 攻击
|
| | | # Def_Effect_AddHPValue_Single = 1202 # 持续单次加血计算 攻击
|
| | | # Def_Effect_LostHP_MaxHP = 1089 # 持续减血(压总值, 血量百分比)
|
| | | #===============================================================================
|
| | |
|
| | | #waring: 此值影响了BUFF的替换规则,值大替换小的
|
| | | ##添加BUFF前压入BUFF的值,这边只计算和攻击者相关,仅支持放在效果1的buff
|
| | | # @param attacker 攻击方
|
| | |
| | | def GetAddBuffValue(attacker, curSkill, defender):
|
| | | #验证该技能效果1的ID,提取公式
|
| | | curEffect = curSkill.GetEffect(0)
|
| | | effectID = curEffect.GetEffectID() |
| | |
|
| | | moduleSuffix = GetBuffModuleSuffix(curEffect)
|
| | |
|
| | |
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | # 获得关联技能
|
| | | # 获得关联技能,0 全部 1是主动型技能(法宝,普攻) 其他技能ID
|
| | | def GetConnectSkillID(curSkill):
|
| | | return curSkill.GetExAttr1()
|
| | |
|
| | |
| | | def GetUpLVCostItemNum(curSkill):
|
| | | return curSkill.GetExAttr5()
|
| | |
|
| | | # 技能特殊增加属性配置,目前只支持生命,潜力技能专用
|
| | | def GetMaxHPAttrValue(curSkill):
|
| | | return curSkill.GetMP()
|
| | |
|
| | |
|
| | | ##获得当前技能升级消耗的真气值
|
| | | # @param curSkill 当前技能技能
|
| | |
| | | ## 获取技能总等级
|
| | | # @param curPlayer
|
| | | # @return allSkillLV:总技能等级
|
| | | def GetAllSkillLV(curPlayer):
|
| | | successSkillIDList = ReadChConfig.GetEvalChConfig("SuccessSkillIDList")
|
| | | def GetAllSkillLV(curPlayer, funcType):
|
| | | allSkillLV = 0
|
| | | skillManager = curPlayer.GetSkillManager()
|
| | | for i in range(0 , skillManager.GetSkillCount()):
|
| | | for i in xrange(skillManager.GetSkillCount()):
|
| | | curPlayerSkill = skillManager.GetSkillByIndex(i)
|
| | | if curPlayerSkill == None:
|
| | | continue
|
| | | |
| | | skillTypeID = curPlayerSkill.GetSkillTypeID()
|
| | | if skillTypeID not in successSkillIDList:
|
| | | if curPlayerSkill.GetFuncType() != funcType:
|
| | | continue
|
| | | |
| | | skillLV = curPlayerSkill.GetSkillLV()
|
| | | allSkillLV += skillLV
|
| | |
|