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

@ -107,17 +107,7 @@ namespace Server.SkillHandlers
{
if (from.CheckTargetSkill(SkillName.ArmsLore, pet, 0, 100))
{
var perc = 4 * pet.BardingHP / pet.BardingMaxHP;
if (perc < 0)
{
perc = 0;
}
else if (perc > 4)
{
perc = 4;
}
var perc = Math.Clamp(4 * pet.BardingHP / pet.BardingMaxHP, 0, 4);
pet.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1053021 - perc, from.NetState);
}
else

View file

@ -31,23 +31,13 @@ namespace Server.SkillHandlers
{
var foundAnyone = false;
Point3D p;
if (targ is Mobile mobile)
Point3D p = targ switch
{
p = mobile.Location;
}
else if (targ is Item item)
{
p = item.Location;
}
else if (targ is IPoint3D d)
{
p = new Point3D(d);
}
else
{
p = src.Location;
}
Mobile mobile => mobile.Location,
Item item => item.Location,
IPoint3D d => new Point3D(d),
_ => src.Location
};
var srcSkill = src.Skills.DetectHidden.Value;
var range = (int)(srcSkill / 10.0);