10019 【砍树】回合战斗(增加技能被动效果5015 5016 5017)
1. 增加技能被动效果ID 5015 - 被攻击触发,附加负面状态判断
2. 增加技能被动效果ID 5016 - 灵宠攻击后触发,附加目标负面状态判断
3. 增加技能被动效果ID 5017 - 攻击时提升攻击力,附加当前血量判
增加山寨技能
神识 清心妙法 处于负面状态时,被攻击有30%概率回复已损失生命5%的生命。
驭兽 践踏 灵兽攻击携带负面状态的敌人时,使其最终减伤降低10%,持续2回合。
躯体 大魔邪身 每次受到攻击,增加自身2.5%的攻击力,最多叠加5次,持续到战斗结束。
躯体 麒麟臂 生命低于20%时,攻击力提升10%。
| | |
| | | return 0, ChConfig.Def_HurtType_Miss
|
| | |
|
| | | multiValue = 0 # 伤害倍值
|
| | | summonAtkPer = 1 # 召唤继承提高基础攻击力,取表
|
| | | atkPer = ChConfig.Def_MaxRateValue # 提高基础攻击力
|
| | | summonAtkObj = atkwargs.get('orgAtkObj', None) if atkwargs.get('orgAtkObj', None) else atkObj
|
| | | if summonAtkObj.GetGameObjType() == IPY_GameWorld.gotNPC and summonAtkObj.GetGameNPCObjType() == IPY_GameWorld.gnotSummon:
|
| | | summonAtkPerValue = summonAtkObj.GetDictByKey(ChConfig.Def_GameObjKey_InheritOwner)
|
| | |
| | | if not ownerAtkObj:
|
| | | return 0, ChConfig.Def_HurtType_Miss
|
| | |
|
| | | summonAtkPer = summonAtkPerValue*1.0/ChConfig.Def_MaxRateValue
|
| | | #GameWorld.DebugLog("召唤兽取主人---------%s-%s-%s-%s"%(ownerAtkObj.GetID(), atkSkillPer, atkSkillValue, summonAtkPer))
|
| | | atkPer = summonAtkPerValue
|
| | | #GameWorld.DebugLog("召唤兽取主人---------%s-%s-%s-%s"%(ownerAtkObj.GetID(), atkSkillPer, atkSkillValue, summonAtkPerValue))
|
| | |
|
| | | atkObjType = atkObj.GetGameObjType()
|
| | | defObjType = defObj.GetGameObjType()
|
| | |
| | | rand = random.random() #种子数 0~1
|
| | |
|
| | | #------- 攻击方
|
| | | aMinAtk = atkObj.GetMinAtk() * summonAtkPer # 攻击方最小攻击
|
| | | aMaxAtk = atkObj.GetMaxAtk() * summonAtkPer # 攻击方最大攻击
|
| | | aMinAtk = atkObj.GetMinAtk() # 攻击方最小攻击
|
| | | aMaxAtk = atkObj.GetMaxAtk() # 攻击方最大攻击
|
| | | if petNPCOwner:
|
| | | petNPCOwner.SetDict("useSkillPetID", atkObj.GetID())
|
| | | #主人攻击力可能会变化,所以在这里用到时直接取
|
| | | aMinAtk = petNPCOwner.GetMinAtk() * summonAtkPer # 攻击方最小攻击
|
| | | aMaxAtk = petNPCOwner.GetMaxAtk() * summonAtkPer # 攻击方最大攻击
|
| | | aMinAtk = petNPCOwner.GetMinAtk() # 攻击方最小攻击
|
| | | aMaxAtk = petNPCOwner.GetMaxAtk() # 攻击方最大攻击
|
| | | #GameWorld.DebugLog("灵宠攻击,直接取主人攻击力: %s ~ %s, 自己: %s ~ %s" % (aMinAtk, aMaxAtk, atkObj.GetMinAtk(), atkObj.GetMaxAtk()))
|
| | |
|
| | | hurtValueExPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(petNPCOwner, defObj, curSkill, ChConfig.TriggerType_PetAtkHurtExPer)
|
| | | else:
|
| | | atkPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(atkObj, defObj, curSkill, ChConfig.TriggerType_AttackAddAtkPer) |
| | | |
| | | if atkPer != ChConfig.Def_MaxRateValue:
|
| | | aMinAtk = aMinAtk * float(atkPer)/ChConfig.Def_MaxRateValue
|
| | | aMaxAtk = aMaxAtk * float(atkPer)/ChConfig.Def_MaxRateValue
|
| | |
|
| | | enemyObj = None
|
| | | aPetStrengthenPer, dPetWeakenPer = 0, 0 # 强化灵兽, 弱化灵兽
|
| | |
| | |
|
| | | #执行攻击结果
|
| | | for obj in resultList:
|
| | | SkillCommon.SkillLostHP(obj, curSkill.GetSkillTypeID(), attacker, lostHP, tick, isDoAttackResult=False)
|
| | | SkillCommon.SkillLostHP(obj, curSkill, attacker, lostHP, tick, isDoAttackResult=False)
|
| | |
|
| | | __DoAreaAttackResult(attacker, defender, curSkill, resultList, attackerHP, tick, isExSkill)
|
| | | return
|
| | |
| | | TriggerType_BeSuperHitHurtExPer, # 被暴击时受到额外伤害百分比 103
|
| | | TriggerType_PetAtkHurtExPer, # 灵宠攻击时额外伤害百分比 104
|
| | | TriggerType_BeHurt, # 受伤时触发 105
|
| | | ) = range(1, 106)
|
| | | TriggerType_AttackAddAtkPer, # 攻击时增加攻击力 106
|
| | | ) = range(1, 107)
|
| | |
|
| | |
|
| | | #不可以佩戴翅膀的地图
|
| | |
| | | skillTypeID, buffOwner = 0, None
|
| | | lostValue = int(GameObj.GetMaxHP(curPlayer) * lostHPPer / 100.0) * lostTime
|
| | | #GameWorld.DebugLog("OnCollecting lostHPPer=%s,lostTime=%s,lostValue=%s" % (lostHPPer, lostTime, lostValue), playerID)
|
| | | SkillCommon.SkillLostHP(curPlayer, skillTypeID, buffOwner, lostValue, tick, skillAffect=False)
|
| | | SkillCommon.SkillLostHP(curPlayer, None, buffOwner, lostValue, tick, skillAffect=False)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_CollectLostHPTick, tick)
|
| | | lostValue = int(GameObj.GetMaxHP(curPlayer) * lostHPPer / 100.0) * lostTime
|
| | | skillTypeID, buffOwner = 0, None
|
| | | SkillCommon.SkillLostHP(curPlayer, skillTypeID, buffOwner, lostValue, tick, skillAffect=False)
|
| | | SkillCommon.SkillLostHP(curPlayer, None, buffOwner, lostValue, tick, skillAffect=False)
|
| | | GameWorld.DebugLog("采集掉血: npcID=%s,lostHPPer=%s,lostTime=%s,lostValue=%s" % (collectNPCIpyData.GetNPCID(), lostHPPer, lostTime, lostValue))
|
| | | return
|
| | |
|
| | |
| | |
|
| | | return DelBuffBySkillID(curObj, skillID, tick)
|
| | |
|
| | | def IsInDebuffState(curObj):
|
| | | ## 是否处于减益状态
|
| | | for buffType in [IPY_GameWorld.bfDeBuff, IPY_GameWorld.bfProcessDeBuff, IPY_GameWorld.bfActionBuff]:
|
| | | buffTuple = SkillCommon.GetBuffManagerByBuffType(curObj, buffType)
|
| | | if buffTuple == ():
|
| | | continue
|
| | | |
| | | buffManager = buffTuple[0]
|
| | | if buffManager.GetBuffCount():
|
| | | return True
|
| | | |
| | | return False
|
| | |
|
| | | def PYSync_RefreshBuff(gameObj, curBuff, buffType, notifyAll=True, owner = None, errSkillID=None):
|
| | | try:
|
| | | sendPack = ChNetSendPack.tagObjAddBuff()
|
| | |
| | | #buff拥有者
|
| | | buffOwner = SkillCommon.GetBuffOwner(curBuff)
|
| | |
|
| | | curBuffSkillID = curBuff.GetSkill().GetSkillTypeID()
|
| | | |
| | | # SkillLostHP前调用 死亡或者其他情况会取消curBuff
|
| | | curBuff.SetValue2(max(curBuff.GetValue2() - 1, 0))
|
| | | SkillCommon.SkillLostHP(defender, curBuffSkillID, buffOwner, singleDecHP, tick, hurtType=ChConfig.Def_HurtType_Bleed)
|
| | | SkillCommon.SkillLostHP(defender, curBuff.GetSkill(), buffOwner, singleDecHP, tick, hurtType=ChConfig.Def_HurtType_Bleed)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | #无剩余
|
| | | if count > 0:
|
| | |
|
| | | SkillCommon.SkillLostHP(defender, curSkill.GetSkillTypeID(), SkillCommon.GetBuffOwner(curBuff), |
| | | SkillCommon.SkillLostHP(defender, curSkill, SkillCommon.GetBuffOwner(curBuff), |
| | | curBuff.GetValue()*count, tick, hurtType=ChConfig.Def_HurtType_Bleed)
|
| | | #已经死亡不触发
|
| | | if GameObj.GetHP(defender) <= 0:
|
| | |
| | | # SkillLostHP前调用 死亡或者其他情况会取消curBuff
|
| | | curBuff.SetValue2(max(curBuff.GetValue2() - 1, 0))
|
| | |
|
| | | SkillCommon.SkillLostHP(defender, curBuffSkillID, buffOwner, singleDecHP, tick, hurtType=ChConfig.Def_HurtType_Burn)
|
| | | SkillCommon.SkillLostHP(defender, curBuff.GetSkill(), buffOwner, singleDecHP, tick, hurtType=ChConfig.Def_HurtType_Burn)
|
| | | if buffOwner and GameObj.GetHP(buffOwner) > 0:
|
| | | # 此处暂无法用被动效果实现
|
| | | buffManager = defender.GetProcessDeBuffState()
|
| | |
| | | addBurnHurtPer = defender.GetDictByKey("addBurnHurtPer") # 灼烧伤害加成
|
| | | if addBurnHurtPer:
|
| | | totalDecHP = int(totalDecHP * (1 + addBurnHurtPer/float(ChConfig.Def_MaxRateValue)))
|
| | | SkillCommon.SkillLostHP(defender, curSkill.GetSkillTypeID(), SkillCommon.GetBuffOwner(curBuff), |
| | | SkillCommon.SkillLostHP(defender, curSkill, SkillCommon.GetBuffOwner(curBuff), |
| | | totalDecHP, tick, hurtType=ChConfig.Def_HurtType_Burn)
|
| | |
|
| | | if GameObj.GetHP(defender) <= 0:
|
| | |
| | |
|
| | | curBuffSkillID = curBuff.GetSkill().GetSkillTypeID()
|
| | |
|
| | | SkillCommon.SkillLostHP(defender, curBuffSkillID, buffOwner, singleDecHP, tick, hurtType=ChConfig.Def_HurtType_Bleed)
|
| | | SkillCommon.SkillLostHP(defender, curBuff.GetSkill(), buffOwner, singleDecHP, tick, hurtType=ChConfig.Def_HurtType_Bleed)
|
| | | if curEffect.GetEffectValue(2) and buffOwner:
|
| | | SkillCommon.SkillAddHP(buffOwner, curBuffSkillID, singleDecHP)
|
| | |
|
| | |
| | |
|
| | | buffOwner = SkillCommon.GetBuffOwner(curBuff)
|
| | |
|
| | | SkillCommon.SkillLostHP(defender, curSkill.GetSkillTypeID(), buffOwner, buffValue, tick, hurtType=ChConfig.Def_HurtType_Bleed)
|
| | | SkillCommon.SkillLostHP(defender, curSkill, buffOwner, buffValue, tick, hurtType=ChConfig.Def_HurtType_Bleed)
|
| | |
|
| | | # 执行次数
|
| | | OnPassiveSkillByHurtCount(defender, curBuff, curEffect, buffOwner)
|
| | |
| | |
|
| | | if GameObj.GetHP(curObj) <= 0:
|
| | | return
|
| | | SkillCommon.SkillLostHP(curObj, curBuff.GetBuffID(), SkillCommon.GetBuffOwner(curBuff), |
| | | SkillCommon.SkillLostHP(curObj, curBuff.GetSkill(), SkillCommon.GetBuffOwner(curBuff), |
| | | curBuff.GetValue(), tick, hurtType=curBuff.GetValue1())
|
| | | return
|
| | |
|
| | |
| | | # hurtType 飘血类型
|
| | | # skillAffect 默认True 会被各种技能BUFF盾等影响伤血数值
|
| | | # False代表一些特殊处理纯固定伤害飘字(如采集固定掉1点血)
|
| | | def SkillLostHP(curObj, skillTypeID, buffOwner, lostValue, tick, view=True, |
| | | def SkillLostHP(curObj, curSkill, buffOwner, lostValue, tick, view=True, |
| | | isDoAttackResult=True, hurtType=ChConfig.Def_HurtType_Normal,
|
| | | skillAffect=True):
|
| | | skillID = curSkill.GetSkillID() if curSkill else 0
|
| | | if lostValue <= 0:
|
| | | GameWorld.Log('###技能伤害血量异常,数值错误 = %s,技能类型ID = %s' % (lostValue, skillTypeID))
|
| | | GameWorld.Log('###技能伤害血量异常,数值错误 = %s,技能类型ID = %s' % (lostValue, skillID))
|
| | | return
|
| | |
|
| | | if not curObj.GetCanAttack():
|
| | |
| | | return
|
| | |
|
| | | curObjType = curObj.GetGameObjType()
|
| | | curSkill = GameWorld.GetGameData().FindSkillByType(skillTypeID, 1)
|
| | | #curSkill = GameWorld.GetGameData().FindSkillByType(skillTypeID, 1)
|
| | |
|
| | | atkObjType = buffOwner.GetGameObjType() if buffOwner else -1
|
| | |
|
| | |
| | | AttackCommon.WriteHurtLog(buffOwner, curObj, curSkill, lostValue, hurtType, "持续掉血")
|
| | | if view:
|
| | | #广播伤血类型
|
| | | AttackCommon.ChangeHPView(curObj, buffOwner, skillTypeID, lostValue, hurtType)
|
| | | AttackCommon.ChangeHPView(curObj, buffOwner, skillID, lostValue, hurtType)
|
| | | if buffOwner:
|
| | | PassiveBuffEffMng.OnPassiveSkillTrigger(buffOwner, curObj, curSkill, ChConfig.TriggerType_AttackOverPassive, tick)
|
| | |
|
| | |
| | |
|
| | | #统一调用攻击结束动作
|
| | | if isDoAttackResult:
|
| | | BaseAttack.DoLogic_AttackResult(buffOwner, curObj, None, tick)
|
| | | BaseAttack.DoLogic_AttackResult(buffOwner, curObj, curSkill, tick)
|
| | | return lostHP
|
| | |
|
| | | ## 检查增加淬毒buff
|
| | |
| | | hurtEnhance = defenderMaxHp*skillPer + skillEnhance
|
| | | hurtEnhance = min(hurtEnhance, defenderMaxHp)
|
| | |
|
| | | return SkillCommon.SkillLostHP(defender, curSkill.GetSkillTypeID(), attacker, int(hurtEnhance), tick, isDoAttackResult=False)
|
| | | return SkillCommon.SkillLostHP(defender, curSkill, attacker, int(hurtEnhance), tick, isDoAttackResult=False)
|
| | |
| | |
|
| | | attrValue = EffGetSet.GetValueByEffIndex(attacker, attrIndex)
|
| | | hurtValue = int(attrValue * skillPer + skillEnhance)
|
| | | return SkillCommon.SkillLostHP(defender, curSkill.GetSkillTypeID(), attacker, hurtValue, tick, isDoAttackResult=False)
|
| | | return SkillCommon.SkillLostHP(defender, curSkill, attacker, hurtValue, tick, isDoAttackResult=False)
|
| | |
| | |
|
| | | GameWorld.DebugLog(" 换血: atkID=%s,defID=%s,skillID=%s,hurtValue=%s,hpHurtValue=%s,atkHurtValue=%s,curHP=%s,tagHP=%s"
|
| | | % (attacker.GetID(), defender.GetID(), curSkill.GetSkillID(), hurtValue, hpHurtValue, atkHurtValue, curHP, tagHP))
|
| | | lostHP = SkillCommon.SkillLostHP(defender, curSkill.GetSkillTypeID(), attacker, hurtValue, tick, isDoAttackResult=False, skillAffect=False)
|
| | | lostHP = SkillCommon.SkillLostHP(defender, curSkill, attacker, hurtValue, tick, isDoAttackResult=False, skillAffect=False)
|
| | | if lostHP:
|
| | | SkillCommon.SkillLostHP(attacker, curSkill.GetSkillTypeID(), attacker, hurtValue, tick, isDoAttackResult=False, skillAffect=False)
|
| | | SkillCommon.SkillLostHP(attacker, curSkill, attacker, hurtValue, tick, isDoAttackResult=False, skillAffect=False)
|
| | | return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
|
| | |
| | | #GameWorld.DebugLog(" 最高不超过自身属性! selfAttrIndex=%s,selfAttrValue=%s,selfPer=%s,hurtValueMax=%s"
|
| | | # % (selfAttrIndex, selfAttrValue, selfPer, hurtValueMax))
|
| | |
|
| | | return SkillCommon.SkillLostHP(defender, curSkill.GetSkillTypeID(), attacker, hurtValue, tick)
|
| | | return SkillCommon.SkillLostHP(defender, curSkill, attacker, hurtValue, tick)
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_5015
|
| | | #
|
| | | # @todo:被攻击触发,附加负面状态判断
|
| | | # @author hxp
|
| | | # @date 2024-04-16
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 被攻击触发,附加负面状态判断
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-04-16 17:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import BuffSkill
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | checkInDebuff = effect.GetEffectValue(1)
|
| | | if checkInDebuff:
|
| | | if not BuffSkill.IsInDebuffState(attacker):
|
| | | return False
|
| | | return GameWorld.CanHappen(effect.GetEffectValue(0))
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_5016
|
| | | #
|
| | | # @todo:灵宠攻击后触发,附加目标负面状态判断
|
| | | # @author hxp
|
| | | # @date 2024-04-16
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 灵宠攻击后触发,附加目标负面状态判断
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-04-16 17:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import BuffSkill
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | checkInDebuff = effect.GetEffectValue(1)
|
| | | if checkInDebuff:
|
| | | if not BuffSkill.IsInDebuffState(defender):
|
| | | return False
|
| | | return GameWorld.CanHappen(effect.GetEffectValue(0))
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_5017
|
| | | #
|
| | | # @todo:攻击时提升攻击力,附加当前血量判断
|
| | | # @author hxp
|
| | | # @date 2024-04-16
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 攻击时提升攻击力,附加当前血量判断
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-04-16 17:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import GameObj
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | checkType = effect.GetEffectValue(2)
|
| | | if checkType:
|
| | | checkHPPer = effect.GetEffectValue(1)
|
| | | nowHPPer = GameObj.GetHP(attacker) * float(ChConfig.Def_MaxRateValue) / GameObj.GetMaxHP(attacker)
|
| | | # 大于
|
| | | if checkType == 1:
|
| | | if nowHPPer <= checkHPPer:
|
| | | return False
|
| | | # 小于
|
| | | elif checkType == 2:
|
| | | if nowHPPer >= checkHPPer:
|
| | | return False
|
| | | |
| | | return True
|
| | |
|
| | | def GetValue(attacker, defender, effect):
|
| | | return effect.GetEffectValue(0)
|
| | |
|
| | |
| | | 5012:ChConfig.TriggerType_BeMissSkill, # 目标闪避后触发技能 101
|
| | | 5013:ChConfig.TriggerType_PetAtkHurtExPer, # 灵宠攻击时额外伤害百分比 104
|
| | | 5014:ChConfig.TriggerType_BeHurt, # 受伤时触发 105
|
| | | 5015:ChConfig.TriggerType_BeAttackOver, # 被攻击后触发 20
|
| | | 5016:ChConfig.TriggerType_AttackOverPet, # 灵宠攻击(对敌技能)后被动技能被触发 97
|
| | | 5017:ChConfig.TriggerType_AttackAddAtkPer, # 攻击时增加攻击力 106
|
| | | }
|
| | | return tdict.get(effectID, -1)
|
| | | #===========================================================================
|