Fixes code according to modern code style. Fixes a few expression bugs.
This commit is contained in:
parent
89eea25e5f
commit
970fd563b2
3324 changed files with 441118 additions and 433755 deletions
|
|
@ -3,139 +3,145 @@ using Server.Network;
|
|||
|
||||
namespace Server.Spells.Chivalry
|
||||
{
|
||||
public abstract class PaladinSpell : Spell
|
||||
{
|
||||
public abstract double RequiredSkill{ get; }
|
||||
public abstract int RequiredMana{ get; }
|
||||
public abstract int RequiredTithing{ get; }
|
||||
public abstract int MantraNumber{ get; }
|
||||
public abstract class PaladinSpell : Spell
|
||||
{
|
||||
public PaladinSpell(Mobile caster, Item scroll, SpellInfo info) : base(caster, scroll, info)
|
||||
{
|
||||
}
|
||||
|
||||
public override SkillName CastSkill => SkillName.Chivalry;
|
||||
public override SkillName DamageSkill => SkillName.Chivalry;
|
||||
public abstract double RequiredSkill{ get; }
|
||||
public abstract int RequiredMana{ get; }
|
||||
public abstract int RequiredTithing{ get; }
|
||||
public abstract int MantraNumber{ get; }
|
||||
|
||||
public override bool ClearHandsOnCast => false;
|
||||
public override SkillName CastSkill => SkillName.Chivalry;
|
||||
public override SkillName DamageSkill => SkillName.Chivalry;
|
||||
|
||||
//public override int CastDelayBase => 1;
|
||||
public override bool ClearHandsOnCast => false;
|
||||
|
||||
public override int CastRecoveryBase => 7;
|
||||
//public override int CastDelayBase => 1;
|
||||
|
||||
public PaladinSpell( Mobile caster, Item scroll, SpellInfo info ) : base( caster, scroll, info )
|
||||
{
|
||||
}
|
||||
public override int CastRecoveryBase => 7;
|
||||
|
||||
public override bool CheckCast()
|
||||
{
|
||||
int mana = ScaleMana( RequiredMana );
|
||||
public override bool CheckCast()
|
||||
{
|
||||
int mana = ScaleMana(RequiredMana);
|
||||
|
||||
if ( !base.CheckCast() )
|
||||
return false;
|
||||
if (!base.CheckCast())
|
||||
return false;
|
||||
|
||||
if ( Caster.TithingPoints < RequiredTithing )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1060173, RequiredTithing.ToString() ); // You must have at least ~1_TITHE_REQUIREMENT~ Tithing Points to use this ability,
|
||||
return false;
|
||||
}
|
||||
if (Caster.TithingPoints < RequiredTithing)
|
||||
{
|
||||
Caster.SendLocalizedMessage(1060173,
|
||||
RequiredTithing
|
||||
.ToString()); // You must have at least ~1_TITHE_REQUIREMENT~ Tithing Points to use this ability,
|
||||
return false;
|
||||
}
|
||||
|
||||
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.Mana < mana)
|
||||
{
|
||||
Caster.SendLocalizedMessage(1060174,
|
||||
mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool CheckFizzle()
|
||||
{
|
||||
int requiredTithing = RequiredTithing;
|
||||
public override bool CheckFizzle()
|
||||
{
|
||||
int requiredTithing = RequiredTithing;
|
||||
|
||||
if ( AosAttributes.GetValue( Caster, AosAttribute.LowerRegCost ) > Utility.Random( 100 ) )
|
||||
requiredTithing = 0;
|
||||
if (AosAttributes.GetValue(Caster, AosAttribute.LowerRegCost) > Utility.Random(100))
|
||||
requiredTithing = 0;
|
||||
|
||||
int mana = ScaleMana( RequiredMana );
|
||||
int mana = ScaleMana(RequiredMana);
|
||||
|
||||
if ( Caster.TithingPoints < requiredTithing )
|
||||
{
|
||||
Caster.SendLocalizedMessage( 1060173, RequiredTithing.ToString() ); // You must have at least ~1_TITHE_REQUIREMENT~ Tithing Points to use this ability,
|
||||
return false;
|
||||
}
|
||||
if (Caster.TithingPoints < requiredTithing)
|
||||
{
|
||||
Caster.SendLocalizedMessage(1060173,
|
||||
RequiredTithing
|
||||
.ToString()); // You must have at least ~1_TITHE_REQUIREMENT~ Tithing Points to use this ability,
|
||||
return false;
|
||||
}
|
||||
|
||||
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.Mana < mana)
|
||||
{
|
||||
Caster.SendLocalizedMessage(1060174,
|
||||
mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
|
||||
return false;
|
||||
}
|
||||
|
||||
Caster.TithingPoints -= requiredTithing;
|
||||
Caster.TithingPoints -= requiredTithing;
|
||||
|
||||
if ( !base.CheckFizzle() )
|
||||
return false;
|
||||
if (!base.CheckFizzle())
|
||||
return false;
|
||||
|
||||
Caster.Mana -= mana;
|
||||
Caster.Mana -= mana;
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void SayMantra()
|
||||
{
|
||||
Caster.PublicOverheadMessage( MessageType.Regular, 0x3B2, MantraNumber, "", false );
|
||||
}
|
||||
public override void SayMantra()
|
||||
{
|
||||
Caster.PublicOverheadMessage(MessageType.Regular, 0x3B2, MantraNumber, "", false);
|
||||
}
|
||||
|
||||
public override void DoFizzle()
|
||||
{
|
||||
Caster.PlaySound( 0x1D6 );
|
||||
Caster.NextSpellTime = Core.TickCount;
|
||||
}
|
||||
public override void DoFizzle()
|
||||
{
|
||||
Caster.PlaySound(0x1D6);
|
||||
Caster.NextSpellTime = Core.TickCount;
|
||||
}
|
||||
|
||||
public override void DoHurtFizzle()
|
||||
{
|
||||
Caster.PlaySound( 0x1D6 );
|
||||
}
|
||||
public override void DoHurtFizzle()
|
||||
{
|
||||
Caster.PlaySound(0x1D6);
|
||||
}
|
||||
|
||||
public override void OnDisturb( DisturbType type, bool message )
|
||||
{
|
||||
base.OnDisturb( type, message );
|
||||
public override void OnDisturb(DisturbType type, bool message)
|
||||
{
|
||||
base.OnDisturb(type, message);
|
||||
|
||||
if ( message )
|
||||
Caster.PlaySound( 0x1D6 );
|
||||
}
|
||||
if (message)
|
||||
Caster.PlaySound(0x1D6);
|
||||
}
|
||||
|
||||
public override void OnBeginCast()
|
||||
{
|
||||
base.OnBeginCast();
|
||||
public override void OnBeginCast()
|
||||
{
|
||||
base.OnBeginCast();
|
||||
|
||||
SendCastEffect();
|
||||
}
|
||||
SendCastEffect();
|
||||
}
|
||||
|
||||
public virtual void SendCastEffect()
|
||||
{
|
||||
Caster.FixedEffect( 0x37C4, 10, (int)( GetCastDelay().TotalSeconds * 28 ), 4, 3 );
|
||||
}
|
||||
public virtual void SendCastEffect()
|
||||
{
|
||||
Caster.FixedEffect(0x37C4, 10, (int)(GetCastDelay().TotalSeconds * 28), 4, 3);
|
||||
}
|
||||
|
||||
public override void GetCastSkills( out double min, out double max )
|
||||
{
|
||||
min = RequiredSkill;
|
||||
max = RequiredSkill + 50.0;
|
||||
}
|
||||
public override void GetCastSkills(out double min, out double max)
|
||||
{
|
||||
min = RequiredSkill;
|
||||
max = RequiredSkill + 50.0;
|
||||
}
|
||||
|
||||
public override int GetMana()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
public override int GetMana()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int ComputePowerValue( int div )
|
||||
{
|
||||
return ComputePowerValue( Caster, div );
|
||||
}
|
||||
public int ComputePowerValue(int div)
|
||||
{
|
||||
return ComputePowerValue(Caster, div);
|
||||
}
|
||||
|
||||
public static int ComputePowerValue( Mobile from, int div )
|
||||
{
|
||||
if ( from == null )
|
||||
return 0;
|
||||
public static int ComputePowerValue(Mobile from, int div)
|
||||
{
|
||||
if (from == null)
|
||||
return 0;
|
||||
|
||||
int v = (int) Math.Sqrt( from.Karma + 20000 + (from.Skills.Chivalry.Fixed * 10) );
|
||||
int v = (int)Math.Sqrt(from.Karma + 20000 + from.Skills.Chivalry.Fixed * 10);
|
||||
|
||||
return v / div;
|
||||
}
|
||||
}
|
||||
}
|
||||
return v / div;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue