public static void Postfix(PlayerPhysics __instance) { foreach (var trap in Trap.traps.Values) { bool canSee = trap.isActive || PlayerControl.LocalPlayer.isImpostor() || PlayerControl.LocalPlayer.isDead() || (PlayerControl.LocalPlayer.isRole(RoleType.Lighter) && Lighter.isLightActive(PlayerControl.LocalPlayer)) || PlayerControl.LocalPlayer.isRole(RoleType.Fox); var opacity = canSee ? 1.0f : 0.0f; if (trap.trap != null) { trap.trap.GetComponent <SpriteRenderer>().material.color = Color.Lerp(Palette.ClearWhite, Palette.White, opacity); } } }
public override void OnInspectorGUI() { DrawDefaultInspector(); Lighter lighter = (Lighter)target; if (GUILayout.Button("Initiate Fire")) { if (lighter.GetComponentInChildren <Fire>().lit) { lighter.StopFire(); } else { lighter.StartFire(); } } }
private IEnumerator IBurnAndMoveToStudents() { // 효과음 fire.SetActive(true); // 얼굴이 불타오르는 애니메이션 // 얼굴에 흉터가 남음 yield return(new WaitForSeconds(1f)); Vector3 dest = (students[0].transform.position + students[1].transform.position) / students.Length; LeanTween.move(gameObject, dest, 1f).setSpeed(moveSpeed); // 학생들을 향해서 이동 yield return(new WaitForSeconds(0.7f)); students[0].Move(); students[1].Move(); Lighter lighter = ObjectManager.GetObject <Lighter>(); lighter.canInteractWith = "Tree"; lighter.useType = UseType.Interact; PlayerScan.instance.progressStatus = ProgressStatus.E_EndMirrorRoom; }
public static void clearAndReloadRoles() { Jester.clearAndReload(); Mayor.clearAndReload(); Engineer.clearAndReload(); Sheriff.clearAndReload(); Lighter.clearAndReload(); Godfather.clearAndReload(); Mafioso.clearAndReload(); Janitor.clearAndReload(); Detective.clearAndReload(); TimeMaster.clearAndReload(); Medic.clearAndReload(); Shifter.clearAndReload(); Swapper.clearAndReload(); Lovers.clearAndReload(); Seer.clearAndReload(); Morphling.clearAndReload(); Camouflager.clearAndReload(); Spy.clearAndReload(); Child.clearAndReload(); }
public void Getlightandobject(GameObject light, GameObject obj) { mylight = light.GetComponent <Lighter>(); myobj = obj; IsObjObt = true; }
public static bool Prefix(ref float __result, ShipStatus __instance, [HarmonyArgument(0)] GameData.PlayerInfo player) { if (!__instance.Systems.ContainsKey(SystemTypes.Electrical)) { return(true); } // If player is a role which has Impostor vision if (player.Role.IsImpostor || (Jackal.jackal != null && Jackal.jackal.PlayerId == player.PlayerId && Jackal.hasImpostorVision) || (Sidekick.sidekick != null && Sidekick.sidekick.PlayerId == player.PlayerId && Sidekick.hasImpostorVision) || (Spy.spy != null && Spy.spy.PlayerId == player.PlayerId && Spy.hasImpostorVision) || (Jester.jester != null && Jester.jester.PlayerId == player.PlayerId && Jester.hasImpostorVision) || (player.Object.hasModifier(ModifierType.Madmate) && Madmate.hasImpostorVision) || // Impostor, Jackal/Sidekick, Spy, or Madmate with Impostor vision (player.Object.hasModifier(ModifierType.CreatedMadmate) && CreatedMadmate.hasImpostorVision) || // Impostor, Jackal/Sidekick, Spy, or Madmate with Impostor vision (player.Object.isRole(RoleType.Puppeteer)) || (Jester.jester != null && Jester.jester.PlayerId == player.PlayerId && Jester.hasImpostorVision) || // Jester with Impostor vision (player.Object.isRole(RoleType.Fox))) { // __result = __instance.MaxLightRadius * PlayerControl.GameOptions.ImpostorLightMod; __result = GetNeutralLightRadius(__instance, true); return(false); } // If player is Lighter with ability active if (PlayerControl.LocalPlayer.isRole(RoleType.Lighter) && Lighter.isLightActive(PlayerControl.LocalPlayer)) { float unlerped = Mathf.InverseLerp(__instance.MinLightRadius, __instance.MaxLightRadius, GetNeutralLightRadius(__instance, true)); __result = Mathf.Lerp(__instance.MaxLightRadius * Lighter.lighterModeLightsOffVision, __instance.MaxLightRadius * Lighter.lighterModeLightsOnVision, unlerped); return(false); } // If there is a Trickster with their ability active if (Trickster.trickster != null && Trickster.lightsOutTimer > 0f) { float lerpValue = 1f; if (Trickster.lightsOutDuration - Trickster.lightsOutTimer < 0.5f) { lerpValue = Mathf.Clamp01((Trickster.lightsOutDuration - Trickster.lightsOutTimer) * 2); } else if (Trickster.lightsOutTimer < 0.5) { lerpValue = Mathf.Clamp01(Trickster.lightsOutTimer * 2); } __result = Mathf.Lerp(__instance.MinLightRadius, __instance.MaxLightRadius, 1 - lerpValue) * PlayerControl.GameOptions.CrewLightMod; return(false); } // If player is Lawyer, apply Lawyer vision modifier if (Lawyer.lawyer != null && Lawyer.lawyer.PlayerId == player.PlayerId) { float unlerped = Mathf.InverseLerp(__instance.MinLightRadius, __instance.MaxLightRadius, GetNeutralLightRadius(__instance, false)); __result = Mathf.Lerp(__instance.MinLightRadius, __instance.MaxLightRadius * Lawyer.vision, unlerped); return(false); } // Default light radius __result = GetNeutralLightRadius(__instance, false); return(false); }
public void InstantiateLight() { Instantiate(ligtherPrefab, g.transform.position, g.transform.rotation, g.transform); lighter = g.transform.GetChild(0).gameObject.GetComponentInChildren <Lighter>(); g.transform.GetChild(0).gameObject.GetComponentInChildren <Lighter>().gameObject.SetActive(false); }