6603 【后端】【2.0】增加新版的sp和被动技能
| | |
| | | changeLayer = True
|
| | |
|
| | | # Def_Buff_Replace_New和Def_Buff_Recharge 均可走到此逻辑
|
| | | __BuffCanRemain(buffState, curBuff, i, resultTime, plusValueList, buffOwner)
|
| | | # 此处考虑下plusValue变强是否刷属性
|
| | | #DoAddBuffOver(curObj, curSkill, addBuff, tick)
|
| | | __BuffCanRemain(curObj, buffState, curBuff, i, resultTime, plusValueList, buffOwner)
|
| | |
|
| | | return changeLayer
|
| | | else:
|
| | | if buffReplaceType == ChConfig.Def_Buff_Recharge:
|
| | | # 充能型
|
| | | __BuffCanRemain(buffState, curBuff, i, resultTime, plusValueList, buffOwner)
|
| | | __BuffCanRemain(curObj, buffState, curBuff, i, resultTime, plusValueList, buffOwner)
|
| | | return
|
| | |
|
| | | processInterval = curBuff.GetProcessInterval()
|
| | |
| | | # @param tick 当前时间
|
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def __BuffCanRemain(buffState, curBuff, buffIndex, resultTime, plusValueList, buffOwner):
|
| | | def __BuffCanRemain(curObj, buffState, curBuff, buffIndex, resultTime, plusValueList, buffOwner):
|
| | | if resultTime != -1:
|
| | | curBuff.SetRemainTime(resultTime)
|
| | | #重置buff总值
|
| | | __SetBuffValue(curBuff , plusValueList , buffOwner)
|
| | |
|
| | | buffState.Sync_RefreshBuff(buffIndex, curBuff.GetRemainTime())
|
| | | |
| | | |
| | | DoAddBuffOver(curObj, curBuff.GetSkill(), curBuff, buffOwner, GameWorld.GetGameWorld().GetTick()) |
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | hurtValue, hurtType = AttackCommon.CalcHurtHP(attacker, defender, curSkill,
|
| | | skillEnhance, skillPer, GameWorld.GetGameWorld().GetTick(),
|
| | | ChConfig.Def_Skill_HappenState_HitOn)
|
| | | addTime = PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(attacker, None, curSkill, ChConfig.TriggerType_BuffTime)
|
| | | buffTick = SkillShell.GetProcessBuffTick(curSkill, attacker)
|
| | | |
| | | # 单次伤害值,伤害类型,次数(配合效果ID9999的间隔)
|
| | | return [hurtValue, hurtType, int(addTime/buffTick + curEffect.GetEffectValue(2))]
|
| | |
|
| | | |
| | | # 单次伤害值,伤害类型
|
| | | return [hurtValue, hurtType]
|
| | |
|
| | | # 次数(配合效果ID9999的间隔)
|
| | | def DoAddBuffOver(curObj, curBuff, curEffect, tick, buffOwner):
|
| | | if not buffOwner:
|
| | | return
|
| | | buffTick = SkillShell.GetProcessBuffTick(curBuff.GetSkill(), buffOwner)
|
| | | |
| | | curBuff.SetValue2(curBuff.GetRemainTime()/buffTick)
|
| | | return
|
| | |
|
| | | # 消失前如有未执行次数则补上
|
| | | # @param defender 承受者
|
| | |
| | | #
|
| | | ##@package
|
| | | #
|
| | | # @todo: 灼烧(流派专用,额外公式), 持续过程中可能会被改变伤害或者持续时长,无法用次数控制,无层级概念
|
| | | # 若同类型buff存在不管等级高低,只给原buff充能只改变值或时间
|
| | | # 不同释放者可共存多个灼烧
|
| | | # @todo: 灼烧(流派专用,额外公式)
|
| | | # @author: Alee
|
| | | # @date 2019-4-28 下午04:12:17
|
| | | # @version 1.0
|
| | |
| | | import PassiveBuffEffMng
|
| | | import GameObj
|
| | | import BuffSkill
|
| | | import SkillShell
|
| | | #---------------------------------------------------------------------
|
| | | #全局变量
|
| | | #---------------------------------------------------------------------
|
| | |
| | | # @return None
|
| | | # @remarks 函数详细说明.
|
| | | def ProcessBuff(defender, curBuff, curEffect, processBuffTick, tick):
|
| | | if curBuff.GetValue2() == 0:
|
| | | return
|
| | | |
| | | #单次伤害
|
| | | singleDecHP = curBuff.GetValue()
|
| | | buffOwner = SkillCommon.GetBuffOwner(curBuff)
|
| | |
|
| | | curBuffSkillID = curBuff.GetSkill().GetSkillTypeID()
|
| | |
|
| | | SkillCommon.SkillLostHP(defender, curBuffSkillID, buffOwner, singleDecHP, tick, hurtType=ChConfig.Def_HurtType_Burn)
|
| | | # SkillLostHP前调用 死亡或者其他情况会取消curBuff
|
| | | curBuff.SetValue2(max(curBuff.GetValue2() - 1, 0))
|
| | |
|
| | | SkillCommon.SkillLostHP(defender, curBuffSkillID, buffOwner, singleDecHP, tick, hurtType=ChConfig.Def_HurtType_Burn)
|
| | | if buffOwner and GameObj.GetHP(buffOwner) > 0:
|
| | | # 此处暂无法用被动效果实现
|
| | | buffManager = defender.GetProcessDeBuffState()
|
| | |
| | | SkillCommon.SkillAddHP(buffOwner, curBuffSkillID, buffOwner, addHP, tick, hurtType=ChConfig.Def_HurtTYpe_Recovery)
|
| | | return
|
| | |
|
| | | # 灼烧的特征为延长buff时间,重算伤害
|
| | |
|
| | | def CalcBuffValue(attacker, defender, curSkill, changeBuffValueDict):
|
| | | curEffect = curSkill.GetEffect(0)
|
| | | skillPer = curEffect.GetEffectValue(0)
|
| | |
| | |
|
| | | return [hurtValue]
|
| | |
|
| | |
|
| | | # 次数(配合效果ID9999的间隔)
|
| | | def DoAddBuffOver(curObj, curBuff, curEffect, tick, buffOwner):
|
| | | if not buffOwner:
|
| | | return
|
| | | buffTick = SkillShell.GetProcessBuffTick(curBuff.GetSkill(), buffOwner)
|
| | | |
| | | curBuff.SetValue2(curBuff.GetRemainTime()/buffTick)
|
| | | return
|
| | |
|
| | |
|
| | | def OnBuffDisappear(defender, curSkill, curBuff, curEffect, tick):
|
| | | #已经死亡不触发
|
| | | if GameObj.GetHP(defender) <= 0:
|
| | | return
|
| | |
|
| | | count = curBuff.GetValue2()
|
| | | #无剩余
|
| | | if count > 0:
|
| | | SkillCommon.SkillLostHP(defender, curSkill.GetSkillTypeID(), SkillCommon.GetBuffOwner(curBuff), |
| | | curBuff.GetValue()*count, tick, hurtType=ChConfig.Def_HurtType_Burn)
|
| | | |
| | | if GameObj.GetHP(defender) <= 0:
|
| | | return
|
| | | |
| | | # 在防御者身上同时取消同一个释放者的相关buff
|
| | | defender.SetDict(ChConfig.Def_PlayerKey_BurnOwnerID, curBuff.GetOwnerID())
|
| | |
|