コード例 #1
0
        public async Task <bool> ActivateNode()
        {
            // Verify the Node is ready.
            if (!await RunNodeReadiness())
            {
                return(false);
            }

            // Get Current Tile Data
            byte[] wtData = this.worldContent.GetWorldTileData(this.currentZone, this.character.curX, this.character.curY);

            // Identify Level Data at this node:
            int    coordId = Coords.MapToInt(this.character.curX, this.character.curY);
            string levelId = this.currentZone.nodes.ContainsKey(coordId.ToString()) ? this.currentZone.nodes[coordId.ToString()] : "";

            // If the level is valid, we can enter the level.
            bool isWon = this.campaign.IsLevelWon(this.campaign.zoneId, levelId);

            // Grant Character Their World Equipment On Casual or Beaten Nodes (after scene generated)
            if (!isWon && (wtData[5] != (byte)OTerrainObjects.NodeCasual && wtData[5] != (byte)OTerrainObjects.NodeWon))
            {
                CampaignState campaign = Systems.handler.campaignState;
                campaign.SetUpgrades(0, 0, 0, 0, 0, 0, 0);
                campaign.SaveCampaign();
            }

            SceneTransition.ToLevel(this.worldData.id, levelId, true);
            return(true);
        }
コード例 #2
0
        // Download a Level
        private static async Task <bool> DownloadLevel(string worldId, string levelId)
        {
            bool success = await WebHandler.LevelRequest(levelId);

            if (success)
            {
                SceneTransition.ToLevel(worldId, levelId, false, true);
            }
            return(true);
        }
コード例 #3
0
        public static void LoadLevel()
        {
            string currentIns = ConsoleTrack.GetArgAsString();

            ConsoleTrack.possibleTabs = "Example: `load-level QCALQOD16`";
            ConsoleTrack.helpText     = "The level ID of the level to load.";

            if (ConsoleTrack.activate)
            {
                SceneTransition.ToLevel("", currentIns);
            }
        }
コード例 #4
0
ファイル: FuncButtonPlay.cs プロジェクト: tarsupin/Nexus
        public override void ActivateFuncButton()
        {
            EditorScene scene = (EditorScene)Systems.scene;

            Systems.handler.levelContent.SaveLevel();
            GameValues.LastAction = "EditorPlayButton";

            if (scene.tutorial.tutorialStep == TutorialEditor.finalStep)
            {
                UIHandler.AddNotification(UIAlertType.Warning, "Playtest Fixes", "If something goes wrong, don't worry. You can open the tilde (~) console enter `editor` to return to the level editor.", 1500);
            }

            SceneTransition.ToLevel("", scene.levelContent.levelId);
        }