|
|
|
@ -72,6 +72,7 @@ ItemEnhancementFunctionPrimingData Item::enhanceFunctionPrimed("CanEnhanceItem() |
|
|
|
|
std::vector<std::shared_ptr<Item>>ItemInfo::craftableConsumables; |
|
|
|
|
std::vector<std::string>ItemSortRules::primarySort; |
|
|
|
|
std::vector<std::string>ItemSortRules::secondarySort; |
|
|
|
|
Stats Stats::NO_MAX_HIGHLIGHT; |
|
|
|
|
|
|
|
|
|
ItemInfo::ItemInfo() |
|
|
|
|
:customProps({nullptr,nullptr}),img(nullptr){} |
|
|
|
@ -653,10 +654,10 @@ const std::string Item::Description(CompactText compact)const{ |
|
|
|
|
if(IsEquippable()){ |
|
|
|
|
if(HasRandomizedStats()){ |
|
|
|
|
description+='\n'; |
|
|
|
|
description+=randomizedStats.GetStatsString(); |
|
|
|
|
description+=randomizedStats.GetStatsString(it->GetMaxStats()); |
|
|
|
|
} |
|
|
|
|
description+='\n'; |
|
|
|
|
description+=GetStats().GetStatsString(compact); |
|
|
|
|
description+=GetStats().GetStatsString(Stats::NO_MAX_HIGHLIGHT,compact); |
|
|
|
|
if(ItemSet()){ |
|
|
|
|
const::ItemSet*const set=ItemSet().value(); |
|
|
|
|
if(compact==COMPACT){ |
|
|
|
@ -676,7 +677,7 @@ const std::string Item::Description(CompactText compact)const{ |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -961,7 +962,7 @@ const std::map<ItemSet,int>Inventory::GetEquippedItemSets(){ |
|
|
|
|
return setCounts; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const std::string Stats::GetStatsString(CompactText compact)const{ |
|
|
|
|
const std::string Stats::GetStatsString(const Stats&maxStats,CompactText compact)const{ |
|
|
|
|
std::string description=""; |
|
|
|
|
for(bool first=true;const auto&[attr,val]:attributes){ |
|
|
|
|
if(!first){ |
|
|
|
@ -975,7 +976,14 @@ const std::string Stats::GetStatsString(CompactText compact)const{ |
|
|
|
|
if(attr.ShowAsDecimal()){ |
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
return description; |
|
|
|
|