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
Tactics3DUtils.h
Go to the documentation of this file.
1 // Copyright (C) 2006-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 TACTICS3DUTILS_H
24 #define TACTICS3DUTILS_H
25 
26 #include "Tactics3DWarrior.h"
27 #include "Tactics3DAction.h"
28 
29 namespace CEGUI {
30  class Window;
31 }
32 
33 namespace Ogre {
34  class ManualObject;
35 }
36 
37 namespace Tactics3D {
38  namespace Utils {
39  inline int d6(int x_=1) {
40  int roll = 0;
41  for (int i = 0; i < x_; i++)
42  roll += (rand() % 6) + 1;
43  return roll;
44  }
45 
46  inline int calcAttrMod(int attr_) {
47  if (attr_ > 9) return attr_ - 9;
48  if (attr_ < 5) return attr_ - 5;
49  return 0;
50  }
51 
52  inline void getTimeStampStr(char* str_) {
53  time_t rawTime;
54  time(&rawTime);
55  tm* timeInfo = localtime(&rawTime);
56  sprintf(str_, "%04d%02d%02d%02d%02d", timeInfo->tm_year + 1900, timeInfo->tm_mon + 1, timeInfo->tm_mday, timeInfo->tm_hour, timeInfo->tm_min);
57  }
58 
59  inline int calcSpeed(int dex_, int str_, int equipmentWeightInPounds_) {
61  switch (dex_) {
62  case 2: return 100;
63  case 3: return 400;
64  case 4: return 600;
65  case 10: return 1000;
66  case 11: return 1200;
67  case 12: return 1500;
68  default: return 800;
69  }
70  }
71 
75 
78  bool moveCurrCamToWarriorPOV(const Warrior* warrior_);
79 
80  void getSpecialMoveParams(Warrior* warrior_, CEGUI::Window* warriorWindow_);
81  void getSuperPowerParams(Warrior* warrior_, CEGUI::Window* warriorWindow_);
82 
85 
86  Ogre::AxisAlignedBox getAABB(const OpenSkyNet::CD::Volume& vol_);
87 
88  Ogre::ManualObject* createHUDCircle(const std::string& name_,
89  const OpenSkyNet::Math::Point<>& color_, int numPoints_);
90 
91  bool getCameraSpacePoint(const std::string& windowName_,
92  const OpenSkyNet::Math::Point<float, 2>& pointInSpread_,
93  OpenSkyNet::Math::Point<float, 2>& cameraSpaceOrigin_);
94 
95  bool getScreenSpacePoint(const std::string& windowName_,
96  const OpenSkyNet::Math::Point<float, 2>& cameraSpaceOrigin_,
97  OpenSkyNet::Math::Point<float, 2>& screenSpaceOrigin_);
98 
101  bool updateHUDCircle(Ogre::ManualObject* circle_, const std::string& windowName_,
102  const OpenSkyNet::Math::Point<float, 2>& cameraSpaceOrigin_, float radius_, int numPoints_,
103  OpenSkyNet::Math::Point<float, 2>& screenSpaceOrigin_);
104 
108 
111  void createEvocationObject(Warrior* warrior_, const std::string& name_);
112  }
113 }
114 
115 #endif //TACTICS3DUTILS_H
bool moveCurrCamToWarriorPOV(const Warrior *warrior_)
Definition: Tactics3DUtils.cpp:55
int d6(int x_=1)
Definition: Tactics3DUtils.h:39
void scheduleEvocationObjectCreation(Warrior *warrior_)
Definition: Tactics3DUtils.cpp:312
bool getScreenSpacePoint(const std::string &windowName_, const OpenSkyNet::Math::Point< float, 2 > &cameraSpaceOrigin_, OpenSkyNet::Math::Point< float, 2 > &screenSpaceOrigin_)
Definition: Tactics3DWarrior.h:42
Ogre::ManualObject * createHUDCircle(const std::string &name_, const OpenSkyNet::Math::Point<> &color_, int numPoints_)
Definition: CDVolume.h:225
void createEvocationObject(Warrior *warrior_, const std::string &name_)
bool updateHUDCircle(Ogre::ManualObject *circle_, const std::string &windowName_, const OpenSkyNet::Math::Point< float, 2 > &cameraSpaceOrigin_, float radius_, int numPoints_, OpenSkyNet::Math::Point< float, 2 > &screenSpaceOrigin_)
int calcAttrMod(int attr_)
Definition: Tactics3DUtils.h:46
Definition: MPoint.h:33
Definition: IObject.h:36
Ogre::AxisAlignedBox getAABB(const OpenSkyNet::CD::Volume &vol_)
void showDieRollVisualEffects(OpenSkyNet::Core::Object *die_, int roll_)
void getTimeStampStr(char *str_)
Definition: Tactics3DUtils.h:52
bool getCameraSpacePoint(const std::string &windowName_, const OpenSkyNet::Math::Point< float, 2 > &pointInSpread_, OpenSkyNet::Math::Point< float, 2 > &cameraSpaceOrigin_)
void getSuperPowerParams(Warrior *warrior_, CEGUI::Window *warriorWindow_)
Definition: Tactics3DUtils.cpp:120
void getSpecialMoveParams(Warrior *warrior_, CEGUI::Window *warriorWindow_)
Definition: Tactics3DUtils.cpp:87
int calcSpeed(int dex_, int str_, int equipmentWeightInPounds_)
Definition: Tactics3DUtils.h:59
void disableAndHideActionWindow()
Definition: Tactics3DUtils.cpp:151