blob: e080a4df853e617abeaba5f3160cd72b2c68d849 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#include "ActorBehavior.h"
#include "public/bridge/consolevariablebridge.h"
extern "C" {
#include "variables.h"
#include "overlays/actors/ovl_En_Dnh/z_en_dnh.h"
void Player_TalkWithPlayer(PlayState* play, Actor* actor);
void func_80837B60(PlayState* play, Player* player);
s32 func_80832558(PlayState* play, Player* player, PlayerFuncD58 arg2);
}
void Rando::ActorBehavior::InitEnDnhBehavior() {
// Scripted Actors
COND_VB_SHOULD(VB_EXEC_MSG_EVENT, IS_RANDO, {
u32 cmdId = va_arg(args, u32);
Actor* actor = va_arg(args, Actor*);
MsgScript* script = va_arg(args, MsgScript*);
Player* player = GET_PLAYER(gPlayState);
static std::vector<u8> skipCmds = {};
if (actor->id != ACTOR_EN_DNH) {
return;
}
if (cmdId == MSCRIPT_CMD_BRANCH_ON_ITEM) {
*should = false;
if (!RANDO_SAVE_CHECKS[RC_TOURIST_INFORMATION_PICTOBOX].obtained) {
return;
} else {
skipCmds.clear();
skipCmds.push_back(MSCRIPT_CMD_06);
skipCmds.push_back(MSCRIPT_CMD_07);
skipCmds.push_back(MSCRIPT_CMD_12);
}
}
if (cmdId == MSCRIPT_CMD_06) { // MSCRIPT_OFFER_ITEM
func_80832558(gPlayState, player, func_80837B60);
*should = false;
skipCmds.clear();
skipCmds.push_back(MSCRIPT_CMD_07);
skipCmds.push_back(MSCRIPT_CMD_12);
return;
}
if (skipCmds.empty()) {
return;
}
if (cmdId == skipCmds[0]) {
skipCmds.erase(skipCmds.begin());
*should = false;
}
});
}
|