|
SSBM Decomp
|
#include "itbox.h"#include <placeholder.h>#include <platform.h>#include "baselib/jobj.h"#include "baselib/random.h"#include "cm/camera.h"#include "ef/efsync.h"#include "gr/grkongo.h"#include "it/inlines.h"#include "it/it_266F.h"#include "it/it_26B1.h"#include "it/it_2725.h"#include "it/itCommonItems.h"#include "it/item.h"#include "lb/lb_00B0.h"#include "lb/lb_00F9.h"#include "lb/lbvector.h"#include "mp/mpcoll.h"#include <math.h>Macros | |
| #define | DEG_TO_RAD 0.01745329238474369 |
| #define | MAX_ROT_VEL 0.05235987715423107 |
| #define | TAU 6.2831853071795862 |
Functions | |
| Item_GObj * | it_80286088 (Item_GObj *parent_gobj) |
| Spawn a box accessory item that follows the parent item. | |
| void | itBox_Logic1_Spawned (Item_GObj *gobj) |
| void | itBox_Logic1_Destroyed (Item_GObj *gobj) |
| void | it_80286248 (Item_GObj *gobj, s32 arg1, s32 arg2, s32 arg3, s32 arg4) |
| Spawn item(s) from box based on weighted random roll. | |
| bool | it_80286340 (Item_GObj *gobj, s32 arg1, s32 arg2, s32 arg3, s32 arg4) |
| bool | it_802863BC (Item_GObj *gobj) |
| Check if box bounced off a surface nearly upright. | |
| void | fn_80286480 (Item_GObj *gobj) |
| bool | itBox_UnkMotion0_Anim (Item_GObj *gobj) |
| Check animation frame and play sound if at start. | |
| void | itBox_UnkMotion0_Phys (Item_GObj *gobj) |
| bool | itBox_UnkMotion0_Coll (Item_GObj *gobj) |
| void | it_8028655C (Item_GObj *gobj) |
| bool | itBox_UnkMotion4_Anim (Item_GObj *gobj) |
| void | itBox_UnkMotion1_Phys (Item_GObj *gobj) |
| Physics for thrown box motion. | |
| bool | itBox_UnkMotion1_Coll (Item_GObj *gobj) |
| void | itBox_Logic1_PickedUp (Item_GObj *gobj) |
| bool | itBox_UnkMotion2_Anim (Item_GObj *gobj) |
| void | itBox_UnkMotion2_Phys (Item_GObj *gobj) |
| void | itBox_Logic1_Thrown (Item_GObj *gobj) |
| void | itBox_UnkMotion4_Phys (Item_GObj *gobj) |
| static void | itBox_TryOpen_inline (Item_GObj *gobj) |
| Inline helper: spawn break effect and roll for item spawn. | |
| bool | itBox_UnkMotion3_Coll (Item_GObj *gobj) |
| Collision handler for dropped box. Opens on ground/wall contact. | |
| void | itBox_Logic1_Dropped (Item_GObj *gobj) |
| bool | itBox_UnkMotion4_Coll (Item_GObj *gobj) |
| Collision handler for thrown box in air. | |
| void | it_80286AA4 (Item_GObj *gobj) |
| Box opens empty (no items spawned). | |
| bool | itBox_UnkMotion6_Anim (Item_GObj *gobj) |
| void | itBox_UnkMotion6_Phys (Item_GObj *gobj) |
| bool | itBox_UnkMotion6_Coll (Item_GObj *gobj) |
| void | it_80286BA0 (Item_GObj *gobj) |
| Box opens and spawns items. | |
| bool | itBox_UnkMotion7_Anim (Item_GObj *gobj) |
| void | itBox_UnkMotion7_Phys (Item_GObj *gobj) |
| bool | itBox_UnkMotion7_Coll (Item_GObj *gobj) |
| bool | itBox_Logic1_DmgDealt (Item_GObj *gobj) |
| Box dealt damage to something - try to open. | |
| bool | itBox_Logic1_Clanked (Item_GObj *gobj) |
| Box clanked with another hitbox - try to open. | |
| bool | itBox_Logic1_HitShield (Item_GObj *gobj) |
| Box hit a shield - try to open. | |
| bool | itBox_Logic1_Reflected (Item_GObj *gobj) |
| Box was reflected - try to open. | |
| bool | itBox_Logic1_DmgReceived (Item_GObj *gobj) |
| Handle damage received by box. | |
| void | itBox_Logic1_EnteredAir (Item_GObj *gobj) |
| bool | itBox_UnkMotion5_Anim (Item_GObj *gobj) |
| void | itBox_UnkMotion5_Phys (Item_GObj *gobj) |
| bool | itBox_UnkMotion5_Coll (Item_GObj *gobj) |
| void | itBox_Logic1_EvtUnk (Item_GObj *gobj, Item_GObj *ref_gobj) |
| void | it_802870A4 (Item_GObj *gobj) |
| Transition box to state 8 and set accessory callback. | |
| bool | itBox_UnkMotion8_Anim (Item_GObj *gobj) |
| void | itBox_UnkMotion8_Phys (Item_GObj *gobj) |
| Physics for floating box (state 8). | |
| bool | itBox_UnkMotion8_Coll (Item_GObj *gobj) |
| void | it_8028733C (Item_GObj *gobj) |
| Accessory callback - makes item follow its spawned parent item. | |
Variables | |
| static double const | ROT_VEL_SCALE = 0.03490658476948738 |
| ItemStateTable | it_803F5850 [] |
| #define DEG_TO_RAD 0.01745329238474369 |
| #define MAX_ROT_VEL 0.05235987715423107 |
| #define TAU 6.2831853071795862 |
Spawn a box accessory item that follows the parent item.
Returns the spawned gobj, or NULL if parent is invalid.
| void itBox_Logic1_Spawned | ( | Item_GObj * | gobj | ) |
| void itBox_Logic1_Destroyed | ( | Item_GObj * | gobj | ) |
Spawn item(s) from box based on weighted random roll.
arg1/arg2/arg3 are spawn weights, arg4 is additional weight for special roll.
Check if box bounced off a surface nearly upright.
If the bounce angle relative to vertical is below threshold, clear velocity vectors and set ground flag.
| void fn_80286480 | ( | Item_GObj * | gobj | ) |
| void itBox_UnkMotion0_Phys | ( | Item_GObj * | gobj | ) |
| void it_8028655C | ( | Item_GObj * | gobj | ) |
| void itBox_UnkMotion1_Phys | ( | Item_GObj * | gobj | ) |
Physics for thrown box motion.
Applies gravity and updates rotation based on stored rotation velocities (wobble effect when thrown).
| void itBox_Logic1_PickedUp | ( | Item_GObj * | gobj | ) |
| void itBox_UnkMotion2_Phys | ( | Item_GObj * | gobj | ) |
| void itBox_Logic1_Thrown | ( | Item_GObj * | gobj | ) |
| void itBox_UnkMotion4_Phys | ( | Item_GObj * | gobj | ) |
|
inlinestatic |
Inline helper: spawn break effect and roll for item spawn.
Used by collision handlers when box breaks.
Collision handler for dropped box. Opens on ground/wall contact.
| void itBox_Logic1_Dropped | ( | Item_GObj * | gobj | ) |
Collision handler for thrown box in air.
Checks if landed hard enough to break, otherwise bounces.
| void it_80286AA4 | ( | Item_GObj * | gobj | ) |
Box opens empty (no items spawned).
Clears velocity, sets opened flag, spawns smoke effect (0x78), and transitions to state 6.
| void itBox_UnkMotion6_Phys | ( | Item_GObj * | gobj | ) |
| void it_80286BA0 | ( | Item_GObj * | gobj | ) |
Box opens and spawns items.
Plays sound, triggers camera, spawns items, sets opened flag, and transitions to state 7.
| void itBox_UnkMotion7_Phys | ( | Item_GObj * | gobj | ) |
Handle damage received by box.
When accumulated damage reaches threshold, box breaks open. Weighted random roll determines if items spawn or box is empty. Effect 0x427 is the box breaking visual effect.
| void itBox_Logic1_EnteredAir | ( | Item_GObj * | gobj | ) |
| void itBox_UnkMotion5_Phys | ( | Item_GObj * | gobj | ) |
| void it_802870A4 | ( | Item_GObj * | gobj | ) |
Transition box to state 8 and set accessory callback.
| void itBox_UnkMotion8_Phys | ( | Item_GObj * | gobj | ) |
Physics for floating box (state 8).
Randomly adjusts rotation velocities each frame and applies rotation around X and Y axes.
| void it_8028733C | ( | Item_GObj * | gobj | ) |
Accessory callback - makes item follow its spawned parent item.
Updates position and velocity to track the parent's JObj position.
|
static |
| ItemStateTable it_803F5850[] |