Skip to content

Commit

Permalink
fix for v1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
BadRyuner committed Jan 28, 2022
1 parent 45e7429 commit 89953c7
Show file tree
Hide file tree
Showing 37 changed files with 139 additions and 100 deletions.
14 changes: 7 additions & 7 deletions PulsarModLoader/Content/Components/CPU/CPUModManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ public static PLCPU CreateCPU(int Subtype, int level)
InCPU.SubType = Subtype;
InCPU.Name = CPUType.Name;
InCPU.Desc = CPUType.Description;
InCPU.GetType().GetField("m_IconTexture", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InCPU, CPUType.IconTexture);
InCPU.GetType().GetField("m_MarketPrice", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InCPU, (ObscuredInt)CPUType.MarketPrice);
InCPU.GetType().GetField("m_MaxPowerUsage_Watts", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InCPU, (CPUType.MaxPowerUsage_Watts));
InCPU.m_IconTexture = CPUType.IconTexture;
InCPU.m_MarketPrice = CPUType.MarketPrice;
InCPU.m_MaxPowerUsage_Watts = CPUType.MaxPowerUsage_Watts;
InCPU.CargoVisualPrefabID = CPUType.CargoVisualID;
InCPU.CanBeDroppedOnShipDeath = CPUType.CanBeDroppedOnShipDeath;
InCPU.Experimental = CPUType.Experimental;
InCPU.Unstable = CPUType.Unstable;
InCPU.Contraband = CPUType.Contraband;
InCPU.Speed = CPUType.Speed;
InCPU.GetType().GetField("m_Defense", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InCPU, CPUType.Defense);
InCPU.GetType().GetField("m_MaxCompUpgradeLevelBoost", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InCPU, CPUType.MaxCompUpgradeLevelBoost);
InCPU.GetType().GetField("m_MaxPawnItemUpgradeLevelBoost", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InCPU, CPUType.MaxItemUpgradeLevelBoost);
InCPU.GetType().GetField("Price_LevelMultiplierExponent", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InCPU, CPUType.Price_LevelMultiplierExponent);
InCPU.m_Defense = CPUType.Defense;
InCPU.m_MaxCompUpgradeLevelBoost = CPUType.MaxCompUpgradeLevelBoost;
InCPU.m_MaxPawnItemUpgradeLevelBoost = CPUType.MaxItemUpgradeLevelBoost;
InCPU.Price_LevelMultiplierExponent = CPUType.Price_LevelMultiplierExponent;
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ public static PLCaptainsChair CreateCaptainsChair(int Subtype, int level)
InCaptainsChair.SubType = Subtype;
InCaptainsChair.Name = CaptainsChairType.Name;
InCaptainsChair.Desc = CaptainsChairType.Description;
InCaptainsChair.GetType().GetField("m_IconTexture", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InCaptainsChair, CaptainsChairType.IconTexture);
InCaptainsChair.GetType().GetField("m_MarketPrice", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InCaptainsChair, (ObscuredInt)CaptainsChairType.MarketPrice);
InCaptainsChair.m_IconTexture = CaptainsChairType.IconTexture;
InCaptainsChair.m_MarketPrice = CaptainsChairType.MarketPrice;
InCaptainsChair.CargoVisualPrefabID = CaptainsChairType.CargoVisualID;
InCaptainsChair.CanBeDroppedOnShipDeath = CaptainsChairType.CanBeDroppedOnShipDeath;
InCaptainsChair.Experimental = CaptainsChairType.Experimental;
InCaptainsChair.Unstable = CaptainsChairType.Unstable;
InCaptainsChair.Contraband = CaptainsChairType.Contraband;
InCaptainsChair.GetType().GetField("Price_LevelMultiplierExponent", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InCaptainsChair, CaptainsChairType.Price_LevelMultiplierExponent);
InCaptainsChair.Price_LevelMultiplierExponent = CaptainsChairType.Price_LevelMultiplierExponent;
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ public static PLExtractor CreateExtractor(int Subtype, int level)
InExtractor.SubType = Subtype;
InExtractor.Name = ExtractorType.Name;
InExtractor.Desc = ExtractorType.Description;
InExtractor.GetType().GetField("m_IconTexture", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InExtractor, ExtractorType.IconTexture);
InExtractor.GetType().GetField("m_Stability", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InExtractor, ExtractorType.Stability);
InExtractor.GetType().GetField("m_MarketPrice", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InExtractor, (ObscuredInt)ExtractorType.MarketPrice);
InExtractor.m_IconTexture = ExtractorType.IconTexture;
InExtractor.m_Stability = ExtractorType.Stability;
InExtractor.m_MarketPrice = ExtractorType.MarketPrice;
InExtractor.CargoVisualPrefabID = ExtractorType.CargoVisualID;
InExtractor.CanBeDroppedOnShipDeath = ExtractorType.CanBeDroppedOnShipDeath;
InExtractor.Experimental = ExtractorType.Experimental;
InExtractor.Unstable = ExtractorType.Unstable;
InExtractor.Contraband = ExtractorType.Contraband;
InExtractor.GetType().GetField("Price_LevelMultiplierExponent", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InExtractor, ExtractorType.Price_LevelMultiplierExponent);
InExtractor.Price_LevelMultiplierExponent = ExtractorType.Price_LevelMultiplierExponent;
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,21 @@ public static PLFBRecipeModule CreateFBRecipeModule(int Subtype, int level)
InFBRecipeModule.SubType = Subtype;
InFBRecipeModule.Name = FBRecipeModuleType.Name;
InFBRecipeModule.Desc = FBRecipeModuleType.Description;
InFBRecipeModule.GetType().GetField("m_IconTexture", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InFBRecipeModule, FBRecipeModuleType.IconTexture);
InFBRecipeModule.GetType().GetField("m_MarketPrice", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InFBRecipeModule, (ObscuredInt)FBRecipeModuleType.MarketPrice);
InFBRecipeModule.m_IconTexture = FBRecipeModuleType.IconTexture;
InFBRecipeModule.m_MarketPrice = FBRecipeModuleType.MarketPrice;
InFBRecipeModule.CargoVisualPrefabID = FBRecipeModuleType.CargoVisualID;
InFBRecipeModule.CanBeDroppedOnShipDeath = FBRecipeModuleType.CanBeDroppedOnShipDeath;
InFBRecipeModule.Experimental = FBRecipeModuleType.Experimental;
InFBRecipeModule.Unstable = FBRecipeModuleType.Unstable;
InFBRecipeModule.Contraband = FBRecipeModuleType.Contraband;
InFBRecipeModule.GetType().GetField("Price_LevelMultiplierExponent", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InFBRecipeModule, FBRecipeModuleType.Price_LevelMultiplierExponent);
InFBRecipeModule.GetType().GetField("CookDurationMs", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InFBRecipeModule, FBRecipeModuleType.CookDurationMs);
InFBRecipeModule.GetType().GetField("CookedTimingOffsetMidpoint", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InFBRecipeModule, FBRecipeModuleType.CookedTimingOffsetMidpoint);
InFBRecipeModule.GetType().GetField("PerfectlyCookedMaxTimingOffset", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InFBRecipeModule, FBRecipeModuleType.PerfectlyCookedMaxTimingOffset);
InFBRecipeModule.GetType().GetField("CookedMaxTimingOffset", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InFBRecipeModule, FBRecipeModuleType.CookedMaxTimingOffset);
InFBRecipeModule.GetType().GetField("FoodSupplyCost", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InFBRecipeModule, FBRecipeModuleType.FoodSupplyCost);
InFBRecipeModule.GetType().GetField("BiscuitTypeToProduce", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InFBRecipeModule, EFoodType.MAX);
InFBRecipeModule.GetType().GetField("IconResourcePath", BindingFlags.Instance | BindingFlags.Public).SetValue(InFBRecipeModule, string.Empty);
InFBRecipeModule.Price_LevelMultiplierExponent = FBRecipeModuleType.Price_LevelMultiplierExponent;
InFBRecipeModule.CookDurationMs = FBRecipeModuleType.CookDurationMs;
InFBRecipeModule.CookedTimingOffsetMidpoint = FBRecipeModuleType.CookedTimingOffsetMidpoint;
InFBRecipeModule.PerfectlyCookedMaxTimingOffset = FBRecipeModuleType.PerfectlyCookedMaxTimingOffset;
InFBRecipeModule.CookedMaxTimingOffset = FBRecipeModuleType.CookedMaxTimingOffset;
InFBRecipeModule.FoodSupplyCost = FBRecipeModuleType.FoodSupplyCost;
InFBRecipeModule.BiscuitTypeToProduce = EFoodType.MAX;
InFBRecipeModule.IconResourcePath = string.Empty;
}
}
else
Expand Down
6 changes: 3 additions & 3 deletions PulsarModLoader/Content/Components/Hull/HullModManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,17 @@ public static PLHull CreateHull(int Subtype, int level)
InHull.SubType = Subtype;
InHull.Name = HullType.Name;
InHull.Desc = HullType.Description;
InHull.GetType().GetField("m_IconTexture", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InHull, HullType.IconTexture);
InHull.m_IconTexture = HullType.IconTexture;
InHull.Max = HullType.HullMax;
InHull.Armor = HullType.Armor;
InHull.Defense = HullType.Defense;
InHull.GetType().GetField("m_MarketPrice", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InHull, (ObscuredInt)HullType.MarketPrice);
InHull.m_MarketPrice = HullType.MarketPrice;
InHull.CargoVisualPrefabID = HullType.CargoVisualID;
InHull.CanBeDroppedOnShipDeath = HullType.CanBeDroppedOnShipDeath;
InHull.Experimental = HullType.Experimental;
InHull.Unstable = HullType.Unstable;
InHull.Contraband = HullType.Contraband;
InHull.GetType().GetField("Price_LevelMultiplierExponent", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InHull, HullType.Price_LevelMultiplierExponent);
InHull.Price_LevelMultiplierExponent = HullType.Price_LevelMultiplierExponent;
InHull.Max *= 2f;
InHull.Current = InHull.Max;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,20 @@ public static PLTrackerMissile CreateMissile(int Subtype, int level, int inSubTy
InMissile.SubType = Subtype;
InMissile.Name = MissileType.Name;
InMissile.Desc = MissileType.Description;
InMissile.GetType().GetField("m_IconTexture", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InMissile, MissileType.IconTexture);
InMissile.m_IconTexture = MissileType.IconTexture;
InMissile.Damage = MissileType.Damage;
InMissile.Speed = MissileType.Speed;
InMissile.DamageType = MissileType.DamageType;
InMissile.MissileRefillPrice = MissileType.MissileRefillPrice;
InMissile.AmmoCapacity = MissileType.AmmoCapacity;
InMissile.PrefabID = MissileType.PrefabID;
InMissile.GetType().GetField("m_MarketPrice", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InMissile, (ObscuredInt)MissileType.MarketPrice);
InMissile.m_MarketPrice = MissileType.MarketPrice;
InMissile.CargoVisualPrefabID = MissileType.CargoVisualID;
InMissile.CanBeDroppedOnShipDeath = MissileType.CanBeDroppedOnShipDeath;
InMissile.Experimental = MissileType.Experimental;
InMissile.Unstable = MissileType.Unstable;
InMissile.Contraband = MissileType.Contraband;
InMissile.GetType().GetField("Price_LevelMultiplierExponent", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InMissile, MissileType.Price_LevelMultiplierExponent);
InMissile.Price_LevelMultiplierExponent = MissileType.Price_LevelMultiplierExponent;
if (PhotonNetwork.isMasterClient)
{
InMissile.SubTypeData = (short)InMissile.AmmoCapacity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ public static PLMissionShipComponent CreateMissionShipComponent(int Subtype, int
InMissionShipComponent.SubType = Subtype;
InMissionShipComponent.Name = MissionShipComponentType.Name;
InMissionShipComponent.Desc = MissionShipComponentType.Description;
InMissionShipComponent.GetType().GetField("m_IconTexture", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InMissionShipComponent, MissionShipComponentType.IconTexture);
InMissionShipComponent.GetType().GetField("m_MarketPrice", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InMissionShipComponent, (ObscuredInt)MissionShipComponentType.MarketPrice);
InMissionShipComponent.m_IconTexture = MissionShipComponentType.IconTexture;
InMissionShipComponent.m_MarketPrice = MissionShipComponentType.MarketPrice;
InMissionShipComponent.CargoVisualPrefabID = MissionShipComponentType.CargoVisualID;
InMissionShipComponent.CanBeDroppedOnShipDeath = MissionShipComponentType.CanBeDroppedOnShipDeath;
InMissionShipComponent.Experimental = MissionShipComponentType.Experimental;
InMissionShipComponent.Unstable = MissionShipComponentType.Unstable;
InMissionShipComponent.Contraband = MissionShipComponentType.Contraband;
InMissionShipComponent.GetType().GetField("Price_LevelMultiplierExponent", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InMissionShipComponent, MissionShipComponentType.Price_LevelMultiplierExponent);
InMissionShipComponent.Price_LevelMultiplierExponent = MissionShipComponentType.Price_LevelMultiplierExponent;
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,21 @@ public static PLNuclearDevice CreateNuclearDevice(int Subtype, int level)
InNuclearDevice.SubType = Subtype;
InNuclearDevice.Name = NuclearDeviceType.Name;
InNuclearDevice.Desc = NuclearDeviceType.Description;
InNuclearDevice.GetType().GetField("m_IconTexture", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InNuclearDevice, NuclearDeviceType.IconTexture);
InNuclearDevice.GetType().GetField("m_MaxDamage", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InNuclearDevice, NuclearDeviceType.MaxDamage);
InNuclearDevice.GetType().GetField("m_Range", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InNuclearDevice, NuclearDeviceType.Range);
InNuclearDevice.GetType().GetField("m_FuelBurnRate", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InNuclearDevice, NuclearDeviceType.FuelBurnRate);
InNuclearDevice.GetType().GetField("m_TurnRate", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InNuclearDevice, NuclearDeviceType.TurnRate);
InNuclearDevice.GetType().GetField("m_IntimidationBonus", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InNuclearDevice, NuclearDeviceType.IntimidationBonus);
InNuclearDevice.GetType().GetField("m_TurnRate", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InNuclearDevice, NuclearDeviceType.TurnRate);
InNuclearDevice.GetType().GetField("m_Health", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InNuclearDevice, NuclearDeviceType.Health);
InNuclearDevice.GetType().GetField("m_MarketPrice", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InNuclearDevice, (ObscuredInt)NuclearDeviceType.MarketPrice);
InNuclearDevice.m_IconTexture = NuclearDeviceType.IconTexture;
InNuclearDevice.m_MaxDamage = NuclearDeviceType.MaxDamage;
InNuclearDevice.m_Range = NuclearDeviceType.Range;
InNuclearDevice.m_FuelBurnRate = NuclearDeviceType.FuelBurnRate;
InNuclearDevice.m_TurnRate = NuclearDeviceType.TurnRate;
InNuclearDevice.m_IntimidationBonus = NuclearDeviceType.IntimidationBonus;
InNuclearDevice.m_TurnRate = NuclearDeviceType.TurnRate;
InNuclearDevice.m_Health = NuclearDeviceType.Health;
InNuclearDevice.m_MarketPrice = NuclearDeviceType.MarketPrice;
InNuclearDevice.CargoVisualPrefabID = NuclearDeviceType.CargoVisualID;
InNuclearDevice.CanBeDroppedOnShipDeath = NuclearDeviceType.CanBeDroppedOnShipDeath;
InNuclearDevice.Experimental = NuclearDeviceType.Experimental;
InNuclearDevice.Unstable = NuclearDeviceType.Unstable;
InNuclearDevice.Contraband = NuclearDeviceType.Contraband;
InNuclearDevice.GetType().GetField("Price_LevelMultiplierExponent", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InNuclearDevice, NuclearDeviceType.Price_LevelMultiplierExponent);
InNuclearDevice.Price_LevelMultiplierExponent = NuclearDeviceType.Price_LevelMultiplierExponent;
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace PulsarModLoader.Content.Components
{
[HarmonyPatch()]
/* [HarmonyPatch()] // ???
class OnWarpUnstableNotificationPatch
{
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
Expand All @@ -30,5 +30,5 @@ static void PatchMethod(PLShipComponent InComp)
{
PulsarModLoader.Utilities.Messaging.Notification(InComp.GetItemName(true) + " has degraded to Level " + (InComp.Level + 1));
}
}
} */
}
Loading

0 comments on commit 89953c7

Please sign in to comment.