Combine ZombieGame.Props.cs / ZombieGame.cs file

This commit is contained in:
UnknownShadow200 2017-10-27 08:52:48 +11:00
parent 652f48ea14
commit 3bbff57d8f
6 changed files with 37 additions and 103 deletions

View File

@ -25,16 +25,12 @@ namespace MCGalaxy.Games {
public VolatileArray<Player> Players = new VolatileArray<Player>(); public VolatileArray<Player> Players = new VolatileArray<Player>();
public VolatileArray<Player> Remaining = new VolatileArray<Player>(); public VolatileArray<Player> Remaining = new VolatileArray<Player>();
public CountdownGameStatus Status = CountdownGameStatus.Disabled; public CountdownGameStatus Status = CountdownGameStatus.Disabled;
public override bool Running { get { return Status != CountdownGameStatus.Disabled; } } public override bool Running { get { return Status != CountdownGameStatus.Disabled; } }
/// <summary> Whether players are allowed to teleport to others when not in referee mode. </summary>
public override bool TeleportAllowed { get { return Status == CountdownGameStatus.RoundInProgress; } }
public bool FreezeMode = false; public bool FreezeMode = false;
public int Interval; public int Interval;
public string SpeedType; public string SpeedType;
CountdownPlugin plugin = new CountdownPlugin(); CountdownPlugin plugin = new CountdownPlugin();
List<SquarePos> squaresLeft = new List<SquarePos>(); List<SquarePos> squaresLeft = new List<SquarePos>();

View File

@ -72,30 +72,23 @@ namespace MCGalaxy.Games {
[ConfigString("revive-notime-msg", "Revive", [ConfigString("revive-notime-msg", "Revive",
"It's too late. The humans do not have enough time left to make more revive potions.")] "It's too late. The humans do not have enough time left to make more revive potions.")]
public static string ReviveNoTimeMessage = "It's too late. The humans do not have enough time left to produce more revive potions."; public static string ReviveNoTimeMessage = "It's too late. The humans do not have enough time left to produce more revive potions.";
[ConfigInt("revive-no-time", "Revive", 120, 0)] [ConfigInt("revive-no-time", "Revive", 120, 0)]
public static int ReviveNoTime = 120; public static int ReviveNoTime = 120;
[ConfigString("revive-fewzombies-msg", "Revive", [ConfigString("revive-fewzombies-msg", "Revive",
"There aren't enough zombies for it to be worthwhile to produce revive potions.")] "There aren't enough zombies for it to be worthwhile to produce revive potions.")]
public static string ReviveFewZombiesMessage = "There aren't enough zombies for it to be worthwhile to produce revive potions."; public static string ReviveFewZombiesMessage = "There aren't enough zombies for it to be worthwhile to produce revive potions.";
[ConfigInt("revive-fewzombies", "Revive", 3, 0)] [ConfigInt("revive-fewzombies", "Revive", 3, 0)]
public static int ReviveFewZombies = 3; public static int ReviveFewZombies = 3;
[ConfigInt("revive-tooslow", "Revive", 60, 0)] [ConfigInt("revive-tooslow", "Revive", 60, 0)]
public static int ReviveTooSlow = 60; public static int ReviveTooSlow = 60;
[ConfigInt("revive-chance", "Revive", 80, 0, 100)] [ConfigInt("revive-chance", "Revive", 80, 0, 100)]
public static int ReviveChance = 80; public static int ReviveChance = 80;
[ConfigInt("revive-times", "Revive", 1, 0)] [ConfigInt("revive-times", "Revive", 1, 0)]
public static int ReviveTimes = 1; public static int ReviveTimes = 1;
[ConfigString("revive-success", "Revive", "used a revive potion. &aIt was super effective!")] [ConfigString("revive-success", "Revive", "used a revive potion. &aIt was super effective!")]
public static string ReviveSuccessMessage = "used a revive potion. &aIt was super effective!"; public static string ReviveSuccessMessage = "used a revive potion. &aIt was super effective!";
[ConfigString("revive-failure", "Revive", "tried using a revive potion. &cIt was not very effective..")] [ConfigString("revive-failure", "Revive", "tried using a revive potion. &cIt was not very effective..")]
public static string ReviveFailureMessage = "tried using a revive potion. &cIt was not very effective.."; public static string ReviveFailureMessage = "tried using a revive potion. &cIt was not very effective..";

View File

@ -25,6 +25,7 @@ namespace MCGalaxy.Games {
public LevelPicker Picker = new ZSLevelPicker(); public LevelPicker Picker = new ZSLevelPicker();
public override bool TeleportAllowed { get { return !RoundInProgress; } } public override bool TeleportAllowed { get { return !RoundInProgress; } }
public override bool Running { get { return Status != ZombieGameStatus.NotStarted; } }
public override void PlayerLeftGame(Player p) { public override void PlayerLeftGame(Player p) {
Alive.Remove(p); Alive.Remove(p);

View File

@ -1,83 +0,0 @@
/*
Copyright 2010 MCLawl Team -
Created by Snowl (David D.) and Cazzar (Cayde D.)
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.osedu.org/licenses/ECL-2.0
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 System.IO;
using System.Threading;
using MCGalaxy.Config;
namespace MCGalaxy.Games {
public class BountyData {
public string Origin, Target;
public int Amount;
public BountyData(string origin, string target, int amount) {
Origin = origin; Target = target; Amount = amount;
}
}
public enum ZombieGameStatus { NotStarted, InfiniteRounds, SingleRound, VariableRounds, LastRound }
public sealed partial class ZSGame {
public const string InfectCol = "&infect";
/// <summary> The number of rounds that have been played in this game so far. </summary>
public int RoundsDone = 0;
/// <summary> The maximum number of rounds that can be played before the game ends. </summary>
public int MaxRounds = 0;
/// <summary> Current round status of the game. </summary>
public ZombieGameStatus Status = ZombieGameStatus.NotStarted;
/// <summary> Gets whether zombie survival is currently running. </summary>
public override bool Running { get { return Status != ZombieGameStatus.NotStarted; } }
/// <summary> Whether a round is currently in progress. </summary>
public bool RoundInProgress = false;
/// <summary> Time at which the next round is scheduled to start. </summary>
public DateTime RoundStart;
/// <summary> Time at which the next round is scheduled to end. </summary>
public DateTime RoundEnd;
/// <summary> The name of the level that the last round of zombie survival was played on. </summary>
public string LastLevelName = "";
/// <summary> List of alive/human players. </summary>
public VolatileArray<Player> Alive = new VolatileArray<Player>();
/// <summary> List of dead/infected players. </summary>
public VolatileArray<Player> Infected = new VolatileArray<Player>();
/// <summary> Name of the player queued to be the first zombie in the next round. </summary>
public string QueuedZombie;
List<string> infectMessages = new List<string>();
string lastPlayerToInfect = "";
int infectCombo = 0;
/// <summary> List of players who have a bounty on them. </summary>
public VolatileArray<BountyData> Bounties = new VolatileArray<BountyData>();
}
}

View File

@ -28,11 +28,39 @@ using MCGalaxy.SQL;
namespace MCGalaxy.Games { namespace MCGalaxy.Games {
public class BountyData {
public string Origin, Target;
public int Amount;
public BountyData(string origin, string target, int amount) {
Origin = origin; Target = target; Amount = amount;
}
}
public enum ZombieGameStatus { NotStarted, InfiniteRounds, SingleRound, VariableRounds, LastRound }
public struct ZombieStats { public struct ZombieStats {
public int TotalRounds, MaxRounds, TotalInfected, MaxInfected; public int TotalRounds, MaxRounds, TotalInfected, MaxInfected;
} }
public sealed partial class ZSGame { public sealed partial class ZSGame {
public const string InfectCol = "&infect";
public int RoundsDone = 0;
public int MaxRounds = 0;
public ZombieGameStatus Status = ZombieGameStatus.NotStarted;
public bool RoundInProgress = false;
public DateTime RoundStart, RoundEnd;
public string LastLevelName = "";
public VolatileArray<Player> Alive = new VolatileArray<Player>();
public VolatileArray<Player> Infected = new VolatileArray<Player>();
public string QueuedZombie;
public VolatileArray<BountyData> Bounties = new VolatileArray<BountyData>();
List<string> infectMessages = new List<string>();
string lastPlayerToInfect = "";
int infectCombo = 0;
ZSPlugin plugin = new ZSPlugin(); ZSPlugin plugin = new ZSPlugin();
public void Start(ZombieGameStatus status, Level level, int rounds) { public void Start(ZombieGameStatus status, Level level, int rounds) {

View File

@ -514,7 +514,6 @@
<Compile Include="Games\ZombieSurvival\Rewards.cs" /> <Compile Include="Games\ZombieSurvival\Rewards.cs" />
<Compile Include="Games\ZombieSurvival\ZombieGame.cs" /> <Compile Include="Games\ZombieSurvival\ZombieGame.cs" />
<Compile Include="Games\ZombieSurvival\ZombieGame.Game.cs" /> <Compile Include="Games\ZombieSurvival\ZombieGame.Game.cs" />
<Compile Include="Games\ZombieSurvival\ZombieGame.Props.cs" />
<Compile Include="Games\ZombieSurvival\ZSConfig.cs" /> <Compile Include="Games\ZombieSurvival\ZSConfig.cs" />
<Compile Include="Games\ZombieSurvival\ZSPlugin.cs" /> <Compile Include="Games\ZombieSurvival\ZSPlugin.cs" />
<Compile Include="Generator\AdvNoiseGen.cs" /> <Compile Include="Generator\AdvNoiseGen.cs" />