mirror of
https://github.com/JezuzLizard/Recompilable-gscs-for-BO2-zombies-and-multiplayer.git
synced 2025-07-05 06:57:51 -05:00
Added all the remaining scripts not previously included.
This commit is contained in:
87
zm_transit_dr_patch/maps/mp/_bb.gsc
Normal file
87
zm_transit_dr_patch/maps/mp/_bb.gsc
Normal file
@ -0,0 +1,87 @@
|
||||
#include common_scripts/utility;
|
||||
#include maps/mp/_utility;
|
||||
|
||||
init()
|
||||
{
|
||||
level thread onplayerconnect();
|
||||
}
|
||||
|
||||
onplayerconnect()
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
level waittill( "connected", player );
|
||||
player thread onplayerspawned();
|
||||
player thread onplayerdeath();
|
||||
}
|
||||
}
|
||||
|
||||
onplayerspawned()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
self._bbdata = [];
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill( "spawned_player" );
|
||||
self._bbdata[ "score" ] = 0;
|
||||
self._bbdata[ "momentum" ] = 0;
|
||||
self._bbdata[ "spawntime" ] = getTime();
|
||||
self._bbdata[ "shots" ] = 0;
|
||||
self._bbdata[ "hits" ] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
onplayerdisconnect()
|
||||
{
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill( "disconnect" );
|
||||
self commitspawndata();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
onplayerdeath()
|
||||
{
|
||||
self endon( "disconnect" );
|
||||
for ( ;; )
|
||||
{
|
||||
self waittill( "death" );
|
||||
self commitspawndata();
|
||||
}
|
||||
}
|
||||
|
||||
commitspawndata()
|
||||
{
|
||||
/#
|
||||
assert( isDefined( self._bbdata ) );
|
||||
#/
|
||||
if ( !isDefined( self._bbdata ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
bbprint( "mpplayerlives", "gametime %d spawnid %d lifescore %d lifemomentum %d lifetime %d name %s", getTime(), getplayerspawnid( self ), self._bbdata[ "score" ], self._bbdata[ "momentum" ], getTime() - self._bbdata[ "spawntime" ], self.name );
|
||||
}
|
||||
|
||||
commitweapondata( spawnid, currentweapon, time0 )
|
||||
{
|
||||
/#
|
||||
assert( isDefined( self._bbdata ) );
|
||||
#/
|
||||
if ( !isDefined( self._bbdata ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
time1 = getTime();
|
||||
bbprint( "mpweapons", "spawnid %d name %s duration %d shots %d hits %d", spawnid, currentweapon, time1 - time0, self._bbdata[ "shots" ], self._bbdata[ "hits" ] );
|
||||
self._bbdata[ "shots" ] = 0;
|
||||
self._bbdata[ "hits" ] = 0;
|
||||
}
|
||||
|
||||
bbaddtostat( statname, delta )
|
||||
{
|
||||
if ( isDefined( self._bbdata ) && isDefined( self._bbdata[ statname ] ) )
|
||||
{
|
||||
self._bbdata[ statname ] += delta;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user