From 4cb1b511a094e19c14543d6c8f3d53b629d2a15e Mon Sep 17 00:00:00 2001 From: Jbleezy Date: Mon, 27 Dec 2021 20:30:41 -0800 Subject: [PATCH] Borough: add PDW and SVU wallbuys --- README.md | 6 ++- maps/mp/zm_buried_grief_street.gsc | 71 +++++++++++++++++++++++++----- 2 files changed, 64 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 70e3b38f..93378575 100644 --- a/README.md +++ b/README.md @@ -248,8 +248,10 @@ #### Borough * Tunnels disabled -* Players initially spawn in the Stables zone -* Added B23R, M16A1, Claymore, and Bowie Knife wallbuys +* Players spawn at Stables +* Added B23R, M16, Claymore, and Bowie Knife wallbuys at their locations on Buried +* Added PDW wallbuy at Morgue +* Added SVU wallbuy at Church * Moved Quick Revive to Speed Cola's location on Borough * Moved Speed Cola to its location on Buried * Moved Stamin-Up to Vulture Aid's location on Buried diff --git a/maps/mp/zm_buried_grief_street.gsc b/maps/mp/zm_buried_grief_street.gsc index b057b623..2e0dc5c3 100644 --- a/maps/mp/zm_buried_grief_street.gsc +++ b/maps/mp/zm_buried_grief_street.gsc @@ -100,18 +100,67 @@ enemy_location_override( zombie, enemy ) builddynamicwallbuys() { - builddynamicwallbuy( "bank", "beretta93r_zm" ); - builddynamicwallbuy( "bar", "pdw57_zm" ); - builddynamicwallbuy( "church", "ak74u_zm" ); - builddynamicwallbuy( "courthouse", "mp5k_zm" ); - builddynamicwallbuy( "generalstore", "m16_zm" ); + builddynamicwallbuy( "morgue", "pdw57_zm" ); + builddynamicwallbuy( "church", "svu_zm" ); builddynamicwallbuy( "mansion", "an94_zm" ); - builddynamicwallbuy( "morgue", "svu_zm" ); - builddynamicwallbuy( "prison", "claymore_zm" ); - builddynamicwallbuy( "stables", "bowie_knife_zm" ); - builddynamicwallbuy( "stablesroof", "frag_grenade_zm" ); - builddynamicwallbuy( "toystore", "tazer_knuckles_zm" ); - builddynamicwallbuy( "candyshop", "870mcs_zm" ); + + scripts/zm/main/_zm_reimagined::wallbuy_increase_trigger_radius(); + scripts/zm/main/_zm_reimagined::wallbuy_decrease_upgraded_ammo_cost(); +} + +builddynamicwallbuy( location, weaponname ) +{ + foreach ( stub in level.chalk_builds ) + { + wallbuy = getstruct( stub.target, "targetname" ); + + if ( isDefined( wallbuy.script_location ) && wallbuy.script_location == location ) + { + spawned_wallbuy = undefined; + for ( i = 0; i < level._spawned_wallbuys.size; i++ ) + { + if ( level._spawned_wallbuys[ i ].target == wallbuy.targetname ) + { + spawned_wallbuy = level._spawned_wallbuys[ i ]; + break; + } + } + + if ( !isDefined( spawned_wallbuy ) ) + { + origin = wallbuy.origin; + + // center wallbuy chalk and model, and adjust wallbuy trigger + if(weaponname == "pdw57_zm") + { + origin += anglesToForward(wallbuy.angles) * 12; + wallbuy.origin += anglesToForward(wallbuy.angles) * 3; + } + else if(weaponname == "svu_zm") + { + origin += anglesToForward(wallbuy.angles) * 24; + wallbuy.origin += anglesToForward(wallbuy.angles) * 15; + } + + struct = spawnStruct(); + struct.target = wallbuy.targetname; + level._spawned_wallbuys[level._spawned_wallbuys.size] = struct; + + // move model foreward so it always shows in front of chalk + model = spawn_weapon_model( weaponname, undefined, origin + anglesToRight(wallbuy.angles) * -0.25, wallbuy.angles ); + model.targetname = struct.target; + model setmodel( getWeaponModel(weaponname) ); + model useweaponhidetags( weaponname ); + model hide(); + + chalk_fx = weaponname + "_fx"; + thread scripts/zm/main/_zm_reimagined::playchalkfx( chalk_fx, origin, wallbuy.angles ); + } + + maps/mp/zombies/_zm_weapons::add_dynamic_wallbuy( weaponname, wallbuy.targetname, 1 ); + thread wait_and_remove( stub, stub.buildablezone.pieces[ 0 ] ); + } + } } buildbuildables()