Home » PLAYER'S HQ 1.13 » JA2 Complete Mods & Sequels » Stracciatella Project (Platform Independent JA2) » [Mod] Recruit Maria using the Playable Characters Mod
Re: [Mod] Recruit Maria using the Playable Characters Mod[message #318101]
|
Sat, 27 April 2013 19:05
|
|
mgl |
|
Messages:255
Registered:December 2007 Location: France |
|
|
Second part: Update the source code for the mod.
The diff file for this mod assumes that the Consistency Fix for the Maria Quest patch has been applied. Apply it first if you need to.
This is the diff file for the mod:
recruit_maria.diff:
Index: Build/Tactical/Interface_Dialogue.cc
===================================================================
--- Build/Tactical/Interface_Dialogue.cc (revision 7072)
+++ Build/Tactical/Interface_Dialogue.cc (working copy)
@@ -2497,6 +2497,9 @@
TriggerNPCRecord( MARIA, 10 );
}
}
+ /* mgl: Recruit Maria using PCM data */
+ gMercProfiles[MARIA].ubBodyType = REGFEMALE;
break;
case NPC_ACTION_ANGEL_LEAVES_DEED:
Index: Build/Strategic/StrategicMap.cc
===================================================================
--- Build/Strategic/StrategicMap.cc (revision 7072)
+++ Build/Strategic/StrategicMap.cc (working copy)
@@ -1089,10 +1089,22 @@
if (sector == SEC_C6 && gubQuest[QUEST_RESCUE_MARIA] == QUESTDONE)
{
// make sure Maria and Angel are gone
- gMercProfiles[ MARIA ].sSectorX = 0;
+
+ /* mgl: Recruit Maria using PCM data
+ * Maria could be elsewhere, waiting to be recruited.
+ * Don't change her coordinates if she's not here and don't change them
+ * if she's here in the player's team.
+ * We simply look at her body type: if it's a fighting body type
+ * then she is available as a merc.
+ */
+ if (gMercProfiles[MARIA].ubBodyType != REGFEMALE)
+ {
+ gMercProfiles[ MARIA ].sSectorX = 0;
+ gMercProfiles[ MARIA ].sSectorY = 0;
+ }
+
+ gMercProfiles[ ANGEL ].sSectorX = 0;
gMercProfiles[ ANGEL ].sSectorY = 0;
- gMercProfiles[ MARIA ].sSectorX = 0;
- gMercProfiles[ ANGEL ].sSectorY = 0;
}
if (sector == SEC_D5)
Index: Build/Strategic/Strategic_Merc_Handler.cc
===================================================================
--- Build/Strategic/Strategic_Merc_Handler.cc (revision 7072)
+++ Build/Strategic/Strategic_Merc_Handler.cc (working copy)
@@ -36,11 +36,44 @@
#include "Soldier_Macros.h"
#include "Finances.h"
#include "Quests.h"
+#include "Animation_Data.h" /* mgl: Recruit Maria using PCM data */
#define NUM_DAYS_TILL_UNPAID_RPC_QUITS 3
+static void HandleMariaAsRPC()
+{
+ /* mgl: Recruit Maria using "Playable Characters Mod" (PCM) data
+ * If her quest is done (she must be alive then), we use a daily update function
+ * to prepare her to be added in Omerta, A10, starting the following day of her quest.
+ */
+ if ( (gubQuest[QUEST_RESCUE_MARIA] == QUESTDONE)
+ && (!(gMercProfiles[MARIA].ubMiscFlags & PROFILE_MISC_FLAG_RECRUITED))
+ )
+ {
+ MERCPROFILESTRUCT& maria = GetProfile(MARIA);
+
+ // Tell the game not to use her profile from a map (I think it's already done).
+ maria.ubMiscFlags3 |= PROFILE_MISC_FLAG3_PERMANENT_INSERTION_CODE;
+ maria.fUseProfileInsertionInfo = TRUE;
+
+ // Give her a fighting body type.
+ maria.ubBodyType = REGFEMALE;
+
+ // Set her near the rebels' house in A10
+ maria.sSectorX = 10;
+ maria.sSectorY = MAP_ROW_A;
+ maria.ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
+ maria.usStrategicInsertionData = 7897;
+
+ // Make her stationary
+ SOLDIERTYPE* const s = FindSoldierByProfileID(MARIA);
+ if (s && (s->bLife >= OKLIFE)) { s->bOrders = STATIONARY; }
+ }
+}
+
+
void StrategicHandlePlayerTeamMercDeath(SOLDIERTYPE& s)
{
UINT32 const now = GetWorldTotalMin();
@@ -356,6 +383,9 @@
HandleSlayDailyEvent();
ReBuildCharactersList();
+
+ /* mgl: Recruit Maria using PCM data */
+ HandleMariaAsRPC();
}
Index: Build/TacticalAI/NPC.cc
===================================================================
--- Build/TacticalAI/NPC.cc (revision 7072)
+++ Build/TacticalAI/NPC.cc (working copy)
@@ -627,6 +627,19 @@
SOLDIERTYPE const* const s = FindSoldierByProfileID(ubNPC);
if (!s) return 0;
+ /* mgl: Recruit Maria using PCM (Playable Characters Mod) data
+ * When approached to be recruited, her lines are either that she's eager to meet her brother
+ * or that she fears guns. We don't bother triggering them and recruit her without speech.
+ */
+ if (ubNPC == MARIA
+ && gMercProfiles[MARIA].ubBodyType == REGFEMALE
+ && approach == APPROACH_RECRUIT
+ && gubQuest[QUEST_RESCUE_MARIA] == QUESTDONE)
+ {
+ RecruitRPC(MARIA);
+ return 0;
+ }
+
if (ppResultQuoteInfo) *ppResultQuoteInfo = 0;
if (pubQuoteNum) *pubQuoteNum = 0;
The last, empty line is required, it's an important context line for the "patch" program.
Go to the root folder of the source code, save the diff file "recruit_maria.diff" there and patch the code:
patch -p0 < recruit_maria.diff
The patch program may complain but work because the line numbers don't match yours. It's because I have other mods/patches in the same files that I removed to create the diff file for this mod.
Recompile.
Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Mon Jan 13 13:59:43 GMT+2 2025
Total time taken to generate the page: 0.00847 seconds
|