MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / OperateBookcase

Function OperateBookcase

Source/objects.cpp:3230–3257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3228}
3229
3230void OperateBookcase(Object &bookcase, bool sendmsg, bool sendLootMsg)
3231{
3232 if (bookcase._oSelFlag == 0) {
3233 return;
3234 }
3235
3236 PlaySfxLoc(IS_ISCROL, bookcase.position);
3237 bookcase._oSelFlag = 0;
3238 bookcase._oAnimFrame -= 2;
3239 SetRndSeed(bookcase._oRndSeed);
3240 CreateTypeItem(bookcase.position, false, ItemType::Misc, IMISC_BOOK, sendLootMsg, false);
3241
3242 if (Quests[Q_ZHAR].IsAvailable()) {
3243 auto &zhar = Monsters[MAX_PLRS];
3244 if (zhar.mode == MonsterMode::Stand // prevents playing the "angry" message for the second time if zhar got aggroed by losing vision and talking again
3245 && zhar.uniqueType == UniqueMonsterType::Zhar
3246 && zhar.activeForTicks == UINT8_MAX
3247 && zhar.hitPoints > 0) {
3248 zhar.talkMsg = TEXT_ZHAR2;
3249 M_StartStand(zhar, zhar.direction); // BUGFIX: first parameter in call to M_StartStand should be MAX_PLRS, not 0. (fixed)
3250 zhar.goal = MonsterGoal::Attack;
3251 if (sendmsg)
3252 zhar.mode = MonsterMode::Talk;
3253 }
3254 }
3255 if (sendmsg)
3256 NetSendCmdLoc(MyPlayerId, false, CMD_OPERATEOBJ, bookcase.position);
3257}
3258
3259void OperateDecapitatedBody(Object &corpse, bool sendmsg, bool sendLootMsg)
3260{

Callers 2

OperateObjectFunction · 0.85
SyncOpObjectFunction · 0.85

Calls 6

SetRndSeedFunction · 0.85
CreateTypeItemFunction · 0.85
M_StartStandFunction · 0.85
NetSendCmdLocFunction · 0.85
IsAvailableMethod · 0.80
PlaySfxLocFunction · 0.70

Tested by

no test coverage detected