- bugfix: Endless clock after stealing

- changed: APs for stealing from 10 to 14 (because stealing is more than simple picking enemies gun)
- changed: You cannot steal items from head, body, leg or face until the enemy is collapsed (lying on the ground)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@631 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2006-11-13 08:36:36 +00:00
parent ac117f7143
commit c351c27e37
15 changed files with 107 additions and 31 deletions
+2 -2
View File
@@ -23,12 +23,12 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" };
#else
//RELEASE BUILD VERSION
INT16 zVersionLabel[256] = { L"Release v1.13.620" };
INT16 zVersionLabel[256] = { L"Release v1.13.631" };
#endif
INT8 czVersionNumber[16] = { "Build 06.11.06" };
INT8 czVersionNumber[16] = { "Build 06.11.13" };
INT16 zTrackingNumber[16] = { L"Z" };
BIN
View File
Binary file not shown.
+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_620.exe"
OutputFile="C:\Games\Jagged Alliance 2 v1.13\ja2_debug_631.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_620.exe"
OutputFile="C:\Games\Jagged Alliance 2 v1.13\ja2_release_631.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=".\..\..\Standard Gaming Platform\"
+51 -12
View File
@@ -5319,31 +5319,70 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet
ITEM_POOL *pItemPool,*pTempItemPool,*pTempLastItemPool;
OBJECTTYPE *pObject;
UINT8 i;
BOOLEAN fStealItem = FALSE;
//Create a temporary item pool, with index in Opponent's inventory as index
pItemPool=NULL;
for(i=0 ; i<NUM_INV_SLOTS; i++)
{
fStealItem = FALSE;
pObject=pOpponent->inv+i;
if (pObject->usItem!=0)
{
pTempItemPool = (ITEM_POOL*)MemAlloc(sizeof(ITEM_POOL));
++ubCount;
if (pItemPool == NULL)
// Is the enemy collapsed
if ( pOpponent->bLife < OKLIFE || pOpponent->bCollapsed )
{
pItemPool = pTempItemPool;
pItemPool->pPrev = NULL;
// We can steal any of his items in the inventory
fStealItem = TRUE;
}
else
{
pTempItemPool->pPrev = pTempLastItemPool;
pTempLastItemPool->pNext = pTempItemPool;
// Check, if we can steal the item
switch (i)
{
case HANDPOS:
case SECONDHANDPOS:
case BIGPOCK1POS:
case BIGPOCK2POS:
case BIGPOCK3POS:
case BIGPOCK4POS:
case SMALLPOCK1POS:
case SMALLPOCK2POS:
case SMALLPOCK3POS:
case SMALLPOCK4POS:
case SMALLPOCK5POS:
case SMALLPOCK6POS:
case SMALLPOCK7POS:
case SMALLPOCK8POS:
fStealItem = TRUE;
break;
default:
fStealItem = FALSE;
break;
}
}
if (fStealItem == TRUE)
{
pTempItemPool = (ITEM_POOL*)MemAlloc(sizeof(ITEM_POOL));
++ubCount;
if (pItemPool == NULL)
{
pItemPool = pTempItemPool;
pItemPool->pPrev = NULL;
}
else
{
pTempItemPool->pPrev = pTempLastItemPool;
pTempLastItemPool->pNext = pTempItemPool;
}
pTempItemPool->pNext = NULL;
pTempItemPool->iItemIndex = i;
//very bad, jack, to test if we are stealing?
pTempItemPool->pLevelNode=NULL;//finally not used
pTempLastItemPool=pTempItemPool;
}
pTempItemPool->pNext = NULL;
pTempItemPool->iItemIndex = i;
//very bad, jack, to test if we are stealing?
pTempItemPool->pLevelNode=NULL;//finally not used
pTempLastItemPool=pTempItemPool;
}
}
if (ubCount == 0)
+4
View File
@@ -6960,6 +6960,8 @@ void ItemPickupOK( GUI_BUTTON *btn, INT32 reason )
DeletePool(gItemPickupMenu.pItemPool);
if ((gpOpponent->inv[HANDPOS].usItem == NOTHING ) && (usLastItem!=NOTHING))
ReLoadSoldierAnimationDueToHandItemChange( gpOpponent, usLastItem, NOTHING );
PreventFromTheFreezingBug(gItemPickupMenu.pSoldier);
}
else
{
@@ -6992,6 +6994,8 @@ void ItemPickupCancel( GUI_BUTTON *btn, INT32 reason )
if (gfStealing) //jackaians modif
{
DeletePool(gItemPickupMenu.pItemPool);
PreventFromTheFreezingBug(gItemPickupMenu.pSoldier);
}
}
else if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE )
+1 -1
View File
@@ -23,7 +23,7 @@
#define AP_REVERSE_MODIFIER 1
#define AP_STEALTH_MODIFIER 2
#define AP_STEAL_ITEM 10 // APs to steal item....
#define AP_STEAL_ITEM 14 // APs to steal item....
#define AP_TAKE_BLOOD 10
+34 -9
View File
@@ -2161,11 +2161,13 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, BOOLEAN fStea
INT16 sAPCost;
EV_S_WEAPONHIT SWeaponHit;
INT32 iImpact;
UINT16 usOldItem;
UINT16 usOldItem, usNewItem;
UINT8 ubExpGain;
UINT8 ubIndexRet;
BOOLEAN fFailure; // no stealing occured
BOOLEAN fNoMoreItems; // The enemy has no more items to steal!
BOOLEAN fNoMoreItems = FALSE; // The enemy has no more items to steal!
BOOLEAN fNoMoreItemInHand = FALSE;
BOOLEAN fSoldierCollapsed = FALSE;
// Deduct points!
// August 13 2002: unless stealing - APs already deducted elsewhere
@@ -2207,6 +2209,7 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, BOOLEAN fStea
else if ( pTargetSoldier->bLife < OKLIFE || pTargetSoldier->bCollapsed )
{
iHitChance = 100;
fSoldierCollapsed = TRUE;
}
else
{
@@ -2252,6 +2255,9 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, BOOLEAN fStea
// Do we have the chance to steal more than 1 item?
if (( iDiceRoll <= iHitChance * 2 / 3) || (pTargetSoldier->bCollapsed))
{
// The item that the enemy holds in his hand before the stealing
usOldItem = pTargetSoldier->inv[HANDPOS].usItem;
INT16 sNumStolenItems = StealItems(pSoldier, pTargetSoldier,&ubIndexRet);
// We have only stolen 1 item, because the enemy has not more than one item.
@@ -2266,6 +2272,15 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, BOOLEAN fStea
AddItemToPool( pSoldier->sGridNo, &(pTargetSoldier->inv[HANDPOS]), 1, pSoldier->bLevel, 0, -1 );
}
DeleteObj( &(pTargetSoldier->inv[ubIndexRet]) );
// WANNE: NEW
// The item that the enemy holds in his hand before the stealing
usNewItem = pTargetSoldier->inv[HANDPOS].usItem;
if (usOldItem != usNewItem)
{
ReLoadSoldierAnimationDueToHandItemChange(pTargetSoldier, usOldItem, usNewItem );
}
}
// The enemy has no more items to steal
else if (sNumStolenItems == 0)
@@ -2299,11 +2314,10 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, BOOLEAN fStea
// Reload buddy's animation...
ReLoadSoldierAnimationDueToHandItemChange( pTargetSoldier, usOldItem, NOTHING );
}
// Steal was successfull, but the enemy had nothing to steal (we had stolen the Nada item)
// Enemy has no item in his hand.
else
{
fNoMoreItems = TRUE;
//fFailure=TRUE;
fNoMoreItemInHand = TRUE;
}
// Reload buddy's animation...
//ReLoadSoldierAnimationDueToHandItemChange( pTargetSoldier, usOldItem, NOTHING );
@@ -2329,13 +2343,24 @@ BOOLEAN UseHandToHand( SOLDIERTYPE *pSoldier, INT16 sTargetGridNo, BOOLEAN fStea
DoMercBattleSound( pSoldier, BATTLE_SOUND_CURSE1 );
}
}
else
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE,
Message[ STR_NO_MORE_ITEM_IN_HAND ]);
}
}
// The enemy had no more items to steal, or we had stolen the Nada item
if (fNoMoreItems == TRUE)
// Enemy had no item in its hand
else if (fNoMoreItemInHand == TRUE)
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE,
Message[ STR_NO_MORE_ITEMS_TO_STEAL ],
pSoldier->name, ShortItemNames[ pTargetSoldier->inv[HANDPOS].usItem ] );
Message[ STR_NO_MORE_ITEM_IN_HAND ]);
}
// The enemy has no more items to steal
else if (fNoMoreItems == TRUE)
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE,
Message[ STR_NO_MORE_ITEMS_TO_STEAL ]);
}
// Give some experience
+2 -1
View File
@@ -332,7 +332,8 @@ enum
STR_ACCURATE,
STR_INACCURATE,
STR_NO_SEMI_AUTO,
STR_NO_MORE_ITEMS_TO_STEAL // WANNE
STR_NO_MORE_ITEMS_TO_STEAL, // WANNE
STR_NO_MORE_ITEM_IN_HAND, // WANNE
};
// WANNE: Tooltips
+1
View File
@@ -286,6 +286,7 @@ UINT16 Message[][STRING_LENGTH] =
L"automatic",
L"no full auto",
L"The enemy has no more items to steal!", // WANNE
L"The enemy has no item in its hand!", //WANNE
};
+2 -1
View File
@@ -286,7 +286,7 @@ UINT16 Message[][STRING_LENGTH] =
L"This attachment will be permanent. Go ahead with it?",
L"%s feels more energetic!",
L"%s slipped on some marbles!",
L"%s failed to grab the %s!",
L"%s failed to grab the %s from enemy's hand!",
L"%s has repaired the %s",
L"Interrupt for ",
L"Surrender?",
@@ -301,6 +301,7 @@ UINT16 Message[][STRING_LENGTH] =
L"inaccurate",
L"no semi auto",
L"The enemy has no more items to steal!", // WANNE
L"The enemy has no item in its hand!", //WANNE
};
+1
View File
@@ -292,6 +292,7 @@ UINT16 Message[][STRING_LENGTH] =
L"automatic",
L"no full auto",
L"The enemy has no more items to steal!", // WANNE
L"The enemy has no item in its hand!", //WANNE
};
+4 -3
View File
@@ -279,7 +279,7 @@ UINT16 Message[][STRING_LENGTH] =
L"Die Modifikation ist permanent. Weitermachen?",
L"%s fühlt sich frischer!",
L"%s ist auf Murmeln ausgerutscht!",
L"%s konnte %s nicht greifen!",
L"%s konnte %s aus der Hand des Feindes nicht stehlen!",
L"%s hat %s repariert",
L"Unterbrechung für ",
L"Ergeben?",
@@ -293,7 +293,8 @@ UINT16 Message[][STRING_LENGTH] =
L"genau",
L"ungenau",
L"kein Einzelschuss",
L"Der Gegner besitzt keine Gegenstände mehr zum Stehlen!",
L"Der Feind besitzt keine Gegenstände mehr zum Stehlen!",
L"Der Feind hat keinen Gegenstand in seiner Hand!", //WANNE
};
CHAR16 pTownNames[MAX_TOWNS][MAX_TOWN_NAME_LENGHT] =
@@ -1884,7 +1885,7 @@ STR16 pMapErrorString[] =
L"Raketenstützpunkt in %s wurde erobert.",
//16-20
L"Mine in %s wurde erobert. Ihre Tageseinnahmen wurden reduziert auf %s.",
L"Gegner hat Sektor %s ohne Gegenwehr erobert.",
L"Feind hat Sektor %s ohne Gegenwehr erobert.",
L"Mindestens ein Söldner konnte nicht eingeteilt werden.",
L"%s konnte sich nicht anschließen, weil %s voll ist",
L"%s konnte sich %s nicht anschließen, weil er zu weit weg ist.",
+1
View File
@@ -285,6 +285,7 @@ UINT16 Message[][STRING_LENGTH] =
L"automatic",
L"no full auto",
L"The enemy has no more items to steal!", // WANNE
L"The enemy has no item in its hand!", //WANNE
};
+1
View File
@@ -286,6 +286,7 @@ UINT16 Message[][STRING_LENGTH] =
L"automatic",
L"no full auto",
L"The enemy has no more items to steal!", // WANNE
L"The enemy has no item in its hand!", //WANNE
};
+1
View File
@@ -293,6 +293,7 @@ UINT16 Message[][STRING_LENGTH] =
L"inaccurate",
L"no semi auto",
L"The enemy has no more items to steal!", // WANNE
L"The enemy has no item in its hand!", //WANNE
};