mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
New attack busy system
Added missing #includes Added LUA scripting and console Changed the way tracers are visualized, so they work more like real tracers instead of a light fountain Fixed signedness of many grid variables used in GetMouseMapPos calls Fixed enemy weapon choosing: Sometimes a mortar is chosen but later rejected, but the grenade class was not reset. Caused assertion failure Added checks so enemies don't try to chuck RPG grenades with their hands Now possible to shoot a someone in the head if he's in water Fixed InitSightArrays to also clear soldier interrupt duel points. This was causing an assertion failure elsewhere in the code because the interrupt list still had soldiers on it sometimes when this function was called. Soldiers are much less willing to forfeit their turn over an attempt to use more APs than they have Removed early setting of muzzle flash. This would allow enemies to get an interrupt before you even fired. Fixed item dropping by AI. If AI tried to drop something while standing it would cause deadlock Change to greatly speed up closing the sector inventory window in an unloaded sector Added conditional compile flag to always give robot weapon ready advantage, even for 360 degree sighting Check builddefines.h for the conditional flags. Of greatest interest might be LUA_CONSOLE. This will cause the game to bring up a command console when run. However this console is severely lacking in many areas. If anybody knows of an open-source terminal/console that could be used instead, it would be appreciated. The existing console does bad things when you try to close it, and since it counts as a separate app, it pauses the game while it has focus. LUA scripting is very limited, basically just proof of concept. There is one global variable, the Soldiers array. An array index gives you the soldier in that slot in the currently loaded sector. The soldier has a few things that can be accessed: name (short name); fullname (long name); grid (current grid #, can be changed); walkto(grid) (function to walk to another grid); runto(grid) (function to run to another grid) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@924 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+12
-7
@@ -31,6 +31,8 @@
|
||||
#include "text.h"
|
||||
#include "Morale.h"
|
||||
#include "Map screen helicopter.h"
|
||||
#include "structure wrap.h"
|
||||
#include "meanwhile.h"
|
||||
#endif
|
||||
|
||||
#define SCRIPT_DELAY 10
|
||||
@@ -548,7 +550,7 @@ void AirRaidLookForDive( )
|
||||
if ( giNumGridNosMovedThisTurn == 0 )
|
||||
{
|
||||
// Free up attacker...
|
||||
FreeUpAttacker( gpRaidSoldier->ubID );
|
||||
ReduceAttackBusyCount( );
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Tried to free up attacker AIR RAID NO DIVE, attack count now %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
}
|
||||
}
|
||||
@@ -643,6 +645,7 @@ void BeginDive( )
|
||||
// Increment attacker bust count....
|
||||
gTacticalStatus.ubAttackBusyCount++;
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Starting attack BEGIN DIVE %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
DebugAttackBusy( String("!!!!!!! Starting attack BEGIN DIVE %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
|
||||
// Pick location...
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("BeginDive: pick location"));
|
||||
@@ -822,7 +825,7 @@ void DoDive( )
|
||||
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Starting attack AIR RAID ( fire gun ), attack count now %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
|
||||
// INcrement bullet fired...
|
||||
gpRaidSoldier->bBulletsLeft++;
|
||||
// gpRaidSoldier->bBulletsLeft++;
|
||||
}
|
||||
|
||||
// For now use first position....
|
||||
@@ -857,7 +860,7 @@ void DoDive( )
|
||||
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Starting attack AIR RAID ( second one ), attack count now %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
|
||||
// INcrement bullet fired...
|
||||
gpRaidSoldier->bBulletsLeft++;
|
||||
// gpRaidSoldier->bBulletsLeft++;
|
||||
|
||||
}
|
||||
|
||||
@@ -872,7 +875,7 @@ void DoDive( )
|
||||
if ( ( gTacticalStatus.uiFlags & INCOMBAT ) )
|
||||
{
|
||||
// Free up attacker...
|
||||
FreeUpAttacker( gpRaidSoldier->ubID );
|
||||
ReduceAttackBusyCount( );
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Tried to free up attacker AIR RAID DIVE DONE FOR THIS TURN, attack count now %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
}
|
||||
}
|
||||
@@ -999,6 +1002,7 @@ void DoBombing( )
|
||||
// Increase attacker busy...
|
||||
gTacticalStatus.ubAttackBusyCount++;
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Starting attack AIR RAID ( bombs away ), attack count now %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
DebugAttackBusy( String("!!!!!!! Starting attack AIR RAID ( bombs away ), attack count now %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
}
|
||||
|
||||
// Drop bombs...
|
||||
@@ -1013,7 +1017,7 @@ void DoBombing( )
|
||||
if ( ( gTacticalStatus.uiFlags & INCOMBAT ) )
|
||||
{
|
||||
// Free up attacker...
|
||||
FreeUpAttacker( gpRaidSoldier->ubID );
|
||||
ReduceAttackBusyCount( );
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Tried to free up attacker AIR RAID BOMB ATTACK DONE FOR THIS TURN, attack count now %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
}
|
||||
}
|
||||
@@ -1192,7 +1196,7 @@ void HandleAirRaid( )
|
||||
if ( ( gTacticalStatus.uiFlags & INCOMBAT ) )
|
||||
{
|
||||
// Free up attacker...
|
||||
FreeUpAttacker( gpRaidSoldier->ubID );
|
||||
ReduceAttackBusyCount( );
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Tried to free up attacker AIR RAID ENDING DIVE, attack count now %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
}
|
||||
|
||||
@@ -1207,7 +1211,7 @@ void HandleAirRaid( )
|
||||
if ( ( gTacticalStatus.uiFlags & INCOMBAT ) )
|
||||
{
|
||||
// Free up attacker...
|
||||
FreeUpAttacker( gpRaidSoldier->ubID );
|
||||
ReduceAttackBusyCount( );
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Tried to free up attacker AIR RAID ENDING DIVE, attack count now %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
}
|
||||
|
||||
@@ -1279,6 +1283,7 @@ BOOLEAN HandleAirRaidEndTurn( UINT8 ubTeam )
|
||||
// Increment attacker bust count....
|
||||
gTacticalStatus.ubAttackBusyCount++;
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Starting attack AIR RAID, attack count now %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
DebugAttackBusy( String("!!!!!!! Starting attack AIR RAID, attack count now %d\n", gTacticalStatus.ubAttackBusyCount) );
|
||||
|
||||
AddTopMessage( AIR_RAID_TURN_MESSAGE, TacticalStr[ AIR_RAID_TURN_STR ] );
|
||||
|
||||
|
||||
+352
-349
File diff suppressed because it is too large
Load Diff
@@ -56,10 +56,20 @@
|
||||
#define ANIM_RAISE_WEAPON 0x00080000
|
||||
#define ANIM_NOCHANGE_WEAPON 0x00100000
|
||||
#define ANIM_NOCHANGE_PENDINGCOUNT 0x00200000
|
||||
#define ANIM_NO_EFFORT 0x00400000
|
||||
#define ANIM_MIN_EFFORT 0x00800000
|
||||
#define ANIM_LIGHT_EFFORT 0x01000000
|
||||
#define ANIM_MODERATE_EFFORT 0x02000000
|
||||
// I'm commandeering the effort flags. I do not expect to see multiple efforts for the same tasks, so I'm turning them into a 2-bit
|
||||
// level instead. So there :P
|
||||
#define ANIM_NO_EFFORT 0x00000000
|
||||
#define ANIM_MIN_EFFORT 0x00400000
|
||||
#define ANIM_LIGHT_EFFORT 0x00800000
|
||||
#define ANIM_MODERATE_EFFORT 0x00C00000
|
||||
|
||||
// Return a number between 0 and 4 to indicate effort. 4 means variable
|
||||
#define EFFORT(flags) (((flags) & ANIM_VARIABLE_EFFORT) ? 4 : ((flags) & 0x00C00000) >> 22)
|
||||
|
||||
// Now I have room for a new flag. And there's still room for one more!
|
||||
#define ANIM_ATTACK 0x01000000
|
||||
#define ANIM_FREEFORUSE 0x02000000
|
||||
|
||||
#define ANIM_RT_NONINTERRUPT 0x04000000
|
||||
#define ANIM_VARIABLE_EFFORT 0x08000000
|
||||
#define ANIM_UPDATEMOVEMENTMODE 0x10000000
|
||||
@@ -92,7 +102,7 @@ typedef struct
|
||||
INT16 sAP;
|
||||
INT16 sSpeed;
|
||||
FLOAT dMovementChange;
|
||||
UINT32 uiFlags;
|
||||
UINT32 uiFlags;
|
||||
UINT8 ubHeight;
|
||||
UINT8 ubEndHeight;
|
||||
INT8 bProfile;
|
||||
@@ -530,7 +540,7 @@ enum AnimationStates
|
||||
LOCKPICK_CROUCHED,
|
||||
|
||||
//<SB> crouch throwing
|
||||
THROW_ITEM_CROUCHED,
|
||||
THROW_ITEM_CROUCHED,
|
||||
//</SB>
|
||||
|
||||
NUMANIMATIONSTATES
|
||||
@@ -572,4 +582,4 @@ UINT16 LoadSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimState );
|
||||
UINT16 GetSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimState );
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "wcheck.h"
|
||||
@@ -1131,4 +1132,4 @@ void ZeroAnimSurfaceCounts( )
|
||||
}
|
||||
|
||||
memset( gbAnimUsageHistory, 0, sizeof( gbAnimUsageHistory ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "Message.h"
|
||||
#include "soldier profile.h"
|
||||
#include "Handle Items.h"
|
||||
#include "Quests.h"
|
||||
#include "Scheduling.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
#include "Item Types.h"
|
||||
#include "Arms Dealer Init.h"
|
||||
#include "DEbug.h"
|
||||
#include "weapons.h"
|
||||
#include "Campaign.h"
|
||||
#include "GameSettings.h"
|
||||
#include "AIInternals.h"
|
||||
#include "LaptopSave.h"
|
||||
#include "bobbyr.h"
|
||||
#include "Random.h"
|
||||
#include "Shopkeeper Interface.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef _ARMS_DEALER_INV_INIT__H_
|
||||
#define _ARMS_DEALER_INV_INIT__H_
|
||||
|
||||
#include "Item Types.h"
|
||||
|
||||
#define LAST_DEALER_ITEM 0//-1
|
||||
#define NO_DEALER_ITEM 0
|
||||
|
||||
@@ -339,7 +339,7 @@ BOOLEAN CreateAutoBandageString( void )
|
||||
uiDoctorNameStringLength += wcslen( Message[STR_ARE_APPLYING_FIRST_AID] );
|
||||
}
|
||||
|
||||
sAutoBandageString = (STR16) MemRealloc( sAutoBandageString, uiDoctorNameStringLength * sizeof( CHAR16 ) );
|
||||
sAutoBandageString = (STR16) MemRealloc( sAutoBandageString, uiDoctorNameStringLength * sizeof( CHAR16 ) );
|
||||
if (!sAutoBandageString)
|
||||
{
|
||||
return( FALSE );
|
||||
@@ -352,7 +352,7 @@ BOOLEAN CreateAutoBandageString( void )
|
||||
else
|
||||
{
|
||||
// make a temporary string to hold most of the doctors names joined by commas
|
||||
sTemp = (STR16) MemAlloc( uiDoctorNameStringLength * sizeof( CHAR16 ) );
|
||||
sTemp = (STR16) MemAlloc( uiDoctorNameStringLength * sizeof( CHAR16 ) );
|
||||
// sTemp = MemAlloc( 1000 );
|
||||
if (!sTemp)
|
||||
{
|
||||
|
||||
@@ -15,6 +15,15 @@
|
||||
#include "Handle UI.h"
|
||||
#include "Points.h"
|
||||
#include "interface.h"
|
||||
#include "interface dialogue.h"
|
||||
#include "TeamTurns.h"
|
||||
#include "Music Control.h"
|
||||
#include "history.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Animation Data.h"
|
||||
#include "Font Control.h"
|
||||
#include "message.h"
|
||||
#endif
|
||||
|
||||
INT16 gsBoxerGridNo[ NUM_BOXERS ] = { 11393, 11233, 11073 };
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <wchar.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -22,6 +23,19 @@
|
||||
#include "Sys Globals.h"
|
||||
#include "Text.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Assignments.h"
|
||||
#include "Interface.h"
|
||||
#include "Game Event Hook.h"
|
||||
#include "Overhead.h"
|
||||
#include "meanwhile.h"
|
||||
#include "Quests.h"
|
||||
#include "Squads.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "strategic.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Town Militia.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "Tactical Save.h"
|
||||
#endif
|
||||
|
||||
#include "email.h"
|
||||
|
||||
@@ -1,6 +1,38 @@
|
||||
// WANNE 2 <changed some lines>
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include "Types.h"
|
||||
#include "civ quotes.h"
|
||||
#include "mousesystem.h"
|
||||
#include "strategicmap.h"
|
||||
#include "WCheck.h"
|
||||
#include "FileMan.h"
|
||||
#include "encrypted file.h"
|
||||
#include "MessageBoxScreen.h"
|
||||
#include "Queen Command.h"
|
||||
#include "Overhead.h"
|
||||
#include "render dirty.h"
|
||||
#include "merctextbox.h"
|
||||
#include "ai.h"
|
||||
#include "Text.h"
|
||||
#include "screenids.h"
|
||||
#include "Animation Data.h"
|
||||
#include "Video.h"
|
||||
#include "Font Control.h"
|
||||
#include "message.h"
|
||||
#include "local.h"
|
||||
#include "renderworld.h"
|
||||
#include "Interface.h"
|
||||
#include "cursors.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "Quests.h"
|
||||
#include "Strategic Town Loyalty.h"
|
||||
#include "NPC.h"
|
||||
#include "Strategic Mines.h"
|
||||
#include "Random.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef __CIV_QUOTES_H
|
||||
#define __CIV_QUOTES_H
|
||||
|
||||
#include "Soldier Control.h"
|
||||
|
||||
#define CIV_TYPE_NA 0
|
||||
#define CIV_TYPE_ADULT 1
|
||||
#define CIV_TYPE_KID 2
|
||||
|
||||
@@ -46,6 +46,16 @@
|
||||
#include "SkillCheck.h"
|
||||
#include "Interface Control.h"
|
||||
#include "finances.h"
|
||||
#include "civ quotes.h"
|
||||
#include "Map Screen Interface Map.h"
|
||||
#include "opplist.h"
|
||||
#include "ai.h"
|
||||
#include "worldman.h"
|
||||
#include "Map Screen Interface Bottom.h"
|
||||
#include "Campaign.h"
|
||||
#include "end game.h"
|
||||
#include "los.h"
|
||||
#include "qarray.h"
|
||||
#endif
|
||||
|
||||
#define DIALOGUESIZE 480
|
||||
@@ -2255,21 +2265,23 @@ void HandleDialogueEnd( FACETYPE *pFace )
|
||||
case DIALOGUE_TACTICAL_UI:
|
||||
case DIALOGUE_EXTERNAL_NPC_UI:
|
||||
// Remove if created
|
||||
// 0verhaul: Both of these events are more or less independent. Most often the gTextBoxOverlay fails to init.
|
||||
// Therefore I am removing the dependency on giTextBoxOverlay before it decides to destroy the popup box region.
|
||||
// This should prevent blockage of buttons and also clicks on the tactical map.
|
||||
if ( giTextBoxOverlay != -1 )
|
||||
{
|
||||
RemoveVideoOverlay( giTextBoxOverlay );
|
||||
giTextBoxOverlay = -1;
|
||||
|
||||
if ( fTextBoxMouseRegionCreated )
|
||||
{
|
||||
RemoveMercPopupBoxFromIndex( iDialogueBox );
|
||||
}
|
||||
|
||||
if ( fTextBoxMouseRegionCreated )
|
||||
{
|
||||
RemoveMercPopupBoxFromIndex( iDialogueBox );
|
||||
|
||||
// reset box id
|
||||
iDialogueBox = -1;
|
||||
MSYS_RemoveRegion( &gTextBoxMouseRegion );
|
||||
fTextBoxMouseRegionCreated = FALSE;
|
||||
}
|
||||
|
||||
// reset box id
|
||||
iDialogueBox = -1;
|
||||
MSYS_RemoveRegion( &gTextBoxMouseRegion );
|
||||
fTextBoxMouseRegionCreated = FALSE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
+37
-12
@@ -5,6 +5,31 @@
|
||||
#include "opplist.h"
|
||||
#include "_Ja25Englishtext.h"
|
||||
//#include "Ja25 Strategic Ai.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include "Types.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Soldier Control.h"
|
||||
#include "Overhead.h"
|
||||
#include "displaycover.h"
|
||||
#include "Font Control.h"
|
||||
#include "_Ja25EnglishText.h"
|
||||
#include "message.h"
|
||||
#include "GameSettings.h"
|
||||
#include "renderworld.h"
|
||||
#include "Interface.h"
|
||||
#include "Debug.h"
|
||||
#include "PATHAI.H"
|
||||
#include "worldman.h"
|
||||
#include "opplist.h"
|
||||
#include "los.h"
|
||||
#include "weapons.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Animation Control.h"
|
||||
#include "lighting.h"
|
||||
#include "Text.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Render Fun.h"
|
||||
#endif
|
||||
|
||||
//******* Local Defines **************************************************
|
||||
@@ -79,10 +104,10 @@ BOOLEAN IsTheRoofVisible( INT16 sGridNo );
|
||||
|
||||
void DisplayCoverOfSelectedGridNo( )
|
||||
{
|
||||
INT16 sGridNo;
|
||||
UINT16 usGridNo;
|
||||
INT8 bStance;
|
||||
|
||||
GetMouseMapPos( &sGridNo );
|
||||
GetMouseMapPos( &usGridNo );
|
||||
|
||||
//Only allowed in if there is someone selected
|
||||
if( gusSelectedSoldier == NOBODY )
|
||||
@@ -91,12 +116,12 @@ void DisplayCoverOfSelectedGridNo( )
|
||||
}
|
||||
|
||||
//if the cursor is in a the tactical map
|
||||
if( sGridNo != NOWHERE && sGridNo != 0 )
|
||||
if( usGridNo != NOWHERE && usGridNo != 0 )
|
||||
{
|
||||
bStance = GetCurrentMercForDisplayCoverStance();
|
||||
|
||||
//if the gridno is different then the last one that was displayed
|
||||
if( sGridNo != gsLastCoverGridNo ||
|
||||
if( usGridNo != gsLastCoverGridNo ||
|
||||
gbLastStance != bStance ||
|
||||
MercPtrs[ gusSelectedSoldier ]->sGridNo != gsLastSoldierGridNo )
|
||||
{
|
||||
@@ -126,11 +151,11 @@ void DisplayCoverOfSelectedGridNo( )
|
||||
}
|
||||
|
||||
gbLastStance = bStance;
|
||||
gsLastCoverGridNo = sGridNo;
|
||||
gsLastCoverGridNo = usGridNo;
|
||||
gsLastSoldierGridNo = MercPtrs[ gusSelectedSoldier ]->sGridNo;
|
||||
|
||||
//Fill the array of gridno and cover values
|
||||
CalculateCoverInRadiusAroundGridno( sGridNo, gGameSettings.ubSizeOfDisplayCover );
|
||||
CalculateCoverInRadiusAroundGridno( usGridNo, gGameSettings.ubSizeOfDisplayCover );
|
||||
|
||||
//Add the graphics to each gridno
|
||||
AddCoverTileToEachGridNo();
|
||||
@@ -641,10 +666,10 @@ void DisplayRangeToTarget( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo )
|
||||
|
||||
void DisplayGridNoVisibleToSoldierGrid( )
|
||||
{
|
||||
INT16 sGridNo;
|
||||
UINT16 usGridNo;
|
||||
// INT8 bStance;
|
||||
|
||||
GetMouseMapPos( &sGridNo );
|
||||
GetMouseMapPos( &usGridNo );
|
||||
|
||||
//Only allowed in if there is someone selected
|
||||
if( gusSelectedSoldier == NOBODY )
|
||||
@@ -653,10 +678,10 @@ void DisplayGridNoVisibleToSoldierGrid( )
|
||||
}
|
||||
|
||||
//if the cursor is in a the tactical map
|
||||
if( sGridNo != NOWHERE && sGridNo != 0 )
|
||||
if( usGridNo != NOWHERE && usGridNo != 0 )
|
||||
{
|
||||
//if the gridno is different then the last one that was displayed
|
||||
if( sGridNo != gsLastVisibleToSoldierGridNo || MercPtrs[ gusSelectedSoldier ]->sGridNo != gsLastSoldierGridNo )
|
||||
if( usGridNo != gsLastVisibleToSoldierGridNo || MercPtrs[ gusSelectedSoldier ]->sGridNo != gsLastSoldierGridNo )
|
||||
{
|
||||
//if the cover is currently being displayed
|
||||
if( gsLastVisibleToSoldierGridNo != NOWHERE || gsLastSoldierGridNo != NOWHERE )
|
||||
@@ -680,12 +705,12 @@ void DisplayGridNoVisibleToSoldierGrid( )
|
||||
//gJa25SaveStruct.uiDisplayLosCounter++;
|
||||
}
|
||||
|
||||
gsLastVisibleToSoldierGridNo = sGridNo;
|
||||
gsLastVisibleToSoldierGridNo = usGridNo;
|
||||
gsLastSoldierGridNo = MercPtrs[ gusSelectedSoldier ]->sGridNo;
|
||||
|
||||
|
||||
//Fill the array of gridno and cover values
|
||||
CalculateVisibleToSoldierAroundGridno( sGridNo, gGameSettings.ubSizeOfLOS );
|
||||
CalculateVisibleToSoldierAroundGridno( usGridNo, gGameSettings.ubSizeOfLOS );
|
||||
|
||||
//Add the graphics to each gridno
|
||||
AddVisibleToSoldierToEachGridNo();
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
#include "morale.h"
|
||||
#include "points.h"
|
||||
#include "message.h"
|
||||
#include "Random.h"
|
||||
#include "Text.h"
|
||||
#include "Interface.h"
|
||||
#endif
|
||||
|
||||
UINT8 ubDrugTravelRate[] = { 4, 2 };
|
||||
|
||||
+25
-1
@@ -19,6 +19,29 @@
|
||||
#include "interface.h"
|
||||
#include "end game.h"
|
||||
#include "Intro.h"
|
||||
#include "Exit Grids.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Quests.h"
|
||||
#include "SaveLoadMap.h"
|
||||
#include "Sound Control.h"
|
||||
#include "renderworld.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Music Control.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "qarray.h"
|
||||
#include "los.h"
|
||||
#include "Strategic AI.h"
|
||||
#include "Squads.h"
|
||||
#include "PreBattle Interface.h"
|
||||
#include "Strategic Movement.h"
|
||||
#include "strategic.h"
|
||||
#include "Morale.h"
|
||||
#include "Queen Command.h"
|
||||
#include "Strategic Town Loyalty.h"
|
||||
#include "Player Command.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "Tactical Save.h"
|
||||
#include "screenids.h"
|
||||
#endif
|
||||
|
||||
INT16 sStatueGridNos[] = { 13829, 13830, 13669, 13670 };
|
||||
@@ -415,7 +438,8 @@ void BeginHandleQueenBitchDeath( SOLDIERTYPE *pKillerSoldier, INT16 sGridNo, INT
|
||||
// HELLO! THESE ARE CREATURES! THEY CAN'T BE NEUTRAL!
|
||||
//if ( !pTeamSoldier->bNeutral && (pTeamSoldier->bSide != gbPlayerNum ) )
|
||||
{
|
||||
gTacticalStatus.ubAttackBusyCount++;
|
||||
// gTacticalStatus.ubAttackBusyCount++;
|
||||
DebugAttackBusy( "Killing off a queen ally.\n");
|
||||
EVENT_SoldierGotHit( pTeamSoldier, 0, 10000, 0, pTeamSoldier->bDirection, 320, NOBODY , FIRE_WEAPON_NO_SPECIAL, pTeamSoldier->bAimShotLocation, 0, NOWHERE );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "Tactical All.h"
|
||||
#include "Enemy Soldier Save.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <memory.h>
|
||||
|
||||
@@ -27,6 +28,11 @@
|
||||
#include "Animation Data.h"
|
||||
#include "message.h"
|
||||
#include "Font Control.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "Tactical Save.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Queen Command.h"
|
||||
#include "Scheduling.h"
|
||||
#endif
|
||||
|
||||
BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *pNode );
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include "math.h"
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
@@ -32,6 +33,10 @@
|
||||
#include "interface.h"
|
||||
#include "Quests.h"
|
||||
#include "animation control.h"
|
||||
#include "drugs and alcohol.h"
|
||||
#include "Interface Items.h"
|
||||
#include "meanwhile.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#endif
|
||||
|
||||
// Defines
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include "debug.h"
|
||||
#include "types.h"
|
||||
//#include "mssw.h"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "Tactical All.h"
|
||||
#include "language defines.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
@@ -23,6 +24,16 @@
|
||||
#include "message.h"
|
||||
#include "text.h"
|
||||
#include "random.h"
|
||||
#include "SkillCheck.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Quests.h"
|
||||
#include "Render Fun.h"
|
||||
#include "Map Screen Interface Map.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "ai.h"
|
||||
#include "Soldier macros.h"
|
||||
#endif
|
||||
|
||||
BOOLEAN gfSetPerceivedDoorState = FALSE;
|
||||
|
||||
+941
-930
File diff suppressed because it is too large
Load Diff
+17
-4
@@ -3,6 +3,7 @@
|
||||
#include "BuildDefines.h"
|
||||
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "wcheck.h"
|
||||
@@ -72,6 +73,18 @@
|
||||
#include "render dirty.h"
|
||||
#include "GameSettings.h"
|
||||
#include "los.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "Queen Command.h"
|
||||
#include "Options Screen.h"
|
||||
#include "SaveLoadGame.h"
|
||||
#include "Spread Burst.h"
|
||||
#include "ai.h"
|
||||
#include "Game Clock.h"
|
||||
#include "civ quotes.h"
|
||||
#include "Militia Control.h"
|
||||
#include "qarray.h"
|
||||
#include "environment.h"
|
||||
#include "Map Information.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1028,7 +1041,7 @@ UINT32 UIHandleExit( UI_EVENT *pUIEvent )
|
||||
UINT32 UIHandleNewMerc( UI_EVENT *pUIEvent )
|
||||
{
|
||||
static UINT8 ubTemp = 3;
|
||||
INT16 usMapPos;
|
||||
UINT16 usMapPos;
|
||||
static INT32 iSoldierCount=0;
|
||||
MERC_HIRE_STRUCT HireMercStruct;
|
||||
INT8 bReturnCode;
|
||||
@@ -1223,8 +1236,8 @@ UINT32 UIHandleTestHit( UI_EVENT *pUIEvent )
|
||||
}
|
||||
}
|
||||
|
||||
gTacticalStatus.ubAttackBusyCount++;
|
||||
|
||||
// gTacticalStatus.ubAttackBusyCount++;
|
||||
DebugAttackBusy( "Testing a hit.\n" );
|
||||
EVENT_SoldierGotHit( pSoldier, 1, bDamage, 10, pSoldier->bDirection, 320, NOBODY , FIRE_WEAPON_NO_SPECIAL, pSoldier->bAimShotLocation, 0, NOWHERE );
|
||||
// callahan update end - put everything as it was
|
||||
}
|
||||
@@ -6387,4 +6400,4 @@ BOOLEAN IsValidJumpLocation( SOLDIERTYPE *pSoldier, INT16 sGridNo, BOOLEAN fChec
|
||||
}
|
||||
|
||||
return( FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,9 @@
|
||||
#include "spread burst.h"
|
||||
#include "squads.h"
|
||||
#include "line.h"
|
||||
#include "Militia Control.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#include "civ quotes.h"
|
||||
#endif
|
||||
|
||||
/* I deleted here declaration of clock coords for tactical screen i will declare them
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "sys globals.h"
|
||||
#include "overhead.h"
|
||||
#include "interface items.h"
|
||||
#include "GameSettings.h"
|
||||
#endif
|
||||
|
||||
#define DISPLAY_AP_INDEX MOCKFLOOR1
|
||||
@@ -262,7 +263,7 @@ BOOLEAN DrawUICursor( )
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
if (GetMouseMapPos( (INT16 *)&usMapPos) )
|
||||
if (GetMouseMapPos( &usMapPos) )
|
||||
{
|
||||
gusCurMousePos = usMapPos;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "Tactical All.h"
|
||||
#include "PreBattle Interface.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include "sgp.h"
|
||||
#include "soldier control.h"
|
||||
@@ -64,6 +65,18 @@
|
||||
#include "Soldier create.h"
|
||||
#include "SkillCheck.h"
|
||||
#include "Sound Control.h"
|
||||
#include "opplist.h"
|
||||
#include "PreBattle Interface.h"
|
||||
#include "history.h"
|
||||
#include "Keys.h"
|
||||
#include "Morale.h"
|
||||
#include "personnel.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#include "Queen Command.h"
|
||||
#include "Campaign.h"
|
||||
#include "BobbyRMailOrder.h"
|
||||
#include "end game.h"
|
||||
#include "Map Screen Helicopter.h"
|
||||
#endif
|
||||
|
||||
INT16 sBasementEnterGridNos[ ] = { 13362, 13363, 13364, 13365, 13525, 13524 };
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "Tactical All.h"
|
||||
#include "language defines.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
@@ -65,6 +66,13 @@
|
||||
#include "MessageBoxScreen.h"
|
||||
#include "Language Defines.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Map Screen Interface Map Inventory.h"
|
||||
#include "Quests.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "opplist.h"
|
||||
#include "los.h"
|
||||
#include "Map Screen Interface Map.h"
|
||||
#endif
|
||||
|
||||
#define ITEMDESC_FONT BLOCKFONT2
|
||||
@@ -558,7 +566,7 @@ MOUSE_REGION gSMInvCamoRegion;
|
||||
INT8 gbCompatibleAmmo[ NUM_INV_SLOTS ];
|
||||
INT8 gbInvalidPlacementSlot[ NUM_INV_SLOTS ];
|
||||
UINT16 us16BPPItemCyclePlacedItemColors[ 20 ];
|
||||
// Kaiden: Vehicle Inventory change - Increase this from 4-2 to 5-2
|
||||
// Kaiden: Vehicle Inventory change - Increase this from 4-2 to 5-2
|
||||
UINT32 guiBodyInvVO[ 5 ][ 2 ];
|
||||
UINT32 guiGoldKeyVO;
|
||||
INT8 gbCompatibleApplyItem = FALSE;
|
||||
@@ -891,17 +899,17 @@ BOOLEAN InitInvSlotInterface( INV_REGION_DESC *pRegionDesc , INV_REGION_DESC *pC
|
||||
FilenameForBPP("INTERFACE\\inventory_figure_female_H.sti", VObjectDesc.ImageFile);
|
||||
CHECKF( AddVideoObject( &VObjectDesc, &(guiBodyInvVO[ 3 ][ 1 ] ) ) );
|
||||
|
||||
// Kaiden: Vehicle Inventory change - Added two new STI's for Vehicle Inventory
|
||||
// Feel free to change them to more appropriate pictures, I just blanked out
|
||||
// the body image for now, I'm no graphics artist.
|
||||
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
||||
FilenameForBPP("INTERFACE\\inventory_figure_Vehicle.sti",
|
||||
VObjectDesc.ImageFile);
|
||||
CHECKF( AddVideoObject( &VObjectDesc, &(guiBodyInvVO[ 4 ][ 0 ] ) ) );
|
||||
|
||||
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
||||
FilenameForBPP("INTERFACE\\inventory_figure_Vehicle_h.sti",
|
||||
VObjectDesc.ImageFile);
|
||||
// Kaiden: Vehicle Inventory change - Added two new STI's for Vehicle Inventory
|
||||
// Feel free to change them to more appropriate pictures, I just blanked out
|
||||
// the body image for now, I'm no graphics artist.
|
||||
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
||||
FilenameForBPP("INTERFACE\\inventory_figure_Vehicle.sti",
|
||||
VObjectDesc.ImageFile);
|
||||
CHECKF( AddVideoObject( &VObjectDesc, &(guiBodyInvVO[ 4 ][ 0 ] ) ) );
|
||||
|
||||
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
||||
FilenameForBPP("INTERFACE\\inventory_figure_Vehicle_h.sti",
|
||||
VObjectDesc.ImageFile);
|
||||
CHECKF( AddVideoObject( &VObjectDesc, &(guiBodyInvVO[ 4 ][ 1 ] ) ) );
|
||||
|
||||
// add gold key graphic
|
||||
@@ -1007,7 +1015,7 @@ void ShutdownInvSlotInterface( )
|
||||
{
|
||||
UINT32 cnt;
|
||||
|
||||
// Kaiden: Vehicle Inventory change - Added 4-0 and 4-1
|
||||
// Kaiden: Vehicle Inventory change - Added 4-0 and 4-1
|
||||
// to be deleted as well.
|
||||
|
||||
// Remove all body type panels
|
||||
@@ -1042,12 +1050,12 @@ void RenderInvBodyPanel( SOLDIERTYPE *pSoldier, INT16 sX, INT16 sY )
|
||||
// Blit body inv, based on body type
|
||||
INT8 bSubImageIndex = gbCompatibleApplyItem;
|
||||
|
||||
// Kaiden: Vehicle Inventory change - Added IF Test, Else function call was
|
||||
// the original statement
|
||||
if ( (gGameExternalOptions.fVehicleInventory) && (pSoldier->uiStatusFlags & SOLDIER_VEHICLE) )
|
||||
{
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiBodyInvVO[4][0], 0, sX, sY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
// Kaiden: Vehicle Inventory change - Added IF Test, Else function call was
|
||||
// the original statement
|
||||
if ( (gGameExternalOptions.fVehicleInventory) && (pSoldier->uiStatusFlags & SOLDIER_VEHICLE) )
|
||||
{
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiBodyInvVO[4][0], 0, sX, sY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
else
|
||||
{
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiBodyInvVO[ pSoldier->ubBodyType ][ bSubImageIndex ], 0, sX, sY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
@@ -4487,7 +4495,7 @@ void DrawItemTileCursor( )
|
||||
INT16 sDist;
|
||||
INT8 bLevel;
|
||||
|
||||
if (GetMouseMapPos( (INT16 *)&usMapPos) )
|
||||
if (GetMouseMapPos( &usMapPos) )
|
||||
{
|
||||
if ( gfUIFullTargetFound )
|
||||
{
|
||||
@@ -5125,8 +5133,8 @@ BOOLEAN HandleItemPointerClick( UINT16 usMapPos )
|
||||
|
||||
if (gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_STAND)
|
||||
{
|
||||
pSoldier->usPendingAnimation = PASS_OBJECT;
|
||||
}
|
||||
pSoldier->usPendingAnimation = PASS_OBJECT;
|
||||
}
|
||||
}
|
||||
|
||||
// WANNE: Also turn merc if he is crouched and he received the passed item
|
||||
@@ -5137,9 +5145,9 @@ BOOLEAN HandleItemPointerClick( UINT16 usMapPos )
|
||||
|
||||
if (gAnimControl[ gpItemPointerSoldier->usAnimState ].ubEndHeight == ANIM_STAND)
|
||||
{
|
||||
gpItemPointerSoldier->usPendingAnimation = PASS_OBJECT;
|
||||
}
|
||||
gpItemPointerSoldier->usPendingAnimation = PASS_OBJECT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return( TRUE );
|
||||
@@ -5234,8 +5242,9 @@ BOOLEAN HandleItemPointerClick( UINT16 usMapPos )
|
||||
gpItemPointerSoldier->fTurningUntilDone = TRUE;
|
||||
|
||||
// Increment attacker count...
|
||||
gTacticalStatus.ubAttackBusyCount++;
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("INcremtning ABC: Throw item to %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
// gTacticalStatus.ubAttackBusyCount++;
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("Incremtning ABC: Throw item to %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
DebugAttackBusy( "Incrementing ABC: Throw item\n" );
|
||||
|
||||
|
||||
// Given our gridno, throw grenate!
|
||||
@@ -8158,4 +8167,4 @@ void DeletePool(ITEM_POOL *pItemPool)
|
||||
pItemPool=pItemPool->pNext;
|
||||
MemFree(pItemPoolToDelete);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
@@ -70,6 +71,8 @@
|
||||
#include "LaptopSave.h"
|
||||
#include "Cursor Control.h"
|
||||
#include "MessageBoxScreen.h"
|
||||
#include "wordwrap.h"
|
||||
#include "Boxing.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include "sgp.h"
|
||||
@@ -17,6 +18,8 @@
|
||||
#include "Overhead.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "line.h"
|
||||
#include "WCheck.h"
|
||||
#include "Vehicles.h"
|
||||
#endif
|
||||
|
||||
#define LIFE_BAR_SHADOW FROMRGB( 108, 12, 12 )
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
@@ -53,6 +54,8 @@
|
||||
#include "Vehicles.h"
|
||||
#include "messageboxscreen.h"
|
||||
#include "gamesettings.h"
|
||||
#include "Squads.h"
|
||||
#include "message.h"
|
||||
#endif
|
||||
|
||||
//const UINT32 INTERFACE_START_X = 0;
|
||||
@@ -1497,7 +1500,7 @@ void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
|
||||
GetSoldier( &pSoldier, usSoldierID );
|
||||
|
||||
if ( pSoldier->bVisible == -1 && !(gTacticalStatus.uiFlags&SHOW_ALL_MERCS) )
|
||||
if ( !pSoldier || (pSoldier->bVisible == -1 && !(gTacticalStatus.uiFlags&SHOW_ALL_MERCS) ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,13 @@
|
||||
#include "Strategic Status.h"
|
||||
#include "Campaign.h"
|
||||
#include "GameSettings.h"
|
||||
#include "AIInternals.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Auto Resolve.h"
|
||||
#include "Map Screen Interface Map.h"
|
||||
#include "EnemyItemDrops.h"
|
||||
#include "strategic.h"
|
||||
#include "Game Clock.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -558,6 +565,11 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
|
||||
case IC_LAUNCHER:
|
||||
pItem->ubGunState |= GS_CARTRIDGE_IN_CHAMBER;
|
||||
fGrenadeLauncher = FALSE;
|
||||
if (fMortar || fRPG)
|
||||
{
|
||||
bGrenadeClass = 0;
|
||||
bGrenades = 0;
|
||||
}
|
||||
fMortar = FALSE;
|
||||
fRPG = FALSE;
|
||||
break;
|
||||
|
||||
+17
-2
@@ -36,6 +36,20 @@
|
||||
#include "Interface Control.h"
|
||||
#include "ShopKeeper Interface.h"
|
||||
#include "Cursors.h"
|
||||
|
||||
#include "GameSettings.h"
|
||||
#include "environment.h"
|
||||
#include "Auto Resolve.h"
|
||||
#include "Interface Items.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "history.h"
|
||||
#include "Game Clock.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Inventory Choosing.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Smell.h"
|
||||
#include "lighting.h"
|
||||
#include "utilities.h"
|
||||
#endif
|
||||
|
||||
#define ANY_MAGSIZE 255
|
||||
@@ -1607,7 +1621,8 @@ INT8 FindThrowableGrenade( SOLDIERTYPE * pSoldier )
|
||||
|
||||
for (bLoop = 0; bLoop < NUM_INV_SLOTS; bLoop++)
|
||||
{
|
||||
if ( (Item[ pSoldier->inv[ bLoop ].usItem ].usItemClass & IC_GRENADE) && !GLGrenadeInSlot( pSoldier, bLoop ) )
|
||||
if ( (Item[ pSoldier->inv[ bLoop ].usItem ].usItemClass & IC_GRENADE) && // Try this check instead, to avoid tossing RPG rounds !GLGrenadeInSlot( pSoldier, bLoop ) &&
|
||||
GetLauncherFromLaunchable( pSoldier->inv[ bLoop ].usItem) == NOTHING )
|
||||
{
|
||||
return( bLoop );
|
||||
}
|
||||
@@ -6565,7 +6580,7 @@ INT16 GetRateOfFireBonus( OBJECTTYPE * pObj )
|
||||
}
|
||||
|
||||
bns = BonusReduceMore( Item[pObj->usItem].rateoffirebonus, pObj->bStatus[0] );
|
||||
bns += Item[pObj->usGunAmmoItem].rateoffirebonus;
|
||||
bns += Item[pObj->usGunAmmoItem].rateoffirebonus ;
|
||||
|
||||
for (bLoop = 0; bLoop < MAX_ATTACHMENTS; bLoop++)
|
||||
{
|
||||
|
||||
+11
-4
@@ -1,6 +1,7 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <memory.h>
|
||||
|
||||
@@ -33,6 +34,10 @@
|
||||
#include "worlddef.h"
|
||||
#include "campaign.h"
|
||||
#include "sound control.h"
|
||||
#include "Interface.h"
|
||||
#include "Game Clock.h"
|
||||
#include "handle doors.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -662,9 +667,10 @@ void HandleDoorTrap( SOLDIERTYPE * pSoldier, DOOR * pDoor )
|
||||
// Set attacker's ID
|
||||
pSoldier->ubAttackerID = pSoldier->ubID;
|
||||
// Increment being attacked count
|
||||
pSoldier->bBeingAttackedCount++;
|
||||
gTacticalStatus.ubAttackBusyCount++;
|
||||
// pSoldier->bBeingAttackedCount++;
|
||||
// gTacticalStatus.ubAttackBusyCount++;
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Trap gone off %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
DebugAttackBusy( "!!!!!!! Trap gone off\n" );
|
||||
|
||||
SoldierTakeDamage( pSoldier, 0, (UINT16) (10 + PreRandom( 10 )), (UINT16) ((3 + PreRandom( 3 ) * 1000)), TAKE_DAMAGE_ELECTRICITY, NOBODY, pDoor->sGridNo, 0, TRUE );
|
||||
break;
|
||||
@@ -676,9 +682,10 @@ void HandleDoorTrap( SOLDIERTYPE * pSoldier, DOOR * pDoor )
|
||||
// Set attacker's ID
|
||||
pSoldier->ubAttackerID = pSoldier->ubID;
|
||||
// Increment being attacked count
|
||||
pSoldier->bBeingAttackedCount++;
|
||||
gTacticalStatus.ubAttackBusyCount++;
|
||||
// pSoldier->bBeingAttackedCount++;
|
||||
// gTacticalStatus.ubAttackBusyCount++;
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Trap gone off %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
DebugAttackBusy( "!!!!!!! Trap gone off\n" );
|
||||
|
||||
SoldierTakeDamage( pSoldier, 0, (UINT16) (20 + PreRandom( 20 )), (UINT16) ((6 + PreRandom( 6 ) * 1000)), TAKE_DAMAGE_ELECTRICITY, NOBODY, pDoor->sGridNo, 0, TRUE );
|
||||
break;
|
||||
|
||||
+677
-663
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,9 @@
|
||||
#include "sys globals.h"
|
||||
#include "message.h"
|
||||
#include "weapons.h"
|
||||
#include "environment.h"
|
||||
#include "lighting.h"
|
||||
#include "Animated ProgressBar.h"
|
||||
#endif
|
||||
|
||||
//Don't mess with this value, unless you want to force update all maps in the game!
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "wcheck.h"
|
||||
@@ -29,6 +30,14 @@
|
||||
#include "english.h"
|
||||
#include "cursors.h"
|
||||
#include "cursor control.h"
|
||||
#include "Merc Hiring.h"
|
||||
#include "Font Control.h"
|
||||
#include "message.h"
|
||||
#include "Text.h"
|
||||
#include "strategic turns.h"
|
||||
#include "ai.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "Music Control.h"
|
||||
#endif
|
||||
|
||||
#define MAX_MERC_IN_HELI 20
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "Tactical All.h"
|
||||
#include "strategic.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "wcheck.h"
|
||||
@@ -51,6 +52,12 @@
|
||||
#include "jascreens.h"
|
||||
#include "text.h"
|
||||
#include "Merc Contract.h"
|
||||
#include "LaptopSave.h"
|
||||
#include "personnel.h"
|
||||
#include "Auto Resolve.h"
|
||||
#include "Map Screen Interface Bottom.h"
|
||||
#include "Quests.h"
|
||||
#include "GameSettings.h"
|
||||
#endif
|
||||
|
||||
#define MIN_FLIGHT_PREP_TIME 6
|
||||
|
||||
@@ -10,6 +10,26 @@
|
||||
#include "Overhead.h"
|
||||
#include "strategicmap.h"
|
||||
#include "PreBattle Interface.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#include "Queen Command.h"
|
||||
#include "strategic.h"
|
||||
#include "popupbox.h"
|
||||
#include "interface control.h"
|
||||
#include "Map Screen Interface Map.h"
|
||||
#include "renderworld.h"
|
||||
#include "Text.h"
|
||||
#include "utilities.h"
|
||||
#include "Interface.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Input.h"
|
||||
#include "opplist.h"
|
||||
#include "los.h"
|
||||
#include "Items.h"
|
||||
#include "Animation Control.h"
|
||||
#include "points.h"
|
||||
#include "Campaign.h"
|
||||
#include "ai.h"
|
||||
#include "Isometric Utils.h"
|
||||
#endif
|
||||
|
||||
#include "MilitiaSquads.h"
|
||||
|
||||
@@ -15,6 +15,11 @@
|
||||
#include "drugs and alcohol.h"
|
||||
#include "StrategicMap.h"
|
||||
#include "Debug.h"
|
||||
#include "Squads.h"
|
||||
#include "ai.h"
|
||||
#include "Campaign.h"
|
||||
#include "mapscreen.h"
|
||||
#include "Soldier macros.h"
|
||||
#endif
|
||||
|
||||
#define MORALE_MOD_MAX 50 // morale *mod* range is -50 to 50, if you change this, check the decay formulas!
|
||||
|
||||
+1659
-1523
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -304,7 +304,7 @@ void CycleThroughKnownEnemies( );
|
||||
|
||||
BOOLEAN CheckForEndOfCombatMode( BOOLEAN fIncrementTurnsNotSeen );
|
||||
|
||||
SOLDIERTYPE * FreeUpAttacker( UINT8 ubID );
|
||||
SOLDIERTYPE * FreeUpAttacker( );
|
||||
|
||||
BOOLEAN PlayerTeamFull( );
|
||||
|
||||
@@ -314,7 +314,7 @@ void ResetAllMercSpeeds( );
|
||||
|
||||
BOOLEAN HandleGotoNewGridNo( SOLDIERTYPE *pSoldier, BOOLEAN *pfKeepMoving, BOOLEAN fInitialMove, UINT16 usAnimState );
|
||||
|
||||
SOLDIERTYPE * ReduceAttackBusyCount( UINT8 ubID, BOOLEAN fCalledByAttacker );
|
||||
SOLDIERTYPE * ReduceAttackBusyCount( );
|
||||
|
||||
void CommonEnterCombatModeCode( );
|
||||
|
||||
|
||||
+33
-26
@@ -24,6 +24,14 @@
|
||||
#include "SkillCheck.h"
|
||||
#include "wcheck.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Random.h"
|
||||
#include "Campaign.h"
|
||||
#include "drugs and alcohol.h"
|
||||
#include "GameSettings.h"
|
||||
#include "worldman.h"
|
||||
#include "math.h"
|
||||
#include "Interface Items.h"
|
||||
#endif
|
||||
|
||||
//rain
|
||||
@@ -823,28 +831,23 @@ INT16 GetBreathPerAP( SOLDIERTYPE *pSoldier, UINT16 usAnimState )
|
||||
fAnimTypeFound = TRUE;
|
||||
}
|
||||
|
||||
if ( gAnimControl[ usAnimState ].uiFlags & ANIM_NO_EFFORT )
|
||||
{
|
||||
sBreathPerAP = BP_PER_AP_NO_EFFORT;
|
||||
fAnimTypeFound = TRUE;
|
||||
}
|
||||
|
||||
if ( gAnimControl[ usAnimState ].uiFlags & ANIM_MIN_EFFORT )
|
||||
{
|
||||
sBreathPerAP = BP_PER_AP_MIN_EFFORT;
|
||||
fAnimTypeFound = TRUE;
|
||||
}
|
||||
|
||||
if ( gAnimControl[ usAnimState ].uiFlags & ANIM_LIGHT_EFFORT )
|
||||
{
|
||||
sBreathPerAP = BP_PER_AP_LT_EFFORT;
|
||||
fAnimTypeFound = TRUE;
|
||||
}
|
||||
|
||||
if ( gAnimControl[ usAnimState ].uiFlags & ANIM_MODERATE_EFFORT )
|
||||
{
|
||||
sBreathPerAP = BP_PER_AP_MOD_EFFORT;
|
||||
fAnimTypeFound = TRUE;
|
||||
switch ( EFFORT( gAnimControl[ usAnimState ].uiFlags) ) {
|
||||
case 0: // No effort
|
||||
sBreathPerAP = BP_PER_AP_NO_EFFORT;
|
||||
fAnimTypeFound = TRUE;
|
||||
break;
|
||||
case 1: // Minimal effort
|
||||
sBreathPerAP = BP_PER_AP_MIN_EFFORT;
|
||||
fAnimTypeFound = TRUE;
|
||||
break;
|
||||
case 2: // Light effort
|
||||
sBreathPerAP = BP_PER_AP_LT_EFFORT;
|
||||
fAnimTypeFound = TRUE;
|
||||
break;
|
||||
case 3: // Moderate effort
|
||||
sBreathPerAP = BP_PER_AP_MOD_EFFORT;
|
||||
fAnimTypeFound = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( !fAnimTypeFound )
|
||||
@@ -1089,7 +1092,7 @@ UINT8 CalcTotalAPsToAttack( SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubAddTur
|
||||
return( (INT8)sAPCost );
|
||||
}
|
||||
|
||||
UINT8 MinAPsToAttack(SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubAddTurningCost)
|
||||
UINT8 MinAPsToAttack(SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubAddTurningCost, UINT8 ubForceRaiseGunCost)
|
||||
{
|
||||
UINT16 sAPCost = 0;
|
||||
UINT32 uiItemClass;
|
||||
@@ -1119,7 +1122,7 @@ UINT8 MinAPsToAttack(SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubAddTurningCos
|
||||
|
||||
if ( uiItemClass == IC_BLADE || uiItemClass == IC_GUN || uiItemClass == IC_LAUNCHER || uiItemClass == IC_TENTACLES || uiItemClass == IC_THROWING_KNIFE )
|
||||
{
|
||||
sAPCost = MinAPsToShootOrStab( pSoldier, sGridno, ubAddTurningCost );
|
||||
sAPCost = MinAPsToShootOrStab( pSoldier, sGridno, ubAddTurningCost, ubForceRaiseGunCost );
|
||||
}
|
||||
else if ( uiItemClass & ( IC_GRENADE | IC_THROWN ) )
|
||||
{
|
||||
@@ -1237,7 +1240,7 @@ void GetAPChargeForShootOrStabWRTGunRaises( SOLDIERTYPE *pSoldier, INT16 sGridNo
|
||||
(*pfChargeRaise ) = fAddingRaiseGunCost;
|
||||
}
|
||||
|
||||
UINT8 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubAddTurningCost)
|
||||
UINT8 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubAddTurningCost, UINT8 ubForceRaiseGunCost)
|
||||
{
|
||||
UINT32 uiMercFlags;
|
||||
UINT16 usTargID;
|
||||
@@ -1263,6 +1266,10 @@ UINT8 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubAddTurni
|
||||
|
||||
GetAPChargeForShootOrStabWRTGunRaises( pSoldier, sGridNo, ubAddTurningCost, &fAddingTurningCost, &fAddingRaiseGunCost );
|
||||
|
||||
if (ubForceRaiseGunCost)
|
||||
{
|
||||
fAddingRaiseGunCost = TRUE;
|
||||
}
|
||||
|
||||
if ( Item[ usItem ].usItemClass == IC_THROWING_KNIFE )
|
||||
{
|
||||
@@ -1306,7 +1313,7 @@ UINT8 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubAddTurni
|
||||
}
|
||||
|
||||
// if attacking a new target (or if the specific target is uncertain)
|
||||
if (( sGridNo != pSoldier->sLastTarget ) && !Item[usItem].rocketlauncher )
|
||||
if (ubForceRaiseGunCost || (( sGridNo != pSoldier->sLastTarget ) && !Item[usItem].rocketlauncher ))
|
||||
{
|
||||
bAPCost += AP_CHANGE_TARGET;
|
||||
}
|
||||
|
||||
+2
-2
@@ -282,11 +282,11 @@ void DeductPoints( SOLDIERTYPE *pSoldier, INT16 sAPCost, INT32 iBPCost, BOOLEAN
|
||||
INT32 AdjustBreathPts(SOLDIERTYPE *pSold, INT32 iBPCost);
|
||||
void UnusedAPsToBreath(SOLDIERTYPE *pSold);
|
||||
INT16 TerrainBreathPoints(SOLDIERTYPE * pSoldier, INT16 sGridno,INT8 bDir, UINT16 usMovementMode);
|
||||
UINT8 MinAPsToAttack(SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubAddTurningCost);
|
||||
UINT8 MinAPsToAttack(SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubAddTurningCost, UINT8 ubForceRaiseGunCost = 0);
|
||||
INT8 MinPtsToMove(SOLDIERTYPE *pSoldier);
|
||||
INT8 MinAPsToStartMovement( SOLDIERTYPE * pSoldier, UINT16 usMovementMode );
|
||||
INT8 PtsToMoveDirection(SOLDIERTYPE *pSoldier, INT8 bDirection );
|
||||
UINT8 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubAddTurningCost );
|
||||
UINT8 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT16 sGridno, UINT8 ubAddTurningCost, UINT8 ubForceRaiseGunCost = 0 );
|
||||
BOOLEAN EnoughAmmo( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay, INT8 bInvPos );
|
||||
void DeductAmmo( SOLDIERTYPE *pSoldier, INT8 bInvPos );
|
||||
|
||||
|
||||
@@ -42,6 +42,17 @@
|
||||
#ifdef DEBUG_INTERRUPTS
|
||||
#include "debug.h"
|
||||
#endif
|
||||
#include "render dirty.h"
|
||||
#include "GameSettings.h"
|
||||
#include "screenids.h"
|
||||
#include "vsurface.h"
|
||||
#include "math.h"
|
||||
#include "merctextbox.h"
|
||||
#include "Video.h"
|
||||
#include "local.h"
|
||||
#include "line.h"
|
||||
#include "overhead map.h"
|
||||
#include "interface dialogue.h"
|
||||
#endif
|
||||
|
||||
#include "Rain.h"
|
||||
|
||||
+983
-981
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "wcheck.h"
|
||||
@@ -34,6 +35,14 @@
|
||||
#include "World Items.h"
|
||||
#include "explosion control.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Interface Items.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Keys.h"
|
||||
#include "Render Fun.h"
|
||||
#include "strategic.h"
|
||||
#include "qarray.h"
|
||||
#include "Interface.h"
|
||||
#endif
|
||||
|
||||
#define CORPSE_WARNING_MAX 5
|
||||
@@ -951,6 +960,13 @@ BOOLEAN TurnSoldierIntoCorpse( SOLDIERTYPE *pSoldier, BOOLEAN fRemoveMerc, BOOLE
|
||||
if( pSoldier->bTeam == ENEMY_TEAM )
|
||||
Corpse.ubAIWarningValue = 20;
|
||||
|
||||
// This should free up ABC for death codes
|
||||
if ( gAnimControl[ pSoldier->usAnimState ].uiFlags & ANIM_ATTACK )
|
||||
{
|
||||
DebugAttackBusy( "%%%%%%%%% Freeing up attacker because soldier became a corpse.\n");
|
||||
ReduceAttackBusyCount( );
|
||||
}
|
||||
|
||||
//if we are to call TacticalRemoveSoldier after adding the corpse
|
||||
if( fRemoveMerc )
|
||||
{
|
||||
|
||||
@@ -45,6 +45,13 @@
|
||||
#include "MessageBoxScreen.h"
|
||||
#include "LINE.H"
|
||||
#include "Drugs and Alcohol.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "armsdealerinvinit.h"
|
||||
#include "opplist.h"
|
||||
#include "los.h"
|
||||
#include "NPC.h"
|
||||
#include "Soldier Create.h"
|
||||
#endif
|
||||
|
||||
#include "BuildDefines.h"
|
||||
@@ -2618,8 +2625,8 @@ UINT32 DisplayInvSlot( UINT8 ubSlotNum, UINT16 usItemIndex, UINT16 usPosX, UINT1
|
||||
usHeight = (UINT32)pTrav->usHeight;
|
||||
usWidth = (UINT32)pTrav->usWidth;
|
||||
|
||||
sCenX = usPosX + 7 + (INT16)( abs( SKI_INV_WIDTH - 3.0 - usWidth ) / 2 ) - pTrav->sOffsetX;
|
||||
sCenY = usPosY + (INT16)( abs( SKI_INV_HEIGHT - (double)usHeight ) / 2 ) - pTrav->sOffsetY;
|
||||
sCenX = usPosX + 7 + (INT16)( abs( SKI_INV_WIDTH - 3 - usWidth ) / 2 ) - pTrav->sOffsetX;
|
||||
sCenY = usPosY + (INT16)( abs( SKI_INV_HEIGHT - usHeight ) / 2 ) - pTrav->sOffsetY;
|
||||
|
||||
|
||||
//Restore the background region
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
#include "fov.h"
|
||||
#include "pathai.h"
|
||||
#include "Random.h"
|
||||
#include "Render Fun.h"
|
||||
#include "meanwhile.h"
|
||||
#include "Exit Grids.h"
|
||||
#endif
|
||||
|
||||
// Adds a soldier to a world gridno and set's direction
|
||||
|
||||
+2653
-2619
File diff suppressed because it is too large
Load Diff
+2602
-2510
File diff suppressed because it is too large
Load Diff
@@ -793,7 +793,7 @@ typedef struct
|
||||
UINT32 uiChangeMechanicalTime;
|
||||
|
||||
UINT32 uiUniqueSoldierIdValue; // the unique value every instance of a soldier gets - 1 is the first valid value
|
||||
INT8 bBeingAttackedCount; // Being attacked counter
|
||||
INT8 bBeingAttackedCount; // Being attacked counter is obsolete and can be renamed and used as something else
|
||||
|
||||
INT8 bNewItemCount[ NUM_INV_SLOTS ];
|
||||
INT8 bNewItemCycleCount[ NUM_INV_SLOTS ];
|
||||
@@ -1096,7 +1096,8 @@ UINT8 atan8FromAngle( DOUBLE dAngle );
|
||||
INT8 CalcActionPoints(SOLDIERTYPE *pSold );
|
||||
BOOLEAN IsActionInterruptable( SOLDIERTYPE *pSoldier );
|
||||
INT16 GetDirectionToGridNoFromGridNo( INT16 sGridNoDest, INT16 sGridNoSrc );
|
||||
void ReleaseSoldiersAttacker( SOLDIERTYPE *pSoldier );
|
||||
// This function is now obsolete. Call ReduceAttackBusyCount instead.
|
||||
// void ReleaseSoldiersAttacker( SOLDIERTYPE *pSoldier );
|
||||
BOOLEAN MercInWater( SOLDIERTYPE *pSoldier );
|
||||
UINT16 GetNewSoldierStateFromNewStance( SOLDIERTYPE *pSoldier, UINT8 ubDesiredStance );
|
||||
UINT16 GetMoveStateBasedOnStance( SOLDIERTYPE *pSoldier, UINT8 ubStanceHeight );
|
||||
|
||||
@@ -42,6 +42,9 @@
|
||||
#include "PreBattle Interface.h"
|
||||
#include "Auto Resolve.h"
|
||||
#include "Morale.h"
|
||||
#include "ai.h"
|
||||
#include "Strategic Mines.h"
|
||||
#include "math.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -50,6 +50,9 @@
|
||||
#include "EditorMercs.h"
|
||||
#include "soldier tile.h"
|
||||
#include "soldier find.h"
|
||||
#include "Vehicles.h"
|
||||
#include "GameSettings.h"
|
||||
#include "ui cursors.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -93,13 +96,13 @@ extern UINT32 guiUITargetSoldierId;
|
||||
|
||||
BOOLEAN FindSoldierFromMouse( UINT16 *pusSoldierIndex, UINT32 *pMercFlags )
|
||||
{
|
||||
INT16 sMapPos;
|
||||
UINT16 usMapPos;
|
||||
|
||||
*pMercFlags = 0;
|
||||
|
||||
if ( GetMouseMapPos( &sMapPos ) )
|
||||
if ( GetMouseMapPos( &usMapPos ) )
|
||||
{
|
||||
if ( FindSoldier( sMapPos, pusSoldierIndex, pMercFlags ,FINDSOLDIERSAMELEVEL( gsInterfaceLevel ) ) )
|
||||
if ( FindSoldier( usMapPos, pusSoldierIndex, pMercFlags ,FINDSOLDIERSAMELEVEL( gsInterfaceLevel ) ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
@@ -110,13 +113,13 @@ BOOLEAN FindSoldierFromMouse( UINT16 *pusSoldierIndex, UINT32 *pMercFlags )
|
||||
|
||||
BOOLEAN SelectiveFindSoldierFromMouse( UINT16 *pusSoldierIndex, UINT32 *pMercFlags )
|
||||
{
|
||||
INT16 sMapPos;
|
||||
UINT16 usMapPos;
|
||||
|
||||
*pMercFlags = 0;
|
||||
|
||||
if ( GetMouseMapPos( &sMapPos ) )
|
||||
if ( GetMouseMapPos( &usMapPos ) )
|
||||
{
|
||||
if ( FindSoldier( sMapPos, pusSoldierIndex, pMercFlags , FINDSOLDIERSAMELEVEL( gsInterfaceLevel ) ) )
|
||||
if ( FindSoldier( usMapPos, pusSoldierIndex, pMercFlags , FINDSOLDIERSAMELEVEL( gsInterfaceLevel ) ) )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <memory.h>
|
||||
|
||||
@@ -26,6 +27,24 @@
|
||||
#include "Animation Data.h"
|
||||
#include "message.h"
|
||||
#include "Font Control.h"
|
||||
#include "Sound Control.h"
|
||||
#include "Quests.h"
|
||||
#include "Render Fun.h"
|
||||
#include "meanwhile.h"
|
||||
#include "Map Screen Interface Map.h"
|
||||
#include "mapscreen.h"
|
||||
#include "Debug Control.h"
|
||||
#include "Inventory Choosing.h"
|
||||
#include "Strategic AI.h"
|
||||
#include "strategic.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "ai.h"
|
||||
#include "NPC.h"
|
||||
#include "Scheduling.h"
|
||||
#include "opplist.h"
|
||||
#include "MessageBoxScreen.h"
|
||||
#include "screenids.h"
|
||||
#include "SaveLoadScreen.h"
|
||||
#endif
|
||||
|
||||
#include "Map Edgepoints.h"
|
||||
|
||||
@@ -46,6 +46,13 @@
|
||||
#include "Interface Dialogue.h"
|
||||
#include "GameSettings.h"
|
||||
#include "strategic town reputation.h"
|
||||
#include "interface utils.h"
|
||||
#include "Game Event Hook.h"
|
||||
#include "Map Information.h"
|
||||
#include "history.h"
|
||||
#include "personnel.h"
|
||||
#include "environment.h"
|
||||
#include "Player Command.h"
|
||||
#endif
|
||||
|
||||
#ifdef JA2EDITOR
|
||||
|
||||
@@ -54,6 +54,10 @@
|
||||
#include "soldier tile.h"
|
||||
#include "soldier add.h"
|
||||
#include "fov.h"
|
||||
#include "Font Control.h"
|
||||
#include "message.h"
|
||||
#include "Text.h"
|
||||
#include "NPC.h"
|
||||
#endif
|
||||
|
||||
extern INT8 gbNumMercsUntilWaitingOver;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "teamturns.h"
|
||||
#include "soldier profile.h"
|
||||
#include "assignments.h"
|
||||
#include "Animation Data.h"
|
||||
|
||||
// MACROS
|
||||
#define RPC_RECRUITED( p ) ( ( p->ubProfile == NO_PROFILE ) ? FALSE : ( gMercProfiles[ p->ubProfile ].ubMiscFlags & PROFILE_MISC_FLAG_RECRUITED ) )
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "Types.h"
|
||||
#include "Windows.h"
|
||||
#include "Soldier Control.h"
|
||||
#include "Input.h"
|
||||
#include "english.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Overhead.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Text.h"
|
||||
#include "lighting.h"
|
||||
#include "Interface.h"
|
||||
#include "weapons.h"
|
||||
#include "renderworld.h"
|
||||
#include "Font Control.h"
|
||||
#include "font.h"
|
||||
#include "local.h"
|
||||
#include "vsurface.h"
|
||||
#include "line.h"
|
||||
#endif
|
||||
|
||||
struct MOUSETT
|
||||
{
|
||||
@@ -35,7 +57,7 @@ void SoldierTooltip( SOLDIERTYPE* pSoldier )
|
||||
MOUSETT *pRegion = &mouseTT;
|
||||
CHAR16 pStrInfo[ sizeof( pRegion->FastHelpText ) ];
|
||||
int iNVG = 0;
|
||||
INT16 sSoldierGridNo;
|
||||
UINT16 usSoldierGridNo;
|
||||
BOOLEAN fDisplayBigSlotItem = FALSE;
|
||||
BOOLEAN fMercIsUsingScope = FALSE;
|
||||
UINT16 iCarriedRL = 0;
|
||||
@@ -46,12 +68,12 @@ void SoldierTooltip( SOLDIERTYPE* pSoldier )
|
||||
fDrawTooltip = TRUE;
|
||||
|
||||
// get the gridno the cursor is at
|
||||
GetMouseMapPos( &sSoldierGridNo );
|
||||
GetMouseMapPos( &usSoldierGridNo );
|
||||
|
||||
// get the distance to enemy's tile from the selected merc
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
{
|
||||
iRangeToTarget = GetRangeInCellCoordsFromGridNoDiff( MercPtrs[ gusSelectedSoldier ]->sGridNo, sSoldierGridNo ) / 10;
|
||||
iRangeToTarget = GetRangeInCellCoordsFromGridNoDiff( MercPtrs[ gusSelectedSoldier ]->sGridNo, usSoldierGridNo ) / 10;
|
||||
}
|
||||
// WANNE: If we want to show the tooltip of milita and no merc is present in the sector
|
||||
else
|
||||
@@ -129,9 +151,9 @@ void SoldierTooltip( SOLDIERTYPE* pSoldier )
|
||||
{
|
||||
// display "debug" info
|
||||
if ( gGameExternalOptions.fEnableSoldierTooltipLocation )
|
||||
swprintf( pStrInfo, gzTooltipStrings[STR_TT_CAT_LOCATION], pStrInfo, sSoldierGridNo );
|
||||
swprintf( pStrInfo, gzTooltipStrings[STR_TT_CAT_LOCATION], pStrInfo, usSoldierGridNo );
|
||||
if ( gGameExternalOptions.fEnableSoldierTooltipBrightness )
|
||||
swprintf( pStrInfo, gzTooltipStrings[STR_TT_CAT_BRIGHTNESS], pStrInfo, SHADE_MIN - LightTrueLevel( sSoldierGridNo, gsInterfaceLevel ), SHADE_MIN );
|
||||
swprintf( pStrInfo, gzTooltipStrings[STR_TT_CAT_BRIGHTNESS], pStrInfo, SHADE_MIN - LightTrueLevel( usSoldierGridNo, gsInterfaceLevel ), SHADE_MIN );
|
||||
if ( gGameExternalOptions.fEnableSoldierTooltipRangeToTarget )
|
||||
swprintf( pStrInfo, gzTooltipStrings[STR_TT_CAT_RANGE_TO_TARGET], pStrInfo, iRangeToTarget );
|
||||
if ( gGameExternalOptions.fEnableSoldierTooltipID )
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "render dirty.h"
|
||||
#include "interface.h"
|
||||
#include "spread burst.h"
|
||||
#include "points.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
#include "Vehicles.h"
|
||||
#include "Map Screen Helicopter.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Debug.h"
|
||||
#include "jascreens.h"
|
||||
#include "screenids.h"
|
||||
#include "Soldier macros.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "PreBattle Interface.h"
|
||||
#include "creature spreading.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include "Button System.h"
|
||||
#include "mousesystem.h"
|
||||
@@ -24,6 +25,16 @@
|
||||
#include "input.h"
|
||||
#include "english.h"
|
||||
#include "text.h"
|
||||
#include "Strategic Movement.h"
|
||||
#include "Squads.h"
|
||||
#include "Assignments.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Map Screen Interface Map.h"
|
||||
#include "PreBattle Interface.h"
|
||||
#include "strategic.h"
|
||||
#include "MessageBoxScreen.h"
|
||||
#include "Quests.h"
|
||||
#include "Creature Spreading.h"
|
||||
#endif
|
||||
|
||||
BOOLEAN gfInSectorExitMenu = FALSE;
|
||||
|
||||
+120
-2
@@ -31,6 +31,23 @@
|
||||
#include "debug.h"
|
||||
#include "Random.h"
|
||||
#include "quests.h"
|
||||
#include "Animated ProgressBar.h"
|
||||
#include "Text.h"
|
||||
#include "meanwhile.h"
|
||||
#include "Enemy Soldier Save.h"
|
||||
#include "SmokeEffects.h"
|
||||
#include "LightEffects.h"
|
||||
#include "PATHAI.H"
|
||||
#include "GameVersion.h"
|
||||
#include "strategic.h"
|
||||
#include "Map Screen Interface Map.h"
|
||||
#include "Strategic Status.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "sgp.h"
|
||||
#include "MessageBoxScreen.h"
|
||||
#include "screenids.h"
|
||||
#include "Queen Command.h"
|
||||
#include "Map Screen Interface Map Inventory.h"
|
||||
#endif
|
||||
|
||||
BOOLEAN gfWasInMeanwhile = FALSE;
|
||||
@@ -1741,13 +1758,113 @@ BOOLEAN LoadRottingCorpsesFromTempCorpseFile( INT16 sMapX, INT16 sMapY, INT8 bMa
|
||||
}
|
||||
|
||||
|
||||
// Rewritten to load the temp file once, update with the list, and then write it. This was getting insane as items piled up in sectors.
|
||||
// A few dozen read, update, writes was okay but a few hundred is pushing it.
|
||||
|
||||
|
||||
BOOLEAN AddWorldItemsToUnLoadedSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ, INT16 sGridNo, UINT32 uiNumberOfItems, WORLDITEM *pWorldItem, BOOLEAN fOverWrite )
|
||||
BOOLEAN AddWorldItemsToUnLoadedSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ, INT16 sGridNo, UINT32 uiNumberOfItemsToAdd, WORLDITEM *pWorldItem, BOOLEAN fOverWrite )
|
||||
{
|
||||
UINT32 uiLoop;
|
||||
BOOLEAN fLoop=fOverWrite;
|
||||
UINT32 uiLastItemPos;
|
||||
UINT32 uiNumberOfItems;
|
||||
WORLDITEM *pWorldItems;
|
||||
|
||||
if( !GetNumberOfWorldItemsFromTempItemFile( sMapX, sMapY, bMapZ, &uiNumberOfItems, TRUE ) )
|
||||
{
|
||||
//Errror getting the numbers of the items from the sector
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
//Allocate memory for the item
|
||||
pWorldItems = (WORLDITEM *) MemAlloc( sizeof( WORLDITEM ) * uiNumberOfItems );
|
||||
if( pWorldItems == NULL )
|
||||
{
|
||||
//Error Allocating memory for the temp item array
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
//Clear the memory
|
||||
memset( pWorldItems, 0, sizeof( WORLDITEM ) * uiNumberOfItems );
|
||||
|
||||
//Load in the sectors Item Info
|
||||
if( !LoadWorldItemsFromTempItemFile( sMapX, sMapY, bMapZ, pWorldItems ) )
|
||||
{
|
||||
//error reading in the items from the Item mod file
|
||||
MemFree( pWorldItems );
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
//if we are to replace the entire file
|
||||
if( fOverWrite )
|
||||
{
|
||||
//first loop through and mark all entries that they dont exists
|
||||
for( UINT32 cnt=0; cnt<uiNumberOfItems; cnt++)
|
||||
pWorldItems[ cnt ].fExists = FALSE;
|
||||
|
||||
//Now delete the item temp file
|
||||
DeleteTempItemMapFile( sMapX, sMapY, bMapZ );
|
||||
}
|
||||
|
||||
uiLastItemPos = 0;
|
||||
|
||||
//loop through all the objects to add
|
||||
for( uiLoop=0; uiLoop < uiNumberOfItemsToAdd; uiLoop++)
|
||||
{
|
||||
//Loop through the array to see if there is a free spot to add an item to it
|
||||
for( ; uiLastItemPos < uiNumberOfItems; uiLastItemPos++)
|
||||
{
|
||||
if( pWorldItems[ uiLastItemPos ].fExists == FALSE )
|
||||
{
|
||||
//We have found a free spot, break
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( uiLastItemPos == ( uiNumberOfItems ) )
|
||||
{
|
||||
//Error, there wasnt a free spot. Reallocate memory for the array
|
||||
pWorldItems = (WORLDITEM *) MemRealloc( pWorldItems, sizeof( WORLDITEM ) * (uiNumberOfItems + 1 ) );
|
||||
if( pWorldItems == NULL )
|
||||
{
|
||||
//error realloctin memory
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
//Increment the total number of item in the array
|
||||
uiNumberOfItems++;
|
||||
}
|
||||
|
||||
pWorldItems[ uiLastItemPos ].fExists = TRUE;
|
||||
pWorldItems[ uiLastItemPos ].sGridNo = pWorldItem[ uiLoop ].sGridNo;
|
||||
pWorldItems[ uiLastItemPos ].ubLevel = pWorldItem[ uiLoop ].ubLevel;
|
||||
pWorldItems[ uiLastItemPos ].usFlags = pWorldItem[ uiLoop ].usFlags;
|
||||
pWorldItems[ uiLastItemPos ].bVisible = pWorldItem[ uiLoop ].bVisible;
|
||||
pWorldItems[ uiLastItemPos ].bRenderZHeightAboveLevel = pWorldItem[ uiLoop ].bRenderZHeightAboveLevel;
|
||||
|
||||
|
||||
//Check
|
||||
if( pWorldItem[ uiLoop ].sGridNo == NOWHERE && !( pWorldItems[ uiLastItemPos ].usFlags & WORLD_ITEM_GRIDNO_NOT_SET_USE_ENTRY_POINT ) )
|
||||
{
|
||||
pWorldItems[ uiLastItemPos ].usFlags |= WORLD_ITEM_GRIDNO_NOT_SET_USE_ENTRY_POINT;
|
||||
|
||||
// Display warning.....
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_BETAVERSION, L"Error: Trying to add item ( %d: %s ) to invalid gridno in unloaded sector. Please Report.", pWorldItems[ uiLoop ].o.usItem, ItemNames[pWorldItems[ uiLoop ].o.usItem] );
|
||||
}
|
||||
|
||||
|
||||
memcpy( &(pWorldItems[ uiLastItemPos ].o), &pWorldItem[ uiLoop ].o, sizeof( OBJECTTYPE ) );
|
||||
}
|
||||
|
||||
//Save the Items to the the file
|
||||
SaveWorldItemsToTempItemFile( sMapX, sMapY, bMapZ, uiNumberOfItems, pWorldItems );
|
||||
|
||||
|
||||
//Free the memory used to load in the item array
|
||||
MemFree( pWorldItems );
|
||||
|
||||
#if 0
|
||||
// The old excruciatingly inefficient code
|
||||
for( uiLoop=0; uiLoop<uiNumberOfItems; uiLoop++)
|
||||
{
|
||||
//If the item exists
|
||||
@@ -1758,6 +1875,7 @@ BOOLEAN AddWorldItemsToUnLoadedSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ, INT
|
||||
fLoop = FALSE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
#include "lighteffects.h"
|
||||
#include "campaign.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Random.h"
|
||||
#include "Explosion Control.h"
|
||||
#endif
|
||||
|
||||
#include "Reinforcement.h"
|
||||
|
||||
+11
-1
@@ -41,6 +41,12 @@
|
||||
#ifdef DEBUG_INTERRUPTS
|
||||
#include "debug.h"
|
||||
#endif
|
||||
#include "renderworld.h"
|
||||
#include "rotting corpses.h"
|
||||
#include "Squads.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "NPC.h"
|
||||
#endif
|
||||
|
||||
#include "Reinforcement.h"
|
||||
@@ -197,6 +203,10 @@ void StartPlayerTeamTurn( BOOLEAN fDoBattleSnd, BOOLEAN fEnteringCombatMode )
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("StartPlayerTeamTurn: SelectNextAvailSoldier"));
|
||||
SelectNextAvailSoldier( MercPtrs[ gusSelectedSoldier ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectSoldier( gusSelectedSoldier, FALSE, FALSE);
|
||||
}
|
||||
|
||||
// Slide to selected guy...
|
||||
if ( gusSelectedSoldier != NO_SOLDIER )
|
||||
@@ -2140,4 +2150,4 @@ BOOLEAN NPCFirstDraw( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pTargetSoldier )
|
||||
}
|
||||
}
|
||||
return( FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
+2671
-2660
File diff suppressed because it is too large
Load Diff
@@ -26,6 +26,9 @@
|
||||
#include "soldier macros.h"
|
||||
#include "text.h"
|
||||
#include "spread burst.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Interactive Tiles.h"
|
||||
#include "PATHAI.H"
|
||||
#endif
|
||||
|
||||
// FUNCTIONS FOR ITEM CURSOR HANDLING
|
||||
@@ -1129,7 +1132,7 @@ void DetermineCursorBodyLocation( UINT8 ubSoldierID, BOOLEAN fDisplay, BOOLEAN f
|
||||
// ALWAYS SET AIM LOCATION TO NOTHING
|
||||
pSoldier->bAimShotLocation = AIM_SHOT_RANDOM;
|
||||
|
||||
if( !GetMouseMapPos( (INT16 *)&usMapPos) )
|
||||
if( !GetMouseMapPos( &usMapPos) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1919,7 +1922,7 @@ void HandleLeftClickCursor( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
UINT16 usInHand;
|
||||
UINT8 ubItemCursor;
|
||||
INT16 sGridNo;
|
||||
UINT16 usGridNo;
|
||||
|
||||
// LOOK IN GUY'S HAND TO CHECK LOCATION
|
||||
usInHand = pSoldier->inv[HANDPOS].usItem;
|
||||
@@ -1938,7 +1941,7 @@ void HandleLeftClickCursor( SOLDIERTYPE *pSoldier )
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GetMouseMapPos( &sGridNo ) )
|
||||
if (!GetMouseMapPos( &usGridNo ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2002,7 +2005,7 @@ void HandleLeftClickCursor( SOLDIERTYPE *pSoldier )
|
||||
|
||||
case TOSSCURS:
|
||||
|
||||
//BeginAimCubeUI( pSoldier, sGridNo, (INT8)gsInterfaceLevel, 0, 0 );
|
||||
//BeginAimCubeUI( pSoldier, usGridNo, (INT8)gsInterfaceLevel, 0, 0 );
|
||||
//break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -29,6 +29,15 @@
|
||||
#include "animation control.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Interface Control.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#include "jascreens.h"
|
||||
#include "screenids.h"
|
||||
#include "Quests.h"
|
||||
#include "Tactical Save.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "opplist.h"
|
||||
#include "Soldier ani.h"
|
||||
#endif
|
||||
|
||||
INT8 gubVehicleMovementGroups[ MAX_VEHICLES ];
|
||||
|
||||
+87
-60
@@ -42,6 +42,10 @@
|
||||
#include "Debug Control.h"
|
||||
#include "expat.h"
|
||||
#include "XML.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "SmokeEffects.h"
|
||||
#include "lighting.h"
|
||||
#include "Auto Resolve.h"
|
||||
#endif
|
||||
|
||||
//rain
|
||||
@@ -1289,7 +1293,7 @@ BOOLEAN FireWeapon( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
{
|
||||
// FREE UP NPC!
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - attack on own gridno!") );
|
||||
FreeUpAttacker( (UINT8) pSoldier->ubID );
|
||||
FreeUpAttacker( );
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
@@ -1531,6 +1535,10 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
// ONly deduct points once
|
||||
if ( pSoldier->bDoBurst == 1 )
|
||||
{
|
||||
INT8 bShotsToFire = pSoldier->bDoAutofire ?
|
||||
pSoldier->bDoAutofire :
|
||||
GetShotsPerBurst(&pSoldier->inv[HANDPOS]);
|
||||
|
||||
if ( Weapon[ usItemNum ].sBurstSound != NO_WEAPON_SOUND )
|
||||
{
|
||||
// IF we are silenced?
|
||||
@@ -1538,7 +1546,7 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
if( noisefactor < MAX_PERCENT_NOISE_VOLUME_FOR_SILENCED_SOUND || Weapon[ usItemNum ].ubAttackVolume <= 10 )
|
||||
{
|
||||
// Pick sound file baed on how many bullets we are going to fire...
|
||||
sprintf( zBurstString, gzBurstSndStrings[ Weapon[ usItemNum ].sSilencedBurstSound ], pSoldier->bBulletsLeft );
|
||||
sprintf( zBurstString, gzBurstSndStrings[ Weapon[ usItemNum ].sSilencedBurstSound ], bShotsToFire );
|
||||
|
||||
// Try playing sound...
|
||||
pSoldier->iBurstSoundID = PlayJA2SampleFromFile( zBurstString, RATE_11025, SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ) );
|
||||
@@ -1547,7 +1555,7 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
{
|
||||
// Pick sound file baed on how many bullets we are going to fire...
|
||||
// Lesh: changed next line
|
||||
sprintf( zBurstString, gzBurstSndStrings[ Weapon[ usItemNum ].sBurstSound ], pSoldier->bBulletsLeft );
|
||||
sprintf( zBurstString, gzBurstSndStrings[ Weapon[ usItemNum ].sBurstSound ], bShotsToFire );
|
||||
|
||||
INT8 volume = HIGHVOLUME;
|
||||
if ( noisefactor < 100 ) volume = (volume * noisefactor) / 100;
|
||||
@@ -1880,8 +1888,10 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
}
|
||||
// Reduce again for attack end 'cause it has been incremented for a normal attack
|
||||
//
|
||||
// Not anymore. Only the attack animation was increased, and it will decrease itself.
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - ATTACK ANIMATION %s ENDED BY BAD EXPLOSIVE CHECK, Now %d", gAnimControl[ pSoldier->usAnimState ].zAnimStr, gTacticalStatus.ubAttackBusyCount ) );
|
||||
ReduceAttackBusyCount( pSoldier->ubID, FALSE );
|
||||
DebugAttackBusy( String("@@@@@@@ Freeing up attacker - ATTACK ANIMATION %s ENDED BY BAD EXPLOSIVE CHECK\n", gAnimControl[ pSoldier->usAnimState ].zAnimStr ) );
|
||||
// ReduceAttackBusyCount( pSoldier->ubID, FALSE );
|
||||
|
||||
return( FALSE );
|
||||
}
|
||||
@@ -1918,8 +1928,9 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
if ( gAnimControl[ MercPtrs[ ubMerc ]->usAnimState ].ubHeight != ANIM_PRONE )
|
||||
{
|
||||
// Increment attack counter...
|
||||
gTacticalStatus.ubAttackBusyCount++;
|
||||
// gTacticalStatus.ubAttackBusyCount++;
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("Incrementing Attack: Exaust from LAW", gTacticalStatus.ubAttackBusyCount ) );
|
||||
DebugAttackBusy( "Incrementing Attack: Exaust from LAW\n" );
|
||||
|
||||
EVENT_SoldierGotHit( MercPtrs[ ubMerc ], MINI_GRENADE, 10, 200, pSoldier->bDirection, 0, pSoldier->ubID, 0, ANIM_CROUCH, 0, sNewGridNo );
|
||||
}
|
||||
@@ -2095,8 +2106,9 @@ BOOLEAN UseBlade( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
StatChange( MercPtrs[ pTargetSoldier->ubID ], STRAMT, 5, FALSE);
|
||||
}
|
||||
}
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - missed in knife attack") );
|
||||
FreeUpAttacker( (UINT8) pSoldier->ubID );
|
||||
// 0verhaul: Another case that is handled by the animation transition system.
|
||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - missed in knife attack") );
|
||||
// FreeUpAttacker( (UINT8) pSoldier->ubID );
|
||||
}
|
||||
|
||||
if ( PTR_OURTEAM && pSoldier->ubTargetID != NOBODY)
|
||||
@@ -2136,11 +2148,12 @@ BOOLEAN UseBlade( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
|
||||
StatChange( pSoldier, STRAMT, usExpGain/3, ( UINT8 )( fGonnaHit ? FALSE : FROM_FAILURE ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - missed in knife attack") );
|
||||
FreeUpAttacker( (UINT8) pSoldier->ubID );
|
||||
}
|
||||
// 0verhaul: This case is also handled by the animation translations
|
||||
// else
|
||||
// {
|
||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - missed in knife attack") );
|
||||
// FreeUpAttacker( (UINT8) pSoldier->ubID );
|
||||
// }
|
||||
|
||||
// possibly reduce monster smell
|
||||
if ( pSoldier->bMonsterSmell > 0 && Random( 5 ) == 0 )
|
||||
@@ -2382,10 +2395,11 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, BOOLEAN fStea
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - steal") );
|
||||
#endif
|
||||
FreeUpAttacker( (UINT8) pSoldier->ubID );
|
||||
// 0verhaul: Also handled in the animation transition
|
||||
// #ifdef JA2BETAVERSION
|
||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - steal") );
|
||||
// #endif
|
||||
// FreeUpAttacker( (UINT8) pSoldier->ubID );
|
||||
}
|
||||
|
||||
// -----------------------------------
|
||||
@@ -2471,11 +2485,12 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, BOOLEAN fStea
|
||||
SWeaponHit.ubSpecial = FIRE_WEAPON_NO_SPECIAL;
|
||||
AddGameEvent( S_WEAPONHIT, (UINT16) 20, &SWeaponHit );
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - missed in HTH attack") );
|
||||
FreeUpAttacker( (UINT8) pSoldier->ubID );
|
||||
}
|
||||
// 0verhaul: And this too
|
||||
// else
|
||||
// {
|
||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - missed in HTH attack") );
|
||||
// FreeUpAttacker( (UINT8) pSoldier->ubID );
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2674,9 +2689,10 @@ BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo )
|
||||
IgniteExplosion( pSoldier->ubID, (INT16)CenterX( pSoldier->sGridNo ), (INT16)CenterY( pSoldier->sGridNo ), 0, pSoldier->sGridNo, Launchable.usItem, pSoldier->bLevel );
|
||||
|
||||
// Reduce again for attack end 'cause it has been incremented for a normal attack
|
||||
//
|
||||
// Nope, not anymore.
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - ATTACK ANIMATION %s ENDED BY BAD EXPLOSIVE CHECK, Now %d", gAnimControl[ pSoldier->usAnimState ].zAnimStr, gTacticalStatus.ubAttackBusyCount ) );
|
||||
ReduceAttackBusyCount( pSoldier->ubID, FALSE );
|
||||
DebugAttackBusy( String("@@@@@@@ Freeing up attacker - ATTACK ANIMATION %s ENDED BY BAD EXPLOSIVE CHECK\n", gAnimControl[ pSoldier->usAnimState ].zAnimStr ) );
|
||||
// ReduceAttackBusyCount( pSoldier->ubID, FALSE );
|
||||
|
||||
// So all's well, should be good from here....
|
||||
return( FALSE );
|
||||
@@ -2733,7 +2749,7 @@ BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo )
|
||||
|
||||
CalculateLaunchItemParamsForThrow( pSoldier, sTargetGridNo, pSoldier->bTargetLevel, 0, &Launchable, (INT8)(uiDiceRoll - uiHitChance), THROW_ARM_ITEM, 0 );
|
||||
|
||||
iID = CreatePhysicalObject( pSoldier->pTempObject, pSoldier->pThrowParams->dLifeSpan, pSoldier->pThrowParams->dX, pSoldier->pThrowParams->dY, pSoldier->pThrowParams->dZ, pSoldier->pThrowParams->dForceX, pSoldier->pThrowParams->dForceY, pSoldier->pThrowParams->dForceZ, pSoldier->ubID, pSoldier->pThrowParams->ubActionCode, pSoldier->pThrowParams->uiActionData );
|
||||
iID = CreatePhysicalObject( pSoldier->pTempObject, pSoldier->pThrowParams->dLifeSpan, pSoldier->pThrowParams->dX, pSoldier->pThrowParams->dY, pSoldier->pThrowParams->dZ, pSoldier->pThrowParams->dForceX, pSoldier->pThrowParams->dForceY, pSoldier->pThrowParams->dForceZ, pSoldier->ubID, pSoldier->pThrowParams->ubActionCode, pSoldier->pThrowParams->uiActionData, FALSE );
|
||||
|
||||
pObject = &( ObjectSlots[ iID ] );
|
||||
//pObject->fPotentialForDebug = TRUE;
|
||||
@@ -2785,8 +2801,9 @@ BOOLEAN DoSpecialEffectAmmoMiss( UINT8 ubAttackerID, INT16 sGridNo, INT16 sXPos,
|
||||
if ( fFreeupAttacker )
|
||||
{
|
||||
RemoveBullet( iBullet );
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - bullet hit structure - explosive ammo") );
|
||||
FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
// 0verhaul: No longer necessary
|
||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - bullet hit structure - explosive ammo") );
|
||||
// FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2821,8 +2838,9 @@ BOOLEAN DoSpecialEffectAmmoMiss( UINT8 ubAttackerID, INT16 sGridNo, INT16 sXPos,
|
||||
if ( fFreeupAttacker )
|
||||
{
|
||||
RemoveBullet( iBullet );
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - bullet hit structure - explosive ammo") );
|
||||
FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
// 0verhaul: No longer necessary.
|
||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - bullet hit structure - explosive ammo") );
|
||||
// FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2857,8 +2875,9 @@ BOOLEAN DoSpecialEffectAmmoMiss( UINT8 ubAttackerID, INT16 sGridNo, INT16 sXPos,
|
||||
if ( fFreeupAttacker )
|
||||
{
|
||||
RemoveBullet( iBullet );
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - bullet hit structure - explosive ammo") );
|
||||
FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
// 0verhaul: No longer necessary.
|
||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - bullet hit structure - explosive ammo") );
|
||||
// FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2948,26 +2967,28 @@ void WeaponHit( UINT16 usSoldierID, UINT16 usWeaponIndex, INT16 sDamage, INT16 s
|
||||
IgniteExplosion( ubAttackerID, sXPos, sYPos, 0, (INT16) (GETWORLDINDEXFROMWORLDCOORDS( sYPos, sXPos )), TANK_SHELL, pTargetSoldier->bLevel );
|
||||
}
|
||||
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - end of LAW fire") );
|
||||
FreeUpAttacker( ubAttackerID );
|
||||
// 0verhaul: No longer necessary
|
||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - end of LAW fire") );
|
||||
// FreeUpAttacker( ubAttackerID );
|
||||
return;
|
||||
}
|
||||
|
||||
DoSpecialEffectAmmoMiss( ubAttackerID, pTargetSoldier->sGridNo, sXPos, sYPos, sZPos, FALSE, FALSE, 0 );
|
||||
|
||||
// OK, SHOT HAS HIT, DO THINGS APPROPRIATELY
|
||||
// ATE: This is 'cause of that darn smoke effect that could potnetially kill
|
||||
// the poor bastard .. so check
|
||||
if ( !pTargetSoldier->fDoingExternalDeath )
|
||||
{
|
||||
EVENT_SoldierGotHit( pTargetSoldier, usWeaponIndex, sDamage, sBreathLoss, usDirection, sRange, ubAttackerID, ubSpecial, ubHitLocation, 0, NOWHERE );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Buddy had died from additional dammage - free up attacker here...
|
||||
ReduceAttackBusyCount( pTargetSoldier->ubAttackerID, FALSE );
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("Special effect killed before bullet impact, attack count now %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
}
|
||||
// ATE: This is 'cause of that darn smoke effect that could potnetially kill
|
||||
// the poor bastard .. so check
|
||||
if ( !pTargetSoldier->fDoingExternalDeath )
|
||||
{
|
||||
EVENT_SoldierGotHit( pTargetSoldier, usWeaponIndex, sDamage, sBreathLoss, usDirection, sRange, ubAttackerID, ubSpecial, ubHitLocation, 0, NOWHERE );
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// Buddy had died from additional dammage - free up attacker here...
|
||||
// ReduceAttackBusyCount( pTargetSoldier->ubAttackerID, FALSE );
|
||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("Special effect killed before bullet impact, attack count now %d", gTacticalStatus.ubAttackBusyCount) );
|
||||
// OutputDebugString( "Special effect killed before bullet impact\n" );
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -3041,11 +3062,9 @@ void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT8 bWeaponStatus, UINT
|
||||
// marke added one 'or' to get this working with HE ammo
|
||||
if ( Item[usWeaponIndex].rocketlauncher || AmmoTypes[pSoldier->inv[pSoldier->ubAttackingHand ].ubGunAmmoType].explosionSize > 1)
|
||||
{
|
||||
RemoveBullet( iBullet );
|
||||
|
||||
// Reduce attacker count!
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - end of LAW fire") );
|
||||
FreeUpAttacker( ubAttackerID );
|
||||
// FreeUpAttacker( ubAttackerID );
|
||||
if ( Item[usWeaponIndex].singleshotrocketlauncher )
|
||||
{
|
||||
IgniteExplosion( ubAttackerID, (INT16)CenterX( sGridNo ), (INT16)CenterY( sGridNo ), 0, sGridNo, C1, (INT8)( sZPos >= WALL_HEIGHT ) );
|
||||
@@ -3063,21 +3082,25 @@ void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT8 bWeaponStatus, UINT
|
||||
IgniteExplosion( ubAttackerID, (INT16)CenterX( sGridNo ), (INT16)CenterY( sGridNo ), 0, sGridNo, AmmoTypes[pSoldier->inv[pSoldier->ubAttackingHand ].ubGunAmmoType].highExplosive , (INT8)( sZPos >= WALL_HEIGHT ) );
|
||||
// pSoldier->inv[pSoldier->ubAttackingHand ].usGunAmmoItem = NONE;
|
||||
}
|
||||
|
||||
// Moved here to make sure ABC stays >0 until everything done
|
||||
RemoveBullet( iBullet );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( Item[usWeaponIndex].cannon )
|
||||
{
|
||||
RemoveBullet( iBullet );
|
||||
|
||||
// Reduce attacker count!
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - end of TANK fire") );
|
||||
FreeUpAttacker( ubAttackerID );
|
||||
//DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - end of TANK fire") );
|
||||
//FreeUpAttacker( ubAttackerID );
|
||||
|
||||
IgniteExplosion( ubAttackerID, (INT16)CenterX( sGridNo ), (INT16)CenterY( sGridNo ), 0, sGridNo, TANK_SHELL, (INT8)( sZPos >= WALL_HEIGHT ) );
|
||||
//FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
|
||||
// Moved here to keep ABC >0 as long as possible
|
||||
RemoveBullet( iBullet );
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -3116,11 +3139,11 @@ void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT8 bWeaponStatus, UINT
|
||||
|
||||
case MONSTERCLASS:
|
||||
|
||||
DoSpecialEffectAmmoMiss( ubAttackerID, sGridNo, sXPos, sYPos, sZPos, FALSE, TRUE, iBullet );
|
||||
DoSpecialEffectAmmoMiss( ubAttackerID, sGridNo, sXPos, sYPos, sZPos, FALSE, TRUE, iBullet );
|
||||
|
||||
RemoveBullet( iBullet );
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - monster attack hit structure") );
|
||||
FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - monster attack hit structure") );
|
||||
// FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
|
||||
//PlayJA2Sample( SPIT_RICOCHET , RATE_11025, uiMissVolume, 1, SoundDir( sGridNo ) );
|
||||
break;
|
||||
@@ -3150,8 +3173,8 @@ void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT8 bWeaponStatus, UINT
|
||||
}
|
||||
|
||||
RemoveBullet( iBullet );
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - knife attack hit structure") );
|
||||
FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - knife attack hit structure") );
|
||||
// FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3178,8 +3201,8 @@ void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT8 bWeaponStatus, UINT
|
||||
if ( fStopped )
|
||||
{
|
||||
RemoveBullet( iBullet );
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - bullet hit same structure twice") );
|
||||
FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - bullet hit same structure twice") );
|
||||
// FreeUpAttacker( (UINT8) ubAttackerID );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -4815,8 +4838,8 @@ void ShotMiss( UINT8 ubAttackerID, INT32 iBullet )
|
||||
|
||||
}
|
||||
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - bullet missed") );
|
||||
FreeUpAttacker( ubAttackerID );
|
||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("@@@@@@@ Freeing up attacker - bullet missed") );
|
||||
// FreeUpAttacker( ubAttackerID );
|
||||
}
|
||||
|
||||
UINT32 CalcChanceHTH( SOLDIERTYPE * pAttacker,SOLDIERTYPE *pDefender, UINT8 ubAimTime, UINT8 ubMode )
|
||||
@@ -5719,6 +5742,10 @@ UINT8 GetMagSize( OBJECTTYPE *pObj )
|
||||
}
|
||||
BOOLEAN WeaponReady(SOLDIERTYPE * pSoldier)
|
||||
{
|
||||
#ifdef ROBOT_ALWAYS_READY
|
||||
if ( AM_A_ROBOT( pSoldier) )
|
||||
return TRUE;
|
||||
#endif
|
||||
if ( gAnimControl[ pSoldier->usAnimState ].uiFlags & ANIM_FIREREADY )
|
||||
return TRUE;
|
||||
else
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
#include "Action Items.h"
|
||||
#include "pits.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Quests.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "message.h"
|
||||
#endif
|
||||
|
||||
//Global dynamic array of all of the items in a loaded map.
|
||||
|
||||
+1
-1
@@ -188,4 +188,4 @@ extern BOOLEAN WriteInArmyCompositionInfo(STR fileName);
|
||||
|
||||
//Kaiden: Roaming Militia Restricted Sectors List
|
||||
extern BOOLEAN ReadInRoamingInfo(STR filename);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -266,4 +266,4 @@ BOOLEAN WriteAttachmentComboMergeStats()
|
||||
FileClose( hFile );
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "Debug Control.h"
|
||||
#include "expat.h"
|
||||
#include "XML.h"
|
||||
#include "Inventory Choosing.h"
|
||||
#endif
|
||||
|
||||
struct
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "Debug Control.h"
|
||||
#include "expat.h"
|
||||
#include "XML.h"
|
||||
#include "Inventory Choosing.h"
|
||||
#endif
|
||||
|
||||
struct
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include "Debug Control.h"
|
||||
#include "expat.h"
|
||||
#include "XML.h"
|
||||
#include "SectorLoadscreens.h"
|
||||
// #include "SectorLoadscreens.h"
|
||||
#endif
|
||||
|
||||
struct
|
||||
|
||||
+47
-23
@@ -1,6 +1,7 @@
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "Tactical All.h"
|
||||
#else
|
||||
#include "builddefines.h"
|
||||
#include "math.h"
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
@@ -25,6 +26,8 @@
|
||||
#include "random.h"
|
||||
#include "GameSettings.h"
|
||||
#include "FileMan.h"
|
||||
#include "lighting.h"
|
||||
#include "Buildings.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -98,6 +101,9 @@ INT32 CreateBullet( UINT8 ubFirerID, BOOLEAN fFake, UINT16 usFlags,UINT16 fromIt
|
||||
else
|
||||
{
|
||||
pBullet->fReal = TRUE;
|
||||
// gBullets[ iBullet ].pFirer->bBulletsLeft++;
|
||||
gTacticalStatus.ubAttackBusyCount++;
|
||||
DebugAttackBusy( String( "Creating a new bullet for %d. ABC now %d\n", ubFirerID, gTacticalStatus.ubAttackBusyCount) );
|
||||
}
|
||||
|
||||
return( iBulletIndex );
|
||||
@@ -174,28 +180,32 @@ void RemoveBullet( INT32 iBullet )
|
||||
gBullets[ iBullet ].fToDelete = TRUE;
|
||||
|
||||
// decrement reference to bullet in the firer
|
||||
gBullets[ iBullet ].pFirer->bBulletsLeft--;
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Ending bullet, bullets left %d", gBullets[ iBullet ].pFirer->bBulletsLeft ) );
|
||||
// gBullets[ iBullet ].pFirer->bBulletsLeft--;
|
||||
// DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String("!!!!!!! Ending bullet, bullets left %d", gBullets[ iBullet ].pFirer->bBulletsLeft ) );
|
||||
// DebugAttackBusy( String( "Deleting a bullet for %d. Total count now %d\n", gBullets[ iBullet].ubFirerID, gBullets[ iBullet ].pFirer->bBulletsLeft) );
|
||||
// Nah, just decrement the attack busy count and be done with it
|
||||
DebugAttackBusy( String( "Deleting a bullet for %d.\n", gBullets[ iBullet].ubFirerID ) );
|
||||
ReduceAttackBusyCount( );
|
||||
|
||||
if ( gBullets[ iBullet ].usFlags & ( BULLET_FLAG_KNIFE ) )
|
||||
// if ( gBullets[ iBullet ].usFlags & ( BULLET_FLAG_KNIFE ) )
|
||||
// {
|
||||
// Delete ani tile
|
||||
if ( gBullets[ iBullet ].pAniTile != NULL )
|
||||
{
|
||||
// Delete ani tile
|
||||
if ( gBullets[ iBullet ].pAniTile != NULL )
|
||||
{
|
||||
DeleteAniTile( gBullets[ iBullet ].pAniTile );
|
||||
gBullets[ iBullet ].pAniTile = NULL;
|
||||
}
|
||||
|
||||
// Delete shadow
|
||||
if ( gBullets[ iBullet ].usFlags & ( BULLET_FLAG_KNIFE ) )
|
||||
{
|
||||
if ( gBullets[ iBullet ].pShadowAniTile != NULL )
|
||||
{
|
||||
DeleteAniTile( gBullets[ iBullet ].pShadowAniTile );
|
||||
gBullets[ iBullet ].pShadowAniTile = NULL;
|
||||
}
|
||||
}
|
||||
DeleteAniTile( gBullets[ iBullet ].pAniTile );
|
||||
gBullets[ iBullet ].pAniTile = NULL;
|
||||
}
|
||||
|
||||
// Delete shadow
|
||||
// if ( gBullets[ iBullet ].usFlags & ( BULLET_FLAG_KNIFE ) )
|
||||
// {
|
||||
if ( gBullets[ iBullet ].pShadowAniTile != NULL )
|
||||
{
|
||||
DeleteAniTile( gBullets[ iBullet ].pShadowAniTile );
|
||||
gBullets[ iBullet ].pShadowAniTile = NULL;
|
||||
}
|
||||
// }
|
||||
// }
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -429,15 +439,29 @@ void AddMissileTrail( BULLET *pBullet, FIXEDPT qCurrX, FIXEDPT qCurrY, FIXEDPT q
|
||||
//else if ( pBullet->usFlags & ( BULLET_FLAG_TRACER ) )
|
||||
else if (fTracer == TRUE)
|
||||
{
|
||||
INT16 sXPos, sYPos;
|
||||
|
||||
strcpy( AniParams.zCachedFile, "TILECACHE\\BULLET_TRACER.STI" );
|
||||
AniParams.uiFlags |= ANITILE_LIGHT;
|
||||
/*if ( pBullet->pFirer->bLevel > 0 ) // if firer on roof then
|
||||
AniParams.sDelay = 10000; // Test this out
|
||||
|
||||
if (!pBullet->pAniTile)
|
||||
{
|
||||
pBullet->pAniTile = CreateAnimationTile( &AniParams );
|
||||
}
|
||||
|
||||
ConvertGridNoToCenterCellXY( pBullet->sGridNo, &sXPos, &sYPos );
|
||||
LightSpritePosition( pBullet->pAniTile->lightSprite, (INT16)(sXPos/CELL_X_SIZE), (INT16)(sYPos/CELL_Y_SIZE));
|
||||
|
||||
if ( pBullet->pFirer->bLevel > 0 ) // if firer on roof then
|
||||
{
|
||||
if ( FindBuilding(AniParams.sGridNo) != NULL ) // if this spot is still within the building's grid area
|
||||
{
|
||||
AniParams.uiFlags &= ~ANITILE_LIGHT;
|
||||
LightSpritePower( pBullet->pAniTile->lightSprite, FALSE);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
CreateAnimationTile( &AniParams );
|
||||
@@ -555,4 +579,4 @@ void DeleteAllBullets( )
|
||||
|
||||
RecountBullets( );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
#include "Fog Of War.h"
|
||||
#include "Strategicmap.h"
|
||||
#include "boxing.h"
|
||||
#include "opplist.h"
|
||||
#include "lighting.h"
|
||||
#include "Soldier macros.h"
|
||||
#endif
|
||||
|
||||
/* view directions */
|
||||
|
||||
+31
-4
@@ -42,6 +42,13 @@
|
||||
#include "meanwhile.h"
|
||||
#include "WorldMan.h"
|
||||
#include "SkillCheck.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Smell.h"
|
||||
#include "Game Clock.h"
|
||||
#include "civ quotes.h"
|
||||
#include "Sound Control.h"
|
||||
#include "drugs and alcohol.h"
|
||||
#include "Interface.h"
|
||||
#endif
|
||||
|
||||
//rain
|
||||
@@ -460,6 +467,12 @@ void HandleBestSightingPositionInRealtime( void )
|
||||
return;
|
||||
}
|
||||
|
||||
// Also delay until attack busy returns
|
||||
// if (gTacticalStatus.ubAttackBusyCount > 0)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (gubBestToMakeSighting[ 0 ] != NOBODY)
|
||||
{
|
||||
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "HBSPIR called and there is someone in the list" );
|
||||
@@ -598,6 +611,20 @@ void InitSightArrays( void )
|
||||
gubBestToMakeSighting[ uiLoop ] = NOBODY;
|
||||
}
|
||||
//gfHumanSawSomeoneInRealtime = FALSE;
|
||||
|
||||
// It is assumed that once the sight arrays are (re)initialized, the enemies should all have no
|
||||
// interrupt points. At least a paranoia check in the HandleSightingInRealtime and HandleSightingInTurnBased
|
||||
// both make sure no interrupt points remain after they drain the sighting list.
|
||||
// I do not fully grok the interrupt system, but it IS possible for this function to be called when there are
|
||||
// still soldiers on the sighting list, which gives them lingering interrupt points. So the best course of
|
||||
// action is to reset their points. However, I think I'll just do a clean sweep here to make sure I get them all.
|
||||
for ( uiLoop = 0; uiLoop < guiNumMercSlots; uiLoop++ )
|
||||
{
|
||||
if (MercSlots[ uiLoop ] )
|
||||
{
|
||||
MercSlots[ uiLoop ]->bInterruptDuelPts = NO_INTERRUPT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AddToShouldBecomeHostileOrSayQuoteList( UINT8 ubID )
|
||||
@@ -3717,7 +3744,7 @@ void DebugSoldierPage1( )
|
||||
gprintf( 400, LINE_HEIGHT * ubLine, L"%d", pSoldier->bHasKeys );
|
||||
ubLine++;
|
||||
}
|
||||
else if ( GetMouseMapPos( (INT16 *)&usMapPos ) )
|
||||
else if ( GetMouseMapPos( &usMapPos ) )
|
||||
{
|
||||
SetFont( LARGEFONT1 );
|
||||
gprintf( 0,0,L"DEBUG LAND PAGE ONE" );
|
||||
@@ -3876,7 +3903,7 @@ void DebugSoldierPage2( )
|
||||
gprintf( 150, LINE_HEIGHT * ubLine, L"%s", ShortItemNames[pSoldier->inv[SECONDHANDPOS].usItem] );
|
||||
ubLine++;
|
||||
|
||||
if ( GetMouseMapPos( (INT16 *)&usMapPos ) )
|
||||
if ( GetMouseMapPos( &usMapPos ) )
|
||||
{
|
||||
SetFontShade(LARGEFONT1, FONT_SHADE_GREEN);
|
||||
gprintf( 0, LINE_HEIGHT * ubLine, L"CurrGridNo:");
|
||||
@@ -3886,7 +3913,7 @@ void DebugSoldierPage2( )
|
||||
}
|
||||
|
||||
}
|
||||
else if ( GetMouseMapPos( (INT16 *)&usMapPos ) )
|
||||
else if ( GetMouseMapPos( &usMapPos ) )
|
||||
{
|
||||
SetFont( LARGEFONT1 );
|
||||
gprintf( 0,0,L"DEBUG LAND PAGE TWO" );
|
||||
@@ -4217,7 +4244,7 @@ void DebugSoldierPage3( )
|
||||
}
|
||||
|
||||
}
|
||||
else if ( GetMouseMapPos( (INT16 *)&usMapPos ) )
|
||||
else if ( GetMouseMapPos( &usMapPos ) )
|
||||
{
|
||||
DOOR_STATUS *pDoorStatus;
|
||||
STRUCTURE *pStructure;
|
||||
|
||||
@@ -103,6 +103,7 @@ INT16 MaxDistanceVisible( void );
|
||||
INT16 DistanceVisible( SOLDIERTYPE *pSoldier, INT8 bFacingDir, INT8 bSubjectDir, INT16 sSubjectGridNo, INT8 bLevel, SOLDIERTYPE *pOther );
|
||||
void ResetLastKnownLocs(SOLDIERTYPE *ptr);
|
||||
void RecalculateOppCntsDueToNoLongerNeutral( SOLDIERTYPE * pSoldier );
|
||||
void ReevaluateBestSightingPosition( SOLDIERTYPE * pSoldier, INT8 bInterruptDuelPts );
|
||||
|
||||
|
||||
void InitOpponentKnowledgeSystem(void);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef __Q_ARRAY_H
|
||||
#define __Q_ARRAY_H
|
||||
|
||||
#include "soldier profile type.h"
|
||||
|
||||
extern BOOLEAN QuoteExp_HeadShotOnly[NUM_PROFILES];
|
||||
extern BOOLEAN QuoteExp_TeamSpecific[NUM_PROFILES];
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef __SOLDER_PROFILE_TYPE_H
|
||||
#define __SOLDER_PROFILE_TYPE_H
|
||||
|
||||
#include "overhead types.h"
|
||||
|
||||
#define NUM_PROFILES 170
|
||||
#define FIRST_RPC 57
|
||||
|
||||
Reference in New Issue
Block a user