diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index d7b2ed05..d4811658 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -520,24 +520,34 @@ void Player::Update(float fElapsedTime){ } auto AllowedToCast=[&](Ability&ability){return !ability.precastInfo.precastTargetingRequired&&GetState()!=State::ANIMATION_LOCK;}; + auto HasEnoughOfItem=[&](Ability&ability){ + if(!ability.itemAbility)return true; + if(&ability==&item1&&game->GetLoadoutItem(0).lock()->Amt()>0)return true; + if(&ability==&item2&&game->GetLoadoutItem(1).lock()->Amt()>0)return true; + if(&ability==&item3&&game->GetLoadoutItem(2).lock()->Amt()>0)return true; + return false; + }; //If pressed is set to false, uses held instead. auto CheckAndPerformAbility=[&](Ability&ability,InputGroup key){ if(ability.name!="???"){ if(CanAct(ability)){ if(ability.cooldown==0&&GetMana()>=ability.manaCost){ if(key.Held()||key.Released()&&&ability==castPrepAbility&&GetState()==State::PREP_CAST){ + #pragma region Tutorial Defensive/Use Ability Tasks if(&ability==&rightClickAbility){ Tutorial::GetTask(TutorialTaskName::USE_DEFENSIVE).I(A::DEFENSIVE_COUNT)++; }else{ Tutorial::GetTask(TutorialTaskName::USE_ABILITIES).I(A::ABILITY_COUNT)++; } + #pragma endregion if(AllowedToCast(ability)&&ability.action(this,{})){ bool allowed=ability.actionPerformedDuringCast; ability.cooldown=ability.GetCooldownTime(); CancelCast(); ConsumeMana(ability.manaCost); }else - if(ability.precastInfo.precastTargetingRequired&&GetState()==State::NORMAL){ + if(ability.precastInfo.precastTargetingRequired&&GetState()==State::NORMAL + &&HasEnoughOfItem(ability)){ PrepareCast(ability); } } diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 5897aa30..ba6e4f8a 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 0 #define VERSION_MINOR 5 #define VERSION_PATCH 0 -#define VERSION_BUILD 7997 +#define VERSION_BUILD 7998 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index edcdd4ef..ba25b5d7 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ