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
Tactics3DNPC.h
Go to the documentation of this file.
1 // Copyright (C) 2008-2015 Dylan Blair
3 //
4 // email: dblair@alumni.cs.utexas.edu
5 //
6 // This file is part of Tactics3D.
7 //
8 // Tactics3D is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // Tactics3D is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 
23 #ifndef TACTICS3DNPC_H
24 #define TACTICS3DNPC_H
25 
26 #include "Tactics3DWarrior.h"
27 
28 #include "../Libs/Core_LIB/IAIWrapperObject.h"
29 #include "../Libs/Core_LIB/ITransformChangeListener.h"
30 #include "../Libs/Math_LIB/MPath.h"
31 
32 namespace Tactics3D {
35  public:
36  static std::vector<Warrior*>* _warriors;
37 
39  int gp_, int lvl_, int dex_, int str_, int end_, TEAM team_);
40 
41  virtual ~NPC() {}
42 
45  virtual OpenSkyNet::Math::Point<> getPos() const { return Warrior::getPos(); }
46  virtual void getPos(OpenSkyNet::Math::Point<>& pos_) const { Warrior::getPos(pos_); }
47  virtual void setPos(const OpenSkyNet::Math::Point<>& pos_);
48  virtual bool getHasPosChanged() const { return Warrior::getHasPosChanged(); }
49  virtual void setHasPosChanged(bool val_) { Warrior::setHasPosChanged(val_); }
50 
51  virtual OpenSkyNet::Math::Matrix3x3 getRot() const { return Warrior::getRot(); }
52  virtual void getRot(OpenSkyNet::Math::Matrix3x3& rot_) const { Warrior::getRot(rot_); }
53  virtual void setRot(const OpenSkyNet::Math::Matrix3x3& rot_) { Warrior::setRot(rot_); }
54  virtual bool getHasRotChanged() const { return Warrior::getHasRotChanged(); }
55  virtual void setHasRotChanged(bool val_) { Warrior::setHasRotChanged(val_); }
56 
57  virtual OpenSkyNet::Math::Point<> getVel() const { return Warrior::getVel(); }
58  virtual void getVel(OpenSkyNet::Math::Point<>& vel_) const { Warrior::getVel(vel_); }
59  virtual void setVel(const OpenSkyNet::Math::Point<>& vel_) { Warrior::setVel(vel_); }
60  virtual bool getHasVelChanged() const { return Warrior::getHasVelChanged(); }
61  virtual void setHasVelChanged(bool val_) { Warrior::setHasVelChanged(val_); }
62 
64  virtual void getAngVel(OpenSkyNet::Math::Point<>& angVel_) const { Warrior::getAngVel(angVel_); }
65  virtual void setAngVel(const OpenSkyNet::Math::Point<>& angVel_) { Warrior::setAngVel(angVel_); }
66  virtual bool getHasAngVelChanged() const { return Warrior::getHasAngVelChanged(); }
67  virtual void setHasAngVelChanged(bool val_) { Warrior::setHasAngVelChanged(val_); }
68 
73 
74  virtual const std::string& getName() const { return Warrior::getName(); }
75  virtual void setName(const std::string& name_) { Warrior::setName(name_); }
77 
80  virtual void doAction();
82 
85  virtual void handleTransformChange(OpenSkyNet::Core::Object* obj_, const OpenSkyNet::Math::Point<>& prevPos_, const OpenSkyNet::Math::Matrix3x3& prevRot_, float dt_);
86  virtual void handleIdle(OpenSkyNet::Core::Object* obj_, float idleSecs_);
88 
89  virtual bool doPerformAction(const Action* action_, bool& doDelay_, bool& doSubstitute_, Action*& substitute_);
90 
93  virtual void onPrePerformAnyAction(const std::vector<Warrior*>& warriors_);
94  virtual void onMove();
96 
97  virtual void setActions();
98 
99  inline const OpenSkyNet::Math::Point<>& getPosPrePerformAnyAction() const { return _posPrePerformAnyAction; }
100 
101  inline const OpenSkyNet::Math::Path& getPath() const { return _path; }
102  private:
103  bool _isPerforming;
104  float _idleSecs;
105  OpenSkyNet::Math::Point<> _posPrePerformAnyAction;
107  };
108 }
109 
110 #endif //TACTICS3DNPC_H
virtual void getVel(OpenSkyNet::Math::Point<> &vel_) const
Definition: Tactics3DNPC.h:58
const OpenSkyNet::Math::Point & getPosPrePerformAnyAction() const
Definition: Tactics3DNPC.h:99
virtual OpenSkyNet::Math::Point getAngVel() const
Definition: Tactics3DNPC.h:63
Definition: CVisibleObject.h:28
virtual void handleIdle(OpenSkyNet::Core::Object *obj_, float idleSecs_)
Definition: Tactics3DNPC.cpp:72
virtual void handleTransformChange(OpenSkyNet::Core::Object *obj_, const OpenSkyNet::Math::Point<> &prevPos_, const OpenSkyNet::Math::Matrix3x3 &prevRot_, float dt_)
Definition: Tactics3DNPC.cpp:45
Definition: CPhysVisObject.h:30
Definition: Tactics3DAction.h:40
Definition: IAIWrapperObject.h:30
Definition: CPhysicalObject.h:33
virtual void setHasVelChanged(bool val_)
Definition: Tactics3DNPC.h:61
virtual OpenSkyNet::Core::PhysicalObject * getPhysicalObject()
Definition: Tactics3DNPC.h:70
NPC(OpenSkyNet::Utils::uint networkId_, OpenSkyNet::Core::PhysVisObject *pVO_, int gp_, int lvl_, int dex_, int str_, int end_, TEAM team_)
Definition: Tactics3DNPC.cpp:21
virtual const std::string & getName() const
Definition: Tactics3DNPC.h:74
virtual OpenSkyNet::Math::Point getAngVel() const
Definition: Tactics3DWarrior.cpp:124
virtual void doAction()
Definition: Tactics3DNPC.cpp:41
virtual bool getHasAngVelChanged() const
Definition: IObject.h:96
Definition: Tactics3DWarrior.h:42
virtual const OpenSkyNet::Core::VisibleObject * getVisibleObject() const
Definition: Tactics3DWarrior.h:130
virtual void setVel(const OpenSkyNet::Math::Point<> &vel_)
Definition: Tactics3DWarrior.h:123
Definition: ITransformChangeListener.h:29
virtual void setRot(const OpenSkyNet::Math::Matrix3x3 &rot_)
Definition: Tactics3DNPC.h:53
virtual bool getHasVelChanged() const
Definition: Tactics3DNPC.h:60
virtual void onPrePerformAnyAction(const std::vector< Warrior * > &warriors_)
Definition: Tactics3DNPC.cpp:157
virtual void getRot(OpenSkyNet::Math::Matrix3x3 &rot_) const
Definition: Tactics3DNPC.h:52
virtual const OpenSkyNet::Core::VisibleObject * getVisibleObject() const
Definition: Tactics3DNPC.h:71
virtual void setActions()
Definition: Tactics3DNPC.cpp:223
virtual void setVel(const OpenSkyNet::Math::Point<> &vel_)
Definition: Tactics3DNPC.h:59
virtual void setHasAngVelChanged(bool val_)
Definition: Tactics3DNPC.h:67
virtual void setHasRotChanged(bool val_)
Definition: Tactics3DNPC.h:55
virtual OpenSkyNet::Math::Point getPos() const
Definition: Tactics3DNPC.h:45
virtual void setHasVelChanged(bool val_)
Definition: IObject.h:91
virtual void setName(const std::string &name_)
Definition: IObject.h:105
virtual void setAngVel(const OpenSkyNet::Math::Point<> &angVel_)
Definition: Tactics3DNPC.h:65
virtual void setPos(const OpenSkyNet::Math::Point<> &pos_)
Definition: Tactics3DNPC.cpp:37
virtual bool getHasAngVelChanged() const
Definition: Tactics3DNPC.h:66
virtual void setHasPosChanged(bool val_)
Definition: Tactics3DWarrior.h:113
virtual OpenSkyNet::Math::Point getVel() const
Definition: Tactics3DWarrior.cpp:111
virtual void getAngVel(OpenSkyNet::Math::Point<> &angVel_) const
Definition: Tactics3DNPC.h:64
virtual bool getHasPosChanged() const
Definition: Tactics3DNPC.h:48
virtual OpenSkyNet::Math::Matrix3x3 getRot() const
Definition: Tactics3DNPC.h:51
unsigned int uint
Definition: UTypes.h:39
virtual OpenSkyNet::Core::VisibleObject * getVisibleObject()
Definition: Tactics3DNPC.h:72
virtual void setAngVel(const Math::Point<> &angVel_)
Definition: IObject.h:95
virtual void getPos(OpenSkyNet::Math::Point<> &pos_) const
Definition: Tactics3DNPC.h:46
virtual bool getHasVelChanged() const
Definition: IObject.h:90
Definition: MPoint.h:33
virtual void setRot(const OpenSkyNet::Math::Matrix3x3 &rot_)
Definition: Tactics3DWarrior.h:117
virtual bool doPerformAction(const Action *action_, bool &doDelay_, bool &doSubstitute_, Action *&substitute_)
Definition: Tactics3DNPC.cpp:95
Definition: IObject.h:36
virtual const OpenSkyNet::Core::PhysicalObject * getPhysicalObject() const
Definition: Tactics3DWarrior.h:128
static std::vector< Warrior * > * _warriors
Definition: Tactics3DNPC.h:36
virtual OpenSkyNet::Math::Matrix3x3 getRot() const
Definition: Tactics3DWarrior.h:115
Definition: Tactics3DNPC.h:34
virtual void setHasPosChanged(bool val_)
Definition: Tactics3DNPC.h:49
virtual void setHasAngVelChanged(bool val_)
Definition: IObject.h:97
virtual void onMove()
Definition: Tactics3DNPC.cpp:193
TEAM
Definition: Tactics3DWarrior.h:72
virtual bool getHasRotChanged() const
Definition: Tactics3DNPC.h:54
virtual bool getHasRotChanged() const
Definition: Tactics3DWarrior.h:118
virtual const std::string & getName() const
Definition: IObject.h:104
const OpenSkyNet::Math::Path & getPath() const
Definition: Tactics3DNPC.h:101
Definition: MMatrix3x3.h:32
virtual bool getHasPosChanged() const
Definition: Tactics3DWarrior.h:112
virtual void setHasRotChanged(bool val_)
Definition: Tactics3DWarrior.h:119
virtual const OpenSkyNet::Core::PhysicalObject * getPhysicalObject() const
Definition: Tactics3DNPC.h:69
virtual void setName(const std::string &name_)
Definition: Tactics3DNPC.h:75
float float rot_[3]
Definition: ViewerApp.h:31
virtual OpenSkyNet::Math::Point getVel() const
Definition: Tactics3DNPC.h:57
virtual ~NPC()
Definition: Tactics3DNPC.h:41
virtual OpenSkyNet::Math::Point getPos() const
Definition: Tactics3DWarrior.h:109
float pos_[3]
Definition: ViewerApp.h:31
Definition: MPath.h:31