Cards: coarse condition grade in the description until the card is owned
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
821eb1b960
commit
68265095a8
3 files changed
+23
-3
No files matched your search
@@ -102,9 +102,21 @@ namespace Decentralized
|
|||||||
Refresh(item);
|
Refresh(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>说明:算力和耗电按标称写;成色在归玩家之前只给粗略等级(要看外观自己判断),归玩家之后给精确健康度。</summary>
|
||||||
|
private static string Desc(GameItem item, Unit u)
|
||||||
|
{
|
||||||
|
var label = u.Label;
|
||||||
|
string cond = GeneralHelper.IsItemOwned(item)
|
||||||
|
? Mathf.RoundToInt((float)u.Health) + "%"
|
||||||
|
: L.T(u.Health >= 85 ? "item.gpu.grade.1" : u.Health >= 60 ? "item.gpu.grade.2" : u.Health >= 35 ? "item.gpu.grade.3" : "item.gpu.grade.4");
|
||||||
|
return L.T("item.gpu.desc", Fmt.Num(label.DisplayHash), Fmt.Num(label.Kj), cond);
|
||||||
|
}
|
||||||
|
|
||||||
private static void SyncValue(GameItem item)
|
private static void SyncValue(GameItem item)
|
||||||
{
|
{
|
||||||
if (item.IsTag(DeadTag)) return;
|
if (item.IsTag(DeadTag)) return;
|
||||||
|
string desc = Desc(item, ToUnit(item));
|
||||||
|
if (item.shortDescription != desc) item.shortDescription = desc;
|
||||||
long value = item.IsTag(QuoteTag) && !GeneralHelper.IsItemOwned(item) ? item.GetTagReadonly(QuoteTag).GetLong() : CardValue.True(ToUnit(item));
|
long value = item.IsTag(QuoteTag) && !GeneralHelper.IsItemOwned(item) ? item.GetTagReadonly(QuoteTag).GetLong() : CardValue.True(ToUnit(item));
|
||||||
if (item.unitValue != value) item.unitValue = value;
|
if (item.unitValue != value) item.unitValue = value;
|
||||||
}
|
}
|
||||||
@@ -147,7 +159,7 @@ namespace Decentralized
|
|||||||
}
|
}
|
||||||
item.SetSpriteAndShapeFromMod(ModInfo.Id, (label.Brand == Hardware.Probidia ? "gpu_probidia" : "gpu_pmd") + (item.IsTag(BackTag) ? "_b" : "_f"));
|
item.SetSpriteAndShapeFromMod(ModInfo.Id, (label.Brand == Hardware.Probidia ? "gpu_probidia" : "gpu_pmd") + (item.IsTag(BackTag) ? "_b" : "_f"));
|
||||||
item.name = L.T("item.gpu.name", label.Brand, DisplayModel(label.Model));
|
item.name = L.T("item.gpu.name", label.Brand, DisplayModel(label.Model));
|
||||||
item.shortDescription = L.T("item.gpu.desc", Fmt.Num(label.DisplayHash), Fmt.Num(label.Kj), Mathf.RoundToInt((float)u.Health));
|
item.shortDescription = Desc(item, u);
|
||||||
item.unitValue = CardValue.True(u);
|
item.unitValue = CardValue.True(u);
|
||||||
SyncValue(item);
|
SyncValue(item);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ mat.common_electronic,Common electronics
|
|||||||
mat.rare_electronic,Rare electronics
|
mat.rare_electronic,Rare electronics
|
||||||
rig.label.cards,Graphics cards
|
rig.label.cards,Graphics cards
|
||||||
item.gpu.name,{0} {1}
|
item.gpu.name,{0} {1}
|
||||||
item.gpu.desc,"Hashrate {0} MH/s. Draws {1} kJ per day. Condition {2}%."
|
item.gpu.desc,"Hashrate {0} MH/s. Draws {1} kJ per day. Condition: {2}."
|
||||||
item.gpu.burnt.name,Burnt {0} {1}
|
item.gpu.burnt.name,Burnt {0} {1}
|
||||||
item.gpu.burnt.desc,This card no longer works.
|
item.gpu.burnt.desc,This card no longer works.
|
||||||
term.title,Trading Terminal
|
term.title,Trading Terminal
|
||||||
@@ -68,3 +68,7 @@ dealer.line2.2,"No warranty. Look before you take."
|
|||||||
dealer.line2.3,"Price is negotiable if you want them."
|
dealer.line2.3,"Price is negotiable if you want them."
|
||||||
inspect.flip.back,"Turn over"
|
inspect.flip.back,"Turn over"
|
||||||
inspect.flip.front,"Front side"
|
inspect.flip.front,"Front side"
|
||||||
|
item.gpu.grade.1,"like new"
|
||||||
|
item.gpu.grade.2,"decent"
|
||||||
|
item.gpu.grade.3,"clearly worn"
|
||||||
|
item.gpu.grade.4,"badly worn"
|
||||||
|
@@ -13,7 +13,7 @@ mat.common_electronic,普通电子元件
|
|||||||
mat.rare_electronic,稀有电子元件
|
mat.rare_electronic,稀有电子元件
|
||||||
rig.label.cards,显卡
|
rig.label.cards,显卡
|
||||||
item.gpu.name,{0} {1}
|
item.gpu.name,{0} {1}
|
||||||
item.gpu.desc,算力 {0} MH/s。耗电 {1} kJ/天。健康度 {2}%。
|
item.gpu.desc,算力 {0} MH/s。耗电 {1} kJ/天。成色 {2}。
|
||||||
item.gpu.burnt.name,烧毁的 {0} {1}
|
item.gpu.burnt.name,烧毁的 {0} {1}
|
||||||
item.gpu.burnt.desc,此显卡已无法工作。
|
item.gpu.burnt.desc,此显卡已无法工作。
|
||||||
term.title,交易终端
|
term.title,交易终端
|
||||||
@@ -67,3 +67,7 @@ dealer.line2.2,"不保修,看好了再拿。"
|
|||||||
dealer.line2.3,"要的话价钱好商量。"
|
dealer.line2.3,"要的话价钱好商量。"
|
||||||
inspect.flip.back,"翻到背面"
|
inspect.flip.back,"翻到背面"
|
||||||
inspect.flip.front,"翻到正面"
|
inspect.flip.front,"翻到正面"
|
||||||
|
item.gpu.grade.1,"接近全新"
|
||||||
|
item.gpu.grade.2,"成色尚可"
|
||||||
|
item.gpu.grade.3,"明显旧了"
|
||||||
|
item.gpu.grade.4,"磨损严重"
|
||||||
|
Reference in new issue
Block a user