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

@ -1,93 +1,78 @@
using System;
namespace Server.Spells.Mysticism
{
public abstract class MysticSpell : Spell
{
public MysticSpell(Mobile caster, Item scroll, SpellInfo info)
: base(caster, scroll, info)
{
}
public abstract double RequiredSkill{ get; }
public abstract int RequiredMana{ get; }
public override SkillName CastSkill => SkillName.Mysticism;
/*
* As per OSI Publish 64:
* Imbuing is not the only skill associated with Mysticism now.
* Players can use EITHER their Focus skill or Imbuing skill.
* Evaluate Intelligence no longer has any effect on a Mystic’s spell power.
*/
public override double GetDamageSkill(Mobile m)
{
return Math.Max(m.Skills.Imbuing.Value, m.Skills.Focus.Value);
}
public override int GetDamageFixed(Mobile m)
{
return Math.Max(m.Skills.Imbuing.Fixed, m.Skills.Focus.Fixed);
}
public override void GetCastSkills(out double min, out double max)
{
// As per Mysticism page at the UO Herald Playguide
// This means that we have 25% success chance at min Required Skill
min = RequiredSkill - 12.5;
max = RequiredSkill + 37.5;
}
public override int GetMana()
{
return RequiredMana;
}
public override bool CheckCast()
{
if (!base.CheckCast())
return false;
int mana = ScaleMana(RequiredMana);
if (Caster.Mana < mana)
{
Caster.SendLocalizedMessage(1060174,
mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
}
if (Caster.Skills[CastSkill].Value < RequiredSkill)
{
Caster.SendLocalizedMessage(1063013,
$"{RequiredSkill.ToString("F1")}\t{CastSkill.ToString()}\t "); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
return false;
}
return true;
}
public override void OnBeginCast()
{
base.OnBeginCast();
SendCastEffect();
}
public virtual void SendCastEffect()
{
Caster.FixedEffect(0x37C4, 10, (int)(GetCastDelay().TotalSeconds * 28), 0x66C, 3);
}
public static double GetBaseSkill(Mobile m)
{
return m.Skills.Mysticism.Value;
}
public static double GetBoostSkill(Mobile m)
{
return Math.Max(m.Skills.Imbuing.Value, m.Skills.Focus.Value);
}
}
using System;
namespace Server.Spells.Mysticism
{
public abstract class MysticSpell : Spell
{
public MysticSpell(Mobile caster, Item scroll, SpellInfo info)
: base(caster, scroll, info)
{
}
public abstract double RequiredSkill{ get; }
public abstract int RequiredMana{ get; }
public override SkillName CastSkill => SkillName.Mysticism;
/*
* As per OSI Publish 64:
* Imbuing is not the only skill associated with Mysticism now.
* Players can use EITHER their Focus skill or Imbuing skill.
* Evaluate Intelligence no longer has any effect on a Mystic’s spell power.
*/
public override double GetDamageSkill(Mobile m) => Math.Max(m.Skills.Imbuing.Value, m.Skills.Focus.Value);
public override int GetDamageFixed(Mobile m) => Math.Max(m.Skills.Imbuing.Fixed, m.Skills.Focus.Fixed);
public override void GetCastSkills(out double min, out double max)
{
// As per Mysticism page at the UO Herald Playguide
// This means that we have 25% success chance at min Required Skill
min = RequiredSkill - 12.5;
max = RequiredSkill + 37.5;
}
public override int GetMana() => RequiredMana;
public override bool CheckCast()
{
if (!base.CheckCast())
return false;
int mana = ScaleMana(RequiredMana);
if (Caster.Mana < mana)
{
Caster.SendLocalizedMessage(1060174,
mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
return false;
}
if (Caster.Skills[CastSkill].Value < RequiredSkill)
{
Caster.SendLocalizedMessage(1063013,
$"{RequiredSkill.ToString("F1")}\t{CastSkill.ToString()}\t "); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
return false;
}
return true;
}
public override void OnBeginCast()
{
base.OnBeginCast();
SendCastEffect();
}
public virtual void SendCastEffect()
{
Caster.FixedEffect(0x37C4, 10, (int)(GetCastDelay().TotalSeconds * 28), 0x66C, 3);
}
public static double GetBaseSkill(Mobile m) => m.Skills.Mysticism.Value;
public static double GetBoostSkill(Mobile m) => Math.Max(m.Skills.Imbuing.Value, m.Skills.Focus.Value);
}
}

View file

@ -79,10 +79,7 @@ namespace Server.Spells.Mysticism
FinishSequence();
}
public static bool UnderEffect(Mobile m)
{
return m_Table.ContainsKey(m);
}
public static bool UnderEffect(Mobile m) => m_Table.ContainsKey(m);
public static void RemoveEffect(Mobile m)
{
@ -197,10 +194,8 @@ namespace Server.Spells.Mysticism
private SpellPlagueSpell m_Owner;
public InternalTarget(SpellPlagueSpell owner)
: base(12, false, TargetFlags.Harmful)
{
: base(12, false, TargetFlags.Harmful) =>
m_Owner = owner;
}
protected override void OnTarget(Mobile from, object o)
{

View file

@ -36,10 +36,7 @@ namespace Server.Spells.Mysticism
EventSink.PlayerDeath += OnPlayerDeath;
}
public static bool UnderEffect(Mobile m)
{
return m_Table.ContainsKey(m);
}
public static bool UnderEffect(Mobile m) => m_Table.ContainsKey(m);
public override bool CheckCast()
{
@ -129,15 +126,9 @@ namespace Server.Spells.Mysticism
FinishSequence();
}
public static int GetDIBonus(Mobile m)
{
return (int)((GetBaseSkill(m) + GetBoostSkill(m)) / 12.0);
}
public static int GetDIBonus(Mobile m) => (int)((GetBaseSkill(m) + GetBoostSkill(m)) / 12.0);
public static int GetResistCapBonus(Mobile m)
{
return (int)((GetBaseSkill(m) + GetBoostSkill(m)) / 48.0);
}
public static int GetResistCapBonus(Mobile m) => (int)((GetBaseSkill(m) + GetBoostSkill(m)) / 48.0);
public static void RemoveEffects(Mobile m)
{