1
0
mirror of https://github.com/JezuzLizard/BO2-Reimagined.git synced 2025-06-10 15:17:57 -05:00

Tranzit: attach powerups to bus

This commit is contained in:
Jbleezy
2023-03-27 14:48:28 -07:00
parent f349712d6f
commit b1383377e5
2 changed files with 39 additions and 0 deletions

View File

@ -424,6 +424,7 @@
### Tranzit
* Any door that requires a Turbine to open is automatically open whenever the power is on
* Increased bus speed by 100%
* Powerups dropped within the bus are linked to the bus
* Players can sprint and go prone on the bus
* Lava in starting area activates after the power is on
* Lava destroys grenades instantly

View File

@ -67,6 +67,7 @@ init()
level thread power_local_electric_doors_globally();
level thread b23r_hint_string_fix();
level thread power_station_vision_change();
level thread attach_powerups_to_bus();
}
grief_include_weapons()
@ -390,6 +391,43 @@ change_dvar_over_time(dvar, val, time, increment)
self setClientDvar(dvar, val);
}
attach_powerups_to_bus()
{
if (!isDefined(level.the_bus))
{
return;
}
while (1)
{
level waittill("powerup_dropped", powerup);
attachpoweruptobus(powerup);
}
}
attachpoweruptobus( powerup )
{
if ( !isdefined( powerup ) || !isdefined( level.the_bus ) )
return;
distanceoutsideofbus = 50.0;
pos = powerup.origin;
posinbus = pointonsegmentnearesttopoint( level.the_bus.frontworld, level.the_bus.backworld, pos );
posdist2 = distance2dsquared( pos, posinbus );
if ( posdist2 > level.the_bus.radius * level.the_bus.radius )
{
radiusplus = level.the_bus.radius + distanceoutsideofbus;
if ( posdist2 > radiusplus * radiusplus )
return;
}
powerup enablelinkto();
powerup linkto( level.the_bus );
}
manage_zones( initial_zone )
{
level.zone_manager_init_func = ::transit_zone_init;