ModernUO/Projects/UOContent/Items/Resources/Fishing/MagicFish.cs
Kamron Batman 25fa9b397b
fix: Code gens items. Fixes code genning of ore (#684)
### THIS IS A BREAKING CHANGE IF YOU ARE ALREADY USING CODEGEN. IF YOUR WORLD HAS ERRORS LOADING PLEASE CONTACT ME ON DISCORD. ORE MIGHT FAIL TO LOAD.
 
### Changes
* Fixes Components from addons not marking dirty
* Code gens BaseAddonContainer
* Code gens Ingots
* Fixes code gen deserialization for Ore
* Code gens dyetubs
* Code gens reagents
* Code gens tailor commodities
* Code gens fish
2021-08-14 22:16:42 -07:00

103 lines
2.6 KiB
C#

using System;
using Server.Network;
using Server.Spells;
namespace Server.Items
{
[Serializable(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)
{
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;
}
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();
}
}
}
[Serializable(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
}
[Serializable(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
}
[Serializable(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
}
[Serializable(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;
}
}
}