diff --git a/Adventures in Lestoria Tests/EnchantTests.cpp b/Adventures in Lestoria Tests/EnchantTests.cpp index d82fda81..fbbeea18 100644 --- a/Adventures in Lestoria Tests/EnchantTests.cpp +++ b/Adventures in Lestoria Tests/EnchantTests.cpp @@ -572,5 +572,16 @@ namespace EnchantTests player->CheckAndPerformAbility(player->GetAbility1(),testKeyboardInput); Assert::AreEqual("Ranger.Ability 1.ArrowCount"_I+int("Extreme Rapid Fire"_ENC["ARROW COUNT INCREASE"]),player->RemainingRapidFireShots(),L"Player now has even more Rapid Fire shots."); } + TEST_METHOD(MegaChargedShotCheck){ + std::weak_ptrnullRing{Inventory::AddItem("Null Ring"s)}; + Inventory::EquipItem(nullRing,EquipSlot::RING1); + nullRing.lock()->EnchantItem("Extreme Rapid Fire"); + Assert::AreEqual("Warrior.Ability 2.Precast Time"_F,player->GetAbility2().precastInfo.castTime,L"Non-Ranger class' precast times should be unaffected with the item."); + game->ChangePlayerClass(RANGER); + player=game->GetPlayer(); + Assert::AreEqual("Ranger.Ability 2.Precast Time"_F+"Mega Charged Shot"_ENC["CAST TIME INCREASE"],player->GetAbility2().precastInfo.castTime,L"Ranger class' precast time should be affected with the item."); + Inventory::UnequipItem(EquipSlot::RING1); + Assert::AreEqual("Ranger.Ability 2.Precast Time"_F,player->GetAbility2().precastInfo.castTime,L"Ranger class' precast time should be back to normal."); + } }; } \ No newline at end of file diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index dec6ea71..abec8a34 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -1424,6 +1424,11 @@ void Player::RecalculateEquipStats(){ EquipSlot slot=EquipSlot(i); if(!ISBLANK(Inventory::GetEquip(slot))&&Inventory::GetEquip(slot).lock()->GetEnchant().has_value())enchantList.insert(Inventory::GetEquip(slot).lock()->GetEnchant().value().Name()); } + + if(GetClass()==RANGER){ + GetAbility2().precastInfo.castTime=Ranger::ability2.precastInfo.castTime; //This resets the cast time of this ability since it's possible for an enchant to modify it. + if(HasEnchant("Mega Charged Shot"))GetAbility2().precastInfo.castTime+="Mega Charged Shot"_ENC["CAST TIME INCREASE"]; + } } const std::vectorPlayer::GetStatBuffs(const std::vector&attr)const{ diff --git a/Adventures in Lestoria/Ranger.cpp b/Adventures in Lestoria/Ranger.cpp index f8b346e4..1a4f8876 100644 --- a/Adventures in Lestoria/Ranger.cpp +++ b/Adventures in Lestoria/Ranger.cpp @@ -130,7 +130,10 @@ void Ranger::InitializeClassAbilities(){ float beamRadius{12*"Ranger.Ability 2.Radius"_F/100}; if(p->HasEnchant("Charge Beam"))beamRadius*="Charge Beam"_ENC["ATTACK RADIUS INCREASE MULT"]; - BULLET_LIST.push_back(std::make_unique(p->GetPos(),arrowVelocity*"Ranger.Ability 2.Speed"_F,beamRadius,p->GetAttack()*"Ranger.Ability 2.DamageMult"_F,p->OnUpperLevel(),true)); + float damageMult{"Ranger.Ability 2.DamageMult"_F}; + if(p->HasEnchant("Mega Charged Shot"))damageMult*="Mega Charged Shot"_ENC["DAMAGE INCREASE MULT"]; + + BULLET_LIST.push_back(std::make_unique(p->GetPos(),arrowVelocity*"Ranger.Ability 2.Speed"_F,beamRadius,p->GetAttack()*damageMult,p->OnUpperLevel(),true)); p->SetState(State::SHOOT_ARROW); p->rangerShootAnimationTimer=0.3f; p->SetAnimationBasedOnTargetingDirection("SHOOT",atan2(arrowVelocity.y,arrowVelocity.x)); diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 1629c33c..1f17ad34 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 10824 +#define VERSION_BUILD 10827 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/items/ItemEnchants.txt b/Adventures in Lestoria/assets/config/items/ItemEnchants.txt index 58f31321..d96a8159 100644 --- a/Adventures in Lestoria/assets/config/items/ItemEnchants.txt +++ b/Adventures in Lestoria/assets/config/items/ItemEnchants.txt @@ -128,10 +128,11 @@ Item Enchants } Mega Charged Shot { - Description = "Charged Shot's cast time increases by {CAST TIME INCREASE} seconds. Now deals two times more damage." + Description = "Charged Shot's cast time increases by {CAST TIME INCREASE} seconds. Now deals {DAMAGE INCREASE MULT}x more damage." Affects = Ability 2 CAST TIME INCREASE = 1.5s + DAMAGE INCREASE MULT = 2x # Stat, Lowest, Highest Value # Stat Modifier[0] = ..., 0, 0 diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 777ef96c..ec4216a5 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ