...
 
Commits (4)
......@@ -182,6 +182,11 @@ bool ActionBox::UpgradeRandomSkill()
return !upgraded;
}
void ActionBox::Reset()
{
InitializeAboxSkillInfoMicroicons();
}
void ActionBox::PlayPressSound()
{
SPI::Play(Sounds::ABoxSkillPress,1.0f+0.2f*(float)skillsActivatedThisTurn);
......
......@@ -39,6 +39,8 @@ public:
bool UpgradeRandomSkill();//returns 1 if all skills are upgraded
void Reset();
protected:
std::vector<std::unique_ptr<class Skill>>& boxPool;
std::vector<std::unique_ptr<class Skill>*> pickedSkills;
......
......@@ -16,6 +16,7 @@ CombatManager::CombatManager()
void CombatManager::StartBattle(size_t enemyID)
{
killcount = 0u;
currentTurn = 0u;
returningToMenu = false;
playMan->BeginBattle();
......@@ -29,7 +30,9 @@ void CombatManager::StartBattle(size_t enemyID)
void CombatManager::EndBattle()
{
turnAnnouncer.SetAnnouncment(TurnAnnouncer::AnnTurn::Void);
enMan = nullptr;
playMan->Reset();
combatData.enemyIntent = AbilityType::NoType;
CombatManager::curTurn = Turn::NotInCombat;
timers.SetActiveTimer(CombatTimers::ActiveTimer::NoActive);
......
......@@ -174,13 +174,14 @@ Effect2DPhysics::Effect2DPhysics(size_t particleCount, PositionData particleOrig
particleSprite(sprite, gfx)
{
PositionData po = particleOrigin;
auto& ru = RU;
po.rot.x *= partScale; //scaling down
for (size_t i = 0; i < particleCount; i++)
{
partPos.push_back(po);
auto speed = RU.GetFloat(speedMin, speedMax);
auto speedDist = RU.GetFloat0to1();
partVel.emplace_back(RU.GetBool()?speed * speedDist : -speed * speedDist, RU.GetBool() ? speed * (1.0f - speedDist): -speed * (1.0f - speedDist), friction);
auto speed = ru.GetFloat(speedMin, speedMax);
auto speedDist = ru.GetFloat0to1();
partVel.emplace_back(ru.GetBool()?speed * speedDist : -speed * speedDist, ru.GetBool() ? speed * (1.0f - speedDist): -speed * (1.0f - speedDist), friction);
}
particleSprite.BindPositionData(&partPos);
}
......
......@@ -91,13 +91,13 @@ void LevelLayout::Enemy::Submit(FrameCommander& fc)
LevelLayout::LevelLayout(DXGraphics& gfx, FrameCommander& fc, const CombatManager& cm) : gfx(gfx), fc(fc), cm(cm)
{
wallModels.emplace_back(L"Media\\Models\\BrickWall.obj", gfx);
wallModels.emplace_back(L"Media\\Models\\StoneFloor.obj", gfx);
wallModels.emplace_back(L"Media\\Models\\BrickWall.obj", gfx); //replaces ceiling for now
wallModels.emplace_back(L"Media\\Models\\stone_wall.obj", gfx);
wallModels.emplace_back(L"Media\\Models\\stone_floor.obj", gfx);
wallModels.emplace_back(L"Media\\Models\\stone_ceiling.obj", gfx);
enemies.emplace_back(gfx);
wallPositions.reserve(static_cast<size_t>(Wall::Model::Last));
for (size_t i = static_cast<size_t>(Wall::Model::BrickWall);
for (size_t i = static_cast<size_t>(Wall::Model::StoneWall);
i < static_cast<size_t>(Wall::Model::Last); i++)
{
std::vector<PositionData> vPos;
......@@ -116,20 +116,20 @@ LevelLayout::LevelLayout(DXGraphics& gfx, FrameCommander& fc, const CombatManage
enemies[i].SetDrawingData(&enemiesForDrawing[i].first, &enemiesForDrawing[i].second);
}
//behid camera
AddWall(Wall::Model::BrickWall, Wall::Type::Wall, { 0,2 }, Wall::Direction::Forward);
AddWall(Wall::Model::BrickWall, Wall::Type::Wall, { 0,0 }, Wall::Direction::Forward);
//coridor
AddWall(Wall::Model::BrickWall, Wall::Type::Wall, { 1,3 }, Wall::Direction::Right);
AddWall(Wall::Model::BrickWall, Wall::Type::Wall, { 1,-1 }, Wall::Direction::Left);
AddWall(Wall::Model::BrickWall, Wall::Type::Wall, { 3,3 }, Wall::Direction::Right);
AddWall(Wall::Model::BrickWall, Wall::Type::Wall, { 3,-1 }, Wall::Direction::Left);
AddWall(Wall::Model::BrickWall, Wall::Type::Wall, { 5,3 }, Wall::Direction::Right);
AddWall(Wall::Model::BrickWall, Wall::Type::Wall, { 5,-1 }, Wall::Direction::Left);
AddWall(Wall::Model::BrickWall, Wall::Type::Wall, { 7,3 }, Wall::Direction::Right);
AddWall(Wall::Model::BrickWall, Wall::Type::Wall, { 7,-1 }, Wall::Direction::Left);
//in front of camera
AddWall(Wall::Model::BrickWall, Wall::Type::Wall, { 8,0 }, Wall::Direction::Backwards);
AddWall(Wall::Model::BrickWall, Wall::Type::Wall, { 8,2 }, Wall::Direction::Backwards);
AddWall(Wall::Model::StoneWall, Wall::Type::Wall, { 0,2 }, Wall::Direction::Forward);
AddWall(Wall::Model::StoneWall, Wall::Type::Wall, { 0,0 }, Wall::Direction::Forward);
//coridor
AddWall(Wall::Model::StoneWall, Wall::Type::Wall, { 1,3 }, Wall::Direction::Right);
AddWall(Wall::Model::StoneWall, Wall::Type::Wall, { 1,-1 }, Wall::Direction::Left);
AddWall(Wall::Model::StoneWall, Wall::Type::Wall, { 3,3 }, Wall::Direction::Right);
AddWall(Wall::Model::StoneWall, Wall::Type::Wall, { 3,-1 }, Wall::Direction::Left);
AddWall(Wall::Model::StoneWall, Wall::Type::Wall, { 5,3 }, Wall::Direction::Right);
AddWall(Wall::Model::StoneWall, Wall::Type::Wall, { 5,-1 }, Wall::Direction::Left);
AddWall(Wall::Model::StoneWall, Wall::Type::Wall, { 7,3 }, Wall::Direction::Right);
AddWall(Wall::Model::StoneWall, Wall::Type::Wall, { 7,-1 }, Wall::Direction::Left);
//in front of camera
AddWall(Wall::Model::StoneWall, Wall::Type::Wall, { 8,0 }, Wall::Direction::Backwards);
AddWall(Wall::Model::StoneWall, Wall::Type::Wall, { 8,2 }, Wall::Direction::Backwards);
AddWall(Wall::Model::StoneFloor, Wall::Type::Floor, { 1,0 });
AddWall(Wall::Model::StoneFloor, Wall::Type::Floor, { 1,2 });
......@@ -140,14 +140,14 @@ LevelLayout::LevelLayout(DXGraphics& gfx, FrameCommander& fc, const CombatManage
AddWall(Wall::Model::StoneFloor, Wall::Type::Floor, { 7,0 });
AddWall(Wall::Model::StoneFloor, Wall::Type::Floor, { 7,2 });
AddWall(Wall::Model::BrickWall, Wall::Type::Ceiling, { 1,0 });
AddWall(Wall::Model::BrickWall, Wall::Type::Ceiling, { 1,2 });
AddWall(Wall::Model::BrickWall, Wall::Type::Ceiling, { 3,0 });
AddWall(Wall::Model::BrickWall, Wall::Type::Ceiling, { 3,2 });
AddWall(Wall::Model::BrickWall, Wall::Type::Ceiling, { 5,0 });
AddWall(Wall::Model::BrickWall, Wall::Type::Ceiling, { 5,2 });
AddWall(Wall::Model::BrickWall, Wall::Type::Ceiling, { 7,0 });
AddWall(Wall::Model::BrickWall, Wall::Type::Ceiling, { 7,2 });
AddWall(Wall::Model::StoneCeiling, Wall::Type::Ceiling, { 1,0 });
AddWall(Wall::Model::StoneCeiling, Wall::Type::Ceiling, { 1,2 });
AddWall(Wall::Model::StoneCeiling, Wall::Type::Ceiling, { 3,0 });
AddWall(Wall::Model::StoneCeiling, Wall::Type::Ceiling, { 3,2 });
AddWall(Wall::Model::StoneCeiling, Wall::Type::Ceiling, { 5,0 });
AddWall(Wall::Model::StoneCeiling, Wall::Type::Ceiling, { 5,2 });
AddWall(Wall::Model::StoneCeiling, Wall::Type::Ceiling, { 7,0 });
AddWall(Wall::Model::StoneCeiling, Wall::Type::Ceiling, { 7,2 });
AddEnemy(Enemy::Monster::Ghoul, { 4,1 });
}
......@@ -250,8 +250,6 @@ void LevelLayout::SubmitDrawables()
assert(false && "missed the satate in LevelLayout::SubmitDrawables");
break;
}
wallModels[0].Submit(fc);
wallModels[1].Submit(fc);
enemies[0].Submit(fc);
//for (auto& w : wallModels) w.Submit(fc); //no ceiling yet
for (auto& w : wallModels) w.Submit(fc);
enemies[0].Submit(fc);
}
\ No newline at end of file
......@@ -27,9 +27,9 @@ public:
};
enum class Model
{
BrickWall,
StoneWall,
StoneFloor,
Ceiling,
StoneCeiling,
Last
};
void BindModelToPositions(std::vector<PositionData>* posData)
......
......@@ -24,7 +24,7 @@ PlaneTexNorm::PlaneTexNorm(std::wstring modelName, DXGraphics& gfx, float scale,
);
if (pPlane == nullptr)
{
//auto s = imp.GetErrorString(); // ModelException not implemented
auto s = imp.GetErrorString(); // ModelException not implemented
assert(false && "bad model"); //throw ModelException(__LINE__, __FILE__, imp.GetErrorString());
}
......
......@@ -60,7 +60,7 @@ public:
Ghoul_Enrage(CombatEntity* owner) : Skill(owner)
{
id = 1002;
valLow = valHigh = 1.3f;
valLow = valHigh = 0.75f;
type = AbilityType::Buff;
};
void Activate()
......
# Blender MTL File: 'None'
# Material Count: 1
newmtl stone_ceiling
Ns 200.200000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.700000 0.700000 0.700000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
map_Kd stone_ceiling.png
map_Kn stone_ceilingNormal.tif
\ No newline at end of file
# Blender v2.81 (sub 16) OBJ File: ''
# www.blender.org
mtllib stone_ceiling.mtl
o Plane
v -1.000000 0.000000 1.000000
v 1.000000 0.000000 1.000000
v -1.000000 0.000000 -1.000000
v 1.000000 0.000000 -1.000000
vt 0.999900 0.999900
vt 0.000100 0.000100
vt 0.999900 0.000100
vt 0.000100 0.999900
vn 0.0000 1.0000 0.0000
usemtl stone_ceiling
s off
f 2/1/1 3/2/1 1/3/1
f 2/1/1 4/4/1 3/2/1
# Blender MTL File: 'None'
# Material Count: 1
newmtl StoneFloor
newmtl stone_floor
Ns 200.200000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
......@@ -10,5 +10,5 @@ Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
map_Kd StoneFloor.png
map_Kn StoneFloorNormal.tif
\ No newline at end of file
map_Kd stone_floor.png
map_Kn stone_floorNormal.tif
\ No newline at end of file
# Blender v2.81 (sub 16) OBJ File: ''
# www.blender.org
mtllib BrickWall.mtl
mtllib stone_floor.mtl
o Plane
v -1.000000 0.000000 1.000000
v 1.000000 0.000000 1.000000
......@@ -11,7 +11,7 @@ vt 0.000100 0.000100
vt 0.999900 0.000100
vt 0.000100 0.999900
vn 0.0000 1.0000 0.0000
usemtl StoneWall
usemtl stone_floor
s off
f 2/1/1 3/2/1 1/3/1
f 2/1/1 4/4/1 3/2/1
# Blender MTL File: 'None'
# Material Count: 1
newmtl StoneWall
newmtl stone_wall
Ns 15.200000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
......@@ -10,5 +10,5 @@ Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
map_Kd BrickWall.png
map_Kn BrickWallNormal.tif
\ No newline at end of file
map_Kd stone_wall.png
map_Kn stone_wallNormal.tif
\ No newline at end of file
# Blender v2.81 (sub 16) OBJ File: ''
# www.blender.org
mtllib StoneFloor.mtl
mtllib stone_wall.mtl
o Plane
v -1.000000 0.000000 1.000000
v 1.000000 0.000000 1.000000
......@@ -11,7 +11,7 @@ vt 0.000100 0.000100
vt 0.999900 0.000100
vt 0.000100 0.999900
vn 0.0000 1.0000 0.0000
usemtl StoneFloor
usemtl stone_wall
s off
f 2/1/1 3/2/1 1/3/1
f 2/1/1 4/4/1 3/2/1
......@@ -131,6 +131,7 @@ bool Menu::Update(Keyboard::Event in_event)
{
SetPressedKey(Key::W);
cm.ChoseBandage();
cm.GetPlayerManager().Heal(size_t((cm.GetPlayerManager().GetmaxHP() - cm.GetPlayerManager().GetHP()) * 0.1f)); //heal for 10% of missing hp
mState = MenuState::Inactive;
}
if (code == 'A')
......
......@@ -57,6 +57,31 @@ bool PlayerManager::UpgradeRandomSkill()
return actionBox.UpgradeRandomSkill();
}
void PlayerManager::Reset()
{
HP = 300u;
maxHP = 300u;
block = 0u;
baseCrit = 0.0f;
baseDodge = 0.0f;
baseTurnTime = 10.0f;
activeStatusEffects[StatusEffects::CritChance].first = baseCrit;
activeStatusEffects[StatusEffects::Dodge].first = baseDodge;
skillPool.clear();
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<SandStorm>(this));
skillPool.push_back(std::make_unique<SharpenTheBlade>(this));
skillPool.push_back(std::make_unique<SandsOfTime>(this));
skillPool.push_back(std::make_unique<DustThrow>(this));
actionBox.Reset();
CureBleed();
speed = 1.0f;
isDead = false;
}
void PlayerManager::SufferPhysicalDamage(size_t incDmg)
{
if (incDmg < HP + block) //if does not kill
......
......@@ -40,6 +40,8 @@ public:
void DumpTemporaryStatus() override;
bool UpgradeRandomSkill(); //returns true if all skills are upgraded
void Reset();
private:
void ResetTimePool();
......
......@@ -144,6 +144,10 @@ public:
{
SPI::Play(Sounds::Dust_Throw, 1.4f, 0.8f);
owner->AddEvent(SkillEvent(EventType::Enemy_DecreaceAcc, valLow, valHigh));
if (upgraded)
{
owner->AddEvent(SkillEvent(EventType::Enemy_PhysicalDamage, dmg, dmg));
}
//std::unique_ptr<scenarios::dustThrowScenario> scen = std::make_unique<scenarios::dustThrowScenario>();
//MainScene::AddScenario(std::move(scen));
}
......@@ -151,6 +155,6 @@ public:
{
upgraded = true;
valLow = valHigh = 0.3f;
rewinding = true;
}
static constexpr float dmg = 5.0f;
};
\ No newline at end of file