Tactics: Western Philosophers Vs. Musicians  0.12
A turn-based tactical game combining rules and gameplay elements inspired by Final Fantasy Tactics and the Mayfair Exponential Game System. Unlike most games of this type, motion is in full, grid-less 3D.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Attributes | List of all members
Tactics3D::NPC Class Reference

#include <Tactics3DNPC.h>

Inheritance diagram for Tactics3D::NPC:
Tactics3D::Warrior OpenSkyNet::Core::AIWrapperObject OpenSkyNet::Core::TransformChangeListener OpenSkyNet::Core::ABCObject OpenSkyNet::Core::CollisionListener OpenSkyNet::Core::Object OpenSkyNet::AI::Wrapper OpenSkyNet::Core::Object

Public Member Functions

 NPC (OpenSkyNet::Utils::uint networkId_, OpenSkyNet::Core::PhysVisObject *pVO_, int gp_, int lvl_, int dex_, int str_, int end_, TEAM team_)
 
virtual ~NPC ()
 
virtual bool doPerformAction (const Action *action_, bool &doDelay_, bool &doSubstitute_, Action *&substitute_)
 
virtual void setActions ()
 
const OpenSkyNet::Math::PointgetPosPrePerformAnyAction () const
 
const OpenSkyNet::Math::PathgetPath () const
 
Object interface methods
virtual OpenSkyNet::Math::Point getPos () const
 
virtual void getPos (OpenSkyNet::Math::Point<> &pos_) const
 
virtual void setPos (const OpenSkyNet::Math::Point<> &pos_)
 
virtual bool getHasPosChanged () const
 
virtual void setHasPosChanged (bool val_)
 
virtual OpenSkyNet::Math::Matrix3x3 getRot () const
 
virtual void getRot (OpenSkyNet::Math::Matrix3x3 &rot_) const
 
virtual void setRot (const OpenSkyNet::Math::Matrix3x3 &rot_)
 
virtual bool getHasRotChanged () const
 
virtual void setHasRotChanged (bool val_)
 
virtual OpenSkyNet::Math::Point getVel () const
 
virtual void getVel (OpenSkyNet::Math::Point<> &vel_) const
 
virtual void setVel (const OpenSkyNet::Math::Point<> &vel_)
 
virtual bool getHasVelChanged () const
 
virtual void setHasVelChanged (bool val_)
 
virtual OpenSkyNet::Math::Point getAngVel () const
 
virtual void getAngVel (OpenSkyNet::Math::Point<> &angVel_) const
 
virtual void setAngVel (const OpenSkyNet::Math::Point<> &angVel_)
 
virtual bool getHasAngVelChanged () const
 
virtual void setHasAngVelChanged (bool val_)
 
virtual const
OpenSkyNet::Core::PhysicalObject
getPhysicalObject () const
 
virtual
OpenSkyNet::Core::PhysicalObject
getPhysicalObject ()
 
virtual const
OpenSkyNet::Core::VisibleObject
getVisibleObject () const
 
virtual
OpenSkyNet::Core::VisibleObject
getVisibleObject ()
 
virtual const std::string & getName () const
 
virtual void setName (const std::string &name_)
 
AIWrapperObject interface methods
virtual void doAction ()
 
TransformChangeListener interface methods
virtual void handleTransformChange (OpenSkyNet::Core::Object *obj_, const OpenSkyNet::Math::Point<> &prevPos_, const OpenSkyNet::Math::Matrix3x3 &prevRot_, float dt_)
 
virtual void handleIdle (OpenSkyNet::Core::Object *obj_, float idleSecs_)
 
Tactics3D event handlers
virtual void onPrePerformAnyAction (const std::vector< Warrior * > &warriors_)
 
virtual void onMove ()
 
- Public Member Functions inherited from Tactics3D::Warrior
 Warrior (OpenSkyNet::Utils::uint networkId_, OpenSkyNet::Core::PhysVisObject *pVO_, int gp_, int lvl_, int dex_, int str_, int end_, TEAM team_)
 
virtual ~Warrior ()
 
void setTempOD (int oD_)
 
void takeDamage (int dmg_)
 
virtual void setIsTurn (bool isTurn_)
 
bool isGrounded () const
 
void setGrounded (bool isGrounded_)
 
bool isGrappling () const
 
WarriorgetOtherGrappler () const
 
virtual bool grapple (Warrior *otherGrappler_)
 
virtual bool stopGrappling ()
 
bool isAlive () const
 
void setDead ()
 
const std::vector< AttackRange * > & getAttackRanges () const
 
virtual const AttackRangegetAttackRange (SPECIAL_MOVE specialMove_) const
 
void addEvocationObject (EvocationObject *evoObj_)
 
std::vector< EvocationObject * > & getEvocationObjects ()
 
void snapToGrid ()
 
virtual void setNonCollidingData (OpenSkyNet::Core::Object *obj_)
 
virtual void handleNonCollidingTransformApplied (OpenSkyNet::Core::Object *obj_)
 
virtual bool handleCollisions (OpenSkyNet::Core::Object *collidee_, std::vector< OpenSkyNet::CD::HitInfo > &colliders_, float &dt_)
 
virtual bool handleOutOfGrid (OpenSkyNet::Core::Object *obj_)
 
virtual void handleNewAttackRangeCollisions (AttackRange *collidee_, std::vector< OpenSkyNet::Core::Object * > &colliders_)
 
virtual void handleDeletedAttackRangeCollisions (AttackRange *collidee_, std::vector< OpenSkyNet::Core::Object * > &colliders_)
 
virtual void setVisible (bool val_)
 
const
OpenSkyNet::OgreCore::OgreVisibleObject
getOgreVisibleObject () const
 
OpenSkyNet::OgreCore::OgreVisibleObjectgetOgreVisibleObject ()
 
Ogre::SceneNode * getRenderNode ()
 
Ogre::Entity * getEntity ()
 
void clearFightingStyles ()
 
void addFightingStyle (FIGHTING_STYLE style_, int rank_)
 
const FightingStyleContextMapgetFightingStyleContexts () const
 
void clearSuperPowers ()
 
void addSuperPower (SUPER_POWER power_)
 
const SuperPowerContextMapgetSuperPowerContexts () const
 
virtual bool setSuperPowerActive (SUPER_POWER power_, const SuperPower::Warriors &targets_)
 
bool isSuperPowerActive (SUPER_POWER power_)
 
virtual const std::list
< ICollectible * > & 
getInventory () const
 
virtual std::list
< ICollectible * > & 
getInventory ()
 
virtual const IWeapongetPrimaryWeapon () const
 
virtual IWeapongetPrimaryWeapon ()
 
virtual void setPrimaryWeapon (IWeapon *weapon_)
 
int getGP () const
 
int getLvl () const
 
virtual int getDex () const
 
virtual int getInitDex () const
 
virtual void setDex (int dex_)
 
virtual void setInitDex (int dex_)
 
virtual int getStr () const
 
virtual int getInitStr () const
 
virtual void setStr (int str_)
 
virtual void setInitStr (int str_)
 
virtual int getEnd () const
 
virtual int getInitEnd () const
 
virtual void setEnd (int end_)
 
virtual void setInitEnd (int end_)
 
TEAM getTeam () const
 
int getOO (FIGHTING_STYLE style_=HIGHEST_OO) const
 
int getOD () const
 
int getInitOD () const
 
int getDmgAdj () const
 
int getSpeed () const
 
void setSpeed (int speed_)
 
float getMovementLeftInAction () const
 
void disableMovement ()
 
void enableMovement ()
 
bool isMovementEnabled () const
 
void clearActions ()
 
std::list< Tactics3D::Action * > * getActions ()
 
const std::list
< Tactics3D::Action * > * 
getActions () const
 
virtual bool canAddAction (const Tactics3D::Action *action_) const
 
virtual bool updateContinuousAction (Tactics3D::Action *&action_)
 
SPECIAL_MOVE getSpecialMoveJustPerformed () const
 
virtual void addCounterableMove (Warrior *attacker_, SPECIAL_MOVE move_)
 
virtual bool canCounter (Warrior *attacker_, SPECIAL_MOVE move_) const
 
virtual void getPointInSpread (float spread_, OpenSkyNet::Math::Point< float, 2 > &p_)
 
const OpenSkyNet::Math::Point
< float, 2 > & 
getCachedPointInSpread ()
 
virtual void getAim (float spread_, OpenSkyNet::Math::Point<> &origin_, OpenSkyNet::Math::Point<> &dir_)
 
float getDist (const Warrior *warrior_) const
 
virtual void onPostPerformAction (const Action *action_)
 
virtual void onHipFire (OpenSkyNet::Core::Object *intendedTarget_, Action *action_)
 
virtual void onIronSightsFire (OpenSkyNet::Core::Object *intendedTarget_, Action *action_)
 
virtual void onEvocation ()
 
virtual bool onAttack (std::vector< OpenSkyNet::Utils::TaggedUnion > &eventParams_)
 
virtual void onDefend ()
 
virtual void onAttacked (const std::vector< OpenSkyNet::Utils::TaggedUnion > &eventParams_)
 
virtual void onDefended ()
 
virtual void onRoundEnd ()
 
OpenSkyNet::Utils::uint getNetworkId () const
 
- Public Member Functions inherited from OpenSkyNet::Core::ABCObject
 ABCObject ()
 
virtual ~ABCObject ()
 
- Public Member Functions inherited from OpenSkyNet::Core::Object
 Object ()
 
virtual ~Object ()
 
- Public Member Functions inherited from OpenSkyNet::Core::CollisionListener
virtual bool handleCollisions (Object *collidee_, std::vector< CD::HitInfo > &collisions_, float &dt_)
 
virtual void handleNewCollisions (Object *collidee_, std::vector< Object * > &colliders_)
 
virtual void handleDeletedCollisions (Object *collidee_, std::vector< Object * > &colliders_)
 
virtual bool handleWrongSidedness (Object *collidee_, std::vector< CD::HitInfo > &collisions_)
 
- Public Member Functions inherited from OpenSkyNet::Core::AIWrapperObject
virtual void init (AI::LOGIC_IDS logicId_, AI::FSM_IDS fSMId_, AI::State *state_)
 
virtual void init (AI::LOGIC_IDS logicId_, AI::FSM_IDS fSMId_, AI::State *state_, AI::KB *kB_)
 
virtual bool performLogic (bool includeGlobalKB_=false)
 returns true if state changed, false otherwise More...
 
virtual const AI::StategetCurrentState () const
 
virtual AI::KBgetKB ()
 

Static Public Attributes

static std::vector< Warrior * > * _warriors = 0
 
- Static Public Attributes inherited from Tactics3D::Warrior
static const
OpenSkyNet::Utils::uint 
MAX_FIGHTING_STYLES = 4
 
static const
OpenSkyNet::Utils::uint 
MAX_SUPER_POWERS = 2
 
static const
OpenSkyNet::Utils::uint 
MAX_ACTIONS = 3
 
static const volatile bool * _quit = 0
 
static bool _isSmokeTest = false
 

Additional Inherited Members

- Public Types inherited from Tactics3D::Warrior
enum  TEAM { NO_TEAM, PHILOSOPHER, MUSICIAN, MAX_TEAM }
 
typedef std::map
< FIGHTING_STYLE,
FightingStyleContext
FightingStyleContextMap
 
typedef std::map< SUPER_POWER,
SuperPowerContext
SuperPowerContextMap
 
- Static Public Member Functions inherited from Tactics3D::Warrior
static void setEvent (OpenSkyNet::Utils::SyncEvent &event_, bool ignoreIfQuitting_)
 
static void waitForEvent (OpenSkyNet::Utils::SyncEvent &event_, bool ignoreIfQuitting_)
 
static void setPerformEvent (bool ignoreIfQuitting_)
 
static void waitForPerformEvent (bool ignoreIfQuitting_)
 
static OpenSkyNet::Utils::uint getAttributesBufferLen ()
 
static OpenSkyNet::Utils::uint serializeAttributes (const Warrior *warrior_, char(&buffer_)[MAX_STRING_SIZE])
 
static void assembleAttributes (char(&buffer_)[MAX_STRING_SIZE], std::vector< OpenSkyNet::Utils::TaggedUnion > &eventParams_)
 
static OpenSkyNet::Utils::uint getActionsBufferLen ()
 
static OpenSkyNet::Utils::uint serializeActions (const Warrior *warrior_, char(&buffer_)[MAX_STRING_SIZE])
 
static void assembleActions (char(&buffer_)[MAX_STRING_SIZE], const std::vector< Warrior * > &warriors_, OpenSkyNet::Utils::uint warriorIndex_, std::list< Action * > &actions_)
 
static OpenSkyNet::Utils::uint getMoveUpdateBufferLen ()
 
static OpenSkyNet::Utils::uint serializeMoveUpdate (const Warrior *warrior_, int flags_, char(&buffer_)[MAX_STRING_SIZE])
 
static void assembleMoveUpdate (char(&buffer_)[MAX_STRING_SIZE], OpenSkyNet::Utils::uint warriorIndex_, int &flags_, OpenSkyNet::Math::Point<> &pos_, OpenSkyNet::Math::Point<> &axis_, float &radians_)
 
static OpenSkyNet::Utils::uint getAttackBufferLen ()
 
static OpenSkyNet::Utils::uint serializeAttack (const std::vector< OpenSkyNet::Utils::TaggedUnion > &eventParams_, char(&buffer_)[MAX_STRING_SIZE])
 
static void assembleAttack (char(&buffer_)[MAX_STRING_SIZE], std::vector< OpenSkyNet::Utils::TaggedUnion > &eventParams_)
 
- Static Public Member Functions inherited from OpenSkyNet::Core::AIWrapperObject
static AI::FSM ** getGlobalFSMs ()
 
- Public Attributes inherited from Tactics3D::Warrior
struct Tactics3D::Warrior::Override _override
 
- Protected Attributes inherited from Tactics3D::Warrior
OpenSkyNet::Utils::uint _networkId
 
OpenSkyNet::Core::PhysVisObject_pVO
 
OpenSkyNet::Math::Point _prevPos
 
int _gp
 
int _lvl
 
int _dex
 
int _str
 
int _end
 
int _initDex
 
int _initStr
 
int _initEnd
 
TEAM _team
 
int _oO
 
int _oD
 
int _prevOD
 
int _initOD
 
int _dmgAdj
 
int _speed
 
int _flags
 
int _numRoundEndEventsSinceTempOD
 
FightingStyleContextMap _fightingStyleContexts
 
SuperPowerContextMap _superPowerContexts
 
bool _isTurn
 
bool _isGrounded
 
bool _isGrappling
 
bool _isDead
 
SPECIAL_MOVE _specialMoveJustPerformed
 
std::set< CounterableMove_counterableMoves
 
float _movementLeftInAction
 
float _distMovedLastPosSet
 
std::vector< AttackRange * > _attackRanges
 
std::vector< EvocationObject * > _evocationObjects
 
std::list< Action * > _actions
 
Warrior_otherGrappler
 
OpenSkyNet::Math::Point< float, 2 > _cachedPointInSpread
 
std::list< ICollectible * > _inventory
 
- Protected Attributes inherited from OpenSkyNet::Core::ABCObject
std::string _name
 
bool _hasPosChanged
 
bool _hasRotChanged
 
bool _hasVelChanged
 
bool _hasAngVelChanged
 
- Static Protected Attributes inherited from Tactics3D::Warrior
static OpenSkyNet::Utils::SyncEvent _performEvent
 

Detailed Description

A non-player character in the game.

Constructor & Destructor Documentation

NPC::NPC ( OpenSkyNet::Utils::uint  networkId_,
OpenSkyNet::Core::PhysVisObject pVO_,
int  gp_,
int  lvl_,
int  dex_,
int  str_,
int  end_,
TEAM  team_ 
)
virtual Tactics3D::NPC::~NPC ( )
inlinevirtual

Member Function Documentation

void NPC::doAction ( )
virtual

AI method to be implemented by derived class.

Implements OpenSkyNet::Core::AIWrapperObject.

bool NPC::doPerformAction ( const Action action_,
bool &  doDelay_,
bool &  doSubstitute_,
Tactics3D::Action *&  substitute_ 
)
virtual
Todo:
handle multiple defenders
Todo:
Skip the current move action if the warrior is moving towards another warrior for an attack or special move this round and the defender is already in attack range. However, this prevents rotating towards the defender, so don't allow the skip for now.

Reimplemented from Tactics3D::Warrior.

virtual OpenSkyNet::Math::Point Tactics3D::NPC::getAngVel ( ) const
inlinevirtual

Reimplemented from Tactics3D::Warrior.

virtual void Tactics3D::NPC::getAngVel ( OpenSkyNet::Math::Point<> &  angVel_) const
inlinevirtual

Reimplemented from Tactics3D::Warrior.

virtual bool Tactics3D::NPC::getHasAngVelChanged ( ) const
inlinevirtual
virtual bool Tactics3D::NPC::getHasPosChanged ( ) const
inlinevirtual

Reimplemented from Tactics3D::Warrior.

virtual bool Tactics3D::NPC::getHasRotChanged ( ) const
inlinevirtual

Reimplemented from Tactics3D::Warrior.

virtual bool Tactics3D::NPC::getHasVelChanged ( ) const
inlinevirtual
virtual const std::string& Tactics3D::NPC::getName ( ) const
inlinevirtual
const OpenSkyNet::Math::Path& Tactics3D::NPC::getPath ( ) const
inline
virtual const OpenSkyNet::Core::PhysicalObject* Tactics3D::NPC::getPhysicalObject ( ) const
inlinevirtual

Reimplemented from Tactics3D::Warrior.

virtual OpenSkyNet::Core::PhysicalObject* Tactics3D::NPC::getPhysicalObject ( )
inlinevirtual

Reimplemented from Tactics3D::Warrior.

virtual OpenSkyNet::Math::Point Tactics3D::NPC::getPos ( ) const
inlinevirtual

Reimplemented from Tactics3D::Warrior.

virtual void Tactics3D::NPC::getPos ( OpenSkyNet::Math::Point<> &  pos_) const
inlinevirtual

Reimplemented from Tactics3D::Warrior.

const OpenSkyNet::Math::Point& Tactics3D::NPC::getPosPrePerformAnyAction ( ) const
inline
virtual OpenSkyNet::Math::Matrix3x3 Tactics3D::NPC::getRot ( ) const
inlinevirtual

Reimplemented from Tactics3D::Warrior.

virtual void Tactics3D::NPC::getRot ( OpenSkyNet::Math::Matrix3x3 rot_) const
inlinevirtual

Reimplemented from Tactics3D::Warrior.

virtual OpenSkyNet::Math::Point Tactics3D::NPC::getVel ( ) const
inlinevirtual

Reimplemented from Tactics3D::Warrior.

virtual void Tactics3D::NPC::getVel ( OpenSkyNet::Math::Point<> &  vel_) const
inlinevirtual

Reimplemented from Tactics3D::Warrior.

virtual const OpenSkyNet::Core::VisibleObject* Tactics3D::NPC::getVisibleObject ( ) const
inlinevirtual

Reimplemented from Tactics3D::Warrior.

virtual OpenSkyNet::Core::VisibleObject* Tactics3D::NPC::getVisibleObject ( )
inlinevirtual

Reimplemented from Tactics3D::Warrior.

void NPC::handleIdle ( OpenSkyNet::Core::Object obj_,
float  idleSecs_ 
)
virtual
void NPC::handleTransformChange ( OpenSkyNet::Core::Object obj_,
const OpenSkyNet::Math::Point<> &  prevPos_,
const OpenSkyNet::Math::Matrix3x3 prevRot_,
float  dt_ 
)
virtual
Todo:
find a better way to detect rotation changes

Implements OpenSkyNet::Core::TransformChangeListener.

void NPC::onMove ( )
virtual

Reimplemented from Tactics3D::Warrior.

void NPC::onPrePerformAnyAction ( const std::vector< Warrior * > &  warriors_)
virtual
Todo:
don't hardcode an attack range

Reimplemented from Tactics3D::Warrior.

void NPC::setActions ( )
virtual
Todo:
lame, have a better way to choose a special move based on the closest attack ranges
Todo:
lame, don't just choose a random attack
Todo:
lame, don't just hardcode the power punch modifier

Reimplemented from Tactics3D::Warrior.

virtual void Tactics3D::NPC::setAngVel ( const OpenSkyNet::Math::Point<> &  angVel_)
inlinevirtual
virtual void Tactics3D::NPC::setHasAngVelChanged ( bool  val_)
inlinevirtual
virtual void Tactics3D::NPC::setHasPosChanged ( bool  val_)
inlinevirtual

Reimplemented from Tactics3D::Warrior.

virtual void Tactics3D::NPC::setHasRotChanged ( bool  val_)
inlinevirtual

Reimplemented from Tactics3D::Warrior.

virtual void Tactics3D::NPC::setHasVelChanged ( bool  val_)
inlinevirtual
virtual void Tactics3D::NPC::setName ( const std::string &  name_)
inlinevirtual
void NPC::setPos ( const OpenSkyNet::Math::Point<> &  pos_)
virtual

Reimplemented from Tactics3D::Warrior.

virtual void Tactics3D::NPC::setRot ( const OpenSkyNet::Math::Matrix3x3 rot_)
inlinevirtual

Reimplemented from Tactics3D::Warrior.

virtual void Tactics3D::NPC::setVel ( const OpenSkyNet::Math::Point<> &  vel_)
inlinevirtual

Reimplemented from Tactics3D::Warrior.

Member Data Documentation

vector< Warrior * > * NPC::_warriors = 0
static

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