public static bool Prefix(SpawnInMinigame __instance) { if (PlayerControl.LocalPlayer.Is(RoleEnum.Phantom)) { var caught = Role.GetRole <Phantom>(PlayerControl.LocalPlayer).Caught; if (!caught) { __instance.Close(); return(false); } } return(true); }
static bool Prefix(SpawnInMinigame __instance) { //respawn a true || GameStarted == false if (AirshipSpawn.MeetingRespawn.GetValue() || !GameStarted) // respawn a false et GameStarted == true { GameStarted = true; var Spawn = __instance.Locations.ToArray <SpawnInMinigame.SpawnLocation>(); if (AirshipSpawn.NewSpawn.GetValue()) { Spawn = AddSpawn(Location: new Vector3(-8.808f, 12.710f, 0.013f), name: StringNames.VaultRoom, Sprite: ResourceLoader.VaultSprite, Rollover: ResourceLoader.VaultAnim, RolloverSfx: Spawn[0].RolloverSfx, array: Spawn); Spawn = AddSpawn(Location: new Vector3(-19.278f, -1.033f, 0), name: StringNames.Cockpit, Sprite: ResourceLoader.CokpitSprite, Rollover: ResourceLoader.CokpitAnim, RolloverSfx: Spawn[0].RolloverSfx, array: Spawn); __instance.Locations = Spawn; } if (AirshipSpawn.TypeSpawn.GetValue() != 0) { for (int i = 0; i < Spawn.Length; i++) { AirshipSpawn.Logger.LogInfo($"Name : {Spawn[i].Name}, i : {i}"); } for (int i = 0; i < SpawnPoints.Count; i++) { AirshipSpawn.Logger.LogInfo($"i : {SpawnPoints[i]}"); } if (AirshipSpawn.TypeSpawn.GetValue() == 1) { __instance.Locations = new SpawnInMinigame.SpawnLocation[3] { AirshipSpawn.NewSpawn.GetValue() ? Spawn[7] : Spawn[3], Spawn[2], Spawn[5] } } ; else if (AirshipSpawn.TypeSpawn.GetValue() == 2) { __instance.Locations = new SpawnInMinigame.SpawnLocation[3] { Spawn[SpawnPoints[0]], Spawn[SpawnPoints[1]], Spawn[SpawnPoints[2]] } } ; } return(true); } __instance.Close(); PlayerControl.LocalPlayer.NetTransform.RpcSnapTo(GetMeetingPosition(PlayerControl.LocalPlayer.PlayerId)); return(false); }
static bool Prefix(SpawnInMinigame __instance) { if (BetterAirShip.MeetingRespawn.GetValue() || !GameStarted) { GameStarted = true; var Spawn = __instance.Locations.ToArray(); if (BetterAirShip.NewSpawn.GetValue()) { Spawn = AddSpawn(Location: new Vector3(-8.808f, 12.710f, 0.013f), name: StringNames.VaultRoom, Sprite: AssetsLoader.VaultSprite, Rollover: AssetsLoader.VaultAnim, RolloverSfx: Spawn[0].RolloverSfx, array: Spawn); Spawn = AddSpawn(Location: new Vector3(-19.278f, -1.033f, 0), name: StringNames.Cockpit, Sprite: AssetsLoader.CokpitSprite, Rollover: AssetsLoader.CokpitAnim, RolloverSfx: Spawn[0].RolloverSfx, array: Spawn); Spawn = AddSpawn(Location: new Vector3(29.041f, -6.336f, 0), name: StringNames.Medical, Sprite: AssetsLoader.MedicalSprite, Rollover: AssetsLoader.MedicalAnim, RolloverSfx: Spawn[0].RolloverSfx, array: Spawn); __instance.Locations = Spawn; } if (BetterAirShip.TypeSpawn.GetValue() != 0) { if (BetterAirShip.TypeSpawn.GetValue() == 1) { __instance.Locations = new SpawnInMinigame.SpawnLocation[3] { BetterAirShip.NewSpawn.GetValue() ? Spawn[7] : Spawn[3], Spawn[2], Spawn[5] } } ; else if (BetterAirShip.TypeSpawn.GetValue() == 2) { __instance.Locations = new SpawnInMinigame.SpawnLocation[3] { Spawn[SpawnPoints[0]], Spawn[SpawnPoints[1]], Spawn[SpawnPoints[2]] } } ; } return(true); } __instance.Close(); PlayerControl.LocalPlayer.moveable = true; PlayerControl.LocalPlayer.NetTransform.RpcSnapTo(GetMeetingPosition(PlayerControl.LocalPlayer.PlayerId)); return(false); }
public static bool Prefix2(SpawnInMinigame __instance, [HarmonyArgument(0)] Vector3 spawnAt) { if (!CustomOptionHolder.airshipSynchronizedSpawning.getBool() || CustomOptionHolder.airshipRandomSpawn.getBool()) { if (isFirstSpawn) { resetButtons(); } CustomButton.stopCountdown = false; return(true); } Synchronize(SynchronizeTag.PreSpawnMinigame, PlayerControl.LocalPlayer.PlayerId); if (__instance.amClosing != Minigame.CloseState.None) { return(false); } if (__instance.gotButton) { return(false); } __instance.gotButton = true; foreach (var button in __instance.LocationButtons) { button.enabled = false; } __instance.StartCoroutine(Effects.Lerp(10f, new Action <float>((p) => { float time = p * 10f; foreach (var button in __instance.LocationButtons) { if (selected == button) { if (time > 0.3f) { float x = button.transform.localPosition.x; if (x < 0f) { x += 10f * Time.deltaTime; } if (x > 0f) { x -= 10f * Time.deltaTime; } if (Mathf.Abs(x) < 10f * Time.deltaTime) { x = 0f; } button.transform.localPosition = new Vector3(x, button.transform.localPosition.y, button.transform.localPosition.z); } } else { var color = button.GetComponent <SpriteRenderer>().color; float a = color.a; if (a > 0f) { a -= 2f * Time.deltaTime; } if (a < 0f) { a = 0f; } button.GetComponent <SpriteRenderer>().color = new Color(color.r, color.g, color.b, a); button.GetComponentInChildren <TextMeshPro>().color = new Color(1f, 1f, 1f, a); } if (__instance.amClosing != Minigame.CloseState.None) { return; } if (synchronizeData.Align(SynchronizeTag.PreSpawnMinigame, false) || p == 1f) { PlayerControl.LocalPlayer.gameObject.SetActive(true); __instance.StopAllCoroutines(); PlayerControl.LocalPlayer.NetTransform.RpcSnapTo(spawnAt); DestroyableSingleton <HudManager> .Instance.PlayerCam.SnapToTarget(); synchronizeData.Reset(SynchronizeTag.PreSpawnMinigame); __instance.Close(); CustomButton.stopCountdown = false; // サボタージュのクールダウンをリセット SabotageSystemType saboSystem = ShipStatus.Instance.Systems[SystemTypes.Sabotage].Cast <SabotageSystemType>(); AccessTools.PropertySetter(typeof(SabotageSystemType), "IsDirty").Invoke(saboSystem, new object[] { true }); saboSystem.ForceSabTime(0f); saboSystem.Timer = initialSabotageCooldown; DoorsSystemType doorSystem = ShipStatus.Instance.Systems[SystemTypes.Doors].Cast <DoorsSystemType>(); AccessTools.PropertySetter(typeof(DoorsSystemType), "IsDirty").Invoke(doorSystem, new object[] { true }); doorSystem.timers[SystemTypes.MainHall] = initialDoorCooldown; doorSystem.timers[SystemTypes.Brig] = initialDoorCooldown; doorSystem.timers[SystemTypes.Comms] = initialDoorCooldown; doorSystem.timers[SystemTypes.Medical] = initialDoorCooldown; doorSystem.timers[SystemTypes.Engine] = initialDoorCooldown; doorSystem.timers[SystemTypes.Records] = initialDoorCooldown; doorSystem.timers[SystemTypes.Kitchen] = initialDoorCooldown; if (isFirstSpawn) { resetButtons(); } } } }))); return(false); }