Player Equipment set effect tests added.

mac-build
sigonasr2 5 months ago
parent 5193f382a3
commit 6410d837c7
  1. 44
      Adventures in Lestoria Tests/PlayerTests.cpp
  2. 8
      Adventures in Lestoria/Player.cpp
  3. 2
      Adventures in Lestoria/Version.h

@ -161,5 +161,49 @@ namespace PlayerTests
player->Hurt(30,player->OnUpperLevel(),player->GetZ()); player->Hurt(30,player->OnUpperLevel(),player->GetZ());
Assert::AreEqual(74,player->GetHealth()); //Even though we are supposed to take 30 damage, damage reduction reduces it to 26 instead. (Random variance is controlled during testing. If this number changes at some point, either the damage formula or the item's stats have changed!) Assert::AreEqual(74,player->GetHealth()); //Even though we are supposed to take 30 damage, damage reduction reduces it to 26 instead. (Random variance is controlled during testing. If this number changes at some point, either the damage formula or the item's stats have changed!)
} }
TEST_METHOD(PlayerSetEffectsAcknowledged){
std::weak_ptr<Item>setArmor{Inventory::AddItem("Test Armor"s)};
setArmor.lock()->enhancementLevel="Item.Item Max Enhancement Level"_I; //Force enhance the item to the max enhancement level.
Inventory::EquipItem(setArmor,EquipSlot::ARMOR);
//This gear is supposed to be provide an additional 100 defense, 1000 health, and 100 attack.
Assert::AreEqual(100.f+player->GetBaseStat("Defense"),player->GetStat("Defense"));
Assert::AreEqual(100.f+player->GetBaseStat("Attack"),player->GetStat("Attack"));
Assert::AreEqual(1000.f+player->GetBaseStat("Health"),player->GetStat("Health"));
}
TEST_METHOD(PlayerSetEffectsAcknowledged2){
std::weak_ptr<Item>setArmor{Inventory::AddItem("Test Armor2"s)};
setArmor.lock()->enhancementLevel="Item.Item Max Enhancement Level"_I; //Force enhance the item to the max enhancement level.
Inventory::EquipItem(setArmor,EquipSlot::ARMOR);
//This gear is supposed to be provide an additional 100 defense, 1000 health, and 100 attack.
Assert::AreEqual(100.f+player->GetBaseStat("Defense %"),player->GetStat("Defense %"));
Assert::AreEqual(100.f+player->GetBaseStat("Attack %"),player->GetStat("Attack %"));
Assert::AreEqual(100.f+player->GetBaseStat("Move Spd %"),player->GetStat("Move Spd %"));
Assert::AreEqual(100.f+player->GetBaseStat("CDR"),player->GetStat("CDR"));
Assert::AreEqual(100.f+player->GetBaseStat("Crit Rate"),player->GetStat("Crit Rate"));
Assert::AreEqual(100.f+player->GetBaseStat("Crit Dmg"),player->GetStat("Crit Dmg"));
Assert::AreEqual(100.f+player->GetBaseStat("Health %"),player->GetStat("Health %"));
Assert::AreEqual(100.f+player->GetBaseStat("HP6 Recovery %"),player->GetStat("HP6 Recovery %"));
}
TEST_METHOD(PlayerSetEffectsAcknowledged3){
std::weak_ptr<Item>setArmor{Inventory::AddItem("Test Armor3"s)};
setArmor.lock()->enhancementLevel="Item.Item Max Enhancement Level"_I; //Force enhance the item to the max enhancement level.
Inventory::EquipItem(setArmor,EquipSlot::ARMOR);
//This gear is supposed to be provide an additional 100 defense, 1000 health, and 100 attack.
Assert::AreEqual(100.f+player->GetBaseStat("HP4 Recovery %"),player->GetStat("HP4 Recovery %"));
Assert::AreEqual(100.f+player->GetBaseStat("Damage Reduction"),player->GetStat("Damage Reduction"));
}
TEST_METHOD(PlayerSetEffectsAcknowledged4){
std::weak_ptr<Item>setArmor{Inventory::AddItem("Test Armor4"s)};
setArmor.lock()->enhancementLevel="Item.Item Max Enhancement Level"_I; //Force enhance the item to the max enhancement level.
Inventory::EquipItem(setArmor,EquipSlot::ARMOR);
//This gear is supposed to be provide an additional 100 defense, 1000 health, and 100 attack.
Assert::AreEqual(100.f+player->GetBaseStat("HP Recovery %"),player->GetStat("HP Recovery %"));
Assert::AreEqual(50.f+player->GetBaseStat("Attack Spd"),player->GetStat("Attack Spd"));
Assert::AreEqual(100.f+player->GetBaseStat("Mana"),player->GetStat("Mana"));
}
}; };
} }

@ -98,8 +98,8 @@ Player::Player(Player*player)
void Player::Initialize(){ void Player::Initialize(){
Player::GROUND_SLAM_SPIN_TIME="Warrior.Ability 2.SpinTime"_F; Player::GROUND_SLAM_SPIN_TIME="Warrior.Ability 2.SpinTime"_F;
SetBaseStat("Health",hp); SetBaseStat("Health","Warrior.BaseHealth"_I);
SetBaseStat("Mana",mana); SetBaseStat("Mana","Player.BaseMana"_I);
SetBaseStat("Defense",0); SetBaseStat("Defense",0);
SetBaseStat("Attack","Warrior.BaseAtk"_I); SetBaseStat("Attack","Warrior.BaseAtk"_I);
SetBaseStat("Move Spd %",100); SetBaseStat("Move Spd %",100);
@ -108,6 +108,10 @@ void Player::Initialize(){
SetBaseStat("Crit Dmg","Player.Crit Dmg"_F); SetBaseStat("Crit Dmg","Player.Crit Dmg"_F);
SetBaseStat("Health %",0); SetBaseStat("Health %",0);
SetBaseStat("HP6 Recovery %",0); SetBaseStat("HP6 Recovery %",0);
SetBaseStat("HP4 Recovery %",0);
SetBaseStat("HP Recovery %",0);
SetBaseStat("Damage Reduction",0);
SetBaseStat("Attack Spd",0);
cooldownSoundInstance=Audio::Engine().LoadSound("spell_cast.ogg"_SFX); cooldownSoundInstance=Audio::Engine().LoadSound("spell_cast.ogg"_SFX);
} }

@ -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 9849 #define VERSION_BUILD 9851
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

Loading…
Cancel
Save