mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-07 21:59:49 -05:00
Remove old wallbuy code
This commit is contained in:
parent
82ed12fc19
commit
23443988e7
@ -197,170 +197,6 @@ register_map_spawn(origin, angles, zone, team_num)
|
||||
add_struct(spawn_struct);
|
||||
}
|
||||
|
||||
wallbuy(weapon_name, target, targetname, origin, angles, play_chalk_fx = 1)
|
||||
{
|
||||
unitrigger_stub = spawnstruct();
|
||||
unitrigger_stub.origin = origin;
|
||||
unitrigger_stub.angles = angles;
|
||||
|
||||
model_name = undefined;
|
||||
|
||||
if (weapon_name == "sticky_grenade_zm")
|
||||
{
|
||||
model_name = "semtex_bag";
|
||||
}
|
||||
else if (weapon_name == "claymore_zm")
|
||||
{
|
||||
model_name = "t6_wpn_claymore_world";
|
||||
}
|
||||
|
||||
wallmodel = spawn_weapon_model(weapon_name, model_name, origin, angles);
|
||||
wallmodel.targetname = target;
|
||||
wallmodel useweaponhidetags(weapon_name);
|
||||
wallmodel hide();
|
||||
|
||||
absmins = wallmodel getabsmins();
|
||||
absmaxs = wallmodel getabsmaxs();
|
||||
bounds = absmaxs - absmins;
|
||||
|
||||
unitrigger_stub.script_length = 64;
|
||||
unitrigger_stub.script_width = bounds[1];
|
||||
unitrigger_stub.script_height = bounds[2];
|
||||
unitrigger_stub.target = target;
|
||||
unitrigger_stub.targetname = targetname;
|
||||
unitrigger_stub.cursor_hint = "HINT_NOICON";
|
||||
|
||||
// move model forward so it always shows in front of chalk
|
||||
wallmodel.origin += anglesToRight(wallmodel.angles) * -0.3;
|
||||
unitrigger_stub.origin += anglesToRight(wallmodel.angles) * -0.3;
|
||||
|
||||
if (unitrigger_stub.targetname == "weapon_upgrade")
|
||||
{
|
||||
unitrigger_stub.cost = get_weapon_cost(weapon_name);
|
||||
|
||||
if (!is_true(level.monolingustic_prompt_format))
|
||||
{
|
||||
unitrigger_stub.hint_string = get_weapon_hint(weapon_name);
|
||||
unitrigger_stub.hint_parm1 = unitrigger_stub.cost;
|
||||
}
|
||||
else
|
||||
{
|
||||
unitrigger_stub.hint_parm1 = get_weapon_display_name(weapon_name);
|
||||
|
||||
if (!isDefined(unitrigger_stub.hint_parm1) || unitrigger_stub.hint_parm1 == "" || unitrigger_stub.hint_parm1 == "none")
|
||||
{
|
||||
unitrigger_stub.hint_parm1 = "missing weapon name " + weapon_name;
|
||||
}
|
||||
|
||||
unitrigger_stub.hint_parm2 = unitrigger_stub.cost;
|
||||
unitrigger_stub.hint_string = &"ZOMBIE_WEAPONCOSTONLY";
|
||||
}
|
||||
}
|
||||
|
||||
unitrigger_stub.weapon_upgrade = weapon_name;
|
||||
unitrigger_stub.script_unitrigger_type = "unitrigger_box_use";
|
||||
unitrigger_stub.require_look_at = 1;
|
||||
unitrigger_stub.require_look_from = 0;
|
||||
unitrigger_stub.zombie_weapon_upgrade = weapon_name;
|
||||
maps\mp\zombies\_zm_unitrigger::unitrigger_force_per_player_triggers(unitrigger_stub, 1);
|
||||
|
||||
if (is_melee_weapon(weapon_name))
|
||||
{
|
||||
melee_weapon = undefined;
|
||||
|
||||
foreach (melee_weapon in level._melee_weapons)
|
||||
{
|
||||
if (melee_weapon.weapon_name == weapon_name)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isDefined(melee_weapon))
|
||||
{
|
||||
unitrigger_stub.cost = melee_weapon.cost;
|
||||
unitrigger_stub.hint_string = melee_weapon.hint_string;
|
||||
unitrigger_stub.weapon_name = melee_weapon.weapon_name;
|
||||
unitrigger_stub.flourish_weapon_name = melee_weapon.flourish_weapon_name;
|
||||
unitrigger_stub.ballistic_weapon_name = melee_weapon.ballistic_weapon_name;
|
||||
unitrigger_stub.ballistic_upgraded_weapon_name = melee_weapon.ballistic_upgraded_weapon_name;
|
||||
unitrigger_stub.vo_dialog_id = melee_weapon.vo_dialog_id;
|
||||
unitrigger_stub.flourish_fn = melee_weapon.flourish_fn;
|
||||
|
||||
unitrigger_stub.cursor_hint = "HINT_WEAPON";
|
||||
unitrigger_stub.cursor_hint_weapon = melee_weapon.weapon_name;
|
||||
}
|
||||
|
||||
if (weapon_name == "tazer_knuckles_zm")
|
||||
{
|
||||
unitrigger_stub.origin += (anglesToForward(angles) * -7) + (anglesToRight(angles) * -2);
|
||||
}
|
||||
|
||||
wallmodel.origin += anglesToForward(angles) * -8; // _zm_melee_weapon::melee_weapon_show moves this back
|
||||
|
||||
maps\mp\zombies\_zm_unitrigger::register_static_unitrigger(unitrigger_stub, ::melee_weapon_think);
|
||||
}
|
||||
else if (weapon_name == "claymore_zm")
|
||||
{
|
||||
wallmodel.angles += (0, 90, 0);
|
||||
wallmodel.script_int = 90; // fix for model sliding right to left
|
||||
|
||||
unitrigger_stub.prompt_and_visibility_func = scripts\zm\replaced\_zm_weap_claymore::claymore_unitrigger_update_prompt;
|
||||
maps\mp\zombies\_zm_unitrigger::register_static_unitrigger(unitrigger_stub, scripts\zm\replaced\_zm_weap_claymore::buy_claymores);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (is_lethal_grenade(unitrigger_stub.zombie_weapon_upgrade))
|
||||
unitrigger_stub.prompt_and_visibility_func = scripts\zm\replaced\_zm_weapons::lethal_grenade_update_prompt;
|
||||
else
|
||||
unitrigger_stub.prompt_and_visibility_func = ::wall_weapon_update_prompt;
|
||||
|
||||
maps\mp\zombies\_zm_unitrigger::register_static_unitrigger(unitrigger_stub, scripts\zm\replaced\_zm_weapons::weapon_spawn_think);
|
||||
}
|
||||
|
||||
if (weaponType(weapon_name) == "grenade")
|
||||
{
|
||||
unitrigger_stub thread wallbuy_grenade_model_fix();
|
||||
}
|
||||
|
||||
if (play_chalk_fx)
|
||||
{
|
||||
chalk_fx = get_chalk_fx_name(weapon_name);
|
||||
level thread play_chalk_fx(chalk_fx, origin, angles);
|
||||
}
|
||||
}
|
||||
|
||||
get_chalk_fx_name(weapon_name)
|
||||
{
|
||||
return weapon_name + "_fx";
|
||||
}
|
||||
|
||||
play_chalk_fx(effect, origin, angles)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
fx = SpawnFX(level._effect[effect], origin, AnglesToForward(angles), AnglesToUp(angles));
|
||||
TriggerFX(fx);
|
||||
level waittill("connected", player);
|
||||
fx Delete();
|
||||
}
|
||||
}
|
||||
|
||||
// fixes grenade wallbuy model doing first trigger animation everytime
|
||||
wallbuy_grenade_model_fix()
|
||||
{
|
||||
model = getent(self.target, "targetname");
|
||||
|
||||
if (!isDefined(model))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
model waittill("movedone");
|
||||
|
||||
self.target = undefined;
|
||||
}
|
||||
|
||||
barrier(model, origin, angles, not_solid)
|
||||
{
|
||||
if (!isDefined(level.survival_barriers))
|
||||
|
Loading…
x
Reference in New Issue
Block a user