Extracted base health, base attack,and growth rates from being tied to the player directly. Values update on class changes.
This commit is contained in:
parent
e779725106
commit
0fdfa65ddf
@ -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);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user