Adds style cop (#109)

This commit is contained in:
Kamron Batman 2020-04-26 00:16:02 -07:00 • committed by GitHub
parent 3e715bcb60
commit 556a17aba8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1725 changed files with 33831 additions and 38046 deletions

View file

@ -40,7 +40,7 @@ namespace Server
from.PlaySound(0x1EE);
from.AddStatMod(new StatMod(StatType.Int, "clarity-potion", amount, TimeSpan.FromMinutes(time)));
Timer.DelayCall(TimeSpan.FromMinutes(time), delegate { from.EndAction<ClarityPotion>(); });
Timer.DelayCall(TimeSpan.FromMinutes(time), from.EndAction<ClarityPotion>);
return true;
}
@ -62,4 +62,4 @@ namespace Server
int version = reader.ReadEncodedInt();
}
}
}
}

View file

@ -9,7 +9,7 @@ namespace Server
{
public abstract class PowerFactionItem : Item
{
private static WeightedItem[] _items =
private static readonly WeightedItem[] _items =
{
new WeightedItem(30, typeof(GemOfEmpowerment)),
new WeightedItem(25, typeof(BloodRose)),
@ -61,8 +61,7 @@ namespace Server
killer.SendSound(1470);
killer.LocalOverheadMessage(
MessageType.Regular, 2119, false,
"You notice a strange item on the corpse, and decide to pick it up."
);
"You notice a strange item on the corpse, and decide to pick it up.");
try
{
@ -101,19 +100,16 @@ namespace Server
"The object vanishes from your hands as you touch it.");
Timer.DelayCall(TimeSpan.FromSeconds(1.0),
delegate
{
from.LocalOverheadMessage(MessageType.Regular, 2118, false,
"You feel a strange tingling sensation throughout your body.");
});
() => from.LocalOverheadMessage(MessageType.Regular, 2118, false,
"You feel a strange tingling sensation throughout your body."));
Timer.DelayCall(TimeSpan.FromSeconds(4.0),
delegate { from.LocalOverheadMessage(MessageType.Regular, 2118, false, "Your skin begins to burn."); });
() => { from.LocalOverheadMessage(MessageType.Regular, 2118, false, "Your skin begins to burn."); });
new DestructionTimer(from).Start();
Delete();
//from.SendMessage( "You must be in a faction to use this item." );
// from.SendMessage( "You must be in a faction to use this item." );
}
else if (Use(from))
{
@ -138,7 +134,7 @@ namespace Server
private sealed class DestructionTimer : Timer
{
private Mobile _mobile;
private readonly Mobile _mobile;
private bool _screamed;
@ -171,9 +167,9 @@ namespace Server
Type = type;
}
public int Weight{ get; }
public int Weight { get; }
public Type Type{ get; }
public Type Type { get; }
public Item Construct() => ActivatorUtil.CreateInstance(Type) as Item;
}

View file

@ -23,7 +23,7 @@ namespace Server
public override bool Use(Mobile user)
{
if (Movable)
user.BeginTarget(12, true, TargetFlags.None, delegate(Mobile from, object obj)
user.BeginTarget(12, true, TargetFlags.None, (from, obj) =>
{
if (Movable && !Deleted)
if (obj is IPoint3D pt)
@ -40,10 +40,9 @@ namespace Server
Effects.SendMovingEffect(
from, new Entity(Serial.Zero, origin, facet),
ItemID & 0x3FFF, 7, 0, false, false, Hue - 1
);
ItemID & 0x3FFF, 7, 0, false, false, Hue - 1);
Timer.DelayCall(TimeSpan.FromSeconds(0.5), delegate
Timer.DelayCall(TimeSpan.FromSeconds(0.5), () =>
{
Delete();
@ -52,10 +51,9 @@ namespace Server
Effects.SendLocationEffect(
origin, facet,
14284, 96, 1, 0, 2
);
14284, 96, 1, 0, 2);
Timer.DelayCall(TimeSpan.FromSeconds(1.0), delegate
Timer.DelayCall(TimeSpan.FromSeconds(1.0), () =>
{
List<Mobile> targets = facet.GetMobilesInRange(origin, 12).Where(mob =>
from.CanBeHarmful(mob, false) && mob.InLOS(new Point3D(origin, origin.Z + 1)) &&
@ -72,8 +70,7 @@ namespace Server
Effects.SendMovingEffect(
new Entity(Serial.Zero, new Point3D(origin, origin.Z + 4), facet), mob,
14068, 1, 32, false, false, 1111, 2
);
14068, 1, 32, false, false, 1111, 2);
from.DoHarmful(mob);
@ -84,7 +81,7 @@ namespace Server
SpellHelper.Damage(TimeSpan.FromSeconds(1.00), mob, from, damage / 3.0, 0, 0, 0, 0,
100);
Timer.DelayCall(TimeSpan.FromSeconds(0.50), delegate { mob.PlaySound(0x1FB); });
Timer.DelayCall(TimeSpan.FromSeconds(0.50), mob.PlaySound, 0x1FB);
}
});
});