chore(content): Updates to C# 9 syntax (#373)

This commit is contained in:
Kamron Batman 2020-12-30 12:50:10 -08:00 • committed by GitHub
parent a59fda6a3a
commit 1e2242bb1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 155 additions and 405 deletions

View file

@ -1489,26 +1489,15 @@ namespace Server.Items
if (m_Resource == CraftResource.None)
{
if (mat == ArmorMaterialType.Studded || mat == ArmorMaterialType.Leather)
m_Resource = mat switch
{
m_Resource = CraftResource.RegularLeather;
}
else if (mat == ArmorMaterialType.Spined)
{
m_Resource = CraftResource.SpinedLeather;
}
else if (mat == ArmorMaterialType.Horned)
{
m_Resource = CraftResource.HornedLeather;
}
else if (mat == ArmorMaterialType.Barbed)
{
m_Resource = CraftResource.BarbedLeather;
}
else
{
m_Resource = CraftResource.Iron;
}
ArmorMaterialType.Studded => CraftResource.RegularLeather,
ArmorMaterialType.Leather => CraftResource.RegularLeather,
ArmorMaterialType.Spined => CraftResource.SpinedLeather,
ArmorMaterialType.Horned => CraftResource.HornedLeather,
ArmorMaterialType.Barbed => CraftResource.BarbedLeather,
_ => CraftResource.Iron
};
}
if (m_MaxHitPoints == 0 && m_HitPoints == 0)

View file

@ -1,3 +1,4 @@
using System;
using Server.Network;
namespace Server.Items
@ -149,19 +150,7 @@ namespace Server.Items
*/
if (owner.CheckSkill(SkillName.Parry, chance))
{
if (weapon.Skill == SkillName.Archery)
{
damage -= (int)ar;
}
else
{
damage -= (int)(ar / 2.0);
}
if (damage < 0)
{
damage = 0;
}
damage -= Math.Min(damage, weapon.Skill == SkillName.Archery ? (int)ar : (int)(ar / 2.0));
owner.FixedEffect(0x37B9, 10, 16);

View file

@ -294,100 +294,33 @@ namespace Server.Items
return false;
}
string option = null;
if (this is ArmorIgnore)
string option = this switch
{
option = "Armor Ignore";
}
else if (this is BleedAttack)
{
option = "Bleed Attack";
}
else if (this is ConcussionBlow)
{
option = "Concussion Blow";
}
else if (this is CrushingBlow)
{
option = "Crushing Blow";
}
else if (this is Disarm)
{
option = "Disarm";
}
else if (this is Dismount)
{
option = "Dismount";
}
else if (this is DoubleStrike)
{
option = "Double Strike";
}
else if (this is InfectiousStrike)
{
option = "Infectious Strike";
}
else if (this is MortalStrike)
{
option = "Mortal Strike";
}
else if (this is MovingShot)
{
option = "Moving Shot";
}
else if (this is ParalyzingBlow)
{
option = "Paralyzing Blow";
}
else if (this is ShadowStrike)
{
option = "Shadow Strike";
}
else if (this is WhirlwindAttack)
{
option = "Whirlwind Attack";
}
else if (this is RidingSwipe)
{
option = "Riding Swipe";
}
else if (this is FrenziedWhirlwind)
{
option = "Frenzied Whirlwind";
}
else if (this is Block)
{
option = "Block";
}
else if (this is DefenseMastery)
{
option = "Defense Mastery";
}
else if (this is NerveStrike)
{
option = "Nerve Strike";
}
else if (this is TalonStrike)
{
option = "Talon Strike";
}
else if (this is Feint)
{
option = "Feint";
}
else if (this is DualWield)
{
option = "Dual Wield";
}
else if (this is DoubleShot)
{
option = "Double Shot";
}
else if (this is ArmorPierce)
{
option = "Armor Pierce";
}
ArmorIgnore _ => "Armor Ignore",
BleedAttack _ => "Bleed Attack",
ConcussionBlow _ => "Concussion Blow",
CrushingBlow _ => "Crushing Blow",
Disarm _ => "Disarm",
Dismount _ => "Dismount",
DoubleStrike _ => "Double Strike",
InfectiousStrike _ => "Infectious Strike",
MortalStrike _ => "Mortal Strike",
MovingShot _ => "Moving Shot",
ParalyzingBlow _ => "Paralyzing Blow",
ShadowStrike _ => "Shadow Strike",
WhirlwindAttack _ => "Whirlwind Attack",
RidingSwipe _ => "Riding Swipe",
FrenziedWhirlwind _ => "Frenzied Whirlwind",
Block _ => "Block",
DefenseMastery _ => "Defense Mastery",
NerveStrike _ => "Nerve Strike",
TalonStrike _ => "Talon Strike",
Feint _ => "Feint",
DualWield _ => "Dual Wield",
DoubleShot _ => "Double Shot",
ArmorPierce _ => "Armor Pierce",
_ => null
};
if (option != null && !DuelContext.AllowSpecialAbility(from, option, true))
{