scummvm/engines/hdb/ai-player.cpp

1406 lines
37 KiB
C++
Raw Normal View History

2019-06-19 15:53:22 +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.
*
*/
#include "hdb/hdb.h"
namespace HDB {
void aiPlayerInit(AIEntity *e) {
2019-06-21 03:22:28 +05:30
g_hdb->_ai->clearInventory();
e->aiAction = aiPlayerAction;
e->draw = g_hdb->_ai->getStandFrameDir(e);
switch (e->dir) {
case DIR_UP:
e->state = STATE_STANDUP;
break;
case DIR_DOWN:
e->state = STATE_STANDDOWN;
break;
case DIR_LEFT:
e->state = STATE_STANDLEFT;
break;
case DIR_RIGHT:
e->state = STATE_STANDRIGHT;
break;
case DIR_NONE:
warning("AI-PLAYER: aiPlayerInit: DIR_NONE found");
break;
}
e->moveSpeed = kPlayerMoveSpeed;
strcpy(e->entityName, "player");
g_hdb->_ai->assignPlayer(e);
2019-06-19 15:53:22 +05:30
}
void aiPlayerInit2(AIEntity *e) {
2019-06-21 04:58:26 +05:30
if (!g_hdb->_ai->_clubUpGfx[0]) {
warning("STUB: weapon_sel_gfx uninitialized");
g_hdb->_ai->_clubUpGfx[0] = new Picture;
g_hdb->_ai->_clubUpGfx[0]->load(g_hdb->_fileMan->findFirstData("clubup1", TYPE_PIC));
g_hdb->_ai->_clubUpGfx[1] = new Picture;
g_hdb->_ai->_clubUpGfx[1]->load(g_hdb->_fileMan->findFirstData("clubup2", TYPE_PIC));
g_hdb->_ai->_clubUpGfx[2] = new Picture;
g_hdb->_ai->_clubUpGfx[2]->load(g_hdb->_fileMan->findFirstData("clubup3", TYPE_PIC));
g_hdb->_ai->_clubUpGfx[3] = new Picture;
g_hdb->_ai->_clubUpGfx[3]->load(g_hdb->_fileMan->findFirstData("clubup3", TYPE_PIC));
g_hdb->_ai->_clubDownGfx[0] = new Picture;
g_hdb->_ai->_clubDownGfx[0]->load(g_hdb->_fileMan->findFirstData("clubdown1", TYPE_PIC));
g_hdb->_ai->_clubDownGfx[1] = new Picture;
g_hdb->_ai->_clubDownGfx[1]->load(g_hdb->_fileMan->findFirstData("clubdown2", TYPE_PIC));
g_hdb->_ai->_clubDownGfx[2] = new Picture;
g_hdb->_ai->_clubDownGfx[2]->load(g_hdb->_fileMan->findFirstData("clubdown3", TYPE_PIC));
g_hdb->_ai->_clubDownGfx[3] = new Picture;
g_hdb->_ai->_clubDownGfx[3]->load(g_hdb->_fileMan->findFirstData("clubdown3", TYPE_PIC));
g_hdb->_ai->_clubLeftGfx[0] = new Picture;
g_hdb->_ai->_clubLeftGfx[0]->load(g_hdb->_fileMan->findFirstData("clubleft1", TYPE_PIC));
g_hdb->_ai->_clubLeftGfx[1] = new Picture;
g_hdb->_ai->_clubLeftGfx[1]->load(g_hdb->_fileMan->findFirstData("clubleft2", TYPE_PIC));
g_hdb->_ai->_clubLeftGfx[2] = new Picture;
g_hdb->_ai->_clubLeftGfx[2]->load(g_hdb->_fileMan->findFirstData("clubleft3", TYPE_PIC));
g_hdb->_ai->_clubLeftGfx[3] = new Picture;
g_hdb->_ai->_clubLeftGfx[3]->load(g_hdb->_fileMan->findFirstData("clubleft3", TYPE_PIC));
g_hdb->_ai->_clubRightGfx[0] = new Picture;
g_hdb->_ai->_clubRightGfx[0]->load(g_hdb->_fileMan->findFirstData("clubright1", TYPE_PIC));
g_hdb->_ai->_clubRightGfx[1] = new Picture;
g_hdb->_ai->_clubRightGfx[1]->load(g_hdb->_fileMan->findFirstData("clubright2", TYPE_PIC));
g_hdb->_ai->_clubRightGfx[2] = new Picture;
g_hdb->_ai->_clubRightGfx[2]->load(g_hdb->_fileMan->findFirstData("clubright3", TYPE_PIC));
g_hdb->_ai->_clubRightGfx[3] = new Picture;
g_hdb->_ai->_clubRightGfx[3]->load(g_hdb->_fileMan->findFirstData("clubright3", TYPE_PIC));
g_hdb->_ai->_clubUpFrames = 4;
g_hdb->_ai->_clubDownFrames = 4;
g_hdb->_ai->_clubLeftFrames = 4;
g_hdb->_ai->_clubRightFrames = 4;
g_hdb->_ai->_slugAttackGfx[0] = new Picture;
g_hdb->_ai->_slugAttackGfx[0]->load(g_hdb->_fileMan->findFirstData("slug_shot1", TYPE_PIC));
g_hdb->_ai->_slugAttackGfx[1] = new Picture;
g_hdb->_ai->_slugAttackGfx[1]->load(g_hdb->_fileMan->findFirstData("slug_shot2", TYPE_PIC));
g_hdb->_ai->_slugAttackGfx[2] = new Picture;
g_hdb->_ai->_slugAttackGfx[2]->load(g_hdb->_fileMan->findFirstData("slug_shot3", TYPE_PIC));
g_hdb->_ai->_slugAttackGfx[3] = new Picture;
g_hdb->_ai->_slugAttackGfx[3]->load(g_hdb->_fileMan->findFirstData("slug_shot4", TYPE_PIC));
int32 size = g_hdb->_fileMan->getLength("shock_spark_sit01", TYPE_TILE32);
2019-07-02 00:48:38 +02:00
g_hdb->_ai->_stunLightningGfx[0] = g_hdb->_gfx->getTileGfx("shock_spark_sit01", size);
2019-06-21 04:58:26 +05:30
size = g_hdb->_fileMan->getLength("shock_spark_sit02", TYPE_TILE32);
2019-07-02 00:48:38 +02:00
g_hdb->_ai->_stunLightningGfx[1] = g_hdb->_gfx->getTileGfx("shock_spark_sit02", size);
2019-06-21 04:58:26 +05:30
size = g_hdb->_fileMan->getLength("shock_spark_sit03", TYPE_TILE32);
2019-07-02 00:48:38 +02:00
g_hdb->_ai->_stunLightningGfx[2] = g_hdb->_gfx->getTileGfx("shock_spark_sit03", size);
2019-06-21 04:58:26 +05:30
size = g_hdb->_fileMan->getLength("shock_spark_sit04", TYPE_TILE32);
2019-07-02 00:48:38 +02:00
g_hdb->_ai->_stunLightningGfx[3] = g_hdb->_gfx->getTileGfx("shock_spark_sit04", size);
2019-06-21 04:58:26 +05:30
size = g_hdb->_fileMan->getLength("starstun_sit01", TYPE_TILE32);
2019-07-02 00:48:38 +02:00
g_hdb->_ai->_stunnedGfx[0] = g_hdb->_gfx->getTileGfx("starstun_sit01", size);
2019-06-21 04:58:26 +05:30
size = g_hdb->_fileMan->getLength("starstun_sit02", TYPE_TILE32);
2019-07-02 00:48:38 +02:00
g_hdb->_ai->_stunnedGfx[1] = g_hdb->_gfx->getTileGfx("starstun_sit02", size);
2019-06-21 04:58:26 +05:30
size = g_hdb->_fileMan->getLength("starstun_sit03", TYPE_TILE32);
2019-07-02 00:48:38 +02:00
g_hdb->_ai->_stunnedGfx[2] = g_hdb->_gfx->getTileGfx("starstun_sit03", size);
2019-06-21 04:58:26 +05:30
size = g_hdb->_fileMan->getLength("starstun_sit04", TYPE_TILE32);
2019-07-02 00:48:38 +02:00
g_hdb->_ai->_stunnedGfx[3] = g_hdb->_gfx->getTileGfx("starstun_sit04", size);
2019-06-21 04:58:26 +05:30
}
e->draw = g_hdb->_ai->getStandFrameDir(e);
2019-06-19 15:53:22 +05:30
}
void aiPlayerAction(AIEntity *e) {
2019-06-28 03:45:26 +05:30
AIState stand[5] = {STATE_NONE, STATE_STANDUP, STATE_STANDDOWN, STATE_STANDLEFT, STATE_STANDRIGHT};
int xvAhead[5] = {9, 0, 0, -1, 1}, yvAhead[5] = {9, -1, 1, 0, 0};
2019-06-28 04:01:00 +05:30
AIEntity *hit = NULL;
2019-06-28 03:45:26 +05:30
// Draw the STUN lightning if it exists
if (e->sequence) {
e->aiDraw = aiPlayerDraw;
warning("STUB: Play SND_STUNNER_FIRE");
hit = g_hdb->_ai->findEntity(e->tileX + xvAhead[e->dir], e->tileY + yvAhead[e->dir]);
if (hit)
switch (hit->type) {
case AI_MEERKAT:
if (hit->sequence > 2)
g_hdb->_ai->stunEnemy(hit, 8);
break;
case AI_ICEPUFF:
if (hit->state == STATE_ICEP_APPEAR || hit->state == STATE_ICEP_THROWDOWN || hit->state == STATE_ICEP_THROWLEFT || hit->state == STATE_ICEP_THROWRIGHT) {
g_hdb->_ai->addAnimateTarget(hit->x, hit->y, 0, 3, ANIM_NORMAL, false, false, GROUP_STEAM_PUFF_SIT);
g_hdb->_ai->stunEnemy(hit, 8);
}
break;
case AI_BADFAIRY:
case AI_GOODFAIRY:
case AI_CHICKEN:
case AI_OMNIBOT:
case AI_TURNBOT:
case AI_PUSHBOT:
case AI_DEADEYE:
case AI_FATFROG:
case AI_BUZZFLY:
case AI_MAINTBOT:
case AI_RIGHTBOT:
case AI_GATEPUDDLE:
g_hdb->_ai->stunEnemy(hit, 8);
break;
default:
2019-06-28 04:00:24 +05:30
debug(9, "STUB: stunEnemy: Play sound");
2019-06-28 03:45:26 +05:30
break;
}
hit = g_hdb->_ai->findEntity(e->tileX + (xvAhead[e->dir] << 1), e->tileY + (yvAhead[e->dir] << 1));
if (hit)
switch (hit->type) {
case AI_MEERKAT:
if (hit->sequence > 2)
g_hdb->_ai->stunEnemy(hit, 8);
break;
case AI_ICEPUFF:
if (hit->state == STATE_ICEP_APPEAR || hit->state == STATE_ICEP_THROWDOWN || hit->state == STATE_ICEP_THROWLEFT || hit->state == STATE_ICEP_THROWRIGHT) {
g_hdb->_ai->addAnimateTarget(hit->x, hit->y, 0, 3, ANIM_NORMAL, false, false, GROUP_STEAM_PUFF_SIT);
g_hdb->_ai->stunEnemy(hit, 8);
}
break;
case AI_BADFAIRY:
case AI_GOODFAIRY:
case AI_CHICKEN:
case AI_OMNIBOT:
case AI_TURNBOT:
case AI_PUSHBOT:
case AI_DEADEYE:
case AI_FATFROG:
case AI_BUZZFLY:
case AI_MAINTBOT:
case AI_RIGHTBOT:
case AI_GATEPUDDLE:
g_hdb->_ai->stunEnemy(hit, 8);
break;
default:
2019-06-28 04:00:24 +05:30
debug(9, "STUB: stunEnemy: Play sound");
2019-06-28 03:45:26 +05:30
break;
}
}
int xOff[] = {0, 0, -8,-16};
int yOff[] = {-8,-24,-16,-16};
// If the player is supposed to animate for abit, check for it here
switch (e->state) {
case STATE_GRABUP:
case STATE_GRABDOWN:
case STATE_GRABLEFT:
case STATE_GRABRIGHT:
if (!e->animFrame--) {
// Done with the Grabbing Animation, switch to standing
switch (e->state) {
case STATE_GRABUP: e->draw = e->standupGfx[0]; e->state = STATE_STANDUP; break;
case STATE_GRABDOWN: e->draw = e->standdownGfx[0]; e->state = STATE_STANDDOWN; break;
case STATE_GRABLEFT: e->draw = e->standleftGfx[0]; e->state = STATE_STANDLEFT; break;
case STATE_GRABRIGHT: e->draw = e->standrightGfx[0]; e->state = STATE_STANDRIGHT; break;
default:
2019-06-28 04:00:24 +05:30
debug(9, "STUB: stunEnemy: Play sound");
2019-06-28 03:45:26 +05:30
break;
}
e->animDelay = 1;
e->animCycle = 1;
}
break;
case STATE_ATK_CLUB_UP:
case STATE_ATK_CLUB_DOWN:
case STATE_ATK_CLUB_LEFT:
case STATE_ATK_CLUB_RIGHT:
g_hdb->_ai->setPlayerInvisible(true);
e->aiDraw = aiPlayerDraw;
e->drawXOff = xOff[e->state - STATE_ATK_CLUB_UP];
e->drawYOff = yOff[e->state - STATE_ATK_CLUB_UP];
switch (e->state) {
case STATE_ATK_CLUB_UP: cycleFrames(e, g_hdb->_ai->_clubUpFrames); break;
case STATE_ATK_CLUB_DOWN: cycleFrames(e, g_hdb->_ai->_clubDownFrames); break;
case STATE_ATK_CLUB_LEFT: cycleFrames(e, g_hdb->_ai->_clubLeftFrames); break;
case STATE_ATK_CLUB_RIGHT: cycleFrames(e, g_hdb->_ai->_clubRightFrames); break;
default:
2019-06-28 04:00:24 +05:30
debug(9, "STUB: stunEnemy: Play sound");
2019-06-28 03:45:26 +05:30
break;
}
// Whack!
if ((e->animFrame >= 1) && (e->animDelay == e->animCycle)) {
switch (e->dir) {
case DIR_UP: hit = g_hdb->_ai->playerCollision(32, 0, 16, 16); break;
case DIR_DOWN: hit = g_hdb->_ai->playerCollision(0, 32, 16, 16); break;
case DIR_LEFT: hit = g_hdb->_ai->playerCollision(16, 16, 32, 0); break;
case DIR_RIGHT: hit = g_hdb->_ai->playerCollision(16, 16, 0, 32); break;
default:
warning("aiPlayerAction: DIR_NONE found");
break;
}
if (hit && hit->level == e->level && !hit->stunnedWait) {
switch (hit->type) {
case AI_MEERKAT:
if (hit->sequence > 2) // out of the ground?
g_hdb->_ai->stunEnemy(hit, 2);
break;
case AI_ICEPUFF:
if (hit->state == STATE_ICEP_APPEAR ||
hit->state == STATE_ICEP_THROWDOWN ||
hit->state == STATE_ICEP_THROWLEFT ||
hit->state == STATE_ICEP_THROWRIGHT)
g_hdb->_ai->stunEnemy(hit, 2);
break;
case AI_CHICKEN:
g_hdb->_ai->addAnimateTarget(hit->x, hit->y, 0, 3, ANIM_NORMAL, false, false, GROUP_STEAM_PUFF_SIT);
g_hdb->_ai->removeEntity(hit);
break;
case AI_BADFAIRY:
case AI_GOODFAIRY:
case AI_OMNIBOT:
case AI_TURNBOT:
case AI_PUSHBOT:
case AI_DEADEYE:
case AI_FATFROG:
case AI_BUZZFLY:
case AI_MAINTBOT:
case AI_RIGHTBOT:
case AI_SHOCKBOT:
case AI_GATEPUDDLE:
g_hdb->_ai->stunEnemy(hit, 2);
warning("STUB: Play MetalorFlesh SND");
break;
default:
warning("aiPlayerAction: DIR_NONE found");
break;
}
}
}
if ((!e->animFrame) && (e->animDelay == e->animCycle)) {
e->state = stand[e->dir];
e->aiDraw = NULL;
switch (e->state) {
case STATE_ATK_CLUB_UP: e->draw = e->standupGfx[0]; break;
case STATE_ATK_CLUB_DOWN: e->draw = e->standdownGfx[0]; break;
case STATE_ATK_CLUB_LEFT: e->draw = e->standleftGfx[0]; break;
case STATE_ATK_CLUB_RIGHT: e->draw = e->standrightGfx[0]; break;
default:
2019-06-28 04:00:24 +05:30
debug(9, "STUB: stunEnemy: Play sound");
2019-06-28 03:45:26 +05:30
break;
}
g_hdb->_ai->setPlayerInvisible(false);
e->drawXOff = e->drawYOff = 0;
}
return;
case STATE_ATK_STUN_UP:
e->draw = g_hdb->_ai->_stunUpGfx[e->animFrame];
cycleFrames(e, g_hdb->_ai->_stunUpFrames);
if (!e->animFrame && e->animDelay == e->animCycle) {
e->state = stand[e->dir];
e->aiDraw = NULL;
e->sequence = 0;
}
return;
case STATE_ATK_STUN_DOWN:
e->draw = g_hdb->_ai->_stunDownGfx[e->animFrame];
cycleFrames(e, g_hdb->_ai->_stunDownFrames);
if (!e->animFrame && e->animDelay == e->animCycle) {
e->state = stand[e->dir];
e->aiDraw = NULL;
e->sequence = 0;
}
return;
case STATE_ATK_STUN_LEFT:
e->draw = g_hdb->_ai->_stunLeftGfx[e->animFrame];
cycleFrames(e, g_hdb->_ai->_stunLeftFrames);
if (!e->animFrame && e->animDelay == e->animCycle) {
e->state = stand[e->dir];
e->aiDraw = NULL;
e->sequence = 0;
}
return;
case STATE_ATK_STUN_RIGHT:
e->draw = g_hdb->_ai->_stunRightGfx[e->animFrame];
cycleFrames(e, g_hdb->_ai->_stunRightFrames);
if (!e->animFrame && e->animDelay == e->animCycle) {
e->state = stand[e->dir];
e->aiDraw = NULL;
e->sequence = 0;
}
return;
case STATE_ATK_SLUG_UP:
e->draw = g_hdb->_ai->_slugUpGfx[e->animFrame];
cycleFrames(e, g_hdb->_ai->_slugUpFrames);
if (!e->animFrame && e->animDelay == e->animCycle) {
e->state = stand[e->dir];
e->sequence = 0;
}
return;
case STATE_ATK_SLUG_DOWN:
e->draw = g_hdb->_ai->_slugDownGfx[e->animFrame];
cycleFrames(e, g_hdb->_ai->_slugDownFrames);
if (!e->animFrame && e->animDelay == e->animCycle) {
e->state = stand[e->dir];
e->sequence = 0;
}
return;
case STATE_ATK_SLUG_LEFT:
e->draw = g_hdb->_ai->_slugLeftGfx[e->animFrame];
cycleFrames(e, g_hdb->_ai->_slugLeftFrames);
if (!e->animFrame && e->animDelay == e->animCycle) {
e->state = stand[e->dir];
e->sequence = 0;
}
return;
case STATE_ATK_SLUG_RIGHT:
e->draw = g_hdb->_ai->_slugRightGfx[e->animFrame];
cycleFrames(e, g_hdb->_ai->_slugRightFrames);
if (!e->animFrame && e->animDelay == e->animCycle) {
e->state = stand[e->dir];
e->sequence = 0;
}
return;
default:
2019-06-28 04:00:24 +05:30
debug(9, "STUB: stunEnemy: Play sound");
2019-06-28 03:45:26 +05:30
break;
}
// If the touchplate wait is on, keep it timing
if (e->touchpWait) {
e->touchpWait--;
if (!e->touchpWait)
e->touchpTile = -e->touchpTile;
} else if (e->touchpTile < 0 && (e->touchpX != e->tileX || e->touchpY != e->tileY)) {
g_hdb->_ai->checkActionList(e, e->touchpX, e->touchpY, false);
g_hdb->_map->setMapBGTileIndex(e->touchpX, e->touchpY, -e->touchpTile);
e->touchpX = e->touchpY = e->touchpTile = 0;
}
// If the player is moving somewhere, animate him
int bgFlags, fgFlags;
if (e->goalX) {
if (onEvenTile(e->x, e->y)) {
g_hdb->_ai->playerOnIce() ? warning("STUB: Play SND_STEPS_ICE") : warning("STUB: Play SND_FOOTSTEPS");
// Did we just fall down a PLUMMET?
bgFlags = g_hdb->_map->getMapBGTileFlags(e->tileX, e->tileY);
fgFlags = g_hdb->_map->getMapFGTileFlags(e->tileX, e->tileY);
if ((bgFlags & kFlagPlummet) && !(fgFlags & kFlagGrating) && !g_hdb->_ai->playerDead()) {
g_hdb->_ai->killPlayer(DEATH_PLUMMET);
g_hdb->_ai->animEntFrames(e);
return;
}
}
g_hdb->_ai->animateEntity(e);
} else {
// Sometimes the fading stays black
2019-07-02 00:48:38 +02:00
if (!g_hdb->_ai->cinematicsActive() && g_hdb->_gfx->isFadeStaying())
g_hdb->_gfx->turnOffFade();
2019-06-28 03:45:26 +05:30
// Did we just fall down a PLUMMET?
bgFlags = g_hdb->_map->getMapBGTileFlags(e->tileX, e->tileY);
fgFlags = g_hdb->_map->getMapFGTileFlags(e->tileX, e->tileY);
if ((bgFlags & kFlagPlummet) && !(fgFlags & kFlagGrating) && !g_hdb->_ai->playerDead()) {
g_hdb->_ai->killPlayer(DEATH_PLUMMET);
g_hdb->_ai->animEntFrames(e);
return;
}
// Standing on a TouchPlate will activate something WHILE standing on it
int bgTile = g_hdb->_ai->checkForTouchplate(e->tileX, e->tileY);
if (bgTile && !e->touchpWait && !e->touchpTile) {
if (g_hdb->_ai->checkActionList(e, e->tileX, e->tileY, false)) {
e->touchpTile = bgTile;
e->touchpX = e->tileX;
e->touchpY = e->tileY;
e->touchpWait = kPlayerTouchPWait;
g_hdb->_ai->stopEntity(e);
}
}
g_hdb->_ai->animEntFrames(e);
}
2019-06-19 15:53:22 +05:30
}
void aiPlayerDraw(AIEntity *e, int mx, int my) {
2019-06-21 05:12:38 +05:30
switch (e->state) {
case STATE_ATK_CLUB_UP:
g_hdb->_ai->_clubUpGfx[e->animFrame]->drawMasked(e->x + e->drawXOff - mx, e->y + e->drawYOff - my);
break;
case STATE_ATK_CLUB_DOWN:
g_hdb->_ai->_clubDownGfx[e->animFrame]->drawMasked(e->x + e->drawXOff - mx, e->y + e->drawYOff - my);
break;
case STATE_ATK_CLUB_LEFT:
g_hdb->_ai->_clubLeftGfx[e->animFrame]->drawMasked(e->x + e->drawXOff - mx, e->y + e->drawYOff - my);
break;
case STATE_ATK_CLUB_RIGHT:
g_hdb->_ai->_clubRightGfx[e->animFrame]->drawMasked(e->x + e->drawXOff - mx, e->y + e->drawYOff - my);
break;
default:
warning("AI-PLAYER: aiPlayerDraw: Unintended State");
break;
}
if (e->sequence) {
static int frame = 0;
switch (e->dir) {
case DIR_UP:
g_hdb->_ai->_stunLightningGfx[frame]->drawMasked(e->x - mx, e->y - 32 - my);
g_hdb->_ai->_stunLightningGfx[frame]->drawMasked(e->x - mx, e->y - 64 - my);
break;
case DIR_DOWN:
g_hdb->_ai->_stunLightningGfx[frame]->drawMasked(e->x - mx, e->y + 32 - my);
g_hdb->_ai->_stunLightningGfx[frame]->drawMasked(e->x - mx, e->y + 64 - my);
break;
case DIR_LEFT:
g_hdb->_ai->_stunLightningGfx[frame]->drawMasked(e->x - 32 - mx, e->y - my);
g_hdb->_ai->_stunLightningGfx[frame]->drawMasked(e->x - 64 - mx, e->y - my);
break;
case DIR_RIGHT:
g_hdb->_ai->_stunLightningGfx[frame]->drawMasked(e->x + 32 - mx, e->y - my);
g_hdb->_ai->_stunLightningGfx[frame]->drawMasked(e->x + 64 - mx, e->y - my);
break;
case DIR_NONE:
warning("AI-PLAYER: aiPlayerDraw: DIR_NONE found");
break;
}
frame = (frame + 1) & 3;
}
2019-06-19 15:53:22 +05:30
}
void aiGemAttackInit(AIEntity *e) {
warning("STUB: AI: aiGemAttackInit required");
}
void aiGemAttackInit2(AIEntity *e) {
warning("STUB: AI: aiGemAttackInit2 required");
}
void aiGemAttackAction(AIEntity *e) {
warning("STUB: AI: aiGemAttackAction required");
}
void aiChickenAction(AIEntity *e) {
warning("STUB: AI: aiChickenAction required");
}
void aiChickenUse(AIEntity *e) {
warning("STUB: AI: aiChickenUse required");
}
void aiChickenInit(AIEntity *e) {
warning("STUB: AI: aiChickenInit required");
}
void aiChickenInit2(AIEntity *e) {
warning("STUB: AI: aiChickenInit2 required");
}
void aiDollyInit(AIEntity *e) {
2019-06-30 03:38:45 +05:30
e->moveSpeed = kPlayerMoveSpeed >> 1;
e->aiAction = aiGenericAction;
2019-06-19 15:53:22 +05:30
}
void aiDollyInit2(AIEntity *e) {
2019-06-30 03:38:45 +05:30
e->draw = e->movedownGfx[0];
2019-06-19 15:53:22 +05:30
}
void aiSergeantInit(AIEntity *e) {
e->moveSpeed = kPlayerMoveSpeed >> 1;
if (e->value1)
e->aiAction = aiSergeantAction;
2019-06-19 15:53:22 +05:30
}
void aiSergeantInit2(AIEntity *e) {
e->draw = g_hdb->_ai->getStandFrameDir(e);
2019-06-19 15:53:22 +05:30
}
void aiSergeantAction(AIEntity *e) {
if (e->goalX) {
debug(9, "STUB: AI-PLAYER: aiSergeantAction: Play SND_FOOTSTEPS sounds");
g_hdb->_ai->animateEntity(e);
} else
g_hdb->_ai->animEntFrames(e);
2019-06-19 15:53:22 +05:30
}
void aiSpacedudeInit(AIEntity *e) {
2019-06-30 03:38:45 +05:30
e->moveSpeed = kPlayerMoveSpeed >> 1;
if (e->value1)
e->aiAction = aiGenericAction;
2019-06-19 15:53:22 +05:30
}
void aiSpacedudeInit2(AIEntity *e) {
2019-06-30 03:38:45 +05:30
e->standdownFrames = 1;
e->standdownGfx[0] = e->movedownGfx[0];
e->standupFrames = 1;
e->standupGfx[0] = e->moveupGfx[0];
e->standleftFrames = 1;
e->standleftGfx[0] = e->moveleftGfx[0];
e->standrightFrames = 1;
e->standrightGfx[0] = e->moverightGfx[0];
e->draw = g_hdb->_ai->getStandFrameDir(e);
2019-06-19 15:53:22 +05:30
}
void aiCrateAction(AIEntity *e) {
2019-07-02 04:22:05 +05:30
// if crate isn't moving somewhere, don't move it
if (!e->goalX) {
// crate is stopped in the water... should it continue downstream?
// not if it's marked by the Number of the Beast!
if (e->state == STATE_FLOATING) {
if (e->value1 != 0x666) {
int flags = g_hdb->_map->getMapBGTileFlags(e->tileX, e->tileY);
if (flags & (kFlagPushRight | kFlagPushLeft | kFlagPushUp | kFlagPushDown)) {
g_hdb->_ai->setEntityGoal(e, e->tileX, e->tileY);
g_hdb->_ai->animateEntity(e);
} else
g_hdb->_ai->animEntFrames(e);
} else
g_hdb->_ai->animEntFrames(e);
}
return;
}
g_hdb->_ai->animateEntity(e);
2019-06-19 15:53:22 +05:30
}
void aiCrateInit2(AIEntity *e) {
2019-07-02 04:22:05 +05:30
// point all crate move frames to the standing one
e->movedownFrames =
e->moveleftFrames =
e->moverightFrames =
e->moveupFrames = 1;
e->movedownGfx[0] =
e->moveupGfx[0] =
e->moveleftGfx[0] =
e->moverightGfx[0] = e->standdownGfx[0];
e->draw = e->standdownGfx[0]; // standing frame - doesn't move
2019-06-19 15:53:22 +05:30
}
void aiCrateInit(AIEntity *e) {
2019-07-02 04:22:05 +05:30
e->moveSpeed = kPushMoveSpeed;
e->aiAction = aiCrateAction;
e->value1 = 0;
2019-06-19 15:53:22 +05:30
}
void aiBarrelLightAction(AIEntity *e) {
if (!e->goalX) {
if (e->state == STATE_FLOATING)
g_hdb->_ai->animEntFrames(e);
return;
}
g_hdb->_ai->animateEntity(e);
2019-06-19 15:53:22 +05:30
}
void aiBarrelLightInit2(AIEntity *e) {
// point all light barrel move frames to the standing one
e->movedownFrames =
e->moveleftFrames =
e->moverightFrames =
e->moveupFrames = 1;
e->movedownGfx[0] =
e->moveupGfx[0] =
e->moveleftGfx[0] =
e->moverightGfx[0] = e->standdownGfx[0];
e->draw = e->standdownGfx[0]; // standing frame - doesn't move
2019-06-19 15:53:22 +05:30
}
void aiBarrelLightInit(AIEntity *e) {
e->moveSpeed = kPushMoveSpeed;
e->aiAction = aiBarrelLightAction;
2019-06-19 15:53:22 +05:30
}
void aiBarrelHeavyAction(AIEntity *e) {
if (!e->goalX) {
if (e->state == STATE_FLOATING)
g_hdb->_ai->animEntFrames(e);
return;
}
g_hdb->_ai->animateEntity(e);
2019-06-19 15:53:22 +05:30
}
void aiBarrelHeavyInit2(AIEntity *e) {
// point all heavy barrel move frames to the standing one
e->movedownFrames =
e->moveleftFrames =
e->moverightFrames =
e->moveupFrames = 1;
e->movedownGfx[0] =
e->moveupGfx[0] =
e->moveleftGfx[0] =
e->moverightGfx[0] = e->standdownGfx[0];
e->draw = e->standdownGfx[0]; // standing frame - doesn't move
2019-06-19 15:53:22 +05:30
}
void aiBarrelHeavyInit(AIEntity *e) {
e->moveSpeed = kPushMoveSpeed;
e->aiAction = aiBarrelHeavyAction;
2019-06-19 15:53:22 +05:30
}
void aiBarrelExplosionEnd(AIEntity *e) {
warning("STUB: AI: aiBarrelExplosionEnd required");
}
void aiBarrelExplosionAction(AIEntity *e) {
warning("STUB: AI: aiBarrelExplosionAction required");
}
void aiBarrelExplode(AIEntity *e) {
e->state = STATE_EXPLODING;
e->animDelay = e->animCycle;
e->animFrame = 0;
warning("STUB: Play SND_BARREL_EXPLODE");
g_hdb->_map->setBoomBarrel(e->tileX, e->tileY, 0);
2019-06-19 15:53:22 +05:30
}
void aiBarrelExplodeInit(AIEntity *e) {
e->moveSpeed = kPushMoveSpeed;
e->aiAction = aiBarrelExplodeAction;
g_hdb->_map->setBoomBarrel(e->tileX, e->tileY, 1);
2019-06-19 15:53:22 +05:30
}
void aiBarrelExplodeInit2(AIEntity *e) {
// point all exploding barrel MOVE frames to the standing one
e->blinkFrames =
e->movedownFrames =
e->moveleftFrames =
e->moverightFrames =
e->moveupFrames = 1;
e->blinkGfx[0] =
e->movedownGfx[0] =
e->moveupGfx[0] =
e->moveleftGfx[0] =
e->moverightGfx[0] = e->standdownGfx[0];
e->draw = e->standdownGfx[0]; // standing frame - doesn't move
2019-06-19 15:53:22 +05:30
}
void aiBarrelExplodeAction(AIEntity *e) {
if (e->goalX)
g_hdb->_ai->animateEntity(e);
else if (e->state == STATE_EXPLODING)
g_hdb->_ai->animEntFrames(e);
2019-06-19 15:53:22 +05:30
}
void aiBarrelExplodeSpread(AIEntity *e) {
warning("STUB: AI: aiBarrelExplodeSpread required");
}
void aiBarrelExplosionEnd(int x, int y) {
g_hdb->_map->setExplosion(x, y, 0);
}
2019-06-19 15:53:22 +05:30
void aiBarrelBlowup(AIEntity *e, int x, int y) {
g_hdb->_ai->addAnimateTarget(x * kTileWidth,
y * kTileHeight, 0, 3, ANIM_NORMAL, false, false, GROUP_EXPLOSION_BOOM_SIT);
g_hdb->_map->setExplosion(x, y, 1);
g_hdb->_ai->addCallback(AI_BARREL_EXPLOSION_END, x, y, e->animCycle * 4);
2019-06-19 15:53:22 +05:30
}
void aiScientistInit(AIEntity *e) {
2019-06-30 03:38:45 +05:30
e->moveSpeed = kPlayerMoveSpeed >> 1;
if (g_hdb->_ai->findPath(e))
e->aiAction = aiGenericAction;
else if (e->value1)
e->aiAction = aiGenericAction;
2019-06-19 15:53:22 +05:30
}
void aiScientistInit2(AIEntity *e) {
2019-06-30 03:38:45 +05:30
e->draw = g_hdb->_ai->getStandFrameDir(e);
2019-06-19 15:53:22 +05:30
}
void aiSlugAttackAction(AIEntity *e) {
warning("STUB: AI: aiSlugAttackAction required");
}
void aiSlugAttackDraw(AIEntity *e, int mx, int my) {
warning("STUB: AI: aiSlugAttackDraw required");
}
void aiSlugAttackInit(AIEntity *e) {
warning("STUB: AI: aiSlugAttackInit required");
}
void aiSlugAttackInit2(AIEntity *e) {
warning("STUB: AI: aiSlugAttackInit2 required");
}
void aiDeadWorkerInit(AIEntity *e) {
}
void aiDeadWorkerInit2(AIEntity *e) {
2019-06-30 03:38:45 +05:30
e->draw = e->standdownGfx[0];
2019-06-19 15:53:22 +05:30
}
void aiWorkerInit(AIEntity *e) {
2019-06-30 03:38:45 +05:30
if (e->value1)
e->aiAction = aiGenericAction;
e->moveSpeed = kPlayerMoveSpeed >> 1;
2019-06-19 15:53:22 +05:30
}
void aiWorkerInit2(AIEntity *e) {
2019-06-30 03:38:45 +05:30
e->draw = g_hdb->_ai->getStandFrameDir(e);
2019-06-19 15:53:22 +05:30
}
void aiAccountantInit(AIEntity *e) {
}
void aiAccountantInit2(AIEntity *e) {
2019-06-30 03:38:45 +05:30
e->draw = g_hdb->_ai->getStandFrameDir(e);
2019-06-19 15:53:22 +05:30
}
void aiFrogStatueInit(AIEntity *e) {
warning("STUB: AI: aiFrogStatueInit required");
}
void aiFrogStatueInit2(AIEntity *e) {
warning("STUB: AI: aiFrogStatueInit2 required");
}
void aiFrogStatueAction(AIEntity *e) {
warning("STUB: AI: aiFrogStatueAction required");
}
void aiRoboStunnerAction(AIEntity *e) {
warning("STUB: AI: aiRoboStunnerAction required");
}
void aiRoboStunnerInit(AIEntity *e) {
warning("STUB: AI: aiRoboStunnerInit required");
}
void aiRoboStunnerInit2(AIEntity *e) {
warning("STUB: AI: aiRoboStunnerInit2 required");
}
void aiClubInit(AIEntity *e) {
warning("STUB: AI: aiClubInit required");
}
void aiClubInit2(AIEntity *e) {
warning("STUB: AI: aiClubInit2 required");
}
void aiSlugSlingerInit(AIEntity *e) {
warning("STUB: AI: aiSlugSlingerInit required");
}
void aiSlugSlingerInit2(AIEntity *e) {
warning("STUB: AI: aiSlugSlingerInit2 required");
}
void aiLaserAction(AIEntity *e) {
warning("STUB: AI: aiLaserAction required");
}
void aiLaserDraw(AIEntity *e, int mx, int my) {
warning("STUB: AI: aiLaserDraw required");
}
void aiDiverterAction(AIEntity *e) {
warning("STUB: AI: aiDiverterAction required");
}
void aiDiverterDraw(AIEntity *e, int mx, int my) {
warning("STUB: AI: aiDiverterDraw required");
}
void aiMeerkatDraw(AIEntity *e, int mx, int my) {
warning("STUB: AI: aiMeerkatDraw required");
}
void aiMeerkatAction(AIEntity *e) {
warning("STUB: AI: aiMeerkatAction required");
}
void aiMeerkatLookAround(AIEntity *e) {
warning("STUB: AI: aiMeerkatLookAround required");
}
void aiFatFrogAction(AIEntity *e) {
warning("STUB: AI: aiFatFrogAction required");
}
void aiFatFrogTongueDraw(AIEntity *e, int mx, int my) {
warning("STUB: AI: aiFatFrogTongueDraw required");
}
void aiGoodFairyAction(AIEntity *e) {
warning("STUB: AI: aiGoodFairyAction required");
}
void aiBadFairyAction(AIEntity *e) {
warning("STUB: AI: aiBadFairyAction required");
}
void aiGatePuddleAction(AIEntity *e) {
warning("STUB: AI: aiGatePuddleAction required");
}
void aiIcePuffSnowballAction(AIEntity *e) {
warning("STUB: AI: aiIcePuffSnowballAction required");
}
void aiIcePuffSnowballDraw(AIEntity *e, int mx, int my) {
warning("STUB: AI: aiIcePuffSnowballDraw required");
}
void aiIcePuffAction(AIEntity *e) {
warning("STUB: AI: aiIcePuffAction required");
}
void aiBuzzflyAction(AIEntity *e) {
warning("STUB: AI: aiBuzzflyAction required");
}
void aiDragonAction(AIEntity *e) {
warning("STUB: AI: aiDragonAction required");
}
void aiDragonDraw(AIEntity *e, int mx, int my) {
warning("STUB: AI: aiDragonDraw required");
}
void aiListenBotInit(AIEntity *e) {
warning("STUB: AI: aiListenBotInit required");
}
void aiListenBotInit2(AIEntity *e) {
warning("STUB: AI: aiListenBotInit2 required");
}
void aiLaserInit(AIEntity *e) {
warning("STUB: AI: aiLaserInit required");
}
void aiLaserInit2(AIEntity *e) {
warning("STUB: AI: aiLaserInit2 required");
}
void aiDiverterInit(AIEntity *e) {
warning("STUB: AI: aiDiverterInit required");
}
void aiDiverterInit2(AIEntity *e) {
warning("STUB: AI: aiDiverterInit2 required");
}
void aiMeerkatInit(AIEntity *e) {
warning("STUB: AI: aiMeerkatInit required");
}
void aiMeerkatInit2(AIEntity *e) {
warning("STUB: AI: aiMeerkatInit2 required");
}
void aiFatFrogInit(AIEntity *e) {
warning("STUB: AI: aiFatFrogInit required");
}
void aiFatFrogInit2(AIEntity *e) {
warning("STUB: AI: aiFatFrogInit2 required");
}
void aiGoodFairyInit(AIEntity *e) {
warning("STUB: AI: aiGoodFairyInit required");
}
void aiGoodFairyInit2(AIEntity *e) {
warning("STUB: AI: aiGoodFairyInit2 required");
}
void aiGoodFairyMoveaway(AIEntity *e) {
warning("STUB: AI: aiGoodFairyMoveaway required");
}
void aiBadFairyInit(AIEntity *e) {
warning("STUB: AI: aiBadFairyInit required");
}
void aiBadFairyInit2(AIEntity *e) {
warning("STUB: AI: aiBadFairyInit2 required");
}
void aiGatePuddleInit(AIEntity *e) {
warning("STUB: AI: aiGatePuddleInit required");
}
void aiGatePuddleInit2(AIEntity *e) {
warning("STUB: AI: aiGatePuddleInit2 required");
}
void aiIcePuffInit(AIEntity *e) {
warning("STUB: AI: aiIcePuffInit required");
}
void aiIcePuffInit2(AIEntity *e) {
warning("STUB: AI: aiIcePuffInit2 required");
}
void aiBuzzflyInit(AIEntity *e) {
warning("STUB: AI: aiBuzzflyInit required");
}
void aiBuzzflyInit2(AIEntity *e) {
warning("STUB: AI: aiBuzzflyInit2 required");
}
void aiDragonInit(AIEntity *e) {
warning("STUB: AI: aiDragonInit required");
}
void aiDragonInit2(AIEntity *e) {
warning("STUB: AI: aiDragonInit2 required");
}
void aiDragonWake(AIEntity *e) {
warning("STUB: AI: aiDragonWake required");
}
void aiDragonUse(AIEntity *e) {
warning("STUB: AI: aiDragonUse required");
}
void aiEnvelopeGreenInit(AIEntity *e) {
warning("STUB: AI: aiEnvelopeGreenInit required");
}
void aiEnvelopeGreenInit2(AIEntity *e) {
warning("STUB: AI: aiEnvelopeGreenInit2 required");
}
void aiGemBlueInit(AIEntity *e) {
warning("STUB: AI: aiGemBlueInit required");
}
void aiGemBlueInit2(AIEntity *e) {
warning("STUB: AI: aiGemBlueInit2 required");
}
void aiGemRedInit(AIEntity *e) {
warning("STUB: AI: aiGemRedInit required");
}
void aiGemRedInit2(AIEntity *e) {
warning("STUB: AI: aiGemRedInit2 required");
}
void aiGemGreenInit(AIEntity *e) {
warning("STUB: AI: aiGemGreenInit required");
}
void aiGemGreenInit2(AIEntity *e) {
warning("STUB: AI: aiGemGreenInit2 required");
}
void aiTeaCupInit(AIEntity *e) {
warning("STUB: AI: aiTeaCupInit required");
}
void aiTeaCupInit2(AIEntity *e) {
warning("STUB: AI: aiTeaCupInit2 required");
}
void aiCookieInit(AIEntity *e) {
warning("STUB: AI: aiCookieInit required");
}
void aiCookieInit2(AIEntity *e) {
warning("STUB: AI: aiCookieInit2 required");
}
void aiBurgerInit(AIEntity *e) {
warning("STUB: AI: aiBurgerInit required");
}
void aiBurgerInit2(AIEntity *e) {
warning("STUB: AI: aiBurgerInit2 required");
}
void aiBookInit(AIEntity *e) {
warning("STUB: AI: aiBookInit required");
}
void aiBookInit2(AIEntity *e) {
warning("STUB: AI: aiBookInit2 required");
}
void aiClipboardInit(AIEntity *e) {
warning("STUB: AI: aiClipboardInit required");
}
void aiClipboardInit2(AIEntity *e) {
warning("STUB: AI: aiClipboardInit2 required");
}
void aiNoteInit(AIEntity *e) {
warning("STUB: AI: aiNoteInit required");
}
void aiNoteInit2(AIEntity *e) {
warning("STUB: AI: aiNoteInit2 required");
}
void aiKeycardWhiteInit(AIEntity *e) {
warning("STUB: AI: aiKeycardWhiteInit required");
}
void aiKeycardWhiteInit2(AIEntity *e) {
warning("STUB: AI: aiKeycardWhiteInit2 required");
}
void aiKeycardBlueInit(AIEntity *e) {
warning("STUB: AI: aiKeycardBlueInit required");
}
void aiKeycardBlueInit2(AIEntity *e) {
warning("STUB: AI: aiKeycardBlueInit2 required");
}
void aiKeycardRedInit(AIEntity *e) {
warning("STUB: AI: aiKeycardRedInit required");
}
void aiKeycardRedInit2(AIEntity *e) {
warning("STUB: AI: aiKeycardRedInit2 required");
}
void aiKeycardGreenInit(AIEntity *e) {
warning("STUB: AI: aiKeycardGreenInit required");
}
void aiKeycardGreenInit2(AIEntity *e) {
warning("STUB: AI: aiKeycardGreenInit2 required");
}
void aiKeycardPurpleInit(AIEntity *e) {
warning("STUB: AI: aiKeycardPurpleInit required");
}
void aiKeycardPurpleInit2(AIEntity *e) {
warning("STUB: AI: aiKeycardPurpleInit2 required");
}
void aiKeycardBlackInit(AIEntity *e) {
warning("STUB: AI: aiKeycardBlackInit required");
}
void aiKeycardBlackInit2(AIEntity *e) {
warning("STUB: AI: aiKeycardBlackInit2 required");
}
void aiSeedInit(AIEntity *e) {
warning("STUB: AI: aiSeedInit required");
}
void aiSeedInit2(AIEntity *e) {
warning("STUB: AI: aiSeedInit2 required");
}
void aiSodaInit(AIEntity *e) {
warning("STUB: AI: aiSodaInit required");
}
void aiSodaInit2(AIEntity *e) {
warning("STUB: AI: aiSodaInit2 required");
}
void aiDollyTool1Init(AIEntity *e) {
warning("STUB: AI: aiDollyTool1Init required");
}
void aiDollyTool1Init2(AIEntity *e) {
warning("STUB: AI: aiDollyTool1Init2 required");
}
void aiDollyTool2Init(AIEntity *e) {
warning("STUB: AI: aiDollyTool2Init required");
}
void aiDollyTool2Init2(AIEntity *e) {
warning("STUB: AI: aiDollyTool2Init2 required");
}
void aiDollyTool3Init(AIEntity *e) {
warning("STUB: AI: aiDollyTool3Init required");
}
void aiDollyTool3Init2(AIEntity *e) {
warning("STUB: AI: aiDollyTool3Init2 required");
}
void aiDollyTool4Init(AIEntity *e) {
warning("STUB: AI: aiDollyTool4Init required");
}
void aiDollyTool4Init2(AIEntity *e) {
warning("STUB: AI: aiDollyTool4Init2 required");
}
void aiRouterInit(AIEntity *e) {
warning("STUB: AI: aiRouterInit required");
}
void aiRouterInit2(AIEntity *e) {
warning("STUB: AI: aiRouterInit2 required");
}
void aiSlicerInit(AIEntity *e) {
warning("STUB: AI: aiSlicerInit required");
}
void aiSlicerInit2(AIEntity *e) {
warning("STUB: AI: aiSlicerInit2 required");
}
void aiPackageInit(AIEntity *e) {
warning("STUB: AI: aiPackageInit required");
}
void aiPackageInit2(AIEntity *e) {
warning("STUB: AI: aiPackageInit2 required");
}
void aiMagicEggAction(AIEntity *e) {
warning("STUB: AI: aiMagicEggAction required");
}
void aiMagicEggInit(AIEntity *e) {
warning("STUB: AI: aiMagicEggInit required");
}
void aiMagicEggInit2(AIEntity *e) {
warning("STUB: AI: aiMagicEggInit2 required");
}
void aiMagicEggUse(AIEntity *e) {
warning("STUB: AI: aiMagicEggUse required");
}
void aiIceBlockAction(AIEntity *e) {
warning("STUB: AI: aiIceBlockAction required");
}
void aiIceBlockInit(AIEntity *e) {
warning("STUB: AI: aiIceBlockInit required");
}
void aiIceBlockInit2(AIEntity *e) {
warning("STUB: AI: aiIceBlockInit2 required");
}
void aiCabKeyInit(AIEntity *e) {
warning("STUB: AI: aiCabKeyInit required");
}
void aiCabKeyInit2(AIEntity *e) {
warning("STUB: AI: aiCabKeyInit2 required");
}
void aiItemChickenInit(AIEntity *e) {
warning("STUB: AI: aiItemChickenInit required");
}
void aiItemChickenInit2(AIEntity *e) {
warning("STUB: AI: aiItemChickenInit2 required");
}
void aiPdaInit(AIEntity *e) {
warning("STUB: AI: aiPdaInit required");
}
void aiPdaInit2(AIEntity *e) {
warning("STUB: AI: aiPdaInit2 required");
}
void aiCellUse(AIEntity *e) {
warning("STUB: AI: aiCellUse required");
}
void aiCellInit2(AIEntity *e) {
warning("STUB: AI: aiCellInit2 required");
}
void aiCellInit(AIEntity *e) {
warning("STUB: AI: aiCellInit required");
}
void aiEnvelopeWhiteInit(AIEntity *e) {
warning("STUB: AI: aiEnvelopeWhiteInit required");
}
void aiEnvelopeWhiteInit2(AIEntity *e) {
warning("STUB: AI: aiEnvelopeWhiteInit2 required");
}
void aiEnvelopeBlueInit(AIEntity *e) {
warning("STUB: AI: aiEnvelopeBlueInit required");
}
void aiEnvelopeBlueInit2(AIEntity *e) {
warning("STUB: AI: aiEnvelopeBlueInit2 required");
}
void aiEnvelopeRedInit(AIEntity *e) {
warning("STUB: AI: aiEnvelopeRedInit required");
}
void aiEnvelopeRedInit2(AIEntity *e) {
warning("STUB: AI: aiEnvelopeRedInit2 required");
}
void aiTransceiverInit(AIEntity *e) {
warning("STUB: AI: aiTransceiverInit required");
}
void aiTransceiverInit2(AIEntity *e) {
warning("STUB: AI: aiTransceiverInit2 required");
}
void aiTransceiverAction(AIEntity *e) {
warning("STUB: AI: aiTransceiverAction required");
}
void aiTransceiverUse(AIEntity *e) {
warning("STUB: AI: aiTransceiverUse required");
}
void aiMonkeystoneInit(AIEntity *e) {
warning("STUB: AI: aiMonkeystoneInit required");
}
void aiMonkeystoneAction(AIEntity *e) {
warning("STUB: AI: aiMonkeystoneAction required");
}
void aiMonkeystoneInit2(AIEntity *e) {
warning("STUB: AI: aiMonkeystoneInit2 required");
}
void aiMonkeystoneUse(AIEntity *e) {
warning("STUB: AI: aiMonkeystoneUse required");
}
void aiMonkeystoneUse2(AIEntity *e) {
warning("STUB: AI: aiMonkeystoneUse2 required");
}
void aiGemAction(AIEntity *e) {
warning("STUB: AI: aiGemAction required");
}
void aiGemAction2(AIEntity *e) {
warning("STUB: AI: aiGemAction2 required");
}
void aiGemWhiteInit(AIEntity *e) {
warning("STUB: AI: aiGemWhiteInit required");
}
void aiGemWhiteInit2(AIEntity *e) {
warning("STUB: AI: aiGemWhiteInit2 required");
}
void aiGooCupUse(AIEntity *e) {
warning("STUB: AI: aiGooCupUse required");
}
void aiGooCupInit(AIEntity *e) {
warning("STUB: AI: aiGooCupInit required");
}
void aiGooCupInit2(AIEntity *e) {
warning("STUB: AI: aiGooCupInit2 required");
}
void aiVortexianAction(AIEntity *e) {
warning("STUB: AI: aiVortexianAction required");
}
void aiVortexianUse(AIEntity *e) {
warning("STUB: AI: aiVortexianUse required");
}
void aiVortexianInit(AIEntity *e) {
warning("STUB: AI: aiVortexianInit required");
}
void aiVortexianInit2(AIEntity *e) {
warning("STUB: AI: aiVortexianInit2 required");
}
void aiNoneInit(AIEntity *e) {
warning("STUB: AI: aiNoneInit required");
}
void aiNoneInit2(AIEntity *e) {
warning("STUB: AI: aiNoneInit2 required");
}
void callbackDoorOpenClose(int x, int y) {
warning("STUB: AI: callbackDoorOpenClose required");
}
// Utility Functions
void aiAnimateStanddown(AIEntity *e, int speed) {
if (e->value2-- > 0)
return;
e->value2 = speed;
if (e->type == AI_GUY && e->animFrame > 0)
e->value2 = 0;
e->draw = e->standdownGfx[e->animFrame];
e->animFrame++;
if (e->animFrame >= e->standdownFrames)
e->animFrame = 0;
2019-06-19 15:53:22 +05:30
}
void aiGenericAction(AIEntity *e) {
if (!e->goalX)
g_hdb->_ai->findPath(e);
else if (onEvenTile(e->x, e->y))
debug(9, "STUB: Play SND_FOOTSTEPS");
g_hdb->_ai->animateEntity(e);
2019-06-19 15:53:22 +05:30
}
void aiGetItemAction(AIEntity *e) {
if (!e->onScreen)
return;
AIEntity *p = g_hdb->_ai->getPlayer();
if (abs(p->x - e->x) < 16 && abs(p->y - e->y) < 16 && e->level == p->level) {
if (e->aiUse)
e->aiUse(e);
if (e->luaFuncUse[0])
g_hdb->_lua->callFunction(e->luaFuncUse, 0);
g_hdb->_ai->getItemSound(e->type);
g_hdb->_ai->addToInventory(e);
}
2019-06-19 15:53:22 +05:30
}
2019-06-19 15:55:51 +02:00
} // End of Namespace