v0.0.1-Alpha (#42)
This commit is contained in:
parent
d30f93c454
commit
a36796c2c1
3552 changed files with 2476 additions and 15223 deletions
48
Projects/Scripts/Items/Games/Mahjong/MahjongDices.cs
Normal file
48
Projects/Scripts/Items/Games/Mahjong/MahjongDices.cs
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
namespace Server.Engines.Mahjong
|
||||
{
|
||||
public class MahjongDices
|
||||
{
|
||||
public MahjongDices(MahjongGame game)
|
||||
{
|
||||
Game = game;
|
||||
First = Utility.Random(1, 6);
|
||||
Second = Utility.Random(1, 6);
|
||||
}
|
||||
|
||||
public MahjongDices(MahjongGame game, GenericReader reader)
|
||||
{
|
||||
Game = game;
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
First = reader.ReadInt();
|
||||
Second = reader.ReadInt();
|
||||
}
|
||||
|
||||
public MahjongGame Game{ get; }
|
||||
|
||||
public int First{ get; private set; }
|
||||
|
||||
public int Second{ get; private set; }
|
||||
|
||||
public void RollDices(Mobile from)
|
||||
{
|
||||
First = Utility.Random(1, 6);
|
||||
Second = Utility.Random(1, 6);
|
||||
|
||||
Game.Players.SendGeneralPacket(true, true);
|
||||
|
||||
if (from != null)
|
||||
Game.Players.SendLocalizedMessage(1062695,
|
||||
$"{from.Name}\t{First}\t{Second}"); // ~1_name~ rolls the dice and gets a ~2_number~ and a ~3_number~!
|
||||
}
|
||||
|
||||
public void Save(GenericWriter writer)
|
||||
{
|
||||
writer.Write(0); // version
|
||||
|
||||
writer.Write(First);
|
||||
writer.Write(Second);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue