-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cc0b23
commit f6bba2a
Showing
10 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,40 @@ | ||
#include "z3D/z3D.h" | ||
#include "fishing.h" | ||
#include "models.h" | ||
#include "settings.h" | ||
|
||
u32 isFishing(void) { | ||
return gSaveContext.equips.buttonItems[0] == ITEM_FISHING_POLE && gGlobalContext->sceneNum == 73; | ||
} | ||
|
||
static s32 rewardObtained(void) { | ||
u8 obtainedRewardFlag = gSaveContext.linkAge == AGE_ADULT ? 0x8 : 0x4; | ||
return gSaveContext.fishingStats.flags & obtainedRewardFlag; | ||
} | ||
|
||
void Fishing_rInit(Actor* thisx, GlobalContext* globalCtx) { | ||
u16 baseItemId = gSaveContext.linkAge == AGE_ADULT ? GI_SCALE_GOLD : GI_HEART_PIECE; | ||
Fishing_Init(thisx, globalCtx); | ||
if (gSettingsContext.fishingHints && thisx->params == EN_FISH_AQUARIUM && !rewardObtained()) { | ||
Model_SpawnByActor(thisx, globalCtx, baseItemId); | ||
} | ||
} | ||
|
||
void Fishing_rUpdateFish(Actor* thisx, GlobalContext* globalCtx) { | ||
Fishing_UpdateFish(thisx, globalCtx); | ||
if (gSettingsContext.fishingHints && thisx->params == EN_FISH_AQUARIUM && !rewardObtained()) { | ||
thisx->textId = 0x40AE; // custom text, overrides vanilla "pond owner" record text | ||
} | ||
} | ||
|
||
void Fishing_rDrawFish(Actor* thisx, GlobalContext* globalCtx) { | ||
static s16 sPrizeRotation = 0x8000; // used because shape.rot.y is reset between update cycles | ||
|
||
if (gSettingsContext.fishingHints && thisx->params == EN_FISH_AQUARIUM && !rewardObtained()) { | ||
sPrizeRotation += 0x100; | ||
thisx->shape.rot.y = sPrizeRotation; | ||
Model_DrawByActor(thisx); | ||
} else { | ||
Fishing_DrawFish(thisx, globalCtx); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef _FISHING_H_ | ||
#define _FISHING_H_ | ||
|
||
#include "z3D/z3D.h" | ||
|
||
#define Fishing_Init ((ActorFunc)0x1C0AD8) | ||
#define Fishing_UpdateFish ((ActorFunc)0x1F9ACC) | ||
#define Fishing_DrawFish ((ActorFunc)0x1F98B4) | ||
|
||
#define EN_FISH_AQUARIUM 200 // param for record fish in tank. | ||
|
||
void Fishing_rInit(Actor* thisx, GlobalContext* globalCtx); | ||
void Fishing_rUpdateFish(Actor* thisx, GlobalContext* globalCtx); | ||
void Fishing_rDrawFish(Actor* thisx, GlobalContext* globalCtx); | ||
|
||
#endif //_FISHING_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters