Implement Bloodlust enchant. Fix crash that occurs if the player class is not Warrior or Thief. Release Build 10981.

mac-build
sigonasr2 4 months ago
parent c017c353db
commit 012f5de2a1
  1. 29
      Adventures in Lestoria Tests/EnchantTests.cpp
  2. 2
      Adventures in Lestoria/Buff.h
  3. 2
      Adventures in Lestoria/EnergyBolt.cpp
  4. 2
      Adventures in Lestoria/FireBolt.cpp
  5. 2
      Adventures in Lestoria/LightningBolt.cpp
  6. 5
      Adventures in Lestoria/Monster.cpp
  7. 4
      Adventures in Lestoria/Player.cpp
  8. 2
      Adventures in Lestoria/PurpleEnergyBall.cpp
  9. 2
      Adventures in Lestoria/Version.h
  10. 3
      Adventures in Lestoria/assets/config/classes/Ranger.txt
  11. 3
      Adventures in Lestoria/assets/config/classes/Trapper.txt
  12. 2
      Adventures in Lestoria/assets/config/classes/Witch.txt
  13. 2
      Adventures in Lestoria/assets/config/classes/Wizard.txt
  14. BIN
      x64/Release/Adventures in Lestoria.exe

@ -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.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."); 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_ptr<Item>nullRing{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.");
}
}; };
} }

@ -50,7 +50,7 @@ enum BuffType{
FIXED_COLLISION_DMG, //Does a fixed amount of collision damage based on intensity of this buff. 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 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. 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, TRAPPER_MARK,
OVER_TIME, OVER_TIME,
ONE_OFF, ONE_OFF,

@ -53,7 +53,7 @@ void EnergyBolt::Update(float fElapsedTime){
lastParticleSpawn="Wizard.Auto Attack.ParticleFrequency"_F; lastParticleSpawn="Wizard.Auto Attack.ParticleFrequency"_F;
game->AddEffect(std::make_unique<Effect>(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})); game->AddEffect(std::make_unique<Effect>(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; fadeOutTime="Wizard.Auto Attack.BulletHitFadeoutTime"_F;
} }
} }

@ -55,7 +55,7 @@ void FireBolt::Update(float fElapsedTime){
lastParticleSpawn="Wizard.Ability 1.ParticleFrequency"_F; lastParticleSpawn="Wizard.Ability 1.ParticleFrequency"_F;
game->AddEffect(std::make_unique<Effect>(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)})); game->AddEffect(std::make_unique<Effect>(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; fadeOutTime="Wizard.Ability 1.BulletHitFadeoutTime"_F;
for(int i=0;i<"Wizard.Ability 1.BulletHitExplosionParticleCount"_I;i++){ for(int i=0;i<"Wizard.Ability 1.BulletHitExplosionParticleCount"_I;i++){
game->AddEffect(std::make_unique<Effect>(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)})); game->AddEffect(std::make_unique<Effect>(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)}));

@ -72,7 +72,7 @@ void LightningBolt::Update(float fElapsedTime){
}break; }break;
} }
} }
if(distanceTraveled>"Wizard.Ability 2.Max Range"_F&&IsActivated()){ if(distanceTraveled>"Wizard.Ability 2.Range"_F&&IsActivated()){
fadeOutTime="Wizard.Ability 2.BulletFadeoutTime"_F; fadeOutTime="Wizard.Ability 2.BulletFadeoutTime"_F;
} }
} }

@ -1011,6 +1011,11 @@ void Monster::OnDeath(){
if(strategyDeathFunc)GameEvent::AddEvent(std::make_unique<MonsterStrategyGameEvent>(strategyDeathFunc,*this,MONSTER_DATA[name].GetAIStrategy())); if(strategyDeathFunc)GameEvent::AddEvent(std::make_unique<MonsterStrategyGameEvent>(strategyDeathFunc,*this,MONSTER_DATA[name].GetAIStrategy()));
if(game->GetPlayer()->HasEnchant("Reaper of Souls"))game->AddEffect(std::make_unique<MonsterSoul>(GetPos(),0.3f,GetSizeMult(),vf2d{},WHITE,0.f,0.f,false)); if(game->GetPlayer()->HasEnchant("Reaper of Souls"))game->AddEffect(std::make_unique<MonsterSoul>(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(); SpawnDrops();

@ -274,8 +274,10 @@ const int Player::GetMaxMana()const{
} }
const int Player::GetAttack()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; 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; return finalAtk;
} }

@ -62,7 +62,7 @@ void PurpleEnergyBall::Update(float fElapsedTime){
homingTarget.reset(); homingTarget.reset();
} }
}else homingTarget=Monster::GetNearestMonster(pos,"Witch.Auto Attack.Homing Range"_F,OnUpperLevel(),GetZ()); }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; fadeOutTime="Witch.Auto Attack.BulletHitFadeoutTime"_F;
} }
const vf2d energyBallScale{initialScale.lerp(initialScale*0.9f,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)};

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_PATCH 3 #define VERSION_PATCH 3
#define VERSION_BUILD 10977 #define VERSION_BUILD 10981
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

@ -23,6 +23,9 @@ Ranger
ArrowSpd = 275 ArrowSpd = 275
Sound = Ranger Auto Attack 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 Right Click Ability
{ {

@ -23,6 +23,9 @@ Trapper
ArrowSpd = 275 ArrowSpd = 275
Sound = Ranger Auto Attack 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 Right Click Ability

@ -26,7 +26,7 @@ Witch
Homing Turning Radius = 225deg/sec Homing Turning Radius = 225deg/sec
# Maximum distance this attack will travel before it becomes deactivated. # 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. # When bullet makes contact, how fast the bullet will fade out.
BulletHitFadeoutTime = 0.2s BulletHitFadeoutTime = 0.2s

@ -22,7 +22,7 @@ Wizard
CancelCast = 0 CancelCast = 0
# Maximum distance this attack will travel before it becomes deactivated. # 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. # When bullet makes contact, how fast the bullet will fade out.
BulletHitFadeoutTime = 0.2 BulletHitFadeoutTime = 0.2

Loading…
Cancel
Save