...
 
Commits (2)
......@@ -2,7 +2,7 @@
ABox::ABox(DXGraphics& gfx, const ActionBox& actBox) :
actBox(actBox),
HudElement(L"Media\\Sprites\\pm_ABox.png", gfx, 0.2f)
HudElement(L"Media\\Sprites\\pm_ABox.png", gfx)
{
skills.emplace(std::make_pair(Skill0::Inactive, std::make_unique<HudElement>(L"Media//Sprites//SkillSheet.png", gfx, 0, 7, 1)));
skills.emplace(std::make_pair(Skill0::Cut, std::make_unique<HudElement>(L"Media//Sprites//SkillSheet.png", gfx, 1, 7, 1)));
......
......@@ -5,6 +5,7 @@
#include <map>
#include "Scenarios.h"
#include "SkillEvent.h"
#include "SoundPlayerInterface.h"
enum class StatusEffects
{
CritChance,
......@@ -51,7 +52,7 @@ public:
}
void AddBleed(size_t emount)
{
ActiveStatusEffects[StatusEffects::Bleed] += (float)emount;
activeStatusEffects[StatusEffects::Bleed].first += (float)emount;
}
void Heal(size_t in_heal)
{
......@@ -60,15 +61,30 @@ public:
}
void CureBleed()
{
ActiveStatusEffects.erase(StatusEffects::Bleed);
activeStatusEffects.erase(StatusEffects::Bleed);
//add sound?
}
void ProkEndTurnStatusEffects()
size_t ProkEndTurnStatusEffects(size_t statusIndex = 0u) //one by one
{
if (ActiveStatusEffects.find(StatusEffects::Bleed) != ActiveStatusEffects.end())
size_t numberOfStatuses = 0u;
size_t curStatus = 0u;
bool isBleading = activeStatusEffects.find(StatusEffects::Bleed) != activeStatusEffects.end();
if (isBleading)
{
SufferPureDamage((int)ActiveStatusEffects[StatusEffects::Bleed]);
numberOfStatuses++;
if (curStatus == statusIndex)
{
SPI::Play(Sounds::Cut);
SufferPureDamage((size_t)activeStatusEffects[StatusEffects::Bleed].first);
activeStatusEffects[StatusEffects::Bleed].second = true;
}
else
{
curStatus++;
activeStatusEffects[StatusEffects::Bleed].second = false;
}
}
return numberOfStatuses;
}
size_t GetBlock()const
{
......@@ -76,7 +92,7 @@ public:
}
const auto GetStatusEffectsReference()
{
return &ActiveStatusEffects;
return &activeStatusEffects;
}
void SetState(State st)
{
......@@ -100,7 +116,7 @@ public:
return events;
}
protected:
std::map <StatusEffects, float> ActiveStatusEffects;
std::map <StatusEffects, std::pair<float,bool>> activeStatusEffects;
size_t HP = 0;
size_t maxHP = 0;
size_t block = 0;
......
......@@ -16,6 +16,7 @@ CombatManager::CombatManager()
void CombatManager::StartBattle(int enemyID)
{
currentTurn = 0u;
returningToMenu = false;
playMan->BeginBattle();
enMan = std::make_unique<Ghoul>();
......@@ -69,14 +70,11 @@ void CombatManager::EndPlayerTurn()
}
void CombatManager::StartNewTurn() //global new turn
{ //PERK ALL TURN BASED EVENTS HERE (first player - then enemy)
playMan->ProkEndTurnStatusEffects();
enMan->ProkEndTurnStatusEffects();
playMan->DumpTemporaryStatus();
enMan->DumpTemporaryStatus();
turnAnnouncer.SetAnnouncment(TurnAnnouncer::AnnTurn::Player);
curTurn = Turn::ExpressingEnemyIntent; //AFTER dumping go to announcing
combatData.enemyIntent = enMan->Choose();
{ //perk all turn based events here (first player - then enemy)
curTurn = Turn::StartingTurn;
turnStartState = TurnBeginningState::PlayerStatusEffects;
enMan->Choose(true); //reseting enemy posture
currentTurn++;
}
int CombatManager::ProcessInput(Keyboard::Event in_event) //why does it return int and not bool?
......@@ -85,7 +83,7 @@ int CombatManager::ProcessInput(Keyboard::Event in_event) //why does it return
//{
// return 1;
//}
if (in_event.GetCode() == 27) //escape pressed
if (in_event.GetCode() == 27u) //escape pressed
{
returningToMenu = true;
EndBattle();
......@@ -150,6 +148,84 @@ void CombatManager::UpdateCombatState(float dt)
{
case CombatManager::Turn::Prefase:
if(turnAnnouncer.Update(dt))StartNewTurn();
break;
case CombatManager::Turn::StartingTurn:
UpdateCombatData();
accumulatedTime += dt;
switch (turnStartState)
{
case CombatManager::TurnBeginningState::PlayerStatusEffects:
if (accumulatedTime >= statusEffetAnnounceTime) //statusEffetAnnounceTime passed since the end of turn
{
size_t numEffects;
numEffects = playMan->ProkEndTurnStatusEffects(currentProcingEffect);
currentProcingEffect++;
accumulatedTime = 0.0f;
if (currentProcingEffect > numEffects) //if proced all status effects
{
playMan->ProkEndTurnStatusEffects(currentProcingEffect); //call proc with increaced index to show that all effects have been proced
currentProcingEffect = 0u;
turnStartState = TurnBeginningState::EnemyStatusEffects;
}
else //if some are left
{
currentProcingEffect++;
}
}
else if(currentProcingEffect==0u) //the turn just began
{
TD::DrawString(L"Turn" + std::to_wstring(currentTurn), { 0.0f,0.0f }, Colors::LightGray, 0.09f);
}
break;
case CombatManager::TurnBeginningState::EnemyStatusEffects:
if (accumulatedTime >= statusEffetAnnounceTime) //statusEffetAnnounceTime passed since the end of turn
{
size_t numEffects;
numEffects = enMan->ProkEndTurnStatusEffects(currentProcingEffect);
currentProcingEffect++;
accumulatedTime = 0.0f;
if (currentProcingEffect > numEffects) //if proced all status effects
{
enMan->ProkEndTurnStatusEffects(currentProcingEffect); //call proc with increaced index to show that all effects have been proced
currentProcingEffect = 0u;
turnStartState = TurnBeginningState::PlayerDumping;
}
else //if some are left
{
currentProcingEffect++;
}
//enMan->ProkEndTurnStatusEffects();
playMan->DumpTemporaryStatus();
enMan->DumpTemporaryStatus();
turnAnnouncer.SetAnnouncment(TurnAnnouncer::AnnTurn::Player);
combatData.enemyIntent = enMan->Choose();
curTurn = Turn::ExpressingEnemyIntent;
}
break;
case CombatManager::TurnBeginningState::PlayerDumping:
break;
case CombatManager::TurnBeginningState::EnemyDumping:
break;
case CombatManager::TurnBeginningState::None:
break;
default:
break;
}
break;
case CombatManager::Turn::ExpressingEnemyIntent:
......
......@@ -14,13 +14,13 @@ struct CombatData
size_t playerHP;
size_t playerBlock;
float playerSpeed;
const std::map <StatusEffects, float>* playerStatusEffects;
const std::map <StatusEffects, std::pair<float, bool>>* playerStatusEffects;
size_t enemyMaxHP;
size_t enemyHP;
size_t enemyBlock;
float enemySpeed;
const std::map <StatusEffects, float>* enemyStatusEffects;
const std::map <StatusEffects, std::pair<float, bool>>* enemyStatusEffects;
AbilityType enemyIntent;
};
class CombatManager
......@@ -70,8 +70,17 @@ private:
ExpressingEnemyIntent,
EnemyDied,
PlayerDied,
StartingTurn,
NotInCombat
};
enum class TurnBeginningState
{
PlayerStatusEffects,
EnemyStatusEffects,
PlayerDumping,
EnemyDumping,
None
};
void IncreaceKillcount()
{
killcount++;
......@@ -83,6 +92,7 @@ private:
CombatData combatData;
Turn curTurn = Turn::NotInCombat;
TurnBeginningState turnStartState = TurnBeginningState::None;
CombatTimers timers;
TurnAnnouncer turnAnnouncer;
......@@ -92,8 +102,10 @@ private:
std::unique_ptr<PlayerManager>playMan;
std::unique_ptr<EnemyCombat>enMan;
bool returningToMenu = false;
size_t killcount = 0;
size_t currentProcingEffect = 0u;
size_t killcount = 0u;
size_t currentTurn = 0u;
float accumulatedTime = 0.0f;
static constexpr float enemyTurnAnimationLength = 1.0f;
static constexpr float statusEffetAnnounceTime = 1.0f;
};
\ No newline at end of file
......@@ -33,6 +33,7 @@ private:
SPI::StopAllInstances(Sounds::TimerCritical);
lowTime = 0;
criticalTime = 0;
skipped = false;
remainingTime = turnRime;
}
void Skip()
......@@ -40,6 +41,7 @@ private:
SPI::StopAllInstances(Sounds::tic_tac);
//add sound
remainingTime = 0.0f;
skipped = true;
}
bool Update(float dt) //returns isEnded
{
......@@ -48,15 +50,21 @@ private:
{
SPI::Play(Sounds::tic_tac, 1.0f, 0.5f);
lowTime = 1;
}
} else
if (!criticalTime&&remainingTime < 2.0f)
{
SPI::Play(Sounds::TimerCritical, 1.0f, 0.4f);
SPI::Play(Sounds::TimerCritical, 1.0f, 0.3f);
criticalTime = 1;
} else
if (remainingTime < 0.0f && !skipped)
{
SPI::Play(Sounds::TimerEnd, 1.0f, 0.4f);
SPI::StopAllInstances(Sounds::tic_tac);
SPI::StopAllInstances(Sounds::TimerCritical);
return 1;
}
if (remainingTime < 0.0f)
else if(remainingTime < 0.0f && skipped)
{
SPI::Play(Sounds::TimerEnd, 1.0f, 0.5f);
SPI::StopAllInstances(Sounds::tic_tac);
SPI::StopAllInstances(Sounds::TimerCritical);
return 1;
......@@ -71,6 +79,7 @@ private:
float remainingTime;
bool lowTime = 0;
bool criticalTime = 0;
bool skipped = false;
};
class CountdownTimer
{
......@@ -146,9 +155,8 @@ private:
two,
three
};
const float defaultDigitTime = 0.6f;
const float defaultGoTime = 0.2f;
static constexpr float defaultDigitTime = 0.4f;
static constexpr float defaultGoTime = 0.15f;
float remainingDigitTime = defaultDigitTime;
Digits curDigit = Digits::three;
};
......
......@@ -7,7 +7,7 @@
#include "TextDrawingUnit.h"
EnemyCombat::EnemyCombat()
{
ActiveStatusEffects[StatusEffects::Accuracy] = baseAcc;
activeStatusEffects[StatusEffects::Accuracy].first = baseAcc;
}
void EnemyCombat::SufferPhysicalDamage(size_t incDmg)
......@@ -41,16 +41,16 @@ void EnemyCombat::SufferPhysicalDamage(size_t incDmg)
}
float EnemyCombat::GetCurAcc() const
{
return ActiveStatusEffects.at(StatusEffects::Accuracy);
return activeStatusEffects.at(StatusEffects::Accuracy).first;
}
void EnemyCombat::DecreaceAcc(float acc)
{
ActiveStatusEffects[StatusEffects::Accuracy] = (0.05f > ActiveStatusEffects[StatusEffects::Accuracy] - acc) ? 0.05f : ActiveStatusEffects[StatusEffects::Accuracy] - acc; //hope compiler optimizes tis a bit
activeStatusEffects[StatusEffects::Accuracy].first = (std::max)(0.05f, activeStatusEffects[StatusEffects::Accuracy].first - acc);
}
void EnemyCombat::DumpTemporaryStatus()
{
ActiveStatusEffects[StatusEffects::Accuracy] = baseAcc;
block /= 4;
activeStatusEffects[StatusEffects::Accuracy].first = baseAcc;
block /= 4u;
}
......@@ -20,7 +20,7 @@ public:
virtual void Act() = 0;
virtual enum class AbilityType Choose() = 0;
virtual enum class AbilityType Choose(bool justReset = false) = 0;
protected:
int chosenAbility; //its position in pool
......
......@@ -4,7 +4,7 @@
#include "../imgui/imgui.h"
#include "TransformCbuf2D.h"
#include "Vertex.h"
HudElement::HudElement(std::wstring modelName, DXGraphics& gfx, float scale )
HudElement::HudElement(std::wstring modelName, DXGraphics& gfx)
{
parent = std::make_pair(nullptr, 0); //set to zero be default
//getting main drawable data
......@@ -58,7 +58,7 @@ HudElement::HudElement(std::wstring modelName, DXGraphics& gfx, float scale )
only.AddBindable(std::move(pvs));
//these three should be bound outside steps because they stay the same no matter the Technique
const auto meshTag = modelName + L"%" + std::to_wstring(scale);
const auto meshTag = modelName + L"%";
pVertices = VertexBuffer::Resolve(gfx, meshTag, vbuf);
pIndices = IndexBuffer::Resolve(gfx, meshTag, indices);
pTopology = Topology::Resolve(gfx, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
......@@ -186,7 +186,7 @@ DirectX::XMMATRIX HudElement::GetTransformXMSpecific(size_t ans) const noexcept
return std::move(encoded);
}
void HudElement::BindPositionData(std::vector<PositionData>* posData)
void HudElement::BindPositionData(const std::vector<PositionData>* posData)
{
this->posData = posData;
}
......
......@@ -9,14 +9,14 @@
class HudElement : protected Drawable //a plane with normals and a texture
{
public:
HudElement(std::wstring modelName, DXGraphics& gfx, float scale = 1);
HudElement(std::wstring modelName, DXGraphics& gfx);
HudElement(std::wstring fontSprite, DXGraphics& gfx, wchar_t spriteNum, wchar_t spritesPerRow, wchar_t spritesPerColumn); //for constructing objects using sprite sheets
HudElement() = default;
HudElement(HudElement&&);
virtual ~HudElement() = default;
DirectX::XMMATRIX GetTransformXM() const noexcept override;
DirectX::XMMATRIX GetTransformXMSpecific(size_t ind) const noexcept; //extracts transform of specific object and does not desturb the currentObjectBeingDrawn variable
void BindPositionData(std::vector<PositionData>* posData);
void BindPositionData(const std::vector<PositionData>* posData);
void BindParent(std::optional<HudElement*>parent, size_t ind = 0u); //index in parnt's posData that corresponds to the right object
virtual void SmartSubmit(FrameCommander& fc) const; //uses Submit with standart tecqunice for first draw call
//and consecutive for all the rest in posData
......@@ -26,7 +26,7 @@ protected:
//index in parnt's posData that corresponds to the right one
mutable size_t currentObjectBeingDrawn = 0;
std::vector<PositionData>* posData; //for every object there will be one position
const std::vector<PositionData>* posData; //for every object there will be one position
};
enum class StatusOwner //is plased here because nicely includes everywhere
......
......@@ -105,7 +105,7 @@ public:
Ghoul::Ghoul()
{
HP = 1u;
HP = 75u;
maxHP = 75u;
speed = 1.0f;
block = 0u;
......@@ -134,40 +134,48 @@ void Ghoul::Act()
}
}
AbilityType Ghoul::Choose()
AbilityType Ghoul::Choose(bool justReset)
{
float chanceSumm = 0.0f;
for (auto& entry : abilities)
if (!justReset)
{
chanceSumm += std::get<2>(entry);
}
float roll = RU.GetFloat(0.0f, chanceSumm);
for (int i = 0; ; i++)
{
roll -= std::get<2>(abilities[i]);
if (roll <= 0)
float chanceSumm = 0.0f;
for (auto& entry : abilities)
{
chanceSumm += std::get<2>(entry);
}
float roll = RU.GetFloat(0.0f, chanceSumm);
for (int i = 0; ; i++)
{
chosenAbility = i;
auto type = std::get<0>(abilities[i])->GetType();
switch (type)
roll -= std::get<2>(abilities[i]);
if (roll <= 0)
{
case AbilityType::NoType:
SetState(EnemyCombat::State::GhoulIdle);
break;
case AbilityType::Attack:
SetState(EnemyCombat::State::GhoulPreparingAttack);
break;
case AbilityType::Buff:
SetState(EnemyCombat::State::GhoulPreparingRage);
break;
case AbilityType::Block:
SetState(EnemyCombat::State::GhoulIdle);
break;
default:
assert(false && "missed ability type in Ghoul::Choose");
break;
chosenAbility = i;
auto type = std::get<0>(abilities[i])->GetType();
switch (type)
{
case AbilityType::NoType:
SetState(EnemyCombat::State::GhoulIdle);
break;
case AbilityType::Attack:
SetState(EnemyCombat::State::GhoulPreparingAttack);
break;
case AbilityType::Buff:
SetState(EnemyCombat::State::GhoulPreparingRage);
break;
case AbilityType::Block:
SetState(EnemyCombat::State::GhoulIdle);
break;
default:
assert(false && "missed ability type in Ghoul::Choose");
break;
}
return type;
}
return type;
}
}
else
{
SetState(EnemyCombat::State::GhoulIdle);
return AbilityType::NoType;
}
}
......@@ -7,5 +7,5 @@ public:
Ghoul();
void Act() override;
private:
AbilityType Choose() override;
AbilityType Choose(bool justReset = false) override;
};
\ No newline at end of file
......@@ -10,13 +10,12 @@ PlayerManager::PlayerManager():
HP = 300u;
maxHP = 300u;
block = 0u;
ActiveStatusEffects[StatusEffects::CritChance] = baseCrit;
ActiveStatusEffects[StatusEffects::Dodge] = baseDodge;
activeStatusEffects[StatusEffects::CritChance].first = baseCrit;
activeStatusEffects[StatusEffects::Dodge].first = baseDodge;
skillPool.push_back(std::make_unique<Cut>(this));
skillPool.push_back(std::make_unique<Cut>(this));
skillPool.push_back(std::make_unique<Cut>(this));
skillPool.push_back(std::make_unique<Deflect>(this));
skillPool.push_back(std::make_unique<Deflect>(this));
skillPool.push_back(std::make_unique<SandStorm>(this));
skillPool.push_back(std::make_unique<SharpenTheBlade>(this));
skillPool.push_back(std::make_unique<SandsOfTime>(this));
......@@ -82,7 +81,7 @@ void PlayerManager::SufferPhysicalDamage(size_t incDmg)
float PlayerManager::GetCritMod() const
{
return ActiveStatusEffects.at(StatusEffects::CritChance);
return activeStatusEffects.at(StatusEffects::CritChance).first;
}
const ActionBox& PlayerManager::GetActionBox() const
......@@ -92,7 +91,7 @@ const ActionBox& PlayerManager::GetActionBox() const
float PlayerManager::GetDodge() const
{
return ActiveStatusEffects.at(StatusEffects::Dodge);
return activeStatusEffects.at(StatusEffects::Dodge).first;
}
float PlayerManager::GetTurnTime() const
......@@ -112,17 +111,17 @@ void PlayerManager::ResetTimePool()
void PlayerManager::AddCrit(float in_crit)
{
ActiveStatusEffects[StatusEffects::CritChance] += in_crit;
activeStatusEffects[StatusEffects::CritChance].first += in_crit;
}
void PlayerManager::AddDodge(float in_dodge)
{
ActiveStatusEffects[StatusEffects::Dodge] += in_dodge;
activeStatusEffects[StatusEffects::Dodge].first += in_dodge;
}
void PlayerManager::DumpTemporaryStatus()
{
block /= 4;
ActiveStatusEffects.at(StatusEffects::Dodge) = baseDodge;
ActiveStatusEffects.at(StatusEffects::CritChance) = baseCrit;
block /= 4u;
activeStatusEffects.at(StatusEffects::Dodge).first = baseDodge;
activeStatusEffects.at(StatusEffects::CritChance).first = baseCrit;
}
\ No newline at end of file
......@@ -23,11 +23,11 @@ void StatusBar::UpdateStatus(DXGraphics& gfx)
void PlayerStatusBar::SmartSubmit(FrameCommander& fc) const
{
dodgeIcon.UpdateData(1, cd.playerStatusEffects->at(StatusEffects::Dodge));
critIcon.UpdateData(2, cd.playerStatusEffects->at(StatusEffects::CritChance));
dodgeIcon.UpdateData(1, cd.playerStatusEffects->at(StatusEffects::Dodge).first);
critIcon.UpdateData(2, cd.playerStatusEffects->at(StatusEffects::CritChance).first);
if (cd.playerStatusEffects->find(StatusEffects::Bleed) != cd.playerStatusEffects->end())
{
bleedIcon.UpdateData(3, cd.playerStatusEffects->at(StatusEffects::Bleed));
bleedIcon.UpdateData(3, cd.playerStatusEffects->at(StatusEffects::Bleed).first, cd.playerStatusEffects->at(StatusEffects::Bleed).second);
bleedIcon.SmartSubmit(fc);
}
hb.SmartSubmit(fc);
......@@ -40,10 +40,10 @@ void PlayerStatusBar::SmartSubmit(FrameCommander& fc) const
void EnemyStatusBar::SmartSubmit(FrameCommander& fc) const
{
accIcon.UpdateData(1, cd.enemyStatusEffects->at(StatusEffects::Accuracy));
accIcon.UpdateData(1, cd.enemyStatusEffects->at(StatusEffects::Accuracy).first);
if (cd.enemyStatusEffects->find(StatusEffects::Bleed) != cd.enemyStatusEffects->end())
{
bleedIcon.UpdateData(2, cd.enemyStatusEffects->at(StatusEffects::Bleed));
bleedIcon.UpdateData(2, cd.enemyStatusEffects->at(StatusEffects::Bleed).first, cd.enemyStatusEffects->at(StatusEffects::Bleed).second);
bleedIcon.SmartSubmit(fc);
}
accIcon.SmartSubmit(fc);
......
#include "StatusIcons.h"
#include "Framework\TextDrawer.h"
void StatusIcon::UpdateData(size_t ind, float val)
void StatusIcon::UpdateData(size_t ind, float val, bool isActivating)
{
value = val;
posData.clear();
const float y = (owner == StatusOwner::Player ? -0.65f : 0.63f);
const float x = (1 + ind) * xOffset + size*ind - 1.0f;
posData.emplace_back(x, y, size);
if (isActivating&& activation.has_value())activation->Activate(); else activation->Deactivate(); //these functions are cheap
}
void StatusIcon::SmartSubmit(FrameCommander& fc) const
{
TD::DrawString(std::to_wstring(value).substr(0u,4u), Vec2(posData[0].pos.x-0.01f, posData[0].pos.y + 0.12f), Colors::LightGray,0.03f);
if (activation.has_value())activation->SmartSubmit(fc);
this->Submit(fc, Techniques::Standart);
}
const std::vector<PositionData>& StatusIcon::GetPosition() const
{
return posData;
}
IconAtivation::IconAtivation(DXGraphics& gfx, std::wstring spriteName, StatusIcon* owner) :
HudElement(spriteName, gfx),
owner(owner)
{
posData.emplace_back(0.0f, 0.0f, 2.0f);
BindParent(owner, 0u);
BindPositionData(&posData);
}
void IconAtivation::Activate()
{
isActive = true;
}
void IconAtivation::Deactivate()
{
isActive = false;
}
void IconAtivation::SmartSubmit(FrameCommander& fc) const
{
if (isActive)HudElement::SmartSubmit(fc);
}
#pragma once
#include "Framework\HudElement.h"
class IconAtivation : public HudElement
{
public:
IconAtivation(DXGraphics& gfx, std::wstring spriteName, class StatusIcon* owner); //StatusIcon could be const, but not quite
IconAtivation(IconAtivation&&) = default;
IconAtivation() = default;
void Activate();
void Deactivate();
void SmartSubmit(FrameCommander& fc)const override;
private:
std::vector<PositionData> posData;//will store relative data to parent and the parenting hud element will be binded
const class StatusIcon* owner;
bool isActive = false;
};
class StatusIcon : public HudElement
{
public:
virtual ~StatusIcon() = default;
StatusIcon(DXGraphics& gfx, std::wstring spriteName, StatusOwner owner) :
HudElement(spriteName, gfx), owner(owner) {BindPositionData(&posData);}
HudElement(spriteName, gfx), owner(owner) {BindPositionData(&posData);}
StatusIcon& operator = (StatusIcon&&) = delete;
StatusIcon(StatusIcon&&) = delete;
void SmartSubmit(FrameCommander& fc) const override;
void UpdateData(size_t ind, float val); //ind indicates the number (left-to-right) of this icon in the StatusBar
const std::vector<PositionData>& GetPosition() const;
virtual void UpdateData(size_t ind, float val, bool isActivating = false); //ind indicates the number (left-to-right) of this icon in the StatusBar
protected:
std::vector<PositionData> posData;
float value;
static constexpr float xOffset = 0.04f;
static constexpr float size = 0.1f;
StatusOwner owner;
std::optional<IconAtivation> activation;
};
class AccuracyIcon : public StatusIcon //only enemy is supposed to have accuracy
{
public:
......@@ -26,7 +47,10 @@ public:
class BleedIcon : public StatusIcon
{
public:
BleedIcon(DXGraphics& gfx, StatusOwner owner) : StatusIcon(gfx, L"Media\\Sprites\\bleed.png", owner) {};
BleedIcon(DXGraphics& gfx, StatusOwner owner) : StatusIcon(gfx, L"Media\\Sprites\\bleed.png", owner)
{
activation.emplace(gfx, L"Media\\Sprites\\bleedAct.png", this);
};
};
class DodgeIcon : public StatusIcon
......