mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
- Bugfix: Old IMP Creation
o Fixed bug with IMP Attributes selection, where you could lower value to 0 and get bonus points git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4592 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -94,9 +94,9 @@ INT32 iHealthMinimum = gGameExternalOptions.iMinAttribute;
|
||||
INT32 iLeaderShipMinimum = gGameExternalOptions.iMinAttribute;
|
||||
INT32 iWisdomMinimum = gGameExternalOptions.iMinAttribute;
|
||||
INT32 iMarkmanshipMinimum = gGameExternalOptions.iMinAttribute;
|
||||
INT32 iMechanicalMinimum = gGameExternalOptions.iMinAttribute;
|
||||
INT32 iMedicalMinimum = gGameExternalOptions.iMinAttribute;
|
||||
INT32 iExplosivesMinimum = gGameExternalOptions.iMinAttribute;
|
||||
INT32 iMechanicalMinimum = 0;
|
||||
INT32 iMedicalMinimum = 0;
|
||||
INT32 iExplosivesMinimum = 0;
|
||||
|
||||
|
||||
|
||||
@@ -613,79 +613,79 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
|
||||
switch( iStatToIncrement )
|
||||
{
|
||||
case( STRENGTH_ATTRIBUTE ):
|
||||
if( iCurrentStrength > iMaxAttribute -1 )
|
||||
if( iCurrentStrength > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentStrength++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
break;
|
||||
case( DEXTERITY_ATTRIBUTE ):
|
||||
if( iCurrentDexterity > iMaxAttribute -1 )
|
||||
case( DEXTERITY_ATTRIBUTE ):
|
||||
if( iCurrentDexterity > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentDexterity++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
break;
|
||||
case( AGILITY_ATTRIBUTE ):
|
||||
if( iCurrentAgility > iMaxAttribute -1 )
|
||||
if( iCurrentAgility > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentAgility++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
break;
|
||||
case( WISDOM_ATTRIBUTE ):
|
||||
if( iCurrentWisdom > iMaxAttribute -1 )
|
||||
if( iCurrentWisdom > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentWisdom++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
break;
|
||||
case( HEALTH_ATTRIBUTE ):
|
||||
if( iCurrentHealth > iMaxAttribute -1 )
|
||||
case( HEALTH_ATTRIBUTE ):
|
||||
if( iCurrentHealth > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentHealth++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
break;
|
||||
case( LEADERSHIP_ATTRIBUTE ):
|
||||
if( iCurrentLeaderShip > iMaxAttribute -1 )
|
||||
if( iCurrentLeaderShip > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if( iCurrentLeaderShip == 0)
|
||||
{
|
||||
if( DoWeHaveThisManyBonusPoints( iMaxZeroBonus ) == TRUE )
|
||||
{
|
||||
iCurrentLeaderShip+=iLeaderShipMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
iCurrentLeaderShip+=iLeaderShipMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
fSkillAtZeroWarning = FALSE;
|
||||
}
|
||||
else
|
||||
@@ -695,25 +695,25 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentLeaderShip++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentLeaderShip++;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case( MARKSMANSHIP_SKILL ):
|
||||
if( iCurrentMarkmanship > iMaxAttribute -1 )
|
||||
if( iCurrentMarkmanship > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
if( iCurrentMarkmanship == 0)
|
||||
{
|
||||
if( DoWeHaveThisManyBonusPoints( iMaxZeroBonus ) == TRUE )
|
||||
{
|
||||
iCurrentMarkmanship+=iMarkmanshipMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
iCurrentMarkmanship+=iMarkmanshipMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
fSkillAtZeroWarning = FALSE;
|
||||
}
|
||||
else
|
||||
@@ -723,25 +723,25 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentMarkmanship++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentMarkmanship++;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case( MECHANICAL_SKILL ):
|
||||
if( iCurrentMechanical > iMaxAttribute -1 )
|
||||
if( iCurrentMechanical > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
if( iCurrentMechanical == 0)
|
||||
{
|
||||
if( DoWeHaveThisManyBonusPoints( iMaxZeroBonus ) == TRUE )
|
||||
{
|
||||
iCurrentMechanical+=iMechanicalMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
iCurrentMechanical+=iMechanicalMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
fSkillAtZeroWarning = FALSE;
|
||||
}
|
||||
else
|
||||
@@ -751,25 +751,25 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentMechanical++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentMechanical++;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case( MEDICAL_SKILL ):
|
||||
if( iCurrentMedical > iMaxAttribute -1 )
|
||||
if( iCurrentMedical > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
if( iCurrentMedical == 0)
|
||||
if( iCurrentMedical == 0)
|
||||
{
|
||||
if( DoWeHaveThisManyBonusPoints( iMaxZeroBonus ) == TRUE )
|
||||
{
|
||||
iCurrentMedical+=iMedicalMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
iCurrentMedical+=iMedicalMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
fSkillAtZeroWarning = FALSE;
|
||||
}
|
||||
else
|
||||
@@ -779,25 +779,25 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentMedical++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentMedical++;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case( EXPLOSIVE_SKILL ):
|
||||
if( iCurrentExplosives > iMaxAttribute -1 )
|
||||
if( iCurrentExplosives > iMaxAttribute -1 )
|
||||
{
|
||||
// too high, leave
|
||||
return( SLIDER_OUT_OF_RANGE );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
if( iCurrentExplosives == 0)
|
||||
{
|
||||
if( DoWeHaveThisManyBonusPoints( iMaxZeroBonus ) == TRUE )
|
||||
{
|
||||
iCurrentExplosives+=iExplosivesMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
iCurrentExplosives+=iExplosivesMinimum;
|
||||
iCurrentBonusPoints-=iMaxZeroBonus;
|
||||
fSkillAtZeroWarning = FALSE;
|
||||
}
|
||||
else
|
||||
@@ -807,8 +807,8 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
|
||||
}
|
||||
else
|
||||
{
|
||||
iCurrentExplosives++;
|
||||
iCurrentBonusPoints--;
|
||||
iCurrentExplosives++;
|
||||
iCurrentBonusPoints--;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1916,7 +1916,7 @@ INT32 GetCurrentAttributeValue( INT32 iAttribute )
|
||||
void SetAttributes( void )
|
||||
{
|
||||
INT32 iExtraPoints = 0;
|
||||
|
||||
|
||||
// added externilized multiplier for starting level - SADNRO
|
||||
iLevelCostMultiplier = gGameExternalOptions.iIMPStartingLevelCostMultiplier;
|
||||
|
||||
@@ -2077,6 +2077,19 @@ void SetAttributes( void )
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
else // ORIGINAL
|
||||
{
|
||||
// default
|
||||
iStrengthMinimum = gGameExternalOptions.iMinAttribute;
|
||||
iAgilityMinimum = gGameExternalOptions.iMinAttribute;
|
||||
iDexterityMinimum = gGameExternalOptions.iMinAttribute;
|
||||
iHealthMinimum = gGameExternalOptions.iMinAttribute;
|
||||
iLeaderShipMinimum = gGameExternalOptions.iMinAttribute;
|
||||
iWisdomMinimum = gGameExternalOptions.iMinAttribute;
|
||||
|
||||
iMarkmanshipMinimum = gGameExternalOptions.iMinAttribute;
|
||||
iMechanicalMinimum = gGameExternalOptions.iMinAttribute;
|
||||
iMedicalMinimum = gGameExternalOptions.iMinAttribute;
|
||||
iExplosivesMinimum = gGameExternalOptions.iMinAttribute;
|
||||
|
||||
iCurrentBonusPoints = gGameExternalOptions.iImpAttributePoints;
|
||||
|
||||
//Determine if the player has any extra points
|
||||
|
||||
Reference in New Issue
Block a user