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
@ -145,7 +145,7 @@ init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
level.lowSpawn = lowSpawn;
|
level.lowSpawn = lowSpawn;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addCrateType( dropType, crateType, crateWeight, crateFunc )
|
addCrateType( dropType, crateType, crateWeight, crateFunc )
|
||||||
@ -214,27 +214,30 @@ drawLine( start, end, timeSlice )
|
|||||||
* Usage functions
|
* 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;
|
result = undefined;
|
||||||
|
|
||||||
if ( !isDefined( dropType ) )
|
if ( !isDefined( dropType ) )
|
||||||
dropType = "airdrop";
|
dropType = "airdrop";
|
||||||
|
|
||||||
|
if ( !isDefined( self.pers["kIDs_valid"][kID] ) )
|
||||||
|
return true;
|
||||||
|
|
||||||
if ( level.littleBirds >= 3 && dropType != "airdrop_mega" )
|
if ( level.littleBirds >= 3 && dropType != "airdrop_mega" )
|
||||||
{
|
{
|
||||||
@ -259,14 +262,14 @@ tryUseAirdrop( lifeId, dropType )
|
|||||||
self thread watchDisconnect();
|
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" );
|
self notify( "markerDetermined" );
|
||||||
|
|
||||||
if ( dropType != "airdrop_mega" )
|
if ( dropType != "airdrop_mega" )
|
||||||
level.littleBirds--;
|
decrementLittleBirdCount();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -283,7 +286,7 @@ watchDisconnect()
|
|||||||
self endon( "markerDetermined" );
|
self endon( "markerDetermined" );
|
||||||
|
|
||||||
self waittill( "disconnect" );
|
self waittill( "disconnect" );
|
||||||
level.littleBirds--;
|
decrementLittleBirdCount();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,13 +295,13 @@ watchDisconnect()
|
|||||||
* Marker functions
|
* Marker functions
|
||||||
***********************************************************/
|
***********************************************************/
|
||||||
|
|
||||||
beginAirdropViaMarker( lifeId, dropType )
|
beginAirdropViaMarker( lifeId, kID, dropType )
|
||||||
{
|
{
|
||||||
self endon ( "death" );
|
self endon ( "death" );
|
||||||
self endon ( "grenade_fire" );
|
self endon ( "grenade_fire" );
|
||||||
self.airDropMarker = undefined;
|
self.airDropMarker = undefined;
|
||||||
|
|
||||||
self thread watchAirDropMarkerUsage( dropType );
|
self thread watchAirDropMarkerUsage( dropType, kID );
|
||||||
|
|
||||||
while( self isChangingWeapon() )
|
while( self isChangingWeapon() )
|
||||||
wait ( 0.05 );
|
wait ( 0.05 );
|
||||||
@ -310,7 +313,7 @@ beginAirdropViaMarker( lifeId, dropType )
|
|||||||
else
|
else
|
||||||
airdropMarkerWeapon = undefined;
|
airdropMarkerWeapon = undefined;
|
||||||
|
|
||||||
while( isAirdropMarker( currentWeapon ) )
|
while( isAirdropMarker( currentWeapon ) /*|| currentWeapon == "none"*/ )
|
||||||
{
|
{
|
||||||
self waittill( "weapon_change", currentWeapon );
|
self waittill( "weapon_change", currentWeapon );
|
||||||
|
|
||||||
@ -327,7 +330,7 @@ beginAirdropViaMarker( lifeId, dropType )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
watchAirDropMarkerUsage( dropType )
|
watchAirDropMarkerUsage( dropType, kID )
|
||||||
{
|
{
|
||||||
self notify( "watchAirDropMarkerUsage" );
|
self notify( "watchAirDropMarkerUsage" );
|
||||||
|
|
||||||
@ -335,7 +338,7 @@ watchAirDropMarkerUsage( dropType )
|
|||||||
self endon( "watchAirDropMarkerUsage" );
|
self endon( "watchAirDropMarkerUsage" );
|
||||||
self endon( "stopWatchingAirDropMarker" );
|
self endon( "stopWatchingAirDropMarker" );
|
||||||
|
|
||||||
thread watchAirDropMarker( dropType );
|
thread watchAirDropMarker( dropType, kID );
|
||||||
|
|
||||||
for ( ;; )
|
for ( ;; )
|
||||||
{
|
{
|
||||||
@ -350,7 +353,7 @@ watchAirDropMarkerUsage( dropType )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
watchAirDropMarker( dropType )
|
watchAirDropMarker( dropType, kID )
|
||||||
{
|
{
|
||||||
self notify( "watchAirDropMarker" );
|
self notify( "watchAirDropMarker" );
|
||||||
|
|
||||||
@ -364,6 +367,14 @@ watchAirDropMarker( dropType )
|
|||||||
|
|
||||||
if ( !isAirdropMarker( weapname ) )
|
if ( !isAirdropMarker( weapname ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if ( !isDefined( self.pers["kIDs_valid"][kID] ) )
|
||||||
|
{
|
||||||
|
airDropWeapon delete();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.pers["kIDs_valid"][kID] = undefined;
|
||||||
|
|
||||||
airDropWeapon thread airdropDetonateOnStuck();
|
airDropWeapon thread airdropDetonateOnStuck();
|
||||||
|
|
||||||
@ -371,7 +382,7 @@ watchAirDropMarker( dropType )
|
|||||||
airDropWeapon.weaponName = weapname;
|
airDropWeapon.weaponName = weapname;
|
||||||
self.airDropMarker = airDropWeapon;
|
self.airDropMarker = airDropWeapon;
|
||||||
|
|
||||||
airDropWeapon thread airDropMarkerActivate( dropType );
|
airDropWeapon thread airDropMarkerActivate( dropType );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -822,7 +833,7 @@ doFlyBy( owner, dropSite, dropYaw, dropType, heightAdjustment )
|
|||||||
chopper waittill ( "goal" );
|
chopper waittill ( "goal" );
|
||||||
chopper notify( "leaving" );
|
chopper notify( "leaving" );
|
||||||
chopper trimActiveBirdList();
|
chopper trimActiveBirdList();
|
||||||
level.littleBirds--;
|
decrementLittleBirdCount();
|
||||||
chopper notify( "delete" );
|
chopper notify( "delete" );
|
||||||
chopper delete();
|
chopper delete();
|
||||||
}
|
}
|
||||||
@ -1094,7 +1105,7 @@ heliDestroyed()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
self trimActiveBirdList();
|
self trimActiveBirdList();
|
||||||
level.littleBirds--;
|
decrementLittleBirdCount();
|
||||||
self Vehicle_SetSpeed( 25, 5 );
|
self Vehicle_SetSpeed( 25, 5 );
|
||||||
self thread lbSpin( RandomIntRange(180, 220) );
|
self thread lbSpin( RandomIntRange(180, 220) );
|
||||||
|
|
||||||
@ -1551,3 +1562,11 @@ airdropDetonateOnStuck()
|
|||||||
|
|
||||||
self detonate();
|
self detonate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
decrementLittleBirdCount()
|
||||||
|
{
|
||||||
|
level.littleBirds--;
|
||||||
|
|
||||||
|
level.littleBirds = int( max( level.littleBirds, 0 ) );
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user