@ -424,9 +424,14 @@ void Monster::Draw()const{
if ( markedForDeletion ) return ;
Pixel blendCol = GetBuffs ( BuffType : : SLOWDOWN ) . size ( ) > 0 ? Pixel { uint8_t ( 255 * abs ( sin ( 1.4 * GetBuffs ( BuffType : : SLOWDOWN ) [ 0 ] . duration ) ) ) , uint8_t ( 255 * abs ( sin ( 1.4 * GetBuffs ( BuffType : : SLOWDOWN ) [ 0 ] . duration ) ) ) , uint8_t ( 128 + 127 * abs ( sin ( 1.4 * GetBuffs ( BuffType : : SLOWDOWN ) [ 0 ] . duration ) ) ) } : WHITE ;
const vf2d hitTimerOffset = vf2d { sin ( 20 * PI * lastHitTimer + randomFrameOffset ) , 0.f } * 2.f * GetSizeMult ( ) ;
const vf2d zOffset = - vf2d { 0 , GetZ ( ) } ;
const vf2d drawPos = GetPos ( ) + zOffset + hitTimerOffset ;
if ( GetZ ( ) > 0 ) {
vf2d shadowScale = vf2d { 8 * GetSizeMult ( ) / 3.f , 1 } / std : : max ( 1.f , GetZ ( ) / 24 ) ;
game - > view . DrawDecal ( GetPos ( ) - vf2d { 3 , 3 } * shadowScale / 2 + vf2d { 0 , 6 * GetSizeMult ( ) } , GFX [ " circle.png " ] . Decal ( ) , shadowScale , BLACK ) ;
game - > view . DrawDecal ( drawPos - vf2d { 3 , 3 } * shadowScale / 2 + vf2d { 0 , 6 * GetSizeMult ( ) } , GFX [ " circle.png " ] . Decal ( ) , shadowScale , BLACK ) ;
}
const bool NotOnTitleScreen = GameState : : STATE ! = GameState : : states [ States : : MAIN_MENU ] ;
@ -439,15 +444,15 @@ void Monster::Draw()const{
blendCol . a = blendColAlpha ;
game - > view . DrawPartialRotatedDecal ( GetPos ( ) - vf2d { 0 , GetZ ( ) } , GetFrame ( ) . GetSourceImage ( ) - > Decal ( ) , spriteRot , GetFrame ( ) . GetSourceRect ( ) . size / 2 , GetFrame ( ) . GetSourceRect ( ) . pos , GetFrame ( ) . GetSourceRect ( ) . size , vf2d ( GetSizeMult ( ) * ( ! HasFourWaySprites ( ) & & GetFacingDirection ( ) = = Direction : : EAST ? - 1 : 1 ) , GetSizeMult ( ) ) , blendCol ) ;
game - > view . DrawPartialRotatedDecal ( drawPos , GetFrame ( ) . GetSourceImage ( ) - > Decal ( ) , spriteRot , GetFrame ( ) . GetSourceRect ( ) . size / 2 , GetFrame ( ) . GetSourceRect ( ) . pos , GetFrame ( ) . GetSourceRect ( ) . size , vf2d ( GetSizeMult ( ) * ( ! HasFourWaySprites ( ) & & GetFacingDirection ( ) = = Direction : : EAST ? - 1 : 1 ) , GetSizeMult ( ) ) , blendCol ) ;
if ( overlaySprite . length ( ) ! = 0 ) {
game - > view . DrawPartialRotatedDecal ( GetPos ( ) - vf2d { 0 , GetZ ( ) } , GFX [ overlaySprite ] . Decal ( ) , spriteRot , GetFrame ( ) . GetSourceRect ( ) . size / 2 , GetFrame ( ) . GetSourceRect ( ) . pos , GetFrame ( ) . GetSourceRect ( ) . size , vf2d ( GetSizeMult ( ) * ( ! HasFourWaySprites ( ) & & GetFacingDirection ( ) = = Direction : : EAST ? - 1 : 1 ) , GetSizeMult ( ) ) , { blendCol . r , blendCol . g , blendCol . b , overlaySpriteTransparency } ) ;
game - > view . DrawPartialRotatedDecal ( drawPos , GFX [ overlaySprite ] . Decal ( ) , spriteRot , GetFrame ( ) . GetSourceRect ( ) . size / 2 , GetFrame ( ) . GetSourceRect ( ) . pos , GetFrame ( ) . GetSourceRect ( ) . size , vf2d ( GetSizeMult ( ) * ( ! HasFourWaySprites ( ) & & GetFacingDirection ( ) = = Direction : : EAST ? - 1 : 1 ) , GetSizeMult ( ) ) , { blendCol . r , blendCol . g , blendCol . b , overlaySpriteTransparency } ) ;
}
if ( HasMountedMonster ( ) ) game - > view . DrawPartialRotatedDecal ( GetPos ( ) - vf2d { 0 , GetZ ( ) } + mountedSprOffset , GetMountedFrame ( ) . value ( ) . GetSourceImage ( ) - > Decal ( ) , spriteRot , GetMountedFrame ( ) . value ( ) . GetSourceRect ( ) . size / 2 , GetMountedFrame ( ) . value ( ) . GetSourceRect ( ) . pos , GetMountedFrame ( ) . value ( ) . GetSourceRect ( ) . size , vf2d ( GetSizeMult ( ) * ( ! HasFourWaySprites ( ) & & GetFacingDirection ( ) = = Direction : : EAST ? - 1 : 1 ) , GetSizeMult ( ) ) , blendCol ) ;
if ( HasMountedMonster ( ) ) game - > view . DrawPartialRotatedDecal ( drawPos + mountedSprOffset , GetMountedFrame ( ) . value ( ) . GetSourceImage ( ) - > Decal ( ) , spriteRot , GetMountedFrame ( ) . value ( ) . GetSourceRect ( ) . size / 2 , GetMountedFrame ( ) . value ( ) . GetSourceRect ( ) . pos , GetMountedFrame ( ) . value ( ) . GetSourceRect ( ) . size , vf2d ( GetSizeMult ( ) * ( ! HasFourWaySprites ( ) & & GetFacingDirection ( ) = = Direction : : EAST ? - 1 : 1 ) , GetSizeMult ( ) ) , blendCol ) ;
std : : vector < Buff > shieldBuffs = GetBuffs ( BARRIER_DAMAGE_REDUCTION ) ;
if ( shieldBuffs . size ( ) > 0 ) {
game - > view . DrawRotatedDecal ( GetPos ( ) - vf2d { 0 , GetZ ( ) } , GFX [ " block.png " ] . Decal ( ) , 0.f , GFX [ " block.png " ] . Sprite ( ) - > Size ( ) / 2 , { GetSizeMult ( ) , GetSizeMult ( ) } ) ;
game - > view . DrawRotatedDecal ( drawPos , GFX [ " block.png " ] . Decal ( ) , 0.f , GFX [ " block.png " ] . Sprite ( ) - > Size ( ) / 2 , { GetSizeMult ( ) , GetSizeMult ( ) } ) ;
}
# pragma region Debug Pathfinding