6603 【后端】【2.0】增加新版的sp和被动技能 - 修复无法清除buff问题
| | |
| | | return curBuff
|
| | |
|
| | | return None
|
| | |
|
| | | def FindBuffByOwnerEx(gameObj, skillTypeID, ownerID, ownerType):
|
| | | findSkill = GameWorld.GetGameData().GetSkillBySkillID(skillTypeID)
|
| | | buffType = GetBuffType(findSkill)
|
| | | buffTuple = GetBuffManagerByBuffType(gameObj, buffType)
|
| | | if buffTuple == ():
|
| | | return None, None, None, None
|
| | |
|
| | | buffManager = buffTuple[0]
|
| | | for i in range(0, buffManager.GetBuffCount()):
|
| | | curBuff = buffManager.GetBuff(i)
|
| | | if not curBuff:
|
| | | continue
|
| | | |
| | | #判断是否拥有同一类型的技能
|
| | | if curBuff.GetSkill().GetSkillTypeID() != skillTypeID:
|
| | | continue
|
| | | |
| | | #判断是否拥有同一类型的技能
|
| | | if curBuff.GetOwnerID() != ownerID:
|
| | | continue
|
| | | |
| | | if curBuff.GetOwnerType() != ownerType:
|
| | | continue
|
| | | |
| | | return curBuff, buffManager, buffType, findSkill
|
| | | |
| | | return None, None, None, None
|
| | | #---------------------------------------------------------------------
|
| | | ## 执行清空命令 参数:玩家, 保留技能类型列表
|
| | | # @param curPlayer 玩家
|
| | |
| | | def UseSkill(attacker, defender, curSkill, tagRoundPosX, tagRoundPosY, isEnhanceSkill, tick):
|
| | | if not defender:
|
| | | return
|
| | | |
| | | if not GameWorld.CanHappen(curSkill.GetHappenRate(), ChConfig.Def_MaxRateValue):
|
| | | #清除失败也触发CD
|
| | | return BaseAttack.DoSkillEx_AttackSucess(attacker, defender, curSkill, tick, isEnhanceSkill)
|
| | |
|
| | | delSuccess = False
|
| | | |
| | | # 优先清理指定技能
|
| | | mark = curSkill.GetEffect(0).GetEffectValue(1)
|
| | | theSkillID = mark if mark > 10 else 0
|
| | | cleanCnt = mark if 0< mark <= 10 else 1
|
| | | if theSkillID:
|
| | | if not curSkill.GetEffect(0).GetEffectValue(2):
|
| | | findBuff = SkillCommon.FindBuffByID(defender, theSkillID)
|
| | | findBuff, buffManager, buffType, buffSkill = SkillCommon.FindBuffByID(defender, theSkillID)
|
| | | else:
|
| | | findBuff = SkillCommon.FindBuffByOwner(defender, theSkillID, attacker.GetID(), attacker.GetGameObjType())
|
| | | findBuff, buffManager, buffType, buffSkill = SkillCommon.FindBuffByOwnerEx(defender, theSkillID, attacker.GetID(), attacker.GetGameObjType())
|
| | | if findBuff:
|
| | | ownerID, ownerType = findBuff.GetOwnerID(), findBuff.GetOwnerType()
|
| | | |
| | | #删除Buff
|
| | | BuffSkill.DoBuffDisApperEx(defender, findBuff, tick)
|
| | | skillID = buffSkill.GetSkillID()
|
| | | buffManager.DeleteBuffByTypeID(buffSkill.GetSkillTypeID())
|
| | | SkillShell.ClearBuffEffectBySkillID(defender, skillID, ownerID, ownerType)
|
| | | delSuccess = True
|
| | | else:
|
| | | # 某类技能中的一个
|
| | |
| | | findBuff = SkillCommon.FindBuffByOwner(defender, effect.GetEffectValue(1), attacker.GetID(), attacker.GetGameObjType())
|
| | | if not findBuff:
|
| | | return 0
|
| | | return effect.GetEffectValue(0)*findBuff.GetLayer()
|
| | | return effect.GetEffectValue(2)*findBuff.GetLayer()
|