10019 【砍树】回合战斗(增加技能被动效果5013 5014;优化效果4048;优化释放方式8 43)
1. 增加技能被动效果ID 5013 - 灵宠攻击时触发提升额外伤害百分比
2. 增加技能被动效果ID 5014 - 受到伤害时触发技能
3. 技能被动效果ID 4048 - 闪避时触发技能支持配置触发概率
4. 技能释放方式8,增加治疗方式8 - 按最后一次受伤值回血
5. 技能释放方式43,偷取目标属性,支持多次偷取层级buff逻辑;buff效果ID1015支持计算层级buff属性;
增加山寨技能
神识 附灵术 每次的攻击附加目标当前生命值3%的伤害,最高造成45%攻击伤害。
神识 拘神 每次攻击偷取目标2%的攻击力,每层最高不超过15%自身攻击力,最多叠加5层,持续到战斗结束。
驭兽 威吓 每只灵兽的第一次攻击造成伤害额外提升20%,治疗效果不受影响。
驭兽 回春 第4回合开始,下次灵兽释放技能时对主人进行一次治疗,恢复已损失生命的20%。
躯体 天媚体 闪避时,有10%概率击晕敌人,持续2回合。
躯体 莲花化身 受到伤害,有30%几率恢复所受伤害30%的生命。
| | |
| | | aMinAtk = atkObj.GetMinAtk() * summonAtkPer # 攻击方最小攻击
|
| | | aMaxAtk = atkObj.GetMaxAtk() * summonAtkPer # 攻击方最大攻击
|
| | | if petNPCOwner:
|
| | | petNPCOwner.SetDict("useSkillPetID", atkObj.GetID())
|
| | | #主人攻击力可能会变化,所以在这里用到时直接取
|
| | | aMinAtk = petNPCOwner.GetMinAtk() * summonAtkPer # 攻击方最小攻击
|
| | | aMaxAtk = petNPCOwner.GetMaxAtk() * summonAtkPer # 攻击方最大攻击
|
| | | #GameWorld.DebugLog("灵宠攻击,直接取主人攻击力: %s ~ %s, 自己: %s ~ %s" % (aMinAtk, aMaxAtk, atkObj.GetMinAtk(), atkObj.GetMaxAtk()))
|
| | | |
| | | hurtValueExPer += PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(petNPCOwner, defObj, curSkill, ChConfig.TriggerType_PetAtkHurtExPer)
|
| | | |
| | | enemyObj = None
|
| | | aPetStrengthenPer, dPetWeakenPer = 0, 0 # 强化灵兽, 弱化灵兽
|
| | | if turnFightTimeline:
|
| | |
| | | if atkObj.GetGameObjType() == IPY_GameWorld.gotPlayer or turnFightTimeline:
|
| | | # 记录最后一次伤害值
|
| | | GameObj.SetLastHurtValue(atkObj, resultHurtType.RealHurtHP)
|
| | | GameObj.SetLastBeHurtValue(defObj, resultHurtType.RealHurtHP)
|
| | | if defObj.GetGameObjType() == IPY_GameWorld.gotNPC:
|
| | | atkObj.SetDict(ChConfig.Def_PlayerKey_LastHurtNPCObjID, defObj.GetID())
|
| | | else:
|
| | | defObj.SetDict(ChConfig.Def_PlayerKey_LastAttackerObjID, atkObj.GetID())
|
| | |
|
| | | TurnAttack.AddTurnObjHurtValue(atkObj, defObj, resultHurtType.HurtType, resultHurtType.RealHurtHP, resultHurtType.LostHP, curSkill)
|
| | | |
| | | if resultHurtType.RealHurtHP:
|
| | | PassiveBuffEffMng.OnPassiveSkillTrigger(defObj, atkObj, None, ChConfig.TriggerType_BeHurt, tick)
|
| | | |
| | | return
|
| | |
|
| | |
|
| | |
| | | Def_Cure_TagMaxHP, # 目标最大生命值 5
|
| | | Def_Cure_TagAtk, # 目标攻击力 6
|
| | | Def_Cure_LostHP, # 已损失生命 7
|
| | | ) = range(8)
|
| | | Def_Cure_BeHurtValue, # 受伤值 8
|
| | | ) = range(9)
|
| | |
|
| | | #回魔类型(影响公式参数)
|
| | | Def_RestoreTypeList = (
|
| | |
| | | Def_PlayerKey_GreatHitRateReduce = "GreatHitRateReduce" # 抗卓越一击概率
|
| | | Def_PlayerKey_SuperHitRateReduce = "SuperHitRateReduce" # 抗暴击概率
|
| | | Def_PlayerKey_IgnoreDefRateReduce = "IgnoreDefRateReduce" # 抗无视防御概率
|
| | | Def_PlayerKey_LastBeHurtValue = "LastBeHurtValue" # 最后受伤值
|
| | | Def_PlayerKey_LastBeHurtValueEx = "LastBeHurtValueEx" # 最后受伤值
|
| | | Def_PlayerKey_LastHurtValue = "LastHurtValue" # 最后一次伤害值
|
| | | Def_PlayerKey_LastHurtValueEx = "LastHurtValueEx" # 最后一次伤害值
|
| | | Def_PlayerKey_LastHurtNPCObjID = "LastHurtNPCObjID" # 最后攻击的NPCObjID
|
| | |
| | | TriggerType_TurnFightStart, # 回合开场触发 100
|
| | | TriggerType_BeMissSkill, # 目标闪避后触发技能 101
|
| | | TriggerType_BeHurtMax, # 锁定受到伤害最大值 102
|
| | | TriggerType_BeSuperHitHurtExPer, # 被暴击附加额外伤害百分比 103
|
| | | ) = range(1, 104)
|
| | | TriggerType_BeSuperHitHurtExPer, # 被暴击时受到额外伤害百分比 103
|
| | | TriggerType_PetAtkHurtExPer, # 灵宠攻击时额外伤害百分比 104
|
| | | TriggerType_BeHurt, # 受伤时触发 105
|
| | | ) = range(1, 106)
|
| | |
|
| | |
|
| | | #不可以佩戴翅膀的地图
|
| | |
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_LastHurtValueEx, value / ShareDefine.Def_PerPointValue)
|
| | | return
|
| | |
|
| | | def GetLastBeHurtValue(gameObj):
|
| | | ## 最后一次受伤值
|
| | | hurt = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_LastBeHurtValue)
|
| | | hurtEx = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_LastBeHurtValueEx)
|
| | | return hurtEx * ShareDefine.Def_PerPointValue + hurt
|
| | | def SetLastBeHurtValue(gameObj, value):
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_LastBeHurtValue, value % ShareDefine.Def_PerPointValue)
|
| | | gameObj.SetDict(ChConfig.Def_PlayerKey_LastBeHurtValueEx, value / ShareDefine.Def_PerPointValue)
|
| | | return
|
| | |
|
| | | def GetBloodShiledHurt(gameObj):
|
| | | ## 伤害值用于血盾抵消
|
| | | hurt = gameObj.GetDictByKey(ChConfig.Def_PlayerKey_BloodShiledHurt)
|
| | |
| | | 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
|
| | | return
|
| | |
|
| | | changeLayer = False
|
| | | if layerMaxCnt and curBuff.GetLayer() < layerMaxCnt:
|
| | |
| | | #---------------------------------------------------------------------
|
| | |
|
| | | import ChConfig
|
| | | import BuffSkill
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | |
| | |
|
| | | vauleFunc = [curBuff.GetValue, curBuff.GetValue1, curBuff.GetValue2]
|
| | | addValue = vauleFunc[min(2, valueIndex)]()
|
| | | if curBuff.GetLayer() and BuffSkill.IsLayerPlusAttr(curBuff):
|
| | | addValue *= curBuff.GetLayer()
|
| | | |
| | | 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
|
| | |
| | | cureBaseValue = 0 if not tagObj else GetCureBaseValue(tagObj, curSkill)
|
| | | elif cureType == ChConfig.Def_Cure_LostHP:
|
| | | cureBaseValue = max(0, GameObj.GetMaxHP(userObj) - GameObj.GetHP(userObj))
|
| | | elif cureType == ChConfig.Def_Cure_BeHurtValue:
|
| | | cureBaseValue = GameObj.GetLastBeHurtValue(userObj)
|
| | |
|
| | |
|
| | | #这边写死了效果1,基本已经定型
|
| | |
| | |
|
| | | #GameWorld.DebugLog("偷取目标属性: atkID=%s,defID=%s,attrIndexAllowList=%s" % (attacker.GetID(), defender.GetID(), attrIndexAllowList))
|
| | | addBuffValueList = []
|
| | | # 效果ID | 属性项,万分率
|
| | | # 最多吸收目标3种属性 存入buffvalue,固定前3个效果
|
| | | # A值-属性ID B值-吸取万分率 C值-最高不超过自身属性万分率,配0不限制
|
| | | for i in range(3):
|
| | | effect = curSkill.GetEffect(i)
|
| | | attrIndex = effect.GetEffectValue(0)
|
| | | if not attrIndex:
|
| | | continue
|
| | | if attrIndexAllowList and attrIndex not in attrIndexAllowList:
|
| | | continue
|
| | | |
| | | 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)
|
| | | buff = SkillCommon.FindBuffByID(attacker, curSkill.GetSkillTypeID())[0]
|
| | | if buff:
|
| | | addBuffValueList = [buff.GetValue(), buff.GetValue1(), buff.GetValue2()]
|
| | | #GameWorld.DebugLog("偷取目标属性,已经存在buff,直接取原值! atkID=%s,defID=%s,addBuffValueList=%s,layer=%s" |
| | | # % (attacker.GetID(), defender.GetID(), addBuffValueList, buff.GetLayer()))
|
| | | else:
|
| | | # 效果ID | 属性项,万分率
|
| | | # 最多吸收目标3种属性 存入buffvalue,固定前3个效果
|
| | | # A值-属性ID B值-吸取万分率 C值-最高不超过自身属性万分率,配0不限制
|
| | | for i in range(3):
|
| | | effect = curSkill.GetEffect(i)
|
| | | attrIndex = effect.GetEffectValue(0)
|
| | | if not attrIndex:
|
| | | continue
|
| | | if attrIndexAllowList and attrIndex not in attrIndexAllowList:
|
| | | continue
|
| | |
|
| | | 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))
|
| | | 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 BuffSkill.DoAddBuff(attacker, buffType, curSkill, tick, addBuffValueList, attacker)
|
| | | #处理技能触发和攻击成功逻辑
|
| | | #return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_4048
|
| | | #
|
| | | # @todo:闪避时触发
|
| | | # @author hxp
|
| | | # @date 2024-04-12
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 闪避时触发
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-04-12 15:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | rate = effect.GetEffectValue(0) # 触发概率,兼容配0的情况
|
| | | if rate and not GameWorld.CanHappen(rate):
|
| | | return False
|
| | | return True
|
| | |
| | | if not petObj:
|
| | | return False
|
| | | if petObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnSkillSuccessPetState):
|
| | | #GameWorld.DebugLog("该灵宠释放过技能! 不再触发独立首次!", useSkillPetID.GetID())
|
| | | #GameWorld.DebugLog("该灵宠释放过技能! 不再触发独立首次!", useSkillPetID)
|
| | | return False
|
| | | elif effType == 2:
|
| | | # 共享首次,直接取主人的状态
|
| | |
| | | if not petObj:
|
| | | return False
|
| | | if petObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnAttackOverPetState):
|
| | | #GameWorld.DebugLog("该灵宠攻击过! 不再触发独立首次!", useSkillPetID.GetID())
|
| | | #GameWorld.DebugLog("该灵宠攻击过! 不再触发独立首次!", useSkillPetID))
|
| | | return False
|
| | | elif effType == 2:
|
| | | # 共享首次,直接取主人的状态
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_5013
|
| | | #
|
| | | # @todo:灵宠攻击时触发提升额外伤害百分比
|
| | | # @author hxp
|
| | | # @date 2024-04-12
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 灵宠攻击时触发提升额外伤害百分比
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-04-12 15:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import ChConfig
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | #生效类型(0-每次;1-独立首次,即每只灵宠独立算首次;2-共享首次,即本场战斗本方多只灵宠的情况下仅首次生效)
|
| | | effType = effect.GetEffectValue(1)
|
| | | if effType == 1:
|
| | | # 独立首次,取灵宠自己的状态
|
| | | useSkillPetID = attacker.GetDictByKey("useSkillPetID")
|
| | | if not useSkillPetID:
|
| | | return False
|
| | | petObj = GameWorld.FindNPCByID(useSkillPetID)
|
| | | if not petObj:
|
| | | return False
|
| | | if petObj.GetDictByKey(ChConfig.Def_Obj_Dict_TurnAttackOverPetState):
|
| | | #GameWorld.DebugLog("该灵宠攻击过! 不再触发独立首次! effID=%s,useSkillPetID=%s" % (effect.GetEffectID(), useSkillPetID))
|
| | | return False
|
| | | elif effType == 2:
|
| | | # 共享首次,直接取主人的状态
|
| | | if attacker.GetDictByKey(ChConfig.Def_Obj_Dict_TurnAttackOverPetState):
|
| | | #GameWorld.DebugLog("已经有灵宠攻击过! 不再触发共享首次! effID=%s,atkID=%s" % (effect.GetEffectID(), attacker.GetID()))
|
| | | return False
|
| | | |
| | | return True
|
| | |
|
| | | def GetValue(attacker, defender, effect):
|
| | | return effect.GetEffectValue(0)
|
| | |
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Skill.PassiveBuff.PassiveSkill_5014
|
| | | #
|
| | | # @todo:受到伤害时触发技能
|
| | | # @author hxp
|
| | | # @date 2024-04-12
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 受到伤害时触发技能
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2024-04-12 15:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | |
|
| | | def CheckCanHappen(attacker, defender, effect, curSkill):
|
| | | return GameWorld.CanHappen(effect.GetEffectValue(0))
|
| | |
| | | 5010:ChConfig.TriggerType_IsDealy, # 是否触发致命一击 72
|
| | | 5011:ChConfig.TriggerType_TurnFightStart, # 回合开场触发 100
|
| | | 5012:ChConfig.TriggerType_BeMissSkill, # 目标闪避后触发技能 101
|
| | | 5013:ChConfig.TriggerType_PetAtkHurtExPer, # 灵宠攻击时额外伤害百分比 104
|
| | | 5014:ChConfig.TriggerType_BeHurt, # 受伤时触发 105
|
| | | }
|
| | | return tdict.get(effectID, -1)
|
| | | #===========================================================================
|
| | |
| | | AfterUsePassiveSkill(pyName, attacker, defender, passiveEffect, tick)
|
| | | triggerCount += 1
|
| | | SkillCommon.SetUsingPassiveSkill(attacker, 0)
|
| | |
|
| | | |
| | | if triggerCount:
|
| | | hasEffect = SkillCommon.GetSkillEffectByEffectID(curSkill, ChConfig.Def_Skill_Effect_BuffTriggerDelLayer)
|
| | | if hasEffect:
|
| | | BuffSkill.ReduceBuffLayer(attacker, None, curSkill.GetSkillTypeID(), triggerCount)
|
| | | |
| | | OnTriggerBuffDel(attacker, curSkill, triggerCount)
|
| | | |
| | | return
|
| | |
|
| | | def OnTriggerBuffDel(curObj, curSkill, triggerCount):
|
| | | ## buff中触发减层 或 删除buff 4544
|
| | | hasEffect = SkillCommon.GetSkillEffectByEffectID(curSkill, ChConfig.Def_Skill_Effect_BuffTriggerDelLayer)
|
| | | if not hasEffect:
|
| | | return
|
| | | skillID = curSkill.GetSkillID()
|
| | | skillTypeID = curSkill.GetSkillTypeID()
|
| | | isDelBuff = hasEffect.GetEffectValue(0)
|
| | | if isDelBuff:
|
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | isOK = BuffSkill.DelBuffBySkillID(curObj, skillID, tick)
|
| | | GameWorld.DebugLog("buff中触发效果删除本buff! objID=%s,delSkillID=%s,isOK=%s" % (curObj.GetID(), skillID, isOK))
|
| | | else:
|
| | | GameWorld.DebugLog("buff中触发效果减层! objID=%s,skillTypeID=%s" % (curObj.GetID(), skillTypeID))
|
| | | BuffSkill.ReduceBuffLayer(curObj, None, skillTypeID, triggerCount)
|
| | | return
|
| | | |
| | | def AfterUsePassiveSkill(pyName, attacker, defender, passiveEffect, tick):
|
| | | # 附加触发后逻辑
|
| | | callFunc = GameWorld.GetExecFunc(PassiveBuff, "%s.%s" % (pyName, "AfterUsePassiveSkill"))
|
| | |
| | | triggerCount += 1
|
| | |
|
| | | if triggerCount:
|
| | | hasEffect = SkillCommon.GetSkillEffectByEffectID(curSkill, ChConfig.Def_Skill_Effect_BuffTriggerDelLayer)
|
| | | if hasEffect:
|
| | | BuffSkill.ReduceBuffLayer(attacker, None, curSkill.GetSkillTypeID(), triggerCount)
|
| | | |
| | | OnTriggerBuffDel(attacker, curSkill, triggerCount)
|
| | | |
| | | return curValue
|
| | |
|
| | |
|