From 068dd1df2910defadb66f582e4e7465220cd9df2 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 27 Jul 2019 09:41:27 +1000 Subject: [PATCH 1/3] More work on ZS gui rewrite --- GUI/PropertyWindow/GamesHelper.cs | 7 +- GUI/PropertyWindow/PropertyWindow.Designer.cs | 1112 +++++++++-------- 2 files changed, 580 insertions(+), 539 deletions(-) diff --git a/GUI/PropertyWindow/GamesHelper.cs b/GUI/PropertyWindow/GamesHelper.cs index 48dc6d7f1..c1722a5e2 100644 --- a/GUI/PropertyWindow/GamesHelper.cs +++ b/GUI/PropertyWindow/GamesHelper.cs @@ -60,7 +60,12 @@ namespace MCGalaxy.Gui { cfg.StartImmediately = cbStart.Checked; cfg.MapInHeartbeat = cbMap.Checked; cfg.SetMainLevel = cbMain.Checked; - cfg.Save(); + + try { + cfg.Save() + } catch (Exception ex) { + Logger.LogError("Error saving " + game.GameName + " settings", ex); + } } public void UpdateButtons() { diff --git a/GUI/PropertyWindow/PropertyWindow.Designer.cs b/GUI/PropertyWindow/PropertyWindow.Designer.cs index adcead40b..6f445b023 100644 --- a/GUI/PropertyWindow/PropertyWindow.Designer.cs +++ b/GUI/PropertyWindow/PropertyWindow.Designer.cs @@ -316,6 +316,50 @@ namespace MCGalaxy.Gui this.ls_btnRemove = new System.Windows.Forms.Button(); this.ls_lstNotUsed = new System.Windows.Forms.ListBox(); this.ls_lstUsed = new System.Windows.Forms.ListBox(); + this.tabZS = new System.Windows.Forms.TabPage(); + this.zs_grpControls = new System.Windows.Forms.GroupBox(); + this.zs_btnEnd = new System.Windows.Forms.Button(); + this.zs_btnStop = new System.Windows.Forms.Button(); + this.zs_btnStart = new System.Windows.Forms.Button(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.timespanUpDown1 = new MCGalaxy.Gui.TimespanUpDown(); + this.timespanUpDown2 = new MCGalaxy.Gui.TimespanUpDown(); + this.timespanUpDown3 = new MCGalaxy.Gui.TimespanUpDown(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.zs_grpSettings = new System.Windows.Forms.GroupBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); + this.label4 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.numericUpDown4 = new System.Windows.Forms.NumericUpDown(); + this.label8 = new System.Windows.Forms.Label(); + this.numericUpDown5 = new System.Windows.Forms.NumericUpDown(); + this.numericUpDown6 = new System.Windows.Forms.NumericUpDown(); + this.label9 = new System.Windows.Forms.Label(); + this.zs_cbMain = new System.Windows.Forms.CheckBox(); + this.zs_cbMap = new System.Windows.Forms.CheckBox(); + this.zs_grpInv = new System.Windows.Forms.GroupBox(); + this.zs_numInvZombieDur = new System.Windows.Forms.NumericUpDown(); + this.zs_numInvHumanDur = new System.Windows.Forms.NumericUpDown(); + this.zs_numInvZombieMax = new System.Windows.Forms.NumericUpDown(); + this.zs_numInvHumanMax = new System.Windows.Forms.NumericUpDown(); + this.zs_lblInvZombieDur = new System.Windows.Forms.Label(); + this.zs_lblInvZombieMax = new System.Windows.Forms.Label(); + this.zs_lblInvHumanDur = new System.Windows.Forms.Label(); + this.zs_lblInvHumanMax = new System.Windows.Forms.Label(); + this.zs_cbStart = new System.Windows.Forms.CheckBox(); + this.zs_grpMaps = new System.Windows.Forms.GroupBox(); + this.label12 = new System.Windows.Forms.Label(); + this.zs_lblUsed = new System.Windows.Forms.Label(); + this.zs_btnAdd = new System.Windows.Forms.Button(); + this.zs_btnRemove = new System.Windows.Forms.Button(); + this.zs_lstNotUsed = new System.Windows.Forms.ListBox(); + this.zs_lstUsed = new System.Windows.Forms.ListBox(); this.tabZS_old = new System.Windows.Forms.TabPage(); this.propsZG = new System.Windows.Forms.PropertyGrid(); this.tabCTF = new System.Windows.Forms.TabPage(); @@ -434,48 +478,7 @@ namespace MCGalaxy.Gui this.sec_numBlocksMsgs = new System.Windows.Forms.NumericUpDown(); this.sec_lblBlocksOnMsgs = new System.Windows.Forms.Label(); this.sec_numBlocksSecs = new MCGalaxy.Gui.TimespanUpDown(); - this.tabZS = new System.Windows.Forms.TabPage(); - this.zs_grpControls = new System.Windows.Forms.GroupBox(); - this.zs_btnEnd = new System.Windows.Forms.Button(); - this.zs_btnStop = new System.Windows.Forms.Button(); - this.zs_btnStart = new System.Windows.Forms.Button(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.groupBox3 = new System.Windows.Forms.GroupBox(); - this.timespanUpDown1 = new MCGalaxy.Gui.TimespanUpDown(); - this.timespanUpDown2 = new MCGalaxy.Gui.TimespanUpDown(); - this.timespanUpDown3 = new MCGalaxy.Gui.TimespanUpDown(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.label4 = new System.Windows.Forms.Label(); - this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); - this.label5 = new System.Windows.Forms.Label(); - this.numericUpDown2 = new System.Windows.Forms.NumericUpDown(); - this.numericUpDown3 = new System.Windows.Forms.NumericUpDown(); - this.label6 = new System.Windows.Forms.Label(); - this.groupBox5 = new System.Windows.Forms.GroupBox(); - this.numericUpDown4 = new System.Windows.Forms.NumericUpDown(); - this.numericUpDown5 = new System.Windows.Forms.NumericUpDown(); - this.numericUpDown6 = new System.Windows.Forms.NumericUpDown(); - this.numericUpDown7 = new System.Windows.Forms.NumericUpDown(); - this.label7 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); - this.zs_grpSettings = new System.Windows.Forms.GroupBox(); - this.label11 = new System.Windows.Forms.Label(); - this.numericUpDown8 = new System.Windows.Forms.NumericUpDown(); - this.zs_cbMain = new System.Windows.Forms.CheckBox(); - this.zs_cbMap = new System.Windows.Forms.CheckBox(); - this.zs_cbStart = new System.Windows.Forms.CheckBox(); - this.zs_grpMaps = new System.Windows.Forms.GroupBox(); - this.label12 = new System.Windows.Forms.Label(); - this.zs_lblUsed = new System.Windows.Forms.Label(); - this.zs_btnAdd = new System.Windows.Forms.Button(); - this.zs_btnRemove = new System.Windows.Forms.Button(); - this.zs_lstNotUsed = new System.Windows.Forms.ListBox(); - this.zs_lstUsed = new System.Windows.Forms.ListBox(); this.pageChat.SuspendLayout(); this.chat_grpTab.SuspendLayout(); this.chat_grpMessages.SuspendLayout(); @@ -549,6 +552,25 @@ namespace MCGalaxy.Gui this.ls_grpBlock.SuspendLayout(); this.ls_grpSettings.SuspendLayout(); this.ls_grpMaps.SuspendLayout(); + this.tabZS.SuspendLayout(); + this.zs_grpControls.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.timespanUpDown1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.timespanUpDown2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.timespanUpDown3)).BeginInit(); + this.zs_grpSettings.SuspendLayout(); + this.groupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).BeginInit(); + this.zs_grpInv.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.zs_numInvZombieDur)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.zs_numInvHumanDur)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.zs_numInvZombieMax)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.zs_numInvHumanMax)).BeginInit(); + this.zs_grpMaps.SuspendLayout(); this.tabZS_old.SuspendLayout(); this.tabCTF.SuspendLayout(); this.ctf_grpControls.SuspendLayout(); @@ -587,25 +609,6 @@ namespace MCGalaxy.Gui this.sec_grpBlocks.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.sec_numBlocksMsgs)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.sec_numBlocksSecs)).BeginInit(); - this.tabZS.SuspendLayout(); - this.zs_grpControls.SuspendLayout(); - this.groupBox2.SuspendLayout(); - this.groupBox3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.timespanUpDown1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.timespanUpDown2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.timespanUpDown3)).BeginInit(); - this.groupBox4.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit(); - this.groupBox5.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown7)).BeginInit(); - this.zs_grpSettings.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown8)).BeginInit(); - this.zs_grpMaps.SuspendLayout(); this.SuspendLayout(); // // pageChat @@ -3528,6 +3531,471 @@ namespace MCGalaxy.Gui this.ls_lstUsed.TabIndex = 0; this.ls_lstUsed.SelectedIndexChanged += new System.EventHandler(this.lsMapUse_SelectedIndexChanged); // + // tabZS + // + this.tabZS.BackColor = System.Drawing.SystemColors.Control; + this.tabZS.Controls.Add(this.zs_grpControls); + this.tabZS.Controls.Add(this.groupBox2); + this.tabZS.Controls.Add(this.zs_grpSettings); + this.tabZS.Controls.Add(this.zs_grpMaps); + this.tabZS.Location = new System.Drawing.Point(4, 22); + this.tabZS.Name = "tabZS"; + this.tabZS.Padding = new System.Windows.Forms.Padding(3); + this.tabZS.Size = new System.Drawing.Size(484, 489); + this.tabZS.TabIndex = 6; + this.tabZS.Text = "Zombie Survival"; + // + // zs_grpControls + // + this.zs_grpControls.Controls.Add(this.zs_btnEnd); + this.zs_grpControls.Controls.Add(this.zs_btnStop); + this.zs_grpControls.Controls.Add(this.zs_btnStart); + this.zs_grpControls.Location = new System.Drawing.Point(110, 5); + this.zs_grpControls.Name = "zs_grpControls"; + this.zs_grpControls.Size = new System.Drawing.Size(279, 51); + this.zs_grpControls.TabIndex = 4; + this.zs_grpControls.TabStop = false; + this.zs_grpControls.Text = "Controls"; + // + // zs_btnEnd + // + this.zs_btnEnd.Location = new System.Drawing.Point(190, 19); + this.zs_btnEnd.Name = "zs_btnEnd"; + this.zs_btnEnd.Size = new System.Drawing.Size(80, 23); + this.zs_btnEnd.TabIndex = 2; + this.zs_btnEnd.Text = "End Round"; + this.zs_btnEnd.UseVisualStyleBackColor = true; + // + // zs_btnStop + // + this.zs_btnStop.Location = new System.Drawing.Point(100, 19); + this.zs_btnStop.Name = "zs_btnStop"; + this.zs_btnStop.Size = new System.Drawing.Size(80, 23); + this.zs_btnStop.TabIndex = 1; + this.zs_btnStop.Text = "Stop Game"; + this.zs_btnStop.UseVisualStyleBackColor = true; + // + // zs_btnStart + // + this.zs_btnStart.Location = new System.Drawing.Point(10, 19); + this.zs_btnStart.Name = "zs_btnStart"; + this.zs_btnStart.Size = new System.Drawing.Size(80, 23); + this.zs_btnStart.TabIndex = 0; + this.zs_btnStart.Text = "Start Game"; + this.zs_btnStart.UseVisualStyleBackColor = true; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.groupBox3); + this.groupBox2.Enabled = false; + this.groupBox2.Location = new System.Drawing.Point(182, 374); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(296, 97); + this.groupBox2.TabIndex = 3; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Map Settings"; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.timespanUpDown1); + this.groupBox3.Controls.Add(this.timespanUpDown2); + this.groupBox3.Controls.Add(this.timespanUpDown3); + this.groupBox3.Controls.Add(this.label1); + this.groupBox3.Controls.Add(this.label2); + this.groupBox3.Controls.Add(this.label3); + this.groupBox3.Location = new System.Drawing.Point(6, 16); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(284, 71); + this.groupBox3.TabIndex = 39; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Time settings"; + // + // timespanUpDown1 + // + this.timespanUpDown1.Location = new System.Drawing.Point(69, 43); + this.timespanUpDown1.Name = "timespanUpDown1"; + this.timespanUpDown1.Seconds = ((long)(300)); + this.timespanUpDown1.Size = new System.Drawing.Size(62, 21); + this.timespanUpDown1.TabIndex = 38; + this.timespanUpDown1.Text = "5m"; + this.timespanUpDown1.Value = System.TimeSpan.Parse("00:05:00"); + // + // timespanUpDown2 + // + this.timespanUpDown2.Location = new System.Drawing.Point(216, 16); + this.timespanUpDown2.Name = "timespanUpDown2"; + this.timespanUpDown2.Seconds = ((long)(120)); + this.timespanUpDown2.Size = new System.Drawing.Size(62, 21); + this.timespanUpDown2.TabIndex = 37; + this.timespanUpDown2.Text = "2m"; + this.timespanUpDown2.Value = System.TimeSpan.Parse("00:02:00"); + // + // timespanUpDown3 + // + this.timespanUpDown3.Location = new System.Drawing.Point(69, 16); + this.timespanUpDown3.Name = "timespanUpDown3"; + this.timespanUpDown3.Seconds = ((long)(900)); + this.timespanUpDown3.Size = new System.Drawing.Size(62, 21); + this.timespanUpDown3.TabIndex = 36; + this.timespanUpDown3.Text = "15m"; + this.timespanUpDown3.Value = System.TimeSpan.Parse("00:15:00"); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(154, 20); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(59, 13); + this.label1.TabIndex = 35; + this.label1.Text = "Layer time:"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(8, 46); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(59, 13); + this.label2.TabIndex = 34; + this.label2.Text = "Flood time:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(5, 20); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(63, 13); + this.label3.TabIndex = 34; + this.label3.Text = "Round time:"; + // + // zs_grpSettings + // + this.zs_grpSettings.Controls.Add(this.groupBox1); + this.zs_grpSettings.Controls.Add(this.zs_cbMain); + this.zs_grpSettings.Controls.Add(this.zs_cbMap); + this.zs_grpSettings.Controls.Add(this.zs_grpInv); + this.zs_grpSettings.Controls.Add(this.zs_cbStart); + this.zs_grpSettings.Location = new System.Drawing.Point(182, 59); + this.zs_grpSettings.Name = "zs_grpSettings"; + this.zs_grpSettings.Size = new System.Drawing.Size(296, 309); + this.zs_grpSettings.TabIndex = 2; + this.zs_grpSettings.TabStop = false; + this.zs_grpSettings.Text = "Settings"; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.label10); + this.groupBox1.Controls.Add(this.label6); + this.groupBox1.Controls.Add(this.label5); + this.groupBox1.Controls.Add(this.numericUpDown1); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.label7); + this.groupBox1.Controls.Add(this.numericUpDown4); + this.groupBox1.Controls.Add(this.label8); + this.groupBox1.Controls.Add(this.numericUpDown5); + this.groupBox1.Controls.Add(this.numericUpDown6); + this.groupBox1.Controls.Add(this.label9); + this.groupBox1.Location = new System.Drawing.Point(6, 169); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(284, 100); + this.groupBox1.TabIndex = 25; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Revive settings"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(7, 75); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(111, 13); + this.label6.TabIndex = 41; + this.label6.Text = "Cannot be used in last"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(201, 20); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(79, 13); + this.label5.TabIndex = 40; + this.label5.Text = "% effectiveness"; + // + // numericUpDown1 + // + this.numericUpDown1.Location = new System.Drawing.Point(150, 16); + this.numericUpDown1.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.numericUpDown1.Name = "numericUpDown1"; + this.numericUpDown1.Size = new System.Drawing.Size(52, 21); + this.numericUpDown1.TabIndex = 39; + this.numericUpDown1.Value = new decimal(new int[] { + 3, + 0, + 0, + 0}); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(91, 19); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(59, 13); + this.label4.TabIndex = 34; + this.label4.Text = "times, with"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(167, 48); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(100, 13); + this.label7.TabIndex = 38; + this.label7.Text = "seconds of infection"; + // + // numericUpDown4 + // + this.numericUpDown4.Location = new System.Drawing.Point(118, 73); + this.numericUpDown4.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.numericUpDown4.Name = "numericUpDown4"; + this.numericUpDown4.Size = new System.Drawing.Size(52, 21); + this.numericUpDown4.TabIndex = 37; + this.numericUpDown4.Value = new decimal(new int[] { + 3, + 0, + 0, + 0}); + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(7, 48); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(102, 13); + this.label8.TabIndex = 36; + this.label8.Text = "Must be used within"; + // + // numericUpDown5 + // + this.numericUpDown5.Location = new System.Drawing.Point(112, 46); + this.numericUpDown5.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.numericUpDown5.Name = "numericUpDown5"; + this.numericUpDown5.Size = new System.Drawing.Size(52, 21); + this.numericUpDown5.TabIndex = 35; + this.numericUpDown5.Value = new decimal(new int[] { + 10, + 0, + 0, + 0}); + // + // numericUpDown6 + // + this.numericUpDown6.Location = new System.Drawing.Point(36, 17); + this.numericUpDown6.Name = "numericUpDown6"; + this.numericUpDown6.Size = new System.Drawing.Size(52, 21); + this.numericUpDown6.TabIndex = 34; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(6, 19); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(27, 13); + this.label9.TabIndex = 34; + this.label9.Text = "Max"; + // + // zs_cbMain + // + this.zs_cbMain.AutoSize = true; + this.zs_cbMain.Location = new System.Drawing.Point(11, 66); + this.zs_cbMain.Name = "zs_cbMain"; + this.zs_cbMain.Size = new System.Drawing.Size(112, 17); + this.zs_cbMain.TabIndex = 24; + this.zs_cbMain.Text = "Change main level"; + this.zs_cbMain.UseVisualStyleBackColor = true; + // + // zs_cbMap + // + this.zs_cbMap.AutoSize = true; + this.zs_cbMap.Location = new System.Drawing.Point(11, 43); + this.zs_cbMap.Name = "zs_cbMap"; + this.zs_cbMap.Size = new System.Drawing.Size(136, 17); + this.zs_cbMap.TabIndex = 23; + this.zs_cbMap.Text = "Map name in server list"; + this.zs_cbMap.UseVisualStyleBackColor = true; + // + // zs_grpInv + // + this.zs_grpInv.Controls.Add(this.zs_numInvZombieDur); + this.zs_grpInv.Controls.Add(this.zs_numInvHumanDur); + this.zs_grpInv.Controls.Add(this.zs_numInvZombieMax); + this.zs_grpInv.Controls.Add(this.zs_numInvHumanMax); + this.zs_grpInv.Controls.Add(this.zs_lblInvZombieDur); + this.zs_grpInv.Controls.Add(this.zs_lblInvZombieMax); + this.zs_grpInv.Controls.Add(this.zs_lblInvHumanDur); + this.zs_grpInv.Controls.Add(this.zs_lblInvHumanMax); + this.zs_grpInv.Location = new System.Drawing.Point(6, 89); + this.zs_grpInv.Name = "zs_grpInv"; + this.zs_grpInv.Size = new System.Drawing.Size(284, 74); + this.zs_grpInv.TabIndex = 0; + this.zs_grpInv.TabStop = false; + this.zs_grpInv.Text = "Invisibility settings"; + // + // zs_numInvZombieDur + // + this.zs_numInvZombieDur.Location = new System.Drawing.Point(227, 45); + this.zs_numInvZombieDur.Name = "zs_numInvZombieDur"; + this.zs_numInvZombieDur.Size = new System.Drawing.Size(52, 21); + this.zs_numInvZombieDur.TabIndex = 33; + // + // zs_numInvHumanDur + // + this.zs_numInvHumanDur.Location = new System.Drawing.Point(227, 20); + this.zs_numInvHumanDur.Name = "zs_numInvHumanDur"; + this.zs_numInvHumanDur.Size = new System.Drawing.Size(52, 21); + this.zs_numInvHumanDur.TabIndex = 32; + // + // zs_numInvZombieMax + // + this.zs_numInvZombieMax.Location = new System.Drawing.Point(77, 45); + this.zs_numInvZombieMax.Name = "zs_numInvZombieMax"; + this.zs_numInvZombieMax.Size = new System.Drawing.Size(52, 21); + this.zs_numInvZombieMax.TabIndex = 31; + // + // zs_numInvHumanMax + // + this.zs_numInvHumanMax.Location = new System.Drawing.Point(78, 20); + this.zs_numInvHumanMax.Name = "zs_numInvHumanMax"; + this.zs_numInvHumanMax.Size = new System.Drawing.Size(52, 21); + this.zs_numInvHumanMax.TabIndex = 27; + this.zs_numInvHumanMax.Value = new decimal(new int[] { + 100, + 0, + 0, + 0}); + // + // zs_lblInvZombieDur + // + this.zs_lblInvZombieDur.AutoSize = true; + this.zs_lblInvZombieDur.Location = new System.Drawing.Point(129, 48); + this.zs_lblInvZombieDur.Name = "zs_lblInvZombieDur"; + this.zs_lblInvZombieDur.Size = new System.Drawing.Size(100, 13); + this.zs_lblInvZombieDur.TabIndex = 30; + this.zs_lblInvZombieDur.Text = "potions, and last for"; + // + // zs_lblInvZombieMax + // + this.zs_lblInvZombieMax.AutoSize = true; + this.zs_lblInvZombieMax.Location = new System.Drawing.Point(6, 48); + this.zs_lblInvZombieMax.Name = "zs_lblInvZombieMax"; + this.zs_lblInvZombieMax.Size = new System.Drawing.Size(72, 13); + this.zs_lblInvZombieMax.TabIndex = 29; + this.zs_lblInvZombieMax.Text = "Zombies: max"; + // + // zs_lblInvHumanDur + // + this.zs_lblInvHumanDur.AutoSize = true; + this.zs_lblInvHumanDur.Location = new System.Drawing.Point(129, 22); + this.zs_lblInvHumanDur.Name = "zs_lblInvHumanDur"; + this.zs_lblInvHumanDur.Size = new System.Drawing.Size(101, 13); + this.zs_lblInvHumanDur.TabIndex = 28; + this.zs_lblInvHumanDur.Text = "times, which last for"; + // + // zs_lblInvHumanMax + // + this.zs_lblInvHumanMax.AutoSize = true; + this.zs_lblInvHumanMax.Location = new System.Drawing.Point(7, 23); + this.zs_lblInvHumanMax.Name = "zs_lblInvHumanMax"; + this.zs_lblInvHumanMax.Size = new System.Drawing.Size(71, 13); + this.zs_lblInvHumanMax.TabIndex = 27; + this.zs_lblInvHumanMax.Text = "Humans: max"; + // + // zs_cbStart + // + this.zs_cbStart.AutoSize = true; + this.zs_cbStart.Location = new System.Drawing.Point(11, 20); + this.zs_cbStart.Name = "zs_cbStart"; + this.zs_cbStart.Size = new System.Drawing.Size(139, 17); + this.zs_cbStart.TabIndex = 22; + this.zs_cbStart.Text = "Start when server starts"; + this.zs_cbStart.UseVisualStyleBackColor = true; + // + // zs_grpMaps + // + this.zs_grpMaps.Controls.Add(this.label12); + this.zs_grpMaps.Controls.Add(this.zs_lblUsed); + this.zs_grpMaps.Controls.Add(this.zs_btnAdd); + this.zs_grpMaps.Controls.Add(this.zs_btnRemove); + this.zs_grpMaps.Controls.Add(this.zs_lstNotUsed); + this.zs_grpMaps.Controls.Add(this.zs_lstUsed); + this.zs_grpMaps.Location = new System.Drawing.Point(6, 59); + this.zs_grpMaps.Name = "zs_grpMaps"; + this.zs_grpMaps.Size = new System.Drawing.Size(170, 412); + this.zs_grpMaps.TabIndex = 1; + this.zs_grpMaps.TabStop = false; + this.zs_grpMaps.Text = "Maps"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(187, 17); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(83, 13); + this.label12.TabIndex = 6; + this.label12.Text = "Maps Not In Use"; + // + // zs_lblUsed + // + this.zs_lblUsed.AutoSize = true; + this.zs_lblUsed.Location = new System.Drawing.Point(6, 17); + this.zs_lblUsed.Name = "zs_lblUsed"; + this.zs_lblUsed.Size = new System.Drawing.Size(38, 13); + this.zs_lblUsed.TabIndex = 5; + this.zs_lblUsed.Text = "In use:"; + // + // zs_btnAdd + // + this.zs_btnAdd.Location = new System.Drawing.Point(6, 188); + this.zs_btnAdd.Name = "zs_btnAdd"; + this.zs_btnAdd.Size = new System.Drawing.Size(77, 23); + this.zs_btnAdd.TabIndex = 4; + this.zs_btnAdd.Text = "<< Add"; + this.zs_btnAdd.UseVisualStyleBackColor = true; + // + // zs_btnRemove + // + this.zs_btnRemove.Location = new System.Drawing.Point(89, 188); + this.zs_btnRemove.Name = "zs_btnRemove"; + this.zs_btnRemove.Size = new System.Drawing.Size(75, 23); + this.zs_btnRemove.TabIndex = 3; + this.zs_btnRemove.Text = "Remove >>"; + this.zs_btnRemove.UseVisualStyleBackColor = true; + // + // zs_lstNotUsed + // + this.zs_lstNotUsed.FormattingEnabled = true; + this.zs_lstNotUsed.Location = new System.Drawing.Point(6, 219); + this.zs_lstNotUsed.Name = "zs_lstNotUsed"; + this.zs_lstNotUsed.Size = new System.Drawing.Size(158, 186); + this.zs_lstNotUsed.TabIndex = 2; + // + // zs_lstUsed + // + this.zs_lstUsed.FormattingEnabled = true; + this.zs_lstUsed.Location = new System.Drawing.Point(6, 33); + this.zs_lstUsed.Name = "zs_lstUsed"; + this.zs_lstUsed.Size = new System.Drawing.Size(158, 147); + this.zs_lstUsed.TabIndex = 0; + // // tabZS_old // this.tabZS_old.BackColor = System.Drawing.SystemColors.Control; @@ -4810,449 +5278,14 @@ namespace MCGalaxy.Gui this.sec_numBlocksSecs.Text = "5s"; this.sec_numBlocksSecs.Value = System.TimeSpan.Parse("00:00:05"); // - // tabZS - // - this.tabZS.BackColor = System.Drawing.SystemColors.Control; - this.tabZS.Controls.Add(this.zs_grpControls); - this.tabZS.Controls.Add(this.groupBox2); - this.tabZS.Controls.Add(this.zs_grpSettings); - this.tabZS.Controls.Add(this.zs_grpMaps); - this.tabZS.Location = new System.Drawing.Point(4, 22); - this.tabZS.Name = "tabZS"; - this.tabZS.Padding = new System.Windows.Forms.Padding(3); - this.tabZS.Size = new System.Drawing.Size(484, 489); - this.tabZS.TabIndex = 6; - this.tabZS.Text = "Zombie Survival"; - // - // zs_grpControls - // - this.zs_grpControls.Controls.Add(this.zs_btnEnd); - this.zs_grpControls.Controls.Add(this.zs_btnStop); - this.zs_grpControls.Controls.Add(this.zs_btnStart); - this.zs_grpControls.Location = new System.Drawing.Point(110, 5); - this.zs_grpControls.Name = "zs_grpControls"; - this.zs_grpControls.Size = new System.Drawing.Size(279, 51); - this.zs_grpControls.TabIndex = 4; - this.zs_grpControls.TabStop = false; - this.zs_grpControls.Text = "Controls"; - // - // zs_btnEnd - // - this.zs_btnEnd.Location = new System.Drawing.Point(190, 19); - this.zs_btnEnd.Name = "zs_btnEnd"; - this.zs_btnEnd.Size = new System.Drawing.Size(80, 23); - this.zs_btnEnd.TabIndex = 2; - this.zs_btnEnd.Text = "End Round"; - this.zs_btnEnd.UseVisualStyleBackColor = true; - // - // zs_btnStop - // - this.zs_btnStop.Location = new System.Drawing.Point(100, 19); - this.zs_btnStop.Name = "zs_btnStop"; - this.zs_btnStop.Size = new System.Drawing.Size(80, 23); - this.zs_btnStop.TabIndex = 1; - this.zs_btnStop.Text = "Stop Game"; - this.zs_btnStop.UseVisualStyleBackColor = true; - // - // zs_btnStart - // - this.zs_btnStart.Location = new System.Drawing.Point(10, 19); - this.zs_btnStart.Name = "zs_btnStart"; - this.zs_btnStart.Size = new System.Drawing.Size(80, 23); - this.zs_btnStart.TabIndex = 0; - this.zs_btnStart.Text = "Start Game"; - this.zs_btnStart.UseVisualStyleBackColor = true; - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.groupBox3); - this.groupBox2.Controls.Add(this.groupBox4); - this.groupBox2.Controls.Add(this.groupBox5); - this.groupBox2.Enabled = false; - this.groupBox2.Location = new System.Drawing.Point(182, 184); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(296, 287); - this.groupBox2.TabIndex = 3; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Map Settings"; - // - // groupBox3 - // - this.groupBox3.Controls.Add(this.timespanUpDown1); - this.groupBox3.Controls.Add(this.timespanUpDown2); - this.groupBox3.Controls.Add(this.timespanUpDown3); - this.groupBox3.Controls.Add(this.label1); - this.groupBox3.Controls.Add(this.label2); - this.groupBox3.Controls.Add(this.label3); - this.groupBox3.Location = new System.Drawing.Point(6, 180); - this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(284, 71); - this.groupBox3.TabIndex = 39; - this.groupBox3.TabStop = false; - this.groupBox3.Text = "Time settings"; - // - // timespanUpDown1 - // - this.timespanUpDown1.Location = new System.Drawing.Point(69, 43); - this.timespanUpDown1.Name = "timespanUpDown1"; - this.timespanUpDown1.Seconds = ((long)(300)); - this.timespanUpDown1.Size = new System.Drawing.Size(62, 21); - this.timespanUpDown1.TabIndex = 38; - this.timespanUpDown1.Text = "5m"; - this.timespanUpDown1.Value = System.TimeSpan.Parse("00:05:00"); - // - // timespanUpDown2 - // - this.timespanUpDown2.Location = new System.Drawing.Point(216, 16); - this.timespanUpDown2.Name = "timespanUpDown2"; - this.timespanUpDown2.Seconds = ((long)(120)); - this.timespanUpDown2.Size = new System.Drawing.Size(62, 21); - this.timespanUpDown2.TabIndex = 37; - this.timespanUpDown2.Text = "2m"; - this.timespanUpDown2.Value = System.TimeSpan.Parse("00:02:00"); - // - // timespanUpDown3 - // - this.timespanUpDown3.Location = new System.Drawing.Point(69, 16); - this.timespanUpDown3.Name = "timespanUpDown3"; - this.timespanUpDown3.Seconds = ((long)(900)); - this.timespanUpDown3.Size = new System.Drawing.Size(62, 21); - this.timespanUpDown3.TabIndex = 36; - this.timespanUpDown3.Text = "15m"; - this.timespanUpDown3.Value = System.TimeSpan.Parse("00:15:00"); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(154, 20); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(59, 13); - this.label1.TabIndex = 35; - this.label1.Text = "Layer time:"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(8, 46); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(59, 13); - this.label2.TabIndex = 34; - this.label2.Text = "Flood time:"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(5, 20); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(63, 13); - this.label3.TabIndex = 34; - this.label3.Text = "Round time:"; - // - // groupBox4 - // - this.groupBox4.Controls.Add(this.label4); - this.groupBox4.Controls.Add(this.numericUpDown1); - this.groupBox4.Controls.Add(this.label5); - this.groupBox4.Controls.Add(this.numericUpDown2); - this.groupBox4.Controls.Add(this.numericUpDown3); - this.groupBox4.Controls.Add(this.label6); - this.groupBox4.Location = new System.Drawing.Point(6, 100); - this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(284, 74); - this.groupBox4.TabIndex = 1; - this.groupBox4.TabStop = false; - this.groupBox4.Text = "Layer flood settings"; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(183, 48); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(55, 13); - this.label4.TabIndex = 38; - this.label4.Text = "blocks tall"; - // - // numericUpDown1 - // - this.numericUpDown1.Location = new System.Drawing.Point(128, 44); - this.numericUpDown1.Maximum = new decimal(new int[] { - 1000000, - 0, - 0, - 0}); - this.numericUpDown1.Name = "numericUpDown1"; - this.numericUpDown1.Size = new System.Drawing.Size(52, 21); - this.numericUpDown1.TabIndex = 37; - this.numericUpDown1.Value = new decimal(new int[] { - 3, - 0, - 0, - 0}); - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(62, 48); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(64, 13); - this.label5.TabIndex = 36; - this.label5.Text = "layers, each"; - // - // numericUpDown2 - // - this.numericUpDown2.Location = new System.Drawing.Point(7, 44); - this.numericUpDown2.Maximum = new decimal(new int[] { - 1000000, - 0, - 0, - 0}); - this.numericUpDown2.Name = "numericUpDown2"; - this.numericUpDown2.Size = new System.Drawing.Size(52, 21); - this.numericUpDown2.TabIndex = 35; - this.numericUpDown2.Value = new decimal(new int[] { - 10, - 0, - 0, - 0}); - // - // numericUpDown3 - // - this.numericUpDown3.Location = new System.Drawing.Point(128, 16); - this.numericUpDown3.Name = "numericUpDown3"; - this.numericUpDown3.Size = new System.Drawing.Size(52, 21); - this.numericUpDown3.TabIndex = 34; - // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(28, 20); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(98, 13); - this.label6.TabIndex = 34; - this.label6.Text = "Layer flood chance:"; - // - // groupBox5 - // - this.groupBox5.Controls.Add(this.numericUpDown4); - this.groupBox5.Controls.Add(this.numericUpDown5); - this.groupBox5.Controls.Add(this.numericUpDown6); - this.groupBox5.Controls.Add(this.numericUpDown7); - this.groupBox5.Controls.Add(this.label7); - this.groupBox5.Controls.Add(this.label8); - this.groupBox5.Controls.Add(this.label9); - this.groupBox5.Controls.Add(this.label10); - this.groupBox5.Location = new System.Drawing.Point(6, 20); - this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(284, 74); - this.groupBox5.TabIndex = 0; - this.groupBox5.TabStop = false; - this.groupBox5.Text = "Flood block type"; - // - // numericUpDown4 - // - this.numericUpDown4.Location = new System.Drawing.Point(226, 45); - this.numericUpDown4.Name = "numericUpDown4"; - this.numericUpDown4.Size = new System.Drawing.Size(52, 21); - this.numericUpDown4.TabIndex = 33; - // - // numericUpDown5 - // - this.numericUpDown5.Location = new System.Drawing.Point(226, 20); - this.numericUpDown5.Name = "numericUpDown5"; - this.numericUpDown5.Size = new System.Drawing.Size(52, 21); - this.numericUpDown5.TabIndex = 32; - // - // numericUpDown6 - // - this.numericUpDown6.Location = new System.Drawing.Point(79, 45); - this.numericUpDown6.Name = "numericUpDown6"; - this.numericUpDown6.Size = new System.Drawing.Size(52, 21); - this.numericUpDown6.TabIndex = 31; - // - // numericUpDown7 - // - this.numericUpDown7.Location = new System.Drawing.Point(79, 20); - this.numericUpDown7.Name = "numericUpDown7"; - this.numericUpDown7.Size = new System.Drawing.Size(52, 21); - this.numericUpDown7.TabIndex = 27; - this.numericUpDown7.Value = new decimal(new int[] { - 100, - 0, - 0, - 0}); - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(135, 48); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(88, 13); - this.label7.TabIndex = 30; - this.label7.Text = "Destroys chance:"; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(11, 48); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(66, 13); - this.label8.TabIndex = 29; - this.label8.Text = "Fast chance:"; - // - // label9 - // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(147, 23); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(76, 13); - this.label9.TabIndex = 28; - this.label9.Text = "Water chance:"; - // // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(6, 23); + this.label10.Location = new System.Drawing.Point(172, 75); this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(71, 13); - this.label10.TabIndex = 27; - this.label10.Text = "Killer chance:"; - // - // zs_grpSettings - // - this.zs_grpSettings.Controls.Add(this.label11); - this.zs_grpSettings.Controls.Add(this.numericUpDown8); - this.zs_grpSettings.Controls.Add(this.zs_cbMain); - this.zs_grpSettings.Controls.Add(this.zs_cbMap); - this.zs_grpSettings.Controls.Add(this.zs_cbStart); - this.zs_grpSettings.Location = new System.Drawing.Point(182, 59); - this.zs_grpSettings.Name = "zs_grpSettings"; - this.zs_grpSettings.Size = new System.Drawing.Size(296, 119); - this.zs_grpSettings.TabIndex = 2; - this.zs_grpSettings.TabStop = false; - this.zs_grpSettings.Text = "Settings"; - // - // label11 - // - this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(14, 92); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(54, 13); - this.label11.TabIndex = 26; - this.label11.Text = "Max lives:"; - // - // numericUpDown8 - // - this.numericUpDown8.Location = new System.Drawing.Point(71, 89); - this.numericUpDown8.Maximum = new decimal(new int[] { - 1000000, - 0, - 0, - 0}); - this.numericUpDown8.Name = "numericUpDown8"; - this.numericUpDown8.Size = new System.Drawing.Size(52, 21); - this.numericUpDown8.TabIndex = 25; - this.numericUpDown8.Value = new decimal(new int[] { - 3, - 0, - 0, - 0}); - // - // zs_cbMain - // - this.zs_cbMain.AutoSize = true; - this.zs_cbMain.Location = new System.Drawing.Point(11, 66); - this.zs_cbMain.Name = "zs_cbMain"; - this.zs_cbMain.Size = new System.Drawing.Size(112, 17); - this.zs_cbMain.TabIndex = 24; - this.zs_cbMain.Text = "Change main level"; - this.zs_cbMain.UseVisualStyleBackColor = true; - // - // zs_cbMap - // - this.zs_cbMap.AutoSize = true; - this.zs_cbMap.Location = new System.Drawing.Point(11, 43); - this.zs_cbMap.Name = "zs_cbMap"; - this.zs_cbMap.Size = new System.Drawing.Size(136, 17); - this.zs_cbMap.TabIndex = 23; - this.zs_cbMap.Text = "Map name in server list"; - this.zs_cbMap.UseVisualStyleBackColor = true; - // - // zs_cbStart - // - this.zs_cbStart.AutoSize = true; - this.zs_cbStart.Location = new System.Drawing.Point(11, 20); - this.zs_cbStart.Name = "zs_cbStart"; - this.zs_cbStart.Size = new System.Drawing.Size(139, 17); - this.zs_cbStart.TabIndex = 22; - this.zs_cbStart.Text = "Start when server starts"; - this.zs_cbStart.UseVisualStyleBackColor = true; - // - // zs_grpMaps - // - this.zs_grpMaps.Controls.Add(this.label12); - this.zs_grpMaps.Controls.Add(this.zs_lblUsed); - this.zs_grpMaps.Controls.Add(this.zs_btnAdd); - this.zs_grpMaps.Controls.Add(this.zs_btnRemove); - this.zs_grpMaps.Controls.Add(this.zs_lstNotUsed); - this.zs_grpMaps.Controls.Add(this.zs_lstUsed); - this.zs_grpMaps.Location = new System.Drawing.Point(6, 59); - this.zs_grpMaps.Name = "zs_grpMaps"; - this.zs_grpMaps.Size = new System.Drawing.Size(170, 412); - this.zs_grpMaps.TabIndex = 1; - this.zs_grpMaps.TabStop = false; - this.zs_grpMaps.Text = "Maps"; - // - // label12 - // - this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(187, 17); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(83, 13); - this.label12.TabIndex = 6; - this.label12.Text = "Maps Not In Use"; - // - // zs_lblUsed - // - this.zs_lblUsed.AutoSize = true; - this.zs_lblUsed.Location = new System.Drawing.Point(6, 17); - this.zs_lblUsed.Name = "zs_lblUsed"; - this.zs_lblUsed.Size = new System.Drawing.Size(38, 13); - this.zs_lblUsed.TabIndex = 5; - this.zs_lblUsed.Text = "In use:"; - // - // zs_btnAdd - // - this.zs_btnAdd.Location = new System.Drawing.Point(6, 188); - this.zs_btnAdd.Name = "zs_btnAdd"; - this.zs_btnAdd.Size = new System.Drawing.Size(77, 23); - this.zs_btnAdd.TabIndex = 4; - this.zs_btnAdd.Text = "<< Add"; - this.zs_btnAdd.UseVisualStyleBackColor = true; - // - // zs_btnRemove - // - this.zs_btnRemove.Location = new System.Drawing.Point(89, 188); - this.zs_btnRemove.Name = "zs_btnRemove"; - this.zs_btnRemove.Size = new System.Drawing.Size(75, 23); - this.zs_btnRemove.TabIndex = 3; - this.zs_btnRemove.Text = "Remove >>"; - this.zs_btnRemove.UseVisualStyleBackColor = true; - // - // zs_lstNotUsed - // - this.zs_lstNotUsed.FormattingEnabled = true; - this.zs_lstNotUsed.Location = new System.Drawing.Point(6, 219); - this.zs_lstNotUsed.Name = "zs_lstNotUsed"; - this.zs_lstNotUsed.Size = new System.Drawing.Size(158, 186); - this.zs_lstNotUsed.TabIndex = 2; - // - // zs_lstUsed - // - this.zs_lstUsed.FormattingEnabled = true; - this.zs_lstUsed.Location = new System.Drawing.Point(6, 33); - this.zs_lstUsed.Name = "zs_lstUsed"; - this.zs_lstUsed.Size = new System.Drawing.Size(158, 147); - this.zs_lstUsed.TabIndex = 0; + this.label10.Size = new System.Drawing.Size(95, 13); + this.label10.TabIndex = 42; + this.label10.Text = "seconds of a round"; // // PropertyWindow // @@ -5377,6 +5410,30 @@ namespace MCGalaxy.Gui this.ls_grpSettings.PerformLayout(); this.ls_grpMaps.ResumeLayout(false); this.ls_grpMaps.PerformLayout(); + this.tabZS.ResumeLayout(false); + this.zs_grpControls.ResumeLayout(false); + this.groupBox2.ResumeLayout(false); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.timespanUpDown1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.timespanUpDown2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.timespanUpDown3)).EndInit(); + this.zs_grpSettings.ResumeLayout(false); + this.zs_grpSettings.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).EndInit(); + this.zs_grpInv.ResumeLayout(false); + this.zs_grpInv.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.zs_numInvZombieDur)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.zs_numInvHumanDur)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.zs_numInvZombieMax)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.zs_numInvHumanMax)).EndInit(); + this.zs_grpMaps.ResumeLayout(false); + this.zs_grpMaps.PerformLayout(); this.tabZS_old.ResumeLayout(false); this.tabCTF.ResumeLayout(false); this.ctf_grpControls.ResumeLayout(false); @@ -5429,32 +5486,17 @@ namespace MCGalaxy.Gui this.sec_grpBlocks.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.sec_numBlocksMsgs)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.sec_numBlocksSecs)).EndInit(); - this.tabZS.ResumeLayout(false); - this.zs_grpControls.ResumeLayout(false); - this.groupBox2.ResumeLayout(false); - this.groupBox3.ResumeLayout(false); - this.groupBox3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.timespanUpDown1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.timespanUpDown2)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.timespanUpDown3)).EndInit(); - this.groupBox4.ResumeLayout(false); - this.groupBox4.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit(); - this.groupBox5.ResumeLayout(false); - this.groupBox5.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown7)).EndInit(); - this.zs_grpSettings.ResumeLayout(false); - this.zs_grpSettings.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDown8)).EndInit(); - this.zs_grpMaps.ResumeLayout(false); - this.zs_grpMaps.PerformLayout(); this.ResumeLayout(false); } + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.NumericUpDown numericUpDown6; + private System.Windows.Forms.NumericUpDown numericUpDown5; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.NumericUpDown numericUpDown4; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.ListBox zs_lstUsed; private System.Windows.Forms.ListBox zs_lstNotUsed; private System.Windows.Forms.Button zs_btnRemove; @@ -5465,25 +5507,19 @@ namespace MCGalaxy.Gui private System.Windows.Forms.CheckBox zs_cbStart; private System.Windows.Forms.CheckBox zs_cbMap; private System.Windows.Forms.CheckBox zs_cbMain; - private System.Windows.Forms.NumericUpDown numericUpDown8; - private System.Windows.Forms.Label label11; private System.Windows.Forms.GroupBox zs_grpSettings; - private System.Windows.Forms.Label label10; - private System.Windows.Forms.Label label9; - private System.Windows.Forms.Label label8; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.NumericUpDown numericUpDown7; - private System.Windows.Forms.NumericUpDown numericUpDown6; - private System.Windows.Forms.NumericUpDown numericUpDown5; - private System.Windows.Forms.NumericUpDown numericUpDown4; - private System.Windows.Forms.GroupBox groupBox5; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.NumericUpDown numericUpDown3; - private System.Windows.Forms.NumericUpDown numericUpDown2; + private System.Windows.Forms.Label zs_lblInvHumanMax; + private System.Windows.Forms.Label zs_lblInvHumanDur; + private System.Windows.Forms.Label zs_lblInvZombieMax; + private System.Windows.Forms.Label zs_lblInvZombieDur; + private System.Windows.Forms.NumericUpDown zs_numInvHumanMax; + private System.Windows.Forms.NumericUpDown zs_numInvZombieMax; + private System.Windows.Forms.NumericUpDown zs_numInvHumanDur; + private System.Windows.Forms.NumericUpDown zs_numInvZombieDur; + private System.Windows.Forms.GroupBox zs_grpInv; private System.Windows.Forms.Label label5; private System.Windows.Forms.NumericUpDown numericUpDown1; private System.Windows.Forms.Label label4; - private System.Windows.Forms.GroupBox groupBox4; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label1; From 60e4eb2c10abc971c645126f9fc6e92e88e7a77e Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 27 Jul 2019 10:01:31 +1000 Subject: [PATCH 2/3] Combine invisibility and zinvisibility items --- MCGalaxy/Economy/Economy.cs | 4 +- MCGalaxy/Economy/ReviveItem.cs | 88 ----------------------- MCGalaxy/Economy/ZombieItems.cs | 122 ++++++++++++++++++++++---------- MCGalaxy/MCGalaxy_.csproj | 1 - 4 files changed, 85 insertions(+), 130 deletions(-) delete mode 100644 MCGalaxy/Economy/ReviveItem.cs diff --git a/MCGalaxy/Economy/Economy.cs b/MCGalaxy/Economy/Economy.cs index c18a10219..3c2433ecd 100644 --- a/MCGalaxy/Economy/Economy.cs +++ b/MCGalaxy/Economy/Economy.cs @@ -68,7 +68,7 @@ namespace MCGalaxy.Eco { try { lock (saveLock) SaveCore(); } catch (Exception e) { - Logger.LogError("Error loading " + Paths.EconomyPropsFile, e); + Logger.LogError("Error saving " + Paths.EconomyPropsFile, e); } } @@ -89,7 +89,7 @@ namespace MCGalaxy.Eco { new TitleItem(), new RankItem(), new LevelItem(), new LoginMessageItem(), new LogoutMessageItem(), new BlocksItem(), new QueueLevelItem(), new InfectMessageItem(), new NickItem(), new ReviveItem(), - new HumanInvisibilityItem(), new ZombieInvisibilityItem() }; + new InvisibilityItem() }; /// Finds the item whose name or one of its aliases caselessly matches the input. public static Item GetItem(string name) { diff --git a/MCGalaxy/Economy/ReviveItem.cs b/MCGalaxy/Economy/ReviveItem.cs deleted file mode 100644 index 51b915f5a..000000000 --- a/MCGalaxy/Economy/ReviveItem.cs +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright 2015 MCGalaxy - - Dual-licensed under the Educational Community License, Version 2.0 and - the GNU General Public License, Version 3 (the "Licenses"); you may - not use this file except in compliance with the Licenses. You may - obtain a copy of the Licenses at - - http://www.opensource.org/licenses/ecl2.php - http://www.gnu.org/licenses/gpl-3.0.html - - Unless required by applicable law or agreed to in writing, - software distributed under the Licenses are distributed on an "AS IS" - BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express - or implied. See the Licenses for the specific language governing - permissions and limitations under the Licenses. - */ -using System; -using System.Collections.Generic; -using MCGalaxy.Games; - -namespace MCGalaxy.Eco { - - public sealed class ReviveItem : SimpleItem { - - public ReviveItem() { - Aliases = new string[] { "revive", "rev" }; - Price = 7; - } - - public override string Name { get { return "Revive"; } } - - protected internal override void OnBuyCommand(Player p, string message, string[] args) { - if (p.money < Price) { - p.Message("%WYou don't have enough &3" + Server.Config.Currency + "%W to buy a " + Name + "."); return; - } - if (!ZSGame.Instance.Running || !ZSGame.Instance.RoundInProgress) { - p.Message("You can only buy an revive potion " + - "when a round of zombie survival is in progress."); return; - } - - ZSData data = ZSGame.Get(p); - if (!data.Infected) { - p.Message("You are already a human."); return; - } - - DateTime end = ZSGame.Instance.RoundEnd; - if (DateTime.UtcNow.AddSeconds(ZSGame.Config.ReviveNoTime) > end) { - p.Message(ZSGame.Config.ReviveNoTimeMessage); return; - } - int count = ZSGame.Instance.Infected.Count; - if (count < ZSGame.Config.ReviveFewZombies) { - p.Message(ZSGame.Config.ReviveFewZombiesMessage); return; - } - if (data.RevivesUsed >= ZSGame.Config.ReviveTimes) { - p.Message("You cannot buy any more revive potions."); return; - } - if (data.TimeInfected.AddSeconds(ZSGame.Config.ReviveTooSlow) < DateTime.UtcNow) { - p.Message("%WYou can only revive within the first {0} seconds after you were infected.", - ZSGame.Config.ReviveTooSlow); return; - } - - int chance = new Random().Next(1, 101); - if (chance <= ZSGame.Config.ReviveChance) { - ZSGame.Instance.DisinfectPlayer(p); - ZSGame.Instance.Map.Message(p.ColoredName + " %Sused a revive potion. &aIt was super effective!"); - } else { - ZSGame.Instance.Map.Message(p.ColoredName + " %Stried using a revive potion. &cIt was not very effective.."); - } - Economy.MakePurchase(p, Price, "%3Revive:"); - data.RevivesUsed++; - } - - protected override void DoPurchase(Player p, string message, string[] args) { } - - protected internal override void OnStoreCommand(Player p) { - int time = ZSGame.Config.ReviveNoTime, expiry = ZSGame.Config.ReviveTooSlow; - int potions = ZSGame.Config.ReviveTimes; - p.Message("%T/Buy " + Name); - OutputItemInfo(p); - - p.Message("Lets you rejoin the humans - %Wnot guaranteed to always work"); - p.Message(" Cannot be used in the last &a" + time + " %Sseconds of a round."); - p.Message(" Can only be used within &a" + expiry + " %Sseconds after being infected."); - p.Message(" Can only buy &a" + potions + " %Srevive potions per round."); - } - } -} diff --git a/MCGalaxy/Economy/ZombieItems.cs b/MCGalaxy/Economy/ZombieItems.cs index 1134c3ecc..13920459a 100644 --- a/MCGalaxy/Economy/ZombieItems.cs +++ b/MCGalaxy/Economy/ZombieItems.cs @@ -123,12 +123,16 @@ namespace MCGalaxy.Eco { } } - public abstract class InvisibilityItem : SimpleItem { + public sealed class InvisibilityItem : SimpleItem { - protected abstract int MaxPotions { get; } - protected abstract int Duration { get; } - protected abstract bool ForHumans { get; } + public InvisibilityItem() { + // old aliases for when invisibility and zombie invisibility were seperate + Aliases = new string[] { "invisibility", "invisible", "invis", "zinvisibility", "zinvisible", "zinvis" }; + Price = 3; + } + public override string Name { get { return "Invisibility"; } } + protected internal override void OnBuyCommand(Player p, string message, string[] args) { if (p.money < Price) { p.Message("%WYou don't have enough &3{1} %Wto buy a {0}.", Name, Server.Config.Currency); return; @@ -138,34 +142,31 @@ namespace MCGalaxy.Eco { "when a round of zombie survival is in progress."); return; } - ZSData data = ZSGame.Get(p); - + ZSData data = ZSGame.Get(p); if (data.Invisible) { p.Message("You are already invisible."); return; } - if (data.InvisibilityPotions >= MaxPotions) { + + int maxPotions = data.Infected ? + ZSGame.Config.ZombieInvisibilityPotions : ZSGame.Config.InvisibilityPotions; + if (data.InvisibilityPotions >= maxPotions) { p.Message("You cannot buy any more invisibility potions this round."); return; } - if (ForHumans && data.Infected) { - p.Message("Use %T/Buy zinvisibility %Sfor buying invisibility when you are a zombie."); return; - } - if (!ForHumans && !data.Infected) { - p.Message("Use %T/Buy invisibility %Sfor buying invisibility when you are a human."); return; - } DateTime end = ZSGame.Instance.RoundEnd; if (DateTime.UtcNow.AddSeconds(60) > end) { - p.Message("You cannot buy an invisibility potion " + - "during the last minute of a round."); return; + p.Message("You cannot buy an invisibility potion during the last minute of a round."); return; } + int duration = data.Infected ? + ZSGame.Config.ZombieInvisibilityDuration : ZSGame.Config.InvisibilityDuration; data.Invisible = true; - data.InvisibilityEnd = DateTime.UtcNow.AddSeconds(Duration); + data.InvisibilityEnd = DateTime.UtcNow.AddSeconds(duration); data.InvisibilityPotions++; - int left = MaxPotions - data.InvisibilityPotions; + int left = maxPotions - data.InvisibilityPotions; - p.Message("Lasts for &a{0} %Sseconds. You can buy &a{1} %Smore this round.", Duration, left); + p.Message("Lasts for &a{0} %Sseconds. You can buy &a{1} %Smore this round.", duration, left); ZSGame.Instance.Map.Message(p.ColoredName + " %Svanished. &a*POOF*"); Entities.GlobalDespawn(p, false, false); - Economy.MakePurchase(p, Price, "%3Invisibility: " + Duration); + Economy.MakePurchase(p, Price, "%3Invisibility: " + duration); } protected override void DoPurchase(Player p, string message, string[] args) { } @@ -174,36 +175,79 @@ namespace MCGalaxy.Eco { p.Message("%T/Buy " + Name); OutputItemInfo(p); - p.Message("Makes you invisible to {0} - %Wyou can still {1}", + /*p.Message("Makes you invisible to {0} - %Wyou can still {1}", ForHumans ? "zombies" : "humans", ForHumans ? "be infected" : "infect humans"); - p.Message("Lasts for " + Duration + " seconds before you reappear."); + p.Message("Lasts for " + Duration + " seconds before you reappear.");*/ + p.Message("Humans: Makes you invisible to zombies for {0} seconds", ZSGame.Config.InvisibilityDuration); + p.Message(" %WYou can still get infected while invisible"); + p.Message("Zombies: Makes you invisible to humans for {0} seconds", ZSGame.Config.ZombieInvisibilityDuration); + p.Message(" %WYou can still infect humans while invisible"); } } - public sealed class HumanInvisibilityItem : InvisibilityItem { + public sealed class ReviveItem : SimpleItem { - public HumanInvisibilityItem() { - Aliases = new string[] { "invisibility", "invisible", "invis" }; - Price = 3; + public ReviveItem() { + Aliases = new string[] { "revive", "rev" }; + Price = 7; } - public override string Name { get { return "Invisibility"; } } - protected override int MaxPotions { get { return ZSGame.Config.InvisibilityPotions; } } - protected override int Duration { get { return ZSGame.Config.InvisibilityDuration; } } - protected override bool ForHumans { get { return true; } } - } - - public sealed class ZombieInvisibilityItem : InvisibilityItem { + public override string Name { get { return "Revive"; } } - public ZombieInvisibilityItem() { - Aliases = new string[] { "zinvisibility", "zinvisible", "zinvis" }; - Price = 3; + protected internal override void OnBuyCommand(Player p, string message, string[] args) { + if (p.money < Price) { + p.Message("%WYou don't have enough &3" + Server.Config.Currency + "%W to buy a " + Name + "."); return; + } + if (!ZSGame.Instance.Running || !ZSGame.Instance.RoundInProgress) { + p.Message("You can only buy an revive potion " + + "when a round of zombie survival is in progress."); return; + } + + ZSData data = ZSGame.Get(p); + if (!data.Infected) { + p.Message("You are already a human."); return; + } + + DateTime end = ZSGame.Instance.RoundEnd; + if (DateTime.UtcNow.AddSeconds(ZSGame.Config.ReviveNoTime) > end) { + p.Message(ZSGame.Config.ReviveNoTimeMessage); return; + } + int count = ZSGame.Instance.Infected.Count; + if (count < ZSGame.Config.ReviveFewZombies) { + p.Message(ZSGame.Config.ReviveFewZombiesMessage); return; + } + if (data.RevivesUsed >= ZSGame.Config.ReviveTimes) { + p.Message("You cannot buy any more revive potions."); return; + } + if (data.TimeInfected.AddSeconds(ZSGame.Config.ReviveTooSlow) < DateTime.UtcNow) { + p.Message("%WYou can only revive within the first {0} seconds after you were infected.", + ZSGame.Config.ReviveTooSlow); return; + } + + int chance = new Random().Next(1, 101); + if (chance <= ZSGame.Config.ReviveChance) { + ZSGame.Instance.DisinfectPlayer(p); + ZSGame.Instance.Map.Message(p.ColoredName + " %Sused a revive potion. &aIt was super effective!"); + } else { + ZSGame.Instance.Map.Message(p.ColoredName + " %Stried using a revive potion. &cIt was not very effective.."); + } + Economy.MakePurchase(p, Price, "%3Revive:"); + data.RevivesUsed++; } - public override string Name { get { return "ZombieInvisibility"; } } - protected override int MaxPotions { get { return ZSGame.Config.ZombieInvisibilityPotions; } } - protected override int Duration { get { return ZSGame.Config.ZombieInvisibilityDuration; } } - protected override bool ForHumans { get { return false; } } + protected override void DoPurchase(Player p, string message, string[] args) { } + + protected internal override void OnStoreCommand(Player p) { + int time = ZSGame.Config.ReviveNoTime, expiry = ZSGame.Config.ReviveTooSlow; + int potions = ZSGame.Config.ReviveTimes; + p.Message("%T/Buy " + Name); + OutputItemInfo(p); + + p.Message("Lets you rejoin the humans - %Wnot guaranteed to always work"); + p.Message(" Cannot be used in the last &a" + time + " %Sseconds of a round."); + p.Message(" Can only be used within &a" + expiry + " %Sseconds after being infected."); + p.Message(" Can only buy &a" + potions + " %Srevive potions per round."); + } } } diff --git a/MCGalaxy/MCGalaxy_.csproj b/MCGalaxy/MCGalaxy_.csproj index 3c0c674a7..29e2fa2e6 100644 --- a/MCGalaxy/MCGalaxy_.csproj +++ b/MCGalaxy/MCGalaxy_.csproj @@ -465,7 +465,6 @@ - From 404a5b9f5ee8dbeff56ed69dfacba70a33c09e33 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 27 Jul 2019 14:34:17 +1000 Subject: [PATCH 3/3] move code out of invisible/revive items and into more logical ZSGame --- MCGalaxy/Commands/Moderation/CmdLocation.cs | 3 +- MCGalaxy/Economy/ZombieItems.cs | 32 ++++++--------------- MCGalaxy/Games/ZombieSurvival/ZSGame.cs | 21 +++++++++++++- 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/MCGalaxy/Commands/Moderation/CmdLocation.cs b/MCGalaxy/Commands/Moderation/CmdLocation.cs index 96d858a44..d57da59d9 100644 --- a/MCGalaxy/Commands/Moderation/CmdLocation.cs +++ b/MCGalaxy/Commands/Moderation/CmdLocation.cs @@ -61,8 +61,7 @@ namespace MCGalaxy.Commands.Moderation { } if (elems == null) elems = ConfigElement.GetAll(typeof(GeoInfo)); - obj.Deserialise(elems, info); - + obj.Deserialise(elems, info); string suffix = HasExtraPerm(p, data.Rank, 1) ? "&b{1}%S/&b{2}" : "&b{2}"; string target = name == null ? ip : "of " + PlayerInfo.GetColoredName(p, name); diff --git a/MCGalaxy/Economy/ZombieItems.cs b/MCGalaxy/Economy/ZombieItems.cs index 13920459a..95e195bcc 100644 --- a/MCGalaxy/Economy/ZombieItems.cs +++ b/MCGalaxy/Economy/ZombieItems.cs @@ -135,18 +135,18 @@ namespace MCGalaxy.Eco { protected internal override void OnBuyCommand(Player p, string message, string[] args) { if (p.money < Price) { - p.Message("%WYou don't have enough &3{1} %Wto buy a {0}.", Name, Server.Config.Currency); return; + p.Message("%WYou don't have enough &3{1} %Wto buy an {0}.", Name, Server.Config.Currency); return; } if (!ZSGame.Instance.Running || !ZSGame.Instance.RoundInProgress) { p.Message("You can only buy an invisiblity potion " + "when a round of zombie survival is in progress."); return; } - ZSData data = ZSGame.Get(p); + ZSData data = ZSGame.Get(p); if (data.Invisible) { p.Message("You are already invisible."); return; } + ZSConfig cfg = ZSGame.Config; - int maxPotions = data.Infected ? - ZSGame.Config.ZombieInvisibilityPotions : ZSGame.Config.InvisibilityPotions; + int maxPotions = data.Infected ? cfg.ZombieInvisibilityPotions : cfg.InvisibilityPotions; if (data.InvisibilityPotions >= maxPotions) { p.Message("You cannot buy any more invisibility potions this round."); return; } @@ -156,16 +156,12 @@ namespace MCGalaxy.Eco { p.Message("You cannot buy an invisibility potion during the last minute of a round."); return; } - int duration = data.Infected ? - ZSGame.Config.ZombieInvisibilityDuration : ZSGame.Config.InvisibilityDuration; - data.Invisible = true; - data.InvisibilityEnd = DateTime.UtcNow.AddSeconds(duration); + int duration = data.Infected ? cfg.ZombieInvisibilityDuration : cfg.InvisibilityDuration; data.InvisibilityPotions++; int left = maxPotions - data.InvisibilityPotions; p.Message("Lasts for &a{0} %Sseconds. You can buy &a{1} %Smore this round.", duration, left); - ZSGame.Instance.Map.Message(p.ColoredName + " %Svanished. &a*POOF*"); - Entities.GlobalDespawn(p, false, false); + ZSGame.Instance.GoInvisible(p, duration); Economy.MakePurchase(p, Price, "%3Invisibility: " + duration); } @@ -175,10 +171,6 @@ namespace MCGalaxy.Eco { p.Message("%T/Buy " + Name); OutputItemInfo(p); - /*p.Message("Makes you invisible to {0} - %Wyou can still {1}", - ForHumans ? "zombies" : "humans", - ForHumans ? "be infected" : "infect humans"); - p.Message("Lasts for " + Duration + " seconds before you reappear.");*/ p.Message("Humans: Makes you invisible to zombies for {0} seconds", ZSGame.Config.InvisibilityDuration); p.Message(" %WYou can still get infected while invisible"); p.Message("Zombies: Makes you invisible to humans for {0} seconds", ZSGame.Config.ZombieInvisibilityDuration); @@ -207,7 +199,7 @@ namespace MCGalaxy.Eco { ZSData data = ZSGame.Get(p); if (!data.Infected) { p.Message("You are already a human."); return; - } + } DateTime end = ZSGame.Instance.RoundEnd; if (DateTime.UtcNow.AddSeconds(ZSGame.Config.ReviveNoTime) > end) { @@ -225,15 +217,9 @@ namespace MCGalaxy.Eco { ZSGame.Config.ReviveTooSlow); return; } - int chance = new Random().Next(1, 101); - if (chance <= ZSGame.Config.ReviveChance) { - ZSGame.Instance.DisinfectPlayer(p); - ZSGame.Instance.Map.Message(p.ColoredName + " %Sused a revive potion. &aIt was super effective!"); - } else { - ZSGame.Instance.Map.Message(p.ColoredName + " %Stried using a revive potion. &cIt was not very effective.."); - } - Economy.MakePurchase(p, Price, "%3Revive:"); + ZSGame.Instance.AttemptRevive(p); data.RevivesUsed++; + Economy.MakePurchase(p, Price, "%3Revive:"); } protected override void DoPurchase(Player p, string message, string[] args) { } diff --git a/MCGalaxy/Games/ZombieSurvival/ZSGame.cs b/MCGalaxy/Games/ZombieSurvival/ZSGame.cs index 21c6f1110..13486ef41 100644 --- a/MCGalaxy/Games/ZombieSurvival/ZSGame.cs +++ b/MCGalaxy/Games/ZombieSurvival/ZSGame.cs @@ -249,7 +249,26 @@ namespace MCGalaxy.Games { else if (winStreak == 2) prefix += "&7*" + p.color; else if (winStreak == 3) prefix += "&6*" + p.color; else if (winStreak > 0) prefix += "&6" + winStreak + p.color; - } + } + + public void GoInvisible(Player p, int duration) { + ZSData data = Get(p); + data.Invisible = true; + data.InvisibilityEnd = DateTime.UtcNow.AddSeconds(duration); + + Map.Message(p.ColoredName + " %Svanished. &a*POOF*"); + Entities.GlobalDespawn(p, false, false); + } + + public void AttemptRevive(Player p) { + int chance = new Random().Next(1, 101); + if (chance <= Config.ReviveChance) { + DisinfectPlayer(p); + Map.Message(p.ColoredName + " %Sused a revive potion. &aIt was super effective!"); + } else { + Map.Message(p.ColoredName + " %Stried using a revive potion. &cIt was not very effective.."); + } + } public bool HasMap(string name) {