static void Postfix(PLWarpDriveProgram __instance, ref float __result) { int subtypeformodded = __instance.SubType - WarpDriveProgramModManager.Instance.VanillaWarpDriveProgramMaxType; if (subtypeformodded > -1 && subtypeformodded < WarpDriveProgramModManager.Instance.WarpDriveProgramTypes.Count) { __result = Mathf.Clamp01((Time.time - __instance.ShieldBooster_LastActivationTime) / WarpDriveProgramModManager.Instance.WarpDriveProgramTypes[subtypeformodded].ActiveTime); } }
static void Postfix(PLWarpDriveProgram __instance) { int subtypeformodded = __instance.SubType - WarpDriveProgramModManager.Instance.VanillaWarpDriveProgramMaxType; if (subtypeformodded > -1 && subtypeformodded < WarpDriveProgramModManager.Instance.WarpDriveProgramTypes.Count && Time.time - __instance.ShieldBooster_LastActivationTime < WarpDriveProgramModManager.Instance.WarpDriveProgramTypes[subtypeformodded].ActiveTime) { WarpDriveProgramModManager.Instance.WarpDriveProgramTypes[subtypeformodded].FinalLateAddStats(__instance); } }
static void Postfix(PLWarpDriveProgram inProgram, PLCPU __instance) { int subtypeformodded = __instance.SubType - CPUPluginManager.Instance.VanillaCPUMaxType; if (subtypeformodded > -1 && subtypeformodded < CPUPluginManager.Instance.CPUTypes.Count && inProgram != null) { CPUPluginManager.Instance.CPUTypes[subtypeformodded].WhenProgramIsRun(inProgram); } }
static void Postfix(PLWarpDriveProgram __instance, ref float __result) { int subtypeformodded = __instance.SubType - WarpDriveProgramPluginManager.Instance.VanillaWarpDriveProgramMaxType; if (subtypeformodded > -1 && subtypeformodded < WarpDriveProgramPluginManager.Instance.WarpDriveProgramTypes.Count) { __result = Mathf.Clamp01((Time.time - (float)__instance.GetType().GetField("ShieldBooster_LastActivationTime", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance)) / WarpDriveProgramPluginManager.Instance.WarpDriveProgramTypes[subtypeformodded].ActiveTime); } }
static void Postfix(PLWarpDriveProgram __instance) { int subtypeformodded = __instance.SubType - WarpDriveProgramPluginManager.Instance.VanillaWarpDriveProgramMaxType; if (subtypeformodded > -1 && subtypeformodded < WarpDriveProgramPluginManager.Instance.WarpDriveProgramTypes.Count && Time.time - (float)__instance.GetType().GetField("ShieldBooster_LastActivationTime", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance) < WarpDriveProgramPluginManager.Instance.WarpDriveProgramTypes[subtypeformodded].ActiveTime) { WarpDriveProgramPluginManager.Instance.WarpDriveProgramTypes[subtypeformodded].FinalLateAddStats(__instance); } }
static void Postfix(PLWarpDriveProgram __instance, PLShipStats inStats)//The devs were sill and added every number nececary but forgot to actually change the shield numbers { if (Time.time - (float)__instance.GetType().GetField("SuperShieldBooster_LastActivationTime", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance) < (float)__instance.GetType().GetField("SuperShieldBooster_ActiveTime", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance)) { //PulsarPluginLoader.Utilities.Logger.Info("Working"); float DontReflectOnItTooMuch = (float)__instance.GetType().GetField("SuperShieldBooster_BoostAmount", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); inStats.ShieldsChargeRate += DontReflectOnItTooMuch; inStats.ShieldsChargeRateMax += DontReflectOnItTooMuch; } }
public static PLWarpDriveProgram CreateWarpDriveProgram(int Subtype, int level) { PLWarpDriveProgram InWarpDriveProgram; if (Subtype >= Instance.VanillaWarpDriveProgramMaxType) { InWarpDriveProgram = new PLWarpDriveProgram(EWarpDriveProgramType.SHIELD_BOOSTER, level); int subtypeformodded = Subtype - Instance.VanillaWarpDriveProgramMaxType; if (Global.DebugLogging) { Logger.Info($"Subtype for modded is {subtypeformodded}"); } if (subtypeformodded <= Instance.WarpDriveProgramTypes.Count && subtypeformodded > -1) { if (Global.DebugLogging) { Logger.Info("Creating WarpDriveProgram from list info"); } WarpDriveProgramPlugin WarpDriveProgramType = Instance.WarpDriveProgramTypes[Subtype - Instance.VanillaWarpDriveProgramMaxType]; InWarpDriveProgram.SubType = Subtype; InWarpDriveProgram.Name = WarpDriveProgramType.Name; InWarpDriveProgram.Desc = WarpDriveProgramType.Description; InWarpDriveProgram.MaxLevelCharges = WarpDriveProgramType.MaxLevelCharges; InWarpDriveProgram.GetType().GetField("m_IconTexture", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InWarpDriveProgram, WarpDriveProgramType.IconTexture); InWarpDriveProgram.ShortName = WarpDriveProgramType.ShortName; InWarpDriveProgram.GetType().GetField("ShieldBooster_BoostAmount", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InWarpDriveProgram, 0f); InWarpDriveProgram.GetType().GetField("m_MarketPrice", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InWarpDriveProgram, (ObscuredInt)WarpDriveProgramType.MarketPrice); InWarpDriveProgram.CargoVisualPrefabID = WarpDriveProgramType.CargoVisualID; InWarpDriveProgram.CanBeDroppedOnShipDeath = WarpDriveProgramType.CanBeDroppedOnShipDeath; InWarpDriveProgram.Experimental = WarpDriveProgramType.Experimental; InWarpDriveProgram.Unstable = WarpDriveProgramType.Unstable; InWarpDriveProgram.Contraband = WarpDriveProgramType.Contraband; InWarpDriveProgram.GetType().GetField("Price_LevelMultiplierExponent", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(InWarpDriveProgram, (ObscuredFloat)WarpDriveProgramType.Price_LevelMultiplierExponent); if (PhotonNetwork.isMasterClient) { InWarpDriveProgram.Level = InWarpDriveProgram.MaxLevelCharges; } } } else { InWarpDriveProgram = new PLWarpDriveProgram((EWarpDriveProgramType)Subtype, level); } return(InWarpDriveProgram); }
static void Prefix(PLWarpDriveProgram __instance) { int subtypeformodded = __instance.SubType - WarpDriveProgramModManager.Instance.VanillaWarpDriveProgramMaxType; if (subtypeformodded > -1 && subtypeformodded < WarpDriveProgramModManager.Instance.WarpDriveProgramTypes.Count) { if (WarpDriveProgramModManager.Instance.WarpDriveProgramTypes[subtypeformodded].IsVirus) { PLServer.Instance.photonView.RPC("AddToSendQueue", PhotonTargets.All, new object[] { __instance.ShipStats.Ship.ShipID, __instance.ShipStats.Ship.VirusSendQueueCounter + 1, WarpDriveProgramModManager.Instance.WarpDriveProgramTypes[subtypeformodded].VirusSubtype, PLServer.Instance.GetEstimatedServerMs() }); PulsarModLoader.Utilities.Messaging.Notification($"{WarpDriveProgramModManager.Instance.WarpDriveProgramTypes[subtypeformodded].VirusSubtype}"); } else { __instance.ShieldBooster_LastActivationTime = Time.time; WarpDriveProgramModManager.Instance.WarpDriveProgramTypes[subtypeformodded].Execute(__instance); } } }
public static PLWarpDriveProgram CreateWarpDriveProgram(int Subtype, int level) { PLWarpDriveProgram InWarpDriveProgram; if (Subtype >= Instance.VanillaWarpDriveProgramMaxType) { InWarpDriveProgram = new PLWarpDriveProgram(EWarpDriveProgramType.SHIELD_BOOSTER, level); int subtypeformodded = Subtype - Instance.VanillaWarpDriveProgramMaxType; if (subtypeformodded <= Instance.WarpDriveProgramTypes.Count && subtypeformodded > -1) { WarpDriveProgramMod WarpDriveProgramType = Instance.WarpDriveProgramTypes[Subtype - Instance.VanillaWarpDriveProgramMaxType]; InWarpDriveProgram.SubType = Subtype; InWarpDriveProgram.Name = WarpDriveProgramType.Name; InWarpDriveProgram.Desc = WarpDriveProgramType.Description; InWarpDriveProgram.MaxLevelCharges = WarpDriveProgramType.MaxLevelCharges; InWarpDriveProgram.m_IconTexture = WarpDriveProgramType.IconTexture; InWarpDriveProgram.ShortName = WarpDriveProgramType.ShortName; InWarpDriveProgram.ShieldBooster_BoostAmount = 0f; InWarpDriveProgram.m_MarketPrice = WarpDriveProgramType.MarketPrice; InWarpDriveProgram.CargoVisualPrefabID = WarpDriveProgramType.CargoVisualID; InWarpDriveProgram.CanBeDroppedOnShipDeath = WarpDriveProgramType.CanBeDroppedOnShipDeath; InWarpDriveProgram.Experimental = WarpDriveProgramType.Experimental; InWarpDriveProgram.Unstable = WarpDriveProgramType.Unstable; InWarpDriveProgram.Contraband = WarpDriveProgramType.Contraband; InWarpDriveProgram.Price_LevelMultiplierExponent = WarpDriveProgramType.Price_LevelMultiplierExponent; if (PhotonNetwork.isMasterClient) { InWarpDriveProgram.Level = InWarpDriveProgram.MaxLevelCharges; } } } else { InWarpDriveProgram = new PLWarpDriveProgram((EWarpDriveProgramType)Subtype, level); } return(InWarpDriveProgram); }
public virtual void WhenProgramIsRun(PLWarpDriveProgram InProgram) { }
public virtual void Execute(PLWarpDriveProgram InWarpDriveProgram) { }
public override void WhenProgramIsRun(PLWarpDriveProgram inProgram) { PulsarPluginLoader.Utilities.Messaging.Notification("WarpdProgram thing running because of " + inProgram.Name); }