@ -250,9 +250,9 @@ const int Player::GetHealth()const{
return hp ;
}
const floa t Player : : GetMaxHealth ( ) const {
const in t Player : : GetMaxHealth ( ) const {
const float hpPctIncrease = GetStat ( " Health " ) * GetStat ( " Health % " ) / 100.f ;
return GetStat ( " Health " ) + hpPctIncrease ;
return int ( GetStat ( " Health " ) + hpPctIncrease ) ;
}
const int Player : : GetMana ( ) const {
@ -809,7 +809,7 @@ bool Player::Hurt(int damage,bool onUpperLevel,float z){
hurtRumbleTime = " Player.Hurt Rumble Time " _F ;
Input : : StartVibration ( ) ;
Input : : SetLightbar ( PixelLerp ( DARK_RED , GREEN , GetHealth ( ) / GetMaxHealth ( ) ) ) ;
Input : : SetLightbar ( PixelLerp ( DARK_RED , GREEN , GetHealth ( ) / float ( GetMaxHealth ( ) ) ) ) ;
if ( lastHitTimer > 0 ) {
damageNumberPtr . get ( ) - > damage + = int ( mod_dmg ) ;
@ -821,7 +821,7 @@ bool Player::Hurt(int damage,bool onUpperLevel,float z){
}
lastHitTimer = 0.05f ;
if ( ! lowHealthSoundPlayed & & lowHealthSoundPlayedTimer = = 0.f & & GetHealth ( ) / GetMaxHealth ( ) < = " Player.Health Warning Pct " _F / 100.f ) {
if ( ! lowHealthSoundPlayed & & lowHealthSoundPlayedTimer = = 0.f & & GetHealth ( ) / float ( GetMaxHealth ( ) ) < = " Player.Health Warning Pct " _F / 100.f ) {
SoundEffect : : PlaySFX ( " Health Warning " , SoundEffect : : CENTERED ) ;
lowHealthSoundPlayed = true ;
lowHealthSoundPlayedTimer = " Player.Health Warning Cooldown " _F ;
@ -1088,7 +1088,7 @@ bool Player::Heal(int damage,bool suppressDamageNumber){
if ( ! suppressDamageNumber & & damage > 0 ) {
DAMAGENUMBER_LIST . push_back ( std : : make_shared < DamageNumber > ( GetPos ( ) , damage , true , HEALTH_GAIN ) ) ;
}
Input : : SetLightbar ( PixelLerp ( DARK_RED , GREEN , GetHealth ( ) / GetMaxHealth ( ) ) ) ;
Input : : SetLightbar ( PixelLerp ( DARK_RED , GREEN , GetHealth ( ) / float ( GetMaxHealth ( ) ) ) ) ;
return true ;
}
@ -1358,7 +1358,7 @@ void Player::PerformHPRecovery(){
Heal ( hpRecoveryAmt ) ;
}
if ( GetHealth ( ) / GetMaxHealth ( ) > " Player.Health Warning Pct " _F / 100.f ) {
if ( GetHealth ( ) / float ( GetMaxHealth ( ) ) > " Player.Health Warning Pct " _F / 100.f ) {
lowHealthSoundPlayed = false ;
}
}