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

@ -7,14 +7,14 @@ namespace Server.Spells
{
private const double ChanceOffset = 20.0, ChanceLength = 100.0 / 7.0;
private static int[] m_ManaTable = { 4, 6, 9, 11, 14, 20, 40, 50 };
private static readonly int[] m_ManaTable = { 4, 6, 9, 11, 14, 20, 40, 50 };
public MagerySpell(Mobile caster, Item scroll, SpellInfo info)
: base(caster, scroll, info)
{
}
public abstract SpellCircle Circle{ get; }
public abstract SpellCircle Circle { get; }
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds((3 + (int)Circle) * CastDelaySecondsPerTick);

View file

@ -11,7 +11,7 @@ namespace Server.Spells
{
public abstract class SpecialMove
{
private static Dictionary<Mobile, SpecialMoveContext> m_PlayersTable = new Dictionary<Mobile, SpecialMoveContext>();
private static readonly Dictionary<Mobile, SpecialMoveContext> m_PlayersTable = new Dictionary<Mobile, SpecialMoveContext>();
public virtual int BaseMana => 0;
@ -23,7 +23,7 @@ namespace Server.Spells
public virtual bool BlockedByAnimalForm => true;
public virtual bool DelayedContext => false;
public static Dictionary<Mobile, SpecialMove> Table{ get; } = new Dictionary<Mobile, SpecialMove>();
public static Dictionary<Mobile, SpecialMove> Table { get; } = new Dictionary<Mobile, SpecialMove>();
public virtual bool ValidatesDuringHit => true;
@ -145,8 +145,6 @@ namespace Server.Spells
return false;
}
#region Dueling
string option = null;
if (this is Backstab)
@ -169,8 +167,6 @@ namespace Server.Spells
if (option != null && !DuelContext.AllowSpecialMove(from, option, this))
return false;
#endregion
return CheckSkills(from) && CheckMana(from, false);
}
@ -286,7 +282,7 @@ namespace Server.Spells
private class SpecialMoveTimer : Timer
{
private Mobile m_Mobile;
private readonly Mobile m_Mobile;
public SpecialMoveTimer(Mobile from) : base(TimeSpan.FromSeconds(3.0))
{
@ -309,9 +305,9 @@ namespace Server.Spells
Type = type;
}
public Timer Timer{ get; }
public Timer Timer { get; }
public Type Type{ get; }
public Type Type { get; }
}
}
}

View file

@ -16,15 +16,15 @@ namespace Server.Spells
{
public abstract class Spell : ISpell
{
private static TimeSpan NextSpellDelay = TimeSpan.FromSeconds(0.75);
private static readonly TimeSpan NextSpellDelay = TimeSpan.FromSeconds(0.75);
private static TimeSpan AnimateDelay = TimeSpan.FromSeconds(1.5);
//In reality, it's ANY delayed Damage spell Post-AoS that can't stack, but, only
//Expo & Magic Arrow have enough delay and a short enough cast time to bring up
//the possibility of stacking 'em. Note that a MA & an Explosion will stack, but
//of course, two MA's won't.
private static readonly TimeSpan AnimateDelay = TimeSpan.FromSeconds(1.5);
// In reality, it's ANY delayed Damage spell Post-AoS that can't stack, but, only
// Expo & Magic Arrow have enough delay and a short enough cast time to bring up
// the possibility of stacking 'em. Note that a MA & an Explosion will stack, but
// of course, two MA's won't.
private static Dictionary<Type, DelayedDamageContextWrapper> m_ContextTable =
private static readonly Dictionary<Type, DelayedDamageContextWrapper> m_ContextTable =
new Dictionary<Type, DelayedDamageContextWrapper>();
private AnimTimer m_AnimTimer;
@ -38,18 +38,18 @@ namespace Server.Spells
Info = info;
}
public SpellState State{ get; set; }
public SpellState State { get; set; }
public Mobile Caster{ get; }
public Mobile Caster { get; }
public SpellInfo Info{ get; }
public SpellInfo Info { get; }
public string Name => Info.Name;
public string Mantra => Info.Mantra;
public Type[] Reagents => Info.Reagents;
public Item Scroll{ get; }
public Item Scroll { get; }
public long StartCastTime{ get; private set; }
public long StartCastTime { get; private set; }
public virtual SkillName CastSkill => SkillName.Magery;
public virtual SkillName DamageSkill => SkillName.EvalInt;
@ -73,7 +73,7 @@ namespace Server.Spells
public virtual int CastRecoveryPerSecond => 4;
public virtual int CastRecoveryMinimum => 0;
public abstract TimeSpan CastDelayBase{ get; }
public abstract TimeSpan CastDelayBase { get; }
public virtual double CastDelayFastScalar => 1;
public virtual double CastDelaySecondsPerTick => 0.25;
@ -83,7 +83,7 @@ namespace Server.Spells
public virtual void OnCasterHurt()
{
//Confirm: Monsters and pets cannot be disturbed.
// Confirm: Monsters and pets cannot be disturbed.
if (Caster.Player && IsCasting && ProtectionSpell.Registry.TryGetValue(Caster, out double d) &&
d <= Utility.RandomDouble() * 100.0)
Disturb(DisturbType.Hurt, false, true);
@ -131,7 +131,7 @@ namespace Server.Spells
public void StartDelayedDamageContext(Mobile m, Timer t)
{
if (DelayedDamageStacking)
return; //Sanity
return; // Sanity
if (!m_ContextTable.TryGetValue(GetType(), out DelayedDamageContextWrapper contexts))
m_ContextTable[GetType()] = contexts = new DelayedDamageContextWrapper();
@ -233,17 +233,17 @@ namespace Server.Spells
{
double scalar = 1.0;
if (!Core.AOS) //EvalInt stuff for AoS is handled elsewhere
if (!Core.AOS) // EvalInt stuff for AoS is handled elsewhere
{
double casterEI = Caster.Skills[DamageSkill].Value;
double targetRS = target.Skills.MagicResist.Value;
/*
if ( Core.AOS )
if (Core.AOS)
targetRS = 0;
*/
//m_Caster.CheckSkill( DamageSkill, 0.0, 120.0 );
// m_Caster.CheckSkill( DamageSkill, 0.0, 120.0 );
if (casterEI > targetRS)
scalar = 1.0 + (casterEI - targetRS) / 500.0;
@ -266,7 +266,7 @@ namespace Server.Spells
target.Region.SpellDamageScalar(Caster, target, ref scalar);
if (Evasion.CheckSpellEvasion(target)) //Only single target spells an be evaded
if (Evasion.CheckSpellEvasion(target)) // Only single target spells an be evaded
scalar = 0;
return scalar;
@ -284,7 +284,7 @@ namespace Server.Spells
if (atkSlayer?.Slays(defender) == true || atkSlayer2?.Slays(defender) == true)
{
defender.FixedEffect(0x37B9, 10, 5); //TODO: Confirm this displays on OSIs
defender.FixedEffect(0x37B9, 10, 5); // TODO: Confirm this displays on OSIs
scalar = 2.0;
}
@ -411,9 +411,9 @@ namespace Server.Spells
{
Caster.SendLocalizedMessage(502642); // You are already casting a spell.
}
else if (BlockedByHorrificBeast &&
TransformationSpellHelper.UnderTransformation(Caster, typeof(HorrificBeastSpell)) ||
BlockedByAnimalForm && AnimalForm.UnderTransformation(Caster))
else if ((BlockedByHorrificBeast &&
TransformationSpellHelper.UnderTransformation(Caster, typeof(HorrificBeastSpell))) ||
(BlockedByAnimalForm && AnimalForm.UnderTransformation(Caster)))
{
Caster.SendLocalizedMessage(1061091); // You cannot cast that spell in this form.
}
@ -429,15 +429,9 @@ namespace Server.Spells
{
mobile.SendLocalizedMessage(1072060); // You cannot cast a spell while calmed.
}
#region Dueling
else if ((Caster as PlayerMobile)?.DuelContext?.AllowSpellCast(Caster, this) == false)
{
}
#endregion
else if (Caster.Mana >= ScaleMana(GetMana()))
{
if (Caster.Spell == null && Caster.CheckSpellCast(this) && CheckCast() &&
@ -453,7 +447,7 @@ namespace Server.Spells
TimeSpan castDelay = GetCastDelay();
if (ShowHandMovement && (Caster.Body.IsHuman || Caster.Player && Caster.Body.IsMonster))
if (ShowHandMovement && (Caster.Body.IsHuman || (Caster.Player && Caster.Body.IsMonster)))
{
int count = (int)Math.Ceiling(castDelay.TotalSeconds / AnimateDelay.TotalSeconds);
@ -477,7 +471,7 @@ namespace Server.Spells
WeaponAbility.ClearCurrentAbility(Caster);
m_CastTimer = new CastTimer(this, castDelay);
//m_CastTimer.Start();
// m_CastTimer.Start();
OnBeginCast();
@ -507,7 +501,7 @@ namespace Server.Spells
public virtual void GetCastSkills(out double min, out double max)
{
min = max = 0; //Intended but not required for overriding.
min = max = 0; // Intended but not required for overriding.
}
public virtual bool CheckFizzle()
@ -574,10 +568,10 @@ namespace Server.Spells
return TimeSpan.FromSeconds((double)delay / CastRecoveryPerSecond);
}
//public virtual int CastDelayBase{ get{ return 3; } }
//public virtual int CastDelayFastScalar{ get{ return 1; } }
//public virtual int CastDelayPerSecond{ get{ return 4; } }
//public virtual int CastDelayMinimum{ get{ return 1; } }
// public virtual int CastDelayBase{ get{ return 3; } }
// public virtual int CastDelayFastScalar{ get{ return 1; } }
// public virtual int CastDelayPerSecond{ get{ return 4; } }
// public virtual int CastDelayMinimum{ get{ return 1; } }
public virtual TimeSpan GetCastDelay()
{
@ -591,7 +585,7 @@ namespace Server.Spells
int fcMax = 4;
if (CastSkill == SkillName.Magery || CastSkill == SkillName.Necromancy ||
CastSkill == SkillName.Chivalry && Caster.Skills.Magery.Value >= 70.0)
(CastSkill == SkillName.Chivalry && Caster.Skills.Magery.Value >= 70.0))
fcMax = 2;
int fc = AosAttributes.GetValue(Caster, AosAttribute.CastSpeed);
@ -609,13 +603,13 @@ namespace Server.Spells
TimeSpan fcDelay = TimeSpan.FromSeconds(-(CastDelayFastScalar * fc * CastDelaySecondsPerTick));
//int delay = CastDelayBase + circleDelay + fcDelay;
// int delay = CastDelayBase + circleDelay + fcDelay;
TimeSpan delay = baseDelay + fcDelay;
if (delay < CastDelayMinimum)
delay = CastDelayMinimum;
//return TimeSpan.FromSeconds( (double)delay / CastDelayPerSecond );
// return TimeSpan.FromSeconds( (double)delay / CastDelayPerSecond );
return delay;
}
@ -638,8 +632,8 @@ namespace Server.Spells
DoFizzle();
}
else if (Scroll != null && !(Scroll is Runebook) &&
(Scroll.Amount <= 0 || Scroll.Deleted || Scroll.RootParent != Caster || Scroll is BaseWand baseWand &&
(baseWand.Charges <= 0 || baseWand.Parent != Caster)))
(Scroll.Amount <= 0 || Scroll.Deleted || Scroll.RootParent != Caster || (Scroll is BaseWand baseWand &&
(baseWand.Charges <= 0 || baseWand.Parent != Caster))))
{
DoFizzle();
}
@ -759,7 +753,7 @@ namespace Server.Spells
private class DelayedDamageContextWrapper
{
private Dictionary<Mobile, Timer> m_Contexts = new Dictionary<Mobile, Timer>();
private readonly Dictionary<Mobile, Timer> m_Contexts = new Dictionary<Mobile, Timer>();
public void Add(Mobile m, Timer t)
{
@ -780,7 +774,7 @@ namespace Server.Spells
private class AnimTimer : Timer
{
private Spell m_Spell;
private readonly Spell m_Spell;
public AnimTimer(Spell spell, int count) : base(TimeSpan.Zero, AnimateDelay, count)
{
@ -812,7 +806,7 @@ namespace Server.Spells
private class CastTimer : Timer
{
private Spell m_Spell;
private readonly Spell m_Spell;
public CastTimer(Spell spell, TimeSpan castDelay) : base(castDelay)
{

View file

@ -28,7 +28,7 @@ namespace Server
private class InternalTimer : Timer
{
private Mobile m_Mobile;
private readonly Mobile m_Mobile;
public InternalTimer(Mobile m)
: base(TimeSpan.FromMinutes(1.0))
@ -61,13 +61,13 @@ namespace Server.Spells
public class SpellHelper
{
private static TimeSpan AosDamageDelay = TimeSpan.FromSeconds(1.0);
private static TimeSpan OldDamageDelay = TimeSpan.FromSeconds(0.5);
private static readonly TimeSpan AosDamageDelay = TimeSpan.FromSeconds(1.0);
private static readonly TimeSpan OldDamageDelay = TimeSpan.FromSeconds(0.5);
private static TimeSpan CombatHeatDelay = TimeSpan.FromSeconds(30.0);
private static bool RestrictTravelCombat = true;
private static readonly TimeSpan CombatHeatDelay = TimeSpan.FromSeconds(30.0);
private static readonly bool RestrictTravelCombat = true;
private static int[] m_Offsets =
private static readonly int[] m_Offsets =
{
-1, -1,
-1, 0,
@ -79,7 +79,7 @@ namespace Server.Spells
1, 1
};
private static TravelValidator[] m_Validators =
private static readonly TravelValidator[] m_Validators =
{
IsFeluccaT2A,
IsKhaldun,
@ -102,10 +102,10 @@ namespace Server.Spells
IsMLDungeon
};
// TODO: Find a better way
private static bool[,] m_Rules =
// TODO: Move to configuration
private static readonly 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 */
/* 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 */
{
false, false, true, true, false, false, true, false, false, false, false, true, true, false, true, false,
@ -146,7 +146,7 @@ namespace Server.Spells
private static Mobile m_TravelCaster;
private static TravelCheckType m_TravelType;
public static bool DisableSkillCheck{ get; set; }
public static bool DisableSkillCheck { get; set; }
public static TimeSpan GetDamageDelayForSpell(Spell sp)
{
@ -169,7 +169,7 @@ namespace Server.Spells
if (multi is BaseHouse bh)
{
if (houses && bh.IsInside(p, 16) || housingrange > 0 && bh.InRange(p, housingrange))
if ((houses && bh.IsInside(p, 16)) || (housingrange > 0 && bh.InRange(p, housingrange)))
return true;
}
else if (multi.Contains(p))
@ -405,8 +405,6 @@ namespace Server.Spells
BaseCreature bcFrom = from as BaseCreature;
BaseCreature bcTarg = to as BaseCreature;
#region Dueling
PlayerMobile pmFrom;
PlayerMobile pmTarg;
@ -424,8 +422,6 @@ namespace Server.Spells
pmFrom.DuelPlayer != null && pmTarg?.DuelPlayer != null)
return pmFrom.DuelPlayer.Participant != pmTarg.DuelPlayer.Participant;
#endregion
Guild fromGuild = GetGuildFor(from);
Guild toGuild = GetGuildFor(to);
@ -457,7 +453,7 @@ namespace Server.Spells
return false;
}
return bcTarg?.Controlled == false && bcTarg.InitialInnocent ||
return (bcTarg?.Controlled == false && bcTarg.InitialInnocent) ||
Notoriety.Compute(from, to) != Notoriety.Innocent || from.Kills >= 5;
}
@ -494,7 +490,6 @@ namespace Server.Spells
return;
}
/*
int offset = Utility.Random( 8 ) * 2;
@ -503,7 +498,7 @@ namespace Server.Spells
int x = caster.X + m_Offsets[(offset + i) % m_Offsets.Length];
int y = caster.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
if ( map.CanSpawnMobile( x, y, caster.Z ) )
if (map.CanSpawnMobile( x, y, caster.Z ))
{
BaseCreature.Summon( creature, caster, new Point3D( x, y, caster.Z ), sound, duration );
return;
@ -512,7 +507,7 @@ namespace Server.Spells
{
int z = map.GetAverageZ( x, y );
if ( map.CanSpawnMobile( x, y, z ) )
if (map.CanSpawnMobile( x, y, z ))
{
BaseCreature.Summon( creature, caster, new Point3D( x, y, z ), sound, duration );
return;
@ -527,12 +522,12 @@ namespace Server.Spells
public static bool FindValidSpawnLocation(Map map, ref Point3D p, bool surroundingsOnly)
{
if (map == null) //sanity
if (map == null) // sanity
return false;
if (!surroundingsOnly)
{
if (map.CanSpawnMobile(p)) //p's fine.
if (map.CanSpawnMobile(p)) // p's fine.
{
p = new Point3D(p);
return true;
@ -674,22 +669,19 @@ namespace Server.Spells
int x = loc.X, y = loc.Y;
return x >= 1182 && y >= 437 && x < 1211 && y < 470
|| x >= 1156 && y >= 470 && x < 1211 && y < 503
|| x >= 1176 && y >= 503 && x < 1208 && y < 509
|| x >= 1188 && y >= 509 && x < 1201 && y < 513;
return (x >= 1182 && y >= 437 && x < 1211 && y < 470)
|| (x >= 1156 && y >= 470 && x < 1211 && y < 503)
|| (x >= 1176 && y >= 503 && x < 1208 && y < 509)
|| (x >= 1188 && y >= 509 && x < 1201 && y < 513);
}
public static bool IsSafeZone(Map map, Point3D loc)
{
#region Duels
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;
}
@ -715,7 +707,7 @@ namespace Server.Spells
public static bool IsTokunoDungeon(Map map, Point3D loc)
{
//The tokuno dungeons are really inside malas
// The tokuno dungeons are really inside malas
if (map != Map.Malas)
return false;
@ -776,7 +768,7 @@ namespace Server.Spells
return x < 0 || y < 0 || x >= map.Width || y >= map.Height;
}
//towns
// towns
public static bool IsTown(IPoint3D ip, Mobile caster)
{
if (ip is Item item)
@ -792,13 +784,10 @@ namespace Server.Spells
if (map == null)
return false;
#region Dueling
if (Region.Find(loc, map).GetRegion<SafeZone>() != null)
if (caster is PlayerMobile pm && (pm.DuelContext?.Started != true || pm.DuelPlayer?.Eliminated != false))
return true;
#endregion
GuardedRegion reg = Region.Find(loc, map).GetRegion<GuardedRegion>();
return reg?.IsDisabled() == false;
@ -823,7 +812,7 @@ namespace Server.Spells
return true;
}
//magic reflection
// magic reflection
public static void CheckReflect(int circle, Mobile caster, ref Mobile target)
{
CheckReflect(circle, ref caster, ref target);
@ -994,7 +983,7 @@ namespace Server.Spells
public static void Heal(int amount, Mobile target, Mobile from, bool message = true)
{
//TODO: All Healing *spells* go through ArcaneEmpowerment
// TODO: All Healing *spells* go through ArcaneEmpowerment
target.Heal(amount, from, message);
}
@ -1003,8 +992,9 @@ namespace Server.Spells
private class SpellDamageTimer : Timer
{
private int m_Damage;
private Spell m_Spell;
private Mobile m_Target, m_From;
private readonly Spell m_Spell;
private readonly Mobile m_Target;
private readonly Mobile m_From;
public SpellDamageTimer(Spell s, Mobile target, Mobile from, int damage, TimeSpan delay)
: base(delay)
@ -1034,10 +1024,16 @@ namespace Server.Spells
private class SpellDamageTimerAOS : Timer
{
private int m_Damage;
private DFAlgorithm m_DFA;
private int m_Phys, m_Fire, m_Cold, m_Pois, m_Nrgy, m_Chaos;
private Spell m_Spell;
private Mobile m_Target, m_From;
private readonly DFAlgorithm m_DFA;
private readonly int m_Phys;
private readonly int m_Fire;
private readonly int m_Cold;
private readonly int m_Pois;
private readonly int m_Nrgy;
private readonly int m_Chaos;
private readonly Spell m_Spell;
private readonly Mobile m_Target;
private readonly Mobile m_From;
public SpellDamageTimerAOS(Spell s, TimeSpan delay, Mobile target, Mobile from, int damage, int phys, int fire, int cold,
int pois, int nrgy, int chaos, DFAlgorithm dfa)
@ -1138,7 +1134,7 @@ namespace Server.Spells
{
caster.SendLocalizedMessage(1061091); // You cannot cast that spell in this form.
}
else if (!caster.CanBeginAction<IncognitoSpell>() || caster.IsBodyMod && GetContext(caster) == null)
else if (!caster.CanBeginAction<IncognitoSpell>() || (caster.IsBodyMod && GetContext(caster) == null))
{
spell.DoFizzle();
}
@ -1207,9 +1203,7 @@ namespace Server.Spells
return false;
}
#region Context Stuff
private static Dictionary<Mobile, TransformContext> m_Table = new Dictionary<Mobile, TransformContext>();
private static readonly Dictionary<Mobile, TransformContext> m_Table = new Dictionary<Mobile, TransformContext>();
public static void AddContext(Mobile m, TransformContext context)
{
@ -1256,29 +1250,26 @@ namespace Server.Spells
public static bool UnderTransformation(Mobile m) => GetContext(m) != null;
public static bool UnderTransformation(Mobile m, Type type) => GetContext(m)?.Type == type;
#endregion
}
public interface ITransformationSpell
{
int Body{ get; }
int Hue{ get; }
int Body { get; }
int Hue { get; }
int PhysResistOffset{ get; }
int FireResistOffset{ get; }
int ColdResistOffset{ get; }
int PoisResistOffset{ get; }
int NrgyResistOffset{ get; }
int PhysResistOffset { get; }
int FireResistOffset { get; }
int ColdResistOffset { get; }
int PoisResistOffset { get; }
int NrgyResistOffset { get; }
double TickRate{ get; }
double TickRate { get; }
void OnTick(Mobile m);
void DoEffect(Mobile m);
void RemoveEffect(Mobile m);
}
public class TransformContext
{
public TransformContext(Timer timer, List<ResistanceMod> mods, Type type, ITransformationSpell spell)
@ -1289,19 +1280,19 @@ namespace Server.Spells
Spell = spell;
}
public Timer Timer{ get; }
public Timer Timer { get; }
public List<ResistanceMod> Mods{ get; }
public List<ResistanceMod> Mods { get; }
public Type Type{ get; }
public Type Type { get; }
public ITransformationSpell Spell{ get; }
public ITransformationSpell Spell { get; }
}
public class TransformTimer : Timer
{
private Mobile m_Mobile;
private ITransformationSpell m_Spell;
private readonly Mobile m_Mobile;
private readonly ITransformationSpell m_Spell;
public TransformTimer(Mobile from, ITransformationSpell spell)
: base(TimeSpan.FromSeconds(spell.TickRate), TimeSpan.FromSeconds(spell.TickRate))

View file

@ -51,20 +51,20 @@ namespace Server.Spells
Amounts[i] = 1;
}
public int Action{ get; set; }
public int Action { get; set; }
public bool AllowTown{ get; set; }
public bool AllowTown { get; set; }
public int[] Amounts{ get; set; }
public int[] Amounts { get; set; }
public string Mantra{ get; set; }
public string Mantra { get; set; }
public string Name{ get; set; }
public string Name { get; set; }
public Type[] Reagents{ get; set; }
public Type[] Reagents { get; set; }
public int LeftHandEffect{ get; set; }
public int LeftHandEffect { get; set; }
public int RightHandEffect{ get; set; }
public int RightHandEffect { get; set; }
}
}

View file

@ -1,19 +1,19 @@
using Server.Utilities;
using System;
using System.Collections.Generic;
using Server.Utilities;
namespace Server.Spells
{
public class SpellRegistry
{
private static Type[] m_Types = new Type[700];
private static readonly Type[] m_Types = new Type[700];
private static int m_Count;
private static Dictionary<Type, int> m_IDsFromTypes = new Dictionary<Type, int>(m_Types.Length);
private static readonly Dictionary<Type, int> m_IDsFromTypes = new Dictionary<Type, int>(m_Types.Length);
private static object[] m_Params = new object[2];
private static readonly object[] m_Params = new object[2];
private static string[] m_CircleNames =
private static readonly string[] m_CircleNames =
{
"First",
"Second",
@ -39,7 +39,7 @@ namespace Server.Spells
}
}
//What IS this used for anyways.
// What IS this used for anyways.
public static int Count
{
get
@ -57,7 +57,7 @@ namespace Server.Spells
}
}
public static Dictionary<int, SpecialMove> SpecialMoves{ get; } = new Dictionary<int, SpecialMove>();
public static Dictionary<int, SpecialMove> SpecialMoves { get; } = new Dictionary<int, SpecialMove>();
public static int GetRegistryNumber(ISpell s) => GetRegistryNumber(s.GetType());

View file

@ -5,14 +5,13 @@ namespace Server.Spells.Bushido
{
public class Confidence : SamuraiSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Confidence", null,
-1,
9002
);
9002);
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private static Dictionary<Mobile, Timer> m_RegenTable = new Dictionary<Mobile, Timer>();
private static readonly Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private static readonly Dictionary<Mobile, Timer> m_RegenTable = new Dictionary<Mobile, Timer>();
public Confidence(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
@ -93,7 +92,7 @@ namespace Server.Spells.Bushido
private class InternalTimer : Timer
{
private Mobile m_Mobile;
private readonly Mobile m_Mobile;
public InternalTimer(Mobile m) : base(TimeSpan.FromSeconds(15.0))
{
@ -110,8 +109,8 @@ namespace Server.Spells.Bushido
private class RegenTimer : Timer
{
private int m_Hits;
private Mobile m_Mobile;
private readonly int m_Hits;
private readonly Mobile m_Mobile;
private int m_Ticks;
public RegenTimer(Mobile m) : base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0))

View file

@ -6,13 +6,12 @@ namespace Server.Spells.Bushido
{
public class CounterAttack : SamuraiSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"CounterAttack", null,
-1,
9002
);
9002);
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private static readonly Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
public CounterAttack(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
@ -87,7 +86,7 @@ namespace Server.Spells.Bushido
private class InternalTimer : Timer
{
private Mobile m_Mobile;
private readonly Mobile m_Mobile;
public InternalTimer(Mobile m) : base(TimeSpan.FromSeconds(30.0))
{

View file

@ -6,13 +6,12 @@ namespace Server.Spells.Bushido
{
public class Evasion : SamuraiSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Evasion", null,
-1,
9002
);
9002);
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private static readonly Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
public Evasion(Mobile caster, Item scroll)
: base(caster, scroll, m_Info)
@ -26,34 +25,34 @@ namespace Server.Spells.Bushido
public override bool CheckCast() => VerifyCast(Caster, true) && base.CheckCast();
public static bool VerifyCast(Mobile Caster, bool messages)
public static bool VerifyCast(Mobile caster, bool messages)
{
if (Caster == null) // Sanity
if (caster == null) // Sanity
return false;
if (!(Caster.FindItemOnLayer(Layer.OneHanded) is BaseWeapon weap))
weap = Caster.FindItemOnLayer(Layer.TwoHanded) as BaseWeapon;
if (!(caster.FindItemOnLayer(Layer.OneHanded) is BaseWeapon weap))
weap = caster.FindItemOnLayer(Layer.TwoHanded) as BaseWeapon;
if (weap != null)
{
if (Core.ML && Caster.Skills[weap.Skill].Base < 50)
if (Core.ML && caster.Skills[weap.Skill].Base < 50)
{
if (messages)
Caster.SendLocalizedMessage(
caster.SendLocalizedMessage(
1076206); // Your skill with your equipped weapon must be 50 or higher to use Evasion.
return false;
}
}
else if (!(Caster.FindItemOnLayer(Layer.TwoHanded) is BaseShield))
else if (!(caster.FindItemOnLayer(Layer.TwoHanded) is BaseShield))
{
if (messages)
Caster.SendLocalizedMessage(1062944); // You must have a weapon or a shield equipped to use this ability!
caster.SendLocalizedMessage(1062944); // You must have a weapon or a shield equipped to use this ability!
return false;
}
if (!Caster.CanBeginAction<Evasion>())
if (!caster.CanBeginAction<Evasion>())
{
if (messages) Caster.SendLocalizedMessage(501789); // You must wait before trying again.
if (messages) caster.SendLocalizedMessage(501789); // You must wait before trying again.
return false;
}
@ -109,7 +108,7 @@ namespace Server.Spells.Bushido
BeginEvasion(Caster);
Caster.BeginAction<Evasion>();
Timer.DelayCall(TimeSpan.FromSeconds(20.0), delegate { Caster.EndAction<Evasion>(); });
Timer.DelayCall(TimeSpan.FromSeconds(20.0), Caster.EndAction<Evasion>);
}
FinishSequence();
@ -135,8 +134,7 @@ namespace Server.Spells.Bushido
if (m.Skills.Bushido.Value > 60)
seconds += (m.Skills.Bushido.Value - 60) / 20;
if (m.Skills.Anatomy.Value >= 100.0 && m.Skills.Tactics.Value >= 100.0 && m.Skills.Bushido.Value > 100.0
) //Bushido being HIGHER than 100 for bonus is intended
if (m.Skills.Anatomy.Value >= 100.0 && m.Skills.Tactics.Value >= 100.0 && m.Skills.Bushido.Value > 100.0) // Bushido being HIGHER than 100 for bonus is intended
seconds++;
return TimeSpan.FromSeconds((int)seconds);
@ -161,8 +159,7 @@ namespace Server.Spells.Bushido
if (m.Skills.Bushido.Value >= 60)
bonus += (m.Skills.Bushido.Value - 60) * .004 + 0.16;
if (m.Skills.Anatomy.Value >= 100 && m.Skills.Tactics.Value >= 100 && m.Skills.Bushido.Value > 100
) //Bushido being HIGHER than 100 for bonus is intended
if (m.Skills.Anatomy.Value >= 100 && m.Skills.Tactics.Value >= 100 && m.Skills.Bushido.Value > 100) // Bushido being HIGHER than 100 for bonus is intended
bonus += 0.10;
return 1.0 + bonus;
@ -190,7 +187,7 @@ namespace Server.Spells.Bushido
private class InternalTimer : Timer
{
private Mobile m_Mobile;
private readonly Mobile m_Mobile;
public InternalTimer(Mobile m, TimeSpan delay)
: base(delay)

View file

@ -5,7 +5,7 @@ namespace Server.Spells.Bushido
{
public class HonorableExecution : SamuraiMove
{
private static Dictionary<Mobile, HonorableExecutionInfo> m_Table = new Dictionary<Mobile, HonorableExecutionInfo>();
private static readonly Dictionary<Mobile, HonorableExecutionInfo> m_Table = new Dictionary<Mobile, HonorableExecutionInfo>();
public override int BaseMana => 0;
public override double RequiredSkill => 25.0;
@ -90,10 +90,10 @@ namespace Server.Spells.Bushido
private class HonorableExecutionInfo
{
public Mobile m_Mobile;
public List<object> m_Mods;
public bool m_Penalty;
public int m_SwingBonus;
public readonly Mobile m_Mobile;
public readonly List<object> m_Mods;
public readonly bool m_Penalty;
public readonly int m_SwingBonus;
public Timer m_Timer;
public HonorableExecutionInfo(Mobile from, List<object> mods) : this(from, 0, mods, mods != null)

View file

@ -6,7 +6,7 @@ namespace Server.Spells
public override void CheckGain(Mobile m)
{
m.CheckSkill(MoveSkill, RequiredSkill - 12.5, RequiredSkill + 37.5); //Per five on friday 02/16/07
m.CheckSkill(MoveSkill, RequiredSkill - 12.5, RequiredSkill + 37.5); // Per five on friday 02/16/07
}
}
}

View file

@ -10,8 +10,8 @@ namespace Server.Spells.Bushido
{
}
public abstract double RequiredSkill{ get; }
public abstract int RequiredMana{ get; }
public abstract double RequiredSkill { get; }
public abstract int RequiredMana { get; }
public override SkillName CastSkill => SkillName.Bushido;
public override SkillName DamageSkill => SkillName.Bushido;
@ -20,7 +20,7 @@ namespace Server.Spells.Bushido
public override bool BlocksMovement => false;
public override bool ShowHandMovement => false;
//public override int CastDelayBase => 1;
// public override int CastDelayBase => 1;
public override double CastDelayFastScalar => 0;
public override int CastRecoveryBase => 7;
@ -86,7 +86,7 @@ namespace Server.Spells.Bushido
public override void GetCastSkills(out double min, out double max)
{
min = RequiredSkill - 12.5; //per 5 on friday, 2/16/07
min = RequiredSkill - 12.5; // per 5 on friday, 2/16/07
max = RequiredSkill + 37.5;
}

View file

@ -6,11 +6,10 @@ namespace Server.Spells.Chivalry
{
public class CleanseByFireSpell : PaladinSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Cleanse By Fire", "Expor Flamus",
-1,
9002
);
9002);
public CleanseByFireSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -9,11 +9,10 @@ namespace Server.Spells.Chivalry
{
public class CloseWoundsSpell : PaladinSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Close Wounds", "Obsu Vulni",
-1,
9002
);
9002);
public CloseWoundsSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,13 +6,12 @@ namespace Server.Spells.Chivalry
{
public class ConsecrateWeaponSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Consecrate Weapon", "Consecrus Arma",
-1,
9002
);
9002);
private static Dictionary<BaseWeapon, ExpireTimer> m_Table = new Dictionary<BaseWeapon, ExpireTimer>();
private static readonly Dictionary<BaseWeapon, ExpireTimer> m_Table = new Dictionary<BaseWeapon, ExpireTimer>();
public ConsecrateWeaponSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -92,7 +91,7 @@ namespace Server.Spells.Chivalry
private class ExpireTimer : Timer
{
private BaseWeapon m_Weapon;
private readonly BaseWeapon m_Weapon;
public ExpireTimer(BaseWeapon weapon, TimeSpan delay) : base(delay)
{

View file

@ -9,11 +9,10 @@ namespace Server.Spells.Chivalry
{
public class DispelEvilSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Dispel Evil", "Dispiro Malas",
-1,
9002
);
9002);
public DispelEvilSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -82,7 +81,7 @@ namespace Server.Spells.Chivalry
}
TransformContext context = TransformationSpellHelper.GetContext(m);
if (context?.Spell is NecromancerSpell) //Trees are not evil! TODO: OSI confirm?
if (context?.Spell is NecromancerSpell) // Trees are not evil! TODO: OSI confirm?
{
// transformed ..

View file

@ -5,13 +5,12 @@ namespace Server.Spells.Chivalry
{
public class DivineFurySpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Divine Fury", "Divinum Furis",
-1,
9002
);
9002);
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private static readonly Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
public DivineFurySpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,13 +6,12 @@ namespace Server.Spells.Chivalry
{
public class EnemyOfOneSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Enemy of One", "Forul Solum",
-1,
9002
);
9002);
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
private static readonly Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
public EnemyOfOneSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -7,11 +7,10 @@ namespace Server.Spells.Chivalry
{
public class HolyLightSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Holy Light", "Augus Luminos",
-1,
9002
);
9002);
public HolyLightSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -8,11 +8,10 @@ namespace Server.Spells.Chivalry
{
public class NobleSacrificeSpell : PaladinSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Noble Sacrifice", "Dium Prostra",
-1,
9002
);
9002);
public NobleSacrificeSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -9,17 +9,17 @@ namespace Server.Spells.Chivalry
{
}
public abstract double RequiredSkill{ get; }
public abstract int RequiredMana{ get; }
public abstract int RequiredTithing{ get; }
public abstract int MantraNumber{ get; }
public abstract double RequiredSkill { get; }
public abstract int RequiredMana { get; }
public abstract int RequiredTithing { get; }
public abstract int MantraNumber { get; }
public override SkillName CastSkill => SkillName.Chivalry;
public override SkillName DamageSkill => SkillName.Chivalry;
public override bool ClearHandsOnCast => false;
//public override int CastDelayBase => 1;
// public override int CastDelayBase => 1;
public override int CastRecoveryBase => 7;

View file

@ -9,11 +9,10 @@ namespace Server.Spells.Chivalry
{
public class RemoveCurseSpell : PaladinSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Remove Curse", "Extermo Vomica",
-1,
9002
);
9002);
public RemoveCurseSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -8,18 +8,16 @@ namespace Server.Spells.Chivalry
{
public class SacredJourneySpell : PaladinSpell, IRecallSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Sacred Journey", "Sanctum Viatas",
-1,
9002
);
9002);
private Runebook m_Book;
private readonly Runebook m_Book;
private RunebookEntry m_Entry;
private readonly RunebookEntry m_Entry;
public SacredJourneySpell(Mobile caster, RunebookEntry entry = null, Runebook book = null, Item scroll = null) :
base(caster, scroll, m_Info)
public SacredJourneySpell(Mobile caster, RunebookEntry entry = null, Runebook book = null, Item scroll = null) : base(caster, scroll, m_Info)
{
m_Entry = entry;
m_Book = book;
@ -79,7 +77,7 @@ namespace Server.Spells.Chivalry
{
Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
}
else if (map == null || !Core.AOS && Caster.Map != map)
else if (map == null || (!Core.AOS && Caster.Map != map))
{
Caster.SendLocalizedMessage(1005569); // You can not recall to another facet.
}

View file

@ -5,15 +5,14 @@ namespace Server.Spells.Eighth
{
public class AirElementalSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Air Elemental", "Kal Vas Xen Hur",
269,
9010,
false,
Reagent.Bloodmoss,
Reagent.MandrakeRoot,
Reagent.SpidersSilk
);
Reagent.SpidersSilk);
public AirElementalSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -5,15 +5,14 @@ namespace Server.Spells.Eighth
{
public class EarthElementalSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Earth Elemental", "Kal Vas Xen Ylem",
269,
9020,
false,
Reagent.Bloodmoss,
Reagent.MandrakeRoot,
Reagent.SpidersSilk
);
Reagent.SpidersSilk);
public EarthElementalSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,7 +6,7 @@ namespace Server.Spells.Eighth
{
public class EarthquakeSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Earthquake", "In Vas Por",
233,
9012,
@ -14,8 +14,7 @@ namespace Server.Spells.Eighth
Reagent.Bloodmoss,
Reagent.Ginseng,
Reagent.MandrakeRoot,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
public EarthquakeSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -5,7 +5,7 @@ namespace Server.Spells.Eighth
{
public class EnergyVortexSpell : MagerySpell, ISpellTargetingPoint3D
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Energy Vortex", "Vas Corp Por",
260,
9032,
@ -13,8 +13,7 @@ namespace Server.Spells.Eighth
Reagent.Bloodmoss,
Reagent.BlackPearl,
Reagent.MandrakeRoot,
Reagent.Nightshade
);
Reagent.Nightshade);
public EnergyVortexSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -5,7 +5,7 @@ namespace Server.Spells.Eighth
{
public class FireElementalSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Fire Elemental", "Kal Vas Xen Flam",
269,
9050,
@ -13,8 +13,7 @@ namespace Server.Spells.Eighth
Reagent.Bloodmoss,
Reagent.MandrakeRoot,
Reagent.SpidersSilk,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
public FireElementalSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,14 +6,13 @@ namespace Server.Spells.Eighth
{
public class ResurrectionSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Resurrection", "An Corp",
245,
9062,
Reagent.Bloodmoss,
Reagent.Garlic,
Reagent.Ginseng
);
Reagent.Ginseng);
public ResurrectionSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -5,7 +5,7 @@ namespace Server.Spells.Eighth
{
public class SummonDaemonSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Summon Daemon", "Kal Vas Xen Corp",
269,
9050,
@ -13,8 +13,7 @@ namespace Server.Spells.Eighth
Reagent.Bloodmoss,
Reagent.MandrakeRoot,
Reagent.SpidersSilk,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
public SummonDaemonSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -5,15 +5,14 @@ namespace Server.Spells.Eighth
{
public class WaterElementalSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Water Elemental", "Kal Vas Xen An Flam",
269,
9070,
false,
Reagent.Bloodmoss,
Reagent.MandrakeRoot,
Reagent.SpidersSilk
);
Reagent.SpidersSilk);
public WaterElementalSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -5,15 +5,14 @@ namespace Server.Spells.Fifth
{
public class BladeSpiritsSpell : MagerySpell, ISpellTargetingPoint3D
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Blade Spirits", "In Jux Hur Ylem",
266,
9040,
false,
Reagent.BlackPearl,
Reagent.MandrakeRoot,
Reagent.Nightshade
);
Reagent.Nightshade);
public BladeSpiritsSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,15 +6,14 @@ namespace Server.Spells.Fifth
{
public class DispelFieldSpell : MagerySpell, ISpellTargetingItem
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Dispel Field", "An Grav",
206,
9002,
Reagent.BlackPearl,
Reagent.SpidersSilk,
Reagent.SulfurousAsh,
Reagent.Garlic
);
Reagent.Garlic);
public DispelFieldSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -9,16 +9,15 @@ namespace Server.Spells.Fifth
{
public class IncognitoSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Incognito", "Kal In Ex",
206,
9002,
Reagent.Bloodmoss,
Reagent.Garlic,
Reagent.Nightshade
);
Reagent.Nightshade);
private static Dictionary<Mobile, InternalTimer> m_Timers = new Dictionary<Mobile, InternalTimer>();
private static readonly Dictionary<Mobile, InternalTimer> m_Timers = new Dictionary<Mobile, InternalTimer>();
public IncognitoSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -97,7 +96,6 @@ namespace Server.Spells.Fifth
StopTimer(Caster);
int timeVal = 6 * Caster.Skills.Magery.Fixed / 50 + 1;
if (timeVal > 144)
@ -105,7 +103,6 @@ namespace Server.Spells.Fifth
TimeSpan length = TimeSpan.FromSeconds(timeVal);
InternalTimer t = new InternalTimer(Caster, length);
m_Timers[Caster] = t;
@ -134,7 +131,7 @@ namespace Server.Spells.Fifth
private class InternalTimer : Timer
{
private Mobile m_Owner;
private readonly Mobile m_Owner;
public InternalTimer(Mobile owner, TimeSpan length) : base(length)
{
@ -143,7 +140,7 @@ namespace Server.Spells.Fifth
/*
int val = ((6 * owner.Skills.Magery.Fixed) / 50) + 1;
if ( val > 144 )
if (val > 144)
val = 144;
Delay = TimeSpan.FromSeconds( val );

View file

@ -4,16 +4,15 @@ namespace Server.Spells.Fifth
{
public class MagicReflectSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Magic Reflection", "In Jux Sanct",
242,
9012,
Reagent.Garlic,
Reagent.MandrakeRoot,
Reagent.SpidersSilk
);
Reagent.SpidersSilk);
private static Dictionary<Mobile, ResistanceMod[]> m_Table = new Dictionary<Mobile, ResistanceMod[]>();
private static readonly Dictionary<Mobile, ResistanceMod[]> m_Table = new Dictionary<Mobile, ResistanceMod[]>();
public MagicReflectSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -113,7 +112,7 @@ namespace Server.Spells.Fifth
if (Caster.BeginAction<DefensiveSpell>())
{
int value = (int)(Caster.Skills.Magery.Value + Caster.Skills.Inscribe.Value);
value = (int)(8 + value / 200.0 * 7.0); //absorb from 8 to 15 "circles"
value = (int)(8 + value / 200.0 * 7.0); // absorb from 8 to 15 "circles"
Caster.MagicDamageAbsorb = value;

View file

@ -5,15 +5,14 @@ namespace Server.Spells.Fifth
{
public class MindBlastSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Mind Blast", "Por Corp Wis",
218,
Core.AOS ? 9002 : 9032,
Reagent.BlackPearl,
Reagent.MandrakeRoot,
Reagent.Nightshade,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
public MindBlastSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -7,14 +7,13 @@ namespace Server.Spells.Fifth
{
public class ParalyzeSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Paralyze", "An Ex Por",
218,
9012,
Reagent.Garlic,
Reagent.MandrakeRoot,
Reagent.SpidersSilk
);
Reagent.SpidersSilk);
public ParalyzeSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -35,7 +34,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?.IsCasting == true && !(m.Spell is PaladinSpell)))
(m.Spell?.IsCasting == true && !(m.Spell is PaladinSpell))))
{
Caster.SendLocalizedMessage(1061923); // The target is already frozen.
}

View file

@ -9,15 +9,14 @@ namespace Server.Spells.Fifth
{
public class PoisonFieldSpell : MagerySpell, ISpellTargetingPoint3D
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Poison Field", "In Nox Grav",
230,
9052,
false,
Reagent.BlackPearl,
Reagent.Nightshade,
Reagent.SpidersSilk
);
Reagent.SpidersSilk);
public PoisonFieldSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -132,20 +131,20 @@ namespace Server.Spells.Fifth
switch (version)
{
case 1:
{
m_Caster = reader.ReadMobile();
{
m_Caster = reader.ReadMobile();
goto case 0;
}
goto case 0;
}
case 0:
{
m_End = reader.ReadDeltaTime();
{
m_End = reader.ReadDeltaTime();
m_Timer = new InternalTimer(this, TimeSpan.Zero, true, true);
m_Timer.Start();
m_Timer = new InternalTimer(this, TimeSpan.Zero, true, true);
m_Timer.Start();
break;
}
break;
}
}
}
@ -197,9 +196,10 @@ namespace Server.Spells.Fifth
private class InternalTimer : Timer
{
private static Queue<Mobile> m_Queue = new Queue<Mobile>();
private bool m_InLOS, m_CanFit;
private InternalItem m_Item;
private static readonly Queue<Mobile> m_Queue = new Queue<Mobile>();
private readonly bool m_InLOS;
private readonly bool m_CanFit;
private readonly InternalItem m_Item;
public InternalTimer(InternalItem item, TimeSpan delay, bool inLOS, bool canFit) : base(delay,
TimeSpan.FromSeconds(1.5))

View file

@ -6,18 +6,17 @@ namespace Server.Spells.Fifth
{
public class SummonCreatureSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Summon Creature", "Kal Xen",
16,
false,
Reagent.Bloodmoss,
Reagent.MandrakeRoot,
Reagent.SpidersSilk
);
Reagent.SpidersSilk);
// NOTE: Creature list based on 1hr of summon/release on OSI.
private static Type[] m_Types =
private static readonly Type[] m_Types =
{
typeof(PolarBear),
typeof(GrizzlyBear),
@ -66,7 +65,7 @@ namespace Server.Spells.Fifth
{
BaseCreature creature = (BaseCreature)ActivatorUtil.CreateInstance(m_Types[Utility.Random(m_Types.Length)]);
//creature.ControlSlots = 2;
// creature.ControlSlots = 2;
TimeSpan duration;

View file

@ -5,13 +5,12 @@ namespace Server.Spells.First
{
public class ClumsySpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Clumsy", "Uus Jux",
212,
9031,
Reagent.Bloodmoss,
Reagent.Nightshade
);
Reagent.Nightshade);
public ClumsySpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,16 +6,15 @@ namespace Server.Spells.First
{
public class CreateFoodSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Create Food", "In Mani Ylem",
224,
9011,
Reagent.Garlic,
Reagent.Ginseng,
Reagent.MandrakeRoot
);
Reagent.MandrakeRoot);
private static FoodInfo[] m_Food =
private static readonly FoodInfo[] m_Food =
{
new FoodInfo(typeof(Grapes), "a grape bunch"),
new FoodInfo(typeof(Ham), "a ham"),
@ -66,9 +65,9 @@ namespace Server.Spells.First
Name = name;
}
public Type Type{ get; set; }
public Type Type { get; set; }
public string Name{ get; set; }
public string Name { get; set; }
public Item Create()
{

View file

@ -5,13 +5,12 @@ namespace Server.Spells.First
{
public class FeeblemindSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Feeblemind", "Rel Wis",
212,
9031,
Reagent.Ginseng,
Reagent.Nightshade
);
Reagent.Nightshade);
public FeeblemindSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -8,14 +8,13 @@ namespace Server.Spells.First
{
public class HealSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Heal", "In Mani",
224,
9061,
Reagent.Garlic,
Reagent.Ginseng,
Reagent.SpidersSilk
);
Reagent.SpidersSilk);
public HealSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -84,7 +83,7 @@ namespace Server.Spells.First
toHeal += Utility.Random(1, 5);
}
//m.Heal( toHeal, Caster );
// m.Heal( toHeal, Caster );
SpellHelper.Heal(toHeal, m, Caster);
m.FixedParticles(0x376A, 9, 32, 5005, EffectLayer.Waist);

View file

@ -4,12 +4,11 @@ namespace Server.Spells.First
{
public class MagicArrowSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Magic Arrow", "In Por Ylem",
212,
9041,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
public MagicArrowSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -4,13 +4,12 @@ namespace Server.Spells.First
{
public class NightSightSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Night Sight", "In Lor",
236,
9031,
Reagent.SulfurousAsh,
Reagent.SpidersSilk
);
Reagent.SpidersSilk);
public NightSightSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -25,7 +24,7 @@ namespace Server.Spells.First
private class NightSightTarget : Target
{
private Spell m_Spell;
private readonly Spell m_Spell;
public NightSightTarget(Spell spell) : base(12, false, TargetFlags.Beneficial) => m_Spell = spell;
@ -52,7 +51,7 @@ namespace Server.Spells.First
targ.PlaySound(0x1E3);
BuffInfo.AddBuff(targ,
new BuffInfo(BuffIcon.NightSight, 1075643)); //Night Sight/You ignore lighting effects
new BuffInfo(BuffIcon.NightSight, 1075643)); // Night Sight/You ignore lighting effects
}
else
{

View file

@ -4,16 +4,15 @@ namespace Server.Spells.First
{
public class ReactiveArmorSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Reactive Armor", "Flam Sanct",
236,
9011,
Reagent.Garlic,
Reagent.SpidersSilk,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
private static Dictionary<Mobile, ResistanceMod[]> m_Table = new Dictionary<Mobile, ResistanceMod[]>();
private static readonly Dictionary<Mobile, ResistanceMod[]> m_Table = new Dictionary<Mobile, ResistanceMod[]>();
public ReactiveArmorSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -62,7 +61,7 @@ namespace Server.Spells.First
targ.PlaySound(0x1E9);
targ.FixedParticles(0x376A, 9, 32, 5008, EffectLayer.Waist);
mods = new []
mods = new[]
{
new ResistanceMod(ResistanceType.Physical,
15 + (int)(targ.Skills.Inscribe.Value / 20)),

View file

@ -5,13 +5,12 @@ namespace Server.Spells.First
{
public class WeakenSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Weaken", "Des Mani",
212,
9031,
Reagent.Garlic,
Reagent.Nightshade
);
Reagent.Nightshade);
public WeakenSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -8,14 +8,13 @@ namespace Server.Spells.Fourth
{
public class ArchCureSpell : MagerySpell, ISpellTargetingPoint3D
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Arch Cure", "Vas An Nox",
215,
9061,
Reagent.Garlic,
Reagent.Ginseng,
Reagent.MandrakeRoot
);
Reagent.MandrakeRoot);
public ArchCureSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -9,17 +9,16 @@ namespace Server.Spells.Fourth
{
public class ArchProtectionSpell : MagerySpell, ISpellTargetingPoint3D
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Arch Protection", "Vas Uus Sanct",
Core.AOS ? 239 : 215,
9011,
Reagent.Garlic,
Reagent.Ginseng,
Reagent.MandrakeRoot,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
private static Dictionary<Mobile, int> _Table = new Dictionary<Mobile, int>();
private static readonly Dictionary<Mobile, int> _Table = new Dictionary<Mobile, int>();
public ArchProtectionSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -108,7 +107,7 @@ namespace Server.Spells.Fourth
private class InternalTimer : Timer
{
private Mobile m_Owner;
private readonly Mobile m_Owner;
public InternalTimer(Mobile target, Mobile caster) : base(TimeSpan.FromSeconds(0))
{

View file

@ -6,16 +6,15 @@ namespace Server.Spells.Fourth
{
public class CurseSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Curse", "Des Sanct",
227,
9031,
Reagent.Nightshade,
Reagent.Garlic,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
private static HashSet<Mobile> m_UnderEffect = new HashSet<Mobile>();
private static readonly HashSet<Mobile> m_UnderEffect = new HashSet<Mobile>();
public CurseSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -56,8 +55,7 @@ namespace Server.Spells.Fourth
SpellHelper.AddStatCurse(Caster, m, StatType.Int);
SpellHelper.DisableSkillCheck = false;
if (Caster.Player && m.Player /*&& Caster != m */ && !UnderEffect(m)
) //On OSI you CAN curse yourself and get this effect.
if (Caster.Player && m.Player /*&& Caster != m */ && !UnderEffect(m)) // On OSI you CAN curse yourself and get this effect.
{
TimeSpan duration = SpellHelper.GetDuration(Caster, m);
m_UnderEffect.Add(m);

View file

@ -9,15 +9,14 @@ namespace Server.Spells.Fourth
{
public class FireFieldSpell : MagerySpell, ISpellTargetingPoint3D
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Fire Field", "In Flam Grav",
215,
9041,
false,
Reagent.BlackPearl,
Reagent.SpidersSilk,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
public FireFieldSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -142,25 +141,25 @@ namespace Server.Spells.Fourth
switch (version)
{
case 2:
{
m_Damage = reader.ReadInt();
goto case 1;
}
{
m_Damage = reader.ReadInt();
goto case 1;
}
case 1:
{
m_Caster = reader.ReadMobile();
{
m_Caster = reader.ReadMobile();
goto case 0;
}
goto case 0;
}
case 0:
{
m_End = reader.ReadDeltaTime();
{
m_End = reader.ReadDeltaTime();
m_Timer = new InternalTimer(this, TimeSpan.Zero, true, true);
m_Timer.Start();
m_Timer = new InternalTimer(this, TimeSpan.Zero, true, true);
m_Timer.Start();
break;
}
break;
}
}
if (version < 2)
@ -197,9 +196,10 @@ namespace Server.Spells.Fourth
private class InternalTimer : Timer
{
private static Queue m_Queue = new Queue();
private bool m_InLOS, m_CanFit;
private FireFieldItem m_Item;
private static readonly Queue m_Queue = new Queue();
private readonly bool m_InLOS;
private readonly bool m_CanFit;
private readonly FireFieldItem m_Item;
public InternalTimer(FireFieldItem item, TimeSpan delay, bool inLOS, bool canFit) : base(delay,
TimeSpan.FromSeconds(1.0))

View file

@ -8,15 +8,14 @@ namespace Server.Spells.Fourth
{
public class GreaterHealSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Greater Heal", "In Vas Mani",
204,
9061,
Reagent.Garlic,
Reagent.Ginseng,
Reagent.MandrakeRoot,
Reagent.SpidersSilk
);
Reagent.SpidersSilk);
public GreaterHealSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -72,7 +71,7 @@ namespace Server.Spells.Fourth
int toHeal = (int)(Caster.Skills.Magery.Value * 0.4);
toHeal += Utility.Random(1, 10);
//m.Heal( toHeal, Caster );
// m.Heal( toHeal, Caster );
SpellHelper.Heal(toHeal, m, Caster);
m.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);

View file

@ -4,13 +4,12 @@ namespace Server.Spells.Fourth
{
public class LightningSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Lightning", "Por Ort Grav",
239,
9021,
Reagent.MandrakeRoot,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
public LightningSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,16 +6,15 @@ namespace Server.Spells.Fourth
{
public class ManaDrainSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Mana Drain", "Ort Rel",
215,
9031,
Reagent.BlackPearl,
Reagent.MandrakeRoot,
Reagent.SpidersSilk
);
Reagent.SpidersSilk);
private static HashSet<Mobile> m_Table = new HashSet<Mobile>();
private static readonly HashSet<Mobile> m_Table = new HashSet<Mobile>();
public ManaDrainSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -8,21 +8,19 @@ namespace Server.Spells.Fourth
{
public class RecallSpell : MagerySpell, IRecallSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Recall", "Kal Ort Por",
239,
9031,
Reagent.BlackPearl,
Reagent.Bloodmoss,
Reagent.MandrakeRoot
);
Reagent.MandrakeRoot);
private Runebook m_Book;
private readonly Runebook m_Book;
private RunebookEntry m_Entry;
private readonly RunebookEntry m_Entry;
public RecallSpell(Mobile caster, RunebookEntry entry = null, Runebook book = null, Item scroll = null) :
base(caster, scroll, m_Info)
public RecallSpell(Mobile caster, RunebookEntry entry = null, Runebook book = null, Item scroll = null) : base(caster, scroll, m_Info)
{
m_Entry = entry;
m_Book = book;
@ -34,7 +32,7 @@ namespace Server.Spells.Fourth
{
if (TransformationSpellHelper.UnderTransformation(Caster, typeof(WraithFormSpell)))
min = max = 0;
else if (Core.SE && m_Book != null) //recall using Runebook charge
else if (Core.SE && m_Book != null) // recall using Runebook charge
min = max = 0;
else
base.GetCastSkills(out min, out max);
@ -83,7 +81,7 @@ namespace Server.Spells.Fourth
{
Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
}
else if (map == null || !Core.AOS && Caster.Map != map)
else if (map == null || (!Core.AOS && Caster.Map != map))
{
Caster.SendLocalizedMessage(1005569); // You can not recall to another facet.
}

View file

@ -167,34 +167,34 @@ namespace Server.Spells
Register(606, typeof(SummonFeySpell));
Register(607, typeof(SummonFiendSpell));
Register(608, typeof(ReaperFormSpell));
//Register( 609, typeof( Spellweaving.WildfireSpell ) );
// Register( 609, typeof( Spellweaving.WildfireSpell ) );
Register(610, typeof(EssenceOfWindSpell));
//Register( 611, typeof( Spellweaving.DryadAllureSpell ) );
// Register( 611, typeof( Spellweaving.DryadAllureSpell ) );
Register(612, typeof(EtherealVoyageSpell));
Register(613, typeof(WordOfDeathSpell));
Register(614, typeof(GiftOfLifeSpell));
//Register( 615, typeof( Spellweaving.ArcaneEmpowermentSpell ) );
// Register( 615, typeof( Spellweaving.ArcaneEmpowermentSpell ) );
}
if (Core.SA)
{
// Mysticism spells
//Register( 677, typeof( Mysticism.NetherBoltSpell ) );
//Register( 678, typeof( Mysticism.HealingStoneSpell ) );
//Register( 679, typeof( Mysticism.PurgeMagicSpell ) );
//Register( 680, typeof( Mysticism.EnchantSpell ) );
//Register( 681, typeof( Mysticism.SleepSpell ) );
// Register( 677, typeof( Mysticism.NetherBoltSpell ) );
// Register( 678, typeof( Mysticism.HealingStoneSpell ) );
// Register( 679, typeof( Mysticism.PurgeMagicSpell ) );
// Register( 680, typeof( Mysticism.EnchantSpell ) );
// Register( 681, typeof( Mysticism.SleepSpell ) );
Register(682, typeof(EagleStrikeSpell));
Register(683, typeof(AnimatedWeaponSpell));
Register(684, typeof(StoneFormSpell));
//Register( 685, typeof( Mysticism.SpellTriggerSpell ) );
//Register( 686, typeof( Mysticism.MassSleepSpell ) );
//Register( 687, typeof( Mysticism.CleansingWindsSpell ) );
//Register( 688, typeof( Mysticism.BombardSpell ) );
// Register( 685, typeof( Mysticism.SpellTriggerSpell ) );
// Register( 686, typeof( Mysticism.MassSleepSpell ) );
// Register( 687, typeof( Mysticism.CleansingWindsSpell ) );
// Register( 688, typeof( Mysticism.BombardSpell ) );
Register(689, typeof(SpellPlagueSpell));
Register(690, typeof(HailStormSpell));
Register(691, typeof(NetherCycloneSpell));
//Register( 692, typeof( Mysticism.RisingColossusSpell ) );
// Register( 692, typeof( Mysticism.RisingColossusSpell ) );
}
}
}

View file

@ -5,15 +5,14 @@ namespace Server.Spells.Mysticism
{
public class AnimatedWeaponSpell : MysticSpell, ISpellTargetingPoint3D
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Animated Weapon", "In Jux Por Ylem",
-1,
9002,
Reagent.Bone,
Reagent.BlackPearl,
Reagent.MandrakeRoot,
Reagent.Nightshade
);
Reagent.Nightshade);
public AnimatedWeaponSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)
@ -42,7 +41,7 @@ namespace Server.Spells.Mysticism
SpellHelper.GetSurfaceTop(ref p);
if (map == null || Caster.Player && !map.CanSpawnMobile(p.X, p.Y, p.Z))
if (map == null || (Caster.Player && !map.CanSpawnMobile(p.X, p.Y, p.Z)))
{
Caster.SendLocalizedMessage(501942); // That location is blocked.
}

View file

@ -5,15 +5,14 @@ namespace Server.Spells.Mysticism
{
public class EagleStrikeSpell : MysticSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Eagle Strike", "Kal Por Xen",
-1,
9002,
Reagent.Bloodmoss,
Reagent.Bone,
Reagent.SpidersSilk,
Reagent.MandrakeRoot
);
Reagent.MandrakeRoot);
public EagleStrikeSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)

View file

@ -6,15 +6,14 @@ namespace Server.Spells.Mysticism
{
public class HailStormSpell : MysticSpell, ISpellTargetingPoint3D
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Hail Storm", "Kal Des Ylem",
-1,
9002,
Reagent.DragonsBlood,
Reagent.Bloodmoss,
Reagent.BlackPearl,
Reagent.MandrakeRoot
);
Reagent.MandrakeRoot);
public HailStormSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)

View file

@ -9,8 +9,8 @@ namespace Server.Spells.Mysticism
{
}
public abstract double RequiredSkill{ get; }
public abstract int RequiredMana{ get; }
public abstract double RequiredSkill { get; }
public abstract int RequiredMana { get; }
public override SkillName CastSkill => SkillName.Mysticism;

View file

@ -6,15 +6,14 @@ namespace Server.Spells.Mysticism
{
public class NetherCycloneSpell : MysticSpell, ISpellTargetingPoint3D
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Nether Cyclone", "Grav Hur",
-1,
9002,
Reagent.MandrakeRoot,
Reagent.Nightshade,
Reagent.SulfurousAsh,
Reagent.Bloodmoss
);
Reagent.Bloodmoss);
public NetherCycloneSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)

View file

@ -6,17 +6,16 @@ namespace Server.Spells.Mysticism
{
public class SpellPlagueSpell : MysticSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Spell Plague", "Vas Rel Jux Ort",
-1,
9002,
Reagent.DaemonBone,
Reagent.DragonsBlood,
Reagent.Nightshade,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
private static Dictionary<Mobile, SpellPlagueContext> m_Table = new Dictionary<Mobile, SpellPlagueContext>();
private static readonly Dictionary<Mobile, SpellPlagueContext> m_Table = new Dictionary<Mobile, SpellPlagueContext>();
public SpellPlagueSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)
@ -111,8 +110,8 @@ namespace Server.Spells.Mysticism
private int m_Explosions;
private DateTime m_LastExploded;
private SpellPlagueContext m_Next;
private SpellPlagueSpell m_Owner;
private Mobile m_Target;
private readonly SpellPlagueSpell m_Owner;
private readonly Mobile m_Target;
private Timer m_Timer;
public SpellPlagueContext(SpellPlagueSpell owner, Mobile target)
@ -191,7 +190,7 @@ namespace Server.Spells.Mysticism
private class InternalTarget : Target
{
private SpellPlagueSpell m_Owner;
private readonly SpellPlagueSpell m_Owner;
public InternalTarget(SpellPlagueSpell owner)
: base(12, false, TargetFlags.Harmful) =>

View file

@ -10,16 +10,15 @@ namespace Server.Spells.Mysticism
{
public class StoneFormSpell : MysticSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Stone Form", "In Rel Ylem",
-1,
9002,
Reagent.Bloodmoss,
Reagent.FertileDirt,
Reagent.Garlic
);
Reagent.Garlic);
private static Dictionary<Mobile, ResistanceMod[]> m_Table = new Dictionary<Mobile, ResistanceMod[]>();
private static readonly Dictionary<Mobile, ResistanceMod[]> m_Table = new Dictionary<Mobile, ResistanceMod[]>();
public StoneFormSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)
@ -77,7 +76,7 @@ namespace Server.Spells.Mysticism
{
Caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed.
}
else if (!Caster.CanBeginAction<IncognitoSpell>() || Caster.IsBodyMod && !UnderEffect(Caster))
else if (!Caster.CanBeginAction<IncognitoSpell>() || (Caster.IsBodyMod && !UnderEffect(Caster)))
{
Caster.SendLocalizedMessage(1063218); // You cannot use that ability in this form.
}

View file

@ -11,18 +11,17 @@ namespace Server.Spells.Necromancy
{
public class AnimateDeadSpell : NecromancerSpell, ISpellTargetingItem
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Animate Dead", "Uus Corp",
203,
9031,
Reagent.GraveDust,
Reagent.DaemonBlood
);
Reagent.DaemonBlood);
private static CreatureGroup[] m_Groups =
private static readonly CreatureGroup[] m_Groups =
{
// Undead group--empty
new CreatureGroup(SlayerGroup.GetEntryByName(SlayerName.Silver).Types, new SummonEntry[0]),
new CreatureGroup(SlayerGroup.GetEntryByName(SlayerName.Silver).Types, Array.Empty<SummonEntry>()),
// Insects
new CreatureGroup(new[]
{
@ -81,7 +80,7 @@ namespace Server.Spells.Necromancy
new SummonEntry(0, typeof(PatchworkSkeleton))
}),
// Default group
new CreatureGroup(new Type[0], new[]
new CreatureGroup(Array.Empty<Type>(), new[]
{
new SummonEntry(18000, typeof(LichLord)),
new SummonEntry(10000, typeof(FleshGolem)),
@ -93,7 +92,7 @@ namespace Server.Spells.Necromancy
})
};
private static Dictionary<Mobile, List<Mobile>> m_Table = new Dictionary<Mobile, List<Mobile>>();
private static readonly Dictionary<Mobile, List<Mobile>> m_Table = new Dictionary<Mobile, List<Mobile>>();
public AnimateDeadSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -164,8 +163,8 @@ namespace Server.Spells.Necromancy
if (c.Owner != null) type = c.Owner.GetType();
if (c.ItemID != 0x2006 || c.Animated || type == typeof(PlayerMobile) || type == null ||
c.Owner != null && c.Owner.Fame < 100 || c.Owner is BaseCreature creature &&
(creature.Summoned || creature.IsBonded))
(c.Owner != null && c.Owner.Fame < 100) ||
(c.Owner is BaseCreature creature && (creature.Summoned || creature.IsBonded)))
{
Caster.SendLocalizedMessage(1061085); // There's not enough life force there to animate.
}
@ -350,8 +349,8 @@ namespace Server.Spells.Necromancy
private class CreatureGroup
{
public SummonEntry[] m_Entries;
public Type[] m_Types;
public readonly SummonEntry[] m_Entries;
public readonly Type[] m_Types;
public CreatureGroup(Type[] types, SummonEntry[] entries)
{
@ -362,8 +361,8 @@ namespace Server.Spells.Necromancy
private class SummonEntry
{
public int m_Requirement;
public Type[] m_ToSummon;
public readonly int m_Requirement;
public readonly Type[] m_ToSummon;
public SummonEntry(int requirement, params Type[] toSummon)
{

View file

@ -7,15 +7,14 @@ namespace Server.Spells.Necromancy
{
public class BloodOathSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Blood Oath", "In Jux Mani Xen",
203,
9031,
Reagent.DaemonBlood
);
Reagent.DaemonBlood);
private static Dictionary<Mobile, Mobile> m_OathTable = new Dictionary<Mobile, Mobile>();
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
private static readonly Dictionary<Mobile, Mobile> m_OathTable = new Dictionary<Mobile, Mobile>();
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
public BloodOathSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -76,7 +75,7 @@ namespace Server.Spells.Necromancy
m.FixedParticles(0x3728, 1, 13, 9502, 33, 7, (EffectLayer)255);
TimeSpan duration = TimeSpan.FromSeconds((GetDamageSkill(Caster) - GetResistSkill(m)) / 8 + 8);
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); //Skill check for gain
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); // Skill check for gain
timer = new ExpireTimer(Caster, m, duration);
timer.Start();
@ -97,13 +96,13 @@ namespace Server.Spells.Necromancy
t?.DoExpire();
}
public static Mobile GetBloodOath(Mobile m) => m == null || m_OathTable.TryGetValue(m, out Mobile oath) && oath == m ? null : oath;
public static Mobile GetBloodOath(Mobile m) => m == null || (m_OathTable.TryGetValue(m, out Mobile oath) && oath == m) ? null : oath;
private class ExpireTimer : Timer
{
private Mobile m_Caster;
private DateTime m_End;
private Mobile m_Target;
private readonly Mobile m_Caster;
private readonly DateTime m_End;
private readonly Mobile m_Target;
public ExpireTimer(Mobile caster, Mobile target, TimeSpan delay) : base(TimeSpan.FromSeconds(1.0),
TimeSpan.FromSeconds(1.0))

View file

@ -6,15 +6,14 @@ namespace Server.Spells.Necromancy
{
public class CorpseSkinSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Corpse Skin", "In Agle Corp Ylem",
203,
9051,
Reagent.BatWing,
Reagent.GraveDust
);
Reagent.GraveDust);
private static Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
private static readonly Dictionary<Mobile, ExpireTimer> m_Table = new Dictionary<Mobile, ExpireTimer>();
public CorpseSkinSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -63,7 +62,7 @@ namespace Server.Spells.Necromancy
double ss = GetDamageSkill(Caster);
double mr = Caster == m ? 0.0 : GetResistSkill(m);
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); //Skill check for gain
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); // Skill check for gain
TimeSpan duration = TimeSpan.FromSeconds((ss - mr) / 2.5 + 40.0);
@ -102,8 +101,8 @@ namespace Server.Spells.Necromancy
private class ExpireTimer : Timer
{
private Mobile m_Mobile;
private ResistanceMod[] m_Mods;
private readonly Mobile m_Mobile;
private readonly ResistanceMod[] m_Mods;
public ExpireTimer(Mobile m, ResistanceMod[] mods, TimeSpan delay) : base(delay)
{

View file

@ -6,14 +6,13 @@ namespace Server.Spells.Necromancy
{
public class CurseWeaponSpell : NecromancerSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Curse Weapon", "An Sanct Gra Char",
203,
9031,
Reagent.PigIron
);
Reagent.PigIron);
private static Dictionary<BaseWeapon, ExpireTimer> m_Table = new Dictionary<BaseWeapon, ExpireTimer>();
private static readonly Dictionary<BaseWeapon, ExpireTimer> m_Table = new Dictionary<BaseWeapon, ExpireTimer>();
public CurseWeaponSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -63,7 +62,7 @@ namespace Server.Spells.Necromancy
private class ExpireTimer : Timer
{
private BaseWeapon m_Weapon;
private readonly BaseWeapon m_Weapon;
public ExpireTimer(BaseWeapon weapon, TimeSpan delay) : base(delay)
{
@ -81,7 +80,7 @@ namespace Server.Spells.Necromancy
private class SoundEffectTimer : Timer
{
private Mobile m_Mobile;
private readonly Mobile m_Mobile;
public SoundEffectTimer(Mobile m) : base(TimeSpan.FromSeconds(0.75))
{

View file

@ -7,15 +7,14 @@ namespace Server.Spells.Necromancy
{
public class EvilOmenSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Evil Omen", "Pas Tym An Sanct",
203,
9031,
Reagent.BatWing,
Reagent.NoxCrystal
);
Reagent.NoxCrystal);
private static Dictionary<Mobile, DefaultSkillMod> m_Table = new Dictionary<Mobile, DefaultSkillMod>();
private static readonly Dictionary<Mobile, DefaultSkillMod> m_Table = new Dictionary<Mobile, DefaultSkillMod>();
public EvilOmenSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)

View file

@ -12,13 +12,12 @@ namespace Server.Spells.Necromancy
{
public class ExorcismSpell : NecromancerSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Exorcism", "Ort Corp Grav",
203,
9031,
Reagent.NoxCrystal,
Reagent.GraveDust
);
Reagent.GraveDust);
private static readonly int Range = Core.ML ? 48 : 18;
@ -67,7 +66,6 @@ namespace Server.Spells.Necromancy
public override double RequiredSkill => 80.0;
public override int RequiredMana => 40;
public override bool DelayedDamage => false;
public override bool CheckCast()
@ -99,7 +97,7 @@ namespace Server.Spells.Necromancy
IEnumerable<Mobile> targets = r.ChampionSpawn.GetMobilesInRange(Range).Where(IsValidTarget);
foreach (Mobile m in targets)
//Surprisingly, no sparkle type effects
// Surprisingly, no sparkle type effects
m.Location = GetNearestShrine(m);
}
}
@ -118,12 +116,12 @@ namespace Server.Spells.Necromancy
if (c?.Deleted == false && map != null && c.Map == map)
{
if (SpellHelper.IsAnyT2A(map, c.Location) && SpellHelper.IsAnyT2A(map, m.Location))
return false; //Same Map, both in T2A, ie, same 'sub server'.
return false; // Same Map, both in T2A, ie, same 'sub server'.
if (m.Region.IsPartOf<DungeonRegion>() == Region.Find(c.Location, map).IsPartOf<DungeonRegion>())
return false; //Same Map, both in Dungeon region OR They're both NOT in a dungeon region.
return false; // Same Map, both in Dungeon region OR They're both NOT in a dungeon region.
//Just an approximation cause RunUO doesn't divide up the world the same way OSI does ;p
// Just an approximation cause RunUO doesn't divide up the world the same way OSI does ;p
}
if (Party.Get(m)?.Contains(Caster) == true)
@ -143,7 +141,7 @@ namespace Server.Spells.Necromancy
Faction f = Faction.Find(m);
return Faction.Facet != m.Map || f == null || f != Faction.Find(Caster);
return m.Map != Faction.Facet || f == null || f != Faction.Find(Caster);
}
private static Point3D GetNearestShrine(Mobile m)
@ -152,7 +150,6 @@ namespace Server.Spells.Necromancy
Point3D[] locList;
if (map == Map.Felucca || map == Map.Trammel)
locList = m_BritanniaLocs;
else if (map == Map.Ilshenar)
@ -162,7 +159,7 @@ namespace Server.Spells.Necromancy
else if (map == Map.Malas)
locList = m_MalasLocs;
else
locList = new Point3D[0];
locList = Array.Empty<Point3D>();
Point3D closest = Point3D.Zero;
double minDist = double.MaxValue;

View file

@ -4,13 +4,12 @@ namespace Server.Spells.Necromancy
{
public class HorrificBeastSpell : TransformationSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Horrific Beast", "Rel Xen Vas Bal",
203,
9031,
Reagent.BatWing,
Reagent.DaemonBlood
);
Reagent.DaemonBlood);
public HorrificBeastSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -4,14 +4,13 @@ namespace Server.Spells.Necromancy
{
public class LichFormSpell : TransformationSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Lich Form", "Rel Xen Corp Ort",
203,
9031,
Reagent.GraveDust,
Reagent.DaemonBlood,
Reagent.NoxCrystal
);
Reagent.NoxCrystal);
public LichFormSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,16 +6,15 @@ namespace Server.Spells.Necromancy
{
public class MindRotSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Mind Rot", "Wis An Ben",
203,
9031,
Reagent.BatWing,
Reagent.PigIron,
Reagent.DaemonBlood
);
Reagent.DaemonBlood);
private static Dictionary<Mobile, MRBucket> m_Table = new Dictionary<Mobile, MRBucket>();
private static readonly Dictionary<Mobile, MRBucket> m_Table = new Dictionary<Mobile, MRBucket>();
public MindRotSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -55,7 +54,7 @@ namespace Server.Spells.Necromancy
TimeSpan duration =
TimeSpan.FromSeconds(
((GetDamageSkill(Caster) - GetResistSkill(m)) / 5.0 + 20.0) * (m.Player ? 1.0 : 2.0));
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); //Skill check for gain
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); // Skill check for gain
SetMindRotScalar(Caster, m, m.Player ? 1.25 : 2.00, duration);
@ -104,8 +103,8 @@ namespace Server.Spells.Necromancy
public class MRExpireTimer : Timer
{
private DateTime m_End;
private Mobile m_Target;
private readonly DateTime m_End;
private readonly Mobile m_Target;
public MRExpireTimer(Mobile caster, Mobile target, TimeSpan delay) : base(TimeSpan.FromSeconds(1.0),
TimeSpan.FromSeconds(1.0))

View file

@ -8,13 +8,13 @@ namespace Server.Spells.Necromancy
{
}
public abstract double RequiredSkill{ get; }
public abstract int RequiredMana{ get; }
public abstract double RequiredSkill { get; }
public abstract int RequiredMana { get; }
public override SkillName CastSkill => SkillName.Necromancy;
public override SkillName DamageSkill => SkillName.SpiritSpeak;
//public override int CastDelayBase => base.CastDelayBase; // Reference, 3
// public override int CastDelayBase => base.CastDelayBase; // Reference, 3
public override bool ClearHandsOnCast => false;
@ -25,12 +25,11 @@ namespace Server.Spells.Necromancy
public override int ComputeKarmaAward()
{
//TODO: Verify this formula being that Necro spells don't HAVE a circle.
//int karma = -(70 + (10 * (int)Circle));
// TODO: Verify this formula being that Necro spells don't HAVE a circle.
// int karma = -(70 + (10 * (int)Circle));
int karma = -(40 + (int)(10 * (CastDelayBase.TotalSeconds / CastDelaySecondsPerTick)));
if (Core.ML
) // Pub 36: "Added a new property called Increased Karma Loss which grants higher karma loss for casting necromancy spells."
if (Core.ML) // Pub 36: "Added a new property called Increased Karma Loss which grants higher karma loss for casting necromancy spells."
karma += AOS.Scale(karma, AosAttributes.GetValue(Caster, AosAttribute.IncreasedKarmaLoss));
return karma;

View file

@ -7,15 +7,14 @@ namespace Server.Spells.Necromancy
{
public class PainSpikeSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Pain Spike", "In Sar",
203,
9031,
Reagent.GraveDust,
Reagent.PigIron
);
Reagent.PigIron);
private static Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
private static readonly Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
public PainSpikeSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -42,7 +41,7 @@ namespace Server.Spells.Necromancy
{
SpellHelper.Turn(Caster, m);
//SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m ); //Irrelevent after AoS
// SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m ); //Irrelevent after AoS
/* Temporarily causes intense physical pain to the target, dealing direct damage.
* After 10 seconds the spell wears off, and if the target is still alive,
@ -54,7 +53,7 @@ namespace Server.Spells.Necromancy
m.PlaySound(0x210);
double damage = (GetDamageSkill(Caster) - GetResistSkill(m)) / 10 + (m.Player ? 18 : 30);
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); //Skill check for gain
m.CheckSkill(SkillName.MagicResist, 0.0, 120.0); // Skill check for gain
if (damage < 1)
damage = 1;
@ -81,7 +80,7 @@ namespace Server.Spells.Necromancy
SpellHelper.DoLeech((int)damage, Caster, m);
WeightOverloading.DFA = DFAlgorithm.Standard;
//SpellHelper.Damage( this, m, damage, 100, 0, 0, 0, 0, Misc.DFAlgorithm.PainSpike );
// SpellHelper.Damage( this, m, damage, 100, 0, 0, 0, 0, Misc.DFAlgorithm.PainSpike );
HarmfulSpell(m);
}
@ -90,8 +89,8 @@ namespace Server.Spells.Necromancy
private class InternalTimer : Timer
{
private Mobile m_Mobile;
private int m_ToRestore;
private readonly Mobile m_Mobile;
private readonly int m_ToRestore;
public InternalTimer(Mobile m, double toRestore) : base(TimeSpan.FromSeconds(10.0))
{

View file

@ -9,12 +9,11 @@ namespace Server.Spells.Necromancy
{
public class PoisonStrikeSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Poison Strike", "In Vas Nox",
203,
9031,
Reagent.NoxCrystal
);
Reagent.NoxCrystal);
public PoisonStrikeSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)
@ -47,7 +46,9 @@ namespace Server.Spells.Necromancy
* One tile from main target receives 50% damage, two tiles from target receives 33% damage.
*/
//CheckResisted( m ); // Check magic resist for skill, but do not use return value //reports from OSI: Necro spells don't give Resist gain
// CheckResisted( m );
// Check magic resist for skill, but do not use return value
// reports from OSI: Necro spells don't give Resist gain
Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x36B0, 1,
14, 63, 7, 9915, 0);

View file

@ -6,15 +6,14 @@ namespace Server.Spells.Necromancy
{
public class StrangleSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Strangle", "In Bal Nox",
209,
9031,
Reagent.DaemonBlood,
Reagent.NoxCrystal
);
Reagent.NoxCrystal);
private static Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
private static readonly Dictionary<Mobile, InternalTimer> m_Table = new Dictionary<Mobile, InternalTimer>();
public StrangleSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -39,7 +38,8 @@ namespace Server.Spells.Necromancy
{
SpellHelper.Turn(Caster, m);
//SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m ); //Irrelevent after AoS
// SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m );
// Irrelevent after AoS
/* Temporarily chokes off the air suply of the target with poisonous fumes.
* The target is inflicted with poison damage over time.
@ -70,7 +70,7 @@ namespace Server.Spells.Necromancy
HarmfulSpell(m);
}
//Calculations for the buff bar
// Calculations for the buff bar
double spiritlevel = Caster.Skills.SpiritSpeak.Value / 10;
if (spiritlevel < 4)
spiritlevel = 4;
@ -123,12 +123,15 @@ namespace Server.Spells.Necromancy
private class InternalTimer : Timer
{
private int m_Count, m_MaxCount;
private int m_Count;
private readonly int m_MaxCount;
private int m_HitDelay;
private double m_MinBaseDamage, m_MaxBaseDamage;
private readonly double m_MinBaseDamage;
private readonly double m_MaxBaseDamage;
private DateTime m_NextHit;
private Mobile m_Target, m_From;
private readonly Mobile m_Target;
private readonly Mobile m_From;
public InternalTimer(Mobile target, Mobile from) : base(TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.1))
{
@ -205,8 +208,7 @@ namespace Server.Spells.Necromancy
AOS.Damage(m_Target, m_From, (int)damage, 0, 0, 0, 100, 0);
if (0.60 <= Utility.RandomDouble()
) // OSI: randomly revealed between first and third damage tick, guessing 60% chance
if (Utility.RandomDouble() >= 0.60) // OSI: randomly revealed between first and third damage tick, guessing 60% chance
m_Target.RevealingAction();
}
}

View file

@ -9,14 +9,13 @@ namespace Server.Spells.Necromancy
{
public class SummonFamiliarSpell : NecromancerSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Summon Familiar", "Kal Xen Bal",
203,
9031,
Reagent.BatWing,
Reagent.GraveDust,
Reagent.DaemonBlood
);
Reagent.DaemonBlood);
public SummonFamiliarSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -27,9 +26,9 @@ namespace Server.Spells.Necromancy
public override double RequiredSkill => 30.0;
public override int RequiredMana => 17;
public static Dictionary<Mobile, BaseCreature> Table{ get; } = new Dictionary<Mobile, BaseCreature>();
public static Dictionary<Mobile, BaseCreature> Table { get; } = new Dictionary<Mobile, BaseCreature>();
public static SummonFamiliarEntry[] Entries{ get; } =
public static SummonFamiliarEntry[] Entries { get; } =
{
new SummonFamiliarEntry(typeof(HordeMinionFamiliar), 1060146, 30.0, 30.0), // Horde Minion
new SummonFamiliarEntry(typeof(ShadowWispFamiliar), 1060142, 50.0, 50.0), // Shadow Wisp
@ -69,13 +68,13 @@ namespace Server.Spells.Necromancy
ReqSpiritSpeak = reqSpiritSpeak;
}
public Type Type{ get; }
public Type Type { get; }
public object Name{ get; }
public object Name { get; }
public double ReqNecromancy{ get; }
public double ReqNecromancy { get; }
public double ReqSpiritSpeak{ get; }
public double ReqSpiritSpeak { get; }
}
public class SummonFamiliarGump : Gump
@ -86,10 +85,10 @@ namespace Server.Spells.Necromancy
private const int EnabledColor32 = 0x18CD00;
private const int DisabledColor32 = 0x4A8B52;
private SummonFamiliarEntry[] m_Entries;
private Mobile m_From;
private readonly SummonFamiliarEntry[] m_Entries;
private readonly Mobile m_From;
private SummonFamiliarSpell m_Spell;
private readonly SummonFamiliarSpell m_Spell;
public SummonFamiliarGump(Mobile from, SummonFamiliarEntry[] entries, SummonFamiliarSpell spell) : base(200, 100)
{
@ -143,11 +142,9 @@ namespace Server.Spells.Necromancy
double necro = m_From.Skills.Necromancy.Value;
double spirit = m_From.Skills.SpiritSpeak.Value;
#region Dueling
if ((m_From as PlayerMobile)?.DuelContext?.AllowSpellCast(m_From, m_Spell) == false)
{
}
#endregion
else if (SummonFamiliarSpell.Table.TryGetValue(m_From, out BaseCreature check) && check?.Deleted == false)
{
m_From.SendLocalizedMessage(1061605); // You already have a familiar.

View file

@ -7,7 +7,7 @@ namespace Server.Spells.Necromancy
}
public override bool BlockedByHorrificBeast => false;
public abstract int Body{ get; }
public abstract int Body { get; }
public virtual int Hue => 0;
public virtual int PhysResistOffset => 0;

View file

@ -5,14 +5,13 @@ namespace Server.Spells.Necromancy
{
public class VampiricEmbraceSpell : TransformationSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Vampiric Embrace", "Rel Xen An Sanct",
203,
9031,
Reagent.BatWing,
Reagent.NoxCrystal,
Reagent.PigIron
);
Reagent.PigIron);
public VampiricEmbraceSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,14 +6,13 @@ namespace Server.Spells.Necromancy
{
public class VengefulSpiritSpell : NecromancerSpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Vengeful Spirit", "Kal Xen Bal Beh",
203,
9031,
Reagent.BatWing,
Reagent.GraveDust,
Reagent.PigIron
);
Reagent.PigIron);
public VengefulSpiritSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -7,14 +7,13 @@ namespace Server.Spells.Necromancy
{
public class WitherSpell : NecromancerSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Wither", "Kal Vas An Flam",
203,
9031,
Reagent.NoxCrystal,
Reagent.GraveDust,
Reagent.PigIron
);
Reagent.PigIron);
public WitherSpell(Mobile caster, Item scroll = null)
: base(caster, scroll, m_Info)
@ -93,8 +92,8 @@ namespace Server.Spells.Necromancy
damage /= 100;
// TODO: cap?
//if ( damage > 40 )
// damage = 40;
// if (damage > 40)
// damage = 40;
SpellHelper.Damage(this, m, damage, 0, 0, 100, 0, 0);
}

View file

@ -5,13 +5,12 @@ namespace Server.Spells.Necromancy
{
public class WraithFormSpell : TransformationSpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Wraith Form", "Rel Xen Um",
203,
9031,
Reagent.NoxCrystal,
Reagent.PigIron
);
Reagent.PigIron);
public WraithFormSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -18,14 +18,13 @@ namespace Server.Spells.Ninjitsu
NoSkill
}
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Animal Form", null,
-1,
9002
);
9002);
private static Dictionary<Mobile, int> m_LastAnimalForms = new Dictionary<Mobile, int>();
private static Dictionary<Mobile, AnimalFormContext> m_Table = new Dictionary<Mobile, AnimalFormContext>();
private static readonly Dictionary<Mobile, int> m_LastAnimalForms = new Dictionary<Mobile, int>();
private static readonly Dictionary<Mobile, AnimalFormContext> m_Table = new Dictionary<Mobile, AnimalFormContext>();
private bool m_WasMoving;
@ -42,7 +41,7 @@ namespace Server.Spells.Ninjitsu
public override bool BlockedByAnimalForm => false;
public static AnimalFormEntry[] Entries{ get; } =
public static AnimalFormEntry[] Entries { get; } =
{
new AnimalFormEntry(typeof(Kirin), 1029632, 9632, 0, 1070811, 100.0, 0x84, 0, 0),
new AnimalFormEntry(typeof(Unicorn), 1018214, 9678, 0, 1070812, 100.0, 0x7A, 0, 0),
@ -120,7 +119,7 @@ namespace Server.Spells.Ninjitsu
{
Caster.SendLocalizedMessage(1063219); // You cannot mimic an animal while in that form.
}
else if (!Caster.CanBeginAction<IncognitoSpell>() || Caster.IsBodyMod && GetContext(Caster) == null)
else if (!Caster.CanBeginAction<IncognitoSpell>() || (Caster.IsBodyMod && GetContext(Caster) == null))
{
DoFizzle();
}
@ -187,7 +186,7 @@ namespace Server.Spells.Ninjitsu
AnimalFormEntry entry = Entries[entryID];
m_LastAnimalForms[m] = entryID; //On OSI, it's the last /attempted/ one not the last succeeded one
m_LastAnimalForms[m] = entryID; // On OSI, it's the last /attempted/ one not the last succeeded one
if (m.Skills.Ninjitsu.Value < entry.ReqSkill)
{
@ -198,7 +197,7 @@ namespace Server.Spells.Ninjitsu
}
/*
if ( !m.CheckSkill( SkillName.Ninjitsu, entry.ReqSkill, entry.ReqSkill + 37.5 ) )
if (!m.CheckSkill( SkillName.Ninjitsu, entry.ReqSkill, entry.ReqSkill + 37.5 ))
return MorphResult.Fail;
*
* On OSI,it seems you can only gain starting at '0' using Animal form.
@ -311,9 +310,9 @@ namespace Server.Spells.Ninjitsu
public class AnimalFormEntry
{
private int m_HueModMax;
private readonly int m_HueModMax;
private int m_HueModMin;
private readonly int m_HueModMin;
/*
private AnimalFormCallback m_TransformCallback;
private AnimalFormCallback m_UntransformCallback;
@ -337,33 +336,33 @@ namespace Server.Spells.Ninjitsu
StealingBonus = stealingBonus;
}
public Type Type{ get; }
public Type Type { get; }
public TextDefinition Name{ get; }
public TextDefinition Name { get; }
public int ItemID{ get; }
public int ItemID { get; }
public int Hue{ get; }
public int Hue { get; }
public int Tooltip{ get; }
public int Tooltip { get; }
public double ReqSkill{ get; }
public double ReqSkill { get; }
public int BodyMod{ get; }
public int BodyMod { get; }
public int HueMod => Utility.RandomMinMax(m_HueModMin, m_HueModMax);
public bool StealthBonus{ get; }
public bool StealthBonus { get; }
public bool SpeedBoost{ get; }
public bool SpeedBoost { get; }
public bool StealingBonus{ get; }
public bool StealingBonus { get; }
}
public class AnimalFormGump : Gump
{
//TODO: Convert this for ML to the BaseImageTileButtonsGump
private Mobile m_Caster;
private AnimalForm m_Spell;
// TODO: Convert this for ML to the BaseImageTileButtonsGump
private readonly Mobile m_Caster;
private readonly AnimalForm m_Spell;
public AnimalFormGump(Mobile caster, AnimalFormEntry[] entries, AnimalForm spell)
: base(50, 50)
@ -449,14 +448,9 @@ namespace Server.Spells.Ninjitsu
}
else if (BaseFormTalisman.EntryEnabled(sender.Mobile, entry.Type))
{
#region Dueling
if ((m_Caster as PlayerMobile)?.DuelContext?.AllowSpellCast(m_Caster, m_Spell) == false)
{
}
#endregion
else if (Morph(m_Caster, entryID) == MorphResult.Fail)
{
m_Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502632); // The spell fizzles.
@ -484,24 +478,24 @@ namespace Server.Spells.Ninjitsu
StealingMod = stealingMod;
}
public Timer Timer{ get; }
public Timer Timer { get; }
public SkillMod Mod{ get; }
public SkillMod Mod { get; }
public bool SpeedBoost{ get; }
public bool SpeedBoost { get; }
public Type Type{ get; }
public Type Type { get; }
public SkillMod StealingMod{ get; }
public SkillMod StealingMod { get; }
}
public class AnimalFormTimer : Timer
{
private int m_Body;
private readonly int m_Body;
private int m_Counter;
private int m_Hue;
private readonly int m_Hue;
private Mobile m_LastTarget;
private Mobile m_Mobile;
private readonly Mobile m_Mobile;
public AnimalFormTimer(Mobile from, int body, int hue)
: base(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0))

View file

@ -38,7 +38,7 @@ namespace Server.Spells.Ninjitsu
if (valid)
{
attacker.BeginAction<Stealth>();
Timer.DelayCall(TimeSpan.FromSeconds(5.0), delegate { attacker.EndAction<Stealth>(); });
Timer.DelayCall(TimeSpan.FromSeconds(5.0), attacker.EndAction<Stealth>);
}
return valid;
@ -46,7 +46,7 @@ namespace Server.Spells.Ninjitsu
public override void OnHit(Mobile attacker, Mobile defender, int damage)
{
//Validates before swing
// Validates before swing
ClearCurrentMove(attacker);
@ -68,4 +68,4 @@ namespace Server.Spells.Ninjitsu
attacker.RevealingAction();
}
}
}
}

View file

@ -7,7 +7,7 @@ namespace Server.Spells.Ninjitsu
{
public class DeathStrike : NinjaMove
{
private static Dictionary<Mobile, DeathStrikeInfo> m_Table = new Dictionary<Mobile, DeathStrikeInfo>();
private static readonly Dictionary<Mobile, DeathStrikeInfo> m_Table = new Dictionary<Mobile, DeathStrikeInfo>();
public override int BaseMana => 30;
public override double RequiredSkill => 85.0;
@ -31,7 +31,7 @@ namespace Server.Spells.Ninjitsu
// TODO: should be defined onHit method, what if the player hit and remove the weapon before process? ;)
bool isRanged = attacker.Weapon is BaseRanged;
if (ninjitsu < 100) //This formula is an approximation from OSI data. TODO: find correct formula
if (ninjitsu < 100) // This formula is an approximation from OSI data. TODO: find correct formula
chance = 30 + (ninjitsu - 85) * 2.2;
else
chance = 63 + (ninjitsu - 100) * 1.1;
@ -130,11 +130,11 @@ namespace Server.Spells.Ninjitsu
private class DeathStrikeInfo
{
public Mobile m_Attacker;
public int m_DamageBonus;
public bool m_isRanged;
public readonly Mobile m_Attacker;
public readonly int m_DamageBonus;
public readonly bool m_isRanged;
public int m_Steps;
public Mobile m_Target;
public readonly Mobile m_Target;
public Timer m_Timer;
public DeathStrikeInfo(Mobile target, Mobile attacker, int damageBonus, bool isRanged)

View file

@ -6,7 +6,7 @@ namespace Server.Spells.Ninjitsu
{
public class KiAttack : NinjaMove
{
private static Dictionary<Mobile, KiAttackInfo> m_Table = new Dictionary<Mobile, KiAttackInfo>();
private static readonly Dictionary<Mobile, KiAttackInfo> m_Table = new Dictionary<Mobile, KiAttackInfo>();
public override int BaseMana => 25;
public override double RequiredSkill => 80.0;
@ -116,7 +116,7 @@ namespace Server.Spells.Ninjitsu
private class KiAttackInfo
{
public Point3D m_Location;
public Mobile m_Mobile;
public readonly Mobile m_Mobile;
public Timer m_Timer;
public KiAttackInfo(Mobile m)

View file

@ -10,13 +10,12 @@ namespace Server.Spells.Ninjitsu
{
public class MirrorImage : NinjaSpell
{
private static Dictionary<Mobile, int> m_CloneCount = new Dictionary<Mobile, int>();
private static readonly Dictionary<Mobile, int> m_CloneCount = new Dictionary<Mobile, int>();
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Mirror Image", null,
-1,
9002
);
9002);
public MirrorImage(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
@ -225,7 +224,6 @@ namespace Server.Mobiles
}
}
namespace Server.Mobiles
{
public class CloneAI : BaseAI

View file

@ -6,7 +6,7 @@ namespace Server.Spells
public override void CheckGain(Mobile m)
{
m.CheckSkill(MoveSkill, RequiredSkill - 12.5, RequiredSkill + 37.5); //Per five on friday 02/16/07
m.CheckSkill(MoveSkill, RequiredSkill - 12.5, RequiredSkill + 37.5); // Per five on friday 02/16/07
}
}
}

View file

@ -8,8 +8,8 @@ namespace Server.Spells.Ninjitsu
{
}
public abstract double RequiredSkill{ get; }
public abstract int RequiredMana{ get; }
public abstract double RequiredSkill { get; }
public abstract int RequiredMana { get; }
public override SkillName CastSkill => SkillName.Ninjitsu;
public override SkillName DamageSkill => SkillName.Ninjitsu;
@ -20,7 +20,7 @@ namespace Server.Spells.Ninjitsu
public override bool BlocksMovement => false;
//public override int CastDelayBase => 1;
// public override int CastDelayBase => 1;
public override int CastRecoveryBase => 7;
@ -85,7 +85,7 @@ namespace Server.Spells.Ninjitsu
public override void GetCastSkills(out double min, out double max)
{
min = RequiredSkill - 12.5; //Per 5 on friday 2/16/07
min = RequiredSkill - 12.5; // Per 5 on friday 2/16/07
max = RequiredSkill + 37.5;
}

View file

@ -11,11 +11,10 @@ namespace Server.Spells.Ninjitsu
{
public class Shadowjump : NinjaSpell, ISpellTargetingPoint3D
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Shadowjump", null,
-1,
9002
);
9002);
public Shadowjump(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{

View file

@ -6,7 +6,7 @@ namespace Server.Spells.Ninjitsu
{
public class SurpriseAttack : NinjaMove
{
private static Dictionary<Mobile, SurpriseAttackInfo> m_Table = new Dictionary<Mobile, SurpriseAttackInfo>();
private static readonly Dictionary<Mobile, SurpriseAttackInfo> m_Table = new Dictionary<Mobile, SurpriseAttackInfo>();
public override int BaseMana => 20;
public override double RequiredSkill => Core.ML ? 60.0 : 30.0;
@ -33,7 +33,7 @@ namespace Server.Spells.Ninjitsu
if (valid)
{
attacker.BeginAction<Stealth>();
Timer.DelayCall(TimeSpan.FromSeconds(5.0), delegate { attacker.EndAction<Stealth>(); });
Timer.DelayCall(TimeSpan.FromSeconds(5.0), attacker.EndAction<Stealth>);
}
return valid;
@ -41,7 +41,7 @@ namespace Server.Spells.Ninjitsu
public override void OnHit(Mobile attacker, Mobile defender, int damage)
{
//Validates before swing
// Validates before swing
ClearCurrentMove(attacker);
@ -99,8 +99,8 @@ namespace Server.Spells.Ninjitsu
private class SurpriseAttackInfo
{
public int m_Malus;
public Mobile m_Target;
public readonly int m_Malus;
public readonly Mobile m_Target;
public Timer m_Timer;
public SurpriseAttackInfo(Mobile target, int effect)

View file

@ -5,7 +5,7 @@ namespace Server.Spells
{
public class Reagent
{
private static Type[] m_Types =
private static readonly Type[] m_Types =
{
typeof(BlackPearl),
typeof(Bloodmoss),

View file

@ -6,13 +6,12 @@ namespace Server.Spells.Second
{
public class AgilitySpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Agility", "Ex Uus",
212,
9061,
Reagent.Bloodmoss,
Reagent.MandrakeRoot
);
Reagent.MandrakeRoot);
public AgilitySpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -6,13 +6,12 @@ namespace Server.Spells.Second
{
public class CunningSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Cunning", "Uus Wis",
212,
9061,
Reagent.MandrakeRoot,
Reagent.Nightshade
);
Reagent.Nightshade);
public CunningSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -5,13 +5,12 @@ namespace Server.Spells.Second
{
public class CureSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Cure", "An Nox",
212,
9061,
Reagent.Garlic,
Reagent.Ginseng
);
Reagent.Ginseng);
public CureSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -4,13 +4,12 @@ namespace Server.Spells.Second
{
public class HarmSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Harm", "An Mani",
212,
Core.AOS ? 9001 : 9041,
Reagent.Nightshade,
Reagent.SpidersSilk
);
Reagent.SpidersSilk);
public HarmSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

View file

@ -5,14 +5,13 @@ namespace Server.Spells.Second
{
public class MagicTrapSpell : MagerySpell, ISpellTargetingItem
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Magic Trap", "In Jux",
212,
9001,
Reagent.Garlic,
Reagent.SpidersSilk,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
public MagicTrapSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -35,7 +34,7 @@ namespace Server.Spells.Second
}
else if (cont.TrapType != TrapType.None && cont.TrapType != TrapType.MagicTrap)
{
base.DoFizzle();
this.DoFizzle();
}
else if (CheckSequence())
{

View file

@ -5,22 +5,21 @@ namespace Server.Spells.Second
{
public class ProtectionSpell : MagerySpell
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Protection", "Uus Sanct",
236,
9011,
Reagent.Garlic,
Reagent.Ginseng,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
private static Dictionary<Mobile, Tuple<ResistanceMod, DefaultSkillMod>> m_Table = new Dictionary<Mobile, Tuple<ResistanceMod, DefaultSkillMod>>();
private static readonly Dictionary<Mobile, Tuple<ResistanceMod, DefaultSkillMod>> m_Table = new Dictionary<Mobile, Tuple<ResistanceMod, DefaultSkillMod>>();
public ProtectionSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
}
public static Dictionary<Mobile, double> Registry{ get; } = new Dictionary<Mobile, double>();
public static Dictionary<Mobile, double> Registry { get; } = new Dictionary<Mobile, double>();
public override SpellCircle Circle => SpellCircle.Second;
@ -40,7 +39,6 @@ namespace Server.Spells.Second
Caster.SendLocalizedMessage(1005385); // The spell will not adhere to you at this time.
return false;
}
public static void Toggle(Mobile caster, Mobile target)
@ -63,8 +61,7 @@ namespace Server.Spells.Second
new ResistanceMod(ResistanceType.Physical,
-15 + Math.Min((int)(caster.Skills.Inscribe.Value / 20), 15)),
new DefaultSkillMod(SkillName.MagicResist, true,
-35 + Math.Min((int)(caster.Skills.Inscribe.Value / 20), 35))
);
-35 + Math.Min((int)(caster.Skills.Inscribe.Value / 20), 35)));
m_Table[target] = mods;
Registry[target] = 100.0;
@ -157,7 +154,7 @@ namespace Server.Spells.Second
private class InternalTimer : Timer
{
private Mobile m_Caster;
private readonly Mobile m_Caster;
public InternalTimer(Mobile caster) : base(TimeSpan.FromSeconds(0))
{

View file

@ -5,13 +5,12 @@ namespace Server.Spells.Second
{
public class RemoveTrapSpell : MagerySpell, ISpellTargetingItem
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Remove Trap", "An Jux",
212,
9001,
Reagent.Bloodmoss,
Reagent.SulfurousAsh
);
Reagent.SulfurousAsh);
public RemoveTrapSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{
@ -35,7 +34,7 @@ namespace Server.Spells.Second
}
else if (cont.TrapType != TrapType.None && cont.TrapType != TrapType.MagicTrap)
{
base.DoFizzle();
this.DoFizzle();
}
else if (CheckSequence())
{

View file

@ -6,13 +6,12 @@ namespace Server.Spells.Second
{
public class StrengthSpell : MagerySpell, ISpellTargetingMobile
{
private static SpellInfo m_Info = new SpellInfo(
private static readonly SpellInfo m_Info = new SpellInfo(
"Strength", "Uus Mani",
212,
9061,
Reagent.MandrakeRoot,
Reagent.Nightshade
);
Reagent.Nightshade);
public StrengthSpell(Mobile caster, Item scroll = null) : base(caster, scroll, m_Info)
{

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