feat: Adds monster abilities to combat actions (#1266)

This commit is contained in:
Kamron Batman 2022-11-22 20:05:19 -08:00 • committed by GitHub
parent efaf2e947a
commit 8b5bd9ec13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 173 additions and 127 deletions

View file

@ -993,18 +993,24 @@ public abstract class BaseAI
{
m_Mobile.DebugSay("Praise the shepherd!");
}
}
else
{
var c = m_Mobile.Combatant;
if (c?.Deleted != false || c.Map != m_Mobile.Map || !c.Alive || c.IsDeadBondedPet)
return true;
}
var c = m_Mobile.Combatant;
if (c?.Deleted != false || c.Map != m_Mobile.Map || !c.Alive || c.IsDeadBondedPet)
{
Action = ActionType.Wander;
return true;
}
m_Mobile.Direction = m_Mobile.GetDirectionTo(c);
if (m_Mobile.TriggerAbility(MonsterAbilityTrigger.CombatAction, c))
{
if (m_Mobile.Debug)
{
Action = ActionType.Wander;
}
else
{
m_Mobile.Direction = m_Mobile.GetDirectionTo(c);
m_Mobile.DebugSay($"I used my abilities on {c.Name}!");
}
}