- new feature: manual reload

- update readme


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@177 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2006-06-05 22:37:34 +00:00
parent 979423c07a
commit ce1b1220b7
9 changed files with 103 additions and 22 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" };
#else
//RELEASE BUILD VERSION
INT16 zVersionLabel[256] = { L"Release v1.13.174" };
INT16 zVersionLabel[256] = { L"Release v1.13.177" };
#endif
+2 -2
View File
@@ -43,7 +43,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libexpatMT.lib mss32.lib winmm.lib smackw32.lib fmodvc.lib"
OutputFile="C:\games\Jagged Alliance 2 v1.13\ja2_debug_v1.13.175_2006_06_05.exe"
OutputFile="C:\games\Jagged Alliance 2 v1.13\ja2_debug_v1.13.177_2006_06_06.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=".\..\..\Standard Gaming Platform\"
@@ -546,7 +546,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libexpatMT.lib winmm.lib smackw32.lib mss32.lib fmodvc.lib"
OutputFile="C:\Games\Jagged Alliance 2 v1.13\ja2_release_v1.13.175_2006_06_05.exe"
OutputFile="C:\Games\Jagged Alliance 2 v1.13\ja2_release_v1.13.177_2006_06_06.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=".\..\..\Standard Gaming Platform\"
+7 -4
View File
@@ -59,14 +59,16 @@ typedef enum
#define PANIC_FREQUENCY_3 125
#define OBJECT_UNDROPPABLE 0x01
#define OBJECT_MODIFIED 0x02
#define OBJECT_MODIFIED 0x02
#define OBJECT_AI_UNUSABLE 0x04
#define OBJECT_ARMED_BOMB 0x08
#define OBJECT_KNOWN_TO_BE_TRAPPED 0x10
#define OBJECT_ARMED_BOMB 0x08
#define OBJECT_KNOWN_TO_BE_TRAPPED 0x10
#define OBJECT_DISABLED_BOMB 0x20
#define OBJECT_ALARM_TRIGGER 0x40
#define OBJECT_NO_OVERWRITE 0x80
#define GS_CARTRIDGE_IN_CHAMBER 0x01
typedef struct
{
UINT16 usItem;
@@ -78,8 +80,9 @@ typedef struct
INT8 bGunStatus; // status % of gun
UINT8 ubGunAmmoType; // ammo type, as per weapons.h
UINT8 ubGunShotsLeft; // duh, amount of ammo left
UINT16 usGunAmmoItem; // the item # for the item table
UINT16 usGunAmmoItem; // the item # for the item table
INT8 bGunAmmoStatus; // only for "attached ammo" - grenades, mortar shells
UINT8 ubGunState; // SB manual recharge
UINT8 ubGunUnused[MAX_OBJECTS_PER_SLOT - 6];
};
struct
+22 -1
View File
@@ -1169,7 +1169,6 @@ UINT16 ReplacementAmmo[][2] =
{ 0, 0 }
};
BOOLEAN ItemIsLegal( UINT16 usItemIndex )
{
//if the user has selected the reduced gun list
@@ -2733,6 +2732,8 @@ BOOLEAN ReloadGun( SOLDIERTYPE * pSoldier, OBJECTTYPE * pGun, OBJECTTYPE * pAmmo
pGun->bGunAmmoStatus = 100;
}
pGun->ubGunState |= GS_CARTRIDGE_IN_CHAMBER; // Madd: reloading should automatically put cartridge in chamber
return( TRUE );
}
@@ -2854,6 +2855,12 @@ INT8 FindAmmoToReload( SOLDIERTYPE * pSoldier, INT8 bWeaponIn, INT8 bExcludeSlot
return( NO_SLOT );
}
pObj = &(pSoldier->inv[bWeaponIn]);
//<SB> manual recharge
if (pObj->ubGunShotsLeft && !(pObj->ubGunState & GS_CARTRIDGE_IN_CHAMBER) )
return bWeaponIn;
//</SB>
if ( Item[pObj->usItem].usItemClass == IC_GUN && !Item[pObj->usItem].cannon )
{
// look for same ammo as before
@@ -2918,6 +2925,19 @@ BOOLEAN AutoReload( SOLDIERTYPE * pSoldier )
CHECKF( pSoldier );
pObj = &(pSoldier->inv[HANDPOS]);
//<SB> manual recharge
if (pObj->ubGunShotsLeft && !(pObj->ubGunState & GS_CARTRIDGE_IN_CHAMBER) )
{
pObj->ubGunState |= GS_CARTRIDGE_IN_CHAMBER;
DeductPoints(pSoldier, Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually, 0);
PlayJA2Sample( Weapon[ Item[pObj->usItem].ubClassIndex ].ManualReloadSound, RATE_11025, SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ) );
return TRUE;
}
//</SB>
if (Item[pObj->usItem].usItemClass == IC_GUN || Item[pObj->usItem].usItemClass == IC_LAUNCHER)
{
bSlot = FindAmmoToReload( pSoldier, HANDPOS, NO_SLOT );
@@ -4646,6 +4666,7 @@ BOOLEAN CreateGun( UINT16 usItem, INT8 bStatus, OBJECTTYPE * pObj )
pObj->ubGunAmmoType = Magazine[ Item[ usAmmo ].ubClassIndex].ubAmmoType;
pObj->bGunAmmoStatus = 100;
pObj->ubGunShotsLeft = Magazine[ Item[ usAmmo ].ubClassIndex ].ubMagSize;
pObj->ubGunState |= GS_CARTRIDGE_IN_CHAMBER; // Madd: new guns should have cartridge in chamber
/*
if (usItem == CAWS)
{
+17
View File
@@ -1583,6 +1583,16 @@ BOOLEAN EnoughAmmo( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay, INT8 bInvPos )
}
return( FALSE );
}
//<SB> manual recharge
if( pSoldier->bTeam == OUR_TEAM )
{
if ( !( pSoldier->inv[ bInvPos ].ubGunState & GS_CARTRIDGE_IN_CHAMBER ) )
{
return( FALSE );
}
}
//</SB>
}
}
@@ -1756,6 +1766,13 @@ INT8 GetAPsToAutoReload( SOLDIERTYPE * pSoldier )
CHECKF( pSoldier );
pObj = &(pSoldier->inv[HANDPOS]);
//<SB> manual recharge
if (pObj->ubGunShotsLeft && !(pObj->ubGunState & GS_CARTRIDGE_IN_CHAMBER) )
{
return Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually;
}
//</SB>
if (Item[pObj->usItem].usItemClass == IC_GUN || Item[pObj->usItem].usItemClass == IC_LAUNCHER)
{
bSlot = FindAmmoToReload( pSoldier, HANDPOS, NO_SLOT );
-1
View File
@@ -1,7 +1,6 @@
#ifndef __POINTS_H_
#define __POINTS_H_
#define AP_MINIMUM 10 // no merc can have less for his turn
#define AP_MAXIMUM 25 // no merc can have more for his turn
#define AP_MONSTER_MAXIMUM 40 // no monster can have more for his turn
+22 -5
View File
@@ -394,8 +394,10 @@ weaponStartElementHandle(void *userData, const char *name, const char **atts)
strcmp(name, "NoSemiAuto") == 0 ||
strcmp(name, "MaxDistForMessyDeath") == 0 ||
strcmp(name, "SilencedSound") == 0 || // Lesh: add new field (OR operand)
strcmp(name, "BurstAniDelay") == 0)) // Lesh: add new field (field itself)
strcmp(name, "BurstAniDelay") == 0 || // Lesh: add new field (field itself)
strcmp(name, "APsToReloadManually") == 0 ||
strcmp(name, "ManualReloadSound") == 0)
)
{
pData->curElement = WEAPON_ELEMENT_WEAPON_PROPERY;
@@ -611,6 +613,16 @@ weaponEndElementHandle(void *userData, const char *name)
pData->curWeapon.sAniDelay = (INT16) atol(pData->szCharData);
}
// Lesh: end
else if(strcmp(name, "APsToReloadManually") == 0)
{
pData->curElement = WEAPON_ELEMENT_WEAPON;
pData->curWeapon.APsToReloadManually = (UINT8) atol(pData->szCharData);
}
else if(strcmp(name, "ManualReloadSound") == 0)
{
pData->curElement = WEAPON_ELEMENT_WEAPON;
pData->curWeapon.ManualReloadSound = (UINT16) atol(pData->szCharData);
}
pData->maxReadDepth--;
}
@@ -758,11 +770,13 @@ BOOLEAN ReadInWeaponStats(STR fileName)
FilePrintf(hFile,"\t\t<ubHitVolume>%d</ubHitVolume>\r\n", Weapon[cnt].ubHitVolume);
FilePrintf(hFile,"\t\t<sSound>%d</sSound>\r\n", Weapon[cnt].sSound);
FilePrintf(hFile,"\t\t<sBurstSound>%d</sBurstSound>\r\n", Weapon[cnt].sBurstSound);
FilePrintf(hFile,"\t\t<sSilencedBurstSound>%d</sSilencedBurstSound>\r\n", Weapon[cnt].sSilencedBurstSound);
FilePrintf(hFile,"\t\t<sSilencedBurstSound>%d</sSilencedBurstSound>\r\n", Weapon[cnt].sSilencedBurstSound);
FilePrintf(hFile,"\t\t<sReloadSound>%d</sReloadSound>\r\n", Weapon[cnt].sReloadSound);
FilePrintf(hFile,"\t\t<sLocknLoadSound>%d</sLocknLoadSound>\r\n", Weapon[cnt].sLocknLoadSound);
FilePrintf(hFile,"\t\t<bBurstAP>%d</bBurstAP>\r\n", Weapon[cnt].bBurstAP);
FilePrintf(hFile,"\t\t<bBurstAP>%d</bBurstAP>\r\n", Weapon[cnt].bBurstAP);
FilePrintf(hFile,"\t\t<bAutofireShotsPerFiveAP>%d</bAutofireShotsPerFiveAP>\r\n", Weapon[cnt].bAutofireShotsPerFiveAP);
FilePrintf(hFile,"\t\t<APsToReloadManually>%d</APsToReloadManually>\r\n", Weapon[cnt].ManualReloadAPs);
FilePrintf(hFile,"\t\t<ManualReloadSound>%d</ManualReloadSound>\r\n", Weapon[cnt].ManualReloadSound);
FilePrintf(hFile,"\t</WEAPON>\r\n");
}
FilePrintf(hFile,"</WEAPONLIST>\r\n");
@@ -1914,7 +1928,10 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT16 sTargetGridNo )
pSoldier->bMonsterSmell--;
}
//<SB> manual recharge
if (Weapon[Item[usItemNum].ubClassIndex].APsToReloadManually > 0)
pSoldier->inv[ pSoldier->ubAttackingHand ].ubGunState &= ~GS_CARTRIDGE_IN_CHAMBER;
//<SB>
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("UseGun: done"));
return( TRUE );
}
+3 -1
View File
@@ -266,8 +266,10 @@ typedef struct
UINT8 APsToReload;
UINT8 maxdistformessydeath;
BOOLEAN NoSemiAuto;
UINT8 AutoPenalty;
UINT8 AutoPenalty;
INT16 sAniDelay; // Lesh: for burst animation delay
UINT8 APsToReloadManually;
UINT16 ManualReloadSound;
} WEAPONTYPE;
typedef struct
+29 -7
View File
@@ -1852,18 +1852,40 @@ INT32 EstimateStabDamage( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent,
INT8 TryToReload( SOLDIERTYPE * pSoldier )
{
INT8 bSlot;
WEAPONTYPE * pWeapon;
INT8 bSlot;
WEAPONTYPE *pWeapon;
OBJECTTYPE *pObj;
pWeapon = &(Weapon[pSoldier->inv[HANDPOS].usItem]);
bSlot = FindAmmo( pSoldier, pWeapon->ubCalibre, pWeapon->ubMagSize, NO_SLOT );
if (bSlot != NO_SLOT)
//if (bSlot != NO_SLOT)
//{
// if (ReloadGun( pSoldier, &(pSoldier->inv[HANDPOS]), &(pSoldier->inv[bSlot]) ))
// {
// return( TRUE );
// }
//}
//<SB> manual recharge
pObj = &(pSoldier->inv[HANDPOS]);
if (pObj->ubGunShotsLeft && !(pObj->ubGunState & GS_CARTRIDGE_IN_CHAMBER) )
{
if (ReloadGun( pSoldier, &(pSoldier->inv[HANDPOS]), &(pSoldier->inv[bSlot]) ))
{
return( TRUE );
}
pObj->ubGunState |= GS_CARTRIDGE_IN_CHAMBER;
DeductPoints(pSoldier, Weapon[Item[(pObj)->usItem].ubClassIndex].APsToReloadManually, 0);
//PlayJA2Sample( Weapon[ Item[pObj->usItem].ubClassIndex ].ManualReloadSound, RATE_11025, SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ) );
return TRUE;
}
//</SB>
if (bSlot != NO_SLOT && ReloadGun( pSoldier, &(pSoldier->inv[HANDPOS]), &(pSoldier->inv[bSlot]) ))
{
return( TRUE );
}
return( NOSHOOT_NOAMMO );
}