ERAiAPI
Loading...
Searching...
No Matches
GoalFunc Class Reference

Represents a Goal object. More...

#include <GoalFunc.hpp>

Public Member Functions

void AddGoalScopedTeamRecord (int cooridnateType, int target, float p3)
 
void AddLifeParentSubGoal (float life)
 Adds the given amount of time to the parent's, grand-parent's, grand-grand-parent's..., life.
 
GoalFuncAddSubGoal (int goalId, float life, float goalParam0=0, float goalParam1=0, float goalParam2=0, float goalParam3=0, float goalParam4=0, float goalParam5=0, float goalParam6=0, float goalParam7=0, float goalParam8=0, float goalParam9=0, float goalParam10=0, float goalParam11=0, float goalParam12=0)
 Adds subgoal to this goal's subgoal queue.
 
GoalFuncAddSubGoal_Front (int goalId, float life, float goalParam0, float goalParam1, float goalParam2)
 Adds subgoal to the front of this goal's subgoal queue.
 
void AdjustDisplacement (int p1, int p2, float p3, float p4, float p5)
 
void ClearSeriesSubGoal (int goalId)
 Clears all goals in the subgoal queue from front to back until it reaches a goal whose id isn't the given id. Example: SubGoal Queue [2000, 2000, 2001, 2001, 2000, 2003] ClearSeriesSubGoal(2000) -> [2001, 2001, 2000, 2003] ClearSeriesSubGoal(anything else) -> no change.
 
void ClearSubGoal ()
 Clears goal's subgoal queue.
 
int GetBattleGoalId ()
 Returns the AI's battle goal id.
 
GOAL_RESULT GetLastResult ()
 Returns the goal's last updated result.
 
GOAL_RESULT GetLastSubGoalResult ()
 Returns the goal's active subgoal's last updated result (from Update function).
 
GoalFuncGetLatestAddGoalFunc ()
 Returns the last subgoal in the goal's subgoal queue (the last subgoal added).
 
float GetLife ()
 Returns the goal's life.
 
float GetNumber (int index)
 Returns the number stored at the given index (0-7)
 
float GetParam (int paramIndex)
 Returns the goal's param at the given index (the params used at the time of the goal's creation, e.g AddSubGoal). If the param doesn't exist, returns 0.
 
float GetParamBool (int paramIndex)
 Returns true if the goal's param at the given index is bigger than 0, otherwise false (the params used at the time of the goal's creation). If the param doesn't exist, returns false. Lua's "true" = 1.0.
 
int GetSubGoalNum ()
 Returns the number of subgoals in the goal's subgoal queue.
 
float GetTimer (int index)
 Returns the given timer's remaining time.
 
bool IsExistParam (int paramIndex)
 Returns true if the index is less than 8, or if the goal was created with the given param, otherwise false. Example: local child = goal:AddSubGoal(GOAL_COMMON_CommonAttack, 5, 3000, TARGET_ENE_0, 999, 180, 1, 180, true, true, false, false, 0, 0) yields child:IsExistParam(11) = true, child:IsExistParam(12) = false.
 
bool IsFinishTimer (int index)
 Returns true if the given timer's remaining time is less than or equal to 0, otherwise false.
 
bool IsFinishTimerForTurnBeforeAtk ()
 Returns true if the timer to turn before executing the animation is less than or equal to 0, otherwise false. Used with CommonAttack's turnTime, turnFaceAngle.
 
bool IsInterruptSubGoalChanged ()
 Returns true if subgoals were added or cleared by the interrupt.
 
void SetEnableComboAttackCancel ()
 Does nothing.
 
GoalFuncSetFailedEndOption (AI_GOAL_FAILED_END_OPT failedEndOption)
 Set what to do on goal failure.
 
GoalFuncSetLifeEndSuccess (bool enable)
 Set whether the goal's life running out is a success or failure (goal will end either way). Default: GOAL_RESULT_Failed
 
void SetManagementGoal ()
 
void SetNumber (int index, float value)
 Store the given number in the given index (0-7).
 
GoalFuncSetTargetAngle (int angleObserverSlot, float angleStart, float angleWidth)
 Creates an angle observer with the given parameters. The observer can normally be accessed with INTERUPT_TargetOutOfAngle, IsTargetOutOfAngleInterruptSlot. No longer used in ER (IsTargetOutOfAngleInterruptSlot is empty).
 
GoalFuncSetTargetAngle (float angleStart, float angleWidth)
 Creates an angle observer with the given parameters. The observer can normally be accessed with INTERUPT_TargetOutOfAngle, IsTargetOutOfAngleInterruptSlot. No longer used in ER (IsTargetOutOfAngleInterruptSlot is empty). Equivalent to SetTargetAngle(-1, angleStart, angleWidth)
 
GoalFuncSetTargetOriginRange (int rangeObserverSlot, float minDistance, float maxDistance)
 Creates a range observer with the given parameters. The observer measures range without taking the AI's hit radius into account. The observer can normally be accessed with INTERUPT_TargetOutOfRange, IsTargetOutOfRangeInterruptSlot. No longer used in ER (IsTargetOutOfRangeInterruptSlot is empty).
 
GoalFuncSetTargetOriginRange (float minDistance, float maxDistance)
 Creates a range observer with the given parameters. The observer measures range without taking the AI's hit radius into account. The observer can normally be accessed with INTERUPT_TargetOutOfRange, IsTargetOutOfRangeInterruptSlot. No longer used in ER (IsTargetOutOfRangeInterruptSlot is empty). Equivalent to SetTargetOriginRange(-1, minDistance, maxDistance)
 
GoalFuncSetTargetRange (int rangeObserverSlot, float minDistance, float maxDistance)
 Creates a range observer with the given parameters. The observer measures range with the AI's hit radius taken into account. The observer can normally be accessed with INTERUPT_TargetOutOfRange, IsTargetOutOfRangeInterruptSlot. No longer used in ER (IsTargetOutOfRangeInterruptSlot is empty).
 
GoalFuncSetTargetRange (float minDistance, float maxDistance)
 Creates a range observer with the given parameters. The observer measures range with the AI's hit radius taken into account. The observer can normally be accessed with INTERUPT_TargetOutOfRange, IsTargetOutOfRangeInterruptSlot. No longer used in ER (IsTargetOutOfRangeInterruptSlot is empty). Equivalent to SetTargetRange(-1, minDistance, maxDistance)
 
void SetTimer (int index, float value)
 Sets the given timer to the given value. Timers constantly tick down until they reach 0.
 
void SetTimerForTurnBeforeAtk (float value)
 Sets the goal's timer for turning to the given value. The timer constantly ticks down until it reaches 0. Used with GOAL_COMMON_CommonAttack's turnTime, turnFaceAngle.
 
GoalFuncTimingSetNumber (int index, float value, AI_TIMING_SET when)
 ets the goal's number to the value at the moment given.
 
GoalFuncTimingSetTimer (int index, float value, AI_TIMING_SET when)
 Sets the goal's timer to the value at the moment given.
 
GOAL_RESULT UpdateSubGoal ()
 Updates active subgoal (including all normal update functionalities, such as executing the goal's "Update" method).
 

Detailed Description

Represents a Goal object.

Definition at line 8 of file GoalFunc.hpp.

Member Function Documentation

◆ AddGoalScopedTeamRecord()

void GoalFunc::AddGoalScopedTeamRecord ( int cooridnateType,
int target,
float p3 )
Parameters
cooridnateType
target
p3

◆ AddLifeParentSubGoal()

void GoalFunc::AddLifeParentSubGoal ( float life)

Adds the given amount of time to the parent's, grand-parent's, grand-grand-parent's..., life.

Parameters
lifelife to add

◆ AddSubGoal()

GoalFunc * GoalFunc::AddSubGoal ( int goalId,
float life,
float goalParam0 = 0,
float goalParam1 = 0,
float goalParam2 = 0,
float goalParam3 = 0,
float goalParam4 = 0,
float goalParam5 = 0,
float goalParam6 = 0,
float goalParam7 = 0,
float goalParam8 = 0,
float goalParam9 = 0,
float goalParam10 = 0,
float goalParam11 = 0,
float goalParam12 = 0 )

Adds subgoal to this goal's subgoal queue.

Parameters
goalIdgoal to add
lifelife of goal
goalParam00th goal param
goalParam11st goal param
goalParam22nd goal param
goalParam33rd goal param
goalParam44th goal param
goalParam55th goal param
goalParam66th goal param
goalParam77th goal param
goalParam88th goal param
goalParam99th goal param
goalParam1010th goal param
goalParam1111th goal param
goalParam1212th goal param
Returns
the created subgoal

◆ AddSubGoal_Front()

GoalFunc * GoalFunc::AddSubGoal_Front ( int goalId,
float life,
float goalParam0,
float goalParam1,
float goalParam2 )

Adds subgoal to the front of this goal's subgoal queue.

Parameters
goalIdgoal to add
lifelife of goal
goalParam00th goal param
goalParam11st goal param
goalParam22nd goal param
Returns
the created subgoal

◆ AdjustDisplacement()

void GoalFunc::AdjustDisplacement ( int p1,
int p2,
float p3,
float p4,
float p5 )
Parameters
p1
p2
p3
p4
p5

◆ ClearSeriesSubGoal()

void GoalFunc::ClearSeriesSubGoal ( int goalId)

Clears all goals in the subgoal queue from front to back until it reaches a goal whose id isn't the given id. Example: SubGoal Queue [2000, 2000, 2001, 2001, 2000, 2003] ClearSeriesSubGoal(2000) -> [2001, 2001, 2000, 2003] ClearSeriesSubGoal(anything else) -> no change.

Parameters
goalIdgoal series to clear

◆ ClearSubGoal()

void GoalFunc::ClearSubGoal ( )

Clears goal's subgoal queue.

◆ GetBattleGoalId()

int GoalFunc::GetBattleGoalId ( )

Returns the AI's battle goal id.

Returns
the AI's battle goal id

◆ GetLastResult()

GOAL_RESULT GoalFunc::GetLastResult ( )

Returns the goal's last updated result.

Returns
the goal's last updated result

◆ GetLastSubGoalResult()

GOAL_RESULT GoalFunc::GetLastSubGoalResult ( )

Returns the goal's active subgoal's last updated result (from Update function).

Returns
the goal's active subgoal's last updated result

◆ GetLatestAddGoalFunc()

GoalFunc * GoalFunc::GetLatestAddGoalFunc ( )

Returns the last subgoal in the goal's subgoal queue (the last subgoal added).

Returns
the last subgoal in the goal's subgoal queue

◆ GetLife()

float GoalFunc::GetLife ( )

Returns the goal's life.

Returns
the goal's life

◆ GetNumber()

float GoalFunc::GetNumber ( int index)

Returns the number stored at the given index (0-7)

Parameters
indexnumber index
Returns
the number stored at the given index (0-7)

◆ GetParam()

float GoalFunc::GetParam ( int paramIndex)

Returns the goal's param at the given index (the params used at the time of the goal's creation, e.g AddSubGoal). If the param doesn't exist, returns 0.

Parameters
paramIndexparam index
Returns
the goal's param at the given index

◆ GetParamBool()

float GoalFunc::GetParamBool ( int paramIndex)

Returns true if the goal's param at the given index is bigger than 0, otherwise false (the params used at the time of the goal's creation). If the param doesn't exist, returns false. Lua's "true" = 1.0.

Parameters
paramIndexparam index
Returns
true if the goal's param at the given index is bigger than 0, otherwise false

◆ GetSubGoalNum()

int GoalFunc::GetSubGoalNum ( )

Returns the number of subgoals in the goal's subgoal queue.

Returns
the number of subgoals in the goal's subgoal queue

◆ GetTimer()

float GoalFunc::GetTimer ( int index)

Returns the given timer's remaining time.

Parameters
indextimer index
Returns
the given timer's remaining time

◆ IsExistParam()

bool GoalFunc::IsExistParam ( int paramIndex)

Returns true if the index is less than 8, or if the goal was created with the given param, otherwise false. Example: local child = goal:AddSubGoal(GOAL_COMMON_CommonAttack, 5, 3000, TARGET_ENE_0, 999, 180, 1, 180, true, true, false, false, 0, 0) yields child:IsExistParam(11) = true, child:IsExistParam(12) = false.

Parameters
paramIndexparam index
Returns
true if the index is less than 8, or if the goal was created with the given param, otherwise false

◆ IsFinishTimer()

bool GoalFunc::IsFinishTimer ( int index)

Returns true if the given timer's remaining time is less than or equal to 0, otherwise false.

Parameters
indextimer index
Returns
true if the given timer's remaining time is less than or equal to 0, otherwise false

◆ IsFinishTimerForTurnBeforeAtk()

bool GoalFunc::IsFinishTimerForTurnBeforeAtk ( )

Returns true if the timer to turn before executing the animation is less than or equal to 0, otherwise false. Used with CommonAttack's turnTime, turnFaceAngle.

Returns
true if the timer to turn before executing the animation is less than or equal to 0, otherwise false

◆ IsInterruptSubGoalChanged()

bool GoalFunc::IsInterruptSubGoalChanged ( )

Returns true if subgoals were added or cleared by the interrupt.

Returns
Returns true if subgoals were added or cleared by the interrupt

◆ SetEnableComboAttackCancel()

void GoalFunc::SetEnableComboAttackCancel ( )

Does nothing.

◆ SetFailedEndOption()

GoalFunc * GoalFunc::SetFailedEndOption ( AI_GOAL_FAILED_END_OPT failedEndOption)

Set what to do on goal failure.

Parameters
failedEndOptionwhat to do on goal failure
Returns
this

◆ SetLifeEndSuccess()

GoalFunc * GoalFunc::SetLifeEndSuccess ( bool enable)

Set whether the goal's life running out is a success or failure (goal will end either way). Default: GOAL_RESULT_Failed

Parameters
enableenable
Returns
this

◆ SetManagementGoal()

void GoalFunc::SetManagementGoal ( )

◆ SetNumber()

void GoalFunc::SetNumber ( int index,
float value )

Store the given number in the given index (0-7).

Parameters
indexnumber index
valuevalue

◆ SetTargetAngle() [1/2]

GoalFunc * GoalFunc::SetTargetAngle ( float angleStart,
float angleWidth )

Creates an angle observer with the given parameters. The observer can normally be accessed with INTERUPT_TargetOutOfAngle, IsTargetOutOfAngleInterruptSlot. No longer used in ER (IsTargetOutOfAngleInterruptSlot is empty). Equivalent to SetTargetAngle(-1, angleStart, angleWidth)

Parameters
angleStartangle offset from front
angleWidthangle width
Returns
this

◆ SetTargetAngle() [2/2]

GoalFunc * GoalFunc::SetTargetAngle ( int angleObserverSlot,
float angleStart,
float angleWidth )

Creates an angle observer with the given parameters. The observer can normally be accessed with INTERUPT_TargetOutOfAngle, IsTargetOutOfAngleInterruptSlot. No longer used in ER (IsTargetOutOfAngleInterruptSlot is empty).

Parameters
angleObserverSlotobserver slot
angleStartangle offset from front
angleWidthangle width
Returns
this

◆ SetTargetOriginRange() [1/2]

GoalFunc * GoalFunc::SetTargetOriginRange ( float minDistance,
float maxDistance )

Creates a range observer with the given parameters. The observer measures range without taking the AI's hit radius into account. The observer can normally be accessed with INTERUPT_TargetOutOfRange, IsTargetOutOfRangeInterruptSlot. No longer used in ER (IsTargetOutOfRangeInterruptSlot is empty). Equivalent to SetTargetOriginRange(-1, minDistance, maxDistance)

Parameters
minDistanceminimum distance
maxDistancemaximum distance
Returns
this

◆ SetTargetOriginRange() [2/2]

GoalFunc * GoalFunc::SetTargetOriginRange ( int rangeObserverSlot,
float minDistance,
float maxDistance )

Creates a range observer with the given parameters. The observer measures range without taking the AI's hit radius into account. The observer can normally be accessed with INTERUPT_TargetOutOfRange, IsTargetOutOfRangeInterruptSlot. No longer used in ER (IsTargetOutOfRangeInterruptSlot is empty).

Parameters
rangeObserverSlotobserver slot
minDistanceminimum distance
maxDistancemaximum distance
Returns
this

◆ SetTargetRange() [1/2]

GoalFunc * GoalFunc::SetTargetRange ( float minDistance,
float maxDistance )

Creates a range observer with the given parameters. The observer measures range with the AI's hit radius taken into account. The observer can normally be accessed with INTERUPT_TargetOutOfRange, IsTargetOutOfRangeInterruptSlot. No longer used in ER (IsTargetOutOfRangeInterruptSlot is empty). Equivalent to SetTargetRange(-1, minDistance, maxDistance)

Parameters
minDistanceminimum distance
maxDistancemaximum distance
Returns
this

◆ SetTargetRange() [2/2]

GoalFunc * GoalFunc::SetTargetRange ( int rangeObserverSlot,
float minDistance,
float maxDistance )

Creates a range observer with the given parameters. The observer measures range with the AI's hit radius taken into account. The observer can normally be accessed with INTERUPT_TargetOutOfRange, IsTargetOutOfRangeInterruptSlot. No longer used in ER (IsTargetOutOfRangeInterruptSlot is empty).

Parameters
rangeObserverSlotobserver slot
minDistanceminimum distance
maxDistancemaximum distance
Returns
this

◆ SetTimer()

void GoalFunc::SetTimer ( int index,
float value )

Sets the given timer to the given value. Timers constantly tick down until they reach 0.

Parameters
indextimer index (0-15)
valuetime [seconds]

◆ SetTimerForTurnBeforeAtk()

void GoalFunc::SetTimerForTurnBeforeAtk ( float value)

Sets the goal's timer for turning to the given value. The timer constantly ticks down until it reaches 0. Used with GOAL_COMMON_CommonAttack's turnTime, turnFaceAngle.

Parameters
valuetime [seconds]

◆ TimingSetNumber()

GoalFunc * GoalFunc::TimingSetNumber ( int index,
float value,
AI_TIMING_SET when )

ets the goal's number to the value at the moment given.

Parameters
indexnumber index
valuevalue
whenwhen to set number
Returns
this

◆ TimingSetTimer()

GoalFunc * GoalFunc::TimingSetTimer ( int index,
float value,
AI_TIMING_SET when )

Sets the goal's timer to the value at the moment given.

Parameters
indextimer index
valuetime [seconds]
whenwhen to set the given timer to the given value
Returns
this

◆ UpdateSubGoal()

GOAL_RESULT GoalFunc::UpdateSubGoal ( )

Updates active subgoal (including all normal update functionalities, such as executing the goal's "Update" method).

Returns
the subgoal's update result

The documentation for this class was generated from the following file: