@ -442,7 +442,8 @@ void Monster::Draw()const{
if ( GetBuffs ( BuffType : : GLOW_PURPLE ) . size ( ) > 0 ) glowPurpleBuff = GetBuffs ( BuffType : : GLOW_PURPLE ) [ 0 ] ;
if ( GetBuffs ( BuffType : : COLOR_MOD ) . size ( ) > 0 ) blendCol = Pixel { uint8_t ( PixelRaw ( GetBuffs ( BuffType : : COLOR_MOD ) [ 0 ] . intensity ) . r * abs ( sin ( 1.4 * GetBuffs ( BuffType : : COLOR_MOD ) [ 0 ] . duration ) ) ) , uint8_t ( PixelRaw ( GetBuffs ( BuffType : : COLOR_MOD ) [ 0 ] . intensity ) . g * abs ( sin ( 1.4 * GetBuffs ( BuffType : : COLOR_MOD ) [ 0 ] . duration ) ) ) , uint8_t ( PixelRaw ( GetBuffs ( BuffType : : COLOR_MOD ) [ 0 ] . intensity ) . b * abs ( sin ( 1.4 * GetBuffs ( BuffType : : COLOR_MOD ) [ 0 ] . duration ) ) ) } ;
if ( GetBuffs ( BuffType : : DAMAGE_AMPLIFICATION ) . size ( ) > 0 ) blendCol = Pixel { uint8_t ( 128 + 127 * abs ( sin ( 1.4 * PI * GetBuffs ( BuffType : : DAMAGE_AMPLIFICATION ) [ 0 ] . duration ) ) ) , uint8_t ( 0 * abs ( sin ( 1.4 * PI * GetBuffs ( BuffType : : DAMAGE_AMPLIFICATION ) [ 0 ] . duration ) ) ) , uint8_t ( 0 * abs ( sin ( 1.4 * PI * GetBuffs ( BuffType : : DAMAGE_AMPLIFICATION ) [ 0 ] . duration ) ) ) } ;
else if ( GetBuffs ( BuffType : : COLOR_MOD ) . size ( ) > 0 ) blendCol = Pixel { uint8_t ( PixelRaw ( GetBuffs ( BuffType : : COLOR_MOD ) [ 0 ] . intensity ) . r * abs ( sin ( 1.4 * GetBuffs ( BuffType : : COLOR_MOD ) [ 0 ] . duration ) ) ) , uint8_t ( PixelRaw ( GetBuffs ( BuffType : : COLOR_MOD ) [ 0 ] . intensity ) . g * abs ( sin ( 1.4 * GetBuffs ( BuffType : : COLOR_MOD ) [ 0 ] . duration ) ) ) , uint8_t ( PixelRaw ( GetBuffs ( BuffType : : COLOR_MOD ) [ 0 ] . intensity ) . b * abs ( sin ( 1.4 * GetBuffs ( BuffType : : COLOR_MOD ) [ 0 ] . duration ) ) ) } ;
else if ( GetBuffs ( BuffType : : SLOWDOWN ) . size ( ) > 0 ) blendCol = 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 ) ) ) } ;
else if ( glowPurpleBuff . has_value ( ) ) blendCol = Pixel { uint8_t ( 255 * abs ( sin ( 1.4 * glowPurpleBuff . value ( ) . get ( ) . duration ) ) ) , uint8_t ( 255 * abs ( sin ( 1.4 * glowPurpleBuff . value ( ) . get ( ) . duration ) ) ) , uint8_t ( 128 + 127 * abs ( sin ( 1.4 * glowPurpleBuff . value ( ) . get ( ) . duration ) ) ) } ;
@ -473,15 +474,25 @@ void Monster::Draw()const{
const vf2d imageScale { vf2d ( GetSizeMult ( ) * ( ! HasFourWaySprites ( ) & & GetFacingDirection ( ) = = Direction : : EAST ? - 1 : 1 ) , GetSizeMult ( ) ) } ;
const vf2d glowPurpleImageScale { imageScale * 1.1f } ;
if ( glowPurpleBuff . has_value ( ) ) game - > view . DrawPartialRotatedDecal ( drawPos , GetFrame ( ) . GetSourceImage ( ) - > Decal ( ) , finalSpriteRot , GetFrame ( ) . GetSourceRect ( ) . size / 2 , GetFrame ( ) . GetSourceRect ( ) . pos , GetFrame ( ) . GetSourceRect ( ) . size , glowPurpleImageScale , { 43 , 0 , 66 , blendCol . a } ) ;
game - > view . DrawPartialRotatedDecal ( drawPos , GetFrame ( ) . GetSourceImage ( ) - > Decal ( ) , finalSpriteRot , GetFrame ( ) . GetSourceRect ( ) . size / 2 , GetFrame ( ) . GetSourceRect ( ) . pos , GetFrame ( ) . GetSourceRect ( ) . size , imageScale , blendCol ) ;
const auto DrawBaseMonster = [ & ] ( vf2d scale = { 1.f , 1.f } , Pixel col = WHITE ) {
game - > view . DrawPartialRotatedDecal ( drawPos , GetFrame ( ) . GetSourceImage ( ) - > Decal ( ) , finalSpriteRot , GetFrame ( ) . GetSourceRect ( ) . size / 2 , GetFrame ( ) . GetSourceRect ( ) . pos , GetFrame ( ) . GetSourceRect ( ) . size , scale , col ) ;
} ;
const auto DrawOverlayMonster = [ & ] ( vf2d scale = { 1.f , 1.f } , Pixel col = WHITE ) {
game - > view . DrawPartialRotatedDecal ( drawPos , GFX [ overlaySprite ] . Decal ( ) , finalSpriteRot , GetFrame ( ) . GetSourceRect ( ) . size / 2 , GetFrame ( ) . GetSourceRect ( ) . pos , GetFrame ( ) . GetSourceRect ( ) . size , scale , col ) ;
} ;
const auto DrawMountedMonster = [ & ] ( vf2d scale = { 1.f , 1.f } , Pixel col = WHITE ) {
game - > view . DrawPartialRotatedDecal ( drawPos + mountedSprOffset , GetMountedFrame ( ) . value ( ) . GetSourceImage ( ) - > Decal ( ) , finalSpriteRot , GetMountedFrame ( ) . value ( ) . GetSourceRect ( ) . size / 2 , GetMountedFrame ( ) . value ( ) . GetSourceRect ( ) . pos , GetMountedFrame ( ) . value ( ) . GetSourceRect ( ) . size , scale , col ) ;
} ;
if ( glowPurpleBuff . has_value ( ) ) DrawBaseMonster ( glowPurpleImageScale , { 43 , 0 , 66 , blendCol . a } ) ;
DrawBaseMonster ( imageScale , blendCol ) ;
if ( overlaySprite . length ( ) ! = 0 ) {
if ( glowPurpleBuff . has_value ( ) ) game - > view . DrawPartialRotatedDecal ( drawPos , GFX [ overlaySprite ] . Decal ( ) , finalSpriteRot , GetFrame ( ) . GetSourceRect ( ) . size / 2 , GetFrame ( ) . GetSourceRect ( ) . pos , GetFrame ( ) . GetSourceRect ( ) . size , glowPurpleImageScale , { 43 , 0 , 66 , overlaySpriteTransparency } ) ;
game - > view . DrawPartialRotatedDecal ( drawPos , GFX [ overlaySprite ] . Decal ( ) , finalSpriteRot , GetFrame ( ) . GetSourceRect ( ) . size / 2 , GetFrame ( ) . GetSourceRect ( ) . pos , GetFrame ( ) . GetSourceRect ( ) . size , imageScale , { blendCol . r , blendCol . g , blendCol . b , overlaySpriteTransparency } ) ;
if ( glowPurpleBuff . has_value ( ) ) DrawOverlayMonster ( i mageScale, { 43 , 0 , 66 , overlaySpriteTransparency } ) ;
DrawOverlayMonster ( imageScale , { blendCol . r , blendCol . g , blendCol . b , overlaySpriteTransparency } ) ;
}
if ( HasMountedMonster ( ) ) {
if ( glowPurpleBuff . has_value ( ) ) game - > view . DrawPartialRotatedDecal ( drawPos + mountedSprOffset , GetMountedFrame ( ) . value ( ) . GetSourceImage ( ) - > Decal ( ) , finalSpriteRot , GetMountedFrame ( ) . value ( ) . GetSourceRect ( ) . size / 2 , GetMountedFrame ( ) . value ( ) . GetSourceRect ( ) . pos , GetMountedFrame ( ) . value ( ) . GetSourceRect ( ) . size , glowPurpleImageScale , { 43 , 0 , 66 , blendCol . a } ) ;
game - > view . DrawPartialRotatedDecal ( drawPos + mountedSprOffset , GetMountedFrame ( ) . value ( ) . GetSourceImage ( ) - > Decal ( ) , finalSpriteRot , GetMountedFrame ( ) . value ( ) . GetSourceRect ( ) . size / 2 , GetMountedFrame ( ) . value ( ) . GetSourceRect ( ) . pos , GetMountedFrame ( ) . value ( ) . GetSourceRect ( ) . size , imageScale , blendCol ) ;
if ( glowPurpleBuff . has_value ( ) ) DrawMountedMons ter ( imageScale , { 43 , 0 , 66 , blendCol . a } ) ;
DrawMountedMons ter ( imageScale , blendCol ) ;
}
std : : vector < Buff > shieldBuffs = GetBuffs ( BARRIER_DAMAGE_REDUCTION ) ;
@ -681,6 +692,8 @@ bool Monster::_Hurt(int damage,bool onUpperLevel,float z,const TrueDamageFlag da
RemoveMarkStack ( ) ;
}
mod_dmg * = GetDamageAmplificationMult ( ) ;
mod_dmg = std : : ceil ( mod_dmg ) ;
hp = std : : max ( 0 , hp - int ( mod_dmg ) ) ;
@ -1341,4 +1354,13 @@ void Monster::ApplyDot(float duration,int damage,float timeBetweenTicks,Buff::Mo
void Monster : : SetWeakPointer ( std : : shared_ptr < Monster > & sharedMonsterPtr ) {
weakPtr = sharedMonsterPtr ;
}
const float Monster : : GetDamageAmplificationMult ( ) const {
float damageAmpMult { 1.f } ;
const std : : vector < Buff > & buffList { GetBuffs ( BuffType : : DAMAGE_AMPLIFICATION ) } ;
for ( const Buff & buff : buffList ) {
damageAmpMult + = buff . intensity ;
}
return damageAmpMult ;
}