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
|
|
@ -3,75 +3,76 @@ using Server.Network;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class PlagueBeastVein : PlagueBeastComponent
|
||||
{
|
||||
public bool Cut { get; private set; }
|
||||
public class PlagueBeastVein : PlagueBeastComponent
|
||||
{
|
||||
private Timer m_Timer;
|
||||
|
||||
private Timer m_Timer;
|
||||
public PlagueBeastVein(int itemID, int hue) : base(itemID, hue)
|
||||
{
|
||||
Cut = false;
|
||||
}
|
||||
|
||||
public PlagueBeastVein( int itemID, int hue ) : base( itemID, hue )
|
||||
{
|
||||
Cut = false;
|
||||
}
|
||||
public PlagueBeastVein(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Scissor( Mobile from, Scissors scissors )
|
||||
{
|
||||
if ( IsAccessibleTo( from ) )
|
||||
{
|
||||
if ( !Cut && m_Timer == null )
|
||||
{
|
||||
m_Timer = Timer.DelayCall<Mobile>( TimeSpan.FromSeconds( 3 ), CuttingDone, from );
|
||||
scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071899 ); // You begin cutting through the vein.
|
||||
return true;
|
||||
}
|
||||
public bool Cut{ get; private set; }
|
||||
|
||||
scissors.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071900 ); // // This vein has already been cut.
|
||||
}
|
||||
public override bool Scissor(Mobile from, Scissors scissors)
|
||||
{
|
||||
if (IsAccessibleTo(from))
|
||||
{
|
||||
if (!Cut && m_Timer == null)
|
||||
{
|
||||
m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(3), CuttingDone, from);
|
||||
scissors.PublicOverheadMessage(MessageType.Regular, 0x3B2,
|
||||
1071899); // You begin cutting through the vein.
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
scissors.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1071900); // // This vein has already been cut.
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if ( m_Timer != null && m_Timer.Running )
|
||||
m_Timer.Stop();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void CuttingDone( Mobile from )
|
||||
{
|
||||
Cut = true;
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
if (m_Timer != null && m_Timer.Running)
|
||||
m_Timer.Stop();
|
||||
}
|
||||
|
||||
if ( ItemID == 0x1B1C )
|
||||
ItemID = 0x1B1B;
|
||||
else
|
||||
ItemID = 0x1B1C;
|
||||
private void CuttingDone(Mobile from)
|
||||
{
|
||||
Cut = true;
|
||||
|
||||
Owner?.PlaySound( 0x199 );
|
||||
if (ItemID == 0x1B1C)
|
||||
ItemID = 0x1B1B;
|
||||
else
|
||||
ItemID = 0x1B1C;
|
||||
|
||||
if ( Organ is PlagueBeastRubbleOrgan organ )
|
||||
organ.OnVeinCut( from, this );
|
||||
}
|
||||
Owner?.PlaySound(0x199);
|
||||
|
||||
public PlagueBeastVein( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
if (Organ is PlagueBeastRubbleOrgan organ)
|
||||
organ.OnVeinCut(from, this);
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.WriteEncodedInt( 0 ); // version
|
||||
writer.WriteEncodedInt(0); // version
|
||||
|
||||
writer.Write( (bool) Cut );
|
||||
}
|
||||
writer.Write(Cut);
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadEncodedInt();
|
||||
int version = reader.ReadEncodedInt();
|
||||
|
||||
Cut = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
Cut = reader.ReadBool();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue