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
Crawler
@ -1486,6 +1486,10 @@ void Crawler::ChangePlayerClass(Class cl){
|
|||||||
player.reset(new Witch(player.get()));
|
player.reset(new Witch(player.get()));
|
||||||
}break;
|
}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();
|
sig::Animation::SetupPlayerAnimations();
|
||||||
GetPlayer()->UpdateIdleAnimation(DOWN);
|
GetPlayer()->UpdateIdleAnimation(DOWN);
|
||||||
}
|
}
|
||||||
|
@ -6,5 +6,5 @@ void GameState::Initialize(){
|
|||||||
NEW_STATE(States::GAME_RUN,State_GameRun);
|
NEW_STATE(States::GAME_RUN,State_GameRun);
|
||||||
NEW_STATE(States::MAIN_MENU,State_MainMenu);
|
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_BULLET_LIST
|
||||||
INCLUDE_DAMAGENUMBER_LIST
|
INCLUDE_DAMAGENUMBER_LIST
|
||||||
INCLUDE_game
|
INCLUDE_game
|
||||||
|
INCLUDE_DATA
|
||||||
|
|
||||||
float Player::GROUND_SLAM_SPIN_TIME=0.6f;
|
float Player::GROUND_SLAM_SPIN_TIME=0.6f;
|
||||||
|
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "Key.h"
|
#include "Key.h"
|
||||||
|
|
||||||
|
#undef GetClassName
|
||||||
|
|
||||||
struct CastInfo{
|
struct CastInfo{
|
||||||
std::string name;
|
std::string name;
|
||||||
float castTimer;
|
float castTimer;
|
||||||
@ -29,9 +31,11 @@ struct Player{
|
|||||||
friend struct Witch;
|
friend struct Witch;
|
||||||
friend class State_GameRun;
|
friend class State_GameRun;
|
||||||
private:
|
private:
|
||||||
int hp="Player.BaseHealth"_I,maxhp=hp;
|
int hp="Warrior.BaseHealth"_I,maxhp=hp;
|
||||||
int mana="Player.BaseMana"_I,maxmana=mana;
|
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;
|
vf2d pos;
|
||||||
float z=0;
|
float z=0;
|
||||||
float moveSpd=1.0f;
|
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}, \
|
{#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) \
|
bool(#class".Ability 3.CancelCast"_I) \
|
||||||
}; \
|
}; \
|
||||||
class::ability4;
|
class::ability4;
|
@ -2,7 +2,7 @@
|
|||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 0
|
||||||
#define VERSION_BUILD 2225
|
#define VERSION_BUILD 2231
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
@ -55,7 +55,7 @@ debug_access_options = 0
|
|||||||
debug_map_load_info = 0
|
debug_map_load_info = 0
|
||||||
|
|
||||||
# Shows extra info about the player on the HUD
|
# Shows extra info about the player on the HUD
|
||||||
debug_player_info = 1
|
debug_player_info = 0
|
||||||
|
|
||||||
# Shows collision boxes of tiles.
|
# Shows collision boxes of tiles.
|
||||||
debug_collision_boxes = 0
|
debug_collision_boxes = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user