alias debugmonsters "cmd debugmonsters ${* ?}"
alias upgradeturret "cmd buffturret ${* ?}"
alias rmturret "cmd turretremove ${* ?}"
+alias repairturret "cmd repairturret ${* ?}"
// ============================================================
set g_td_tower_buff_cost 70
set g_td_turret_flac_cost 40
set g_td_turret_upgrade_cost 100
+set g_td_turret_repair_cost 20
set g_td_monsters_speed_walk 75
set g_td_monsters_speed_run 110
set g_td_monsters_spawn_delay 3
float autocvar_g_td_monsters_spawn_delay;
float autocvar_g_td_monsters_spawnshield_time;
float autocvar_g_td_turret_upgrade_cost;
+float autocvar_g_td_turret_repair_cost;
float autocvar_g_za_monster_count;
float autocvar_g_monsters;
float autocvar_g_monsters_max;
sprint(self, strcat("You do not have enough fuel to spawn a ", argv(1), " turret\n"));
return TRUE;
}
+ if(cmd_name == "repairturret")
+ {
+ if(trace_ent.realowner != self || !(trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET))
+ {
+ sprint(self, "You need to aim at your turret to repair it\n");
+ return TRUE;
+ }
+ if(self.ammo_fuel < autocvar_g_td_turret_repair_cost)
+ {
+ sprint(self, strcat("You need ", ftos(autocvar_g_td_turret_repair_cost), " fuel to repair this turret\n"));
+ return TRUE;
+ }
+ if(trace_ent.health >= trace_ent.max_health)
+ {
+ sprint(self, "This turret is already at max health\n");
+ return TRUE;
+ }
+
+ self.ammo_fuel -= autocvar_g_td_turret_repair_cost;
+ trace_ent.SendFlags |= TNSF_STATUS;
+ trace_ent.health = bound(1, trace_ent.health + 100, trace_ent.max_health);
+ sprint(self, "100 turret health repaired!\n");
+
+ return TRUE;
+ }
if(cmd_name == "buffturret")
{
if(trace_ent.realowner != self || !(trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET))