Skip to content

Commit

Permalink
Merge 'Restore icy smoke effect when opening a chest with an ice trap' (
Browse files Browse the repository at this point in the history
#2169)

# Conflicts:
#	ASM/build/asm_symbols.txt
#	ASM/build/bundle.o
#	ASM/build/c_symbols.txt
#	data/generated/rom_patch.txt
#	data/generated/symbols.json
  • Loading branch information
fenhl committed Mar 23, 2024
2 parents b9b410e + 0205fa9 commit 511d986
Show file tree
Hide file tree
Showing 8 changed files with 28,397 additions and 28,360 deletions.
1,174 changes: 587 additions & 587 deletions ASM/build/asm_symbols.txt

Large diffs are not rendered by default.

Binary file modified ASM/build/bundle.o
Binary file not shown.
1,160 changes: 580 additions & 580 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

18 changes: 13 additions & 5 deletions ASM/c/chests.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "gfx.h"
#include "sys_matrix.h"
#include "textures.h"
#include "objects.h"

#define BROWN_FRONT_TEXTURE 0x06001798
#define BROWN_BASE_TEXTURE 0x06002798
Expand All @@ -27,12 +28,10 @@ void get_chest_override(z64_actor_t* actor) {
Chest* chest = (Chest*)actor;
uint8_t size = chest->en_box.type;
uint8_t color = size;

uint8_t item_id = (actor->variable & 0x0FE0) >> 5;
uint8_t scene = z64_game.scene_index;
override_t override = lookup_override(actor, scene, item_id);
if (CHEST_SIZE_MATCH_CONTENTS || CHEST_SIZE_TEXTURE || CHEST_TEXTURE_MATCH_CONTENTS) {
uint8_t scene = z64_game.scene_index;
uint8_t item_id = (actor->variable & 0x0FE0) >> 5;

override_t override = lookup_override(actor, scene, item_id);
if (override.value.base.item_id != 0) {
item_row_t* item_row = get_item_row(override.value.looks_like_item_id);
if (item_row == NULL) {
Expand All @@ -58,6 +57,15 @@ void get_chest_override(z64_actor_t* actor) {
// Usually only applies to chest types 4 and 6
actor->flags |= 0x80;
}

// If the chest has an ice trap, load OBJECT_FZ (0x0114) to make the ice smoke effect work.
if (override.value.base.item_id == 0x7C) {
int object_fz_index = z64_ObjectIndex(&z64_game.obj_ctxt, 0x0114);
// No need to spawn more than one by scene.
if (!z64_ObjectIsLoaded(&z64_game.obj_ctxt, object_fz_index)) {
object_index_or_spawn(&z64_game.obj_ctxt, 0x0114);
}
}
}

uint8_t get_chest_type(z64_actor_t* actor) {
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ issue. You should always Hard Reset to avoid this issue entirely.
* Goal hints can now hint items required to defeat Ganon even if they're not required for the rainbow bridge, Ganon's boss key, or the trials. These items will be hinted as being on the "path of the hero".
* Fix a softlock present in the original game when damaging Volvagia's second hitbox during the death cutscene.
* Don't start the trade sequence timer if getting the `ZD King Zora Thawed` item while the Eyeball Frog is in the inventory.
* Fix missing visual frost effect for ice traps in most chests.

#### Other Changes
* Clarified the error message shown when an unshuffled trade quest item is used as a starting item.
Expand Down
Loading

0 comments on commit 511d986

Please sign in to comment.