diff --git a/README.md b/README.md index 94be5eb2..0842ecaa 100644 --- a/README.md +++ b/README.md @@ -333,11 +333,12 @@ * Flipped perk icon ### Who's Who -* Gain all other perks the player had before going down when entering Who's Who mode +* Keep weapons when entering Who's Who mode +* Invulnerable for 2 seconds after entering and exiting Who's Who mode +* Controls are frozen for 0.5 seconds after exiting Who's Who mode * Revive twice as fast when in Who's Who mode * Changed revive waypoint icon to Who's Who perk icon * Revive waypoint shows offscreen -* No longer gives the player Claymores when entering Who's Who mode if the player purchased Claymores ### Electric Cherry * Removed cooldown after being used multiple times in a row diff --git a/scripts/zm/_zm_reimagined.gsc b/scripts/zm/_zm_reimagined.gsc index 4e38028a..f286c424 100644 --- a/scripts/zm/_zm_reimagined.gsc +++ b/scripts/zm/_zm_reimagined.gsc @@ -197,8 +197,6 @@ onplayerspawned() self thread additionalprimaryweapon_indicator(); self thread additionalprimaryweapon_stowed_weapon_refill(); - self thread whos_who_spawn_changes(); - self thread electric_cherry_unlimited(); //self.score = 100000; @@ -3618,9 +3616,8 @@ additionalprimaryweapon_restore_weapons() if (additionalprimaryweapon_canplayerreceiveweapon(self, self.a_saved_weapon["name"], pap_triggers)) { - current_wep = self getCurrentWeapon(); - self maps\mp\zombies\_zm_weapons::weapondata_give(self.a_saved_weapon); - self switchToWeapon(current_wep); + self additionalprimaryweapon_restore_weapon(self.a_saved_weapon); + self seteverhadweaponall( 1 ); } self.a_saved_weapon = undefined; @@ -3628,6 +3625,49 @@ additionalprimaryweapon_restore_weapons() } } +additionalprimaryweapon_restore_weapon( weapondata ) +{ + current = get_player_weapon_with_same_base( weapondata["name"] ); + + if ( isdefined( current ) ) + { + curweapondata = get_player_weapondata( self, current ); + self takeweapon( current ); + weapondata = merge_weapons( curweapondata, weapondata ); + } + + name = weapondata["name"]; + + if ( !is_weapon_upgraded( name ) ) + self giveweapon( name ); + else + self giveweapon( name, 0, self get_pack_a_punch_weapon_options( name ) ); + + dw_name = weapondualwieldweaponname( name ); + alt_name = weaponaltweaponname( name ); + + if ( name != "none" ) + { + self setweaponammoclip( name, weapondata["clip"] ); + self setweaponammostock( name, weapondata["stock"] ); + + if ( isdefined( weapondata["fuel"] ) ) + self setweaponammofuel( name, weapondata["fuel"] ); + + if ( isdefined( weapondata["heat"] ) && isdefined( weapondata["overheat"] ) ) + self setweaponoverheating( weapondata["overheat"], weapondata["heat"], name ); + } + + if ( dw_name != "none" ) + self setweaponammoclip( dw_name, weapondata["lh_clip"] ); + + if ( alt_name != "none" ) + { + self setweaponammoclip( alt_name, weapondata["alt_clip"] ); + self setweaponammostock( alt_name, weapondata["alt_stock"] ); + } +} + additionalprimaryweapon_canplayerreceiveweapon( player, weapon, pap_triggers ) { if ( isDefined( player ) && self maps\mp\zombies\_zm_weapons::has_weapon_or_upgrade( weapon ) ) @@ -3870,28 +3910,6 @@ refill_after_time(primary) } } -whos_who_spawn_changes() -{ - self endon( "disconnect" ); - - while (1) - { - self waittill("fake_revive"); - - self takeweapon("frag_grenade_zm"); - self takeweapon("claymore_zm"); - self giveweapon("sticky_grenade_zm"); - self setweaponammoclip("sticky_grenade_zm", 2); - - foreach (perk in self.loadout.perks) - { - self maps\mp\zombies\_zm_perks::give_perk(perk); - } - - self waittill("chugabud_effects_cleanup"); - } -} - electric_cherry_unlimited() { self endon( "disconnect" ); diff --git a/scripts/zm/replaced/_zm_chugabud.gsc b/scripts/zm/replaced/_zm_chugabud.gsc index b7891c71..bd0a4b9f 100644 --- a/scripts/zm/replaced/_zm_chugabud.gsc +++ b/scripts/zm/replaced/_zm_chugabud.gsc @@ -3,6 +3,84 @@ #include maps\mp\zombies\_zm_utility; #include maps\mp\zombies\_zm_chugabud; +chugabud_laststand() +{ + self endon( "player_suicide" ); + self endon( "disconnect" ); + self endon( "chugabud_bleedout" ); + self maps\mp\zombies\_zm_laststand::increment_downed_stat(); + self.ignore_insta_kill = 1; + self.health = self.maxhealth; + self chugabud_save_loadout(); + self chugabud_fake_death(); + wait 3; + + if ( isdefined( self.insta_killed ) && self.insta_killed || isdefined( self.disable_chugabud_corpse ) ) + create_corpse = 0; + else + create_corpse = 1; + + if ( create_corpse == 1 ) + { + if ( isdefined( level._chugabug_reject_corpse_override_func ) ) + { + reject_corpse = self [[ level._chugabug_reject_corpse_override_func ]]( self.origin ); + + if ( reject_corpse ) + create_corpse = 0; + } + } + + if ( create_corpse == 1 ) + { + self thread activate_chugabud_effects_and_audio(); + corpse = self chugabud_spawn_corpse(); + corpse thread chugabud_corpse_revive_icon( self ); + self.e_chugabud_corpse = corpse; + corpse thread chugabud_corpse_cleanup_on_spectator( self ); + corpse thread chugabud_corpse_cleanup_on_disconnect( self ); + + if ( isdefined( level.whos_who_client_setup ) ) + corpse setclientfield( "clientfield_whos_who_clone_glow_shader", 1 ); + } + + self chugabud_fake_revive(); + wait 0.1; + self.ignore_insta_kill = undefined; + self.disable_chugabud_corpse = undefined; + + if ( create_corpse == 0 ) + { + self notify( "chugabud_effects_cleanup" ); + return; + } + + bleedout_time = getdvarfloat( "player_lastStandBleedoutTime" ); + self thread chugabud_bleed_timeout( bleedout_time, corpse ); + self thread chugabud_handle_multiple_instances( corpse ); + + corpse waittill( "player_revived", e_reviver ); + + if ( isdefined( e_reviver ) && e_reviver == self ) + self notify( "whos_who_self_revive" ); + + self perk_abort_drinking( 0.1 ); + self maps\mp\zombies\_zm_perks::perk_set_max_health_if_jugg( "health_reboot", 1, 0 ); + self setorigin( corpse.origin ); + self setplayerangles( corpse.angles ); + + if ( self player_is_in_laststand() ) + { + self thread chugabud_laststand_cleanup( corpse, "player_revived" ); + self enableweaponcycling(); + self enableoffhandweapons(); + self auto_revive( self, 1 ); + return; + } + + self chugabud_laststand_cleanup( corpse, undefined ); +} + chugabud_fake_death() { level notify( "fake_death" ); @@ -24,6 +102,134 @@ chugabud_fake_death() self freezecontrols( 1 ); } +chugabud_fake_revive() +{ + level notify( "fake_revive" ); + self notify( "fake_revive" ); + playsoundatposition( "evt_ww_disappear", self.origin ); + playfx( level._effect["chugabud_revive_fx"], self.origin ); + spawnpoint = chugabud_get_spawnpoint(); + + if ( isdefined( level._chugabud_post_respawn_override_func ) ) + self [[ level._chugabud_post_respawn_override_func ]]( spawnpoint.origin ); + + if ( isdefined( level.chugabud_force_corpse_position ) ) + { + if ( isdefined( self.e_chugabud_corpse ) ) + self.e_chugabud_corpse forceteleport( level.chugabud_force_corpse_position ); + + level.chugabud_force_corpse_position = undefined; + } + + if ( isdefined( level.chugabud_force_player_position ) ) + { + spawnpoint.origin = level.chugabud_force_player_position; + level.chugabud_force_player_position = undefined; + } + + self setorigin( spawnpoint.origin ); + self setplayerangles( spawnpoint.angles ); + playsoundatposition( "evt_ww_appear", spawnpoint.origin ); + playfx( level._effect["chugabud_revive_fx"], spawnpoint.origin ); + self allowstand( 1 ); + self allowcrouch( 1 ); + self allowprone( 1 ); + self.ignoreme = 0; + self setstance( "stand" ); + self freezecontrols( 0 ); + self chugabud_give_loadout(); + self seteverhadweaponall( 1 ); + self.score = self.loadout.score; + self.pers["score"] = self.loadout.score; + + wait 2; + + self disableinvulnerability(); +} + +chugabud_give_loadout() +{ + self takeallweapons(); + loadout = self.loadout; + primaries = self getweaponslistprimaries(); + + if ( loadout.weapons.size > 1 || primaries.size > 1 ) + { + foreach ( weapon in primaries ) + self takeweapon( weapon ); + } + + weapons_given = 0; + for ( i = 0; i < loadout.weapons.size; i++ ) + { + if ( !isdefined( loadout.weapons[i] ) ) + continue; + + if ( loadout.weapons[i]["name"] == "none" ) + continue; + + self maps\mp\zombies\_zm_weapons::weapondata_give( loadout.weapons[i] ); + + weapons_given++; + if (weapons_given >= 2) + { + break; + } + } + + if ( loadout.current_weapon >= 0 && isdefined( loadout.weapons[loadout.current_weapon]["name"] ) ) + self switchtoweapon( loadout.weapons[loadout.current_weapon]["name"] ); + + self giveweapon( "knife_zm" ); + self maps\mp\zombies\_zm_equipment::equipment_give( self.loadout.equipment ); + loadout restore_weapons_for_chugabud( self ); + self chugabud_restore_claymore(); + self.score = loadout.score; + self.pers["score"] = loadout.score; + perk_array = maps\mp\zombies\_zm_perks::get_perk_array( 1 ); + + for ( i = 0; i < perk_array.size; i++ ) + { + perk = perk_array[i]; + self unsetperk( perk ); + self.num_perks--; + self set_perk_clientfield( perk, 0 ); + } + + self chugabud_restore_grenades(); + + if ( maps\mp\zombies\_zm_weap_cymbal_monkey::cymbal_monkey_exists() ) + { + if ( loadout.zombie_cymbal_monkey_count ) + { + self maps\mp\zombies\_zm_weap_cymbal_monkey::player_give_cymbal_monkey(); + self setweaponammoclip( "cymbal_monkey_zm", loadout.zombie_cymbal_monkey_count ); + } + } +} + +chugabud_give_perks() +{ + loadout = self.loadout; + + if ( isdefined( loadout.perks ) && loadout.perks.size > 0 ) + { + for ( i = 0; i < loadout.perks.size; i++ ) + { + if ( self hasperk( loadout.perks[i] ) ) + continue; + + if ( loadout.perks[i] == "specialty_quickrevive" && flag( "solo_game" ) ) + level.solo_game_free_player_quickrevive = 1; + + if ( loadout.perks[i] == "specialty_finalstand" ) + continue; + + maps\mp\zombies\_zm_perks::give_perk( loadout.perks[i] ); + } + } +} + chugabud_corpse_revive_icon( player ) { self endon( "death" ); @@ -84,6 +290,62 @@ chugabud_corpse_cleanup( corpse, was_revived ) self.e_chugabud_corpse = undefined; } +chugabud_handle_multiple_instances( corpse ) +{ + corpse endon( "death" ); + + self waittill( "perk_chugabud_activated" ); + + self chugabud_corpse_cleanup( corpse, 0 ); +} + +chugabud_corpse_cleanup_on_disconnect( player ) +{ + self endon( "death" ); + + player waittill( "disconnect" ); + + player chugabud_corpse_cleanup( self, 0 ); +} + +chugabud_laststand_cleanup( corpse, str_notify ) +{ + if ( isdefined( str_notify ) ) + self waittill( str_notify ); + + self setstance( "stand" ); + self thread chugabud_leave_freeze(); + self thread chugabud_revive_invincible(); + self chugabud_give_perks(); + self chugabud_corpse_cleanup( corpse, 1 ); +} + +chugabud_leave_freeze() +{ + self endon( "disconnect" ); + level endon( "end_game" ); + + self freezecontrols( 1 ); + + wait 0.5; + + if ( !is_true( self.hostmigrationcontrolsfrozen ) ) + self freezecontrols( 0 ); +} + +chugabud_revive_invincible() +{ + self endon( "disconnect" ); + level endon( "end_game" ); + + self.health = self.maxhealth; + self enableinvulnerability(); + + wait 2; + + self disableinvulnerability(); +} + chugabud_bleed_timeout( delay, corpse ) { self endon( "player_suicide" ); @@ -100,12 +362,5 @@ chugabud_bleed_timeout( delay, corpse ) } } - if ( flag( "solo_game" ) && self.solo_lives_given < 3 ) - { - self.solo_lives_given++; - corpse notify( "player_revived" ); - return; - } - self chugabud_corpse_cleanup( corpse, 0 ); } \ No newline at end of file diff --git a/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc b/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc index 40a0b666..0e3916d8 100644 --- a/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc +++ b/scripts/zm/zm_highrise/zm_highrise_reimagined.gsc @@ -33,10 +33,6 @@ main() replaceFunc(maps\mp\zm_highrise_buildables::init_buildables, scripts\zm\replaced\zm_highrise_buildables::init_buildables); replaceFunc(maps\mp\zm_highrise_buildables::include_buildables, scripts\zm\replaced\zm_highrise_buildables::include_buildables); replaceFunc(maps\mp\zm_highrise_elevators::faller_location_logic, scripts\zm\replaced\zm_highrise_elevators::faller_location_logic); - replaceFunc(maps\mp\zombies\_zm_chugabud::chugabud_fake_death, scripts\zm\replaced\_zm_chugabud::chugabud_fake_death); - replaceFunc(maps\mp\zombies\_zm_chugabud::chugabud_corpse_revive_icon, scripts\zm\replaced\_zm_chugabud::chugabud_corpse_revive_icon); - replaceFunc(maps\mp\zombies\_zm_chugabud::chugabud_corpse_cleanup, scripts\zm\replaced\_zm_chugabud::chugabud_corpse_cleanup); - replaceFunc(maps\mp\zombies\_zm_chugabud::chugabud_bleed_timeout, scripts\zm\replaced\_zm_chugabud::chugabud_bleed_timeout); replaceFunc(maps\mp\zombies\_zm_equip_springpad::springpadthink, scripts\zm\replaced\_zm_equip_springpad::springpadthink); replaceFunc(maps\mp\zombies\_zm_weap_slipgun::init, scripts\zm\replaced\_zm_weap_slipgun::init); replaceFunc(maps\mp\zombies\_zm_weap_slipgun::slipgun_zombie_1st_hit_response, scripts\zm\replaced\_zm_weap_slipgun::slipgun_zombie_1st_hit_response); @@ -54,6 +50,7 @@ init() level.zombie_init_done = ::zombie_init_done; level.special_weapon_magicbox_check = ::highrise_special_weapon_magicbox_check; level.check_for_valid_spawn_near_team_callback = ::highrise_respawn_override; + level.chugabud_laststand_func = scripts\zm\replaced\_zm_chugabud::chugabud_laststand; slipgun_change_ammo();