This commit is contained in:
asayre 2006-08-30 03:24:57 +00:00
parent 4386cbac99
commit 71e80d5949
16 changed files with 63 additions and 103 deletions

View file

@ -22,31 +22,32 @@ namespace Server.Items
private class FlipTarget : Target
{
public FlipTarget() : base( -1, false, TargetFlags.None )
public FlipTarget()
: base( -1, false, TargetFlags.None )
{
}
protected override void OnTarget( Mobile from, object targeted )
{
if ( targeted is Item )
if( targeted is Item )
{
Item item = (Item)targeted;
if ( item.Movable == false && from.AccessLevel == AccessLevel.Player )
if( item.Movable == false && from.AccessLevel == AccessLevel.Player )
return;
Type type = targeted.GetType();
Type type = targeted.GetType();
FlipableAttribute[] AttributeArray = (FlipableAttribute[])type.GetCustomAttributes( typeof( FlipableAttribute ), false );
FlipableAttribute [] AttributeArray = (FlipableAttribute []) type.GetCustomAttributes(typeof(FlipableAttribute), false);
if( AttributeArray.Length == 0 )
{
return ;
return;
}
FlipableAttribute fa = AttributeArray[0];
fa.Flip( (Item)targeted);
fa.Flip( (Item)targeted );
}
}
}
@ -67,13 +68,14 @@ namespace Server.Items
public int[] ItemIDs
{
get{ return m_ItemIDs; }
get { return m_ItemIDs; }
}
public FlipableAttribute() : this ( null )
public FlipableAttribute()
: this( null )
{
}
public FlipableAttribute( params int[] itemIDs )
{
m_ItemIDs = itemIDs;
@ -81,12 +83,12 @@ namespace Server.Items
public virtual void Flip( Item item )
{
if ( m_ItemIDs == null )
if( m_ItemIDs == null )
{
try
{
MethodInfo flipMethod = item.GetType().GetMethod( "Flip", Type.EmptyTypes );
if ( flipMethod != null )
if( flipMethod != null )
flipMethod.Invoke( item, new object[0] );
}
catch
@ -97,18 +99,18 @@ namespace Server.Items
else
{
int index = 0;
for ( int i = 0; i < m_ItemIDs.Length; i++ )
for( int i = 0; i < m_ItemIDs.Length; i++ )
{
if ( item.ItemID == m_ItemIDs[i] )
if( item.ItemID == m_ItemIDs[i] )
{
index = i + 1;
break;
}
}
if ( index > m_ItemIDs.Length - 1)
if( index > m_ItemIDs.Length - 1 )
index = 0;
item.ItemID = m_ItemIDs[index];
}
}

View file

@ -429,7 +429,7 @@ namespace Server.Items
[Constructable]
public GrizzledBones( int amount )
: base( 0x318F )
: base( 0x318C )
{
Stackable = true;
Amount = amount;
@ -444,7 +444,7 @@ namespace Server.Items
{
base.Serialize( writer );
writer.Write( (int)0 ); // version
writer.Write( (int)1 ); // version
}
public override void Deserialize( GenericReader reader )
@ -452,6 +452,9 @@ namespace Server.Items
base.Deserialize( reader );
int version = reader.ReadInt();
if( version <= 0 && ItemID == 0x318F )
ItemID = 0x318C;
}
}

View file

@ -20,6 +20,11 @@ namespace Server.Items
public override void OnDoubleClick( Mobile from )
{
Fishing.System.BeginHarvesting( from, this );
Item item = from.FindItemOnLayer( Layer.OneHanded );
if( item != null )
from.RemoveItem( item );
}
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )

View file

@ -262,7 +262,7 @@ namespace Server.Items
val += targ.SkillsTotal / 10;
if ( val > 700 )
val = 700 + ((val - 700) * (3 / 11));
val = 700 + (int)((val - 700) * (3.0 / 11));
BaseCreature bc = targ as BaseCreature;

View file

@ -1278,7 +1278,7 @@ namespace Server.Items
set{ m_InDoubleStrike = value; }
}
public virtual void OnHit( Mobile attacker, Mobile defender )
public void OnHit( Mobile attacker, Mobile defender )
{
OnHit( attacker, defender, 1.0 );
}
@ -1871,62 +1871,6 @@ namespace Server.Items
defender.Z ), defender.Map );
}
}
/* if ( damage <= 2 )
return;
Direction d = defender.GetDirectionTo( attacker );
int maxCount = damage / 15;
if ( maxCount < 1 )
maxCount = 1;
else if ( maxCount > 4 )
maxCount = 4;
for( int i = 0; i < Utility.Random( 1, maxCount ); ++i )
{
int x = defender.X;
int y = defender.Y;
switch( d )
{
case Direction.North:
x += Utility.Random( -1, 3 );
y += Utility.Random( 2 );
break;
case Direction.East:
y += Utility.Random( -1, 3 );
x += Utility.Random( -1, 2 );
break;
case Direction.West:
y += Utility.Random( -1, 3 );
x += Utility.Random( 2 );
break;
case Direction.South:
x += Utility.Random( -1, 3 );
y += Utility.Random( -1, 2 );
break;
case Direction.Up:
x += Utility.Random( 2 );
y += Utility.Random( 2 );
break;
case Direction.Down:
x += Utility.Random( -1, 2 );
y += Utility.Random( -1, 2 );
break;
case Direction.Left:
x += Utility.Random( 2 );
y += Utility.Random( -1, 2 );
break;
case Direction.Right:
x += Utility.Random( -1, 2 );
y += Utility.Random( 2 );
break;
}
new Blood().MoveToWorld( new Point3D( x, y, defender.Z ), defender.Map );
}*/
}
public virtual void GetDamageTypes( Mobile wielder, out int phys, out int fire, out int cold, out int pois, out int nrgy )