Skip to content

Commit

Permalink
Create some headers
Browse files Browse the repository at this point in the history
  • Loading branch information
robojumper committed Sep 11, 2024
1 parent 0ba0cc1 commit 0071898
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 99 deletions.
66 changes: 66 additions & 0 deletions include/d/tg/d_t_dowsing.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#ifndef D_T_DOWSING_H
#define D_T_DOWSING_H

#include <d/tg/d_tg.h>
#include <toBeSorted/dowsing_target.h>

class dTgDowsing_c : public dTg_c {
public:
dTgDowsing_c();
virtual ~dTgDowsing_c() {}

virtual int create() override;
virtual int doDelete() override;
virtual int actorExecute() override;
virtual int draw() override;

bool checkDowsing() const;

private:
enum DowsingOption {
TRIAL_0,
TRIAL_1,
TRIAL_2,
TRIAL_3,
PROPELLER,
WATER_BASIN,
CRYSTAL_BALL,
PUMPKIN,
NEW_PLANT_SPECIES,
PARTY_WHEEL,
ZELDA,
DOWSING_MAX
};

DowsingTarget mDowsingTarget; // 0x0FC
DowsingOption mDowsingOption; // 0x11C
u16 mUntriggerStoryFlag; // 0x120
u16 mTriggerStoryFlag; // 0x122
bool mTargetActive; // 0x124

u16 getTriggerSceneFlag() {
return params & 0xFF;
}

u16 getUntriggerSceneFlag() {
return params >> 0x8 & 0xFF;
}

DowsingOption getDowsingOption() {
return (DowsingOption)(params >> 0x10 & 0xF);
}

u32 getDowsingOptionNum() {
return mDowsingOption;
}

u16 getUntriggerStoryFlag() {
return params >> 0x14 & 0x7FF;
}

u16 getTriggerStoryFlag() {
return rotation.z.mVal & 0x7FF;
}
};

#endif
23 changes: 23 additions & 0 deletions include/d/tg/d_t_genki_dws_tgt.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef D_T_GENKI_DWS_TGT_H
#define D_T_GENKI_DWS_TGT_H

#include <d/tg/d_tg.h>
#include <toBeSorted/dowsing_target.h>

class dTgGenkiDwsTgt_c : public dTg_c {
public:
dTgGenkiDwsTgt_c() : mDowsingTarget(this, DowsingTarget::SLOT_NONE) {}
virtual ~dTgGenkiDwsTgt_c() {}

virtual int create() override;
virtual int doDelete() override;
virtual int actorExecute() override;


private:
u16 getSceneFlagFromParams();

DowsingTarget mDowsingTarget; // 0xFC
};

#endif
24 changes: 24 additions & 0 deletions include/d/tg/d_t_holy_water.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef D_T_HOLY_WATER_H
#define D_T_HOLY_WATER_H

#include <d/tg/d_tg.h>
#include <toBeSorted/dowsing_target.h>

class dTgHolyWater_c : public dTg_c {
public:
dTgHolyWater_c() : mDowsingTarget(this, DowsingTarget::SLOT_NONE) {}
virtual ~dTgHolyWater_c() {}

virtual int create() override;
virtual int doDelete() override;
virtual int actorExecute() override;
virtual int draw() override;

bool isLinkNearby();
bool dowsingActive();

private:
DowsingTarget mDowsingTarget; // 0x0FC
};

#endif
62 changes: 1 addition & 61 deletions src/REL/d/t/d_t_dowsing.cpp
Original file line number Diff line number Diff line change
@@ -1,68 +1,8 @@
#include <d/tg/d_tg.h>
#include <toBeSorted/dowsing_target.h>
#include <d/tg/d_t_dowsing.h>
#include <toBeSorted/item_story_flag_manager.h>
#include <toBeSorted/room_manager.h>
#include <toBeSorted/sceneflag_manager.h>

class dTgDowsing_c : public dTg_c {
public:
dTgDowsing_c();
virtual ~dTgDowsing_c() {}

virtual int create() override;
virtual int doDelete() override;
virtual int actorExecute() override;
virtual int draw() override;

bool checkDowsing() const;

private:
enum DowsingOption {
TRIAL_0,
TRIAL_1,
TRIAL_2,
TRIAL_3,
PROPELLER,
WATER_BASIN,
CRYSTAL_BALL,
PUMPKIN,
NEW_PLANT_SPECIES,
PARTY_WHEEL,
ZELDA,
DOWSING_MAX
};

DowsingTarget mDowsingTarget; // 0x0FC
DowsingOption mDowsingOption; // 0x11C
u16 mUntriggerStoryFlag; // 0x120
u16 mTriggerStoryFlag; // 0x122
bool mTargetActive; // 0x124

u16 getTriggerSceneFlag() {
return params & 0xFF;
}

u16 getUntriggerSceneFlag() {
return params >> 0x8 & 0xFF;
}

DowsingOption getDowsingOption() {
return (DowsingOption)(params >> 0x10 & 0xF);
}

u32 getDowsingOptionNum() {
return mDowsingOption;
}

u16 getUntriggerStoryFlag() {
return params >> 0x14 & 0x7FF;
}

u16 getTriggerStoryFlag() {
return rotation.z.mVal & 0x7FF;
}
};

SPECIAL_ACTOR_PROFILE(T_DOWSING, dTgDowsing_c, fProfile::T_DOWSING, 0x0293, 0, 0);

dTgDowsing_c::dTgDowsing_c() : mDowsingTarget(this, DowsingTarget::SLOT_NONE) {}
Expand Down
20 changes: 1 addition & 19 deletions src/REL/d/t/d_t_genki_dws_tgt.cpp
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
#include <d/tg/d_tg.h>
#include <toBeSorted/dowsing_target.h>
#include <d/tg/d_t_genki_dws_tgt.h>
#include <toBeSorted/room_manager.h>
#include <toBeSorted/sceneflag_manager.h>
#include <toBeSorted/item_story_flag_manager.h>
#include <toBeSorted/scgame.h>


class dTgGenkiDwsTgt_c : public dTg_c {
public:
dTgGenkiDwsTgt_c() : mDowsingTarget(this, DowsingTarget::SLOT_NONE) {}
virtual ~dTgGenkiDwsTgt_c() {}

virtual int create() override;
virtual int doDelete() override;
virtual int actorExecute() override;


private:
u16 getSceneFlagFromParams();

DowsingTarget mDowsingTarget; // 0xFC
};

SPECIAL_ACTOR_PROFILE(TAG_GENKI_DOWSING_TARGET, dTgGenkiDwsTgt_c, fProfile::TAG_GENKI_DOWSING_TARGET, 0x02A5, 0, 0);

int dTgGenkiDwsTgt_c::create() {
Expand Down
20 changes: 1 addition & 19 deletions src/REL/d/t/d_t_holy_water.cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
#include <d/d_player.h>
#include <d/tg/d_tg.h>
#include <toBeSorted/dowsing_target.h>

class dTgHolyWater_c : public dTg_c {
public:
dTgHolyWater_c() : mDowsingTarget(this, DowsingTarget::SLOT_NONE) {}
virtual ~dTgHolyWater_c() {}

virtual int create() override;
virtual int doDelete() override;
virtual int actorExecute() override;
virtual int draw() override;

bool isLinkNearby();
bool dowsingActive();

private:
DowsingTarget mDowsingTarget; // 0x0FC
};
#include <d/tg/d_t_holy_water.h>

SPECIAL_ACTOR_PROFILE(TAG_HOLY_WATER, dTgHolyWater_c, fProfile::TAG_HOLY_WATER, 0x0224, 0, 4);

Expand Down

0 comments on commit 0071898

Please sign in to comment.