diff --git a/Crawler/Animation.cpp b/Crawler/Animation.cpp index 7f93d985..dc4cc46e 100644 --- a/Crawler/Animation.cpp +++ b/Crawler/Animation.cpp @@ -46,7 +46,6 @@ INCLUDE_DATA INCLUDE_GFX void sig::Animation::InitializeAnimations(){ - auto CreateStillAnimation=[&](std::string imgName,vf2d size,AnimationData data={}){ Animate2D::FrameSequence anim(data.frameDuration,data.style); anim.AddFrame({&GFX[imgName],{{0,0},size}}); diff --git a/Crawler/CharacterMenuWindow.cpp b/Crawler/CharacterMenuWindow.cpp index 1e4ed6ef..69674f9b 100644 --- a/Crawler/CharacterMenuWindow.cpp +++ b/Crawler/CharacterMenuWindow.cpp @@ -84,6 +84,16 @@ void Menu::InitializeCharacterMenuWindow(){ characterMenuWindow->AddComponent("Equip Selection Bottom Outline",equipSelectionBottomOutline); characterMenuWindow->AddComponent("Equip Selection Select Button",equipSelectionSelectButton); + const std::arraydisplayAttrs{ + ItemAttribute::health, + ItemAttribute::attack, + ItemAttribute::defense, + ItemAttribute::moveSpdPct, + ItemAttribute::cdrPct, + ItemAttribute::critPct, + ItemAttribute::critDmgPct, + }; + int equipSlot=1; for(int i=0;i<8;i++){ float x=31+(i%2)*33; @@ -98,7 +108,7 @@ void Menu::InitializeCharacterMenuWindow(){ EquipSlot slot=EquipSlot(equipSlot); MenuItemItemButton*equipmentSlot=NEW MenuItemItemButton(CHARACTER_MENU,{{x,y+36},{24,24}},Item::BLANK,MenuType::ENUM_END, - [](MenuFuncData data){ + [&](MenuFuncData data){ EquipSlot slot=EquipSlot(data.component->I(Attribute::EQUIP_TYPE)); std::vector&equips=Inventory::get("Equipment"); @@ -142,15 +152,6 @@ void Menu::InitializeCharacterMenuWindow(){ } MenuComponent*statDisplayOutline=NEW MenuComponent(CHARACTER_MENU,{{245,36},{62,windowSize.y-37}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE); - const std::arraydisplayAttrs{ - ItemAttribute::health, - ItemAttribute::attack, - ItemAttribute::defense, - ItemAttribute::moveSpdPct, - ItemAttribute::cdrPct, - ItemAttribute::critPct, - ItemAttribute::critDmgPct, - }; characterMenuWindow->AddComponent("Stat Display Outline",statDisplayOutline); diff --git a/Crawler/Item.cpp b/Crawler/Item.cpp index f2efd6bf..826187a7 100644 --- a/Crawler/Item.cpp +++ b/Crawler/Item.cpp @@ -91,6 +91,7 @@ void ItemInfo::InitializeItems(){ float castTime=0; std::vector slot; float cooldownTime="Item.Item Cooldown Time"_F; + bool hasStatValues=false; for(auto&itemKey:data[key.first].GetKeys()){ std::string keyName=itemKey.first; if(keyName=="Description"){ @@ -112,17 +113,34 @@ void ItemInfo::InitializeItems(){ for(auto&val:data[key.first][keyName].GetValues()){ slot.push_back(val); } + }else + if(keyName.starts_with("StatValues")){ + hasStatValues=true; }else{ //THis is a custom override modifier for a script. NO-OP } } + ItemInfo&it=ITEM_DATA[key.first]; + + if(hasStatValues){ + EnhancementInfo enhancementStats; + for(int i=0;i<=10;i++){ + datafile&dat=data[key.first]["StatValues["+std::to_string(i)+"]"]; + int armor=dat.GetValueCount()>0?dat.GetInt(0):0; + int health=dat.GetValueCount()>1?dat.GetInt(1):0; + int attack=dat.GetValueCount()>2?dat.GetInt(2):0; + enhancementStats.SetAttribute(i,ItemAttribute::defense,armor); + enhancementStats.SetAttribute(i,ItemAttribute::health,health); + enhancementStats.SetAttribute(i,ItemAttribute::attack,attack); + } + it.enhancement=enhancementStats; + } if(scriptName!=""){ if(!ITEM_SCRIPTS.count(scriptName)){ ERR("Could not load script "<enhancementStats; public: + void SetAttribute(int enhanceLevel,ItemAttribute attribute,int value); const Stats&operator[](int level)const; }; diff --git a/Crawler/Version.h b/Crawler/Version.h index 863eebb5..104b748a 100644 --- a/Crawler/Version.h +++ b/Crawler/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 0 #define VERSION_MINOR 2 #define VERSION_PATCH 1 -#define VERSION_BUILD 3457 +#define VERSION_BUILD 3458 #define stringify(a) stringify_(a) #define stringify_(a) #a