Add available chapter to individual crafting requirements and item dattabase

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
pull/35/head
Nic0Nic0Nii 10 months ago
parent 6d4eba57e4
commit 32bec29f61
  1. 9
      Adventures in Lestoria/CraftingRequirement.cpp
  2. 6
      Adventures in Lestoria/CraftingRequirement.h
  3. 3
      Adventures in Lestoria/Item.cpp
  4. 2
      Adventures in Lestoria/Item.h
  5. 400
      Adventures in Lestoria/assets/config/items/Equipment.txt
  6. 325
      Adventures in Lestoria/assets/config/items/Weapons.txt

@ -30,15 +30,15 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE. SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType Portions of this software are copyright <EFBFBD> 2023 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information. Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved. All rights reserved.
*/ */
#pragma endregion #pragma endregion
#include "CraftingRequirement.h" #include "CraftingRequirement.h"
CraftingRequirement::CraftingRequirement(const std::vector<std::pair<IT,int>>&craftingItems,const uint32_t cost) CraftingRequirement::CraftingRequirement(const std::vector<std::pair<IT,int>>&craftingItems,const uint32_t cost,const uint8_t availableChapter)
:craftingItems(craftingItems),cost(cost){} :craftingItems(craftingItems),cost(cost),availableChapter(availableChapter){}
const std::vector<std::pair<IT,int>>&CraftingRequirement::GetItems()const{ const std::vector<std::pair<IT,int>>&CraftingRequirement::GetItems()const{
return craftingItems; return craftingItems;
@ -46,3 +46,6 @@ const std::vector<std::pair<IT,int>>&CraftingRequirement::GetItems()const{
const uint32_t CraftingRequirement::GetCost()const{ const uint32_t CraftingRequirement::GetCost()const{
return cost; return cost;
} }
const uint8_t CraftingRequirement::GetAvailableChapter()const{
return availableChapter;
}

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE. SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType Portions of this software are copyright <EFBFBD> 2023 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information. Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved. All rights reserved.
*/ */
@ -41,8 +41,10 @@ All rights reserved.
class CraftingRequirement{ class CraftingRequirement{
std::vector<std::pair<IT,int>>craftingItems; std::vector<std::pair<IT,int>>craftingItems;
uint32_t cost; uint32_t cost;
uint8_t availableChapter;
public: public:
CraftingRequirement(const std::vector<std::pair<IT,int>>&craftingItems,const uint32_t cost); CraftingRequirement(const std::vector<std::pair<IT,int>>&craftingItems,const uint32_t cost,const uint8_t availableChapter);
const std::vector<std::pair<IT,int>>&GetItems()const; const std::vector<std::pair<IT,int>>&GetItems()const;
const uint32_t GetCost()const; const uint32_t GetCost()const;
const uint8_t GetAvailableChapter()const;
}; };

@ -1066,8 +1066,7 @@ void EnhancementInfo::SetCraftingRequirements(const int enhanceLevel,const std::
while(craftingRequirements.size()<=enhanceLevel){ while(craftingRequirements.size()<=enhanceLevel){
craftingRequirements.push_back(CraftingRequirement({},0)); craftingRequirements.push_back(CraftingRequirement({},0));
} }
this->availableChapter=availableChapter; craftingRequirements[enhanceLevel]=CraftingRequirement(requiredItems,goldCost,availableChapter);
craftingRequirements[enhanceLevel]=CraftingRequirement(requiredItems,goldCost);
} }
EnhancementLevelInfo::EnhancementLevelInfo(const Stats&stats,const CraftingRequirement&craftingRequirement) EnhancementLevelInfo::EnhancementLevelInfo(const Stats&stats,const CraftingRequirement&craftingRequirement)

@ -122,12 +122,10 @@ struct EnhancementInfo{
private: private:
std::vector<Stats>enhancementStats; std::vector<Stats>enhancementStats;
std::vector<CraftingRequirement>craftingRequirements; std::vector<CraftingRequirement>craftingRequirements;
uint8_t availableChapter=1;
public: public:
void SetAttribute(int enhanceLevel,ItemAttribute attribute,float value); void SetAttribute(int enhanceLevel,ItemAttribute attribute,float value);
void SetCraftingRequirements(const int enhanceLevel,const std::vector<std::pair<IT,int>>&requiredItems,const uint32_t goldCost,const uint8_t availableChapter); void SetCraftingRequirements(const int enhanceLevel,const std::vector<std::pair<IT,int>>&requiredItems,const uint32_t goldCost,const uint8_t availableChapter);
const bool CanBeEnhanced()const; const bool CanBeEnhanced()const;
const uint8_t AvailableChapter()const;
const EnhancementLevelInfo operator[](int level)const; const EnhancementLevelInfo operator[](int level)const;
const size_t size()const; const size_t size()const;
}; };

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save