demo2
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a55b59e0ab15b874cb1d93c0056f5ab1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,52 @@
|
||||
#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
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e0d4428fa7f5541498beb4e6f3c37022
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "NightShiftProtocol.Rules",
|
||||
"rootNamespace": "NightShiftProtocol",
|
||||
"references": ["Demo2.Domain"],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": true
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c6cc7202b24d10d48ba0ede46ea9de10
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d848e706b74b0224291fa7d73d0d3a58
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "NightShiftProtocol.Unity",
|
||||
"rootNamespace": "NightShiftProtocol",
|
||||
"references": [
|
||||
"NightShiftProtocol.Rules",
|
||||
"Demo2.Domain",
|
||||
"Demo2.Runtime",
|
||||
"ShrinkModFramework.Runtime",
|
||||
"ShrinkCommand.Runtime"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a727c069198ce2a468b98ee588f5a733
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
#nullable enable
|
||||
|
||||
using Demo2.Runtime;
|
||||
using ShrinkCommand;
|
||||
using ShrinkModFramework;
|
||||
|
||||
namespace NightShiftProtocol
|
||||
{
|
||||
[ShrinkMod("example.night-shift-protocol", "夜班协议", "1.0.0", AutoApplyHarmonyPatches = false)]
|
||||
public sealed class NightShiftUnityMod : ShrinkModBase
|
||||
{
|
||||
public override void OnRegisterContent(ShrinkModContext context)
|
||||
{
|
||||
context.GetRegistry<Demo2.Domain.IDemo2Mod>(Demo2ModBridge.RegistryName)
|
||||
.Register(context.ModInfo.ModId, context.ModInfo.ModId, new NightShiftContent());
|
||||
}
|
||||
|
||||
public override void OnReady(ShrinkModContext context)
|
||||
{
|
||||
context.Log("Night-shift content registered without per-item callbacks or Harmony ECS patches.");
|
||||
}
|
||||
}
|
||||
|
||||
[ShrinkCommandSubscriber]
|
||||
public static class NightShiftServerCommands
|
||||
{
|
||||
[ShrinkCommand("demo2 night-shift status", Description = "显示夜班协议加载状态", Permission = "demo2.mods.inspect")]
|
||||
private static string Status() => "night-shift-protocol=registered; appliesTo=next-cycle-or-next-game";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a79e815068bd88c44a9e0715e3baaef1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"machines": ["night-shift-smelter"],
|
||||
"recipes": ["cyclic-cooling"],
|
||||
"rules": ["night-shift.continuous-production"],
|
||||
"commands": ["demo2 night-shift status"]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2bf17c59e9bea3e4eb568ce8169191e1
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"id": "example.night-shift-protocol",
|
||||
"version": "1.0.0",
|
||||
"rulesAssembly": "NightShiftProtocol.Rules.dll",
|
||||
"unityAssembly": "NightShiftProtocol.Unity.dll",
|
||||
"content": "content.json",
|
||||
"networkCompatible": true,
|
||||
"files": []
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7085a468410b9cd4790f4bc565a6ac2a
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user