diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj b/Adventures in Lestoria/Adventures in Lestoria.vcxproj index 7f6db988..27dcf3a1 100644 --- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj +++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj @@ -221,6 +221,7 @@ C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include;%(AdditionalIncludeDirectories) /MP20 %(AdditionalOptions) 4099;5030;4715;4172;4834 + true Console @@ -246,6 +247,7 @@ C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include /MP20 %(AdditionalOptions) 4099;5030;4715;4172;4834 + true Console @@ -275,6 +277,7 @@ stdcpp20 /MP20 %(AdditionalOptions) C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include + true Windows @@ -335,6 +338,7 @@ stdcpp20 C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files; + true powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File ../emscripten_build.ps1 @@ -351,6 +355,7 @@ stdcpp20 C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files; + true powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File ../emscripten_debug_build.ps1 diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index 8faba25c..6da9d399 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -57,6 +57,8 @@ All rights reserved. #include "GameSettings.h" #include "Unlock.h" #include "Tutorial.h" + +#include #ifndef __EMSCRIPTEN__ #include "steam/isteamuserstats.h" #endif @@ -113,6 +115,8 @@ void Player::Initialize(){ SetBaseStat("Damage Reduction",0); SetBaseStat("Attack Spd",0); cooldownSoundInstance=Audio::Engine().LoadSound("spell_cast.ogg"_SFX); + afterImage->sprite->Resize(24,24); + afterImage->Update(); } void Player::InitializeMinimapImage(){ @@ -751,6 +755,29 @@ void Player::Update(float fElapsedTime){ } daggerThrowWaitTimer-=fElapsedTime; #pragma endregion + #pragma region Witch + const auto RemoveScanLine=[&](uint8_t scanLine){ + for(int x:std::ranges::iota_view(0,afterImage->sprite->width)){ + afterImage->sprite->SetPixel({x,scanLine},BLANK); + } + afterImage->Update(); + }; + + //Scan Line goes through 1-23 (odd numbers) first, then 0-22. + const bool ScanLineFinished{scanLine==24U}; + if(!ScanLineFinished){ + removeLineTimer-=fElapsedTime; + if(removeLineTimer<=0.f){ + removeLineTimer=TIME_BETWEEN_LINE_REMOVALS; + RemoveScanLine(scanLine); + scanLine+=2; + if(scanLine>23&&scanLine%2==1){ + scanLine=0; + } + } + } + #pragma endregion + #pragma region Handle knockup timers if(knockUpTimer>0.f){ @@ -1773,4 +1800,14 @@ vf2d Player::MoveUsingPathfinding(vf2d targetPos){ const std::unordered_set&Player::GetMyClass()const{ return myClass; +} + +void Player::SetupAfterImage(){ + game->SetDrawTarget(afterImage->sprite); + game->Clear(BLANK); + game->DrawPartialSprite({},animation.GetFrame(internal_animState).GetSourceImage()->Sprite(),animation.GetFrame(internal_animState).GetSourceRect().pos,animation.GetFrame(internal_animState).GetSourceRect().size,1U,0U,{255,255,254}); //Off-white so that the sprite is rendered completely in white. + game->SetDrawTarget(nullptr); + afterImage->Update(); + removeLineTimer=TIME_BETWEEN_LINE_REMOVALS; + scanLine=1U; } \ No newline at end of file diff --git a/Adventures in Lestoria/Player.h b/Adventures in Lestoria/Player.h index b2464b75..cfb74eed 100644 --- a/Adventures in Lestoria/Player.h +++ b/Adventures in Lestoria/Player.h @@ -321,7 +321,6 @@ private: float teleportAttemptWaitTime=0; //If a teleport fails, we wait awhile before trying again, it's expensive. State::State state=State::NORMAL; Animate2D::Animationanimation; - Animate2D::AnimationState internal_animState; void AddAnimation(std::string state); std::vectorbuffList; CastInfo castInfo={"",0}; @@ -409,6 +408,12 @@ protected: float footstepTimer=0.f; float ySquishFactor{1.f}; size_t cooldownSoundInstance=std::numeric_limits::max(); + std::unique_ptrafterImage; + Animate2D::AnimationState internal_animState; + float removeLineTimer{}; + const float TIME_BETWEEN_LINE_REMOVALS{0.025f}; + uint8_t scanLine{24}; //0-23. + void SetupAfterImage(); }; #pragma region Warrior diff --git a/Adventures in Lestoria/PurpleEnergyBall.cpp b/Adventures in Lestoria/PurpleEnergyBall.cpp index 2e5adb18..b33c393d 100644 --- a/Adventures in Lestoria/PurpleEnergyBall.cpp +++ b/Adventures in Lestoria/PurpleEnergyBall.cpp @@ -65,7 +65,7 @@ void PurpleEnergyBall::Update(float fElapsedTime){ if(distanceTraveled>"Witch.Auto Attack.Max Range"_F&&IsActivated()){ fadeOutTime="Witch.Auto Attack.BulletHitFadeoutTime"_F; } - const vf2d energyBallScale{initialScale.lerp(initialScale*0.8f,cos(12*PI*game->GetRunTime())/2.f+0.5f)}; + const vf2d energyBallScale{initialScale.lerp(initialScale*0.9f,cos(12*PI*game->GetRunTime())/2.f+0.5f)}; scale=energyBallScale; } diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 0bc40504..41602d54 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define VERSION_PATCH 3 -#define VERSION_BUILD 10345 +#define VERSION_BUILD 10347 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/Witch.cpp b/Adventures in Lestoria/Witch.cpp index ffe99f63..78860bbf 100644 --- a/Adventures in Lestoria/Witch.cpp +++ b/Adventures in Lestoria/Witch.cpp @@ -63,7 +63,6 @@ void Witch::Initialize(){ SETUP_CLASS(Witch) void Witch::OnUpdate(float fElapsedTime){ - } bool Witch::AutoAttack(){ @@ -75,10 +74,11 @@ bool Witch::AutoAttack(){ return true; } void Witch::InitializeClassAbilities(){ - #pragma region Witch Right-click Ability (???) + #pragma region Witch Right-click Ability (Transform) Witch::rightClickAbility.action= [](Player*p,vf2d pos={}){ - return false; + p->SetupAfterImage(); + return true; }; #pragma endregion #pragma region Witch Ability 1 (???) diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index ff0e17ec..96f4004d 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ