53 lines
1.7 KiB
C#
53 lines
1.7 KiB
C#
#nullable enable
|
|
|
|
using Demo2.Domain;
|
|
|
|
namespace NightShiftProtocol
|
|
{
|
|
public sealed class NightShiftContent : IDemo2Mod
|
|
{
|
|
public string Id => "example.night-shift-protocol";
|
|
public string Version => "1.0.0";
|
|
|
|
public void Register(Demo2ContentRegistry registry)
|
|
{
|
|
registry.AddRecipe(new Demo2RecipeDefinition
|
|
{
|
|
Id = 100,
|
|
Name = "循环冷却",
|
|
InputA = Demo2MaterialKind.IronOre,
|
|
InputB = Demo2MaterialKind.Energy,
|
|
Output = Demo2MaterialKind.Ingot,
|
|
InputCountA = 2,
|
|
InputCountB = 1,
|
|
OutputCount = 2,
|
|
ProcessTicks = 34
|
|
});
|
|
registry.AddMachine(new Demo2MachineDefinition
|
|
{
|
|
Kind = Demo2MachineKind.NightShiftSmelter,
|
|
Name = "夜班熔炉",
|
|
Cost = 95,
|
|
RecipeId = 100,
|
|
Capacity = 16
|
|
});
|
|
registry.AddRule(new Demo2RuleDefinition
|
|
{
|
|
Id = "night-shift.continuous-production",
|
|
Name = "连续夜班",
|
|
Description = "连续完成三次相同配方且无故障时,结算倍率提高 40%。",
|
|
Category = Demo2RuleCategory.MachineState,
|
|
Instructions =
|
|
{
|
|
new Demo2RuleInstructionData
|
|
{
|
|
Opcode = Demo2RuleOpcode.MultiplyMultiplier,
|
|
Condition = Demo2RuleCondition.ThreeSameRecipes | Demo2RuleCondition.NoFaults,
|
|
Operand = 1400
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|