Code cleanup (#188)

This commit is contained in:
Kamron Batman 2020-08-01 08:40:06 -07:00 • committed by GitHub
parent df53c16620
commit 010fd9402a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
185 changed files with 1052 additions and 1271 deletions

View file

@ -1,3 +1,5 @@
using System;
namespace Server.Items
{
/// <summary>
@ -44,8 +46,7 @@ namespace Server.Items
--weapon.PoisonCharges;
// Infectious strike special move now uses poisoning skill to help determine potency
int maxLevel = attacker.Skills.Poisoning.Fixed / 200;
if (maxLevel < 0) maxLevel = 0;
int maxLevel = Math.Max(attacker.Skills.Poisoning.Fixed / 200, 0);
if (p.Level > maxLevel) p = Poison.GetPoison(maxLevel);
if (attacker.Skills.Poisoning.Value / 100.0 > Utility.RandomDouble())
@ -72,4 +73,4 @@ namespace Server.Items
}
}
}
}
}

View file

@ -105,7 +105,7 @@ namespace Server.Items
PlayerConstructed = true;
Type resourceType = typeRes ?? craftItem.Resources.GetAt(0).ItemType;
Type resourceType = typeRes ?? craftItem.Resources[0].ItemType;
if (Core.AOS)
{
@ -824,10 +824,7 @@ namespace Server.Items
if (shield != null)
{
// As per OSI, no genitive effect from the Racial stuffs, ie, 120 parry and '0' bushido with humans
chance = (parry - bushidoNonRacial) / 400.0;
if (chance < 0) // chance shouldn't go below 0
chance = 0;
chance = Math.Max((parry - bushidoNonRacial) / 400.0, 0);
// Parry/Bushido over 100 grants a 5% bonus.
if (parry >= 100.0 || bushido >= 100.0)
@ -2067,7 +2064,7 @@ namespace Server.Items
list.Add(entry.Title);
}
this.AddResistanceProperties(list);
AddResistanceProperties(list);
int prop;

View file

@ -73,10 +73,10 @@ namespace Server.Items
Effects.SendMovingEffect(new Entity(Serial.Zero, startLoc, map), new Entity(Serial.Zero, endLoc, map),
0x36E4, 5, 0, false, false);
Timer.DelayCall(TimeSpan.FromSeconds(1.0), () => FinishLaunch(endLoc, map));
Timer.DelayCall(TimeSpan.FromSeconds(1.0), FinishLaunch, endLoc, map);
}
private void FinishLaunch(Point3D endLoc, Map map)
private static void FinishLaunch(Point3D endLoc, Map map)
{
int hue = Utility.Random(40);