Commit 36e68ba0 authored by AL's avatar AL

upgrade system now is a bit better

parent 8c60d0b7
......@@ -97,6 +97,7 @@ void CombatManager::OnEnemyDeath()
turnAnnouncer.SetAnnouncment(TurnAnnouncer::AnnTurn::EnemyDead);
curTurn = Turn::EnemyDied;
enMan->SetState(EnemyCombat::State::GhoulDead);
playMan->UpgradeRandomSkill(); //after each kill one skill is upgraded
AM::Alert(AM::Event::EnemyDied);
AM::Alert(AM::Event::TurnEnd);
}
......@@ -417,14 +418,17 @@ void CombatManager::ChoseDodge()
rewardMenuIsActive = false;
}
void CombatManager::ChoseUpgrade()
bool CombatManager::ChoseUpgrade()
{
if (playMan->UpgradeRandomSkill()) //if all skills are upgraded
if (playMan->UpgradeRandomSkill()) //if all skills are already upgraded
{
playMan->AddPassiveDodge(dodgeBuffEmount);
playMan->AddPassiveCrit(critBuffEmount);
return true;
}
else
{
rewardMenuIsActive = false;
return false;
}
rewardMenuIsActive = false;
}
void CombatManager::DrawDamage(bool missed, size_t dmg, bool crited, bool bleed, bool playerProduced) const
......
......@@ -70,7 +70,7 @@ public: //why the fuck are they all public?? //at least make some frien
void ChoseBandage();
void ChoseCrit();
void ChoseDodge();
void ChoseUpgrade();
bool ChoseUpgrade();
private:
enum class Turn //this will definitely require reworking as more animations and states will be added
{
......
......@@ -117,7 +117,7 @@ public:
Ghoul::Ghoul()
{
HP = 75u;
HP = 1u;
maxHP = 75u;
speed = 1.0f;
block = 0u;
......
......@@ -148,9 +148,15 @@ bool Menu::Update(Keyboard::Event in_event)
if (code == 'S')
{
SetPressedKey(Key::S);
cm.ChoseUpgrade();
SPI::Play(Sounds::SkillUpgrade);
mState = MenuState::Inactive;
if (cm.ChoseUpgrade()) //if all skills are already upgraded
{
TD::DrawStringAscending(L"All skills are already upgraded", { -0.6f,0.0f }, Colors::Cyan);
}
else
{
SPI::Play(Sounds::SkillUpgrade);
mState = MenuState::Inactive;
}
}
if (code == 'D')
{
......
......@@ -10,8 +10,6 @@ PlayerManager::PlayerManager():
actionBox(skillPool)
{
Reset();
actionBox.UpgradeRandomSkill(); actionBox.UpgradeRandomSkill(); actionBox.UpgradeRandomSkill(); actionBox.UpgradeRandomSkill();
actionBox.UpgradeRandomSkill(); actionBox.UpgradeRandomSkill(); actionBox.UpgradeRandomSkill(); actionBox.UpgradeRandomSkill();
}
void PlayerManager::BeginBattle()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment