2019-06-18 22:55:32 -04:00
|
|
|
|
/*
|
|
|
|
|
===========================================================================
|
|
|
|
|
Copyright (C) 2015-2019 Project Meteor Dev Team
|
|
|
|
|
|
|
|
|
|
This file is part of Project Meteor Server.
|
|
|
|
|
|
|
|
|
|
Project Meteor Server is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Affero General Public License as published by
|
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
Project Meteor Server is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
|
|
|
|
===========================================================================
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using System;
|
2017-06-12 20:13:26 +01:00
|
|
|
|
using FFXIVClassic_Map_Server.Actors;
|
2017-06-12 03:50:02 +01:00
|
|
|
|
|
|
|
|
|
namespace FFXIVClassic_Map_Server.actors.chara.ai.controllers
|
|
|
|
|
{
|
2017-06-12 20:13:26 +01:00
|
|
|
|
abstract class Controller
|
2017-06-12 03:50:02 +01:00
|
|
|
|
{
|
2017-06-12 20:13:26 +01:00
|
|
|
|
protected Character owner;
|
|
|
|
|
|
2017-10-11 19:23:40 +01:00
|
|
|
|
protected DateTime lastCombatTickScript;
|
2017-06-12 20:13:26 +01:00
|
|
|
|
protected DateTime lastUpdate;
|
2017-08-02 23:06:11 +01:00
|
|
|
|
public bool canUpdate = true;
|
2017-06-12 20:13:26 +01:00
|
|
|
|
protected bool autoAttackEnabled = true;
|
|
|
|
|
protected bool castingEnabled = true;
|
|
|
|
|
protected bool weaponSkillEnabled = true;
|
|
|
|
|
protected PathFind pathFind;
|
|
|
|
|
protected TargetFind targetFind;
|
|
|
|
|
|
2017-08-02 23:06:11 +01:00
|
|
|
|
public Controller(Character owner)
|
|
|
|
|
{
|
|
|
|
|
this.owner = owner;
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 20:13:26 +01:00
|
|
|
|
public abstract void Update(DateTime tick);
|
|
|
|
|
public abstract bool Engage(Character target);
|
|
|
|
|
public abstract void Cast(Character target, uint spellId);
|
|
|
|
|
public virtual void WeaponSkill(Character target, uint weaponSkillId) { }
|
2017-07-11 20:49:38 +01:00
|
|
|
|
public virtual void MonsterSkill(Character target, uint mobSkillId) { }
|
2017-09-05 05:05:25 +01:00
|
|
|
|
public virtual void UseItem(Character target, uint slot, uint itemId) { }
|
2017-06-12 20:13:26 +01:00
|
|
|
|
public abstract void Ability(Character target, uint abilityId);
|
|
|
|
|
public abstract void RangedAttack(Character target);
|
|
|
|
|
public virtual void Spawn() { }
|
|
|
|
|
public virtual void Despawn() { }
|
|
|
|
|
|
|
|
|
|
|
2017-08-02 23:06:11 +01:00
|
|
|
|
public virtual void Disengage()
|
|
|
|
|
{
|
|
|
|
|
owner.aiContainer.InternalDisengage();
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 20:13:26 +01:00
|
|
|
|
public virtual void ChangeTarget(Character target)
|
|
|
|
|
{
|
2017-06-18 22:01:55 +01:00
|
|
|
|
owner.aiContainer.InternalChangeTarget(target);
|
2017-06-12 20:13:26 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsAutoAttackEnabled()
|
|
|
|
|
{
|
|
|
|
|
return autoAttackEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetAutoAttackEnabled(bool isEnabled)
|
|
|
|
|
{
|
|
|
|
|
autoAttackEnabled = isEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsCastingEnabled()
|
|
|
|
|
{
|
|
|
|
|
return castingEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetCastingEnabled(bool isEnabled)
|
|
|
|
|
{
|
|
|
|
|
castingEnabled = isEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsWeaponSkillEnabled()
|
|
|
|
|
{
|
|
|
|
|
return weaponSkillEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetWeaponSkillEnabled(bool isEnabled)
|
|
|
|
|
{
|
|
|
|
|
weaponSkillEnabled = isEnabled;
|
|
|
|
|
}
|
2017-06-12 03:50:02 +01:00
|
|
|
|
}
|
|
|
|
|
}
|