mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
New feature: riot shields protect against damage from some directions.
For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23452&start=0& git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8434 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -53,6 +53,11 @@
|
||||
#include "Render Z.h"
|
||||
///////////////////////////
|
||||
|
||||
#include "Utilities.h"
|
||||
|
||||
UINT32 guiShieldGraphic = 0;
|
||||
BOOLEAN fShieldGraphicInit = FALSE;
|
||||
|
||||
extern CHAR8 gDebugStr[128];
|
||||
extern BOOLEAN fLandLayerDirty = TRUE;
|
||||
|
||||
@@ -603,6 +608,50 @@ void DeleteFromWorld( UINT16 usTileIndex, UINT32 uiRenderTiles, UINT16 usIndex )
|
||||
void RenderHighlight( INT16 sMouseX_M, INT16 sMouseY_M, INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStartPointX_S, INT16 sStartPointY_S, INT16 sEndXS, INT16 sEndYS );
|
||||
BOOLEAN CheckRenderCenter( INT16 sNewCenterX, INT16 sNewCenterY );
|
||||
|
||||
// Flugente: display a riot shield
|
||||
void ShowRiotShield( SOLDIERTYPE* pSoldier )
|
||||
{
|
||||
if (pSoldier)
|
||||
{
|
||||
if (!fShieldGraphicInit)
|
||||
{
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
|
||||
// Flugente: enemy role symbols
|
||||
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
||||
FilenameForBPP("Tilecache\\riotshield.sti", VObjectDesc.ImageFile);
|
||||
if (!AddVideoObject(&VObjectDesc, &guiShieldGraphic))
|
||||
AssertMsg(0, "Missing Tilecache\\riotshield.sti");
|
||||
|
||||
fShieldGraphicInit = TRUE;
|
||||
}
|
||||
|
||||
// Get screen pos of gridno......
|
||||
INT16 sScreenX, sScreenY;
|
||||
GetGridNoScreenXY(pSoldier->sGridNo, &sScreenX, &sScreenY);
|
||||
|
||||
// redraw background to stop weird graphic remnants remaining
|
||||
// but don*t do so while scrolling, because that looks weird
|
||||
if ( !gfScrollPending && !gfScrollInertia)
|
||||
{
|
||||
INT32 iBack = RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, sScreenX - 50, sScreenY - 60, sScreenX + 50, sScreenY + 35);
|
||||
|
||||
if (iBack != -1)
|
||||
{
|
||||
SetBackgroundRectFilled(iBack);
|
||||
}
|
||||
}
|
||||
|
||||
UINT16 offset = 0;
|
||||
OBJECTTYPE* pObj = pSoldier->GetEquippedRiotShield();
|
||||
|
||||
if (pObj)
|
||||
offset = Item[pObj->usItem].usRiotShieldGraphic;
|
||||
|
||||
BltVideoObjectFromIndex( FRAME_BUFFER, guiShieldGraphic, offset * 8 + pSoldier->ubDirection, sScreenX - 20, sScreenY - 60, VO_BLT_TRANSSHADOW, NULL );
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN RevealWalls(INT16 sX, INT16 sY, INT16 sRadius)
|
||||
{
|
||||
LEVELNODE *pStruct;
|
||||
@@ -1837,6 +1886,16 @@ void RenderTiles(UINT32 uiFlags, INT32 iStartPointX_M, INT32 iStartPointY_M, INT
|
||||
usImageIndex = pSoldier->CryoAniFrame( );
|
||||
}
|
||||
|
||||
// Flugente: riot shields
|
||||
if ( pSoldier &&
|
||||
(pSoldier->ubDirection == NORTH ||
|
||||
pSoldier->ubDirection == NORTHWEST ||
|
||||
pSoldier->ubDirection == WEST)
|
||||
&& pSoldier->IsRiotShieldEquipped( ) )
|
||||
{
|
||||
ShowRiotShield( pSoldier );
|
||||
}
|
||||
|
||||
uiDirtyFlags=BGND_FLAG_SINGLE|BGND_FLAG_ANIMATED| BGND_FLAG_MERC;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user