Add new test config files. Add in test to read enchant modifiers for function GetModifiers(). Release Build 12193.
All checks were successful
Emscripten Build / Build_and_Deploy_Web_Build (push) Successful in 6m41s

This commit is contained in:
sigonasr2 2025-05-15 02:17:25 -05:00
parent bee8d6d306
commit 67ca0d168d
6 changed files with 137 additions and 2 deletions

View File

@ -126,6 +126,15 @@ namespace EnchantTests
Assert::AreEqual("Rapid Fire",player->GetAbility1().GetNameWithPlayerModifiers().c_str(),L"After unequipping Ability name should be back to normal with no modifiers applied.");
Assert::AreEqual("Shoots #45F9FFfour#FFFFFF arrows rapidly. Total Damage: #45F9FF52#FFFFFF.",player->GetAbility1().GetDescriptionWithPlayerModifiers().c_str(),L"After unequipping Ability descriptions should be back to normal with no modifiers applied.");
}
TEST_METHOD(AbilityDescriptionModifiersPopulateProperly){
ItemEnchantInfo::AbilityDescriptionModifiers modifiers{"Test Enchant"_ENC.GetModifiers()};
Assert::AreEqual("Test",(*modifiers.preName).c_str(),L"Pre-name reads in properly");
Assert::AreEqual("Enchant",(*modifiers.newName).c_str(),L"Replacement name reads in properly");
Assert::IsFalse(modifiers.postName.has_value(),L"Post-name should not have a value.");
Assert::AreEqual("Pre test",(*modifiers.preDescription).c_str(),L"Pre-description reads in properly");
Assert::AreEqual("My Description",(*modifiers.newDescription).c_str(),L"Replacement description reads in properly");
Assert::AreEqual("Post test",(*modifiers.postDescription).c_str(),L"Post-description reads in properly");
}
TEST_METHOD(HealthBoostCheck){
Assert::AreEqual(100,player->GetMaxHealth(),L"Player starts with 100 health.");
std::weak_ptr<Item>nullRing{Game::GiveAndEquipEnchantedRing("Aura of the Beast")};

View File

@ -179,7 +179,7 @@ AiL::AiL(bool testingMode){
utils::datafile::Read(DATA,ITEM_SET_CONFIG,',',datafile::OverwriteMode::OVERWRITE);
auto keys=DATA.GetProperty("ItemConfiguration");
for(auto&[key,value]:keys){
std::string config=DATA["ItemConfiguration"][key].GetString();
std::string config=DATA["ItemConfiguration"][key].GetString();
utils::datafile::Read(DATA,CONFIG_PATH + "item_directory"_S + config,',',datafile::OverwriteMode::OVERWRITE);
}
}

View File

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_PATCH 0
#define VERSION_BUILD 12192
#define VERSION_BUILD 12193
#define stringify(a) stringify_(a)
#define stringify_(a) #a

View File

@ -7,6 +7,9 @@ ItemConfiguration
Equipment = Equipment.txt
Weapons = Weapons.txt
Accessories = Accessories.txt
# Item enchants unit testing config
Item Enchants Test Config = ItemEnchants-test.txt
}
Item
{

View File

@ -0,0 +1,88 @@
Fragment Description = "A small piece of concentrated material from broken down jewelry."
# Number of fragments earned when breaking down an accessory.
Fragment Disassemble Gain Amount = 1
# Number of fragments and gold required to Refine an accessory.
Fragment Refine Cost = 1, 20g
# Number of fragments and gold required to Enchant an accessory.
Fragment Enchant Cost = 3, 35g
# How much to increase refined stats by with each refinement. (Ex. if the value is 20%, it takes 5 refinements at most from an item with the lowest possible stat to the max stat with 20% increments.)
Refine Stat Increase Amount = 20%
Equipment
{
Ring of the Slime King
{
Slot = Ring1,Ring2
ItemCategory = Accessories
Fragment Name = Slime King Ring Fragment
# Uncomment to specify a custom icon for this fragment. Otherwise uses the default fragment icon with auto-detected color sampling.
#Fragment Icon = MyIcon.png
# See ItemStats.txt for valid stat names
StatValues = Health,Mana,Move Spd %
MinStats = 5,1,1
MaxStats = 20,4,3
SellValue = 90
Equip Sound = Equip Accessory
}
Ring of the Bear
{
Slot = Ring1,Ring2
ItemCategory = Accessories
Fragment Name = Bear Ring Fragment
# See ItemStats.txt for valid stat names
StatValues = Health,Attack,Mana
MinStats = 4,1,1
MaxStats = 10,4,3
SellValue = 75
Equip Sound = Equip Accessory
}
Stone Ring
{
Slot = Ring1,Ring2
ItemCategory = Accessories
Fragment Name = Stone Ring Fragment
# See ItemStats.txt for valid stat names
StatValues = Defense,Health,Health %
MinStats = 5,10,1
MaxStats = 15,25,3
SellValue = 130
Equip Sound = Equip Accessory
}
Bird's Treasure
{
Slot = Ring1,Ring2
ItemCategory = Accessories
Fragment Name = Bird's Treasure Fragment
# See ItemStats.txt for valid stat names
StatValues = Move Spd %,Crit Rate,Mana
MinStats = 1,1,2
MaxStats = 5,3,5
SellValue = 110
Equip Sound = Equip Accessory
}
Null Ring
{
Slot = Ring1,Ring2
ItemCategory = Accessories
Fragment Name = Null Ring Fragment
SellValue = 110
Equip Sound = Equip Accessory
}
}

View File

@ -0,0 +1,35 @@
Item Enchants
{
General Enchants
{
}
Class Enchants
{
Ranger
{
Test Enchant
{
Description = "A test enchant"
Affects = Ability 1
Ability Settings
{
# Add variables here to modify what the ability's original description might state.
# Use "Pre-Description" and "Post-Description" keys to add to the front or back of a current description string.
# Use "Description" key to completely overwrite the default description (be careful of conflicts with another modification!)
# Use "Pre-Name" and "Post-Name" keys to add to the front or back of a current ability name.
# Use "Name" to completely overwrite the default ability name (be careful of conflicts with another modification!)
Pre-Name = Test
Name = Enchant
Pre-Description = "Pre test"
Description = "My Description"
Post-Description = "Post test"
}
}
}
}
Unique Enchants
{
}
}