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 8 * modify it under the terms of the GNU General Public License 9 * as published by the Free Software Foundation; either version 2 10 * of the License, or (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, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 20 * 21 */ 22 23 #ifndef BLADERUNNER_COMBAT_H 24 #define BLADERUNNER_COMBAT_H 25 26 #include "bladerunner/vector.h" 27 28 #include "common/array.h" 29 30 namespace BladeRunner { 31 32 class BladeRunnerEngine; 33 class SaveFileReadStream; 34 class SaveFileWriteStream; 35 class Vector3; 36 37 class Combat { 38 static const int kSoundCount = 9; 39 40 BladeRunnerEngine *_vm; 41 42 bool _active; 43 bool _enabled; 44 int _hitSoundId[kSoundCount]; 45 int _missSoundId[kSoundCount]; 46 // int _random1; 47 // int _random2; 48 49 public: 50 int _ammoDamage[3]; 51 52 struct CoverWaypoint { 53 int type; 54 int setId; 55 int sceneId; 56 Vector3 position; 57 }; 58 59 struct FleeWaypoint { 60 int type; 61 int setId; 62 int sceneId; 63 Vector3 position; 64 int field7; 65 }; 66 67 Common::Array<CoverWaypoint> _coverWaypoints; 68 Common::Array<FleeWaypoint> _fleeWaypoints; 69 70 public: 71 Combat(BladeRunnerEngine *vm); 72 ~Combat(); 73 74 void reset(); 75 76 void activate(); 77 void deactivate(); 78 void change(); 79 bool isActive() const; 80 81 void enable(); 82 void disable(); 83 84 void setHitSound(int ammoType, int column, int soundId); 85 void setMissSound(int ammoType, int column, int soundId); 86 int getHitSound() const; 87 int getMissSound() const; 88 89 void shoot(int actorId, Vector3 &to, int screenX); 90 91 int findFleeWaypoint(int setId, int enemyId, const Vector3& position) const; 92 int findCoverWaypoint(int waypointType, int actorId, int enemyId) const; 93 94 void save(SaveFileWriteStream &f); 95 void load(SaveFileReadStream &f); 96 }; 97 98 } // End of namespace BladeRunner 99 100 #endif 101