23 #ifndef TACTICS3DWARRIOR_H
24 #define TACTICS3DWARRIOR_H
26 #include "../Libs/OgreCore_LIB/OgrePhysVisObject.h"
27 #include "../Libs/Core_LIB/ICollisionListener.h"
28 #include "../Libs/Core_LIB/CLog.h"
29 #include "../Libs/Utils_LIB/UThread.h"
32 #include <EASTL/fixed_map.h>
74 #define WARRIOR_MOVEMENT_DISABLED (1 << 0)
103 int gp_,
int lvl_,
int dex_,
int str_,
int end_,
TEAM team_);
172 return static_cast<Ogre::Entity*
>(node->getAttachedObject(
getName()));
214 virtual void setDex(
int dex_);
219 virtual void setStr(
int str_);
224 virtual void setEnd(
int end_);
233 return i->second._oO;
290 std::set<CounterableMove>::const_iterator i =
_counterableMoves.find(counterableMove);
325 virtual bool onAttack(std::vector<OpenSkyNet::Utils::TaggedUnion>& eventParams_) {
return false; }
327 virtual void onAttacked(
const std::vector<OpenSkyNet::Utils::TaggedUnion>& eventParams_) {}
343 if (ignoreIfQuitting_ &&
_quit && *
_quit)
return;
347 if (ignoreIfQuitting_ &&
_quit && *
_quit)
return;
359 #define OVERRIDE_GROUNDED (1 << 0) // rendering thread -> game thread
360 #define OVERRIDE_DEAD (1 << 1) // rendering thread -> game thread
361 #define OVERRIDE_EVOCATION (1 << 2) // game thread -> rendering thread
393 #define MOVE_UPDATE_FINAL (1 << 0)
408 #endif //TACTICS3DWARRIOR_H
int _uses
Definition: Tactics3DWarrior.h:52
const std::list< Tactics3D::Action * > * getActions() const
Definition: Tactics3DWarrior.h:260
std::list< ICollectible * > _inventory
Definition: Tactics3DWarrior.h:98
void setSpeed(int speed_)
Definition: Tactics3DWarrior.h:241
static void assembleActions(char(&buffer_)[MAX_STRING_SIZE], const std::vector< Warrior * > &warriors_, OpenSkyNet::Utils::uint warriorIndex_, std::list< Action * > &actions_)
Definition: Tactics3DNetwork.cpp:260
virtual bool getHasPosChanged() const
Definition: CPhysVisObject.h:46
Definition: CVisibleObject.h:28
SPECIAL_MOVE
Definition: Tactics3DFightingStyle.h:37
virtual void setVel(const Math::Point<> &vel_)
Definition: CPhysVisObject.h:57
virtual void handleNonCollidingTransformApplied(OpenSkyNet::Core::Object *obj_)
Definition: Tactics3DWarrior.cpp:137
Definition: CPhysVisObject.h:30
Ogre::SceneNode * getRenderNode()
Definition: Tactics3DWarrior.h:159
void set()
Definition: UThread.h:87
Warrior(OpenSkyNet::Utils::uint networkId_, OpenSkyNet::Core::PhysVisObject *pVO_, int gp_, int lvl_, int dex_, int str_, int end_, TEAM team_)
Definition: Tactics3DWarrior.cpp:21
virtual void onPrePerformAnyAction(const std::vector< Warrior * > &warriors_)
Definition: Tactics3DWarrior.cpp:551
Definition: Tactics3DAction.h:40
int _initOD
Definition: Tactics3DWarrior.h:82
Definition: Tactics3DFightingStyle.h:44
struct Tactics3D::Warrior::Override _override
virtual void onDefended()
Definition: Tactics3DWarrior.cpp:578
Definition: CPhysicalObject.h:33
FIGHTING_STYLE
Definition: Tactics3DFightingStyle.h:41
virtual OpenSkyNet::Core::PhysicalObject * getPhysicalObject()
Definition: Tactics3DWarrior.h:129
virtual void onAttacked(const std::vector< OpenSkyNet::Utils::TaggedUnion > &eventParams_)
Definition: Tactics3DWarrior.h:327
int _flags
Definition: Tactics3DWarrior.h:85
int getOO(FIGHTING_STYLE style_=HIGHEST_OO) const
Definition: Tactics3DWarrior.h:229
virtual void onMove()
Definition: Tactics3DWarrior.h:321
virtual bool updateContinuousAction(Tactics3D::Action *&action_)
Definition: Tactics3DWarrior.cpp:281
FightingStyleContext(int rank_, int oO_, int oD_)
Definition: Tactics3DWarrior.h:48
static OpenSkyNet::Utils::uint getAttributesBufferLen()
Definition: Tactics3DNetwork.cpp:50
static const OpenSkyNet::Utils::uint MAX_FIGHTING_STYLES
Definition: Tactics3DWarrior.h:59
static OpenSkyNet::Utils::SyncEvent _performEvent
Definition: Tactics3DWarrior.h:100
virtual ~Warrior()
Definition: Tactics3DWarrior.cpp:49
void takeDamage(int dmg_)
Definition: Tactics3DWarrior.cpp:324
int _speed
Definition: Tactics3DWarrior.h:84
virtual int getInitStr() const
Definition: Tactics3DWarrior.h:218
SuperPowerContext()
Definition: Tactics3DWarrior.h:55
void clearActions()
Definition: Tactics3DWarrior.h:257
virtual OpenSkyNet::Math::Point getAngVel() const
Definition: Tactics3DWarrior.cpp:124
int getLvl() const
Definition: Tactics3DWarrior.h:210
Definition: Tactics3DInventory.h:50
virtual void setActions()
Definition: Tactics3DWarrior.h:255
void addFightingStyle(FIGHTING_STYLE style_, int rank_)
Definition: Tactics3DWarrior.cpp:168
float _movementLeftInAction
Definition: Tactics3DWarrior.h:92
std::map< FIGHTING_STYLE, FightingStyleContext > FightingStyleContextMap
Definition: Tactics3DWarrior.h:68
Definition: Tactics3DWarrior.h:370
bool isAlive() const
Definition: Tactics3DWarrior.h:297
static OpenSkyNet::Utils::uint serializeActions(const Warrior *warrior_, char(&buffer_)[MAX_STRING_SIZE])
Definition: Tactics3DNetwork.cpp:117
const FightingStyleContextMap & getFightingStyleContexts() const
Definition: Tactics3DWarrior.h:182
void snapToGrid()
Definition: Tactics3DWarrior.cpp:612
virtual Math::Point getPos() const
Definition: CPhysVisObject.h:43
virtual void setInitStr(int str_)
Definition: Tactics3DWarrior.h:220
SuperPower::Warriors _targets
Definition: Tactics3DWarrior.h:54
virtual void setRot(const Math::Matrix3x3 &rot_)
Definition: CPhysVisObject.h:51
Ogre::Entity * getEntity()
Definition: Tactics3DWarrior.h:168
virtual const IWeapon * getPrimaryWeapon() const
Definition: Tactics3DWarrior.cpp:219
Definition: Tactics3DWarrior.h:42
SPECIAL_MOVE getSpecialMoveJustPerformed() const
Definition: Tactics3DWarrior.h:282
int _oO
Definition: Tactics3DWarrior.h:82
virtual const OpenSkyNet::Core::VisibleObject * getVisibleObject() const
Definition: Tactics3DWarrior.h:130
int _gp
Definition: Tactics3DWarrior.h:79
int _prevOD
Definition: Tactics3DWarrior.h:82
virtual void setVisible(bool val_)
Definition: CVisibleObject.h:33
void clearFightingStyles()
Definition: Tactics3DWarrior.cpp:161
std::vector< Warrior * > Warriors
Definition: Tactics3DSuperPower.h:43
virtual void setVel(const OpenSkyNet::Math::Point<> &vel_)
Definition: Tactics3DWarrior.h:123
static OpenSkyNet::Utils::uint getMoveUpdateBufferLen()
Definition: Tactics3DNetwork.cpp:433
bool _isTurn
Definition: Tactics3DWarrior.h:89
virtual void setInitDex(int dex_)
Definition: Tactics3DWarrior.h:215
Definition: Tactics3DWarrior.h:72
SPECIAL_MOVE _specialMoveJustPerformed
Definition: Tactics3DWarrior.h:90
virtual int getStr() const
Definition: Tactics3DWarrior.h:217
void setDead()
Definition: Tactics3DWarrior.cpp:451
virtual const VisibleObject * getVisibleObject() const
Definition: CPhysVisObject.h:61
void wait()
Definition: UThread.h:98
void clearSuperPowers()
Definition: Tactics3DWarrior.h:187
OpenSkyNet::Utils::uint _networkId
Definition: Tactics3DWarrior.h:76
virtual const AttackRange * getAttackRange(SPECIAL_MOVE specialMove_) const
Definition: Tactics3DWarrior.cpp:469
static OpenSkyNet::Utils::uint getActionsBufferLen()
Definition: Tactics3DNetwork.cpp:112
virtual void setInitEnd(int end_)
Definition: Tactics3DWarrior.h:225
static void setPerformEvent(bool ignoreIfQuitting_)
Definition: Tactics3DWarrior.h:352
std::map< SUPER_POWER, SuperPowerContext > SuperPowerContextMap
Definition: Tactics3DWarrior.h:69
virtual void setHasRotChanged(bool val_)
Definition: CPhysVisObject.h:53
virtual std::list< ICollectible * > & getInventory()
Definition: Tactics3DWarrior.h:198
virtual void getPos(OpenSkyNet::Math::Point<> &pos_) const
Definition: Tactics3DWarrior.h:110
#define MAX_STRING_SIZE
Definition: UTypes.h:33
static const OpenSkyNet::Utils::uint MAX_ACTIONS
Definition: Tactics3DWarrior.h:61
bool _isDead
Definition: Tactics3DWarrior.h:89
Definition: Tactics3DFightingStyle.h:42
std::list< Action * > _actions
Definition: Tactics3DWarrior.h:95
Definition: Tactics3DEvocationObject.h:31
std::list< Tactics3D::Action * > * getActions()
Definition: Tactics3DWarrior.h:259
static void waitForPerformEvent(bool ignoreIfQuitting_)
Definition: Tactics3DWarrior.h:355
TEAM _team
Definition: Tactics3DWarrior.h:81
OpenSkyNet::Math::Point< float, 2 > _cachedPointInSpread
Definition: Tactics3DWarrior.h:97
virtual int getInitEnd() const
Definition: Tactics3DWarrior.h:223
int getDmgAdj() const
Definition: Tactics3DWarrior.h:238
virtual void onIronSightsFire(OpenSkyNet::Core::Object *intendedTarget_, Action *action_)
Definition: Tactics3DWarrior.h:323
FightingStyleContext()
Definition: Tactics3DWarrior.h:47
virtual void setIsTurn(bool isTurn_)
Definition: Tactics3DWarrior.cpp:350
virtual bool doPerformAction(const Action *action_, bool &doDelay_, bool &doSubstitute_, Action *&substitute_)
Definition: Tactics3DWarrior.cpp:515
int getSpeed() const
Definition: Tactics3DWarrior.h:240
std::string _name
Definition: Tactics3DWarrior.h:374
Definition: Tactics3DWarrior.h:72
std::vector< EvocationObject * > _evocationObjects
Definition: Tactics3DWarrior.h:94
Definition: OgreVisibleObject.h:33
const OpenSkyNet::OgreCore::OgreVisibleObject * getOgreVisibleObject() const
Definition: Tactics3DWarrior.h:152
float getDist(const Warrior *warrior_) const
Definition: Tactics3DWarrior.cpp:505
std::vector< AttackRange * > _attackRanges
Definition: Tactics3DWarrior.h:93
virtual void setHasPosChanged(bool val_)
Definition: CPhysVisObject.h:47
const Ogre::SceneNode * getRenderNode() const
Definition: OgreVisibleObject.h:59
void setGrounded(bool isGrounded_)
Definition: Tactics3DWarrior.cpp:359
virtual bool getHasRotChanged() const
Definition: CPhysVisObject.h:52
virtual void handleNewAttackRangeCollisions(AttackRange *collidee_, std::vector< OpenSkyNet::Core::Object * > &colliders_)
Definition: Tactics3DWarrior.h:144
Definition: Tactics3DWarrior.h:45
virtual void onPostPerformAction(const Action *action_)
Definition: Tactics3DWarrior.cpp:568
virtual void setHasPosChanged(bool val_)
Definition: Tactics3DWarrior.h:113
int _numRoundEndEventsSinceTempOD
Definition: Tactics3DWarrior.h:86
virtual OpenSkyNet::Math::Point getVel() const
Definition: Tactics3DWarrior.cpp:111
Definition: Tactics3DWarrior.h:51
virtual int getEnd() const
Definition: Tactics3DWarrior.h:222
int _rank
Definition: Tactics3DWarrior.h:46
int _lvl
Definition: Tactics3DWarrior.h:79
Definition: Tactics3DAttackRange.h:33
TEAM getTeam() const
Definition: Tactics3DWarrior.h:227
bool _isGrappling
Definition: Tactics3DWarrior.h:89
bool _isDead
Definition: Tactics3DWarrior.h:373
bool isSuperPowerActive(SUPER_POWER power_)
Definition: Tactics3DWarrior.cpp:210
const SuperPowerContextMap & getSuperPowerContexts() const
Definition: Tactics3DWarrior.h:189
std::vector< EvocationObject * > & getEvocationObjects()
Definition: Tactics3DWarrior.h:304
virtual void getRot(OpenSkyNet::Math::Matrix3x3 &rot_) const
Definition: Tactics3DWarrior.h:116
virtual void getPointInSpread(float spread_, OpenSkyNet::Math::Point< float, 2 > &p_)
Definition: Tactics3DWarrior.cpp:484
virtual void setNonCollidingData(Object *obj_)
Definition: CPhysVisObject.h:67
virtual const std::list< ICollectible * > & getInventory() const
Definition: Tactics3DWarrior.h:197
unsigned int uint
Definition: UTypes.h:39
int _initStr
Definition: Tactics3DWarrior.h:80
virtual void onEvocation()
Definition: Tactics3DWarrior.h:324
static void setEvent(OpenSkyNet::Utils::SyncEvent &event_, bool ignoreIfQuitting_)
Definition: Tactics3DWarrior.h:342
static void waitForEvent(OpenSkyNet::Utils::SyncEvent &event_, bool ignoreIfQuitting_)
Definition: Tactics3DWarrior.h:346
Override()
Definition: Tactics3DWarrior.h:375
int getOD() const
Definition: Tactics3DWarrior.h:235
virtual void getAim(float spread_, OpenSkyNet::Math::Point<> &origin_, OpenSkyNet::Math::Point<> &dir_)
Definition: Tactics3DWarrior.cpp:489
int _oD
Definition: Tactics3DWarrior.h:46
virtual void setDex(int dex_)
Definition: Tactics3DWarrior.cpp:248
SUPER_POWER
Definition: Tactics3DSuperPower.h:35
virtual void handleDeletedAttackRangeCollisions(AttackRange *collidee_, std::vector< OpenSkyNet::Core::Object * > &colliders_)
Definition: Tactics3DWarrior.h:145
virtual Math::Matrix3x3 getRot() const
Definition: CPhysVisObject.h:49
float _distMovedLastPosSet
Definition: Tactics3DWarrior.h:92
int _initEnd
Definition: Tactics3DWarrior.h:80
static const OpenSkyNet::Utils::uint MAX_SUPER_POWERS
Definition: Tactics3DWarrior.h:60
virtual void setRot(const OpenSkyNet::Math::Matrix3x3 &rot_)
Definition: Tactics3DWarrior.h:117
static OpenSkyNet::Utils::uint getAttackBufferLen()
Definition: Tactics3DNetwork.cpp:491
void setTempOD(int oD_)
Definition: Tactics3DWarrior.cpp:262
bool isGrounded() const
Definition: Tactics3DWarrior.h:272
virtual const OpenSkyNet::Core::PhysicalObject * getPhysicalObject() const
Definition: Tactics3DWarrior.h:128
virtual OpenSkyNet::Math::Matrix3x3 getRot() const
Definition: Tactics3DWarrior.h:115
int _oO
Definition: Tactics3DWarrior.h:46
virtual OpenSkyNet::Core::VisibleObject * getVisibleObject()
Definition: Tactics3DWarrior.h:131
void addSuperPower(SUPER_POWER power_)
Definition: Tactics3DWarrior.cpp:180
virtual bool handleCollisions(OpenSkyNet::Core::Object *collidee_, std::vector< OpenSkyNet::CD::HitInfo > &colliders_, float &dt_)
Definition: Tactics3DWarrior.cpp:151
TEAM
Definition: Tactics3DWarrior.h:72
virtual const PhysicalObject * getPhysicalObject() const
Definition: CPhysVisObject.h:59
int _roundsRemaining
Definition: Tactics3DWarrior.h:53
SuperPowerContextMap _superPowerContexts
Definition: Tactics3DWarrior.h:88
OpenSkyNet::Core::PhysVisObject * _pVO
Definition: Tactics3DWarrior.h:77
virtual bool grapple(Warrior *otherGrappler_)
Definition: Tactics3DWarrior.cpp:387
static OpenSkyNet::Utils::uint serializeAttack(const std::vector< OpenSkyNet::Utils::TaggedUnion > &eventParams_, char(&buffer_)[MAX_STRING_SIZE])
Definition: Tactics3DNetwork.cpp:496
bool isMovementEnabled() const
Definition: Tactics3DWarrior.h:246
virtual void setStr(int str_)
Definition: Tactics3DWarrior.cpp:242
bool _isGrounded
Definition: Tactics3DWarrior.h:373
int _dex
Definition: Tactics3DWarrior.h:80
static const volatile bool * _quit
Definition: Tactics3DWarrior.h:337
const std::vector< AttackRange * > & getAttackRanges() const
Definition: Tactics3DWarrior.h:300
#define WARRIOR_MOVEMENT_DISABLED
Definition: Tactics3DWarrior.h:74
int _dmgAdj
Definition: Tactics3DWarrior.h:83
float getMovementLeftInAction() const
Definition: Tactics3DWarrior.h:243
virtual bool getHasRotChanged() const
Definition: Tactics3DWarrior.h:118
virtual int getInitDex() const
Definition: Tactics3DWarrior.h:213
virtual const std::string & getName() const
Definition: IObject.h:104
static OpenSkyNet::Utils::uint serializeMoveUpdate(const Warrior *warrior_, int flags_, char(&buffer_)[MAX_STRING_SIZE])
Definition: Tactics3DNetwork.cpp:438
static void assembleAttributes(char(&buffer_)[MAX_STRING_SIZE], std::vector< OpenSkyNet::Utils::TaggedUnion > &eventParams_)
Definition: Tactics3DNetwork.cpp:83
Definition: ICollisionListener.h:34
virtual void setNonCollidingData(OpenSkyNet::Core::Object *obj_)
Definition: Tactics3DWarrior.h:136
virtual void onHipFire(OpenSkyNet::Core::Object *intendedTarget_, Action *action_)
Definition: Tactics3DWarrior.h:322
virtual bool stopGrappling()
Definition: Tactics3DWarrior.cpp:416
int _str
Definition: Tactics3DWarrior.h:80
Definition: MMatrix3x3.h:32
virtual bool getHasPosChanged() const
Definition: Tactics3DWarrior.h:112
bool _isGrounded
Definition: Tactics3DWarrior.h:89
virtual void setHasRotChanged(bool val_)
Definition: Tactics3DWarrior.h:119
bool isGrappling() const
Definition: Tactics3DWarrior.h:275
virtual bool canAddAction(const Tactics3D::Action *action_) const
Definition: Tactics3DWarrior.cpp:268
static void assembleAttack(char(&buffer_)[MAX_STRING_SIZE], std::vector< OpenSkyNet::Utils::TaggedUnion > &eventParams_)
Definition: Tactics3DNetwork.cpp:520
virtual void setPrimaryWeapon(IWeapon *weapon_)
Definition: Tactics3DWarrior.cpp:237
int _flags
Definition: Tactics3DWarrior.h:372
void addEvocationObject(EvocationObject *evoObj_)
Definition: Tactics3DWarrior.h:303
OpenSkyNet::Math::Point _prevPos
Definition: Tactics3DWarrior.h:78
SuperPowerContext(int maxUses_)
Definition: Tactics3DWarrior.h:56
int _oD
Definition: Tactics3DWarrior.h:82
OpenSkyNet::OgreCore::OgreVisibleObject * getOgreVisibleObject()
Definition: Tactics3DWarrior.h:155
float float rot_[3]
Definition: ViewerApp.h:31
Warrior * _otherGrappler
Definition: Tactics3DWarrior.h:96
virtual void setEnd(int end_)
Definition: Tactics3DWarrior.cpp:258
virtual void onDefend()
Definition: Tactics3DWarrior.h:326
Warrior * getOtherGrappler() const
Definition: Tactics3DWarrior.h:276
virtual bool setSuperPowerActive(SUPER_POWER power_, const SuperPower::Warriors &targets_)
Definition: Tactics3DWarrior.cpp:187
virtual void setPos(const OpenSkyNet::Math::Point<> &pos_)
Definition: Tactics3DWarrior.cpp:71
static OpenSkyNet::Utils::uint serializeAttributes(const Warrior *warrior_, char(&buffer_)[MAX_STRING_SIZE])
Definition: Tactics3DNetwork.cpp:55
OpenSkyNet::Utils::uint getNetworkId() const
Definition: Tactics3DWarrior.h:381
virtual bool canCounter(Warrior *attacker_, SPECIAL_MOVE move_) const
Definition: Tactics3DWarrior.h:288
std::set< CounterableMove > _counterableMoves
Definition: Tactics3DWarrior.h:91
const OpenSkyNet::Math::Point< float, 2 > & getCachedPointInSpread()
Definition: Tactics3DWarrior.h:309
int getInitOD() const
Definition: Tactics3DWarrior.h:236
virtual bool onAttack(std::vector< OpenSkyNet::Utils::TaggedUnion > &eventParams_)
Definition: Tactics3DWarrior.h:325
void disableMovement()
Definition: Tactics3DWarrior.h:244
static void assembleMoveUpdate(char(&buffer_)[MAX_STRING_SIZE], OpenSkyNet::Utils::uint warriorIndex_, int &flags_, OpenSkyNet::Math::Point<> &pos_, OpenSkyNet::Math::Point<> &axis_, float &radians_)
Definition: Tactics3DNetwork.cpp:466
Definition: Tactics3DWarrior.h:72
virtual OpenSkyNet::Math::Point getPos() const
Definition: Tactics3DWarrior.h:109
static bool _isSmokeTest
Definition: Tactics3DWarrior.h:340
int _initDex
Definition: Tactics3DWarrior.h:80
int _end
Definition: Tactics3DWarrior.h:80
virtual bool handleOutOfGrid(OpenSkyNet::Core::Object *obj_)
Definition: Tactics3DWarrior.cpp:155
virtual void addCounterableMove(Warrior *attacker_, SPECIAL_MOVE move_)
Definition: Tactics3DWarrior.h:284
float pos_[3]
Definition: ViewerApp.h:31
virtual void onRoundEnd()
Definition: Tactics3DWarrior.cpp:582
int getGP() const
Definition: Tactics3DWarrior.h:208
Definition: Tactics3DWarrior.h:72
void enableMovement()
Definition: Tactics3DWarrior.h:245
FightingStyleContextMap _fightingStyleContexts
Definition: Tactics3DWarrior.h:87
virtual int getDex() const
Definition: Tactics3DWarrior.h:212
virtual void setVisible(bool val_)
Definition: Tactics3DWarrior.h:150