mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-10 07:08:06 -05:00
One Inch Punch: optimize weapon give
This commit is contained in:
@ -20,70 +20,50 @@ one_inch_punch_melee_attack()
|
||||
self ent_flag_init( "melee_punch_cooldown" );
|
||||
|
||||
self.one_inch_punch_flag_has_been_init = 1;
|
||||
current_melee_weapon = self get_player_melee_weapon();
|
||||
self takeweapon( current_melee_weapon );
|
||||
|
||||
punch_weapon = "one_inch_punch_zm";
|
||||
flourish_weapon = "zombie_one_inch_punch_flourish";
|
||||
|
||||
if ( isdefined( self.b_punch_upgraded ) && self.b_punch_upgraded )
|
||||
{
|
||||
str_weapon = self getcurrentweapon();
|
||||
self disable_player_move_states( 1 );
|
||||
self giveweapon( "zombie_one_inch_punch_upgrade_flourish" );
|
||||
self switchtoweapon( "zombie_one_inch_punch_upgrade_flourish" );
|
||||
self waittill_any( "player_downed", "weapon_change_complete" );
|
||||
self switchtoweapon( str_weapon );
|
||||
self enable_player_move_states();
|
||||
self takeweapon( "zombie_one_inch_punch_upgrade_flourish" );
|
||||
punch_weapon = "one_inch_punch_" + self.str_punch_element + "_zm";
|
||||
flourish_weapon = "zombie_one_inch_punch_upgrade_flourish";
|
||||
}
|
||||
|
||||
if ( self.str_punch_element == "air" )
|
||||
{
|
||||
self giveweapon( "one_inch_punch_air_zm" );
|
||||
self set_player_melee_weapon( "one_inch_punch_air_zm" );
|
||||
self giveweapon( "held_one_inch_punch_air_zm" );
|
||||
self setactionslot( 2, "weapon", "one_inch_punch_air_zm" );
|
||||
}
|
||||
else if ( self.str_punch_element == "fire" )
|
||||
{
|
||||
self giveweapon( "one_inch_punch_fire_zm" );
|
||||
self set_player_melee_weapon( "one_inch_punch_fire_zm" );
|
||||
self giveweapon( "held_one_inch_punch_fire_zm" );
|
||||
self setactionslot( 2, "weapon", "held_one_inch_punch_fire_zm" );
|
||||
}
|
||||
else if ( self.str_punch_element == "ice" )
|
||||
{
|
||||
self giveweapon( "one_inch_punch_ice_zm" );
|
||||
self set_player_melee_weapon( "one_inch_punch_ice_zm" );
|
||||
self giveweapon( "held_one_inch_punch_ice_zm" );
|
||||
self setactionslot( 2, "weapon", "held_one_inch_punch_ice_zm" );
|
||||
}
|
||||
else if ( self.str_punch_element == "lightning" )
|
||||
{
|
||||
self giveweapon( "one_inch_punch_lightning_zm" );
|
||||
self set_player_melee_weapon( "one_inch_punch_lightning_zm" );
|
||||
self giveweapon( "held_inch_punch_lightning_zm" );
|
||||
self setactionslot( 2, "weapon", "held_inch_punch_lightning_zm" );
|
||||
}
|
||||
else
|
||||
{
|
||||
self giveweapon( "one_inch_punch_upgraded_zm" );
|
||||
self set_player_melee_weapon( "one_inch_punch_upgraded_zm" );
|
||||
self giveweapon( "held_one_inch_punch_upgraded_zm" );
|
||||
self setactionslot( 2, "weapon", "held_one_inch_punch_upgraded_zm" );
|
||||
}
|
||||
current_melee_weapon = self get_player_melee_weapon();
|
||||
str_weapon = self getcurrentweapon();
|
||||
self disable_player_move_states( 1 );
|
||||
self giveweapon( flourish_weapon );
|
||||
self switchtoweapon( flourish_weapon );
|
||||
|
||||
result = self waittill_any_return( "player_downed", "weapon_change" );
|
||||
|
||||
self takeweapon( current_melee_weapon );
|
||||
self takeweapon( "held_" + current_melee_weapon );
|
||||
self giveweapon( punch_weapon );
|
||||
self set_player_melee_weapon( punch_weapon );
|
||||
self giveweapon( "held_" + punch_weapon );
|
||||
self setactionslot( 2, "weapon", "held_" + punch_weapon );
|
||||
|
||||
if (result != "player_downed")
|
||||
{
|
||||
self waittill_any( "player_downed", "weapon_change_complete" );
|
||||
}
|
||||
|
||||
if (is_melee_weapon(str_weapon))
|
||||
{
|
||||
self switchtoweapon( "held_" + punch_weapon );
|
||||
}
|
||||
else
|
||||
{
|
||||
str_weapon = self getcurrentweapon();
|
||||
self disable_player_move_states( 1 );
|
||||
self giveweapon( "zombie_one_inch_punch_flourish" );
|
||||
self switchtoweapon( "zombie_one_inch_punch_flourish" );
|
||||
self waittill_any( "player_downed", "weapon_change_complete" );
|
||||
self switchtoweapon( str_weapon );
|
||||
self enable_player_move_states();
|
||||
self takeweapon( "zombie_one_inch_punch_flourish" );
|
||||
self giveweapon( "one_inch_punch_zm" );
|
||||
self set_player_melee_weapon( "one_inch_punch_zm" );
|
||||
self giveweapon( "held_one_inch_punch_zm" );
|
||||
self setactionslot( 2, "weapon", "held_one_inch_punch_zm" );
|
||||
}
|
||||
|
||||
self takeweapon( flourish_weapon );
|
||||
self enable_player_move_states();
|
||||
|
||||
if ( !isdefined( self.b_punch_upgraded ) || !self.b_punch_upgraded )
|
||||
{
|
||||
self thread maps\mp\zombies\_zm_audio::create_and_play_dialog( "perk", "one_inch" );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user