Skip to content

Commit 6cd5e3a

Browse files
committed
Update Code
1 parent 2d64c71 commit 6cd5e3a

File tree

9 files changed

+73
-29
lines changed

9 files changed

+73
-29
lines changed

CHANGELOG.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,38 @@
1-
- v3.1.0-alpha1 (Experimental 0.3.11010)
2-
+ 复制建造量子储物仓时不再将
3-
4-
+
1+
- v3.1.0-alpha0.1
2+
+ 调整了部分物品的位置
3+
+ 调整了地面黑雾的制造速度及数值
4+
+ 调整了部分配方(仅对新存档生效)
5+
+ 调整了戴森球对细胞点数的需求,提高太阳帆的发电量
6+
+ 调整了气态行星上的机甲采集效果
7+
+ 修复了协调中心效果`光伏扩容`无法正确生效的问题
8+
+ 修复了母星系可生成特殊海洋的问题
9+
+ 修复了燃烧室自动补充燃料的相关问题
10+
+ 增加了`地中海`星球的`放射性矿物`储量
11+
+ 优化了量化计算器的用户界面
12+
+ 复制建造量子储物仓时将复制频道信息
13+
+ 启用创世时不再解锁平台成就
14+
+ `电磁轨道弹射器`现在将使用集装科技加成
15+
+ 制造建筑将根据配方和制造速度额外耗电
16+
+ 量化计算器现在将在存档时保存自定义配置
17+
18+
+ Adjusted the position of some items
19+
+ Adjusted the creation speed and value of the ground black mist
20+
+ Adjusted some recipes (only effective for new archives)
21+
+ Adjusted the Dyson Sphere's cell point requirement to increase the power generation of solar sails
22+
+ Tweaked mecha harvesting effects on gas planets
23+
+ Fixed Coordination Center effect `Photovoltaic Expansion` not working correctly
24+
+ Fixed issue where home system could generate special oceans
25+
+ Fixed an issue with the automatic refueling of combustion chambers.
26+
+ Increased the amount of radioactive minerals on the planet Mediterranean.
27+
+ Optimized the UI of the Quantization Calculator.
28+
+ Channel information will be copied when building a Quantum Storage Silo.
29+
+ Platform achievement no longer unlocked when Genesis is enabled
30+
+ `Electromagnetic Orbital Catapults` will now use the Collective Technology bonus
31+
+ Fabricated buildings will consume additional power based on recipe and fabrication rate
32+
+ Quantization Calculator will now save custom configurations on archive
33+
34+
35+
Translated with DeepL.com (free version)
536

637

738
<details>

data/prefabDescs.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,18 +226,18 @@
226226
},
227227
{
228228
"ModelID": 300,
229-
"unitAttackDamage0": 3750,
230-
"unitAttackDamageInc0": 625
229+
"unitAttackDamage0": 2250,
230+
"unitAttackDamageInc0": 375
231231
},
232232
{
233233
"ModelID": 301,
234-
"unitAttackDamage0": 2700,
235-
"unitAttackDamageInc0": 300
234+
"unitAttackDamage0": 1620,
235+
"unitAttackDamageInc0": 180
236236
},
237237
{
238238
"ModelID": 302,
239-
"unitAttackDamage0": 8000,
240-
"unitAttackDamageInc0": 1000
239+
"unitAttackDamage0": 4800,
240+
"unitAttackDamageInc0": 600
241241
},
242242
{
243243
"ModelID": 373,

data/recipes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2214,7 +2214,7 @@
22142214
"IconPath": "",
22152215
"Type": 10,
22162216
"GridIndex": 1713,
2217-
"Time": 900,
2217+
"Time": 600,
22182218
"Input": [
22192219
1502,
22202220
1305,

lib/Assembly-CSharp-publicized.dll

2.5 KB
Binary file not shown.

src/Patches/QTools/NodeData.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ internal class NodeData
1111
internal ItemProto Item;
1212
internal float ItemCount;
1313
internal NodeOptions Options;
14+
internal bool IsNeed;
1415

1516
internal void RefreshFactoryCount()
1617
{
@@ -61,5 +62,7 @@ public void CheckFactory()
6162
internal void RefreshNeeds() => DataSet.RefreshNeeds();
6263

6364
public void RemoveNeed() => DataSet.RemoveNeed(this);
65+
66+
public void MarkAsNeed() => IsNeed = true;
6467
}
6568
}

src/Patches/QTools/NodeDataSet.cs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void RefreshNeeds()
4747
if (ReuseByProducts(node, AsRaws))
4848
ReuseByProducts(node, Raws);
4949

50-
if (_totalProliferatedItemCount > 0) MergeRaws(ItemRaw(QTools.ProliferatorProto, ProliferatorCount));
50+
if (_totalProliferatedItemCount > 0) MergeRaws(NewItemRaw(ProliferatorProto, ProliferatorCount));
5151

5252
OnNeedRefreshed?.Invoke();
5353
}
@@ -62,7 +62,7 @@ public void CalcFactories()
6262
NodeOptions nodeOptions = node.Options;
6363

6464
if (!nodeOptions.AsRaw && nodeOptions.Factory != null)
65-
MergeFactories(ItemRaw(nodeOptions.Factory, Mathf.Ceil(nodeOptions.FactoryCount)));
65+
MergeFactories(NewItemRaw(nodeOptions.Factory, Mathf.Ceil(nodeOptions.FactoryCount)));
6666
}
6767
}
6868

@@ -132,7 +132,10 @@ private void AddNodeChilds(NodeData node)
132132
if (node.ItemCount < 1e-6) return;
133133
}
134134

135-
MergeData(node);
135+
if (node.IsNeed)
136+
node.RefreshFactoryCount();
137+
else
138+
MergeData(node);
136139

137140
RecipeProto recipe = node.Options.Recipe;
138141

@@ -147,7 +150,7 @@ private void AddNodeChilds(NodeData node)
147150
{
148151
ItemProto proto = LDB.items.Select(recipe.Results[index]);
149152
float count = node.ItemCount * recipe.ResultCounts[index] / recipe.ResultCounts[idx];
150-
MergeByproducts(ItemRaw(proto, count));
153+
MergeByproducts(NewItemRaw(proto, count));
151154
}
152155
}
153156

@@ -164,7 +167,7 @@ private void AddNodeChilds(NodeData node)
164167

165168
if (node.Options.Strategy != EProliferatorStrategy.Nonuse) _totalProliferatedItemCount += count;
166169

167-
NodeData nodeData = ItemNeed(proto, count);
170+
NodeData nodeData = NewItemNeed(proto, count);
168171

169172
AddNodeChilds(nodeData);
170173
}
@@ -186,7 +189,7 @@ private NodeData MergeNode(Dictionary<ItemProto, NodeData> datas, NodeData node)
186189

187190
private void MergeData(NodeData node) => MergeNode(Datas, node).RefreshFactoryCount();
188191

189-
private void MergeNeeds(NodeData node) => MergeNode(Needs, node);
192+
private void MergeNeeds(NodeData node) => MergeNode(Needs, node).MarkAsNeed();
190193

191194
private void MergeRaws(NodeData node) => MergeNode(Raws, node);
192195

@@ -204,7 +207,7 @@ public void ClearNeeds()
204207

205208
public void AddItemNeed(ItemProto proto, float count)
206209
{
207-
NodeData data = ItemNeed(proto, count);
210+
NodeData data = NewItemNeed(proto, count);
208211
MergeNeeds(data);
209212
RefreshNeeds();
210213
}
@@ -215,13 +218,13 @@ public void RemoveNeed(NodeData nodeData)
215218
RefreshNeeds();
216219
}
217220

218-
private NodeData ItemNeed(ItemProto proto, float count)
221+
private NodeData NewItemNeed(ItemProto proto, float count)
219222
{
220223
if (CustomOptions.TryGetValue(proto, out NodeOptions option))
221224
{
222-
if (proto.isRaw || option.AsRaw) return ItemRaw(proto, count, option);
225+
if (proto.isRaw || option.AsRaw) return ItemRawWithOption(proto, count, option);
223226

224-
NodeData data = ItemNeed(proto, count, option);
227+
NodeData data = ItemNeedWithOption(proto, count, option);
225228
data.RefreshFactoryCount();
226229

227230
return data;
@@ -230,18 +233,18 @@ private NodeData ItemNeed(ItemProto proto, float count)
230233
RecipeProto recipe = proto.recipes.FirstOrDefault();
231234
Utils.ERecipeType type = (Utils.ERecipeType?)recipe?.Type ?? Utils.ERecipeType.None;
232235

233-
if (type == Utils.ERecipeType.None) return ItemRaw(proto, count);
236+
if (type == Utils.ERecipeType.None) return NewItemRaw(proto, count);
234237

235238
if (!DefaultMachine.TryGetValue(type, out ItemProto factory))
236239
{
237-
factory = QTools.RecipeTypeFactoryMap[type][0];
240+
factory = RecipeTypeFactoryMap[type][0];
238241
SetDefaultMachine(type, factory);
239242
}
240243

241244
return ItemNeed(proto, count, factory, recipe, !string.IsNullOrWhiteSpace(proto.miningFrom));
242245
}
243246

244-
private NodeData ItemRaw(ItemProto proto, float count, NodeOptions option)
247+
private NodeData ItemRawWithOption(ItemProto proto, float count, NodeOptions option)
245248
{
246249
var data = new NodeData
247250
{
@@ -254,7 +257,7 @@ private NodeData ItemRaw(ItemProto proto, float count, NodeOptions option)
254257
return data;
255258
}
256259

257-
private NodeData ItemRaw(ItemProto proto, float count)
260+
private NodeData NewItemRaw(ItemProto proto, float count)
258261
{
259262
var data = new NodeData
260263
{
@@ -269,7 +272,7 @@ private NodeData ItemRaw(ItemProto proto, float count)
269272
return data;
270273
}
271274

272-
private NodeData ItemNeed(ItemProto proto, float count, NodeOptions option)
275+
private NodeData ItemNeedWithOption(ItemProto proto, float count, NodeOptions option)
273276
{
274277
var data = new NodeData
275278
{

src/Patches/QTools/UI/ItemNeedDetail.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using HarmonyLib;
2-
using UnityEngine;
1+
using UnityEngine;
32
using UnityEngine.UI;
43

54
namespace ProjectGenesis.Patches

src/Patches/QTools/UI/UIQToolsWindow.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,14 @@ private void RefreshProductDetails()
193193

194194
var y = 20;
195195

196+
foreach (NodeData t in _data.Needs.Values)
197+
{
198+
ProductDetail productDetail = _productDetailPool.Alloc();
199+
productDetail.SetPos(y);
200+
productDetail.SetData(t);
201+
y += 60;
202+
}
203+
196204
foreach (NodeData t in _data.Datas.Values)
197205
{
198206
ProductDetail productDetail = _productDetailPool.Alloc();

src/ProjectGenesis.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class ProjectGenesis : BaseUnityPlugin, IModCanSave, IMultiplayerModWithS
4949
public const string MODGUID = "org.LoShin.GenesisBook";
5050
public const string MODNAME = "GenesisBook";
5151
public const string VERSION = "3.1.0";
52-
public const string DEBUGVERSION = "-alpha0.2";
52+
public const string DEBUGVERSION = "-alpha0.1";
5353

5454
public static bool LoadCompleted;
5555

0 commit comments

Comments
 (0)