Skip to content

Commit

Permalink
v0.3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ballock1 committed Apr 2, 2012
1 parent 66c65a3 commit 70afa07
Show file tree
Hide file tree
Showing 22 changed files with 267 additions and 36 deletions.
1 change: 0 additions & 1 deletion CTFGame.cs
Expand Up @@ -14,7 +14,6 @@
namespace MCLawl
{
public class CTFGame
///A cute little game.
{
public List<Team> teams = new List<Team>();

Expand Down
5 changes: 3 additions & 2 deletions Changelog.txt
@@ -1,8 +1,9 @@


(4/2/12)-v0.3.2.0: Added Commands
- Converse
- Vote
(4/1/12)-v0.3.2.0: Added Commands
- FastHouse
- OpTest
- Push
Added Blocks
- opdoor
Expand Down
72 changes: 72 additions & 0 deletions Commands/CmdConverse.cs
@@ -0,0 +1,72 @@
using System;
using System.Threading;
using MCLawl;

namespace MCDek
{
public class CmdConverse : Command
{
public override string name { get { return "converse"; } }
public override string shortcut { get { return "co"; } }
public override string type { get { return "other"; } }
public override bool museumUsable { get { return false; } }
public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
public override void Use(Player p, string message)
{
if (message.ToLower() == "1")
{
Player.GlobalChat(p, p.name + Server.DefaultColor + "is feeling happy! :)");
}

else if (message.ToLower() == "2")
{
Player.GlobalChat(p, p.name + Server.DefaultColor + "is feeling sad :(");
}

else if (message.ToLower() == "3")
{
Player.GlobalChat(p, p.name + Server.DefaultColor + "is angry >:(");
}

else if (message.ToLower() == "4")
{
Player.GlobalChat(p, p.name + Server.DefaultColor + "is excited :D");
}

else if (message.ToLower() == "5")
{
Player.GlobalChat(p, p.name + Server.DefaultColor + "is bored |-O");
}

else if (message.ToLower() == "6")
{
Player.GlobalChat(p, p.name + Server.DefaultColor + "is feeling mischevious }:-)");
}

else if (message.ToLower() == "7")
{
Player.GlobalChat(p, p.name + Server.DefaultColor + "is suprised o.O");
}

else if (message.ToLower() == "8")
{
Player.GlobalChat(p, p.name + Server.DefaultColor + "is not amused -_-");
}

else if (message.ToLower() == "9")
{
Player.GlobalChat(p, p.name + Server.DefaultColor + "is confused :-/");
}

else if (message.ToLower() == "10")
{
Player.GlobalChat(p, p.name + Server.DefaultColor + "is feeling happy!");
}
}

public override void Help(Player p)
{
Player.SendMessage(p, "/converse <1-10> - Quick chat about how you feel");
}
}
}
10 changes: 5 additions & 5 deletions Commands/CmdPush.cs
Expand Up @@ -26,25 +26,25 @@ public override void Use(Player p, string message)
ushort currentX = (ushort)(who.pos[0] / 32);
ushort currentY = (ushort)(who.pos[1] / 32);
ushort currentZ = (ushort)(who.pos[2] / 32);
ushort foundHeight = 0;
ushort foundX = 0;

for (ushort xx = currentX; xx <= 1000; xx++)
{
if (!Block.Walkthrough(p.level.GetTile(currentY, xx, currentZ)) && p.level.GetTile(currentY, xx, currentZ) != Block.Zero)
{
foundHeight = (ushort)(xx - 1);
foundX = (ushort)(xx - 1);
who.level.ChatLevel(who.color + who.name + Server.DefaultColor + " was slapped into the wall by " + p.color + p.name);
break;
}
}

if (foundHeight == 0)
if (foundX == 0)
{
who.level.ChatLevel(who.color + who.name + Server.DefaultColor + " was slapped across the map by " + p.color + p.name);
foundHeight = 128;
foundX = 128;
}

unchecked { who.SendPos((byte)-1, who.pos[0], (ushort)(foundHeight * 32), who.pos[2], who.rot[0], who.rot[1]); }
unchecked { who.SendPos((byte)-1, (ushort)(foundX * 32), who.pos[1], who.pos[2], who.rot[0], who.rot[1]); }
}
public override void Help(Player p)
{
Expand Down
53 changes: 53 additions & 0 deletions Commands/CmdVote.cs
@@ -0,0 +1,53 @@
using System;
using MCLawl;


namespace MCDek
{
/// <summary>
/// This is the command /vote
/// </summary>
public class CmdVote : Command
{
public override string name { get { return "vote"; } }
public override string shortcut { get { return "vo"; } }
public override string type { get { return "other"; } }
public override bool museumUsable { get { return false; } }
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
public CmdVote() { }

public override void Use(Player p, string message)
{
if (message != "")
{
if (!Server.voting)
{
string temp = message.Substring(0, 1) == "%" ? "" : Server.DefaultColor;
Server.voting = true;
Server.NoVotes = 0;
Server.YesVotes = 0;
Player.GlobalMessage(" " + c.green + "VOTE: " + temp + message + "(" + c.green + "Yes " + Server.DefaultColor + "/" + c.red + "No" + Server.DefaultColor + ")");
System.Threading.Thread.Sleep(15000);
Server.voting = false;
Player.GlobalMessage("The vote is in! " + c.green + "Y: " + Server.YesVotes + c.red + " N: " + Server.NoVotes);
Player.players.ForEach(delegate(Player winners)
{
winners.voted = false;
});
}
else
{
p.SendMessage("A vote is in progress!");
}
}
else
{
Help(p);
}
}
public override void Help(Player p)
{
p.SendMessage("/vote [message] - Obviously starts a vote!");
}
}
}
39 changes: 39 additions & 0 deletions Commands/CmdVoteResults.cs
@@ -0,0 +1,39 @@
using System;
using System.IO;
using MCLawl;


namespace MCDek
{
/// <summary>
/// This is the command /voteresults
/// use /help voteresults in-game for more info
/// </summary>
public class CmdVoteResults : Command
{
public override string name { get { return "voteresults"; } }
public override string shortcut { get { return "vr"; } }
public override string type { get { return ""; } }
public override bool museumUsable { get { return true; } }
public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }
public CmdVoteResults() { }
public override void Use(Player p, string message)
{
Player who = null;
if (message == "") { who = p; message = p.name; } else { who = Player.Find(message); }
if (Server.YesVotes >= 1 || Server.NoVotes >= 1)
{
p.SendMessage(c.green + "Y: " + Server.YesVotes + c.red + " N: " + Server.NoVotes);
return;
}
else
{
p.SendMessage("There hasn't been a vote yet!");
}
}
public override void Help(Player p)
{
Player.SendMessage(p, "/voteresults - see the results of the last vote!");
}
}
}
2 changes: 2 additions & 0 deletions Commands/Command.cs
Expand Up @@ -203,6 +203,8 @@ public static void InitAll()
all.Add(new CmdPush());
all.Add(new CmdGriefPatrol());
all.Add(new CmdFastHouse());
all.Add(new CmdVote());
all.Add(new CmdConverse());

core.commands = new List<Command>(all.commands);

Expand Down
9 changes: 1 addition & 8 deletions GUI/MapViewer.cs
Expand Up @@ -82,19 +82,11 @@ private void panel1_Paint(object sender, PaintEventArgs e)

private void dgvMaps_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
<<<<<<< HEAD

}
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
=======
if (TextBox1.Text.Trim == "")
{
MessageBox.Show("Type something in! Darn it!!!")
}
else
>>>>>>> 82d1c3725cf3d4ddb9306e32e3d1fc2101dd01ea
{
Level lvl = Level.Find(textBox1.Text.Trim().ToLower());
if (lvl == null) lvl = Level.Load(textBox1.Text.Trim().ToLower());
Expand All @@ -118,6 +110,7 @@ >>>>>>> 82d1c3725cf3d4ddb9306e32e3d1fc2101dd01ea
}
}
}

}
}
}
Expand Down
80 changes: 80 additions & 0 deletions GUI/Properties.cs
@@ -0,0 +1,80 @@
namespace MCDekGUI.Properties
{
using System;


/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{

private static global::System.Resources.ResourceManager resourceMan;

private static global::System.Globalization.CultureInfo resourceCulture;

[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}

/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if (object.ReferenceEquals(resourceMan, null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("fCraftGUI.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}

/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}

internal static System.Drawing.Bitmap Tileset
{
get
{
object obj = ResourceManager.GetObject("Tileset", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}

internal static System.Drawing.Bitmap TilesetShadowed
{
get
{
object obj = ResourceManager.GetObject("TilesetShadowed", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}
Binary file added Lawl.ico
Binary file not shown.
9 changes: 3 additions & 6 deletions Player/Player.cs
@@ -1,5 +1,5 @@
/*
Copyright 2010 MCSharp team (Modified for use with MCZall/MCLawl/MCDek) Licensed under the
Copyright 2010 MCSharp team (Modified for use with MCZall/MCLawl) Licensed under the
Educational Community License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may
obtain a copy of the License at
Expand All @@ -12,9 +12,6 @@
or implied. See the License for the specific language governing
permissions and limitations under the License.
*/

//From dekema2: This will be heavily modified in some way or another, this one file determines our success.

using System;
using System.Threading;
using System.Net;
Expand Down Expand Up @@ -1246,14 +1243,14 @@ public void HandleDeath(byte b, string customMessage = "", bool explode = false)
case Block.deathlava:
case Block.activedeathlava: GlobalChatLevel(this, this.color + this.prefix + this.name + Server.DefaultColor + " stood in &cmagma and melted.", false); break;
case Block.magma: GlobalChatLevel(this, this.color + this.prefix + this.name + Server.DefaultColor + " was hit by &cflowing magma and melted.", false); break;
case Block.geyser: GlobalChatLevel(this, this.color + this.prefix + this.name + Server.DefaultColor + " was scorched by &cboiling water and melted.", false); break;
case Block.geyser: GlobalChatLevel(this, this.color + this.prefix + this.name + Server.DefaultColor + " was hit by &cboiling water and melted.", false); break;
case Block.birdkill: GlobalChatLevel(this, this.color + this.prefix + this.name + Server.DefaultColor + " was hit by a &cphoenix and burnt.", false); break;
case Block.train: GlobalChatLevel(this, this.color + this.prefix + this.name + Server.DefaultColor + " was hit by a &ctrain.", false); break;
case Block.fishshark: GlobalChatLevel(this, this.color + this.prefix + this.name + Server.DefaultColor + " was eaten by a &cshark.", false); break;
case Block.fire: GlobalChatLevel(this, this.color + this.prefix + this.name + Server.DefaultColor + " burnt to a &ccrisp.", false); break;
case Block.rockethead: GlobalChatLevel(this, this.color + this.prefix + this.name + Server.DefaultColor + " was &cin a fiery explosion.", false); level.MakeExplosion(x, y, z, 0); break;
case Block.zombiebody: GlobalChatLevel(this, this.color + this.prefix + this.name + Server.DefaultColor + " died due to lack of &5brain.", false); break;
case Block.creeper: GlobalChatLevel(this, this.color + this.prefix + this.name + Server.DefaultColor + " was killed &cturned into a zombie", false); level.MakeExplosion(x, y, z, 1); break;
case Block.creeper: GlobalChatLevel(this, this.color + this.prefix + this.name + Server.DefaultColor + " was killed &cb-SSSSSSSSSSSSSS", false); level.MakeExplosion(x, y, z, 1); break;
case Block.air: GlobalChatLevel(this, this.color + this.prefix + this.name + Server.DefaultColor + " hit the floor &chard.", false); break;
case Block.water: GlobalChatLevel(this, this.color + this.prefix + this.name + Server.DefaultColor + " &cdrowned.", false); break;
case Block.Zero: GlobalChatLevel(this, this.color + this.prefix + this.name + Server.DefaultColor + " was &cterminated", false); break;
Expand Down
2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Expand Up @@ -34,4 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("0.3.0.0")]
[assembly: AssemblyVersion("0.3.2.0")]
3 changes: 2 additions & 1 deletion TODO.txt
@@ -1,2 +1,3 @@
TO DO FOR MCDEK
/PUSH PUSHES PERSON FORWARD
/converse #
PREMADE MESSAGES
Binary file added bin/Debug/Debug.zip
Binary file not shown.
Binary file modified bin/Debug/mcdektest2.exe
Binary file not shown.
Binary file modified bin/Debug/mcdektest2.pdb
Binary file not shown.

0 comments on commit 70afa07

Please sign in to comment.