Added vignette effect when taking damage. Release Build 8614.

This commit is contained in:
sigonasr2 2024-03-31 20:39:51 -05:00
parent 962ee84da9
commit 92da000b13
9 changed files with 27 additions and 1 deletions

View File

@ -373,6 +373,8 @@ bool AiL::OnUserUpdate(float fElapsedTime){
lastMousePos=GetMousePos();
}else lastMouseMovement+=fElapsedTime;
vignetteDisplayTime=std::max(0.f,vignetteDisplayTime-fElapsedTime);
if(Audio::Engine().IsPlaying(GetPlayer()->cooldownSoundInstance)){
Audio::Engine().SetVolume(GetPlayer()->cooldownSoundInstance,Audio::GetCalculatedSFXVolume("Audio.Casting Sound Volume"_F/100.f));
}
@ -1850,6 +1852,11 @@ void AiL::RenderHud(){
DrawShadowStringDecal({0,12},"Button Hold Time: "+std::to_string(Menu::menus[INVENTORY_CONSUMABLES]->buttonHoldTime));
}
#endif
Pixel vignetteOverlayColor="Interface.Vignette Color"_Pixel;
const float vignetteTotalDisplayTime="Interface.Vignette Appearance Time"_F+"Interface.Vignette Fadeout Time"_F;
if(vignetteDisplayTime<"Interface.Vignette Fadeout Time"_F)vignetteOverlayColor.a=util::lerp(0,255,vignetteDisplayTime/"Interface.Vignette Fadeout Time"_F);
DrawDecal({0,0},GFX["vignette.png"].Decal(),{1.f,1.f},vignetteOverlayColor);
}
void AiL::RenderCooldowns(){
@ -3937,3 +3944,7 @@ void AiL::ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHan
const float AiL::GetEncounterDuration()const{
return encounterDuration;
}
void AiL::ShowDamageVignetteOverlay(){
vignetteDisplayTime="Interface.Vignette Appearance Time"_F+"Interface.Vignette Fadeout Time"_F;
}

View File

@ -182,6 +182,7 @@ private:
float saveGameDisplayTime=0.f;
float loadingWaitTime=0.f;
bool displayHud=true;
float vignetteDisplayTime=0.f;
void ValidateGameStatus();
void _PrepareLevel(MapName map,MusicChange changeMusic);
@ -319,6 +320,7 @@ public:
void UpdateMonsters();
void ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHandle);
const float GetEncounterDuration()const;
void ShowDamageVignetteOverlay();
struct TileGroupData{
vi2d tilePos;

View File

@ -745,6 +745,9 @@ bool Player::Hurt(int damage,bool onUpperLevel,float z){
SoundEffect::PlaySFX("Player Hit",SoundEffect::CENTERED);
}
if(Menu::IsMenuOpen()&&mod_dmg>0)Menu::CloseAllMenus();
if(mod_dmg>0)game->ShowDamageVignetteOverlay();
hp=std::max(0,hp-int(mod_dmg));
if(hp==0&&GameState::STATE!=GameState::states[States::DEATH])GameState::ChangeState(States::DEATH);

View File

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 0
#define VERSION_PATCH 0
#define VERSION_BUILD 8610
#define VERSION_BUILD 8614
#define stringify(a) stringify_(a)
#define stringify_(a) #a

View File

@ -21,6 +21,15 @@ Interface
# The text color of input keys.
InputButtonTextCol = 175,199,191,255
# Vignette Appearance Wait Duration
Vignette Appearance Time = 0.4s
# Vignette Fade out Duration
Vignette Fadeout Time = 0.2s
# Damage Vignette Overlay Color
Vignette Color = 218, 44, 143, 255
# The original health display color.
HUD Health Display Color = 255,255,255,255

View File

@ -84,6 +84,7 @@ Images
GFX_Unlock = unlock.png
GFX_SwordSlash = swordslash.png
GFX_CustomFont = font.png
GFX_Vignette = vignette.png
# Ability Icons
GFX_Warrior_BattleCry_Icon = Ability Icons/battlecry.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB