diff --git a/Adventures in Lestoria Tests/EnchantTests.cpp b/Adventures in Lestoria Tests/EnchantTests.cpp index 128cc751..96e8a2a4 100644 --- a/Adventures in Lestoria Tests/EnchantTests.cpp +++ b/Adventures in Lestoria Tests/EnchantTests.cpp @@ -721,5 +721,34 @@ namespace EnchantTests Assert::AreEqual("Thief.Auto Attack.Cooldown"_F*"Thief.Ability 3.Attack Speed Increase"_F/100.f,player->GetAttackRecoveryRateReduction(),L"Adrenaline Stim still boosts attack rate normally."); Assert::AreEqual("Thief.Auto Attack.Range"_F+"Thief.Auto Attack.Range"_F*"Adrenaline Stim"_ENC["ATTACK RANGE INCREASE PCT"]/100.f,player->GetAttackRange(),L"Adrenaline Stim boosts attack range."); } + TEST_METHOD(BloodlustCheck){ + testKey->bHeld=true; //Force the key to be held down for testing purposes. + game->ChangePlayerClass(THIEF); + player=game->GetPlayer(); + player->SetBaseStat("Attack",100); + player->CheckAndPerformAbility(player->GetAbility3(),testKeyboardInput); + + MonsterData testMonsterData{"TestName","Test Monster",30,10,5,{MonsterDropData{"Health Potion",100.f,1,1}},200.f}; + MONSTER_DATA["TestName"]=testMonsterData; + for(int i:std::ranges::iota_view(0,10)){ + Monster testMonster{{},MONSTER_DATA["TestName"]}; + testMonster.Hurt(1000,testMonster.OnUpperLevel(),testMonster.GetZ()); + } + Assert::AreEqual(100,player->GetAttack(),L"Bloodlust's bonus attack should not be applying here."); + Assert::AreEqual("Thief.Ability 3.Duration"_F,player->GetBuffs(BuffType::ADRENALINE_RUSH)[0].duration,L"Bloodlust's duration increase should not be applying here."); + player->RestoreMana(100); + player->RemoveAllBuffs(); + Thief::ability3.charges=1; + std::weak_ptrnullRing{Inventory::AddItem("Null Ring"s)}; + Inventory::EquipItem(nullRing,EquipSlot::RING1); + nullRing.lock()->EnchantItem("Bloodlust"); + player->CheckAndPerformAbility(player->GetAbility3(),testKeyboardInput); + for(int i:std::ranges::iota_view(0,30)){ + Monster testMonster{{},MONSTER_DATA["TestName"]}; + testMonster.Hurt(1000,testMonster.OnUpperLevel(),testMonster.GetZ()); + } + Assert::AreEqual(110,player->GetAttack(),L"Bloodlust's bonus attacks stack only to 10."); + Assert::AreEqual("Thief.Ability 3.Duration"_F+"Bloodlust"_ENC["BUFF TIMER INCREASE"]*30,player->GetBuffs(BuffType::ADRENALINE_RUSH)[0].duration,L"Bloodlust's duration increases per kill."); + } }; } \ No newline at end of file diff --git a/Adventures in Lestoria/Buff.h b/Adventures in Lestoria/Buff.h index 3d235980..bded5aa8 100644 --- a/Adventures in Lestoria/Buff.h +++ b/Adventures in Lestoria/Buff.h @@ -50,7 +50,7 @@ enum BuffType{ FIXED_COLLISION_DMG, //Does a fixed amount of collision damage based on intensity of this buff. COLLISION_KNOCKBACK_STRENGTH, //Causes an amount of knockback based on intensity when hit via collision with this buff SELF_INFLICTED_SLOWDOWN, //Used for monsters and can't be applied by any player abilities. - ADRENALINE_RUSH, + ADRENALINE_RUSH, //Intensity indicates the stack count (used by the Bloodlust enchant) this buff gives which in turn increases attack. TRAPPER_MARK, OVER_TIME, ONE_OFF, diff --git a/Adventures in Lestoria/EnergyBolt.cpp b/Adventures in Lestoria/EnergyBolt.cpp index 83620f34..0893ad13 100644 --- a/Adventures in Lestoria/EnergyBolt.cpp +++ b/Adventures in Lestoria/EnergyBolt.cpp @@ -53,7 +53,7 @@ void EnergyBolt::Update(float fElapsedTime){ lastParticleSpawn="Wizard.Auto Attack.ParticleFrequency"_F; game->AddEffect(std::make_unique(pos,"Wizard.Auto Attack.ParticleLifetimeRange"_FRange,"energy_particle.png",upperLevel,"Wizard.Auto Attack.ParticleSizeRange"_FRange,"Wizard.Auto Attack.ParticleFadeoutTime"_F,vf2d{"Wizard.Auto Attack.ParticleSpeedRange"_FRange,"Wizard.Auto Attack.ParticleSpeedRange"_FRange})); } - if(distanceTraveled>"Wizard.Auto Attack.Max Range"_F&&IsActivated()){ + if(distanceTraveled>"Wizard.Auto Attack.Range"_F&&IsActivated()){ fadeOutTime="Wizard.Auto Attack.BulletHitFadeoutTime"_F; } } diff --git a/Adventures in Lestoria/FireBolt.cpp b/Adventures in Lestoria/FireBolt.cpp index 3118b059..1b9899ac 100644 --- a/Adventures in Lestoria/FireBolt.cpp +++ b/Adventures in Lestoria/FireBolt.cpp @@ -55,7 +55,7 @@ void FireBolt::Update(float fElapsedTime){ lastParticleSpawn="Wizard.Ability 1.ParticleFrequency"_F; game->AddEffect(std::make_unique(pos,"Wizard.Ability 1.ParticleLifetimeRange"_FRange,"energy_particle.png",upperLevel,"Wizard.Ability 1.ParticleSizeRange"_FRange,"Wizard.Ability 1.ParticleFadeoutTime"_F,vf2d{"Wizard.Ability 1.ParticleXSpeedRange"_FRange,"Wizard.Ability 1.ParticleYSpeedRange"_FRange},Pixel{uint8_t("Wizard.Ability 1.ParticleRedRange"_FRange),uint8_t("Wizard.Ability 1.ParticleGreenRange"_FRange),uint8_t("Wizard.Ability 1.ParticleBlueRange"_FRange),uint8_t("Wizard.Ability 1.ParticleAlphaRange"_FRange)})); } - if(distanceTraveled>"Wizard.Ability 1.Max Range"_F&&IsActivated()){ + if(distanceTraveled>"Wizard.Ability 1.Range"_F&&IsActivated()){ fadeOutTime="Wizard.Ability 1.BulletHitFadeoutTime"_F; for(int i=0;i<"Wizard.Ability 1.BulletHitExplosionParticleCount"_I;i++){ game->AddEffect(std::make_unique(pos,"Wizard.Ability 1.BulletHitExplosionParticleLifetimeRange"_FRange,"circle.png",upperLevel,"Wizard.Ability 1.BulletHitExplosionParticleSizeRange"_FRange,"Wizard.Ability 1.BulletHitExplosionParticleFadeoutTimeRange"_FRange,vf2d{"Wizard.Ability 1.BulletHitExplosionParticleSpeedRange"_FRange,"Wizard.Ability 1.BulletHitExplosionParticleSpeedRange"_FRange},Pixel{uint8_t("Wizard.Ability 1.BulletHitExplosionParticleRedRange"_FRange),uint8_t("Wizard.Ability 1.BulletHitExplosionParticleGreenRange"_FRange),uint8_t("Wizard.Ability 1.BulletHitExplosionParticleBlueRange"_FRange),uint8_t("Wizard.Ability 1.BulletHitExplosionParticleAlphaRange"_FRange)})); diff --git a/Adventures in Lestoria/LightningBolt.cpp b/Adventures in Lestoria/LightningBolt.cpp index 5d612909..f7289f5e 100644 --- a/Adventures in Lestoria/LightningBolt.cpp +++ b/Adventures in Lestoria/LightningBolt.cpp @@ -72,7 +72,7 @@ void LightningBolt::Update(float fElapsedTime){ }break; } } - if(distanceTraveled>"Wizard.Ability 2.Max Range"_F&&IsActivated()){ + if(distanceTraveled>"Wizard.Ability 2.Range"_F&&IsActivated()){ fadeOutTime="Wizard.Ability 2.BulletFadeoutTime"_F; } } diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index b7bec99a..4786ddfe 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -1011,6 +1011,11 @@ void Monster::OnDeath(){ if(strategyDeathFunc)GameEvent::AddEvent(std::make_unique(strategyDeathFunc,*this,MONSTER_DATA[name].GetAIStrategy())); if(game->GetPlayer()->HasEnchant("Reaper of Souls"))game->AddEffect(std::make_unique(GetPos(),0.3f,GetSizeMult(),vf2d{},WHITE,0.f,0.f,false)); + if(game->GetPlayer()->HasEnchant("Bloodlust")&&game->GetPlayer()->GetBuffs(BuffType::ADRENALINE_RUSH).size()>0){ + Buff&adrenalineRushBuff{game->GetPlayer()->EditBuff(BuffType::ADRENALINE_RUSH,0)}; + adrenalineRushBuff.duration+="Bloodlust"_ENC["BUFF TIMER INCREASE"]; + adrenalineRushBuff.intensity=std::min(int("Bloodlust"_ENC["MAX ATTACK BUFF STACKS"]),int(adrenalineRushBuff.intensity)+1); + } SpawnDrops(); diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index 39aa1650..8367e72f 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -274,8 +274,10 @@ const int Player::GetMaxMana()const{ } const int Player::GetAttack()const{ - int finalAtk{int(round(GetModdedStatBonuses("Attack")))}; + const int originalAtk{int(round(GetModdedStatBonuses("Attack")))}; + int finalAtk{originalAtk}; finalAtk+=LastReserveEnchantConditionsMet()?round(GetBaseStat("Attack")*"Last Reserve"_ENC["ATTACK PCT"]/100.f):0; + if(GetBuffs(BuffType::ADRENALINE_RUSH).size()>0)finalAtk+="Bloodlust"_ENC["ATTACK BUFF PCT INCREASE"]/100.f*originalAtk*int(GetBuffs(ADRENALINE_RUSH)[0].intensity); return finalAtk; } diff --git a/Adventures in Lestoria/PurpleEnergyBall.cpp b/Adventures in Lestoria/PurpleEnergyBall.cpp index b33c393d..2ed14dcd 100644 --- a/Adventures in Lestoria/PurpleEnergyBall.cpp +++ b/Adventures in Lestoria/PurpleEnergyBall.cpp @@ -62,7 +62,7 @@ void PurpleEnergyBall::Update(float fElapsedTime){ homingTarget.reset(); } }else homingTarget=Monster::GetNearestMonster(pos,"Witch.Auto Attack.Homing Range"_F,OnUpperLevel(),GetZ()); - if(distanceTraveled>"Witch.Auto Attack.Max Range"_F&&IsActivated()){ + if(distanceTraveled>"Witch.Auto Attack.Range"_F&&IsActivated()){ fadeOutTime="Witch.Auto Attack.BulletHitFadeoutTime"_F; } const vf2d energyBallScale{initialScale.lerp(initialScale*0.9f,cos(12*PI*game->GetRunTime())/2.f+0.5f)}; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index fac08010..19c904a8 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 10977 +#define VERSION_BUILD 10981 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/classes/Ranger.txt b/Adventures in Lestoria/assets/config/classes/Ranger.txt index f5b25106..0afa6f6b 100644 --- a/Adventures in Lestoria/assets/config/classes/Ranger.txt +++ b/Adventures in Lestoria/assets/config/classes/Ranger.txt @@ -23,6 +23,9 @@ Ranger ArrowSpd = 275 Sound = Ranger Auto Attack + + # NOTE: The Range property is not actually used for Rangers! This just silences an error where the game expects this value to exist! + Range = 100 } Right Click Ability { diff --git a/Adventures in Lestoria/assets/config/classes/Trapper.txt b/Adventures in Lestoria/assets/config/classes/Trapper.txt index 7d92b767..3da798f6 100644 --- a/Adventures in Lestoria/assets/config/classes/Trapper.txt +++ b/Adventures in Lestoria/assets/config/classes/Trapper.txt @@ -23,6 +23,9 @@ Trapper ArrowSpd = 275 Sound = Ranger Auto Attack + + # NOTE: The Range property is not actually used for Trappers! This just silences an error where the game expects this value to exist! + Range = 100 } Right Click Ability diff --git a/Adventures in Lestoria/assets/config/classes/Witch.txt b/Adventures in Lestoria/assets/config/classes/Witch.txt index 6161314d..c950b28b 100644 --- a/Adventures in Lestoria/assets/config/classes/Witch.txt +++ b/Adventures in Lestoria/assets/config/classes/Witch.txt @@ -26,7 +26,7 @@ Witch Homing Turning Radius = 225deg/sec # Maximum distance this attack will travel before it becomes deactivated. - Max Range = 1200 + Range = 1200 # When bullet makes contact, how fast the bullet will fade out. BulletHitFadeoutTime = 0.2s diff --git a/Adventures in Lestoria/assets/config/classes/Wizard.txt b/Adventures in Lestoria/assets/config/classes/Wizard.txt index 2f34beeb..f3bf5da9 100644 --- a/Adventures in Lestoria/assets/config/classes/Wizard.txt +++ b/Adventures in Lestoria/assets/config/classes/Wizard.txt @@ -22,7 +22,7 @@ Wizard CancelCast = 0 # Maximum distance this attack will travel before it becomes deactivated. - Max Range = 1000 + Range = 1000 # When bullet makes contact, how fast the bullet will fade out. BulletHitFadeoutTime = 0.2 diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 2a961ba0..3467e1da 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ