New feature: individual militia creates small militia profiles that track a militia's history and allow it to be recreated, thereby maintaining the illusion of persistent militia.

Requires GameDir >= r2316.

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=tree&th=23044&goto=345324&#msg_345324

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8202 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-05-06 14:51:24 +00:00
parent 67927ed723
commit 9f52c940a8
75 changed files with 6740 additions and 703 deletions
+11 -1
View File
@@ -51,6 +51,7 @@
#include "Reinforcement.h" // added by Flugente for AddPossiblePendingMilitiaToBattle()
#include "Militia Control.h" // added by Flugente for ResetMilitia()
#include "Creature Spreading.h" // added by Flugente
#include "MilitiaIndividual.h" // added by Flugente
#endif
#include "MilitiaSquads.h"
@@ -2281,6 +2282,9 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
if ( gGameExternalOptions.fMilitiaUseSectorInventory )
TeamDropAll( MILITIA_TEAM );
// Flugente: update individual militia data
UpdateAllMilitiaHealthInTactical( );
// we now force a resetting of militia - they will be removed and recreated
// as the group's coordinates have alreay 'moved' to the next sector, the group militia will now be gone
gfStrategicMilitiaChangesMade = TRUE;
@@ -2294,6 +2298,9 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
// move the gear along to the next sector
MoveMilitiaEquipment( pGroup->ubPrevX, pGroup->ubPrevY, pGroup->ubSectorX, pGroup->ubSectorY, pGroup->pEnemyGroup->ubNumElites, pGroup->pEnemyGroup->ubNumTroops, pGroup->pEnemyGroup->ubNumAdmins );
// Flugente: move along individual militia data
MoveIndividualMilitiaProfiles( SECTOR( pGroup->ubPrevX, pGroup->ubPrevY ), SECTOR( pGroup->ubSectorX, pGroup->ubSectorY ), pGroup->pEnemyGroup->ubNumAdmins, pGroup->pEnemyGroup->ubNumTroops, pGroup->pEnemyGroup->ubNumElites );
// if this is the last sector along the path, destroy the group after this and make the militia static
if ( !fBattlePending &&GroupAtFinalDestination( pGroup ) )
{
@@ -2309,13 +2316,16 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
// move the gear along to the next sector
MoveMilitiaEquipment( pGroup->ubPrevX, pGroup->ubPrevY, pGroup->ubSectorX, pGroup->ubSectorY, pGroup->pEnemyGroup->ubNumElites, pGroup->pEnemyGroup->ubNumTroops, pGroup->pEnemyGroup->ubNumAdmins );
// Flugente: move along individual militia data
MoveIndividualMilitiaProfiles( SECTOR( pGroup->ubPrevX, pGroup->ubPrevY ), SECTOR( pGroup->ubSectorX, pGroup->ubSectorY ), pGroup->pEnemyGroup->ubNumAdmins, pGroup->pEnemyGroup->ubNumTroops, pGroup->pEnemyGroup->ubNumElites );
// if this is the last sector along the path, destroy the group after this and make the militia static
if ( !fBattlePending && GroupAtFinalDestination( pGroup ) )
{
// once militia have arrived, move them from the group to the sector
DissolveMilitiaGroup( pGroup->ubGroupID );
}
// for safety, reset if necessary
ResetMilitia( );
}