Home » MODDING HQ 1.13 » v1.13 Feature Requests » Drop All & TravelRating
|
Re: Drop All & TravelRating[message #364313 is a reply to message #364312]
|
Wed, 09 February 2022 14:42
|
|
Deleted. |
|
Messages:2657
Registered:December 2012 Location: Russian Federation |
|
|
Currently items can disappear randomly if there is queen's army in the sector.
BOOLEAN SetThisSectorAsEnemyControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, BOOLEAN fContested )
// stealing should fail anyway 'cause there shouldn't be a temp file for unvisited sectors, but let's check anyway
if ( GetSectorFlagStatus( sMapX, sMapY, ( UINT8 ) bMapZ, SF_ALREADY_VISITED ) == TRUE )
{
// enemies can steal items left lying about (random chance). The more there are, the more they take!
ubTheftChance = 5 * NumEnemiesInAnySector( sMapX, sMapY, bMapZ );
// max 90%, some stuff may just simply not get found
if (ubTheftChance > 90 )
{
ubTheftChance = 90;
}
RemoveRandomItemsInSector( sMapX, sMapY, bMapZ, ubTheftChance );
}
So it happens at the moment army takes control over the sector, but only if sector was previously visited by player.
20 enemy soldiers in sector means 90% chance for every item in sector to be removed (if NO_REMOVE_RANDOM_SECTOR_ITEMS is not activated).
There is also some old code to steal items by civilians but it's disabled
Toggle SpoilerARM: Civilian theft of items was removed
void HandleTheftByCiviliansInSector( INT16 sX, INT16 sY, INT32 iLoyalty )
{
UINT8 ubChance = 0;
// any loyalty under the theft threshhold is chance that thefts will occur
if( iLoyalty < THRESHOLD_FOR_TOWN_THEFT )
{
// sectors with mercs are immune
if( fSectorsWithSoldiers[ sX + ( MAP_WORLD_X * sY ) ][ 0 ] == FALSE )
{
// sectors not yet visited by player are also immune (other sectors in town could have been visited)
if ( GetSectorFlagStatus( sX, sY, 0, SF_ALREADY_VISITED ) == TRUE )
{
ubChance = 5 + ( THRESHOLD_FOR_TOWN_THEFT - iLoyalty ) / 2;
// remove items from sector
RemoveRandomItemsInSector( sX, sY, 0, ubChance);
}
}
}
return;
}
void HandleTownTheft( void )
{
INT32 iCounter = 0;
UINT8 ubTown;
// init sectors with soldiers list
InitSectorsWithSoldiersList( );
// build list
BuildSectorsWithSoldiersList( );
while( pTownNamesList[ iCounter ] != 0 )
{
ubTown = StrategicMap[ pTownLocationsList[ iCounter ] ].bNameId;
// if this town tracks loyalty, and tracking has started
if ( ( ubTown != BLANK_SECTOR ) && gfTownUsesLoyalty[ ubTown ] && gTownLoyalty[ ubTown ].fStarted )
{
// handle theft in this town sector
HandleTheftByCiviliansInSector( ( INT16 )( pTownLocationsList[ iCounter ] % MAP_WORLD_X ), ( INT16 )( pTownLocationsList[ iCounter ] / MAP_WORLD_X ), gTownLoyalty[ ubTown ].ubRating );
}
iCounter++;
}
return;
}
HandleTownTheft was supposed to be called every hour and steal items from town sectors not guarded by mercs, with a theft chance based on current town loyalty.
This was probably removed by game developers as unfun game element.
Lowest loyalty to start stealing items from unguarded town sectors in defined as 50%
// the loyalty threshold below which theft of unsupervised items in a town sector can occur
#define THRESHOLD_FOR_TOWN_THEFT 50
[Updated on: Wed, 09 February 2022 18:05]
Left this community.Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Tue Dec 10 16:27:01 GMT+2 2024
Total time taken to generate the page: 0.00897 seconds
|