Fixes code according to modern code style. Fixes a few expression bugs.

This commit is contained in:
Kamron Batman 2018-09-15 09:58:51 -07:00
parent 89eea25e5f
commit 970fd563b2
3324 changed files with 441118 additions and 433755 deletions

View file

@ -3,81 +3,81 @@ using Server.Engines.PartySystem;
namespace Server.Items
{
public class MoonstoneGate : Moongate
{
private Mobile m_Caster;
public class MoonstoneGate : Moongate
{
private Mobile m_Caster;
public MoonstoneGate( Point3D loc, Map map, Map targetMap, Mobile caster, int hue ) : base( loc, targetMap )
{
MoveToWorld( loc, map );
Dispellable = false;
Hue = hue;
public MoonstoneGate(Point3D loc, Map map, Map targetMap, Mobile caster, int hue) : base(loc, targetMap)
{
MoveToWorld(loc, map);
Dispellable = false;
Hue = hue;
m_Caster = caster;
m_Caster = caster;
new InternalTimer( this ).Start();
new InternalTimer(this).Start();
Effects.PlaySound( loc, map, 0x20E );
}
Effects.PlaySound(loc, map, 0x20E);
}
public MoonstoneGate( Serial serial ) : base( serial )
{
}
public MoonstoneGate(Serial serial) : base(serial)
{
}
public override void CheckGate( Mobile m, int range )
{
if ( m.Kills >= 5 )
return;
public override void CheckGate(Mobile m, int range)
{
if (m.Kills >= 5)
return;
Party casterParty = Party.Get( m_Caster );
Party userParty = Party.Get( m );
Party casterParty = Party.Get(m_Caster);
Party userParty = Party.Get(m);
if ( m == m_Caster || (casterParty != null && userParty == casterParty) )
base.CheckGate( m, range );
}
if (m == m_Caster || casterParty != null && userParty == casterParty)
base.CheckGate(m, range);
}
public override void UseGate( Mobile m )
{
if ( m.Kills >= 5 )
return;
public override void UseGate(Mobile m)
{
if (m.Kills >= 5)
return;
Party casterParty = Party.Get( m_Caster );
Party userParty = Party.Get( m );
Party casterParty = Party.Get(m_Caster);
Party userParty = Party.Get(m);
if ( m == m_Caster || (casterParty != null && userParty == casterParty) )
base.UseGate( m );
}
if (m == m_Caster || casterParty != null && userParty == casterParty)
base.UseGate(m);
}
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();
int version = reader.ReadInt();
Delete();
}
Delete();
}
private class InternalTimer : Timer
{
private Item m_Item;
private class InternalTimer : Timer
{
private Item m_Item;
public InternalTimer( Item item ) : base( TimeSpan.FromSeconds( 30.0 ) )
{
m_Item = item;
Priority = TimerPriority.OneSecond;
}
public InternalTimer(Item item) : base(TimeSpan.FromSeconds(30.0))
{
m_Item = item;
Priority = TimerPriority.OneSecond;
}
protected override void OnTick()
{
m_Item.Delete();
}
}
}
protected override void OnTick()
{
m_Item.Delete();
}
}
}
}