Fixes code according to modern code style. Fixes a few expression bugs.

This commit is contained in:
Kamron Batman 2018-09-15 09:58:51 -07:00
parent 89eea25e5f
commit 970fd563b2
3324 changed files with 441118 additions and 433755 deletions

View file

@ -2,68 +2,65 @@ using Server.Items;
namespace Server.Spells.Ninjitsu
{
public class FocusAttack : NinjaMove
{
public FocusAttack()
{
}
public class FocusAttack : NinjaMove
{
public override int BaseMana => Core.ML ? 10 : 20;
public override double RequiredSkill => Core.ML ? 30.0 : 60;
public override int BaseMana => Core.ML ? 10 : 20;
public override double RequiredSkill => Core.ML? 30.0 : 60 ;
public override TextDefinition AbilityMessage =>
new TextDefinition(1063095); // You prepare to focus all of your abilities into your next strike.
public override TextDefinition AbilityMessage => new TextDefinition( 1063095 ); // You prepare to focus all of your abilities into your next strike.
public override bool Validate(Mobile from)
{
if (from.FindItemOnLayer(Layer.TwoHanded) as BaseShield != null)
{
from.SendLocalizedMessage(1063096); // You cannot use this ability while holding a shield.
return false;
}
public override bool Validate( Mobile from )
{
if ( from.FindItemOnLayer( Layer.TwoHanded ) as BaseShield != null )
{
from.SendLocalizedMessage( 1063096 ); // You cannot use this ability while holding a shield.
return false;
}
Item handOne = from.FindItemOnLayer(Layer.OneHanded) as BaseWeapon;
Item handOne = from.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon;
if (handOne != null && !(handOne is BaseRanged))
return base.Validate(from);
if ( handOne != null && !(handOne is BaseRanged) )
return base.Validate( from );
Item handTwo = from.FindItemOnLayer(Layer.TwoHanded) as BaseWeapon;
Item handTwo = from.FindItemOnLayer( Layer.TwoHanded ) as BaseWeapon;
if (handTwo != null && !(handTwo is BaseRanged))
return base.Validate(from);
if ( handTwo != null && !(handTwo is BaseRanged) )
return base.Validate( from );
from.SendLocalizedMessage(1063097); // You must be wielding a melee weapon without a shield to use this ability.
return false;
}
from.SendLocalizedMessage( 1063097 ); // You must be wielding a melee weapon without a shield to use this ability.
return false;
}
public override double GetDamageScalar(Mobile attacker, Mobile defender)
{
double ninjitsu = attacker.Skills[SkillName.Ninjitsu].Value;
public override double GetDamageScalar( Mobile attacker, Mobile defender )
{
double ninjitsu = attacker.Skills[SkillName.Ninjitsu].Value;
return 1.0 + ninjitsu * ninjitsu / 43636;
}
return 1.0 + (ninjitsu * ninjitsu) / 43636;
}
public override double GetPropertyBonus(Mobile attacker)
{
double ninjitsu = attacker.Skills[SkillName.Ninjitsu].Value;
public override double GetPropertyBonus( Mobile attacker )
{
double ninjitsu = attacker.Skills[SkillName.Ninjitsu].Value;
double bonus = ninjitsu * ninjitsu / 43636;
double bonus = (ninjitsu * ninjitsu) / 43636;
return 1.0 + (bonus * 3 + 0.01);
}
return 1.0 + (bonus * 3 + 0.01);
}
public override bool OnBeforeDamage(Mobile attacker, Mobile defender)
{
return Validate(attacker) && CheckMana(attacker, true);
}
public override bool OnBeforeDamage( Mobile attacker, Mobile defender )
{
return Validate( attacker ) && CheckMana( attacker, true );
}
public override void OnHit(Mobile attacker, Mobile defender, int damage)
{
ClearCurrentMove(attacker);
public override void OnHit( Mobile attacker, Mobile defender, int damage )
{
ClearCurrentMove( attacker );
attacker.SendLocalizedMessage(1063098); // You focus all of your abilities and strike with deadly force!
attacker.PlaySound(0x510);
attacker.SendLocalizedMessage( 1063098 ); // You focus all of your abilities and strike with deadly force!
attacker.PlaySound( 0x510 );
CheckGain( attacker );
}
}
}
CheckGain(attacker);
}
}
}