Added vignette effect when taking damage. Release Build 8614.

pull/57/head
sigonasr2 8 months ago
parent d6e140cfb4
commit 02e7d5665a
  1. 11
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 2
      Adventures in Lestoria/AdventuresInLestoria.h
  3. 3
      Adventures in Lestoria/Player.cpp
  4. 2
      Adventures in Lestoria/Version.h
  5. 9
      Adventures in Lestoria/assets/config/Interface.txt
  6. 1
      Adventures in Lestoria/assets/config/gfx/gfx.txt
  7. BIN
      Adventures in Lestoria/assets/gamepack.pak
  8. BIN
      Adventures in Lestoria/assets/vignette.png
  9. BIN
      x64/Release/Adventures in Lestoria.exe

@ -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;
}

@ -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;

@ -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);

@ -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

@ -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

@ -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

Loading…
Cancel
Save