1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-11 01:10:33 +00:00

Document/fix Player.bodyPartsPos usage (#1141)

* Document/fix `Player#bodyPartsPos` usage

* `distFromLinksHead` -> `distFromPlayerHat`

* Comment on `bodyPartsPos[-1]`

* Run formatter

* Use `PLAYER_BODYPART_MAX` more

* Use hex for `PlayerBodyPart` enum comments
This commit is contained in:
Dragorn421 2022-03-09 01:50:27 +01:00 committed by GitHub
parent c73053db6f
commit 5cadc5df8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 166 additions and 120 deletions

View file

@ -169,7 +169,7 @@ void EffectSsFhgFlash_UpdateLightBall(GlobalContext* globalCtx, u32 index, Effec
}
void EffectSsFhgFlash_UpdateShock(GlobalContext* globalCtx, u32 index, EffectSs* this) {
s16 randBodypart;
s16 randBodyPart;
Player* player;
BossGanondrof* phantomGanon;
s16 rand;
@ -179,16 +179,16 @@ void EffectSsFhgFlash_UpdateShock(GlobalContext* globalCtx, u32 index, EffectSs*
if (this->rParam == FHGFLASH_SHOCK_PLAYER) {
player = GET_PLAYER(globalCtx);
randBodypart = Rand_ZeroFloat(17.9f);
this->pos.x = player->bodyPartsPos[randBodypart].x + Rand_CenteredFloat(10.0f);
this->pos.y = player->bodyPartsPos[randBodypart].y + Rand_CenteredFloat(15.0f);
this->pos.z = player->bodyPartsPos[randBodypart].z + Rand_CenteredFloat(10.0f);
randBodyPart = Rand_ZeroFloat(PLAYER_BODYPART_MAX - 0.1f);
this->pos.x = player->bodyPartsPos[randBodyPart].x + Rand_CenteredFloat(10.0f);
this->pos.y = player->bodyPartsPos[randBodyPart].y + Rand_CenteredFloat(15.0f);
this->pos.z = player->bodyPartsPos[randBodyPart].z + Rand_CenteredFloat(10.0f);
} else if (this->rParam == FHGFLASH_SHOCK_PG) {
phantomGanon = (BossGanondrof*)this->actor;
randBodypart = Rand_ZeroFloat(23.9f);
this->pos.x = phantomGanon->bodyPartsPos[randBodypart].x + Rand_CenteredFloat(15.0f);
this->pos.y = phantomGanon->bodyPartsPos[randBodypart].y + Rand_CenteredFloat(20.0f);
this->pos.z = phantomGanon->bodyPartsPos[randBodypart].z + Rand_CenteredFloat(15.0f);
randBodyPart = Rand_ZeroFloat(23.9f);
this->pos.x = phantomGanon->bodyPartsPos[randBodyPart].x + Rand_CenteredFloat(15.0f);
this->pos.y = phantomGanon->bodyPartsPos[randBodyPart].y + Rand_CenteredFloat(20.0f);
this->pos.z = phantomGanon->bodyPartsPos[randBodyPart].z + Rand_CenteredFloat(15.0f);
}
if (this->life < 100) {