diff --git a/README.md b/README.md index 782f596d..eb2541fd 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ ### AN-94 * Increased weapon cost from 1200 to 1500 +* Upgraded: decreased stock ammo from 600 to 450 ### B23R * Changed weapon cost to 900 on all maps @@ -115,6 +116,7 @@ * Increased penetration ### M1911 +* Upgraded: decreased stock ammo from 50 to 48 * Upgraded: given as last stand pistol above all others except Ray Gun Mark 2 * Upgraded: decreased last stand ammo from 2 clips to 1 clip @@ -186,6 +188,7 @@ ### Sliquifier * Added upgraded version * Kills on any round (normally stops killing after round 100) +* Decreased stock ammo from 40 to 20 * Removed additional goo created by chain kills * Added teddy bear to buildable table after weapon is taken from it * Teddy bear standing up means weapon is not available from Mystery Box @@ -509,6 +512,7 @@ * Landing on top of an enemy player that is prone downs them * Increased max radius for landing on top of an enemy player by 16.67% * Decreased max height for landing on top of an enemy player by 50% +* M1911 upgraded: decreased stock ammo from 50 to 24 * Max Ammo: decreased amount of ammo given from max stock to one clip * Max Ammo: unloads clip of all enemy players' weapons * Double Points: decreased duration from 30 seconds to 15 seconds diff --git a/scripts/zm/_zm_reimagined.gsc b/scripts/zm/_zm_reimagined.gsc index c5a795cb..765fad0f 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -46,6 +46,7 @@ main() replaceFunc(maps\mp\zombies\_zm_laststand::revive_give_back_weapons, scripts\zm\replaced\_zm_laststand::revive_give_back_weapons); replaceFunc(maps\mp\zombies\_zm_laststand::revive_hud_think, scripts\zm\replaced\_zm_laststand::revive_hud_think); replaceFunc(maps\mp\zombies\_zm_weapons::weapon_give, scripts\zm\replaced\_zm_weapons::weapon_give); + replaceFunc(maps\mp\zombies\_zm_weapons::ammo_give, scripts\zm\replaced\_zm_weapons::ammo_give); replaceFunc(maps\mp\zombies\_zm_weapons::get_upgraded_ammo_cost, scripts\zm\replaced\_zm_weapons::get_upgraded_ammo_cost); replaceFunc(maps\mp\zombies\_zm_weapons::makegrenadedudanddestroy, scripts\zm\replaced\_zm_weapons::makegrenadedudanddestroy); replaceFunc(maps\mp\zombies\_zm_weapons::createballisticknifewatcher_zm, scripts\zm\replaced\_zm_weapons::createballisticknifewatcher_zm); @@ -60,6 +61,7 @@ main() replaceFunc(maps\mp\zombies\_zm_perks::perk_think, scripts\zm\replaced\_zm_perks::perk_think); replaceFunc(maps\mp\zombies\_zm_perks::perk_set_max_health_if_jugg, scripts\zm\replaced\_zm_perks::perk_set_max_health_if_jugg); replaceFunc(maps\mp\zombies\_zm_perks::initialize_custom_perk_arrays, scripts\zm\replaced\_zm_perks::initialize_custom_perk_arrays); + replaceFunc(maps\mp\zombies\_zm_perks::wait_for_player_to_take, scripts\zm\replaced\_zm_perks::wait_for_player_to_take); replaceFunc(maps\mp\zombies\_zm_power::standard_powered_items, scripts\zm\replaced\_zm_power::standard_powered_items); replaceFunc(maps\mp\zombies\_zm_powerups::full_ammo_powerup, scripts\zm\replaced\_zm_powerups::full_ammo_powerup); replaceFunc(maps\mp\zombies\_zm_powerups::nuke_powerup, scripts\zm\replaced\_zm_powerups::nuke_powerup); @@ -2166,6 +2168,47 @@ disable_carpenter() arrayremovevalue(level.zombie_powerup_array, "carpenter"); } +change_weapon_ammo(weapon) +{ + max_ammo = 0; + + if (isSubStr(weapon, "m1911")) + { + if (is_weapon_upgraded(weapon)) + { + if (level.scr_zm_ui_gametype == "zgrief") + { + max_ammo = 24; + } + else + { + max_ammo = 48; + } + } + } + else if (isSubStr(weapon, "an94")) + { + if (is_weapon_upgraded(weapon)) + { + max_ammo = 450; + } + } + else if (isSubStr(weapon, "slipgun")) + { + max_ammo = 20; + } + + if (max_ammo == 0) + { + return; + } + + if (self getWeaponAmmoStock(weapon) > max_ammo) + { + self setWeaponAmmoStock(weapon, max_ammo); + } +} + wallbuy_location_changes() { if(!is_classic()) diff --git a/scripts/zm/replaced/_zm_perks.gsc b/scripts/zm/replaced/_zm_perks.gsc index 1e262ffa..5720b226 100644 --- a/scripts/zm/replaced/_zm_perks.gsc +++ b/scripts/zm/replaced/_zm_perks.gsc @@ -499,4 +499,78 @@ take_movefaster() { self set_perk_clientfield( "specialty_longersprint", 0 ); } +} + +wait_for_player_to_take( player, weapon, packa_timer, upgrade_as_attachment ) +{ + current_weapon = self.current_weapon; + upgrade_name = self.upgrade_name; + upgrade_weapon = upgrade_name; + self endon( "pap_timeout" ); + level endon( "Pack_A_Punch_off" ); + + while ( true ) + { + packa_timer playloopsound( "zmb_perks_packa_ticktock" ); + + self waittill( "trigger", trigger_player ); + + if ( isdefined( level.pap_grab_by_anyone ) && level.pap_grab_by_anyone ) + player = trigger_player; + + packa_timer stoploopsound( 0.05 ); + + if ( trigger_player == player ) + { + player maps\mp\zombies\_zm_stats::increment_client_stat( "pap_weapon_grabbed" ); + player maps\mp\zombies\_zm_stats::increment_player_stat( "pap_weapon_grabbed" ); + current_weapon = player getcurrentweapon(); + + if ( is_player_valid( player ) && !( player.is_drinking > 0 ) && !is_placeable_mine( current_weapon ) && !is_equipment( current_weapon ) && level.revive_tool != current_weapon && "none" != current_weapon && !player hacker_active() ) + { + maps\mp\_demo::bookmark( "zm_player_grabbed_packapunch", gettime(), player ); + self notify( "pap_taken" ); + player notify( "pap_taken" ); + player.pap_used = 1; + + if ( !( isdefined( upgrade_as_attachment ) && upgrade_as_attachment ) ) + player thread do_player_general_vox( "general", "pap_arm", 15, 100 ); + else + player thread do_player_general_vox( "general", "pap_arm2", 15, 100 ); + + weapon_limit = get_player_weapon_limit( player ); + player maps\mp\zombies\_zm_weapons::take_fallback_weapon(); + primaries = player getweaponslistprimaries(); + + if ( isdefined( primaries ) && primaries.size >= weapon_limit ) + player maps\mp\zombies\_zm_weapons::weapon_give( upgrade_weapon ); + else + { + player giveweapon( upgrade_weapon, 0, player maps\mp\zombies\_zm_weapons::get_pack_a_punch_weapon_options( upgrade_weapon ) ); + player givestartammo( upgrade_weapon ); + player scripts\zm\_zm_reimagined::change_weapon_ammo(upgrade_weapon); + } + + player switchtoweapon( upgrade_weapon ); + + if ( isdefined( player.restore_ammo ) && player.restore_ammo ) + { + new_clip = player.restore_clip + weaponclipsize( upgrade_weapon ) - player.restore_clip_size; + new_stock = player.restore_stock + weaponmaxammo( upgrade_weapon ) - player.restore_max; + player setweaponammostock( upgrade_weapon, new_stock ); + player setweaponammoclip( upgrade_weapon, new_clip ); + } + + player.restore_ammo = undefined; + player.restore_clip = undefined; + player.restore_stock = undefined; + player.restore_max = undefined; + player.restore_clip_size = undefined; + player maps\mp\zombies\_zm_weapons::play_weapon_vo( upgrade_weapon ); + return; + } + } + + wait 0.05; + } } \ No newline at end of file diff --git a/scripts/zm/replaced/_zm_powerups.gsc b/scripts/zm/replaced/_zm_powerups.gsc index 628db9b3..4516541b 100644 --- a/scripts/zm/replaced/_zm_powerups.gsc +++ b/scripts/zm/replaced/_zm_powerups.gsc @@ -70,6 +70,8 @@ full_ammo_powerup( drop_item, player ) { players[i] givemaxammo(primary_weapons[x]); } + + players[i] scripts\zm\_zm_reimagined::change_weapon_ammo(primary_weapons[x]); } x++; } diff --git a/scripts/zm/replaced/_zm_weapons.gsc b/scripts/zm/replaced/_zm_weapons.gsc index c016e139..77ce4f30 100644 --- a/scripts/zm/replaced/_zm_weapons.gsc +++ b/scripts/zm/replaced/_zm_weapons.gsc @@ -157,8 +157,56 @@ weapon_give( weapon, is_upgrade, magic_box, nosound ) } } self play_weapon_vo( weapon, magic_box ); + + self scripts\zm\_zm_reimagined::change_weapon_ammo(weapon); } +ammo_give( weapon ) +{ + give_ammo = 0; + + if ( !is_offhand_weapon( weapon ) ) + { + weapon = get_weapon_with_attachments( weapon ); + + if ( isdefined( weapon ) ) + { + stockmax = 0; + stockmax = weaponstartammo( weapon ); + clipcount = self getweaponammoclip( weapon ); + currstock = self getammocount( weapon ); + + if ( currstock - clipcount >= stockmax ) + give_ammo = 0; + else + give_ammo = 1; + } + } + else if ( self has_weapon_or_upgrade( weapon ) ) + { + if ( self getammocount( weapon ) < weaponmaxammo( weapon ) ) + give_ammo = 1; + } + + if ( give_ammo ) + { + self play_sound_on_ent( "purchase" ); + self givemaxammo( weapon ); + alt_weap = weaponaltweaponname( weapon ); + + if ( "none" != alt_weap ) + self givemaxammo( alt_weap ); + + self scripts\zm\_zm_reimagined::change_weapon_ammo(weapon); + + return true; + } + + if ( !give_ammo ) + return false; +} + + lethal_grenade_update_prompt( player ) { weapon = self.stub.zombie_weapon_upgrade; diff --git a/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc b/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc index 885f2da8..8e0999be 100644 --- a/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc +++ b/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc @@ -27,6 +27,8 @@ init() level.special_weapon_magicbox_check = ::highrise_special_weapon_magicbox_check; level.check_for_valid_spawn_near_team_callback = ::highrise_respawn_override; + slipgun_change_ammo(); + level thread elevator_solo_revive_fix(); } @@ -91,6 +93,26 @@ highrise_respawn_override( revivee, return_struct ) } } +slipgun_change_ammo() +{ + foreach (buildable in level.zombie_include_buildables) + { + if(IsDefined(buildable.name) && buildable.name == "slipgun_zm") + { + buildable.onbuyweapon = ::onbuyweapon_slipgun; + return; + } + } +} + +onbuyweapon_slipgun( player ) +{ + player givestartammo( self.stub.weaponname ); + player switchtoweapon( self.stub.weaponname ); + player scripts\zm\_zm_reimagined::change_weapon_ammo(self.stub.weaponname); + level notify( "slipgun_bought", player ); +} + elevator_solo_revive_fix() { if (!(is_classic() && level.scr_zm_map_start_location == "rooftop"))