From 92a4ff67feeb83755dcc271be65855593448eb34 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 3 Jul 2019 21:36:07 +0200 Subject: HDB: Implement cineSpawnEntity() --- engines/hdb/ai-cinematic.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'engines/hdb/ai-cinematic.cpp') diff --git a/engines/hdb/ai-cinematic.cpp b/engines/hdb/ai-cinematic.cpp index 58287a8153..d230ab3015 100644 --- a/engines/hdb/ai-cinematic.cpp +++ b/engines/hdb/ai-cinematic.cpp @@ -348,6 +348,17 @@ void AI::processCines() { complete = true; } break; + case C_SPAWNENTITY: + { + int x2, y2; + x2 = (int)_cine[i]->x2; + y2 = (int)_cine[i]->y2; + spawn((AIType)x2, (AIDir)y2, (int)_cine[i]->x, (int)_cine[i]->y, _cine[i]->title, _cine[i]->string, + _cine[i]->id, (AIDir)_cine[i]->start, (int)_cine[i]->end, (int)_cine[i]->delay, (int)_cine[i]->speed, 1); + complete = true; + break; + } + break; case C_CLEAR_FG: g_hdb->_map->setMapFGTileIndex((int)_cine[i]->x, (int)_cine[i]->y, -1); g_hdb->_map->removeFGTileAnimation((int)_cine[i]->x, (int)_cine[i]->y); @@ -576,6 +587,25 @@ void AI::cineEntityFace(const char *luaName, double dir) { _cine.push_back(cmd); } +void AI::cineSpawnEntity(AIType t, AIDir d, int x, int y, const char *func_init, const char *func_action, + const char *func_use, AIDir d2, int level, int value1, int value2) { + CineCommand *cmd = new CineCommand; + cmd->cmdType = C_SPAWNENTITY; + cmd->x2 = (double)t; + cmd->y2 = (double)d; + cmd->x = (double)x; + cmd->y = (double)y; + cmd->title = func_init; + cmd->string = func_action; + cmd->id = func_use; + cmd->start = (int)d2; + cmd->end = level; + cmd->delay = value1; + cmd->speed = value2; + + _cine.push_back(cmd); +} + void AI::cineDialog(const char *title, const char *string, int seconds) { CineCommand *cmd = new CineCommand; cmd->title = title; -- cgit v1.2.3