Reorganizes Project (#41)
This commit is contained in:
parent
08bf44af9a
commit
3614a66aee
3499 changed files with 79 additions and 55 deletions
41
Projects/Scripts/Items/Body Parts/BonePile.cs
Normal file
41
Projects/Scripts/Items/Body Parts/BonePile.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
[Flippable(0x1B09, 0x1B10)]
|
||||
public class BonePile : Item, IScissorable
|
||||
{
|
||||
[Constructible]
|
||||
public BonePile() : base(0x1B09 + Utility.Random(8))
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 10.0;
|
||||
}
|
||||
|
||||
public BonePile(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public bool Scissor(Mobile from, Scissors scissors)
|
||||
{
|
||||
if (Deleted || !from.CanSee(this))
|
||||
return false;
|
||||
|
||||
base.ScissorHelper(from, new Bone(), Utility.RandomMinMax(10, 15));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
107
Projects/Scripts/Items/Body Parts/Head.cs
Normal file
107
Projects/Scripts/Items/Body Parts/Head.cs
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public enum HeadType
|
||||
{
|
||||
Regular,
|
||||
Duel,
|
||||
Tournament
|
||||
}
|
||||
|
||||
public class Head : Item
|
||||
{
|
||||
[Constructible]
|
||||
public Head(string playerName) : this(HeadType.Regular, playerName)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public Head(HeadType headType = HeadType.Regular, string playerName = null)
|
||||
: base(0x1DA0)
|
||||
{
|
||||
HeadType = headType;
|
||||
PlayerName = playerName;
|
||||
}
|
||||
|
||||
public Head(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public string PlayerName{ get; set; }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public HeadType HeadType{ get; set; }
|
||||
|
||||
public override string DefaultName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (PlayerName == null)
|
||||
return base.DefaultName;
|
||||
|
||||
switch (HeadType)
|
||||
{
|
||||
default:
|
||||
return $"the head of {PlayerName}";
|
||||
|
||||
case HeadType.Duel:
|
||||
return $"the head of {PlayerName}, taken in a duel";
|
||||
|
||||
case HeadType.Tournament:
|
||||
return $"the head of {PlayerName}, taken in a tournament";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(1); // version
|
||||
|
||||
writer.Write(PlayerName);
|
||||
writer.WriteEncodedInt((int)HeadType);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
PlayerName = reader.ReadString();
|
||||
HeadType = (HeadType)reader.ReadEncodedInt();
|
||||
break;
|
||||
|
||||
case 0:
|
||||
string format = Name;
|
||||
|
||||
if (format != null)
|
||||
{
|
||||
if (format.StartsWith("the head of "))
|
||||
format = format.Substring("the head of ".Length);
|
||||
|
||||
if (format.EndsWith(", taken in a duel"))
|
||||
{
|
||||
format = format.Substring(0, format.Length - ", taken in a duel".Length);
|
||||
HeadType = HeadType.Duel;
|
||||
}
|
||||
else if (format.EndsWith(", taken in a tournament"))
|
||||
{
|
||||
format = format.Substring(0, format.Length - ", taken in a tournament".Length);
|
||||
HeadType = HeadType.Tournament;
|
||||
}
|
||||
}
|
||||
|
||||
PlayerName = format;
|
||||
Name = null;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Projects/Scripts/Items/Body Parts/LeftArm.cs
Normal file
28
Projects/Scripts/Items/Body Parts/LeftArm.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class LeftArm : Item
|
||||
{
|
||||
[Constructible]
|
||||
public LeftArm() : base(0x1DA1)
|
||||
{
|
||||
}
|
||||
|
||||
public LeftArm(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Projects/Scripts/Items/Body Parts/LeftLeg.cs
Normal file
28
Projects/Scripts/Items/Body Parts/LeftLeg.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class LeftLeg : Item
|
||||
{
|
||||
[Constructible]
|
||||
public LeftLeg() : base(0x1DA3)
|
||||
{
|
||||
}
|
||||
|
||||
public LeftLeg(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Projects/Scripts/Items/Body Parts/RibCage.cs
Normal file
41
Projects/Scripts/Items/Body Parts/RibCage.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
[Flippable(0x1B17, 0x1B18)]
|
||||
public class RibCage : Item, IScissorable
|
||||
{
|
||||
[Constructible]
|
||||
public RibCage() : base(0x1B17 + Utility.Random(2))
|
||||
{
|
||||
Stackable = false;
|
||||
Weight = 5.0;
|
||||
}
|
||||
|
||||
public RibCage(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public bool Scissor(Mobile from, Scissors scissors)
|
||||
{
|
||||
if (Deleted || !from.CanSee(this))
|
||||
return false;
|
||||
|
||||
base.ScissorHelper(from, new Bone(), Utility.RandomMinMax(3, 5));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Projects/Scripts/Items/Body Parts/RightArm.cs
Normal file
28
Projects/Scripts/Items/Body Parts/RightArm.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class RightArm : Item
|
||||
{
|
||||
[Constructible]
|
||||
public RightArm() : base(0x1DA2)
|
||||
{
|
||||
}
|
||||
|
||||
public RightArm(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Projects/Scripts/Items/Body Parts/RightLeg.cs
Normal file
28
Projects/Scripts/Items/Body Parts/RightLeg.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class RightLeg : Item
|
||||
{
|
||||
[Constructible]
|
||||
public RightLeg() : base(0x1DA4)
|
||||
{
|
||||
}
|
||||
|
||||
public RightLeg(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
29
Projects/Scripts/Items/Body Parts/Torso.cs
Normal file
29
Projects/Scripts/Items/Body Parts/Torso.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
public class Torso : Item
|
||||
{
|
||||
[Constructible]
|
||||
public Torso() : base(0x1D9F)
|
||||
{
|
||||
Weight = 2.0;
|
||||
}
|
||||
|
||||
public Torso(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue