mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
A paramedic can use empty bloodbags (<emptybloodbag>-tag, item #1756) to create blood bags (<bloodbag>-tag, item #1757) from other mercs. These can then boost the health returned by surgery by ONTOP_PERCENT_SURGERY_HEAL_BLOODBAG percent.
Requires GameDir >= r2467. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8662 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -319,8 +319,10 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
|
||||
if ( fFromUI && pSoldier->bTeam == gbPlayerNum && pTargetSoldier &&
|
||||
(pTargetSoldier->bTeam == gbPlayerNum || pTargetSoldier->aiData.bNeutral) && pTargetSoldier->ubBodyType != CROW &&
|
||||
Item[usHandItem].usItemClass != IC_MEDKIT && !Item[usHandItem].gascan &&
|
||||
!ItemCanBeAppliedToOthers( usHandItem ) )
|
||||
Item[usHandItem].usItemClass != IC_MEDKIT &&
|
||||
!Item[usHandItem].gascan &&
|
||||
!ItemCanBeAppliedToOthers( usHandItem ) &&
|
||||
!HasItemFlag( usHandItem, EMPTY_BLOOD_BAG ) )
|
||||
{
|
||||
if ( pSoldier->ubProfile != NO_PROFILE )
|
||||
{
|
||||
@@ -1525,6 +1527,86 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
}
|
||||
}
|
||||
|
||||
// Flugente: apply misc items to other soldiers
|
||||
if ( HasItemFlag( usHandItem, EMPTY_BLOOD_BAG ) )
|
||||
{
|
||||
// ATE: AI CANNOT GO THROUGH HERE!
|
||||
BOOLEAN fHadToUseCursorPos = FALSE;
|
||||
|
||||
// See if we can get there to stab
|
||||
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
|
||||
if ( sActionGridNo == -1 )
|
||||
{
|
||||
// Try another location...
|
||||
sActionGridNo = FindAdjacentGridEx( pSoldier, usMapPos, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
|
||||
|
||||
if ( sActionGridNo == -1 )
|
||||
{
|
||||
return( ITEM_HANDLE_CANNOT_GETTO_LOCATION );
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate AP costs...
|
||||
sAPCost = GetAPsToFillBloodbag( pSoldier, sActionGridNo );
|
||||
sAPCost += PlotPath( pSoldier, sActionGridNo, NO_COPYROUTE, FALSE, TEMPORARY, (UINT16)pSoldier->usUIMovementMode, NOT_STEALTH, FORWARD, pSoldier->bActionPoints );
|
||||
|
||||
// if we are at the action gridno, the item is a bomb, but nobody is at the gridno, do not apply and do not return - we will plant the bomb instead (handlded later in this function)
|
||||
if ( Item[usHandItem].usItemClass == IC_BOMB && pSoldier->sGridNo == sActionGridNo && WhoIsThere2( usMapPos, pSoldier->pathing.bLevel ) == NOBODY )
|
||||
{
|
||||
;
|
||||
}
|
||||
else if ( EnoughPoints( pSoldier, sAPCost, 0, fFromUI ) )
|
||||
{
|
||||
// OK, set UI
|
||||
SetUIBusy( pSoldier->ubID );
|
||||
|
||||
// CHECK IF WE ARE AT THIS GRIDNO NOW
|
||||
if ( pSoldier->sGridNo != sActionGridNo )
|
||||
{
|
||||
// SEND PENDING ACTION
|
||||
pSoldier->aiData.ubPendingAction = MERC_FILLBLOODBAG;
|
||||
|
||||
if ( fHadToUseCursorPos )
|
||||
{
|
||||
pSoldier->aiData.sPendingActionData2 = usMapPos;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( pTargetSoldier != NULL )
|
||||
{
|
||||
pSoldier->aiData.sPendingActionData2 = pTargetSoldier->sGridNo;
|
||||
}
|
||||
else
|
||||
{
|
||||
pSoldier->aiData.sPendingActionData2 = sGridNo;
|
||||
}
|
||||
}
|
||||
pSoldier->aiData.bPendingActionData3 = ubDirection;
|
||||
pSoldier->aiData.ubPendingActionAnimCount = 0;
|
||||
|
||||
// WALK UP TO DEST FIRST
|
||||
pSoldier->EVENT_InternalGetNewSoldierPath( sActionGridNo, pSoldier->usUIMovementMode, FALSE, TRUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
pSoldier->EVENT_SoldierTakeBloodFromPerson( sAdjustedGridNo, ubDirection );
|
||||
|
||||
UnSetUIBusy( pSoldier->ubID );
|
||||
}
|
||||
|
||||
if ( fFromUI )
|
||||
{
|
||||
guiPendingOverrideEvent = A_CHANGE_TO_MOVE;
|
||||
}
|
||||
|
||||
return( ITEM_HANDLE_OK );
|
||||
}
|
||||
else
|
||||
{
|
||||
return( ITEM_HANDLE_NOAPS );
|
||||
}
|
||||
}
|
||||
|
||||
if ( Item[usHandItem].canandstring )
|
||||
{
|
||||
STRUCTURE *pStructure;
|
||||
@@ -5431,7 +5513,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
|
||||
|
||||
// Flugente: tripwire rolls are not planted - instead we spawn tripwire and plant that
|
||||
OBJECTTYPE* pObj = &(gpTempSoldier->inv[HANDPOS]);
|
||||
if ( Item[ gpTempSoldier->inv[ HANDPOS ].usItem ].usItemFlag & TRIPWIREROLL && Item[ gpTempSoldier->inv[ HANDPOS ].usItem ].usBuddyItem != NOTHING )
|
||||
if ( HasItemFlag( gpTempSoldier->inv[HANDPOS].usItem, TRIPWIREROLL ) && Item[ gpTempSoldier->inv[ HANDPOS ].usItem ].usBuddyItem != NOTHING )
|
||||
{
|
||||
(*pObj)[0]->data.objectStatus--;
|
||||
|
||||
@@ -5794,11 +5876,11 @@ void BoobyTrapDialogueCallBack( void )
|
||||
// now prompt the user...
|
||||
if( guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN )
|
||||
{
|
||||
DoScreenIndependantMessageBox( TacticalStr[ DISARM_BOOBYTRAP_PROMPT ], ( UINT8 )MSG_BOX_FLAG_YESNO, BoobyTrapInMapScreenMessageBoxCallBack );
|
||||
DoScreenIndependantMessageBox( TacticalStr[ DISARM_BOOBYTRAP_PROMPT ], MSG_BOX_FLAG_YESNO, BoobyTrapInMapScreenMessageBoxCallBack );
|
||||
}
|
||||
else
|
||||
{
|
||||
DoScreenIndependantMessageBox( TacticalStr[ DISARM_BOOBYTRAP_PROMPT ], ( UINT8 )MSG_BOX_FLAG_YESNO, BoobyTrapMessageBoxCallBack );
|
||||
DoScreenIndependantMessageBox( TacticalStr[ DISARM_BOOBYTRAP_PROMPT ], MSG_BOX_FLAG_YESNO, BoobyTrapMessageBoxCallBack );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user