FindNearestUngassedLand, FindNearbyDarkerSpot:

- optimization: don't check spots already checked in previous loop
- increase max distance to 35, reduce to 25 if complex AI not allowed, reduce to 15 in realtime
CanDragPerson: use world movement cost instead of LOS check.
Say TAUNT_RELOAD, TAUNT_OUT_OF_AMMO taunts if mag size > 4 or Chance (CHANCE_SAY_ANNOYING_PHRASE).
SpotDangerLevel: also check Water and CorpseWarning for danger level = 1.
ManSeesMan: only call SetNewSituation if location or level are different to reduce frequency of AI re-evaluation.
Only allow radio animation on initial red alert, if sector is not jammed.
Press ESC to stop dragging.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8904 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2020-10-17 06:30:23 +00:00
parent 43ab995ecd
commit b45af3f575
9 changed files with 72 additions and 23 deletions
+7 -5
View File
@@ -11837,7 +11837,7 @@ void SOLDIERTYPE::MoveMerc( FLOAT dMovementChange, FLOAT dAngle, BOOLEAN fCheckR
if ( BuildStructDrag( sOldGridNo, gsInterfaceLevel, arusTileType, arusStructureNumber, this->ubID ) )
{
// remove
RemoveStructDrag( this->sDragGridNo, gsInterfaceLevel, arusTileType );
RemoveStructDrag( this->sDragGridNo, (INT8)gsInterfaceLevel, arusTileType );
// also move doors, this includes moving locks and traps
DOOR* pDoor = FindDoorInfoAtGridNo( this->sDragGridNo );
@@ -16095,14 +16095,14 @@ BOOLEAN SOLDIERTYPE::SeemsLegit( UINT8 ubObserverID )
}
}
// if we are trying to dress like a civilian, but aren't sucessful: not covert
// if we are trying to dress like a civilian, but aren't successful: not covert
if ( this->usSoldierFlagMask & SOLDIER_COVERT_CIV && !(this->LooksLikeACivilian( )) )
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_NO_CIV], this->GetName( ) );
return FALSE;
}
// if we are trying to dress like a soldier, but aren't sucessful: not covert
// if we are trying to dress like a soldier, but aren't successful: not covert
if ( this->usSoldierFlagMask & SOLDIER_COVERT_SOLDIER && !(this->LooksLikeASoldier( )) )
{
return FALSE;
@@ -20556,7 +20556,8 @@ BOOLEAN SOLDIERTYPE::CanDragPerson( UINT16 usID )
return FALSE;
// we must be able to see the other guy even if if both would be prone. This is to stop the player from dragging someone through solid structures
if ( !LocationToLocationLineOfSightTest(pSoldier->sGridNo, pSoldier->pathing.bLevel, this->sGridNo, this->pathing.bLevel, TRUE, CALC_FROM_ALL_DIRS, PRONE_LOS_POS, PRONE_LOS_POS))
//if ( !LocationToLocationLineOfSightTest(pSoldier->sGridNo, pSoldier->pathing.bLevel, this->sGridNo, this->pathing.bLevel, TRUE, CALC_FROM_ALL_DIRS, PRONE_LOS_POS, PRONE_LOS_POS))
if (gubWorldMovementCosts[pSoldier->sGridNo][AIDirection(this->sGridNo, pSoldier->sGridNo)][this->pathing.bLevel] >= TRAVELCOST_BLOCKED)
return FALSE;
return TRUE;
@@ -20587,7 +20588,8 @@ BOOLEAN SOLDIERTYPE::CanDragCorpse( UINT16 usCorpseNum )
return FALSE;
// we must be able to see the other guy even if if both would be prone. This is to stop the player from dragging someone through solid structures
if (!LocationToLocationLineOfSightTest(pCorpse->def.sGridNo, this->pathing.bLevel, this->sGridNo, this->pathing.bLevel, TRUE, CALC_FROM_ALL_DIRS, PRONE_LOS_POS, PRONE_LOS_POS))
//if (!LocationToLocationLineOfSightTest(pCorpse->def.sGridNo, this->pathing.bLevel, this->sGridNo, this->pathing.bLevel, TRUE, CALC_FROM_ALL_DIRS, PRONE_LOS_POS, PRONE_LOS_POS))
if (this->sGridNo != pCorpse->def.sGridNo && gubWorldMovementCosts[pCorpse->def.sGridNo][AIDirection(this->sGridNo, pCorpse->def.sGridNo)][this->pathing.bLevel] >= TRAVELCOST_BLOCKED)
return FALSE;
return TRUE;