mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-05-14 08:24:50 +00:00
patch_mp
This commit is contained in:
parent
56fc9148ac
commit
d0098e8b44
@ -214,28 +214,31 @@ drawLine( start, end, timeSlice )
|
||||
* Usage functions
|
||||
***********************************************************/
|
||||
|
||||
tryUseAirdropPredatorMissile( lifeId )
|
||||
tryUseAirdropPredatorMissile( lifeId, kID )
|
||||
{
|
||||
return ( self tryUseAirdrop( lifeId , "airdrop_predator_missile" ) );
|
||||
return ( self tryUseAirdrop( lifeId, kID, "airdrop_predator_missile" ) );
|
||||
}
|
||||
|
||||
tryUseAirdropSentryMinigun( lifeId )
|
||||
tryUseAirdropSentryMinigun( lifeId, kID )
|
||||
{
|
||||
return ( self tryUseAirdrop( lifeId, "airdrop_sentry_minigun" ) );
|
||||
return ( self tryUseAirdrop( lifeId, kID, "airdrop_sentry_minigun" ) );
|
||||
}
|
||||
|
||||
tryUseMegaAirdrop( lifeId )
|
||||
tryUseMegaAirdrop( lifeId, kID )
|
||||
{
|
||||
return ( self tryUseAirdrop( lifeId, "airdrop_mega" ) );
|
||||
return ( self tryUseAirdrop( lifeId, kID, "airdrop_mega" ) );
|
||||
}
|
||||
|
||||
tryUseAirdrop( lifeId, dropType )
|
||||
tryUseAirdrop( lifeId, kID, dropType )
|
||||
{
|
||||
result = undefined;
|
||||
|
||||
if ( !isDefined( dropType ) )
|
||||
dropType = "airdrop";
|
||||
|
||||
if ( !isDefined( self.pers["kIDs_valid"][kID] ) )
|
||||
return true;
|
||||
|
||||
if ( level.littleBirds >= 3 && dropType != "airdrop_mega" )
|
||||
{
|
||||
self iPrintLnBold( &"MP_AIR_SPACE_TOO_CROWDED" );
|
||||
@ -259,14 +262,14 @@ tryUseAirdrop( lifeId, dropType )
|
||||
self thread watchDisconnect();
|
||||
}
|
||||
|
||||
result = self beginAirdropViaMarker( lifeId, dropType );
|
||||
result = self beginAirdropViaMarker( lifeId, kID, dropType );
|
||||
|
||||
if ( (!isDefined( result ) || !result) && !isDefined( self.airDropMarker ) )
|
||||
if ( (!isDefined( result ) || !result) && isDefined( self.pers["kIDs_valid"][kID] ) )
|
||||
{
|
||||
self notify( "markerDetermined" );
|
||||
|
||||
if ( dropType != "airdrop_mega" )
|
||||
level.littleBirds--;
|
||||
decrementLittleBirdCount();
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -283,7 +286,7 @@ watchDisconnect()
|
||||
self endon( "markerDetermined" );
|
||||
|
||||
self waittill( "disconnect" );
|
||||
level.littleBirds--;
|
||||
decrementLittleBirdCount();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -292,13 +295,13 @@ watchDisconnect()
|
||||
* Marker functions
|
||||
***********************************************************/
|
||||
|
||||
beginAirdropViaMarker( lifeId, dropType )
|
||||
beginAirdropViaMarker( lifeId, kID, dropType )
|
||||
{
|
||||
self endon ( "death" );
|
||||
self endon ( "grenade_fire" );
|
||||
self.airDropMarker = undefined;
|
||||
|
||||
self thread watchAirDropMarkerUsage( dropType );
|
||||
self thread watchAirDropMarkerUsage( dropType, kID );
|
||||
|
||||
while( self isChangingWeapon() )
|
||||
wait ( 0.05 );
|
||||
@ -310,7 +313,7 @@ beginAirdropViaMarker( lifeId, dropType )
|
||||
else
|
||||
airdropMarkerWeapon = undefined;
|
||||
|
||||
while( isAirdropMarker( currentWeapon ) )
|
||||
while( isAirdropMarker( currentWeapon ) /*|| currentWeapon == "none"*/ )
|
||||
{
|
||||
self waittill( "weapon_change", currentWeapon );
|
||||
|
||||
@ -327,7 +330,7 @@ beginAirdropViaMarker( lifeId, dropType )
|
||||
}
|
||||
|
||||
|
||||
watchAirDropMarkerUsage( dropType )
|
||||
watchAirDropMarkerUsage( dropType, kID )
|
||||
{
|
||||
self notify( "watchAirDropMarkerUsage" );
|
||||
|
||||
@ -335,7 +338,7 @@ watchAirDropMarkerUsage( dropType )
|
||||
self endon( "watchAirDropMarkerUsage" );
|
||||
self endon( "stopWatchingAirDropMarker" );
|
||||
|
||||
thread watchAirDropMarker( dropType );
|
||||
thread watchAirDropMarker( dropType, kID );
|
||||
|
||||
for ( ;; )
|
||||
{
|
||||
@ -350,7 +353,7 @@ watchAirDropMarkerUsage( dropType )
|
||||
}
|
||||
}
|
||||
|
||||
watchAirDropMarker( dropType )
|
||||
watchAirDropMarker( dropType, kID )
|
||||
{
|
||||
self notify( "watchAirDropMarker" );
|
||||
|
||||
@ -365,6 +368,14 @@ watchAirDropMarker( dropType )
|
||||
if ( !isAirdropMarker( weapname ) )
|
||||
continue;
|
||||
|
||||
if ( !isDefined( self.pers["kIDs_valid"][kID] ) )
|
||||
{
|
||||
airDropWeapon delete();
|
||||
continue;
|
||||
}
|
||||
|
||||
self.pers["kIDs_valid"][kID] = undefined;
|
||||
|
||||
airDropWeapon thread airdropDetonateOnStuck();
|
||||
|
||||
airDropWeapon.owner = self;
|
||||
@ -822,7 +833,7 @@ doFlyBy( owner, dropSite, dropYaw, dropType, heightAdjustment )
|
||||
chopper waittill ( "goal" );
|
||||
chopper notify( "leaving" );
|
||||
chopper trimActiveBirdList();
|
||||
level.littleBirds--;
|
||||
decrementLittleBirdCount();
|
||||
chopper notify( "delete" );
|
||||
chopper delete();
|
||||
}
|
||||
@ -1094,7 +1105,7 @@ heliDestroyed()
|
||||
return;
|
||||
|
||||
self trimActiveBirdList();
|
||||
level.littleBirds--;
|
||||
decrementLittleBirdCount();
|
||||
self Vehicle_SetSpeed( 25, 5 );
|
||||
self thread lbSpin( RandomIntRange(180, 220) );
|
||||
|
||||
@ -1551,3 +1562,11 @@ airdropDetonateOnStuck()
|
||||
|
||||
self detonate();
|
||||
}
|
||||
|
||||
|
||||
decrementLittleBirdCount()
|
||||
{
|
||||
level.littleBirds--;
|
||||
|
||||
level.littleBirds = int( max( level.littleBirds, 0 ) );
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user