| | |
| | |
|
| | | return summonNPCList, maxBornIndex
|
| | |
|
| | | ## 获得持续性技能的总量(技能类型 -> 12,13) |
| | | # @param curPlayer 当前玩家
|
| | | # @param curSkill 当前技能
|
| | | # @param skillPlus ,技能增益
|
| | | # @return value
|
| | | # @remarks 函数详细说明.
|
| | | def GetLastSkillMaxValue(curPlayer , curSkill , skillPlus=None):
|
| | | #根据约定,总量一定是第0个效果
|
| | | curEffect = curSkill.GetEffect(0)
|
| | | index = curEffect.GetEffectValue(0)
|
| | | skillPer = curEffect.GetEffectValue(1)
|
| | | effect = curEffect.GetEffectValue(2)
|
| | | maxValue = EffGetSet.GetValueByEffIndex(curPlayer, index)
|
| | | #GameWorld.Log("持续伤害总值设置curSkill = %s,maxValue = %s skillPer = %s,effect = %s"%(curSkill.GetSkillName(),maxValue,skillPer,effect))
|
| | | if maxValue == None:
|
| | | GameWorld.Log("计算附加技能总量错误,skillID = %s,index = %s" % (curSkill.GetSkillID(), index) , curPlayer.GetPlayerID())
|
| | | return effect
|
| | | |
| | | #总值
|
| | | value = 0
|
| | | if skillPlus == None :
|
| | | value = (maxValue * skillPer / ChConfig.Def_MaxRateValue) + effect
|
| | | #GameWorld.Log("持续伤害总值设置 value = %s"%value)
|
| | | else:
|
| | | plus = 1 + skillPlus / float(ChConfig.Def_MaxRateValue) |
| | | value = (maxValue * (skillPer * plus) / ChConfig.Def_MaxRateValue) + effect
|
| | | #GameWorld.Log("持续伤害总值设置 value = %s 技能附加 = %s"%(value,plus))
|
| | | |
| | | return int(value)
|
| | | |
| | | |
| | |
|
| | | ## 玩家召唤NPC(当前玩家,召唤技能,召唤兽ID,召唤兽属性列表, 召唤兽离自己的距离, 当前时间)
|
| | | # @param curPlayer 当前玩家
|
| | | # @param curSkill 召唤技能
|
| | |
| | | if curSkill:
|
| | | Calc_Summon_BaseEffectBySkillPer(curPlayer, summonNPC, curSkill)
|
| | | return
|
| | | |
| | | # #同一个召唤兽有10个等级, 所以必须用GetFunctionType来决定召唤兽的类型
|
| | | # summonID = summonNPC.GetFunctionType()
|
| | | # |
| | | # summonList = None
|
| | | # if ChConfig.Def_SummonProperty.has_key(summonID):
|
| | | # summonList = ChConfig.Def_SummonProperty[summonID]
|
| | | # |
| | | # #设置玩家被动技能对召唤兽属性的影响
|
| | | # __PassiveSkill_AddSummonAttribute(curPlayer, summonNPC, summonID)
|
| | | # |
| | | # if summonList != None:
|
| | | # lvSummonNPC = summonNPC.GetLV()
|
| | | # #设置召唤兽战斗信息
|
| | | # __CalcSummonEffectValue(lvSummonNPC, summonNPC, summonList) |
| | |
|
| | | #计算基础总值
|
| | | Calc_Summon_BaseEffect(summonNPC)
|
| | |
| | | #返回值,技能释放成功
|
| | | return summonNPC
|
| | |
|
| | |
|
| | | ## 召唤兽使用技能召唤
|
| | | # @param curNPC 当前NPC
|
| | | # @param curSkill 当前技能
|
| | | # @param maxSummonCount 最大召唤数量
|
| | | # @param maxAngryCount 最大怒值数量
|
| | | # @param posX 重生坐标X
|
| | | # @param posY 重生坐标Y
|
| | | # @param tick 当前时间
|
| | | # @return 召唤兽
|
| | | # @remarks 函数详细说明.
|
| | | #def SummonNPC_UseSkill_SummonNPC(curNPC, curSkill , maxSummonCount , maxAngryCount , posX, posY, tick):
|
| | | # #获得召唤兽ID
|
| | | # summonNPCID = curSkill.GetEffect(0).GetEffectValue(0)
|
| | | # |
| | | # if not summonNPCID:
|
| | | # return
|
| | | # |
| | | # #第一次召唤的时候,需要初始化最大召唤个数
|
| | | # if not curNPC.GetSummonCount() :
|
| | | # curNPC.SetSummonCount(maxSummonCount, summonNPCID, maxAngryCount)
|
| | | # |
| | | # #召唤兽召唤补足
|
| | | # elif curNPC.GetGameNPCObjType() == IPY_GameWorld.gnotSummon and maxSummonCount > curNPC.GetSummonCount():
|
| | | # curNPC.AddSummonCount(maxSummonCount - curNPC.GetSummonCount(), summonNPCID, maxAngryCount)
|
| | | # |
| | | # #寻找一个可以召唤的NPC
|
| | | # summonIsFull = True
|
| | | # summonNPC = None
|
| | | # |
| | | # for i in range(0, curNPC.GetSummonCount()):
|
| | | # summonNPC = curNPC.GetSummonNPCAt(i)
|
| | | # if GameObj.GetHP(summonNPC) > 0:
|
| | | # continue
|
| | | # |
| | | # summonIsFull = False
|
| | | # break
|
| | | # |
| | | # #已经没有可召唤兽的召唤兽,满了
|
| | | # if summonIsFull:
|
| | | # return
|
| | | # |
| | | # #设置这个NPC属性,并召唤出这个NPC
|
| | | # NPCCommon.InitNPC(summonNPC)
|
| | | #
|
| | | # summonNPC.Reborn(posX , posY)
|
| | | # summonNPC.SetBornTime(tick)
|
| | | # summonNPC.SetLastTime(curSkill.GetLastTime())
|
| | | # |
| | | # #返回summonNPC,技能释放成功
|
| | | # return summonNPC
|
| | |
|
| | | ## 设置玩家被动技能对召唤兽属性的影响
|
| | | # @param curPlayer 当前玩家
|
| | | # @param summonNPC 当前召唤兽
|
| | | # @param summonID 召唤兽ID
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def __PassiveSkill_AddSummonAttribute(curPlayer, summonNPC, summonID):
|
| | | return
|
| | |
|
| | | ## 根据效果获得值
|
| | | # @param valueList
|
| | | # @param curSkill 当前技能
|
| | |
| | | returnList.append(value)
|
| | |
|
| | | return returnList
|
| | | |
| | | ## 计算NPC属性效果 |
| | | # @param lvSummonNPC 玩家
|
| | | # @param summonNPC 效果
|
| | | # @param summonList NPC
|
| | | # @return True
|
| | | # @remarks 函数详细说明.
|
| | | def __CalcSummonEffectValue(lvSummonNPC, summonNPC, summonList):
|
| | | for value in summonList:
|
| | | curValue = EffGetSet.GetValueByEffIndex(summonNPC, value[0])
|
| | | #GameWorld.Log("当期属性 = %s index = %s"%(curValue,value[0]))
|
| | | #GameWorld.Log("设置属性 = %s"%(curValue + value[1] * lvSummonNPC))
|
| | | EffGetSet.SetValueByEffIndex(summonNPC, value[0], curValue + value[1] * lvSummonNPC)
|
| | | |
| | | return True
|
| | |
|
| | | ## 设置这个召唤兽的基础属性
|
| | | # @param summonNPC 召唤兽
|
| | |
| | | #0通哟 1 PVP类型 2PVE类型
|
| | | return curSkill.GetHurtType() % 10
|
| | |
|
| | | def isXPSkill(curSkill):
|
| | | ## 是否xp怒气技能
|
| | | def isAngerSkill(curSkill):
|
| | | ## 是否怒气技能
|
| | | return curSkill and curSkill.GetXP() > 0
|
| | |
|
| | | def isTurnNormalAtkSkill(curSkill):
|
| | | def isTurnNormalSkill(curSkill):
|
| | | ## 是否回合普攻技能,区别与无技能的普通A一下,该普攻同样可以有各种技能效果,只是他属于普攻
|
| | | return curSkill and curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_TurnNormaAttack
|
| | | return curSkill and curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_TurnNormaSkill
|
| | |
|
| | | ## 检查技能是否为被动技能, 用于控制不可释放技能
|
| | | def isPassiveSkill(curSkill):
|
| | |
| | | cureDefPer = 0 # 敌方的弱化治疗
|
| | | angerOverflow = 0 # 怒气溢出值
|
| | | if userObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightPosInfo):
|
| | | if isXPSkill(curSkill):
|
| | | if isAngerSkill(curSkill):
|
| | | angerOverflow = max(GameObj.GetXP(userObj) - IpyGameDataPY.GetFuncCfg("AngerXP", 2), 0)
|
| | | #enemyObj = TurnAttack.GetEnemyObj(userObj)
|
| | | #curePer += GameObj.GetCurePer(userObj)
|
| | |
| | | # @return
|
| | | def UpdateSkillCombo(attacker, skill, tick):
|
| | | return
|
| | | #===========================================================================
|
| | | # if attacker.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
| | | # return
|
| | | # |
| | | # SkillComboDict = ReadChConfig.GetEvalChConfig("SkillCombo")
|
| | | # jobType = ChConfig.JOB_TYPE_DICT[attacker.GetJob()]
|
| | | # |
| | | # if jobType not in SkillComboDict:
|
| | | # return
|
| | | # |
| | | # jobSkillComboDict = SkillComboDict[jobType]
|
| | | # |
| | | # curSkillTypeID = skill.GetSkillTypeID()
|
| | | # |
| | | # isCombo = False
|
| | | # lastComboTick = attacker.GetDictByKey(ChConfig.Def_PlayerKey_LastSkillComboTick)
|
| | | # comboCnt = attacker.GetDictByKey(ChConfig.Def_PlayerKey_SkillComboCnt)
|
| | | # buffProcessState = attacker.GetDictByKey(ChConfig.Def_PlayerKey_ComboBuffProcessState)
|
| | | # # 持续性伤害buff已处理过不再处理
|
| | | # if curSkillTypeID in ChConfig.Ded_ComboBuffProcessSkillIDList and buffProcessState:
|
| | | # #GameWorld.DebugLog("持续性伤害buff已处理过不再处理:%s" % curSkillTypeID)
|
| | | # return
|
| | | # |
| | | # for comboNum, comboInfo in jobSkillComboDict.items():
|
| | | # |
| | | # skillList = comboInfo[0]
|
| | | # stateSkillReq = comboInfo[1]
|
| | | # comboInterval = comboInfo[2]
|
| | | # addHurtPerFormat = comboInfo[3]
|
| | | # modulusPlusHappenRate = comboInfo[4] # 伤害系数加成概率万分率
|
| | | # modulusPlusFormat = comboInfo[5] # 伤害系数公式
|
| | | # |
| | | # if curSkillTypeID not in skillList:
|
| | | # continue
|
| | | # |
| | | # # 如果有姿态要求
|
| | | # if stateSkillReq != 0:
|
| | | # buffState = attacker.GetBuffState()
|
| | | # if buffState.FindBuff(stateSkillReq) == None:
|
| | | # #GameWorld.DebugLog("非对应职业姿态(%s),无法连击!" % stateSkillReq)
|
| | | # continue
|
| | | # |
| | | # curComboCnt = skillList.index(curSkillTypeID) + 1 # 当前技能所在连击数
|
| | | # |
| | | # # 在规定时间内完成连击
|
| | | # #GameWorld.DebugLog("skillList=%s, curSkillTypeID=%s,comboCnt=%s,curComboCnt=%s,tick=%s,lastComboTick=%s,(%s),comboInterval=%s" |
| | | # # % (skillList, curSkillTypeID, comboCnt, curComboCnt, tick, lastComboTick, tick - lastComboTick, comboInterval))
|
| | | # if comboCnt > 0 and (comboCnt + 1) == curComboCnt and (tick - lastComboTick) <= comboInterval:
|
| | | # isCombo = True
|
| | | # #GameWorld.DebugLog(" 连击成功!")
|
| | | # |
| | | # # 第一击
|
| | | # elif curComboCnt == 1:
|
| | | # GameWorld.DebugLog(" 技能第一击!")
|
| | | # comboCnt = 0
|
| | | # isCombo = True
|
| | | # |
| | | # if isCombo:
|
| | | # STR = attacker.GetSTR()
|
| | | # PHY = attacker.GetPHY()
|
| | | # modulus = 1 # 伤害系数
|
| | | # if GameWorld.CanHappen(modulusPlusHappenRate):
|
| | | # modulus = eval(modulusPlusFormat)
|
| | | # addHurtPer = eval(addHurtPerFormat)
|
| | | # attacker.SetDict(ChConfig.Def_PlayerKey_LastSkillComboTick, tick)
|
| | | # attacker.SetDict(ChConfig.Def_PlayerKey_SkillComboCnt, curComboCnt)
|
| | | # attacker.SetDict(ChConfig.Def_PlayerKey_ComboSkillTypeID, curSkillTypeID)
|
| | | # attacker.SetDict(ChConfig.Def_PlayerKey_ComboAddHurtPer, addHurtPer)
|
| | | # if curSkillTypeID in ChConfig.Ded_ComboBuffProcessSkillIDList:
|
| | | # attacker.SetDict(ChConfig.Def_PlayerKey_ComboBuffProcessState, 1)
|
| | | # #GameWorld.DebugLog(" 持续性伤害buff连击!%s" % curSkillTypeID)
|
| | | # |
| | | # |
| | | # # 通知客户端连击数
|
| | | # skillComboPack = ChPyNetSendPack.tagMCSkillCombo()
|
| | | # skillComboPack.Clear()
|
| | | # skillComboPack.ComboNum = comboNum
|
| | | # skillComboPack.ComboCnt = curComboCnt
|
| | | # NetPackCommon.SendFakePack(attacker, skillComboPack)
|
| | | # GameWorld.DebugLog("技能连击: num=%s,curCnt=%s,comboCnt=%s,力=%s,敏=%s,modulus=%s,addHurtPer=%s" |
| | | # % (comboNum, curComboCnt, comboCnt, STR, PHY, modulus, addHurtPer))
|
| | | # break
|
| | | # |
| | | # # 没有连击成功, 重置连击信息
|
| | | # if not isCombo and comboCnt != 0:
|
| | | # attacker.SetDict(ChConfig.Def_PlayerKey_LastSkillComboTick, 0)
|
| | | # attacker.SetDict(ChConfig.Def_PlayerKey_SkillComboCnt, 0)
|
| | | # attacker.SetDict(ChConfig.Def_PlayerKey_ComboSkillTypeID, 0)
|
| | | # attacker.SetDict(ChConfig.Def_PlayerKey_ComboAddHurtPer, 0)
|
| | | # attacker.SetDict(ChConfig.Def_PlayerKey_ComboBuffProcessState, 0)
|
| | | # GameWorld.DebugLog("连击失败!curSkillTypeID=%s" % curSkillTypeID)
|
| | | # |
| | | # return
|
| | | #===========================================================================
|
| | |
|
| | | def GetSkillAddPerByID(curPlayer, skillTypeID):
|
| | | ## 获取技能伤害百分比提升值
|