From 726e916709bc0e038ee4cfeafa434ffdfd759fad Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Thu, 30 Mar 2023 17:11:31 -0700 Subject: [PATCH] Staffs: picking up staff at Crazy Place while holding staff places other staff at Crazy Place --- README.md | 1 + scripts/zm/replaced/zm_tomb_main_quest.gsc | 33 +++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 768e4924..b6d0cef7 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,7 @@ * Upgrade only requires collecting souls in The Crazy Place * Can no longer collect souls in The Crazy Place from staff kills * Can collect souls in The Crazy Place after upgrading to fill 5% of max ammo per soul +* Picking up a staff at The Crazy Place while holding a staff places the other staff at The Crazy Place * Fixed triggers for inserting and picking up staffs in The Crazy Place * Fixed being able to carry multiple staffs by picking up a staff with staff revive weapon out * Get full ammo when initially picked up after upgrading (normally missing one clip) diff --git a/scripts/zm/replaced/zm_tomb_main_quest.gsc b/scripts/zm/replaced/zm_tomb_main_quest.gsc index e8f37327..f60b1856 100644 --- a/scripts/zm/replaced/zm_tomb_main_quest.gsc +++ b/scripts/zm/replaced/zm_tomb_main_quest.gsc @@ -295,8 +295,17 @@ watch_for_player_pickup_staff() a_weapons = player getweaponslistprimaries(); n_max_other_weapons = get_player_weapon_limit( player ) - 1; - if ( a_weapons.size > n_max_other_weapons || issubstr( weapon_drop, "staff" ) ) + if ( issubstr( weapon_drop, "staff" ) ) + { + n_index = get_staff_enum_from_element_weapon( weapon_drop ); + e_staff_standard = get_staff_info_from_element_index( n_index ); + e_staff_standard_upgraded = e_staff_standard.upgrade; + e_staff_standard_upgraded.charge_trigger notify( "trigger", player ); + } + else if ( a_weapons.size > n_max_other_weapons ) + { player takeweapon( weapon_drop ); + } player thread watch_staff_ammo_reload(); self ghost(); @@ -322,6 +331,28 @@ watch_for_player_pickup_staff() } } +get_staff_enum_from_element_weapon(weapon_drop) +{ + if (isSubStr(weapon_drop, "fire")) + { + return 1; + } + else if (isSubStr(weapon_drop, "air")) + { + return 2; + } + else if (isSubStr(weapon_drop, "lightning")) + { + return 3; + } + else if (isSubStr(weapon_drop, "water")) + { + return 4; + } + + return 1; +} + can_pickup_staff() { b_has_staff = self player_has_staff();