From fb2c36b028f82d55d3cf74adc9cb5c4abc29c9d2 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 20 十月 2022 15:31:23 +0800
Subject: [PATCH] 9710 【越南】【主干】【BT7】阵营对抗增加复活点回复生命(仙盟联赛营地支持回复生命)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py
index e3c8a3e..7b365e5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py
@@ -168,6 +168,8 @@
self.calcFightTimeTick = 0 # 计算战斗时长tick
self.collectTypeIndex = 0 # 采集NPC类型配置index
self.collectLostHPTick = 0 # 采集NPC掉血tick
+
+ self.restoreHPTick = 0 # 营地回血tick
return
def AddFamilyWarPlayer(familyID, faction, playerID, name, tick):
@@ -793,6 +795,10 @@
def __AddPlayerFightTimeByTime(tick):
# 更新玩家战斗时长
+
+ restoreHPPerBySecond = IpyGameDataPY.GetFuncCfg("FamilyMatchSpawnPoint", 4) # 每秒回血百分比
+ factionSafeAreaRandPosList = IpyGameDataPY.GetFuncEvalCfg("FamilyMatchSpawnPoint", 3) # 营地坐标
+
playerManager = GameWorld.GetMapCopyPlayerManager()
for index in xrange(playerManager.GetPlayerCount()):
curPlayer = playerManager.GetPlayerByIndex(index)
@@ -800,6 +806,24 @@
if not playerID:
continue
warPlayer = GetFamilyWarPlayer(playerID)
+
+ faction = curPlayer.GetFaction()
+ if faction and faction <= len(factionSafeAreaRandPosList):
+ safePosX, safePosY, safeRadius = factionSafeAreaRandPosList[faction - 1]
+ if GameWorld.GetDist(curPlayer.GetPosX(), curPlayer.GetPosY(), safePosX, safePosY) <= safeRadius:
+ # 营地回血
+ restoreSeconds = (tick - warPlayer.restoreHPTick) / 1000.0 if warPlayer.restoreHPTick else 1 # 首次保底1秒
+ if restoreSeconds >= 1:
+ maxHP = GameObj.GetMaxHP(curPlayer)
+ if GameObj.GetHP(curPlayer) < maxHP:
+ restoreHP = int(maxHP * restoreHPPerBySecond / 100.0 * round(restoreSeconds, 1))
+ #GameWorld.DebugLog("restoreHPPerBySecond=%s,restoreSeconds=%s,maxHP=%s,restoreHP=%s"
+ # % (restoreHPPerBySecond, restoreSeconds, maxHP, restoreHP), playerID)
+ SkillCommon.SkillAddHP(curPlayer, 0, restoreHP)
+ warPlayer.restoreHPTick = tick
+ else:
+ warPlayer.restoreHPTick = 0
+
lastCalcTick = warPlayer.calcFightTimeTick
warPlayer.calcFightTimeTick = tick
if not lastCalcTick:
--
Gitblit v1.8.0