Ejemplo n.º 1
0
    void SetupForPvELadder()
    {
        campaignLevel = CampaignLevel.Load(pveLadderLevel);
        campaignLevel.Setup();

        pveConfig = campaignLevel.config;
        //power rate
        player1.powerSource.generationRate           = pveConfig.playerPowerRate;
        player1.powerSource.generationRateAdjustment = 1;
        player2.powerSource.generationRate           = pveConfig.cpuPowerRate;
        player2.powerSource.generationRateAdjustment = 1;
        if (pveConfig.isBossLevel)
        {
            print("BOSS");
            var unit = pveConfig.boss.prefab.Instantiate();
            unit.player = player2;
            unit.name   = "BOSS";
            // unit.releaseZone = player2.fortress.towers[2].transform.position;
            unit.transform.position = player2.fortress.towers[2].transform.position + (player2.fortress.towers[2].transform.forward * 12) + (player2.fortress.towers[2].transform.up * 10);
            unit.transform.rotation = player2.fortress.towers[2].transform.rotation;
            pveConfig.AdjustBossUnit(unit);
        }
        Time.timeScale = pveConfig.gameSpeed;

        campaignLevel.Begin();
        //
    }
Ejemplo n.º 2
0
        private void EditLevel(object sender, EventArgs e)
        {
            CampaignLevel level = levelList.SelectedItem;

            if (!Equals(level, null))
            {
                int index = levelList.SelectedRow;

                level = new LevelPropertiesWindow(editor, level).ShowModal();

                if (!Equals(level, null))
                {
                    collection[index] = level;
                    OnModified?.Invoke(this, EventArgs.Empty);

                    levelList.SuspendLayout();

                    levelList.UpdateBindings();
                    levelList.Invalidate();

                    levelList.SelectedRow = index;

                    levelList.ResumeLayout();
                }
            }
        }
Ejemplo n.º 3
0
        private void SelectionChanged(object sender, EventArgs e)
        {
            CampaignLevel level = levelList.SelectedItem;

            if (Equals(level, null))
            {
                level = new CampaignLevel()
                {
                    Name  = " ",
                    Title = "<no level selected>"
                };
            }

            selectionThumbnail.Image = (editor.Document.GetResource(level.ResourceId, ResourceType.Level) as CampaignResource.Level)?.AsImage(editor) ?? Resources.GetImage("NoLevelImageFound.png");
            selectionHeader.Text     = level?.Name?.ToUpper();
            selectionText.Text       = level?.Title;

            int index = levelList.SelectedRow;

            moveUpButton.Enabled
                  = moveUpMenuButton.Enabled
                  = index > 0;

            moveDownButton.Enabled
                  = moveDownMenuButton.Enabled
                  = index >= 0 && index < collection.Count - 1;

            editButton.Enabled
                      = editMenuButton.Enabled
                      = removeButton.Enabled
                      = removeMenuButton.Enabled
                      = index != -1;
        }
Ejemplo n.º 4
0
        private void RemoveLevel(object sender, EventArgs e)
        {
            CampaignLevel level = levelList.SelectedItem;

            if (!Equals(level, null) && Messages.RemoveLevelDialog(level) == DialogResult.Yes)
            {
                collection.Remove(level);
                OnModified?.Invoke(this, EventArgs.Empty);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Update the gpd's Campaign Completion
        /// </summary>
        public void UpdateCampaignCompletion()
        {
            // Write all things
            for (int spLevel = 9; spLevel >= 0; spLevel--)
            {
                int           coopLevel     = 9 - spLevel;
                CampaignLevel campaignLevel = _gpdCampaignLevels[coopLevel];

                _gpdStream.SeekTo(0x350D - spLevel);
                _gpdStream.WriteByte((byte)campaignLevel.CompletionSP);

                _gpdStream.SeekTo(0x352E + coopLevel);
                _gpdStream.WriteByte((byte)campaignLevel.CompletionSP);

                _gpdCampaignLevels.Add(campaignLevel);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Load the gpd's Campaign Completion
        /// </summary>
        public void LoadCampaignCompletion()
        {
            _gpdCampaignLevels = new List <CampaignLevel>();

            for (int level = 0; level < 10; level++)
            {
                CampaignLevel campaignLevel = new CampaignLevel();
                campaignLevel.LevelName = (CampaignLevelNames)level;


                _gpdStream.SeekTo(0x34F8 + level);
                campaignLevel.CompletionSP = (CompletionState)_gpdStream.ReadByte();
                _gpdStream.SeekTo(0x3518 + level);
                campaignLevel.CompletionCoop = (CompletionState)_gpdStream.ReadByte();
                _gpdStream.SeekTo(0x354C + level);
                campaignLevel.ProgressSP = (CampaignProcessState)_gpdStream.ReadByte();

                _gpdCampaignLevels.Add(campaignLevel);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Load the gpd's Campaign Completion
        /// </summary>
        public void LoadCampaignCompletion()
        {
            _gpdCampaignLevels = new List <CampaignLevel>();

            // Load all levels
            for (int spLevel = 9; spLevel >= 0; spLevel--)
            {
                int           coopLevel     = 9 - spLevel;
                CampaignLevel campaignLevel = new CampaignLevel();

                _gpdStream.SeekTo(0x350D - spLevel);
                campaignLevel.CompletionSP = (CompletionState)_gpdStream.ReadByte();

                _gpdStream.SeekTo(0x352E + coopLevel);
                campaignLevel.CompletionSP = (CompletionState)_gpdStream.ReadByte();

                campaignLevel.LevelName = (CampaignLevelNames)coopLevel;

                _gpdCampaignLevels.Add(campaignLevel);
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Load the gpd's Campaign Completion
        /// </summary>
        public void LoadCampaignCompletion()
        {
            _gpdCampaignLevels = new List<CampaignLevel>();

            // Load all levels
            for (int spLevel = 9; spLevel >= 0; spLevel--)
            {
                int coopLevel = 9 - spLevel;
                CampaignLevel campaignLevel = new CampaignLevel();

                _gpdStream.SeekTo(0x350D - spLevel);
                campaignLevel.CompletionSP = (CompletionState)_gpdStream.ReadByte();

                _gpdStream.SeekTo(0x352E + coopLevel);
                campaignLevel.CompletionSP = (CompletionState)_gpdStream.ReadByte();

                campaignLevel.LevelName = (CampaignLevelNames)coopLevel;

                _gpdCampaignLevels.Add(campaignLevel);
            }
        }
 public static DialogResult RemoveLevelDialog(CampaignLevel level)
 {
     return(MessageBox.Show(string.Format(DIALOG_MESSAGE_REMOVE_LEVEL, level.Name), DIALOG_CAPTION_REMOVE_LEVEL, MessageBoxButtons.YesNo, MessageBoxType.Question));
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Load the gpd's Campaign Completion
        /// </summary>
        public void LoadCampaignCompletion()
        {
            _gpdCampaignLevels = new List<CampaignLevel>();

            for (int level = 0; level < 10; level++)
            {
                CampaignLevel campaignLevel = new CampaignLevel();
                campaignLevel.LevelName = (CampaignLevelNames)level;

                _gpdStream.SeekTo(0x34F8 + level);
                campaignLevel.CompletionSP = (CompletionState)_gpdStream.ReadByte();
                _gpdStream.SeekTo(0x3518 + level);
                campaignLevel.CompletionCoop = (CompletionState)_gpdStream.ReadByte();
                _gpdStream.SeekTo(0x354C + level);
                campaignLevel.ProgressSP = (CampaignProcessState)_gpdStream.ReadByte();

                _gpdCampaignLevels.Add(campaignLevel);
            }
        }