From 14661edf6156dbc38b2fe4bdf0a15cceacc52897 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 31 五月 2019 16:04:19 +0800
Subject: [PATCH] 6805 【后端】【2.0】副本前端化(去除木桩非自定义场景召唤限制,最大同时存在木桩数改为3个,设置玩家血量改为玩家掉血)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index 20a96ea..18f1725 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -5821,18 +5821,23 @@
     NetPackCommon.SendFakePack(curPlayer, sendPack)
     return
 
-#// B4 0E 设置玩家自身血量 #tagCMSetRoleHP
+#// B4 0E 玩家掉血 #tagCMRoleLostHP
 #
-#struct    tagCMSetRoleHP
+#struct    tagCMRoleLostHP
 #{
 #    tagHead        Head;
-#    DWORD        HP;
+#    DWORD        LostHP;
 #};
-def OnSetRoleHP(index, clientData, tick):
+def OnRoleLostHP(index, clientData, tick):
     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
-    if not curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
-        GameWorld.DebugLog("玩家当前不是在自定义场景中,不允许设置自身血量!")
-        return
-    setHP = max(1, min(clientData.HP, curPlayer.GetMaxHP()))
-    curPlayer.SetHP(setHP)
+    lostHP = clientData.LostHP
+    curHP = curPlayer.GetHP()
+    updHP = curHP - lostHP
+    if updHP <= 0:
+        #玩家已经死亡
+        playerControl = PlayerControl.PlayerControl(curPlayer)
+        playerControl.SetDead()
+    else:
+        curPlayer.SetHP(updHP)
+        
     return

--
Gitblit v1.8.0