1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-08 07:20:16 +00:00

More actor cleanup Part 3 (#118)

* Add custom types for actor specific functions (like actions)

* Add a forward struct declaration for all other actors
This commit is contained in:
Roman971 2020-05-06 00:53:15 +02:00 committed by GitHub
parent f114df8929
commit 1425678d8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
477 changed files with 1817 additions and 792 deletions

View file

@ -104,7 +104,7 @@ void EnMs_Wait(EnMs* this, GlobalContext* globalCtx) {
unkAngle = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
EnMs_SetOfferText(&this->actor, globalCtx);
if (func_8002F194(&this->actor, globalCtx) != 0) { // if talk is initiated
this->actionFunc = &EnMs_Talk;
this->actionFunc = EnMs_Talk;
return;
}
@ -119,7 +119,7 @@ void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) {
dialogState = func_8010BDBC(&globalCtx->msgCtx);
if (dialogState != 4) {
if ((dialogState == 6) && (func_80106BC8(globalCtx) != 0)) { // advanced final textbox
this->actionFunc = &EnMs_Wait;
this->actionFunc = EnMs_Wait;
}
} else {
if (func_80106BC8(globalCtx) != 0) {
@ -130,7 +130,7 @@ void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) {
return;
}
func_8002F434(&this->actor, globalCtx, GI_BEAN, 90.0f, 10.0f);
this->actionFunc = &EnMs_Sell;
this->actionFunc = EnMs_Sell;
return;
case 1: // no
func_8010B720(globalCtx, 0x4068);
@ -145,7 +145,7 @@ void EnMs_Sell(EnMs* this, GlobalContext* globalCtx) {
if (func_8002F410(&this->actor, globalCtx) != 0) { // if attached is set
Rupees_ChangeBy(-prices[BEANS_BOUGHT]);
this->actor.attachedA = NULL;
this->actionFunc = &EnMs_TalkAfterBuy;
this->actionFunc = EnMs_TalkAfterBuy;
return;
}
func_8002F434(&this->actor, globalCtx, GI_BEAN, 90.0f, 10.0f);
@ -155,7 +155,7 @@ void EnMs_TalkAfterBuy(EnMs* this, GlobalContext* globalCtx) {
// if dialog state is 6 and player responded to textbox
if ((func_8010BDBC(&globalCtx->msgCtx)) == 6 && (func_80106BC8(globalCtx) != 0)) {
func_8010B720(globalCtx, 0x406C);
this->actionFunc = &EnMs_Talk;
this->actionFunc = EnMs_Talk;
}
}

View file

@ -4,14 +4,18 @@
#include <ultra64.h>
#include <global.h>
typedef struct {
struct EnMs;
typedef void (*EnMsActionFunc)(struct EnMs*, GlobalContext*);
typedef struct EnMs {
/* 0x0000 */ Actor actor;
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ UNK_PTR unkSkelAnimeStruct;
/* 0x0194 */ char unk_194[0x32];
/* 0x01C6 */ s16 unk_1C6;
/* 0x01C8 */ char unk_1C8[0x34];
/* 0x01FC */ ActorFunc actionFunc;
/* 0x01FC */ EnMsActionFunc actionFunc;
/* 0x0200 */ ColliderCylinder collider;
/* 0x024C */ s16 activeTimer;
} EnMs; // size = 0x0250