Esempio n. 1
0
        public override void Initialize()
        {
            TeamSelect2.DefaultSettings();
            base.Initialize();
            this.UpdateDefault();
            bool flag = true;

            foreach (Profile prof in Profiles.active)
            {
                if (flag)
                {
                    flag = false;
                }
                else
                {
                    if (prof.team != null)
                    {
                        prof.team.Leave(prof);
                    }
                    prof.inputProfile = (InputProfile)null;
                }
            }
            this._pendingSpawns = new Deathmatch((Level)this).SpawnPlayers();
            this._pendingSpawns = this._pendingSpawns.OrderBy <Duck, float>((Func <Duck, float>)(sp => sp.x)).ToList <Duck>();
            foreach (Duck pendingSpawn in this._pendingSpawns)
            {
                this.followCam.Add((Thing)pendingSpawn);
                ((ArcadeHatConsole)Level.First <ArcadeHatConsole>())?.MakeHatSelector(pendingSpawn);
            }
            this.followCam.Adjust();
            foreach (ArcadeMachine arcadeMachine in this.things[typeof(ArcadeMachine)])
            {
                this._challenges.Add(arcadeMachine);
            }
            Profiles.active[0].ticketCount = Challenges.GetTicketCount(Profiles.active[0]);
            if (Profiles.active[0].ticketCount < 0)
            {
                Profiles.active[0].ticketCount = 0;
            }
            foreach (ArcadeFrame arcadeFrame in this.things[typeof(ArcadeFrame)])
            {
                this._frames.Add(arcadeFrame);
            }
            foreach (ChallengeSaveData challengeSaveData in Challenges.GetAllSaveData())
            {
                if (challengeSaveData.frameID != "")
                {
                    ArcadeFrame frame = this.GetFrame(challengeSaveData.frameID);
                    if (frame != null)
                    {
                        frame.saveData = challengeSaveData;
                    }
                }
            }
            foreach (ArcadeMachine challenge in this._challenges)
            {
                challenge.unlocked = challenge.CheckUnlocked(false);
            }
            this._hud       = new ArcadeHUD();
            this._hud.alpha = 0.0f;
            Level.Add((Thing)this._hud);
            this._unlockScreen       = new UnlockScreen();
            this._unlockScreen.alpha = 0.0f;
            Level.Add((Thing)this._unlockScreen);
            this._pauseGroup  = new UIComponent(Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 0.0f, 0.0f);
            this._pauseMenu   = new UIMenu("@LWING@CHALLENGE MODE@RWING@", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 160f, conString: "@DPAD@MOVE  @SELECT@SELECT");
            this._confirmMenu = new UIMenu("REALLY QUIT?", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 160f, conString: "@SELECT@SELECT");
            UIDivider uiDivider = new UIDivider(true, 0.8f);

            uiDivider.leftSection.Add((UIComponent) new UIMenuItem("RESUME", (UIMenuAction) new UIMenuActionCloseMenu(this._pauseGroup), UIAlign.Left), true);
            uiDivider.leftSection.Add((UIComponent) new UIMenuItem("OPTIONS", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)this._pauseMenu, (UIComponent)Options.optionsMenu), UIAlign.Left), true);
            uiDivider.leftSection.Add((UIComponent) new UIMenuItem("QUIT", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)this._pauseMenu, (UIComponent)this._confirmMenu), UIAlign.Left), true);
            uiDivider.rightSection.Add((UIComponent) new UIImage("pauseIcons", UIAlign.Right), true);
            this._pauseMenu.Add((UIComponent)uiDivider, true);
            this._pauseMenu.Close();
            this._pauseGroup.Add((UIComponent)this._pauseMenu, false);
            this._pauseGroup.Add((UIComponent)Options.optionsMenu, false);
            Options.openOnClose = this._pauseMenu;
            this._confirmMenu.Add((UIComponent) new UIMenuItem("NO!", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)this._confirmMenu, (UIComponent)this._pauseMenu)), true);
            this._confirmMenu.Add((UIComponent) new UIMenuItem("YES!", (UIMenuAction) new UIMenuActionCloseMenuSetBoolean(this._pauseGroup, this._quit)), true);
            this._confirmMenu.Close();
            this._pauseGroup.Add((UIComponent)this._confirmMenu, false);
            this._pauseGroup.Close();
            Level.Add((Thing)this._pauseGroup);
            this._prizeTable = this.things[typeof(PrizeTable)].FirstOrDefault <Thing>() as PrizeTable;
            if (this._prizeTable == null)
            {
                this._prizeTable = new PrizeTable(730f, 124f);
            }
            Chancy.activeChallenge    = (ChallengeData)null;
            Chancy.atCounter          = true;
            Chancy.lookingAtChallenge = false;
            Graphics.fade             = 1f;
            this.basementWasUnlocked  = Unlocks.IsUnlocked("BASEMENTKEY", Profiles.active[0]);
            Level.Add((Thing)this._prizeTable);
            Music.Play("Arcade");
        }
Esempio n. 2
0
        public override void Initialize()
        {
            this._background        = new SpriteThing(313f, -40f, new Sprite("arcade/arcadeOuya"));
            this._background.center = new Vec2(0.0f, 0.0f);
            this._background.layer  = Layer.Background;
            this._duck = new Duck(730f, 100f, Profiles.active[0]);
            Level.Add((Thing)this._background);
            Level.Add((Thing)this._duck);
            this._followCam.Add((Thing)this._duck);
            Chancy.Add("SUP MOTHARFUCKAR :P");
            Level.Add((Thing) new Block(0.0f, 187f, 295f, 53f));
            Level.Add((Thing) new Block(289f, 195f, 14f, 45f));
            Level.Add((Thing) new Block(290f, 203f, 190f, 37f));
            Level.Add((Thing) new Block(467f, 195f, 17f, 45f));
            Level.Add((Thing) new Block(475f, 187f, 217f, 53f));
            Level.Add((Thing) new Block(639f, 179f, 32f, 16f));
            Level.Add((Thing) new Block(647f, 171f, 32f, 16f));
            Level.Add((Thing) new Block(655f, 163f, 32f, 16f));
            Level.Add((Thing) new Block(663f, 155f, 32f, 16f));
            Level.Add((Thing) new Block(671f, 147f, 32f, 16f));
            Level.Add((Thing) new Block(679f, 139f, 124f, 16f));
            Level.Add((Thing) new Block(787f, 0.0f, 64f, 300f));
            Level.Add((Thing) new Block(-16f, 0.0f, 21f, 300f));
            Level.Add((Thing) new Platform(648f, 131f, 12f, 8f));
            Level.Add((Thing) new Platform(640f, 123f, 12f, 8f));
            Level.Add((Thing) new Platform(632f, 115f, 12f, 8f));
            Level.Add((Thing) new Block(624f, 107f, 12f, 8f));
            Level.Add((Thing) new Block(616f, 99f, 12f, 8f));
            Level.Add((Thing) new Block(-100f, 91f, 720f, 14f));
            Level.Add((Thing) new Block(251f, 83f, 268f, 10f));
            Level.Add((Thing) new Block(259f, 75f, 252f, 10f));
            Level.Add((Thing) new Block(254f, 0.0f, 64f, 300f));
            List <Vec2> vec2List = new List <Vec2>()
            {
                new Vec2(380f, 186f),
                new Vec2(520f, 170f),
                new Vec2(565f, 74f),
                new Vec2(375f, 58f),
                new Vec2(455f, 58f)
            };
            Vec2          vec2_1         = vec2List[this._challenges.Count];
            Vec2          vec2_2         = vec2List[this._challenges.Count];
            ArcadeMachine arcadeMachine1 = new ArcadeMachine(vec2_2.x, vec2_2.y, new ChallengeGroup()
            {
                name       = "TARGETS",
                challenges =
                {
                    "challenge/targets01",
                    "challenge/targets03ouya",
                    "challenge/targets02ouya"
                },
                trophiesRequired = 0
            }, 0);

            arcadeMachine1.lightColor = 2;
            arcadeMachine1.unlocked   = true;
            Level.Add((Thing)arcadeMachine1);
            this._challenges.Add(arcadeMachine1);
            Vec2          vec2_3         = vec2List[this._challenges.Count];
            ArcadeMachine arcadeMachine2 = new ArcadeMachine(vec2_3.x, vec2_3.y, new ChallengeGroup()
            {
                name       = "VARIETY ZONE",
                challenges =
                {
                    "challenge/obstacle",
                    "challenge/shootout02",
                    "challenge/jetpack02"
                },
                trophiesRequired = 0
            }, 6);

            arcadeMachine2.lightColor = 1;
            Level.Add((Thing)arcadeMachine2);
            this._challenges.Add(arcadeMachine2);
            Vec2          vec2_4         = vec2List[this._challenges.Count];
            ArcadeMachine arcadeMachine3 = new ArcadeMachine(vec2_4.x, vec2_4.y, new ChallengeGroup()
            {
                name       = "TELEPORTER",
                challenges =
                {
                    "challenge/tele02",
                    "challenge/tele01",
                    "challenge/tele03"
                },
                trophiesRequired = 1
            }, 4);

            arcadeMachine3.lightColor = 1;
            Level.Add((Thing)arcadeMachine3);
            this._challenges.Add(arcadeMachine3);
            Vec2          vec2_5         = vec2List[this._challenges.Count];
            ArcadeMachine arcadeMachine4 = new ArcadeMachine(vec2_5.x, vec2_5.y, new ChallengeGroup()
            {
                name       = "WEAPON TRAINING",
                challenges =
                {
                    "challenge/magnumouya",
                    "challenge/chaingunouya",
                    "challenge/sniper"
                },
                trophiesRequired = 4
            }, 5);

            arcadeMachine4.lightColor = 2;
            Level.Add((Thing)arcadeMachine4);
            this._challenges.Add(arcadeMachine4);
            Vec2          vec2_6         = vec2List[this._challenges.Count];
            ArcadeMachine arcadeMachine5 = new ArcadeMachine(vec2_6.x, vec2_6.y, new ChallengeGroup()
            {
                name       = "VARIETY ZONE 2",
                challenges =
                {
                    "challenge/ball01",
                    "challenge/glass01ouya",
                    "challenge/grapple04"
                },
                trophiesRequired = 9
            }, 8);

            arcadeMachine5.lightColor = 1;
            Level.Add((Thing)arcadeMachine5);
            this._challenges.Add(arcadeMachine5);
            this._prizeTable = new PrizeTable(730f, 124f);
            Level.Add((Thing)this._prizeTable);
            this._hud                = new ArcadeHUD();
            this._hud.alpha          = 0.0f;
            this._unlockScreen       = new UnlockScreen();
            this._unlockScreen.alpha = 0.0f;
            Level.Add((Thing)this._unlockScreen);
            this._pauseGroup  = new UIComponent(Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 0.0f, 0.0f);
            this._pauseMenu   = new UIMenu("@LWING@CHALLENGE MODE@RWING@", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 160f, conString: "@DPAD@MOVE  @SELECT@SELECT");
            this._confirmMenu = new UIMenu("REALLY QUIT?", Layer.HUD.camera.width / 2f, Layer.HUD.camera.height / 2f, 160f, conString: "@SELECT@SELECT");
            UIDivider uiDivider = new UIDivider(true, 0.8f);

            uiDivider.leftSection.Add((UIComponent) new UIMenuItem("RESUME", (UIMenuAction) new UIMenuActionCloseMenu(this._pauseGroup), UIAlign.Left), true);
            uiDivider.leftSection.Add((UIComponent) new UIMenuItem("OPTIONS", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)this._pauseMenu, (UIComponent)Options.optionsMenu), UIAlign.Left), true);
            uiDivider.leftSection.Add((UIComponent) new UIMenuItem("QUIT", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)this._pauseMenu, (UIComponent)this._confirmMenu), UIAlign.Left), true);
            uiDivider.rightSection.Add((UIComponent) new UIImage("pauseIcons", UIAlign.Right), true);
            this._pauseMenu.Add((UIComponent)uiDivider, true);
            this._pauseMenu.Close();
            this._pauseGroup.Add((UIComponent)this._pauseMenu, false);
            this._pauseGroup.Add((UIComponent)Options.optionsMenu, false);
            Options.openOnClose = this._pauseMenu;
            this._confirmMenu.Add((UIComponent) new UIMenuItem("NO!", (UIMenuAction) new UIMenuActionOpenMenu((UIComponent)this._confirmMenu, (UIComponent)this._pauseMenu)), true);
            this._confirmMenu.Add((UIComponent) new UIMenuItem("YES!", (UIMenuAction) new UIMenuActionCloseMenuSetBoolean(this._pauseGroup, this._quit)), true);
            this._confirmMenu.Close();
            this._pauseGroup.Add((UIComponent)this._confirmMenu, false);
            this._pauseGroup.Close();
            Level.Add((Thing)this._pauseGroup);
            Music.Play(nameof(Arcade));
            base.Initialize();
        }