mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
Feature improvement:
- If MILITIA_USE_SECTOR_EQUIPMENT is TRUE and you assign a merc to the 'MOVE ITEM' assignment, you can select wether gear that the militia can use should be ignored. - To prevent confusion, 'MOVE ITEM' has been renamed 'GETITEM'. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7517 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -2069,12 +2069,18 @@ void HandleDynamicOpinionChange( SOLDIERTYPE* pSoldier, UINT8 usEvent, BOOLEAN f
|
||||
if ( !pTeamSoldier->iTotalContractLength || (pTeamSoldier->ubWhatKindOfMercAmI != MERC_TYPE__AIM_MERC && pTeamSoldier->ubWhatKindOfMercAmI != MERC_TYPE__MERC && pTeamSoldier->ubWhatKindOfMercAmI != MERC_TYPE__NPC_WITH_UNEXTENDABLE_CONTRACT) )
|
||||
continue;
|
||||
|
||||
// A gets offended of B if
|
||||
// mean wage(B) >= ( WAGE_ACCEPTANCE_FACTOR * level(B) / level(A) ) * mean wage(A)
|
||||
// which equals
|
||||
// mean wage(B) / level(B) >= WAGE_ACCEPTANCE_FACTOR * mean wage(A) / level(A)
|
||||
|
||||
// their wage
|
||||
UINT32 theirmeanwage = gMercProfiles[pTeamSoldier->ubProfile].uiTotalCostToDate / pTeamSoldier->iTotalContractLength;
|
||||
|
||||
// adjust this for experience levels
|
||||
FLOAT explevelfactor = gGameExternalOptions.fDynamicWageFactor * pTeamSoldier->stats.bExpLevel / explevel;
|
||||
|
||||
// abort if their mean wage isn't that high
|
||||
if ( theirmeanwage < explevelfactor * meanwage )
|
||||
continue;
|
||||
}
|
||||
|
||||
+21
-1
@@ -15409,4 +15409,24 @@ void AttachDefaultAttachments(OBJECTTYPE *pObj, BOOLEAN fAllDefaultAttachments)/
|
||||
pObj->AttachObject(NULL, &defaultAttachment, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Flugente: is this object useable by militia?
|
||||
BOOLEAN ObjectIsMilitiaRelevant( OBJECTTYPE *pObj )
|
||||
{
|
||||
if ( !pObj )
|
||||
return FALSE;
|
||||
|
||||
if ( gGameExternalOptions.fMilitiaUseSectorInventory )
|
||||
{
|
||||
if ( Item[pObj->usItem].usItemClass & IC_ARMOUR && gGameExternalOptions.fMilitiaUseSectorInventory_Armour ) return TRUE;
|
||||
if ( Item[pObj->usItem].usItemClass & IC_FACE && gGameExternalOptions.fMilitiaUseSectorInventory_Face ) return TRUE;
|
||||
if ( Item[pObj->usItem].usItemClass & (IC_BLADE | IC_PUNCH) && gGameExternalOptions.fMilitiaUseSectorInventory_Melee ) return TRUE;
|
||||
if ( Item[pObj->usItem].usItemClass & IC_GRENADE && gGameExternalOptions.fMilitiaUseSectorInventory_Grenade ) return TRUE;
|
||||
if ( Item[pObj->usItem].usItemClass & (IC_GUN | IC_AMMO) && gGameExternalOptions.fMilitiaUseSectorInventory_Gun ) return TRUE;
|
||||
if ( Item[pObj->usItem].usItemClass & IC_LAUNCHER && gGameExternalOptions.fMilitiaUseSectorInventory_Launcher ) return TRUE;
|
||||
if ( Item[pObj->usItem].usItemClass & IC_AMMO && gGameExternalOptions.fMilitiaUseSectorInventory_Ammo ) return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -540,6 +540,9 @@ UINT8 GetInventorySleepModifier( SOLDIERTYPE *pSoldier );
|
||||
|
||||
void AttachDefaultAttachments(OBJECTTYPE *pObj, BOOLEAN fAllDefaultAttachments=TRUE);//dnl ch75 261013
|
||||
|
||||
// Flugente: is this object useable by militia?
|
||||
BOOLEAN ObjectIsMilitiaRelevant( OBJECTTYPE *pObj );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -393,7 +393,7 @@ enum
|
||||
#define SOLDIER_VIP 0x10000000 //268435456 // soldier is a VIP - the player will likely try to assassinate him
|
||||
#define SOLDIER_BODYGUARD 0x20000000 //536870912 // soldier is a bodyguard for a VIP/*
|
||||
#define SOLDIER_COVERT_TEMPORARY_OVERT 0x40000000 //1073741824 // we are covert, but just performed a obviously suspicious task. For a short time, we can be uncovered more easily
|
||||
//#define WH40K_SOLDIER_KILLTHISTURN 0x80000000 //2147483648 // Soldier is on a kill streak*/
|
||||
#define SOLDIER_MOVEITEM_RESTRICTED 0x80000000 //2147483648 // when moving item, this soldier will not pick up equipment the militia might use
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
// ------------------- more flags for soldiers --------------------
|
||||
|
||||
Reference in New Issue
Block a user