From 5c4ea9b4fd7f98d82e64878a5ce29d5747506f8c Mon Sep 17 00:00:00 2001 From: xdh <xiefantasy@qq.com> Date: 星期四, 24 一月 2019 14:08:09 +0800 Subject: [PATCH] 5924 【后端】【1.5.100】诛仙Boss功能(2秒不打,停止掉血) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ZhuXianBoss.py | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ZhuXianBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ZhuXianBoss.py index ba38246..5e00d42 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ZhuXianBoss.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ZhuXianBoss.py @@ -41,6 +41,7 @@ FBDict_IsReduceing = 'FBDict_IsReduceing%s' #是否掉血中 FBPlayerDict_Rank = "FBPlayerDict_Rank" # 玩家排名 FBDict_BossTotalHP = 'FBDict_BossTotalHP%s' #BOSS血量 +FBDict_LastHurtTick = 'FBDict_LastHurtTick' #上次伤害时间 g_heroHurtDict = {} #{playerID:hurt} @@ -323,6 +324,7 @@ # @return None def DoFB_Player_HurtNPC(curPlayer, curNPC, hurtHP): UpdateHurtInfo(curPlayer, hurtHP) + GameWorld.GetGameFB().SetGameFBDict(FBDict_LastHurtTick, GameWorld.GetGameWorld().GetTick()) return # def UpdateHurtInfo(curPlayer, hurtHP, isAdd=False): @@ -371,6 +373,11 @@ startTick = gameWorld.GetGameWorldDictByKey(FBDict_StartTick % lineID) if not startTick or overTick: return + lastHurtTick = gameFB.GetGameFBDictByKey(FBDict_LastHurtTick) + if lastHurtTick and tick - lastHurtTick >= 2000: + StopReduceHP(lineID, tick) + GameWorld.GetGameFB().SetGameFBDict(FBDict_LastHurtTick, 0) + FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 5000) __CheckBossHP(tick) @@ -616,6 +623,7 @@ if not startTick: gameWorld.SetGameWorldDict(FBDict_RemainHP % lineID, __GetBossTotalHP(lineID)) gameWorld.SetGameWorldDict(FBDict_StartTick % lineID, tick) + FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0) return def __GetBossTotalHP(lineID):return GameWorld.GetGameWorld().GetGameWorldDictByKey(FBDict_BossTotalHP%lineID) @@ -670,11 +678,12 @@ def CheckCanAttackTagObjInFB(attacker, defender): atkObjType = attacker.GetGameObjType() defObjType = defender.GetGameObjType() - if atkObjType == IPY_GameWorld.gotPlayer and defObjType == IPY_GameWorld.gotNPC: - gameWorld = GameWorld.GetGameWorld() - lineID = gameWorld.GetPropertyID() - 1 - if not gameWorld.GetGameWorldDictByKey(FBDict_IsReduceing%lineID): - PlayerControl.NotifyCode(attacker, 'TryEnterJadeDynastyBossError_7') + gameWorld = GameWorld.GetGameWorld() + lineID = gameWorld.GetPropertyID() - 1 + if defObjType == IPY_GameWorld.gotNPC and defender.GetNPCID() == CurFBLineBOSSID(lineID): + if not PyGameData.g_ZhuXianBossPlayerHurtDict.get(lineID, {}): + if atkObjType == IPY_GameWorld.gotPlayer: + PlayerControl.NotifyCode(attacker, 'TryEnterJadeDynastyBossError_7') return False return True -- Gitblit v1.8.0