HDB: Unstub Sound related stubs

This commit is contained in:
Nipun Garg 2019-07-26 10:16:42 +05:30 committed by Eugene Sandulenko
parent d3eacb7e0f
commit 5ba5a335a1
3 changed files with 74 additions and 11 deletions

View File

@ -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) {

View File

@ -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?

View File

@ -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);
}