@ -401,7 +401,7 @@ bool Monster::Update(float fElapsedTime){
}
}
animation . UpdateState ( internal_animState , randomFrameOffset + fElapsedTime ) ;
if ( HasMountedMonster ( ) ) mounted_animation . value ( ) . UpdateState ( internal_mounted_animState . value ( ) , fElapsedTime ) ;
if ( HasMountedMonster ( ) ) mounted_animation . value ( ) . UpdateState ( internal_mounted_animState , fElapsedTime ) ;
randomFrameOffset = 0 ;
attackedByPlayer = false ;
return true ;
@ -446,7 +446,7 @@ void Monster::UpdateFacingDirection(vf2d facingTargetPoint){
}
}
animation . ModifyDisplaySprite ( internal_animState , std : : format ( " {}_{} " , animation . currentStateName . substr ( 0 , animation . currentStateName . length ( ) - 2 ) , int ( facingDirection ) ) ) ;
if ( HasMountedMonster ( ) ) mounted_animation . value ( ) . ModifyDisplaySprite ( internal_mounted_animState . value ( ) , std : : format ( " {}_{} " , mounted_animation . value ( ) . currentStateName . substr ( 0 , mounted_animation . value ( ) . currentStateName . length ( ) - 2 ) , int ( facingDirection ) ) ) ;
if ( HasMountedMonster ( ) ) mounted_animation . value ( ) . ModifyDisplaySprite ( internal_mounted_animState , std : : format ( " {}_{} " , mounted_animation . value ( ) . currentStateName . substr ( 0 , mounted_animation . value ( ) . currentStateName . length ( ) - 2 ) , int ( facingDirection ) ) ) ;
} else {
if ( diff . x > 0 ) {
facingDirection = Direction : : WEST ;
@ -1316,13 +1316,12 @@ const bool Monster::HasFourWaySprites()const{
}
const bool Monster : : HasMountedMonster ( ) const {
if ( internal_mounted_animState . has_value ( ) ^ mounted_animation . has_value ( ) ) ERR ( " WARNING! The internal mounted animation state and the mounted animation variables are not matching! They should both either be on or both be off! THIS SHOULD NOT BE HAPPENING! " ) ;
return internal_mounted_animState . has_value ( ) & & mounted_animation . has_value ( ) ;
return mounted_animation . has_value ( ) ;
}
const std : : optional < const Animate2D : : Frame > Monster : : GetMountedFrame ( ) const {
if ( ! HasMountedMonster ( ) ) return { } ;
else return mounted_animation . value ( ) . GetFrame ( internal_mounted_animState . value ( ) ) ;
else return mounted_animation . value ( ) . GetFrame ( internal_mounted_animState ) ;
}
DeathSpawnInfo : : DeathSpawnInfo ( const std : : string_view monsterName , const uint8_t spawnAmt , const vf2d spawnOffset )
@ -1413,7 +1412,7 @@ const bool Monster::_DealTrueDamage(const uint32_t damageAmt,HurtFlag::HurtFlag
void Monster : : Heal ( const int healAmt , const bool displayDamageNumber ) {
hp = std : : clamp ( hp + healAmt , 0 , int ( GetMaxHealth ( ) ) ) ;
if ( displayDamageNumber ) DAMAGENUMBER_LIST . emplace_back ( std : : make_shared < DamageNumber > ( GetPos ( ) , healAmt , false , DamageNumberType : : HEALTH_GAIN ) ;
if ( displayDamageNumber ) DAMAGENUMBER_LIST . emplace_back ( std : : make_shared < DamageNumber > ( GetPos ( ) , healAmt , false , DamageNumberType : : HEALTH_GAIN ) ) ;
}
const float Monster : : GetModdedStatBonuses ( std : : string_view stat ) const {