From dc0e44895dac68c8dc643e46a3ef06189af64ead Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Wed, 3 Jan 2024 19:50:26 -0800 Subject: [PATCH] Encounter: steal points from EMP Grenade and Meat --- scripts/zm/replaced/_zm_weap_emp_bomb.gsc | 5 +- scripts/zm/replaced/zgrief.gsc | 5 +- scripts/zm/zgrief/zgrief_reimagined.gsc | 197 ++++++++++++---------- 3 files changed, 117 insertions(+), 90 deletions(-) diff --git a/scripts/zm/replaced/_zm_weap_emp_bomb.gsc b/scripts/zm/replaced/_zm_weap_emp_bomb.gsc index e1c71362..1dfa1185 100644 --- a/scripts/zm/replaced/_zm_weap_emp_bomb.gsc +++ b/scripts/zm/replaced/_zm_weap_emp_bomb.gsc @@ -201,7 +201,10 @@ player_perk_pause_and_unpause_all_perks(time, owner) { self.last_emped_by = spawnStruct(); self.last_emped_by.attacker = owner; - self [[level.store_player_damage_info_func]](owner, "emp_grenade_zm", "MOD_GRENADE_SPLASH"); + + self.player_damage_callback_score_only = 1; + self [[level._game_module_player_damage_callback]](owner, owner, 0, 0, "MOD_GRENADE_SPLASH", "emp_grenade_zm"); + self.player_damage_callback_score_only = undefined; } else { diff --git a/scripts/zm/replaced/zgrief.gsc b/scripts/zm/replaced/zgrief.gsc index 8131c4ab..05d11c17 100644 --- a/scripts/zm/replaced/zgrief.gsc +++ b/scripts/zm/replaced/zgrief.gsc @@ -439,7 +439,10 @@ meat_stink_player(who, owner) { who.last_meated_by = spawnStruct(); who.last_meated_by.attacker = owner; - who [[level.store_player_damage_info_func]](owner, level.item_meat_name, "MOD_UNKNOWN"); + + who.player_damage_callback_score_only = 1; + who [[level._game_module_player_damage_callback]](owner, owner, 0, 0, "MOD_UNKNOWN", level.item_meat_name); + who.player_damage_callback_score_only = undefined; } else { diff --git a/scripts/zm/zgrief/zgrief_reimagined.gsc b/scripts/zm/zgrief/zgrief_reimagined.gsc index f7560ceb..7bfda774 100644 --- a/scripts/zm/zgrief/zgrief_reimagined.gsc +++ b/scripts/zm/zgrief/zgrief_reimagined.gsc @@ -1661,6 +1661,15 @@ custom_end_screen() game_module_player_damage_callback(einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime) { + if (isdefined(self.player_damage_callback_score_only)) + { + self do_game_mode_stun_score_steal(eattacker); + + self store_player_damage_info(eattacker, sweapon, smeansofdeath); + + return 0; + } + self.last_damage_from_zombie_or_player = 0; if (isDefined(eattacker)) @@ -1730,90 +1739,7 @@ game_module_player_damage_callback(einflictor, eattacker, idamage, idflags, smea { is_melee = true; dir = vdir; - amount = 0; - - if (self maps\mp\zombies\_zm_laststand::is_reviving_any()) - { - if (idamage >= 500) - { - if (!self isOnGround()) - { - amount = 185; // 64 air units - } - else if (self getStance() == "stand") - { - amount = 297.5; // 32 units - } - else if (self getStance() == "crouch") - { - amount = 215; // 21.33 units - } - else if (self getStance() == "prone") - { - amount = 132.5; // 10.66 units - } - } - else - { - if (!self isOnGround()) - { - amount = 142.5; // 48 air units - } - else if (self getStance() == "stand") - { - amount = 235; // 24 units - } - else if (self getStance() == "crouch") - { - amount = 172.5; // 16 units - } - else if (self getStance() == "prone") - { - amount = 112.5; // 8 units - } - } - } - else - { - if (idamage >= 500) - { - if (!self isOnGround()) - { - amount = 350; // 128 air units - } - else if (self getStance() == "stand") - { - amount = 540; // 64 units - } - else if (self getStance() == "crouch") - { - amount = 377.5; // 42.66 units - } - else if (self getStance() == "prone") - { - amount = 215; // 21.33 units - } - } - else - { - if (!self isOnGround()) - { - amount = 265; // 96 air units - } - else if (self getStance() == "stand") - { - amount = 420; // 48 units - } - else if (self getStance() == "crouch") - { - amount = 297.5; // 32 units - } - else if (self getStance() == "prone") - { - amount = 172.5; // 16 units - } - } - } + amount = self get_player_push_amount(idamage); if (self isOnGround()) { @@ -1832,10 +1758,7 @@ game_module_player_damage_callback(einflictor, eattacker, idamage, idflags, smea if (!is_true(self._being_shellshocked)) { - score = 100 * maps\mp\zombies\_zm_score::get_points_multiplier(eattacker); - self stun_score_steal(eattacker, score); - - eattacker.killsdenied++; + self do_game_mode_stun_score_steal(eattacker); } if (isDefined(level._effect["butterflies"])) @@ -1850,6 +1773,104 @@ game_module_player_damage_callback(einflictor, eattacker, idamage, idflags, smea } } +get_player_push_amount(idamage) +{ + amount = 0; + + if (self maps\mp\zombies\_zm_laststand::is_reviving_any()) + { + if (idamage >= 500) + { + if (!self isOnGround()) + { + amount = 185; // 64 air units + } + else if (self getStance() == "stand") + { + amount = 297.5; // 32 units + } + else if (self getStance() == "crouch") + { + amount = 215; // 21.33 units + } + else if (self getStance() == "prone") + { + amount = 132.5; // 10.66 units + } + } + else + { + if (!self isOnGround()) + { + amount = 142.5; // 48 air units + } + else if (self getStance() == "stand") + { + amount = 235; // 24 units + } + else if (self getStance() == "crouch") + { + amount = 172.5; // 16 units + } + else if (self getStance() == "prone") + { + amount = 112.5; // 8 units + } + } + } + else + { + if (idamage >= 500) + { + if (!self isOnGround()) + { + amount = 350; // 128 air units + } + else if (self getStance() == "stand") + { + amount = 540; // 64 units + } + else if (self getStance() == "crouch") + { + amount = 377.5; // 42.66 units + } + else if (self getStance() == "prone") + { + amount = 215; // 21.33 units + } + } + else + { + if (!self isOnGround()) + { + amount = 265; // 96 air units + } + else if (self getStance() == "stand") + { + amount = 420; // 48 units + } + else if (self getStance() == "crouch") + { + amount = 297.5; // 32 units + } + else if (self getStance() == "prone") + { + amount = 172.5; // 16 units + } + } + } + + return amount; +} + +do_game_mode_stun_score_steal(eattacker) +{ + score = 100 * maps\mp\zombies\_zm_score::get_points_multiplier(eattacker); + self stun_score_steal(eattacker, score); + + eattacker.killsdenied++; +} + do_game_mode_stun_fx(einflictor, eattacker, idamage, idflags, smeansofdeath, sweapon, vpoint, vdir, shitloc, psoffsettime) { pos = vpoint;