diff --git a/Adventures in Lestoria/Animation.cpp b/Adventures in Lestoria/Animation.cpp index c2d57cb6..bd602a57 100644 --- a/Adventures in Lestoria/Animation.cpp +++ b/Adventures in Lestoria/Animation.cpp @@ -39,6 +39,7 @@ All rights reserved. #include "AdventuresInLestoria.h" #include "DEFINES.h" #include "safemap.h" +#include INCLUDE_game INCLUDE_ANIMATION_DATA @@ -239,6 +240,33 @@ void sig::Animation::InitializeAnimations(){ ANIMATION_DATA["THIEF_DEADLYDASH_E"]=pl_thief_deadlydash_e; ANIMATION_DATA["THIEF_DEADLYDASH_S"]=pl_thief_deadlydash_s; ANIMATION_DATA["THIEF_DEADLYDASH_W"]=pl_thief_deadlydash_w; + + //Trapper animations + SetupClassWalkIdleAnimations(GFX["nico-trapper.png"],"TRAPPER"); + Animate2D::FrameSequence pl_trapper_shoot_s,pl_trapper_shoot_n,pl_trapper_shoot_e,pl_trapper_shoot_w; + Animate2D::FrameSequence pl_trapper_setTrap_s,pl_trapper_setTrap_n,pl_trapper_setTrap_e,pl_trapper_setTrap_w; + for(int i=0;i<3;i++){ + pl_trapper_shoot_s.AddFrame({&GFX["nico-trapper.png"],{vi2d{3+i,0}*24,{24,24}}}); + pl_trapper_shoot_n.AddFrame({&GFX["nico-trapper.png"],{vi2d{3+i,1}*24,{24,24}}}); + pl_trapper_shoot_e.AddFrame({&GFX["nico-trapper.png"],{vi2d{3+i,3}*24,{24,24}}}); + pl_trapper_shoot_w.AddFrame({&GFX["nico-trapper.png"],{vi2d{3+i,2}*24,{24,24}}}); + } + for(int i:std::ranges::iota_view(0,5)){ + pl_trapper_setTrap_s.AddFrame({&GFX["nico-trapper.png"],{vi2d{1+i,4}*24,{24,24}}}); + pl_trapper_setTrap_n.AddFrame({&GFX["nico-trapper.png"],{vi2d{1+i,5}*24,{24,24}}}); + int frameInd{i}; + if(i==4)frameInd--; //One less frame for East and West facing sprites. + pl_trapper_setTrap_e.AddFrame({&GFX["nico-trapper.png"],{vi2d{1+frameInd,6}*24,{24,24}}}); + pl_trapper_setTrap_w.AddFrame({&GFX["nico-trapper.png"],{vi2d{1+frameInd,7}*24,{24,24}}}); + } + ANIMATION_DATA["TRAPPER_SHOOT_S"]=pl_trapper_shoot_s; + ANIMATION_DATA["TRAPPER_SHOOT_N"]=pl_trapper_shoot_n; + ANIMATION_DATA["TRAPPER_SHOOT_E"]=pl_trapper_shoot_e; + ANIMATION_DATA["TRAPPER_SHOOT_W"]=pl_trapper_shoot_w; + ANIMATION_DATA["TRAPPER_SETTRAP_S"]=pl_trapper_setTrap_s; + ANIMATION_DATA["TRAPPER_SETTRAP_N"]=pl_trapper_setTrap_n; + ANIMATION_DATA["TRAPPER_SETTRAP_E"]=pl_trapper_setTrap_e; + ANIMATION_DATA["TRAPPER_SETTRAP_W"]=pl_trapper_setTrap_w; CreateHorizontalAnimationSequence("ground-slam-attack-back.png",5,{64,64},{0.02f,Animate2D::Style::OneShot}); CreateHorizontalAnimationSequence("ground-slam-attack-front.png",5,{64,64},{0.02f,Animate2D::Style::OneShot}); diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index c4cf117b..e1f3c2fe 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -1395,7 +1395,7 @@ const float Player::GetDamageReductionPct()const{ return modDmgReductionPct; } -void Player::AddXP(const uint32_t xpGain){ +void Player::AddXP(const uint64_t xpGain){ currentLevelXP+=xpGain; totalXPEarned+=xpGain; if(Level()(MenuType::CHARACTER_MENU,"XP Bar")->ResetProgressBar(game->GetPlayer()->CurrentXP(),game->GetPlayer()->NextLevelXPRequired()); } -void Player::SetXP(const uint32_t xp){ +void Player::SetXP(const uint64_t xp){ currentLevelXP=xp; Component(MenuType::CHARACTER_MENU,"XP Bar")->ResetProgressBar(game->GetPlayer()->CurrentXP(),game->GetPlayer()->NextLevelXPRequired()); } -void Player::SetTotalXPEarned(const uint32_t totalXP){ +void Player::SetTotalXPEarned(const uint64_t totalXP){ totalXPEarned=totalXP; } @@ -1445,16 +1445,16 @@ void Player::SetLevel(uint8_t newLevel){ Component(CHARACTER_MENU,"Level Class Display")->SetLabel(std::format("Lv{} {}",game->GetPlayer()->Level(),game->GetPlayer()->GetClassName())); Component(LEVEL_COMPLETE,"Level Display")->SetLabel(std::format("Lv{}",game->GetPlayer()->Level())); } -const uint32_t Player::CurrentXP()const{ +const uint64_t Player::CurrentXP()const{ return currentLevelXP; } -const uint32_t Player::TotalXP()const{ +const uint64_t Player::TotalXP()const{ return totalXPEarned; } -const uint32_t Player::NextLevelXPRequired()const{ +const uint64_t Player::NextLevelXPRequired()const{ if(Level()component); uint32_t GetMoney()const; void SetMoney(uint32_t newMoney); - void AddXP(const uint32_t xpGain); + void AddXP(const uint64_t xpGain); void OnLevelUp(); const uint8_t LevelCap()const; const uint8_t Level()const; - const uint32_t CurrentXP()const; - const uint32_t TotalXP()const; - const uint32_t NextLevelXPRequired()const; + const uint64_t CurrentXP()const; + const uint64_t TotalXP()const; + const uint64_t NextLevelXPRequired()const; void CancelCast(); const ItemAttributable&GetStats()const; const ItemAttributable&GetBaseStats()const; void ResetAccumulatedXP(); - const uint32_t GetAccumulatedXP()const; - void AddAccumulatedXP(const uint32_t xpGain); + const uint64_t GetAccumulatedXP()const; + void AddAccumulatedXP(const uint64_t xpGain); //Knockup the player for duration amount of seconds, and Zamt pixels. void Knockup(float duration); static const bool INVERTED,USE_WALK_DIR; const vf2d GetAimingLocation(bool useWalkDir=false,bool invert=false); const vf2d GetWorldAimingLocation(bool useWalkDir=false,bool invert=false); - void SetXP(const uint32_t xp); - void SetTotalXPEarned(const uint32_t totalXP); + void SetXP(const uint64_t xp); + void SetTotalXPEarned(const uint64_t totalXP); void SetLevel(uint8_t newLevel); void SetInvisible(const bool invisibleState); const bool IsInvisible()const; @@ -295,9 +295,9 @@ private: vf2d pos; uint8_t level=1; uint8_t levelCap=1; - uint32_t totalXPEarned=0; - uint32_t currentLevelXP=0; - uint32_t accumulatedXP=0; + uint64_t totalXPEarned=0; + uint64_t currentLevelXP=0; + uint64_t accumulatedXP=0; float z=0; float size=1.0f; float spin_attack_timer=0; diff --git a/Adventures in Lestoria/SaveFile.cpp b/Adventures in Lestoria/SaveFile.cpp index 95e858ad..0696d768 100644 --- a/Adventures in Lestoria/SaveFile.cpp +++ b/Adventures in Lestoria/SaveFile.cpp @@ -109,8 +109,8 @@ const void SaveFile::SaveGame(){ saveFile["Player"]["Class"].SetString(game->GetPlayer()->GetClassName()); saveFile["Player"]["Level"].SetInt(game->GetPlayer()->Level()); saveFile["Player"]["Money"].SetInt(game->GetPlayer()->GetMoney()); - saveFile["Player"]["Current EXP"].SetInt(game->GetPlayer()->CurrentXP()); - saveFile["Player"]["Total EXP"].SetInt(game->GetPlayer()->TotalXP()); + saveFile["Player"]["Current EXP"].SetBigInt(game->GetPlayer()->CurrentXP()); + saveFile["Player"]["Total EXP"].SetBigInt(game->GetPlayer()->TotalXP()); for(const auto&[attr,val]:game->GetPlayer()->GetBaseStats()){ saveFile["Player"]["Base Stats"][std::string(attr.ActualName())].SetReal(val); } @@ -371,8 +371,8 @@ void SaveFile::LoadFile(){ game->ChangePlayerClass(classutils::StringToClass(loadFile["Player"]["Class"].GetString())); game->GetPlayer()->SetLevel(loadFile["Player"]["Level"].GetInt()); game->GetPlayer()->SetMoney(loadFile["Player"]["Money"].GetInt()); - game->GetPlayer()->SetXP(loadFile["Player"]["Current EXP"].GetInt()); - game->GetPlayer()->SetTotalXPEarned(loadFile["Player"]["Total EXP"].GetInt()); + game->GetPlayer()->SetXP(loadFile["Player"]["Current EXP"].GetBigInt()); + game->GetPlayer()->SetTotalXPEarned(loadFile["Player"]["Total EXP"].GetBigInt()); for(auto&[key,data]:loadFile["Player"]["Base Stats"].GetOrderedKeys()){ game->GetPlayer()->SetBaseStat(key,data.GetReal()); } diff --git a/Adventures in Lestoria/Trapper.cpp b/Adventures in Lestoria/Trapper.cpp index 2d404f24..5c94c6bf 100644 --- a/Adventures in Lestoria/Trapper.cpp +++ b/Adventures in Lestoria/Trapper.cpp @@ -48,14 +48,14 @@ INCLUDE_game void Trapper::Initialize(){ READFROMCONFIG(Trapper,TRAPPER); - Trapper::idle_n="WARRIOR_IDLE_N"; - Trapper::idle_e="WARRIOR_IDLE_E"; - Trapper::idle_s="WARRIOR_IDLE_S"; - Trapper::idle_w="WARRIOR_IDLE_W"; - Trapper::walk_n="WARRIOR_WALK_N"; - Trapper::walk_e="WARRIOR_WALK_E"; - Trapper::walk_s="WARRIOR_WALK_S"; - Trapper::walk_w="WARRIOR_WALK_W"; + Trapper::idle_n="TRAPPER_IDLE_N"; + Trapper::idle_e="TRAPPER_IDLE_E"; + Trapper::idle_s="TRAPPER_IDLE_S"; + Trapper::idle_w="TRAPPER_IDLE_W"; + Trapper::walk_n="TRAPPER_WALK_N"; + Trapper::walk_e="TRAPPER_WALK_E"; + Trapper::walk_s="TRAPPER_WALK_S"; + Trapper::walk_w="TRAPPER_WALK_W"; } SETUP_CLASS(Trapper) diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 3ab7217f..33f41d6e 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define VERSION_PATCH 3 -#define VERSION_BUILD 10166 +#define VERSION_BUILD 10172 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/Player.txt b/Adventures in Lestoria/assets/config/Player.txt index 8416f53d..8b5beee9 100644 --- a/Adventures in Lestoria/assets/config/Player.txt +++ b/Adventures in Lestoria/assets/config/Player.txt @@ -82,11 +82,15 @@ Player PLAYER_ANIMATION[8] = WIZARD_IDLE_ATTACK PLAYER_ANIMATION[9] = WIZARD_ATTACK PLAYER_ANIMATION[10] = WIZARD_CAST - PLAYER_ANIMATION[11] = WIZARD_IDLE - PLAYER_ANIMATION[12] = THIEF_IDLE - PLAYER_ANIMATION[13] = THIEF_WALK - PLAYER_ANIMATION[14] = THIEF_SWINGSWORD - PLAYER_ANIMATION[15] = THIEF_DEADLYDASH + PLAYER_ANIMATION[11] = WIZARD_IDLE + PLAYER_ANIMATION[12] = THIEF_IDLE + PLAYER_ANIMATION[13] = THIEF_WALK + PLAYER_ANIMATION[14] = THIEF_SWINGSWORD + PLAYER_ANIMATION[15] = THIEF_DEADLYDASH + PLAYER_ANIMATION[16] = TRAPPER_IDLE + PLAYER_ANIMATION[17] = TRAPPER_WALK + PLAYER_ANIMATION[18] = TRAPPER_SHOOT + PLAYER_ANIMATION[19] = TRAPPER_SETTRAP } PlayerXP diff --git a/Adventures in Lestoria/assets/config/gfx/gfx.txt b/Adventures in Lestoria/assets/config/gfx/gfx.txt index 2100f55a..e4c11d7a 100644 --- a/Adventures in Lestoria/assets/config/gfx/gfx.txt +++ b/Adventures in Lestoria/assets/config/gfx/gfx.txt @@ -111,6 +111,7 @@ Images GFX_Shine = shine.png GFX_Thief_Sheet = nico-thief.png + GFX_Trapper_Sheet = nico-trapper.png # Ability Icons GFX_Warrior_BattleCry_Icon = Ability Icons/battlecry.png diff --git a/Adventures in Lestoria/assets/gamepack.pak b/Adventures in Lestoria/assets/gamepack.pak index fa561a0c..6331419f 100644 Binary files a/Adventures in Lestoria/assets/gamepack.pak and b/Adventures in Lestoria/assets/gamepack.pak differ diff --git a/Adventures in Lestoria/assets/nico-trapper.png b/Adventures in Lestoria/assets/nico-trapper.png new file mode 100644 index 00000000..d6a4868d Binary files /dev/null and b/Adventures in Lestoria/assets/nico-trapper.png differ diff --git a/Adventures in Lestoria/assets/nico-trapper.xcf b/Adventures in Lestoria/assets/nico-trapper.xcf new file mode 100644 index 00000000..36c453ac Binary files /dev/null and b/Adventures in Lestoria/assets/nico-trapper.xcf differ diff --git a/Adventures in Lestoria/cpp.hint b/Adventures in Lestoria/cpp.hint index ee9cc413..c3f8a076 100644 --- a/Adventures in Lestoria/cpp.hint +++ b/Adventures in Lestoria/cpp.hint @@ -8,7 +8,8 @@ #define INCLUDE_MONSTER_LIST #define INCLUDE_MONSTER_DATA #define INCLUDE_EMITTER_LIST -#define SETUP_CLASS(class) class::class() :Player::Player(){} class::class(Player*player) :Player::Player(player){} Class class::GetClass(){return cl;} std::string class::GetClassName(){return name;} Ability&class::GetRightClickAbility(){return rightClickAbility;}; Ability&class::GetAbility1(){return ability1;}; Ability&class::GetAbility2(){return ability2;}; Ability&class::GetAbility3(){return ability3;}; Ability&class::GetAbility4(){return ability4;}; std::string&class::GetWalkNAnimation(){return walk_n;}; std::string&class::GetWalkEAnimation(){return walk_e;}; std::string&class::GetWalkSAnimation(){return walk_s;}; std::string&class::GetWalkWAnimation(){return walk_w;}; std::string&class::GetIdleNAnimation(){return idle_n;}; std::string&class::GetIdleEAnimation(){return idle_e;}; std::string&class::GetIdleSAnimation(){return idle_s;}; std::string&class::GetIdleWAnimation(){return idle_w;}; std::string class::name=""; Class class::cl=ANY; Ability class::rightClickAbility=Ability(); Ability class::ability1=Ability(); Ability class::ability2=Ability(); Ability class::ability3=Ability(); Ability class::ability4=Ability(); std::string class::idle_n="WARRIOR_IDLE_N"; std::string class::idle_e="WARRIOR_IDLE_E"; std::string class::idle_s="WARRIOR_IDLE_S"; std::string class::idle_w="WARRIOR_IDLE_W"; std::string class::walk_n="WARRIOR_WALK_N"; std::string class::walk_e="WARRIOR_WALK_E"; std::string class::walk_s="WARRIOR_WALK_S"; std::string class::walk_w="WARRIOR_WALK_W"; +#define SETUP_CLASS(class) class::class() :Player::Player(){} class::class(Player*player) :Player::Player(player){} Class class::GetClass(){return cl;} std::string class::GetClassName(){return name;} Ability&class::GetRightClickAbility(){return rightClickAbility;}; Ability&class::GetAbility1(){return ability1;}; Ability&class::GetAbility2(){return ability2;}; Ability&class::GetAbility3(){return ability3;}; Ability&class::GetAbility4(){return ability4;}; std::string&class::GetWalkNAnimation(){return walk_n;}; std::string&class::GetWalkEAnimation(){return walk_e;}; std::string&class::GetWalkSAnimation(){return walk_s;}; std::string&class::GetWalkWAnimation(){return walk_w;}; std::string&class::GetIdleNAnimation(){return idle_n;}; std::string&class::GetIdleEAnimation(){return idle_e;}; std::string&class::GetIdleSAnimation(){return idle_s;}; std::string&class::GetIdleWAnimation(){return idle_w;}; std::string class::name=""; Class class::cl=ANY; Ability class::rightClickAbility=Ability(); Ability class::ability1=Ability(); Ability class::ability2=Ability(); Ability class::ability3=Ability(); Ability class::ability4=Ability(); std::string class::idle_n=" +_N"; std::string class::idle_e="WARRIOR_IDLE_E"; std::string class::idle_s="WARRIOR_IDLE_S"; std::string class::idle_w="WARRIOR_IDLE_W"; std::string class::walk_n="WARRIOR_WALK_N"; std::string class::walk_e="WARRIOR_WALK_E"; std::string class::walk_s="WARRIOR_WALK_S"; std::string class::walk_w="WARRIOR_WALK_W"; #define INCLUDE_BULLET_LIST #define INCLUDE_DATA #define INCLUDE_MONSTER_NAME_DATA diff --git a/Adventures in Lestoria/olcUTIL_DataFile.h b/Adventures in Lestoria/olcUTIL_DataFile.h index f29e167a..d64a0840 100644 --- a/Adventures in Lestoria/olcUTIL_DataFile.h +++ b/Adventures in Lestoria/olcUTIL_DataFile.h @@ -123,6 +123,12 @@ namespace olc::utils SetString(std::to_string(d), nItem); } + // Retrieves the Integer Value of a Property (for a given index) or 0 + inline const int64_t GetBigInt(const size_t nItem = 0) const + { + return std::stoll(GetString(nItem).c_str()); + } + // Retrieves the Integer Value of a Property (for a given index) or 0 inline const int32_t GetInt(const size_t nItem = 0) const { @@ -153,6 +159,12 @@ namespace olc::utils SetString(std::to_string(n), nItem); } + // Sets the Long Integer Value of a Property (for a given index) + inline void SetBigInt(const int64_t n, const size_t nItem = 0) + { + SetString(std::to_string(n), nItem); + } + inline Pixel GetPixel(const size_t nItem = 0){ return {uint8_t(GetInt(nItem)),uint8_t(GetInt(nItem+1)),uint8_t(GetInt(nItem+2)),uint8_t(GetInt(nItem+3))}; } diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 9e9390a3..b571fa8a 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ