Add in Witch Transform ability setup. Afterimage setup with scanline removal animation effect for Transform ability. Release Build 10347.

mac-build
sigonasr2 4 months ago
parent 98208fb3e0
commit 8df671dcab
  1. 5
      Adventures in Lestoria/Adventures in Lestoria.vcxproj
  2. 37
      Adventures in Lestoria/Player.cpp
  3. 7
      Adventures in Lestoria/Player.h
  4. 2
      Adventures in Lestoria/PurpleEnergyBall.cpp
  5. 2
      Adventures in Lestoria/Version.h
  6. 6
      Adventures in Lestoria/Witch.cpp
  7. BIN
      x64/Release/Adventures in Lestoria.exe

@ -221,6 +221,7 @@
<AdditionalIncludeDirectories>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)</AdditionalIncludeDirectories>
<AdditionalOptions>/MP20 %(AdditionalOptions)</AdditionalOptions>
<TreatSpecificWarningsAsErrors>4099;5030;4715;4172;4834</TreatSpecificWarningsAsErrors>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@ -246,6 +247,7 @@
<AdditionalIncludeDirectories>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>
<AdditionalOptions>/MP20 %(AdditionalOptions)</AdditionalOptions>
<TreatSpecificWarningsAsErrors>4099;5030;4715;4172;4834</TreatSpecificWarningsAsErrors>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@ -275,6 +277,7 @@
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalOptions>/MP20 %(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>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>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -335,6 +338,7 @@
<ClCompile>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalIncludeDirectories>C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<PostBuildEvent>
<Command>powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File ../emscripten_build.ps1</Command>
@ -351,6 +355,7 @@
<ClCompile>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalIncludeDirectories>C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<PostBuildEvent>
<Command>powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File ../emscripten_debug_build.ps1</Command>

@ -57,6 +57,8 @@ All rights reserved.
#include "GameSettings.h"
#include "Unlock.h"
#include "Tutorial.h"
#include <ranges>
#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<std::string>&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;
}

@ -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::Animation<std::string>animation;
Animate2D::AnimationState internal_animState;
void AddAnimation(std::string state);
std::vector<Buff>buffList;
CastInfo castInfo={"",0};
@ -409,6 +408,12 @@ protected:
float footstepTimer=0.f;
float ySquishFactor{1.f};
size_t cooldownSoundInstance=std::numeric_limits<size_t>::max();
std::unique_ptr<Decal>afterImage;
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

@ -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;
}

@ -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

@ -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 (???)

Loading…
Cancel
Save