From f2fb76ce4ad761b2295c445cfcb7fefe3545457d Mon Sep 17 00:00:00 2001 From: Mikk Date: Sun, 7 Apr 2024 09:54:57 -0300 Subject: [PATCH] turret_active_time --- game/cfg/skills/skill_default.json | 5 +++++ src/game/server/entities/NPCs/military/turret.cpp | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/game/cfg/skills/skill_default.json b/game/cfg/skills/skill_default.json index 0802c67a5..231ab64fe 100644 --- a/game/cfg/skills/skill_default.json +++ b/game/cfg/skills/skill_default.json @@ -247,6 +247,11 @@ "turret_health2": 50, "turret_health3": 60, + // seconds turret will stay active w/o a target + "turret_active_time1": 15, + "turret_active_time2": 20, + "turret_active_time3": 30, + // 0 = turret can not take damage when it's off // affects both turret and miniturret. "turret_takedamage_off1": 1, diff --git a/src/game/server/entities/NPCs/military/turret.cpp b/src/game/server/entities/NPCs/military/turret.cpp index dfbce0036..c0b335b01 100644 --- a/src/game/server/entities/NPCs/military/turret.cpp +++ b/src/game/server/entities/NPCs/military/turret.cpp @@ -19,7 +19,6 @@ #define TURRET_RANGE (100 * 12) #define TURRET_SPREAD Vector(0, 0, 0) #define TURRET_TURNRATE 30 //!< angles per 0.1 second -#define TURRET_MAXWAIT 15 //!< seconds turret will stay active w/o a target #define TURRET_MAXSPIN 5 //!< seconds turret barrel will spin w/o a target #define TURRET_MACHINE_VOLUME 0.5 @@ -383,7 +382,7 @@ void CBaseTurret::Initialize() m_fTurnRate = TURRET_TURNRATE; } if (m_flMaxWait == 0) - m_flMaxWait = TURRET_MAXWAIT; + m_flMaxWait = GetSkillFloat( "turret_active_time"sv, 15 ); m_flStartYaw = pev->angles.y; if (m_iOrientation == 1) {