diff options
-rw-r--r-- | engines/hdb/ai-lists.cpp | 18 | ||||
-rw-r--r-- | engines/hdb/ai.h | 6 |
2 files changed, 24 insertions, 0 deletions
diff --git a/engines/hdb/ai-lists.cpp b/engines/hdb/ai-lists.cpp index d6534cc6cf..890b943ab9 100644 --- a/engines/hdb/ai-lists.cpp +++ b/engines/hdb/ai-lists.cpp @@ -236,6 +236,24 @@ void AI::animateBridges() { } } +void AI::addToFairystones(int index, int tileX, int tileY, int sourceOrDest) { + if (!sourceOrDest) { + _fairystones[index].srcX = tileX; + _fairystones[index].srcY = tileY; + } else { + _fairystones[index].destX = tileX; + _fairystones[index].destY = tileY; + } +} + +int AI::checkFairystones(int tileX, int tileY) { + int i; + for (i = 0; i < kMaxFairystones; i++) + if (_fairystones[i].destX == tileX && _fairystones[i].destY == tileY) + return i; + return -1; +} + // Add an action location to the list of possible actions // Each action must be paired with another of the same number void AI::addToActionList(int actionIndex, int x, int y, char *luaFuncInt, char *luaFuncUse) { diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 3ac60cac16..f7d42e6089 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -848,6 +848,12 @@ public: void addBridgeExtend(int x, int y, int bridgeType); void animateBridges(); + void addToFairystones(int index, int tileX, int tileY, int sourceOrDest); + int checkFairystones(int tileX, int tileY); + void getFairystonesSrc(int index, int *tileX, int *tileY) { + *tileX = _fairystones[index].srcX; + *tileY = _fairystones[index].srcY; + } AIEntity *playerCollision(int topBorder, int bottomBorder, int leftBorder, int rightBorder); bool checkPlayerTileCollision(int x, int y); |