ScummVM API documentation
ai_traveller.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 SCUMM_HE_MOONBASE_AI_TRAVELER_H
23 #define SCUMM_HE_MOONBASE_AI_TRAVELER_H
24 
25 #include "scumm/he/moonbase/ai_node.h"
26 
27 namespace Scumm {
28 
29 const int NUM_TO_GEN = 9;
30 
31 const int NUM_POWER_STEPS = 3;
32 const double SIZE_POWER_STEP = .15;
33 const int SIZE_ANGLE_STEP = 45;
34 const int VARIATION_EXTENT = 3;
35 const int DIRECTION_WEIGHT = 5;
36 
37 class Traveller : public IContainedObject {
38 private:
39  static int _targetPosX;
40  static int _targetPosY;
41  static int _maxDist;
42 
43  static int _numToGen;
44  static int _sizeAngleStep;
45 
46  int _sourceHub;
47 
48  int _posX;
49  int _posY;
50  int _angleTo;
51  int _powerTo;
52 
53  int _disabled;
54  int _waterFlag;
55  int _waterSourceX;
56  int _waterSourceY;
57  int _waterDestX;
58  int _waterDestY;
59 
60  AI *_ai;
61 
62 protected:
63  float calcH() override;
64 
65 public:
66  Traveller(AI *ai);
67  Traveller(int originX, int originY, AI *ai);
68  ~Traveller() override {}
69 
70  IContainedObject *duplicate() override { return this; }
71 
72  static void setTargetPosX(int posX) { _targetPosX = posX; }
73  static void setTargetPosY(int posY) { _targetPosY = posY; }
74  static void setMaxDist(int maxDist) { _maxDist = maxDist; }
75 
76  void setSourceHub(int sourceHub) { _sourceHub = sourceHub; }
77 
78  void setPosX(int posX) { _posX = posX; }
79  void setPosY(int posY) { _posY = posY; }
80  void setAngleTo(int angleTo) { _angleTo = angleTo; }
81  void setPowerTo(int powerTo) { _powerTo = powerTo; }
82 
83  void setWaterSourceX(int waterSourceX) { _waterSourceX = waterSourceX; }
84  void setWaterSourceY(int waterSourceY) { _waterSourceY = waterSourceY; }
85 
86  void setWaterDestX(int waterDestX) { _waterDestX = waterDestX; }
87  void setWaterDestY(int waterDestY) { _waterDestY = waterDestY; }
88 
89  int getSourceHub() const { return _sourceHub; }
90 
91  int getPosX() const { return _posX; }
92  int getPosY() const { return _posY; }
93  int getAngleTo() const { return _angleTo; }
94  int getPowerTo() const { return _powerTo; }
95 
96  int getWaterSourceX() const { return _waterSourceX; }
97  int getWaterSourceY() const { return _waterSourceY; }
98  int getWaterDestX() const { return _waterDestX; }
99  int getWaterDestY() const { return _waterDestY; }
100 
101  void setDisabled() { _disabled = 1; }
102  void unsetDisabled() { _disabled = 0; }
103  int getDisabled() { return _disabled; }
104 
105  void adjustPosX(int offsetX);
106  void adjustPosY(int offsetY);
107  void adjustXY(int offsetX, int offsetY);
108 
109  void enableWaterFlag() { _waterFlag = 1; }
110  void disableWaterFlag() { _waterFlag = 0; }
111  int getWaterFlag() const { return _waterFlag; }
112 
113  int numChildrenToGen() override;
114  IContainedObject *createChildObj(int, int &) override;
115 
116  int checkSuccess() override;
117  float calcT() override;
118 };
119 
120 } // End of namespace Scumm
121 
122 #endif
Definition: ai_main.h:85
Definition: ai_traveller.h:37
Definition: ai_node.h:32
Definition: actor.h:30