Commit e40b5e08 authored by AL's avatar AL

a lot prettier

parent 7e312c40
......@@ -118,11 +118,11 @@ int CombatManager::ProcessInput(Keyboard::Event in_event) //why does it return
if (in_event.GetCode() == 'G') //for testing
{
EH::AddEffect3D(EH::Effect::PlayerSwordAttack);
SL::PendDistortion(SL::LightDistortionType::YellowSpark);
}
if (in_event.GetCode() == 'H') //for testing
{
EH::AddEffect3D(EH::Effect::GhoulAttack);
SL::PendDistortion(SL::LightDistortionType::GreenWave);
}
if (in_event.GetCode() == 'J') //for testing
......
......@@ -4,7 +4,7 @@
newmtl Enemy_hit
Ns 49.300000
Ka 1.000000 1.000000 1.000000
Kd 1.100000 2.900000 8.300000
Kd 4.100000 8.900000 35.300000
Ks 1.300000 0.700000 0.200000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
......
......@@ -2,10 +2,10 @@
# www.blender.org
mtllib Enemy_hit.mtl
o Plane
v -1.000000 0.000000 0.725000
v 0.450000 0.000000 0.725000
v -1.000000 0.000000 -0.725000
v 0.450000 0.000000 -0.725000
v -1.000000 0.000000 0.800000
v 0.600000 0.000000 0.800000
v -1.000000 0.000000 -0.800000
v 0.600000 0.000000 -0.800000
vt 0.999900 0.999900
vt 0.000100 0.000100
vt 0.999900 0.000100
......
......@@ -4,7 +4,7 @@
newmtl Player_SwordStrike
Ns 49.300000
Ka 1.000000 1.000000 1.000000
Kd 1.100000 2.900000 8.300000
Kd 4.100000 8.900000 35.300000
Ks 1.300000 0.700000 0.200000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
......
......@@ -2,10 +2,10 @@
# www.blender.org
mtllib Player_SwordStrike.mtl
o Plane
v -0.25000 0.000000 0.25000
v 0.25000 0.000000 0.25000
v -0.25000 0.000000 -0.25000
v 0.25000 0.000000 -0.25000
v -0.40000 0.000000 0.400000
v 0.40000 0.000000 0.400000
v -0.40000 0.000000 -0.40000
v 0.40000 0.000000 -0.400000
vt 0.999900 0.999900
vt 0.000100 0.000100
vt 0.999900 0.000100
......
......@@ -4,7 +4,7 @@
newmtl Player_SwordStrikeUpgraded
Ns 49.300000
Ka 1.000000 1.000000 1.000000
Kd 1.100000 2.900000 8.300000
Kd 4.100000 8.900000 35.300000
Ks 1.300000 0.700000 0.200000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
......
......@@ -2,10 +2,10 @@
# www.blender.org
mtllib Player_SwordStrikeUpgraded.mtl
o Plane
v -0.25000 0.000000 0.25000
v 0.25000 0.000000 0.25000
v -0.25000 0.000000 -0.25000
v 0.25000 0.000000 -0.25000
v -0.40000 0.000000 0.400000
v 0.40000 0.000000 0.400000
v -0.40000 0.000000 -0.40000
v 0.40000 0.000000 -0.400000
vt 0.999900 0.999900
vt 0.000100 0.000100
vt 0.999900 0.000100
......
......@@ -28,6 +28,7 @@ void SceneLight::UpdateAndBind(float dt, DXGraphics& gfx, DirectX::XMMATRIX came
{
currentDistortion = pendingDistortion;
currentDistortedTime = 0.0f;
if (currentDistortion == LightDistortionType::GreenWave|| currentDistortion == LightDistortionType::YellowSpark) currentDistortedTime+=0.7f; //reducing lifetime of some effects
pendingDistortion = LightDistortionType::NoDistortion;
}
if (currentDistortion != LightDistortionType::NoDistortion)
......@@ -60,7 +61,7 @@ void SceneLight::UpdateAndBind(float dt, DXGraphics& gfx, DirectX::XMMATRIX came
RU.GetFloat(bplb[2] - positionFlickerAmount * darkeningMod, bplb[2] + positionFlickerAmount * darkeningMod),
0.0f
};
endIntBuffer[i] = RU.GetFloat(baseIntBuffer[i] - intencityFlickerAmount * darkeningMod*2.0f, baseIntBuffer[i] - intencityFlickerAmount*2.0f);
endIntBuffer[i] = RU.GetFloat(baseIntBuffer[i] - intencityFlickerAmount *3.0f, baseIntBuffer[i] - intencityFlickerAmount);
float f = RU.GetFloat0to1(); //what color(red-to-yellow) will be target color for this flick
endDifBuffer[i] = _mm_add_ps(_mm_mul_ps(red, _mm_set1_ps(1.0f - f)), _mm_mul_ps(yellow, _mm_set1_ps(f)));
......@@ -94,6 +95,39 @@ void SceneLight::UpdateAndBind(float dt, DXGraphics& gfx, DirectX::XMMATRIX came
endDifBuffer[i] = _mm_mul_ps(red,_mm_setr_ps(coldColortModR, coldColortModG, coldColortModB, 1.0f));
break;
}
case SceneLight::LightDistortionType::GreenWave:
{
flickerEndPosLightBuffer[i] = {
basePosLightBuffer[i].m128_f32[0], //is not taking part in interpolation
RU.GetFloat(basePosLightBuffer[i].m128_f32[1] - positionFlickerAmount, basePosLightBuffer[i].m128_f32[1] + positionFlickerAmount),
RU.GetFloat(basePosLightBuffer[i].m128_f32[2] - positionFlickerAmount, basePosLightBuffer[i].m128_f32[2] + positionFlickerAmount),
0.0f
};
endIntBuffer[i] = RU.GetFloat(baseIntBuffer[i] - intencityFlickerAmount, baseIntBuffer[i] + intencityFlickerAmount);
float f = RU.GetFloat0to1(); //what color(red-to-yellow) will be target color for this flick
endDifBuffer[i] = _mm_add_ps(_mm_mul_ps(red, _mm_set1_ps(1.0f - f)), _mm_mul_ps(yellow, _mm_set1_ps(f)));
endDifBuffer[i].m128_f32[1] *= greenBoostMode;
break;
}
case SceneLight::LightDistortionType::YellowSpark:
{
flickerEndPosLightBuffer[i] = {
basePosLightBuffer[i].m128_f32[0], //is not taking part in interpolation
RU.GetFloat(basePosLightBuffer[i].m128_f32[1] - positionFlickerAmount, basePosLightBuffer[i].m128_f32[1] + positionFlickerAmount),
RU.GetFloat(basePosLightBuffer[i].m128_f32[2] - positionFlickerAmount, basePosLightBuffer[i].m128_f32[2] + positionFlickerAmount),
0.0f
};
endIntBuffer[i] = RU.GetFloat(baseIntBuffer[i] - intencityFlickerAmount, baseIntBuffer[i] + intencityFlickerAmount);
float f = RU.GetFloat0to1(); //what color(red-to-yellow) will be target color for this flick
endDifBuffer[i] = _mm_add_ps(_mm_mul_ps(red, _mm_set1_ps(1.0f - f)), _mm_mul_ps(yellow, _mm_set1_ps(f)));
endDifBuffer[i].m128_f32[0] *= yellowBoostMode;
endDifBuffer[i].m128_f32[1] *= yellowBoostMode;
break;
}
case SceneLight::LightDistortionType::NoDistortion:
{
flickerEndPosLightBuffer[i] = {
......
......@@ -15,6 +15,8 @@ public:
DarkeningFlicker,
RednessBoost,
ColdEmbrace,
YellowSpark,
GreenWave,
NoDistortion
};
SceneLight(DXGraphics& gfx);
......@@ -81,6 +83,10 @@ private:
static constexpr float redBoostMod = 3.0f;
static constexpr float redColortMod = 1.4f;
static constexpr float greenBoostMode = 1.5f;
static constexpr float yellowBoostMode = 1.5f;
static constexpr float coldMoveMod = 0.0f;
static constexpr float coldColortModR = 0.9f;
static constexpr float coldColortModG = 0.95f;
......
#include "Skills0.h"
#include "CameraManager.h"
#include "SceneLight.h"
DustThrow::DustThrow(CombatEntity* owner) : Skill(owner)
{
......@@ -26,8 +27,6 @@ void DustThrow::Activate()
}
AM::Alert(AM::Event::PLayerUsedDustThrow);
EH::AddEffect3D(EH::Effect::PlayerSandThrow);
//std::unique_ptr<scenarios::dustThrowScenario> scen = std::make_unique<scenarios::dustThrowScenario>();
//MainScene::AddScenario(std::move(scen));
}
void DustThrow::Upgrade()
......@@ -42,6 +41,8 @@ SandsOfTime::SandsOfTime(CombatEntity* owner) : Skill(owner)
valLow = valHigh = 0.15f;
quick = 1;
rewinding = 1;
preActTime = step0;
actTime = step0;
}
void SandsOfTime::Activate()
......@@ -56,12 +57,19 @@ void SandsOfTime::Upgrade()
valLow = valHigh = 0.3f;
}
void SandsOfTime::OnPend()
{
SL::PendDistortion(SL::LightDistortionType::GreenWave);
}
SharpenTheBlade::SharpenTheBlade(CombatEntity* owner) : Skill(owner)
{
id = 3;
valLow = valHigh = 0.55f;
quick = 1;
actTime = 0.35f;
preActTime = step0;
actTime = step0;
}
void SharpenTheBlade::Activate()
......@@ -80,6 +88,11 @@ void SharpenTheBlade::Upgrade()
valLow = valHigh = 0.6f;
}
void SharpenTheBlade::OnPend()
{
SL::PendDistortion(SL::LightDistortionType::YellowSpark);
}
SandStorm::SandStorm(CombatEntity* owner) : Skill(owner)
{
id = 2;
......@@ -94,8 +107,6 @@ void SandStorm::Activate()
owner->AddEvent(SkillEvent(EventType::Player_AddDodge, valLow, valHigh));
AM::Alert(AM::Event::PlayerUsedSandStorm);
EH::AddEffect3D(EH::Effect::PlayerSandStorm);
//std::unique_ptr<scenarios::sandStormScenario> scen = std::make_unique<scenarios::sandStormScenario>();
//MainScene::AddScenario(std::move(scen));
}
void SandStorm::Upgrade()
......@@ -171,4 +182,6 @@ float Deflect::step0 = 0.7f;
float SandStorm::step0 = 0.7f;
float SandStorm::step1 = 0.5f;
float DustThrow::step0 = 0.5f;
float DustThrow::step1 = 0.15f;
\ No newline at end of file
float DustThrow::step1 = 0.15f;
float SharpenTheBlade::step0 = 0.1f;
float SandsOfTime::step0 = 0.1f;
\ No newline at end of file
......@@ -58,18 +58,22 @@ public:
class SharpenTheBlade : public Skill
{
public:
static float step0;
SharpenTheBlade(CombatEntity* owner);;
void Activate() override;
void Upgrade() override;
void OnPend()override;
static constexpr float block = 5.0f;
};
class SandsOfTime : public Skill
{
public:
static float step0;
SandsOfTime(CombatEntity* owner);;
void Activate() override;
void Upgrade() override;
void OnPend()override;
};
class DustThrow : public Skill
......
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