ORK Framework  2.29.3
API Documentation
ORKFramework.Combatants.CombatantAI Class Reference
Inheritance diagram for ORKFramework.Combatants.CombatantAI:
ORKFramework.ISaveData ORKFramework.IStatusChanged

Public Member Functions

 CombatantAI (Combatant owner)
 
void Init ()
 
void Clear ()
 
bool IsAITypeEquipped (int aiTypeID, bool checkParent)
 
void FireChanged ()
 
void CheckSlots ()
 
void CheckSlots (bool notifyChange)
 
void AttackAttributeChanged (Combatant c, int id, int id2, float change)
 
void DefenceAttributeChanged (Combatant c, int id, int id2, float change)
 
void DefenceAttributeIDChanged (Combatant c, int id, int id2)
 
void StatusValueChanged (Combatant c, int id, int change)
 
void StatusEffectChanged (Combatant c, StatusEffect effect)
 
void LevelChanged (Combatant c, int id)
 
void ClassLevelChanged (Combatant c, int id)
 
void ClassChanged (Combatant c, int id)
 
void AbilitiesChanged (Combatant c)
 
void EquipmentChanged (Combatant c)
 
void CombatantGroupChanged (Combatant combatant)
 
void CombatantInventoryChanged (Combatant combatant)
 
void CombatantBattleStateChanged (Combatant combatant)
 
void CombatantActionStateChanged (Combatant combatant)
 
void CombatantCastingStateChanged (Combatant combatant)
 
void CombatantChoosingStateChanged (Combatant combatant)
 
void CombatantTurnStateChanged (Combatant combatant)
 
void CombatantGridMoveRangeChanged (Combatant combatant)
 
void CombatantResearchChanged (Combatant combatant)
 
void CombatantAIChanged (Combatant combatant)
 
void CombatantActionBarChanged (Combatant combatant)
 
void CombatantDeathStateChanged (Combatant combatant)
 
void AddAIBehaviourSlots (AIBehaviourSlotSetting[] slot)
 
void RemoveAIBehaviourSlot (int slotIndex, bool toInventory)
 
void RemoveAllAIBehaviourSlots (bool toInventory)
 
bool IsAIBehaviourEquipped (int aiBehaviourID)
 
void EquipAIBehaviourAccess (int aiBehaviourID, int slotIndex, bool toInventory, bool fromInventory, bool notifyChange)
 Equips an AI behaviour via the access handler. More...
 
void EquipAIBehaviour (int aiBehaviourID, int slotIndex, bool toInventory, bool fromInventory, bool notifyChange)
 Equips an AI behaviour. More...
 
void UnequipAIBehaviourID (int aiBehaviourID, bool toInventory, bool notifyChange)
 Unequips an AI behaviour. More...
 
void UnequipAIBehaviourAccess (int slotIndex, bool toInventory, bool notifyChange)
 Unequips an AI behaviour via the access handler. More...
 
void UnequipAIBehaviour (int slotIndex, bool toInventory, bool notifyChange)
 Unequips an AI behaviour. More...
 
void AddAIRulesetSlots (AIRulesetSlotSetting[] slot)
 
void RemoveAIRulesetSlot (int slotIndex, bool toInventory)
 
void RemoveAllAIRulesetSlots (bool toInventory)
 
bool IsAIRulesetEquipped (int aiRulesetID)
 
void EquipAIRulesetAccess (int aiRulesetID, int slotIndex, bool toInventory, bool fromInventory, bool notifyChange)
 Equips an AI ruleset via the access handler. More...
 
void EquipAIRuleset (int aiRulesetID, int slotIndex, bool toInventory, bool fromInventory, bool notifyChange)
 Equips an AI ruleset. More...
 
void UnequipAIRulesetID (int aiRulesetID, bool toInventory, bool notifyChange)
 Unequips an AI ruleset. More...
 
void UnequipAIRulesetAccess (int slotIndex, bool toInventory, bool notifyChange)
 Unequips an AI ruleset via the access handler. More...
 
void UnequipAIRuleset (int slotIndex, bool toInventory, bool notifyChange)
 Unequips an AI ruleset. More...
 
bool SetActionTargets (BaseAction action, List< Combatant > preferredTargets, List< Combatant > allies, List< Combatant > enemies)
 
bool CanUseAction (BaseAction action)
 
bool CanUseAbility (int abilityID)
 
bool CanUseAttack ()
 
bool CanUseCounterAttack ()
 
bool CanUseItem (int itemID)
 
void Tick (float battleTime)
 
void TickDecisionTime (float battleTime, bool checkConditions)
 
BaseAction GetAction (List< Combatant > allies, List< Combatant > enemies)
 Gets a battle action based on the AI settings and BattleAI of the combatant. More...
 
bool ChangeMoveAI ()
 Changes the used move AI and use mode of the combatant based on equipped AI rulesets and AI behaviours (in that order). The first found change will be used. More...
 
DataObject SaveGame ()
 Used to save the data - you need to add the data to a ORKFramework.DataObject. More...
 
void LoadGame (DataObject data)
 Used to load the data - you need to get the data from the ORKFramework.DataObject. More...
 

Properties

NotifyCombatant Changed
 
Notify SimpleChanged
 
bool AIControlled [get, set]
 Gets or sets whether the combatant is AI controlled (only for the player group). More...
 
bool Blocked [get, set]
 Gets or sets whether the combatant's battle AI is blocked. More...
 
float DecisionTime [get, set]
 Gets or sets the time for deciding an AI action. More...
 
float RealTimeTimeout [get, set]
 Gets or sets the timeout between two AI actions in real time battles. More...
 
Combatant RealTimeCounterTarget [get, set]
 Sets a combatant to be the target of a counter attack in 'Real Time' battles. More...
 
AIBehaviourSlot [] AIBehaviourSlot [get, set]
 
AIRulesetSlot [] AIRulesetSlot [get, set]
 

Member Function Documentation

◆ ChangeMoveAI()

bool ORKFramework.Combatants.CombatantAI.ChangeMoveAI ( )

Changes the used move AI and use mode of the combatant based on equipped AI rulesets and AI behaviours (in that order). The first found change will be used.

Returns
true if the move AI was changed.

◆ EquipAIBehaviour()

void ORKFramework.Combatants.CombatantAI.EquipAIBehaviour ( int  aiBehaviourID,
int  slotIndex,
bool  toInventory,
bool  fromInventory,
bool  notifyChange 
)

Equips an AI behaviour.

Parameters
aiBehaviourIDThe ID/index of the AI behaviour.
slotIndexThe index of the AI behaviour slot.
toInventorytrue if the currently equipped AI behaviour should be returned to the inventory.
fromInventorytrue if the AI behaviour should be taken from the inventory.
notifyChangetrue if the listeners should be notified of the change.

◆ EquipAIBehaviourAccess()

void ORKFramework.Combatants.CombatantAI.EquipAIBehaviourAccess ( int  aiBehaviourID,
int  slotIndex,
bool  toInventory,
bool  fromInventory,
bool  notifyChange 
)

Equips an AI behaviour via the access handler.

Parameters
aiBehaviourIDThe ID/index of the AI behaviour.
slotIndexThe index of the AI behaviour slot.
toInventorytrue if the currently equipped AI behaviour should be returned to the inventory.
fromInventorytrue if the AI behaviour should be taken from the inventory.
notifyChangetrue if the listeners should be notified of the change.

◆ EquipAIRuleset()

void ORKFramework.Combatants.CombatantAI.EquipAIRuleset ( int  aiRulesetID,
int  slotIndex,
bool  toInventory,
bool  fromInventory,
bool  notifyChange 
)

Equips an AI ruleset.

Parameters
aiRulesetIDThe ID/index of the AI ruleset.
slotIndexThe index of the AI behaviour slot.
toInventorytrue if the currently equipped AI ruleset should be returned to the inventory.
fromInventorytrue if the AI ruleset should be taken from the inventory.
notifyChangetrue if the listeners should be notified of the change.

◆ EquipAIRulesetAccess()

void ORKFramework.Combatants.CombatantAI.EquipAIRulesetAccess ( int  aiRulesetID,
int  slotIndex,
bool  toInventory,
bool  fromInventory,
bool  notifyChange 
)

Equips an AI ruleset via the access handler.

Parameters
aiRulesetIDThe ID/index of the AI ruleset.
slotIndexThe index of the AI behaviour slot.
toInventorytrue if the currently equipped AI ruleset should be returned to the inventory.
fromInventorytrue if the AI ruleset should be taken from the inventory.
notifyChangetrue if the listeners should be notified of the change.

◆ GetAction()

BaseAction ORKFramework.Combatants.CombatantAI.GetAction ( List< Combatant allies,
List< Combatant enemies 
)

Gets a battle action based on the AI settings and BattleAI of the combatant.

Returns
The selected battle action.
Parameters
alliesA list of combatants allied to the combatant.
enemiesA list of combatants who are enemies of the combatant.

◆ LoadGame()

void ORKFramework.Combatants.CombatantAI.LoadGame ( DataObject  data)

Used to load the data - you need to get the data from the ORKFramework.DataObject.

Parameters
dataA ORKFramework.DataObject containing the data.

Implements ORKFramework.ISaveData.

◆ SaveGame()

DataObject ORKFramework.Combatants.CombatantAI.SaveGame ( )

Used to save the data - you need to add the data to a ORKFramework.DataObject.

Returns
A ORKFramework.DataObject containing the data.

Implements ORKFramework.ISaveData.

◆ UnequipAIBehaviour()

void ORKFramework.Combatants.CombatantAI.UnequipAIBehaviour ( int  slotIndex,
bool  toInventory,
bool  notifyChange 
)

Unequips an AI behaviour.

Parameters
slotIndexThe index of the AI behaviour slot.
toInventorytrue if it should be returned to the inventory.
notifyChangetrue if the listeners should be notified of the change.

◆ UnequipAIBehaviourAccess()

void ORKFramework.Combatants.CombatantAI.UnequipAIBehaviourAccess ( int  slotIndex,
bool  toInventory,
bool  notifyChange 
)

Unequips an AI behaviour via the access handler.

Parameters
slotIndexThe index of the AI behaviour slot.
toInventorytrue if it should be returned to the inventory.
notifyChangetrue if the listeners should be notified of the change.

◆ UnequipAIBehaviourID()

void ORKFramework.Combatants.CombatantAI.UnequipAIBehaviourID ( int  aiBehaviourID,
bool  toInventory,
bool  notifyChange 
)

Unequips an AI behaviour.

Parameters
aiBehaviourIDThe ID/index of the AI behaviour.
toInventorytrue if it should be returned to the inventory.
notifyChangetrue if the listeners should be notified of the change.

◆ UnequipAIRuleset()

void ORKFramework.Combatants.CombatantAI.UnequipAIRuleset ( int  slotIndex,
bool  toInventory,
bool  notifyChange 
)

Unequips an AI ruleset.

Parameters
slotIndexThe index of the AI ruleset slot.
toInventorytrue if it should be returned to the inventory.
notifyChangetrue if the listeners should be notified of the change.

◆ UnequipAIRulesetAccess()

void ORKFramework.Combatants.CombatantAI.UnequipAIRulesetAccess ( int  slotIndex,
bool  toInventory,
bool  notifyChange 
)

Unequips an AI ruleset via the access handler.

Parameters
slotIndexThe index of the AI ruleset slot.
toInventorytrue if it should be returned to the inventory.
notifyChangetrue if the listeners should be notified of the change.

◆ UnequipAIRulesetID()

void ORKFramework.Combatants.CombatantAI.UnequipAIRulesetID ( int  aiRulesetID,
bool  toInventory,
bool  notifyChange 
)

Unequips an AI ruleset.

Parameters
userThe user combatant.
aiRulesetIDThe ID/index of the AI ruleset.
toInventorytrue if it should be returned to the inventory.
notifyChangetrue if the listeners should be notified of the change.

Property Documentation

◆ AIControlled

bool ORKFramework.Combatants.CombatantAI.AIControlled
getset

Gets or sets whether the combatant is AI controlled (only for the player group).

true if AI controlled; otherwise, false.

◆ Blocked

bool ORKFramework.Combatants.CombatantAI.Blocked
getset

Gets or sets whether the combatant's battle AI is blocked.

true if blocked; otherwise, false.

◆ DecisionTime

float ORKFramework.Combatants.CombatantAI.DecisionTime
getset

Gets or sets the time for deciding an AI action.

The AI decision time that will be used.

◆ RealTimeCounterTarget

Combatant ORKFramework.Combatants.CombatantAI.RealTimeCounterTarget
getset

Sets a combatant to be the target of a counter attack in 'Real Time' battles.

The combatant that will be used as target.

◆ RealTimeTimeout

float ORKFramework.Combatants.CombatantAI.RealTimeTimeout
getset

Gets or sets the timeout between two AI actions in real time battles.

The timeout that will be used.