Formatting FIxes (#58)

This commit is contained in:
Kamron Batman 2019-10-04 23:08:13 -07:00 committed by GitHub
parent 57fb9fb525
commit 096d39609e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1318 changed files with 11633 additions and 22129 deletions

View file

@ -18,10 +18,7 @@ namespace Server.Spells
public override TimeSpan CastDelayBase => TimeSpan.FromSeconds((3 + (int)Circle) * CastDelaySecondsPerTick);
public override bool ConsumeReagents()
{
return base.ConsumeReagents() || ArcaneGem.ConsumeCharges(Caster, Core.SE ? 1 : 1 + (int)Circle);
}
public override bool ConsumeReagents() => base.ConsumeReagents() || ArcaneGem.ConsumeCharges(Caster, Core.SE ? 1 : 1 + (int)Circle);
public override void GetCastSkills(out double min, out double max)
{
@ -36,10 +33,7 @@ namespace Server.Spells
max = avg + ChanceOffset;
}
public override int GetMana()
{
return Scroll is BaseWand ? 0 : m_ManaTable[(int)Circle];
}
public override int GetMana() => Scroll is BaseWand ? 0 : m_ManaTable[(int)Circle];
public override double GetResistSkill(Mobile m)
{
@ -83,10 +77,7 @@ namespace Server.Spells
2.0; // Seems should be about half of what stratics says.
}
public virtual double GetResistPercent(Mobile target)
{
return GetResistPercentForCircle(target, Circle);
}
public virtual double GetResistPercent(Mobile target) => GetResistPercentForCircle(target, Circle);
public override TimeSpan GetCastDelay()
{

View file

@ -27,27 +27,15 @@ namespace Server.Spells
public virtual bool ValidatesDuringHit => true;
public virtual int GetAccuracyBonus(Mobile attacker)
{
return 0;
}
public virtual int GetAccuracyBonus(Mobile attacker) => 0;
public virtual double GetDamageScalar(Mobile attacker, Mobile defender)
{
return 1.0;
}
public virtual double GetDamageScalar(Mobile attacker, Mobile defender) => 1.0;
// Called before swinging, to make sure the accuracy scalar is to be computed.
public virtual bool OnBeforeSwing(Mobile attacker, Mobile defender)
{
return true;
}
public virtual bool OnBeforeSwing(Mobile attacker, Mobile defender) => true;
// Called when a hit connects, but before damage is calculated.
public virtual bool OnBeforeDamage(Mobile attacker, Mobile defender)
{
return true;
}
public virtual bool OnBeforeDamage(Mobile attacker, Mobile defender) => true;
// Called as soon as the ability is used.
public virtual void OnUse(Mobile from)
@ -69,15 +57,9 @@ namespace Server.Spells
{
}
public virtual bool IgnoreArmor(Mobile attacker)
{
return false;
}
public virtual bool IgnoreArmor(Mobile attacker) => false;
public virtual double GetPropertyBonus(Mobile attacker)
{
return 1.0;
}
public virtual double GetPropertyBonus(Mobile attacker) => 1.0;
public virtual bool CheckSkills(Mobile m)
{
@ -302,10 +284,7 @@ namespace Server.Spells
}
}
private static SpecialMoveContext GetContext(Mobile m)
{
return m_PlayersTable.TryGetValue(m, out SpecialMoveContext context) ? context : null;
}
private static SpecialMoveContext GetContext(Mobile m) => m_PlayersTable.TryGetValue(m, out SpecialMoveContext context) ? context : null;
private class SpecialMoveTimer : Timer
{

View file

@ -126,10 +126,7 @@ namespace Server.Spells
return true;
}
public virtual bool OnCastInTown(Region r)
{
return Info.AllowTown;
}
public virtual bool OnCastInTown(Region r) => Info.AllowTown;
public void StartDelayedDamageContext(Mobile m, Timer t)
{
@ -162,10 +159,7 @@ namespace Server.Spells
return GetNewAosDamage(bonus, dice, sides, false);
}
public virtual int GetNewAosDamage(int bonus, int dice, int sides, bool playerVsPlayer)
{
return GetNewAosDamage(bonus, dice, sides, playerVsPlayer, 1.0);
}
public virtual int GetNewAosDamage(int bonus, int dice, int sides, bool playerVsPlayer) => GetNewAosDamage(bonus, dice, sides, playerVsPlayer, 1.0);
public virtual int GetNewAosDamage(int bonus, int dice, int sides, bool playerVsPlayer, double scalar)
{
@ -225,40 +219,15 @@ namespace Server.Spells
return false;
}
public virtual double GetInscribeSkill(Mobile m)
{
// There is no chance to gain
// m.CheckSkill( SkillName.Inscribe, 0.0, 120.0 );
public virtual double GetInscribeSkill(Mobile m) => m.Skills.Inscribe.Value;
return m.Skills.Inscribe.Value;
}
public virtual int GetInscribeFixed(Mobile m) => m.Skills.Inscribe.Fixed;
public virtual int GetInscribeFixed(Mobile m)
{
// There is no chance to gain
// m.CheckSkill( SkillName.Inscribe, 0.0, 120.0 );
public virtual int GetDamageFixed(Mobile m) => m.Skills[DamageSkill].Fixed;
return m.Skills.Inscribe.Fixed;
}
public virtual double GetDamageSkill(Mobile m) => m.Skills[DamageSkill].Value;
public virtual int GetDamageFixed(Mobile m)
{
//m.CheckSkill( DamageSkill, 0.0, m.Skills[DamageSkill].Cap );
return m.Skills[DamageSkill].Fixed;
}
public virtual double GetDamageSkill(Mobile m)
{
//m.CheckSkill( DamageSkill, 0.0, m.Skills[DamageSkill].Cap );
return m.Skills[DamageSkill].Value;
}
public virtual double GetResistSkill(Mobile m)
{
return m.Skills.MagicResist.Value;
}
public virtual double GetResistSkill(Mobile m) => m.Skills.MagicResist.Value;
public virtual double GetDamageScalar(Mobile target)
{
@ -359,10 +328,7 @@ namespace Server.Spells
}
}
public virtual bool CheckDisturb(DisturbType type, bool firstCircle, bool resistable)
{
return !(resistable && Scroll is BaseWand);
}
public virtual bool CheckDisturb(DisturbType type, bool firstCircle, bool resistable) => !(resistable && Scroll is BaseWand);
public void Disturb(DisturbType type, bool firstCircle = true, bool resistable = false)
{
@ -417,10 +383,7 @@ namespace Server.Spells
Caster.SendLocalizedMessage(500641); // Your concentration is disturbed, thus ruining thy spell.
}
public virtual bool CheckCast()
{
return true;
}
public virtual bool CheckCast() => true;
public virtual void SayMantra()
{
@ -665,10 +628,7 @@ namespace Server.Spells
Caster.Spell = null;
}
public virtual int ComputeKarmaAward()
{
return 0;
}
public virtual int ComputeKarmaAward() => 0;
public virtual bool CheckSequence()
{
@ -762,10 +722,7 @@ namespace Server.Spells
return false;
}
public bool CheckBSequence(Mobile target)
{
return CheckBSequence(target, false);
}
public bool CheckBSequence(Mobile target) => CheckBSequence(target, false);
public bool CheckBSequence(Mobile target, bool allowDead)
{

View file

@ -241,11 +241,7 @@ namespace Server.Spells
return false;
}
public static bool CanRevealCaster(Mobile m)
{
return m is BaseCreature c && !c.Controlled;
}
public static bool CanRevealCaster(Mobile m) => m is BaseCreature c && !c.Controlled;
public static void GetSurfaceTop(ref IPoint3D p)
{
@ -274,10 +270,7 @@ namespace Server.Spells
return true;
}
public static bool AddStatBonus(Mobile caster, Mobile target, StatType type)
{
return AddStatBonus(caster, target, type, GetOffset(caster, target, type, false), GetDuration(caster, target));
}
public static bool AddStatBonus(Mobile caster, Mobile target, StatType type) => AddStatBonus(caster, target, type, GetOffset(caster, target, type, false), GetDuration(caster, target));
public static bool AddStatBonus(Mobile caster, Mobile target, StatType type, int bonus, TimeSpan duration)
{
@ -301,10 +294,7 @@ namespace Server.Spells
return false;
}
public static bool AddStatCurse(Mobile caster, Mobile target, StatType type)
{
return AddStatCurse(caster, target, type, GetOffset(caster, target, type, true), GetDuration(caster, target));
}
public static bool AddStatCurse(Mobile caster, Mobile target, StatType type) => AddStatCurse(caster, target, type, GetOffset(caster, target, type, true), GetDuration(caster, target));
public static bool AddStatCurse(Mobile caster, Mobile target, StatType type, int curse, TimeSpan duration)
{
@ -592,15 +582,9 @@ namespace Server.Spells
caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work...
}
public static bool CheckTravel(Mobile caster, TravelCheckType type)
{
return CheckTravel(caster, caster.Map, caster.Location, type);
}
public static bool CheckTravel(Mobile caster, TravelCheckType type) => CheckTravel(caster, caster.Map, caster.Location, type);
public static bool CheckTravel(Map map, Point3D loc, TravelCheckType type)
{
return CheckTravel(null, map, loc, type);
}
public static bool CheckTravel(Map map, Point3D loc, TravelCheckType type) => CheckTravel(null, map, loc, type);
public static bool CheckTravel(Mobile caster, Map map, Point3D loc, TravelCheckType type)
{
@ -644,20 +628,11 @@ namespace Server.Spells
return x >= 5120 && y >= 0 && x < 5376 && y < 256;
}
public static bool IsFeluccaWind(Map map, Point3D loc)
{
return map == Map.Felucca && IsWindLoc(loc);
}
public static bool IsFeluccaWind(Map map, Point3D loc) => map == Map.Felucca && IsWindLoc(loc);
public static bool IsTrammelWind(Map map, Point3D loc)
{
return map == Map.Trammel && IsWindLoc(loc);
}
public static bool IsTrammelWind(Map map, Point3D loc) => map == Map.Trammel && IsWindLoc(loc);
public static bool IsIlshenar(Map map, Point3D loc)
{
return map == Map.Ilshenar;
}
public static bool IsIlshenar(Map map, Point3D loc) => map == Map.Ilshenar;
public static bool IsSolenHiveLoc(Point3D loc)
{
@ -666,15 +641,9 @@ namespace Server.Spells
return x >= 5640 && y >= 1776 && x < 5935 && y < 2039;
}
public static bool IsTrammelSolenHive(Map map, Point3D loc)
{
return map == Map.Trammel && IsSolenHiveLoc(loc);
}
public static bool IsTrammelSolenHive(Map map, Point3D loc) => map == Map.Trammel && IsSolenHiveLoc(loc);
public static bool IsFeluccaSolenHive(Map map, Point3D loc)
{
return map == Map.Felucca && IsSolenHiveLoc(loc);
}
public static bool IsFeluccaSolenHive(Map map, Point3D loc) => map == Map.Felucca && IsSolenHiveLoc(loc);
public static bool IsFeluccaT2A(Map map, Point3D loc)
{
@ -696,10 +665,7 @@ namespace Server.Spells
return region.IsPartOf<DungeonRegion>() && region.Map == Map.Felucca;
}
public static bool IsKhaldun(Map map, Point3D loc)
{
return Region.Find(loc, map).Name == "Khaldun";
}
public static bool IsKhaldun(Map map, Point3D loc) => Region.Find(loc, map).Name == "Khaldun";
public static bool IsCrystalCave(Map map, Point3D loc)
{
@ -728,22 +694,9 @@ namespace Server.Spells
return false;
}
public static bool IsFactionStronghold(Map map, Point3D loc)
{
/*// Teleporting is allowed, but only for faction members
if ( !Core.AOS && m_TravelCaster != null && (m_TravelType == TravelCheckType.TeleportTo || m_TravelType == TravelCheckType.TeleportFrom) )
{
if ( Factions.Faction.Find( m_TravelCaster, true, true ) != null )
return false;
}*/
public static bool IsFactionStronghold(Map map, Point3D loc) => Region.Find(loc, map).IsPartOf<StrongholdRegion>();
return Region.Find(loc, map).IsPartOf<StrongholdRegion>();
}
public static bool IsChampionSpawn(Map map, Point3D loc)
{
return Region.Find(loc, map).IsPartOf<ChampionSpawnRegion>();
}
public static bool IsChampionSpawn(Map map, Point3D loc) => Region.Find(loc, map).IsPartOf<ChampionSpawnRegion>();
public static bool IsDoomFerry(Map map, Point3D loc)
{
@ -812,10 +765,7 @@ namespace Server.Spells
return (map == Map.Trammel || map == Map.Felucca) && x >= 6911 && y >= 254 && x < 7167 && y < 511;
}
public static bool IsMLDungeon(Map map, Point3D loc)
{
return MondainsLegacy.IsMLRegion(Region.Find(loc, map));
}
public static bool IsMLDungeon(Map map, Point3D loc) => MondainsLegacy.IsMLRegion(Region.Find(loc, map));
public static bool IsInvalid(Map map, Point3D loc)
{
@ -1307,15 +1257,9 @@ namespace Server.Spells
return context;
}
public static bool UnderTransformation(Mobile m)
{
return GetContext(m) != null;
}
public static bool UnderTransformation(Mobile m) => GetContext(m) != null;
public static bool UnderTransformation(Mobile m, Type type)
{
return GetContext(m)?.Type == type;
}
public static bool UnderTransformation(Mobile m, Type type) => GetContext(m)?.Type == type;
#endregion
}

View file

@ -58,20 +58,11 @@ namespace Server.Spells
public static Dictionary<int, SpecialMove> SpecialMoves{ get; } = new Dictionary<int, SpecialMove>();
public static int GetRegistryNumber(ISpell s)
{
return GetRegistryNumber(s.GetType());
}
public static int GetRegistryNumber(ISpell s) => GetRegistryNumber(s.GetType());
public static int GetRegistryNumber(SpecialMove s)
{
return GetRegistryNumber(s.GetType());
}
public static int GetRegistryNumber(SpecialMove s) => GetRegistryNumber(s.GetType());
public static int GetRegistryNumber(Type type)
{
return m_IDsFromTypes.TryGetValue(type, out int value) ? value : -1;
}
public static int GetRegistryNumber(Type type) => m_IDsFromTypes.TryGetValue(type, out int value) ? value : -1;
public static void Register(int spellID, Type type)
{