|
|
@ -72,6 +72,7 @@ ItemEnhancementFunctionPrimingData Item::enhanceFunctionPrimed("CanEnhanceItem() |
|
|
|
std::vector<std::shared_ptr<Item>>ItemInfo::craftableConsumables; |
|
|
|
std::vector<std::shared_ptr<Item>>ItemInfo::craftableConsumables; |
|
|
|
std::vector<std::string>ItemSortRules::primarySort; |
|
|
|
std::vector<std::string>ItemSortRules::primarySort; |
|
|
|
std::vector<std::string>ItemSortRules::secondarySort; |
|
|
|
std::vector<std::string>ItemSortRules::secondarySort; |
|
|
|
|
|
|
|
Stats Stats::NO_MAX_HIGHLIGHT; |
|
|
|
|
|
|
|
|
|
|
|
ItemInfo::ItemInfo() |
|
|
|
ItemInfo::ItemInfo() |
|
|
|
:customProps({nullptr,nullptr}),img(nullptr){} |
|
|
|
:customProps({nullptr,nullptr}),img(nullptr){} |
|
|
@ -653,10 +654,10 @@ const std::string Item::Description(CompactText compact)const{ |
|
|
|
if(IsEquippable()){ |
|
|
|
if(IsEquippable()){ |
|
|
|
if(HasRandomizedStats()){ |
|
|
|
if(HasRandomizedStats()){ |
|
|
|
description+='\n'; |
|
|
|
description+='\n'; |
|
|
|
description+=randomizedStats.GetStatsString(); |
|
|
|
description+=randomizedStats.GetStatsString(it->GetMaxStats()); |
|
|
|
} |
|
|
|
} |
|
|
|
description+='\n'; |
|
|
|
description+='\n'; |
|
|
|
description+=GetStats().GetStatsString(compact); |
|
|
|
description+=GetStats().GetStatsString(Stats::NO_MAX_HIGHLIGHT,compact); |
|
|
|
if(ItemSet()){ |
|
|
|
if(ItemSet()){ |
|
|
|
const::ItemSet*const set=ItemSet().value(); |
|
|
|
const::ItemSet*const set=ItemSet().value(); |
|
|
|
if(compact==COMPACT){ |
|
|
|
if(compact==COMPACT){ |
|
|
@ -676,7 +677,7 @@ const std::string Item::Description(CompactText compact)const{ |
|
|
|
description+="\n"; |
|
|
|
description+="\n"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
description+="("+std::to_string(pieceCount)+"): "+bonuses.GetStatsString(compact)+"#FFFFFF"; |
|
|
|
description+="("+std::to_string(pieceCount)+"): "+bonuses.GetStatsString(Stats::NO_MAX_HIGHLIGHT,compact)+"#FFFFFF"; |
|
|
|
first=false; |
|
|
|
first=false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -961,7 +962,7 @@ const std::map<ItemSet,int>Inventory::GetEquippedItemSets(){ |
|
|
|
return setCounts; |
|
|
|
return setCounts; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const std::string Stats::GetStatsString(CompactText compact)const{ |
|
|
|
const std::string Stats::GetStatsString(const Stats&maxStats,CompactText compact)const{ |
|
|
|
std::string description=""; |
|
|
|
std::string description=""; |
|
|
|
for(bool first=true;const auto&[attr,val]:attributes){ |
|
|
|
for(bool first=true;const auto&[attr,val]:attributes){ |
|
|
|
if(!first){ |
|
|
|
if(!first){ |
|
|
@ -975,7 +976,14 @@ const std::string Stats::GetStatsString(CompactText compact)const{ |
|
|
|
if(attr.ShowAsDecimal()){ |
|
|
|
if(attr.ShowAsDecimal()){ |
|
|
|
statNumber=std::format("{:.2f}",val); |
|
|
|
statNumber=std::format("{:.2f}",val); |
|
|
|
} |
|
|
|
} |
|
|
|
description+=std::string(attr.Name())+": "+statNumber+(attr.DisplayAsPercent()?"%":""); |
|
|
|
|
|
|
|
|
|
|
|
std::string col=""; |
|
|
|
|
|
|
|
if(maxStats.attributes.count(attr)&&int(val)>=int(maxStats.attributes.at(attr))){ |
|
|
|
|
|
|
|
Pixel shimmeringCol=PixelLerp({255,196,60},{254,217,133},sin((70*game->GetRuntime())/2.f+0.5f)); |
|
|
|
|
|
|
|
col=util::PixelToHTMLColorCode(shimmeringCol); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
description+=col+std::string(attr.Name())+": "+statNumber+(attr.DisplayAsPercent()?"%":"")+"#FFFFFF"; |
|
|
|
first=false; |
|
|
|
first=false; |
|
|
|
} |
|
|
|
} |
|
|
|
return description; |
|
|
|
return description; |
|
|
|