Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
motionspider.h
1 // * This file is part of the COLOBOT source code
2 // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
3 // *
4 // * This program is free software: you can redistribute it and/or modify
5 // * it under the terms of the GNU General Public License as published by
6 // * the Free Software Foundation, either version 3 of the License, or
7 // * (at your option) any later version.
8 // *
9 // * This program is distributed in the hope that it will be useful,
10 // * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // * GNU General Public License for more details.
13 // *
14 // * You should have received a copy of the GNU General Public License
15 // * along with this program. If not, see http://www.gnu.org/licenses/.
16 
17 // motionspider.h
18 
19 #pragma once
20 
21 
22 #include "object/motion/motion.h"
23 
24 
25 
26 enum MotionSpiderAction
27 {
28  MS_MARCH = 0,
29  MS_STOP = 1,
30  MS_SPEC = 2
31 };
32 
33 enum MotionSpiderSpecialAction
34 {
35  MSS_BURN = 0,
36  MSS_RUIN = 1,
37  MSS_EXPLO = 2,
38  MSS_BACK1 = 3,
39  MSS_BACK2 = 4,
40  MSS_BACK3 = 5
41 };
42 
43 
44 class CMotionSpider : public CMotion
45 {
46 public:
47  CMotionSpider(CObject* object);
48  ~CMotionSpider();
49 
50  void DeleteObject(bool bAll=false);
51  bool Create(Math::Vector pos, float angle, ObjectType type, float power);
52  bool EventProcess(const Event &event);
53 
54 protected:
55  void CreatePhysics();
56  bool EventFrame(const Event &event);
57 
58 protected:
59  float m_armMember;
60  float m_armTimeAbs;
61  float m_armTimeMarch;
62  float m_armTimeAction;
63  short m_armAngles[3*4*4*3*3 + 3*4*4*6];
64  int m_armTimeIndex;
65  int m_armPartIndex;
66  int m_armMemberIndex;
67  int m_armLastAction;
68  bool m_bArmStop;
69  float m_lastParticle;
70 };
71