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

@ -1,84 +1,89 @@
using System;
using Server.Factions;
using Server.Mobiles;
using Server.Spells;
using Server.Spells.Fifth;
using Server.Spells.Ninjitsu;
using Server.Spells.Seventh;
namespace Server.Items
{
public class TribalPaint : Item
{
public override int LabelNumber => 1040000; // savage kin paint
public class TribalPaint : Item
{
[Constructible]
public TribalPaint() : base(0x9EC)
{
Hue = 2101;
Weight = 2.0;
Stackable = Core.ML;
}
[Constructible]
public TribalPaint() : base( 0x9EC )
{
Hue = 2101;
Weight = 2.0;
Stackable = Core.ML;
}
public TribalPaint(Serial serial) : base(serial)
{
}
public TribalPaint( Serial serial ) : base( serial )
{
}
public override int LabelNumber => 1040000; // savage kin paint
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
{
if ( Factions.Sigil.ExistsOn( from ) )
{
from.SendLocalizedMessage( 1010465 ); // You cannot disguise yourself while holding a sigil.
}
else if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) )
{
from.SendLocalizedMessage( 501698 ); // You cannot disguise yourself while incognitoed.
}
else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) )
{
from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
}
else if ( TransformationSpellHelper.UnderTransformation( from ) )
{
from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
}
else if ( Spells.Ninjitsu.AnimalForm.UnderTransformation( from ) )
{
from.SendLocalizedMessage( 1061634 ); // You cannot disguise yourself while in that form.
}
else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask )
{
from.SendLocalizedMessage( 501605 ); // You are already disguised.
}
else
{
from.BodyMod = ( from.Female ? 184 : 183 );
from.HueMod = 0;
public override void OnDoubleClick(Mobile from)
{
if (IsChildOf(from.Backpack))
{
if (Sigil.ExistsOn(from))
{
from.SendLocalizedMessage(1010465); // You cannot disguise yourself while holding a sigil.
}
else if (!from.CanBeginAction(typeof(IncognitoSpell)))
{
from.SendLocalizedMessage(501698); // You cannot disguise yourself while incognitoed.
}
else if (!from.CanBeginAction(typeof(PolymorphSpell)))
{
from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
}
else if (TransformationSpellHelper.UnderTransformation(from))
{
from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
}
else if (AnimalForm.UnderTransformation(from))
{
from.SendLocalizedMessage(1061634); // You cannot disguise yourself while in that form.
}
else if (from.IsBodyMod || from.FindItemOnLayer(Layer.Helm) is OrcishKinMask)
{
from.SendLocalizedMessage(501605); // You are already disguised.
}
else
{
from.BodyMod = from.Female ? 184 : 183;
from.HueMod = 0;
if ( from is PlayerMobile mobile )
mobile.SavagePaintExpiration = TimeSpan.FromDays( 7.0 );
if (from is PlayerMobile mobile)
mobile.SavagePaintExpiration = TimeSpan.FromDays(7.0);
from.SendLocalizedMessage( 1042537 ); // You now bear the markings of the savage tribe. Your body paint will last about a week or you can remove it with an oil cloth.
from.SendLocalizedMessage(
1042537); // You now bear the markings of the savage tribe. Your body paint will last about a week or you can remove it with an oil cloth.
Consume();
}
}
else
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
Consume();
}
}
else
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write( (int) 0 );
}
writer.Write(0);
}
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();
}
}
}