...
 
Commits (2)
......@@ -16,6 +16,7 @@ ActionBox::ActionBox(std::vector<std::unique_ptr<Skill>>& skillPool) :
void ActionBox::PullNewSkills()
{
SetPressedKey(Key::All);
pickedSkills.clear();
std::vector<std::unique_ptr<Skill>*> temp;
for (auto& s: boxPool)
......@@ -71,7 +72,8 @@ ABoxDrawingInfo ActionBox::GetPickedSkills() const
ABoxDrawingInfo abdi;
for (size_t i = 0;i<pickedSkills.size();i++)
{
if (pickedSkills[i]->get()->GetAvalibility())abdi.s[i] = static_cast<Skill0>(pickedSkills[i]->get()->GetID()); else abdi.s[i] = static_cast<Skill0>(0u);
if (pickedSkills[i]->get()->GetAvalibility())abdi.s[i] = static_cast<Skill0>(pickedSkills[i]->get()->GetID()); //gets normal
else abdi.s[i] = static_cast<Skill0>(pickedSkills[i]->get()->GetID()+static_cast<size_t>(Skill0::CutBlocked)); //gets blocked
}
return std::move(abdi);
}
......@@ -148,9 +150,9 @@ bool ActionBox::ProcessInput(const char input)
return ending;
}
bool ActionBox::UpdateTurnState() //not intuitive
bool ActionBox::UpdateTurnState()
{
bool Finished = 0;
bool Finished = 0; //use std accumulate here?
for (size_t i = 0; i < pickedSkills.size(); i++)
{
Finished = pickedSkills[i]->get()->IsAvalible() || Finished;
......
......@@ -119,6 +119,16 @@ void EffectHandler::AddEffect2D(PositionData posData,Effect e)
EffectHandler::AddEffect2D(e2ds, L"Media\\Sprites\\effect_shine.png");
break;
}
case Effect::ShineOrange:
{
Effect2DSequence e2ds;
e2ds.AddStage({ posData.pos.x,posData.pos.y,posData.rot.x*0.5f, 0.4f }, 0.1f);
e2ds.AddStage({ posData.pos.x,posData.pos.y,posData.rot.x, 0.9f }, 0.2f);
e2ds.AddStage({ posData.pos.x,posData.pos.y,posData.rot.x*2.0f, 0.4f }, 0.3f);
e2ds.AddStage({ posData.pos.x,posData.pos.y,posData.rot.x * 4.0f,0.0f }, 0.0f);
EffectHandler::AddEffect2D(e2ds, L"Media\\Sprites\\effect_particle1.png");
break;
}
case Effect::Sparks:
{
e2df.push_back(std::make_unique<Effect2DPhysics>(30u, posData, 1.0f, 10.0f, 1.5f, 0.95f, L"Media\\Sprites\\effect_particle1.png", *gfx));
......
......@@ -87,6 +87,7 @@ public:
enum class Effect
{
Shine,
ShineOrange,
Sparks
};
EffectHandler(DXGraphics& gfx);
......
......@@ -4,7 +4,7 @@ class PressableMenu
public:
enum class Key
{
W, A, S, D, None
W, A, S, D, All, None
};
Key GetPressedKey() const {return pressedKey; };
void KeyAcquired() const { pressedKey = Key::None; };
......
#pragma once
#include "./SkillStuff/Skill.h"
#include "SoundPlayerInterface.h" //??????
#include "SoundPlayerInterface.h"
#include <assert.h>
enum class Skill0
enum class Skill0 //order matters. is used for indexing
{
Inactive,
Cut,
Deflect,
SandStorm,
SharpenTheBlade,
SandsOfTime,
DustThrow
DustThrow,
CutBlocked,
DeflectBlocked,
SandStormBlocked,
SharpenTheBladeBlocked,
SandsOfTimeBlocked,
DustThrowBlocked,
Inactive
};
class Cut : public Skill
class Cut : public Skill //skill ID has to match skills position in Skill0 enum
{
public:
Cut(CombatEntity* owner) : Skill(owner)
{
id = 1;
id = 0;
valLow = 10.0f;
valHigh = 15.0f;
};
......@@ -39,7 +45,7 @@ class Deflect : public Skill
public:
Deflect(CombatEntity* owner) : Skill(owner)
{
id = 2;
id = 1;
valLow = 10u;
valHigh = 20u;
succChance = 0.0f;
......@@ -61,7 +67,7 @@ class SandStorm : public Skill
public:
SandStorm(CombatEntity* owner) : Skill(owner)
{
id = 3;
id = 2;
valLow = valHigh = 0.7f;
};
void Activate() override
......@@ -85,7 +91,7 @@ class SharpenTheBlade : public Skill
public:
SharpenTheBlade(CombatEntity* owner) : Skill(owner)
{
id = 4;
id = 3;
valLow = valHigh = 0.55f;
quick = 1;
};
......@@ -107,7 +113,7 @@ class SandsOfTime : public Skill
public:
SandsOfTime(CombatEntity* owner) : Skill(owner)
{
id = 5;
id = 4;
valLow = valHigh = 0.15f;
quick = 1;
rewinding = 1;
......@@ -129,7 +135,7 @@ class DustThrow : public Skill
public:
DustThrow(CombatEntity* owner) : Skill(owner)
{
id = 6;
id = 5;
valLow = valHigh = 0.25f;
quick = 1;
};
......@@ -147,5 +153,4 @@ public:
valLow = valHigh = 0.3f;
rewinding = true;
}
};
};
\ No newline at end of file
......@@ -42,26 +42,26 @@ protected:
class AccuracyIcon : public StatusIcon //only enemy is supposed to have accuracy
{
public:
AccuracyIcon(DXGraphics& gfx, StatusOwner owner) : StatusIcon(gfx, L"Media\\Sprites\\acc.png", owner) {};
AccuracyIcon(DXGraphics& gfx, StatusOwner owner) : StatusIcon(gfx, L"Media\\Sprites\\statusBar_acc.png", owner) {};
};
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\\statusBar_bleed.png", owner)
{
activation.emplace(gfx, L"Media\\Sprites\\bleedAct.png", this);
activation.emplace(gfx, L"Media\\Sprites\\statusBar_bleedAct.png", this);
};
};
class DodgeIcon : public StatusIcon
{
public:
DodgeIcon(DXGraphics& gfx, StatusOwner owner) : StatusIcon(gfx, L"Media\\Sprites\\dodge.png", owner) {};
DodgeIcon(DXGraphics& gfx, StatusOwner owner) : StatusIcon(gfx, L"Media\\Sprites\\statusBar_dodge.png", owner) {};
};
class CritIcon : public StatusIcon
{
public:
CritIcon(DXGraphics& gfx, StatusOwner owner) : StatusIcon(gfx, L"Media\\Sprites\\crit.png", owner) {};
CritIcon(DXGraphics& gfx, StatusOwner owner) : StatusIcon(gfx, L"Media\\Sprites\\statusBar_crit.png", owner) {};
};
\ No newline at end of file
......@@ -40,7 +40,7 @@ void MainMenuHolder::SmartSubmit(FrameCommander& fc) const
for (auto& s : panels) s.second->SmartSubmit(fc);
this->Submit(fc, Techniques::Standart);
const auto key = menu.GetPressedKey();
if (key != PressableMenu::Key::None)
if (key != PressableMenu::Key::None && key != PressableMenu::Key::All)
{
EffectHandler::AddEffect2D(panels.at(key)->GetCumulatedPosData(), EffectHandler::Effect::Shine);
EffectHandler::AddEffect2D(panels.at(key)->GetCumulatedPosData(), EffectHandler::Effect::Sparks);
......@@ -70,7 +70,7 @@ void TutorialHolder::SmartSubmit(FrameCommander& fc) const
for (auto& s : panels) s.second->SmartSubmit(fc);
this->Submit(fc, Techniques::Standart);
const auto key = menu.GetPressedKey();
if (key != PressableMenu::Key::None)
if (key != PressableMenu::Key::None && key != PressableMenu::Key::All)
{
EffectHandler::AddEffect2D(panels.at(key)->GetCumulatedPosData(), EffectHandler::Effect::Shine);
EffectHandler::AddEffect2D(panels.at(key)->GetCumulatedPosData(), EffectHandler::Effect::Sparks);
......@@ -104,7 +104,7 @@ void RewardMenu::SmartSubmit(FrameCommander& fc) const
this->Submit(fc, Techniques::Standart);
}
const auto key = menu.GetPressedKey();
if (key != PressableMenu::Key::None)
if (key != PressableMenu::Key::None && key != PressableMenu::Key::All)
{
EffectHandler::AddEffect2D(panels.at(key)->GetCumulatedPosData(), EffectHandler::Effect::Shine);
EffectHandler::AddEffect2D(panels.at(key)->GetCumulatedPosData(), EffectHandler::Effect::Sparks);
......@@ -118,13 +118,19 @@ ABox::ABox(DXGraphics& gfx, const ActionBox& actBox) :
skillIconInfo(actBox.GetPickedSkillsInfo()),
skillMicroiconPositionReferences(L"Media\\Sprites\\blank.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)));
skills.emplace(std::make_pair(Skill0::Deflect, std::make_unique<HudElement>(L"Media//Sprites//SkillSheet.png", gfx, 2, 7, 1)));
skills.emplace(std::make_pair(Skill0::SandStorm, std::make_unique<HudElement>(L"Media//Sprites//SkillSheet.png", gfx, 3, 7, 1)));
skills.emplace(std::make_pair(Skill0::SharpenTheBlade, std::make_unique<HudElement>(L"Media//Sprites//SkillSheet.png", gfx, 4, 7, 1)));
skills.emplace(std::make_pair(Skill0::SandsOfTime, std::make_unique<HudElement>(L"Media//Sprites//SkillSheet.png", gfx, 5, 7, 1)));
skills.emplace(std::make_pair(Skill0::DustThrow, std::make_unique<HudElement>(L"Media//Sprites//SkillSheet.png", gfx, 6, 7, 1)));
skills.emplace(std::make_pair(Skill0::CutBlocked, std::make_unique<HudElement>(L"Media//Sprites//SkillSheetBlocked.png", gfx, 1, 7, 1)));
skills.emplace(std::make_pair(Skill0::DeflectBlocked, std::make_unique<HudElement>(L"Media//Sprites//SkillSheetBlocked.png", gfx, 2, 7, 1)));
skills.emplace(std::make_pair(Skill0::SandStormBlocked, std::make_unique<HudElement>(L"Media//Sprites//SkillSheetBlocked.png", gfx, 3, 7, 1)));
skills.emplace(std::make_pair(Skill0::SharpenTheBladeBlocked, std::make_unique<HudElement>(L"Media//Sprites//SkillSheetBlocked.png", gfx, 4, 7, 1)));
skills.emplace(std::make_pair(Skill0::SandsOfTimeBlocked, std::make_unique<HudElement>(L"Media//Sprites//SkillSheetBlocked.png", gfx, 5, 7, 1)));
skills.emplace(std::make_pair(Skill0::DustThrowBlocked, std::make_unique<HudElement>(L"Media//Sprites//SkillSheetBlocked.png", gfx, 6, 7, 1)));
for (size_t i = 0; i < skills.size(); i++)posSkill.emplace_back();
for (size_t i = 0; i < skills.size(); i++)
{
......@@ -182,7 +188,7 @@ void ABox::SmartSubmit(FrameCommander& fc) const
for (auto& s : skillMicroicons) s.second->ClearDrawingPositions();
for (size_t i = 0; i < skillMicroInfo.size(); i++)
{
if (dispSkills.s[i] != Skill0::Inactive)
if (dispSkills.s[i] < Skill0::CutBlocked)
{
size_t curIconInd = 0u;
if (skillMicroInfo[i].at(SkillInfoMicroicons::TurnEnder))
......@@ -211,12 +217,20 @@ void ABox::SmartSubmit(FrameCommander& fc) const
this->Submit(fc, Techniques::Standart);
//submiting effects
const auto key = actBox.GetPressedKey();
if (actBox.GetPressedKey() != PressableMenu::Key::None)
if (key != PressableMenu::Key::None && key != PressableMenu::Key::All) //some key pressed
{
EffectHandler::AddEffect2D(panels.at(key)->GetCumulatedPosData(), EffectHandler::Effect::Shine);
EffectHandler::AddEffect2D(panels.at(key)->GetCumulatedPosData(), EffectHandler::Effect::Sparks);
actBox.KeyAcquired();
}
else if (key != PressableMenu::Key::None) //pull new skills was called
{
EffectHandler::AddEffect2D(panels.at(PressableMenu::Key::W)->GetCumulatedPosData(), EffectHandler::Effect::ShineOrange);
EffectHandler::AddEffect2D(panels.at(PressableMenu::Key::A)->GetCumulatedPosData(), EffectHandler::Effect::ShineOrange);
EffectHandler::AddEffect2D(panels.at(PressableMenu::Key::S)->GetCumulatedPosData(), EffectHandler::Effect::ShineOrange);
EffectHandler::AddEffect2D(panels.at(PressableMenu::Key::D)->GetCumulatedPosData(), EffectHandler::Effect::ShineOrange);
actBox.KeyAcquired();
}
}
std::vector<std::vector<PositionData>> ABox::posSkill;
\ No newline at end of file