Files
source/Tactical/Weapons.h
T
Wanne 7ca53fadc7 *** MERGED source code from development trunk revision 4890 up to latest current revision 5105 ***
Development Trunk (now obsolete): https://ja2svn.dyndns.org/source/ja2/branches/Wanne/JA2%201.13%20MP
A detailed list of all the features (changes) is visible in the history log of the development trunk:

INFO: There will be no further development in the development source trunk, so is obsolete from now on!

This commit contains the following features (bugfixes are not listed):

- New Feature: Show merc ranks in Strategy Screen before merc name
o Toggle on/off in the ingame options screen
o For each experience level (0-10) there are defined rank names in the language specific text files
o Additional language text that is not translated yet is marked with // TODO.Translate

- New Feature: Faster Bobby Ray Shipments
o This feature is selectable in the ja2_options.ini
o When activated Bobby Ray shipments will be really fast
-> Overnight Express: 5 - 7 hours
-> Air Service: 10, 12 or 14 hours
-> Standard Service: 15, 18 or 21 hours
o In a multiplayer game, this feature is disabled (because shipment arrive immediately in the destination sector)

- New Feature: AP cost for manipulating the merc inventory
o This feature is selectable in the start new game screen
o For example, putting a weapon from hand in the backpack costs APs
o The AP costs are defined in the APBPConstants.ini
o In a multiplayer game, this feature is disabled

- New Feature: Added possibility to set individual Gear Kit names
o Set individual names in the optional new tag <mGearKitName> inside the <GEARKIT> root element (File: TableData\MercStartingGear.xml)

- New Feature: Externalized the maximum purchase amount (JA2 vanilla: 10) for Bobby Rays purchases per shipment
o Define the max. amount in the ja2_options.ini: BOBBY_RAY_MAX_PURCHASE_AMOUNT, Range: 10 - 100)
o Nice scrolling bars to scroll through all the purchases

- New Feature: Now it is possible to walk on "water" tiles or handle those tiles like "normal" tiles 
o (instead of showing the swimming animation and counting the APs for swimming), when the soldier is located on the second level (level > 0)

- New Feature: Externalized AIM Veterans laptop site
o Add maximum of 4 pages
o Add  new AIM to veterans page, and remove AIM from veterans page.
o New XML file: OldAIMArchive.xml (language specific XML files: *.OldAIMArchive.xml)

- New Feature: Added possibility to choose from 254 IMP faces
o Modified IMPPortraits.xml
o Added new GameDir folder "IMPFaces" which contains the IMP face portraits
o Moved IMP faces in the new "IMPFaces" folder

- New Feature: ARSP - All Resolution Support Project
o See here: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=298698&page=1
o Support any kind of screen resolution. This works by choosing the matching full supported resolution (640x480, 800x600, 1024x768) and then centering the graphics
o See ja2.ini for defining the screen resolution

- New Feature: AI Turn Speed Up (FF-MOD)
o see here: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=298699#Post298699
o When this feature is activated it allows fast enemy turns
o New entry in ja2.ini to enable this feature: HIGHSPEED_TIMER = TRUE
o Turn on/off auto fast turns in ingame options
o New ja2_options.ini settings for fine tuning: [Clock Settings] ini block

- New Feature: "Lock" / "Release" mouse cursor in tactical windowed mode, so the mouse can stay within window boundary
o This is very helpful for doing scrolling with the mouse (by moving the mouse to the window edge) in windowed mode
o You can toggle on/off the feature by pressing CTRL + Z. It is also possible to press CTRL + Y. So the user can decide which fits better :)
o Whenever you toggle on/off a screen message appears on the tactical log to notify the player

- New Feature: Weapon overheating
o Basically, every shot fired from a gun increases its temperature. On higher temperatures, the gun jams more frequently
o On/off toggle in the ingame options
o Graphical thermometer indication on the weapon picture
o New ja2_options.ini section with a few options, Section: [Tactical Weapon Overheating Settings]
o XML changes (New Tags)
--> AmmoTypes.xml: <temperatureModificator>
--> Items.xml: <barrel>, <usOverheatingCooldownFactor>
--> Weapons.xml: <usOverheatingJamThreshold>, <usOverheatingDamageThreshold>, <usOverheatingSingleShotTemperature>
o Added a few barells to Items.xml (end of the file)
o more infos: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=301059&page=1

- New Feature: Resting weapons on a surfaces
o You can now rest your weapon on crates, low walls, rocks, debris, open windows etc. while you are crouched. Resting will give yu the superior gun handling modifiers from PRONE position.
o A little 'A' on your gun indicates if you are resting it or not.
o Both settings can be turned on and off in Ja2_Options.ini under 'Tactical Gameplay Settings'

- New Feature: Externalized option on whether mercs can exit sector using grid exit in turn based mode
o new ja2_options.ini property: GRID_EXIT_IN_TURNBASED
o This ini setting does not affect leaving sectors on map edges

- Rework/Update: Ammo boxes and Ammo crates
o Ammo crate items added for remaining calibers.  Tweaked prices to correspond to magazines, tweaked capacities and weights to be reasonable (~800 or less).
o Shift-R reload now looks at both boxes and crates in sector items and merc's inventory to reload, and tops off magazines in inventory as well.  Only possible outside of combat.
o Ctrl-Shift-A still creates crates as per usual, with some fixes to ensure all ammo is caught on the first press.
o Shift-A now creates ammo boxes in the same loop.  They mostly behave like crates, but fit in mercs inventories.
o Ammo boxes are available to purchase at BR and tony, sam, etc.  Individual magazines/drums/etc are no longer available.
o Removed ammo crate xml tag.  Added ubMagType tag to Magazines array.  This allows us to differentiate between magazines, bullets, boxes and crates.
o Changed ammo filtering in BR's to display boxes appropriately.  Added back the "Mag:" display (changed text to "Size:")
o Added ja2set.dat.xml file (WF map version in WF maps folder) to be used instead of ja2set.dat file (ja2.ini setting added) For now, if you want to play vanilla instead, just change the setting in the ini (see comments in file).
o Added P4-P9Items image files (up to 5k images each) and tileslots.  1.13 core items will continue to use Guns and P1-P3Items for the foreseeable future.  P4-P9 can be used by customizers/modders to avoid conflicts with Guns/P1-P3 items.  TODO: Need to discuss a strategy for this in the forums.
o Added in Ambient/0.bad and 32.bad to avoid an exception in the code.
o Updated the XML Editor
o Standardized the text on all the ammo items.

- New Multiplayer Feature: Sharing same FOV (field of view) in a coop/team-dm (for friendly teams) game
o You will also see enemies, that your teammate sees

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5108 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2012-03-23 18:46:54 +00:00

453 lines
16 KiB
C

#ifndef __WEAPONS_H
#define __WEAPONS_H
#include "Soldier Control.h"
//ADB moved from Soldier Control.h
enum WeaponMode
{
WM_NORMAL = 0,
WM_BURST,
WM_AUTOFIRE,
WM_ATTACHED_GL,
WM_ATTACHED_GL_BURST,
WM_ATTACHED_GL_AUTO,
NUM_WEAPON_MODES
} ;
//ADB moved from Interface Panels.h
void HandleTacticalEffectsOfEquipmentChange( SOLDIERTYPE *pSoldier, UINT32 uiInvPos, UINT16 usOldItem, UINT16 usNewItem );
// HEADROCK: Removed this and externalized to JA2_OPTIONS.INI as part of HAM project.
//#define MAXCHANCETOHIT 99
#define BAD_DODGE_POSITION_PENALTY 20
#define GUN_BARREL_RANGE_BONUS 100
#define SOLID_SLUG_RANGE_BONUS 65
#define DUCKBILL_RANGE_BONUS 40
#define MAX_PERCENT_NOISE_VOLUME_FOR_SILENCED_SOUND 35
// JA2 GOLD: for weapons and attachments, give penalties only for status values below 85
#define WEAPON_STATUS_MOD( x ) ( (x) >= 85 ? 100 : (((x) * 100) / 85) )
// Special deaths can only occur within a limited distance to the target
// Madd
#define MAX_DISTANCE_FOR_MESSY_DEATH 7
#define MAX_BARRETT_DISTANCE_FOR_MESSY_DEATH 23
// If you do a lot of damage with a close-range shot, instant kill
#define MIN_DAMAGE_FOR_INSTANT_KILL 55
// If you happen to kill someone with a close-range shot doing a lot of damage to the head, head explosion
#define MIN_DAMAGE_FOR_HEAD_EXPLOSION 45
// If you happen to kill someone with a close-range shot doing a lot of damage to the chest, chest explosion
// This value is lower than head because of the damage bonus for shooting the head
#define MIN_DAMAGE_FOR_BLOWN_AWAY 30
// If you happen to hit someone in the legs for enough damage, REGARDLESS of distance, person falls down
// Leg damage is halved for these purposes
#define MIN_DAMAGE_FOR_AUTO_FALL_OVER 20
// short range at which being prone provides to hit penalty when shooting standing people
#define MIN_PRONE_RANGE 50
// can't miss at this range?
#define POINT_BLANK_RANGE 16
#define BODY_IMPACT_ABSORPTION 20
#define BUCKSHOT_SHOTS 9
#define MIN_MORTAR_RANGE 150 // minimum range of a mortar
// WEAPON CLASSES
enum
{
NOGUNCLASS,
HANDGUNCLASS,
SMGCLASS,
RIFLECLASS,
MGCLASS,
SHOTGUNCLASS,
KNIFECLASS,
MONSTERCLASS,
NUM_WEAPON_CLASSES
};
// exact gun types
enum
{
NOT_GUN = 0,
GUN_PISTOL,
GUN_M_PISTOL,
GUN_SMG,
GUN_RIFLE,
GUN_SN_RIFLE,
GUN_AS_RIFLE,
GUN_LMG,
GUN_SHOTGUN
};
// ARMOUR CLASSES
enum
{
ARMOURCLASS_HELMET,
ARMOURCLASS_VEST,
ARMOURCLASS_LEGGINGS,
ARMOURCLASS_PLATE,
ARMOURCLASS_MONST,
ARMOURCLASS_VEHICLE
};
// Warning: There is a table in weapons.c that indexes using these enumberations...
// BurstSndStrings[]....
// MADD MARKER
enum
{
NOAMMO = 0,
AMMO38,
AMMO9,
AMMO45,
AMMO357,
AMMO12G,
AMMOCAWS,
AMMO545,
AMMO556,
AMMO762N,
AMMO762W,
AMMO47,
AMMO57,
AMMOMONST,
AMMOROCKET,
AMMODART,
AMMOFLAME,
AMMO50,
AMMO9H
};
enum
{
AMMO_MAGAZINE = 0,
AMMO_BULLET,
AMMO_BOX,
AMMO_CRATE
};
enum
{
AMMO_REGULAR = 0,
AMMO_HP,
AMMO_AP,
AMMO_SUPER_AP,
AMMO_BUCKSHOT,
AMMO_FLECHETTE,
AMMO_GRENADE,
AMMO_MONSTER, // index referenced in code to create ammo type
AMMO_KNIFE, // index referenced in code to create ammo type
AMMO_HE,
AMMO_HEAT,
AMMO_SLEEP_DART,
AMMO_FLAME,
};
typedef struct
{
UINT32 uiIndex;
// on interface
UINT8 fontColour;
// in detail screen (interface\infobox.sti)
INT32 grayed;
INT32 offNormal;
INT32 onNormal;
// bullet contact with structure
INT32 structureImpactReductionMultiplier;
INT32 structureImpactReductionDivisor;
// bullet contact with armour
INT32 armourImpactReductionMultiplier;
INT32 armourImpactReductionDivisor;
// bullet damage multiplier before/after penetrating armour
INT32 beforeArmourDamageMultiplier;
INT32 beforeArmourDamageDivisor;
INT32 afterArmourDamageMultiplier;
INT32 afterArmourDamageDivisor;
// minimum damage can be zero
BOOLEAN zeroMinimumDamage;
BOOLEAN canGoThrough;
BOOLEAN standardIssue;
UINT8 numberOfBullets;
INT32 multipleBulletDamageMultiplier;
INT32 multipleBulletDamageDivisor;
BOOLEAN highExplosive;
UINT8 explosionSize; //0=none, 1=small, 2=medium, 3=large
BOOLEAN antiTank;
BOOLEAN dart;
BOOLEAN knife;
UINT16 monsterSpit;
BOOLEAN ignoreArmour;
BOOLEAN acidic;
INT16 lockBustingPower;
BOOLEAN tracerEffect;
FLOAT temperatureModificator; // Flugente FTW 1.1: modificator for weapon temperature
//zilpin: pellet spread patterns externalized in XML
INT32 spreadPattern;
} AMMOTYPE;
enum
{
EXPLOSV_NORMAL,
EXPLOSV_STUN,
EXPLOSV_TEARGAS,
EXPLOSV_MUSTGAS,
EXPLOSV_FLARE,
EXPLOSV_NOISE,
EXPLOSV_SMOKE,
EXPLOSV_CREATUREGAS,
EXPLOSV_BURNABLEGAS,
EXPLOSV_FLASHBANG,
};
#define AMMO_DAMAGE_ADJUSTMENT_BUCKSHOT( x ) (x / 4)
#define NUM_BUCKSHOT_PELLETS 9
// hollow point bullets do lots of damage to people
#define AMMO_DAMAGE_ADJUSTMENT_HP( x ) ( (x * 17) / 10 )
// but they SUCK at penetrating armour
#define AMMO_ARMOUR_ADJUSTMENT_HP( x ) ( (x * 3) / 2 )
// armour piercing bullets are good at penetrating armour
#define AMMO_ARMOUR_ADJUSTMENT_AP( x ) ((x * 3) / 4)
// "super" AP bullets are great at penetrating armour
#define AMMO_ARMOUR_ADJUSTMENT_SAP( x ) (x / 2)
// high explosive damage value (PRIOR to armour subtraction)
#define AMMO_DAMAGE_ADJUSTMENT_HE( x ) ((x * 4) / 3)
// but they SUCK at penetrating armour
#define AMMO_STRUCTURE_ADJUSTMENT_HP( x ) (x * 2)
// armour piercing bullets are good at penetrating structure
#define AMMO_STRUCTURE_ADJUSTMENT_AP( x ) ( (x * 3 ) / 4)
// "super" AP bullets are great at penetrating structures
#define AMMO_STRUCTURE_ADJUSTMENT_SAP( x ) ( x / 2 )
// one quarter of punching damage is "real" rather than breath damage
#define PUNCH_REAL_DAMAGE_PORTION 4
#define AIM_BONUS_SAME_TARGET 10 // chance-to-hit bonus (in %)
#define AIM_BONUS_PER_AP 10 // chance-to-hit bonus (in %) for aim
#define AIM_BONUS_CROUCHING 10
#define AIM_BONUS_PRONE 20
#define AIM_BONUS_TWO_HANDED_PISTOL 5
#define AIM_BONUS_FIRING_DOWN 15
#define AIM_PENALTY_ONE_HANDED_PISTOL 5
#define AIM_PENALTY_DUAL_PISTOLS 20
#define AIM_PENALTY_SMG 5
#define AIM_PENALTY_GASSED 50
#define AIM_PENALTY_GETTINGAID 20
#define AIM_PENALTY_PER_SHOCK 5 // 5% penalty per point of shock
#define AIM_BONUS_TARGET_HATED 20
#define AIM_BONUS_PSYCHO 15
#define AIM_PENALTY_TARGET_BUDDY 20
#define AIM_PENALTY_BURSTING 10
#define AIM_PENALTY_GENTLEMAN 15
#define AIM_PENALTY_TARGET_CROUCHED 20
#define AIM_PENALTY_TARGET_PRONE 40
#define AIM_PENALTY_BLIND 80
#define AIM_PENALTY_FIRING_UP 25
//#define HIGH_POWER_SCOPE 14 //Externalized
#define MAX_WEAPON_NAME_LENGTH 20
typedef struct
{
UINT8 ubWeaponClass; // handgun/shotgun/rifle/knife
UINT8 ubWeaponType; // exact type (for display purposes)
UINT8 ubCalibre; // type of ammunition needed
UINT8 ubReadyTime; // APs to ready/unready weapon
//CHRISL: Changed to a float to allow for more control over actual ap costs
//UINT8 ubShotsPer4Turns; // maximum (mechanical) firing rate
FLOAT ubShotsPer4Turns; // maximum (mechanical) firing rate
UINT8 ubShotsPerBurst;
UINT8 ubBurstPenalty; // % penalty per shot after first
UINT8 ubBulletSpeed; // bullet's travelling speed
UINT8 ubImpact; // weapon's max damage impact (size & speed)
UINT8 ubDeadliness; // comparative ratings of guns
INT8 bAccuracy; // accuracy or penalty used by OCTH
INT8 nAccuracy; // accuracy or penalty used by NCTH
UINT16 ubMagSize;
UINT16 usRange;
UINT16 usReloadDelay;
UINT8 ubAttackVolume;
UINT8 ubHitVolume;
UINT16 sSound;
UINT16 sBurstSound;
UINT16 sSilencedBurstSound;
UINT16 sReloadSound;
UINT16 sLocknLoadSound;
UINT8 bBurstAP; // Snap: Burst AP cost replaces bBaseAutofireCost
UINT8 bAutofireShotsPerFiveAP;
CHAR8 szWeaponName[MAX_WEAPON_NAME_LENGTH+1]; //+1 for the null terminator
UINT32 uiIndex;
BOOLEAN swapClips;
UINT16 silencedSound;
UINT8 APsToReload;
UINT8 maxdistformessydeath;
BOOLEAN NoSemiAuto;
UINT8 AutoPenalty;
INT16 sAniDelay; // Lesh: for burst animation delay
UINT8 APsToReloadManually;
UINT16 ManualReloadSound;
BOOLEAN EasyUnjam; // Guns where each bullet has its own chamber (like revolvers) are easyer to unjam
INT8 bRecoilX; // HEADROCK HAM 4: Recoil now measured in points of muzzle deviation X and Y.
INT8 bRecoilY; // Positive values indicated upwards (Y) and rightwards (X). Negatives are down (-Y) and left (-X).
// Note that each value is an array. Each item in the array determines recoil
// for a different bullet in the sequence. Not all values have to be filled,
// but the last filled value will determine the recoil for longer volleys.
UINT8 ubRecoilDelay;
UINT8 ubAimLevels; // HEADROCK HAM 4: Dictates how many aiming levels this gun supports. If 0, the program
// chooses automatically based on the type of gun (see AllowedAimingLevels() ).
UINT8 ubHandling; // CHRISL HAM 4: This value replaces ubReadyTime for determining a weapons base handling characteristics.
// Flugente FTW 1
FLOAT usOverheatingJamThreshold; // if a gun's temperature is above this treshold, it is increasingly prone to jamming
FLOAT usOverheatingDamageThreshold; // if a gun is fired while its temperature is above this value, it degrades much faster
FLOAT usOverheatingSingleShotTemperature; // a single shot raises a gun's temperature by this amount
} WEAPONTYPE;
typedef struct
{
UINT8 ubCalibre;
UINT16 ubMagSize;
UINT8 ubAmmoType;
UINT8 ubMagType;
UINT32 uiIndex;
} MAGTYPE;
typedef struct
{
UINT8 ubArmourClass;
UINT16 ubProtection;
UINT8 ubCoverage; // Captain J
UINT8 ubDegradePercent;
UINT32 uiIndex;
} ARMOURTYPE;
typedef struct
{
UINT16 ubType; // type of explosive
UINT16 ubDamage; // damage value
UINT16 ubStunDamage; // stun amount / 100
UINT16 ubRadius; // radius of effect
UINT16 ubVolume; // sound radius of explosion
UINT16 ubVolatility; // maximum chance of accidental explosion
UINT16 ubAnimationID; // Animation enum to use
UINT32 uiIndex;
UINT16 ubDuration;
UINT16 ubStartRadius;
UINT8 ubMagSize;
} EXPLOSIVETYPE;
//GLOBALS
extern WEAPONTYPE Weapon[ MAXITEMS ];
extern ARMOURTYPE Armour[MAXITEMS+1];
extern MAGTYPE Magazine[MAXITEMS+1];
extern EXPLOSIVETYPE Explosive[MAXITEMS+1];
extern CHAR8 gzBurstSndStrings[MAXITEMS*2][128]; // Lesh: changed this
extern AMMOTYPE AmmoTypes[MAXITEMS];
extern BOOLEAN ReadInWeaponStats(STR fileName);
extern BOOLEAN WriteWeaponStats();
extern bool gbForceWeaponNotReady;
extern bool gbForceWeaponReady;
extern INT32 EffectiveArmour( OBJECTTYPE * pObj );
extern INT8 ArmourVersusExplosivesPercent( SOLDIERTYPE * pSoldier );
extern BOOLEAN FireWeapon( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo );
extern void WeaponHit( UINT16 usSoldierID, UINT16 usWeaponIndex, INT16 sDamage, INT16 sBreathLoss, UINT16 usDirection, INT16 sXPos, INT16 sYPos, INT16 sZPos, INT16 sRange , UINT8 ubAttackerID, BOOLEAN fHit, UINT8 ubSpecial, UINT8 ubHitLocation );
extern void StructureHit( INT32 iBullet, UINT16 usWeaponIndex, INT16 bWeaponStatus, UINT8 ubAttackerID, UINT16 sXPos, INT16 sYPos, INT16 sZPos, UINT16 usStructureID, INT32 iImpact, BOOLEAN fStopped );
extern void WindowHit( INT32 sGridNo, UINT16 usStructureID, BOOLEAN fBlowWindowSouth, BOOLEAN fLargeForce );
extern INT32 BulletImpact( SOLDIERTYPE *pFirer, SOLDIERTYPE * pTarget, UINT8 ubHitLocation, INT32 iImpact, INT16 sHitBy, UINT8 * pubSpecial );
extern BOOLEAN InRange( SOLDIERTYPE *pSoldier, INT32 sGridNo );
extern void ShotMiss( UINT8 ubAttackerID, INT32 iBullet );
extern UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime, UINT8 ubAimPos );
extern UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime, UINT8 ubAimPos );
extern UINT32 AICalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime, UINT8 ubAimPos );
extern UINT32 CalcChanceToPunch(SOLDIERTYPE *pAttacker, SOLDIERTYPE * pDefender, INT16 ubAimTime);
extern UINT32 CalcChanceToStab(SOLDIERTYPE * pAttacker,SOLDIERTYPE *pDefender, INT16 ubAimTime);
UINT32 CalcChanceToSteal(SOLDIERTYPE *pAttacker, SOLDIERTYPE * pDefender, INT16 ubAimTime);
extern void ReloadWeapon( SOLDIERTYPE *pSoldier, UINT8 ubHandPos );
// Changed by ADB, rev 1513
//extern BOOLEAN IsGunWeaponModeCapable( SOLDIERTYPE *pSoldier, UINT8 ubHandPos , UINT8 bWpnMode );
//extern BOOLEAN IsGunBurstCapable( SOLDIERTYPE *pSoldier, UINT8 ubHandPos , BOOLEAN fNotify );
//extern BOOLEAN IsGunAutofireCapable( SOLDIERTYPE *pSoldier, UINT8 ubHandPos );
extern BOOLEAN IsGunWeaponModeCapable( OBJECTTYPE* pObject, WeaponMode weaponMode, SOLDIERTYPE *pSoldier = NULL );
extern BOOLEAN IsGunBurstCapable( OBJECTTYPE* pObject, BOOLEAN fNotify, SOLDIERTYPE *pSoldier = NULL );
extern BOOLEAN IsGunAutofireCapable( OBJECTTYPE* pObject );
extern INT32 CalcBodyImpactReduction( UINT8 ubAmmoType, UINT8 ubHitLocation );
extern INT32 TotalArmourProtection( SOLDIERTYPE *pFirer, SOLDIERTYPE * pTarget, UINT8 ubHitLocation, INT32 iImpact, UINT8 ubAmmoType );
extern INT32 ArmourPercent( SOLDIERTYPE * pSoldier );
extern void GetTargetWorldPositions( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo, FLOAT *pdXPos, FLOAT *pdYPos, FLOAT *pdZPos );
extern BOOLEAN OKFireWeapon( SOLDIERTYPE *pSoldier );
extern BOOLEAN CheckForGunJam( SOLDIERTYPE * pSoldier );
extern INT32 CalcMaxTossRange( SOLDIERTYPE * pSoldier, UINT16 usItem, BOOLEAN fArmed );
extern UINT32 CalcThrownChanceToHit(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime, UINT8 ubAimPos );
extern void ChangeWeaponMode( SOLDIERTYPE * pSoldier );
extern BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo, BOOLEAN fStealing );
void DishoutQueenSwipeDamage( SOLDIERTYPE *pQueenSoldier );
INT32 HTHImpact( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pTarget, INT32 iHitBy, BOOLEAN fBladeAttack );
UINT16 GunRange( OBJECTTYPE * pObj, SOLDIERTYPE * pSoldier ); // SANDRO - added argument
BOOLEAN IsWeapon ( UINT16 itemIndex );
UINT8 GetDamage ( OBJECTTYPE *pObj );
// HEADROCK HAM 4: Same function as above, but without modifiers from attached items.
UINT8 GetBasicDamage ( OBJECTTYPE *pObj );
UINT8 GetAutofireShotsPerFiveAPs( OBJECTTYPE *pObj );
UINT8 GetBaseAutoFireCost( OBJECTTYPE *pObj );
UINT8 GetBurstPenalty( OBJECTTYPE *pObj, BOOLEAN fProneStance = FALSE );
UINT8 GetAutoPenalty( OBJECTTYPE *pObj, BOOLEAN fProneStance = FALSE );
UINT8 GetShotsPerBurst( OBJECTTYPE *pObj );
UINT16 GetMagSize( OBJECTTYPE *pObj, UINT8 subObject = 0 );
UINT16 GetExpMagSize( OBJECTTYPE *pObj );
UINT8 GetAmmoType( OBJECTTYPE *pObj );
bool WeaponReady(SOLDIERTYPE * pSoldier);
INT8 GetAPsToReload( OBJECTTYPE *pObj );
// HEADROCK HAM 3.4: Estimate bullets left in gun. Returns an "errorcode" telling the calling function if the check
// was successful and to what degree.
void EstimateBulletsLeft( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObj );
extern CHAR16 gBulletCount[10];
// HEADROCK HAM 4: This function generates a mag-factor bar percentage.
void CalcMagFactorSimple( SOLDIERTYPE *pSoldier, FLOAT d2DDistance, INT16 bAimTime );
// HEADROCK HAM 4: This gets the Z of a target regardless of what's there.
FLOAT GetTargetZPos( SOLDIERTYPE *pShooter, INT32 sTargetGridNo );
// Flugente: Overheating Weapons
void GunIncreaseHeat( OBJECTTYPE *pObj );
FLOAT GetSingleShotTemperature( OBJECTTYPE *pObj );
FLOAT GetGunOverheatDamagePercentage( OBJECTTYPE * pObj ); // Flugente FTW 1: Get percentage: temperature/damagethreshold
FLOAT GetGunOverheatJamPercentage( OBJECTTYPE * pObj ); // Flugente FTW 1: Get percentage: temperature/jamthreshold
FLOAT GetOverheatJamThreshold( OBJECTTYPE *pObj );
FLOAT GetOverheatDamageThreshold( OBJECTTYPE *pObj );
#endif