ScummVM API documentation
robotship.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * Additional copyright for this file:
8  * Copyright (C) 1995-1997 Presto Studios, Inc.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #ifndef PEGASUS_NEIGHBORHOOD_MARS_ROBOTSHIP_H
26 #define PEGASUS_NEIGHBORHOOD_MARS_ROBOTSHIP_H
27 
28 #include "pegasus/movie.h"
29 
30 namespace Pegasus {
31 
32 static const CoordType kShuttleMovieWidth = 114;
33 static const CoordType kShuttleMovieHeight = 42;
34 
36 public:
37  RobotShip();
38  ~RobotShip() override;
39 
40  void initRobotShip();
41  void cleanUpRobotShip();
42 
43  void startMoving();
44 
45  void killRobotShip();
46 
47  bool pointInShuttle(Common::Point&);
48 
49  void hitByEnergyBeam(Common::Point impactPoint);
50  void hitByGravitonCannon(Common::Point impactPoint);
51 
52  void getShuttleBounds(Common::Rect &r) { _spritesMovie.getBounds(r); }
53 
54  void setGlowing(const bool glowing) { _spritesMovie.setGlowing(glowing); }
55 
56  void snareByTractorBeam();
57  bool isSnared() { return _snaring && getTime() == _duration; }
58 
59  bool isDead() { return _dead; }
60 
61  void setUpNextDropTime();
62 
63 protected:
64  void newDestination();
65  void moveRobotTo(CoordType, CoordType);
66  void timeToDropJunk();
67  void timeChanged(const TimeValue) override;
68  void makeVelocityVector(CoordType, CoordType, CoordType, CoordType, Common::Point &);
69 
70  GlowingMovie _spritesMovie;
71  Common::Rect _shipRange;
72  int _shipWidth, _shipHeight;
73  Common::Point _p1, _p4, _r1, _r4, _currentLocation;
74  FuseFunction _dropJunkFuse;
75  TimeValue _duration;
76  bool _snaring, _dead;
77 };
78 
79 extern RobotShip *g_robotShip;
80 
81 } // End of namespace Pegasus
82 
83 #endif
Definition: timers.h:176
Definition: movie.h:80
Definition: timers.h:239
Definition: rect.h:144
Definition: rect.h:45
Definition: robotship.h:35
Definition: ai_action.h:33