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
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.
All rights reserved.
*/
#pragma endregion
#include "CraftingRequirement.h"
CraftingRequirement::CraftingRequirement(const std::vector<std::pair<IT,int>>&craftingItems,const uint32_t cost)
:craftingItems(craftingItems),cost(cost){}
CraftingRequirement::CraftingRequirement(const std::vector<std::pair<IT,int>>&craftingItems,const uint32_t cost,const uint8_t availableChapter)
:craftingItems(craftingItems),cost(cost),availableChapter(availableChapter){}
const std::vector<std::pair<IT,int>>&CraftingRequirement::GetItems()const{
return craftingItems;
@ -46,3 +46,6 @@ const std::vector<std::pair<IT,int>>&CraftingRequirement::GetItems()const{
const uint32_t CraftingRequirement::GetCost()const{
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
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.
All rights reserved.
*/
@ -41,8 +41,10 @@ All rights reserved.
class CraftingRequirement{
std::vector<std::pair<IT,int>>craftingItems;
uint32_t cost;
uint8_t availableChapter;
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 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){
craftingRequirements.push_back(CraftingRequirement({},0));
}
this->availableChapter=availableChapter;
craftingRequirements[enhanceLevel]=CraftingRequirement(requiredItems,goldCost);
craftingRequirements[enhanceLevel]=CraftingRequirement(requiredItems,goldCost,availableChapter);
}
EnhancementLevelInfo::EnhancementLevelInfo(const Stats&stats,const CraftingRequirement&craftingRequirement)

@ -122,12 +122,10 @@ struct EnhancementInfo{
private:
std::vector<Stats>enhancementStats;
std::vector<CraftingRequirement>craftingRequirements;
uint8_t availableChapter=1;
public:
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);
const bool CanBeEnhanced()const;
const uint8_t AvailableChapter()const;
const EnhancementLevelInfo operator[](int level)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