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
|
|
@ -4,82 +4,80 @@ using Server.Spells;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
/// <summary>
|
||||
/// A godsend to a warrior surrounded, the Whirlwind Attack allows the fighter to strike at all nearby targets in one mighty spinning swing.
|
||||
/// </summary>
|
||||
public class WhirlwindAttack : WeaponAbility
|
||||
{
|
||||
public WhirlwindAttack()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// A godsend to a warrior surrounded, the Whirlwind Attack allows the fighter to strike at all nearby targets in one mighty
|
||||
/// spinning swing.
|
||||
/// </summary>
|
||||
public class WhirlwindAttack : WeaponAbility
|
||||
{
|
||||
public override int BaseMana => 15;
|
||||
|
||||
public override int BaseMana => 15;
|
||||
public override void OnHit(Mobile attacker, Mobile defender, int damage)
|
||||
{
|
||||
if (!Validate(attacker))
|
||||
return;
|
||||
|
||||
public override void OnHit( Mobile attacker, Mobile defender, int damage )
|
||||
{
|
||||
if ( !Validate( attacker ) )
|
||||
return;
|
||||
ClearCurrentAbility(attacker);
|
||||
|
||||
ClearCurrentAbility( attacker );
|
||||
Map map = attacker.Map;
|
||||
|
||||
Map map = attacker.Map;
|
||||
if (map == null)
|
||||
return;
|
||||
|
||||
if ( map == null )
|
||||
return;
|
||||
if (!(attacker.Weapon is BaseWeapon weapon))
|
||||
return;
|
||||
|
||||
if ( !(attacker.Weapon is BaseWeapon weapon) )
|
||||
return;
|
||||
if (!CheckMana(attacker, true))
|
||||
return;
|
||||
|
||||
if ( !CheckMana( attacker, true ) )
|
||||
return;
|
||||
attacker.FixedEffect(0x3728, 10, 15);
|
||||
attacker.PlaySound(0x2A1);
|
||||
|
||||
attacker.FixedEffect( 0x3728, 10, 15 );
|
||||
attacker.PlaySound( 0x2A1 );
|
||||
ArrayList list = new ArrayList();
|
||||
|
||||
ArrayList list = new ArrayList();
|
||||
foreach (Mobile m in attacker.GetMobilesInRange(1))
|
||||
list.Add(m);
|
||||
|
||||
foreach ( Mobile m in attacker.GetMobilesInRange( 1 ) )
|
||||
list.Add( m );
|
||||
ArrayList targets = new ArrayList();
|
||||
|
||||
ArrayList targets = new ArrayList();
|
||||
for (int i = 0; i < list.Count; ++i)
|
||||
{
|
||||
Mobile m = (Mobile)list[i];
|
||||
|
||||
for ( int i = 0; i < list.Count; ++i )
|
||||
{
|
||||
Mobile m = (Mobile)list[i];
|
||||
if (m != defender && m != attacker && SpellHelper.ValidIndirectTarget(attacker, m))
|
||||
{
|
||||
if (m == null || m.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.CanSee(m) ||
|
||||
!attacker.CanBeHarmful(m))
|
||||
continue;
|
||||
|
||||
if ( m != defender && m != attacker && SpellHelper.ValidIndirectTarget( attacker, m ) )
|
||||
{
|
||||
if ( m == null || m.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.CanSee( m ) || !attacker.CanBeHarmful( m ) )
|
||||
continue;
|
||||
if (!attacker.InRange(m, weapon.MaxRange))
|
||||
continue;
|
||||
|
||||
if ( !attacker.InRange( m, weapon.MaxRange ) )
|
||||
continue;
|
||||
if (attacker.InLOS(m))
|
||||
targets.Add(m);
|
||||
}
|
||||
}
|
||||
|
||||
if ( attacker.InLOS( m ) )
|
||||
targets.Add( m );
|
||||
}
|
||||
}
|
||||
if (targets.Count > 0)
|
||||
{
|
||||
double bushido = attacker.Skills.Bushido.Value;
|
||||
double damageBonus = 1.0 + Math.Pow(targets.Count * bushido / 60, 2) / 100;
|
||||
|
||||
if ( targets.Count > 0 )
|
||||
{
|
||||
double bushido = attacker.Skills.Bushido.Value;
|
||||
double damageBonus = 1.0 + Math.Pow( (targets.Count * bushido) / 60, 2 ) / 100;
|
||||
if (damageBonus > 2.0)
|
||||
damageBonus = 2.0;
|
||||
|
||||
if ( damageBonus > 2.0 )
|
||||
damageBonus = 2.0;
|
||||
attacker.RevealingAction();
|
||||
|
||||
attacker.RevealingAction();
|
||||
for (int i = 0; i < targets.Count; ++i)
|
||||
{
|
||||
Mobile m = (Mobile)targets[i];
|
||||
|
||||
for ( int i = 0; i < targets.Count; ++i )
|
||||
{
|
||||
Mobile m = (Mobile)targets[i];
|
||||
attacker.SendLocalizedMessage(1060161); // The whirling attack strikes a target!
|
||||
m.SendLocalizedMessage(1060162); // You are struck by the whirling attack and take damage!
|
||||
|
||||
attacker.SendLocalizedMessage( 1060161 ); // The whirling attack strikes a target!
|
||||
m.SendLocalizedMessage( 1060162 ); // You are struck by the whirling attack and take damage!
|
||||
|
||||
weapon.OnHit( attacker, m, damageBonus );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
weapon.OnHit(attacker, m, damageBonus);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue