Rig: base power draw follows the installed cards

The game recomputes a machine's draw from its base-draw tag whenever a
module is added or removed. The rig kept that tag at the body's 2 kJ, so the
game briefly rewrote the draw to a percentage of 2 kJ before the mod put it
back. The tag now carries the body plus all cards (without modules).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ZHU MINCHAOandClaude Sonnet 5.5 committed 2026-11-03 10:30:11 +08:00
1 parent 3a4572efb6
commit 8bdaad474e
2 files changed
+5

No files matched your search

+4
View File
@@ -207,6 +207,10 @@ namespace Decentralized
{
var b = Bonus(rig, modules);
int kj = RigKj(cards, b);
// 基础耗电 = 机身 + 所有显卡(不含模块)。游戏装卸模块时用这个基础值重算耗电,所以它必须随显卡变化,
// 否则游戏会把耗电改回"只有机身的 2 kJ"再按百分比折算。
int baseKj = RigKj(cards, ModuleBonus.None);
rig.ModifyTag("MACHINERY_DRAWN_POWER_BASE", s => s.Enable().SetInt(baseKj));
rig.ModifyTag(MachineryHelper.MACHINERY_DRAWN_POWER, s => s.Enable().SetInt(kj));
double hash = Cards(cards).Select(ToUnit).Sum(u => u.Hash(b));
int slots = SlotsOf(rig);