mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
-minor fix: PickARandomLaunchable now looks at the HighestPlayerProgress percentage, so early enemy GLs won't use thermobarics
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@482 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+21
-4
@@ -7342,6 +7342,23 @@ INT8 FindRemoteControl( SOLDIERTYPE * pSoldier )
|
|||||||
return( NO_SLOT );
|
return( NO_SLOT );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UINT16 LowestLaunchableCoolness(UINT16 launcherIndex)
|
||||||
|
{
|
||||||
|
UINT16 i = 0;
|
||||||
|
UINT16 lowestCoolness = 999;
|
||||||
|
|
||||||
|
for( i = 0; i < MAXITEMS; i++ )
|
||||||
|
{
|
||||||
|
if ( Item[i].usItemClass == 0 )
|
||||||
|
break;
|
||||||
|
|
||||||
|
if( ValidLaunchable( i, launcherIndex ) && Item[i].ubCoolness <= lowestCoolness )
|
||||||
|
{
|
||||||
|
lowestCoolness = Item[i].ubCoolness;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return lowestCoolness;
|
||||||
|
}
|
||||||
|
|
||||||
UINT16 PickARandomLaunchable(UINT16 itemIndex)
|
UINT16 PickARandomLaunchable(UINT16 itemIndex)
|
||||||
{
|
{
|
||||||
@@ -7349,7 +7366,7 @@ UINT16 PickARandomLaunchable(UINT16 itemIndex)
|
|||||||
UINT16 usNumMatches = 0;
|
UINT16 usNumMatches = 0;
|
||||||
UINT16 usRandom = 0;
|
UINT16 usRandom = 0;
|
||||||
UINT16 i = 0;
|
UINT16 i = 0;
|
||||||
|
UINT16 lowestCoolness = LowestLaunchableCoolness(itemIndex);
|
||||||
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("PickARandomLaunchable: itemIndex = %d", itemIndex));
|
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("PickARandomLaunchable: itemIndex = %d", itemIndex));
|
||||||
|
|
||||||
while( !usNumMatches )
|
while( !usNumMatches )
|
||||||
@@ -7358,8 +7375,8 @@ UINT16 PickARandomLaunchable(UINT16 itemIndex)
|
|||||||
{
|
{
|
||||||
if ( Item[i].usItemClass == 0 )
|
if ( Item[i].usItemClass == 0 )
|
||||||
break;
|
break;
|
||||||
|
//Madd: quickfix: make it not choose best grenades right away.
|
||||||
if( ValidLaunchable( i, itemIndex ) )
|
if( ValidLaunchable( i, itemIndex ) && Item[i].ubCoolness <= max(HighestPlayerProgressPercentage()/10,lowestCoolness) )
|
||||||
usNumMatches++;
|
usNumMatches++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7371,7 +7388,7 @@ UINT16 PickARandomLaunchable(UINT16 itemIndex)
|
|||||||
if ( Item[i].usItemClass == 0 )
|
if ( Item[i].usItemClass == 0 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if( ValidLaunchable( i, itemIndex ) )
|
if( ValidLaunchable( i, itemIndex ) && Item[i].ubCoolness <= max(HighestPlayerProgressPercentage()/10,lowestCoolness) )
|
||||||
{
|
{
|
||||||
if( usRandom )
|
if( usRandom )
|
||||||
usRandom--;
|
usRandom--;
|
||||||
|
|||||||
Reference in New Issue
Block a user