2019-06-18 04:19:36 +05:30
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HDB_AI_H
|
|
|
|
#define HDB_AI_H
|
|
|
|
|
|
|
|
#include "common/system.h"
|
|
|
|
|
|
|
|
namespace HDB {
|
|
|
|
|
2019-06-19 23:54:46 +05:30
|
|
|
enum {
|
2019-06-20 05:16:47 +05:30
|
|
|
kMaxAnimFrames = 8,
|
2019-06-22 05:58:29 +05:30
|
|
|
kMaxAnimTFrames = 16,
|
2019-06-20 05:16:47 +05:30
|
|
|
kMaxDeathFrames = 12,
|
2019-06-21 07:47:33 +05:30
|
|
|
kMaxLevel2Ents = 60,
|
2019-06-19 23:54:46 +05:30
|
|
|
kMaxInventory = 10,
|
2019-06-20 02:28:49 +05:30
|
|
|
kMaxDeliveries = 5,
|
2019-06-20 17:34:22 +05:30
|
|
|
kMaxWaypoints = 10,
|
2019-06-22 06:44:22 +05:30
|
|
|
kMaxActions = 20,
|
2019-06-22 05:49:57 +05:30
|
|
|
kMaxAutoActions = 30,
|
2019-06-20 02:28:49 +05:30
|
|
|
kPlayerMoveSpeed = 4,
|
|
|
|
kEnemyMoveSpeed = 2,
|
|
|
|
kPushMoveSpeed = (kPlayerMoveSpeed >> 1)
|
2019-06-19 23:54:46 +05:30
|
|
|
};
|
|
|
|
|
2019-06-19 01:14:06 +05:30
|
|
|
enum AIType {
|
|
|
|
AI_NONE,
|
|
|
|
AI_GUY,
|
|
|
|
AI_DOLLY,
|
|
|
|
AI_SPACEDUDE,
|
|
|
|
AI_SERGEANT,
|
|
|
|
AI_SCIENTIST,
|
|
|
|
AI_WORKER,
|
|
|
|
AI_DEADWORKER,
|
|
|
|
AI_ACCOUNTANT,
|
|
|
|
AI_RAILRIDER,
|
|
|
|
AI_RAILRIDER_ON,
|
|
|
|
AI_VORTEXIAN,
|
|
|
|
AI_CHICKEN,
|
|
|
|
AI_GEM_ATTACK,
|
|
|
|
AI_SLUG_ATTACK,
|
|
|
|
|
|
|
|
AI_LASER,
|
|
|
|
AI_LASERBEAM,
|
|
|
|
AI_DIVERTER,
|
|
|
|
AI_FOURFIRER,
|
|
|
|
AI_OMNIBOT,
|
|
|
|
AI_TURNBOT,
|
|
|
|
AI_SHOCKBOT,
|
|
|
|
AI_RIGHTBOT,
|
|
|
|
AI_PUSHBOT,
|
|
|
|
AI_LISTENBOT,
|
|
|
|
AI_MAINTBOT,
|
|
|
|
AI_OMNIBOT_MISSILE,
|
|
|
|
AI_DEADEYE,
|
|
|
|
AI_MEERKAT,
|
|
|
|
AI_FATFROG,
|
|
|
|
AI_GOODFAIRY,
|
|
|
|
AI_BADFAIRY,
|
|
|
|
AI_ICEPUFF,
|
|
|
|
AI_BUZZFLY,
|
|
|
|
AI_DRAGON,
|
|
|
|
AI_GATEPUDDLE,
|
|
|
|
|
|
|
|
AI_CRATE,
|
|
|
|
AI_LIGHTBARREL,
|
|
|
|
AI_HEAVYBARREL,
|
|
|
|
AI_BOOMBARREL,
|
|
|
|
AI_FROGSTATUE,
|
|
|
|
|
|
|
|
AI_MAGIC_EGG,
|
|
|
|
AI_ICE_BLOCK,
|
|
|
|
|
|
|
|
ITEM_CELL,
|
|
|
|
ITEM_ENV_WHITE,
|
|
|
|
ITEM_ENV_RED,
|
|
|
|
ITEM_ENV_BLUE,
|
|
|
|
ITEM_ENV_GREEN,
|
|
|
|
ITEM_TRANSCEIVER,
|
|
|
|
ITEM_CLUB,
|
|
|
|
ITEM_ROBOSTUNNER,
|
|
|
|
ITEM_SLUGSLINGER,
|
|
|
|
ITEM_MONKEYSTONE,
|
|
|
|
ITEM_GEM_WHITE,
|
|
|
|
ITEM_GEM_BLUE,
|
|
|
|
ITEM_GEM_RED,
|
|
|
|
ITEM_GEM_GREEN,
|
|
|
|
ITEM_GOO_CUP,
|
|
|
|
ITEM_TEACUP,
|
|
|
|
ITEM_COOKIE,
|
|
|
|
ITEM_BURGER,
|
|
|
|
ITEM_PDA,
|
|
|
|
ITEM_BOOK,
|
|
|
|
ITEM_CLIPBOARD,
|
|
|
|
ITEM_NOTE,
|
|
|
|
ITEM_KEYCARD_WHITE,
|
|
|
|
ITEM_KEYCARD_BLUE,
|
|
|
|
ITEM_KEYCARD_RED,
|
|
|
|
ITEM_KEYCARD_GREEN,
|
|
|
|
ITEM_KEYCARD_PURPLE,
|
|
|
|
ITEM_KEYCARD_BLACK,
|
|
|
|
ITEM_CABKEY,
|
|
|
|
ITEM_DOLLYTOOL1,
|
|
|
|
ITEM_DOLLYTOOL2,
|
|
|
|
ITEM_DOLLYTOOL3,
|
|
|
|
ITEM_DOLLYTOOL4,
|
|
|
|
ITEM_SEED,
|
|
|
|
ITEM_SODA,
|
|
|
|
ITEM_ROUTER,
|
|
|
|
ITEM_SLICER,
|
|
|
|
ITEM_CHICKEN,
|
|
|
|
ITEM_PACKAGE,
|
|
|
|
|
|
|
|
INFO_FAIRY_SRC,
|
|
|
|
INFO_FAIRY_SRC2,
|
|
|
|
INFO_FAIRY_SRC3,
|
|
|
|
INFO_FAIRY_SRC4,
|
|
|
|
INFO_FAIRY_SRC5,
|
|
|
|
INFO_FAIRY_DEST,
|
|
|
|
INFO_FAIRY_DEST2,
|
|
|
|
INFO_FAIRY_DEST3,
|
|
|
|
INFO_FAIRY_DEST4,
|
|
|
|
INFO_FAIRY_DEST5,
|
|
|
|
INFO_TRIGGER,
|
|
|
|
INFO_SET_MUSIC,
|
|
|
|
INFO_PROMOTE,
|
|
|
|
INFO_DEMOTE,
|
|
|
|
INFO_LUA,
|
|
|
|
INFO_HERE,
|
|
|
|
INFO_ARROW_TURN,
|
|
|
|
INFO_ARROW_STOP,
|
|
|
|
INFO_ARROW_4WAY,
|
|
|
|
INFO_TELEPORTER1,
|
|
|
|
INFO_TELEPORTER2,
|
|
|
|
INFO_TELEPORTER3,
|
|
|
|
INFO_TELEPORTER4,
|
|
|
|
INFO_TELEPORTER5,
|
|
|
|
INFO_TELEPORTER6,
|
|
|
|
INFO_TELEPORTER7,
|
|
|
|
INFO_TELEPORTER8,
|
|
|
|
INFO_TELEPORTER9,
|
|
|
|
INFO_TELEPORTER10,
|
|
|
|
INFO_TELEPORTER11,
|
|
|
|
INFO_TELEPORTER12,
|
|
|
|
INFO_TELEPORTER13,
|
|
|
|
INFO_TELEPORTER14,
|
|
|
|
INFO_TELEPORTER15,
|
|
|
|
INFO_TELEPORTER16,
|
|
|
|
INFO_TELEPORTER17,
|
|
|
|
INFO_TELEPORTER18,
|
|
|
|
INFO_TELEPORTER19,
|
|
|
|
INFO_TELEPORTER20,
|
|
|
|
INFO_LEVELEXIT,
|
|
|
|
INFO_ACTION1,
|
|
|
|
INFO_ACTION2,
|
|
|
|
INFO_ACTION3,
|
|
|
|
INFO_ACTION4,
|
|
|
|
INFO_ACTION5,
|
|
|
|
INFO_ACTION6,
|
|
|
|
INFO_ACTION7,
|
|
|
|
INFO_ACTION8,
|
|
|
|
INFO_ACTION9,
|
|
|
|
INFO_ACTION10,
|
|
|
|
INFO_ACTION11,
|
|
|
|
INFO_ACTION12,
|
|
|
|
INFO_ACTION13,
|
|
|
|
INFO_ACTION14,
|
|
|
|
INFO_ACTION15,
|
|
|
|
INFO_ACTION16,
|
|
|
|
INFO_ACTION17,
|
|
|
|
INFO_ACTION18,
|
|
|
|
INFO_ACTION19,
|
|
|
|
INFO_ACTION20,
|
|
|
|
INFO_ACTION_AUTO,
|
|
|
|
|
|
|
|
INFO_QMARK,
|
|
|
|
INFO_DEBUG,
|
|
|
|
END_AI_TYPES
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
enum AIDir {
|
|
|
|
DIR_NONE,
|
|
|
|
DIR_UP,
|
|
|
|
DIR_DOWN,
|
|
|
|
DIR_LEFT,
|
|
|
|
DIR_RIGHT
|
|
|
|
};
|
|
|
|
|
2019-06-21 19:47:41 +05:30
|
|
|
enum Death {
|
|
|
|
DEATH_NORMAL,
|
|
|
|
DEATH_FRIED,
|
|
|
|
DEATH_DROWNED,
|
|
|
|
DEATH_GRABBED,
|
|
|
|
DEATH_SHOCKED,
|
|
|
|
DEATH_PANICZONE,
|
|
|
|
DEATH_PLUMMET
|
|
|
|
};
|
|
|
|
|
2019-06-19 01:14:06 +05:30
|
|
|
enum AIState {
|
|
|
|
STATE_NONE,
|
|
|
|
STATE_STANDDOWN,
|
|
|
|
STATE_STANDUP,
|
|
|
|
STATE_STANDLEFT,
|
|
|
|
STATE_STANDRIGHT,
|
|
|
|
STATE_BLINK,
|
|
|
|
STATE_MOVEUP,
|
|
|
|
STATE_MOVEDOWN,
|
|
|
|
STATE_MOVELEFT,
|
|
|
|
STATE_MOVERIGHT,
|
|
|
|
STATE_DYING,
|
|
|
|
STATE_DEAD,
|
|
|
|
STATE_HORRIBLE1,
|
|
|
|
STATE_HORRIBLE2,
|
|
|
|
STATE_HORRIBLE3,
|
|
|
|
STATE_HORRIBLE4,
|
|
|
|
STATE_GOODJOB,
|
|
|
|
STATE_PLUMMET,
|
|
|
|
|
|
|
|
STATE_PUSHUP, // these are only used for the player
|
|
|
|
STATE_PUSHDOWN,
|
|
|
|
STATE_PUSHLEFT,
|
|
|
|
STATE_PUSHRIGHT,
|
|
|
|
STATE_GRABUP, // player grabbing something
|
|
|
|
STATE_GRABDOWN,
|
|
|
|
STATE_GRABLEFT,
|
|
|
|
STATE_GRABRIGHT,
|
|
|
|
STATE_ATK_CLUB_UP, // player attacking frames
|
|
|
|
STATE_ATK_CLUB_DOWN,
|
|
|
|
STATE_ATK_CLUB_LEFT,
|
|
|
|
STATE_ATK_CLUB_RIGHT,
|
|
|
|
STATE_ATK_STUN_DOWN,
|
|
|
|
STATE_ATK_STUN_UP,
|
|
|
|
STATE_ATK_STUN_LEFT,
|
|
|
|
STATE_ATK_STUN_RIGHT,
|
|
|
|
STATE_ATK_SLUG_DOWN,
|
|
|
|
STATE_ATK_SLUG_UP,
|
|
|
|
STATE_ATK_SLUG_LEFT,
|
|
|
|
STATE_ATK_SLUG_RIGHT,
|
|
|
|
|
|
|
|
STATE_FLOATING, // floating in stuff (can walk on)
|
|
|
|
STATE_FLOATDOWN,
|
|
|
|
STATE_FLOATUP,
|
|
|
|
STATE_FLOATLEFT,
|
|
|
|
STATE_FLOATRIGHT,
|
|
|
|
STATE_MELTED, // melted into slag (can walk on)
|
|
|
|
STATE_SLIDING, // sliding across a floor
|
|
|
|
STATE_SHOCKING, // for Shockbot floor-shock anim
|
|
|
|
STATE_EXPLODING, // boom barrel explosion!
|
|
|
|
|
|
|
|
STATE_USEDOWN, // crazy maintenance bot!
|
|
|
|
STATE_USEUP,
|
|
|
|
STATE_USELEFT,
|
|
|
|
STATE_USERIGHT,
|
|
|
|
|
|
|
|
STATE_MEER_MOVE, // for the Meerkat
|
|
|
|
STATE_MEER_APPEAR,
|
|
|
|
STATE_MEER_BITE,
|
|
|
|
STATE_MEER_DISAPPEAR,
|
|
|
|
STATE_MEER_LOOK,
|
|
|
|
|
|
|
|
STATE_ICEP_PEEK, // for the Icepuff
|
|
|
|
STATE_ICEP_APPEAR,
|
|
|
|
STATE_ICEP_THROWDOWN,
|
|
|
|
STATE_ICEP_THROWRIGHT,
|
|
|
|
STATE_ICEP_THROWLEFT,
|
|
|
|
STATE_ICEP_DISAPPEAR,
|
|
|
|
|
|
|
|
STATE_LICKDOWN, // for the Fatfrog
|
|
|
|
STATE_LICKLEFT,
|
|
|
|
STATE_LICKRIGHT,
|
|
|
|
|
|
|
|
STATE_DIVERTER_BL, // for Diverters
|
|
|
|
STATE_DIVERTER_BR,
|
|
|
|
STATE_DIVERTER_TL,
|
|
|
|
STATE_DIVERTER_TR,
|
|
|
|
|
|
|
|
STATE_KISSRIGHT, // for Dolly
|
|
|
|
STATE_KISSLEFT,
|
|
|
|
STATE_ANGRY,
|
|
|
|
STATE_PANIC,
|
|
|
|
STATE_LAUGH,
|
|
|
|
STATE_DOLLYUSERIGHT,
|
|
|
|
|
|
|
|
STATE_YELL, // for Sarge
|
|
|
|
|
|
|
|
STATE_ENDSTATES
|
|
|
|
};
|
|
|
|
|
2019-06-22 05:58:29 +05:30
|
|
|
enum AnimSpeed {
|
|
|
|
ANIM_SLOW,
|
|
|
|
ANIM_NORMAL,
|
|
|
|
ANIM_FAST
|
|
|
|
};
|
|
|
|
|
2019-06-18 04:19:36 +05:30
|
|
|
enum CineType {
|
|
|
|
C_NO_COMMAND,
|
|
|
|
C_STOPCINE,
|
|
|
|
C_LOCKPLAYER,
|
|
|
|
C_UNLOCKPLAYER,
|
|
|
|
C_SETCAMERA,
|
|
|
|
C_MOVECAMERA,
|
|
|
|
C_WAIT,
|
|
|
|
C_WAITUNTILDONE,
|
|
|
|
C_MOVEENTITY,
|
|
|
|
C_DIALOG,
|
|
|
|
C_ANIMENTITY,
|
|
|
|
C_RESETCAMERA,
|
|
|
|
C_SETENTITY,
|
|
|
|
C_STARTMAP,
|
|
|
|
C_MOVEPIC,
|
|
|
|
C_MOVEMASKEDPIC,
|
|
|
|
C_DRAWPIC,
|
|
|
|
C_DRAWMASKEDPIC,
|
|
|
|
C_FADEIN,
|
|
|
|
C_FADEOUT,
|
|
|
|
C_SPAWNENTITY,
|
|
|
|
C_PLAYSOUND,
|
|
|
|
C_CLEAR_FG,
|
|
|
|
C_SET_FG,
|
|
|
|
C_SET_BG,
|
|
|
|
C_FUNCTION,
|
|
|
|
C_ENTITYFACE,
|
|
|
|
C_USEENTITY,
|
|
|
|
C_REMOVEENTITY,
|
|
|
|
C_SETANIMFRAME,
|
|
|
|
C_TEXTOUT,
|
|
|
|
C_CENTERTEXTOUT,
|
|
|
|
C_PLAYVOICE,
|
|
|
|
|
|
|
|
C_ENDLIST
|
|
|
|
};
|
|
|
|
|
2019-06-19 03:37:51 +05:30
|
|
|
struct AIStateDef {
|
|
|
|
AIState state;
|
2019-06-21 08:44:27 +02:00
|
|
|
const char name[64];
|
2019-06-19 03:37:51 +05:30
|
|
|
};
|
|
|
|
|
2019-06-19 01:14:54 +05:30
|
|
|
struct AIEntity {
|
|
|
|
AIType type;
|
|
|
|
AIState state;
|
|
|
|
AIDir dir;
|
|
|
|
|
2019-06-21 07:49:23 +05:30
|
|
|
Tile *draw; // Current frame to draw
|
2019-06-19 01:14:54 +05:30
|
|
|
|
|
|
|
void (*aiInit)(AIEntity *e); // func ptr to init routine
|
|
|
|
void (*aiInit2)(AIEntity *e); // func ptr to init2 routine - graphic init only (this for LoadGame functionality)
|
|
|
|
void (*aiAction)(AIEntity *e); // func ptr to action routine
|
|
|
|
void (*aiUse)(AIEntity *e); // func ptr to use routine
|
|
|
|
void (*aiDraw)(AIEntity *e, int x, int y); // func ptr to extra drawing routine (only for special stuff) - pass in mapx, mapy
|
|
|
|
|
|
|
|
char luaFuncInit[32]; // Lua function for Init (always called after entity's init). These are ptrs into the map header.
|
|
|
|
char luaFuncAction[32]; // Lua function for Action
|
|
|
|
char luaFuncUse[32]; // Lua function for Use
|
|
|
|
uint16 level; // which floor level we're on
|
|
|
|
uint16 value1, value2; // extra values we might need
|
|
|
|
AIDir dir2; // this is from TED
|
|
|
|
|
|
|
|
uint16 x, y;
|
2019-06-20 17:47:01 +05:30
|
|
|
uint16 drawXOff, drawYOff; // might need a drawing offset
|
2019-06-19 01:14:54 +05:30
|
|
|
uint16 onScreen; // FLAG: is this entity onscreen?
|
|
|
|
uint16 moveSpeed; // movement speed of this entity
|
2019-06-20 18:14:07 +05:30
|
|
|
int16 xVel, yVel; // movement values
|
2019-06-19 01:14:54 +05:30
|
|
|
uint16 tileX, tileY;
|
|
|
|
uint16 goalX, goalY; // where we're trying to go - TILE COORDS
|
|
|
|
uint16 touchpX, touchpY, touchpTile, touchpWait; // ACTION index a touchplate is using, which you're on
|
|
|
|
uint32 stunnedWait; // if we're stunned, this is the delay before being normal again
|
|
|
|
uint16 sequence; // to use for specially-coded sequences
|
|
|
|
char entityName[32]; // the name of the entity, as registered by the Lua init function for the entity
|
|
|
|
char printedName[32]; // the name of the entity/item, the way it should be printed
|
|
|
|
|
|
|
|
uint16 animFrame; // which frame we're on
|
|
|
|
uint16 animDelay; // changes every frame; based on anim_cycle at start
|
|
|
|
uint16 animCycle; // delay between frame animations
|
|
|
|
|
2019-06-20 05:16:47 +05:30
|
|
|
union {
|
|
|
|
uint16 blinkFrames;
|
|
|
|
uint16 int1;
|
|
|
|
};
|
2019-06-21 02:33:15 +05:30
|
|
|
Tile *blinkGfx[kMaxAnimFrames];
|
2019-06-20 05:16:47 +05:30
|
|
|
|
|
|
|
union {
|
|
|
|
uint16 special1Frames;
|
|
|
|
uint16 int2;
|
|
|
|
};
|
2019-06-20 20:10:42 +05:30
|
|
|
Tile *special1Gfx[kMaxAnimFrames];
|
2019-06-20 05:16:47 +05:30
|
|
|
|
|
|
|
uint16 standdownFrames;
|
|
|
|
Tile *standdownGfx[kMaxAnimFrames];
|
|
|
|
|
|
|
|
uint16 standupFrames;
|
|
|
|
Tile *standupGfx[kMaxAnimFrames];
|
|
|
|
|
|
|
|
uint16 standleftFrames;
|
|
|
|
Tile *standleftGfx[kMaxAnimFrames];
|
|
|
|
|
|
|
|
uint16 standrightFrames;
|
|
|
|
Tile *standrightGfx[kMaxAnimFrames];
|
|
|
|
|
|
|
|
uint16 moveupFrames;
|
|
|
|
Tile *moveupGfx[kMaxAnimFrames];
|
|
|
|
|
|
|
|
uint16 movedownFrames;
|
|
|
|
Tile *movedownGfx[kMaxAnimFrames];
|
|
|
|
|
|
|
|
uint16 moveleftFrames;
|
|
|
|
Tile *moveleftGfx[kMaxAnimFrames];
|
|
|
|
|
|
|
|
uint16 moverightFrames;
|
|
|
|
Tile *moverightGfx[kMaxAnimFrames];
|
2019-06-21 02:33:15 +05:30
|
|
|
|
|
|
|
AIEntity() : luaFuncInit(""), luaFuncAction(""), luaFuncUse(""), entityName(""), printedName("") {
|
|
|
|
type = AI_NONE;
|
|
|
|
state = STATE_NONE;
|
|
|
|
dir = DIR_NONE;
|
|
|
|
|
|
|
|
draw = NULL;
|
|
|
|
|
|
|
|
aiInit = aiInit2 = NULL;
|
|
|
|
aiAction = NULL;
|
|
|
|
aiUse = NULL;
|
|
|
|
aiDraw = NULL;
|
|
|
|
|
|
|
|
level = 0;
|
|
|
|
value1 = value2 = 0;
|
|
|
|
dir2 = DIR_NONE;
|
|
|
|
|
|
|
|
x = y = 0;
|
|
|
|
drawXOff = drawYOff = 0;
|
|
|
|
onScreen = 0;
|
|
|
|
moveSpeed = 0;
|
|
|
|
xVel = yVel = 0;
|
|
|
|
tileX = tileY = 0;
|
|
|
|
goalX = goalY = 0;
|
|
|
|
touchpX = touchpY = touchpTile = touchpWait = 0;
|
|
|
|
stunnedWait = 0;
|
|
|
|
sequence = 0;
|
|
|
|
|
|
|
|
animCycle = 0;
|
|
|
|
animDelay = 0;
|
|
|
|
animFrame = 0;
|
|
|
|
|
|
|
|
blinkFrames = 0;
|
|
|
|
for (int i = 0; i < kMaxAnimFrames; i++) {
|
|
|
|
blinkGfx[i] = new Tile;
|
|
|
|
}
|
|
|
|
|
|
|
|
special1Frames = 0;
|
|
|
|
for (int i = 0; i < kMaxAnimFrames; i++) {
|
|
|
|
special1Gfx[i] = new Tile;
|
|
|
|
}
|
|
|
|
|
|
|
|
standdownFrames = 0;
|
|
|
|
for (int i = 0; i < kMaxAnimFrames; i++) {
|
|
|
|
standdownGfx[i] = new Tile;
|
|
|
|
}
|
|
|
|
|
|
|
|
standupFrames = 0;
|
|
|
|
for (int i = 0; i < kMaxAnimFrames; i++) {
|
|
|
|
standupGfx[i] = new Tile;
|
|
|
|
}
|
|
|
|
|
|
|
|
standleftFrames = 0;
|
|
|
|
for (int i = 0; i < kMaxAnimFrames; i++) {
|
|
|
|
standleftGfx[i] = new Tile;
|
|
|
|
}
|
|
|
|
|
|
|
|
standrightFrames = 0;
|
|
|
|
for (int i = 0; i < kMaxAnimFrames; i++) {
|
|
|
|
standrightGfx[i] = new Tile;
|
|
|
|
}
|
|
|
|
|
|
|
|
movedownFrames = 0;
|
|
|
|
for (int i = 0; i < kMaxAnimFrames; i++) {
|
|
|
|
movedownGfx[i] = new Tile;
|
|
|
|
}
|
|
|
|
|
|
|
|
moveupFrames = 0;
|
|
|
|
for (int i = 0; i < kMaxAnimFrames; i++) {
|
|
|
|
moveupGfx[i] = new Tile;
|
|
|
|
}
|
|
|
|
|
|
|
|
moveleftFrames = 0;
|
|
|
|
for (int i = 0; i < kMaxAnimFrames; i++) {
|
|
|
|
moveleftGfx[i] = new Tile;
|
|
|
|
}
|
|
|
|
|
|
|
|
moverightFrames = 0;
|
|
|
|
for (int i = 0; i < kMaxAnimFrames; i++) {
|
|
|
|
moverightGfx[i] = new Tile;
|
|
|
|
}
|
|
|
|
}
|
2019-06-19 01:14:54 +05:30
|
|
|
};
|
|
|
|
|
2019-06-19 03:37:51 +05:30
|
|
|
struct AIEntTypeInfo {
|
|
|
|
AIType type;
|
2019-06-19 13:35:14 +02:00
|
|
|
const char *luaName;
|
2019-06-19 03:37:51 +05:30
|
|
|
AIStateDef *stateDef;
|
|
|
|
void (*initFunc)(AIEntity *e);
|
|
|
|
void (*initFunc2)(AIEntity *e);
|
|
|
|
};
|
|
|
|
|
2019-06-19 15:53:50 +02:00
|
|
|
extern AIEntTypeInfo aiEntList[];
|
2019-06-19 03:38:18 +05:30
|
|
|
|
2019-06-21 07:47:33 +05:30
|
|
|
struct AIEntLevel2 {
|
|
|
|
uint16 x;
|
|
|
|
uint16 y;
|
|
|
|
Tile *draw;
|
|
|
|
AIEntity *e;
|
|
|
|
void(*aiDraw)(AIEntity *e, int x, int y);
|
|
|
|
uint32 stunnedWait;
|
|
|
|
|
|
|
|
AIEntLevel2() : x(0), y(0), draw(NULL), e(NULL), aiDraw(NULL), stunnedWait(0) {}
|
|
|
|
};
|
|
|
|
|
2019-06-22 05:58:29 +05:30
|
|
|
struct AnimTarget {
|
|
|
|
uint16 x, y;
|
|
|
|
uint16 start, end;
|
|
|
|
int16 vel;
|
|
|
|
uint16 animCycle;
|
|
|
|
uint16 animFrame;
|
|
|
|
bool killAuto; // Keep it alive if its an Auto?
|
|
|
|
bool inMap;
|
|
|
|
Tile *gfxList[kMaxAnimTFrames];
|
|
|
|
|
|
|
|
AnimTarget() : x(0), y(0), start(0), end(0), vel(0), animCycle(0), animFrame(0), killAuto(false), inMap(false) {
|
|
|
|
for (int i = 0; i < kMaxAnimTFrames;i++) {
|
|
|
|
gfxList[i] = new Tile;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct InvEnt {
|
|
|
|
uint16 keep;
|
|
|
|
AIEntity *ent;
|
|
|
|
|
|
|
|
InvEnt() : keep(0), ent(NULL) {}
|
|
|
|
};
|
|
|
|
|
2019-06-20 17:34:22 +05:30
|
|
|
struct Waypoint {
|
|
|
|
int x, y, level;
|
2019-06-21 02:33:15 +05:30
|
|
|
|
|
|
|
Waypoint() : x(0), y(0), level(0) {}
|
2019-06-20 17:34:22 +05:30
|
|
|
};
|
|
|
|
|
2019-06-22 06:44:22 +05:30
|
|
|
struct ActionInfo {
|
|
|
|
uint16 x1, y1;
|
|
|
|
uint16 x2, y2;
|
|
|
|
char luaFuncInit[32];
|
|
|
|
char luaFuncUse[32];
|
|
|
|
char entityName[32];
|
|
|
|
|
|
|
|
ActionInfo() : x1(0), y1(0), x2(0), y2(0), luaFuncInit(""), luaFuncUse(""), entityName("") {}
|
|
|
|
};
|
|
|
|
|
2019-06-22 05:49:57 +05:30
|
|
|
struct AutoAction {
|
|
|
|
uint16 x, y;
|
|
|
|
bool activated;
|
|
|
|
char luaFuncInit[32];
|
|
|
|
char luaFuncUse[32];
|
|
|
|
char entityName[32];
|
|
|
|
|
|
|
|
AutoAction() : x(0), y(0), activated(false), luaFuncInit(""), luaFuncUse(""), entityName("") {}
|
|
|
|
};
|
|
|
|
|
2019-06-18 04:19:36 +05:30
|
|
|
struct CineCommand {
|
|
|
|
CineType cmdType;
|
|
|
|
double x, y;
|
|
|
|
double x2, y2;
|
|
|
|
double xv, yv;
|
|
|
|
int start, end;
|
|
|
|
uint32 delay;
|
|
|
|
int speed;
|
2019-06-22 22:19:41 +05:30
|
|
|
char title[32];
|
|
|
|
char string[32];
|
2019-06-18 04:19:36 +05:30
|
|
|
char *id;
|
2019-06-19 01:14:54 +05:30
|
|
|
AIEntity *e;
|
2019-06-18 18:53:49 +02:00
|
|
|
|
|
|
|
CineCommand() : cmdType(C_NO_COMMAND), x(0.0), y(0.0), x2(0.0), y2(0.0), xv(0.0), yv(0.0),
|
2019-06-22 22:19:41 +05:30
|
|
|
start(0), end(0), delay(0), speed(0), title(""), string(""), id(NULL), e(NULL) {}
|
2019-06-18 04:19:36 +05:30
|
|
|
};
|
|
|
|
|
2019-06-21 19:45:56 +05:30
|
|
|
#define onEvenTile(x, y) ( !(x & 31) && !(y & 31) )
|
|
|
|
|
2019-06-18 04:19:36 +05:30
|
|
|
class AI {
|
|
|
|
public:
|
2019-06-19 17:25:19 +05:30
|
|
|
AI();
|
|
|
|
~AI();
|
|
|
|
|
2019-06-18 06:02:04 +05:30
|
|
|
bool init();
|
2019-06-19 23:56:48 +05:30
|
|
|
void clearPersistent();
|
2019-06-19 17:26:11 +05:30
|
|
|
void restartSystem();
|
2019-06-22 22:25:56 +05:30
|
|
|
void initAnimInfo();
|
2019-06-19 17:26:11 +05:30
|
|
|
|
2019-06-19 17:27:11 +05:30
|
|
|
// Entity Functions
|
2019-06-20 02:29:49 +05:30
|
|
|
AIEntity *spawn(AIType type, AIDir dir, int x, int y, char *funcInit, char *funcAction, char *funcUse, AIDir dir2, int level, int value1, int value2, int callInit);
|
2019-06-20 05:23:20 +05:30
|
|
|
bool cacheEntGfx(AIEntity *e, bool init);
|
2019-06-20 17:47:01 +05:30
|
|
|
void stopEntity(AIEntity *e);
|
2019-06-19 17:27:11 +05:30
|
|
|
AIEntity *locateEntity(const char *luaName);
|
2019-06-22 08:58:22 +05:30
|
|
|
AIEntity *findEntity(int x, int y);
|
2019-06-19 23:57:17 +05:30
|
|
|
void removeEntity(AIEntity *e);
|
2019-06-20 18:14:07 +05:30
|
|
|
void setEntityGoal(AIEntity *e, int x, int y);
|
2019-06-20 01:46:40 +05:30
|
|
|
void initAllEnts();
|
2019-06-21 19:47:41 +05:30
|
|
|
void killPlayer(Death method);
|
2019-06-20 19:12:56 +05:30
|
|
|
|
2019-06-21 21:29:05 +05:30
|
|
|
void animateEntity(AIEntity *e);
|
2019-06-21 06:12:10 +05:30
|
|
|
void animEntFrames(AIEntity *e);
|
2019-06-20 19:12:56 +05:30
|
|
|
void animLuaEntity(const char *initName, AIState st);
|
2019-06-21 07:50:09 +05:30
|
|
|
void drawEnts(int x, int y, int w, int h);
|
2019-06-22 05:42:55 +05:30
|
|
|
void animGrabbing();
|
2019-06-20 19:12:56 +05:30
|
|
|
|
2019-06-23 08:59:11 +05:30
|
|
|
void moveEnts();
|
|
|
|
|
2019-06-22 08:55:27 +05:30
|
|
|
int checkForTouchplate(int x, int y);
|
|
|
|
|
2019-06-22 06:01:05 +05:30
|
|
|
void addAnimateTarget(int x, int y, int start, int end, AnimSpeed speed, bool killAuto, bool inMap, const char *tileName);
|
|
|
|
void animateTargets();
|
|
|
|
|
2019-06-22 05:54:51 +05:30
|
|
|
// List functions
|
2019-06-22 08:59:33 +05:30
|
|
|
void addToActionList(int actionIndex, int x, int y, char *funcLuaInit, char *funcLuaUse);
|
|
|
|
bool checkActionList(AIEntity *e, int x, int y, bool lookAndGrab);
|
2019-06-22 05:54:51 +05:30
|
|
|
void addToAutoList(int x, int y, const char *luaFuncInt, const char *luaFuncUse);
|
|
|
|
void autoDeactivate(int x, int y);
|
|
|
|
bool activateAction(AIEntity *e, int x, int y, int targetX, int targetY);
|
|
|
|
bool checkAutoList(AIEntity *e, int x, int y);
|
|
|
|
bool autoActive(int x, int y);
|
|
|
|
|
2019-06-21 19:45:36 +05:30
|
|
|
bool checkFloating(int x, int y);
|
|
|
|
|
2019-06-19 22:21:26 +05:30
|
|
|
bool getTableEnt(AIType type);
|
|
|
|
bool walkThroughEnt(AIType type);
|
|
|
|
void getItemSound(AIType type);
|
2019-06-19 22:46:33 +05:30
|
|
|
void lookAtEntity(AIEntity *e);
|
2019-06-18 06:02:04 +05:30
|
|
|
|
2019-06-19 21:16:36 +05:30
|
|
|
// Player Functions
|
2019-06-19 22:15:43 +05:30
|
|
|
AIEntity *getPlayer() {
|
2019-06-22 06:14:03 +05:30
|
|
|
if (!_player)
|
|
|
|
return &_dummyPlayer;
|
2019-06-19 22:15:43 +05:30
|
|
|
return _player;
|
|
|
|
}
|
|
|
|
|
|
|
|
void getPlayerXY(int *x, int *y) {
|
|
|
|
if (_player) {
|
|
|
|
*x = _player->x;
|
|
|
|
*y = _player->y;
|
|
|
|
} else {
|
|
|
|
*x = *y = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void setPlayerXY(int x, int y) {
|
|
|
|
if (_player) {
|
|
|
|
_player->x = x;
|
|
|
|
_player->tileX = x / kTileWidth;
|
|
|
|
_player->y = y;
|
|
|
|
_player->tileY = y / kTileHeight;
|
|
|
|
_player->xVel = _player->yVel = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-19 21:16:36 +05:30
|
|
|
void assignPlayer(AIEntity *p) {
|
|
|
|
_player = p;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool playerDead() {
|
|
|
|
return _playerDead;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool playerOnIce() {
|
|
|
|
return _playerOnIce;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool playerLocked() {
|
|
|
|
return _playerLock;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setPlayerLock(bool status) {
|
|
|
|
_playerLock = status;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setPlayerInvisible(bool status) {
|
|
|
|
_playerInvisible = status;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool playerRunning() {
|
|
|
|
return _playerRunning;
|
|
|
|
}
|
|
|
|
|
|
|
|
void togglePlayerRunning() {
|
|
|
|
_playerRunning = !_playerRunning;
|
|
|
|
}
|
|
|
|
|
2019-06-18 04:19:36 +05:30
|
|
|
// Cinematic Functions
|
2019-06-23 07:10:23 +05:30
|
|
|
bool cinematicsActive() {
|
|
|
|
return _cineActive;
|
|
|
|
}
|
2019-06-18 04:52:29 +05:30
|
|
|
void processCines();
|
2019-06-18 20:40:47 +05:30
|
|
|
void cineStart(bool abortable, const char *abortFunc);
|
2019-06-20 17:48:00 +05:30
|
|
|
void cineLockPlayer();
|
|
|
|
void cineUnlockPlayer();
|
2019-06-18 04:19:36 +05:30
|
|
|
void cineSetCamera(int x, int y);
|
|
|
|
void cineResetCamera();
|
|
|
|
void cineMoveCamera(int x, int y, int speed);
|
2019-06-18 04:56:16 +05:30
|
|
|
void cineWait(int seconds);
|
|
|
|
void cineWaitUntilDone();
|
2019-06-19 01:15:55 +05:30
|
|
|
void cineSetEntity(const char *entName, int x, int y, int level);
|
2019-06-20 18:14:46 +05:30
|
|
|
void cineMoveEntity(const char *entName, int x, int y, int level, int speed);
|
2019-06-20 18:32:57 +05:30
|
|
|
void cineEntityFace(const char *luaName, double dir);
|
2019-06-23 06:50:09 +05:30
|
|
|
void cineDialog(const char *title, const char *string, int seconds);
|
2019-06-19 17:58:37 +05:30
|
|
|
void cineUse(const char *entName);
|
2019-06-18 16:43:12 +05:30
|
|
|
void cineFadeIn(bool isBlack, int steps);
|
|
|
|
void cineFadeOut(bool isBlack, int steps);
|
2019-06-21 06:38:14 +05:30
|
|
|
void cineClearForeground(int x, int y);
|
|
|
|
void cineSetBackground(int x, int y, int index);
|
|
|
|
void cineSetForeground(int x, int y, int index);
|
2019-06-18 04:19:36 +05:30
|
|
|
|
2019-06-19 22:46:33 +05:30
|
|
|
// Waypoint & Movement Functions
|
|
|
|
void lookAtXY(int x, int y);
|
2019-06-22 08:53:59 +05:30
|
|
|
void addWaypoint(int px, int py, int x, int y, int level);
|
2019-06-21 21:25:40 +05:30
|
|
|
void removeFirstWaypoint();
|
2019-06-20 17:46:20 +05:30
|
|
|
void clearWaypoints();
|
2019-06-21 07:49:23 +05:30
|
|
|
Tile *getStandFrameDir(AIEntity *e);
|
2019-06-19 22:46:33 +05:30
|
|
|
|
2019-06-19 23:54:46 +05:30
|
|
|
// Inventory Functions
|
|
|
|
bool addToInventory(AIEntity *e);
|
2019-06-21 03:20:59 +05:30
|
|
|
void clearInventory();
|
2019-06-19 23:54:46 +05:30
|
|
|
|
2019-06-19 21:16:36 +05:30
|
|
|
// Player Variables
|
|
|
|
bool _playerDead;
|
|
|
|
bool _playerInvisible; // While on RailRider for example
|
|
|
|
bool _playerOnIce;
|
|
|
|
bool _playerEmerging;
|
|
|
|
bool _playerRunning;
|
2019-06-19 17:25:19 +05:30
|
|
|
|
2019-06-20 19:33:50 +05:30
|
|
|
uint16 _pushupFrames;
|
|
|
|
Tile *_pushupGfx[kMaxAnimFrames];
|
|
|
|
|
|
|
|
uint16 _pushdownFrames;
|
|
|
|
Tile *_pushdownGfx[kMaxAnimFrames];
|
|
|
|
|
|
|
|
uint16 _pushleftFrames;
|
|
|
|
Tile *_pushleftGfx[kMaxAnimFrames];
|
|
|
|
|
|
|
|
uint16 _pushrightFrames;
|
|
|
|
Tile *_pushrightGfx[kMaxAnimFrames];
|
|
|
|
|
|
|
|
Tile *_getGfx[5]; // only 1 frame in each direction (+1 for DIR_NONE at start)
|
|
|
|
|
|
|
|
uint16 _dyingFrames;
|
|
|
|
Tile *_dyingGfx[kMaxDeathFrames];
|
|
|
|
|
|
|
|
Tile *_goodjobGfx; // only 1 frame
|
|
|
|
|
|
|
|
uint16 _horrible1Frames;
|
|
|
|
Tile *_horrible1Gfx[kMaxDeathFrames];
|
|
|
|
uint16 _horrible2Frames;
|
|
|
|
Tile *_horrible2Gfx[kMaxDeathFrames];
|
|
|
|
uint16 _horrible3Frames;
|
|
|
|
Tile *_horrible3Gfx[kMaxDeathFrames];
|
|
|
|
uint16 _horrible4Frames;
|
|
|
|
Tile *_horrible4Gfx[kMaxDeathFrames];
|
|
|
|
uint16 _plummetFrames;
|
|
|
|
Tile *_plummetGfx[kMaxDeathFrames];
|
|
|
|
|
|
|
|
uint16 _clubUpFrames;
|
2019-06-21 04:50:26 +05:30
|
|
|
Picture *_clubUpGfx[kMaxAnimFrames];
|
2019-06-20 19:33:50 +05:30
|
|
|
uint16 _clubDownFrames;
|
2019-06-21 04:50:26 +05:30
|
|
|
Picture *_clubDownGfx[kMaxAnimFrames];
|
2019-06-20 19:33:50 +05:30
|
|
|
uint16 _clubLeftFrames;
|
2019-06-21 04:50:26 +05:30
|
|
|
Picture *_clubLeftGfx[kMaxAnimFrames];
|
2019-06-20 19:33:50 +05:30
|
|
|
uint16 _clubRightFrames;
|
2019-06-21 04:50:26 +05:30
|
|
|
Picture *_clubRightGfx[kMaxAnimFrames];
|
2019-06-20 19:33:50 +05:30
|
|
|
|
|
|
|
uint16 _stunUpFrames;
|
|
|
|
Tile *_stunUpGfx[kMaxAnimFrames];
|
|
|
|
uint16 _stunDownFrames;
|
|
|
|
Tile *_stunDownGfx[kMaxAnimFrames];
|
|
|
|
uint16 _stunLeftFrames;
|
|
|
|
Tile *_stunLeftGfx[kMaxAnimFrames];
|
|
|
|
uint16 _stunRightFrames;
|
|
|
|
Tile *_stunRightGfx[kMaxAnimFrames];
|
2019-06-21 04:50:26 +05:30
|
|
|
Tile *_stunLightningGfx[kMaxAnimFrames];
|
2019-06-20 19:33:50 +05:30
|
|
|
Tile *_stunnedGfx[kMaxAnimFrames];
|
|
|
|
|
|
|
|
uint16 _slugUpFrames;
|
|
|
|
Tile *_slugUpGfx[kMaxAnimFrames];
|
|
|
|
uint16 _slugDownFrames;
|
|
|
|
Tile *_slugDownGfx[kMaxAnimFrames];
|
|
|
|
uint16 _slugLeftFrames;
|
|
|
|
Tile *_slugLeftGfx[kMaxAnimFrames];
|
|
|
|
uint16 _slugRightFrames;
|
|
|
|
Tile *_slugRightGfx[kMaxAnimFrames];
|
|
|
|
|
|
|
|
uint16 _slugAttackFrames;
|
2019-06-21 04:50:26 +05:30
|
|
|
Picture *_slugAttackGfx[kMaxAnimFrames];
|
2019-06-20 05:17:30 +05:30
|
|
|
|
2019-06-19 23:54:46 +05:30
|
|
|
// Player Resources and Deliveries
|
|
|
|
|
|
|
|
int _numGems;
|
|
|
|
int _numGooCups;
|
|
|
|
int _numMonkeystones;
|
|
|
|
|
2019-06-22 05:08:42 +05:30
|
|
|
// Special Tiles that are usable
|
|
|
|
// These variables hold the tile-indices set
|
|
|
|
// in ai-init.cpp
|
|
|
|
|
|
|
|
int _useSwitchOff; // the door opening switch
|
|
|
|
int _useSwitchOn; // state, when opened
|
|
|
|
int _useHolderEmpty; // cell holding switch
|
|
|
|
int _useHolderFull; // state, when full
|
|
|
|
int _useSwitch2Off; // another switch
|
|
|
|
int _useSwitch2On; // state, when opened
|
|
|
|
int _useMailsorter; // mailsorter entity
|
|
|
|
int _useAskcomp; // askcomp entitiy
|
|
|
|
int _useTeleporter; // teleporter entity
|
|
|
|
int _useHandswitchOn; // 2-sided handswitch
|
|
|
|
int _useHandswitchOff; // 2-sided handswitch
|
|
|
|
|
|
|
|
int _targetDoorN; // horz SILVER door
|
|
|
|
int _targetDoorP; // horz BLUE door
|
|
|
|
int _targetDoorS; // horz RED door
|
|
|
|
int _targetDoorNv; // vert SILVER door
|
|
|
|
int _targetDoorPv; // vert BLUE door
|
|
|
|
int _targetDoorSv; // vert RED door
|
|
|
|
|
|
|
|
int _targetDoor2N; // horz SILVER door
|
|
|
|
int _targetDoor2P; // horz BLUE door
|
|
|
|
int _targetDoor2S; // horz RED door
|
|
|
|
int _targetDoor2Nv; // vert SILVER door
|
|
|
|
int _targetDoor2Pv; // vert BLUE door
|
|
|
|
int _targetDoor2Sv; // vert RED door
|
|
|
|
|
|
|
|
int _target2DoorN; // horz SILVER door
|
|
|
|
int _target2DoorP; // horz BLUE door
|
|
|
|
int _target2DoorS; // horz RED door
|
|
|
|
int _target2DoorNv; // vert SILVER door
|
|
|
|
int _target2DoorPv; // vert BLUE door
|
|
|
|
int _target2DoorSv; // vert RED door
|
|
|
|
|
|
|
|
int _target3DoorN; // horz SILVER door
|
|
|
|
int _target3DoorP; // horz BLUE door
|
|
|
|
int _target3DoorS; // horz RED door
|
|
|
|
int _target3DoorNv; // vert SILVER door
|
|
|
|
int _target3DoorPv; // vert BLUE door
|
|
|
|
int _target3DoorSv; // vert RED door
|
|
|
|
|
|
|
|
int _targetBridgeU; // bridge extending UP
|
|
|
|
int _targetBridgeD; // bridge extending DOWN
|
|
|
|
int _targetBridgeL; // bridge extending LEFT
|
|
|
|
int _targetBridgeR; // bridge extending RIGHT
|
|
|
|
|
|
|
|
int _targetBridgeMidLR; // bridge grating plank LEFT/RIGHT
|
|
|
|
int _targetBridgeMidUD; // bridge grating plank UP/DOWN
|
|
|
|
int _touchplateOn; // touchplate ON
|
|
|
|
int _touchplateOff;
|
|
|
|
int _templeTouchpOn; // touchplate ON
|
|
|
|
int _templeTouchpOff;
|
|
|
|
int _blockpole; // blockpole
|
|
|
|
|
|
|
|
int _kcHolderWhiteOff; // keycard holders
|
|
|
|
int _kcHolderWhiteOn;
|
|
|
|
int _kcHolderBlueOff;
|
|
|
|
int _kcHolderBlueOn;
|
|
|
|
int _kcHolderRedOff;
|
|
|
|
int _kcHolderRedOn;
|
|
|
|
int _kcHolderGreenOff;
|
|
|
|
int _kcHolderGreenOn;
|
|
|
|
int _kcHolderPurpleOff;
|
|
|
|
int _kcHolderPurpleOn;
|
|
|
|
int _kcHolderBlackOff;
|
|
|
|
int _kcHolderBlackOn;
|
|
|
|
|
2019-06-22 07:41:58 +05:30
|
|
|
AIEntLevel2 _entsLevel2[kMaxLevel2Ents];
|
2019-06-21 07:47:33 +05:30
|
|
|
int _numLevel2Ents;
|
|
|
|
|
2019-06-22 07:41:58 +05:30
|
|
|
InvEnt _inventory[kMaxInventory];
|
2019-06-19 23:54:46 +05:30
|
|
|
int _numInventory;
|
|
|
|
|
2019-06-20 17:34:22 +05:30
|
|
|
Waypoint _waypoints[kMaxWaypoints];
|
|
|
|
int _numWaypoints;
|
|
|
|
Tile *_waypointGfx[4]; // Animating waypoint gfx
|
|
|
|
|
2019-06-22 07:41:58 +05:30
|
|
|
ActionInfo _actions[kMaxActions];
|
2019-06-22 06:44:22 +05:30
|
|
|
|
2019-06-22 07:41:58 +05:30
|
|
|
AutoAction _autoActions[kMaxAutoActions];
|
2019-06-22 05:49:57 +05:30
|
|
|
|
2019-06-22 06:13:27 +05:30
|
|
|
// Virtual Player
|
|
|
|
AIEntity _dummyPlayer;
|
|
|
|
|
2019-06-21 04:50:26 +05:30
|
|
|
// Cinematic Variables
|
|
|
|
Common::Array<CineCommand *> _cine;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2019-06-22 05:47:39 +05:30
|
|
|
// Action Functions
|
|
|
|
|
|
|
|
// Black Door Switch
|
|
|
|
bool useSwitch(AIEntity *e, int x, int y, int targetX, int targetY, int onTile);
|
|
|
|
bool useSwitchOn(AIEntity *e, int x, int y, int targetX, int targetY, int offTile);
|
|
|
|
bool useSwitch2(AIEntity *e, int x, int y, int targetX, int targetY);
|
|
|
|
|
|
|
|
// Colored Keycard Switch
|
2019-06-22 23:13:25 +02:00
|
|
|
bool useLockedSwitch(AIEntity *e, int x, int y, int targetX, int targetY, int onTile, AIType item, const char *keyerror);
|
2019-06-22 05:47:39 +05:30
|
|
|
bool useLockedSwitchOn(AIEntity *e, int x, int y, int targetX, int targetY, int offTile, AIType item);
|
|
|
|
|
|
|
|
// Purple Cell Holder Switch
|
|
|
|
bool useCellHolder(AIEntity *e, int x, int y, int targetX, int targetY);
|
|
|
|
|
|
|
|
// Touchplate
|
|
|
|
bool useTouchplate(AIEntity *e, int x, int y, int targetX, int targetY, int type);
|
|
|
|
bool useTouchplateOn(AIEntity *e, int x, int y, int targetX, int targetY, int type);
|
|
|
|
|
|
|
|
// Normal Door
|
|
|
|
bool useDoorOpenClose(AIEntity *e, int x, int y);
|
|
|
|
bool useAutoDoorOpenClose(AIEntity *e, int x, int y);
|
|
|
|
|
|
|
|
// Any Type Door
|
|
|
|
bool useDoorOpenCloseBot(AIEntity *e, int x, int y);
|
|
|
|
|
2019-06-21 04:50:26 +05:30
|
|
|
Common::Array<AIEntity *> *_ents;
|
2019-06-21 09:34:05 +05:30
|
|
|
Common::Array<AIEntity *> *_floats;
|
2019-06-22 05:58:29 +05:30
|
|
|
Common::Array<AnimTarget *> *_animTargets;
|
2019-06-21 04:50:26 +05:30
|
|
|
AIEntity *_player;
|
|
|
|
|
2019-06-18 04:19:36 +05:30
|
|
|
// Cinematics Variables
|
|
|
|
bool _cineAbortable;
|
2019-06-18 04:26:31 +05:30
|
|
|
bool _cineAborted;
|
2019-06-18 20:40:47 +05:30
|
|
|
const char *_cineAbortFunc;
|
2019-06-18 04:19:36 +05:30
|
|
|
bool _cineActive;
|
|
|
|
bool _playerLock;
|
|
|
|
bool _cameraLock;
|
|
|
|
double _cameraX, _cameraY;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // End of Namespace
|
|
|
|
|
|
|
|
#endif // !HDB_AI_H
|