diff options
author | Nipun Garg | 2019-07-05 00:42:20 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:11 +0200 |
commit | 292ada30e344fbf9d8ba53a9f0bc264082d492b0 (patch) | |
tree | 8f318a3d484c9ac720ce87b099bb70b8e5c127b7 | |
parent | 7a6a169422fd465e62ab64263976b77cb2ce4560 (diff) | |
download | scummvm-rg350-292ada30e344fbf9d8ba53a9f0bc264082d492b0.tar.gz scummvm-rg350-292ada30e344fbf9d8ba53a9f0bc264082d492b0.tar.bz2 scummvm-rg350-292ada30e344fbf9d8ba53a9f0bc264082d492b0.zip |
HDB: Add _fairystones functions
-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); |