ORK Framework  2.34.1
API Documentation
ORKFramework.CombatantAccessHandler Class Reference

Public Member Functions

virtual Combatant CreateInstance (int index, Group group, bool showNotification, bool showConsole)
 Creates a new instance of a combatant and initializes it with the combatant's start levels and class. More...
 
virtual Combatant CreateInstance (int index, Group group, bool showNotification, bool showConsole, int level, int classLevel, int classID, bool loadGame, bool learnAbilities, bool useStartInventory, bool useStartEquipment, bool useInitEvent, bool useStatusEffects)
 Creates a new instance of a combatant and initializes it with the passed on data. More...
 
virtual void DestroyPrefab (Combatant combatant)
 Destroys a combatant's prefab. More...
 
virtual void SpawnAtLastPosition (Combatant combatant)
 Spawns a combatant's prefab at the last known position. More...
 
virtual void Spawn (Combatant combatant, Vector3 position, bool setRotation, float yRotation, bool setScale, Vector3 scale)
 Spawns a combatant's prefab. More...
 
virtual void PlaceAt (Combatant combatant, Vector3 position, bool setRotation, float yRotation, bool setScale, Vector3 scale)
 Places a combatant's game object. More...
 
virtual void SetStatusValue (Combatant user, int valueID, int newValue, bool isCritical, bool ignoreBarrier, bool showFlyingText, bool showConsole, StatusValueChangeSource source)
 Sets the value of a status value of the user. More...
 
virtual void AddStatusValue (Combatant user, int valueID, int addValue, bool isCritical, bool checkDeath, bool checkLevelUp, bool ignoreBarrier, bool showFlyingText, bool showConsole, StatusValueChangeSource source)
 Adds a value to a status value of the user. More...
 
virtual void SetBaseStatusValue (Combatant user, int valueID, int newValue)
 Sets the base value of a status value of the user. More...
 
virtual void AddBaseStatusValue (Combatant user, int valueID, int addValue)
 Adds a value to the base value of a status value of the user. More...
 
virtual void Regenerate (Combatant user, bool revive)
 Sets the 'Consumable' type status values of a combatant to their maximum value. More...
 
virtual bool LearnAbility (Combatant user, bool isGroupAbility, int id, int level, bool showNotification, bool showConsole)
 Lets the user learn an ability. More...
 
virtual bool LearnAbility (Combatant user, bool isGroupAbility, AbilityShortcut ability, bool showNotification, bool showConsole)
 Lets the user learn an ability. More...
 
virtual bool ForgetAbility (Combatant user, bool isGroupAbility, int id, bool showNotification, bool showConsole)
 Lets the user forget an ability. More...
 
virtual bool LearnAbilityTree (Combatant user, int abilityTreeID, bool showConsole)
 Lets the user learn an ability tree. More...
 
virtual void ForgetAbilityTree (Combatant user, int abilityTreeID, bool showConsole)
 Lets the user forget an ability tree. More...
 
virtual bool Equip (Combatant user, int partID, EquipShortcut equip, Combatant fromInventory, Combatant unequipToInventory, bool reset)
 Equips an equipment on a combatant. More...
 
virtual void UnequipAll (Combatant user, Combatant toInventory)
 Unequips all currently equipped equipment of the user. More...
 
virtual void Unequip (Combatant user, EquipShortcut equip, Combatant toInventory)
 Unequips an equipment from the user. More...
 
virtual void Unequip (Combatant user, int partID, Combatant toInventory, bool reset, bool force)
 Unequips equipment currently equipped on a defined equipment part of the user. More...
 
virtual void EquipAIBehaviour (Combatant user, int aiBehaviourID, int slotIndex, bool toInventory, bool fromInventory, bool notifyChange)
 Equips an AI behaviour on the user. More...
 
virtual void UnequipAIBehaviour (Combatant user, int slotIndex, bool toInventory, bool notifyChange)
 Unequips an AI behaviour from the user. More...
 
virtual void EquipAIRuleset (Combatant user, int aiRulesetID, int slotIndex, bool toInventory, bool fromInventory, bool notifyChange)
 Equips an AI ruleset on the user. More...
 
virtual void UnequipAIRuleset (Combatant user, int slotIndex, bool toInventory, bool notifyChange)
 Unequips an AI ruleset from the user. More...
 
virtual void StartResearch (ResearchItem researchItem)
 Starts research on a research item. More...
 
virtual void CancelResearch (ResearchItem researchItem)
 Cancels research on a research item. More...
 
virtual void CheckAggressive (Combatant combatant, AggressionType aggressionType, Combatant origin)
 Checks if a combatant's aggression state is changed due to an aggression of another combatant. Also causes the move AI to react to damage in case it's a damage aggression type. More...
 
virtual void SetAttackedBy (Combatant combatant, Combatant attacker, bool addFaction)
 Adds an attacker to a combatant's attacked by list. More...
 
virtual void RemoveAttackedBy (Combatant combatant, Combatant attacker, bool removeFaction)
 Removes an attacker from a combatant's attacked by list. More...
 
virtual void ClearAttackedBy (Combatant combatant)
 Clears a combatant's attacked by list. More...
 
virtual void SetKilledBy (Combatant combatant, Combatant attacker)
 Sets a combatant's killed by mark to another combatant. More...
 

Properties

virtual bool HasStatusAuthority [get, set]
 Determines if certain combatant status related changes are possible. E.g. status effects causing changes, auto effects or auto unequip (equipment, AI behaviours/rulesets). More...
 
virtual bool HasBattleAIAuthority [get, set]
 Determines if the battle AI can be used. AI controlled combatants will not use actions when not used. More...
 
virtual bool HasMoveAIAuthority [get, set]
 Determines if the move AI can be used. More...
 
virtual bool HasSpawnCreationAuthority [get, set]
 Determines if new combatants can be created and spawned (doesn't impact the player). E.g. checked by 'Combatant Spawners', 'Add Combatant' and 'Battle' components when creating new combatants. More...
 

Member Function Documentation

◆ AddBaseStatusValue()

virtual void ORKFramework.CombatantAccessHandler.AddBaseStatusValue ( Combatant  user,
int  valueID,
int  addValue 
)
virtual

Adds a value to the base value of a status value of the user.

Parameters
userThe user combatant.
valueIDThe ID/index of the status value.
addValueThe value that will be added.

◆ AddStatusValue()

virtual void ORKFramework.CombatantAccessHandler.AddStatusValue ( Combatant  user,
int  valueID,
int  addValue,
bool  isCritical,
bool  checkDeath,
bool  checkLevelUp,
bool  ignoreBarrier,
bool  showFlyingText,
bool  showConsole,
StatusValueChangeSource  source 
)
virtual

Adds a value to a status value of the user.

Parameters
userThe user combatant.
valueIDThe ID/index of the status value.
addValueThe value that will be added.
isCriticaltrue if this is a critical value change.
checkDeathtrue if the combatant should check for death.
checkLevelUptrue if the combatant should check for level up.
ignoreBarriertrue if the change should ignore barrier status values.
showFlyingTexttrue if the change should display flying texts.
showConsoletrue if a console line should be added.
sourceThe source of the value change (e.g. combatant causing the change).

◆ CancelResearch()

virtual void ORKFramework.CombatantAccessHandler.CancelResearch ( ResearchItem  researchItem)
virtual

Cancels research on a research item.

Parameters
researchItemThe research item.

◆ CheckAggressive()

virtual void ORKFramework.CombatantAccessHandler.CheckAggressive ( Combatant  combatant,
AggressionType  aggressionType,
Combatant  origin 
)
virtual

Checks if a combatant's aggression state is changed due to an aggression of another combatant. Also causes the move AI to react to damage in case it's a damage aggression type.

Parameters
combatantThe combatant who's checked.
aggressionTypeThe aggression type that is checked for.
originThe combatant who's the origin of the aggression.

◆ ClearAttackedBy()

virtual void ORKFramework.CombatantAccessHandler.ClearAttackedBy ( Combatant  combatant)
virtual

Clears a combatant's attacked by list.

Parameters
combatantThe combatant who's list is cleared.

◆ CreateInstance() [1/2]

virtual Combatant ORKFramework.CombatantAccessHandler.CreateInstance ( int  index,
Group  group,
bool  showNotification,
bool  showConsole 
)
virtual

Creates a new instance of a combatant and initializes it with the combatant's start levels and class.

Parameters
indexThe ID/index of the combatant that will be created.
groupThe group the combatant will join.
Returns
A new combatant instance initialized with the combatant's start levels and class.

◆ CreateInstance() [2/2]

virtual Combatant ORKFramework.CombatantAccessHandler.CreateInstance ( int  index,
Group  group,
bool  showNotification,
bool  showConsole,
int  level,
int  classLevel,
int  classID,
bool  loadGame,
bool  learnAbilities,
bool  useStartInventory,
bool  useStartEquipment,
bool  useInitEvent,
bool  useStatusEffects 
)
virtual

Creates a new instance of a combatant and initializes it with the passed on data.

Parameters
indexThe ID/index of the combatant that will be created.
groupThe group the combatant will join.
levelThe base level used to initialize the combatant.
classLevelThe class level used to initialize the combatant.
classIDThe ID/index of the class the combatant will have.
loadGametrue if this comes from loading a game.
learnAbilitiestrue if the combatant should learn abilities for the level.
useStartInventorytrue if the combatant should receive the defined start inventory.
useStartEquipmenttrue if the combatant should receive the defined start equipment.
useInitEventtrue if the combatant should use the init game event.
useStatusEffectstrue if the combatant should use auto status effects when initialized.
Returns
A new combatant instance initialized with the passed on data.

◆ DestroyPrefab()

virtual void ORKFramework.CombatantAccessHandler.DestroyPrefab ( Combatant  combatant)
virtual

Destroys a combatant's prefab.

Parameters
combatantThe combatant.

◆ Equip()

virtual bool ORKFramework.CombatantAccessHandler.Equip ( Combatant  user,
int  partID,
EquipShortcut  equip,
Combatant  fromInventory,
Combatant  unequipToInventory,
bool  reset 
)
virtual

Equips an equipment on a combatant.

Parameters
userThe combatant that will equip the equipment.
partIDThe ID/index of the equipment part it will be equipped on. Use -1 if a matching equipment part should be searched.
equipThe EquipShortcut that will be equipped.
fromInventoryThe combatant who's inventory should remove the equipment.
unequipToInventoryThe combatant who's inventory should add equipment currently equipped on the used equipment part.
resettrue if the user's status system should be reset (i.e. checking for bonuses, etc.).
Returns
true if the equipment was equipped.

◆ EquipAIBehaviour()

virtual void ORKFramework.CombatantAccessHandler.EquipAIBehaviour ( Combatant  user,
int  aiBehaviourID,
int  slotIndex,
bool  toInventory,
bool  fromInventory,
bool  notifyChange 
)
virtual

Equips an AI behaviour on the user.

Parameters
userThe user combatant.
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()

virtual void ORKFramework.CombatantAccessHandler.EquipAIRuleset ( Combatant  user,
int  aiRulesetID,
int  slotIndex,
bool  toInventory,
bool  fromInventory,
bool  notifyChange 
)
virtual

Equips an AI ruleset on the user.

Parameters
userThe user combatant.
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.

◆ ForgetAbility()

virtual bool ORKFramework.CombatantAccessHandler.ForgetAbility ( Combatant  user,
bool  isGroupAbility,
int  id,
bool  showNotification,
bool  showConsole 
)
virtual

Lets the user forget an ability.

Parameters
userThe user combatant.
isGroupAbilitytrue if a group ability is forgotten.
idThe ID/index of the ability.
showNotificationtrue if a notification should be displayed.
showConsoletrue if a console line should be added.
Returns
true if the ability was forgotten.

◆ ForgetAbilityTree()

virtual void ORKFramework.CombatantAccessHandler.ForgetAbilityTree ( Combatant  user,
int  abilityTreeID,
bool  showConsole 
)
virtual

Lets the user forget an ability tree.

Parameters
userThe user combatant.
abilityTreeIDThe ID/index of the ability tree.
showConsoletrue if a console line should be added.

◆ LearnAbility() [1/2]

virtual bool ORKFramework.CombatantAccessHandler.LearnAbility ( Combatant  user,
bool  isGroupAbility,
int  id,
int  level,
bool  showNotification,
bool  showConsole 
)
virtual

Lets the user learn an ability.

Parameters
userThe user combatant.
isGroupAbilitytrue if the ability should be learned by the entire group.
idThe ID/index of the ability.
levelThe level of the ability.
showNotificationtrue if a notification should be displayed.
showConsoletrue if a console line should be added.
Returns
true if the ability was learned.

◆ LearnAbility() [2/2]

virtual bool ORKFramework.CombatantAccessHandler.LearnAbility ( Combatant  user,
bool  isGroupAbility,
AbilityShortcut  ability,
bool  showNotification,
bool  showConsole 
)
virtual

Lets the user learn an ability.

Parameters
userThe user combatant.
isGroupAbilitytrue if the ability is learned as a group ability.
abilityThe ability that will be learned.
showNotificationtrue if a notification should be displayed.
showConsoletrue if a console line should be added.
Returns
true if the ability was learned.

◆ LearnAbilityTree()

virtual bool ORKFramework.CombatantAccessHandler.LearnAbilityTree ( Combatant  user,
int  abilityTreeID,
bool  showConsole 
)
virtual

Lets the user learn an ability tree.

Parameters
userThe user combatant.
abilityTreeIDThe ID/index of the ability tree.
showConsoletrue if a console line should be added.
Returns
true if the ability tree was learned.

◆ PlaceAt()

virtual void ORKFramework.CombatantAccessHandler.PlaceAt ( Combatant  combatant,
Vector3  position,
bool  setRotation,
float  yRotation,
bool  setScale,
Vector3  scale 
)
virtual

Places a combatant's game object.

Parameters
combatantThe combatant.
positionThe position the combatant is placed at.
setRotationtrue to set the Y-axis rotation.
yRotationThe Y-axis rotation
setScaletrue to set the scale.
scaleThe scale that will be used.

◆ Regenerate()

virtual void ORKFramework.CombatantAccessHandler.Regenerate ( Combatant  user,
bool  revive 
)
virtual

Sets the 'Consumable' type status values of a combatant to their maximum value.

Parameters
userThe combatant that will be used.
revivetrue if a dead combatant should be revived.

◆ RemoveAttackedBy()

virtual void ORKFramework.CombatantAccessHandler.RemoveAttackedBy ( Combatant  combatant,
Combatant  attacker,
bool  removeFaction 
)
virtual

Removes an attacker from a combatant's attacked by list.

Parameters
combatantThe combatant who's list is changed.
attackerThe attacker
removeFactiontrue if the combatant's faction should be removed (in case no other faction membe attacked the combatant).

◆ SetAttackedBy()

virtual void ORKFramework.CombatantAccessHandler.SetAttackedBy ( Combatant  combatant,
Combatant  attacker,
bool  addFaction 
)
virtual

Adds an attacker to a combatant's attacked by list.

Parameters
combatantThe combatant who's list is changed.
attackerThe attacker.
addFactiontrue if the attacker's faction should be recorded as well.

◆ SetBaseStatusValue()

virtual void ORKFramework.CombatantAccessHandler.SetBaseStatusValue ( Combatant  user,
int  valueID,
int  newValue 
)
virtual

Sets the base value of a status value of the user.

Parameters
userThe user combatant.
valueIDThe ID/index of the status value.
newValueThe new value that will be used.

◆ SetKilledBy()

virtual void ORKFramework.CombatantAccessHandler.SetKilledBy ( Combatant  combatant,
Combatant  attacker 
)
virtual

Sets a combatant's killed by mark to another combatant.

Parameters
combatantThe combatant.
attackerThe attacker.

◆ SetStatusValue()

virtual void ORKFramework.CombatantAccessHandler.SetStatusValue ( Combatant  user,
int  valueID,
int  newValue,
bool  isCritical,
bool  ignoreBarrier,
bool  showFlyingText,
bool  showConsole,
StatusValueChangeSource  source 
)
virtual

Sets the value of a status value of the user.

Parameters
userThe user combatant.
valueIDThe ID/index of the status value.
newValueThe new value that will be used.
isCriticaltrue if this is a critical value change.
ignoreBarriertrue if the change should ignore barrier status values.
showFlyingTexttrue if the change should display flying texts.
showConsoletrue if a console line should be added.
sourceThe source of the value change (e.g. combatant causing the change).

◆ Spawn()

virtual void ORKFramework.CombatantAccessHandler.Spawn ( Combatant  combatant,
Vector3  position,
bool  setRotation,
float  yRotation,
bool  setScale,
Vector3  scale 
)
virtual

Spawns a combatant's prefab.

Parameters
combatantThe combatant.
positionThe position the combatant is spawned at.
setRotationtrue to set the Y-axis rotation.
yRotationThe Y-axis rotation
setScaletrue to set the scale.
scaleThe scale that will be used.

◆ SpawnAtLastPosition()

virtual void ORKFramework.CombatantAccessHandler.SpawnAtLastPosition ( Combatant  combatant)
virtual

Spawns a combatant's prefab at the last known position.

Parameters
combatantThe combatant.

◆ StartResearch()

virtual void ORKFramework.CombatantAccessHandler.StartResearch ( ResearchItem  researchItem)
virtual

Starts research on a research item.

Parameters
researchItemThe research item.

◆ Unequip() [1/2]

virtual void ORKFramework.CombatantAccessHandler.Unequip ( Combatant  user,
EquipShortcut  equip,
Combatant  toInventory 
)
virtual

Unequips an equipment from the user.

Parameters
userThe combatant that will unequip the equipment.
equipThe equipment that will be unequiped.
toInventoryThe combatant who's inventory should add the unequipped equipment.

◆ Unequip() [2/2]

virtual void ORKFramework.CombatantAccessHandler.Unequip ( Combatant  user,
int  partID,
Combatant  toInventory,
bool  reset,
bool  force 
)
virtual

Unequips equipment currently equipped on a defined equipment part of the user.

Parameters
userThe combatant that will unequip the equipment.
partIDThe ID/index of the equipment part that will be unequipped.
toInventoryThe combatant who's inventory should add the unequipped equipment.
resettrue if the user's status system should be reset (i.e. checking for bonuses, etc.).
forcetrue if unequipping should be forced.

◆ UnequipAIBehaviour()

virtual void ORKFramework.CombatantAccessHandler.UnequipAIBehaviour ( Combatant  user,
int  slotIndex,
bool  toInventory,
bool  notifyChange 
)
virtual

Unequips an AI behaviour from the user.

Parameters
userThe user combatant.
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.

◆ UnequipAIRuleset()

virtual void ORKFramework.CombatantAccessHandler.UnequipAIRuleset ( Combatant  user,
int  slotIndex,
bool  toInventory,
bool  notifyChange 
)
virtual

Unequips an AI ruleset from the user.

Parameters
userThe user combatant.
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.

◆ UnequipAll()

virtual void ORKFramework.CombatantAccessHandler.UnequipAll ( Combatant  user,
Combatant  toInventory 
)
virtual

Unequips all currently equipped equipment of the user.

Parameters
userThe combatant that will unequip the equipment.
toInventoryThe combatant who's inventory should add the unequipped equipment.

Property Documentation

◆ HasBattleAIAuthority

virtual bool ORKFramework.CombatantAccessHandler.HasBattleAIAuthority
getset

Determines if the battle AI can be used. AI controlled combatants will not use actions when not used.

◆ HasMoveAIAuthority

virtual bool ORKFramework.CombatantAccessHandler.HasMoveAIAuthority
getset

Determines if the move AI can be used.

◆ HasSpawnCreationAuthority

virtual bool ORKFramework.CombatantAccessHandler.HasSpawnCreationAuthority
getset

Determines if new combatants can be created and spawned (doesn't impact the player). E.g. checked by 'Combatant Spawners', 'Add Combatant' and 'Battle' components when creating new combatants.

◆ HasStatusAuthority

virtual bool ORKFramework.CombatantAccessHandler.HasStatusAuthority
getset

Determines if certain combatant status related changes are possible. E.g. status effects causing changes, auto effects or auto unequip (equipment, AI behaviours/rulesets).