- New Feature: The rosine system now allows to capture enemy soldeirs via using handcuffs on them. They can e transferred to a prison the player controls, and be interrogated there.

- GameDir revision 1568 is required for this feature.
- Savegame compatibility is maintained.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5709 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2012-12-03 00:50:48 +00:00
parent 33f3fefc3b
commit cb9c217bb1
46 changed files with 1472 additions and 57 deletions
+45
View File
@@ -2971,3 +2971,48 @@ INT32 CalcStraightThreatValue( SOLDIERTYPE *pEnemy )
return(iThreatValue);
}
// Flugente: get the id of the closest soldier with a specific flag that we can currently see
UINT8 GetClosestFlaggedSoldierID( SOLDIERTYPE * pSoldier, INT16 aRange, UINT8 auTeam, UINT32 aFlag )
{
UINT8 id = NOBODY;
UINT32 uiLoop;
BOOLEAN fRangeRestricted = FALSE, fFound = FALSE;
SOLDIERTYPE * pFriend;
INT16 range = aRange;
// go through each soldier, looking for "friends" (soldiers on same side)
for (uiLoop = 0; uiLoop < guiNumMercSlots; ++uiLoop)
{
pFriend = MercSlots[ uiLoop ];
// if this merc is inactive, not in sector, or dead
if (!pFriend)
continue;
if ( auTeam != pFriend->bTeam )
continue;
// check for flag
if ( !(pFriend->bSoldierFlagMask & aFlag) )
continue;
// skip ourselves
if (pFriend->ubID == pSoldier->ubID)
continue;
// if we're not already neighbors
if (SpacesAway(pSoldier->sGridNo, pFriend->sGridNo) < range)
{
// can we see this guy?
if ( SoldierTo3DLocationLineOfSightTest( pSoldier, pFriend->sGridNo, pSoldier->pathing.bLevel, 3, TRUE, CALC_FROM_WANTED_DIR ) )
{
range = SpacesAway(pSoldier->sGridNo,pFriend->sGridNo);
id = pFriend->ubID;
}
}
}
return id;
}