Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)

This commit is contained in:
Kamron Batman 2019-03-11 14:29:59 -07:00 • committed by GitHub
parent e748af4430
commit 513e54f70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1094 changed files with 15913 additions and 21892 deletions

View file

@ -136,22 +136,21 @@ namespace Server.SkillHandlers
public override void OnCast()
{
IPooledEnumerable<Corpse> eable = Caster.GetItemsInRange<Corpse>(3);
Corpse toChannel = eable.ToList().Find(item => item is Corpse corpse && !corpse.Channeled);
Corpse toChannel = eable.FirstOrDefault(item => item is Corpse corpse && !corpse.Channeled);
eable.Free();
int max, min, mana, number;
int min = 1 + (int)(Caster.Skills.SpiritSpeak.Value * 0.25);
int max = min + 4;
int mana, number;
if (toChannel != null)
{
min = 1 + (int)(Caster.Skills.SpiritSpeak.Value * 0.25);
max = min + 4;
mana = 0;
number = 1061287; // You channel energy from a nearby corpse to heal your wounds.
}
else
{
min = 1 + (int)(Caster.Skills.SpiritSpeak.Value * 0.25);
max = min + 4;
mana = 10;
number = 1061286; // You channel your own spiritual energy to heal your wounds.
}
@ -192,4 +191,4 @@ namespace Server.SkillHandlers
}
}
}
}
}