Colobot
motionhuman.h
1 /*
2  * This file is part of the Colobot: Gold Edition source code
3  * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
4  * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see http://gnu.org/licenses
18  */
19 
20 // motionhuman.h
21 
22 #pragma once
23 
24 
25 #include "object/motion/motion.h"
26 
27 
28 
29 enum MotionHumanAction
30 {
31  MH_MARCH = 0,
32  MH_MARCHTAKE = 1,
33  MH_TURN = 2,
34  MH_STOP = 3,
35  MH_FLY = 4,
36  MH_SWIM = 5,
37  MH_SPEC = 6
38 };
39 
40 enum MotionHumanSpecialAction
41 {
42  MHS_FIRE = 0,
43  MHS_GUN = 1,
44  MHS_TAKE = 2,
45  MHS_TAKEOTHER = 3,
46  MHS_TAKEHIGH = 4,
47  MHS_UPRIGHT = 5,
48  MHS_WIN = 6,
49  MHS_LOST = 7,
50  MHS_DEADg = 8,
51  MHS_DEADg1 = 9,
52  MHS_DEADg2 = 10,
53  MHS_DEADg3 = 11,
54  MHS_DEADg4 = 12,
55  MHS_DEADw = 13,
56  MHS_FLAG = 14,
57  MHS_SATCOM = 15
58 };
59 
60 
61 class CMotionHuman : public CMotion
62 {
63 public:
64  CMotionHuman(CObject* object);
65  ~CMotionHuman();
66 
67  void DeleteObject(bool bAll=false);
68  bool Create(Math::Vector pos, float angle, ObjectType type, float power);
69  bool EventProcess(const Event &event);
70  Error SetAction(int action, float time=0.2f);
71 
72  void StartDisplayPerso();
73  void StopDisplayPerso();
74 
75 protected:
76  void CreatePhysics(ObjectType type);
77  bool EventFrame(const Event &event);
78 
79 protected:
80  int m_partiReactor;
81  float m_armMember;
82  float m_armTimeAbs;
83  float m_armTimeAction;
84  float m_armTimeSwim;
85  short m_armAngles[3*3*3*3*7 + 3*3*3*16];
86  int m_armTimeIndex;
87  int m_armPartIndex;
88  int m_armMemberIndex;
89  int m_armLastAction;
90  bool m_bArmStop;
91  float m_lastSoundMarch;
92  float m_lastSoundHhh;
93  float m_time;
94  float m_tired;
95  bool m_bDisplayPerso;
96 };
97 
ObjectType
Type of game object.
Definition: object.h:51
Definition: motion.h:48
Definition: motionhuman.h:61
Error
Type of error or info message.
Definition: global.h:32
3D (3x1) vector
Definition: vector.h:52
Event sent by system, interface or game.
Definition: event.h:678
Definition: object.h:357