Create new equipment images, read/parse equipment config file

pull/28/head
sigonasr2 1 year ago
parent b51d6f571a
commit 694a82701e
  1. 3
      Crawler/CharacterMenuWindow.cpp
  2. 1
      Crawler/Crawler.vcxproj
  3. 3
      Crawler/Crawler.vcxproj.filters
  4. 125
      Crawler/Item.cpp
  5. 2
      Crawler/Version.h
  6. 1
      Crawler/assets/config/Monsters.txt
  7. 404
      Crawler/assets/config/items/Equipment.txt
  8. 7
      Crawler/assets/config/items/items.txt
  9. BIN
      Crawler/assets/items/Bone Armor.png
  10. BIN
      Crawler/assets/items/Bone Gloves.png
  11. BIN
      Crawler/assets/items/Bone Helmet.png
  12. BIN
      Crawler/assets/items/Bone Pants.png
  13. BIN
      Crawler/assets/items/Bone Shoes.png
  14. BIN
      Crawler/assets/items/Copper Armor.png
  15. BIN
      Crawler/assets/items/Copper Gloves.png
  16. BIN
      Crawler/assets/items/Copper Helmet.png
  17. BIN
      Crawler/assets/items/Copper Pants.png
  18. BIN
      Crawler/assets/items/Copper Shoes.png
  19. BIN
      Crawler/assets/items/Leather Armor.png
  20. BIN
      Crawler/assets/items/Leather Gloves.png
  21. BIN
      Crawler/assets/items/Leather Helmet.png
  22. BIN
      Crawler/assets/items/Leather Pants.png
  23. BIN
      Crawler/assets/items/Leather Shoes.png
  24. BIN
      Crawler/assets/items/Shell Armor.png
  25. BIN
      Crawler/assets/items/Shell Gloves.png
  26. BIN
      Crawler/assets/items/Shell Helmet.png
  27. BIN
      Crawler/assets/items/Shell Pants.png
  28. BIN
      Crawler/assets/items/Shell Shoes.png

@ -107,6 +107,9 @@ void Menu::InitializeCharacterMenuWindow(){
std::copy_if(equips.begin(),equips.end(),std::back_inserter(availableEquipment),[&](Item&it){
return it.GetEquipSlot()&slot;
});
std::copy_if(accessories.begin(),accessories.end(),std::back_inserter(availableEquipment),[&](Item&it){
return it.GetEquipSlot()&slot;
});
ScrollableWindowComponent*equipList=Component<ScrollableWindowComponent>(data.component->parentMenu,"Equip List");
equipList->RemoveAllComponents();

@ -464,6 +464,7 @@
<Text Include="assets\config\configuration.txt" />
<Text Include="assets\config\gfx\gfx.txt" />
<Text Include="assets\config\gfx\themes.txt" />
<Text Include="assets\config\items\Equipment.txt" />
<Text Include="assets\config\items\ItemCategory.txt" />
<Text Include="assets\config\items\ItemDatabase.txt" />
<Text Include="assets\config\items\items.txt" />

@ -557,6 +557,9 @@
<Text Include="Crawler_Story_Chapter_1 (2).txt">
<Filter>Documentation\Story</Filter>
</Text>
<Text Include="assets\config\items\Equipment.txt">
<Filter>Configurations\Items</Filter>
</Text>
</ItemGroup>
<ItemGroup>
<Image Include="assets\heart.ico">

@ -80,72 +80,77 @@ void ItemInfo::InitializeItems(){
Inventory::sortedInv[key.first];
Menu::inventoryListeners[key.first];
}
for(auto&key:DATA["ItemDatabase"].GetKeys()){
std::string imgPath="assets/"+"item_img_directory"_S+key.first+".png";
Renderable&img=GFX["item_img_directory"_S+key.first+".png"];
img.Load(imgPath);
std::string scriptName="",description="",category="";
float castTime=0;
std::vector<std::string> slot;
float cooldownTime="Item.Item Cooldown Time"_F;
for(auto&itemKey:DATA["ItemDatabase"][key.first].GetKeys()){
std::string keyName=itemKey.first;
if(keyName=="Description"){
description=DATA["ItemDatabase"][key.first][keyName].GetString();
}else
if(keyName=="ItemCategory"){
category=DATA["ItemDatabase"][key.first][keyName].GetString();
}else
if(keyName=="ItemScript"){
scriptName=DATA["ItemDatabase"][key.first][keyName].GetString();
}else
if(keyName=="Cast Time"){
castTime=float(DATA["ItemDatabase"][key.first][keyName].GetReal());
}else
if(keyName=="Cooldown Time"){
castTime=float(DATA["ItemDatabase"][key.first][keyName].GetReal());
}else
if(keyName=="Slot"){
for(auto&val:DATA["ItemDatabase"][key.first][keyName].GetValues()){
slot.push_back(val);
auto ReadItems=[&](datafile&data){
for(auto&key:data.GetKeys()){
std::string imgPath="assets/"+"item_img_directory"_S+key.first+".png";
Renderable&img=GFX["item_img_directory"_S+key.first+".png"];
img.Load(imgPath);
std::string scriptName="",description="",category="";
float castTime=0;
std::vector<std::string> slot;
float cooldownTime="Item.Item Cooldown Time"_F;
for(auto&itemKey:data[key.first].GetKeys()){
std::string keyName=itemKey.first;
if(keyName=="Description"){
description=data[key.first][keyName].GetString();
}else
if(keyName=="ItemCategory"){
category=data[key.first][keyName].GetString();
}else
if(keyName=="ItemScript"){
scriptName=data[key.first][keyName].GetString();
}else
if(keyName=="Cast Time"){
castTime=float(data[key.first][keyName].GetReal());
}else
if(keyName=="Cooldown Time"){
castTime=float(data[key.first][keyName].GetReal());
}else
if(keyName=="Slot"){
for(auto&val:data[key.first][keyName].GetValues()){
slot.push_back(val);
}
}else{ //THis is a custom override modifier for a script. NO-OP
}
}else{ //THis is a custom override modifier for a script. NO-OP
}
}
if(scriptName!=""){
if(!ITEM_SCRIPTS.count(scriptName)){
ERR("Could not load script "<<scriptName<<" for Item "<<key.first<<"!")
if(scriptName!=""){
if(!ITEM_SCRIPTS.count(scriptName)){
ERR("Could not load script "<<scriptName<<" for Item "<<key.first<<"!")
}
}
}
ItemInfo&it=ITEM_DATA[key.first];
it.name=key.first;
it.description=description;
it.category=category;
it.castTime=castTime;
it.cooldownTime=cooldownTime;
it.slot=EquipSlot::NONE;
if(slot.size()>0){
for(std::string&s:slot){
if(!nameToEquipSlot.count(s))ERR("WARNING! Tried to add item "<<it.name<<" to slot "<<s<<" which doesn't exist!");
it.slot|=nameToEquipSlot[s];
ItemInfo&it=ITEM_DATA[key.first];
it.name=key.first;
it.description=description;
it.category=category;
it.castTime=castTime;
it.cooldownTime=cooldownTime;
it.slot=EquipSlot::NONE;
if(slot.size()>0){
for(std::string&s:slot){
if(!nameToEquipSlot.count(s))ERR("WARNING! Tried to add item "<<it.name<<" to slot "<<s<<" which doesn't exist!");
it.slot|=nameToEquipSlot[s];
}
}
}
if(!ITEM_CATEGORIES.count(it.category)){
ERR("WARNING! Tried to add item "<<it.name<<" to category "<<it.category<<" which does not exist!")
}
ITEM_CATEGORIES.at(it.category).insert(it.name);
it.img=img.Decal();
ItemProps&props=it.customProps;
if(scriptName!=""){
props.scriptProps=&DATA["ItemScript"][scriptName];
props.customProps=&DATA["ItemDatabase"][key.first];
}
it.useFunc=scriptName;
}
if(!ITEM_CATEGORIES.count(it.category)){
ERR("WARNING! Tried to add item "<<it.name<<" to category "<<it.category<<" which does not exist!")
}
ITEM_CATEGORIES.at(it.category).insert(it.name);
it.img=img.Decal();
ItemProps&props=it.customProps;
if(scriptName!=""){
props.scriptProps=&DATA["ItemScript"][scriptName];
props.customProps=&data[key.first];
}
it.useFunc=scriptName;
}
};
ReadItems(DATA["ItemDatabase"]);
ReadItems(DATA["Equipment"]);
ITEM_DATA.SetInitialized();
ITEM_CATEGORIES.SetInitialized();

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 1
#define VERSION_BUILD 3455
#define VERSION_BUILD 3457
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -141,6 +141,7 @@ Monsters
# Drop Item Name, Drop Percentage(0-100%), Drop Min Quantity, Drop Max Quantity
DROP[0] = Bandages,30%,1,1
DROP[1] = Shell Helmet,100%,1,1
#Additional custom animations go down below. Start with ANIMATION[0]
#ANIMATION[0] = MY_NEW_ANIMATION

@ -0,0 +1,404 @@
Equipment
{
Leather Helmet
{
DisplayName = Leather Helmet
Slot = Helmet
PartofSet = 1
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 3,2,0
StatValues[1] = 4,3,0
StatValues[2] = 5,3,0
StatValues[3] = 6,4,1
StatValues[4] = 6,5,2
StatValues[5] = 7,5,2
StatValues[6] = 8,5,2
StatValues[7] = 9,6,3
StatValues[8] = 9,7,4
StatValues[9] = 10,7,4
StatValues[10] = 11,8,4
}
Leather Armor
{
DisplayName = Leather Armor
Slot = Armor
PartofSet = 1
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 5,1,0
StatValues[1] = 6,1,0
StatValues[2] = 7,2,0
StatValues[3] = 8,2,1
StatValues[4] = 9,3,2
StatValues[5] = 10,3,2
StatValues[6] = 11,4,2
StatValues[7] = 12,4,3
StatValues[8] = 13,5,4
StatValues[9] = 14,6,4
StatValues[10] = 15,7,4
}
Leather Pants
{
DisplayName = Leather Pants
Slot = Pants
PartofSet = 1
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 4,1,1
StatValues[1] = 5,1,1
StatValues[2] = 6,1,2
StatValues[3] = 7,2,2
StatValues[4] = 8,2,3
StatValues[5] = 9,3,3
StatValues[6] = 10,3,4
StatValues[7] = 11,4,4
StatValues[8] = 12,5,5
StatValues[9] = 13,5,6
StatValues[10] = 14,5,7
}
Leather Gloves
{
DisplayName = Leather Gloves
Slot = Gloves
PartofSet = 1
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 1,0,1
StatValues[1] = 2,0,3
StatValues[2] = 3,0,3
StatValues[3] = 3,1,4
StatValues[4] = 4,2,5
StatValues[5] = 5,2,5
StatValues[6] = 6,2,5
StatValues[7] = 6,3,6
StatValues[8] = 7,4,7
StatValues[9] = 8,4,7
StatValues[10] = 8,4,8
}
Leather Shoes
{
DisplayName = Leather Shoes
Slot = Shoes
PartofSet = 1
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 2,1,0
StatValues[1] = 3,1,1
StatValues[2] = 4,2,1
StatValues[3] = 4,2,2
StatValues[4] = 5,3,2
StatValues[5] = 6,3,3
StatValues[6] = 7,4,3
StatValues[7] = 7,4,4
StatValues[8] = 8,5,4
StatValues[9] = 9,5,4
StatValues[10] = 9,5,5
}
Copper Helmet
{
DisplayName = Copper Helmet
Slot = Helmet
PartofSet = 2
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 7,5,2
StatValues[1] = 9,5,2
StatValues[2] = 10,6,3
StatValues[3] = 11,7,4
StatValues[4] = 12,7,4
StatValues[5] = 13,8,4
StatValues[6] = 15,9,4
StatValues[7] = 16,10,5
StatValues[8] = 17,11,5
StatValues[9] = 18,12,5
StatValues[10] = 20,12,5
}
Copper Armor
{
DisplayName = Copper Armor
Slot = Armor
PartofSet = 2
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 10,3,2
StatValues[1] = 11,4,2
StatValues[2] = 12,4,3
StatValues[3] = 13,5,4
StatValues[4] = 14,6,4
StatValues[5] = 15,7,4
StatValues[6] = 17,7,4
StatValues[7] = 19,8,5
StatValues[8] = 21,8,5
StatValues[9] = 23,9,5
StatValues[10] = 25,10,5
}
Copper Pants
{
DisplayName = Copper Pants
Slot = Pants
PartofSet = 2
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 9,3,3
StatValues[1] = 10,3,4
StatValues[2] = 11,4,4
StatValues[3] = 12,5,5
StatValues[4] = 13,5,6
StatValues[5] = 14,5,7
StatValues[6] = 15,6,7
StatValues[7] = 17,6,8
StatValues[8] = 18,7,8
StatValues[9] = 20,7,9
StatValues[10] = 22,8,10
}
Copper Gloves
{
DisplayName = Copper Gloves
Slot = Gloves
PartofSet = 2
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 5,2,5
StatValues[1] = 6,2,5
StatValues[2] = 6,3,6
StatValues[3] = 7,4,7
StatValues[4] = 8,4,7
StatValues[5] = 8,4,8
StatValues[6] = 8,4,9
StatValues[7] = 9,5,10
StatValues[8] = 9,5,11
StatValues[9] = 10,5,12
StatValues[10] = 11,5,12
}
Copper Shoes
{
DisplayName = Copper Shoes
Slot = Shoes
PartofSet = 2
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 6,3,3
StatValues[1] = 7,3,3
StatValues[2] = 7,4,4
StatValues[3] = 8,5,4
StatValues[4] = 9,5,4
StatValues[5] = 9,5,5
StatValues[6] = 9,6,5
StatValues[7] = 10,6,6
StatValues[8] = 10,7,6
StatValues[9] = 11,7,7
StatValues[10] = 12,8,8
}
Shell Helmet
{
DisplayName = Shell Helmet
Slot = Helmet
PartofSet = 3
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 12,8,4
StatValues[1] = 13,8,4
StatValues[2] = 18,9,4
StatValues[3] = 20,10,5
StatValues[4] = 22,11,5
StatValues[5] = 24,12,5
StatValues[6] = 29,12,5
StatValues[7] = 31,13,5
StatValues[8] = 33,13,6
StatValues[9] = 35,14,6
StatValues[10] = 40,14,6
}
Shell Armor
{
DisplayName = Shell Armor
Slot = Armor
PartofSet = 3
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 14,6,4
StatValues[1] = 15,7,4
StatValues[2] = 20,7,4
StatValues[3] = 24,8,5
StatValues[4] = 28,8,5
StatValues[5] = 33,9,5
StatValues[6] = 37,10,5
StatValues[7] = 41,11,5
StatValues[8] = 45,11,6
StatValues[9] = 51,12,6
StatValues[10] = 57,12,6
}
Shell Pants
{
DisplayName = Shell Pants
Slot = Pants
PartofSet = 3
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 13,5,6
StatValues[1] = 14,5,7
StatValues[2] = 16,6,7
StatValues[3] = 19,6,8
StatValues[4] = 21,7,8
StatValues[5] = 24,7,9
StatValues[6] = 26,8,10
StatValues[7] = 30,8,11
StatValues[8] = 34,9,11
StatValues[9] = 38,9,12
StatValues[10] = 42,10,12
}
Shell Gloves
{
DisplayName = Shell Gloves
Slot = Gloves
PartofSet = 3
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 8,4,7
StatValues[1] = 8,4,8
StatValues[2] = 8,4,9
StatValues[3] = 9,5,10
StatValues[4] = 9,5,11
StatValues[5] = 10,5,12
StatValues[6] = 11,5,12
StatValues[7] = 12,5,13
StatValues[8] = 13,6,13
StatValues[9] = 14,6,14
StatValues[10] = 15,6,14
}
Shell Shoes
{
DisplayName = Shell Shoes
Slot = Shoes
PartofSet = 3
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 9,5,4
StatValues[1] = 9,5,5
StatValues[2] = 9,6,6
StatValues[3] = 10,6,6
StatValues[4] = 10,7,7
StatValues[5] = 11,7,7
StatValues[6] = 12,8,8
StatValues[7] = 13,8,8
StatValues[8] = 14,9,9
StatValues[9] = 15,9,9
StatValues[10] = 16,10,10
}
Bone Helmet
{
DisplayName = Bone Helmet
Slot = Helmet
PartofSet = 4
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 24,12,5
StatValues[1] = 29,12,5
StatValues[2] = 31,13,5
StatValues[3] = 33,13,6
StatValues[4] = 35,14,6
StatValues[5] = 40,14,6
StatValues[6] = 42,15,6
StatValues[7] = 44,16,7
StatValues[8] = 46,17,7
StatValues[9] = 51,17,7
StatValues[10] = 53,19,7
}
Bone Armor
{
DisplayName = Bone Armor
Slot = Armor
PartofSet = 4
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 33,9,5
StatValues[1] = 37,10,5
StatValues[2] = 41,11,5
StatValues[3] = 45,11,6
StatValues[4] = 51,12,6
StatValues[5] = 57,12,6
StatValues[6] = 61,13,6
StatValues[7] = 64,13,7
StatValues[8] = 67,13,7
StatValues[9] = 70,14,7
StatValues[10] = 72,14,7
}
Bone Pants
{
DisplayName = Bone Pants
Slot = Pants
PartofSet = 4
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 24,7,9
StatValues[1] = 26,8,10
StatValues[2] = 30,8,11
StatValues[3] = 34,9,11
StatValues[4] = 38,9,12
StatValues[5] = 42,10,12
StatValues[6] = 45,10,13
StatValues[7] = 49,11,13
StatValues[8] = 53,11,13
StatValues[9] = 57,11,14
StatValues[10] = 61,12,14
}
Bone Gloves
{
DisplayName = Bone Gloves
Slot = Gloves
PartofSet = 4
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 9,5,11
StatValues[1] = 10,5,12
StatValues[2] = 11,5,13
StatValues[3] = 12,6,13
StatValues[4] = 13,6,14
StatValues[5] = 14,6,14
StatValues[6] = 15,6,15
StatValues[7] = 16,7,16
StatValues[8] = 17,7,17
StatValues[9] = 18,7,17
StatValues[10] = 19,7,19
}
Bone Shoes
{
DisplayName = Bone Shoes
Slot = Shoes
PartofSet = 4
ItemCategory = Equipment
# Stat Values of the item based on Enhancement level. [Armor],[Health],[Attack]
StatValues[0] = 11,7,7
StatValues[1] = 11,8,8
StatValues[2] = 12,8,8
StatValues[3] = 13,9,9
StatValues[4] = 14,9,9
StatValues[5] = 15,10,10
StatValues[6] = 16,10,10
StatValues[7] = 17,11,11
StatValues[8] = 18,11,11
StatValues[9] = 19,11,11
StatValues[10] = 21,12,12
}
}

@ -1,8 +1,9 @@
ItemConfiguration
{
Item Database = "ItemDatabase.txt"
Item Scripts = "ItemScript.txt"
Item Categories = "ItemCategory.txt
Item Database = ItemDatabase.txt
Item Scripts = ItemScript.txt
Item Categories = ItemCategory.txt
Equipment = Equipment.txt
}
Item
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 789 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 746 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 710 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Loading…
Cancel
Save