-
Notifications
You must be signed in to change notification settings - Fork 614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documet bottle using actions #2360
base: main
Are you sure you want to change the base?
Conversation
Thanks. |
Undid the |
if (sp2C >= 0) { | ||
if (sp2C == 0xC) { | ||
Player_SetupActionPreserveItemAction(play, this, Player_Action_8084EED8, 0); | ||
#define ACTION_TO_BOTTLE_ACTION(action) (action - PLAYER_IA_BOTTLE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd really prefer if this define was at top-level instead of in the middle of a function. Maybe in z64player.h? Then it could be used in Player_ActionToBottle as well.
(PS: I'm not really sure what to do about these "sub-enums" like with Player_ActionToMagicSpell and Player_ActionToMeleeWeapon too. Maybe they deserve a separate enum? I think we can figure that out later though)
(PPS: maybe it should be called ACTION_TO_BOTTLE
to match the function name?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I would prefer to handle all these in a consistent manner at some point in the future. But if we want to introduce this now I guess we can change other examples of it later.
But there are so many of these id offset situations in player.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But there are so many of these id offset situations in player.
yeah, I kinda think this is a bigger project and not too relevant to this PR (where the goal is just to name some action funcs). Could also revert ACTION_TO_BOTTLE_ACTION
here to really punt on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, I moved it to z64player.h
and used it in Player_ActionToBottle
.
I think that either this or a PlayerBottle
enum of some kind is needed since without it it's harder to understand how it chooses an action (sp2C >= ACTION_TO_BOTTLE(PLAYER_IA_BOTTLE_FISH) && sp2C <= ACTION_TO_BOTTLE(PLAYER_IA_BOTTLE_BUG)
vs sp2C >= 1 && sp2C <= 3
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not saying that it isn't helpful, but rather that this pattern is a much larger thing that needs to be handled within player. And that it makes more sense to do it separately as a larger project.
I would prefer if it was taken out temporarily, with the understanding that this enum-range pattern will be handled in the future at a larger scale.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine keeping it as-is, I just meant I didn't want to spend too much time right now trying to get it right. I don't think it'll be hard to undo later if we wanted to, and it does make the code a little clearer now IMO
Document
Player_Action_8084EAC0
asPlayer_Action_DrinkFromBottle
,Player_Action_8084EED8
asPlayer_Action_UseFairyFromBottle
, andPlayer_Action_8084EFC0
asPlayer_Action_DropActorFromBottle
.Also documents
func_8083C0E8
asPlayer_SetupIdleAndPlayIdleAnim
(could maybe be named something likePlayer_ResetToIdle
instead as that's how it's used from what I can see) as it was used inPlayer_Action_DrinkFromBottle
.