mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
*************************************************************************
** Merged source code from development (MP+BMP) trunk (Revision: 3352) ** ** https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP ** ************************************************************************* 1 (Rev. 3343) Changes: Control hardcoded list of unclickable ("bad") sectors via XML file. (by Realist) On the strategic map, the player cannot click or highlight specific sectors (e.g. A4, A5). Introduce a <BadSector> tag in MovementCosts.xml that flags a sector as "bad". (<BadSector>1</BadSector>) Files: /branches/Wanne/JA2 1.13 MP/Build/Strategic/Map Screen Interface Map.cpp /branches/Wanne/JA2 1.13 MP/Build/Strategic/Strategic Movement Costs.cpp /branches/Wanne/JA2 1.13 MP/Build/Strategic/mapscreen.cpp /branches/Wanne/JA2 1.13 MP/GameDir/Data/TableData/Map /branches/Wanne/JA2 1.13 MP/GameDir/Data/TableData/Map/MovementCosts.xml /branches/Wanne/JA2 1.13 MP/GameDir/Data-1.13/TableData/Map /branches/Wanne/JA2 1.13 MP/GameDir/Data-1.13/TableData/Map/MovementCosts.xml 2 (Rev. 3344) Changes: Move hardcoded underground sectors initialization to Lua script file. (by Realist) Locate "initunderground.lua" at data-xyz\scripts ("xyz" subject to change). Lua script allows easily adding underground sectors at arbitrary locations and defining enemy garrisons and creature population. Also enables underground bloodcat population. Files: /branches/Wanne/JA2 1.13 MP/Build/Strategic/Campaign Init.cpp /branches/Wanne/JA2 1.13 MP/Build/Strategic/Campaign Types.h /branches/Wanne/JA2 1.13 MP/Build/Strategic/Queen Command.cpp /branches/Wanne/JA2 1.13 MP/Build/Strategic/Strategic AI.cpp /branches/Wanne/JA2 1.13 MP/Build/Strategic/Strategic_2005Express.vcproj /branches/Wanne/JA2 1.13 MP/Build/Strategic/Strategic_VS2008.vcproj /branches/Wanne/JA2 1.13 MP/Build/Strategic/UndergroundInit.cpp /branches/Wanne/JA2 1.13 MP/Build/Strategic/UndergroundInit.h /branches/Wanne/JA2 1.13 MP/Build/Strategic/strategicmap.cpp /branches/Wanne/JA2 1.13 MP/Build/Tactical/Soldier Init List.cpp /branches/Wanne/JA2 1.13 MP/GameDir/Data/Scripts /branches/Wanne/JA2 1.13 MP/GameDir/Data/Scripts/initunderground.lua /branches/Wanne/JA2 1.13 MP/GameDir/Data-1.13/Scripts /branches/Wanne/JA2 1.13 MP/GameDir/Data-1.13/Scripts/initunderground.lua 3 (Rev. 3345) Changes: Bugfix: In Method CreateDestroyMouseRegionsForFacilityAssignmentMenu() (by Headrock) Files: /branches/Wanne/JA2 1.13 MP/Build/Strategic/Assignments.cpp 4 (Rev. 3346) Changes: Changed order of properties in GameSettings.cpp (by Headrock) HAM 3.6 fixes (by Headrock) Sorted Data-1.13\ja2_options.ini (by Headrock) Files: /branches/Wanne/JA2 1.13 MP/Build/GameSettings.cpp /branches/Wanne/JA2 1.13 MP/Build/GameSettings.h /branches/Wanne/JA2 1.13 MP/Build/Laptop/BobbyRGuns.cpp /branches/Wanne/JA2 1.13 MP/Build/Strategic/Assignments.cpp /branches/Wanne/JA2 1.13 MP/Build/Strategic/MilitiaSquads.cpp /branches/Wanne/JA2 1.13 MP/Build/Strategic/Strategic Mines.cpp /branches/Wanne/JA2 1.13 MP/Build/Strategic/Town Militia.cpp /branches/Wanne/JA2 1.13 MP/Build/Tactical/Campaign.cpp /branches/Wanne/JA2 1.13 MP/Build/Tactical/Interface Enhanced.cpp /branches/Wanne/JA2 1.13 MP/Build/Tactical/Interface Items.cpp /branches/Wanne/JA2 1.13 MP/Build/Tactical/Items.cpp /branches/Wanne/JA2 1.13 MP/Build/Tactical/Items.h /branches/Wanne/JA2 1.13 MP/Build/Tactical/Overhead.cpp /branches/Wanne/JA2 1.13 MP/Build/Tactical/Soldier Control.cpp /branches/Wanne/JA2 1.13 MP/Build/Tactical/Soldier Profile.cpp /branches/Wanne/JA2 1.13 MP/Build/Tactical/Weapons.cpp /branches/Wanne/JA2 1.13 MP/Build/TileEngine/Explosion Control.cpp /branches/Wanne/JA2 1.13 MP/GameDir/Data-1.13/Ja2_Options.INI /branches/Wanne/JA2 1.13 MP/GameDir/INIEditorJA2Options.xml 5 (Rev. 3347) Changes: Bugfix: Turns out that the program is saving the number of used Placement Slots to the temp file fine, but if that number is equal to the limit of how many enemies/civvies are allowed in a sector by the INI settings, it leads to an assertion error instead when trying to re-load that sector. (by Headrock) Re-ordered Data/Ja2_Options.INI (by Headrock) Files: /branches/Wanne/JA2 1.13 MP/Build/Tactical/Enemy Soldier Save.cpp /branches/Wanne/JA2 1.13 MP/GameDir/Data/Ja2_Options.INI 6 (Rev. 3348) Changes: Translated missing HAM 3.6 German Texts (by systemfehler) Files: /branches/Wanne/JA2 1.13 MP/Build/Utils/_GermanText.cpp 7 (Rev. 3351) Changes: PlusAI 1.0 Patch (by Headrock) Files: /branches/Wanne/JA2 1.13 MP/Build/Tactical/Points.cpp /branches/Wanne/JA2 1.13 MP/Build/Tactical/Points.h /branches/Wanne/JA2 1.13 MP/Build/TacticalAI/Attacks.cpp /branches/Wanne/JA2 1.13 MP/Build/TacticalAI/DecideAction.cpp /branches/Wanne/JA2 1.13 MP/Build/TacticalAI/FindLocations.cpp /branches/Wanne/JA2 1.13 MP/Build/TacticalAI/ai.h 8 (Rev. 3352) Changes: Bugfix: The DEBUG only setting "fEnableInventoryPoolQ" is now only enabled in a DEBUG version. In all other builds it is set to FALSE. Files: /branches/Wanne/JA2 1.13 MP/Build/GameSettings.cpp git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3354 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1447,7 +1447,8 @@ UINT8 CurrentPlayerProgressPercentage(void)
|
||||
}
|
||||
|
||||
// Add a static amount of points, as declared in the INI file.
|
||||
usCurrentProgress += gGameExternalOptions.ubGameProgressIncrement;
|
||||
// HEADROCK HAM 3.6: Allow negative modifiers!
|
||||
usCurrentProgress = __max(0, (INT16)(usCurrentProgress + gGameExternalOptions.bGameProgressModifier));
|
||||
|
||||
// And failsafes here. I'm not 100% sure about these though: I've never personally seen progress
|
||||
// values go over 100, and I don't think they SHOULD... Can the game handle values > 100? Should it?
|
||||
@@ -1457,6 +1458,7 @@ UINT8 CurrentPlayerProgressPercentage(void)
|
||||
|
||||
return((UINT8)usCurrentProgress);
|
||||
}
|
||||
|
||||
UINT8 HighestPlayerProgressPercentage(void)
|
||||
{
|
||||
if( gfEditMode )
|
||||
@@ -1465,7 +1467,6 @@ UINT8 HighestPlayerProgressPercentage(void)
|
||||
return(gStrategicStatus.ubHighestProgress);
|
||||
}
|
||||
|
||||
|
||||
// monitors the highest level of progress that player has achieved so far (checking hourly),
|
||||
// as opposed to his immediate situation (which may be worse if he's suffered a setback).
|
||||
void HourlyProgressUpdate(void)
|
||||
|
||||
@@ -822,8 +822,9 @@ BOOLEAN NewWayOfLoadingEnemySoldiersFromTempFile()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
if( slots < 0 || slots >= (int)gGameExternalOptions.ubGameMaximumNumberOfEnemies )
|
||||
// // WANNE: Fix by Headrock:
|
||||
// Turns out that the program is saving the number of used Placement Slots to the temp file fine, but if that number is equal to the limit of how many enemies/civvies are allowed in a sector by the INI settings, it leads to an assertion error instead when trying to re-load that sector.
|
||||
if( slots < 0 || slots > (int)gGameExternalOptions.ubGameMaximumNumberOfEnemies )
|
||||
{ //bad IO!
|
||||
#ifdef JA2TESTVERSION
|
||||
sprintf( zReason, "EnemySoldier -- illegal slot value of %d. KM", slots );
|
||||
@@ -1161,7 +1162,10 @@ BOOLEAN NewWayOfLoadingCiviliansFromTempFile()
|
||||
FileClose( hfile );
|
||||
return TRUE;
|
||||
}
|
||||
if( slots < 0 || slots >= (int)gGameExternalOptions.ubGameMaximumNumberOfCivilians )
|
||||
|
||||
// WANNE: Fix by Headrock:
|
||||
// Turns out that the program is saving the number of used Placement Slots to the temp file fine, but if that number is equal to the limit of how many enemies/civvies are allowed in a sector by the INI settings, it leads to an assertion error instead when trying to re-load that sector.
|
||||
if( slots < 0 || slots > (int)gGameExternalOptions.ubGameMaximumNumberOfCivilians )
|
||||
{
|
||||
//bad IO!
|
||||
#ifdef JA2TESTVERSION
|
||||
|
||||
@@ -5161,7 +5161,12 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject )
|
||||
|
||||
// print value
|
||||
SetFontForeground( 5 );
|
||||
swprintf( pStr, L"%2d", Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDamage + ( (Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDamage * gGameExternalOptions.ubExplosivesDamageMultiplier ) / 100 ));
|
||||
|
||||
// HEADROCK HAM 3.6: Can now use negative modifier.
|
||||
UINT16 explDamage = (UINT16) GetModifiedExplosiveDamage( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDamage );
|
||||
|
||||
//swprintf( pStr, L"%2d", Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDamage + ( (Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubDamage * gGameExternalOptions.ubExplosivesDamageMultiplier ) / 100 ));
|
||||
swprintf( pStr, L"%2d", explDamage );
|
||||
uiStringLength=StringPixLength(pStr, ITEMDESC_FONT );
|
||||
FindFontRightCoordinates( (INT16)(gWeaponStats[ 2 ].sX + gsInvDescX + gWeaponStats[ 2 ].sValDx), (INT16)(gWeaponStats[ 2 ].sY + gsInvDescY ), ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &sStrX, &usY);
|
||||
mprintf( sStrX, gWeaponStats[ 2 ].sY + gsInvDescY, pStr );
|
||||
@@ -5176,7 +5181,12 @@ void DrawExplosiveValues( OBJECTTYPE * gpItemDescObject )
|
||||
|
||||
// print value
|
||||
SetFontForeground( 5 );
|
||||
swprintf( pStr, L"%2d", Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubStunDamage + ( (Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubStunDamage * gGameExternalOptions.ubExplosivesDamageMultiplier ) / 100 ));
|
||||
|
||||
// HEADROCK HAM 3.6: Can now use negative modifier.
|
||||
UINT16 explStunDamage = (UINT16) GetModifiedExplosiveDamage( Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubStunDamage );
|
||||
|
||||
//swprintf( pStr, L"%2d", Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubStunDamage + ( (Explosive[Item[ gpItemDescObject->usItem ].ubClassIndex ].ubStunDamage * gGameExternalOptions.ubExplosivesDamageMultiplier ) / 100 ));
|
||||
swprintf( pStr, L"%2d", explStunDamage );
|
||||
uiStringLength=StringPixLength(pStr, ITEMDESC_FONT );
|
||||
FindFontRightCoordinates( (INT16)(gWeaponStats[ 3 ].sX + gsInvDescX + gWeaponStats[ 3 ].sValDx), (INT16)(gWeaponStats[ 3 ].sY + gsInvDescY ), ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &sStrX, &usY);
|
||||
mprintf( sStrX, gWeaponStats[ 3 ].sY + gsInvDescY, pStr );
|
||||
|
||||
@@ -8528,8 +8528,11 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
case IC_BOMB:
|
||||
// explosives
|
||||
{
|
||||
UINT16 explDamage = (UINT16)( Explosive[Item[ usItem ].ubClassIndex].ubDamage + ( (double) Explosive[Item[ usItem ].ubClassIndex].ubDamage / 100) * gGameExternalOptions.ubExplosivesDamageMultiplier );
|
||||
UINT16 explStunDamage = (UINT16)( Explosive[Item[ usItem ].ubClassIndex].ubStunDamage + ( (double) Explosive[Item[ usItem ].ubClassIndex].ubStunDamage / 100) * gGameExternalOptions.ubExplosivesDamageMultiplier );
|
||||
// HEADROCK HAM 3.6: Can now use negative modifier.
|
||||
//UINT16 explDamage = (UINT16)( Explosive[Item[ usItem ].ubClassIndex].ubDamage + ( (double) Explosive[Item[ usItem ].ubClassIndex].ubDamage / 100) * gGameExternalOptions.ubExplosivesDamageMultiplier );
|
||||
//UINT16 explStunDamage = (UINT16)( Explosive[Item[ usItem ].ubClassIndex].ubStunDamage + ( (double) Explosive[Item[ usItem ].ubClassIndex].ubStunDamage / 100) * gGameExternalOptions.ubExplosivesDamageMultiplier );
|
||||
UINT16 explDamage = (UINT16) GetModifiedExplosiveDamage( Explosive[Item[ usItem ].ubClassIndex].ubDamage );
|
||||
UINT16 explStunDamage = (UINT16) GetModifiedExplosiveDamage( Explosive[Item[ usItem ].ubClassIndex].ubStunDamage );
|
||||
|
||||
#ifdef CHINESE
|
||||
swprintf( pStr, ChineseSpecString5,
|
||||
|
||||
@@ -8967,3 +8967,33 @@ INT8 FindBackpackOnSoldier( SOLDIERTYPE * pSoldier )
|
||||
}
|
||||
return( ITEM_NOT_FOUND );
|
||||
}
|
||||
|
||||
// HEADROCK HAM 3.6: This applies the INI modifier to explosives
|
||||
UINT8 GetModifiedExplosiveDamage( UINT16 sDamage )
|
||||
{
|
||||
sDamage = (INT16)(( sDamage * gGameExternalOptions.iExplosivesDamageModifier ) / 100);
|
||||
sDamage = __max(1, sDamage);
|
||||
sDamage = __min(255, sDamage);
|
||||
|
||||
return (UINT8)sDamage;
|
||||
}
|
||||
|
||||
UINT8 GetModifiedMeleeDamage( UINT16 sDamage )
|
||||
{
|
||||
sDamage = (INT16)(( sDamage * gGameExternalOptions.iMeleeDamageModifier ) / 100);
|
||||
sDamage = __max(1, sDamage);
|
||||
sDamage = __min(255, sDamage);
|
||||
|
||||
return (UINT8)sDamage;
|
||||
}
|
||||
|
||||
UINT8 GetModifiedGunDamage( UINT16 sDamage )
|
||||
{
|
||||
sDamage = (INT16)(( sDamage * gGameExternalOptions.iGunDamageModifier ) / 100);
|
||||
sDamage = __max(1, sDamage);
|
||||
sDamage = __min(255, sDamage);
|
||||
|
||||
return (UINT8)sDamage;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -346,6 +346,11 @@ INT16 GetSnowCamoBonus( OBJECTTYPE * pObj );
|
||||
// HEADROCK HAM 3.6: Looks for a backpack anywhere on this character.
|
||||
INT8 FindBackpackOnSoldier( SOLDIERTYPE * pSoldier );
|
||||
|
||||
// HEADROCK HAM 3.6: Handler functions to get modified damage with INI parameter.
|
||||
UINT8 GetModifiedExplosiveDamage( UINT16 ubDamage );
|
||||
UINT8 GetModifiedMeleeDamage( UINT16 ubDamage );
|
||||
UINT8 GetModifiedGunDamage( UINT16 ubDamage );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -7281,6 +7281,14 @@ INT8 CalcSuppressionTolerance( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
bTolerance += pSoldier->bTilesMoved / gGameExternalOptions.ubTilesMovedPerBonusTolerancePoint;
|
||||
}
|
||||
// HEADROCK HAM 3.6: This value has moved here. It reduces tolerance if the character is massively shocked.
|
||||
if (gGameExternalOptions.ubCowerEffectOnSuppression != 0)
|
||||
{
|
||||
if (pSoldier->aiData.bShock > bTolerance)
|
||||
{
|
||||
bTolerance -= gGameExternalOptions.ubCowerEffectOnSuppression;
|
||||
}
|
||||
}
|
||||
|
||||
bTolerance = __max(bTolerance, gGameExternalOptions.ubSuppressionToleranceMin);
|
||||
bTolerance = __min(bTolerance, gGameExternalOptions.ubSuppressionToleranceMax);
|
||||
@@ -7428,11 +7436,6 @@ void HandleSuppressionFire( UINT8 ubTargetedMerc, UINT8 ubCausedAttacker )
|
||||
{
|
||||
fCower = true;
|
||||
|
||||
// If cowering, increase suppression effectiveness by external percentage. If the setting is
|
||||
// over 100%, then the condition of cowering makes the character even MORE susceptible to suppression.
|
||||
if (gGameExternalOptions.usCowerEffectOnSuppression > 0)
|
||||
ubPointsLost = (ubPointsLost * gGameExternalOptions.usCowerEffectOnSuppression) / 100;
|
||||
|
||||
// If soldier is visible on-screen, report to player that they are cowering.
|
||||
if ( pSoldier->bVisible != -1 )
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113HAMMessage[0], pSoldier->name );
|
||||
|
||||
@@ -2646,3 +2646,96 @@ INT16 GetAPsToJumpOver( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
return( GetAPsToChangeStance( pSoldier, ANIM_STAND ) + APBPConstants[AP_JUMP_OVER] );
|
||||
}
|
||||
|
||||
// HEADROCK HAM 3.6: Calculate the actual AP cost to add this many Extra Aiming levels, taking into account
|
||||
// APBP Constants and extra game features.
|
||||
INT32 CalcAPCostForAiming( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, INT8 bAimTime )
|
||||
{
|
||||
INT16 sAPCost = 0;
|
||||
UINT16 usItemNum = pSoldier->inv[HANDPOS].usItem;
|
||||
|
||||
Assert(pSoldier != NULL);
|
||||
Assert(&pSoldier->inv[HANDPOS] != NULL);
|
||||
|
||||
if (gGameExternalOptions.fIncreasedAimingCost )
|
||||
{
|
||||
// HEADROCK HAM B2.6: Changed the number of APs to attack when aiming.
|
||||
// HEADROCK HAM 3.1: Externalized the entire function to allow customization of each detail.
|
||||
if (bAimTime > 0)
|
||||
{
|
||||
// HEADROCK HAM 3: One-time penalty: Add part of the weapon's Ready AP cost. Reinstated because
|
||||
// it's now externalized.
|
||||
if (gGameExternalOptions.ubFirstAimReadyCostDivisor > 0)
|
||||
{
|
||||
UINT16 usWeaponReadyTime;
|
||||
UINT8 ubReadyTimeDivisor;
|
||||
|
||||
usWeaponReadyTime = Weapon[ usItemNum ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction(&pSoldier->inv[HANDPOS])) / 100;
|
||||
ubReadyTimeDivisor = gGameExternalOptions.ubFirstAimReadyCostDivisor;
|
||||
sAPCost += usWeaponReadyTime / ubReadyTimeDivisor;
|
||||
}
|
||||
|
||||
// If the weapon has a scope, and the target is within eligible range for scope use
|
||||
|
||||
if ( IsScoped(&pSoldier->inv[HANDPOS])
|
||||
&& GetRangeInCellCoordsFromGridNoDiff( pSoldier->sGridNo, sTargetGridNo ) >= GetMinRangeForAimBonus(&pSoldier->inv[HANDPOS]) )
|
||||
{
|
||||
// Add an individual cost for EACH click, as necessary.
|
||||
|
||||
sAPCost += APBPConstants[AP_FIRST_CLICK_AIM_SCOPE];
|
||||
|
||||
if (bAimTime > 1)
|
||||
sAPCost += APBPConstants[AP_SECOND_CLICK_AIM_SCOPE];
|
||||
if (bAimTime > 2)
|
||||
sAPCost += APBPConstants[AP_THIRD_CLICK_AIM_SCOPE];
|
||||
if (bAimTime > 3)
|
||||
sAPCost += APBPConstants[AP_FOURTH_CLICK_AIM_SCOPE];
|
||||
if (bAimTime > 4)
|
||||
sAPCost += APBPConstants[AP_FIFTH_CLICK_AIM_SCOPE];
|
||||
if (bAimTime > 5)
|
||||
sAPCost += APBPConstants[AP_SIXTH_CLICK_AIM_SCOPE];
|
||||
if (bAimTime > 6)
|
||||
sAPCost += APBPConstants[AP_SEVENTH_CLICK_AIM_SCOPE];
|
||||
if (bAimTime > 7)
|
||||
sAPCost += APBPConstants[AP_EIGHTTH_CLICK_AIM_SCOPE];
|
||||
}
|
||||
|
||||
// Weapon has no scope or not within requried range. Apply regular AP costs.
|
||||
else
|
||||
{
|
||||
sAPCost += bAimTime * APBPConstants[AP_CLICK_AIM];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
|
||||
// Regular cost system
|
||||
else
|
||||
{
|
||||
sAPCost += bAimTime * APBPConstants[AP_CLICK_AIM];
|
||||
}
|
||||
|
||||
return sAPCost;
|
||||
}
|
||||
|
||||
// HEADROCK HAM 3.6: Calculate how many Aiming Levels we can get with a given amount of APs.
|
||||
INT8 CalcAimingLevelsAvailableWithAP( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, INT8 bAPsLeft )
|
||||
{
|
||||
INT8 bAllowedLevels = 0;
|
||||
|
||||
for (INT16 x = APBPConstants[AP_MIN_AIM_ATTACK]; x <= AllowedAimingLevels(pSoldier); x++)
|
||||
{
|
||||
if (CalcAPCostForAiming( pSoldier, sTargetGridNo, x ) <= (INT16)bAPsLeft)
|
||||
{
|
||||
bAllowedLevels = x;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (bAllowedLevels);
|
||||
}
|
||||
|
||||
@@ -347,5 +347,7 @@ UINT16 GetAPsToReloadRobot( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pRobot );
|
||||
INT16 GetAPsToReloadGunWithAmmo( SOLDIERTYPE *pSoldier, OBJECTTYPE * pGun, OBJECTTYPE * pAmmo, BOOLEAN usAllAPs = TRUE );
|
||||
INT16 GetAPsToAutoReload( SOLDIERTYPE * pSoldier );
|
||||
|
||||
INT32 CalcAPCostForAiming( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, INT8 bAimTime );
|
||||
INT8 CalcAimingLevelsAvailableWithAP( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, INT8 bAPsLeft );
|
||||
|
||||
#endif
|
||||
|
||||
@@ -7611,23 +7611,23 @@ void CalculateSoldierAniSpeed( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pStatsSoldier
|
||||
|
||||
}
|
||||
|
||||
UINT8 GetSpeedUpFactor( )
|
||||
FLOAT GetSpeedUpFactor( )
|
||||
{
|
||||
switch( gTacticalStatus.ubCurrentTeam )
|
||||
{
|
||||
case OUR_TEAM:
|
||||
return gGameExternalOptions.gubPlayerTurnSpeedUpFactor;
|
||||
return gGameExternalOptions.giPlayerTurnSpeedUpFactor;
|
||||
case ENEMY_TEAM:
|
||||
return gGameExternalOptions.gubEnemyTurnSpeedUpFactor;
|
||||
return gGameExternalOptions.giEnemyTurnSpeedUpFactor;
|
||||
case CREATURE_TEAM:
|
||||
return gGameExternalOptions.gubCreatureTurnSpeedUpFactor;
|
||||
return gGameExternalOptions.giCreatureTurnSpeedUpFactor;
|
||||
case MILITIA_TEAM:
|
||||
return gGameExternalOptions.gubMilitiaTurnSpeedUpFactor;
|
||||
return gGameExternalOptions.giMilitiaTurnSpeedUpFactor;
|
||||
case CIV_TEAM:
|
||||
return gGameExternalOptions.gubCivilianTurnSpeedUpFactor;
|
||||
return gGameExternalOptions.giCivilianTurnSpeedUpFactor;
|
||||
}
|
||||
|
||||
return 1;
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
void SetSoldierAniSpeed( SOLDIERTYPE *pSoldier )
|
||||
@@ -7681,7 +7681,7 @@ void SetSoldierAniSpeed( SOLDIERTYPE *pSoldier )
|
||||
|
||||
if ( gTacticalStatus.uiFlags & TURNBASED && gTacticalStatus.uiFlags & INCOMBAT )
|
||||
if( GetSpeedUpFactor() )
|
||||
pSoldier->sAniDelay /= GetSpeedUpFactor();
|
||||
pSoldier->sAniDelay = (INT16)((FLOAT)pSoldier->sAniDelay * GetSpeedUpFactor());
|
||||
else
|
||||
pSoldier->sAniDelay = 0;
|
||||
}
|
||||
|
||||
@@ -50,8 +50,9 @@
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
#include "Map Edgepoints.h"
|
||||
#include "Queen Command.h"
|
||||
|
||||
BOOLEAN gfOriginalList = TRUE;
|
||||
|
||||
SOLDIERINITNODE *gSoldierInitHead = NULL;
|
||||
@@ -1942,16 +1943,30 @@ void AddSoldierInitListBloodcats()
|
||||
{
|
||||
SECTORINFO *pSector;
|
||||
SOLDIERINITNODE *curr;
|
||||
UINT8 ubSectorID;
|
||||
UINT8 ubSectorID = 0;
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("AddSoldierInitListBloodcats"));
|
||||
|
||||
SECTORINFO dummy;
|
||||
|
||||
if( gbWorldSectorZ )
|
||||
{
|
||||
return; //no bloodcats underground.
|
||||
}
|
||||
// This function can only cope with regular SECTORINFO objects.
|
||||
// So let's fake a sector above ground and copy over data from UNDERGROUND_SECTORINFO.
|
||||
UNDERGROUND_SECTORINFO *pUndergroundSector
|
||||
= FindUnderGroundSector(gWorldSectorX, gWorldSectorY, gbWorldSectorZ);
|
||||
|
||||
ubSectorID = (UINT8)SECTOR( gWorldSectorX, gWorldSectorY );
|
||||
pSector = &SectorInfo[ ubSectorID ];
|
||||
if (!pUndergroundSector)
|
||||
return;
|
||||
|
||||
pSector = &dummy;
|
||||
pSector->bBloodCats = pUndergroundSector->ubNumBloodcats;
|
||||
pSector->bBloodCatPlacements = pUndergroundSector->ubNumBloodcats;
|
||||
}
|
||||
else
|
||||
{
|
||||
ubSectorID = (UINT8)SECTOR( gWorldSectorX, gWorldSectorY );
|
||||
pSector = &SectorInfo[ ubSectorID ];
|
||||
}
|
||||
|
||||
if( !pSector->bBloodCatPlacements )
|
||||
{ //This map has no bloodcat placements, so don't waste CPU time.
|
||||
|
||||
@@ -246,7 +246,7 @@ BOOLEAN LoadMercProfiles(void)
|
||||
UINT32 uiLoop, uiLoop2;//, uiLoop3;
|
||||
UINT16 usItem;//, usNewGun, usAmmo, usNewAmmo;
|
||||
|
||||
if (gGameExternalOptions.fAlwaysUseProfDat == FALSE)
|
||||
if (gGameExternalOptions.fUseDifficultyBasedProfDat == TRUE)
|
||||
{
|
||||
switch ( gGameOptions.ubDifficultyLevel)
|
||||
{
|
||||
|
||||
+11
-5
@@ -4976,7 +4976,7 @@ INT32 BulletImpact( SOLDIERTYPE *pFirer, SOLDIERTYPE * pTarget, UINT8 ubHitLocat
|
||||
// HEADROCK HAM 3.2: Critical headshots may now cause blindness, based on shot damage.
|
||||
if (gGameExternalOptions.ubChanceBlindedByHeadshot)
|
||||
{
|
||||
if (PreRandom(gGameExternalOptions.ubChanceBlindedByHeadshot) == 0)
|
||||
if (__min(100,(PreRandom(100)+1 + iImpact)) <= gGameExternalOptions.ubChanceBlindedByHeadshot)
|
||||
{
|
||||
if (pTarget->bBlindedCounter < iImpact / 10 )
|
||||
pTarget->bBlindedCounter = iImpact / 10;
|
||||
@@ -6181,17 +6181,23 @@ UINT8 GetDamage ( OBJECTTYPE *pObj )
|
||||
|
||||
if ( Item[pObj->usItem].usItemClass == IC_BLADE || Item[pObj->usItem].usItemClass == IC_PUNCH || Item[pObj->usItem].usItemClass == IC_TENTACLES )
|
||||
{
|
||||
UINT8 ubDamage = Weapon[ pObj->usItem ].ubImpact + GetMeleeDamageBonus(pObj);
|
||||
return min(255, (UINT8)( (ubDamage) + ( (double)ubDamage / 100) * gGameExternalOptions.ubMeleeDamageMultiplier ) );
|
||||
// HEADROCK HAM 3.6: Can now take a negative modifier
|
||||
UINT8 ubDamage = (UINT8)GetModifiedMeleeDamage( Weapon[ pObj->usItem ].ubImpact );
|
||||
ubDamage += GetMeleeDamageBonus(pObj);
|
||||
//return min(255, (UINT8)( (ubDamage) + ( (double)ubDamage / 100) * gGameExternalOptions.ubMeleeDamageMultiplier ) );
|
||||
return min(255, (UINT8)ubDamage);
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 ubDamage = Weapon[ pObj->usItem ].ubImpact;
|
||||
// HEADROCK HAM 3.6: Can now take a negative modifier
|
||||
UINT8 ubDamage = (UINT8)GetModifiedMeleeDamage( Weapon[ pObj->usItem ].ubImpact );
|
||||
|
||||
// WTF? Why do only small weapons get their damage bonus?!
|
||||
if (FitsInSmallPocket(pObj) == true)
|
||||
{
|
||||
ubDamage += GetDamageBonus(pObj);
|
||||
}
|
||||
return min(255, (UINT8)( (ubDamage) + ( (double)ubDamage / 100) * gGameExternalOptions.ubGunDamageMultiplier ) );
|
||||
return min(255, (UINT8)ubDamage );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user