New Feature: static fortifications can now be built by mercs (by Flugente)

- if the terrain allows it, an empty sandbag (item 1540) can be filled to a full sandbag (item 1541). You need to have a shovel (item 1015) in your second hand. You will notice the new hammer cursor
- by using a full sandbag, you can build a sandbag barrier
- by using a concertina stack, you can build a concertina wire barrier
- this only works if the current map has sandbags/concertina wire in its tileset
- with a shovel in your hand, you can remove a sandbag barrier
- changed the size of shovel so it can actually be put in inventories. It was also necessary to remove its ability to be used as a melee weapon.
- for further info, see this thread: http://www.bears-pit.com/board/ubbthreads.php/topics/305822.html#Post305822


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5340 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-06-11 08:32:07 +00:00
parent 56df9f8f69
commit 80509d2b61
25 changed files with 654 additions and 4 deletions
+57
View File
@@ -4117,6 +4117,24 @@ INT8 DrawUIMovementPath( SOLDIERTYPE *pSoldier, INT32 usMapPos, UINT32 uiFlags )
gsUIHandleShowMoveGridLocation = sActionGridNo;
}
}
else if ( uiFlags == MOVEUI_TARGET_FORTIFICATION )
{
sActionGridNo = FindAdjacentGridEx( pSoldier, usMapPos, &ubDirection, NULL, FALSE, TRUE );
if ( sActionGridNo == -1 )
{
sActionGridNo = usMapPos;
}
sAPCost = GetAPsToBuildFortification( pSoldier, sActionGridNo );
sAPCost += UIPlotPath( pSoldier, sActionGridNo, NO_COPYROUTE, fPlot, TEMPORARY, (UINT16)pSoldier->usUIMovementMode, NOT_STEALTH, FORWARD, pSoldier->bActionPoints);
if ( sActionGridNo != pSoldier->sGridNo )
{
gfUIHandleShowMoveGrid = TRUE;
gsUIHandleShowMoveGridLocation = sActionGridNo;
}
}
else if ( uiFlags == MOVEUI_TARGET_MERCS )
{
INT32 sGotLocation = NOWHERE;
@@ -4423,6 +4441,45 @@ BOOLEAN UIMouseOnValidAttackLocation( SOLDIERTYPE *pSoldier )
}
}
if ( ubItemCursor == FORTICURS )
{
if ( gfUIFullTargetFound )
{
usMapPos = MercPtrs[ gusUIFullTargetID ]->sGridNo;
}
if ( pSoldier->pathing.bLevel == 0 )
{
if ( IsFortificationPossibleAtGridNo( usMapPos, NULL ) )
{
return( TRUE );
}
if ( HasItemFlag( (&(pSoldier->inv[HANDPOS]))->usItem, (EMPTY_SANDBAG)) )
{
// check if we have a shovel in our second hand
OBJECTTYPE* pShovelObj = &(pSoldier->inv[SECONDHANDPOS]);
if ( !pShovelObj || !(pShovelObj->exists()) || !HasItemFlag(pSoldier->inv[ SECONDHANDPOS ].usItem, (SHOVEL)) )
{
return( TRUE );
}
}
if ( HasItemFlag( (&(pSoldier->inv[HANDPOS]))->usItem, (SHOVEL)) )
{
STRUCTURE* pStruct = FindStructure(usMapPos, STRUCTURE_GENERIC);
if ( pStruct )
{
return( TRUE );
}
}
}
return( FALSE );
}
if ( ubItemCursor == BOMBCURS )
{
if ( usMapPos == pSoldier->sGridNo )