fix: Cleans up AI code (#1084)

This commit is contained in:
Kamron Batman 2022-06-20 19:32:16 -07:00 • committed by GitHub
parent da877f59a7
commit 38b45d5e0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 4830 additions and 4632 deletions

View file

@ -411,13 +411,13 @@ namespace Server.Factions
{
if (m_Mobile.Debug)
{
m_Mobile.DebugSay("My move is blocked, so I am going to attack {0}", m_Mobile.FocusMob.Name);
m_Mobile.DebugSay($"My move is blocked, so I am going to attack {m_Mobile.FocusMob.Name}");
}
m_Mobile.Combatant = m_Mobile.FocusMob;
Action = ActionType.Combat;
}
else
else if (m_Mobile.Debug)
{
m_Mobile.DebugSay("I am stuck");
}
@ -815,17 +815,14 @@ namespace Server.Factions
if (type != null && m_Guard.Target == null && UseItemByType(type))
{
if (spell is GreaterHealSpell)
{
if (m_Guard.Hits + 30 > m_Guard.HitsMax && m_Guard.Hits + 10 < m_Guard.HitsMax)
{
spell = new HealSpell(m_Guard);
}
}
else
if (spell is not GreaterHealSpell)
{
spell = null;
}
else if (m_Guard.Hits + 30 > m_Guard.HitsMax && m_Guard.Hits + 10 < m_Guard.HitsMax)
{
spell = new HealSpell(m_Guard);
}
}
}
else if (spell == null && m_Guard.Stam < m_Guard.StamMax / 3 && IsAllowed(GuardAI.Melee))