SSBM Decomp
Loading...
Searching...
No Matches
inlines.h
Go to the documentation of this file.
1#ifndef MELEE_IT_INLINES_H
2#define MELEE_IT_INLINES_H
3
4#include <melee/ef/eflib.h>
5#include <melee/it/it_2725.h>
6#include <melee/it/it_3F14.h>
7#include <melee/it/item.h>
8#include <melee/it/itmaplib.h>
9#include <melee/it/types.h>
10#include <melee/mp/mplib.h>
12
13#define GET_ITEM(gobj) ((Item*) HSD_GObjGetUserData(gobj))
14
15static inline Item* GetItemData(HSD_GObj* gobj)
16{
17 Item* item_data = gobj->user_data;
18 return item_data;
19}
20
21static inline void itResetVelocity(Item* ip)
22{
23 ip->x40_vel.x = ip->x40_vel.y = ip->x40_vel.z = 0.0F;
24}
25
31
40
42{
43 ItemAttr* attrs = GET_ITEM(gobj)->xCC_item_attr;
45 it_80274658(gobj, it_804D6D28->x68_float);
46}
47
48static inline bool Item_TickLifetime(Item* ip)
49{
50 if (ip->xD44_lifeTimer <= 0.0f) {
51 return true;
52 }
53 ip->xD44_lifeTimer -= 1.0f;
54 return false;
55}
56
60static inline bool itGrappleCheckCollision(ItemLink* head, Fighter* fp,
61 Vec3* pos)
62{
63 Vec3* head_pos = &head->pos;
64
65 if (mpCheckAllRemap(NULL, NULL, NULL, NULL, -1, -1, pos->x, pos->y,
66 head->pos.x, head->pos.y))
67 {
68 return true;
69 } else if (mpCheckAllRemap(NULL, NULL, NULL, NULL, -1, -1, fp->cur_pos.x,
70 fp->cur_pos.y, head_pos->x, head_pos->y))
71 {
72 return true;
73 } else {
74 return false;
75 }
76}
77
80{
81 HSD_JObj* jobj = GET_JOBJ(gobj);
82 HSD_JObj* child;
83
84 if (!jobj) {
85 child = NULL;
86 } else {
87 child = jobj->child;
88 }
89 if (!child) {
90 child = NULL;
91 } else {
92 child = child->child;
93 }
94 return child;
95}
96
97#endif
void efLib_ResumeAll(HSD_GObj *gobj)
Definition eflib.c:312
void efLib_PauseAll(HSD_GObj *gobj)
Definition eflib.c:285
struct Vec Vec3
signed long s32
Definition types.h:8
HSD_GObj * gobj
Definition gm_19EF.c:73
#define GET_JOBJ(gobj)
Definition gobj.h:169
static bool itGrappleCheckCollision(ItemLink *head, Fighter *fp, Vec3 *pos)
Check whether the grapple chain from head to the tip pos or to its owner fp collides with terrain (sh...
Definition inlines.h:60
static void itResetVelocity(Item *ip)
Definition inlines.h:21
static Item * GetItemData(HSD_GObj *gobj)
Definition inlines.h:15
static void Item_SetEffectHitlagCallbacks(Item *ip)
Definition inlines.h:26
static HSD_JObj * itGetJObjGrandchild(Item_GObj *gobj)
Definition inlines.h:79
static void Item_EnterStateWithEffectHitlag(Item_GObj *gobj, s32 msid)
Definition inlines.h:32
static bool Item_TickLifetime(Item *ip)
Definition inlines.h:48
#define GET_ITEM(gobj)
Definition inlines.h:13
static void Item_ApplyFallingPhysics(Item_GObj *gobj)
Definition inlines.h:41
ItemCommonData * it_804D6D28
Definition it_3F14.c:848
void it_80274658(HSD_GObj *, f32)
Definition it_2725.c:1063
void it_802762BC(Item *)
Definition itmaplib.c:301
void it_80272860(Item_GObj *, f32, f32)
Definition it_2725.c:176
void Item_80268E5C(HSD_GObj *gobj, enum_t msid, Item_StateChangeFlags flags)
Change item state.
Definition item.c:1120
HSD_GObj Item_GObj
Definition forward.h:55
@ ITEM_ANIM_UPDATE
Updates item model with target Item State's AnimJoint, MatAnimJoint and extra HSD archive node if ava...
Definition forward.h:62
bool mpCheckAllRemap(Vec3 *pos_out, int *line_id_out, u32 *flags_out, Vec3 *normal_out, int joint_id_skip, int joint_id_only, float x0, float y0, float x1, float y1)
Definition mplib.c:3581
Map library.
#define NULL
Definition stddef.h:14
Definition types.h:1127
Vec3 cur_pos
Definition types.h:1149
Definition gobj.h:28
Definition jobj.h:104
HSD_JObj * child
Definition jobj.h:108
Definition types.h:80
f32 x10_fall_speed
Definition types.h:97
f32 x14_fall_speed_max
Definition types.h:98
Definition types.h:213
f32 xD44_lifeTimer
Definition types.h:478
HSD_GObjEvent exited_hitlag
Definition types.h:457
Vec3 x40_vel
Definition types.h:262
HSD_GObjEvent entered_hitlag
Runs after applying hitlag in damage.
Definition types.h:454
f32 z
Definition mtx.h:15
f32 x
Definition mtx.h:15
f32 y
Definition mtx.h:15