From 97cbea04b641f367c24096e69dfe058baf80b150 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期三, 05 十二月 2018 15:42:59 +0800
Subject: [PATCH] 5242 【后端】【1.3.100】仙盟宴会答题修改为只能在宴会地图内才能答题
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py | 50 +++++++++++++++++++++++++++++++++++---------------
1 files changed, 35 insertions(+), 15 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py
index 99e49a4..b6db6ac 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerState.py
@@ -1447,23 +1447,43 @@
#GameWorld.DebugLog("退出Boss状态!", curPlayer.GetPlayerID())
# 脱离PK战斗 X秒后按比例恢复
- if not IsInPKState(curPlayer):
- if tick - curPlayer.GetDictByKey("StartProDTick") < IpyGameDataPY.GetFuncCfg("MagicExterior", 2) * 1000:
- return
-
- if curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
- return
-
- # 每秒恢复
- if tick - curPlayer.GetDictByKey("restoreProDTick") < 1000:
- return
- #非PK状态恢复护盾
- PlayerControl.SetProDef(curPlayer, min(PlayerControl.GetProDef(curPlayer) + \
- IpyGameDataPY.GetFuncCfg("MagicExterior", 3)*PlayerControl.GetMaxProDef(curPlayer)/ChConfig.Def_MaxRateValue, \
- PlayerControl.GetMaxProDef(curPlayer)))
- curPlayer.SetDict("restoreProDTick", tick)
+ ProcessProDef(curPlayer, tick)
return
+# 脱离PK战斗 X秒后按比例恢复
+def ProcessProDef(curPlayer, tick):
+ if PlayerControl.GetProDefHPPer(curPlayer) == 0:
+ # 没转化值
+ return
+
+ # 脱离PK战斗 X秒后按比例恢复
+ if IsInPKState(curPlayer):
+ return
+
+ if tick - curPlayer.GetDictByKey("StartProDTick") < IpyGameDataPY.GetFuncCfg("MagicExterior", 2) * 1000:
+ return
+
+ if curPlayer.GetPlayerAction() == IPY_GameWorld.paDie:
+ return
+
+ # 每秒恢复
+ if tick - curPlayer.GetDictByKey("restoreProDTick") < 1000:
+ return
+
+ curProDef = PlayerControl.GetProDef(curPlayer)
+ maxProDef = PlayerControl.GetMaxProDef(curPlayer)
+
+ if curProDef == maxProDef:
+ return
+
+ #非PK状态恢复护盾
+ PlayerControl.SetProDef(curPlayer, min(curProDef + \
+ IpyGameDataPY.GetFuncCfg("MagicExterior", 3)*maxProDef/ChConfig.Def_MaxRateValue, maxProDef))
+ curPlayer.SetDict("restoreProDTick", tick)
+
+ return
+
+
def IsInPKState(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PDict_PKStateTick) > 0
def SetPKStateTick(curPlayer, tick):
if not curPlayer.GetDictByKey(ChConfig.Def_PDict_PKStateTick):
--
Gitblit v1.8.0