Adds style cop (#109)

This commit is contained in:
Kamron Batman 2020-04-26 00:16:02 -07:00 • committed by GitHub
parent 3e715bcb60
commit 556a17aba8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1725 changed files with 33831 additions and 38046 deletions

View file

@ -5,7 +5,7 @@ namespace Server.Mobiles
{
public class EtherealWarrior : BaseCreature
{
private static TimeSpan ResurrectDelay = TimeSpan.FromSeconds(2.0);
private static readonly TimeSpan ResurrectDelay = TimeSpan.FromSeconds(2.0);
private DateTime m_NextResurrect;

View file

@ -38,7 +38,7 @@ namespace Server.Mobiles
Karma = 7000;
VirtualArmor = 100;
if (0.02 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.02)
PackStatue();
}

View file

@ -10,7 +10,7 @@ namespace Server.Mobiles
public EnergyVortex()
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
{
if (Core.SE && 0.002 > Utility.RandomDouble()) // Per OSI FoF, it's a 1/500 chance.
if (Core.SE && Utility.RandomDouble() < 0.002) // Per OSI FoF, it's a 1/500 chance.
{
// Llama vortex!
Body = 0xDC;
@ -51,7 +51,6 @@ namespace Server.Mobiles
ControlSlots = Core.SE ? 2 : 1;
}
public EnergyVortex(Serial serial)
: base(serial)
{

View file

@ -9,8 +9,7 @@ namespace Server.Mobiles
private bool m_Stunning;
[Constructible]
public Golem(bool summoned = false, double scalar = 1.0) :
base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.4, 0.8)
public Golem(bool summoned = false, double scalar = 1.0) : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.4, 0.8)
{
Body = 752;
@ -57,16 +56,16 @@ namespace Server.Mobiles
{
PackItem(new IronIngot(Utility.RandomMinMax(13, 21)));
if (0.1 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.1)
PackItem(new PowerCrystal());
if (0.15 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.15)
PackItem(new ClockworkAssembly());
if (0.2 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.2)
PackItem(new ArcaneGem());
if (0.25 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.25)
PackItem(new Gears());
}
@ -102,11 +101,11 @@ namespace Server.Mobiles
{
base.OnDeath(c);
if (0.05 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.05)
{
if (!IsParagon)
{
if (0.75 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.75)
c.DropItem(DawnsMusicGear.RandomCommon);
else
c.DropItem(DawnsMusicGear.RandomUncommon);
@ -150,7 +149,7 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack(defender);
if (!m_Stunning && 0.3 > Utility.RandomDouble())
if (!m_Stunning && Utility.RandomDouble() < 0.3)
{
m_Stunning = true;

View file

@ -57,7 +57,7 @@ namespace Server.Mobiles
public override string CorpseName => "a plague beast corpse";
[CommandProperty(AccessLevel.GameMaster)]
public int TotalDevoured{ get; set; }
public int TotalDevoured { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public int DevourGoal
@ -67,15 +67,13 @@ namespace Server.Mobiles
}
[CommandProperty(AccessLevel.GameMaster)]
public bool HasMetalChest{ get; private set; }
public bool HasMetalChest { get; private set; }
public override string DefaultName => "a plague beast";
public override bool AutoDispel => true;
public override Poison PoisonImmune => Poison.Lethal;
#region IDevourer Members
public bool Devour(Corpse corpse)
{
if (corpse?.Owner == null) // sorry we can't devour because the corpse's owner is null
@ -99,8 +97,6 @@ namespace Server.Mobiles
return true;
}
#endregion
public override void GenerateLoot()
{
AddLoot(LootPack.FilthyRich);
@ -119,7 +115,7 @@ namespace Server.Mobiles
public override void OnDamagedBySpell(Mobile caster)
{
if (Map != null && caster != this && 0.25 > Utility.RandomDouble())
if (Map != null && caster != this && Utility.RandomDouble() < 0.25)
{
BaseCreature spawn = new PlagueSpawn(this);
@ -135,7 +131,7 @@ namespace Server.Mobiles
public override void OnGotMeleeAttack(Mobile attacker)
{
if (Map != null && attacker != this && 0.25 > Utility.RandomDouble())
if (Map != null && attacker != this && Utility.RandomDouble() < 0.25)
{
BaseCreature spawn = new PlagueSpawn(this);
@ -175,12 +171,12 @@ namespace Server.Mobiles
switch (version)
{
case 1:
{
HasMetalChest = reader.ReadBool();
TotalDevoured = reader.ReadInt();
m_DevourGoal = reader.ReadInt();
break;
}
{
HasMetalChest = reader.ReadBool();
TotalDevoured = reader.ReadInt();
m_DevourGoal = reader.ReadInt();
break;
}
}
}

View file

@ -50,7 +50,7 @@ namespace Server.Mobiles
public override Poison PoisonImmune => Poison.Lethal;
[CommandProperty(AccessLevel.GameMaster)]
public Mobile OpenedBy{ get; set; }
public Mobile OpenedBy { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public bool IsBleeding
@ -268,7 +268,7 @@ namespace Server.Mobiles
private class DecayTimer : Timer
{
private PlagueBeastLord m_Lord;
private readonly PlagueBeastLord m_Lord;
public DecayTimer(PlagueBeastLord lord, int count = 0, int deadline = 120) : base(TimeSpan.Zero, TimeSpan.FromSeconds(1))
{
@ -277,9 +277,9 @@ namespace Server.Mobiles
Deadline = deadline;
}
public int Count{ get; private set; }
public int Count { get; private set; }
public int Deadline{ get; private set; }
public int Deadline { get; private set; }
protected override void OnTick()
{

View file

@ -7,8 +7,7 @@ namespace Server.Mobiles
public class PlagueSpawn : BaseCreature
{
[Constructible]
public PlagueSpawn(Mobile owner = null) :
base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
public PlagueSpawn(Mobile owner = null) : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
{
Owner = owner;
ExpireTime = DateTime.UtcNow + TimeSpan.FromMinutes(1.0);
@ -75,10 +74,10 @@ namespace Server.Mobiles
public override string CorpseName => "a plague spawn corpse";
[CommandProperty(AccessLevel.GameMaster)]
public Mobile Owner{ get; set; }
public Mobile Owner { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public DateTime ExpireTime{ get; set; }
public DateTime ExpireTime { get; set; }
public override bool AlwaysMurderer => true;

View file

@ -93,7 +93,8 @@ namespace Server.Mobiles
private class InternalTimer : Timer
{
private Mobile m_Mobile, m_From;
private readonly Mobile m_Mobile;
private readonly Mobile m_From;
public InternalTimer(Mobile m, Mobile from) : base(TimeSpan.FromSeconds(1.0))
{