Improve shieldhit functions

This commit is contained in:
Ryan Dwyer
2024-08-17 19:07:33 +10:00
parent f697dfe170
commit 63252f71e1
13 changed files with 257 additions and 229 deletions
+2 -1
View File
@@ -26,6 +26,7 @@
#define MAX_PLAYERS 4
#define MAX_PROPSPERROOMCHUNK 7
#define MAX_ROOMPROPLISTCHUNKS 256
#define MAX_SHIELDHITS 20
#define MAX_SQUADRONS 16
#define MAX_TEAMS 8
@@ -2291,7 +2292,7 @@
#define MODELPART_BASIC_0064 0x0064 // type19
#define MODELPART_BASIC_0065 0x0065 // type19
#define MODELPART_BASIC_0066 0x0066 // type19
#define MODELPART_BASIC_0067 0x0067 // bbox
#define MODELPART_BASIC_SHIELD 0x0067 // bbox
#define MODELPART_BASIC_00C8 0x00c8 // toggle
#define MODELPART_BASIC_00C9 0x00c9 // toggle
#define MODELPART_BASIC_00CA 0x00ca // toggle
+10 -10
View File
@@ -51,22 +51,22 @@ void chr_hit(struct shotdata *shotdata, struct hit *hit);
void chr0f028498(bool value);
void chrs_check_for_noise(f32 noiseradius);
bool chr_calculate_auto_aim(struct prop *prop, struct coord *arg1, f32 *arg2, f32 *arg3);
s32 chr0f028e18(struct prop *arg0, struct modelnode *node, struct model *model, struct prop *arg3);
bool chr0f028e6c(s32 arg0, struct prop *prop, struct prop **propptr, struct modelnode **nodeptr, struct model **modelptr);
void shieldhit_create(struct prop *prop, f32 shield, struct prop *arg2, struct modelnode *node, struct model *model, s32 side, s16 *arg6);
s32 shieldhit_node_to_cmnum(struct prop *arg0, struct modelnode *node, struct model *model, struct prop *arg3);
bool shieldhit_cmnum_to_node(s32 arg0, struct prop *prop, struct prop **propptr, struct modelnode **nodeptr, struct model **modelptr);
void shieldhit_create(struct prop *rootprop, f32 shield, struct prop *hitprop, struct modelnode *node, struct model *model, s32 side, s16 *arg6);
void shieldhit_remove(struct shieldhit *shieldhit);
void shieldhits_remove_by_prop(struct prop *prop);
s32 chr0f02932c(struct prop *prop, s32 arg1);
s32 chr0f0293ec(struct prop *prop, s32 arg1);
s32 chr0f0294cc(struct prop *prop, s32 arg1);
void chr0f0295f8(f32 arg0, s32 *arg1, s32 *arg2, s32 *arg3);
f32 prop_get_shield_thing(struct prop **propptr);
Gfx *chr_render_shield_component(Gfx *gdl, struct shieldhit *hit, struct prop *prop, struct model *model, struct modelnode *node, s32 side, s32 arg6, s32 arg7, s32 alpha);
s32 shieldhit_find_parentnode_cmnum(struct prop *prop, s32 prevcmnum);
s32 shieldhit_find_childnode_cmnum(struct prop *prop, s32 prevcmnum);
s32 shieldhit_find_anynode_cmnum(struct prop *prop, s32 prevcmnum);
void shieldhit_health_to_rgb(f32 health, s32 *r, s32 *g, s32 *b);
f32 shieldhit_get_health(struct prop **propptr);
Gfx *shieldhit_render_component(Gfx *gdl, struct shieldhit *hit, struct prop *prop, struct model *model, struct modelnode *node, s32 side, s32 arg6, s32 arg7, s32 alpha);
Gfx *shieldhit_render(Gfx *gdl, struct prop *prop1, struct prop *prop2, s32 alpha, bool arg4, s32 cmnum1, s32 cmnum2, s32 cmnum3, s32 cmnum4);
Gfx *chr_render_cloak(Gfx *gdl, struct prop *chr1, struct prop *chr2);
Gfx *chr_render_shield(Gfx *gdl, struct chrdata *chr, u32 alpha);
void shieldhits_tick(void);
void chr_set_dr_caroll_images(struct chrdata *drcaroll, s32 imageleft, s32 imageright);
void chr_set_drcaroll_images(struct chrdata *drcaroll, s32 imageleft, s32 imageright);
s32 chrs_get_num_slots(void);
void chr_register(s32 chrnum, s32 chrindex);
Vtx *chr_allocate_vertices(s32 numvertices);
+4 -4
View File
@@ -48,11 +48,11 @@ void chr_knock_out(struct chrdata *chr, f32 angle, s32 hitpart, struct gset *gse
bool chr_is_anim_preventing_argh(struct chrdata *chr, f32 *arg1);
void chr_choke(struct chrdata *chr, s32 choketype);
void chr_set_shield(struct chrdata *chr, f32 shield);
bool func0f034080(struct chrdata *chr, struct modelnode *node, struct prop *prop, struct model *model, s32 side, s16 *arg5);
void chr_damage_by_misc(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *prop);
bool chr_try_create_shieldhit(struct chrdata *chr, struct modelnode *node, struct prop *prop, struct model *model, s32 side, s16 *arg5);
void chr_damage_by_dizziness(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *prop);
void chr_damage_by_laser(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *prop);
void func0f0341dc(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *prop, s32 hitpart, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg10);
void chr_damage_by_impact(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *prop, s32 arg5);
void chr_damage_by_impact(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *prop, s32 hitpart, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *hitpos);
void chr_damage_by_general(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *prop, s32 arg5);
void chr_damage_by_explosion(struct chrdata *chr, f32 damage, struct coord *vector, struct prop *prop, struct coord *explosionpos);
void player_update_damage_stats(struct prop *attacker, struct prop *victim, f32 damage);
void chr_damage(struct chrdata *chr, f32 damage, struct coord *vector, struct gset *gset, struct prop *aprop, s32 hitpart, bool damageshield, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg11, bool explosion, struct coord *explosionpos);
+3 -3
View File
@@ -5065,9 +5065,9 @@ struct shieldhit {
/*0x0c*/ s32 lvframe60;
/*0x10*/ s8 side;
/*0x11*/ s8 unk011;
/*0x12*/ s16 unk012;
/*0x14*/ s16 unk014;
/*0x14*/ s16 unk016;
/*0x12*/ s16 hitposx;
/*0x14*/ s16 hitposy;
/*0x14*/ s16 hitposz;
/*0x18*/ s8 unk018[32];
/*0x38*/ u8 unk038[32];
/*0x58*/ f32 shield;