diff --git a/Crawler/Ability.cpp b/Crawler/Ability.cpp index 55fab209..748a394b 100644 --- a/Crawler/Ability.cpp +++ b/Crawler/Ability.cpp @@ -1,5 +1,5 @@ #include "Ability.h" Ability::Ability(){}; -Ability::Ability(std::string name,float cooldownTime,int manaCost,Pixel barColor1,Pixel barColor2) - :name(name),cooldown(0),COOLDOWN_TIME(cooldownTime),manaCost(manaCost),barColor1(barColor1),barColor2(barColor2){} \ No newline at end of file +Ability::Ability(std::string name,float cooldownTime,int manaCost,Pixel barColor1,Pixel barColor2,bool precastTargetingRequired) + :name(name),cooldown(0),COOLDOWN_TIME(cooldownTime),manaCost(manaCost),barColor1(barColor1),barColor2(barColor2),precastTargetingRequired(precastTargetingRequired){} \ No newline at end of file diff --git a/Crawler/Ability.h b/Crawler/Ability.h index d791a4f7..9f09536c 100644 --- a/Crawler/Ability.h +++ b/Crawler/Ability.h @@ -8,7 +8,8 @@ struct Ability{ float COOLDOWN_TIME=0; int manaCost=0; Pixel barColor1,barColor2; + bool precastTargetingRequired; std::functionaction=[&](){return false;}; Ability(); - Ability(std::string name,float cooldownTime,int manaCost,Pixel barColor1=VERY_DARK_RED,Pixel barColor2=DARK_RED); + Ability(std::string name,float cooldownTime,int manaCost,Pixel barColor1=VERY_DARK_RED,Pixel barColor2=DARK_RED,bool precastTargetingRequired=false); }; \ No newline at end of file diff --git a/Crawler/Crawler.cpp b/Crawler/Crawler.cpp index c82f6bd7..e0202df8 100644 --- a/Crawler/Crawler.cpp +++ b/Crawler/Crawler.cpp @@ -709,7 +709,7 @@ void Crawler::RenderHud(){ GradientFillRectDecal(vf2d{ScreenWidth()/2-90.f,ScreenHeight()-88.f},{(timer/totalTime)*180,16},{247,125,37},{247,125,37},{247,184,37},{247,184,37}); std::stringstream castTimeDisplay; castTimeDisplay<GetKey(SHIFT).bPressed){ notEnoughManaDisplay={ability1.name,1}; diff --git a/Crawler/Player.h b/Crawler/Player.h index eee3ce0a..0a79addb 100644 --- a/Crawler/Player.h +++ b/Crawler/Player.h @@ -69,6 +69,7 @@ protected: Key facingDirection; float swordSwingTimer=0; void CastSpell(std::string name,float castTotalTime); + public: Player(); //So this is rather fascinating and only exists because we have the ability to change classes which means we need to initialize a class diff --git a/Crawler/State.h b/Crawler/State.h index 87c29961..1f73640d 100644 --- a/Crawler/State.h +++ b/Crawler/State.h @@ -10,5 +10,6 @@ enum State{ BLOCK, TELEPORT, PATH_AROUND, - CASTING + CASTING, + PREP_CAST, }; \ No newline at end of file diff --git a/Crawler/Wizard.cpp b/Crawler/Wizard.cpp index 95f2d394..98a5c765 100644 --- a/Crawler/Wizard.cpp +++ b/Crawler/Wizard.cpp @@ -15,7 +15,7 @@ Class Wizard::cl=WIZARD; Ability Wizard::rightClickAbility={"Teleport",8,5,VERY_DARK_BLUE,DARK_BLUE}; Ability Wizard::ability1={"Firebolt",6,30}; Ability Wizard::ability2={"Lightning Bolt",6,25}; -Ability Wizard::ability3={"Meteor",40,75}; +Ability Wizard::ability3={"Meteor",40,75,VERY_DARK_RED,VERY_DARK_RED,true}; Ability Wizard::ability4={"???",0,0}; AnimationState Wizard::idle_n=WIZARD_IDLE_N; AnimationState Wizard::idle_e=WIZARD_IDLE_E; @@ -120,7 +120,6 @@ void Wizard::InitializeClassAbilities(){ #pragma region Wizard Ability 3 (Meteor) Wizard::ability3.action= [&](){ - SetState(State::CASTING); CastSpell("Meteor",1.5); game->AddEffect(std::make_unique(GetPos(),3,AnimationState::METEOR,OnUpperLevel(),vf2d{1,1},2)); return true;