129 【战斗】战斗系统-服务端(周瑜小乔潜能1;步练师潜能1、5;孙坚潜能1、3;增加灼烧增减伤属性;增加触发方式52;优化效果5022、5504;增加效果5026;)
| | |
| | | AttrID_PVPDamPerDef, # PVP减伤 72
|
| | | AttrID_ReviveHPPer, # 复活生命加成 73
|
| | | AttrID_ReviveXPPer, # 复活怒气加成 74
|
| | | ) = range(1, 1 + 74)
|
| | | AttrID_DOTBurnPer, # 灼烧增伤 75
|
| | | AttrID_DOTBurnPerDef, # 灼烧减伤 76
|
| | | ) = range(1, 1 + 76)
|
| | |
|
| | | # 需要计算的武将战斗属性ID列表
|
| | | CalcBattleAttrIDList = [AttrID_Atk, AttrID_Def, AttrID_MaxHP, AttrID_StunRate, AttrID_StunRateDef,
|
| | |
| | | AttrID_WuFinalDamPer, AttrID_WuFinalDamPerDef, AttrID_QunFinalDamPer, AttrID_QunFinalDamPerDef,
|
| | | AttrID_BatDamPer, AttrID_BatDamPerDef, AttrID_PursueDamPer, AttrID_PursueDamPerDef,
|
| | | AttrID_ComboDamPer, AttrID_ComboDamPerDef, AttrID_XPRecoverPer, AttrID_PVPDamPer, AttrID_PVPDamPerDef,
|
| | | AttrID_ReviveHPPer, AttrID_ReviveXPPer,
|
| | | AttrID_ReviveHPPer, AttrID_ReviveXPPer, AttrID_DOTBurnPer, AttrID_DOTBurnPerDef,
|
| | | ]
|
| | |
|
| | | # 基础三维属性ID列表
|
| | |
| | | BatObjState_Link, # 链接(董白) 29
|
| | | ) = range(1 + 29)
|
| | |
|
| | | #属于灼烧状态的
|
| | | BurnStateList = [BatObjState_Burn, BatObjState_BurnPlus]
|
| | |
|
| | | #玩家状态定义,不能超过31个,如超过,需扩展多个key支持
|
| | | Def_PlayerStateList = (
|
| | | Def_PlayerState_Normal, # 无 0
|
| | |
| | | TriggerWay_FriendPursue, # 友军追击时(包含自己) 49
|
| | | TriggerWay_FriendAttackOverDirectOne, # 友方使用技能后(多目标仅触发一次,包含自己) 50
|
| | | TriggerWay_FriendAttackOverDirectOneNoSelf, # 友方使用技能后(多目标仅触发一次,不含自己) 51
|
| | | ) = range(1, 1 + 51)
|
| | | TriggerWay_DOTHurt, # 造成持续伤害时 52
|
| | | ) = range(1, 1 + 52)
|
| | |
|
| | | # 不加载的被动触发方式,一般用于本技能固定触发逻辑用的
|
| | | TriggerWayNoLoadList = [TriggerWay_CurSkillEff, TriggerWay_CurSkillEffLst]
|
| | |
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import BattleObj
|
| | |
|
| | | def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs):
|
| | | effEx1 = curEffect.GetEffectValue(0) # 支持多个属性
|
| | | effEx2 = curEffect.GetEffectValue(1) # 支持多个属性
|
| | | calcRule = curEffect.GetEffectValue(2) # 附加计算规则,没配置默认增加固定值
|
| | | |
| | | calcLayer = 1 # 没配置的默认1层,相当于固定值
|
| | | if calcRule:
|
| | | ruleType = calcRule[0]
|
| | | # 100 - 按友方某个国家武将数 参数1:国家
|
| | | if ruleType == 100:
|
| | | country = calcRule[1] if len(calcRule) > 1 else 0
|
| | | batLineup = batObj.GetBatLineup()
|
| | | countryCnt = 0
|
| | | batObjMgr = BattleObj.GetBatObjMgr()
|
| | | for objID in batLineup.posObjIDDict.values():
|
| | | batObj = batObjMgr.getBatObj(objID)
|
| | | if not batObj:
|
| | | continue
|
| | | if batObj.GetCountry() != country:
|
| | | continue
|
| | | #if batObj.IsAlive(): # 死亡也算
|
| | | # continue
|
| | | countryCnt += 1
|
| | | calcLayer = countryCnt
|
| | | GameWorld.DebugLogEx("按友方某个国家武将数计算额外buff属性: ruleType=%s,country=%s,countryCnt=%s", ruleType, country, countryCnt)
|
| | | |
| | | if calcLayer <= 0:
|
| | | return
|
| | | |
| | | for effEX in [effEx1, effEx2]:
|
| | | if not isinstance(effEX, list) or len(effEX) != 3:
|
| | | continue
|
| | | attrID, attrValue, calcType = effEX
|
| | | if calcLayer > 1:
|
| | | attrValue = int(attrValue * calcLayer)
|
| | | GameWorld.DebugLogEx("额外buff效果ID/属性ID值: attrID=%s,attrValue=%s,calcType=%s", attrID, attrValue, calcType)
|
| | | connBuff.AddEffectValueEx(attrID, attrValue, calcType)
|
| | | return True
|
| New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveTrigger.PassiveEff_5026
|
| | | #
|
| | | # @todo:减少某个buff状态层级
|
| | | # @author hxp
|
| | | # @date 2025-12-20
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 减少某个buff状态层级
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2025-12-20 18:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import TurnBuff
|
| | | import GameWorld
|
| | |
|
| | | def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs):
|
| | | buffState = curEffect.GetEffectValue(0)
|
| | | delLayers = curEffect.GetEffectValue(1) # 减少层数
|
| | | if not buffState or not delLayers:
|
| | | return
|
| | | |
| | | curBuff = batObj.GetBuffManager().FindBuffByState(buffState)
|
| | | if not curBuff:
|
| | | return
|
| | | buffLayers = curBuff.GetLayer()
|
| | | updLayers = buffLayers - delLayers
|
| | | GameWorld.DebugLogEx("减少buff层数: buffState=%s,buffLayers=%s,delLayers=%s,updLayers=%s", |
| | | buffState, buffLayers, delLayers, updLayers)
|
| | | TurnBuff.DoBuffLayerChange(turnFight, batObj, curBuff, updLayers, connSkill)
|
| | | return True
|
| | |
|
| | | def DoBuffEffectLogic(turnFight, batObj, tagObj, effBuff, curEffect, connSkill, connBuff, **kwargs):
|
| | | effSkill = effBuff.GetSkillData().GetIpyData()
|
| | | return DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs)
|
| | |
| | |
|
| | | import TurnSkill
|
| | | import IpyGameDataPY
|
| | | import GameWorld
|
| | |
|
| | | def DoSkillEffectLogic(turnFight, batObj, tagObj, effSkill, curEffect, connSkill, connBuff, **kwargs):
|
| | | skillID = curEffect.GetEffectValue(0) # 技能ID,为0时释放本技能
|
| | | checkStateList = curEffect.GetEffectValue(1) # 可附加验证目标处于xx状态
|
| | | checkOwner = curEffect.GetEffectValue(2) # 是否只限归属自己的状态buff
|
| | | isSelfDOTTrigger = curEffect.GetEffectValue(3) # 可附加验证触发的持续buff是否是自己施加的
|
| | |
|
| | | if checkStateList:
|
| | | ownerID = batObj.GetID() if checkOwner else 0
|
| | |
| | | #GameWorld.DebugLogEx("目标不在状态下不触发: tagID=%s,checkStateList=%s,ownerID=%s", tagObj.GetID(), checkStateList, ownerID)
|
| | | return
|
| | |
|
| | | if isSelfDOTTrigger:
|
| | | if not connBuff:
|
| | | GameWorld.DebugLogEx("5504没有关联的buff不处理!")
|
| | | return
|
| | | curID = batObj.GetID()
|
| | | buffOwnerID = connBuff.GetOwnerID()
|
| | | connBuffID = connBuff.GetBuffID()
|
| | | if curID != buffOwnerID:
|
| | | GameWorld.DebugLogEx("5504非自己的持续buff触发的不处理: connBuffID=%s,buffOwnerID=%s != curID=%s", connBuffID, buffOwnerID, curID)
|
| | | return
|
| | | if checkStateList:
|
| | | if connBuff.GetCurBuffState() not in checkStateList:
|
| | | GameWorld.DebugLogEx("5504非自己指定持续buff触发的不处理: connBuffID=%s,buffState=%s not in %s", connBuffID, connBuff.GetCurBuffState(), checkStateList)
|
| | | return
|
| | | |
| | | if not skillID:
|
| | | passiveSkill = effSkill
|
| | | else:
|
| | |
| | | elif not isAttackDirect:
|
| | | # 受到持续伤害
|
| | | if tagID in beHurtObjIDList:
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, tagObj, ChConfig.TriggerWay_BeDOTHurt, curObj, connSkill=useSkill)
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, curObj, ChConfig.TriggerWay_DOTHurt, tagObj, connSkill=useSkill, connBuff=timeBuff)
|
| | | TurnPassive.OnTriggerPassiveEffect(turnFight, tagObj, ChConfig.TriggerWay_BeDOTHurt, curObj, connSkill=useSkill, connBuff=timeBuff)
|
| | |
|
| | | # 使用技能后
|
| | | if isUseSkill:
|
| | |
| | | aDOTPer = atkObj.GetBatAttrValue(ChConfig.AttrID_DOTPer)
|
| | | dDOTPerDef = defObj.GetBatAttrValue(ChConfig.AttrID_DOTPerDef)
|
| | | GameWorld.DebugLogEx("aDOTPer=%s,dDOTPerDef=%s", aDOTPer, dDOTPerDef)
|
| | | |
| | | if curSkill.GetCurBuffState() in ChConfig.BurnStateList:
|
| | | aDOTPer += atkObj.GetBatAttrValue(ChConfig.AttrID_DOTBurnPer)
|
| | | dDOTPerDef += defObj.GetBatAttrValue(ChConfig.AttrID_DOTBurnPerDef)
|
| | | GameWorld.DebugLogEx("是灼烧: aDOTPer=%s,dDOTPerDef=%s", aDOTPer, dDOTPerDef)
|
| | | |
| | | #aAddSkillPer = 0 # 技能增伤
|
| | | aBatDamPer, dBatDamPerDef = 0, 0 # 战斗增减伤
|
| | | dBatDamPerDef = 0 # 战斗增减伤
|
| | | aBatDamPer = atkObj.GetBatAttrValue(ChConfig.AttrID_BatDamPer)
|
| | | aBatDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.AttrID_BatDamPer, curSkill)
|
| | | aBatDamPer += TurnPassive.GetTriggerEffectValue(turnFight, atkObj, defObj, ChConfig.PassiveEff_AddBatDamPerByTagLostHP, curSkill)
|
| | | aBatDamPer += addBatDamPer
|