public static bool GetProvidesOxygen(PipeSurfaceFloater __instance, ref bool __result) { if (Config.FILTER_ANYWHERE.Equals(DeathRun.config.filterPumpRules)) { return(true); } if (Config.FILTER_RADIATION.Equals(DeathRun.config.filterPumpRules)) { if (!RadiationUtils.isInShipsRadiation(__instance.floater.transform)) { // Not in ship's hotzone radius (fairly big -- where radiation would normally be in vanilla game) return(true); } } else { // Not physically inside the Aurora string LDBiome = RadiationUtils.getPlayerBiome(); if (!LDBiome.Contains("CrashedShip")) { return(true); } } // Don't let it provide oxygen __result = false; return(false); }
/** * True if player can't breathe the current air, because on the surface. */ private static bool isAirPoisoned(Player player) { if (!isSurfaceAirPoisoned()) { return(false); } if (player.IsInside() || player.precursorOutOfWater) { return(false); } float depth = Ocean.main.GetDepthOf(player.gameObject); if (depth > 5) { return(false); } // After repairing radiation leaks, when inside the Aurora. if (LeakingRadiation.main != null) { if (LeakingRadiation.main.GetNumLeaks() == 0) { if (Config.IRRADIATED.Equals(DeathRun.config.surfaceAir)) { return(false); } string LDBiome = RadiationUtils.getPlayerBiome(); if (LDBiome.Contains("CrashedShip_Interior")) { return(false); } } } return(true); }
private static bool Update(RadiationsScreenFXController __instance) { if ((Player.main == null) || (LeakingRadiation.main == null) || Config.FX_NORMAL.Equals(DeathRun.config.radiationFX)) { DeathRun.saveData.playerSave.backgroundRads = 0; return(true); } Vector3 reactorRoom = new Vector3(873.7f, 2.9f, -1.7f); float distance = (Player.main.transform.position - reactorRoom).magnitude; //LeakingRadiation.main.transform.position float backgroundRads; //ErrorMessage.AddMessage("LDBiome=" + LDBiome + " PlayerBiome=" + PlayerBiome); if (RadiationUtils.isInShipsRadiation(Player.main.transform)) { backgroundRads = MINIMUM_AMOUNT_SHIP; } else if (RadiationUtils.isInAnyRadiation(Player.main.transform)) { backgroundRads = MINIMUM_AMOUNT_NORMAL; } else { backgroundRads = 0; } DeathRun.saveData.playerSave.backgroundRads = backgroundRads; if (Player.main == null) { return(true); } string LDBiome = RadiationUtils.getPlayerBiome(); string PlayerBiome = Player.main.GetBiomeString(); // In the moments right after we fix the leaks, the visible radiation fades back a bit. float fixFactor = 1.0f; if (LeakingRadiation.main.GetNumLeaks() == 0) { if (DeathRun.saveData.playerSave.fixedRadiation == 0) { DeathRun.saveData.playerSave.fixedRadiation = DayNightCycle.main.timePassedAsFloat; } else if (DayNightCycle.main.timePassedAsFloat > DeathRun.saveData.playerSave.fixedRadiation + FIX_PERIOD) { fixFactor = 0.0f; } else { fixFactor = 1 - ((DayNightCycle.main.timePassedAsFloat - DeathRun.saveData.playerSave.fixedRadiation) / FIX_PERIOD); } } // If we're inside the ship (or near it), and radiation leaks aren't fixed yet, we show quite a bit more radiation effects if (fixFactor > 0) { if (Config.FX_CHERNOBYL.Equals(DeathRun.config.radiationFX)) { if (LDBiome.Contains("CrashedShip")) { if (LDBiome.Contains("Interior_Power") && !LDBiome.Contains("Corridor")) { if (Player.main.IsSwimming()) { backgroundRads = 2.0f; } else { backgroundRads = 1.6f; } } else if (LDBiome.Contains("PowerCorridor")) { if (distance <= 32) { backgroundRads = 1.4f; } else { backgroundRads = 1.2f; } } else if (LDBiome.Contains("Elevator") || LDBiome.Contains("Locker") || LDBiome.Contains("Seamoth")) { backgroundRads = 1.0f; } else if (LDBiome.Contains("Exo") || LDBiome.Contains("Living") || LDBiome.Contains("Cargo")) { backgroundRads = 0.8f; } else if (LDBiome.Contains("Entrance_03") || LDBiome.Contains("Entrance_01_01")) { backgroundRads = 0.7f; } else if (LDBiome.Contains("THallway_Lower") || LDBiome.Contains("Entrance_01")) { backgroundRads = 0.6f; } else if (LDBiome.Contains("THallway") || LDBiome.Contains("Entrance")) { backgroundRads = 0.5f; } else if (PlayerBiome.Contains("crashedShip") || PlayerBiome.Contains("generatorRoom")) { backgroundRads = 0.4f; } else if (PlayerBiome.Contains("CrashZone") || PlayerBiome.Contains("crashZone")) { backgroundRads = 0.3f; } } if (backgroundRads > 0.8f) { backgroundRads = backgroundRads * LeakingRadiation.main.GetNumLeaks() / 11; if (backgroundRads < 0.8f) { backgroundRads = 0.8f; } } } else { if (LDBiome.Contains("Interior_Power") && !LDBiome.Contains("Corridor")) { if (Player.main.IsSwimming()) { backgroundRads = 0.5f; } else { backgroundRads = 0.4f; } } else if (PlayerBiome.Contains("CrashZone") || PlayerBiome.Contains("crashZone") || PlayerBiome.Contains("crashedShip") || PlayerBiome.Contains("generatorRoom")) { backgroundRads = 0.3f; } } backgroundRads = backgroundRads * fixFactor; if (backgroundRads > DeathRun.saveData.playerSave.backgroundRads) { DeathRun.saveData.playerSave.backgroundRads = backgroundRads; } } //ErrorMessage.AddMessage("Dist=" + distance + " Rads=" + backgroundRads + " Leaks="+ LeakingRadiation.main.GetNumLeaks()); //CattleLogger.Message("start = " + LeakingRadiation.main.kStartRadius); //CattleLogger.Message("max = " + LeakingRadiation.main.kMaxRadius); float rads = Mathf.Max(Player.main.radiationAmount, backgroundRads); // If Player is naturally in at least our minimum display amount, just run normal method. if (Player.main.radiationAmount >= rads) { return(true); } if (rads >= __instance.prevRadiationAmount && rads > 0f) { __instance.animTime += Time.deltaTime / __instance.fadeDuration; } else { __instance.animTime -= Time.deltaTime / __instance.fadeDuration; } __instance.animTime = Mathf.Clamp01(__instance.animTime); __instance.fx.noiseFactor = rads * __instance.radiationMultiplier + __instance.minRadiation * __instance.animTime; if (__instance.fx.noiseFactor > 0f && !__instance.fx.enabled) { __instance.fx.enabled = true; } __instance.prevRadiationAmount = rads; return(false); }