Formatting #2 (#59)

This commit is contained in:
Kamron Batman 2019-10-05 00:37:03 -07:00 committed by GitHub
parent 096d39609e
commit 8e9221bb5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
400 changed files with 3688 additions and 5969 deletions

View file

@ -252,8 +252,6 @@ namespace Server.Spells
public static void ClearCurrentMove(Mobile m)
{
;
if (Table.TryGetValue(m, out SpecialMove move))
{
move.OnClearMove(m);

View file

@ -403,11 +403,11 @@ namespace Server.Spells
if (!Caster.CheckAlive()) return false;
if (Scroll is BaseWand && Caster.Spell != null && Caster.Spell.IsCasting)
if (Scroll is BaseWand && Caster.Spell?.IsCasting == true)
{
Caster.SendLocalizedMessage(502643); // You can not cast a spell while frozen.
}
else if (Caster.Spell != null && Caster.Spell.IsCasting)
else if (Caster.Spell?.IsCasting == true)
{
Caster.SendLocalizedMessage(502642); // You are already casting a spell.
}
@ -432,8 +432,7 @@ namespace Server.Spells
#region Dueling
else if ((Caster as PlayerMobile)?.DuelContext != null &&
!((PlayerMobile)Caster).DuelContext.AllowSpellCast(Caster, this))
else if ((Caster as PlayerMobile)?.DuelContext?.AllowSpellCast(Caster, this) == false)
{
}

View file

@ -106,37 +106,37 @@ namespace Server.Spells
private static bool[,] m_Rules =
{
/*T2A(Fel), Khaldun, Ilshenar, Wind(Tram), Wind(Fel), Dungeons(Fel), Solen(Tram), Solen(Fel), CrystalCave(Malas), Gauntlet(Malas), Gauntlet(Ferry), SafeZone, Stronghold, ChampionSpawn, Dungeons(Tokuno[Malas]), LampRoom(Doom), GuardianRoom(Doom), Heartwood, MLDungeons */
/* Recall From */
/* Recall From */
{
false, false, true, true, false, false, true, false, false, false, false, true, true, false, true, false,
false, false, false
},
/* Recall To */
/* Recall To */
{
false, false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false
},
/* Gate From */
/* Gate From */
{
false, false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false
},
/* Gate To */
/* Gate To */
{
false, false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false
},
/* Mark In */
/* Mark In */
{
false, false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false
},
/* Tele From */
/* Tele From */
{
true, true, true, true, true, true, true, true, false, true, true, true, false, true, true, true, true,
false, true
},
/* Tele To */
/* Tele To */
{
true, true, true, true, true, true, true, true, false, true, false, false, false, true, true, true, true,
false, false
@ -686,9 +686,8 @@ namespace Server.Spells
if (Region.Find(loc, map).IsPartOf<SafeZone>() &&
(m_TravelType == TravelCheckType.TeleportTo || m_TravelType == TravelCheckType.TeleportFrom)
&& (m_TravelCaster as PlayerMobile)?.DuelPlayer?.Eliminated == false)
{
return true;
}
#endregion
return false;

View file

@ -67,7 +67,7 @@ namespace Server.Spells.Bushido
if (Core.ML)
{
if (defender.Spell != null && defender.Spell.IsCasting) return false;
if (defender.Spell?.IsCasting == true) return false;
if (weap != null)
{

View file

@ -38,7 +38,7 @@ namespace Server.Spells.Eighth
}
IEnumerable<Mobile> targets = Caster.GetMobilesInRange(1 + (int)(Caster.Skills.Magery.Value / 15.0))
.Where(m => Caster != m && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false) && (!Core.AOS || Caster.InLOS(m)));
.Where(m => Caster != m && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false) && (!Core.AOS || Caster.InLOS(m)));
foreach (Mobile m in targets)
{

View file

@ -47,7 +47,7 @@ namespace Server.Spells.Eighth
SpellHelper.GetSurfaceTop(ref p);
if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
if (map?.CanSpawnMobile(p.X, p.Y, p.Z) != true)
{
Caster.SendLocalizedMessage(501942); // That location is blocked.
}

View file

@ -54,7 +54,7 @@ namespace Server.Spells.Eighth
Caster.SendLocalizedMessage(501042); // Target is not close enough.
else if (!m.Player)
Caster.SendLocalizedMessage(501043); // Target is not a being.
else if (m.Map == null || !m.Map.CanFit(m.Location, 16, false, false))
else if (m.Map?.CanFit(m.Location, 16, false, false) != true)
{
Caster.SendLocalizedMessage(501042); // Target can not be resurrected at that location.
m.SendLocalizedMessage(502391); // Thou can not be resurrected there!

View file

@ -54,7 +54,7 @@ namespace Server.Spells.Fifth
SpellHelper.GetSurfaceTop(ref p);
if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
if (map?.CanSpawnMobile(p.X, p.Y, p.Z) != true)
{
Caster.SendLocalizedMessage(501942); // That location is blocked.
}

View file

@ -35,7 +35,7 @@ namespace Server.Spells.Fifth
if (!Caster.CanSee(m))
Caster.SendLocalizedMessage(500237); // Target can not be seen.
else if (Core.AOS && (m.Frozen || m.Paralyzed ||
m.Spell != null && m.Spell.IsCasting && !(m.Spell is PaladinSpell)))
m.Spell?.IsCasting == true && !(m.Spell is PaladinSpell)))
{
Caster.SendLocalizedMessage(1061923); // The target is already frozen.
}

View file

@ -46,7 +46,7 @@ namespace Server.Spells.First
Caster.AddToBackpack(food);
// You magically create food in your backpack:
Caster.SendLocalizedMessage(1042695, true, " " + foodInfo.Name);
Caster.SendLocalizedMessage(1042695, true, $" {foodInfo.Name}");
Caster.FixedParticles(0, 10, 5, 2003, EffectLayer.RightHand);
Caster.PlaySound(0x1E2);

View file

@ -61,20 +61,17 @@ namespace Server.Spells.Fourth
Party party = Party.Get(Caster);
foreach (Mobile m in targets)
{
if (m == Caster || party?.Contains(m) == true)
{
Caster.DoBeneficial(m);
ProtectionSpell.Toggle(Caster, m);
}
}
}
else
{
int val = (int)(Caster.Skills.Magery.Value / 10.0 + 1);
foreach (Mobile m in targets)
{
if (m.BeginAction<ArchProtectionSpell>())
{
Caster.DoBeneficial(m);
@ -86,7 +83,6 @@ namespace Server.Spells.Fourth
m.FixedParticles(0x375A, 9, 20, 5027, EffectLayer.Waist);
m.PlaySound(0x1F7);
}
}
}
}

View file

@ -99,11 +99,8 @@ namespace Server.Spells.Necromancy
IEnumerable<Mobile> targets = r.ChampionSpawn.GetMobilesInRange(Range).Where(IsValidTarget);
foreach (Mobile m in targets)
{
//Surprisingly, no sparkle type effects
m.Location = GetNearestShrine(m);
}
}
}

View file

@ -76,7 +76,7 @@ namespace Server.Spells.Ninjitsu
!SpellHelper.CheckTravel(Caster, map, to, TravelCheckType.TeleportTo))
{
}
else if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
else if (map?.CanSpawnMobile(p.X, p.Y, p.Z) != true)
{
Caster.SendLocalizedMessage(502831); // Cannot teleport to that spot.
}

View file

@ -52,7 +52,7 @@ namespace Server.Spells.Spellweaving
{
MLQuestContext context = MLQuestSystem.GetContext(mobile);
if (context == null || !context.Spellweaving)
if (context?.Spellweaving != true)
{
mobile.SendLocalizedMessage(
1073220); // You must have completed the epic arcanist quest to use this ability.

View file

@ -136,7 +136,7 @@ namespace Server.Spells.Spellweaving
{
Mobile m = e.Mobile;
if (m == null || m.Alive || m_Table[m] == null)
if (m?.Alive != false || m_Table[m] == null)
return;
HandleDeath_OnCallback(m);

View file

@ -32,7 +32,7 @@ namespace Server.Spells.Spellweaving
{
MLQuestContext context = MLQuestSystem.GetContext(mobile);
if (context == null || !context.SummonFey)
if (context?.SummonFey != true)
{
mobile.SendLocalizedMessage(
1074563); // You haven't forged a friendship with the fey and are unable to summon their aid.

View file

@ -32,7 +32,7 @@ namespace Server.Spells.Spellweaving
{
MLQuestContext context = MLQuestSystem.GetContext(mobile);
if (context == null || !context.SummonFiend)
if (context?.SummonFiend != true)
{
mobile.SendLocalizedMessage(1074564); // You haven't demonstrated mastery to summon a fiend.
return false;

View file

@ -78,11 +78,8 @@ namespace Server.Spells.Third
if (Caster is PlayerMobile pm)
{
if (pm.DuelContext == null || !pm.DuelContext.Started || pm.DuelContext.Finished ||
pm.DuelContext.Ruleset.GetOption("Skills", "Poisoning"))
{
if (pm.DuelContext?.Started != true || pm.DuelContext.Finished || pm.DuelContext.Ruleset.GetOption("Skills", "Poisoning"))
total += pm.Skills.Poisoning.Value;
}
}
else
{

View file

@ -71,7 +71,7 @@ namespace Server.Spells.Third
else if (!SpellHelper.CheckTravel(Caster, map, to, TravelCheckType.TeleportTo))
{
}
else if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
else if (map?.CanSpawnMobile(p.X, p.Y, p.Z) != true)
{
Caster.SendLocalizedMessage(501942); // That location is blocked.
}