ModernUO/Projects/UOContent/Items/Clothing/Shirts.cs
Kamron Batman 8ffd5a5bd0
fix: Updates races to properly support gargoyle equipment. (#744)
* Adds `RaceFlag` to the `Race` object. This is `1 << RaceIndex`
* Replaces `RequiredRace`  with `RequiredRaces` for items.
* Adds convenience flags for `RequiredRaces`
  ```cs
  
  public const int AllowAllRaces = 0x7;      // Race.Human.RaceFlag | Race.Elf.RaceFlag | Race.Gargoyle.RaceFlag
  public const int AllowHumanOrElves = 0x3;  // Race.Human.RaceFlag | Race.Elf.RaceFlag
  public const int AllowElvesOnly = 0x2;     // Race.Elf.RaceFlag
  public const int AllowGargoylesOnly = 0x4; // Race.Gargoyle.RaceFlag
  ```
* Example usage on an item:
  ```cs
  public override int RequiredRaces => Race.AllowHumanOrElves;
  ```
* Adds Wood and Stone armor material types
* Updates Woodland armor to Wood
* Adds proper messaging for race restrictions
* Adds gargoyle only for object properties
* Adds `CheckRace` functions for validating if a race or mobile can use the item:
  ```cs
  bool CheckRace(Race race);
  bool CheckRace(Mobile from, bool message = true);
  ```
2021-08-29 00:43:55 -07:00

54 lines
1.4 KiB
C#

namespace Server.Items
{
[Serializable(0, false)]
public abstract partial class BaseShirt : BaseClothing
{
public BaseShirt(int itemID, int hue = 0) : base(itemID, Layer.Shirt, hue)
{
}
}
[Flippable(0x1efd, 0x1efe)]
[Serializable(0, false)]
public partial class FancyShirt : BaseShirt
{
[Constructible]
public FancyShirt(int hue = 0) : base(0x1EFD, hue) => Weight = 2.0;
}
[Flippable(0x1517, 0x1518)]
[Serializable(0, false)]
public partial class Shirt : BaseShirt
{
[Constructible]
public Shirt(int hue = 0) : base(0x1517, hue) => Weight = 1.0;
}
[Flippable(0x2794, 0x27DF)]
[Serializable(0, false)]
public partial class ClothNinjaJacket : BaseShirt
{
[Constructible]
public ClothNinjaJacket(int hue = 0) : base(0x2794, hue)
{
Weight = 5.0;
Layer = Layer.InnerTorso;
}
}
[Serializable(0)]
public partial class ElvenShirt : BaseShirt
{
[Constructible]
public ElvenShirt(int hue = 0) : base(0x3175, hue) => Weight = 2.0;
public override int RequiredRaces => Race.AllowElvesOnly;
}
[Serializable(0)]
public partial class ElvenDarkShirt : BaseShirt
{
[Constructible]
public ElvenDarkShirt(int hue = 0) : base(0x3176, hue) => Weight = 2.0;
}
}