mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
Data and Source v1.13 Mod High Resolution version from 2006-03-16
********************************************************* * 2006/03/16 * * RoWa21 * * Developed in VS 2003 * ********************************************************* - Changed missing screens to the High-Resolution - Tactical Screen - Shopkeeper Interface, - Credits Screen, - AutoResolve Screen - ... - Some bugfixing with the screens - Centered message boxes - ... - Merged lalienxx's features (BUT NO BURST AND NO MP3/OGG SUPPORT!) - Rain and lightning visual and sound effects - Visibility radius decrease when rainig - Weapon relyability decrease when rainig - Possibility to spot the enemy at night with lightning - New settings in the ja2.ini file for the rain - Aiming without shooting with "L" key - Move the cursor over an enemy and press the "L" key. - Added judges bugfixing - Swapped internal shopkeeper character numbering to match the Prof.dat in 1.13 (Gabby/Smithy) - Added status of the items to item 'tooltip' - If it is an ammo, the number of available rounds appear - A stack of items now always shows the minimum repair status - No more carrying a stack of grenades into battle only to find most are duds - Made tactical map loading code more robust against maps with bogus buildings - Made tactical map loading code more robust against maps with characters with bogus locations or schedules - Changed the location of the savegame structure - Each mode contains its own savegame folder in its own data-folder - Some general bugfixing - See Bugfixing.xls on the ftp git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@24 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -402,14 +402,14 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
|
||||
pSoldier->fDontChargeTurningAPs = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
/*else
|
||||
{
|
||||
// If raising gun, don't charge turning!
|
||||
if ( fAddingTurningCost )
|
||||
{
|
||||
pSoldier->fDontChargeReadyAPs = TRUE;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
@@ -1301,14 +1301,14 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, UINT16 usGridNo, INT8 bLevel, UINT16 us
|
||||
pSoldier->fDontChargeTurningAPs = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
/*else
|
||||
{
|
||||
// If raising gun, don't charge turning!
|
||||
if ( fAddingTurningCost )
|
||||
{
|
||||
pSoldier->fDontChargeReadyAPs = TRUE;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
// If this is a player guy, show message about no APS
|
||||
|
||||
+61
-1
@@ -75,6 +75,13 @@
|
||||
#endif
|
||||
|
||||
|
||||
//extern BOOLEAN gfDisplayFullCountRingBurst;
|
||||
extern UINT16 PickSoldierReadyAnimation( SOLDIERTYPE *pSoldier, BOOLEAN fEndReady );
|
||||
|
||||
//#define AP_TO_AIM_TILE_IF_GETTING_READY 1
|
||||
#define AP_TO_AIM_TILE_IF_ALREADY_READY ( Weapon[ Item[pSoldier->inv[HANDPOS].usItem].ubClassIndex ].ubReadyTime ? 2 : 1 )
|
||||
#define AP_TO_AIM_TILE_IF_GETTING_READY AP_TO_AIM_TILE_IF_ALREADY_READY
|
||||
|
||||
#define MAX_ON_DUTY_SOLDIERS 6
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -4476,11 +4483,13 @@ void SetConfirmMovementModeCursor( SOLDIERTYPE *pSoldier, BOOLEAN fFromMove )
|
||||
|
||||
}
|
||||
|
||||
UINT8 gubShowActionPointsInRed = 0;
|
||||
|
||||
UINT32 UIHandleLCOnTerrain( UI_EVENT *pUIEvent )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
INT16 sFacingDir, sXPos, sYPos;
|
||||
UINT16 usAnimState;
|
||||
|
||||
guiNewUICursor = LOOK_UICURSOR;
|
||||
|
||||
@@ -4511,10 +4520,26 @@ UINT32 UIHandleLCOnTerrain( UI_EVENT *pUIEvent )
|
||||
if ( sFacingDir != pSoldier->bDirection )
|
||||
{
|
||||
gsCurrentActionPoints = GetAPsToLook( pSoldier );
|
||||
gfUIHandleShowMoveGrid = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
usAnimState = PickSoldierReadyAnimation( pSoldier, FALSE );
|
||||
|
||||
if( usAnimState != INVALID_ANIMATION )
|
||||
{
|
||||
gsCurrentActionPoints = GetAPsToReadyWeapon( pSoldier, usAnimState ) + AP_TO_AIM_TILE_IF_GETTING_READY;
|
||||
}
|
||||
else if( pSoldier->sLastTarget != sXPos + (MAXCOL * sYPos ) )
|
||||
gsCurrentActionPoints = AP_TO_AIM_TILE_IF_ALREADY_READY;
|
||||
else
|
||||
gsCurrentActionPoints = 0;
|
||||
|
||||
gfUIHandleShowMoveGrid = TRUE;
|
||||
gsUIHandleShowMoveGridLocation = sXPos + (MAXCOL * sYPos );
|
||||
|
||||
gubShowActionPointsInRed = 5;
|
||||
//gfDisplayFullCountRingBurst = FALSE;
|
||||
}
|
||||
|
||||
// Determine if we can afford!
|
||||
@@ -4538,7 +4563,8 @@ UINT32 UIHandleLCChangeToLook( UI_EVENT *pUIEvent )
|
||||
|
||||
BOOLEAN MakeSoldierTurn( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos )
|
||||
{
|
||||
INT16 sFacingDir, sAPCost;
|
||||
INT16 sFacingDir, sAPCost, sAPCostToReady;
|
||||
UINT16 usAnimState;
|
||||
|
||||
// Get direction from mouse pos
|
||||
sFacingDir = GetDirectionFromXY( sXPos, sYPos, pSoldier );
|
||||
@@ -4569,8 +4595,42 @@ BOOLEAN MakeSoldierTurn( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos )
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
usAnimState = PickSoldierReadyAnimation( pSoldier, FALSE );
|
||||
|
||||
sAPCostToReady = 0;
|
||||
|
||||
if( usAnimState != INVALID_ANIMATION )
|
||||
{
|
||||
sAPCostToReady = GetAPsToReadyWeapon( pSoldier, usAnimState );
|
||||
sAPCost = sAPCostToReady + AP_TO_AIM_TILE_IF_GETTING_READY;
|
||||
}
|
||||
else if( pSoldier->sLastTarget != sXPos + (MAXCOL * sYPos ) )
|
||||
sAPCost = AP_TO_AIM_TILE_IF_ALREADY_READY;
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
|
||||
// Check AP cost...
|
||||
if ( !EnoughPoints( pSoldier, sAPCost, 0, TRUE ) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if( usAnimState != INVALID_ANIMATION )
|
||||
SoldierReadyWeapon( pSoldier, sXPos, sYPos, FALSE );
|
||||
|
||||
pSoldier->bTurningFromUI = TRUE;
|
||||
guiOldEvent = LA_BEGINUIOURTURNLOCK;
|
||||
|
||||
// Setting "Last Target"
|
||||
|
||||
pSoldier->sLastTarget = sXPos + (MAXCOL * sYPos);
|
||||
DeductPoints( pSoldier, (INT16)(sAPCost - sAPCostToReady), 0 );
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
#include "Soldier Profile.h"
|
||||
#endif
|
||||
|
||||
//rain
|
||||
#define BREATH_GAIN_REDUCTION_PER_RAIN_INTENSITY 25
|
||||
//end rain
|
||||
|
||||
extern BOOLEAN IsValidSecondHandShot( SOLDIERTYPE *pSoldier );
|
||||
|
||||
|
||||
@@ -770,6 +774,10 @@ void UnusedAPsToBreath(SOLDIERTYPE *pSold)
|
||||
}
|
||||
|
||||
|
||||
//rain
|
||||
extern INT8 gbCurrentRainIntensity;
|
||||
//end rain
|
||||
|
||||
INT16 GetBreathPerAP( SOLDIERTYPE *pSoldier, UINT16 usAnimState )
|
||||
{
|
||||
INT16 sBreathPerAP = 0;
|
||||
@@ -844,6 +852,14 @@ INT16 GetBreathPerAP( SOLDIERTYPE *pSoldier, UINT16 usAnimState )
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("Unknown end-of-turn breath anim: %s", gAnimControl[ usAnimState ].zAnimStr ) );
|
||||
}
|
||||
|
||||
//rain
|
||||
// Reduce breath gain on 25%/rain intensity
|
||||
if( sBreathPerAP < 0 && ( pSoldier->bLevel ||!FindStructure( pSoldier->sGridNo, STRUCTURE_ROOF ) ) && pSoldier->bBreath > 1)
|
||||
{
|
||||
sBreathPerAP -= sBreathPerAP * gbCurrentRainIntensity * BREATH_GAIN_REDUCTION_PER_RAIN_INTENSITY / 100 ;
|
||||
}
|
||||
//end rain
|
||||
|
||||
return( sBreathPerAP );
|
||||
}
|
||||
|
||||
@@ -1296,6 +1312,8 @@ UINT8 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubAddTurni
|
||||
// bFullAPs are BASE APs, which do not include APs caried over from the previous turn.
|
||||
bFullAPs = CalcActionPoints( pSoldier );
|
||||
|
||||
//bFullAPs = pSoldier->bInitialActionPoints;//CalcActionPoints( pSoldier ); //lal
|
||||
|
||||
// aim skill is the same whether we are using 1 or 2 guns
|
||||
bAimSkill = CalcAimSkill( pSoldier, usItem );
|
||||
|
||||
|
||||
@@ -0,0 +1,582 @@
|
||||
// WANNE 2 <changed some lines>
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "types.h"
|
||||
#include "soldier control.h"
|
||||
#include "overhead.h"
|
||||
#include "animation control.h"
|
||||
#include "points.h"
|
||||
#include "opplist.h"
|
||||
#include "timer.h"
|
||||
#include "event pump.h"
|
||||
#include "Sound Control.h"
|
||||
#include "interface.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Font Control.H"
|
||||
#include "ai.h"
|
||||
#include "interface.h"
|
||||
#include "message.h"
|
||||
#include "text.h"
|
||||
#include "TeamTurns.h"
|
||||
#include "Smell.h"
|
||||
#include "game clock.h"
|
||||
#include "Soldier Functions.h"
|
||||
#include "cursors.h"
|
||||
#include "Queen Command.h"
|
||||
#include "Pathai.h"
|
||||
#include "Music Control.h"
|
||||
#include "Strategic Turns.h"
|
||||
#include "lighting.h"
|
||||
#include "environment.h"
|
||||
#include "Explosion Control.h"
|
||||
#include "dialogue control.h"
|
||||
#include "Soldier Profile Type.h"
|
||||
#include "SmokeEffects.h"
|
||||
#include "lighteffects.h"
|
||||
#include "air raid.h"
|
||||
#include "meanwhile.h"
|
||||
#include "SkillCheck.h"
|
||||
#include "AIInternals.h"
|
||||
#include "AIList.h"
|
||||
#ifdef DEBUG_INTERRUPTS
|
||||
#include "debug.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "Rain.h"
|
||||
|
||||
// WANNE 2
|
||||
// Shop Keeper Interface
|
||||
#define SKI_X_OFFSET (((SCREEN_WIDTH - 536) / 2))
|
||||
#define SKI_Y_OFFSET ((((SCREEN_HEIGHT - 140) - 340) / 2))
|
||||
|
||||
// WANNE 2
|
||||
// Overhead Map
|
||||
#define OM_X_OFFSET 0
|
||||
#define OM_Y_OFFSET 0
|
||||
|
||||
|
||||
|
||||
|
||||
#define RAIN_UPDATE_RATE 60
|
||||
#define PERCENT_OF_DROPS_GOING_TO_THE_EDGE_OF_SCREEN 0.25f
|
||||
|
||||
#define DROP_ANGLE_CHANGE_RATE 1.0f
|
||||
|
||||
#define MIN_DROP_LENGTH 2.0f
|
||||
#define ADD_DROP_LENGTH_IF_STORM 2.0f
|
||||
#define DROP_LENGTH_RANGE 2.0f
|
||||
#define DROP_LENGTH_CHANGE_RATE 0.1f
|
||||
#define DROP_LENGTH_RAND 2.0f
|
||||
|
||||
#define BASE_DROP_SPEED 7.0f
|
||||
#define DROP_SPEED_RANGE 3.5f
|
||||
#define DROP_SPEED_CHANGE_RATE 0.1f
|
||||
#define DROP_SPEED_RAND 5.0f
|
||||
|
||||
UINT32 guiMaxRainDrops = 79;
|
||||
|
||||
#define RESOLUTION_FACTOR_ON_MAXIMUM_DROPS ((FLOAT) ( SCREEN_WIDTH * SCREEN_HEIGHT ) / ((FLOAT) 640 * 480 ) )
|
||||
#define BASE_MAXIMUM_DROPS guiMaxRainDrops * RESOLUTION_FACTOR_ON_MAXIMUM_DROPS
|
||||
|
||||
#define DEGREE(a) ( 3.14159 / 180 * a )
|
||||
|
||||
typedef struct
|
||||
{
|
||||
BOOLEAN fAlive;
|
||||
|
||||
FLOAT fpX;
|
||||
FLOAT fpY;
|
||||
FLOAT fpIncrX;
|
||||
FLOAT fpIncrY;
|
||||
|
||||
FLOAT fpEndRelX;
|
||||
FLOAT fpEndRelY;
|
||||
|
||||
UINT32 uiAmountOfTicksToLive;
|
||||
}TRainDrop;
|
||||
|
||||
|
||||
static BOOLEAN fFirstTime = TRUE;
|
||||
UINT32 guiRainRenderSurface = 0;
|
||||
UINT32 guiLastRainUpdate = 0;
|
||||
RECT gRainRegion;
|
||||
|
||||
TRainDrop *pRainDrops = 0;
|
||||
UINT32 guiCurrMaxAmountOfRainDrops = 0;
|
||||
UINT32 guiCurrAmountOfDeadRainDrops = 0;
|
||||
|
||||
INT8 gbCurrentRainIntensity = 0;
|
||||
|
||||
FLOAT fpCurrDropAngleOfFalling = 0;
|
||||
FLOAT fpCurrDropLength = 0;
|
||||
FLOAT fpCurrDropSpeed = 0;
|
||||
|
||||
FLOAT fpMaxDropAngleOfFalling = 0;
|
||||
FLOAT fpMaxDropLength = 0;
|
||||
FLOAT fpMaxDropSpeed = 0;
|
||||
|
||||
FLOAT fpMinDropAngleOfFalling = 0;
|
||||
FLOAT fpMinDropLength = 0;
|
||||
FLOAT fpMinDropSpeed = 0;
|
||||
|
||||
|
||||
extern UINT32 guiCurrentScreen;
|
||||
extern BOOLEAN gfAllowRain;
|
||||
|
||||
extern INT16 gsVIEWPORT_WINDOW_END_Y;
|
||||
extern INT16 gsVIEWPORT_WINDOW_START_Y;
|
||||
|
||||
#define VIDEO_OVERLAYS 100
|
||||
extern VIDEO_OVERLAY gVideoOverlays[ VIDEO_OVERLAYS ];
|
||||
extern UINT32 guiNumVideoOverlays;
|
||||
|
||||
extern MercPopUpBox *gPopUpTextBox;
|
||||
|
||||
INT8 GetRainIntensityFromEnvWeather()
|
||||
{
|
||||
INT8 bRes = 0;
|
||||
|
||||
// Debug!!!
|
||||
// guiEnvWeather |= WEATHER_FORECAST_THUNDERSHOWERS;
|
||||
|
||||
if( guiEnvWeather & WEATHER_FORECAST_SHOWERS ) bRes += 1;
|
||||
if( guiEnvWeather & WEATHER_FORECAST_THUNDERSHOWERS ) bRes += 2;
|
||||
|
||||
return bRes;
|
||||
}
|
||||
|
||||
BOOLEAN IsItAllowedToRenderRain()
|
||||
{
|
||||
if( !gfAllowRain )return FALSE;
|
||||
|
||||
if( !( guiEnvWeather & WEATHER_FORECAST_THUNDERSHOWERS | WEATHER_FORECAST_SHOWERS ) )return FALSE;
|
||||
|
||||
if( guiCurrentScreen != GAME_SCREEN && guiCurrentScreen != SHOPKEEPER_SCREEN ) return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void InitializeRainVideoObject( )
|
||||
{
|
||||
VSURFACE_DESC vs_desc;
|
||||
UINT16 usWidth;
|
||||
UINT16 usHeight;
|
||||
UINT8 ubBitDepth;
|
||||
|
||||
// Create render buffer
|
||||
GetCurrentVideoSettings( &usWidth, &usHeight, &ubBitDepth );
|
||||
vs_desc.fCreateFlags = VSURFACE_CREATE_DEFAULT | VSURFACE_SYSTEM_MEM_USAGE;
|
||||
vs_desc.usWidth = usWidth;
|
||||
vs_desc.usHeight = usHeight;
|
||||
vs_desc.ubBitDepth = ubBitDepth;
|
||||
|
||||
AddVideoSurface( &vs_desc, &guiRainRenderSurface );
|
||||
}
|
||||
|
||||
void InitializeRainData()
|
||||
{
|
||||
InitializeRainVideoObject();
|
||||
|
||||
gRainRegion.left = 0;
|
||||
gRainRegion.top = 0;
|
||||
gRainRegion.right = SCREEN_WIDTH;
|
||||
gRainRegion.bottom = SCREEN_HEIGHT - 120;
|
||||
}
|
||||
|
||||
void ResetRain()
|
||||
{
|
||||
if( pRainDrops )
|
||||
{
|
||||
MemFree( pRainDrops );
|
||||
pRainDrops = NULL;
|
||||
}
|
||||
|
||||
guiCurrMaxAmountOfRainDrops = 0;
|
||||
}
|
||||
|
||||
void GenerateRainDropsList()
|
||||
{
|
||||
guiCurrMaxAmountOfRainDrops = (UINT32)BASE_MAXIMUM_DROPS * gbCurrentRainIntensity;
|
||||
|
||||
pRainDrops = (TRainDrop *)MemAlloc( sizeof( TRainDrop ) * guiCurrMaxAmountOfRainDrops );
|
||||
memset( pRainDrops, 0, sizeof( TRainDrop ) * guiCurrMaxAmountOfRainDrops );
|
||||
}
|
||||
|
||||
void KillOutOfRegionRainDrops()
|
||||
{
|
||||
UINT32 uiIndex;
|
||||
|
||||
for( uiIndex = 0; uiIndex < guiCurrMaxAmountOfRainDrops; ++uiIndex )
|
||||
{
|
||||
TRainDrop *pCurr = &pRainDrops[ uiIndex ];
|
||||
|
||||
if( ( pCurr->fpX < gRainRegion.left || pCurr->fpX >= gRainRegion.right ||
|
||||
pCurr->fpY < gRainRegion.top || pCurr->fpY >= gRainRegion.bottom ) &&
|
||||
( pCurr->fpX + pCurr->fpEndRelX < gRainRegion.left || pCurr->fpX + pCurr->fpEndRelX >= gRainRegion.right ||
|
||||
pCurr->fpY + pCurr->fpEndRelY < gRainRegion.top || pCurr->fpY + pCurr->fpEndRelY >= gRainRegion.bottom ) )
|
||||
{
|
||||
pCurr->fAlive = FALSE;
|
||||
guiCurrAmountOfDeadRainDrops++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void CreateRainDrops()
|
||||
{
|
||||
UINT32 uiIndex;
|
||||
UINT32 uiCreatedDrops = 0;
|
||||
FLOAT fpCos, fpSin, fpAbsTg;
|
||||
FLOAT fpDropLength = fpCurrDropLength;
|
||||
FLOAT fpDropSpeed = fpCurrDropSpeed;
|
||||
FLOAT fpNumDropsToXBorder = 0;
|
||||
BOOLEAN fLoopIsDone;
|
||||
UINT32 uiIndRand;
|
||||
|
||||
fpCos = cos( DEGREE(fpCurrDropAngleOfFalling) );
|
||||
fpSin = sin( DEGREE(fpCurrDropAngleOfFalling) );
|
||||
|
||||
if( fpCos )
|
||||
fpAbsTg = fabs( fpSin / fpCos ); // take only absolute valuse
|
||||
else
|
||||
fpAbsTg = 0; // well, it can't really be ;)
|
||||
|
||||
for( uiIndex = 0; uiIndex < guiCurrMaxAmountOfRainDrops; ++uiIndex )
|
||||
{
|
||||
TRainDrop *pCurr = &pRainDrops[ uiIndex ];
|
||||
|
||||
if( pCurr->fAlive )continue;
|
||||
|
||||
uiIndRand = (((UINT32)pCurr) / sizeof(TRainDrop) ) % 20;
|
||||
|
||||
fpDropLength = fpCurrDropLength + ( (((UINT32)pCurr) / sizeof(TRainDrop) ) % 7 ) * DROP_LENGTH_RAND / 6;
|
||||
fpDropSpeed = fpCurrDropSpeed + ( ( ((UINT32)pCurr) / sizeof(TRainDrop) + 43 ) % 13 ) * DROP_SPEED_RAND / 12;
|
||||
|
||||
pCurr->fAlive = TRUE;
|
||||
|
||||
pCurr->fpIncrX = fpCos * fpDropSpeed;
|
||||
pCurr->fpIncrY = fpSin * fpDropSpeed;
|
||||
|
||||
pCurr->fpEndRelX = -fpCos * fpDropLength;
|
||||
pCurr->fpEndRelY = -fpSin * fpDropLength;
|
||||
|
||||
// where we want the drops to fall
|
||||
|
||||
if( uiIndex < guiCurrMaxAmountOfRainDrops * PERCENT_OF_DROPS_GOING_TO_THE_EDGE_OF_SCREEN )
|
||||
{
|
||||
if( !fpCos )
|
||||
fpNumDropsToXBorder = 0;
|
||||
else
|
||||
{
|
||||
if( fpAbsTg < 1 )
|
||||
{
|
||||
fpNumDropsToXBorder = 1.0f - fpAbsTg;
|
||||
fpNumDropsToXBorder *= (((FLOAT)SCREEN_HEIGHT - 120) / (FLOAT)SCREEN_WIDTH);
|
||||
fpNumDropsToXBorder *= guiCurrMaxAmountOfRainDrops * PERCENT_OF_DROPS_GOING_TO_THE_EDGE_OF_SCREEN / 2;
|
||||
|
||||
fpNumDropsToXBorder += guiCurrMaxAmountOfRainDrops * PERCENT_OF_DROPS_GOING_TO_THE_EDGE_OF_SCREEN / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
fpNumDropsToXBorder = 1 / fpAbsTg;
|
||||
fpNumDropsToXBorder *= (((FLOAT)SCREEN_HEIGHT - 120) / (FLOAT)SCREEN_WIDTH);
|
||||
fpNumDropsToXBorder *= guiCurrMaxAmountOfRainDrops * PERCENT_OF_DROPS_GOING_TO_THE_EDGE_OF_SCREEN / 2;
|
||||
}
|
||||
}
|
||||
|
||||
if( uiIndex >= fpNumDropsToXBorder )
|
||||
{
|
||||
pCurr->fpX = gRainRegion.left + Random( gRainRegion.right - gRainRegion.left );
|
||||
pCurr->fpY = gRainRegion.bottom - 1;
|
||||
}
|
||||
else if( fpCos > 0 )
|
||||
{
|
||||
pCurr->fpX = gRainRegion.right - 1;
|
||||
pCurr->fpY = gRainRegion.top + Random( gRainRegion.bottom - gRainRegion.top );
|
||||
}else{
|
||||
pCurr->fpX = 0;
|
||||
pCurr->fpY = gRainRegion.top + Random( gRainRegion.bottom - gRainRegion.top );
|
||||
}
|
||||
}else{
|
||||
pCurr->fpX = gRainRegion.left + Random( gRainRegion.right - gRainRegion.left );
|
||||
pCurr->fpY = gRainRegion.top + Random( gRainRegion.bottom - gRainRegion.top );
|
||||
}
|
||||
|
||||
pCurr->uiAmountOfTicksToLive = 0;
|
||||
fLoopIsDone = FALSE;
|
||||
|
||||
while( !fLoopIsDone )
|
||||
{
|
||||
pCurr->fpX -= pCurr->fpIncrX;
|
||||
pCurr->fpY -= pCurr->fpIncrY;
|
||||
pCurr->uiAmountOfTicksToLive++;
|
||||
|
||||
if( pCurr->fpX >= gRainRegion.right - 1 )
|
||||
{
|
||||
pCurr->fpX = gRainRegion.right - 1 - uiIndRand * pCurr->fpIncrX / 20 ;
|
||||
fLoopIsDone = TRUE;
|
||||
}
|
||||
if( pCurr->fpX < gRainRegion.left )
|
||||
{
|
||||
pCurr->fpX = gRainRegion.left - uiIndRand * pCurr->fpIncrX / 20 ;
|
||||
fLoopIsDone = TRUE;
|
||||
}
|
||||
if( pCurr->fpY >= gRainRegion.bottom - 1 )
|
||||
{
|
||||
pCurr->fpY = gRainRegion.bottom - 1 - uiIndRand * pCurr->fpIncrX / 20 ;
|
||||
fLoopIsDone = TRUE;
|
||||
}
|
||||
if( pCurr->fpY < gRainRegion.top )
|
||||
{
|
||||
pCurr->fpY = gRainRegion.top - uiIndRand * pCurr->fpIncrX / 20 ;
|
||||
fLoopIsDone = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
uiCreatedDrops++;
|
||||
|
||||
// drop creation is done!!!
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateRainDrops()
|
||||
{
|
||||
UINT32 uiIndex;
|
||||
|
||||
for( uiIndex = 0; uiIndex < guiCurrMaxAmountOfRainDrops; ++uiIndex )
|
||||
{
|
||||
TRainDrop *pCurr = &pRainDrops[ uiIndex ];
|
||||
|
||||
if( !pCurr->fAlive )continue;
|
||||
|
||||
if( pCurr->uiAmountOfTicksToLive )
|
||||
{
|
||||
pCurr->fpX += pCurr->fpIncrX;
|
||||
pCurr->fpY += pCurr->fpIncrY;
|
||||
pCurr->uiAmountOfTicksToLive--;
|
||||
}else{
|
||||
pCurr->fpEndRelX += pCurr->fpIncrX;
|
||||
pCurr->fpEndRelY += pCurr->fpIncrY;
|
||||
|
||||
if( ( pCurr->fpEndRelX > 0 && pCurr->fpIncrX > 0 ) ||
|
||||
( pCurr->fpEndRelX < 0 && pCurr->fpIncrX < 0 ) ||
|
||||
( pCurr->fpEndRelY > 0 && pCurr->fpIncrY > 0 ) ||
|
||||
( pCurr->fpEndRelY < 0 && pCurr->fpIncrY < 0 ) )
|
||||
{
|
||||
pCurr->fAlive = FALSE;
|
||||
guiCurrAmountOfDeadRainDrops++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void BlankRainRenderSurface()
|
||||
{
|
||||
ColorFillVideoSurfaceArea( guiRainRenderSurface, gRainRegion.left, gRainRegion.top, gRainRegion.right, gRainRegion.bottom, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
||||
}
|
||||
|
||||
UINT16 GetDropColor()
|
||||
{
|
||||
UINT32 uiRGBPart = 32 + ( 15 - GetTimeOfDayAmbientLightLevel() ) * 8;
|
||||
|
||||
uiRGBPart = max( 0, uiRGBPart );
|
||||
uiRGBPart = min( 255, uiRGBPart );
|
||||
|
||||
return Get16BPPColor( FROMRGB( uiRGBPart, uiRGBPart, uiRGBPart ) );
|
||||
}
|
||||
|
||||
void RenderRainOnSurface()
|
||||
{
|
||||
UINT8 *pDestBuf;
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT32 uiIndex;
|
||||
UINT16 sDropsColor = GetDropColor();
|
||||
|
||||
pDestBuf = LockVideoSurface( guiRainRenderSurface, &uiDestPitchBYTES );
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, gsVIEWPORT_WINDOW_START_Y, SCREEN_WIDTH, gsVIEWPORT_WINDOW_END_Y - gsVIEWPORT_WINDOW_START_Y );
|
||||
|
||||
for( uiIndex = 0; uiIndex < guiCurrMaxAmountOfRainDrops; ++uiIndex )
|
||||
{
|
||||
TRainDrop *pCurr = &pRainDrops[ uiIndex ];
|
||||
|
||||
if( !pCurr->fAlive )continue;
|
||||
|
||||
LineDraw( TRUE, pCurr->fpX, pCurr->fpY, pCurr->fpX + pCurr->fpEndRelX, pCurr->fpY + pCurr->fpEndRelY, sDropsColor, pDestBuf );
|
||||
}
|
||||
|
||||
UnLockVideoSurface( guiRainRenderSurface );
|
||||
}
|
||||
|
||||
void GenerateRainMaximums()
|
||||
{
|
||||
if( gbCurrentRainIntensity == 1 )
|
||||
{
|
||||
fpMinDropAngleOfFalling = 45;
|
||||
fpMaxDropAngleOfFalling = 135;
|
||||
}else
|
||||
if( Random( 2 ) )
|
||||
{
|
||||
fpMinDropAngleOfFalling = 20;
|
||||
fpMaxDropAngleOfFalling = 70;
|
||||
}else{
|
||||
fpMinDropAngleOfFalling = 110;
|
||||
fpMaxDropAngleOfFalling = 160;
|
||||
}
|
||||
|
||||
fpCurrDropAngleOfFalling = fpMinDropAngleOfFalling + Random( fpMaxDropAngleOfFalling - fpMinDropAngleOfFalling );
|
||||
|
||||
fpMinDropLength = MIN_DROP_LENGTH + ADD_DROP_LENGTH_IF_STORM * ( gbCurrentRainIntensity - 1 );
|
||||
fpMaxDropLength = fpMinDropLength + DROP_LENGTH_RANGE;
|
||||
|
||||
fpCurrDropLength = fpMinDropLength + Random( fpMaxDropLength - fpMinDropLength );
|
||||
|
||||
fpMinDropSpeed = BASE_DROP_SPEED * gbCurrentRainIntensity;
|
||||
fpMaxDropSpeed = fpMinDropSpeed + DROP_SPEED_RANGE;
|
||||
|
||||
fpCurrDropSpeed = fpMinDropSpeed + Random( fpMaxDropSpeed - fpMinDropSpeed );
|
||||
|
||||
}
|
||||
|
||||
void UpdateRainDropsProperities()
|
||||
{
|
||||
fpCurrDropAngleOfFalling += Random( 1000 * DROP_ANGLE_CHANGE_RATE * gbCurrentRainIntensity * 2 ) / 1000.0f - DROP_ANGLE_CHANGE_RATE * gbCurrentRainIntensity;
|
||||
|
||||
fpCurrDropAngleOfFalling = max( fpMinDropAngleOfFalling, fpCurrDropAngleOfFalling );
|
||||
fpCurrDropAngleOfFalling = min( fpMaxDropAngleOfFalling, fpCurrDropAngleOfFalling );
|
||||
|
||||
|
||||
fpCurrDropLength += Random( 1000 * DROP_LENGTH_CHANGE_RATE * 2 ) / 1000.0f - DROP_LENGTH_CHANGE_RATE;
|
||||
|
||||
fpCurrDropLength = max( fpMinDropLength, fpCurrDropLength );
|
||||
fpCurrDropLength = min( fpMaxDropLength, fpCurrDropLength );
|
||||
|
||||
|
||||
fpCurrDropSpeed += Random( 1000 * DROP_SPEED_CHANGE_RATE * 2 ) / 1000.0f - DROP_SPEED_CHANGE_RATE;
|
||||
|
||||
fpCurrDropSpeed = max( fpMinDropSpeed, fpCurrDropSpeed );
|
||||
fpCurrDropSpeed = min( fpMaxDropSpeed, fpCurrDropSpeed );
|
||||
|
||||
|
||||
}
|
||||
|
||||
void RandomizeRainDropsPosition()
|
||||
{
|
||||
UINT32 uiIndex;
|
||||
UINT32 ubMoveTo;
|
||||
|
||||
for( uiIndex = 0; uiIndex < guiCurrMaxAmountOfRainDrops; ++uiIndex )
|
||||
{
|
||||
TRainDrop *pCurr = &pRainDrops[ uiIndex ];
|
||||
|
||||
if( !pCurr->fAlive )continue;
|
||||
|
||||
if( pCurr->uiAmountOfTicksToLive )
|
||||
{
|
||||
ubMoveTo = Random( pCurr->uiAmountOfTicksToLive ) + 1;
|
||||
|
||||
while( ubMoveTo < pCurr->uiAmountOfTicksToLive )
|
||||
{
|
||||
pCurr->fpX += pCurr->fpIncrX;
|
||||
pCurr->fpY += pCurr->fpIncrY;
|
||||
pCurr->uiAmountOfTicksToLive--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void RainClipVideoOverlay()
|
||||
{
|
||||
UINT32 uiIndex;
|
||||
BACKGROUND_SAVE *pCurr;
|
||||
|
||||
for( uiIndex = 0; uiIndex < guiNumVideoOverlays ; ++uiIndex )
|
||||
{
|
||||
pCurr = gVideoOverlays[ uiIndex ].pBackground;
|
||||
|
||||
if( pCurr->sLeft < gRainRegion.right ||
|
||||
pCurr->sTop < gRainRegion.bottom ||
|
||||
pCurr->sRight >= gRainRegion.left ||
|
||||
pCurr->sBottom >= gRainRegion.top )
|
||||
ColorFillVideoSurfaceArea( guiRainRenderSurface, pCurr->sLeft, pCurr->sTop, pCurr->sRight, pCurr->sBottom, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
void RenderRain()
|
||||
{
|
||||
if( !GetRainIntensityFromEnvWeather() && gbCurrentRainIntensity )
|
||||
{
|
||||
gbCurrentRainIntensity = GetRainIntensityFromEnvWeather();
|
||||
ResetRain();
|
||||
}
|
||||
|
||||
if( !IsItAllowedToRenderRain() )return;
|
||||
|
||||
if( guiCurrentScreen == SHOPKEEPER_SCREEN )
|
||||
{
|
||||
ColorFillVideoSurfaceArea( guiRainRenderSurface, SKI_X_OFFSET, SKI_Y_OFFSET, 535, 340, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if( InOverheadMap() )
|
||||
{
|
||||
// WANNE 2
|
||||
ColorFillVideoSurfaceArea( guiRainRenderSurface, OM_X_OFFSET, OM_Y_OFFSET, SCREEN_WIDTH, SCREEN_HEIGHT - 120, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if( fFirstTime )
|
||||
{
|
||||
InitializeRainData();
|
||||
fFirstTime = FALSE;
|
||||
}
|
||||
|
||||
if( GetJA2Clock() < guiLastRainUpdate )
|
||||
guiLastRainUpdate = GetJA2Clock();
|
||||
|
||||
if( GetJA2Clock() < guiLastRainUpdate + 1000 / RAIN_UPDATE_RATE )
|
||||
return;
|
||||
else
|
||||
guiLastRainUpdate = GetJA2Clock();
|
||||
|
||||
if( gbCurrentRainIntensity != GetRainIntensityFromEnvWeather() )
|
||||
{
|
||||
gbCurrentRainIntensity = GetRainIntensityFromEnvWeather();
|
||||
ResetRain();
|
||||
GenerateRainDropsList();
|
||||
GenerateRainMaximums();
|
||||
|
||||
|
||||
guiCurrAmountOfDeadRainDrops = guiCurrMaxAmountOfRainDrops;
|
||||
|
||||
CreateRainDrops();
|
||||
RandomizeRainDropsPosition();
|
||||
}
|
||||
|
||||
guiCurrAmountOfDeadRainDrops = 0;
|
||||
|
||||
UpdateRainDropsProperities();
|
||||
UpdateRainDrops();
|
||||
KillOutOfRegionRainDrops();
|
||||
CreateRainDrops();
|
||||
|
||||
BlankRainRenderSurface();
|
||||
RenderRainOnSurface();
|
||||
|
||||
RainClipVideoOverlay();
|
||||
|
||||
if( gfInTalkPanel )
|
||||
{
|
||||
ColorFillVideoSurfaceArea( guiRainRenderSurface, gTalkPanel.sX, gTalkPanel.sY, gTalkPanel.sX + gTalkPanel.usWidth, gTalkPanel.sY + gTalkPanel.usHeight, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
||||
if ( gTalkPanel.fRenderSubTitlesNow )
|
||||
{
|
||||
if( gPopUpTextBox )
|
||||
ColorFillVideoSurfaceArea( guiRainRenderSurface, gTalkPanel.sPopupX, gTalkPanel.sPopupY, (INT16)( gTalkPanel.sPopupX + gPopUpTextBox->sWidth ), (INT16)( gTalkPanel.sPopupY + gPopUpTextBox->sHeight ), Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#ifndef ___RAIN_H___
|
||||
#define ___RAIN_H___
|
||||
|
||||
BOOLEAN IsItAllowedToRenderRain();
|
||||
void RenderRain();
|
||||
|
||||
#endif
|
||||
@@ -3732,6 +3732,9 @@
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Rain.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Real Time Input.cpp">
|
||||
<FileConfiguration
|
||||
@@ -6897,6 +6900,9 @@
|
||||
<File
|
||||
RelativePath="points.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Rain.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ShopKeeper Interface.h">
|
||||
</File>
|
||||
|
||||
@@ -361,6 +361,10 @@ void EndTurnEvents( void )
|
||||
DecayRottingCorpseAIWarnings();
|
||||
}
|
||||
|
||||
//rain
|
||||
BOOLEAN LightningEndOfTurn( UINT8 ubTeam );
|
||||
//end rain
|
||||
|
||||
void BeginTeamTurn( UINT8 ubTeam )
|
||||
{
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"BeginTeamTurn");
|
||||
@@ -368,6 +372,11 @@ void BeginTeamTurn( UINT8 ubTeam )
|
||||
UINT8 ubID;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
//rain
|
||||
if( !LightningEndOfTurn( ubTeam ) )return;
|
||||
//end rain
|
||||
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
if ( ubTeam > LAST_TEAM )
|
||||
|
||||
@@ -1513,6 +1513,32 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Allow to save everywhere
|
||||
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == 'l') )
|
||||
{
|
||||
if( InputEvent.usKeyState & ALT_DOWN )
|
||||
{
|
||||
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||
{
|
||||
LeaveTacticalScreen( GAME_SCREEN );
|
||||
DoQuickLoad();
|
||||
}
|
||||
}
|
||||
else if( InputEvent.usKeyState & CTRL_DOWN )
|
||||
{
|
||||
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||
{
|
||||
gfSaveGame = FALSE;
|
||||
gfCameDirectlyFromGame = TRUE;
|
||||
|
||||
guiPreviousOptionScreen = GAME_SCREEN;
|
||||
LeaveTacticalScreen( SAVE_LOAD_SCREEN );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Break of out IN CONV...
|
||||
if ( CHEATER_CHEAT_LEVEL( ) )
|
||||
{
|
||||
@@ -2734,7 +2760,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
#endif
|
||||
|
||||
case 'l':
|
||||
|
||||
/*
|
||||
if( fAlt )
|
||||
{
|
||||
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
|
||||
@@ -2756,16 +2782,16 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
guiPreviousOptionScreen = GAME_SCREEN;
|
||||
LeaveTacticalScreen( SAVE_LOAD_SCREEN );
|
||||
}
|
||||
/*
|
||||
*//*
|
||||
if ( INFORMATION_CHEAT_LEVEL( ) )
|
||||
{
|
||||
*puiNewEvent = I_LEVELNODEDEBUG;
|
||||
CountLevelNodes();
|
||||
}
|
||||
*/
|
||||
*//*
|
||||
}
|
||||
else
|
||||
{
|
||||
*/ {
|
||||
// nothing in hand and either not in SM panel, or the matching button is enabled if we are in SM panel
|
||||
if ( ( gpItemPointer == NULL ) &&
|
||||
( ( gsCurInterfacePanel != SM_PANEL ) || ( ButtonList[ iSMPanelButtons[ LOOK_BUTTON ] ]->uiFlags & BUTTON_ENABLED ) ) )
|
||||
|
||||
+30
-2
@@ -44,6 +44,12 @@
|
||||
#include "XML.h"
|
||||
#endif
|
||||
|
||||
//rain
|
||||
#define WEAPON_RELIABILITY_REDUCTION_PER_RAIN_INTENSITY 9
|
||||
extern INT8 gbCurrentRainIntensity;
|
||||
//end rain
|
||||
|
||||
|
||||
#define MINCHANCETOHIT 1
|
||||
#define MAXCHANCETOHIT 99
|
||||
|
||||
@@ -1055,6 +1061,10 @@ void AdjustImpactByHitLocation( INT32 iImpact, UINT8 ubHitLocation, INT32 * piNe
|
||||
|
||||
// #define TESTGUNJAM
|
||||
|
||||
//rain
|
||||
extern INT8 gbCurrentRainIntensity;
|
||||
//end rain
|
||||
|
||||
BOOLEAN CheckForGunJam( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
OBJECTTYPE * pObj;
|
||||
@@ -1069,7 +1079,12 @@ BOOLEAN CheckForGunJam( SOLDIERTYPE * pSoldier )
|
||||
if (pObj->bGunAmmoStatus > 0)
|
||||
{
|
||||
// gun might jam, figure out the chance
|
||||
iChance = (80 - pObj->bGunStatus);
|
||||
//iChance = (80 - pObj->bGunStatus);
|
||||
|
||||
//rain
|
||||
iChance = (80 - 90 - pObj->bGunStatus) + WEAPON_RELIABILITY_REDUCTION_PER_RAIN_INTENSITY * gbCurrentRainIntensity;
|
||||
//end rain
|
||||
|
||||
|
||||
// CJC: removed reliability from formula...
|
||||
|
||||
@@ -1080,6 +1095,10 @@ BOOLEAN CheckForGunJam( SOLDIERTYPE * pSoldier )
|
||||
// increased by 20% per negative point...
|
||||
//iChance = iChance * (10 - Item[pObj->usItem].bReliability * 2) / 10;
|
||||
|
||||
//rain
|
||||
iChance = iChance * (10 - Item[pObj->usItem].bReliability * 2) / 10;
|
||||
//end rain
|
||||
|
||||
if (pSoldier->bDoBurst > 1)
|
||||
{
|
||||
// if at bullet in a burst after the first, higher chance
|
||||
@@ -3211,7 +3230,11 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, UINT16 sGridNo, UINT8 ubAimTime
|
||||
{
|
||||
//SOLDIERTYPE *vicpSoldier;
|
||||
SOLDIERTYPE * pTarget;
|
||||
INT32 iChance, iRange, iSightRange, iMaxRange, iBonus; //, minRange;
|
||||
//rain
|
||||
//INT32 iChance, iRange, iSightRange, iMaxRange, iBonus; //, minRange;
|
||||
INT32 iChance, iRange, iSightRange, iMaxRange, iScopeBonus, iBonus; //, minRange;
|
||||
//end rain
|
||||
|
||||
INT32 iGunCondition, iMarksmanship;
|
||||
INT32 iPenalty;
|
||||
UINT16 usInHand;
|
||||
@@ -3472,6 +3495,11 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, UINT16 sGridNo, UINT8 ubAimTime
|
||||
// // adjust for scope condition, only has full affect at 100%
|
||||
// iScopeBonus = (iScopeBonus * WEAPON_STATUS_MOD(pInHand->bAttachStatus[bAttachPos])) / 100;
|
||||
|
||||
//rain
|
||||
// reduce scope effectiveness when it's raining
|
||||
iScopeBonus /= 1 + gbCurrentRainIntensity;
|
||||
//end rain
|
||||
|
||||
// // reduce effective range by the bonus obtained from the scope
|
||||
// iSightRange -= iScopeBonus;
|
||||
// if (iSightRange < 1)
|
||||
|
||||
+36
-5
@@ -44,6 +44,10 @@
|
||||
#include "SkillCheck.h"
|
||||
#endif
|
||||
|
||||
//rain
|
||||
#define VIS_DIST_DECREASE_PER_RAIN_INTENSITY 20
|
||||
//end rain
|
||||
|
||||
#define WE_SEE_WHAT_MILITIA_SEES_AND_VICE_VERSA
|
||||
|
||||
extern void SetSoldierAniSpeed( SOLDIERTYPE *pSoldier );
|
||||
@@ -255,6 +259,14 @@ UINT8 gubSightFlags = 0;
|
||||
}
|
||||
|
||||
|
||||
//rain
|
||||
extern INT8 gbCurrentRainIntensity;
|
||||
extern BOOLEAN gfLightningInProgress;
|
||||
extern BOOLEAN gfHaveSeenSomeone;
|
||||
extern UINT8 ubRealAmbientLightLevel;
|
||||
//end rain
|
||||
|
||||
|
||||
INT16 AdjustMaxSightRangeForEnvEffects( SOLDIERTYPE *pSoldier, INT8 bLightLevel, INT16 sDistVisible )
|
||||
{
|
||||
INT16 sNewDist = 0;
|
||||
@@ -264,8 +276,16 @@ INT16 AdjustMaxSightRangeForEnvEffects( SOLDIERTYPE *pSoldier, INT8 bLightLevel,
|
||||
// Adjust it based on weather...
|
||||
if ( guiEnvWeather & ( WEATHER_FORECAST_SHOWERS | WEATHER_FORECAST_THUNDERSHOWERS ) )
|
||||
{
|
||||
sNewDist = sNewDist * 70 / 100;
|
||||
//sNewDist = sNewDist * 70 / 100;
|
||||
//rain
|
||||
sNewDist = sNewDist * ( 100 - VIS_DIST_DECREASE_PER_RAIN_INTENSITY * gbCurrentRainIntensity ) / 100;
|
||||
//end rain
|
||||
}
|
||||
|
||||
//rain
|
||||
if( gfLightningInProgress )
|
||||
sNewDist += sNewDist * ( ubRealAmbientLightLevel ) / 10; // 10% per dark level
|
||||
//end rain
|
||||
|
||||
return( sNewDist );
|
||||
}
|
||||
@@ -785,6 +805,7 @@ void HandleSight(SOLDIERTYPE *pSoldier, UINT8 ubSightFlags)
|
||||
pSoldier->bNewOppCnt = 0;
|
||||
pSoldier->bNeedToLook = FALSE;
|
||||
|
||||
|
||||
// Temporary for opplist synching - disable random order radioing
|
||||
#ifndef RECORDOPPLIST
|
||||
// if this soldier's NOT on our team (MAY be under our control, though!)
|
||||
@@ -839,7 +860,6 @@ void HandleSight(SOLDIERTYPE *pSoldier, UINT8 ubSightFlags)
|
||||
// CJC August 13 2002: at the end of handling sight, reset sight flags to allow interrupts in case an audio cue should
|
||||
// cause someone to see an enemy
|
||||
gubSightFlags |= SIGHT_INTERRUPT;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1028,7 +1048,6 @@ INT16 DistanceVisible( SOLDIERTYPE *pSoldier, INT8 bFacingDir, INT8 bSubjectDir,
|
||||
//bSubjectDir = atan8(pSoldier->sX,pSoldier->sY,pOpponent->sX,pOpponent->sY);
|
||||
}
|
||||
|
||||
|
||||
if ( !TANK( pSoldier ) && ( bFacingDir == DIRECTION_IRRELEVANT || (pSoldier->uiStatusFlags & SOLDIER_ROBOT) || (pSubject && pSubject->fMuzzleFlash) ) )
|
||||
{
|
||||
sDistVisible = MaxDistanceVisible();
|
||||
@@ -1420,6 +1439,7 @@ void ManLooksForOtherTeams(SOLDIERTYPE *pSoldier)
|
||||
UINT32 uiLoop;
|
||||
SOLDIERTYPE *pOpponent;
|
||||
|
||||
|
||||
#ifdef TESTOPPLIST
|
||||
DebugMsg( TOPIC_JA2OPPLIST, DBG_LEVEL_3,
|
||||
String("MANLOOKSFOROTHERTEAMS ID %d(%S) team %d side %d",pSoldier->ubID,pSoldier->name,pSoldier->bTeam,pSoldier->bSide));
|
||||
@@ -1457,7 +1477,6 @@ void ManLooksForOtherTeams(SOLDIERTYPE *pSoldier)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void HandleManNoLongerSeen( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOpponent, INT8 * pPersOL, INT8 * pbPublOL )
|
||||
@@ -1550,6 +1569,7 @@ INT16 ManLooksForMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 ubCall
|
||||
INT16 sDistVisible,sDistAway;
|
||||
INT8 *pPersOL,*pbPublOL;
|
||||
|
||||
|
||||
/*
|
||||
if (ptr->guynum >= NOBODY)
|
||||
{
|
||||
@@ -1593,6 +1613,8 @@ INT16 ManLooksForMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 ubCall
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// if we're somehow looking for a guy who is inactive, at base, or already dead
|
||||
if (!pOpponent->bActive || !pOpponent->bInSector || pOpponent->bLife <= 0 || pOpponent->sGridNo == NOWHERE )
|
||||
{
|
||||
@@ -1696,6 +1718,7 @@ INT16 ManLooksForMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 ubCall
|
||||
pPersOL = &(pSoldier->bOppList[pOpponent->ubID]);
|
||||
pbPublOL = &(gbPublicOpplist[pSoldier->bTeam][pOpponent->ubID]);
|
||||
|
||||
|
||||
// if soldier is known about (SEEN or HEARD within last few turns)
|
||||
if (*pPersOL || *pbPublOL)
|
||||
{
|
||||
@@ -1791,6 +1814,8 @@ INT16 ManLooksForMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 ubCall
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return(bSuccess);
|
||||
}
|
||||
|
||||
@@ -2256,6 +2281,9 @@ else
|
||||
// then locate to him and set his locator flag
|
||||
bDoLocate = TRUE;
|
||||
|
||||
//rain
|
||||
if( gfLightningInProgress ) gfHaveSeenSomeone = TRUE;
|
||||
//end rain
|
||||
}
|
||||
|
||||
// make opponent visible (to us)
|
||||
@@ -2321,7 +2349,10 @@ else
|
||||
{
|
||||
if (!pOpponent->bNeutral && (pSoldier->bSide != pOpponent->bSide))
|
||||
{
|
||||
SlideTo(0,pOpponent->ubID, pSoldier->ubID, SETLOCATOR);
|
||||
//SlideTo(0,pOpponent->ubID, pSoldier->ubID, SETLOCATOR);
|
||||
//rain
|
||||
SlideTo(0,pOpponent->ubID, pSoldier->ubID, SETLOCATORFAST);
|
||||
//end rain
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user