129 【战斗】战斗系统-服务端(貂蝉、吕布部分潜能;)
| | |
| | | PassiveEff_AddCheckPer5505 = 6026 # 增减5505效果验证生命百分比(根据目标身上buff状态层数)
|
| | | PassiveEff_AddHurtAtkPerMax = 6027 # 增加技能最大攻击万分比限制
|
| | | PassiveEff_AddChangeLayers5008 = 6028 # 增减5008效果的转化层数
|
| | | PassiveEff_AddBatDamPerByLayer = 6029 # 提升技能战斗伤害(根据身上buff状态层数)
|
| | |
|
| | | # 被动效果ID有触发值时就返回的
|
| | | PassiveEffHappenValueList = [PassiveEff_ChangeHurtType, PassiveEff_ImmuneControlBuff, PassiveEff_MustSuperHit, PassiveEff_SkillInvalid,
|
| New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveTrigger.PassiveEff_5507
|
| | | #
|
| | | # @todo:触发释放技能(复活指定目标)
|
| | | # @author hxp
|
| | | # @date 2025-12-19
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 触发释放技能(复活指定目标)
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2025-12-19 18:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import TurnSkill
|
| | | import GameWorld
|
| | |
|
| | | def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs):
|
| | | |
| | | passiveSkillID = curEffect.GetEffectValue(0) # 技能ID,为0时释放本技能
|
| | | effHeroID = curEffect.GetEffectValue(1) # 指定目标武将ID
|
| | | costHPPer = curEffect.GetEffectValue(2) # 可附加消耗自身血量百分比,配0不消耗,大于0血量不足时不释放
|
| | | |
| | | if not effHeroID or not tagObj:
|
| | | return
|
| | | |
| | | if tagObj.IsAlive():
|
| | | return
|
| | | |
| | | tagHeroID = tagObj.GetHeroID()
|
| | | if tagHeroID != effHeroID:
|
| | | #GameWorld.DebugLogEx("5507非目标武将死亡不处理! tagHeroID=%s,effHeroID=%s", tagHeroID, effHeroID)
|
| | | return
|
| | | |
| | | if not passiveSkillID:
|
| | | passiveSkillID = effSkill.GetSkillID()
|
| | | if not passiveSkillID:
|
| | | return
|
| | | |
| | | tagID = tagObj.GetID()
|
| | | if costHPPer:
|
| | | curHP = batObj.GetHP()
|
| | | maxHP = batObj.GetMaxHP()
|
| | | costHP = maxHP * costHPPer / 100.0
|
| | | if curHP < costHP:
|
| | | GameWorld.DebugLogEx("5507自身血量不足,无法复活对方! curHP=%s/%s,costHPPer=%s,costHP=%s", curHP, maxHP, costHPPer, costHP)
|
| | | return
|
| | | GameWorld.DebugLogEx("5507扣血复活指定目标! curHP=%s/%s,costHPPer=%s,costHP=%s,tagHeroID=%s,tagID=%s", curHP, maxHP, costHPPer, costHP, tagHeroID, tagID)
|
| | | batObj.SetHP(max(1, curHP - costHP), False) # 直接扣除
|
| | | else:
|
| | | GameWorld.DebugLogEx("5507直接复活指定目标! curHP=%s/%s,costHPPer=%s,costHP=%s,tagHeroID=%s,tagID=%s", curHP, maxHP, costHPPer, costHP, tagHeroID, tagID)
|
| | | |
| | | effectID = curEffect.GetEffectID()
|
| | | effSkillID = effSkill.GetSkillID()
|
| | | return TurnSkill.OnUsePassiveSkill(turnFight, batObj, tagObj, passiveSkillID, connSkill, effSkillID, effectID, connBuff, **kwargs)
|
| New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveTrigger.PassiveEff_6029
|
| | | #
|
| | | # @todo:提升技能战斗伤害(根据身上buff状态层数)
|
| | | # @author hxp
|
| | | # @date 2025-12-19
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 提升技能战斗伤害(根据身上buff状态层数)
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2025-12-19 18:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import TurnBuff
|
| | | import GameWorld
|
| | |
|
| | | def GetHappenValue(attacker, defender, curEffect, effSkill, effBuff, connSkill, **skillkwargs):
|
| | | if "turnFight" not in skillkwargs:
|
| | | return
|
| | | turnFight = skillkwargs["turnFight"]
|
| | | |
| | | buffState = curEffect.GetEffectValue(0) # buff״̬
|
| | | addPerList = curEffect.GetEffectValue(1) # [1层提升万分比, 2层, ...]
|
| | | isDelBuff = curEffect.GetEffectValue(2) # 触发效果后是否扣除buff
|
| | | if not addPerList:
|
| | | return
|
| | | |
| | | addPer = 0
|
| | | layerTotal = 0
|
| | | buffMgr = attacker.GetBuffManager()
|
| | | for buff in buffMgr.FindBuffListByState(buffState):
|
| | | layerTotal += max(1, buff.GetLayer())
|
| | | if len(addPerList) >= layerTotal:
|
| | | addPer = addPerList[layerTotal - 1]
|
| | | else:
|
| | | addPer = addPerList[-1]
|
| | | |
| | | if isDelBuff:
|
| | | TurnBuff.DoBuffDel(turnFight, attacker, buff, connSkill)
|
| | | |
| | | GameWorld.DebugLogEx("6029战斗增伤: buffState=%s,layerTotal=%s,addPer=%s", buffState, layerTotal, addPer)
|
| | | return addPer
|
| | |
| | | aBatDamPer, dBatDamPerDef = 0, 0 # 战斗增减伤
|
| | | aBatDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.AttrID_BatDamPer, curSkill)
|
| | | aBatDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_AddBatDamPerByTagLostHP, curSkill)
|
| | | aBatDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_AddBatDamPerByLayer, curSkill)
|
| | |
|
| | | # 物法增减伤
|
| | | if pmType == IPY_GameWorld.ghtMag: # 法伤
|