2022-03-21 21:51:23 -04:00
|
|
|
#ifndef Z64ACTOR_H
|
|
|
|
#define Z64ACTOR_H
|
|
|
|
|
|
|
|
#include "z64dma.h"
|
|
|
|
#include "z64animation.h"
|
|
|
|
#include "z64math.h"
|
|
|
|
#include "z64collision_check.h"
|
2023-06-01 21:39:50 -04:00
|
|
|
#include "z64bgcheck.h"
|
2022-10-19 23:29:28 -04:00
|
|
|
#include "soh/Enhancements/item-tables/ItemTableTypes.h"
|
2023-12-14 06:19:39 -05:00
|
|
|
#include "soh/Enhancements/randomizer/randomizerTypes.h"
|
Rando Definition Deduplication (#3284)
* Initial StaticData and RandoItem class definitions
* Initial implementation of RandoItem class.
* Rerranges RandoItem Constructor parameters
The parameters were rearranged for easy copy-paste from the GET_ITEM macro calls later on.
* Switches static data from map to static array.
Array is all that is needed, since the item list will be contiguous and indexed by the RandomizerGet Enum values.
* Defines part of the randomizer item list.
* Adds more item class instances to item_list.cpp
Up through bottles, many more items still to go.
* Adds song items
* Adds Maps and Compasses to the item_list
* Added Key Items to item_list
* Added Key Rings to item_list
* Added Dungeon Rewards to item_list
* Adds generic items and refills to item_list
* Adds shop items, triforce, and hints
Also added constructors that put the GET_ITEM_NONE data in for these items, since there is no corresponding GetItemEntry for them.
* Adds in the stages of progressive items
These are present for GetItemEntry purposes, and aren't really meant to be used in seed generation (unless we find a need for it later on.)
* Remove GetItemEntry data from progressive items
* Moves/adds function definitions to item/item_list
* Refactors GetItemEntry data
It's now a pointer to memory instantiated on the heap in the constructor. These are shared pointers so the memory is freed if any of the item instances get deconstructed (which they shouldn't but just in case.)
* Adds item class member for if item is progressive
* Removes unneeded stuff from initializer list macro
* Replaces relevant `uint32_t`s w/ `RandomizerGet`s
Also replaces calls to the ItemTable method with StaticData::RetrieveItem
* Switches our runtime code to use the new itemList.
* Changes just enough hint gen code to compile
* Initial Definition of Location Class
* Initial Implementation of Location
* Fixes some names and definitions.
* Extracts ActorID and SceneID enums to separate files.
This allows importing them without causing weird conflicts in cpp files when importing the z64scene.h and z64actor.h files directly. Now you can just import z64scene_enum.h and z64actor_enum.h instead. The two old files also import these new files so that existing setups still work as expected.
* Replaces the forward definitions with the new imports.
* Adds missing data for RandomizerCheckObjects.
* Definition and first entry of locationTable
* Added Mido's House Locations
* Added locations up through lost woods.
* Adds in Hyrule Field locations.
* Adds Lake Hylia locations
* Adds location name comments
* Adds Gerudo Valley Locations
* Adds Gerudo Fortress locations.
* Adds the Wasteland and Collosus locations
* Adds Market locations
* Adds Hyrule Castle locations.
* Adds Kakariko and Graveyard locations.
* Adds Death Mountain checks.
* Adds Goron City locations
* Adds Death Mountain Crater locations
* Adds Zora's River locations
* Added Zora's Domain Locations.
* Added Zora's Fountain locations
* Adds Lon Lon Ranch locations.
* Adds Deku Tree locations
* Adds Dodongo's Cavern Locations.
* Adds Jabu Jabu's Belly Locations
* Adds Forest Temple Locations
* Adds Fire Temple Locations
* Adds Water Temple Locations
* Added Spirit Temple Locations
* Some of shadow temple locations.
* Adds remaining Shadow Temple locations
* Fixes a leftover merge conflict
* Adds Bottom of the Well locations.
* Adds Ice Cavern locations
* Adds GTG locations.
* Adds Ganon's Castle and Tower locations
* Adds dungeon Gold Skulltula locations.
* Adds Overworld Gold Skulltula locations
* Adds dungeon reward locations
* Adds Heart Container Locations
* Adds Cutscene and Song locations
* Adds Cow locations
* Adds Shop locations.
* Adds hint locations
* Adds function for retrieving the Location data.
* Initial definition of ItemLocation structure for tracking runtime data
* First push on converting code to use new location definitions
* Changes hints to use the new tables
* Further conversion of hints to new definitions.
* Adds new Hint and Location IDs to area tables
* Moves areaTable to use new RandomizerRegion keys
* Removal of 3drando/item_location files.
* Uses new RandomizerRegion keys in entrance.cpp
* Final push for removal of massive keys.hpp enum
* Uses new SceneID Enum Values
* Remove RandomizerCheckObject structs in favor of new location list.
* Fix a few stragglers to successfully build
* Rename of RandoItem to just Item, but in the Rando namespace
* Adds static hints (Light Arrows, Altar text, etc) to the new Hint table.
* More hint related fixes/edits
* small fix for #include path
* Fix various miscellaneous issues related to seed gen and spoiler parsing.
* Handle progressive items correctly.
* Fixes some hint generation logic
* Fix a few GetItemEntry niche bugs.
* Adds missing shop GI Entries
* Formatting fixes
* small formatting fix
* Namespace StaticData under Rando
* Added a note about a potential use-after-free.
I confirmed the actual pointer in question isn't currently being used, but I added the note as a reminder to fix it later and/or as a warning to anyone who changes how the return value is used.
* Fixes missing location table entries
* Fixes LUS submodule and removes now-unused code
* Resolves weird duplicate definition issue
* Fix missing include
It was missed because not being included wasn't an issue on Windows.
* Fixes error present on Linux builds
* Fixes some issues with excluding locations
* Updates the Resolve Exclusion conflicts function
not sure if actually used, will look into that more later
* Removes some duplicate RGs
* More fixes of duplicate RG values.
* Fix a few duplication issues in the check tracker.
* Fix progressive bombchus.
* Minor typo fix, shouldn't really be affecting anything though
* Should fix some of the remaining check tracker issues.
* oops wrong boolean operator
* Fix skulltulas in the check tracker.
* oops, missing comma
* re-formatting of HintStone locations
* Fixes issue when picking up second Progressive Bullet Bag
* Hide bombchu bowling bombchus
* Fixes missed skullScene in location_list
* Reformats shop items
* Re-formats cow checks
* reformat song locations
* reformat "cutscene" checks
* reformat heart container locaitons
* reformat Boss/Dungeon reward checks
* Hide Triforce Completed if not playing Triforce Hunt
* Fixes incorrect chest param
* reformat GS Tokens locations and cuts down on duplicate data
* reformat Ganons Castle checks
* reformat GTG check locations
* Prevents Gift from Raoru from appearing in the check tracker
* more reformatting (botw, ice cavern, shadow temple)
* Should fix a couple more check tracker checks
* reformat spirit temple checks
* reformat water and fire temple checks
* fix RC_ZR_GS_ABOVE_BRIDGE flag typo
* reformat Forest Temple checks
* Fix RC_LW_TRADE_ODD_POTION in check tracker
* reformat child dungeon locations
* reformat overworld locations
* reformat item entries
2023-10-19 19:48:25 -04:00
|
|
|
#include "z64actor_enum.h"
|
2024-01-14 13:16:32 -05:00
|
|
|
#include "soh/Enhancements/randomizer/randomizerTypes.h"
|
2022-03-21 21:51:23 -04:00
|
|
|
|
2022-06-23 11:32:19 -04:00
|
|
|
#define ACTOR_NUMBER_MAX 2000
|
2022-03-21 21:51:23 -04:00
|
|
|
#define INVISIBLE_ACTOR_MAX 20
|
|
|
|
#define AM_FIELD_SIZE 0x27A0
|
|
|
|
#define MASS_IMMOVABLE 0xFF // Cannot be pushed by OC collisions
|
|
|
|
#define MASS_HEAVY 0xFE // Can only be pushed by OC collisions with IMMOVABLE and HEAVY objects.
|
|
|
|
|
|
|
|
struct Actor;
|
2022-11-06 03:24:34 -05:00
|
|
|
struct PlayState;
|
2022-03-21 21:51:23 -04:00
|
|
|
struct Lights;
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
typedef void (*ActorFunc)(struct Actor*, struct PlayState*);
|
2022-03-21 21:51:23 -04:00
|
|
|
typedef void (*ActorResetFunc)(void);
|
2022-11-06 03:24:34 -05:00
|
|
|
typedef void (*ActorShadowFunc)(struct Actor*, struct Lights*, struct PlayState*);
|
2023-01-19 02:38:04 -05:00
|
|
|
typedef u16 (*NpcGetTextIdFunc)(struct PlayState*, struct Actor*);
|
|
|
|
typedef s16 (*NpcUpdateTalkStateFunc)(struct PlayState*, struct Actor*);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
Vec3f pos;
|
|
|
|
Vec3s rot;
|
|
|
|
} PosRot; // size = 0x14
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ s16 id;
|
|
|
|
/* 0x02 */ u8 category; // Classifies actor and determines when it will update or draw
|
|
|
|
/* 0x04 */ u32 flags;
|
|
|
|
/* 0x08 */ s16 objectId;
|
|
|
|
/* 0x0C */ u32 instanceSize;
|
|
|
|
/* 0x10 */ ActorFunc init; // Constructor
|
|
|
|
/* 0x14 */ ActorFunc destroy; // Destructor
|
|
|
|
/* 0x18 */ ActorFunc update; // Update Function
|
|
|
|
/* 0x1C */ ActorFunc draw; // Draw function
|
|
|
|
/* 0x20 */ ActorResetFunc reset;
|
|
|
|
} ActorInit; // size = 0x20
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
/* 0 */ ALLOCTYPE_NORMAL,
|
|
|
|
/* 1 */ ALLOCTYPE_ABSOLUTE,
|
|
|
|
/* 2 */ ALLOCTYPE_PERMANENT
|
|
|
|
} AllocType;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
u8 table[32];
|
|
|
|
} DamageTable;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ u8 health;
|
|
|
|
/* 0x02 */ s16 cylRadius;
|
|
|
|
/* 0x04 */ s16 cylHeight;
|
|
|
|
/* 0x06 */ u8 mass;
|
|
|
|
} CollisionCheckInfoInit;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ u8 health;
|
|
|
|
/* 0x02 */ s16 cylRadius;
|
|
|
|
/* 0x04 */ s16 cylHeight;
|
|
|
|
/* 0x06 */ s16 cylYShift;
|
|
|
|
/* 0x08 */ u8 mass;
|
|
|
|
} CollisionCheckInfoInit2;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ DamageTable* damageTable;
|
2022-08-16 21:53:28 -04:00
|
|
|
/* 0x04 */ Vec3f displacement; // Amount to correct actor velocity by when colliding into a body
|
2022-03-21 21:51:23 -04:00
|
|
|
/* 0x10 */ s16 cylRadius; // Used for various purposes
|
|
|
|
/* 0x12 */ s16 cylHeight; // Used for various purposes
|
|
|
|
/* 0x14 */ s16 cylYShift; // Unused. Purpose inferred from Cylinder16 and CollisionCheck_CylSideVsLineSeg
|
|
|
|
/* 0x16 */ u8 mass; // Used to compute displacement for OC collisions
|
|
|
|
/* 0x17 */ u8 health; // Note: some actors may use their own health variable instead of this one
|
|
|
|
/* 0x18 */ u8 damage; // Amount to decrement health by
|
|
|
|
/* 0x19 */ u8 damageEffect; // Stores what effect should occur when hit by a weapon
|
|
|
|
/* 0x1A */ u8 atHitEffect; // Stores what effect should occur when AT connects with an AC
|
|
|
|
/* 0x1B */ u8 acHitEffect; // Stores what effect should occur when AC is touched by an AT
|
|
|
|
} CollisionCheckInfo; // size = 0x1C
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ Vec3s rot; // Current actor shape rotation
|
|
|
|
/* 0x06 */ s16 face; // Used to index eyebrow/eye/mouth textures. Only used by player
|
|
|
|
/* 0x08 */ f32 yOffset; // Model y axis offset. Represents model space units
|
|
|
|
/* 0x0C */ ActorShadowFunc shadowDraw; // Shadow draw function
|
|
|
|
/* 0x10 */ f32 shadowScale; // Changes the size of the shadow
|
|
|
|
/* 0x14 */ u8 shadowAlpha; // Default is 255
|
|
|
|
/* 0x15 */ u8 feetFloorFlags; // Set if the actor's foot is clipped under the floor. & 1 is right foot, & 2 is left
|
|
|
|
/* 0x18 */ Vec3f feetPos[2]; // Update by using `Actor_SetFeetPos` in PostLimbDraw
|
|
|
|
} ActorShape; // size = 0x30
|
|
|
|
|
2023-05-30 15:05:04 -04:00
|
|
|
#define ACTOR_FLAG_TARGETABLE (1 << 0)
|
|
|
|
#define ACTOR_FLAG_HOSTILE (1 << 2)
|
|
|
|
#define ACTOR_FLAG_FRIENDLY (1 << 3)
|
|
|
|
#define ACTOR_FLAG_UPDATE_WHILE_CULLED (1 << 4)
|
|
|
|
#define ACTOR_FLAG_DRAW_WHILE_CULLED (1 << 5)
|
|
|
|
#define ACTOR_FLAG_ACTIVE (1 << 6)
|
|
|
|
#define ACTOR_FLAG_LENS (1 << 7)
|
|
|
|
#define ACTOR_FLAG_PLAYER_TALKED_TO (1 << 8)
|
|
|
|
#define ACTOR_FLAG_HOOKSHOT_DRAGS (1 << 9)
|
|
|
|
#define ACTOR_FLAG_DRAGGED_BY_HOOKSHOT (1 << 10)
|
2022-03-21 21:51:23 -04:00
|
|
|
#define ACTOR_FLAG_ENKUSA_CUT (1 << 11)
|
2023-05-30 15:05:04 -04:00
|
|
|
#define ACTOR_FLAG_IGNORE_QUAKE (1 << 12)
|
|
|
|
#define ACTOR_FLAG_HOOKSHOT_ATTACHED (1 << 13)
|
|
|
|
#define ACTOR_FLAG_ARROW_DRAGGABLE (1 << 14)
|
|
|
|
#define ACTOR_FLAG_DRAGGED_BY_ARROW (1 << 15)
|
|
|
|
#define ACTOR_FLAG_WILL_TALK (1 << 16)
|
|
|
|
#define ACTOR_FLAG_PILLAR_PICKUP (1 << 17)
|
|
|
|
#define ACTOR_FLAG_NAVI_HAS_INFO (1 << 18)
|
|
|
|
#define ACTOR_FLAG_SFX_AT_POS (1 << 19)
|
|
|
|
#define ACTOR_FLAG_SFX_AT_CENTER (1 << 20)
|
|
|
|
#define ACTOR_FLAG_SFX_AT_CENTER2 (1 << 21)
|
|
|
|
#define ACTOR_FLAG_IGNORE_POINTLIGHTS (1 << 22)
|
|
|
|
#define ACTOR_FLAG_ALWAYS_THROWN (1 << 23)
|
|
|
|
#define ACTOR_FLAG_PLAY_HIT_SFX (1 << 24)
|
|
|
|
#define ACTOR_FLAG_NO_FREEZE_OCARINA (1 << 25)
|
|
|
|
#define ACTOR_FLAG_CAN_PRESS_SWITCH (1 << 26)
|
|
|
|
#define ACTOR_FLAG_NO_LOCKON (1 << 27)
|
|
|
|
#define ACTOR_FLAG_SFX_AS_TIMER (1 << 28)
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
typedef struct Actor {
|
|
|
|
/* 0x000 */ s16 id; // Actor ID
|
|
|
|
/* 0x002 */ u8 category; // Actor category. Refer to the corresponding enum for values
|
|
|
|
/* 0x003 */ s8 room; // Room number the actor is in. -1 denotes that the actor won't despawn on a room change
|
|
|
|
/* 0x004 */ u32 flags; // Flags used for various purposes
|
|
|
|
/* 0x008 */ PosRot home; // Initial position/rotation when spawned. Can be used for other purposes
|
|
|
|
/* 0x01C */ s16 params; // Configurable variable set by the actor's spawn data; original name: "args_data"
|
|
|
|
/* 0x01E */ s8 objBankIndex; // Object bank index of the actor's object dependency; original name: "bank"
|
|
|
|
/* 0x01F */ s8 targetMode; // Controls how far the actor can be targeted from and how far it can stay locked on
|
|
|
|
/* 0x020 */ u16 sfx; // SFX ID to play. Sound plays when value is set, then is cleared the following update cycle
|
|
|
|
/* 0x024 */ PosRot world; // Position/rotation in the world
|
|
|
|
/* 0x038 */ PosRot focus; // Target reticle focuses on this position. For player this represents head pos and rot
|
|
|
|
/* 0x04C */ f32 targetArrowOffset; // Height offset of the target arrow relative to `focus` position
|
|
|
|
/* 0x050 */ Vec3f scale; // Scale of the actor in each axis
|
|
|
|
/* 0x05C */ Vec3f velocity; // Velocity of the actor in each axis
|
|
|
|
/* 0x068 */ f32 speedXZ; // How fast the actor is traveling along the XZ plane
|
|
|
|
/* 0x06C */ f32 gravity; // Acceleration due to gravity. Value is added to Y velocity every frame
|
|
|
|
/* 0x070 */ f32 minVelocityY; // Sets the lower bounds cap on velocity along the Y axis
|
|
|
|
/* 0x074 */ CollisionPoly* wallPoly; // Wall polygon the actor is touching
|
|
|
|
/* 0x078 */ CollisionPoly* floorPoly; // Floor polygon directly below the actor
|
|
|
|
/* 0x07C */ u8 wallBgId; // Bg ID of the wall polygon the actor is touching
|
|
|
|
/* 0x07D */ u8 floorBgId; // Bg ID of the floor polygon directly below the actor
|
|
|
|
/* 0x07E */ s16 wallYaw; // Y rotation of the wall polygon the actor is touching
|
|
|
|
/* 0x080 */ f32 floorHeight; // Y position of the floor polygon directly below the actor
|
|
|
|
/* 0x084 */ f32 yDistToWater; // Distance to the surface of active waterbox. Negative value means above water
|
|
|
|
/* 0x088 */ u16 bgCheckFlags; // See comments below actor struct for wip docs. TODO: macros for these flags
|
|
|
|
/* 0x08A */ s16 yawTowardsPlayer; // Y rotation difference between the actor and the player
|
2022-08-16 21:53:28 -04:00
|
|
|
/* 0x08C */ f32 xyzDistToPlayerSq; // Squared distance between the actor and the player
|
2022-03-21 21:51:23 -04:00
|
|
|
/* 0x090 */ f32 xzDistToPlayer; // Distance between the actor and the player in the XZ plane
|
|
|
|
/* 0x094 */ f32 yDistToPlayer; // Dist is negative if the actor is above the player
|
|
|
|
/* 0x098 */ CollisionCheckInfo colChkInfo; // Variables related to the Collision Check system
|
|
|
|
/* 0x0B4 */ ActorShape shape; // Variables related to the physical shape of the actor
|
|
|
|
/* 0x0E4 */ Vec3f projectedPos; // Position of the actor in projected space
|
|
|
|
/* 0x0F0 */ f32 projectedW; // w component of the projected actor position
|
|
|
|
/* 0x0F4 */ f32 uncullZoneForward; // Amount to increase the uncull zone forward by (in projected space)
|
|
|
|
/* 0x0F8 */ f32 uncullZoneScale; // Amount to increase the uncull zone scale by (in projected space)
|
|
|
|
/* 0x0FC */ f32 uncullZoneDownward; // Amount to increase uncull zone downward by (in projected space)
|
|
|
|
/* 0x100 */ Vec3f prevPos; // World position from the previous update cycle
|
|
|
|
/* 0x10C */ u8 isTargeted; // Set to true if the actor is currently being targeted by the player
|
|
|
|
/* 0x10D */ u8 targetPriority; // Lower values have higher priority. Resets to 0 when player stops targeting
|
|
|
|
/* 0x10E */ u16 textId; // Text ID to pass to link/display when interacting with the actor
|
|
|
|
/* 0x110 */ u16 freezeTimer; // Actor does not update when set. Timer decrements automatically
|
|
|
|
/* 0x112 */ u16 colorFilterParams; // Set color filter to red, blue, or white. Toggle opa or xlu
|
|
|
|
/* 0x114 */ u8 colorFilterTimer; // A non-zero value enables the color filter. Decrements automatically
|
|
|
|
/* 0x115 */ u8 isDrawn; // Set to true if the actor is currently being drawn. Always stays false for lens actors
|
|
|
|
/* 0x116 */ u8 dropFlag; // Configures what item is dropped by the actor from `Item_DropCollectibleRandom`
|
|
|
|
/* 0x117 */ u8 naviEnemyId; // Sets what 0600 dialog to display when talking to navi. Default 0xFF
|
|
|
|
/* 0x118 */ struct Actor* parent; // Usage is actor specific. Set if actor is spawned via `Actor_SpawnAsChild`
|
|
|
|
/* 0x11C */ struct Actor* child; // Usage is actor specific. Set if actor is spawned via `Actor_SpawnAsChild`
|
|
|
|
/* 0x120 */ struct Actor* prev; // Previous actor of this category
|
|
|
|
/* 0x124 */ struct Actor* next; // Next actor of this category
|
|
|
|
/* 0x128 */ ActorFunc init; // Initialization Routine. Called by `Actor_Init` or `Actor_UpdateAll`
|
|
|
|
/* 0x12C */ ActorFunc destroy; // Destruction Routine. Called by `Actor_Destroy`
|
|
|
|
/* 0x130 */ ActorFunc update; // Update Routine. Called by `Actor_UpdateAll`
|
|
|
|
/* 0x134 */ ActorFunc draw; // Draw Routine. Called by `Actor_Draw`
|
|
|
|
/* 0x138 */ ActorResetFunc reset;
|
|
|
|
/* 0x13C */ char dbgPad[0x10]; // Padding that only exists in the debug rom
|
2023-07-12 21:55:24 -04:00
|
|
|
// #region SOH [General]
|
|
|
|
/* */ u8 maximumHealth; // Max health value for use with health bars, set on actor init
|
|
|
|
// #endregion
|
2022-03-21 21:51:23 -04:00
|
|
|
} Actor; // size = 0x14C
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
/* 0 */ FOOT_LEFT,
|
|
|
|
/* 1 */ FOOT_RIGHT
|
|
|
|
} ActorFootIndex;
|
|
|
|
|
|
|
|
/*
|
|
|
|
BgCheckFlags WIP documentation:
|
|
|
|
& 0x001 : Standing on the ground
|
|
|
|
& 0x002 : Has touched the ground (only active for 1 frame)
|
|
|
|
& 0x004 : Has left the ground (only active for 1 frame)
|
|
|
|
& 0x008 : Touching a wall
|
|
|
|
& 0x010 : Touching a ceiling
|
|
|
|
& 0x020 : On or below water surface
|
|
|
|
& 0x040 : Has touched water (actor is responsible for unsetting this the frame it touches the water)
|
|
|
|
& 0x080 : Similar to & 0x1 but with no velocity check and is cleared every frame
|
|
|
|
& 0x100 : Crushed between a floor and ceiling (triggers a void for player)
|
|
|
|
& 0x200 : Unknown (only set/used by player so far)
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
colorFilterParams WIP documentation
|
|
|
|
& 0x8000 : white
|
|
|
|
& 0x4000 : red
|
|
|
|
if neither of the above are set : blue
|
|
|
|
|
|
|
|
(& 0x1F00 >> 5) | 7 : color intensity
|
|
|
|
0x2000 : translucent, else opaque
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct DynaPolyActor {
|
|
|
|
/* 0x000 */ struct Actor actor;
|
|
|
|
/* 0x14C */ s32 bgId;
|
|
|
|
/* 0x150 */ f32 unk_150;
|
|
|
|
/* 0x154 */ f32 unk_154;
|
|
|
|
/* 0x158 */ s16 unk_158; // y rotation?
|
|
|
|
/* 0x15A */ u16 unk_15A;
|
|
|
|
/* 0x15C */ u32 unk_15C;
|
|
|
|
/* 0x160 */ u8 unk_160;
|
|
|
|
/* 0x162 */ s16 unk_162;
|
|
|
|
} DynaPolyActor; // size = 0x164
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ MtxF* matrices;
|
|
|
|
/* 0x04 */ s16* objectIds;
|
|
|
|
/* 0x08 */ s16 count;
|
|
|
|
/* 0x0C */ Gfx** dLists;
|
|
|
|
/* 0x10 */ s32 val; // used for various purposes: both a status indicator and counter
|
|
|
|
/* 0x14 */ s32 prevLimbIndex;
|
|
|
|
} BodyBreak;
|
|
|
|
|
|
|
|
#define BODYBREAK_OBJECT_DEFAULT -1 // use the same object as the actor
|
|
|
|
#define BODYBREAK_STATUS_READY -1
|
|
|
|
#define BODYBREAK_STATUS_FINISHED 0
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
/* 0x00 */ ITEM00_RUPEE_GREEN,
|
|
|
|
/* 0x01 */ ITEM00_RUPEE_BLUE,
|
|
|
|
/* 0x02 */ ITEM00_RUPEE_RED,
|
|
|
|
/* 0x03 */ ITEM00_HEART,
|
|
|
|
/* 0x04 */ ITEM00_BOMBS_A,
|
|
|
|
/* 0x05 */ ITEM00_ARROWS_SINGLE,
|
|
|
|
/* 0x06 */ ITEM00_HEART_PIECE,
|
|
|
|
/* 0x07 */ ITEM00_HEART_CONTAINER,
|
|
|
|
/* 0x08 */ ITEM00_ARROWS_SMALL,
|
|
|
|
/* 0x09 */ ITEM00_ARROWS_MEDIUM,
|
|
|
|
/* 0x0A */ ITEM00_ARROWS_LARGE,
|
|
|
|
/* 0x0B */ ITEM00_BOMBS_B,
|
|
|
|
/* 0x0C */ ITEM00_NUTS,
|
|
|
|
/* 0x0D */ ITEM00_STICK,
|
|
|
|
/* 0x0E */ ITEM00_MAGIC_LARGE,
|
|
|
|
/* 0x0F */ ITEM00_MAGIC_SMALL,
|
|
|
|
/* 0x10 */ ITEM00_SEEDS,
|
|
|
|
/* 0x11 */ ITEM00_SMALL_KEY,
|
|
|
|
/* 0x12 */ ITEM00_FLEXIBLE,
|
|
|
|
/* 0x13 */ ITEM00_RUPEE_ORANGE,
|
|
|
|
/* 0x14 */ ITEM00_RUPEE_PURPLE,
|
|
|
|
/* 0x15 */ ITEM00_SHIELD_DEKU,
|
|
|
|
/* 0x16 */ ITEM00_SHIELD_HYLIAN,
|
|
|
|
/* 0x17 */ ITEM00_TUNIC_ZORA,
|
|
|
|
/* 0x18 */ ITEM00_TUNIC_GORON,
|
2022-08-23 20:14:17 -04:00
|
|
|
/* 0x19 */ ITEM00_BOMBS_SPECIAL,
|
|
|
|
/* 0x20 */ ITEM00_BOMBCHU,
|
2022-03-21 21:51:23 -04:00
|
|
|
} Item00Type;
|
|
|
|
|
|
|
|
struct EnItem00;
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
typedef void (*EnItem00ActionFunc)(struct EnItem00*, struct PlayState*);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
typedef struct EnItem00 {
|
|
|
|
/* 0x000 */ Actor actor;
|
|
|
|
/* 0x14C */ EnItem00ActionFunc actionFunc;
|
|
|
|
/* 0x150 */ s16 collectibleFlag;
|
|
|
|
/* 0x152 */ s16 getItemId;
|
|
|
|
/* 0x154 */ s16 unk_154;
|
|
|
|
/* 0x156 */ s16 unk_156;
|
|
|
|
/* 0x158 */ s16 unk_158;
|
|
|
|
/* 0x15A */ s16 unk_15A;
|
|
|
|
/* 0x15C */ f32 scale;
|
|
|
|
/* 0x160 */ ColliderCylinder collider;
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
s16 ogParams;
|
2022-10-19 23:29:28 -04:00
|
|
|
GetItemEntry randoGiEntry;
|
2023-12-14 06:19:39 -05:00
|
|
|
RandomizerCheck randoCheck;
|
|
|
|
RandomizerInf randoInf;
|
2022-03-21 21:51:23 -04:00
|
|
|
} EnItem00; // size = 0x1AC
|
|
|
|
|
|
|
|
// Only A_OBJ_SIGNPOST_OBLONG and A_OBJ_SIGNPOST_ARROW are used in room files.
|
|
|
|
typedef enum {
|
|
|
|
/* 0x00 */ A_OBJ_BLOCK_SMALL,
|
|
|
|
/* 0x01 */ A_OBJ_BLOCK_LARGE,
|
|
|
|
/* 0x02 */ A_OBJ_BLOCK_HUGE,
|
|
|
|
/* 0x03 */ A_OBJ_BLOCK_SMALL_ROT,
|
|
|
|
/* 0x04 */ A_OBJ_BLOCK_LARGE_ROT,
|
|
|
|
/* 0x05 */ A_OBJ_CUBE_SMALL,
|
|
|
|
/* 0x06 */ A_OBJ_UNKNOWN_6,
|
|
|
|
/* 0x07 */ A_OBJ_GRASS_CLUMP,
|
|
|
|
/* 0x08 */ A_OBJ_TREE_STUMP,
|
|
|
|
/* 0x09 */ A_OBJ_SIGNPOST_OBLONG,
|
|
|
|
/* 0x0A */ A_OBJ_SIGNPOST_ARROW,
|
|
|
|
/* 0x0B */ A_OBJ_BOULDER_FRAGMENT,
|
|
|
|
/* 0x0C */ A_OBJ_MAX
|
|
|
|
} AObjType;
|
|
|
|
|
|
|
|
struct EnAObj;
|
|
|
|
|
2022-11-06 03:24:34 -05:00
|
|
|
typedef void (*EnAObjActionFunc)(struct EnAObj*, struct PlayState*);
|
2022-03-21 21:51:23 -04:00
|
|
|
|
|
|
|
typedef struct EnAObj {
|
|
|
|
/* 0x000 */ DynaPolyActor dyna;
|
|
|
|
/* 0x164 */ EnAObjActionFunc actionFunc;
|
|
|
|
/* 0x168 */ s32 rotateWaitTimer;
|
|
|
|
/* 0x16C */ s16 textId;
|
|
|
|
/* 0x16E */ s16 rotateState;
|
|
|
|
/* 0x170 */ s16 rotateForTimer;
|
|
|
|
/* 0x172 */ s16 rotSpeedY;
|
|
|
|
/* 0x174 */ s16 rotSpeedX;
|
|
|
|
/* 0x178 */ f32 focusYoffset;
|
|
|
|
/* 0x17C */ ColliderCylinder collider;
|
|
|
|
} EnAObj; // size = 0x1C8
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
/* 0x00 */ ACTORCAT_SWITCH,
|
|
|
|
/* 0x01 */ ACTORCAT_BG,
|
|
|
|
/* 0x02 */ ACTORCAT_PLAYER,
|
|
|
|
/* 0x03 */ ACTORCAT_EXPLOSIVE,
|
|
|
|
/* 0x04 */ ACTORCAT_NPC,
|
|
|
|
/* 0x05 */ ACTORCAT_ENEMY,
|
|
|
|
/* 0x06 */ ACTORCAT_PROP,
|
|
|
|
/* 0x07 */ ACTORCAT_ITEMACTION,
|
|
|
|
/* 0x08 */ ACTORCAT_MISC,
|
|
|
|
/* 0x09 */ ACTORCAT_BOSS,
|
|
|
|
/* 0x0A */ ACTORCAT_DOOR,
|
2022-08-16 21:53:28 -04:00
|
|
|
/* 0x0B */ ACTORCAT_CHEST,
|
|
|
|
/* 0x0C */ ACTORCAT_MAX
|
2022-03-21 21:51:23 -04:00
|
|
|
} ActorCategory;
|
|
|
|
|
|
|
|
//#define DEFINE_ACTOR(_0, enum, _2) enum,
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
DOORLOCK_NORMAL,
|
|
|
|
DOORLOCK_BOSS,
|
|
|
|
DOORLOCK_NORMAL_SPIRIT
|
|
|
|
} DoorLockType;
|
|
|
|
|
2023-01-19 02:38:04 -05:00
|
|
|
typedef enum {
|
|
|
|
/* 0x0 */ NPC_TALK_STATE_IDLE, // NPC not currently talking to player
|
|
|
|
/* 0x1 */ NPC_TALK_STATE_TALKING, // NPC is currently talking to player
|
|
|
|
/* 0x2 */ NPC_TALK_STATE_ACTION, // An NPC-defined action triggered in the conversation
|
|
|
|
/* 0x3 */ NPC_TALK_STATE_ITEM_GIVEN // NPC finished giving an item and text box is done
|
|
|
|
} NpcTalkState;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
/* 0x0 */ NPC_TRACKING_PLAYER_AUTO_TURN, // Determine tracking mode based on player position, see Npc_UpdateAutoTurn
|
|
|
|
/* 0x1 */ NPC_TRACKING_NONE, // Don't track the target (usually the player)
|
|
|
|
/* 0x2 */ NPC_TRACKING_HEAD_AND_TORSO, // Track target by turning the head and the torso
|
|
|
|
/* 0x3 */ NPC_TRACKING_HEAD, // Track target by turning the head
|
|
|
|
/* 0x4 */ NPC_TRACKING_FULL_BODY // Track target by turning the body, torso and head
|
|
|
|
} NpcTrackingMode;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ s16 talkState;
|
|
|
|
/* 0x02 */ s16 trackingMode;
|
|
|
|
/* 0x04 */ s16 autoTurnTimer;
|
|
|
|
/* 0x06 */ s16 autoTurnState;
|
|
|
|
/* 0x08 */ Vec3s headRot;
|
|
|
|
/* 0x0E */ Vec3s torsoRot;
|
|
|
|
/* 0x14 */ f32 yOffset; // Y position offset to add to actor position when calculating angle to target
|
|
|
|
/* 0x18 */ Vec3f trackPos;
|
|
|
|
/* 0x24 */ char unk_24[0x4];
|
|
|
|
} NpcInteractInfo; // size = 0x28
|
|
|
|
|
2022-03-21 21:51:23 -04:00
|
|
|
#endif
|