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
|
|
@ -1,47 +1,47 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
[FlippableAttribute( 0xF4D, 0xF4E )]
|
||||
public class Bardiche : BasePoleArm
|
||||
{
|
||||
public override WeaponAbility PrimaryAbility => WeaponAbility.ParalyzingBlow;
|
||||
public override WeaponAbility SecondaryAbility => WeaponAbility.Dismount;
|
||||
[Flippable(0xF4D, 0xF4E)]
|
||||
public class Bardiche : BasePoleArm
|
||||
{
|
||||
[Constructible]
|
||||
public Bardiche() : base(0xF4D)
|
||||
{
|
||||
Weight = 7.0;
|
||||
}
|
||||
|
||||
public override int AosStrengthReq => 45;
|
||||
public override int AosMinDamage => 17;
|
||||
public override int AosMaxDamage => 18;
|
||||
public override int AosSpeed => 28;
|
||||
public override float MlSpeed => 3.75f;
|
||||
public Bardiche(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int OldStrengthReq => 40;
|
||||
public override int OldMinDamage => 5;
|
||||
public override int OldMaxDamage => 43;
|
||||
public override int OldSpeed => 26;
|
||||
public override WeaponAbility PrimaryAbility => WeaponAbility.ParalyzingBlow;
|
||||
public override WeaponAbility SecondaryAbility => WeaponAbility.Dismount;
|
||||
|
||||
public override int InitMinHits => 31;
|
||||
public override int InitMaxHits => 100;
|
||||
public override int AosStrengthReq => 45;
|
||||
public override int AosMinDamage => 17;
|
||||
public override int AosMaxDamage => 18;
|
||||
public override int AosSpeed => 28;
|
||||
public override float MlSpeed => 3.75f;
|
||||
|
||||
[Constructible]
|
||||
public Bardiche() : base( 0xF4D )
|
||||
{
|
||||
Weight = 7.0;
|
||||
}
|
||||
public override int OldStrengthReq => 40;
|
||||
public override int OldMinDamage => 5;
|
||||
public override int OldMaxDamage => 43;
|
||||
public override int OldSpeed => 26;
|
||||
|
||||
public Bardiche( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override int InitMinHits => 31;
|
||||
public override int InitMaxHits => 100;
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,122 +1,136 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server.Engines.Harvest;
|
||||
using Server.ContextMenus;
|
||||
using Server.Engines.ConPVP;
|
||||
using Server.Engines.Harvest;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public abstract class BasePoleArm : BaseMeleeWeapon, IUsesRemaining
|
||||
{
|
||||
public override int DefHitSound => 0x237;
|
||||
public override int DefMissSound => 0x238;
|
||||
public abstract class BasePoleArm : BaseMeleeWeapon, IUsesRemaining
|
||||
{
|
||||
private bool m_ShowUsesRemaining;
|
||||
|
||||
public override SkillName DefSkill => SkillName.Swords;
|
||||
public override WeaponType DefType => WeaponType.Polearm;
|
||||
public override WeaponAnimation DefAnimation => WeaponAnimation.Slash2H;
|
||||
private int m_UsesRemaining;
|
||||
|
||||
public virtual HarvestSystem HarvestSystem => Lumberjacking.System;
|
||||
public BasePoleArm(int itemID) : base(itemID)
|
||||
{
|
||||
m_UsesRemaining = 150;
|
||||
}
|
||||
|
||||
private int m_UsesRemaining;
|
||||
private bool m_ShowUsesRemaining;
|
||||
public BasePoleArm(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get => m_UsesRemaining;
|
||||
set { m_UsesRemaining = value; InvalidateProperties(); }
|
||||
}
|
||||
public override int DefHitSound => 0x237;
|
||||
public override int DefMissSound => 0x238;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public bool ShowUsesRemaining
|
||||
{
|
||||
get => m_ShowUsesRemaining;
|
||||
set { m_ShowUsesRemaining = value; InvalidateProperties(); }
|
||||
}
|
||||
public override SkillName DefSkill => SkillName.Swords;
|
||||
public override WeaponType DefType => WeaponType.Polearm;
|
||||
public override WeaponAnimation DefAnimation => WeaponAnimation.Slash2H;
|
||||
|
||||
public BasePoleArm( int itemID ) : base( itemID )
|
||||
{
|
||||
m_UsesRemaining = 150;
|
||||
}
|
||||
public virtual HarvestSystem HarvestSystem => Lumberjacking.System;
|
||||
|
||||
public BasePoleArm( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public int UsesRemaining
|
||||
{
|
||||
get => m_UsesRemaining;
|
||||
set
|
||||
{
|
||||
m_UsesRemaining = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( HarvestSystem == null )
|
||||
return;
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public bool ShowUsesRemaining
|
||||
{
|
||||
get => m_ShowUsesRemaining;
|
||||
set
|
||||
{
|
||||
m_ShowUsesRemaining = value;
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
if ( IsChildOf( from.Backpack ) || Parent == from )
|
||||
HarvestSystem.BeginHarvesting( from, this );
|
||||
else
|
||||
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
|
||||
}
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
if (HarvestSystem == null)
|
||||
return;
|
||||
|
||||
public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
|
||||
{
|
||||
base.GetContextMenuEntries( from, list );
|
||||
if (IsChildOf(from.Backpack) || Parent == from)
|
||||
HarvestSystem.BeginHarvesting(from, this);
|
||||
else
|
||||
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
|
||||
}
|
||||
|
||||
if ( HarvestSystem != null )
|
||||
BaseHarvestTool.AddContextMenuEntries( from, this, list, HarvestSystem );
|
||||
}
|
||||
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
|
||||
{
|
||||
base.GetContextMenuEntries(from, list);
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
if (HarvestSystem != null)
|
||||
BaseHarvestTool.AddContextMenuEntries(from, this, list, HarvestSystem);
|
||||
}
|
||||
|
||||
writer.Write( (int) 2 ); // version
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (bool) m_ShowUsesRemaining );
|
||||
writer.Write(2); // version
|
||||
|
||||
writer.Write( (int) m_UsesRemaining );
|
||||
}
|
||||
writer.Write(m_ShowUsesRemaining);
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
writer.Write(m_UsesRemaining);
|
||||
}
|
||||
|
||||
int version = reader.ReadInt();
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
m_ShowUsesRemaining = reader.ReadBool();
|
||||
goto case 1;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
if ( m_UsesRemaining < 1 )
|
||||
m_UsesRemaining = 150;
|
||||
int version = reader.ReadInt();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
switch (version)
|
||||
{
|
||||
case 2:
|
||||
{
|
||||
m_ShowUsesRemaining = reader.ReadBool();
|
||||
goto case 1;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
m_UsesRemaining = reader.ReadInt();
|
||||
goto case 0;
|
||||
}
|
||||
case 0:
|
||||
{
|
||||
if (m_UsesRemaining < 1)
|
||||
m_UsesRemaining = 150;
|
||||
|
||||
public override void OnHit( Mobile attacker, Mobile defender, double damageBonus = 1 )
|
||||
{
|
||||
base.OnHit( attacker, defender, damageBonus );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded && attacker.Skills[SkillName.Anatomy].Value >= 80 && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() && Engines.ConPVP.DuelContext.AllowSpecialAbility(attacker, "Concussion Blow", false))
|
||||
{
|
||||
StatMod mod = defender.GetStatMod( "Concussion" );
|
||||
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus = 1)
|
||||
{
|
||||
base.OnHit(attacker, defender, damageBonus);
|
||||
|
||||
if ( mod == null )
|
||||
{
|
||||
defender.SendMessage( "You receive a concussion blow!" );
|
||||
defender.AddStatMod( new StatMod( StatType.Int, "Concussion", -(defender.RawInt / 2), TimeSpan.FromSeconds( 30.0 ) ) );
|
||||
if (!Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded &&
|
||||
attacker.Skills[SkillName.Anatomy].Value >= 80 &&
|
||||
attacker.Skills[SkillName.Anatomy].Value / 400.0 >= Utility.RandomDouble() &&
|
||||
DuelContext.AllowSpecialAbility(attacker, "Concussion Blow", false))
|
||||
{
|
||||
StatMod mod = defender.GetStatMod("Concussion");
|
||||
|
||||
attacker.SendMessage( "You deliver a concussion blow!" );
|
||||
attacker.PlaySound( 0x11C );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mod == null)
|
||||
{
|
||||
defender.SendMessage("You receive a concussion blow!");
|
||||
defender.AddStatMod(new StatMod(StatType.Int, "Concussion", -(defender.RawInt / 2),
|
||||
TimeSpan.FromSeconds(30.0)));
|
||||
|
||||
attacker.SendMessage("You deliver a concussion blow!");
|
||||
attacker.PlaySound(0x11C);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,47 +1,47 @@
|
|||
namespace Server.Items
|
||||
{
|
||||
[FlippableAttribute( 0x143E, 0x143F )]
|
||||
public class Halberd : BasePoleArm
|
||||
{
|
||||
public override WeaponAbility PrimaryAbility => WeaponAbility.WhirlwindAttack;
|
||||
public override WeaponAbility SecondaryAbility => WeaponAbility.ConcussionBlow;
|
||||
[Flippable(0x143E, 0x143F)]
|
||||
public class Halberd : BasePoleArm
|
||||
{
|
||||
[Constructible]
|
||||
public Halberd() : base(0x143E)
|
||||
{
|
||||
Weight = 16.0;
|
||||
}
|
||||
|
||||
public override int AosStrengthReq => 95;
|
||||
public override int AosMinDamage => 18;
|
||||
public override int AosMaxDamage => 19;
|
||||
public override int AosSpeed => 25;
|
||||
public override float MlSpeed => 4.25f;
|
||||
public Halberd(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int OldStrengthReq => 45;
|
||||
public override int OldMinDamage => 5;
|
||||
public override int OldMaxDamage => 49;
|
||||
public override int OldSpeed => 25;
|
||||
public override WeaponAbility PrimaryAbility => WeaponAbility.WhirlwindAttack;
|
||||
public override WeaponAbility SecondaryAbility => WeaponAbility.ConcussionBlow;
|
||||
|
||||
public override int InitMinHits => 31;
|
||||
public override int InitMaxHits => 80;
|
||||
public override int AosStrengthReq => 95;
|
||||
public override int AosMinDamage => 18;
|
||||
public override int AosMaxDamage => 19;
|
||||
public override int AosSpeed => 25;
|
||||
public override float MlSpeed => 4.25f;
|
||||
|
||||
[Constructible]
|
||||
public Halberd() : base( 0x143E )
|
||||
{
|
||||
Weight = 16.0;
|
||||
}
|
||||
public override int OldStrengthReq => 45;
|
||||
public override int OldMinDamage => 5;
|
||||
public override int OldMaxDamage => 49;
|
||||
public override int OldSpeed => 25;
|
||||
|
||||
public Halberd( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override int InitMinHits => 31;
|
||||
public override int InitMaxHits => 80;
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,53 +2,53 @@ using Server.Engines.Harvest;
|
|||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlippableAttribute( 0x26BA, 0x26C4 )]
|
||||
public class Scythe : BasePoleArm
|
||||
{
|
||||
public override WeaponAbility PrimaryAbility => WeaponAbility.BleedAttack;
|
||||
public override WeaponAbility SecondaryAbility => WeaponAbility.ParalyzingBlow;
|
||||
[Flippable(0x26BA, 0x26C4)]
|
||||
public class Scythe : BasePoleArm
|
||||
{
|
||||
[Constructible]
|
||||
public Scythe() : base(0x26BA)
|
||||
{
|
||||
Weight = 5.0;
|
||||
}
|
||||
|
||||
public override int AosStrengthReq => 45;
|
||||
public override int AosMinDamage => 15;
|
||||
public override int AosMaxDamage => 18;
|
||||
public override int AosSpeed => 32;
|
||||
public override float MlSpeed => 3.50f;
|
||||
public Scythe(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override int OldStrengthReq => 45;
|
||||
public override int OldMinDamage => 15;
|
||||
public override int OldMaxDamage => 18;
|
||||
public override int OldSpeed => 32;
|
||||
public override WeaponAbility PrimaryAbility => WeaponAbility.BleedAttack;
|
||||
public override WeaponAbility SecondaryAbility => WeaponAbility.ParalyzingBlow;
|
||||
|
||||
public override int InitMinHits => 31;
|
||||
public override int InitMaxHits => 100;
|
||||
public override int AosStrengthReq => 45;
|
||||
public override int AosMinDamage => 15;
|
||||
public override int AosMaxDamage => 18;
|
||||
public override int AosSpeed => 32;
|
||||
public override float MlSpeed => 3.50f;
|
||||
|
||||
public override HarvestSystem HarvestSystem => null;
|
||||
public override int OldStrengthReq => 45;
|
||||
public override int OldMinDamage => 15;
|
||||
public override int OldMaxDamage => 18;
|
||||
public override int OldSpeed => 32;
|
||||
|
||||
[Constructible]
|
||||
public Scythe() : base( 0x26BA )
|
||||
{
|
||||
Weight = 5.0;
|
||||
}
|
||||
public override int InitMinHits => 31;
|
||||
public override int InitMaxHits => 100;
|
||||
|
||||
public Scythe( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
public override HarvestSystem HarvestSystem => null;
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if ( Weight == 15.0 )
|
||||
Weight = 5.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Weight == 15.0)
|
||||
Weight = 5.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue