| | |
| | |
|
| | | # 属性击晕
|
| | | def AttackFaintRate(attacker, defender, curSkill, tick):
|
| | | if attacker.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
| | | return
|
| | | #if attacker.GetGameObjType() != IPY_GameWorld.gotPlayer:
|
| | | # return
|
| | |
|
| | | faintRate = GameObj.GetFaintRate(attacker)
|
| | | if not faintRate:
|
| | | #GameWorld.DebugLog("没有击晕概率!", attacker.GetID())
|
| | | return
|
| | |
|
| | | if curSkill:
|
| | | useSkillData = attacker.GetUseSkill()
|
| | | # 非主动性技能不触发
|
| | | if not useSkillData:
|
| | | return
|
| | | if useSkillData.GetSkillID() != curSkill.GetSkillID():
|
| | | return
|
| | | |
| | | if not defender:
|
| | | useSkillTagID = attacker.GetUseSkillTagID()
|
| | | useSkillTagType = attacker.GetUseSkillTagType()
|
| | | defender = GameWorld.GetObj(useSkillTagID, useSkillTagType)
|
| | | if attacker.GetGameObjType() == IPY_GameWorld.gotPlayer:
|
| | | if curSkill:
|
| | | useSkillData = attacker.GetUseSkill()
|
| | | # 非主动性技能不触发
|
| | | if not useSkillData:
|
| | | return
|
| | | if useSkillData.GetSkillID() != curSkill.GetSkillID():
|
| | | return
|
| | | |
| | | if not defender:
|
| | | return
|
| | | useSkillTagID = attacker.GetUseSkillTagID()
|
| | | useSkillTagType = attacker.GetUseSkillTagType()
|
| | | defender = GameWorld.GetObj(useSkillTagID, useSkillTagType)
|
| | | |
| | | if not defender:
|
| | | return
|
| | |
|
| | | if attacker.GetID() == defender.GetID():
|
| | | return
|
| | |
|
| | | |
| | | if GameObj.GetHP(defender) <= 0:
|
| | | return
|
| | |
|
| | | tagFaintRate = GameObj.GetFaintDefRate(defender) if defender.GetGameObjType() == IPY_GameWorld.gotPlayer else 0
|
| | |
|
| | | |
| | | tagFaintDefRate = GameObj.GetFaintDefRate(defender)
|
| | | |
| | | # 添加最高60%击晕效果
|
| | | maxRate = IpyGameDataPY.GetFuncCfg("PassiveSkillFaint", 1)
|
| | | rate = min(max(faintRate - tagFaintRate, 0), maxRate)
|
| | | rate = min(max(faintRate - tagFaintDefRate, 0), maxRate)
|
| | | if not GameWorld.CanHappen(rate):
|
| | | return
|
| | |
|
| | |
| | | GameWorld.DebugLog("击晕CD中! rate=%s,剩余tick=%s" % (rate, remainTick), attacker.GetID())
|
| | | return
|
| | | attacker.SetDict(ChConfig.Def_PlayerKey_AttrFaintCD, tick)
|
| | | GameWorld.DebugLog("触发击晕! rate=%s" % rate, attacker.GetID())
|
| | | GameWorld.DebugLog("触发击晕! rate=%s,tagID=%s" % (rate, defender.GetID()), attacker.GetID())
|
| | |
|
| | | SkillCommon.AddBuffBySkillType(defender, ChConfig.Def_SkillID_AtkerFaint, tick)
|
| | | return
|