From cdfd826105b097c36f7c635c99cda7967d97e430 Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Sun, 22 Mar 2020 13:43:56 -0700 Subject: [PATCH] Added enemy counter HUD --- README.md | 1 + _zm_reimagined.gsc | 40 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7167b458..1351ba53 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ ## HUD * Health bar displayed on top center of screen +* Enemy counter displayed on top left of screen * Current zone displayed on bottom left of screen ## Zombies diff --git a/_zm_reimagined.gsc b/_zm_reimagined.gsc index d898267a..80cdbeae 100644 --- a/_zm_reimagined.gsc +++ b/_zm_reimagined.gsc @@ -50,6 +50,7 @@ onplayerspawned() self tomb_give_shovel(); self thread health_bar_hud(); + self thread enemy_counter_hud(); self thread zone_hud(); self thread fall_velocity_check(); @@ -92,8 +93,6 @@ onplayerspawned() self setperk( "specialty_unlimitedsprint" ); self setperk( "specialty_fastmantle" ); - self tombstone_reset_perks(); - self thread playerhealthregen(); } } @@ -265,6 +264,41 @@ health_bar_hud() } } +enemy_counter_hud() +{ + self endon("disconnect"); + + enemy_counter_hud = newClientHudElem(self); + enemy_counter_hud.alignx = "left"; + enemy_counter_hud.aligny = "top"; + enemy_counter_hud.horzalign = "user_left"; + enemy_counter_hud.vertalign = "user_top"; + enemy_counter_hud.x += 5; + enemy_counter_hud.y += 2; + enemy_counter_hud.fontscale = 1.4; + enemy_counter_hud.alpha = 0; + enemy_counter_hud.color = ( 1, 1, 1 ); + enemy_counter_hud.hidewheninmenu = 1; + + flag_wait( "initial_blackscreen_passed" ); + + text = "Enemies Remaining: "; + enemy_counter_hud.alpha = 1; + while (1) + { + enemies = get_round_enemy_array().size + level.zombie_total; + + if (enemies == 0) + { + enemies = ""; + } + + enemy_counter_hud setText(text + enemies); + + wait 0.05; + } +} + zone_hud() { self endon("disconnect"); @@ -274,7 +308,7 @@ zone_hud() zone_hud.aligny = "bottom"; zone_hud.horzalign = "user_left"; zone_hud.vertalign = "user_bottom"; - zone_hud.x += 7; + zone_hud.x += 5; if (level.script == "zm_buried") { zone_hud.y -= 125;