fix: Codegens resources (#1272)
This commit is contained in:
parent
59ed0a5bb4
commit
82637a77cd
59 changed files with 2435 additions and 2695 deletions
|
|
@ -1,49 +1,48 @@
|
|||
using System;
|
||||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(1, false)]
|
||||
public partial class BigFish : Item, ICarvable
|
||||
{
|
||||
[SerializationGenerator(1, false)]
|
||||
public partial class BigFish : Item, ICarvable
|
||||
[InvalidateProperties]
|
||||
[SerializedCommandProperty(AccessLevel.GameMaster)]
|
||||
[SerializableField(0)]
|
||||
private Mobile _fisher;
|
||||
|
||||
[Constructible]
|
||||
public BigFish() : base(0x09CC)
|
||||
{
|
||||
[InvalidateProperties]
|
||||
[SerializedCommandProperty(AccessLevel.GameMaster)]
|
||||
[SerializableField(0)]
|
||||
private Mobile _fisher;
|
||||
// TODO: Find correct formula. max on OSI currently 200, OSI dev says it's not 200 as max, and ~ 1/1,000,000 chance to get highest
|
||||
Weight = Utility.RandomMinMax(3, 200);
|
||||
Hue = Utility.RandomBool() ? 0x847 : 0x58C;
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public BigFish() : base(0x09CC)
|
||||
public override int LabelNumber => 1041112; // a big fish
|
||||
|
||||
public void Carve(Mobile from, Item item)
|
||||
{
|
||||
ScissorHelper(from, new RawFishSteak(), Math.Max(16, (int)Weight) / 4, false);
|
||||
}
|
||||
|
||||
public override void GetProperties(IPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Weight >= 20)
|
||||
{
|
||||
// TODO: Find correct formula. max on OSI currently 200, OSI dev says it's not 200 as max, and ~ 1/1,000,000 chance to get highest
|
||||
Weight = Utility.RandomMinMax(3, 200);
|
||||
Hue = Utility.RandomBool() ? 0x847 : 0x58C;
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1041112; // a big fish
|
||||
|
||||
public void Carve(Mobile from, Item item)
|
||||
{
|
||||
ScissorHelper(from, new RawFishSteak(), Math.Max(16, (int)Weight) / 4, false);
|
||||
}
|
||||
|
||||
public override void GetProperties(IPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
if (Weight >= 20)
|
||||
if (_fisher != null)
|
||||
{
|
||||
if (_fisher != null)
|
||||
{
|
||||
list.Add(1070857, _fisher.Name); // Caught by ~1_fisherman~
|
||||
}
|
||||
|
||||
list.Add(1070858, $"{(int)Weight}"); // ~1_weight~ stones
|
||||
list.Add(1070857, _fisher.Name); // Caught by ~1_fisherman~
|
||||
}
|
||||
}
|
||||
|
||||
private void Deserialize(IGenericReader reader, int version)
|
||||
{
|
||||
Weight = Utility.RandomMinMax(3, 200);
|
||||
list.Add(1070858, $"{(int)Weight}"); // ~1_weight~ stones
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Deserialize(IGenericReader reader, int version)
|
||||
{
|
||||
Weight = Utility.RandomMinMax(3, 200);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,21 +1,20 @@
|
|||
using ModernUO.Serialization;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class Fish : Item, ICarvable
|
||||
{
|
||||
[Constructible]
|
||||
public Fish(int amount = 1) : base(Utility.Random(0x09CC, 4))
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
}
|
||||
namespace Server.Items;
|
||||
|
||||
public void Carve(Mobile from, Item item)
|
||||
{
|
||||
ScissorHelper(from, new RawFishSteak(), 4);
|
||||
}
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class Fish : Item, ICarvable
|
||||
{
|
||||
[Constructible]
|
||||
public Fish(int amount = 1) : base(Utility.Random(0x09CC, 4))
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
}
|
||||
}
|
||||
|
||||
public void Carve(Mobile from, Item item)
|
||||
{
|
||||
ScissorHelper(from, new RawFishSteak(), 4);
|
||||
}
|
||||
}
|
||||
|
|
@ -3,102 +3,101 @@ using ModernUO.Serialization;
|
|||
using Server.Network;
|
||||
using Server.Spells;
|
||||
|
||||
namespace Server.Items
|
||||
namespace Server.Items;
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public abstract partial class BaseMagicFish : Item
|
||||
{
|
||||
[SerializationGenerator(0, false)]
|
||||
public abstract partial class BaseMagicFish : Item
|
||||
public BaseMagicFish(int hue) : base(0xDD6) => Hue = hue;
|
||||
|
||||
public virtual int Bonus => 0;
|
||||
public virtual StatType Type => StatType.Str;
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
public virtual bool Apply(Mobile from)
|
||||
{
|
||||
public BaseMagicFish(int hue) : base(0xDD6) => Hue = hue;
|
||||
var applied = SpellHelper.AddStatOffset(from, Type, Bonus, TimeSpan.FromMinutes(1.0));
|
||||
|
||||
public virtual int Bonus => 0;
|
||||
public virtual StatType Type => StatType.Str;
|
||||
|
||||
public override double DefaultWeight => 1.0;
|
||||
|
||||
public virtual bool Apply(Mobile from)
|
||||
if (!applied)
|
||||
{
|
||||
var applied = SpellHelper.AddStatOffset(from, Type, Bonus, TimeSpan.FromMinutes(1.0));
|
||||
|
||||
if (!applied)
|
||||
{
|
||||
from.SendLocalizedMessage(502173); // You are already under a similar effect.
|
||||
}
|
||||
|
||||
return applied;
|
||||
from.SendLocalizedMessage(502173); // You are already under a similar effect.
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
else if (Apply(from))
|
||||
{
|
||||
from.FixedEffect(0x375A, 10, 15);
|
||||
from.PlaySound(0x1E7);
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501774); // You swallow the fish whole!
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
return applied;
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class PrizedFish : BaseMagicFish
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
[Constructible]
|
||||
public PrizedFish() : base(51)
|
||||
if (!IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
|
||||
public override int Bonus => 5;
|
||||
public override StatType Type => StatType.Int;
|
||||
|
||||
public override int LabelNumber => 1041073; // prized fish
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class WondrousFish : BaseMagicFish
|
||||
{
|
||||
[Constructible]
|
||||
public WondrousFish() : base(86)
|
||||
else if (Apply(from))
|
||||
{
|
||||
}
|
||||
|
||||
public override int Bonus => 5;
|
||||
public override StatType Type => StatType.Dex;
|
||||
|
||||
public override int LabelNumber => 1041074; // wondrous fish
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class TrulyRareFish : BaseMagicFish
|
||||
{
|
||||
[Constructible]
|
||||
public TrulyRareFish() : base(76)
|
||||
{
|
||||
}
|
||||
|
||||
public override int Bonus => 5;
|
||||
public override StatType Type => StatType.Str;
|
||||
|
||||
public override int LabelNumber => 1041075; // truly rare fish
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class PeculiarFish : BaseMagicFish
|
||||
{
|
||||
[Constructible]
|
||||
public PeculiarFish() : base(66)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1041076; // highly peculiar fish
|
||||
|
||||
public override bool Apply(Mobile from)
|
||||
{
|
||||
from.Stam += 10;
|
||||
return true;
|
||||
from.FixedEffect(0x375A, 10, 15);
|
||||
from.PlaySound(0x1E7);
|
||||
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 501774); // You swallow the fish whole!
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class PrizedFish : BaseMagicFish
|
||||
{
|
||||
[Constructible]
|
||||
public PrizedFish() : base(51)
|
||||
{
|
||||
}
|
||||
|
||||
public override int Bonus => 5;
|
||||
public override StatType Type => StatType.Int;
|
||||
|
||||
public override int LabelNumber => 1041073; // prized fish
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class WondrousFish : BaseMagicFish
|
||||
{
|
||||
[Constructible]
|
||||
public WondrousFish() : base(86)
|
||||
{
|
||||
}
|
||||
|
||||
public override int Bonus => 5;
|
||||
public override StatType Type => StatType.Dex;
|
||||
|
||||
public override int LabelNumber => 1041074; // wondrous fish
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class TrulyRareFish : BaseMagicFish
|
||||
{
|
||||
[Constructible]
|
||||
public TrulyRareFish() : base(76)
|
||||
{
|
||||
}
|
||||
|
||||
public override int Bonus => 5;
|
||||
public override StatType Type => StatType.Str;
|
||||
|
||||
public override int LabelNumber => 1041075; // truly rare fish
|
||||
}
|
||||
|
||||
[SerializationGenerator(0, false)]
|
||||
public partial class PeculiarFish : BaseMagicFish
|
||||
{
|
||||
[Constructible]
|
||||
public PeculiarFish() : base(66)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1041076; // highly peculiar fish
|
||||
|
||||
public override bool Apply(Mobile from)
|
||||
{
|
||||
from.Stam += 10;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue