From: Mario Date: Sun, 27 Jan 2013 04:25:24 +0000 (+1100) Subject: Add a cvar to change turret upgrade cost X-Git-Tag: xonotic-v0.8.0~241^2^2~555 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5c6ee5bff75f40d7a85ba4de297a4d0d9cad6453;p=xonotic%2Fxonotic-data.pk3dir.git Add a cvar to change turret upgrade cost --- diff --git a/gamemodes.cfg b/gamemodes.cfg index 8987e5e5f..8faca21c4 100644 --- a/gamemodes.cfg +++ b/gamemodes.cfg @@ -504,3 +504,4 @@ set g_td_turret_plasma_cost 50 set g_td_turret_mlrs_cost 80 set g_td_turret_walker_cost 100 set g_td_tower_buff_cost 70 +set g_td_turret_upgrade_cost 100 diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index dd3284a6f..d0e0ee8ce 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -1297,6 +1297,7 @@ float autocvar_g_td_tower_buff_cost; float autocvar_g_td_monsters_skill_start; float autocvar_g_td_monsters_skill_increment; float autocvar_g_td_monsters_spawnshield_time; +float autocvar_g_td_turret_upgrade_cost; float autocvar_g_za_monster_count; float autocvar_g_monsters; float autocvar_g_monsters_max; diff --git a/qcsrc/server/mutators/gamemode_td.qc b/qcsrc/server/mutators/gamemode_td.qc index 5983f514a..e9e5c878c 100644 --- a/qcsrc/server/mutators/gamemode_td.qc +++ b/qcsrc/server/mutators/gamemode_td.qc @@ -968,9 +968,9 @@ MUTATOR_HOOKFUNCTION(td_PlayerCommand) sprint(self, "You need to aim at your turret to upgrade it\n"); return TRUE; } - if(self.ammo_fuel < 100) + if(self.ammo_fuel < autocvar_g_td_turret_upgrade_cost) { - sprint(self, "You need 100 fuel to increase this turret's power\n"); + sprint(self, strcat("You need ", ftos(autocvar_g_td_turret_upgrade_cost), " fuel to increase this turret's power\n")); return TRUE; } if(trace_ent.turret_buff >= 3) @@ -979,7 +979,7 @@ MUTATOR_HOOKFUNCTION(td_PlayerCommand) return TRUE; } - self.ammo_fuel -= 100; + self.ammo_fuel -= autocvar_g_td_turret_upgrade_cost; trace_ent.SendFlags |= TNSF_STATUS; buffturret(trace_ent, 1.2); sprint(self, "Turret power increased by 20%!\n");