From 1fe27dce953e83bd563f5806b9173a193ae9d29b Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Wed, 26 Mar 2025 21:54:47 -0500 Subject: [PATCH] Pirate's Treasure Locked state added. Begin populating new item description and enchant structures. --- Adventures in Lestoria Tests/EnchantTests.cpp | 4 +++ Adventures in Lestoria/ItemEnchant.cpp | 6 ++++- Adventures in Lestoria/ItemEnchant.h | 12 +++++++++ Adventures in Lestoria/Pirates_Treasure.cpp | 27 ++++++++++++++----- .../assets/config/Monsters.txt | 4 +-- .../assets/config/classes/Ranger.txt | 5 +++- .../assets/config/items/ItemEnchants.txt | 12 +++++++++ 7 files changed, 59 insertions(+), 11 deletions(-) diff --git a/Adventures in Lestoria Tests/EnchantTests.cpp b/Adventures in Lestoria Tests/EnchantTests.cpp index 877165f0..919b8744 100644 --- a/Adventures in Lestoria Tests/EnchantTests.cpp +++ b/Adventures in Lestoria Tests/EnchantTests.cpp @@ -113,6 +113,10 @@ namespace EnchantTests testGame->OnUserUpdate(0.f); testGame.reset(); } + TEST_METHOD(EnchantAbilitySettingsReadProperly){ + Assert::AreEqual(false,ItemEnchant{"Health Boost"}.HasAbilityDescriptionModifiers(),L"Health Boost should not have any modifiers attached to it (doesn't modify a skill)"); + Assert::AreEqual(true,ItemEnchant{"Extreme Rapid Fire"}.HasAbilityDescriptionModifiers(),L"Extreme Rapid Fire should have ability description modifiers attached to it"); + } TEST_METHOD(HealthBoostCheck){ Assert::AreEqual(100,player->GetMaxHealth(),L"Player starts with 100 health."); std::weak_ptrnullRing{Game::GiveAndEquipEnchantedRing("Aura of the Beast")}; diff --git a/Adventures in Lestoria/ItemEnchant.cpp b/Adventures in Lestoria/ItemEnchant.cpp index 08e03e54..f445be0c 100644 --- a/Adventures in Lestoria/ItemEnchant.cpp +++ b/Adventures in Lestoria/ItemEnchant.cpp @@ -350,4 +350,8 @@ const bool ItemEnchant::HasAttributes()const{ const std::optional&ItemEnchant::GetClass()const{ return ItemEnchantInfo::GetEnchant(Name()).GetClass(); -} \ No newline at end of file +} + +const std::string ItemEnchant::GetModifiedDescription()const{ + +} diff --git a/Adventures in Lestoria/ItemEnchant.h b/Adventures in Lestoria/ItemEnchant.h index 37bdb424..42e5fd57 100644 --- a/Adventures in Lestoria/ItemEnchant.h +++ b/Adventures in Lestoria/ItemEnchant.h @@ -120,10 +120,22 @@ public: const Pixel&DisplayCol()const; const std::optional>Ability()const; const std::optional&GetClass()const; + const std::string GetModifiedName()const; //The finalized modified ability name. + const std::string GetModifiedDescription()const; //The finalized modified description. + private: void UpdateDescription(); const ItemEnchantInfo&GetEnchantInfo()const; std::string enchantName; std::string description; ItemAttributable stats; + struct AbilityDescriptionModifiers{ + std::optionalpreName; + std::optionalpostName; + std::optionalnewName; + std::optionalpreDescription; + std::optionalpostDescription; + std::optionalnewDescription; + }; + AbilityDescriptionModifiers modifiers; }; diff --git a/Adventures in Lestoria/Pirates_Treasure.cpp b/Adventures in Lestoria/Pirates_Treasure.cpp index 39179a23..272c70e6 100644 --- a/Adventures in Lestoria/Pirates_Treasure.cpp +++ b/Adventures in Lestoria/Pirates_Treasure.cpp @@ -42,12 +42,25 @@ All rights reserved. INCLUDE_game void Monster::STRATEGY::PIRATES_TREASURE(Monster&m,float fElapsedTime,std::string strategy){ - const float distToPlayer{util::distance(game->GetPlayer()->GetPos(),m.GetPos())}; - if(distToPlayer<=ConfigFloat("Open Distance"))m.PerformAnimation("OPEN"); - else m.PerformIdleAnimation(); - if(m.B(Attribute::COLLIDED_WITH_PLAYER)&&game->GetPlayer()->HasBuff(BuffType::PIRATE_GHOST_CAPTAIN_CURSE_COIN)){ - game->GetPlayer()->RemoveBuff(BuffType::PIRATE_GHOST_CAPTAIN_PRECURSE); - game->GetPlayer()->RemoveBuff(BuffType::PIRATE_GHOST_CAPTAIN_CURSE_COIN); - game->GetPlayer()->RemoveBuff(BuffType::PIRATE_GHOST_CAPTAIN_CURSE_DOT); + enum Phase{ + NORMAL, + LOCKED, + }; + + switch(PHASE()){ + case NORMAL:{ + const float distToPlayer{util::distance(game->GetPlayer()->GetPos(),m.GetPos())}; + if(distToPlayer<=ConfigFloat("Open Distance"))m.PerformAnimation("OPEN"); + else m.PerformIdleAnimation(); + if(m.B(Attribute::COLLIDED_WITH_PLAYER)&&game->GetPlayer()->HasBuff(BuffType::PIRATE_GHOST_CAPTAIN_CURSE_COIN)){ + game->GetPlayer()->RemoveBuff(BuffType::PIRATE_GHOST_CAPTAIN_PRECURSE); + game->GetPlayer()->RemoveBuff(BuffType::PIRATE_GHOST_CAPTAIN_CURSE_COIN); + game->GetPlayer()->RemoveBuff(BuffType::PIRATE_GHOST_CAPTAIN_CURSE_DOT); + } + }break; + case LOCKED:{ + m.PerformAnimation("LOCKED"); + m.SetCollisionRadius(m.GetOriginalCollisionRadius()+12); + }break; } } \ No newline at end of file diff --git a/Adventures in Lestoria/assets/config/Monsters.txt b/Adventures in Lestoria/assets/config/Monsters.txt index db3b4ed2..47a9c64b 100644 --- a/Adventures in Lestoria/assets/config/Monsters.txt +++ b/Adventures in Lestoria/assets/config/Monsters.txt @@ -1887,7 +1887,7 @@ Monsters Strategy = Pirate's Treasure #Size of each animation frame - SheetFrameSize = 24,24 + SheetFrameSize = 36,36 # Setting this to true means every four rows indicates one animation, the ordering of the directions is: NORTH, EAST, SOUTH, WEST 4-Way Spritesheet = False @@ -1899,7 +1899,7 @@ Monsters # The First Four animations must represent a standing, walking, attack, and death animation. Their names are up to the creator. IDLE = 1, 1.0, OneShot WALK = 1, 1.0, OneShot - SLASHING = 1, 1.0, OneShot + LOCKED = 1, 1.0, OneShot OPEN = 1, 1.0, OneShot } diff --git a/Adventures in Lestoria/assets/config/classes/Ranger.txt b/Adventures in Lestoria/assets/config/classes/Ranger.txt index 0afa6f6b..f5961ff1 100644 --- a/Adventures in Lestoria/assets/config/classes/Ranger.txt +++ b/Adventures in Lestoria/assets/config/classes/Ranger.txt @@ -64,7 +64,10 @@ Ranger # Whether or not this ability cancels casts. CancelCast = 0 - Description = Shoots five arrows rapidly at a target location. + Description = Shoots {ARROW COUNT} arrows rapidly. Total Damage: {Damage:DAMAGE} + + DAMAGE = 5.0x + ARROW COUNT = four #RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown. Cooldown Bar Color 1 = 64, 0, 0, 192 diff --git a/Adventures in Lestoria/assets/config/items/ItemEnchants.txt b/Adventures in Lestoria/assets/config/items/ItemEnchants.txt index eb22c857..3940c709 100644 --- a/Adventures in Lestoria/assets/config/items/ItemEnchants.txt +++ b/Adventures in Lestoria/assets/config/items/ItemEnchants.txt @@ -115,6 +115,18 @@ Item Enchants # Stat, Lowest, Highest Value # Stat Modifier[0] = ..., 0, 0 + + 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 = Extreme + ARROW COUNT = nine + DAMAGE = 9.0x + } } Charge Beam {