| | |
| | | import PlayerControl
|
| | | import NPCCommon
|
| | | import SkillCommon
|
| | | import EffGetSet
|
| | | import FBLogic
|
| | | import ReadChConfig
|
| | | import PetControl
|
| | |
| | | AddHurtValue(defender, attacker.GetPlayerID(), ChConfig.Def_NPCHurtTypePlayer, 1)
|
| | | return
|
| | |
|
| | | ## 被攻击者被动buff触发
|
| | | # @param curTagPlayer 被攻击者
|
| | | # @param tick 当前时间
|
| | | # @param isSuperHit 暴击
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def DefenderSpringBuff(curTagPlayer, tick, isSuperHit=False):
|
| | | return
|
| | | |
| | | #---------------------------------------------------------------------
|
| | |
|
| | | def GetBattleRelationType(attacker, defender):
|
| | |
| | |
|
| | | return ChConfig.AtkDistType_Short
|
| | |
|
| | | ## 输入基础数值,返回增强后的值 - 技能加强
|
| | | # @param value 基础值
|
| | | # @param skill 技能
|
| | | # @return 增强后的值
|
| | | # @remarks 函数详细说明.
|
| | | def GetEnhanceValue(value, skill):
|
| | | per = skill.GetEffect(0).GetEffectValue(0)
|
| | | eff = skill.GetEffect(0).GetEffectValue(1)
|
| | | #GameWorld.Log("被动 -> 自身属性,技能ID = %s,技能增强 = %s,附加 = %s , 基础值 = %s"%(skill.GetSkillName(),per,eff,value))
|
| | | return max(value * per / ChConfig.Def_MaxRateValue + eff , 1)
|
| | |
|
| | | ## 输入基础数值,返回增强后的值 (LV)- 效果加强
|
| | | # @param value 基础值
|
| | | # @param eff 效果
|
| | | # @return 增强后的值
|
| | | # @remarks 函数详细说明.
|
| | | def GetEnhanceValue_Eff(value, eff):
|
| | | per = eff.GetEffectValue(0)
|
| | | eff = eff.GetEffectValue(1)
|
| | | #GameWorld.Log("value = %s,per = %s,erf = %s"%(value,per,eff))
|
| | | return max(value * per / ChConfig.Def_MaxRateValue + eff , 1)
|
| | |
|
| | | ## 输入基础效果值,(玩家索引) -> 技能增强
|
| | | # @param curPlayer 当前玩家
|
| | | # @param curEffect 当前效果
|
| | | # @return 增强后的值
|
| | | # @remarks 函数详细说明.
|
| | | def GetEnhanceIndexValue_Eff(curPlayer, curEffect):
|
| | | index = curEffect.GetEffectValue(0)
|
| | | skillPer = curEffect.GetEffectValue(1)
|
| | | effect = curEffect.GetEffectValue(2)
|
| | | maxValue = EffGetSet.GetValueByEffIndex(curPlayer, index)
|
| | | #GameWorld.Log("-----%s,%s,%s,%s"%(index,skillPer,effect,maxValue))
|
| | | |
| | | if maxValue == None:
|
| | | return 0
|
| | | |
| | | return max(maxValue * skillPer / ChConfig.Def_MaxRateValue + effect , 1)
|
| | | #--------------------------------------------------------------------------
|
| | | ## 设置玩家进入战斗状态
|
| | | # @param defender 当前玩家(被攻击了)
|
| | |
| | |
|
| | | return hurtType, hurtTypeResultDict
|
| | |
|
| | |
|
| | | def __HurtTypeHappen_LuckyHit(atkObj, defObj, happenState, curSkill):
|
| | | ''' 判断伤害类型是否发生 - 会心一击
|
| | | @return: 是否触发, 触发时伤害计算固定值, 触发时防守方的伤害减免固定值
|
| | | '''
|
| | | if IsHappenStateByType(happenState, ChConfig.Def_Skill_HappenState_LuckyHit):
|
| | | return True, atkObj.GetLuckyHitVal(), PlayerControl.GetLuckyHitReduce(defObj)
|
| | | |
| | | aLuckyHitRate = atkObj.GetLuckyHitRate()
|
| | | dLuckyHitRateReduce = PlayerControl.GetLuckyHitRateReduce(defObj)
|
| | | |
| | |
|
| | | atkLuckyHitRate = eval(ReadChConfig.GetChConfig("CalcLuckyHitRate"))
|
| | | if atkLuckyHitRate <= 0:
|
| | | return
|
| | | if GameWorld.CanHappen(atkLuckyHitRate):
|
| | | return True, atkObj.GetLuckyHitVal(), PlayerControl.GetLuckyHitReduce(defObj)
|
| | | return
|
| | |
|
| | | def __HurtTypeHappen_SuperHit(atkObj, defObj, happenState, curSkill):
|
| | | ''' 判断伤害类型是否发生 - 暴击
|
| | | @return: 是否触发, 触发时伤害计算固定值, 触发时防守方的伤害减免固定值
|
| | |
| | | ''' 判断伤害类型是否发生 - 防守方抵御
|
| | | @return: 是否触发, 触发时伤害计算值, 触发时防守方的伤害减免值
|
| | | '''
|
| | | chanceDefPer = PlayerControl.GetDamChanceDef(defObj)
|
| | | if not chanceDefPer:
|
| | | return
|
| | | if GameWorld.CanHappen(ChConfig.Def_ChanceDefRate):
|
| | | return True, 0, chanceDefPer
|
| | | return
|
| | |
|
| | | #def __HurtTypeHappen_Zhuxian(atkObj, defObj, happenState, curSkill):
|
| | | # """诛仙一击"""
|
| | | # rate = PlayerControl.GetZhuXianRate(atkObj)
|
| | | # if not rate:
|
| | | # chanceDefPer = PlayerControl.GetDamChanceDef(defObj)
|
| | | # if not chanceDefPer:
|
| | | # return
|
| | | # |
| | | # if GameWorld.CanHappen(rate):
|
| | | # return True, PlayerControl.GetZhuXianHurtPer(atkObj), 0
|
| | | # return
|
| | | # if GameWorld.CanHappen(ChConfig.Def_ChanceDefRate):
|
| | | # return True, 0, chanceDefPer
|
| | | return
|
| | |
|
| | | # 致命一击
|
| | | def __HurtTypeHappen_Deadly(atkObj, defObj, happenState, curSkill):
|
| | |
| | | if defObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | reducePer = SkillCommon.GetSkillReducePerByID(defObj, skillTypeID)
|
| | |
|
| | | #根据防守方职业 计算攻击方伤害加成
|
| | | if defObj.GetJob() in [ShareDefine.PlayerJob_Warrior, ShareDefine.PlayerJob_Knight]:
|
| | | addPer += PlayerControl.GetJobAHurtAddPer(atkObj)
|
| | | elif defObj.GetJob() in [ShareDefine.PlayerJob_Wizard, ShareDefine.PlayerJob_ForceUser]:
|
| | | addPer += PlayerControl.GetJobBHurtAddPer(atkObj)
|
| | | elif defObj.GetJob() in [ShareDefine.PlayerJob_Assassin, ShareDefine.PlayerJob_BowMaster]:
|
| | | addPer += PlayerControl.GetJobCHurtAddPer(atkObj)
|
| | | |
| | | #根据攻击方职业 计算防守方伤害减免
|
| | | if atkObj.GetJob() in [ShareDefine.PlayerJob_Warrior, ShareDefine.PlayerJob_Knight]:
|
| | | reducePer += PlayerControl.GetJobAAtkReducePer(defObj)
|
| | | elif atkObj.GetJob() in [ShareDefine.PlayerJob_Wizard, ShareDefine.PlayerJob_ForceUser]:
|
| | | reducePer += PlayerControl.GetJobBAtkReducePer(defObj)
|
| | | elif atkObj.GetJob() in [ShareDefine.PlayerJob_Assassin, ShareDefine.PlayerJob_BowMaster]:
|
| | | reducePer += PlayerControl.GetJobCAtkReducePer(defObj)
|
| | | # #根据防守方职业 计算攻击方伤害加成
|
| | | # if defObj.GetJob() in [ShareDefine.PlayerJob_Warrior, ShareDefine.PlayerJob_Knight]:
|
| | | # addPer += PlayerControl.GetJobAHurtAddPer(atkObj)
|
| | | # elif defObj.GetJob() in [ShareDefine.PlayerJob_Wizard, ShareDefine.PlayerJob_ForceUser]:
|
| | | # addPer += PlayerControl.GetJobBHurtAddPer(atkObj)
|
| | | # elif defObj.GetJob() in [ShareDefine.PlayerJob_Assassin, ShareDefine.PlayerJob_BowMaster]:
|
| | | # addPer += PlayerControl.GetJobCHurtAddPer(atkObj)
|
| | | # |
| | | # #根据攻击方职业 计算防守方伤害减免
|
| | | # if atkObj.GetJob() in [ShareDefine.PlayerJob_Warrior, ShareDefine.PlayerJob_Knight]:
|
| | | # reducePer += PlayerControl.GetJobAAtkReducePer(defObj)
|
| | | # elif atkObj.GetJob() in [ShareDefine.PlayerJob_Wizard, ShareDefine.PlayerJob_ForceUser]:
|
| | | # reducePer += PlayerControl.GetJobBAtkReducePer(defObj)
|
| | | # elif atkObj.GetJob() in [ShareDefine.PlayerJob_Assassin, ShareDefine.PlayerJob_BowMaster]:
|
| | | # reducePer += PlayerControl.GetJobCAtkReducePer(defObj)
|
| | |
|
| | | if addPer or reducePer:
|
| | | addSkillPer = addPer - reducePer
|
| | |
| | |
|
| | | # 攻击时防守方神兵护盾的处理
|
| | | def CalcAtkProDef(atkObj, defObj, hurtValue, curSkill, tick):
|
| | | if defObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
| | | return hurtValue
|
| | | |
| | | if not CheckIsPlayerOnwer(atkObj):
|
| | | return hurtValue
|
| | |
|
| | | curProDef = PlayerControl.GetProDef(defObj)
|
| | | if not curProDef:
|
| | | return hurtValue
|
| | | |
| | | absortValue = min(PlayerControl.GetProDefAbsorb(defObj)*hurtValue/ChConfig.Def_MaxRateValue, curProDef)
|
| | | |
| | | PlayerControl.SetProDef(defObj, curProDef - absortValue)
|
| | | |
| | | # 被动技能触发
|
| | | defObj.SetDict(ChConfig.Def_PlayerKey_GodWeaponBeforeProDef, curProDef)
|
| | | PassiveBuffEffMng.OnPassiveSkillTrigger(defObj, atkObj, None, ChConfig.TriggerType_ProDefValue, tick)
|
| | | return hurtValue - absortValue
|
| | | return hurtValue
|
| | | # if defObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
| | | # return hurtValue
|
| | | # |
| | | # if not CheckIsPlayerOnwer(atkObj):
|
| | | # return hurtValue
|
| | | #
|
| | | # curProDef = PlayerControl.GetProDef(defObj)
|
| | | # if not curProDef:
|
| | | # return hurtValue
|
| | | # |
| | | # absortValue = min(PlayerControl.GetProDefAbsorb(defObj)*hurtValue/ChConfig.Def_MaxRateValue, curProDef)
|
| | | # |
| | | # PlayerControl.SetProDef(defObj, curProDef - absortValue)
|
| | | # |
| | | # # 被动技能触发
|
| | | # defObj.SetDict(ChConfig.Def_PlayerKey_GodWeaponBeforeProDef, curProDef)
|
| | | # PassiveBuffEffMng.OnPassiveSkillTrigger(defObj, atkObj, None, ChConfig.TriggerType_ProDefValue, tick)
|
| | | # return hurtValue - absortValue
|
| | |
|
| | |
|
| | | # 设置玩家一次主动型攻击中的第一个防御者
|
| | |
| | | return
|
| | |
|
| | | if curSkill and curSkill.GetFuncType() not in [ChConfig.Def_SkillFuncType_FbSkill,
|
| | | ChConfig.Def_SkillFuncType_TurnNormaAttack]:
|
| | | ChConfig.Def_SkillFuncType_TurnNormaSkill]:
|
| | | return
|
| | |
|
| | | if attacker.GetDictByKey(ChConfig.Def_PlayerKey_FirstDefender):
|
| | |
| | | fightPowerMax = ipyData.GetFightPowerMax()
|
| | | everyFightPower = ipyData.GetEveryFightPower()
|
| | | everyFightPowerLostHPEx = ipyData.GetEveryFightPowerLostHPEx()
|
| | | if fightPowerMinByLV and fightPowerMin:
|
| | | npcLV = NPCCommon.GetNPCLV(curNPC)
|
| | | playerCurLVIpyData = PlayerControl.GetPlayerLVIpyData(npcLV)
|
| | | if not playerCurLVIpyData:
|
| | | return
|
| | | ReFightPower = playerCurLVIpyData.GetReFightPower() # 战斗力
|
| | | reRate = ReFightPower / float(fightPowerMin)
|
| | | #GameWorld.DebugLog("标准战力需要取等级表: fightPowerMin=%s,fightPowerMax=%s,everyFightPower=%s,npcLV=%s,ReFightPower=%s,reRate=%s" |
| | | # % (fightPowerMin, fightPowerMax, everyFightPower, npcLV, ReFightPower, reRate))
|
| | | fightPowerMin = ReFightPower
|
| | | fightPowerMax = int(fightPowerMax * reRate)
|
| | | everyFightPower = int(everyFightPower * reRate)
|
| | | #GameWorld.DebugLog("按比例更新战力值信息: fightPowerMin=%s,fightPowerMax=%s,everyFightPower=%s" |
| | | # % (fightPowerMin, fightPowerMax, everyFightPower))
|
| | | #if fightPowerMinByLV and fightPowerMin:
|
| | | # npcLV = NPCCommon.GetNPCLV(curNPC)
|
| | | # playerCurLVIpyData = PlayerControl.GetPlayerLVIpyData(npcLV)
|
| | | # if not playerCurLVIpyData:
|
| | | # return
|
| | | # ReFightPower = playerCurLVIpyData.GetReFightPower() # 战斗力
|
| | | # reRate = ReFightPower / float(fightPowerMin)
|
| | | # #GameWorld.DebugLog("标准战力需要取等级表: fightPowerMin=%s,fightPowerMax=%s,everyFightPower=%s,npcLV=%s,ReFightPower=%s,reRate=%s" |
| | | # # % (fightPowerMin, fightPowerMax, everyFightPower, npcLV, ReFightPower, reRate))
|
| | | # fightPowerMin = ReFightPower
|
| | | # fightPowerMax = int(fightPowerMax * reRate)
|
| | | # everyFightPower = int(everyFightPower * reRate)
|
| | | # #GameWorld.DebugLog("按比例更新战力值信息: fightPowerMin=%s,fightPowerMax=%s,everyFightPower=%s" |
| | | # # % (fightPowerMin, fightPowerMax, everyFightPower))
|
| | |
|
| | | effFightPower = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_TimeLostHPFightPower) \
|
| | | + curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_TimeLostHPFightPowerEx) * ChConfig.Def_PerPointValue
|
| | |
| | |
|
| | | turnFightPosInfo = atkObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightPosInfo)
|
| | | mustHit = False
|
| | | if SkillCommon.isXPSkill(curSkill):
|
| | | if SkillCommon.isAngerSkill(curSkill):
|
| | | mustHit = True
|
| | | GameWorld.DebugLog(" XP必命中")
|
| | | angerOverflow = max(GameObj.GetXP(atkObj) - IpyGameDataPY.GetFuncCfg("AngerXP", 2), 0)
|
| | |
| | | atkSkillPer = ChangeSkillHurtPer(atkObj, defObj, curSkill, atkSkillPer)
|
| | |
|
| | | # --- 新增普通攻击的数值和技能攻击的数值,根据类型各自计算
|
| | | if atkObjType == IPY_GameWorld.gotPlayer:
|
| | | if not curSkill or curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_TurnNormaAttack:
|
| | | atkSkillPer += PlayerControl.GetNormalHurtPer(atkObj)
|
| | | atkSkillValue += PlayerControl.GetNormalHurt(atkObj)
|
| | | elif curSkill.GetFuncType() in [ChConfig.Def_SkillFuncType_FbSkill, ChConfig.Def_SkillFuncType_FbPassiveSkill]:
|
| | | atkSkillPer += PlayerControl.GetFabaoHurtPer(atkObj)
|
| | | atkSkillValue += PlayerControl.GetFabaoHurt(atkObj)
|
| | | #if atkObjType == IPY_GameWorld.gotPlayer:
|
| | | # if not curSkill or curSkill.GetFuncType() == ChConfig.Def_SkillFuncType_TurnNormaSkill:
|
| | | # atkSkillPer += PlayerControl.GetNormalHurtPer(atkObj)
|
| | | # atkSkillValue += PlayerControl.GetNormalHurt(atkObj)
|
| | | # elif curSkill.GetFuncType() in [ChConfig.Def_SkillFuncType_FbSkill, ChConfig.Def_SkillFuncType_FbPassiveSkill]:
|
| | | # atkSkillPer += PlayerControl.GetFabaoHurtPer(atkObj)
|
| | | # atkSkillValue += PlayerControl.GetFabaoHurt(atkObj)
|
| | |
|
| | | atkSkillValue += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_SkillValue)
|
| | | atkSkillValue += PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_SkillValue)
|
| | |
| | | if atkObjType == IPY_GameWorld.gotPlayer:
|
| | | aIgnoreDefRate = atkObj.GetIgnoreDefRate() # 无视防御比率
|
| | | aSkillAtkRate = atkObj.GetSkillAtkRate() # 技能攻击力加成
|
| | | aDamagePVP = PlayerControl.GetDamagePVP(atkObj) # PVP固定伤害
|
| | | aDamagePVE = PlayerControl.GetDamagePVE(atkObj) # PVE固定伤害
|
| | | aDamagePVP = 0 #PlayerControl.GetDamagePVP(atkObj) # PVP固定伤害
|
| | | aDamagePVE = 0 #PlayerControl.GetDamagePVE(atkObj) # PVE固定伤害
|
| | |
|
| | | aNPCHurtAddPer = PlayerControl.GetNPCHurtAddPer(atkObj) # PVE伤害加成
|
| | | aDamagePerPVP = PlayerControl.GetDamagePerPVP(atkObj) # 外层PVP伤害加成
|
| | | aNPCHurtAddPer = 0 #PlayerControl.GetNPCHurtAddPer(atkObj) # PVE伤害加成
|
| | | aDamagePerPVP = 0 #PlayerControl.GetDamagePerPVP(atkObj) # 外层PVP伤害加成
|
| | | aDamagePerPVP += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AddPVPDamagePer)
|
| | |
|
| | | aFinalHurt = PlayerControl.GetFinalHurt(atkObj) # 最终固定伤害
|
| | | aFinalHurt = 0#PlayerControl.GetFinalHurt(atkObj) # 最终固定伤害
|
| | | # 被动增加最终伤害
|
| | | aFinalHurt += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AttackAddFinalValue)
|
| | | aFinalHurt += PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AttackAddFinalValue)
|
| | |
|
| | | aOnlyFinalHurt = PlayerControl.GetOnlyFinalHurt(atkObj) # 额外固定伤害
|
| | | aOnlyFinalHurt = 0 #PlayerControl.GetOnlyFinalHurt(atkObj) # 额外固定伤害
|
| | | aFightPower = PlayerControl.GetFightPower(atkObj)
|
| | | else:
|
| | | aIgnoreDefRate = 0 # 无视防御比率
|
| | |
| | | dFinalHurtReducePer = GameObj.GetFinalHurtReducePer(defObj)
|
| | | dFinalHurtReducePer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, atkObj, curSkill, ChConfig.TriggerType_dFinalHurtReducePer)
|
| | | if defObjType == IPY_GameWorld.gotPlayer:
|
| | | dIgnoreDefRateReduce = PlayerControl.GetIgnoreDefRateReduce(defObj) # 无视防御比率抗性
|
| | | dSkillAtkRateReduce = PlayerControl.GetSkillAtkRateReduce(defObj) # 技能攻击力减少
|
| | | dDamagePVPReduce = PlayerControl.GetDamagePVPReduce(defObj) # PVP固定减伤
|
| | | dIgnoreDefRateReduce = 0 #PlayerControl.GetIgnoreDefRateReduce(defObj) # 无视防御比率抗性
|
| | | dSkillAtkRateReduce = 0 #PlayerControl.GetSkillAtkRateReduce(defObj) # 技能攻击力减少
|
| | | dDamagePVPReduce = 0 #PlayerControl.GetDamagePVPReduce(defObj) # PVP固定减伤
|
| | | #dDamReduce += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, atkObj, None, ChConfig.TriggerType_DamageReduce)
|
| | | dDamagePerPVPReduce = PlayerControl.GetDamagePerPVPReduce(defObj) # 外层PVP减伤
|
| | | dDamagePerPVPReduce = 0 #PlayerControl.GetDamagePerPVPReduce(defObj) # 外层PVP减伤
|
| | | dDamagePerPVPReduce += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(defObj, atkObj, None, ChConfig.TriggerType_DamageReducePVP)
|
| | | dFinalHurtReduce = PlayerControl.GetFinalHurtReduce(defObj) # 最终固定伤害减少
|
| | | dBeHurtPer = PlayerControl.GetBeHurtPer(defObj) # 加深受到伤害百分比
|
| | | dFinalHurtReduce = 0 #PlayerControl.GetFinalHurtReduce(defObj) # 最终固定伤害减少
|
| | | dBeHurtPer = 0#PlayerControl.GetBeHurtPer(defObj) # 加深受到伤害百分比
|
| | | dFightPower = PlayerControl.GetFightPower(defObj)
|
| | |
|
| | | else:
|
| | |
| | | elif not curSkill:
|
| | | hurtValue = eval(IpyGameDataPY.GetFuncCompileCfg("HurtFormula", 3))
|
| | | GameWorld.DebugLog(" 普攻伤害=%s" % (hurtValue))
|
| | | elif SkillCommon.isTurnNormalAtkSkill(curSkill):
|
| | | elif SkillCommon.isTurnNormalSkill(curSkill):
|
| | | hurtValue = eval(IpyGameDataPY.GetFuncCompileCfg("HurtFormula", 1))
|
| | | GameWorld.DebugLog(" 普攻技能伤害=%s" % (hurtValue))
|
| | | elif SkillCommon.isXPSkill(curSkill):
|
| | | elif SkillCommon.isAngerSkill(curSkill):
|
| | | hurtValue = eval(IpyGameDataPY.GetFuncCompileCfg("HurtFormula", 2))
|
| | | GameWorld.DebugLog(" 怒气技能伤害=%s" % (hurtValue))
|
| | | else:
|
| | |
| | | suckHP += atkObj.GetKillBackHP()
|
| | |
|
| | | # 攻击吸血
|
| | | atkBackHP = PlayerControl.GetAtkBackHPPer(atkObj)
|
| | | if defObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | #PVP 攻击回血
|
| | | atkBackHP += PlayerControl.GetPVPAtkBackHP(atkObj)
|
| | | atkBackHP = 0 #PlayerControl.GetAtkBackHPPer(atkObj)
|
| | | #if defObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | # #PVP 攻击回血
|
| | | # atkBackHP += PlayerControl.GetPVPAtkBackHP(atkObj)
|
| | | # 百分比吸血
|
| | | atkBackHPPer = PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_Buff_SuckBloodPer)
|
| | | atkBackHPPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_Buff_SuckBloodPer)
|
| | |
| | | GameObj.SetHP(atkObj, min(GameObj.GetMaxHP(atkObj), GameObj.GetHP(atkObj) + suckHP), False)
|
| | |
|
| | | ChangeHPView(atkObj, None, 0, suckHP, ChConfig.Def_HurtTYpe_Recovery)
|
| | | return
|
| | |
|
| | | ## 攻击者回蓝逻辑
|
| | | # @param atkObj 攻击者
|
| | | # @param defObj 防守者
|
| | | # @return None
|
| | | def CalcSuckMagic(atkObj, defObj, hurtValue):
|
| | |
|
| | | if atkObj.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
| | | return
|
| | | |
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | if tick - atkObj.GetTickByType(ChConfig.TYPE_Player_Tick_SuckMagic) \
|
| | | < ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_SuckMagic]:
|
| | | return
|
| | | |
| | | atkObj.SetTickByType(ChConfig.TYPE_Player_Tick_SuckMagic, tick)
|
| | | |
| | | suckMP = 0
|
| | | |
| | | # 杀怪回蓝
|
| | | if defObj.GetGameObjType() == IPY_GameWorld.gotNPC and GameObj.GetHP(defObj) <= 0:
|
| | | suckMP += atkObj.GetKillBackMP()
|
| | | |
| | | # 攻击吸蓝
|
| | | atkBackMPPer = PlayerControl.GetAtkBackMPPer(atkObj)
|
| | | if atkBackMPPer > 0:
|
| | | suckMP += int(hurtValue * atkBackMPPer / float(ChConfig.Def_MaxRateValue))
|
| | | |
| | | if suckMP <= 0:
|
| | | return
|
| | | |
| | | atkObj.SetMP(min(atkObj.GetMaxMP(), atkObj.GetMP() + suckMP))
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | return
|
| | |
|
| | | attackLV = curPlayer.GetLV() # 攻击者等级
|
| | | attackPrestige = PlayerControl.GetPrestige(curPlayer) # 攻击者威望
|
| | | attackPrestige = 0 #PlayerControl.GetPrestige(curPlayer) # 攻击者威望
|
| | | attackNotoriety = curPlayer.GetInfamyValue() # 攻击者恶名值
|
| | | attackPkValue = curPlayer.GetPKValue() # 攻击者pk值
|
| | | attackFightPower = PlayerControl.GetFightPower(curPlayer) # 攻击者战斗力
|
| | |
|
| | | defendLV = defender.GetLV() # 防守者等级
|
| | | defendPrestige = PlayerControl.GetPrestige(defender) # 防守者威望
|
| | | defendPrestige = 0 #PlayerControl.GetPrestige(defender) # 防守者威望
|
| | | defendNotoriety = defender.GetInfamyValue() # 防守者恶名值
|
| | | defendPkValue = defender.GetPKValue() # 防守者pk值
|
| | | defendFightPower = PlayerControl.GetFightPower(defender) # 防守者战斗力
|