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,76 +2,81 @@ using System;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BigFish : Item, ICarvable
|
||||
{
|
||||
private Mobile m_Fisher;
|
||||
public class BigFish : Item, ICarvable
|
||||
{
|
||||
private Mobile m_Fisher;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public Mobile Fisher
|
||||
{
|
||||
get => m_Fisher;
|
||||
set{ m_Fisher = value; InvalidateProperties(); }
|
||||
}
|
||||
[Constructible]
|
||||
public BigFish() : base(0x09CC)
|
||||
{
|
||||
Weight = Utility.RandomMinMax(3,
|
||||
200); //TODO: Find correct formula. max on OSI currently 200, OSI dev says it's not 200 as max, and ~ 1/1,000,000 chance to get highest
|
||||
Hue = Utility.RandomBool() ? 0x847 : 0x58C;
|
||||
}
|
||||
|
||||
public void Carve( Mobile from, Item item )
|
||||
{
|
||||
base.ScissorHelper( from, new RawFishSteak(), Math.Max( 16, (int)Weight ) / 4 , false );
|
||||
}
|
||||
public BigFish(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int LabelNumber => 1041112; // a big fish
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public Mobile Fisher
|
||||
{
|
||||
get => m_Fisher;
|
||||
set
|
||||
{
|
||||
m_Fisher = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[Constructible]
|
||||
public BigFish() : base( 0x09CC )
|
||||
{
|
||||
Weight = Utility.RandomMinMax( 3, 200 ); //TODO: Find correct formula. max on OSI currently 200, OSI dev says it's not 200 as max, and ~ 1/1,000,000 chance to get highest
|
||||
Hue = Utility.RandomBool() ? 0x847 : 0x58C;
|
||||
}
|
||||
public override int LabelNumber => 1041112; // a big fish
|
||||
|
||||
public override void GetProperties( ObjectPropertyList list )
|
||||
{
|
||||
base.GetProperties( list );
|
||||
public void Carve(Mobile from, Item item)
|
||||
{
|
||||
base.ScissorHelper(from, new RawFishSteak(), Math.Max(16, (int)Weight) / 4, false);
|
||||
}
|
||||
|
||||
if ( Weight >= 20 )
|
||||
{
|
||||
if ( m_Fisher != null )
|
||||
list.Add( 1070857, m_Fisher.Name ); // Caught by ~1_fisherman~
|
||||
public override void GetProperties(ObjectPropertyList list)
|
||||
{
|
||||
base.GetProperties(list);
|
||||
|
||||
list.Add( 1070858, ((int)Weight).ToString() ); // ~1_weight~ stones
|
||||
}
|
||||
}
|
||||
if (Weight >= 20)
|
||||
{
|
||||
if (m_Fisher != null)
|
||||
list.Add(1070857, m_Fisher.Name); // Caught by ~1_fisherman~
|
||||
|
||||
public BigFish( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
list.Add(1070858, ((int)Weight).ToString()); // ~1_weight~ stones
|
||||
}
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 1 ); // version
|
||||
writer.Write(1); // version
|
||||
|
||||
writer.Write( (Mobile) m_Fisher );
|
||||
}
|
||||
writer.Write(m_Fisher);
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Fisher = reader.ReadMobile();
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
Weight = Utility.RandomMinMax( 3, 200 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
switch (version)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_Fisher = reader.ReadMobile();
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
Weight = Utility.RandomMinMax(3, 200);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue