Modernization Fixes & Updates to Default Values (#3)

This commit is contained in:
Kamron Batman 2018-10-28 00:33:16 -07:00 • committed by GitHub
parent 445eddff68
commit dcf64091b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
768 changed files with 10507 additions and 14196 deletions

View file

@ -34,21 +34,19 @@ namespace Server.SkillHandlers
from.LocalOverheadMessage(MessageType.Regular, 0x3B2,
500324); // You know yourself quite well enough already.
}
else if (targeted is TownCrier)
else if (targeted is TownCrier crier)
{
((TownCrier)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500322,
crier.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500322,
from.NetState); // This person looks fine to me, though he may have some news...
}
else if (targeted is BaseVendor && ((BaseVendor)targeted).IsInvulnerable)
else if (targeted is BaseVendor vendor && vendor.IsInvulnerable)
{
((BaseVendor)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500326,
vendor.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500326,
from.NetState); // That can not be inspected.
}
else if (targeted is Mobile)
else if (targeted is Mobile targ)
{
Mobile targ = (Mobile)targeted;
int marginOfError = Math.Max(0, 25 - (int)(from.Skills[SkillName.Anatomy].Value / 4));
int marginOfError = Math.Max(0, 25 - (int)(from.Skills.Anatomy.Value / 4));
int str = targ.Str + Utility.RandomMinMax(-marginOfError, +marginOfError);
int dex = targ.Dex + Utility.RandomMinMax(-marginOfError, +marginOfError);
@ -73,7 +71,7 @@ namespace Server.SkillHandlers
targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038045 + strMod * 11 + dexMod,
from.NetState); // That looks [strong] and [dexterous].
if (from.Skills[SkillName.Anatomy].Base >= 65.0)
if (from.Skills.Anatomy.Base >= 65.0)
targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038303 + stmMod,
from.NetState); // That being is at [10,20,...] percent endurance.
}