Skip to content

Commit 2478407

Browse files
committed
ProductOverflow & RecipePowerRate changes
1 parent e855872 commit 2478407

11 files changed

Lines changed: 263 additions & 161 deletions

File tree

data/recipes.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@
439439
],
440440
"Explicit": true,
441441
"Handcraft": false,
442+
"Overflow": 2,
442443
"NonProductive": false
443444
},
444445
{
@@ -854,6 +855,7 @@
854855
],
855856
"Explicit": true,
856857
"Handcraft": false,
858+
"Overflow": 2,
857859
"NonProductive": false
858860
},
859861
{
@@ -1093,6 +1095,7 @@
10931095
],
10941096
"Explicit": false,
10951097
"Handcraft": false,
1098+
"PowerFactor": 18,
10961099
"NonProductive": true
10971100
},
10981101
{
@@ -1588,6 +1591,7 @@
15881591
],
15891592
"Explicit": false,
15901593
"Handcraft": false,
1594+
"PowerFactor": 18,
15911595
"NonProductive": false
15921596
},
15931597
{
@@ -2055,6 +2059,7 @@
20552059
],
20562060
"Explicit": true,
20572061
"Handcraft": false,
2062+
"PowerFactor": 18,
20582063
"NonProductive": true
20592064
},
20602065
{
@@ -2916,6 +2921,7 @@
29162921
],
29172922
"Explicit": true,
29182923
"Handcraft": false,
2924+
"PowerFactor": 4,
29192925
"NonProductive": true
29202926
},
29212927
{
@@ -4603,6 +4609,8 @@
46034609
],
46044610
"Explicit": true,
46054611
"Handcraft": false,
4612+
"Overflow": 32,
4613+
"PowerFactor": 8,
46064614
"NonProductive": false
46074615
},
46084616
{
@@ -4984,6 +4992,7 @@
49844992
],
49854993
"Explicit": true,
49864994
"Handcraft": false,
4995+
"Overflow": 2,
49874996
"NonProductive": false
49884997
},
49894998
{
@@ -5245,6 +5254,7 @@
52455254
],
52465255
"Explicit": true,
52475256
"Handcraft": false,
5257+
"PowerFactor": 18,
52485258
"NonProductive": true
52495259
},
52505260
{
@@ -5361,6 +5371,7 @@
53615371
],
53625372
"Explicit": true,
53635373
"Handcraft": false,
5374+
"PowerFactor": 8,
53645375
"NonProductive": false
53655376
},
53665377
{
@@ -5417,6 +5428,7 @@
54175428
],
54185429
"Explicit": true,
54195430
"Handcraft": false,
5431+
"PowerFactor": 8,
54205432
"NonProductive": false
54215433
},
54225434
{
@@ -5643,6 +5655,8 @@
56435655
],
56445656
"Explicit": true,
56455657
"Handcraft": false,
5658+
"Overflow": 32,
5659+
"PowerFactor": 4,
56465660
"NonProductive": false
56475661
},
56485662
{
@@ -5672,6 +5686,8 @@
56725686
],
56735687
"Explicit": true,
56745688
"Handcraft": false,
5689+
"Overflow": 32,
5690+
"PowerFactor": 4,
56755691
"NonProductive": false
56765692
},
56775693
{
@@ -5753,6 +5769,7 @@
57535769
],
57545770
"Explicit": true,
57555771
"Handcraft": false,
5772+
"PowerFactor": 4,
57565773
"NonProductive": false
57575774
},
57585775
{
@@ -5863,6 +5880,7 @@
58635880
],
58645881
"Explicit": true,
58655882
"Handcraft": false,
5883+
"Overflow": 2,
58665884
"NonProductive": false
58675885
},
58685886
{
@@ -5892,6 +5910,7 @@
58925910
],
58935911
"Explicit": true,
58945912
"Handcraft": false,
5913+
"Overflow": 2,
58955914
"NonProductive": false
58965915
},
58975916
{
@@ -5921,6 +5940,7 @@
59215940
],
59225941
"Explicit": true,
59235942
"Handcraft": false,
5943+
"Overflow": 2,
59245944
"NonProductive": false
59255945
},
59265946
{
@@ -6514,6 +6534,7 @@
65146534
],
65156535
"Explicit": true,
65166536
"Handcraft": true,
6537+
"Overflow": 32,
65176538
"NonProductive": false
65186539
}
65196540
]

data/strings.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,8 +1031,8 @@
10311031
},
10321032
{
10331033
"Name": "R水电解",
1034-
"ZHCN": "通过直流电将水电解为氢气与氧气,是获取清洁氢能源的基础工艺。\n<color=\"#FD965ECC\">在所有产物均堆积前不会停止工作。</color>",
1035-
"ENUS": "Electrolysis of water into hydrogen and oxygen using direct current—the fundamental process for obtaining clean hydrogen energy.\n<color=\"#FD965ECC\">Will not stop working until all products are accumulated.</color>"
1034+
"ZHCN": "通过直流电将水电解为氢气与氧气,是获取清洁氢能源的基础工艺。",
1035+
"ENUS": "Electrolysis of water into hydrogen and oxygen using direct current—the fundamental process for obtaining clean hydrogen energy."
10361036
},
10371037
{
10381038
"Name": "盐水电解",
@@ -1041,8 +1041,8 @@
10411041
},
10421042
{
10431043
"Name": "R盐水电解",
1044-
"ZHCN": "采用离子交换膜电解技术处理氯化钠溶液,阳极产生的氯气与阴极产生的氢气经催化反应后溶于水形成盐酸,同时阴极区富集氢氧化钠溶液。\n<color=\"#FD965ECC\">在所有产物均堆积前不会停止工作。</color>",
1045-
"ENUS": "Utilizing ion exchange membrane electrolysis to process sodium chloride solution—chlorine gas from the anode and hydrogen gas from the cathode undergo catalytic reaction and dissolve in water to form hydrochloric acid, while sodium hydroxide solution is enriched at the cathode.\n<color=\"#FD965ECC\">Will not stop working until all products are accumulated.</color>"
1044+
"ZHCN": "采用离子交换膜电解技术处理氯化钠溶液,阳极产生的氯气与阴极产生的氢气经催化反应后溶于水形成盐酸,同时阴极区富集氢氧化钠溶液。",
1045+
"ENUS": "Utilizing ion exchange membrane electrolysis to process sodium chloride solution—chlorine gas from the anode and hydrogen gas from the cathode undergo catalytic reaction and dissolve in water to form hydrochloric acid, while sodium hydroxide solution is enriched at the cathode."
10461046
},
10471047
{
10481048
"Name": "钠盐转化",
@@ -1061,8 +1061,8 @@
10611061
},
10621062
{
10631063
"Name": "R海水淡化",
1064-
"ZHCN": "采用半透膜分离技术,在压力驱动下使水分子选择性透过而截留盐分,实现海水向淡水的转化。\n<color=\"#FD965ECC\">在所有产物均堆积前不会停止工作。</color>",
1065-
"ENUS": "Employing semi-permeable membrane separation technology, driving water molecules to selectively permeate while retaining salts under pressure—achieving the conversion of seawater to freshwater.\n<color=\"#FD965ECC\">Will not stop working until all products are accumulated.</color>"
1064+
"ZHCN": "采用半透膜分离技术,在压力驱动下使水分子选择性透过而截留盐分,实现海水向淡水的转化。",
1065+
"ENUS": "Employing semi-permeable membrane separation technology, driving water molecules to selectively permeate while retaining salts under pressure—achieving the conversion of seawater to freshwater."
10661066
},
10671067
{
10681068
"Name": "甲烷偶联",
@@ -1071,8 +1071,8 @@
10711071
},
10721072
{
10731073
"Name": "R甲烷偶联",
1074-
"ZHCN": "在催化剂作用下使甲烷分子发生氧化偶联反应,碳-氢键断裂并重组为丙烯分子,是实现低碳烷烃高值化利用的关键路径。\n<color=\"#FD965ECC\">在所有产物均堆积前不会停止工作。</color>",
1075-
"ENUS": "Catalytic oxidative coupling of methane molecules, breaking and reforming carbon-hydrogen bonds into propylene molecules—a key pathway for high-value utilization of low-carbon alkanes.\n<color=\"#FD965ECC\">Will not stop working until all products are accumulated.</color>"
1074+
"ZHCN": "在催化剂作用下使甲烷分子发生氧化偶联反应,碳-氢键断裂并重组为丙烯分子,是实现低碳烷烃高值化利用的关键路径。",
1075+
"ENUS": "Catalytic oxidative coupling of methane molecules, breaking and reforming carbon-hydrogen bonds into propylene molecules—a key pathway for high-value utilization of low-carbon alkanes."
10761076
},
10771077
{
10781078
"Name": "合成氨",
@@ -1181,8 +1181,8 @@
11811181
},
11821182
{
11831183
"Name": "R等离子精炼",
1184-
"ZHCN": "利用高温等离子体流裂解原油大分子,轻组分气化后经冷凝分离得氢气,重组分富集为焦油。\n<color=\"#FD965ECC\">在所有产物均堆积前不会停止工作。</color>",
1185-
"ENUS": "Utilizing high-temperature plasma flow to crack crude oil macromolecules—light components gasified and separated by condensation to obtain hydrogen, heavy components enriched as tar.\n<color=\"#FD965ECC\">Will not stop working until all products are accumulated.</color>"
1184+
"ZHCN": "利用高温等离子体流裂解原油大分子,轻组分气化后经冷凝分离得氢气,重组分富集为焦油。",
1185+
"ENUS": "Utilizing high-temperature plasma flow to crack crude oil macromolecules—light components gasified and separated by condensation to obtain hydrogen, heavy components enriched as tar."
11861186
},
11871187
{
11881188
"Name": "催化重整",
@@ -1191,8 +1191,8 @@
11911191
},
11921192
{
11931193
"Name": "R催化重整",
1194-
"ZHCN": "在铂铼双金属催化剂作用下,丙烯经历脱氢环化与芳构化反应转化为苯,虽效率受限但为化石能源清洁利用的经典工艺。\n<color=\"#FD965ECC\">在所有产物均堆积前不会停止工作。</color>",
1195-
"ENUS": "Under platinum-rhenium bimetallic catalysis, propylene undergoes dehydrogenation cyclization and aromatization to convert to benzene—though efficiency-limited, a classic process for clean utilization of fossil energy.\n<color=\"#FD965ECC\">Will not stop working until all products are accumulated.</color>"
1194+
"ZHCN": "在铂铼双金属催化剂作用下,丙烯经历脱氢环化与芳构化反应转化为苯,虽效率受限但为化石能源清洁利用的经典工艺。",
1195+
"ENUS": "Under platinum-rhenium bimetallic catalysis, propylene undergoes dehydrogenation cyclization and aromatization to convert to benzene—though efficiency-limited, a classic process for clean utilization of fossil energy."
11961196
},
11971197
{
11981198
"Name": "氨氧化",
@@ -1206,8 +1206,8 @@
12061206
},
12071207
{
12081208
"Name": "R石墨烯",
1209-
"ZHCN": "在铜箔基底上进行化学气相沉积,甲烷高温裂解出的碳原子自组装为单层石墨烯,同时副产氢气。\n<color=\"#FD965ECC\">在所有产物均堆积前不会停止工作。</color>",
1210-
"ENUS": "Chemical vapor deposition on copper foil substrate—carbon atoms from high-temperature methane cracking self-assemble into monolayer graphene, with hydrogen as byproduct.\n<color=\"#FD965ECC\">Will not stop working until all products are accumulated.</color>"
1209+
"ZHCN": "在铜箔基底上进行化学气相沉积,甲烷高温裂解出的碳原子自组装为单层石墨烯,同时副产氢气。",
1210+
"ENUS": "Chemical vapor deposition on copper foil substrate—carbon atoms from high-temperature methane cracking self-assemble into monolayer graphene, with hydrogen as byproduct."
12111211
},
12121212
{
12131213
"Name": "R石墨烯(高效)",
@@ -1231,8 +1231,8 @@
12311231
},
12321232
{
12331233
"Name": "R放射矿物精炼",
1234-
"ZHCN": "采用碱法浸出工艺,以氢氧化钠溶液溶解放射性矿物基质,使铀、钍元素以可溶性络合物形式进入溶液后沉淀富集。\n<color=\"#FD965ECC\">在所有产物均堆积前不会停止工作。</color>",
1235-
"ENUS": "Employing alkaline leaching process, using sodium hydroxide solution to dissolve radioactive mineral matrix—uranium and thorium enter solution as soluble complexes and precipitate for enrichment.\n<color=\"#FD965ECC\">Will not stop working until all products are accumulated.</color>"
1234+
"ZHCN": "采用碱法浸出工艺,以氢氧化钠溶液溶解放射性矿物基质,使铀、钍元素以可溶性络合物形式进入溶液后沉淀富集。",
1235+
"ENUS": "Employing alkaline leaching process, using sodium hydroxide solution to dissolve radioactive mineral matrix—uranium and thorium enter solution as soluble complexes and precipitate for enrichment."
12361236
},
12371237
{
12381238
"Name": "物质回收",

data/strings_mod.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,21 @@
244244
"ZHCN": "机甲背包负熵奇点数量不足,无法折跃",
245245
"ENUS": "The mecha does not have enough Negentropy Singularity to Quantum Navigation"
246246
},
247+
{
248+
"Name": "配方额外耗电提示",
249+
"ZHCN": "配方额外耗电:",
250+
"ENUS": "Additional power consumption: "
251+
},
252+
{
253+
"Name": "此配方允许所有产物溢出运行",
254+
"ZHCN": "在所有产物均堆积前不会停止工作。",
255+
"ENUS": "Will not stop working until all products are accumulated."
256+
},
257+
{
258+
"Name": "此配方允许x位产物溢出运行",
259+
"ZHCN": "此配方的第{0}个产物不会堆积。",
260+
"ENUS": "This recipe allows product(s) {0} to overflow."
261+
},
247262
{
248263
"Name": "化学能",
249264
"ZHCN": "化学能",

preloader/Preloader.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,16 @@ private static FieldDefinition GetFieldByName(this TypeDefinition type, string n
4444
private static void AddEnumField(this TypeDefinition type, string name, object constant, FieldAttributes fieldAttributes) =>
4545
type.Fields.Add(new FieldDefinition(name, fieldAttributes, type) { Constant = constant, });
4646

47-
private static void AddTypeField(this AssemblyDefinition assembly, string typeName, string oriFieldName, string newFieldName)
47+
private static void AddTypeField(this AssemblyDefinition assembly, string typeName, string oriFieldName, string newFieldName,
48+
bool notSerialized = false)
4849
{
4950
TypeDefinition type = assembly.GetTypeByName(typeName);
5051
FieldDefinition oriField = type.GetFieldByName(oriFieldName);
51-
type.Fields.Add(new FieldDefinition(newFieldName, oriField.Attributes, oriField.FieldType));
52+
var fieldDefinition = new FieldDefinition(newFieldName, oriField.Attributes, oriField.FieldType);
53+
54+
if (notSerialized) fieldDefinition.Attributes |= FieldAttributes.NotSerialized;
55+
56+
type.Fields.Add(fieldDefinition);
5257
}
5358

5459
public static void Patch(AssemblyDefinition assembly)
@@ -73,6 +78,9 @@ public static void Patch(AssemblyDefinition assembly)
7378
assembly.AddTypeField("PlanetData", "birthResourcePoint0", "birthResourcePoint4");
7479

7580
assembly.AddTypeField("GameDesc", "isSandboxMode", "isFastStartMode");
81+
82+
assembly.AddTypeField("RecipeProto", "TimeSpend", "PowerFactor", true);
83+
assembly.AddTypeField("RecipeProto", "TimeSpend", "Overflow", true);
7684
}
7785
}
7886
}

src/Patches/Hooks/AddMatrix/ResearchLabPatches.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,13 @@ public static IEnumerable<CodeInstruction> FactorySystem_GameTickLabResearchMode
228228
IL_0300: call instance unsigned int32 LabComponent::InternalUpdateResearch(float32, float32, int32[], valuetype TechState&, int32&, int64&, int64&)
229229
IL_0305: stloc.s _state
230230
*/
231-
231+
232232
matcher.MatchForward(false,
233233
new CodeMatch(new CodeInstruction(OpCodes.Call,
234234
AccessTools.Method(typeof(LabComponent), nameof(LabComponent.InternalUpdateResearch)))));
235235

236236
object local = matcher.Advance(-8).Operand;
237-
237+
238238
// change techSpeed
239239
matcher.Advance(3).InsertAndAdvance(new CodeInstruction(OpCodes.Ldarg_0), new CodeInstruction(OpCodes.Ldloc_S, local),
240240
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(ResearchLabPatches), nameof(SetResearchSpeed))));

0 commit comments

Comments
 (0)