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
|
|
@ -1,68 +1,68 @@
|
|||
namespace Server.Mobiles
|
||||
{
|
||||
public class Bull : BaseCreature
|
||||
{
|
||||
public override string CorpseName => "a bull corpse";
|
||||
public override string DefaultName => "a bull";
|
||||
public class Bull : BaseCreature
|
||||
{
|
||||
[Constructible]
|
||||
public Bull() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
Body = Utility.RandomList(0xE8, 0xE9);
|
||||
BaseSoundID = 0x64;
|
||||
|
||||
[Constructible]
|
||||
public Bull() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
|
||||
{
|
||||
Body = Utility.RandomList( 0xE8, 0xE9 );
|
||||
BaseSoundID = 0x64;
|
||||
if (0.5 >= Utility.RandomDouble())
|
||||
Hue = 0x901;
|
||||
|
||||
if ( 0.5 >= Utility.RandomDouble() )
|
||||
Hue = 0x901;
|
||||
SetStr(77, 111);
|
||||
SetDex(56, 75);
|
||||
SetInt(47, 75);
|
||||
|
||||
SetStr( 77, 111 );
|
||||
SetDex( 56, 75 );
|
||||
SetInt( 47, 75 );
|
||||
SetHits(50, 64);
|
||||
SetMana(0);
|
||||
|
||||
SetHits( 50, 64 );
|
||||
SetMana( 0 );
|
||||
SetDamage(4, 9);
|
||||
|
||||
SetDamage( 4, 9 );
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetDamageType( ResistanceType.Physical, 100 );
|
||||
SetResistance(ResistanceType.Physical, 25, 30);
|
||||
SetResistance(ResistanceType.Cold, 10, 15);
|
||||
|
||||
SetResistance( ResistanceType.Physical, 25, 30 );
|
||||
SetResistance( ResistanceType.Cold, 10, 15 );
|
||||
SetSkill(SkillName.MagicResist, 17.6, 25.0);
|
||||
SetSkill(SkillName.Tactics, 67.6, 85.0);
|
||||
SetSkill(SkillName.Wrestling, 40.1, 57.5);
|
||||
|
||||
SetSkill( SkillName.MagicResist, 17.6, 25.0 );
|
||||
SetSkill( SkillName.Tactics, 67.6, 85.0 );
|
||||
SetSkill( SkillName.Wrestling, 40.1, 57.5 );
|
||||
Fame = 600;
|
||||
Karma = 0;
|
||||
|
||||
Fame = 600;
|
||||
Karma = 0;
|
||||
VirtualArmor = 28;
|
||||
|
||||
VirtualArmor = 28;
|
||||
Tamable = true;
|
||||
ControlSlots = 1;
|
||||
MinTameSkill = 71.1;
|
||||
}
|
||||
|
||||
Tamable = true;
|
||||
ControlSlots = 1;
|
||||
MinTameSkill = 71.1;
|
||||
}
|
||||
public Bull(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int Meat => 10;
|
||||
public override int Hides => 15;
|
||||
public override FoodType FavoriteFood => FoodType.GrainsAndHay;
|
||||
public override PackInstinct PackInstinct => PackInstinct.Bull;
|
||||
public override string CorpseName => "a bull corpse";
|
||||
public override string DefaultName => "a bull";
|
||||
|
||||
public Bull(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
public override int Meat => 10;
|
||||
public override int Hides => 15;
|
||||
public override FoodType FavoriteFood => FoodType.GrainsAndHay;
|
||||
public override PackInstinct PackInstinct => PackInstinct.Bull;
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,127 +2,129 @@ using System;
|
|||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public class Cow : BaseCreature
|
||||
{
|
||||
public override string CorpseName => "a cow corpse";
|
||||
public class Cow : BaseCreature
|
||||
{
|
||||
[Constructible]
|
||||
public Cow() : base(AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
Body = Utility.RandomList(0xD8, 0xE7);
|
||||
BaseSoundID = 0x78;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public DateTime MilkedOn { get; set; }
|
||||
SetStr(30);
|
||||
SetDex(15);
|
||||
SetInt(5);
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Milk { get; set; }
|
||||
SetHits(18);
|
||||
SetMana(0);
|
||||
|
||||
public override string DefaultName => "a cow";
|
||||
SetDamage(1, 4);
|
||||
|
||||
[Constructible]
|
||||
public Cow() : base( AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
|
||||
{
|
||||
Body = Utility.RandomList( 0xD8, 0xE7 );
|
||||
BaseSoundID = 0x78;
|
||||
SetDamage(1, 4);
|
||||
|
||||
SetStr( 30 );
|
||||
SetDex( 15 );
|
||||
SetInt( 5 );
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetHits( 18 );
|
||||
SetMana( 0 );
|
||||
SetResistance(ResistanceType.Physical, 5, 15);
|
||||
|
||||
SetDamage( 1, 4 );
|
||||
SetSkill(SkillName.MagicResist, 5.5);
|
||||
SetSkill(SkillName.Tactics, 5.5);
|
||||
SetSkill(SkillName.Wrestling, 5.5);
|
||||
|
||||
SetDamage( 1, 4 );
|
||||
Fame = 300;
|
||||
Karma = 0;
|
||||
|
||||
SetDamageType( ResistanceType.Physical, 100 );
|
||||
VirtualArmor = 10;
|
||||
|
||||
SetResistance( ResistanceType.Physical, 5, 15 );
|
||||
Tamable = true;
|
||||
ControlSlots = 1;
|
||||
MinTameSkill = 11.1;
|
||||
|
||||
SetSkill( SkillName.MagicResist, 5.5 );
|
||||
SetSkill( SkillName.Tactics, 5.5 );
|
||||
SetSkill( SkillName.Wrestling, 5.5 );
|
||||
if (Core.AOS && Utility.Random(1000) == 0) // 0.1% chance to have mad cows
|
||||
FightMode = FightMode.Closest;
|
||||
}
|
||||
|
||||
Fame = 300;
|
||||
Karma = 0;
|
||||
public Cow(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
VirtualArmor = 10;
|
||||
public override string CorpseName => "a cow corpse";
|
||||
|
||||
Tamable = true;
|
||||
ControlSlots = 1;
|
||||
MinTameSkill = 11.1;
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public DateTime MilkedOn{ get; set; }
|
||||
|
||||
if ( Core.AOS && Utility.Random( 1000 ) == 0 ) // 0.1% chance to have mad cows
|
||||
FightMode = FightMode.Closest;
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int Milk{ get; set; }
|
||||
|
||||
public override int Meat => 8;
|
||||
public override int Hides => 12;
|
||||
public override FoodType FavoriteFood => FoodType.FruitsAndVegies | FoodType.GrainsAndHay;
|
||||
public override string DefaultName => "a cow";
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
base.OnDoubleClick( from );
|
||||
public override int Meat => 8;
|
||||
public override int Hides => 12;
|
||||
public override FoodType FavoriteFood => FoodType.FruitsAndVegies | FoodType.GrainsAndHay;
|
||||
|
||||
int random = Utility.Random( 100 );
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
base.OnDoubleClick(from);
|
||||
|
||||
if ( random < 5 )
|
||||
Tip();
|
||||
else if ( random < 20 )
|
||||
PlaySound( 120 );
|
||||
else if ( random < 40 )
|
||||
PlaySound( 121 );
|
||||
}
|
||||
int random = Utility.Random(100);
|
||||
|
||||
public void Tip()
|
||||
{
|
||||
PlaySound( 121 );
|
||||
Animate( 8, 0, 3, true, false, 0 );
|
||||
}
|
||||
if (random < 5)
|
||||
Tip();
|
||||
else if (random < 20)
|
||||
PlaySound(120);
|
||||
else if (random < 40)
|
||||
PlaySound(121);
|
||||
}
|
||||
|
||||
public bool TryMilk( Mobile from )
|
||||
{
|
||||
if ( !from.InLOS( this ) || !from.InRange( Location, 2 ) )
|
||||
from.SendLocalizedMessage( 1080400 ); // You can not milk the cow from this location.
|
||||
if ( Controlled && ControlMaster != from )
|
||||
from.SendLocalizedMessage( 1071182 ); // The cow nimbly escapes your attempts to milk it.
|
||||
if ( Milk == 0 && MilkedOn + TimeSpan.FromDays( 1 ) > DateTime.UtcNow )
|
||||
from.SendLocalizedMessage( 1080198 ); // This cow can not be milked now. Please wait for some time.
|
||||
else
|
||||
{
|
||||
if ( Milk == 0 )
|
||||
Milk = 4;
|
||||
public void Tip()
|
||||
{
|
||||
PlaySound(121);
|
||||
Animate(8, 0, 3, true, false, 0);
|
||||
}
|
||||
|
||||
MilkedOn = DateTime.UtcNow;
|
||||
Milk--;
|
||||
public bool TryMilk(Mobile from)
|
||||
{
|
||||
if (!from.InLOS(this) || !from.InRange(Location, 2))
|
||||
from.SendLocalizedMessage(1080400); // You can not milk the cow from this location.
|
||||
if (Controlled && ControlMaster != from)
|
||||
from.SendLocalizedMessage(1071182); // The cow nimbly escapes your attempts to milk it.
|
||||
if (Milk == 0 && MilkedOn + TimeSpan.FromDays(1) > DateTime.UtcNow)
|
||||
{
|
||||
from.SendLocalizedMessage(1080198); // This cow can not be milked now. Please wait for some time.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Milk == 0)
|
||||
Milk = 4;
|
||||
|
||||
return true;
|
||||
}
|
||||
MilkedOn = DateTime.UtcNow;
|
||||
Milk--;
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public Cow( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 1 );
|
||||
writer.Write(1);
|
||||
|
||||
writer.Write( (DateTime) MilkedOn );
|
||||
writer.Write( (int) Milk );
|
||||
}
|
||||
writer.Write(MilkedOn);
|
||||
writer.Write(Milk);
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
if ( version > 0 )
|
||||
{
|
||||
MilkedOn = reader.ReadDateTime();
|
||||
Milk = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (version > 0)
|
||||
{
|
||||
MilkedOn = reader.ReadDateTime();
|
||||
Milk = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue