aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNipun Garg2019-07-26 10:16:42 +0530
committerEugene Sandulenko2019-09-03 17:17:29 +0200
commit5ba5a335a14ba79c9aa0671f1825dad0807fee0b (patch)
tree8eb4d281d2ed0b5c606cea2e53d7bae51effd11b /engines
parentd3eacb7e0fefbd9cde5b17fcfc5727eaf0143ad5 (diff)
downloadscummvm-rg350-5ba5a335a14ba79c9aa0671f1825dad0807fee0b.tar.gz
scummvm-rg350-5ba5a335a14ba79c9aa0671f1825dad0807fee0b.tar.bz2
scummvm-rg350-5ba5a335a14ba79c9aa0671f1825dad0807fee0b.zip
HDB: Unstub Sound related stubs
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/ai-funcs.cpp73
-rw-r--r--engines/hdb/ai-player.cpp11
-rw-r--r--engines/hdb/ai.h1
3 files changed, 74 insertions, 11 deletions
diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp
index 1aee3405f4..7258fa00eb 100644
--- a/engines/hdb/ai-funcs.cpp
+++ b/engines/hdb/ai-funcs.cpp
@@ -864,11 +864,33 @@ void AI::stunEnemy(AIEntity *e, int time) {
g_hdb->_sound->playSound(SND_CHICKEN_DEATH);
// fallthrough
default:
- warning("STUB: stunEnemy: MetalOrFleshSnd");
+ g_hdb->_sound->playSound(g_hdb->_ai->metalOrFleshSND(e));
break;
}
}
+int AI::metalOrFleshSND(AIEntity *e) {
+ switch (e->type) {
+ case AI_OMNIBOT:
+ case AI_TURNBOT:
+ case AI_SHOCKBOT:
+ case AI_RIGHTBOT:
+ case AI_PUSHBOT:
+ case AI_LISTENBOT:
+ case AI_MAINTBOT:
+ return SND_CLUB_HIT_METAL;
+ case AI_DEADEYE:
+ case AI_MEERKAT:
+ case AI_FATFROG:
+ case AI_GOODFAIRY:
+ case AI_BADFAIRY:
+ case AI_ICEPUFF:
+ case AI_BUZZFLY:
+ default:
+ return SND_CLUB_HIT_FLESH;
+ }
+}
+
/*
Note from original:
Moves the entity along toward its goal, sets current frame to draw
@@ -2162,7 +2184,54 @@ bool AI::walkThroughEnt(AIType type) {
// Play special sound for every item you get
void AI::getItemSound(AIType type) {
- warning("STUB: AI: getItemSound required");
+ switch (type) {
+ case ITEM_GOO_CUP: g_hdb->_sound->playSound(SND_GET_GOO);
+ break;
+ case ITEM_GEM_WHITE:
+ case ITEM_GEM_BLUE:
+ case ITEM_GEM_RED:
+ case ITEM_GEM_GREEN:
+ g_hdb->_sound->playSound(SND_GET_GEM);
+ break;
+ case ITEM_CLUB:
+ g_hdb->_sound->playSound(SND_GET_CLUB);
+ break;
+ case ITEM_SLUGSLINGER:
+ g_hdb->_sound->playSound(SND_GET_SLUG);
+ break;
+ case ITEM_ROBOSTUNNER:
+ g_hdb->_sound->playSound(SND_GET_STUNNER);
+ break;
+ case ITEM_CELL:
+ case ITEM_TRANSCEIVER:
+ case ITEM_TEACUP:
+ case ITEM_COOKIE:
+ case ITEM_BURGER:
+ case ITEM_PDA:
+ case ITEM_BOOK:
+ case ITEM_CLIPBOARD:
+ case ITEM_NOTE:
+ case ITEM_CABKEY:
+ case ITEM_DOLLYTOOL1:
+ case ITEM_DOLLYTOOL2:
+ case ITEM_DOLLYTOOL3:
+ case ITEM_DOLLYTOOL4:
+ case ITEM_SEED:
+ case ITEM_SODA:
+ case ITEM_ROUTER:
+ case ITEM_SLICER:
+ case ITEM_CHICKEN:
+ case ITEM_PACKAGE:
+ case ITEM_ENV_RED:
+ case ITEM_ENV_BLUE:
+ case ITEM_ENV_GREEN:
+ if (g_hdb->_sound->getVoiceStatus())
+ g_hdb->_sound->playVoice(GUY_GOT_SOMETHING, 1);
+ else
+ g_hdb->_sound->playSound(SND_GET_THING);
+ break;
+ default: g_hdb->_sound->playSound(SND_GET_THING);
+ }
}
void AI::lookAtEntity(AIEntity *e) {
diff --git a/engines/hdb/ai-player.cpp b/engines/hdb/ai-player.cpp
index aef00e1eb6..4e70436b23 100644
--- a/engines/hdb/ai-player.cpp
+++ b/engines/hdb/ai-player.cpp
@@ -156,7 +156,6 @@ void aiPlayerAction(AIEntity *e) {
g_hdb->_ai->stunEnemy(hit, 8);
break;
default:
- debug(9, "STUB: stunEnemy: Play sound");
break;
}
@@ -188,7 +187,6 @@ void aiPlayerAction(AIEntity *e) {
g_hdb->_ai->stunEnemy(hit, 8);
break;
default:
- debug(9, "STUB: stunEnemy: Play sound");
break;
}
}
@@ -209,7 +207,6 @@ void aiPlayerAction(AIEntity *e) {
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:
- debug(9, "STUB: stunEnemy: Play sound");
break;
}
e->animDelay = 1;
@@ -230,7 +227,6 @@ void aiPlayerAction(AIEntity *e) {
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:
- debug(9, "STUB: stunEnemy: Play sound");
break;
}
// Whack!
@@ -241,7 +237,6 @@ void aiPlayerAction(AIEntity *e) {
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;
}
@@ -275,7 +270,7 @@ void aiPlayerAction(AIEntity *e) {
case AI_SHOCKBOT:
case AI_GATEPUDDLE:
g_hdb->_ai->stunEnemy(hit, 2);
- warning("STUB: Play MetalorFlesh SND");
+ g_hdb->_sound->playSound(g_hdb->_ai->metalOrFleshSND(hit));
break;
default:
break;
@@ -291,7 +286,6 @@ void aiPlayerAction(AIEntity *e) {
case STATE_ATK_CLUB_LEFT: e->draw = e->standleftGfx[0]; break;
case STATE_ATK_CLUB_RIGHT: e->draw = e->standrightGfx[0]; break;
default:
- debug(9, "STUB: stunEnemy: Play sound");
break;
}
g_hdb->_ai->setPlayerInvisible(false);
@@ -367,7 +361,6 @@ void aiPlayerAction(AIEntity *e) {
}
return;
default:
- debug(9, "STUB: stunEnemy: Play sound");
break;
}
@@ -956,7 +949,7 @@ void aiSlugAttackAction(AIEntity *e) {
result = (e->level == 1 ? (bg_flags & (kFlagSolid)) : !(fg_flags & kFlagGrating) && (bg_flags & (kFlagSolid)));
if (hit) {
g_hdb->_sound->playSound(SND_SLUG_HIT);
- warning("STUB: Play MetalOrFleshSnd");
+ g_hdb->_sound->playSound(g_hdb->_ai->metalOrFleshSND(hit));
switch (hit->type) {
case AI_MEERKAT:
if (hit->sequence > 2) { // out of the ground?
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h
index dfa22bbda7..6bf3af88b2 100644
--- a/engines/hdb/ai.h
+++ b/engines/hdb/ai.h
@@ -832,6 +832,7 @@ public:
void initAllEnts();
void killPlayer(Death method);
void stunEnemy(AIEntity *e, int time);
+ int metalOrFleshSND(AIEntity *e);
int tileDistance(AIEntity *e1, AIEntity *e2) {
return abs(e1->tileX - e2->tileX) + abs(e1->tileY - e2->tileY);
}