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:
2023-10-22 00:48:09 -05:00
parent e779725106
commit 0fdfa65ddf
6 changed files with 15 additions and 6 deletions
+4
View File
@@ -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);
}