1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-21 12:40:20 -05:00

Staffs upgraded: decrease alt weapon reload time

Staffs upgraded: fix staff charge not giving max ammo on alt weapon initially
Staffs upgraded: fix staff recharge not recharging alt weapon
This commit is contained in:
Jbleezy
2023-04-03 22:26:59 -07:00
parent 7969519686
commit c291ffd3a4
5 changed files with 73 additions and 5 deletions

View File

@ -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);
}
}

View File

@ -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;
}
}

View File

@ -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 );
}
}
}

View File

@ -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()