1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-07 21:59:49 -05:00

Tranzit: optimize bus wallbuy code

This commit is contained in:
Jbleezy 2024-01-04 01:45:31 -08:00
parent 6d113e2e2a
commit cf854de4b8
4 changed files with 52 additions and 37 deletions

View File

@ -33244,14 +33244,31 @@
"guid" "9FD99599"
}
{
"model" "*223"
"origin" "-7692 6003 78"
"classname" "trigger_use"
"angles" "1.00179e-005 270 90"
"origin" "7693 5994.25 81"
"classname" "script_struct"
"zombie_weapon_upgrade" "beretta93r_zm"
"targetname" "weapon_upgrade"
"target" "pf1777_auto2196"
"script_string" "bus_buyable_weapon1"
"guid" "F0390DB3"
}
{
"targetname" "pf1777_auto2196"
"classname" "script_struct"
"model" "t6_wpn_pistol_b2023r_world"
"angles" "1.00179e-005 270 90"
"origin" "7693 5994.25 81"
"guid" "6D2A1B25"
}
{
"origin" "-7693 5994.25 81"
"angles" "1.00179e-005 270 90"
"model" "t6_wpn_pistol_b2023r_world"
"classname" "script_model"
"targetname" "pf1777_auto2197"
"script_noteworthy" "bus_buyable_weapon1"
"guid" "184F88F7"
"guid" "B3B9A025"
}
{
"model" "*224"
@ -33582,14 +33599,6 @@
"guid" "57775D5E"
}
{
"origin" "-7693 5994.25 80"
"angles" "1.00179e-005 270 90"
"model" "t6_wpn_pistol_b2023r_world"
"classname" "script_model"
"targetname" "pf1777_auto2196"
"guid" "B3B9A025"
}
{
"angles" "0 2.50448e-006 0"
"classname" "node_pathnode"
"origin" "-7714.5 5901.4 -46.5"

View File

@ -12,6 +12,12 @@ wallbuy_player_connect(localclientnum)
for (i = 0; i < keys.size; i++)
{
wallbuy = level._active_wallbuys[keys[i]];
if (isdefined(wallbuy.script_string) && wallbuy.script_string == "bus_buyable_weapon1")
{
continue;
}
fx = level._effect["m14_zm_fx"];
if (wallbuy.targetname == "buildable_wallbuy")

View File

@ -6,13 +6,6 @@
init_weapon_upgrade()
{
init_spawnable_weapon_upgrade();
weapon_spawns = [];
weapon_spawns = getentarray("weapon_upgrade", "targetname");
for (i = 0; i < weapon_spawns.size; i++)
{
scripts\zm\replaced\utility::wallbuy(weapon_spawns[i].zombie_weapon_upgrade, weapon_spawns[i].target + "_weapon_upgrade", weapon_spawns[i].targetname, weapon_spawns[i].origin, weapon_spawns[i].angles, 0);
}
}
init_spawnable_weapon_upgrade()

View File

@ -532,24 +532,18 @@ buspathblockersetup()
if (isdefined(cow_catcher_blocker))
cow_catcher_blocker linkto(self, "", self worldtolocalcoords(cow_catcher_blocker.origin), cow_catcher_blocker.angles + self.angles);
trig = getent("bus_buyable_weapon1", "script_noteworthy");
trig enablelinkto();
trig linkto(self, "", self worldtolocalcoords(trig.origin), (0, 0, 0));
trig setinvisibletoall();
self.buyable_weapon = trig;
level._spawned_wallbuys[level._spawned_wallbuys.size] = trig;
weapon_model = getent(trig.target, "targetname");
weapon_model.origin += (0, 0, 1);
weapon_model linkto(self, "", self worldtolocalcoords(weapon_model.origin), weapon_model.angles + self.angles);
weapon_model setmovingplatformenabled(1);
weapon_model._linked_ent = trig;
weapon_model hide();
self thread bus_buyable_weapon_unitrigger_setup(trig);
self thread bus_buyable_weapon_unitrigger_setup();
}
bus_buyable_weapon_unitrigger_setup(trig)
bus_buyable_weapon_unitrigger_setup()
{
weapon_model = getent("bus_buyable_weapon1", "script_noteworthy");
weapon_model enablelinkto();
weapon_model linkto(self, "", self worldtolocalcoords(weapon_model.origin), weapon_model.angles + self.angles);
weapon_model setmovingplatformenabled(1);
weapon_model._linked_ent = self;
weapon_model hide();
unitrigger = undefined;
while (!isDefined(unitrigger))
@ -566,11 +560,24 @@ bus_buyable_weapon_unitrigger_setup(trig)
wait 1;
}
unitrigger.target = trig.target;
unitrigger.origin_parent = trig;
unitrigger.link_parent = trig;
unitrigger.require_look_at = 0;
unitrigger.target = weapon_model;
unitrigger.origin_parent = weapon_model;
unitrigger.link_parent = self;
unitrigger.originfunc = ::bus_buyable_weapon_get_unitrigger_origin;
unitrigger.onspawnfunc = ::bus_buyable_weapon_on_spawn_trigger;
while (1)
{
level waittill("weapon_bought", player, weapon);
if (weapon == "beretta93r_zm")
{
break;
}
}
weapon_model show();
}
bus_buyable_weapon_get_unitrigger_origin()