9710 【越南】【主干】【BT7】阵营对抗增加复活点回复生命(仙盟联赛营地支持回复生命)
1个文件已修改
24 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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: