1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-08 22:13:30 +08:00

temp fix for GalacticScale

This commit is contained in:
2023-02-15 21:45:04 +08:00
parent 698a9e3747
commit d7015e5459
2 changed files with 48 additions and 8 deletions

View File

@@ -285,37 +285,37 @@ public class CheatEnabler : BaseUnityPlugin
if (_fireIceOnBirthPlanet)
{
veins.Add(8);
settings.AddRange(new [] {1f, 1f, 0,5f, 1f});
settings.AddRange(new [] {1f, 1f, 0.5f, 1f});
}
if (_kimberliteOnBirthPlanet)
{
veins.Add(9);
settings.AddRange(new [] {1f, 1f, 0,5f, 1f});
settings.AddRange(new [] {1f, 1f, 0.5f, 1f});
}
if (_fractalOnBirthPlanet)
{
veins.Add(10);
settings.AddRange(new [] {1f, 1f, 0,5f, 1f});
settings.AddRange(new [] {1f, 1f, 0.5f, 1f});
}
if (_organicOnBirthPlanet)
{
veins.Add(11);
settings.AddRange(new [] {1f, 1f, 0,5f, 1f});
settings.AddRange(new [] {1f, 1f, 0.5f, 1f});
}
if (_opticalOnBirthPlanet)
{
veins.Add(12);
settings.AddRange(new [] {1f, 1f, 0,5f, 1f});
settings.AddRange(new [] {1f, 1f, 0.5f, 1f});
}
if (_spiniformOnBirthPlanet)
{
veins.Add(13);
settings.AddRange(new [] {1f, 1f, 0,5f, 1f});
settings.AddRange(new [] {1f, 1f, 0.5f, 1f});
}
if (_unipolarOnBirthPlanet)
{
veins.Add(14);
settings.AddRange(new [] {1f, 1f, 0,5f, 1f});
settings.AddRange(new [] {1f, 1f, 0.5f, 1f});
}
if (veins.Count > 0)
{

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Reflection.Emit;
using BepInEx;
using BepInEx.Configuration;
@@ -73,6 +74,20 @@ public class Patch : BaseUnityPlugin
Harmony.CreateAndPatchAll(typeof(BeltFix));
}
[HarmonyTranspiler, HarmonyPatch(typeof(BuildTool_Path), "CheckBuildConditions")]
private static IEnumerable<CodeInstruction> BuildTool_Path_CheckBuildConditions_Transpiler(
IEnumerable<CodeInstruction> instructions)
{
foreach (var instr in instructions)
{
if (instr.opcode == OpCodes.Ldc_R4 && instr.OperandIs(0.28f))
{
instr.operand = 0.21f;
}
yield return instr;
}
}
[HarmonyTranspiler, HarmonyPatch(typeof(LabComponent), "SetFunction")]
private static IEnumerable<CodeInstruction> LabComponent_SetFunction_Transpiler(IEnumerable<CodeInstruction> instructions)
{
@@ -135,6 +150,21 @@ public class Patch : BaseUnityPlugin
}
}
foreach (var proto in LDB.items.dataArray)
{
var prefabDesc = proto.prefabDesc;
FixExtValue(ref prefabDesc.buildCollider.ext.x);
FixExtValue(ref prefabDesc.buildCollider.ext.y);
FixExtValue(ref prefabDesc.buildCollider.ext.z);
if (prefabDesc.buildColliders == null) continue;
for (var i = 0; i < prefabDesc.buildColliders.Length; i++)
{
FixExtValue(ref prefabDesc.buildColliders[i].ext.x);
FixExtValue(ref prefabDesc.buildColliders[i].ext.y);
FixExtValue(ref prefabDesc.buildColliders[i].ext.z);
}
}
foreach (var proto in LDB.items.dataArray)
{
var prefabDesc = proto.prefabDesc;
@@ -204,4 +234,14 @@ public class Patch : BaseUnityPlugin
}
}
}
private static void FixExtValue(ref float v)
{
if (v == 0f)
{
return;
}
var b = Math.Abs(v);
v = (v - b) * 0.75f + b;
}
}