From 55f4e9c13d188351415dc8860ba543cdb6815f7b Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 18 May 2013 19:10:07 +1000 Subject: [PATCH] Decrease default turret power --- .../server/mutators/gamemode_towerdefense.qc | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/qcsrc/server/mutators/gamemode_towerdefense.qc b/qcsrc/server/mutators/gamemode_towerdefense.qc index 49f8e5b74..610411580 100644 --- a/qcsrc/server/mutators/gamemode_towerdefense.qc +++ b/qcsrc/server/mutators/gamemode_towerdefense.qc @@ -7,7 +7,9 @@ float max_perteam; float total_killed; -var float max_turrets = 3; +var float max_turrets = 10; + +.float turret_buff; .float newfuel; // hack to not give players fuel every time they spawn @@ -125,11 +127,6 @@ void td_generator_damage(entity inflictor, entity attacker, float damage, float self.SendFlags |= GSF_STATUS; } -void td_generator_reset() -{ - self.SendFlags |= GSF_SETUP; -} - void td_generator_setup() { self.think = func_null; @@ -289,6 +286,28 @@ void spawnturret(entity spawnedby, entity own, string turet, vector orig) self = oldself; } +void buffturret(entity tur, float buff) +{ + float refbuff = bound(0.01, buff * 0.05, 0.1); + + tur.turret_buff += 1; + tur.max_health *= buff; + tur.tur_health = tur.max_health; + tur.health = tur.max_health; + tur.ammo_max *= buff; + tur.ammo_recharge *= buff; + tur.shot_dmg *= buff; + tur.shot_radius *= buff; + tur.shot_speed *= buff; + tur.shot_spread *= buff; + tur.shot_force *= buff; + + if(buff < 1) + tur.shot_refire += refbuff; + else + tur.shot_refire -= refbuff; +} + void spawn_td_fuel(float fuel_size) { if not(g_td) {remove(self); return; } @@ -313,6 +332,8 @@ void TD_RoundStart() { allowed_to_spawn = TRUE; + ignore_turrets = TRUE; + total_killed = 0; } @@ -530,6 +551,7 @@ MUTATOR_HOOKFUNCTION(td_TurretSpawn) return TRUE; self.bot_attack = FALSE; + buffturret(self, 0.7); return FALSE; } @@ -545,8 +567,6 @@ MUTATOR_HOOKFUNCTION(td_MonsterSpawn) return FALSE; } - WaypointSprite_Kill(self.sprite); - self.candrop = FALSE; self.bot_attack = FALSE; self.ammo_fuel = bound(20, 20 * self.level, 100); -- 2.39.2