iw5: test guns (#4)
All checks were successful
Build / build-linux (push) Successful in 7s

This commit was merged in pull request #4.
This commit is contained in:
2024-05-31 09:59:13 +00:00
parent 6493347cd1
commit a6adab0035
5 changed files with 69 additions and 8 deletions

View File

@@ -19,6 +19,7 @@ _ON_PLAYER_CNCT_BEGIN
PLAYER_NOTIFY_CMD( player, "save_pos", "+reload" );
PLAYER_NOTIFY_CMD( player, "load_saved_pos", "+activate" );
player thread onWeaponFired();
player thread jumper();
player thread displaySpeed();
@@ -26,6 +27,21 @@ _ON_PLAYER_CNCT_BEGIN
_ON_PLAYER_CNCT_END
onWeaponFired()
{
GENERIC_COROUTINE_END
while ( true )
{
self waittill( "weapon_fired", weapon );
if (weapon == "rpg_mp")
{
self.last_rpg_shot = getTime();
}
}
}
displaySpeed()
{
GENERIC_COROUTINE_END;
@@ -36,12 +52,30 @@ displaySpeed()
self.speed_text.label = &"";
self.last_speed_sample = 0;
self.last_z_coordinate = 0.0;
while ( true )
{
player_speed = distance( ZERO_VEC3, self getvelocity() );
current_speed = int( player_speed );
if ( self.origin[2] > self.last_z_coordinate )
{
// We should be going up
if ( isDefined( self.last_rpg_shot ) && self.last_rpg_shot != 0 )
{
late = getTime() - self.last_rpg_shot;
if (late <= 500)
{
iPrintLn( "Late RPG (+" + (late) + ")" );
}
self.last_rpg_shot = 0;
}
}
self.last_z_coordinate = self.origin[2];
if ( self.last_speed_sample == current_speed )
{
// White
@@ -115,4 +149,17 @@ _ON_PLAYER_SPAWNED_BEGIN
self setPerk( "specialty_marathon", true, false );
self freezeControls( false );
self takeAllWeapons();
self giveWeapon( "iw5_usp45_mp" );
self giveMaxAmmo( "iw5_usp45_mp" );
self giveWeapon( "rpg_mp" );
self giveMaxAmmo( "rpg_mp" );
wait 1;
self switchToWeaponImmediate( "iw5_usp45_mp" );
_ON_PLAYER_SPAWNED_END