diff --git a/Crawler/Crawler.cpp b/Crawler/Crawler.cpp index dd1e06aa..4078fd3b 100644 --- a/Crawler/Crawler.cpp +++ b/Crawler/Crawler.cpp @@ -1486,6 +1486,10 @@ void Crawler::ChangePlayerClass(Class cl){ player.reset(new Witch(player.get())); }break; } + player->hp=player->maxhp=DATA.GetProperty(player->GetClassName()+".BaseHealth").GetInt(); + player->atk=DATA.GetProperty(player->GetClassName()+".BaseAtk").GetInt(); + player->hpGrowthRate=DATA.GetProperty(player->GetClassName()+".HealthGrowthRate").GetReal(); + player->atkGrowthRate=DATA.GetProperty(player->GetClassName()+".AtkGrowthRate").GetReal(); sig::Animation::SetupPlayerAnimations(); GetPlayer()->UpdateIdleAnimation(DOWN); } diff --git a/Crawler/GameState.cpp b/Crawler/GameState.cpp index 2be5b39d..4c775df6 100644 --- a/Crawler/GameState.cpp +++ b/Crawler/GameState.cpp @@ -6,5 +6,5 @@ void GameState::Initialize(){ NEW_STATE(States::GAME_RUN,State_GameRun); NEW_STATE(States::MAIN_MENU,State_MainMenu); - GameState::ChangeState(States::MAIN_MENU); + GameState::ChangeState(States::GAME_RUN); } \ No newline at end of file diff --git a/Crawler/Player.cpp b/Crawler/Player.cpp index 1762d2ac..39167035 100644 --- a/Crawler/Player.cpp +++ b/Crawler/Player.cpp @@ -17,6 +17,7 @@ INCLUDE_SPAWNER_LIST INCLUDE_BULLET_LIST INCLUDE_DAMAGENUMBER_LIST INCLUDE_game +INCLUDE_DATA float Player::GROUND_SLAM_SPIN_TIME=0.6f; diff --git a/Crawler/Player.h b/Crawler/Player.h index ce343dd1..cae136e1 100644 --- a/Crawler/Player.h +++ b/Crawler/Player.h @@ -11,6 +11,8 @@ #include "config.h" #include "Key.h" +#undef GetClassName + struct CastInfo{ std::string name; float castTimer; @@ -29,9 +31,11 @@ struct Player{ friend struct Witch; friend class State_GameRun; private: - int hp="Player.BaseHealth"_I,maxhp=hp; + int hp="Warrior.BaseHealth"_I,maxhp=hp; int mana="Player.BaseMana"_I,maxmana=mana; - int atk="Player.BaseAtk"_I; + int atk="Warrior.BaseAtk"_I; + float hpGrowthRate="Warrior.HealthGrowthRate"_F; + float atkGrowthRate="Warrior.AtkGrowthRate"_F; vf2d pos; float z=0; float moveSpd=1.0f; @@ -404,4 +408,4 @@ struct Witch:Player{ {#class".Ability 3.Precast Time"_F,#class".Ability 3.Casting Range"_I/100.f*24,#class".Ability 3.Casting Size"_I/100.f*24}, \ bool(#class".Ability 3.CancelCast"_I) \ }; \ - class::ability4; \ No newline at end of file + class::ability4; \ No newline at end of file diff --git a/Crawler/Version.h b/Crawler/Version.h index d974c186..33530339 100644 --- a/Crawler/Version.h +++ b/Crawler/Version.h @@ -2,7 +2,7 @@ #define VERSION_MAJOR 0 #define VERSION_MINOR 2 #define VERSION_PATCH 0 -#define VERSION_BUILD 2225 +#define VERSION_BUILD 2231 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Crawler/assets/config/configuration.txt b/Crawler/assets/config/configuration.txt index 38be4c1c..ed49527d 100644 --- a/Crawler/assets/config/configuration.txt +++ b/Crawler/assets/config/configuration.txt @@ -55,7 +55,7 @@ debug_access_options = 0 debug_map_load_info = 0 # Shows extra info about the player on the HUD -debug_player_info = 1 +debug_player_info = 0 # Shows collision boxes of tiles. debug_collision_boxes = 0