Fix for AI seeking climb point in toxic gas

Fix for civilians trying to climb the roof to seek noise
Fix for punching and stabbing
Transparent change: Gave names to anonymous structs in OBJECTTYPE


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1225 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Overhaul
2007-08-18 19:03:20 +00:00
parent 29b883f59d
commit fccef1faea
60 changed files with 921 additions and 887 deletions
+37 -37
View File
@@ -844,11 +844,11 @@ void AddSelectedItemToWorld( INT16 sGridNo )
case MONEY:
case SILVER:
case GOLD:
tempObject.bStatus[0] = 100;
tempObject.uiMoneyAmount = 100 + Random( 19901 );
tempObject.ItemData.Money.bMoneyStatus = 100;
tempObject.ItemData.Money.uiMoneyAmount = 100 + Random( 19901 );
break;
case OWNERSHIP:
tempObject.ubOwnerProfile = NO_PROFILE;
tempObject.ItemData.Owner.ubOwnerProfile = NO_PROFILE;
bVisibility = BURIED;
break;
case SWITCH:
@@ -857,39 +857,39 @@ void AddSelectedItemToWorld( INT16 sGridNo )
return;
}
bVisibility = BURIED;
tempObject.bStatus[0] = 100;
tempObject.ubBombOwner = 1;
tempObject.ItemData.Trigger.bBombStatus = 100;
tempObject.ItemData.Trigger.ubBombOwner = 1;
if( eInfo.sSelItemIndex < 2 )
tempObject.bFrequency = PANIC_FREQUENCY;
tempObject.ItemData.Trigger.BombTrigger.bFrequency = PANIC_FREQUENCY;
else if( eInfo.sSelItemIndex < 4 )
tempObject.bFrequency = PANIC_FREQUENCY_2;
tempObject.ItemData.Trigger.BombTrigger.bFrequency = PANIC_FREQUENCY_2;
else if( eInfo.sSelItemIndex < 6 )
tempObject.bFrequency = PANIC_FREQUENCY_3;
tempObject.ItemData.Trigger.BombTrigger.bFrequency = PANIC_FREQUENCY_3;
else
tempObject.bFrequency = (INT8)(FIRST_MAP_PLACED_FREQUENCY + (eInfo.sSelItemIndex-4) / 2);
tempObject.ItemData.Trigger.BombTrigger.bFrequency = (INT8)(FIRST_MAP_PLACED_FREQUENCY + (eInfo.sSelItemIndex-4) / 2);
usFlags |= WORLD_ITEM_ARMED_BOMB;
break;
case ACTION_ITEM:
bVisibility = BURIED;
tempObject.bStatus[0] = 100;
tempObject.ubBombOwner = 1;
tempObject.ItemData.Trigger.bBombStatus = 100;
tempObject.ItemData.Trigger.ubBombOwner = 1;
tempObject.bTrap = gbDefaultBombTrapLevel;
if( eInfo.sSelItemIndex < PRESSURE_ACTION_ID )
{
tempObject.bDetonatorType = BOMB_REMOTE;
tempObject.ItemData.Trigger.bDetonatorType = BOMB_REMOTE;
if( eInfo.sSelItemIndex < 2 )
tempObject.bFrequency = PANIC_FREQUENCY;
tempObject.ItemData.Trigger.BombTrigger.bFrequency = PANIC_FREQUENCY;
else if( eInfo.sSelItemIndex < 4 )
tempObject.bFrequency = PANIC_FREQUENCY_2;
tempObject.ItemData.Trigger.BombTrigger.bFrequency = PANIC_FREQUENCY_2;
else if( eInfo.sSelItemIndex < 6 )
tempObject.bFrequency = PANIC_FREQUENCY_3;
tempObject.ItemData.Trigger.BombTrigger.bFrequency = PANIC_FREQUENCY_3;
else
tempObject.bFrequency = (INT8)(FIRST_MAP_PLACED_FREQUENCY + (eInfo.sSelItemIndex-4) / 2);
tempObject.ItemData.Trigger.BombTrigger.bFrequency = (INT8)(FIRST_MAP_PLACED_FREQUENCY + (eInfo.sSelItemIndex-4) / 2);
}
else
{
tempObject.bDetonatorType = BOMB_PRESSURE;
tempObject.bDelay = 0;
tempObject.ItemData.Trigger.bDetonatorType = BOMB_PRESSURE;
tempObject.ItemData.Trigger.BombTrigger.bDelay = 0;
}
ChangeActionItem( &tempObject, gbActionItemIndex );
tempObject.fFlags |= OBJECT_ARMED_BOMB;
@@ -916,26 +916,26 @@ void AddSelectedItemToWorld( INT16 sGridNo )
{
if (Random( 2 ))
{
pObject->ubShotsLeft[0] = Magazine[ pItem->ubClassIndex ].ubMagSize;
pObject->ItemData.Ammo.ubShotsLeft[0] = Magazine[ pItem->ubClassIndex ].ubMagSize;
}
else
{
pObject->ubShotsLeft[0] = (UINT8) Random( Magazine[ pItem->ubClassIndex ].ubMagSize );
pObject->ItemData.Ammo.ubShotsLeft[0] = (UINT8) Random( Magazine[ pItem->ubClassIndex ].ubMagSize );
}
}
else
{
pObject->bStatus[0] = (INT8)(70 + Random( 26 ));
pObject->ItemData.Generic.bStatus[0] = (INT8)(70 + Random( 26 ));
}
if( pItem->usItemClass & IC_GUN )
{
if ( pObject->usItem == ROCKET_LAUNCHER )
{
pObject->ubGunShotsLeft = 1;
pObject->ItemData.Gun.ubGunShotsLeft = 1;
}
else
{
pObject->ubGunShotsLeft = (UINT8)(Random( Weapon[ pObject->usItem ].ubMagSize ));
pObject->ItemData.Gun.ubGunShotsLeft = (UINT8)(Random( Weapon[ pObject->usItem ].ubMagSize ));
}
}
@@ -1054,9 +1054,9 @@ void DeleteSelectedItem()
//remove the item
if( gWorldItems[ gpItemPool->iItemIndex ].o.usItem == ACTION_ITEM )
{
if( gWorldItems[ gpItemPool->iItemIndex ].o.bActionValue == ACTION_ITEM_SMALL_PIT )
if( gWorldItems[ gpItemPool->iItemIndex ].o.ItemData.Trigger.bActionValue == ACTION_ITEM_SMALL_PIT )
Remove3X3Pit( gWorldItems[ gpItemPool->iItemIndex ].sGridNo );
else if( gWorldItems[ gpItemPool->iItemIndex ].o.bActionValue == ACTION_ITEM_LARGE_PIT )
else if( gWorldItems[ gpItemPool->iItemIndex ].o.ItemData.Trigger.bActionValue == ACTION_ITEM_LARGE_PIT )
Remove5X5Pit( gWorldItems[ gpItemPool->iItemIndex ].sGridNo );
}
if( gpEditingItemPool == gpItemPool )
@@ -1295,7 +1295,7 @@ void SelectNextKeyOfType( UINT8 ubKeyID )
while( gpItemPool )
{
pObject = &gWorldItems[ gpItemPool->iItemIndex ].o;
if( Item[ pObject->usItem ].usItemClass == IC_KEY && pObject->ubKeyID == ubKeyID )
if( Item[ pObject->usItem ].usItemClass == IC_KEY && pObject->ItemData.Key.ubKeyID == ubKeyID )
{
SpecifyItemToEdit( pObject, gWorldItems[ gpItemPool->iItemIndex ].sGridNo );
CenterScreenAtMapIndex( gsItemGridNo );
@@ -1314,7 +1314,7 @@ void SelectNextKeyOfType( UINT8 ubKeyID )
while( gpItemPool )
{
pObject = &gWorldItems[ gpItemPool->iItemIndex ].o;
if( Item[ pObject->usItem ].usItemClass == IC_KEY && pObject->ubKeyID == ubKeyID )
if( Item[ pObject->usItem ].usItemClass == IC_KEY && pObject->ItemData.Key.ubKeyID == ubKeyID )
{
SpecifyItemToEdit( pObject, gWorldItems[ gpItemPool->iItemIndex ].sGridNo );
CenterScreenAtMapIndex( gsItemGridNo );
@@ -1332,7 +1332,7 @@ void SelectNextKeyOfType( UINT8 ubKeyID )
while( gpItemPool )
{
pObject = &gWorldItems[ gpItemPool->iItemIndex ].o;
if( Item[ pObject->usItem ].usItemClass == IC_KEY && pObject->ubKeyID == ubKeyID )
if( Item[ pObject->usItem ].usItemClass == IC_KEY && pObject->ItemData.Key.ubKeyID == ubKeyID )
{
SpecifyItemToEdit( pObject, gWorldItems[ gpItemPool->iItemIndex ].sGridNo );
CenterScreenAtMapIndex( gsItemGridNo );
@@ -1359,7 +1359,7 @@ void SelectNextTriggerWithFrequency( UINT16 usItem, INT8 bFrequency )
while( gpItemPool )
{
pObject = &gWorldItems[ gpItemPool->iItemIndex ].o;
if( pObject->usItem == usItem && pObject->bFrequency == bFrequency )
if( pObject->usItem == usItem && pObject->ItemData.Trigger.BombTrigger.bFrequency == bFrequency )
{
SpecifyItemToEdit( pObject, gWorldItems[ gpItemPool->iItemIndex ].sGridNo );
CenterScreenAtMapIndex( gsItemGridNo );
@@ -1378,7 +1378,7 @@ void SelectNextTriggerWithFrequency( UINT16 usItem, INT8 bFrequency )
while( gpItemPool )
{
pObject = &gWorldItems[ gpItemPool->iItemIndex ].o;
if( pObject->usItem == usItem && pObject->bFrequency == bFrequency )
if( pObject->usItem == usItem && pObject->ItemData.Trigger.BombTrigger.bFrequency == bFrequency )
{
SpecifyItemToEdit( pObject, gWorldItems[ gpItemPool->iItemIndex ].sGridNo );
CenterScreenAtMapIndex( gsItemGridNo );
@@ -1396,7 +1396,7 @@ void SelectNextTriggerWithFrequency( UINT16 usItem, INT8 bFrequency )
while( gpItemPool )
{
pObject = &gWorldItems[ gpItemPool->iItemIndex ].o;
if( pObject->usItem == usItem && pObject->bFrequency == bFrequency )
if( pObject->usItem == usItem && pObject->ItemData.Trigger.BombTrigger.bFrequency == bFrequency )
{
SpecifyItemToEdit( pObject, gWorldItems[ gpItemPool->iItemIndex ].sGridNo );
CenterScreenAtMapIndex( gsItemGridNo );
@@ -1423,7 +1423,7 @@ void SelectNextPressureAction()
while( gpItemPool )
{
pObject = &gWorldItems[ gpItemPool->iItemIndex ].o;
if( pObject->usItem == ACTION_ITEM && pObject->bDetonatorType == BOMB_PRESSURE )
if( pObject->usItem == ACTION_ITEM && pObject->ItemData.Trigger.bDetonatorType == BOMB_PRESSURE )
{
SpecifyItemToEdit( pObject, gWorldItems[ gpItemPool->iItemIndex ].sGridNo );
CenterScreenAtMapIndex( gsItemGridNo );
@@ -1442,7 +1442,7 @@ void SelectNextPressureAction()
while( gpItemPool )
{
pObject = &gWorldItems[ gpItemPool->iItemIndex ].o;
if( pObject->usItem == ACTION_ITEM && pObject->bDetonatorType == BOMB_PRESSURE )
if( pObject->usItem == ACTION_ITEM && pObject->ItemData.Trigger.bDetonatorType == BOMB_PRESSURE )
{
SpecifyItemToEdit( pObject, gWorldItems[ gpItemPool->iItemIndex ].sGridNo );
CenterScreenAtMapIndex( gsItemGridNo );
@@ -1460,7 +1460,7 @@ void SelectNextPressureAction()
while( gpItemPool )
{
pObject = &gWorldItems[ gpItemPool->iItemIndex ].o;
if( pObject->usItem == ACTION_ITEM && pObject->bDetonatorType == BOMB_PRESSURE )
if( pObject->usItem == ACTION_ITEM && pObject->ItemData.Trigger.bDetonatorType == BOMB_PRESSURE )
{
SpecifyItemToEdit( pObject, gWorldItems[ gpItemPool->iItemIndex ].sGridNo );
CenterScreenAtMapIndex( gsItemGridNo );
@@ -1508,7 +1508,7 @@ UINT16 CountNumberOfItemsWithFrequency( UINT16 usItem, INT8 bFrequency )
while( pItemPool )
{
if( gWorldItems[ pItemPool->iItemIndex ].o.usItem == usItem &&
gWorldItems[ pItemPool->iItemIndex ].o.bFrequency == bFrequency )
gWorldItems[ pItemPool->iItemIndex ].o.ItemData.Trigger.BombTrigger.bFrequency == bFrequency )
{
num++;
}
@@ -1531,7 +1531,7 @@ UINT16 CountNumberOfPressureActionsInWorld()
while( pItemPool )
{
if( gWorldItems[ pItemPool->iItemIndex ].o.usItem == ACTION_ITEM &&
gWorldItems[ pItemPool->iItemIndex ].o.bDetonatorType == BOMB_PRESSURE )
gWorldItems[ pItemPool->iItemIndex ].o.ItemData.Trigger.bDetonatorType == BOMB_PRESSURE )
{
num++;
}
@@ -1592,7 +1592,7 @@ UINT16 CountNumberOfKeysOfTypeInWorld( UINT8 ubKeyID )
{
if( Item[ gWorldItems[ pItemPool->iItemIndex ].o.usItem ].usItemClass == IC_KEY )
{
if( gWorldItems[ pItemPool->iItemIndex ].o.ubKeyID == ubKeyID )
if( gWorldItems[ pItemPool->iItemIndex ].o.ItemData.Key.ubKeyID == ubKeyID )
{
num++;
}