ScummVM API documentation
combat.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  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BLADERUNNER_COMBAT_H
23 #define BLADERUNNER_COMBAT_H
24 
25 #include "bladerunner/vector.h"
26 
27 #include "common/array.h"
28 
29 namespace BladeRunner {
30 
31 class BladeRunnerEngine;
32 class SaveFileReadStream;
33 class SaveFileWriteStream;
34 class Vector3;
35 
36 class Combat {
37  static const int kSoundCount = 9;
38 
39  BladeRunnerEngine *_vm;
40 
41  bool _active;
42  bool _enabled;
43  int _hitSoundId[kSoundCount];
44  int _missSoundId[kSoundCount];
45  // int _random1;
46  // int _random2;
47 
48 public:
49  int _ammoDamage[3];
50 
51  struct CoverWaypoint {
52  int type;
53  int setId;
54  int sceneId;
55  Vector3 position;
56  };
57 
58  struct FleeWaypoint {
59  int type;
60  int setId;
61  int sceneId;
62  Vector3 position;
63  int field7;
64  };
65 
66  Common::Array<CoverWaypoint> _coverWaypoints;
67  Common::Array<FleeWaypoint> _fleeWaypoints;
68 
69 public:
71  ~Combat();
72 
73  void reset();
74 
75  void activate();
76  void deactivate();
77  void change();
78  bool isActive() const;
79 
80  void enable();
81  void disable();
82 
83  void setHitSound(int ammoType, int column, int soundId);
84  void setMissSound(int ammoType, int column, int soundId);
85  int getHitSound() const;
86  int getMissSound() const;
87 
88  void shoot(int actorId, Vector3 &to, int screenX);
89 
90  int findFleeWaypoint(int setId, int enemyId, const Vector3& position) const;
91  int findCoverWaypoint(int waypointType, int actorId, int enemyId) const;
92 
93  void save(SaveFileWriteStream &f);
94  void load(SaveFileReadStream &f);
95 };
96 
97 } // End of namespace BladeRunner
98 
99 #endif
Definition: savefile.h:88
Definition: combat.h:36
Definition: array.h:52
Definition: actor.h:31
Definition: savefile.h:113
Definition: combat.h:51
Definition: combat.h:58
Definition: vector.h:47
Definition: bladerunner.h:113