mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-22 01:12:19 -05:00
Merge pull request #1807 from HarbourMasters/develop-zhora
zhora -> dev
This commit is contained in:
commit
a920aea8de
@ -7,8 +7,8 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
|
||||
|
||||
project(Ship LANGUAGES C CXX
|
||||
VERSION 4.0.3)
|
||||
set(PROJECT_BUILD_NAME "ZHORA DELTA" CACHE STRING "")
|
||||
VERSION 4.0.4)
|
||||
set(PROJECT_BUILD_NAME "ZHORA ECHO" CACHE STRING "")
|
||||
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "")
|
||||
|
||||
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh)
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "z64animation.h"
|
||||
#include "z64math.h"
|
||||
#include "z64collision_check.h"
|
||||
#include "soh/Enhancements/item-tables/ItemTableTypes.h"
|
||||
|
||||
#define ACTOR_NUMBER_MAX 2000
|
||||
#define INVISIBLE_ACTOR_MAX 20
|
||||
@ -291,6 +292,7 @@ typedef struct EnItem00 {
|
||||
/* 0x15C */ f32 scale;
|
||||
/* 0x160 */ ColliderCylinder collider;
|
||||
s16 ogParams;
|
||||
GetItemEntry randoGiEntry;
|
||||
} EnItem00; // size = 0x1AC
|
||||
|
||||
// Only A_OBJ_SIGNPOST_OBLONG and A_OBJ_SIGNPOST_ARROW are used in room files.
|
||||
|
@ -336,7 +336,7 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
f32 yOffset = 980.0f;
|
||||
f32 shadowScale = 6.0f;
|
||||
s32 getItemId = GI_NONE;
|
||||
GetItemEntry getItem = (GetItemEntry)GET_ITEM_NONE;
|
||||
this->randoGiEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||
s16 spawnParam8000 = this->actor.params & 0x8000;
|
||||
s32 pad1;
|
||||
|
||||
@ -431,6 +431,14 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->actor.shape.shadowAlpha = 180;
|
||||
this->actor.focus.pos = this->actor.world.pos;
|
||||
this->getItemId = GI_NONE;
|
||||
RandomizerCheck randoCheck =
|
||||
Randomizer_GetCheckFromActor(this->actor.id, globalCtx->sceneNum, this->ogParams);
|
||||
|
||||
if (gSaveContext.n64ddFlag && randoCheck != RC_UNKNOWN_CHECK) {
|
||||
this->randoGiEntry =
|
||||
Randomizer_GetItemFromKnownCheck(randoCheck, getItemId);
|
||||
this->randoGiEntry.getItemFrom = ITEM_FROM_FREESTANDING;
|
||||
}
|
||||
|
||||
if (!spawnParam8000) {
|
||||
EnItem00_SetupAction(this, func_8001DFC8);
|
||||
@ -516,12 +524,10 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
if (!Actor_HasParent(&this->actor, globalCtx)) {
|
||||
if (getItemId != GI_NONE) {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
if (!gSaveContext.n64ddFlag || this->randoGiEntry.getItemId == GI_NONE) {
|
||||
func_8002F554(&this->actor, globalCtx, getItemId);
|
||||
} else {
|
||||
getItem = Randomizer_GetItemFromActor(this->actor.id, globalCtx->sceneNum, this->ogParams, getItemId);
|
||||
getItem.getItemFrom = ITEM_FROM_FREESTANDING;
|
||||
GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, getItem);
|
||||
GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, this->randoGiEntry);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -686,10 +692,7 @@ void func_8001E5C8(EnItem00* this, GlobalContext* globalCtx) {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
func_8002F434(&this->actor, globalCtx, this->getItemId, 50.0f, 80.0f);
|
||||
} else {
|
||||
GetItemEntry getItemEntry =
|
||||
Randomizer_GetItemFromActor(this->actor.id, globalCtx->sceneNum, this->ogParams, this->getItemId);
|
||||
getItemEntry.getItemFrom = ITEM_FROM_FREESTANDING;
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, getItemEntry, 50.0f, 80.0f);
|
||||
GiveItemEntryFromActor(&this->actor, globalCtx, this->randoGiEntry, 50.0f, 80.0f);
|
||||
}
|
||||
this->unk_15A++;
|
||||
} else {
|
||||
@ -724,7 +727,6 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
s16* params;
|
||||
Actor* dynaActor;
|
||||
s32 getItemId = GI_NONE;
|
||||
GetItemEntry getItem = (GetItemEntry)GET_ITEM_NONE;
|
||||
s16 sp3A = 0;
|
||||
s16 i;
|
||||
u32* temp;
|
||||
@ -910,13 +912,11 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
params = &this->actor.params;
|
||||
|
||||
if ((getItemId != GI_NONE) && !Actor_HasParent(&this->actor, globalCtx)) {
|
||||
if (!gSaveContext.n64ddFlag) {
|
||||
if (!gSaveContext.n64ddFlag || this->randoGiEntry.getItemId == GI_NONE) {
|
||||
func_8002F554(&this->actor, globalCtx, getItemId);
|
||||
} else {
|
||||
getItem = Randomizer_GetItemFromActor(this->actor.id, globalCtx->sceneNum, this->ogParams, getItemId);
|
||||
getItemId = getItem.getItemId;
|
||||
getItem.getItemFrom = ITEM_FROM_FREESTANDING;
|
||||
GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, getItem);
|
||||
getItemId = this->randoGiEntry.getItemId;
|
||||
GiveItemEntryFromActorWithFixedRange(&this->actor, globalCtx, this->randoGiEntry);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1389,10 +1389,8 @@ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) {
|
||||
if (gSaveContext.n64ddFlag && (this->getItemId != GI_NONE || this->actor.params == ITEM00_SMALL_KEY)) {
|
||||
f32 mtxScale = 16.0f;
|
||||
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||
GetItemEntry randoGetItemEntry =
|
||||
Randomizer_GetItemFromActor(this->actor.id, globalCtx->sceneNum, this->ogParams, this->getItemId);
|
||||
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemEntry);
|
||||
GetItemEntry_Draw(globalCtx, randoGetItemEntry);
|
||||
EnItem00_CustomItemsParticles(&this->actor, globalCtx, this->randoGiEntry);
|
||||
GetItemEntry_Draw(globalCtx, this->randoGiEntry);
|
||||
} else {
|
||||
s32 texIndex = this->actor.params - 3;
|
||||
|
||||
@ -1451,10 +1449,8 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) {
|
||||
if (gSaveContext.n64ddFlag) {
|
||||
f32 mtxScale = 16.0f;
|
||||
Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY);
|
||||
GetItemEntry randoGetItemEntry =
|
||||
Randomizer_GetItemFromActor(this->actor.id, globalCtx->sceneNum, this->ogParams, GI_HEART_PIECE);
|
||||
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemEntry);
|
||||
GetItemEntry_Draw(globalCtx, randoGetItemEntry);
|
||||
EnItem00_CustomItemsParticles(&this->actor, globalCtx, this->randoGiEntry);
|
||||
GetItemEntry_Draw(globalCtx, this->randoGiEntry);
|
||||
} else {
|
||||
s32 pad;
|
||||
|
||||
|
@ -949,15 +949,7 @@ void func_80083108(GlobalContext* globalCtx) {
|
||||
gSaveContext.buttonStatus[0] = BTN_DISABLED;
|
||||
|
||||
for (i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
|
||||
if ((gSaveContext.equips.buttonItems[i] >= ITEM_SHIELD_DEKU) &&
|
||||
(gSaveContext.equips.buttonItems[i] <= ITEM_BOOTS_HOVER)) {
|
||||
// Equipment on c-buttons is always enabled
|
||||
if (gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] == BTN_DISABLED) {
|
||||
sp28 = 1;
|
||||
}
|
||||
|
||||
gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] = BTN_ENABLED;
|
||||
} else if (func_8008F2F8(globalCtx) == 2) {
|
||||
if (func_8008F2F8(globalCtx) == 2) {
|
||||
if ((gSaveContext.equips.buttonItems[i] != ITEM_HOOKSHOT) &&
|
||||
(gSaveContext.equips.buttonItems[i] != ITEM_LONGSHOT)) {
|
||||
if (gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] == BTN_ENABLED) {
|
||||
@ -1100,6 +1092,18 @@ void func_80083108(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
|
||||
if ((gSaveContext.equips.buttonItems[i] >= ITEM_SHIELD_DEKU) &&
|
||||
(gSaveContext.equips.buttonItems[i] <= ITEM_BOOTS_HOVER)) {
|
||||
// Equipment on c-buttons is always enabled
|
||||
if (gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] == BTN_DISABLED) {
|
||||
sp28 = 1;
|
||||
}
|
||||
|
||||
gSaveContext.buttonStatus[BUTTON_STATUS_INDEX(i)] = BTN_ENABLED;
|
||||
}
|
||||
}
|
||||
|
||||
if (interfaceCtx->restrictions.bottles != 0) {
|
||||
for (i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
|
||||
if ((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) &&
|
||||
@ -1253,6 +1257,8 @@ void func_80083108(GlobalContext* globalCtx) {
|
||||
(gSaveContext.equips.buttonItems[i] != ITEM_OCARINA_TIME) &&
|
||||
!((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) &&
|
||||
(gSaveContext.equips.buttonItems[i] <= ITEM_POE)) &&
|
||||
!((gSaveContext.equips.buttonItems[i] >= ITEM_SHIELD_DEKU) && // Never disable equipment
|
||||
(gSaveContext.equips.buttonItems[i] <= ITEM_BOOTS_HOVER)) && // (tunics/boots) on C-buttons
|
||||
!((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) &&
|
||||
(gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) {
|
||||
if ((globalCtx->sceneNum != SCENE_TAKARAYA) ||
|
||||
|
@ -36,7 +36,7 @@ const ActorInit Obj_Lift_InitVars = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
static s16 sFallTimerDurations[] = { 0, 10, 20, 30, 40, 50, 60 };
|
||||
static s16 sFallTimerDurations[] = { 0, 10, 20, 30, 40, 50, 60, 0 };
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 x;
|
||||
|
Loading…
Reference in New Issue
Block a user