예제 #1
0
        public void SpawnItem(int id, Vector2 pos, Vector2?vel = null)
        {
            switch (id)
            {
            case 0:
                DeluminatorWorld deluminator = new DeluminatorWorld(pos);
                AllItems.Add(deluminator);
                break;

            case 1:
                MaraudersMapWorld map = new MaraudersMapWorld(pos);
                AllItems.Add(map);
                break;

            case 2:
                PortKeyWorld key = new PortKeyWorld(pos);
                AllItems.Add(key);
                break;

            case 3:
                TheGoldenSnitchWorld snitch = new TheGoldenSnitchWorld(pos, vel.Value);
                AllItems.Add(snitch);
                break;
            }
        }
예제 #2
0
        public void Update()
        {
            if (ExileController.Instance != null)
            {
                Role.ResetCooldowns();
            }

            if (_Object.Data.IsDead)
            {
                ClearItems();
            }

            TaskInfoHandler.Instance.Update();
            HandleNameColors();
            PopulateButtons();
            Role?.Update();

            if (AmongUsClient.Instance.AmHost)
            {
                DeluminatorWorld.WorldSpawn();
                MaraudersMapWorld.WorldSpawn();
                PortKeyWorld.WorldSpawn();
                TheGoldenSnitchWorld.WorldSpawn();

                if (Main.Instance.Config.OrderOfTheImp)
                {
                    if (Main.Instance.AllPlayers.Any(x => Main.Instance.IsPlayerRole(x, "Harry") && (x._Object.Data.IsDead || x._Object.Data.Disconnected)) &&
                        Main.Instance.AllPlayers.Any(x => Main.Instance.IsPlayerRole(x, "Hermione") && (x._Object.Data.IsDead || x._Object.Data.Disconnected)) &&
                        Main.Instance.AllPlayers.Any(x => Main.Instance.IsPlayerRole(x, "Ron") && (x._Object.Data.IsDead || x._Object.Data.Disconnected)))
                    {
                        ShipStatus.RpcEndGame(GameOverReason.ImpostorByKill, false);
                    }
                }
            }
        }