Merged revision(s) 7024 from branches/ja2_source_official_2014:

- If a merc repairs up to a threshold below 100, display a slightly different message
- Due to radio operator jamming, AI red alert can fail (intentional part of the trait). In that case, forbid the soldier from using radio again this turn, as this would be a fruitless waste of APs.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7025 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2014-03-04 22:20:32 +00:00
parent f03bc8ef23
commit 12d45fcfa2
15 changed files with 62 additions and 17 deletions
+14 -2
View File
@@ -4531,7 +4531,6 @@ BOOLEAN RepairObject( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOwner, OBJECTTYPE *
UINT8 ubLoop, ubItemsInPocket, lbeLoop, ubBeforeRepair; // added by SANDRO
BOOLEAN fSomethingWasRepaired = FALSE;
ubItemsInPocket = pObj->ubNumberOfObjects;
for ( ubLoop = 0; ubLoop < ubItemsInPocket; ubLoop++ )
@@ -4595,12 +4594,25 @@ BOOLEAN RepairObject( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOwner, OBJECTTYPE *
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, gzLateLocalizedString[ 35 ], pSoldier->GetName(), pOwner->GetName(), ItemNames[ pObj->usItem ] );
}
}
// Flugente: if we repaired as much as possible, but the threshold is below 100, display a slightly different message
else if ( (*pObj)[ubLoop]->data.objectStatus == threshold )
{
// report it as fixed
if ( pSoldier == pOwner )
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, Message[ STR_REPAIRED_PARTIAL ], pSoldier->GetName(), ItemNames[ pObj->usItem ] );
}
else
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, Message[ STR_REPAIRED_PARTIAL_FOR_OWNER ], pSoldier->GetName(), pOwner->GetName(), ItemNames[ pObj->usItem ] );
}
}
if ( *pubRepairPtsLeft == 0 )
{
// we're out of points!
return true;
}
}
// now check for attachments after
+2 -2
View File
@@ -17068,8 +17068,8 @@ INT16 SOLDIERTYPE::GetInterruptModifier( UINT8 usDistance )
void SOLDIERTYPE::SoldierPropertyUpkeep()
{
// these flags are only used for the first turn, and thus always removed
this->bSoldierFlagMask &= ~(SOLDIER_AIRDROP_TURN|SOLDIER_ASSAULT_BONUS);
// these effects last only one turn
this->bSoldierFlagMask &= ~(SOLDIER_AIRDROP_TURN|SOLDIER_ASSAULT_BONUS|SOLDIER_RAISED_REDALERT);
if ( HasBackgroundFlag( BACKGROUND_EXP_UNDERGROUND ) && this->bSectorZ )
++bExtraExpLevel;
+3 -3
View File
@@ -379,12 +379,12 @@ enum
#define SOLDIER_RADIO_OPERATOR_JAMMING 0x00100000 //1048576 // radio operator is jamming frequencies
#define SOLDIER_RADIO_OPERATOR_SCANNING 0x00200000 //2097152 // radio operator is scanning for jammers
#define SOLDIER_AIRDROP 0x00400000 //4194304 // soldier is entering the sector via airdrop from a helicopter. Sligthly different from SOLDIER_AIRDROP_TURN
#define SOLDIER_AIRDROP 0x00400000 //4194304 // soldier is entering the sector via airdrop from a helicopter. Slightly different from SOLDIER_AIRDROP_TURN
#define SOLDIER_FRESHWOUND 0x00800000 //8388608 // campaign stats: soldier was wounded in this battle
#define SOLDIER_BATTLE_PARTICIPATION 0x01000000 //16777216 // campaign stats: soldier took part in this battle
/*#define PLAYER_NET_2_LVL_3 0x02000000 //33554432
#define PLAYER_NET_3_LVL_3 0x04000000 //67108864
#define SOLDIER_RAISED_REDALERT 0x02000000 //33554432 // this (AI) soldier has raised red alert. Don't allow him to do so again this turn - either it already worked, or the signal is blocked
/*#define PLAYER_NET_3_LVL_3 0x04000000 //67108864
#define PLAYER_NET_4_LVL_3 0x08000000 //134217728
#define PLAYER_NET_1_LVL_4 0x10000000 //268435456
+2
View File
@@ -2053,6 +2053,8 @@ INT8 ExecuteAction(SOLDIERTYPE *pSoldier)
if (!(pSoldier->flags.uiStatusFlags & SOLDIER_PC) && ( !(gTacticalStatus.Team[pSoldier->bTeam].bAwareOfOpposition) || ( ( gTacticalStatus.fPanicFlags & PANIC_TRIGGERS_HERE ) && gTacticalStatus.ubTheChosenOne == NOBODY ) ) )
{
HandleInitialRedAlert(pSoldier->bTeam, TRUE);
pSoldier->bSoldierFlagMask |= SOLDIER_RAISED_REDALERT;
}
// SANDRO - ENEMY TAUNTS
+10 -9
View File
@@ -885,19 +885,19 @@ INT8 DecideActionGreen(SOLDIERTYPE *pSoldier)
}
//ddd{
if(gGameExternalOptions.bNewTacticalAIBehavior && pSoldier->bTeam == ENEMY_TEAM )
if( !(pSoldier->bSoldierFlagMask & SOLDIER_RAISED_REDALERT) && gGameExternalOptions.bNewTacticalAIBehavior && pSoldier->bTeam == ENEMY_TEAM )
{
if ( !(gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) )
{
INT32 cnt;
ROTTING_CORPSE * pCorpse;
for ( cnt = 0; cnt < giNumRottingCorpse; cnt++ )
for ( cnt = 0; cnt < giNumRottingCorpse; ++cnt )
{
pCorpse = &(gRottingCorpse[ cnt ] );
if ( pCorpse->fActivated && pCorpse->def.ubAIWarningValue > 0 )
{
if ( PythSpacesAway( pSoldier->sGridNo, pCorpse->def.sGridNo ) <= 5 )//ïðèäåëàòü ñðàâíåíèå ïåðåìåííî äàëüíîñòè âèäåíèÿ (smaxvid ?)
{
//ïðîâåðèòü, íàõîäèòñÿ ëè òðóï â ïîëå çðåíèÿ äðàíèêà.ìåíòà?
@@ -911,6 +911,7 @@ INT8 DecideActionGreen(SOLDIERTYPE *pSoldier)
return( AI_ACTION_RED_ALERT );
}
}
}
}
}
@@ -1564,7 +1565,7 @@ INT8 DecideActionYellow(SOLDIERTYPE *pSoldier)
}
}
}
else if ( !gTacticalStatus.Team[pSoldier->bTeam].bAwareOfOpposition )
else if ( !(pSoldier->bSoldierFlagMask & SOLDIER_RAISED_REDALERT) && !gTacticalStatus.Team[pSoldier->bTeam].bAwareOfOpposition )
{
// raise alarm!
return( AI_ACTION_RED_ALERT );
@@ -2632,7 +2633,7 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
}
}
// frequencies are clear, lets call for help
else
else if ( !(pSoldier->bSoldierFlagMask & SOLDIER_RAISED_REDALERT) )
{
// raise alarm!
return( AI_ACTION_RED_ALERT );
@@ -2950,7 +2951,7 @@ INT8 DecideActionRed(SOLDIERTYPE *pSoldier, UINT8 ubUnconsciousOK)
// if we're a computer merc, and we have the action points remaining to RADIO
// (we never want NPCs to choose to radio if they would have to wait a turn)
if ( !fCivilian && (pSoldier->bActionPoints >= APBPConstants[AP_RADIO]) && (gTacticalStatus.Team[pSoldier->bTeam].bMenInSector > 1) )
if ( !(pSoldier->bSoldierFlagMask & SOLDIER_RAISED_REDALERT) && !fCivilian && (pSoldier->bActionPoints >= APBPConstants[AP_RADIO]) && (gTacticalStatus.Team[pSoldier->bTeam].bMenInSector > 1) )
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"decideactionred: checking to radio red alert");
@@ -4446,7 +4447,7 @@ INT16 ubMinAPCost;
}
}
// frequencies are clear, lets call for help
else
else if ( !(pSoldier->bSoldierFlagMask & SOLDIER_RAISED_REDALERT) )
{
// raise alarm!
return( AI_ACTION_RED_ALERT );
@@ -5829,7 +5830,7 @@ L_NEWAIM:
// (we never want NPCs to choose to radio if they would have to wait a turn)
// and we're not swimming in deep water, and somebody has called for spotters
// and we see the location of at least 2 opponents
if ((gTacticalStatus.ubSpottersCalledForBy != NOBODY) && (pSoldier->bActionPoints >= APBPConstants[AP_RADIO]) &&
if ( !(pSoldier->bSoldierFlagMask & SOLDIER_RAISED_REDALERT) && (gTacticalStatus.ubSpottersCalledForBy != NOBODY) && (pSoldier->bActionPoints >= APBPConstants[AP_RADIO]) &&
(pSoldier->aiData.bOppCnt > 1) && !fCivilian &&
(gTacticalStatus.Team[pSoldier->bTeam].bMenInSector > 1) && !bInDeepWater)
{
@@ -5968,7 +5969,7 @@ L_NEWAIM:
// RADIO RED ALERT: determine %chance to call others and report contact
////////////////////////////////////////////////////////////////////////////
if ( pSoldier->bTeam == MILITIA_TEAM && (pSoldier->bActionPoints >= APBPConstants[AP_RADIO]) && (gTacticalStatus.Team[pSoldier->bTeam].bMenInSector > 1) )
if ( !(pSoldier->bSoldierFlagMask & SOLDIER_RAISED_REDALERT) && pSoldier->bTeam == MILITIA_TEAM && (pSoldier->bActionPoints >= APBPConstants[AP_RADIO]) && (gTacticalStatus.Team[pSoldier->bTeam].bMenInSector > 1) )
{
// if there hasn't been an initial RED ALERT yet in this sector
+3
View File
@@ -569,6 +569,9 @@ enum
STR_NO_SPACE_FOR_POCKET,
STR_REPAIRED_PARTIAL,
STR_REPAIRED_PARTIAL_FOR_OWNER,
TEXT_NUM_STR_MESSAGE,
};
+3
View File
@@ -1761,6 +1761,9 @@ CHAR16 Message[][STRING_LENGTH] =
L"你不能把%s添加到这个附件槽。",
L"%s不能被添加到任何附件槽。",
L"这个口袋装不下了", //L"There's not enough space for this pocket.",
L"%s has repaired the %s as much as possible.", // TODO.Translate
L"%s has repaired %s's %s as much as possible.",
};
+4 -1
View File
@@ -1757,7 +1757,10 @@ CHAR16 Message[][STRING_LENGTH] =
L"You cannot attach %s to this slot.",
L"The %s will not fit in any open slots.",
L"There's not enough space for this pocket.", //TODO:Translate
L"There's not enough space for this pocket.", //TODO.Translate
L"%s has repaired the %s as much as possible.", // TODO.Translate
L"%s has repaired %s's %s as much as possible.",
};
+3
View File
@@ -1762,6 +1762,9 @@ CHAR16 Message[][STRING_LENGTH] =
L"You cannot attach %s to this slot.",
L"The %s will not fit in any open slots.",
L"There's not enough space for this pocket.",
L"%s has repaired the %s as much as possible.",
L"%s has repaired %s's %s as much as possible.",
};
+3
View File
@@ -1765,6 +1765,9 @@ CHAR16 Message[][STRING_LENGTH] =
L"Vous ne pouvez pas attacher %s à cet emplacement.",
L"%s n'ira dans aucun emplacement de libre.",
L"Pas assez de place pour cette poche.",
L"%s has repaired the %s as much as possible.", // TODO.Translate
L"%s has repaired %s's %s as much as possible.",
};
+3
View File
@@ -1776,6 +1776,9 @@ CHAR16 Message[][STRING_LENGTH] =
L"Sie können %s nicht an dieser Einbaustelle anbringen.",
L"%s passt in keine freie Einbaustelle.",
L"Für diese Tasche ist nicht mehr genug Platz.",
L"%s has repaired the %s as much as possible.", // TODO.Translate
L"%s has repaired %s's %s as much as possible.",
};
CHAR16 pTownNames[MAX_TOWNS][MAX_TOWN_NAME_LENGHT] =
+3
View File
@@ -1754,6 +1754,9 @@ CHAR16 Message[][STRING_LENGTH] =
L"You cannot attach %s to this slot.",
L"The %s will not fit in any open slots.",
L"There's not enough space for this pocket.", //TODO:Translate
L"%s has repaired the %s as much as possible.", // TODO.Translate
L"%s has repaired %s's %s as much as possible.",
};
+3
View File
@@ -1770,6 +1770,9 @@ CHAR16 Message[][STRING_LENGTH] =
L"Niemożesz przydzielić %s do tego slotu.",
L"The %s will not fit in any open slots.",
L"There's not enough space for this pocket.", //TODO:Translate
L"%s has repaired the %s as much as possible.", // TODO.Translate
L"%s has repaired %s's %s as much as possible.",
};
+3
View File
@@ -1762,6 +1762,9 @@ CHAR16 Message[][STRING_LENGTH] =
L"Нельзя установить навеску %s на это место.",
L"The %s will not fit in any open slots.",
L"There's not enough space for this pocket.", //TODO:Translate
L"%s has repaired the %s as much as possible.", // TODO.Translate
L"%s has repaired %s's %s as much as possible.",
};
+3
View File
@@ -1762,6 +1762,9 @@ CHAR16 Message[][STRING_LENGTH] =
L"You cannot attach %s to this slot.",
L"The %s will not fit in any open slots.",
L"There's not enough space for this pocket.", //TODO:Translate
L"%s has repaired the %s as much as possible.", // TODO.Translate
L"%s has repaired %s's %s as much as possible.",
};