1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-08 14:22:10 -05:00

Buried: add offsets to buildable wallbuys

This commit is contained in:
Jbleezy 2024-01-11 03:07:45 -08:00
parent 3905637981
commit 3ccbbda064
3 changed files with 26 additions and 4 deletions

View File

@ -841,6 +841,7 @@
* Noose and Guillotine parts automatically picked up * Noose and Guillotine parts automatically picked up
* Moved MSMC wallbuy to its location on Borough * Moved MSMC wallbuy to its location on Borough
* Moved buildable wallbuy in Courthouse to AN-94 wallbuy 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 * Drawing weapons no longer gives points
* Arthur barricades are buyable debris * Arthur barricades are buyable debris
* Arthur can be purchased to feed him candy and make him run around and kill zombies for 30 seconds * Arthur can be purchased to feed him candy and make him run around and kill zombies for 30 seconds

View File

@ -136,6 +136,7 @@ wallbuy_callback_idx(localclientnum, oldval, newval, bnewent, binitialsnap, fiel
if (isdefined(level.buildable_wallbuy_weapon_models[weaponname])) if (isdefined(level.buildable_wallbuy_weapon_models[weaponname]))
model = level.buildable_wallbuy_weapon_models[weaponname]; model = level.buildable_wallbuy_weapon_models[weaponname];
origin = target_struct.origin;
angles = target_struct.angles; angles = target_struct.angles;
if (isdefined(level.buildable_wallbuy_weapon_angles[weaponname])) 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 hide();
target_model.parent_struct = target_struct; target_model.parent_struct = target_struct;
target_model.parent_struct.origin = origin;
target_model offset_model(weaponname); target_model offset_model(weaponname);
struct.models[localclientnum] = target_model; struct.models[localclientnum] = target_model;
@ -175,7 +185,7 @@ wallbuy_callback_idx(localclientnum, oldval, newval, bnewent, binitialsnap, fiel
if (isdefined(level._effect[weaponname + "_fx"])) if (isdefined(level._effect[weaponname + "_fx"]))
fx = 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"); level notify("wallbuy_updated");
} }
} }

View File

@ -14,6 +14,9 @@ init()
prepare_chalk_weapon_list() prepare_chalk_weapon_list()
{ {
level.buildable_wallbuy_weapons = []; 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") if (getdvar("ui_zm_mapstartlocation") == "maze")
{ {
@ -43,8 +46,16 @@ prepare_chalk_weapon_list()
level.buildable_wallbuy_weapons[5] = "870mcs_zm"; level.buildable_wallbuy_weapons[5] = "870mcs_zm";
} }
level.buildable_wallbuy_weapon_models = []; level.buildable_wallbuy_weapon_offsets["vector_zm"] = (2, 0, 0);
level.buildable_wallbuy_weapon_angles = []; 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) foreach (buildable_wallbuy_weapon in level.buildable_wallbuy_weapons)
{ {