blob: ee2792240f4308b7087570834295a242ec4b4a0d (
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
57
58
59
60
61
62
63
64
65
66
67
68
69
|
#include "d/t/d_t_genki_dws_tgt.h"
#include "d/d_room.h"
#include "d/d_sc_game.h"
#include "d/d_stage.h"
#include "d/flag/sceneflag_manager.h"
#include "d/flag/storyflag_manager.h"
SPECIAL_ACTOR_PROFILE(TAG_GENKI_DOWSING_TARGET, dTgGenkiDwsTgt_c, fProfile::TAG_GENKI_DOWSING_TARGET, 0x02A5, 0, 0);
int dTgGenkiDwsTgt_c::create() {
u16 batQuestActivated = StoryflagManager::sInstance->getCounterOrFlag(STORYFLAG_GRATITUDE_QUEST_STARTED);
if (batQuestActivated == 0 || !dScGame_c::GetInstance()->currentSpawnInfo.isNight()) {
return FAILED;
}
u16 flag = getSceneFlagFromParams();
if (flag < 0xFF) {
bool flagSet = SceneflagManager::sInstance->checkFlag(mRoomID, flag);
if (flagSet) {
return FAILED;
}
} else {
return FAILED;
}
int roomId_tmp = mRoomID;
if (addActorToRoom(-1)) {
mRoomID = roomId_tmp;
changeLoadedEntitiesWithSet();
} else {
return FAILED;
}
mScale.x = 1.0f;
mScale.y = 1.0f;
mScale.z = 1.0f;
static mVec3_c offset(0.0f, 25.0f, 0.0f);
mDowsingTarget.initialize(DowsingTarget::SLOT_CRYSTAL, 0, &offset, 1.0f);
return SUCCEEDED;
}
int dTgGenkiDwsTgt_c::doDelete() {
changeLoadedEntitiesNoSet();
return SUCCEEDED;
}
int dTgGenkiDwsTgt_c::actorExecute() {
bool flag = SceneflagManager::sInstance->checkFlag(mRoomID, getSceneFlagFromParams());
if (flag) {
deleteRequest();
} else {
if (dStage_c::GetInstance() != nullptr) {
dRoom_c *room = dStage_c::GetInstance()->getRoom(mRoomID);
if (room != nullptr) {
if (room->checkFlag(8)) {
mDowsingTarget.doRegister();
} else {
mDowsingTarget.doUnregister();
}
}
}
}
return SUCCEEDED;
}
u16 dTgGenkiDwsTgt_c::getSceneFlagFromParams() {
return mParams & 0xFF;
}
|