10019 【砍树】回合战斗(每次攻击触发精怪技能支持)
| | |
| | | aNPCHurtAddPer = PlayerControl.GetNPCHurtAddPer(atkObj) # PVE伤害加成
|
| | | aDamagePerPVP = PlayerControl.GetDamagePerPVP(atkObj) # 外层PVP伤害加成
|
| | | aDamagePerPVP += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AddPVPDamagePer)
|
| | | aFinalHurtPer = PlayerControl.GetFinalHurtPer(atkObj) # 最外层伤害加成, 可能为负值
|
| | | aFinalHurtPer = GameObj.GetFinalHurtPer(atkObj) # 最外层伤害加成, 可能为负值
|
| | | aFinalHurtPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AttackAddFinalPer)
|
| | |
|
| | | aFinalHurt = PlayerControl.GetFinalHurt(atkObj) # 最终固定伤害
|
| | |
| | |
|
| | | else:
|
| | | aIgnoreDefRate = 0 # 无视防御比率
|
| | | aFinalHurtPer = GameObj.GetPetDamPer(atkObj) # 最外层伤害加成, 可能为负值
|
| | | aFinalHurtPer = GameObj.GetFinalHurtPer(atkObj) # 最外层伤害加成, 可能为负值
|
| | | aSkillAtkRate = NPCCommon.GetSkillAtkRate(atkObj) # 技能攻击力加成
|
| | | if atkObjType == IPY_GameWorld.gotNPC and atkObj.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
|
| | | aSkillAtkRate += atkObj.GetSkillAtkRate()
|
| | |
| | | return |
| | | |
| | | def __logGameObjAttr(gameObj): |
| | | GameWorld.DebugLog(" HP=%s,Atk=%s,Def=%s,atkSpeed=%s" % (GameObj.GetHP(gameObj), gameObj.GetMaxAtk(), gameObj.GetDef(), GameObj.GetAtkSpeed(gameObj))) |
| | | GameWorld.DebugLog(" HP=%s/%s,atk=%s~%s,Def=%s,atkSpeed=%s" |
| | | % (GameObj.GetHP(gameObj), GameObj.GetMaxHP(gameObj), gameObj.GetMinAtk(), gameObj.GetMaxAtk(), |
| | | gameObj.GetDef(), GameObj.GetAtkSpeed(gameObj))) |
| | | GameWorld.DebugLog(" 闪(%s,%s),暴(%s,%s),晕(%s,%s),连(%s,%s),反(%s,%s),吸(%s,%s)" |
| | | % (GameObj.GetMissRate(gameObj), GameObj.GetMissDefRate(gameObj), |
| | | GameObj.GetSuperHitRate(gameObj), GameObj.GetSuperHitRateReduce(gameObj), |
| | |
| | | totalHurt = curObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnTotalHurt) + totalHurtEx + hurtValue |
| | | curObj.SetDict(ChConfig.Def_Obj_Dict_TurnTotalHurt, totalHurt % ChConfig.Def_PerPointValue) |
| | | curObj.SetDict(ChConfig.Def_Obj_Dict_TurnTotalHurtEx, totalHurt / ChConfig.Def_PerPointValue) |
| | | GameWorld.DebugLog(" 伤血: curTD=%s,tagID=%s,skillID=%s,hurtType=%s,hurtValue=%s,totalHurt=%s" |
| | | % (curObj.GetID(), tagObj.GetID(), skillID, hurtType, hurtValue, totalHurt)) |
| | | GameWorld.DebugLog(" 伤血: curTD=%s,tagID=%s,skillID=%s,hurtType=%s,hurtValue=%s,totalHurt=%s,tagHP=%s" |
| | | % (curObj.GetID(), tagObj.GetID(), skillID, hurtType, hurtValue, totalHurt, GameObj.GetHP(tagObj))) |
| | | return |
| | | |
| | | def DoAttack(curObj, tagObj, tick): |
| | |
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_BloodShiledHurtEx, value / ShareDefine.Def_PerPointValue)
|
| | | return
|
| | |
|
| | | def GetFinalHurtPer(gameObj): return gameObj.GetDictByKey(ChConfig.Def_PlayerKey_FinalHurtPer)
|
| | | def SetFinalHurtPer(gameObj, value):
|
| | | ## 最终伤害百分比
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_FinalHurtPer, value)
|
| | | if gameObj.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | PlayerControl.SendPropertyRefresh(gameObj, ShareDefine.CDBPlayerRefresh_FinalHurtPer, value)
|
| | | return
|
| | |
|
| | | def GetFinalHurtReducePer(gameObj): return gameObj.GetDictByKey(ChConfig.Def_PlayerKey_FinalHurtReducePer)
|
| | | def SetFinalHurtReducePer(gameObj, value):
|
| | | ## 最终伤害减免百分比
|
| | |
| | | # @remarks 刷新NPC属性
|
| | | def RefreshNPCAttrState(self, canSyncClient=True, isReborn=False):
|
| | | curNPC = self.__Instance
|
| | | #curNPCMaxHP_Before = GameObj.GetMaxHP(curNPC)
|
| | | maxHPBef = GameObj.GetMaxHP(curNPC)
|
| | | #清空NPC战斗属性
|
| | | curNPC.ClearBattleEffect()
|
| | | #--------------------------------------------
|
| | |
| | | # curNPC.Notify_MaxHP()
|
| | |
|
| | | PassiveBuffEffMng.GetPassiveEffManager().RegistPassiveEff(curNPC)
|
| | | |
| | | maxHPAdd = GameObj.GetMaxHP(curNPC) - maxHPBef
|
| | | if maxHPAdd > 0:
|
| | | #GameWorld.DebugLog("NPC刷属性提升了最大生命值,当前生命值一起增加: curID=%s,maxHPBef=%s,maxHPAdd=%s" % (curNPC.GetID(), maxHPBef, maxHPAdd))
|
| | | GameObj.SetHP(curNPC, GameObj.GetHP(curNPC) + maxHPAdd)
|
| | | return
|
| | |
|
| | | def SetMirrorPlayerNPCAttr(self, mirrorPlayerID, isReborn):
|
| | |
| | | GameObj.SetSuckHPDefPer(curNPC, PropDict.get("SuckHPDefPer", 0))
|
| | | GameObj.SetCurePer(curNPC, PropDict.get("CurePer", 0))
|
| | | GameObj.SetCureDefPer(curNPC, PropDict.get("CureDefPer", 0))
|
| | | GameObj.SetFinalHurtPer(curNPC, PropDict.get("FinalHurtPer", 0))
|
| | | GameObj.SetFinalHurtReducePer(curNPC, PropDict.get("FinalHurtReducePer", 0))
|
| | |
|
| | | if not isReborn:
|
| | | return
|
| | |
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_BleedDamage, value)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_BleedDamage, value)
|
| | |
|
| | | ## 最终伤害百分比
|
| | | def GetFinalHurtPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_FinalHurtPer)
|
| | | def SetFinalHurtPer(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_FinalHurtPer, value)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_FinalHurtPer, value)
|
| | | |
| | | ## 最终固定伤害增加
|
| | | def GetFinalHurt(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_FinalHurt)
|
| | | def SetFinalHurt(curPlayer, value):
|
| | |
| | | aLuckyHitRate = curPlayer.GetLuckyHitRate() # 会心一击概率
|
| | | aBleedDamage = PlayerControl.GetBleedDamage(curPlayer) # 流血伤害 万分率
|
| | | aFinalHurt = PlayerControl.GetFinalHurt(curPlayer) # 最终固定伤害
|
| | | aFinalHurtPer = PlayerControl.GetFinalHurtPer(curPlayer) # 最终伤害加成万分率
|
| | | aFinalHurtPer = GameObj.GetFinalHurtPer(curPlayer) # 最终伤害加成万分率
|
| | | aFightPower = PlayerControl.GetFightPower(curPlayer) # 战力
|
| | | aReFightPower = lvIpyData.GetReFightPower() # 等级表对应的战力
|
| | | aNPCHurtAddPer = PlayerControl.GetNPCHurtAddPer(curPlayer) #PVE 伤害加成万分率
|
| | |
| | | curPlayerPropDict["DamagePVPReduce"] = PlayerControl.GetDamagePVPReduce(curPlayer) # PVP固定减伤
|
| | | curPlayerPropDict["FinalHurt"] = PlayerControl.GetFinalHurt(curPlayer) # 最终固定伤害增加
|
| | | curPlayerPropDict["FinalHurtReduce"] = PlayerControl.GetFinalHurtReduce(curPlayer) # 最终固定伤害减少
|
| | | curPlayerPropDict["FinalHurtPer"] = PlayerControl.GetFinalHurtPer(curPlayer) # 最终伤害百分比
|
| | | curPlayerPropDict["FinalHurtPer"] = GameObj.GetFinalHurtPer(curPlayer) # 最终伤害百分比
|
| | | curPlayerPropDict["FinalHurtReducePer"] = GameObj.GetFinalHurtReducePer(curPlayer) # 最终伤害减少百分比
|
| | | curPlayerPropDict["OnlyFinalHurt"] = PlayerControl.GetOnlyFinalHurt(curPlayer) # 额外输出伤害
|
| | | curPlayerPropDict["DamChanceDef"] = PlayerControl.GetDamChanceDef(curPlayer) # 20%的概率抵御伤害比率
|
| | |
| | |
|
| | | return layerMaxCnt
|
| | |
|
| | | ## 是否非叠加属性层级
|
| | | def IsLayerNoPlusAttr(effect): return effect.GetEffectValue(1)/10 == 1
|
| | | def IsLayerPlusAttr(curBuff):
|
| | | ## 是否叠加属性层级buff,可叠加时,属性=单层属性*层级,默认叠加
|
| | | hasEffect = SkillCommon.GetSkillEffectByEffectID(curBuff.GetSkill(), ChConfig.Def_Skill_Effect_LayerCnt)
|
| | | if not hasEffect:
|
| | | return False
|
| | | if hasEffect.GetEffectValue(1)/10 == 1:
|
| | | if IsLayerNoPlusAttr(hasEffect):
|
| | | # 配置不叠加,直接返回False
|
| | | return False
|
| | | return True
|
| | |
| | | # buff层级
|
| | | layerMaxCnt = 0
|
| | | layerCalc = 0
|
| | | layerPlusAttr = False # 层级是提升属性的
|
| | | hasEffect = SkillCommon.GetSkillEffectByEffectID(curSkill, ChConfig.Def_Skill_Effect_LayerCnt)
|
| | | if hasEffect:
|
| | | layerMaxCnt = hasEffect.GetEffectValue(0) # 能叠加的最大上限
|
| | | layerCalc = hasEffect.GetEffectValue(1)%10 # 增加层级还是减少层级 Def_BuffLayer_Add
|
| | |
|
| | | layerPlusAttr = not IsLayerNoPlusAttr(hasEffect)
|
| | | turnFightTimeline = curObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightTimeline)
|
| | |
|
| | | #1 检查是否有相同的BUFF,如果有相同的就刷新时间
|
| | | for i in range( 0, buffCount ):
|
| | |
| | | plusValueList[0] = min(buffValue + plusValueList[0], ChConfig.Def_UpperLimit_DWord)
|
| | |
|
| | | if buffSkillLV == curSkillLV:
|
| | | if layerMaxCnt and curBuff.GetLayer() >= layerMaxCnt and turnFightTimeline and layerPlusAttr:
|
| | | #GameWorld.DebugLog("回合制下属性层级达到最大层不再添加! curID=%s,skillID=%s,Layer=%s" % (curObj.GetID(), curSkillID, curBuff.GetLayer()))
|
| | | return False
|
| | | |
| | | changeLayer = False
|
| | | if layerMaxCnt and curBuff.GetLayer() < layerMaxCnt:
|
| | | if layerCalc == ChConfig.Def_BuffLayer_Add:
|
| | |
| | | [lambda curObj:PlayerControl.GetJobCAtkReducePer(curObj), lambda curObj, value:PlayerControl.SetJobCAtkReducePer(curObj, value), 0, 0, 0], # 弓手攻击伤害减免
|
| | |
|
| | | [lambda curObj:PlayerControl.GetCommMapExpRate(curObj), lambda curObj, value:PlayerControl.SetCommMapExpRate(curObj, value), 0, 0, 0], # 常规地图经验倍率加成
|
| | | [lambda curObj:PlayerControl.GetFinalHurtPer(curObj), lambda curObj, value:PlayerControl.SetFinalHurtPer(curObj, value), ShareDefine.CDBPlayerRefresh_FinalHurtPer, 1, 0], # 最终伤害百分比
|
| | | [lambda curObj:GameObj.GetFinalHurtPer(curObj), lambda curObj, value:GameObj.SetFinalHurtPer(curObj, value), ShareDefine.CDBPlayerRefresh_FinalHurtPer, 1, 0], # 最终伤害百分比
|
| | | [lambda curObj:PlayerControl.GetFuhaoHitRate(curObj), lambda curObj, value:PlayerControl.SetFuhaoHitRate(curObj, value), 0, 0, 0], # 富豪一击概率
|
| | | [lambda curObj:PlayerControl.GetBossIDHurt(curObj), lambda curObj, value:PlayerControl.SetBossIDHurt(curObj, value), 0, 0, 0], # 对指定boss伤害加成固定值
|
| | | [lambda curObj:PlayerControl.GetBossIDHurtAddPer(curObj), lambda curObj, value:PlayerControl.SetBossIDHurtAddPer(curObj, value), 0, 0, 0],# 对指定boss伤害加成倍率
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.GameSkills.SkillModule_45
|
| | | #
|
| | | # @todo:打出攻击者某个属性的X%附加Y值,单体攻击
|
| | | # @author hxp
|
| | | # @date 2024-01-18
|
| | | # @version 1.0
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-01-18 16:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import SkillCommon
|
| | | import EffGetSet
|
| | |
|
| | | def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
|
| | | if not defender:
|
| | | return
|
| | | |
| | | skillEffect = curSkill.GetEffect(0)
|
| | | skillPer = skillEffect.GetEffectValue(0) / float(ChConfig.Def_MaxRateValue)
|
| | | skillEnhance = skillEffect.GetEffectValue(1)
|
| | | attrIndex = skillEffect.GetEffectValue(2)
|
| | | |
| | | attrValue = EffGetSet.GetValueByEffIndex(attacker, attrIndex)
|
| | | hurtValue = int(attrValue * skillPer + skillEnhance)
|
| | | return SkillCommon.SkillLostHP(defender, curSkill.GetSkillTypeID(), attacker, hurtValue, tick, isDoAttackResult=False)
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_4111
|
| | | #
|
| | | # @todo:攻击后触发被动技能, 验证对方是否有增益、减益buff
|
| | | # @author hxp
|
| | | # @date 2024-01-18
|
| | | # @version 1.0
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-01-18 16:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | if not defender:
|
| | | return False
|
| | | |
| | | buffType = effect.GetEffectValue(1) # 1增益 2减益
|
| | | if buffType == 1:
|
| | | buffCount = defender.GetBuffState().GetBuffCount()
|
| | | elif buffType == 2:
|
| | | buffCount = defender.GetDeBuffState().GetBuffCount()
|
| | | else:
|
| | | return False
|
| | | |
| | | if not buffCount:
|
| | | return False
|
| | | |
| | | return GameWorld.CanHappen(effect.GetEffectValue(0))
|
| | |
| | | 4108:ChConfig.TriggerType_SkillSuccess, # 使用技能成功后不触发技能 处理消耗等问题用 87
|
| | | 4109:ChConfig.TriggerType_SkillValue, # 增加技能伤害固定值 82
|
| | | 4110:ChConfig.TriggerType_ChangeSkillEff, # 改变技能特效
|
| | | 4111:ChConfig.TriggerType_AttackOver, # 攻击(对敌技能)后被动技能被触发 4
|
| | | 5000:ChConfig.TriggerType_TurnNum, # 回合触发 91
|
| | | }
|
| | | return tdict.get(effectID, -1)
|