Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -2,100 +2,101 @@ using Server.Targeting;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class Flax : Item
|
||||
{
|
||||
[Constructible]
|
||||
public Flax() : this( 1 )
|
||||
{
|
||||
}
|
||||
public class Flax : Item
|
||||
{
|
||||
[Constructible]
|
||||
public Flax() : this(1)
|
||||
{
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public Flax( int amount ) : base( 0x1A9C )
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
}
|
||||
[Constructible]
|
||||
public Flax(int amount) : base(0x1A9C)
|
||||
{
|
||||
Stackable = true;
|
||||
Weight = 1.0;
|
||||
Amount = amount;
|
||||
}
|
||||
|
||||
public Flax( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public Flax(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 502655 ); // What spinning wheel do you wish to spin this on?
|
||||
from.Target = new PickWheelTarget( this );
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
|
||||
public virtual void OnSpun( ISpinningWheel wheel, Mobile from, int hue )
|
||||
{
|
||||
Item item = new SpoolOfThread( 6 );
|
||||
item.Hue = hue;
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(502655); // What spinning wheel do you wish to spin this on?
|
||||
from.Target = new PickWheelTarget(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
}
|
||||
|
||||
from.AddToBackpack( item );
|
||||
from.SendLocalizedMessage( 1010577 ); // You put the spools of thread in your backpack.
|
||||
}
|
||||
public virtual void OnSpun(ISpinningWheel wheel, Mobile from, int hue)
|
||||
{
|
||||
Item item = new SpoolOfThread(6);
|
||||
item.Hue = hue;
|
||||
|
||||
private class PickWheelTarget : Target
|
||||
{
|
||||
private Flax m_Flax;
|
||||
from.AddToBackpack(item);
|
||||
from.SendLocalizedMessage(1010577); // You put the spools of thread in your backpack.
|
||||
}
|
||||
|
||||
public PickWheelTarget( Flax flax ) : base( 3, false, TargetFlags.None )
|
||||
{
|
||||
m_Flax = flax;
|
||||
}
|
||||
private class PickWheelTarget : Target
|
||||
{
|
||||
private Flax m_Flax;
|
||||
|
||||
protected override void OnTarget( Mobile from, object targeted )
|
||||
{
|
||||
if ( m_Flax.Deleted )
|
||||
return;
|
||||
public PickWheelTarget(Flax flax) : base(3, false, TargetFlags.None)
|
||||
{
|
||||
m_Flax = flax;
|
||||
}
|
||||
|
||||
ISpinningWheel wheel = targeted as ISpinningWheel;
|
||||
protected override void OnTarget(Mobile from, object targeted)
|
||||
{
|
||||
if (m_Flax.Deleted)
|
||||
return;
|
||||
|
||||
if ( wheel == null && targeted is AddonComponent component )
|
||||
wheel = component.Addon as ISpinningWheel;
|
||||
ISpinningWheel wheel = targeted as ISpinningWheel;
|
||||
|
||||
if ( wheel is Item )
|
||||
{
|
||||
if ( !m_Flax.IsChildOf( from.Backpack ) )
|
||||
{
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
else if ( wheel.Spinning )
|
||||
{
|
||||
from.SendLocalizedMessage( 502656 ); // That spinning wheel is being used.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Flax.Consume();
|
||||
wheel.BeginSpin( m_Flax.OnSpun, from, m_Flax.Hue );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage( 502658 ); // Use that on a spinning wheel.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (wheel == null && targeted is AddonComponent component)
|
||||
wheel = component.Addon as ISpinningWheel;
|
||||
|
||||
if (wheel is Item)
|
||||
{
|
||||
if (!m_Flax.IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
else if (wheel.Spinning)
|
||||
{
|
||||
from.SendLocalizedMessage(502656); // That spinning wheel is being used.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Flax.Consume();
|
||||
wheel.BeginSpin(m_Flax.OnSpun, from, m_Flax.Hue);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendLocalizedMessage(502658); // Use that on a spinning wheel.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue