New feature: exploration assignment indicates items on the map

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&goto=360244&#msg_360244


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8815 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2020-06-01 20:46:45 +00:00
parent b25a4be4e7
commit f0c8db784a
25 changed files with 514 additions and 58 deletions
+10
View File
@@ -2428,6 +2428,16 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
swprintf(sString, L"%d/%3.1f", sPtsAvailable, bPtsAvailable);
break;
case EXPLORATION:
sIconIndex_Assignment = 34;
fDoIcon_Assignment = TRUE;
fShowCustomText = TRUE;
sPtsAvailable = (INT16)MercPtrs[pFace->ubSoldierID]->GetExplorationPoints();
// we only show our points, not how far we are with the task, lest the player deduct how many items there are to find in the first place
swprintf( sString, L"%d", sPtsAvailable );
break;
}
// Check for being serviced...
+6 -2
View File
@@ -619,6 +619,8 @@ void DrawExplosionWarning( INT32 sGridno, INT8 sLevel, INT8 sDelay )
// make sure to check for these boundaries later on, and only draw inside them
SetClippingRegionAndImageWidth( uiDestPitchBYTES, gsVIEWPORT_START_X, gsVIEWPORT_WINDOW_START_Y, gsVIEWPORT_END_X, gsVIEWPORT_WINDOW_END_Y );
UINT16 red = Get16BPPColor( FROMRGB( 255, 0, 0 ) );
INT16 numcircles = max( 1, 4 - sDelay);
// we determine the biggest rectangle we have to reserve
@@ -658,7 +660,7 @@ void DrawExplosionWarning( INT32 sGridno, INT8 sLevel, INT8 sDelay )
if ( radius_inner <= diff && diff <= radius_outer )
{
// we alter the colour of existing pixels instead of fully replacing the colour. As a result, one can still see the map regions we draw over, which looks a lot better
PixelAlterColour( FALSE, x, y, 0x00, 0x88, pDestBuf );
PixelAlterColour( FALSE, x, y, red, pDestBuf );
sthdrawn = TRUE;
}
@@ -733,6 +735,8 @@ void DrawTraitRadius( INT32 sGridno, INT8 sLevel, INT32 sRadius, INT16 sThicknes
best_yl = min( best_yl, yl );
best_yr = max( best_yr, yr );
UINT16 blue = Get16BPPColor( FROMRGB( 0, 0, 255 ) );
for ( INT32 x = xl; x <= xr; ++x )
{
FLOAT xdiffsquared = (FLOAT)((sScreenX - x) * (sScreenX - x));
@@ -744,7 +748,7 @@ void DrawTraitRadius( INT32 sGridno, INT8 sLevel, INT32 sRadius, INT16 sThicknes
if ( radius_inner <= diff && diff <= radius_outer )
{
// we alter the colour of existing pixels instead of fully replacing the colour. As a result, one can still see the map regions we draw over, which looks a lot better
PixelAlterColour( FALSE, x, y, 0xFF, 0x00, pDestBuf );
PixelAlterColour( FALSE, x, y, blue, pDestBuf );
sthdrawn = TRUE;
}
+1
View File
@@ -205,6 +205,7 @@ enum {
BG_HACKERSKILL, // hacking skill from 0 to 100, > 0 means hacking is possible
BG_BURIAL_ASSIGNMENT, // modifies effectivity of 'BURIAL' assignment
BG_ADMINISTRATION_ASSIGNMENT, // modifies effectivity of 'ADMINISTRATION' assignment
BG_EXPLORATION_ASSIGNMENT, // modifies effectivity of 'EXPLORATION' assignment
BG_MAX,
};
+55 -1
View File
@@ -20684,7 +20684,7 @@ FLOAT SOLDIERTYPE::GetAdministrationModifier()
// Flugente: those with the <scrounging> background occasionally steal money from the locals
UINT8 SOLDIERTYPE::GetThiefStealMoneyChance()
{
if ( this->stats.bLife < OKLIFE )
if ( this->stats.bLife < OKLIFE || ( this->usSoldierFlagMask & SOLDIER_POW ) )
return 0;
UINT32 val = 1 * EffectiveAgility( this, FALSE ) + 8 * EffectiveDexterity( this, FALSE ) + 10 * EffectiveExpLevel( this, FALSE );
@@ -21001,6 +21001,60 @@ void SOLDIERTYPE::OrderAllTurnCoatToSwitchSides()
}
}
UINT32 SOLDIERTYPE::GetExplorationPoints()
{
if ( this->stats.bLife < OKLIFE || ( this->usSoldierFlagMask & SOLDIER_POW ) )
return 0;
// if not on correct assignment, no gain
if ( this->bAssignment != EXPLORATION )
return 0;
UINT32 val = 400 + 1 * EffectiveWisdom( this ) + 1 * EffectiveAgility( this, FALSE ) + 5 * EffectiveExpLevel( this, FALSE )
+ 150 * NUM_SKILL_TRAITS( this, SCOUTING_NT ) + 50 * NUM_SKILL_TRAITS( this, SURVIVAL_NT ) + (this->HasBackgroundFlag( BACKGROUND_SCROUNGING ) ? 150 : 0);
// personality/disability modifiers
FLOAT persmodifier = 1.0f;
//if ( DoesMercHaveDisability( this, HEAT_INTOLERANT ) ) persmodifier -= 0.20f;
//if ( DoesMercHaveDisability( this, NERVOUS ) ) persmodifier -= 0.20f;
if ( DoesMercHaveDisability( this, CLAUSTROPHOBIC ) ) persmodifier -= 0.03f;
//if ( DoesMercHaveDisability( this, NONSWIMMER ) ) persmodifier -= 0.20f;
//if ( DoesMercHaveDisability( this, FEAR_OF_INSECTS ) ) persmodifier -= 0.20f;
if ( DoesMercHaveDisability( this, FORGETFUL ) ) persmodifier -= 0.30f;
//if ( DoesMercHaveDisability( this, PSYCHO ) ) persmodifier -= 0.20f;
//if ( DoesMercHaveDisability( this, DEAF ) ) persmodifier -= 0.15f;
if ( DoesMercHaveDisability( this, SHORTSIGHTED ) ) persmodifier -= 0.30f;
//if ( DoesMercHaveDisability( this, HEMOPHILIAC ) ) persmodifier -= 0.20f;
if ( DoesMercHaveDisability( this, AFRAID_OF_HEIGHTS ) ) persmodifier -= 0.02f;
//if ( DoesMercHaveDisability( this, SELF_HARM ) ) persmodifier -= 0.20f;
if ( gGameOptions.fNewTraitSystem )
{
//if ( DoesMercHavePersonality( this, CHAR_TRAIT_SOCIABLE ) ) persmodifier += 0.25f;
//if ( DoesMercHavePersonality( this, CHAR_TRAIT_LONER ) ) persmodifier -= 0.05f;
//if ( DoesMercHavePersonality( this, CHAR_TRAIT_OPTIMIST ) ) persmodifier += 0.05f;
//if ( DoesMercHavePersonality( this, CHAR_TRAIT_ASSERTIVE ) ) persmodifier += 0.15f;
//if ( DoesMercHavePersonality( this, CHAR_TRAIT_INTELLECTUAL ) ) persmodifier += 0.15f;
//if ( DoesMercHavePersonality( this, CHAR_TRAIT_PRIMITIVE ) ) persmodifier -= 0.15f;
//if ( DoesMercHavePersonality( this, CHAR_TRAIT_AGGRESSIVE ) ) persmodifier -= 0.15f;
//if ( DoesMercHavePersonality( this, CHAR_TRAIT_PHLEGMATIC ) ) persmodifier -= 0.05f;
//if ( DoesMercHavePersonality( this, CHAR_TRAIT_DAUNTLESS ) ) persmodifier -= 0.13f;
//if ( DoesMercHavePersonality( this, CHAR_TRAIT_PACIFIST ) ) persmodifier -= 0.03f;
//if ( DoesMercHavePersonality( this, CHAR_TRAIT_MALICIOUS ) ) persmodifier -= 0.13f;
//if ( DoesMercHavePersonality( this, CHAR_TRAIT_SHOWOFF ) ) persmodifier -= 0.08f;
if ( DoesMercHavePersonality( this, CHAR_TRAIT_COWARD ) ) persmodifier -= 0.02f;
}
// background modifier
persmodifier += ( this->GetBackgroundValue( BG_EXPLORATION_ASSIGNMENT ) ) / 100.0f;
UINT32 totalvalue = val * persmodifier * gGameExternalOptions.fExplorationPointsModifier / 10;
ReducePointsForFatigue( this, &totalvalue );
return totalvalue;
}
INT32 CheckBleeding( SOLDIERTYPE *pSoldier )
{
INT8 bBandaged; //,savedOurTurn;
+3
View File
@@ -2038,6 +2038,9 @@ public:
void AttemptToCreateTurncoat( UINT16 usID );
BOOLEAN OrderTurnCoatToSwitchSides( UINT16 usID );
void OrderAllTurnCoatToSwitchSides();
// Flugente: exploration assignment
UINT32 GetExplorationPoints();
//////////////////////////////////////////////////////////////////////////////
}; // SOLDIERTYPE;
+6
View File
@@ -140,6 +140,7 @@ backgroundStartElementHandle(void *userData, const XML_Char *name, const XML_Cha
strcmp(name, "hackerskill" ) == 0 ||
strcmp(name, "burial_assignment" ) == 0 ||
strcmp(name, "administration_assignment" ) == 0 ||
strcmp(name, "exploration_assignment" ) == 0 ||
strcmp(name, "druguse") == 0 ||
strcmp(name, "xenophobic") == 0 ||
strcmp(name, "corruptionspread") == 0 ||
@@ -610,6 +611,11 @@ backgroundEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curBackground.value[BG_ADMINISTRATION_ASSIGNMENT] = min( 1000, max( -50, (INT16)atol( pData->szCharData ) ) );
}
else if ( strcmp( name, "exploration_assignment" ) == 0 )
{
pData->curElement = ELEMENT;
pData->curBackground.value[BG_EXPLORATION_ASSIGNMENT] = min( 1000, max( -100, (INT16)atol( pData->szCharData ) ) );
}
else if(strcmp(name, "druguse") == 0)
{
pData->curElement = ELEMENT;