MCPcopy Create free account
hub / github.com/diasurgical/devilution / MAI_Garbud

Function MAI_Garbud

Source/monster.cpp:4185–4229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4183}
4184
4185void MAI_Garbud(int i)
4186{
4187 int _mx, _my, md;
4188 MonsterStruct *Monst;
4189
4190 if ((DWORD)i >= MAXMONSTERS)
4191 app_fatal("MAI_Garbud: Invalid monster %d", i);
4192
4193 Monst = &monster[i];
4194 if (Monst->_mmode != MM_STAND) {
4195 return;
4196 }
4197
4198 _mx = Monst->_mx;
4199 _my = Monst->_my;
4200 md = M_GetDir(i);
4201
4202 if (Monst->mtalkmsg < QUEST_GARBUD4
4203 && Monst->mtalkmsg > QUEST_DOOM10
4204 && !(dFlags[_mx][_my] & BFLAG_VISIBLE)
4205 && Monst->_mgoal == MGOAL_TALKING) {
4206 Monst->_mgoal = MGOAL_INQUIRING;
4207 Monst->mtalkmsg++;
4208 }
4209
4210 if (dFlags[_mx][_my] & BFLAG_VISIBLE) {
4211#ifndef SPAWN
4212 if (Monst->mtalkmsg == QUEST_GARBUD4) {
4213 if (!effect_is_playing(USFX_GARBUD4) && Monst->_mgoal == MGOAL_TALKING) {
4214 Monst->_mgoal = MGOAL_NORMAL;
4215 Monst->_msquelch = UCHAR_MAX;
4216 Monst->mtalkmsg = 0;
4217 }
4218 }
4219#endif
4220 }
4221
4222 if (Monst->_mgoal == MGOAL_NORMAL || Monst->_mgoal == MGOAL_MOVE)
4223 MAI_Round(i, TRUE);
4224
4225 monster[i]._mdir = md;
4226
4227 if (Monst->_mmode == MM_STAND)
4228 Monst->_mAnimData = Monst->MType->Anims[MA_STAND].Data[md];
4229}
4230
4231void MAI_Zhar(int i)
4232{

Callers

nothing calls this directly

Calls 4

app_fatalFunction · 0.85
M_GetDirFunction · 0.85
effect_is_playingFunction · 0.85
MAI_RoundFunction · 0.85

Tested by

no test coverage detected