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

@ -61,13 +61,13 @@ namespace Server.Mobiles
public override string CorpseName => "a demon knight corpse";
public override bool IgnoreYoungProtection => Core.ML;
public static Type[] ArtifactRarity10{ get; } =
public static Type[] ArtifactRarity10 { get; } =
{
typeof(LegacyOfTheDreadLord),
typeof(TheTaskmaster)
};
public static Type[] ArtifactRarity11{ get; } =
public static Type[] ArtifactRarity11 { get; } =
{
typeof(TheDragonSlayer),
typeof(ArmorOfFortune),
@ -231,7 +231,7 @@ namespace Server.Mobiles
MovingEffect(from, 0xECA, 10, 0, false, false, 0, 0);
PlaySound(0x491);
if (0.05 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.05)
Timer.DelayCall(TimeSpan.FromSeconds(1.0), CreateBones_Callback, from);
m_InHere = false;

View file

@ -53,7 +53,7 @@ namespace Server.Mobiles
public override bool Unprovokable => Core.SE;
public override bool AreaPeaceImmune => Core.SE;
public override Poison PoisonImmune => Poison.Lethal;
public override Poison HitPoison => 0.8 >= Utility.RandomDouble() ? Poison.Greater : Poison.Deadly;
public override Poison HitPoison => Utility.RandomDouble() <= 0.8 ? Poison.Greater : Poison.Deadly;
public override int TreasureMapLevel => 1;

View file

@ -6,8 +6,8 @@ namespace Server.Mobiles
{
public class Revenant : BaseCreature
{
private DateTime m_ExpireTime;
private Mobile m_Target;
private readonly DateTime m_ExpireTime;
private readonly Mobile m_Target;
public Revenant(Mobile caster, Mobile target, TimeSpan duration) : base(AIType.AI_Melee, FightMode.Closest, 10, 1,
0.18, 0.36)

View file

@ -58,7 +58,6 @@ namespace Server.Mobiles
// TODO: skeleton
}
public AntLion(Serial serial) : base(serial)
{
}

View file

@ -39,7 +39,7 @@ namespace Server.Mobiles
SolenHelper.PackPicnicBasket(this);
PackItem(new ZoogiFungus(0.05 > Utility.RandomDouble() ? 16 : 4));
PackItem(new ZoogiFungus(Utility.RandomDouble() < 0.05 ? 16 : 4));
}
public BlackSolenInfiltratorQueen(Serial serial) : base(serial)

View file

@ -39,7 +39,7 @@ namespace Server.Mobiles
SolenHelper.PackPicnicBasket(this);
PackItem(new ZoogiFungus(0.05 > Utility.RandomDouble() ? 13 : 3));
PackItem(new ZoogiFungus(Utility.RandomDouble() < 0.05 ? 13 : 3));
}
public BlackSolenInfiltratorWarrior(Serial serial) : base(serial)

View file

@ -51,7 +51,7 @@ namespace Server.Mobiles
}
public override string CorpseName => "a solen queen corpse";
public bool BurstSac{ get; private set; }
public bool BurstSac { get; private set; }
public override string DefaultName => "a black solen queen";
@ -122,10 +122,10 @@ namespace Server.Mobiles
switch (version)
{
case 1:
{
BurstSac = reader.ReadBool();
break;
}
{
BurstSac = reader.ReadBool();
break;
}
}
}
}

View file

@ -40,7 +40,7 @@ namespace Server.Mobiles
SolenHelper.PackPicnicBasket(this);
PackItem(new ZoogiFungus(0.05 > Utility.RandomDouble() ? 13 : 3));
PackItem(new ZoogiFungus(Utility.RandomDouble() < 0.05 ? 13 : 3));
if (Utility.RandomDouble() < 0.05)
PackItem(new BraceletOfBinding());
@ -51,7 +51,7 @@ namespace Server.Mobiles
}
public override string CorpseName => "a solen warrior corpse";
public bool BurstSac{ get; private set; }
public bool BurstSac { get; private set; }
public override string DefaultName => "a black solen warrior";
@ -123,10 +123,10 @@ namespace Server.Mobiles
switch (version)
{
case 1:
{
BurstSac = reader.ReadBool();
break;
}
{
BurstSac = reader.ReadBool();
break;
}
}
}
}

View file

@ -38,7 +38,7 @@ namespace Server.Mobiles
SolenHelper.PackPicnicBasket(this);
PackItem(new ZoogiFungus(0.05 < Utility.RandomDouble() ? 4 : 16));
PackItem(new ZoogiFungus(Utility.RandomDouble() > 0.05 ? 4 : 16));
}
public RedSolenInfiltratorQueen(Serial serial) : base(serial)

View file

@ -38,7 +38,7 @@ namespace Server.Mobiles
SolenHelper.PackPicnicBasket(this);
PackItem(new ZoogiFungus(0.05 < Utility.RandomDouble() ? 3 : 13));
PackItem(new ZoogiFungus(Utility.RandomDouble() > 0.05 ? 3 : 13));
}
public RedSolenInfiltratorWarrior(Serial serial) : base(serial)

View file

@ -50,7 +50,7 @@ namespace Server.Mobiles
}
public override string CorpseName => "a solen queen corpse";
public bool BurstSac{ get; private set; }
public bool BurstSac { get; private set; }
public override string DefaultName => "a red solen queen";
@ -69,7 +69,6 @@ namespace Server.Mobiles
AddLoot(LootPack.Rich);
}
public override bool IsEnemy(Mobile m)
{
if (SolenHelper.CheckRedFriendship(m))
@ -122,10 +121,10 @@ namespace Server.Mobiles
switch (version)
{
case 1:
{
BurstSac = reader.ReadBool();
break;
}
{
BurstSac = reader.ReadBool();
break;
}
}
}
}

View file

@ -38,7 +38,7 @@ namespace Server.Mobiles
VirtualArmor = 35;
SolenHelper.PackPicnicBasket(this);
PackItem(new ZoogiFungus(0.05 < Utility.RandomDouble() ? 3 : 13));
PackItem(new ZoogiFungus(Utility.RandomDouble() > 0.05 ? 3 : 13));
if (Utility.RandomDouble() < 0.05)
PackItem(new BraceletOfBinding());
@ -49,7 +49,7 @@ namespace Server.Mobiles
}
public override string CorpseName => "a solen warrior corpse";
public bool BurstSac{ get; private set; }
public bool BurstSac { get; private set; }
public override string DefaultName => "a red solen warrior";
@ -121,10 +121,10 @@ namespace Server.Mobiles
switch (version)
{
case 1:
{
BurstSac = reader.ReadBool();
break;
}
{
BurstSac = reader.ReadBool();
break;
}
}
}
}

View file

@ -7,7 +7,7 @@ namespace Server.Mobiles
{
public static void PackPicnicBasket(BaseCreature solen)
{
if (1 > Utility.Random(100))
if (Utility.Random(100) < 1)
{
PicnicBasket basket = new PicnicBasket();

View file

@ -54,7 +54,7 @@ namespace Server.Mobiles
AddLoot(LootPack.Average);
AddLoot(LootPack.Gems);
if (0.02 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.02)
switch (Utility.Random(5))
{
case 0:

View file

@ -46,7 +46,7 @@ namespace Server.Mobiles
PackItem(new PowerCrystal());
if (0.02 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.02)
PackItem(new BlackthornWelcomeBook());
m_NextAbilityTime = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(5, 30));
@ -71,11 +71,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);
@ -104,7 +104,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

@ -36,7 +36,7 @@ namespace Server.Mobiles
VirtualArmor = 32;
if (0.025 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.025)
PackItem(new GargoylesPickaxe());
}

View file

@ -40,7 +40,7 @@ namespace Server.Mobiles
VirtualArmor = 50;
if (0.2 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.2)
PackItem(new GargoylesPickaxe());
}
@ -65,7 +65,7 @@ namespace Server.Mobiles
public override void OnDamagedBySpell(Mobile from)
{
if (from?.Alive == true && 0.4 > Utility.RandomDouble())
if (from?.Alive == true && Utility.RandomDouble() < 0.4)
ThrowHatchet(from);
}
@ -73,7 +73,7 @@ namespace Server.Mobiles
{
base.OnGotMeleeAttack(attacker);
if (attacker?.Alive == true && attacker.Weapon is BaseRanged && 0.4 > Utility.RandomDouble())
if (attacker?.Alive == true && attacker.Weapon is BaseRanged && Utility.RandomDouble() < 0.4)
ThrowHatchet(attacker);
}

View file

@ -38,7 +38,7 @@ namespace Server.Mobiles
VirtualArmor = 50;
if (0.2 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.2)
PackItem(new GargoylesPickaxe());
}

View file

@ -46,7 +46,7 @@ namespace Server.Mobiles
VirtualArmor = 16;
if (0.7 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.7)
PackItem(new ArcaneGem());
}

View file

@ -28,7 +28,6 @@ namespace Server.Mobiles
SetResistance(ResistanceType.Poison, 55, 65);
SetResistance(ResistanceType.Energy, 40, 50);
SetSkill(SkillName.Necromancy, 89, 99.1);
SetSkill(SkillName.SpiritSpeak, 90.0, 99.0);

View file

@ -38,10 +38,9 @@ namespace Server.Mobiles
VirtualArmor = 30;
PackReg(6);
if (0.05 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.05)
PackItem(new OrcishKinMask());
}

View file

@ -40,7 +40,7 @@ namespace Server.Mobiles
PackReg(6);
if (0.02 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.02)
PackStatue();
}

View file

@ -47,7 +47,7 @@ namespace Server.Mobiles
PackReg(10, 15);
PackItem(new Bandage(Utility.RandomMinMax(1, 15)));
if (0.1 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.1)
PackItem(new TribalBerry());
AddItem(new BoneArms());
@ -109,7 +109,7 @@ namespace Server.Mobiles
{
base.OnGotMeleeAttack(attacker);
if (0.1 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.1)
BeginSavageDance();
}
@ -151,116 +151,116 @@ namespace Server.Mobiles
return;
IPooledEnumerable<Mobile> eable = GetMobilesInRange(8);
switch (Utility.Random(3))
{
case 0: /* greater heal */
{
foreach (Mobile m in eable)
{
bool isFriendly = m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback;
foreach (Mobile m in eable)
{
bool isFriendly = m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback;
if (!isFriendly)
continue;
if (!isFriendly)
continue;
if (m.Poisoned || MortalStrike.IsWounded(m) || !CanBeBeneficial(m))
continue;
if (m.Poisoned || MortalStrike.IsWounded(m) || !CanBeBeneficial(m))
continue;
DoBeneficial(m);
DoBeneficial(m);
// Algorithm: (40% of magery) + (1-10)
// Algorithm: (40% of magery) + (1-10)
int toHeal = (int)(Skills.Magery.Value * 0.4);
toHeal += Utility.Random(1, 10);
int toHeal = (int)(Skills.Magery.Value * 0.4);
toHeal += Utility.Random(1, 10);
m.Heal(toHeal, this);
m.Heal(toHeal, this);
m.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
m.PlaySound(0x202);
m.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
m.PlaySound(0x202);
}
break;
}
break;
}
case 1: /* lightning */
{
foreach (Mobile m in eable)
{
bool isFriendly = m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback;
if (isFriendly)
continue;
if (!CanBeHarmful(m))
continue;
DoHarmful(m);
double damage;
if (Core.AOS)
foreach (Mobile m in eable)
{
int baseDamage = 6 + (int)(Skills.EvalInt.Value / 5.0);
bool isFriendly = m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback;
damage = Utility.RandomMinMax(baseDamage, baseDamage + 3);
}
else
{
damage = Utility.Random(12, 9);
if (isFriendly)
continue;
if (!CanBeHarmful(m))
continue;
DoHarmful(m);
double damage;
if (Core.AOS)
{
int baseDamage = 6 + (int)(Skills.EvalInt.Value / 5.0);
damage = Utility.RandomMinMax(baseDamage, baseDamage + 3);
}
else
{
damage = Utility.Random(12, 9);
}
m.BoltEffect(0);
SpellHelper.Damage(TimeSpan.FromSeconds(0.25), m, this, damage, 0, 0, 0, 0, 100);
}
m.BoltEffect(0);
SpellHelper.Damage(TimeSpan.FromSeconds(0.25), m, this, damage, 0, 0, 0, 0, 100);
break;
}
break;
}
case 2: /* poison */
{
foreach (Mobile m in eable)
{
bool isFriendly = m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback;
foreach (Mobile m in eable)
{
bool isFriendly = m is Savage || m is SavageRider || m is SavageShaman || m is SavageRidgeback;
if (isFriendly)
continue;
if (isFriendly)
continue;
if (!CanBeHarmful(m))
continue;
if (!CanBeHarmful(m))
continue;
DoHarmful(m);
DoHarmful(m);
m.Spell?.OnCasterHurt();
m.Spell?.OnCasterHurt();
m.Paralyzed = false;
m.Paralyzed = false;
double total = Skills.Magery.Value + Skills.Poisoning.Value;
double total = Skills.Magery.Value + Skills.Poisoning.Value;
double dist = GetDistanceToSqrt(m);
double dist = GetDistanceToSqrt(m);
if (dist >= 3.0)
total -= (dist - 3.0) * 10.0;
if (dist >= 3.0)
total -= (dist - 3.0) * 10.0;
int level;
int level;
if (total >= 200.0 && Utility.Random(1, 100) <= 10)
level = 3;
else if (total > 170.0)
level = 2;
else if (total > 130.0)
level = 1;
else
level = 0;
if (total >= 200.0 && Utility.Random(1, 100) <= 10)
level = 3;
else if (total > 170.0)
level = 2;
else if (total > 130.0)
level = 1;
else
level = 0;
m.ApplyPoison(this, Poison.GetPoison(level));
m.ApplyPoison(this, Poison.GetPoison(level));
m.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
m.PlaySound(0x474);
m.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
m.PlaySound(0x474);
}
break;
}
break;
}
}
eable.Free();
}

View file

@ -61,8 +61,8 @@ namespace Server.Mobiles
foreach (Mobile m in eable)
{
if (m == this || !CanBeHarmful(m) ||
!(m.Player || m is BaseCreature creature &&
(creature.Controlled || creature.Summoned || creature.Team != Team)))
!(m.Player || (m is BaseCreature creature &&
(creature.Controlled || creature.Summoned || creature.Team != Team))))
continue;
DoHarmful(m);
@ -70,7 +70,7 @@ namespace Server.Mobiles
m.FixedParticles(0x374A, 10, 15, 5013, 0x496, 0, EffectLayer.Waist);
m.PlaySound(0x231);
//m.SendMessage( "You feel the life drain out of you!" );
// m.SendMessage( "You feel the life drain out of you!" );
int toDrain = Utility.RandomMinMax(10, 40);
@ -85,7 +85,7 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack(defender);
if (0.1 >= Utility.RandomDouble())
if (Utility.RandomDouble() <= 0.1)
DrainLife();
}
@ -93,7 +93,7 @@ namespace Server.Mobiles
{
base.OnGotMeleeAttack(attacker);
if (0.1 >= Utility.RandomDouble())
if (Utility.RandomDouble() <= 0.1)
DrainLife();
}

View file

@ -61,7 +61,7 @@ namespace Server.Mobiles
public override void GenerateLoot()
{
AddLoot(LootPack.Meager);
//AddLoot( LootPack.Miscellaneous );
// AddLoot( LootPack.Miscellaneous );
}
public override void Serialize(IGenericWriter writer)

View file

@ -33,7 +33,7 @@ namespace Server.Mobiles
VirtualArmor = 35;
if (0.2 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.2)
PackItem(new GargoylesPickaxe());
}

View file

@ -46,7 +46,6 @@ namespace Server.Mobiles
helm.Hue = 0x966;
AddItem(helm);
Bow bow = new Bow();
bow.Movable = false;
@ -73,7 +72,7 @@ namespace Server.Mobiles
{
base.Serialize(writer);
writer.Write(0); // version
writer.Write(0); // version
}
public override void Deserialize(IGenericReader reader)

View file

@ -13,7 +13,6 @@ namespace Server.Mobiles
{
Body = 768;
SetStr(301, 400);
SetDex(51, 70);
SetInt(51, 100);
@ -42,10 +41,10 @@ namespace Server.Mobiles
VirtualArmor = 70;
if (0.1 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.1)
PackItem(new PowerCrystal());
if (0.4 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.4)
PackItem(new ClockworkAssembly());
}
@ -68,11 +67,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);
@ -100,7 +99,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

@ -7,10 +7,10 @@ namespace Server.Mobiles
{
public class KhaldunRevenant : BaseCreature
{
private static HashSet<Mobile> m_Set = new HashSet<Mobile>();
private DateTime m_ExpireTime;
private static readonly HashSet<Mobile> m_Set = new HashSet<Mobile>();
private readonly DateTime m_ExpireTime;
private Mobile m_Target;
private readonly Mobile m_Target;
public KhaldunRevenant(Mobile target) : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.18, 0.36)
{
@ -116,8 +116,8 @@ namespace Server.Mobiles
return;
}
//Combatant = m_Target;
//FocusMob = m_Target;
// Combatant = m_Target;
// FocusMob = m_Target;
if (AIObject != null)
AIObject.Action = ActionType.Combat;

View file

@ -74,7 +74,7 @@ namespace Server.Mobiles
break;
}
if (0.2 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.2)
PackItem(new BolaBall());
}

View file

@ -48,7 +48,7 @@ namespace Server.Mobiles
PackItem(new MortarPestle());
PackItem(new LesserExplosionPotion());
if (0.2 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.2)
PackItem(new BolaBall());
}
@ -108,7 +108,7 @@ namespace Server.Mobiles
m_Thrown++;
if (0.75 >= Utility.RandomDouble() && m_Thrown % 2 == 1) // 75% chance to quickly throw another bomb
if (Utility.RandomDouble() <= 0.75 && m_Thrown % 2 == 1) // 75% chance to quickly throw another bomb
m_NextBomb = DateTime.UtcNow + TimeSpan.FromSeconds(3.0);
else
m_NextBomb = DateTime.UtcNow + TimeSpan.FromSeconds(5.0 + 10.0 * Utility.RandomDouble()); // 5-15 seconds
@ -138,7 +138,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))
{

View file

@ -42,10 +42,10 @@ namespace Server.Mobiles
PackItem(ore);
PackItem(new IronIngot(10));
if (0.05 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.05)
PackItem(new OrcishKinMask());
if (0.2 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.2)
PackItem(new BolaBall());
}
@ -113,7 +113,7 @@ namespace Server.Mobiles
if (eable.Count() < 10)
{
BaseCreature orc = new SpawnedOrcishLord{ Team = Team };
BaseCreature orc = new SpawnedOrcishLord { Team = Team };
orc.MoveToWorld(map.GetRandomNearbyLocation(target.Location), map);
orc.Combatant = target;

View file

@ -56,10 +56,10 @@ namespace Server.Mobiles
PackItem(new RingmailChest());
if (0.3 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.3)
PackItem(Loot.RandomPossibleReagent());
if (0.2 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.2)
PackItem(new BolaBall());
}

View file

@ -76,8 +76,7 @@ namespace Server.Mobiles
public override bool IsEnemy(Mobile m)
{
if (m is PlayerMobile player && Map == Map.Trammel && X >= 5199 && X <= 5271 && Y >= 1812 && Y <= 1865
) // Schmendrick's cave
if (m is PlayerMobile player && Map == Map.Trammel && X >= 5199 && X <= 5271 && Y >= 1812 && Y <= 1865) // Schmendrick's cave
{
QuestSystem qs = player.Quest;

View file

@ -35,18 +35,18 @@ namespace Server.Mobiles
PackItem(new Bandage(Utility.RandomMinMax(1, 15)));
if (Female && 0.1 > Utility.RandomDouble())
if (Female && Utility.RandomDouble() < 0.1)
PackItem(new TribalBerry());
else if (!Female && 0.1 > Utility.RandomDouble())
else if (!Female && Utility.RandomDouble() < 0.1)
PackItem(new BolaBall());
AddItem(new Spear());
AddItem(new BoneArms());
AddItem(new BoneLegs());
if (0.5 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.5)
AddItem(new SavageMask());
else if (0.1 > Utility.RandomDouble())
else if (Utility.RandomDouble() < 0.1)
AddItem(new OrcishKinMask());
}

View file

@ -36,7 +36,7 @@ namespace Server.Mobiles
PackItem(new Bandage(Utility.RandomMinMax(1, 15)));
if (0.1 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.1)
PackItem(new BolaBall());
AddItem(new TribalSpear());

View file

@ -100,7 +100,7 @@ namespace Server.Mobiles
private class UnhideTimer : Timer
{
private ShadowFiend m_Owner;
private readonly ShadowFiend m_Owner;
public UnhideTimer(ShadowFiend owner) : base(TimeSpan.FromSeconds(30.0))
{

View file

@ -37,7 +37,7 @@ namespace Server.Mobiles
PackItem(new IronIngot(12));
if (0.05 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.05)
PackItem(new GargoylesPickaxe());
}

View file

@ -56,7 +56,7 @@ namespace Server.Mobiles
}
public override string CorpseName => "a minion's corpse";
public bool FieldActive{ get; private set; }
public bool FieldActive { get; private set; }
public bool CanUseField // TODO: an OSI bug prevents to verify this
=> Hits >= HitsMax * 9 / 10;
@ -100,7 +100,7 @@ namespace Server.Mobiles
public override void OnDamagedBySpell(Mobile from)
{
if (from?.Alive == true && 0.4 > Utility.RandomDouble()) SendEBolt(from);
if (from?.Alive == true && Utility.RandomDouble() < 0.4) SendEBolt(from);
if (!FieldActive)
{
@ -129,7 +129,7 @@ namespace Server.Mobiles
attacker.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
}
if (attacker?.Alive == true && attacker.Weapon is BaseRanged && 0.4 > Utility.RandomDouble())
if (attacker?.Alive == true && attacker.Weapon is BaseRanged && Utility.RandomDouble() < 0.4)
SendEBolt(attacker);
}

View file

@ -47,7 +47,7 @@ namespace Server.Mobiles
}
public override string CorpseName => "an overseer's corpse";
public bool FieldActive{ get; private set; }
public bool FieldActive { get; private set; }
public bool CanUseField // TODO: an OSI bug prevents to verify this
=> Hits >= HitsMax * 9 / 10;
@ -90,7 +90,7 @@ namespace Server.Mobiles
public override void OnDamagedBySpell(Mobile from)
{
if (from?.Alive == true && 0.4 > Utility.RandomDouble()) SendEBolt(from);
if (from?.Alive == true && Utility.RandomDouble() < 0.4) SendEBolt(from);
if (!FieldActive)
{
@ -119,7 +119,7 @@ namespace Server.Mobiles
attacker.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
}
if (attacker?.Alive == true && attacker.Weapon is BaseRanged && 0.4 > Utility.RandomDouble())
if (attacker?.Alive == true && attacker.Weapon is BaseRanged && Utility.RandomDouble() < 0.4)
SendEBolt(attacker);
}

View file

@ -23,11 +23,11 @@ namespace Server.Mobiles
SetDamageType(ResistanceType.Cold, 25);
SetDamageType(ResistanceType.Energy, 25);
//SetResistance( ResistanceType.Physical, 25, 38 );
//SetResistance( ResistanceType.Fire, 25, 38 );
//SetResistance( ResistanceType.Cold, 25, 38 );
//SetResistance( ResistanceType.Poison, 25, 38 );
//SetResistance( ResistanceType.Energy, 25, 38 );
// SetResistance( ResistanceType.Physical, 25, 38 );
// SetResistance( ResistanceType.Fire, 25, 38 );
// SetResistance( ResistanceType.Cold, 25, 38 );
// SetResistance( ResistanceType.Poison, 25, 38 );
// SetResistance( ResistanceType.Energy, 25, 38 );
SetSkill(SkillName.Fencing, 77.6, 92.5);
SetSkill(SkillName.Healing, 60.3, 90.0);
@ -146,7 +146,7 @@ namespace Server.Mobiles
public override void GenerateLoot()
{
AddLoot(LootPack.Rich);
//AddLoot( LootPack.Gems );
// AddLoot( LootPack.Gems );
}
public override bool OnBeforeDeath()

View file

@ -27,7 +27,6 @@ namespace Server.Mobiles
SetResistance(ResistanceType.Poison, 25, 35);
SetResistance(ResistanceType.Energy, 25, 35);*/
SetSkill(SkillName.Tactics, 80.1, 100.0);
SetSkill(SkillName.MagicResist, 100.1, 110.0);
SetSkill(SkillName.Anatomy, 80.1, 100.0);

View file

@ -74,7 +74,7 @@ namespace Server.Mobiles
public override void OnDamage(int amount, Mobile from, bool willKill)
{
if (!willKill && amount > 5 && from?.Player == true && 5 > Utility.Random(100))
if (!willKill && amount > 5 && from?.Player == true && Utility.Random(100) < 5)
{
string[] toSay =
{

View file

@ -73,29 +73,29 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack(defender);
if (0.2 < Utility.RandomDouble())
if (Utility.RandomDouble() > 0.2)
return;
switch (Utility.Random(3))
{
case 0:
{
defender.SendLocalizedMessage(1004014); // You have been stunned!
defender.Freeze(TimeSpan.FromSeconds(4.0));
break;
}
{
defender.SendLocalizedMessage(1004014); // You have been stunned!
defender.Freeze(TimeSpan.FromSeconds(4.0));
break;
}
case 1:
{
defender.SendAsciiMessage("You have been hit by a paralyzing blow!");
defender.Freeze(TimeSpan.FromSeconds(3.0));
break;
}
{
defender.SendAsciiMessage("You have been hit by a paralyzing blow!");
defender.Freeze(TimeSpan.FromSeconds(3.0));
break;
}
case 2:
{
AOS.Damage(defender, this, Utility.Random(10, 5), 100, 0, 0, 0, 0);
defender.SendAsciiMessage("You have been hit by a critical strike!");
break;
}
{
AOS.Damage(defender, this, Utility.Random(10, 5), 100, 0, 0, 0, 0);
defender.SendAsciiMessage("You have been hit by a critical strike!");
break;
}
}
}

View file

@ -190,7 +190,6 @@ namespace Server.Mobiles
given "come" command, ie they wander towards their summoner,
but never actually "follow".
*/
else if (!Combat(this))
{
AIObject?.MoveTo(SummonMaster, false, 5);
@ -201,10 +200,9 @@ namespace Server.Mobiles
is a player or controlled/summoned, and the summoner is not already
engaged in combat.
*/
else if (!Combat(SummonMaster))
{
if (Combatant.Player || Combatant is BaseCreature bc && (bc.Controlled || bc.SummonMaster != null))
if (Combatant.Player || (Combatant is BaseCreature bc && (bc.Controlled || bc.SummonMaster != null)))
SummonMaster.Combatant = Combatant;
}
else

View file

@ -133,7 +133,7 @@ namespace Server.Mobiles
if (!(m is MeerWarrior) || !IsFriend(m) || !CanBeBeneficial(m) || m.Hits >= m.HitsMax || m.Poisoned ||
MortalStrike.IsWounded(m))
continue;
DoBeneficial(m);
int toHeal = Utility.RandomMinMax(20, 30);
@ -145,7 +145,7 @@ namespace Server.Mobiles
m.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
m.PlaySound(0x202);
}
eable.Free();
}

View file

@ -179,7 +179,7 @@ namespace Server.Mobiles
case 3:
DoAreaLeech();
break;
// TODO: Resurrect ability
// TODO: Resurrect ability
}
}
}

View file

@ -7,7 +7,7 @@ namespace Server.Mobiles
{
public class MeerMage : BaseCreature
{
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private static readonly Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private DateTime m_NextAbilityTime;
@ -121,7 +121,7 @@ namespace Server.Mobiles
rabid.MoveToWorld(loc, combatant.Map);
}
Say(1071932); //Creatures of the forest, I call to thee! Aid me in the fight against all that is evil!
Say(1071932); // Creatures of the forest, I call to thee! Aid me in the fight against all that is evil!
}
else if (combatant.Player)
{

View file

@ -5,8 +5,7 @@ namespace Server.Mobiles
public class CuSidhe : BaseMount
{
[Constructible]
public CuSidhe(string name = null) :
base(name, 277, 0x3E91, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
public CuSidhe(string name = null) : base(name, 277, 0x3E91, AIType.AI_Animal, FightMode.Aggressor, 10, 1, 0.2, 0.4)
{
double chance = Utility.RandomDouble() * 23301;
@ -41,8 +40,8 @@ namespace Server.Mobiles
SetSkill(SkillName.Anatomy, 65.5, 69.4);
SetSkill(SkillName.Healing, 72.2, 98.9);
Fame = 5000; //Guessing here
Karma = 5000; //Guessing here
Fame = 5000; // Guessing here
Karma = 5000; // Guessing here
Tamable = true;
ControlSlots = 4;
@ -51,8 +50,8 @@ namespace Server.Mobiles
if (Utility.RandomDouble() < 0.2)
PackItem(new TreasureMap(5, Map.Trammel));
//if ( Utility.RandomDouble() < 0.1 )
//PackItem( new ParrotItem() );
// if (Utility.RandomDouble() < 0.1)
// PackItem( new ParrotItem() );
PackGold(500, 800);

View file

@ -5,7 +5,7 @@ namespace Server.Mobiles
{
public class Ferret : BaseCreature
{
private static string[] m_Vocabulary =
private static readonly string[] m_Vocabulary =
{
"dook",
"dook dook",
@ -77,11 +77,11 @@ namespace Server.Mobiles
Say(m_Vocabulary[Utility.Random(m_Vocabulary.Length)]);
if (to != null && Utility.RandomBool())
Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(5, 8)), delegate { to.Talk(); });
Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(5, 8)), to.Talk);
m_CanTalk = false;
Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(20, 30)), delegate { m_CanTalk = true; });
Timer.DelayCall(TimeSpan.FromSeconds(Utility.RandomMinMax(20, 30)), () => { m_CanTalk = true; });
}
}
@ -101,4 +101,4 @@ namespace Server.Mobiles
m_CanTalk = true;
}
}
}
}

View file

@ -30,8 +30,8 @@ namespace Server.Mobiles
SetSkill(SkillName.MagicResist, 32.8, 54.6);
SetSkill(SkillName.Anatomy, 0, 0);
Fame = 10000; //Guessing here
Karma = 10000; //Guessing here
Fame = 10000; // Guessing here
Karma = 10000; // Guessing here
VirtualArmor = 24;

View file

@ -5,7 +5,7 @@ namespace Server.Mobiles
{
public class LadyJennifyr : SkeletalKnight
{
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
[Constructible]
public LadyJennifyr()
@ -54,10 +54,10 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.15 )
if (Utility.RandomDouble() < 0.15)
c.DropItem( new DisintegratingThesisNotes() );
if ( Utility.RandomDouble() < 0.1 )
if (Utility.RandomDouble() < 0.1)
c.DropItem( new ParrotItem() );
}
*/
@ -107,8 +107,8 @@ namespace Server.Mobiles
private class ExpireTimer : Timer
{
private Mobile m_Mobile;
private ResistanceMod m_Mod;
private readonly Mobile m_Mobile;
private readonly ResistanceMod m_Mod;
public ExpireTimer(Mobile m, ResistanceMod mod)
: base(TimeSpan.FromSeconds(10))

View file

@ -51,10 +51,10 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.15 )
if (Utility.RandomDouble() < 0.15)
c.DropItem( new DisintegratingThesisNotes() );
if ( Utility.RandomDouble() < 0.1 )
if (Utility.RandomDouble() < 0.1)
c.DropItem( new ParrotItem() );
}
*/
@ -82,4 +82,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -62,10 +62,10 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.05 )
if (Utility.RandomDouble() < 0.05)
c.DropItem( new ParrotItem() );
if ( Utility.RandomDouble() < 0.15 )
if (Utility.RandomDouble() < 0.15)
c.DropItem( new DisintegratingThesisNotes() );
}
*/
@ -92,4 +92,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -61,10 +61,10 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.15 )
if (Utility.RandomDouble() < 0.15)
c.DropItem( new DisintegratingThesisNotes() );
if ( Utility.RandomDouble() < 0.1 )
if (Utility.RandomDouble() < 0.1)
c.DropItem( new ParrotItem() );
}
*/
@ -90,4 +90,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -51,10 +51,10 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.15 )
if (Utility.RandomDouble() < 0.15)
c.DropItem( new DisintegratingThesisNotes() );
if ( Utility.RandomDouble() < 0.05 )
if (Utility.RandomDouble() < 0.05)
c.DropItem( new AssassinChest() );
}
*/
@ -88,7 +88,7 @@ namespace Server.Mobiles
foreach (Mobile m in GetMobilesInRange(2))
{
if (m == this || !CanBeHarmful(m, false) || Core.AOS && !InLOS(m))
if (m == this || !CanBeHarmful(m, false) || (Core.AOS && !InLOS(m)))
continue;
if (m is BaseCreature bc)
@ -130,4 +130,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -71,7 +71,7 @@ namespace Server.Mobiles
/*
// TODO: uncomment once added
if ( Utility.RandomDouble() < 0.025 )
if (Utility.RandomDouble() < 0.025)
{
switch ( Utility.Random( 5 ) )
{
@ -99,4 +99,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -13,7 +13,7 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.1 )
if (Utility.RandomDouble() < 0.1)
c.DropItem( new ParrotItem() );
}
*/
@ -40,4 +40,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -65,10 +65,10 @@ namespace Server.Mobiles
/*
// TODO: uncomment once added
if ( Utility.RandomDouble() < 0.2 )
if (Utility.RandomDouble() < 0.2)
c.DropItem( new ParrotItem() );
if ( Utility.RandomDouble() < 0.05 )
if (Utility.RandomDouble() < 0.05)
c.DropItem( new ThorvaldsMedallion() );
*/
}
@ -87,4 +87,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -14,7 +14,7 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.1 )
if (Utility.RandomDouble() < 0.1)
c.DropItem( new ParrotItem() );
}
*/
@ -43,4 +43,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -55,8 +55,8 @@ namespace Server.Mobiles
c.DropItem(new SalivasFeather());
// TODO: uncomment once added
//if ( Utility.RandomDouble() < 0.1 )
// c.DropItem( new ParrotItem() );
// if (Utility.RandomDouble() < 0.1)
// c.DropItem( new ParrotItem() );
}
public override void Serialize(IGenericWriter writer)
@ -73,4 +73,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -86,13 +86,11 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
#region Area Peace
private DateTime m_NextPeace;
public void AreaPeace()
{
if (Combatant == null || Deleted || !Alive || m_NextPeace > DateTime.UtcNow || 0.1 < Utility.RandomDouble())
if (Combatant == null || Deleted || !Alive || m_NextPeace > DateTime.UtcNow || Utility.RandomDouble() > 0.1)
return;
TimeSpan duration = TimeSpan.FromSeconds(Utility.RandomMinMax(20, 80));
@ -118,15 +116,11 @@ namespace Server.Mobiles
m?.PeacedUntil < DateTime.UtcNow && !m.Hidden && m.AccessLevel == AccessLevel.Player &&
CanBeHarmful(m);
#endregion
#region Undress
private DateTime m_NextUndress;
public void AreaUndress()
{
if (Combatant == null || Deleted || !Alive || m_NextUndress > DateTime.UtcNow || 0.005 < Utility.RandomDouble())
if (Combatant == null || Deleted || !Alive || m_NextUndress > DateTime.UtcNow || Utility.RandomDouble() > 0.005)
return;
foreach (Mobile m in GetMobilesInRange(RangePerception))
@ -153,7 +147,5 @@ namespace Server.Mobiles
if (item?.Movable == true)
m.PlaceInBackpack(item);
}
#endregion
}
}

View file

@ -79,13 +79,11 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
#region Peace
private DateTime m_NextPeace;
public void Peace(Mobile target)
{
if (target == null || Deleted || !Alive || m_NextPeace > DateTime.UtcNow || 0.1 < Utility.RandomDouble())
if (target == null || Deleted || !Alive || m_NextPeace > DateTime.UtcNow || Utility.RandomDouble() > 0.1)
return;
if (target is PlayerMobile p && p.PeacedUntil < DateTime.UtcNow && !p.Hidden && CanBeHarmful(p))
@ -101,17 +99,13 @@ namespace Server.Mobiles
m_NextPeace = DateTime.UtcNow + TimeSpan.FromSeconds(10);
}
#endregion
#region Suppress
private static Dictionary<Mobile, Timer> m_Suppressed = new Dictionary<Mobile, Timer>();
private static readonly Dictionary<Mobile, Timer> m_Suppressed = new Dictionary<Mobile, Timer>();
private DateTime m_NextSuppress;
public void Suppress(Mobile target)
{
if (target == null || m_Suppressed.ContainsKey(target) || Deleted || !Alive ||
m_NextSuppress > DateTime.UtcNow || 0.1 < Utility.RandomDouble())
m_NextSuppress > DateTime.UtcNow || Utility.RandomDouble() > 0.1)
return;
TimeSpan delay = TimeSpan.FromSeconds(Utility.RandomMinMax(20, 80));
@ -155,7 +149,7 @@ namespace Server.Mobiles
private class AnimateTimer : Timer
{
private int m_Count;
private Mobile m_Owner;
private readonly Mobile m_Owner;
public AnimateTimer(Mobile owner, int count) : base(TimeSpan.Zero, TimeSpan.FromSeconds(1.25))
{
@ -172,15 +166,11 @@ namespace Server.Mobiles
}
}
#endregion
#region Undress
private DateTime m_NextUndress;
public void Undress(Mobile target)
{
if (target == null || Deleted || !Alive || m_NextUndress > DateTime.UtcNow || 0.005 < Utility.RandomDouble())
if (target == null || Deleted || !Alive || m_NextUndress > DateTime.UtcNow || Utility.RandomDouble() > 0.005)
return;
if (target.Player && target.Female && !target.Hidden && CanBeHarmful(target))
@ -206,15 +196,11 @@ namespace Server.Mobiles
m.PlaceInBackpack(item);
}
#endregion
#region Provoke
private DateTime m_NextProvoke;
public void Provoke(Mobile target)
{
if (target == null || Deleted || !Alive || m_NextProvoke > DateTime.UtcNow || 0.05 < Utility.RandomDouble())
if (target == null || Deleted || !Alive || m_NextProvoke > DateTime.UtcNow || Utility.RandomDouble() > 0.05)
return;
foreach (Mobile m in GetMobilesInRange(RangePerception))
@ -235,7 +221,5 @@ namespace Server.Mobiles
m_NextProvoke = DateTime.UtcNow + TimeSpan.FromSeconds(10);
}
#endregion
}
}

View file

@ -29,8 +29,8 @@ namespace Server.Mobiles
SetSkill(SkillName.Tactics, 65.1, 90.0); // Unknown
SetSkill(SkillName.Wrestling, 65.1, 85.0); // Unknown
Fame = 12500; //Unknown
Karma = 12500; //Unknown
Fame = 12500; // Unknown
Karma = 12500; // Unknown
VirtualArmor = 24;
PackItem(new Log(Utility.RandomMinMax(23, 34)));
@ -58,7 +58,7 @@ namespace Server.Mobiles
public override void GenerateLoot()
{
AddLoot(LootPack.Average); //Unknown
AddLoot(LootPack.Average); // Unknown
}
public override void Serialize(IGenericWriter writer)

View file

@ -25,10 +25,10 @@ namespace Server.Mobiles
SetResistance(ResistanceType.Poison, 30, 40);
SetResistance(ResistanceType.Energy, 30, 40);
//SetSkill( SkillName.Meditation, Unknown );
//SetSkill( SkillName.EvalInt, Unknown );
//SetSkill( SkillName.Magery, Unknown );
//SetSkill( SkillName.Poisoning, Unknown );
// SetSkill( SkillName.Meditation, Unknown );
// SetSkill( SkillName.EvalInt, Unknown );
// SetSkill( SkillName.Magery, Unknown );
// SetSkill( SkillName.Poisoning, Unknown );
SetSkill(SkillName.Anatomy, 0);
SetSkill(SkillName.MagicResist, 60.6, 67.5);
SetSkill(SkillName.Tactics, 86.9, 103.6);

View file

@ -29,7 +29,6 @@ namespace Server.Mobiles
SetSkill(SkillName.Tactics, 100.7, 102.8);
SetSkill(SkillName.MagicResist, 104.3, 116.3);
Fame = 20000;
Karma = -20000;
}

View file

@ -45,7 +45,7 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.025 )
if (Utility.RandomDouble() < 0.025)
{
switch ( Utility.Random( 16 ) )
{
@ -107,4 +107,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -39,7 +39,7 @@ namespace Server.Mobiles
MinTameSkill = 23.1;
}
//TODO: Damage weapon via acid
// TODO: Damage weapon via acid
public CorrosiveSlime(Serial serial) : base(serial)
{

View file

@ -55,7 +55,6 @@ namespace Server.Mobiles
AddLoot(LootPack.FilthyRich, 2);
}
public override void OnDeath(Container c)
{
base.OnDeath(c);

View file

@ -60,7 +60,7 @@ namespace Server.Mobiles
c.DropItem( new SpleenOfThePutrefier() );
if ( Utility.RandomDouble() < 0.6 )
if (Utility.RandomDouble() < 0.6)
c.DropItem( new ParrotItem() );
}
*/
@ -88,4 +88,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -47,7 +47,7 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.4 )
if (Utility.RandomDouble() < 0.4)
c.DropItem( new ScatteredCrystals() );
}
*/
@ -79,4 +79,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -53,10 +53,10 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.75 )
if (Utility.RandomDouble() < 0.75)
c.DropItem( new CrystallineFragments() );
if ( Utility.RandomDouble() < 0.07 )
if (Utility.RandomDouble() < 0.07)
c.DropItem( new PiecesOfCrystal() );
}
*/
@ -68,7 +68,7 @@ namespace Server.Mobiles
{
AddLoot(LootPack.FilthyRich, 4);
// TODO: uncomment once added
//AddLoot( LootPack.Parrot );
// AddLoot( LootPack.Parrot );
AddLoot(LootPack.Gems);
}
@ -95,35 +95,35 @@ namespace Server.Mobiles
switch (Utility.Random(3))
{
case 0:
{
Say(1042156); // I can grant life, and I can sap it as easily.
PlaySound(0x1E6);
{
Say(1042156); // I can grant life, and I can sap it as easily.
PlaySound(0x1E6);
toDrain = Utility.RandomMinMax(3, 6);
Hits += toDrain;
m.Hits -= toDrain;
break;
}
toDrain = Utility.RandomMinMax(3, 6);
Hits += toDrain;
m.Hits -= toDrain;
break;
}
case 1:
{
Say(1042157); // You'll go nowhere, unless I deem it should be so.
PlaySound(0x1DF);
{
Say(1042157); // You'll go nowhere, unless I deem it should be so.
PlaySound(0x1DF);
toDrain = Utility.RandomMinMax(10, 25);
Stam += toDrain;
m.Stam -= toDrain;
break;
}
toDrain = Utility.RandomMinMax(10, 25);
Stam += toDrain;
m.Stam -= toDrain;
break;
}
case 2:
{
Say(1042155); // Your power is mine to use as I will.
PlaySound(0x1F8);
{
Say(1042155); // Your power is mine to use as I will.
PlaySound(0x1F8);
toDrain = Utility.RandomMinMax(15, 25);
Mana += toDrain;
m.Mana -= toDrain;
break;
}
toDrain = Utility.RandomMinMax(15, 25);
Mana += toDrain;
m.Mana -= toDrain;
break;
}
}
}
@ -151,4 +151,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -32,13 +32,13 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.05 )
if (Utility.RandomDouble() < 0.05)
c.DropItem( new CrushedCrystals() );
if ( Utility.RandomDouble() < 0.1 )
if (Utility.RandomDouble() < 0.1)
c.DropItem( new IcyHeart() );
if ( Utility.RandomDouble() < 0.1 )
if (Utility.RandomDouble() < 0.1)
c.DropItem( new LuckyDagger() );
}
*/
@ -65,4 +65,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -51,7 +51,7 @@ namespace Server.Mobiles
{
AddLoot(LootPack.FilthyRich, 2);
// TODO: uncomment once added
//AddLoot( LootPack.Parrot );
// AddLoot( LootPack.Parrot );
}
/*
@ -60,10 +60,10 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.75 )
if (Utility.RandomDouble() < 0.75)
c.DropItem( new CrystallineFragments() );
if ( Utility.RandomDouble() < 0.06 )
if (Utility.RandomDouble() < 0.06)
c.DropItem( new JaggedCrystals() );
}
*/
@ -86,4 +86,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -85,7 +85,7 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.4 )
if (Utility.RandomDouble() < 0.4)
c.DropItem( new ProtectorsEssence() );
}
*/
@ -104,4 +104,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -47,10 +47,10 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.6 )
if (Utility.RandomDouble() < 0.6)
c.DropItem( new BrokenCrystals() );
if ( Utility.RandomDouble() < 0.1 )
if (Utility.RandomDouble() < 0.1)
c.DropItem( new ParrotItem() );
}
*/
@ -67,7 +67,7 @@ namespace Server.Mobiles
{
AddLoot(LootPack.UltraRich, 2);
// TODO: uncomment once added
//AddLoot( LootPack.Parrot );
// AddLoot( LootPack.Parrot );
}
public override void Serialize(IGenericWriter writer)
@ -84,4 +84,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -9,7 +9,7 @@ namespace Server.Mobiles
{
public class Ilhenir : BaseChampion
{
private static HashSet<Mobile> m_Table = new HashSet<Mobile>();
private static readonly HashSet<Mobile> m_Table = new HashSet<Mobile>();
[Constructible]
public Ilhenir()
@ -92,7 +92,7 @@ namespace Server.Mobiles
public override Poison PoisonImmune => Poison.Lethal;
//public override bool GivesMLMinorArtifact => true; // TODO: Needs verification
// public override bool GivesMLMinorArtifact => true; // TODO: Needs verification
public override int TreasureMapLevel => 5;
public virtual void PackResources(int amount)
@ -149,7 +149,7 @@ namespace Server.Mobiles
c.DropItem(new GrizzledBones());
// TODO: Parrots
/*if ( Utility.RandomDouble() < 0.6 )
/*if (Utility.RandomDouble() < 0.6)
c.DropItem( new ParrotItem() ); */
if (Utility.RandomDouble() < 0.05)
@ -159,7 +159,7 @@ namespace Server.Mobiles
c.DropItem(new CrimsonCincture());
// TODO: Armor sets
/*if ( Utility.RandomDouble() < 0.05 )
/*if (Utility.RandomDouble() < 0.05)
{
switch ( Utility.Random(5) )
{
@ -303,7 +303,7 @@ namespace Server.Mobiles
}
[CommandProperty(AccessLevel.GameMaster)]
public bool Corrosive{ get; set; }
public bool Corrosive { get; set; }
public override void OnAfterDelete()
{

View file

@ -31,10 +31,10 @@ namespace Server.Mobiles
SetResistance(ResistanceType.Poison, 40, 60);
SetResistance(ResistanceType.Energy, 50, 55);
//SetSkill( SkillName.Meditation, Unknown );
//SetSkill( SkillName.EvalInt, Unknown );
//SetSkill( SkillName.Magery, Unknown );
//SetSkill( SkillName.Poisoning, Unknown );
// SetSkill( SkillName.Meditation, Unknown );
// SetSkill( SkillName.EvalInt, Unknown );
// SetSkill( SkillName.Magery, Unknown );
// SetSkill( SkillName.Poisoning, Unknown );
SetSkill(SkillName.Anatomy, 0);
SetSkill(SkillName.MagicResist, 107.0, 111.3);
SetSkill(SkillName.Tactics, 107.0, 117.0);
@ -169,7 +169,7 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack(defender);
if (0.2 >= Utility.RandomDouble())
if (Utility.RandomDouble() <= 0.2)
Earthquake();
}
@ -179,8 +179,8 @@ namespace Server.Mobiles
foreach (Mobile m in eable)
{
if (m == this || !CanBeHarmful(m) || m.Deleted || !m.Player &&
!(m is BaseCreature creature && (creature.Controlled || creature.Summoned || creature.Team != Team)))
if (m == this || !CanBeHarmful(m) || m.Deleted || (!m.Player &&
!(m is BaseCreature creature && (creature.Controlled || creature.Summoned || creature.Team != Team))))
continue;
if (m is PlayerMobile pm && pm.Mounted)
@ -212,8 +212,6 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
#region SpawnHelpers
public void SpawnTormented()
{
BaseCreature spawna = new TormentedMinotaur();
@ -228,7 +226,5 @@ namespace Server.Mobiles
BaseCreature spawnd = new TormentedMinotaur();
spawnd.MoveToWorld(Location, Map);
}
#endregion
}
}

View file

@ -101,7 +101,7 @@ namespace Server.Mobiles
public override void AlterDamageScalarFrom(Mobile caster, ref double scalar)
{
if (0.1 >= Utility.RandomDouble())
if (Utility.RandomDouble() <= 0.1)
SpawnPixies(caster);
}
@ -118,7 +118,7 @@ namespace Server.Mobiles
{
base.OnGotMeleeAttack(attacker);
if (0.1 >= Utility.RandomDouble())
if (Utility.RandomDouble() <= 0.1)
SpawnPixies(attacker);
}

View file

@ -41,7 +41,7 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.3 )
if (Utility.RandomDouble() < 0.3)
c.DropItem( new GnawsFang() );
}
*/
@ -77,4 +77,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -42,10 +42,10 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.25 )
if (Utility.RandomDouble() < 0.25)
c.DropItem( new IrksBrain() );
if ( Utility.RandomDouble() < 0.025 )
if (Utility.RandomDouble() < 0.025)
c.DropItem( new PaladinGloves() );
}
*/
@ -82,4 +82,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -52,13 +52,13 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.025 )
if (Utility.RandomDouble() < 0.025)
c.DropItem( new GreymistChest() );
if ( Utility.RandomDouble() < 0.45 )
if (Utility.RandomDouble() < 0.45)
c.DropItem( new LissithsSilk() );
if ( Utility.RandomDouble() < 0.1 )
if (Utility.RandomDouble() < 0.1)
c.DropItem( new ParrotItem() );
}
*/
@ -86,4 +86,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -52,10 +52,10 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.2 )
if (Utility.RandomDouble() < 0.2)
c.DropItem( new SabrixsEye() );
if ( Utility.RandomDouble() < 0.25 )
if (Utility.RandomDouble() < 0.25)
{
switch ( Utility.Random( 2 ) )
{
@ -64,7 +64,7 @@ namespace Server.Mobiles
}
}
if ( Utility.RandomDouble() < 0.1 )
if (Utility.RandomDouble() < 0.1)
c.DropItem( new ParrotItem() );
}
*/
@ -92,4 +92,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -41,7 +41,7 @@ namespace Server.Mobiles
/*
// TODO: uncomment once added
if ( Utility.RandomDouble() < 0.1 )
if (Utility.RandomDouble() < 0.1)
PackItem( new ParrotItem() );
*/
}
@ -77,4 +77,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

View file

@ -5,7 +5,7 @@ namespace Server.Mobiles
{
public class Swoop : Eagle
{
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
[Constructible]
public Swoop()
@ -48,13 +48,13 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.025 )
if (Utility.RandomDouble() < 0.025)
{
switch ( Utility.Random( 18 ) )
{
case 0: c.DropItem( new AssassinChest() ); break;
case 1: c.DropItem( new AssassinArms() ); break;
case 2: c.DropItem( new DeathChest() ); break;
case 2: c.DropItem( new DeathChest() ); break;
case 3: c.DropItem( new MyrmidonArms() ); break;
case 4: c.DropItem( new MyrmidonLegs() ); break;
case 5: c.DropItem( new MyrmidonGorget() ); break;
@ -73,7 +73,7 @@ namespace Server.Mobiles
}
}
if ( Utility.RandomDouble() < 0.1 )
if (Utility.RandomDouble() < 0.1)
c.DropItem( new ParrotItem() );
}
*/
@ -100,7 +100,7 @@ namespace Server.Mobiles
{
base.OnGaveMeleeAttack(defender);
if (0.1 <= Utility.RandomDouble())
if (Utility.RandomDouble() >= 0.1)
return;
if (m_Table.TryGetValue(defender, out ExpireTimer timer))
@ -142,8 +142,8 @@ namespace Server.Mobiles
private class ExpireTimer : Timer
{
private Mobile m_Mobile;
private ResistanceMod m_Mod;
private readonly Mobile m_Mobile;
private readonly ResistanceMod m_Mod;
public ExpireTimer(Mobile m, ResistanceMod mod, TimeSpan delay)
: base(delay)

View file

@ -54,7 +54,7 @@ namespace Server.Mobiles
{
base.OnDeath( c );
if ( Utility.RandomDouble() < 0.025 )
if (Utility.RandomDouble() < 0.025)
{
switch ( Utility.Random( 2 ) )
{
@ -63,7 +63,7 @@ namespace Server.Mobiles
}
}
if ( Utility.RandomDouble() < 0.1 )
if (Utility.RandomDouble() < 0.1)
c.DropItem( new ParrotItem() );
}
*/
@ -91,4 +91,4 @@ namespace Server.Mobiles
int version = reader.ReadInt();
}
}
}
}

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))
{

View file

@ -5,8 +5,7 @@ namespace Server.Mobiles
public class BronzeElemental : BaseCreature
{
[Constructible]
public BronzeElemental(int oreAmount = 2) :
base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
public BronzeElemental(int oreAmount = 2) : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
{
// TODO: Gas attack
Body = 108;

View file

@ -5,8 +5,7 @@ namespace Server.Mobiles
public class DullCopperElemental : BaseCreature
{
[Constructible]
public DullCopperElemental(int oreAmount = 2) :
base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
public DullCopperElemental(int oreAmount = 2) : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
{
Body = 110;
BaseSoundID = 268;

View file

@ -5,8 +5,7 @@ namespace Server.Mobiles
public class GoldenElemental : BaseCreature
{
[Constructible]
public GoldenElemental(int oreAmount = 2) :
base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
public GoldenElemental(int oreAmount = 2) : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
{
Body = 166;
BaseSoundID = 268;

View file

@ -37,7 +37,7 @@ namespace Server.Mobiles
VirtualArmor = 28;
if (0.25 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.25)
PackItem(new Board(10));
else
PackItem(new Log(10));
@ -116,10 +116,10 @@ namespace Server.Mobiles
if (Hits > HitsMax / 4)
{
if (0.25 >= Utility.RandomDouble())
if (Utility.RandomDouble() <= 0.25)
SpawnBogling(attacker);
}
else if (0.25 >= Utility.RandomDouble())
else if (Utility.RandomDouble() <= 0.25)
EatBoglings();
}
}

View file

@ -36,7 +36,7 @@ namespace Server.Mobiles
VirtualArmor = 18;
if (0.25 > Utility.RandomDouble())
if (Utility.RandomDouble() < 0.25)
PackItem(new Board(10));
else
PackItem(new Log(10));

View file

@ -40,7 +40,7 @@ namespace Server.Mobiles
PackReg(3);
PackItem(new FertileDirt(Utility.RandomMinMax(1, 10)));
if (0.2 >= Utility.RandomDouble())
if (Utility.RandomDouble() <= 0.2)
PackItem(new ExecutionersCap());
PackItem(new Vines());

Some files were not shown because too many files have changed in this diff Show more