diff --git a/README.md b/README.md index 5b67bda0..aa28ad32 100644 --- a/README.md +++ b/README.md @@ -250,6 +250,7 @@ * Max ammo no longer fills clip ammo * Upgraded: kill on any round * Upgraded: charged shots damage Panzersoldat +* Upgraded: decreased alt weapon reload time to 0.5 seconds * Fire upgraded: charged shots no longer deal additional damage to Panzersoldat ## Wallbuys diff --git a/scripts/zm/replaced/_zm_weap_staff_revive.gsc b/scripts/zm/replaced/_zm_weap_staff_revive.gsc new file mode 100644 index 00000000..600e133d --- /dev/null +++ b/scripts/zm/replaced/_zm_weap_staff_revive.gsc @@ -0,0 +1,47 @@ +#include common_scripts\utility; +#include maps\mp\_utility; +#include maps\mp\zombies\_zm_utility; +#include maps\mp\zombies\_zm_net; +#include maps\mp\zm_tomb_utility; +#include maps\mp\zombies\_zm_laststand; +#include maps\mp\zombies\_zm_weap_staff_revive; + +watch_staff_revive_fired() +{ + self endon( "disconnect" ); + + while ( true ) + { + self waittill( "missile_fire", e_projectile, str_weapon ); + + if ( !( str_weapon == "staff_revive_zm" ) ) + continue; + + self thread staff_revive_impact_wait(); + + self thread staff_revive_reload( str_weapon ); + } +} + +staff_revive_impact_wait() +{ + self waittill( "projectile_impact", e_ent, v_explode_point, n_radius, str_name, n_impact ); + + self thread staff_revive_impact( v_explode_point ); +} + +staff_revive_reload( str_weapon ) +{ + self endon( "disconnect" ); + + wait weaponFireTime(str_weapon) - 0.05; + + ammo_clip = self getWeaponAmmoClip(str_weapon); + ammo_stock = self getWeaponAmmoStock(str_weapon); + + if (ammo_clip < 1 && ammo_stock >= 1) + { + self setWeaponAmmoClip(str_weapon, ammo_clip + 1); + self setWeaponAmmoStock(str_weapon, ammo_stock - 1); + } +} \ No newline at end of file diff --git a/scripts/zm/replaced/zm_tomb_main_quest.gsc b/scripts/zm/replaced/zm_tomb_main_quest.gsc index f60b1856..732f144e 100644 --- a/scripts/zm/replaced/zm_tomb_main_quest.gsc +++ b/scripts/zm/replaced/zm_tomb_main_quest.gsc @@ -315,6 +315,7 @@ watch_for_player_pickup_staff() clip_size = weaponclipsize( self.weapname ); player setweaponammoclip( self.weapname, clip_size ); player givemaxammo( self.weapname ); + player givemaxammo( "staff_revive_zm" ); self.owner = player; level notify( "stop_staff_sound" ); self notify( "staff_equip" ); @@ -382,6 +383,7 @@ staff_upgraded_reload() clip_size = weaponclipsize( self.weapname ); max_ammo = weaponmaxammo( self.weapname ); + revive_max_ammo = weaponmaxammo( "staff_revive_zm" ); n_count = int( max_ammo / 20 ); b_reloaded = 0; @@ -400,9 +402,16 @@ staff_upgraded_reload() self.prev_ammo_stock -= clip_add; } - if ( self.prev_ammo_stock >= max_ammo ) + if ( self.revive_ammo_clip < 1 && self.revive_ammo_stock >= 1 ) + { + self.revive_ammo_clip += 1; + self.revive_ammo_stock -= 1; + } + + if ( self.prev_ammo_stock >= max_ammo && self.revive_ammo_stock >= revive_max_ammo ) { self.prev_ammo_stock = max_ammo; + self.revive_ammo_stock = revive_max_ammo; self setclientfield( "staff_charger", 0 ); self.charger.full = 1; self thread staff_glow_fx(); @@ -411,6 +420,7 @@ staff_upgraded_reload() self.charger waittill( "soul_received" ); self.prev_ammo_stock += n_count; + self.revive_ammo_stock += 1; } } diff --git a/scripts/zm/replaced/zm_tomb_utility.gsc b/scripts/zm/replaced/zm_tomb_utility.gsc index 42355fcc..ea4afd75 100644 --- a/scripts/zm/replaced/zm_tomb_utility.gsc +++ b/scripts/zm/replaced/zm_tomb_utility.gsc @@ -85,13 +85,21 @@ update_staff_accessories( n_element_index ) self setactionslot( 3, "weapon", "staff_revive_zm" ); self giveweapon( "staff_revive_zm" ); - if ( isdefined( staff_info ) ) + if ( isdefined( staff_info ) && isdefined( staff_info.upgrade.revive_ammo_stock ) ) { - if ( isdefined( staff_info.upgrade.revive_ammo_stock ) ) + if ( staff_info.upgrade.revive_ammo_clip < 1 && staff_info.upgrade.revive_ammo_stock >= 1 ) { - self setweaponammostock( "staff_revive_zm", staff_info.upgrade.revive_ammo_stock ); - self setweaponammoclip( "staff_revive_zm", staff_info.upgrade.revive_ammo_clip ); + staff_info.upgrade.revive_ammo_clip += 1; + staff_info.upgrade.revive_ammo_stock -= 1; } + + self setweaponammostock( "staff_revive_zm", staff_info.upgrade.revive_ammo_stock ); + self setweaponammoclip( "staff_revive_zm", staff_info.upgrade.revive_ammo_clip ); + } + else + { + self setweaponammostock( "staff_revive_zm", 3 ); + self setweaponammoclip( "staff_revive_zm", 1 ); } } } diff --git a/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc b/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc index c5925c7e..86501bd1 100644 --- a/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc +++ b/scripts/zm/zm_tomb/zm_tomb_reimagined.gsc @@ -29,6 +29,7 @@ #include scripts\zm\replaced\_zm_weap_staff_air; #include scripts\zm\replaced\_zm_weap_staff_fire; #include scripts\zm\replaced\_zm_weap_staff_lightning; +#include scripts\zm\replaced\_zm_weap_staff_revive; main() { @@ -72,6 +73,7 @@ main() replaceFunc(maps\mp\zombies\_zm_weap_staff_fire::flame_damage_fx, scripts\zm\replaced\_zm_weap_staff_fire::flame_damage_fx); replaceFunc(maps\mp\zombies\_zm_weap_staff_fire::get_impact_damage, scripts\zm\replaced\_zm_weap_staff_fire::get_impact_damage); replaceFunc(maps\mp\zombies\_zm_weap_staff_lightning::staff_lightning_ball_kill_zombies, scripts\zm\replaced\_zm_weap_staff_lightning::staff_lightning_ball_kill_zombies); + replaceFunc(maps\mp\zombies\_zm_weap_staff_revive::watch_staff_revive_fired, scripts\zm\replaced\_zm_weap_staff_revive::watch_staff_revive_fired); } init()