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

Actor Cleanups (#177)

* rename init chains, colchkinfo, colider inits, damage tables

* actor cleanups

* fix collider init script names

* small fixes

* ichain arg name

* change dynapoly types and names

* revert enru1 data name

* and the type

* pr suggestions
This commit is contained in:
fig02 2020-05-31 05:55:48 -04:00 committed by GitHub
parent 13a94482e5
commit 78d0883f04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
108 changed files with 786 additions and 869 deletions

View file

@ -19,7 +19,7 @@ void EnMs_SetOfferText(EnMs* this, GlobalContext* globalCtx);
void EnMs_Wait(EnMs* this, GlobalContext* globalCtx);
void EnMs_Talk(EnMs* this, GlobalContext* globalCtx);
void EnMs_Sell(EnMs* this, GlobalContext* globalCtx);
void EnMs_TalkAfterBuy(EnMs* this, GlobalContext* globalCtx);
void EnMs_TalkAfterPurchase(EnMs* this, GlobalContext* globalCtx);
const ActorInit En_Ms_InitVars = {
ACTOR_EN_MS,
@ -33,21 +33,21 @@ const ActorInit En_Ms_InitVars = {
(ActorFunc)EnMs_Draw,
};
static ColliderCylinderInit_Set3 colliderInit = {
static ColliderCylinderInit_Set3 sCylinderInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x39, COLSHAPE_CYLINDER },
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0xFFCFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
{ 22, 37, 0, { 0 } },
};
static s16 prices[] = {
static s16 sPrices[] = {
10, 20, 30, 40, 50, 60, 70, 80, 90, 100,
};
static u16 offerTextIds[] = {
static u16 sOfferTextIDs[] = {
0x405E, 0x405F, 0x4060, 0x4061, 0x4062, 0x4063, 0x4064, 0x4065, 0x4066, 0x4067,
};
static InitChainEntry initChain[] = {
static InitChainEntry sInitChain[] = {
ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE),
ICHAIN_F32(unk_4C, 500, ICHAIN_STOP),
};
@ -61,7 +61,7 @@ void EnMs_SetOfferText(EnMs* this, GlobalContext* globalCtx) {
if (BEANS_BOUGHT >= 10) {
this->actor.textId = 0x406B;
} else {
this->actor.textId = offerTextIds[BEANS_BOUGHT];
this->actor.textId = sOfferTextIDs[BEANS_BOUGHT];
}
}
}
@ -74,11 +74,11 @@ void EnMs_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_Kill(&this->actor);
return;
}
Actor_ProcessInitChain(&this->actor, initChain);
Actor_ProcessInitChain(&this->actor, sInitChain);
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06003DC0, &D_060005EC, &this->unkSkelAnimeStruct, &this->unk_1C6,
9);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder_Set3(globalCtx, &this->collider, this, &colliderInit);
Collider_SetCylinder_Set3(globalCtx, &this->collider, this, &sCylinderInit);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 35.0f);
Actor_SetScale(&this->actor, 0.015f);
@ -99,16 +99,16 @@ void EnMs_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnMs_Wait(EnMs* this, GlobalContext* globalCtx) {
s16 unkAngle;
s16 yawDiff;
unkAngle = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
yawDiff = 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;
return;
}
if ((this->actor.xzDistanceFromLink < 90.0f) && (ABS(unkAngle) < 0x2000)) { // talk range
if ((this->actor.xzDistanceFromLink < 90.0f) && (ABS(yawDiff) < 0x2000)) { // talk range
func_8002F2CC(&this->actor, globalCtx, 90.0f);
}
}
@ -125,7 +125,7 @@ void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) {
if (func_80106BC8(globalCtx) != 0) {
switch (globalCtx->msgCtx.choiceIndex) {
case 0: // yes
if (gSaveContext.rupees < prices[BEANS_BOUGHT]) {
if (gSaveContext.rupees < sPrices[BEANS_BOUGHT]) {
func_8010B720(globalCtx, 0x4069); // not enough rupees text
return;
}
@ -143,15 +143,15 @@ void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) {
void EnMs_Sell(EnMs* this, GlobalContext* globalCtx) {
if (func_8002F410(&this->actor, globalCtx) != 0) { // if attached is set
Rupees_ChangeBy(-prices[BEANS_BOUGHT]);
Rupees_ChangeBy(-sPrices[BEANS_BOUGHT]);
this->actor.attachedA = NULL;
this->actionFunc = EnMs_TalkAfterBuy;
this->actionFunc = EnMs_TalkAfterPurchase;
return;
}
func_8002F434(&this->actor, globalCtx, GI_BEAN, 90.0f, 10.0f);
}
void EnMs_TalkAfterBuy(EnMs* this, GlobalContext* globalCtx) {
void EnMs_TalkAfterPurchase(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);