10019 【砍树】回合战斗(复活、多倍攻击、被动触发效果5010、5011、释放方式49、50、优化释放方式43)
1. 支持神通技能复活,区分灵宠触发复活或主角自身复活;
2. 新增被动触发效果5010,攻击有X%的概率造成X倍伤害,同个技能支持同时配置多个不同概率不同倍值;NPC支持多倍攻击;
3. 新增被动触发效果5011,回合战斗开始前触发;
4. 新增换血攻击释放方式49:消耗自身x%当前生命值,扣除敌方等额生命值,最高不超过自身x%攻击;
5. 新增结算灼烧释放方式50;优化原灼烧效果1034,支持结算灼烧伤害加成;
6. 优化原释放方式43:偷取对方属性,支持配置不超过自身属性百分比;NPC支持偷属性;优化原buff效果1015,
| | |
| | | ChConfig.Def_HurtType_Zhuxian, ChConfig.Def_HurtType_DeadlyHit,
|
| | | ChConfig.Def_HurtType_ThumpHit]
|
| | | elif atkObjType == IPY_GameWorld.gotNPC:
|
| | | calcTypeList += [ChConfig.Def_HurtType_SuperHit]
|
| | | |
| | | if PetControl.IsPetNPC(atkObj):
|
| | | calcTypeList += [ChConfig.Def_HurtType_SuperHit]
|
| | | else:
|
| | | calcTypeList += [ChConfig.Def_HurtType_SuperHit, ChConfig.Def_HurtType_DeadlyHit]
|
| | | |
| | | if defObjType == IPY_GameWorld.gotPlayer:
|
| | | calcTypeList += [ChConfig.Def_HurtType_Parry]
|
| | |
|
| | |
| | | if tick - defObj.GetDictByKey(ChConfig.Def_PlayerKey_SomersaultTime) < 500:
|
| | | return 0, ChConfig.Def_HurtType_Miss
|
| | |
|
| | | multiValue = 1 # 伤害倍值
|
| | | multiValue = 0 # 伤害倍值
|
| | | summonAtkPer = 1 # 召唤继承提高基础攻击力,取表
|
| | | summonAtkObj = atkwargs.get('orgAtkObj', None) if atkwargs.get('orgAtkObj', None) else atkObj
|
| | | if summonAtkObj.GetGameObjType() == IPY_GameWorld.gotNPC and summonAtkObj.GetGameNPCObjType() == IPY_GameWorld.gnotSummon:
|
| | |
| | | hurtFormula = hurtDist[hurtFormulaKey]
|
| | |
|
| | | hurtValue = int(eval(FormulaControl.GetCompileFormula(hurtFormulaKey, hurtFormula)))
|
| | | if isDeadlyHit:
|
| | | hurtValue *= deadlyHitMultiValue
|
| | | if isDeadlyHit and deadlyHitMultiValue != 1:
|
| | | multiValue += deadlyHitMultiValue
|
| | |
|
| | | if atkObjType == IPY_GameWorld.gotPlayer and defObjType == IPY_GameWorld.gotNPC and mapID == ChConfig.Def_FBMapID_CrossBattlefield:
|
| | | multiValue = FBLogic.GetFBPlayerHurtNPCMultiValue(atkObj, defObj)
|
| | | |
| | | if multiValue != 1:
|
| | | fbMultiValue = FBLogic.GetFBPlayerHurtNPCMultiValue(atkObj, defObj)
|
| | | if fbMultiValue != 1:
|
| | | multiValue += fbMultiValue
|
| | | |
| | | if multiValue:
|
| | | GameWorld.DebugLog(" 多倍伤害: atkID=%s,defID=%s,skillID=%s,hurtValue=%s,multiValue=%s" |
| | | % (atkObj.GetID(), defObj.GetID(), skillID, hurtValue, multiValue))
|
| | | hurtValue = int(hurtValue * multiValue)
|
| | |
|
| | | #hurtValue = min(max(hurtValue, 0), ChConfig.Def_UpperLimit_DWord)
|
| | |
| | | |
| | | # 回合战斗复活类型 |
| | | ( |
| | | RebornType_PetSkill, |
| | | RebornType_ElfSkill, |
| | | ) = range(1, 1 + 2) |
| | | RebornType_PetSkill, # 灵兽复活,包含灵宠自身技能 或 由灵宠触发的技能 |
| | | RebornType_ElfSkill, # 精怪复活 |
| | | RebornType_ShentongSkill, # 神通复活 - 由主角自己触发,灵宠触发的神通技能归为灵宠复活 |
| | | ) = range(1, 1 + 3) |
| | | |
| | | def GetObjName(gameObj): |
| | | objName = gameObj.GetName() |
| | |
| | | # 战斗前初始化,可能会改变攻速,所以先初始化 |
| | | for factionObjList in atkFactionList: |
| | | for gameObj in factionObjList: |
| | | TurnFightObjStartInit(playerID, gameObj, tick) |
| | | if not gameObj: |
| | | continue |
| | | faction = GameObj.GetFaction(gameObj) |
| | | tagGameObj = objB if faction == 1 else objA |
| | | TurnFightObjStartInit(playerID, gameObj, tagGameObj, tick) |
| | | |
| | | #一个回合攻击顺序,为了后续逻辑统一,都是先确定好顺序 |
| | | sortType = 2 # 攻击顺序排序方式 |
| | |
| | | continue |
| | | if skill.GetRemainTime(): |
| | | continue |
| | | isPetTrigger, triggerPet = GetTriggerRebornPet(gameObj, skill) # 可能由灵宠触发的 |
| | | if isPetTrigger: |
| | | if triggerPet: |
| | | return RebornType_PetSkill, triggerPet, skill |
| | | continue |
| | | if not CheckRoleStateCanUseRebornSkill(gameObj, skill): |
| | | continue |
| | | if skill.GetFuncType() == ChConfig.Def_SkillFuncType_ElfSkill: |
| | | return RebornType_ElfSkill, skill |
| | | if skill.GetFuncType() == ChConfig.Def_SkillFuncType_ShentongSkill: |
| | | return RebornType_ShentongSkill, skill |
| | | |
| | | # 检查是否有灵宠复活技能 |
| | | for index in range(gameObj.GetSummonCount()): |
| | |
| | | #GameWorld.DebugLog(" 没有可以复活的方式!") |
| | | return |
| | | |
| | | def GetTriggerRebornPet(gameObj, skill): |
| | | ## 获取灵宠触发的复活信息 |
| | | # @return: 是否由灵宠触发, 触发的灵宠实例 |
| | | isPetTrigger, triggerPet = False, None |
| | | if SkillShell.GetSkillAffectTag(skill) != ChConfig.Def_UseSkillTag_SummonMaster: |
| | | return isPetTrigger, triggerPet |
| | | |
| | | isPetTrigger = True |
| | | for index in range(gameObj.GetSummonCount()): |
| | | curSummonNPC = gameObj.GetSummonNPCAt(index) |
| | | if not curSummonNPC: |
| | | continue |
| | | if PetControl.IsPetNPC(curSummonNPC): |
| | | triggerPet = curSummonNPC |
| | | break |
| | | return isPetTrigger, triggerPet |
| | | |
| | | def CheckRoleStateCanUseRebornSkill(gameObj, skill): |
| | | ## 检查主角当前状态是否可以使用复活技能 |
| | | |
| | | # 暂时默认可以,寻道冰冻状态不可以 |
| | | return True |
| | | |
| | | def DoReborn(gameObj, hpPer=ChConfig.Def_MaxRateValue): |
| | | ## 执行复活 |
| | | rebornTypeInfo = GetRebornTypeInfo(gameObj) |
| | |
| | | hpPer = skill.GetEffect(0).GetEffectValue(0) |
| | | rebornValue1 = petNPC.GetID() |
| | | rebornValue2 = skill.GetSkillID() |
| | | elif rebornType == RebornType_ElfSkill: |
| | | elif rebornType in [RebornType_ElfSkill, RebornType_ShentongSkill]: |
| | | skill = rebornTypeInfo[1] |
| | | skill.SetRemainTime(skill.GetCoolDownTime()) |
| | | hpPer = skill.GetEffect(0).GetEffectValue(0) |
| | |
| | | gameObj.SetDict(ChConfig.Def_Obj_Dict_TurnFightTimeline, turnNum * 100 + actionNum) |
| | | return |
| | | |
| | | def TurnFightObjStartInit(playerID, gameObj, tick): |
| | | def TurnFightObjStartInit(playerID, gameObj, tagObj, tick): |
| | | ## 回合制战斗实例初始化 |
| | | if not gameObj: |
| | | return |
| | |
| | | gameObj.SetDict(ChConfig.Def_Obj_Dict_TurnAtkAddXPCount, 0) |
| | | gameObj.SetDict(ChConfig.Def_Obj_Dict_TurnXPFullTimeline, 0) |
| | | |
| | | PassiveBuffEffMng.OnPassiveSkillTrigger(gameObj, tagObj, None, ChConfig.TriggerType_TurnFightStart, tick) |
| | | |
| | | __logGameObjAttr(gameObj) |
| | | return |
| | | |
| | |
| | | def AddTurnObjHurtValue(curObj, tagObj, hurtType, hurtValue, lostHP, curSkill=None): |
| | | if not curObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnFightTimeline): |
| | | return |
| | | curID = curObj.GetID() |
| | | tagID = tagObj.GetID() |
| | | skillID = curSkill.GetSkillID() if curSkill else 0 |
| | | totalHurtEx = curObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnTotalHurtEx) * ChConfig.Def_PerPointValue |
| | | 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,tagHP=%s" |
| | | % (curObj.GetID(), tagObj.GetID(), skillID, hurtType, hurtValue, totalHurt, GameObj.GetHP(tagObj))) |
| | | totalHurt = curObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnTotalHurt) + totalHurtEx |
| | | if curID != tagID: |
| | | totalHurt += 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,lostHP=%s,tagHP=%s" |
| | | % (curID, tagID, skillID, hurtType, hurtValue, totalHurt, lostHP, GameObj.GetHP(tagObj))) |
| | | else: |
| | | # 如换血类技能,自残的伤害不算输出 |
| | | GameWorld.DebugLog(" 自残: curTD=%s,tagID=%s,skillID=%s,hurtType=%s,hurtValue=%s,totalHurt=%s,lostHP=%s,curHP=%s" |
| | | % (curID, tagID, skillID, hurtType, hurtValue, totalHurt, lostHP, GameObj.GetHP(curObj))) |
| | | |
| | | if lostHP: |
| | | if lostHP and curID != tagID: |
| | | AddTurnFightXP(tagObj, __GetAddXP_Defender(tagObj, lostHP), "skillID:%s" % skillID) |
| | | AddTurnFightXP(curObj, __GetAddXP_Attack(curObj, curSkill), "skillID:%s" % skillID) |
| | | return |
| | |
| | | TriggerType_AttackOverPet, # 灵宠攻击(对敌技能)后被动技能被触发 97
|
| | | TriggerType_XPAttackAddSkillPer, # 道法攻击增加伤害百分比 98
|
| | | TriggerType_XPAttackOver, # 道法攻击后触发99
|
| | | ) = range(1, 100)
|
| | | TriggerType_TurnFightStart, # 回合开场触发 100
|
| | | ) = range(1, 101)
|
| | |
|
| | |
|
| | | #不可以佩戴翅膀的地图
|
| | |
| | | count = curBuff.GetValue2()
|
| | | #无剩余
|
| | | if count > 0:
|
| | | totalDecHP = curBuff.GetValue() * count
|
| | | addBurnHurtPer = defender.GetDictByKey("addBurnHurtPer") # 灼烧伤害加成
|
| | | if addBurnHurtPer:
|
| | | totalDecHP = int(totalDecHP * (1 + addBurnHurtPer/float(ChConfig.Def_MaxRateValue)))
|
| | | SkillCommon.SkillLostHP(defender, curSkill.GetSkillTypeID(), SkillCommon.GetBuffOwner(curBuff),
|
| | | curBuff.GetValue()*count, tick, hurtType=ChConfig.Def_HurtType_Burn)
|
| | | totalDecHP, tick, hurtType=ChConfig.Def_HurtType_Burn)
|
| | |
|
| | | if GameObj.GetHP(defender) <= 0:
|
| | | return
|
| | |
| | | #---------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import BuffSkill
|
| | | import IPY_GameWorld
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ## buff线性增加属性
|
| | |
| | | def OnCalcBuffEx(defender, curEffect, calcDict, curBuff):
|
| | | attrType = curEffect.GetEffectValue(0)
|
| | |
|
| | | curSkill = curBuff.GetSkill()
|
| | | if not curSkill:
|
| | | return
|
| | | |
| | | valueIndex = None
|
| | | for i in xrange(curSkill.GetEffectCount()):
|
| | | curEffect = curSkill.GetEffect(i)
|
| | | if curEffect.GetEffectValue(0) == attrType:
|
| | | valueIndex = i
|
| | | break
|
| | | |
| | | if valueIndex == None:
|
| | | return
|
| | | |
| | | if attrType == ChConfig.TYPE_Calc_AttrATKMin:
|
| | | # 最小攻击不处理,仅处理最大攻击,配置的时候只配置最大攻击即可,同步加最小攻击
|
| | | return
|
| | | |
| | | vauleFunc = [curBuff.GetValue, curBuff.GetValue1, curBuff.GetValue2]
|
| | | calcDict[attrType] = calcDict.get(attrType, 0) + vauleFunc[min(2, curEffect.GetEffectValue(2))]()
|
| | | addValue = vauleFunc[min(2, valueIndex)]()
|
| | | calcDict[attrType] = calcDict.get(attrType, 0) + addValue
|
| | | if attrType == ChConfig.TYPE_Calc_AttrATKMax:
|
| | | calcDict[ChConfig.TYPE_Calc_AttrATKMin] = calcDict.get(ChConfig.TYPE_Calc_AttrATKMin, 0) + addValue
|
| | | |
| | | return
|
| | |
|
| | |
|
| | |
| | | if curSkill and GetSkillBattleType(curSkill) == ChConfig.Def_BattleRelationType_CommNoBoss and SkillShell.IsNPCSkillResist(curObj):
|
| | | return
|
| | |
|
| | | notifyLostValue = lostValue
|
| | | curObjHP_BeforeAttack = GameObj.GetHP(curObj)
|
| | | if curObjHP_BeforeAttack == 0:
|
| | | # 没有血量不能再触发
|
| | |
| | | AttackCommon.WriteHurtLog(buffOwner, curObj, curSkill, lostValue, hurtType, "持续掉血")
|
| | | if view:
|
| | | #广播伤血类型
|
| | | AttackCommon.ChangeHPView(curObj, buffOwner, skillTypeID, notifyLostValue, hurtType)
|
| | | AttackCommon.ChangeHPView(curObj, buffOwner, skillTypeID, lostValue, hurtType)
|
| | | if buffOwner:
|
| | | PassiveBuffEffMng.OnPassiveSkillTrigger(buffOwner, curObj, curSkill, ChConfig.TriggerType_AttackOverPassive, tick)
|
| | |
|
| | |
| | | #统一调用攻击结束动作
|
| | | if isDoAttackResult:
|
| | | BaseAttack.DoLogic_AttackResult(buffOwner, curObj, None, tick)
|
| | | return
|
| | | return lostHP
|
| | |
|
| | | ## 检查增加淬毒buff
|
| | | # @param skillTypeID 使用的技能typeID
|
| | |
| | | import BaseAttack
|
| | | import BuffSkill
|
| | | import IPY_GameWorld
|
| | | import SkillCommon
|
| | | import EffGetSet
|
| | | import GameWorld
|
| | | import SkillCommon
|
| | |
|
| | |
|
| | | def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
|
| | | def UseBuff(attacker, defender, curSkill, tick, tagRoundPosX, tagRoundPosY):
|
| | | #def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
|
| | | if not defender:
|
| | | return
|
| | | if defender.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
| | | return
|
| | |
|
| | | atkObjType = attacker.GetGameObjType()
|
| | | defObjType = defender.GetGameObjType()
|
| | | |
| | | attrIndexAllowList = [] # 存在NPC,仅允许偷取的属性类型
|
| | | if atkObjType != IPY_GameWorld.gotPlayer or defObjType != IPY_GameWorld.gotPlayer:
|
| | | attrIndexAllowList = [ChConfig.TYPE_Calc_AttrMaxHP, ChConfig.TYPE_Calc_AttrATKMin, ChConfig.TYPE_Calc_AttrATKMax,
|
| | | ChConfig.TYPE_Calc_AttrDEF, ChConfig.TYPE_Calc_AttrAtkSpeed]
|
| | | |
| | | #GameWorld.DebugLog("偷取目标属性: atkID=%s,defID=%s,attrIndexAllowList=%s" % (attacker.GetID(), defender.GetID(), attrIndexAllowList))
|
| | | addBuffValueList = []
|
| | | # 效果ID | 属性项,万分率
|
| | | # 最多吸收目标3种属性 存入buffvalue
|
| | | # 最多吸收目标3种属性 存入buffvalue,固定前3个效果
|
| | | # A值-属性ID B值-吸取万分率 C值-最高不超过自身属性万分率,配0不限制
|
| | | for i in range(3):
|
| | | attrIndex = curSkill.GetEffect(i).GetEffectValue(0)
|
| | | effect = curSkill.GetEffect(i)
|
| | | attrIndex = effect.GetEffectValue(0)
|
| | | if not attrIndex:
|
| | | break
|
| | | curValue = EffGetSet.GetValueByEffIndex(defender, attrIndex)
|
| | | curValue = int(curValue * curSkill.GetEffect(i).GetEffectValue(1) / ChConfig.Def_MaxRateValue)
|
| | | continue
|
| | | if attrIndexAllowList and attrIndex not in attrIndexAllowList:
|
| | | continue
|
| | |
|
| | | addBuffValueList.append(curValue)
|
| | | attrRate = effect.GetEffectValue(1)
|
| | | tagValue = EffGetSet.GetValueByEffIndex(defender, attrIndex)
|
| | | addValue = int(tagValue * attrRate / float(ChConfig.Def_MaxRateValue))
|
| | | |
| | | maxRate = effect.GetEffectValue(2)
|
| | | curValue = EffGetSet.GetValueByEffIndex(attacker, attrIndex)
|
| | | if maxRate:
|
| | | maxValue = int(curValue * maxRate / float(ChConfig.Def_MaxRateValue))
|
| | | addValue = min(addValue, maxValue)
|
| | | |
| | | addBuffValueList.append(addValue)
|
| | | GameWorld.DebugLog("偷取目标属性: atkID=%s,defID=%s,attrIndex=%s,attrRate=%s,addValue=%s,tagValue=%s,curValue=%s,maxRate=%s" |
| | | % (attacker.GetID(), defender.GetID(), attrIndex, attrRate, addValue, tagValue, curValue, maxRate))
|
| | |
|
| | | buffType = SkillCommon.GetBuffType(curSkill)
|
| | | BuffSkill.DoAddBuff(attacker, buffType, curSkill, tick, addBuffValueList, attacker)
|
| | |
|
| | | return True
|
| | | #处理技能触发和攻击成功逻辑
|
| | | return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
|
| | | #return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.GameSkills.SkillModule_49
|
| | | #
|
| | | # @todo:换血攻击
|
| | | # @author hxp
|
| | | # @date 2024-04-02
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 消耗自身x%当前生命值,扣除敌方等额生命值,最高不超过自身x%攻击。
|
| | | # 效果1: A值-消耗血量百分比,B值-最高不超过攻击百分比
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-04-02 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import SkillCommon
|
| | | import BaseAttack
|
| | | import GameWorld
|
| | | import GameObj
|
| | |
|
| | | def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
|
| | | if not defender:
|
| | | return
|
| | | |
| | | curHP = GameObj.GetHP(attacker)
|
| | | tagHP = GameObj.GetHP(defender)
|
| | | if curHP <= 1 or tagHP <= 0:
|
| | | return
|
| | | |
| | | skillEffect = curSkill.GetEffect(0)
|
| | | lostHPPer = skillEffect.GetEffectValue(0)
|
| | | maxAtkPer = skillEffect.GetEffectValue(1)
|
| | | |
| | | maxHP = GameObj.GetMaxHP(attacker)
|
| | | maxAtk = attacker.GetMaxAtk()
|
| | | |
| | | hpHurtValue = int(maxHP * lostHPPer / float(ChConfig.Def_MaxRateValue))
|
| | | atkHurtValue = int(maxAtk * maxAtkPer / float(ChConfig.Def_MaxRateValue))
|
| | | |
| | | hurtValue = min(hpHurtValue, atkHurtValue, tagHP, curHP - 1) # 至少保留1滴血
|
| | | |
| | | 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)
|
| | | if lostHP:
|
| | | SkillCommon.SkillLostHP(attacker, curSkill.GetSkillTypeID(), attacker, hurtValue, tick, isDoAttackResult=False, skillAffect=False)
|
| | | return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.GameSkills.SkillModule_50
|
| | | #
|
| | | # @todo:结算灼烧
|
| | | # @author hxp
|
| | | # @date 2024-04-02
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 结算灼烧 效果1: A值-伤害增加百分比
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-04-02 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import GameWorld
|
| | | import BuffSkill
|
| | | import SkillShell
|
| | |
|
| | | def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
|
| | | if not defender:
|
| | | return
|
| | | |
| | | # 对存在灼烧效果ID的持续减益buff进行结算
|
| | | buffState = defender.GetProcessDeBuffState()
|
| | | buffStateCount = buffState.GetBuffCount()
|
| | | if not buffStateCount:
|
| | | return
|
| | | |
| | | skillEffect = curSkill.GetEffect(0)
|
| | | addBurnHurtPer = skillEffect.GetEffectValue(0)
|
| | | defender.SetDict("addBurnHurtPer", addBurnHurtPer)
|
| | | |
| | | isBurn = False
|
| | | #buff持续效果,回合下可能删除buff,倒序遍历
|
| | | for i in range(0, buffStateCount)[::-1]:
|
| | | curBuff = buffState.GetBuff(i)
|
| | | if not curBuff:
|
| | | continue
|
| | | isDel = False
|
| | | curBuffSkill = curBuff.GetSkill()
|
| | | for effIndex in range(0, curBuffSkill.GetEffectCount()):
|
| | | #得到当前效果
|
| | | curEffect = curBuffSkill.GetEffect(effIndex)
|
| | | curEffectID = curEffect.GetEffectID()
|
| | | if curEffectID == ChConfig.Def_Skill_Effect_Burn:
|
| | | isDel = True
|
| | | break
|
| | | if not isDel:
|
| | | continue
|
| | | # 直接删除buff,由buff自身消失逻辑进行结算
|
| | | GameWorld.DebugLog(" 立即结算灼烧buff: atkID=%s,defID=%s,skillID=%s,addBurnHurtPer=%s" |
| | | % (attacker.GetID(), defender.GetID(), curBuffSkill.GetSkillID(), addBurnHurtPer))
|
| | | isBurn = True
|
| | | skillID = curBuffSkill.GetSkillID()
|
| | | skillTypeID = curBuffSkill.GetSkillTypeID()
|
| | | ownerID, ownerType = curBuff.GetOwnerID(), curBuff.GetOwnerType()
|
| | | BuffSkill.DoBuffDisApper(defender, curBuff, tick)
|
| | | buffState.DeleteBuffByTypeID(skillTypeID)
|
| | | SkillShell.ClearBuffEffectBySkillID(defender, skillID, ownerID, ownerType)
|
| | | |
| | | defender.SetDict("addBurnHurtPer", 0)
|
| | | return isBurn
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_5010
|
| | | #
|
| | | # @todo:攻击有X%的概率造成X倍伤害
|
| | | # @author hxp
|
| | | # @date 2024-04-02
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 攻击有X%的概率造成X倍伤害,同个技能支持同时配置多个不同概率不同倍值;
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-04-02 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | |
|
| | | g_multiValue = 0 # 倍值
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | global g_multiValue
|
| | | g_multiValue = 0
|
| | | |
| | | effID = effect.GetEffectID()
|
| | | for i in range(0, curSkill.GetEffectCount()):
|
| | | curEffect = curSkill.GetEffect(i)
|
| | | curEffectID = curEffect.GetEffectID()
|
| | | cValue = curEffect.GetEffectValue(2)
|
| | | if curEffectID != effID and cValue != effID:
|
| | | # 多组的话,其余的效果ID必须配0,且 效果ID 配置在C值,不然会导致同个被动技能概率重复计算多次(重复次数=配置的组数)
|
| | | continue
|
| | | rate = curEffect.GetEffectValue(0)
|
| | | value = curEffect.GetEffectValue(1)
|
| | | canHappen = GameWorld.CanHappen(rate)
|
| | | #GameWorld.DebugLog("概率X倍: skillID=%s,effID=%s,rate=%s,value=%s,cValue=%s,canHappen=%s" |
| | | # % (curSkill.GetSkillID(), curEffectID, rate, value, cValue, canHappen))
|
| | | # 取最高倍值
|
| | | if canHappen and value > g_multiValue:
|
| | | g_multiValue = value
|
| | | |
| | | return True if g_multiValue else False
|
| | |
|
| | | def GetValue(attacker, defender, effect):
|
| | | #GameWorld.DebugLog(" g_multiValue=%s" % (g_multiValue))
|
| | | return g_multiValue
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_5011
|
| | | #
|
| | | # @todo:回合战斗开场时触发
|
| | | # @author hxp
|
| | | # @date 2024-04-02
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 回合战斗开场时触发
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-04-02 19:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | return GameWorld.CanHappen(effect.GetEffectValue(0))
|
| | |
| | | 5007:ChConfig.TriggerType_XPAttackAddSkillPer, # 道法攻击增加伤害百分比 98
|
| | | 5008:ChConfig.TriggerType_XPAttackOver, # 道法攻击后触发99
|
| | | 5009:ChConfig.TriggerType_BounceHPPer, # 受到攻击时,反弹伤害百分比值17
|
| | | 5010:ChConfig.TriggerType_IsDealy, # 是否触发致命一击 72
|
| | | 5011:ChConfig.TriggerType_TurnFightStart, # 回合开场触发 100
|
| | | }
|
| | | return tdict.get(effectID, -1)
|
| | | #===========================================================================
|
| | |
| | | continue
|
| | |
|
| | | if triggerType == ChConfig.TriggerType_IsDealy:
|
| | | curValue = callFunc(attacker, defender, effect)
|
| | | curValue = max(curValue, callFunc(attacker, defender, effect)) # 取最高倍值
|
| | | else:
|
| | | curValue += callFunc(attacker, defender, effect)
|
| | | if skillTypeID not in Def_PassiveSkillValueNoCD:
|