diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index ac959ea2..bd7ef6f3 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -1351,7 +1351,7 @@ void AiL::RenderWorld(float fElapsedTime){ case HEALTH_LOSS:{ std::string text=std::to_string(dn->damage); if(!dn->friendly){ - view.DrawStringPropDecal(dn->pos-GetTextSizeProp(text)/2,text,DARK_RED); + view.DrawStringPropDecal(dn->pos-GetTextSizeProp(text)/2.f*dn->size,text,DARK_RED,dn->size); }else{ view.DrawShadowStringPropDecal(dn->pos-GetTextSizeProp(text)/2,text,RED,VERY_DARK_GREY); } @@ -1379,7 +1379,7 @@ void AiL::RenderWorld(float fElapsedTime){ case CRIT:{ std::string text=std::to_string(dn->damage); if(!dn->friendly){ - view.DrawShadowStringPropDecal(dn->pos-GetTextSizeProp(text)/2,text,YELLOW,DARK_YELLOW); + view.DrawShadowStringPropDecal(dn->pos-GetTextSizeProp(text)/2.f*dn->size,text,YELLOW,DARK_YELLOW,dn->size); }else{ view.DrawStringPropDecal(dn->pos-GetTextSizeProp(text)/2,text,BLACK); } diff --git a/Adventures in Lestoria/BulletTypes.h b/Adventures in Lestoria/BulletTypes.h index db878230..0f2b5063 100644 --- a/Adventures in Lestoria/BulletTypes.h +++ b/Adventures in Lestoria/BulletTypes.h @@ -83,7 +83,6 @@ struct ChargedArrow:public Bullet{ struct FrogTongue:public Bullet{ vf2d targetPos; float tongueLength; - float tongueSpd; float duration; float knockbackStrength; FrogTongue(vf2d pos,vf2d targetPos,float lifetime,int damage,bool upperLevel,float knockbackStrength=1.0f,bool friendly=false,Pixel col=WHITE); diff --git a/Adventures in Lestoria/DamageNumber.cpp b/Adventures in Lestoria/DamageNumber.cpp index 6327a026..aaf22b9d 100644 --- a/Adventures in Lestoria/DamageNumber.cpp +++ b/Adventures in Lestoria/DamageNumber.cpp @@ -36,6 +36,9 @@ All rights reserved. */ #pragma endregion #include "DamageNumber.h" +#include "AdventuresInLestoria.h" + +INCLUDE_game const float DamageNumber::MOVE_UP_TIME=0.4f; @@ -46,4 +49,18 @@ DamageNumber::DamageNumber() DamageNumber::DamageNumber(vf2d pos,int damage,bool friendly,DamageNumberType type): pos(pos),damage(damage),friendly(friendly),type(type),invertedDirection(type==INTERRUPT),riseSpd(20.f){ if(type==INTERRUPT||type==MANA_GAIN)riseSpd=40.f; + originalRiseSpd=riseSpd; + RecalculateSize(); +} + +void DamageNumber::RecalculateSize(){ + float damageMultRatio=damage/game->GetPlayer()->GetBaseStat("Attack")/2.f; + riseSpd=originalRiseSpd; + if(!friendly){ + float newSize=std::clamp(round(damageMultRatio),1.0f,4.0f); + + if(type==HEALTH_LOSS||type==CRIT)riseSpd*=newSize; + + size=vf2d{newSize,newSize}; + } } \ No newline at end of file diff --git a/Adventures in Lestoria/DamageNumber.h b/Adventures in Lestoria/DamageNumber.h index 78f7158d..a1e36db5 100644 --- a/Adventures in Lestoria/DamageNumber.h +++ b/Adventures in Lestoria/DamageNumber.h @@ -52,10 +52,13 @@ struct DamageNumber{ float lifeTime=0; float pauseTime=0; float riseSpd=0.f; + vf2d size{1.f,1.f}; bool friendly=false; bool invertedDirection=false; DamageNumberType type=HEALTH_LOSS; const static float MOVE_UP_TIME; + float originalRiseSpd=0.f; DamageNumber(); DamageNumber(vf2d pos,int damage,bool friendly=false,DamageNumberType type=HEALTH_LOSS); + void RecalculateSize(); }; \ No newline at end of file diff --git a/Adventures in Lestoria/FrogTongue.cpp b/Adventures in Lestoria/FrogTongue.cpp index c4ec3b19..33198fec 100644 --- a/Adventures in Lestoria/FrogTongue.cpp +++ b/Adventures in Lestoria/FrogTongue.cpp @@ -45,7 +45,7 @@ INCLUDE_MONSTER_LIST INCLUDE_GFX FrogTongue::FrogTongue(vf2d pos,vf2d targetPos,float lifetime,int damage,bool upperLevel,float knockbackStrength,bool friendly,Pixel col) - :Bullet(pos,{},0,damage,upperLevel,friendly,col),targetPos(targetPos),tongueSpd(tongueSpd),tongueLength(0.f),knockbackStrength(knockbackStrength){ + :Bullet(pos,{},0,damage,upperLevel,friendly,col),targetPos(targetPos),tongueLength(0.f),knockbackStrength(knockbackStrength){ this->lifetime=lifetime; duration=lifetime; } diff --git a/Adventures in Lestoria/Key.cpp b/Adventures in Lestoria/Key.cpp index b20d5a0c..429dab68 100644 --- a/Adventures in Lestoria/Key.cpp +++ b/Adventures in Lestoria/Key.cpp @@ -463,4 +463,8 @@ const InputEngageGroup::EngageType InputEngageGroup::GetEngageType()const{ InputGroup&InputEngageGroup::GetGroup()const{ return group; +} + +const InputEngageGroup InputEngageGroup::operator=(const InputEngageGroup&rhs){ + return InputEngageGroup{rhs.group,rhs.type}; } \ No newline at end of file diff --git a/Adventures in Lestoria/Key.h b/Adventures in Lestoria/Key.h index 4170a4b5..e719e338 100644 --- a/Adventures in Lestoria/Key.h +++ b/Adventures in Lestoria/Key.h @@ -107,6 +107,7 @@ public: InputEngageGroup(InputGroup&group,EngageType type=Released); const EngageType GetEngageType()const; InputGroup&GetGroup()const; + const InputEngageGroup operator=(const InputEngageGroup&rhs); }; class GenericKey{ diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index 9e4d9917..9849dd40 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -440,6 +440,7 @@ bool Monster::Hurt(int damage,bool onUpperLevel,float z){ if(lastHitTimer>0){ damageNumberPtr.get()->damage+=int(mod_dmg); damageNumberPtr.get()->pauseTime=0.4f; + damageNumberPtr.get()->RecalculateSize(); } else { damageNumberPtr=std::make_shared(pos,int(mod_dmg)); DAMAGENUMBER_LIST.push_back(damageNumberPtr); diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index 8c516c33..4debdffd 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -718,6 +718,7 @@ bool Player::Hurt(int damage,bool onUpperLevel,float z){ if(lastHitTimer>0){ damageNumberPtr.get()->damage+=int(mod_dmg); damageNumberPtr.get()->pauseTime=0.4f; + damageNumberPtr.get()->RecalculateSize(); } else { damageNumberPtr=std::make_shared(pos,int(mod_dmg),true); DAMAGENUMBER_LIST.push_back(damageNumberPtr); diff --git a/Adventures in Lestoria/State_OverworldMap.cpp b/Adventures in Lestoria/State_OverworldMap.cpp index 7287ba61..54994929 100644 --- a/Adventures in Lestoria/State_OverworldMap.cpp +++ b/Adventures in Lestoria/State_OverworldMap.cpp @@ -199,7 +199,7 @@ void State_OverworldMap::Draw(AiL*game){ using AngleTotal=float; using Count=uint8_t; using MedianAngle=std::pair; - using ConnectionPointIndex=float; + using ConnectionPointIndex=int; auto GetAngle=[](MedianAngle angle){ return angle.first/angle.second; diff --git a/Adventures in Lestoria/TODO.txt b/Adventures in Lestoria/TODO.txt index 7cee6682..f49a84dd 100644 --- a/Adventures in Lestoria/TODO.txt +++ b/Adventures in Lestoria/TODO.txt @@ -31,8 +31,6 @@ Story proofreading/correcting/storyboarding - Add Death screen (Zoom in on fatal blow, slow time down... Display some game over text... Allow retry or return to world map.) -- Auto targeting for controller / keyboard. - A "Debug" version of the game that simply outputs all std::cout to a file as well (debug.log). ERR messages become just output messages in release build and won't crash the game. diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 80e38f6b..56634d79 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 0 #define VERSION_MINOR 3 #define VERSION_PATCH 0 -#define VERSION_BUILD 6261 +#define VERSION_BUILD 6264 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/configuration.txt b/Adventures in Lestoria/assets/config/configuration.txt index 412aec27..b4f060e6 100644 --- a/Adventures in Lestoria/assets/config/configuration.txt +++ b/Adventures in Lestoria/assets/config/configuration.txt @@ -78,7 +78,7 @@ bgm_config = audio/bgm.txt event_config = audio/events.txt # Path to interface configuration -interface_config = interface.txt +interface_config = Interface.txt # Path to character images character_image_location = characters/ diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index e3c196ea..bf15321b 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ