...
 
Commits (2)
......@@ -14,20 +14,22 @@ CombatManager::CombatManager()
keysForActionBoxes.push_back('A');
keysForActionBoxes.push_back('S');
keysForActionBoxes.push_back('D');
killcount = 0u;
}
void CombatManager::StartBattle(size_t enemyID)
{
killcount = 0u;
currentTurn = 0u;
returningToMenu = false;
playMan->BeginBattle();
enMan = std::make_unique<Ghoul>();
enMan->AddSpeed((float)killcount/5.0f); //the more enemies you kill - the faster they become
combatData.enemyIntent = AbilityType::NoType;
combatData.isValid = true;
CombatManager::curTurn = Turn::Prefase;
turnAnnouncer.SetAnnouncment(TurnAnnouncer::AnnTurn::SpawningEnemy);
UpdateCombatData();
timers.Stop();
}
void CombatManager::EndBattle()
......@@ -36,10 +38,19 @@ void CombatManager::EndBattle()
enMan = nullptr;
playMan->Reset();
combatData.enemyIntent = AbilityType::NoType;
combatData.isValid = false;
CombatManager::curTurn = Turn::NotInCombat;
timers.SetActiveTimer(CombatTimers::ActiveTimer::NoActive);
timers.Stop();
turnAnnouncer.SetAnnouncment(TurnAnnouncer::AnnTurn::Void);
curTurn = Turn::NotInCombat;
turnStartState = TurnBeginningState::None;
returningToMenu = true;
rewardMenuIsActive = false;
currentProcingEffect = 0u;
killcount = 0u;
currentTurn = 0u;
accumulatedTime = 0.0f;
}
void CombatManager::StartPlayerTurn()
......@@ -92,7 +103,6 @@ int CombatManager::ProcessInput(Keyboard::Event in_event) //why does it return
//}
if (in_event.GetCode() == 27u) //escape pressed
{
returningToMenu = true;
EndBattle();
}
......@@ -535,9 +545,4 @@ void CombatManager::HandleEvent(SkillEvent ev)
bool CombatManager::GetRewardMenuActiveness() const
{
return rewardMenuIsActive;
}
void DrawIntent()
{
assert(false);
}
}
\ No newline at end of file
......@@ -22,6 +22,8 @@ struct CombatData
float enemySpeed;
const std::map <StatusEffects, std::pair<float, bool>>* enemyStatusEffects;
AbilityType enemyIntent;
bool isValid = false;
};
class CombatManager
{
......@@ -108,7 +110,7 @@ private:
std::unique_ptr<PlayerManager>playMan;
std::unique_ptr<EnemyCombat>enMan;
bool returningToMenu = false;
bool returningToMenu = false; //not used
bool rewardMenuIsActive = false;
size_t currentProcingEffect = 0u;
size_t killcount = 0u;
......
......@@ -248,6 +248,7 @@
<ClInclude Include="IntentIcons.h" />
<ClInclude Include="Mesh.h" />
<ClInclude Include="PressableMenu.h" />
<ClInclude Include="SceneLight.h" />
<ClInclude Include="SideButtons.h" />
<ClInclude Include="LevelMap.h" />
<ClInclude Include="Menu.h" />
......
......@@ -567,6 +567,9 @@
<ClInclude Include="PressableMenu.h">
<Filter>Header Files\HUDs</Filter>
</ClInclude>
<ClInclude Include="SceneLight.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Game.cpp">
......
......@@ -24,7 +24,7 @@ Letter::Letter(std::wstring fontSprite, DXGraphics& gfx, wchar_t letter)
float screenAspecrRatio = (float)gfx.GetScreenWidth() / (float)gfx.GetScreenHeight();
float totalAR = letterAspectRatio/screenAspecrRatio;
only.AddBindable(std::move(tex));
only.AddBindable(Bind::Sampler::Resolve(gfx)); //for filtering
//only.AddBindable(Bind::Sampler::Resolve(gfx)); //for filtering
Dvtx::VertexBuffer vbuf(std::move(
VertexLayout{}
......@@ -57,7 +57,7 @@ Letter::Letter(std::wstring fontSprite, DXGraphics& gfx, wchar_t letter)
pVertices = VertexBuffer::Resolve(gfx, meshTag, vbuf);
pIndices = IndexBuffer::Resolve(gfx, meshTag, indices);
pTopology = Topology::Resolve(gfx, D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
only.AddBindable(Blender::Resolve(gfx, false));
only.AddBindable(Blender::Resolve(gfx, true));
only.AddBindable(std::make_shared<TextConstantBuffer>(gfx));
......
......@@ -208,6 +208,15 @@ void LevelLayout::AddEnemy(Enemy::Monster monster, DirectX::XMFLOAT2 pos, bool i
enemiesForDrawing[static_cast<size_t>(monster)].second.push_back(model);
}
void LevelLayout::RemoveCorpses()
{
while(enemiesForDrawing[0].first.size()>1u)
{
enemiesForDrawing[0].first.pop_back();
enemiesForDrawing[0].second.pop_back();
}
}
void LevelLayout::SubmitDrawables()
{
auto state = cm.GetEnemyState();
......@@ -220,6 +229,10 @@ void LevelLayout::SubmitDrawables()
enemyWasDead = false;
AddEnemy(LevelLayout::Enemy::Monster::Ghoul, { RU.GetFloat(6.0f, 7.5f), RU.GetFloat(0.0f,2.0f) }, true);
}
else if (state == EnemyCombat::State::NoEntity) //removing corpses
{
RemoveCorpses();
}
switch (state)
{
case EnemyCombat::State::GhoulAttack:
......
......@@ -99,6 +99,7 @@ public:
~LevelLayout() = default;
void AddWall(Wall::Model mod, Wall::Type type, DirectX::XMFLOAT2 pos = { 0,0 }, Wall::Direction dir = Wall::Direction::Backwards);
void AddEnemy(Enemy::Monster monster, DirectX::XMFLOAT2 pos = { 0,0 }, bool isDead = false);
void RemoveCorpses();
void ClearWallPositions()
{
wallPositions.clear();
......
......@@ -25,9 +25,6 @@ Game::Game()
//gfx( wnd.GetHWND() ),
//scene(gfx,map,menu)
{
//cube.SetPos({ 4.0f,0.0f,0.0f });
//cube2.SetPos({ 0.0f,4.0f,0.0f });
//planeTN.SetPos({ 1.0f,1.0f,1.0f });
//TextDrawingUnit::Init();
//CombatManager::StartBattle(0);
wnd.DXGfx().SetCamera(dx::XMMatrixTranslation(8.0f, 7.0f, 3.0f));
......@@ -38,11 +35,6 @@ Game::Game()
int Game::Go()
{
while(true)
{
if (isExiting)break;
......@@ -85,10 +77,8 @@ int Game::Go()
wnd.DXGfx().SetCamera(cam.GetMatrix());
wnd.DXGfx().SetCamPos(cam.GetPosition());
light.Bind(wnd.DXGfx(), cam.GetMatrix());
// td.DrawString(L"popiga+rapiga", { -0.6f,0.5f }, Colors::Green, 0.039f);
light.Submit(fc);
hud.Submit();
//planeTN.Submit(fc);
ll.SubmitDrawables();
cm.Draw(wnd.DXGfx());
eh.SubmitAndUpdate(fc, dt);
......@@ -139,7 +129,7 @@ int Game::Go()
wnd.DXGfx().EndFrame();
td.EndFrame();
fc.Reset();
//ComposeFrame();
cm.UpdateCombatState(dt);
}
}
......
......@@ -82,15 +82,18 @@ void HUD::Submit() const
break;
case Menu::MenuState::Inactive:
case Menu::MenuState::ChoosingReward:
elements.at(Element::ActionBox)->SmartSubmit(fc);
dynamic_cast<PlayerStatusBar*>(elements.at(Element::PlayerStatusBar).get())->UpdateStatus(gfx); // casting is the best solution i could find((
dynamic_cast<EnemyStatusBar*>(elements.at(Element::EnemyStatusBar).get())->UpdateStatus(gfx);
dynamic_cast<InitiativeBar*>(elements.at(Element::InitiativeBar).get())->UpdateFillness(gfx);
elements.at(Element::IntentIcon)->SmartSubmit(fc);
elements.at(Element::PlayerStatusBar)->SmartSubmit(fc);
elements.at(Element::EnemyStatusBar)->SmartSubmit(fc);
elements.at(Element::InitiativeBar)->SmartSubmit(fc);
elements.at(Element::RewardMenu)->SmartSubmit(fc);
if (cd.isValid)
{
elements.at(Element::ActionBox)->SmartSubmit(fc);
dynamic_cast<PlayerStatusBar*>(elements.at(Element::PlayerStatusBar).get())->UpdateStatus(gfx); // casting is the best solution i could find((
dynamic_cast<EnemyStatusBar*>(elements.at(Element::EnemyStatusBar).get())->UpdateStatus(gfx);
dynamic_cast<InitiativeBar*>(elements.at(Element::InitiativeBar).get())->UpdateFillness(gfx);
elements.at(Element::IntentIcon)->SmartSubmit(fc);
elements.at(Element::PlayerStatusBar)->SmartSubmit(fc);
elements.at(Element::EnemyStatusBar)->SmartSubmit(fc);
elements.at(Element::InitiativeBar)->SmartSubmit(fc);
elements.at(Element::RewardMenu)->SmartSubmit(fc);
}
break;
case Menu::MenuState::None:
break;
......
Engine/Media/Sprites/font.png

32.5 KB | W: | H:

Engine/Media/Sprites/font.png

17.5 KB | W: | H:

Engine/Media/Sprites/font.png
Engine/Media/Sprites/font.png
Engine/Media/Sprites/font.png
Engine/Media/Sprites/font.png
  • 2-up
  • Swipe
  • Onion skin
//#pragma once
//#include "Framework\PointLight.h"
//#include "Framework\PlaneTexNorm.h"
//
//class SceneLight
//{
// SceneLight(DXGraphics& gfx);
//
//
//private:
// PlaneTexNorm plane;
// PointLight pl;
//};
//
//{
//public:
// enum class Type
// {
// Wall,
// Floor,
// Ceiling
// };
// enum class Direction //the direction the wall facing
// {
// Left,
// Right,
// Forward,
// Backwards
// };
// enum class Model
// {
// StoneWall,
// StoneFloor,
// StoneCeiling,
// Last
// };
// void BindModelToPositions(std::vector<PositionData> * posData)
// {
// plane.BindPositionData(posData);
// }
// Wall(std::wstring modelName, DXGraphics & gfx) :
// plane(modelName, gfx)
// {}
// Wall(const Wall&) = default;
// Wall(Wall&&) = default;
// ~Wall() = default;
// void Submit(FrameCommander & fc) { plane.SmartSubmit(fc, Techniques::Standart); }
//private:
//
//};
\ No newline at end of file
......@@ -9,6 +9,6 @@ float4 main(float2 pos : Position, float2 tc : Texcoord) : SV_Target
float4 dtex = tex.Sample(splr, tc);
clip(dtex.a < 0.1f ? -1 : 1);
// final color
float4 f = { color, 1.0f };
float4 f = { color, dtex.a };
return f;
}
\ No newline at end of file