From 21ad312468d96e7bd4bf8f550455c009f7fdc6fd Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Sat, 25 Feb 2023 16:45:19 -0800 Subject: [PATCH] Meat: meat throw changes --- README.md | 4 +- scripts/zm/replaced/zgrief.gsc | 13 +++++ scripts/zm/zgrief/zgrief_reimagined.gsc | 57 ++++++++++++++++--- scripts/zm/zm_buried/zm_buried_reimagined.gsc | 2 + scripts/zm/zm_prison/zm_prison_reimagined.gsc | 2 + .../zm/zm_transit/zm_transit_reimagined.gsc | 1 + 6 files changed, 71 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8fe72db2..0a1e787d 100644 --- a/README.md +++ b/README.md @@ -522,8 +522,10 @@ #### Meat * Gain score by being the team holding the meat * Gain 250 score to win the game -* Meat always spawns from first zombie killed +* Meat powerup always spawns from the first zombie killed * All zombies go after player holding meat +* Throwing the meat on the ground makes it a grabbable powerup +* Throwing the meat onto another player makes them hold the meat * Player holding the meat gains 100 points when their team gains score * Players respawn after being down for 10 seconds * Players retain perks diff --git a/scripts/zm/replaced/zgrief.gsc b/scripts/zm/replaced/zgrief.gsc index 8d78749d..fbc58c91 100644 --- a/scripts/zm/replaced/zgrief.gsc +++ b/scripts/zm/replaced/zgrief.gsc @@ -20,6 +20,12 @@ game_mode_spawn_player_logic() meat_stink_on_ground(position_to_play) { + if(level.scr_zm_ui_gametype_obj == "zmeat") + { + maps\mp\zombies\_zm_powerups::specific_powerup_drop( "meat_stink", position_to_play ); + return; + } + level.meat_on_ground = 1; attractor_point = spawn( "script_model", position_to_play ); attractor_point setmodel( "tag_origin" ); @@ -40,6 +46,13 @@ meat_stink_player( who ) { level notify( "new_meat_stink_player" ); level endon( "new_meat_stink_player" ); + + if(level.scr_zm_ui_gametype_obj == "zmeat") + { + level thread [[level.zgrief_meat_stink]](who); + return; + } + who.ignoreme = 0; players = get_players(); foreach ( player in players ) diff --git a/scripts/zm/zgrief/zgrief_reimagined.gsc b/scripts/zm/zgrief/zgrief_reimagined.gsc index 1e707e5f..2e8c12d5 100644 --- a/scripts/zm/zgrief/zgrief_reimagined.gsc +++ b/scripts/zm/zgrief/zgrief_reimagined.gsc @@ -61,6 +61,8 @@ init() meat_init(); } + level._powerup_grab_check = ::meat_can_player_grab; + level thread round_start_wait(5, true); level thread remove_round_number(); level thread unlimited_zombies(); @@ -2811,15 +2813,26 @@ meat_powerup_drop_think() while(1) { - level.zombie_powerup_ape = "meat_stink"; - level.zombie_vars["zombie_drop_item"] = 1; - - level waittill( "powerup_dropped", powerup ); - - if (powerup.powerup_name != "meat_stink") + powerup = undefined; + if (isDefined(level.new_meat_powerup)) { - continue; + powerup = level.new_meat_powerup; + level.new_meat_powerup = undefined; } + else + { + level.zombie_powerup_ape = "meat_stink"; + level.zombie_vars["zombie_drop_item"] = 1; + + level waittill( "powerup_dropped", powerup ); + + if (powerup.powerup_name != "meat_stink") + { + continue; + } + } + + level thread meat_powerup_dropped_check(); meat_active = true; while (meat_active) @@ -2842,6 +2855,23 @@ meat_powerup_drop_think() meat_active = true; } } + + level notify("meat_inactive"); + } +} + +meat_powerup_dropped_check() +{ + level endon("meat_inactive"); + + while(1) + { + level waittill( "powerup_dropped", powerup ); + + if (powerup == "meat_stink") + { + level.new_meat_powerup = powerup; + } } } @@ -3035,6 +3065,19 @@ meat_waypoint_init() return meat_waypoint; } +meat_can_player_grab(player) +{ + if (self.powerup_name == "meat_stink") + { + if (player hasWeapon("item_meat_zm") || is_true(player.dont_touch_the_meat)) + { + return false; + } + } + + return true; +} + increment_score(team) { level endon("end_game"); diff --git a/scripts/zm/zm_buried/zm_buried_reimagined.gsc b/scripts/zm/zm_buried/zm_buried_reimagined.gsc index 98b706b8..5d84b438 100644 --- a/scripts/zm/zm_buried/zm_buried_reimagined.gsc +++ b/scripts/zm/zm_buried/zm_buried_reimagined.gsc @@ -34,7 +34,9 @@ init() level.special_weapon_magicbox_check = ::buried_special_weapon_magicbox_check; level._is_player_in_zombie_stink = maps\mp\zombies\_zm_perk_vulture::_is_player_in_zombie_stink; level._zm_buildables_pooled_swap_buildable_fields = maps\mp\zombies\_zm_buildables_pooled::swap_buildable_fields; + level.zgrief_meat_stink = maps\mp\gametypes_zm\zgrief::meat_stink; level.zgrief_meat_stink_player_create = maps\mp\gametypes_zm\zgrief::meat_stink_player_create; + level.zgrief_meat_stink_player_cleanup = maps\mp\gametypes_zm\zgrief::meat_stink_player_cleanup; level.zmeat_create_item_meat_watcher = maps\mp\gametypes_zm\zmeat::create_item_meat_watcher; if(is_gametype_active("zgrief")) diff --git a/scripts/zm/zm_prison/zm_prison_reimagined.gsc b/scripts/zm/zm_prison/zm_prison_reimagined.gsc index bc6f8cf8..911879b9 100644 --- a/scripts/zm/zm_prison/zm_prison_reimagined.gsc +++ b/scripts/zm/zm_prison/zm_prison_reimagined.gsc @@ -28,7 +28,9 @@ init() level.zombie_init_done = ::zombie_init_done; level.special_weapon_magicbox_check = ::check_for_special_weapon_limit_exist; level.round_prestart_func = scripts\zm\replaced\_zm_afterlife::afterlife_start_zombie_logic; + level.zgrief_meat_stink = maps\mp\gametypes_zm\zgrief::meat_stink; level.zgrief_meat_stink_player_create = maps\mp\gametypes_zm\zgrief::meat_stink_player_create; + level.zgrief_meat_stink_player_cleanup = maps\mp\gametypes_zm\zgrief::meat_stink_player_cleanup; level.zmeat_create_item_meat_watcher = maps\mp\gametypes_zm\zmeat::create_item_meat_watcher; remove_acid_trap_player_spawn(); diff --git a/scripts/zm/zm_transit/zm_transit_reimagined.gsc b/scripts/zm/zm_transit/zm_transit_reimagined.gsc index de6fb25b..211fdf90 100644 --- a/scripts/zm/zm_transit/zm_transit_reimagined.gsc +++ b/scripts/zm/zm_transit/zm_transit_reimagined.gsc @@ -46,6 +46,7 @@ init() level.zombie_init_done = ::zombie_init_done; level.special_weapon_magicbox_check = ::transit_special_weapon_magicbox_check; level.grenade_safe_to_bounce = ::grenade_safe_to_bounce; + level.zgrief_meat_stink = maps\mp\gametypes_zm\zgrief::meat_stink; level.zgrief_meat_stink_player_create = maps\mp\gametypes_zm\zgrief::meat_stink_player_create; level.zgrief_meat_stink_player_cleanup = maps\mp\gametypes_zm\zgrief::meat_stink_player_cleanup; level.zmeat_create_item_meat_watcher = maps\mp\gametypes_zm\zmeat::create_item_meat_watcher;