6603 【后端】【2.0】增加新版的sp和被动技能 - 灼烧
| | |
| | |
|
| | | #---SetDict 玩家字典KEY,不存于数据库---
|
| | | # key的长度不能超过29个字节
|
| | | Def_PlayerKey_BurnOwnerID = "burnOwnerID" # 灼烧BUFF特殊处理,部分buff跟随灼烧消失
|
| | | Def_PlayerKey_SkillInDelBuff = "SkillInDelBuff" # buff中释放技能添加buff要特殊记录给后续处理,直接删除/添加会导致错乱
|
| | | Def_PlayerKey_TheFBSkillsCD = "TheFBSkillsCD" # 减少指定技能组CD XX%
|
| | | Def_PlayerKey_BurnValue = "BurnValue" # 灼烧固定伤害
|
| | | Def_PlayerKey_BurnTimePer = "BurnTimePer" # 延长灼烧时间百分比
|
| | |
| | |
|
| | | index = 0
|
| | | isPlayerTJG = (curObj.GetGameObjType() == IPY_GameWorld.gotPlayer and PlayerTJG.GetIsTJG(curObj))
|
| | | |
| | | skillIDListInDelBuff = [] # buff消失中需要处理添加buff,外层处理避免错乱
|
| | | |
| | | while index < buffState.GetBuffCount():
|
| | | curBuff = buffState.GetBuff( index )
|
| | | if not curBuff:
|
| | |
| | | buffState.DeleteBuffByIndex( index )
|
| | | SkillShell.ClearBuffEffectBySkillID(curObj, curSkill.GetSkillID(), ownerID, ownerType)
|
| | |
|
| | | addSkillID = curObj.GetDictByKey(ChConfig.Def_PlayerKey_SkillInDelBuff) |
| | | if addSkillID and addSkillID not in skillIDListInDelBuff:
|
| | | skillIDListInDelBuff.append(addSkillID)
|
| | | |
| | | OnSkillAfterBuffDisappear(curObj, skillIDListInDelBuff, tick)
|
| | | |
| | | #执行DoBuffDisApper中,标记的玩家处理要求
|
| | | __DoBuffDisApperByKey( curObj , tick )
|
| | |
|
| | | return isRefresh, delResult
|
| | |
|
| | |
|
| | | # DoBuffDisApper不能做Buff添加和删除逻辑!!!!!不然指针会错乱, 故在外层处理
|
| | | def OnSkillAfterBuffDisappear(curObj, skillIDListInDelBuff, tick):
|
| | | posX, posY = curObj.GetPosX(), curObj.GetPosY()
|
| | | for skillID in skillIDListInDelBuff:
|
| | | skillData = GameWorld.GetGameData().GetSkillBySkillID(skillID)
|
| | | if not skillData:
|
| | | continue
|
| | | |
| | | SkillShell.Trigger_UseSkill(curObj, curObj, skillData, tick, posX, posY)
|
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ## 执行buff消失触发逻辑
|
| | | # @param curObj 当前OBj
|
| | |
| | | return
|
| | |
|
| | | # 在防御者身上同时取消同一个释放者的相关buff
|
| | | defender.SetDict("burnOwnerID", curBuff.GetOwnerID())
|
| | | defender.SetDict(ChConfig.Def_PlayerKey_BurnOwnerID, curBuff.GetOwnerID())
|
| | |
|
| | | PassiveBuffEffMng.GetValueByPassiveBuffTriggerType(defender, None, None, ChConfig.TriggerType_BurnDisappear)
|
| | |
|
| | | defender.SetDict("burnOwnerID", 0)
|
| | | defender.SetDict(ChConfig.Def_PlayerKey_BurnOwnerID, 0)
|
| | | return
|
| | |
|
| | |
| | |
|
| | | def OnBuffDisappear(curObj, curSkill, curBuff, curEffect, tick):
|
| | | if tick - curBuff.GetValue() < curSkill.GetLastTime():
|
| | | # 非自然消失
|
| | | return
|
| | |
|
| | | if curEffect.GetEffectValue(1):
|
| | | if not GameObj.GetPyPlayerState(defender, pyPlayerState):
|
| | | return False
|
| | | |
| | | boomValue = curBuff.GetValue()
|
| | | # 剩余护盾值用于爆炸
|
| | | if boomValue == 0:
|
| | | return
|
| | | |
| | | boomValue = int(boomValue*float(curEffect.GetEffectValue(1))/ChConfig.Def_MaxRateValue)
|
| | | #效果值 第三个值为技能ID
|
| | | boomID = curEffect.GetEffectValue(2)
|
| | | skillData = GameWorld.GetGameData().GetSkillBySkillID(boomID)
|
| | | if not skillData:
|
| | | return
|
| | | |
| | | # 存储起来用于伤害
|
| | | curObj.SetDict(ChConfig.Def_PlayerKey_MoreHurtValue, boomValue)
|
| | | |
| | | SkillShell.Trigger_UseSkill(curObj, None, skillData, tick, curObj.GetPosX(), curObj.GetPosY())
|
| | | curObj.SetDict(ChConfig.Def_PlayerKey_MoreHurtValue, 0)
|
| | |
|
| | | if not GameObj.GetPyPlayerState(curObj, curEffect.GetEffectValue(1)):
|
| | | return
|
| | | |
| | | curObj.SetDict(ChConfig.Def_PlayerKey_SkillInDelBuff, curEffect.GetEffectValue(0)) |
| | | return |
| | |
| | | #---------------------------------------------------------------------
|
| | | import GameWorld
|
| | | import SkillCommon
|
| | |
|
| | | import ChConfig
|
| | |
|
| | | def CheckCanHappen(attacker, defender, passiveEffect, skillID, **skillkwargs):
|
| | | curSkill = GameWorld.GetGameData().GetSkillBySkillID(skillID)
|
| | |
| | | buff = buffManager.FindBuff(curSkill.GetSkillTypeID())
|
| | | if not buff:
|
| | | return False
|
| | | if buff.GetOwnerID() != defender.GetDictByKey("burnOwnerID"):
|
| | | if buff.GetOwnerID() != attacker.GetDictByKey(ChConfig.Def_PlayerKey_BurnOwnerID):
|
| | | return False
|
| | | buff.SetRemainTime(1) # 此处必须设置为1 无限时长的buff亦可消失
|
| | | return True
|