Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
Protected Member Functions | Protected Attributes | List of all members
dp88_AI_Unit Class Referenceabstract

Unit AI Base Class. More...

#include <dp88_customAI.h>

Protected Member Functions

void ResetAllActions (GameObject *obj)
 
virtual bool ShouldPursueTarget (GameObject *obj, GameObject *target)
 
virtual int GetPreferredAttackRange (GameObject *obj, GameObject *target)=0
 
virtual bool IsValidTarget (GameObject *obj, GameObject *target)=0
 
virtual dp88_AI_ObjectiveChooseNewObjective (GameObject *obj)=0
 

Protected Attributes

bool m_bMovingToObjective
 
bool m_bMovingToTarget
 

Additional Inherited Members

Detailed Description

Author
Daniel Paul (danpa.nosp@m.ul88.nosp@m.@yaho.nosp@m.o.co.nosp@m..uk)

The base class for unit AI classes, this defines some common functions and logic but leaves the specific implementation up to the derived classes

Member Function Documentation

◆ ChooseNewObjective()

virtual dp88_AI_Objective * dp88_AI_Unit::ChooseNewObjective ( GameObject * obj)
protectedpure virtual

Select a new objective

Implemented in dp88_AI_Tank_Offensive.

◆ GetPreferredAttackRange()

virtual int dp88_AI_Unit::GetPreferredAttackRange ( GameObject * obj,
GameObject * target )
protectedpure virtual

Get the preferred attack range for the specified target

Implemented in dp88_AI_Tank_Offensive.

◆ IsValidTarget()

virtual bool dp88_AI_Unit::IsValidTarget ( GameObject * obj,
GameObject * target )
protectedpure virtual

Check if the specified object is a valid target at this time

Implemented in dp88_AI_Tank_Offensive.

◆ ResetAllActions()

void dp88_AI_Unit::ResetAllActions ( GameObject * obj)
protectedvirtual

Called by derived classes to cancel all ongoing actions, can be overridden in a derived class to reset variable states as necessary

Reimplemented from dp88_customAI.

◆ ShouldPursueTarget()

bool dp88_AI_Unit::ShouldPursueTarget ( GameObject * obj,
GameObject * target )
protectedvirtual

Used by AttackTarget to decide if the unit should give chase to the target (or, if already within preferred range, hold position) or whether it should continue with its existing pathfinding operation (or, if none, hold position).

The default implementation will return true if the target base priority is >= 0 or there is no current objective to complete, otherwise it will return false

Member Data Documentation

◆ m_bMovingToObjective

bool dp88_AI_Unit::m_bMovingToObjective
protected

True if moving towards an objective

◆ m_bMovingToTarget

bool dp88_AI_Unit::m_bMovingToTarget
protected

True if moving towards an attack target