diff --git a/README.md b/README.md index 12bb414c..b1345f2f 100644 --- a/README.md +++ b/README.md @@ -841,6 +841,7 @@ * Noose and Guillotine parts automatically picked up * Moved MSMC wallbuy to its location on Borough * Moved buildable wallbuy in Courthouse to AN-94 wallbuy location on Borough +* Adjusted buildable wallbuy positions * Drawing weapons no longer gives points * Arthur barricades are buyable debris * Arthur can be purchased to feed him candy and make him run around and kill zombies for 30 seconds diff --git a/scripts/zm/replaced/_zm_weapons.csc b/scripts/zm/replaced/_zm_weapons.csc index 55fb6623..bcd0bf98 100644 --- a/scripts/zm/replaced/_zm_weapons.csc +++ b/scripts/zm/replaced/_zm_weapons.csc @@ -136,6 +136,7 @@ wallbuy_callback_idx(localclientnum, oldval, newval, bnewent, binitialsnap, fiel if (isdefined(level.buildable_wallbuy_weapon_models[weaponname])) model = level.buildable_wallbuy_weapon_models[weaponname]; + origin = target_struct.origin; angles = target_struct.angles; if (isdefined(level.buildable_wallbuy_weapon_angles[weaponname])) @@ -156,10 +157,19 @@ wallbuy_callback_idx(localclientnum, oldval, newval, bnewent, binitialsnap, fiel } } - target_model = spawn_weapon_model(localclientnum, weaponname, model, target_struct.origin, angles); + if (isdefined(level.buildable_wallbuy_weapon_offsets[weaponname])) + { + offset = level.buildable_wallbuy_weapon_offsets[weaponname]; + + origin += (anglestoforward(angles) * offset[0]) + (anglestoright(angles) * offset[1]) + (anglestoup(angles) * offset[2]); + } + + target_model = spawn_weapon_model(localclientnum, weaponname, model, origin, angles); target_model hide(); target_model.parent_struct = target_struct; + target_model.parent_struct.origin = origin; + target_model offset_model(weaponname); struct.models[localclientnum] = target_model; @@ -175,7 +185,7 @@ wallbuy_callback_idx(localclientnum, oldval, newval, bnewent, binitialsnap, fiel if (isdefined(level._effect[weaponname + "_fx"])) fx = level._effect[weaponname + "_fx"]; - struct.fx[localclientnum] = playfx(localclientnum, fx, struct.origin, anglestoforward(struct.angles), anglestoup(struct.angles), 0.1); + struct.fx[localclientnum] = playfx(localclientnum, fx, origin, anglestoforward(angles), anglestoup(angles), 0.1); level notify("wallbuy_updated"); } } diff --git a/scripts/zm/zm_buried/zm_buried_reimagined.csc b/scripts/zm/zm_buried/zm_buried_reimagined.csc index 0897f474..6ddfa06c 100644 --- a/scripts/zm/zm_buried/zm_buried_reimagined.csc +++ b/scripts/zm/zm_buried/zm_buried_reimagined.csc @@ -14,6 +14,9 @@ init() prepare_chalk_weapon_list() { level.buildable_wallbuy_weapons = []; + level.buildable_wallbuy_weapon_models = []; + level.buildable_wallbuy_weapon_angles = []; + level.buildable_wallbuy_weapon_offsets = []; if (getdvar("ui_zm_mapstartlocation") == "maze") { @@ -43,8 +46,16 @@ prepare_chalk_weapon_list() level.buildable_wallbuy_weapons[5] = "870mcs_zm"; } - level.buildable_wallbuy_weapon_models = []; - level.buildable_wallbuy_weapon_angles = []; + level.buildable_wallbuy_weapon_offsets["vector_zm"] = (2, 0, 0); + level.buildable_wallbuy_weapon_offsets["an94_zm"] = (4, 0, 0); + level.buildable_wallbuy_weapon_offsets["pdw57_zm"] = (10, 0, 0); + level.buildable_wallbuy_weapon_offsets["svu_zm"] = (8, 0, 0); + level.buildable_wallbuy_weapon_offsets["tazer_knuckles_zm"] = (0, 0, 0); + level.buildable_wallbuy_weapon_offsets["870mcs_zm"] = (3, 0, 0); + level.buildable_wallbuy_weapon_offsets["saritch_zm"] = (3, 0, 0); + level.buildable_wallbuy_weapon_offsets["ballista_zm"] = (0, 0, 0); + level.buildable_wallbuy_weapon_offsets["beretta93r_zm"] = (8, 0, 0); + level.buildable_wallbuy_weapon_offsets["lsat_zm"] = (8, 0, 0); foreach (buildable_wallbuy_weapon in level.buildable_wallbuy_weapons) {