public static string GetLabel(this PsychGlow gl) { string result; if (gl != PsychGlow.Dark) { if (gl != PsychGlow.Lit) { if (gl != PsychGlow.Overlit) { throw new ArgumentException(); } result = "LitBrightly".Translate(); } else { result = "Lit".Translate(); } } else { result = "Dark".Translate(); } return(result); }
public static string GetLabel(this PsychGlow gl) { return(gl switch { PsychGlow.Dark => "Dark".Translate(), PsychGlow.Lit => "Lit".Translate(), PsychGlow.Overlit => "LitBrightly".Translate(), _ => throw new ArgumentException(), });
/// <summary> /// Check the plant is not overlit. /// </summary> public static bool IsLightConditionOk(IntVec3 cavePlantPosition) { PsychGlow light = Find.GlowGrid.PsychGlowAt(cavePlantPosition); if ((light == PsychGlow.Dark) || (light == PsychGlow.Lit)) { return(true); } return(false); }
public static string GetLabel(this PsychGlow gl) { if (gl == PsychGlow.Dark) { return("Dark".Translate()); } if (gl == PsychGlow.Lit) { return("Lit".Translate()); } if (gl != PsychGlow.Overlit) { throw new ArgumentException(); } return("LitBrightly".Translate()); }
public static string GetLabel(this PsychGlow gl) { switch (gl) { case PsychGlow.Dark: return("Dark".Translate()); case PsychGlow.Lit: return("Lit".Translate()); case PsychGlow.Overlit: return("LitBrightly".Translate()); default: throw new ArgumentException(); } }
// Token: 0x0600001C RID: 28 RVA: 0x000031E8 File Offset: 0x000013E8 internal static float GetMiscFactor(Pawn target, Pawn seer, bool ActiveCamo) { float num = 1f; bool flag = StealthyBox.IsWearingStealthBox(target, out _); if (flag) { num *= 0.5f; } bool flag2; if (target == null) { flag2 = (null != null); } else { Pawn_StanceTracker stances = target.stances; flag2 = ((stances?.curStance) != null); } if (flag2) { if (!target.Downed) { if (target.stances.curStance is Stance_Mobile) { if (flag) { num *= 1.5f; } else { num *= 1.1f; } if (CamoUtility.IsInsectoid(seer)) { num *= 1.25f; } } else if (target.stances.curStance is Stance_Cooldown || target.stances.curStance is Stance_Warmup) { num *= 0.95f; if (CamoUtility.IsInsectoid(seer)) { num *= 0.75f; } } } else { num *= 0.5f; if (CamoUtility.IsInsectoid(seer)) { num *= 0.75f; } } } if (Controller.Settings.DoCheckWeather && (target?.Map) != null) { float accuracyMultiplier = target.Map.weatherManager.curWeather.accuracyMultiplier; if (accuracyMultiplier != 1f) { num *= accuracyMultiplier; } } if (Controller.Settings.DoCheckLight && !ActiveCamo) { PsychGlow psychGlow = target.Map.glowGrid.PsychGlowAt(target.Position); if (psychGlow == PsychGlow.Overlit) { num *= 1.15f; } else { num *= 0.8f; } PsychGlow psychGlow2 = seer.Map.glowGrid.PsychGlowAt(seer.Position); if (psychGlow2 == PsychGlow.Overlit) { num *= 0.85f; } else { num *= 1.2f; } } if (Controller.Settings.DoCheckTemp) { float temperature = GridsUtility.GetTemperature(target.Position, target.Map); float num2 = 21f; if (temperature > num2) { num *= Mathf.Lerp(1f, 0.85f, (temperature - num2) / temperature); } } return(num); }