mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-26 14:54:12 -04:00
Add /mapauthors command for zombie and lava survival.
This commit is contained in:
parent
446560bf4f
commit
2e1aa7055d
44
Commands/Fun/CmdMapAuthors.cs
Normal file
44
Commands/Fun/CmdMapAuthors.cs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
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 System.Threading;
|
||||||
|
|
||||||
|
namespace MCGalaxy.Commands {
|
||||||
|
|
||||||
|
public sealed class CmdMapAuthor : Command {
|
||||||
|
public override string name { get { return "mapauthors"; } }
|
||||||
|
public override string shortcut { get { return "authors"; } }
|
||||||
|
public override string type { get { return CommandTypes.Games; } }
|
||||||
|
public override bool museumUsable { get { return true; } }
|
||||||
|
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
|
||||||
|
public override bool Enabled { get { return Server.ZombieModeOn || Server.lava.active; } }
|
||||||
|
|
||||||
|
public override void Use(Player p, string message) {
|
||||||
|
if (p == null) { MessageInGameOnly(p); return; }
|
||||||
|
p.level.Authors = message;
|
||||||
|
Player.SendMessage(p, "Sets the authors of the map to: " + message.Replace(" ", "%S, "));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Help(Player p) {
|
||||||
|
Player.SendMessage(p, "%T/mapauthors [name1] <name2>...");
|
||||||
|
Player.SendMessage(p, "%HSets the authors of the current map. " +
|
||||||
|
"This is shown to players at the start of rounds in various games.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -21,7 +21,7 @@ using System.Threading;
|
|||||||
|
|
||||||
namespace MCGalaxy.Commands {
|
namespace MCGalaxy.Commands {
|
||||||
|
|
||||||
public sealed class MapLikeCmd : Command {
|
public sealed class CmdMapLike : Command {
|
||||||
public override string name { get { return "maplike"; } }
|
public override string name { get { return "maplike"; } }
|
||||||
public override string shortcut { get { return "like"; } }
|
public override string shortcut { get { return "like"; } }
|
||||||
public override string type { get { return CommandTypes.Games; } }
|
public override string type { get { return CommandTypes.Games; } }
|
||||||
@ -43,7 +43,7 @@ namespace MCGalaxy.Commands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class MapDislikeCmd : Command {
|
public sealed class CmdMapDislike : Command {
|
||||||
public override string name { get { return "mapdislike"; } }
|
public override string name { get { return "mapdislike"; } }
|
||||||
public override string shortcut { get { return "dislike"; } }
|
public override string shortcut { get { return "dislike"; } }
|
||||||
public override string type { get { return CommandTypes.Games; } }
|
public override string type { get { return CommandTypes.Games; } }
|
||||||
|
@ -302,6 +302,7 @@ namespace MCGalaxy.Games
|
|||||||
{
|
{
|
||||||
Player[] online = PlayerInfo.Online.Items;
|
Player[] online = PlayerInfo.Online.Items;
|
||||||
foreach (Player pl in online) {
|
foreach (Player pl in online) {
|
||||||
|
pl.ratedMap = false;
|
||||||
if (pl.level == oldMap)
|
if (pl.level == oldMap)
|
||||||
{
|
{
|
||||||
if (sendAfkMain && Server.afkset.Contains(pl.name)) Command.all.Find("main").Use(pl, "");
|
if (sendAfkMain && Server.afkset.Contains(pl.name)) Command.all.Find("main").Use(pl, "");
|
||||||
|
@ -111,6 +111,8 @@ namespace MCGalaxy.Games {
|
|||||||
p.SendMessage("%a" + (int)startLeft + " %Sseconds left until the round starts. %aRun!");
|
p.SendMessage("%a" + (int)startLeft + " %Sseconds left until the round starts. %aRun!");
|
||||||
p.SendMessage("This map has &a" + CurrentLevel.Likes +
|
p.SendMessage("This map has &a" + CurrentLevel.Likes +
|
||||||
" likes %Sand &c" + CurrentLevel.Dislikes + " dislikes");
|
" likes %Sand &c" + CurrentLevel.Dislikes + " dislikes");
|
||||||
|
if (CurrentLevel.Authors != "")
|
||||||
|
p.SendMessage("It was created by " + CurrentLevel.Authors.Replace(" ", "%S, "));
|
||||||
p.SendCpeMessage(CpeMessageType.BottomRight1, "%SYou have &a" + p.money + " %S" + Server.moneys);
|
p.SendCpeMessage(CpeMessageType.BottomRight1, "%SYou have &a" + p.money + " %S" + Server.moneys);
|
||||||
UpdatePlayerStatus(p);
|
UpdatePlayerStatus(p);
|
||||||
return;
|
return;
|
||||||
|
@ -61,6 +61,7 @@ namespace MCGalaxy.Levels.IO {
|
|||||||
writer.WriteLine("Unload = " + level.unload);
|
writer.WriteLine("Unload = " + level.unload);
|
||||||
writer.WriteLine("WorldChat = " + level.worldChat);
|
writer.WriteLine("WorldChat = " + level.worldChat);
|
||||||
|
|
||||||
|
writer.WriteLine();
|
||||||
writer.WriteLine("PerBuild = " + GetName(level.permissionbuild));
|
writer.WriteLine("PerBuild = " + GetName(level.permissionbuild));
|
||||||
writer.WriteLine("PerVisit = " + GetName(level.permissionvisit));
|
writer.WriteLine("PerVisit = " + GetName(level.permissionvisit));
|
||||||
writer.WriteLine("PerBuildMax = " + GetName(level.perbuildmax));
|
writer.WriteLine("PerBuildMax = " + GetName(level.perbuildmax));
|
||||||
@ -68,6 +69,7 @@ namespace MCGalaxy.Levels.IO {
|
|||||||
writer.WriteLine("Buildable = " + level.Buildable);
|
writer.WriteLine("Buildable = " + level.Buildable);
|
||||||
writer.WriteLine("Deletable = " + level.Deletable);
|
writer.WriteLine("Deletable = " + level.Deletable);
|
||||||
|
|
||||||
|
writer.WriteLine();
|
||||||
writer.WriteLine("Guns = " + level.guns);
|
writer.WriteLine("Guns = " + level.guns);
|
||||||
writer.WriteLine("LoadOnGoto = " + level.loadOnGoto);
|
writer.WriteLine("LoadOnGoto = " + level.loadOnGoto);
|
||||||
writer.WriteLine("LeafDecay = " + level.leafDecay);
|
writer.WriteLine("LeafDecay = " + level.leafDecay);
|
||||||
@ -77,8 +79,10 @@ namespace MCGalaxy.Levels.IO {
|
|||||||
writer.WriteLine("Texture = " + level.terrainUrl);
|
writer.WriteLine("Texture = " + level.terrainUrl);
|
||||||
writer.WriteLine("TexturePack = " + level.texturePackUrl);
|
writer.WriteLine("TexturePack = " + level.texturePackUrl);
|
||||||
|
|
||||||
|
writer.WriteLine();
|
||||||
writer.WriteLine("Likes = " + level.Likes);
|
writer.WriteLine("Likes = " + level.Likes);
|
||||||
writer.WriteLine("Dislikes = " + level.Dislikes);
|
writer.WriteLine("Dislikes = " + level.Dislikes);
|
||||||
|
writer.WriteLine("Authors = " + level.Authors);
|
||||||
}
|
}
|
||||||
|
|
||||||
static string GetName(LevelPermission perm) {
|
static string GetName(LevelPermission perm) {
|
||||||
@ -219,6 +223,8 @@ namespace MCGalaxy.Levels.IO {
|
|||||||
level.Likes = int.Parse(value); break;
|
level.Likes = int.Parse(value); break;
|
||||||
case "dislikes":
|
case "dislikes":
|
||||||
level.Dislikes = int.Parse(value); break;
|
level.Dislikes = int.Parse(value); break;
|
||||||
|
case "authors":
|
||||||
|
level.Authors = value; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,6 +205,7 @@ namespace MCGalaxy
|
|||||||
|
|
||||||
public List<C4.C4s> C4list = new List<C4.C4s>();
|
public List<C4.C4s> C4list = new List<C4.C4s>();
|
||||||
public int Likes, Dislikes;
|
public int Likes, Dislikes;
|
||||||
|
public string Authors = "";
|
||||||
|
|
||||||
public Level(string n, ushort x, ushort y, ushort z, string type, int seed = 0, bool useSeed = false)
|
public Level(string n, ushort x, ushort y, ushort z, string type, int seed = 0, bool useSeed = false)
|
||||||
{
|
{
|
||||||
|
@ -182,6 +182,7 @@
|
|||||||
<Compile Include="Commands\Fun\CmdFlipHeads.cs" />
|
<Compile Include="Commands\Fun\CmdFlipHeads.cs" />
|
||||||
<Compile Include="Commands\Fun\CmdGun.cs" />
|
<Compile Include="Commands\Fun\CmdGun.cs" />
|
||||||
<Compile Include="Commands\Fun\CmdLavaSurvival.cs" />
|
<Compile Include="Commands\Fun\CmdLavaSurvival.cs" />
|
||||||
|
<Compile Include="Commands\Fun\CmdMapAuthors.cs" />
|
||||||
<Compile Include="Commands\Fun\CmdMissile.cs" />
|
<Compile Include="Commands\Fun\CmdMissile.cs" />
|
||||||
<Compile Include="Commands\Fun\CmdSlap.cs" />
|
<Compile Include="Commands\Fun\CmdSlap.cs" />
|
||||||
<Compile Include="Commands\Fun\CmdTeam.cs" />
|
<Compile Include="Commands\Fun\CmdTeam.cs" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user