Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)
This commit is contained in:
parent
e748af4430
commit
513e54f70e
1094 changed files with 15913 additions and 21892 deletions
|
|
@ -1,18 +1,14 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AlchemyBag : Bag
|
||||
{
|
||||
[Constructible]
|
||||
public AlchemyBag() : this(1)
|
||||
public AlchemyBag(int amount = 5000)
|
||||
{
|
||||
Movable = true;
|
||||
Hue = 0x250;
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public AlchemyBag(int amount)
|
||||
{
|
||||
DropItem(new MortarPestle(5));
|
||||
DropItem(new MortarPestle(Math.Max(amount / 1000, 1)));
|
||||
DropItem(new BagOfReagents(5000));
|
||||
DropItem(new Bottle(5000));
|
||||
}
|
||||
|
|
@ -37,4 +33,4 @@ namespace Server.Items
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,7 @@ namespace Server.Items
|
|||
public class BagOfingots : Bag
|
||||
{
|
||||
[Constructible]
|
||||
public BagOfingots() : this(5000)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public BagOfingots(int amount)
|
||||
public BagOfingots(int amount = 5000)
|
||||
{
|
||||
DropItem(new DullCopperIngot(amount));
|
||||
DropItem(new ShadowIronIngot(amount));
|
||||
|
|
@ -31,7 +26,7 @@ namespace Server.Items
|
|||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
|
|
@ -41,4 +36,4 @@ namespace Server.Items
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,17 +3,11 @@ namespace Server.Items
|
|||
public class ScribeBag : Bag
|
||||
{
|
||||
[Constructible]
|
||||
public ScribeBag() : this(1)
|
||||
public ScribeBag(int amount = 5000)
|
||||
{
|
||||
Movable = true;
|
||||
Hue = 0x105;
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public ScribeBag(int amount)
|
||||
{
|
||||
DropItem(new BagOfReagents(5000));
|
||||
DropItem(new BlankScroll(500));
|
||||
DropItem(new BagOfReagents(amount));
|
||||
DropItem(new BlankScroll(amount));
|
||||
}
|
||||
|
||||
public ScribeBag(Serial serial) : base(serial)
|
||||
|
|
@ -36,4 +30,4 @@ namespace Server.Items
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,7 @@ namespace Server.Items
|
|||
public class SmithBag : Bag
|
||||
{
|
||||
[Constructible]
|
||||
public SmithBag() : this(5000)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public SmithBag(int amount)
|
||||
public SmithBag(int amount = 5000)
|
||||
{
|
||||
DropItem(new DullCopperIngot(amount));
|
||||
DropItem(new ShadowIronIngot(amount));
|
||||
|
|
@ -31,7 +26,7 @@ namespace Server.Items
|
|||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
|
|
@ -41,4 +36,4 @@ namespace Server.Items
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +1,17 @@
|
|||
using System;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class TailorBag : Bag
|
||||
{
|
||||
[Constructible]
|
||||
public TailorBag() : this(1)
|
||||
public TailorBag(int amount = 500)
|
||||
{
|
||||
Movable = true;
|
||||
Hue = 0x315;
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public TailorBag(int amount)
|
||||
{
|
||||
DropItem(new SewingKit(5));
|
||||
DropItem(new SewingKit(Math.Max(amount / 100, 1)));
|
||||
DropItem(new Scissors());
|
||||
DropItem(new Hides(500));
|
||||
DropItem(new BoltOfCloth(20));
|
||||
DropItem(new Hides(amount));
|
||||
DropItem(new BoltOfCloth(Math.Max(amount / 25, 1)));
|
||||
DropItem(new DyeTub());
|
||||
DropItem(new DyeTub());
|
||||
DropItem(new BlackDyeTub());
|
||||
|
|
@ -42,4 +38,4 @@ namespace Server.Items
|
|||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue