diff --git a/src/files/setup/setuplue.c b/src/files/setup/setuplue.c index ecbded61d..4d722d15a 100644 --- a/src/files/setup/setuplue.c +++ b/src/files/setup/setuplue.c @@ -1556,22 +1556,22 @@ u8 func0417_traitor[] = { label(0x0c) if_chr_death_animation_finished(0x2f, /*goto*/ 0x2e) - chr_damage_chr(CHR_SELF, 0x2f, IBH_HEAD) + chr_damage_chr(CHR_SELF, 0x2f, HITPART_HEAD) goto_next(0x06) label(0x2e) if_chr_death_animation_finished(0x2e, /*goto*/ 0x2e) - chr_damage_chr(CHR_SELF, 0x2e, IBH_HEAD) + chr_damage_chr(CHR_SELF, 0x2e, HITPART_HEAD) goto_next(0x06) label(0x2e) if_chr_death_animation_finished(0x2d, /*goto*/ 0x2e) - chr_damage_chr(CHR_SELF, 0x2d, IBH_HEAD) + chr_damage_chr(CHR_SELF, 0x2d, HITPART_HEAD) goto_next(0x06) label(0x2e) if_chr_death_animation_finished(0x2c, /*goto*/ 0x06) - chr_damage_chr(CHR_SELF, 0x2c, IBH_HEAD) + chr_damage_chr(CHR_SELF, 0x2c, HITPART_HEAD) label(0x06) goto_first(0x09) diff --git a/src/game/chr/chr.c b/src/game/chr/chr.c index 62f9e784d..da409c8a2 100644 --- a/src/game/chr/chr.c +++ b/src/game/chr/chr.c @@ -4461,7 +4461,7 @@ void chrInit(struct prop *prop, u8 *ailist) chr->extraspeed.x = 0; chr->extraspeed.y = 0; chr->extraspeed.z = 0; - chr->ivebeenhit = 0; + chr->hitpart = 0; chr->voicebox = 0; chr->pushspeed[0] = 0; chr->pushspeed[1] = 0; @@ -12354,7 +12354,7 @@ Gfx *chrRender(struct prop *prop, Gfx *gdl, bool withalpha) struct var80062a8c *var80062a8c = NULL; -void chrEmitSparks(struct chrdata *chr, struct prop *prop, s32 ibh, struct coord *coord, struct coord *coord2, struct chrdata *chr2) +void chrEmitSparks(struct chrdata *chr, struct prop *prop, s32 hitpart, struct coord *coord, struct coord *coord2, struct chrdata *chr2) { struct prop *chrprop = chr->prop; s32 race; @@ -12372,8 +12372,8 @@ void chrEmitSparks(struct chrdata *chr, struct prop *prop, s32 ibh, struct coord if (prop->type == PROPTYPE_OBJ || prop->type == PROPTYPE_WEAPON || prop->type == PROPTYPE_DOOR - || ibh == IBH_GUN - || ibh == IBH_HAT) { + || hitpart == HITPART_GUN + || hitpart == HITPART_HAT) { sparksCreate(chrprop->rooms[0], chrprop, coord, coord2, 0, 0); return; } diff --git a/src/game/chr/chraction.c b/src/game/chr/chraction.c index 4556dccb8..a929e286c 100644 --- a/src/game/chr/chraction.c +++ b/src/game/chr/chraction.c @@ -738,46 +738,46 @@ struct animtablerow g_SpecialDieAnims[] = { struct animtable g_AnimTablesHuman[] = { { 0, NULL, NULL, 0, 0 }, - { IBH_LFOOT, g_DeathAnimsHumanLfoot, g_InjuryAnimsHumanLfoot, 0, 0 }, - { IBH_LSHIN, g_DeathAnimsHumanLshin, g_InjuryAnimsHumanLshin, 0, 0 }, - { IBH_LTHIGH, g_DeathAnimsHumanLthigh, g_InjuryAnimsHumanLthigh, 0, 0 }, - { IBH_RFOOT, g_DeathAnimsHumanRfoot, g_InjuryAnimsHumanRfoot, 0, 0 }, - { IBH_RSHIN, g_DeathAnimsHumanRshin, g_InjuryAnimsHumanRshin, 0, 0 }, - { IBH_RTHIGH, g_DeathAnimsHumanRthigh, g_InjuryAnimsHumanRthigh, 0, 0 }, - { IBH_PELVIS, g_DeathAnimsHumanPelvis, g_InjuryAnimsHumanPelvis, 0, 0 }, - { IBH_HEAD, g_DeathAnimsHumanHead, g_InjuryAnimsHumanHead, 0, 0 }, - { IBH_LHAND, g_DeathAnimsHumanLhand, g_InjuryAnimsHumanLhand, 0, 0 }, - { IBH_LFOREARM, g_DeathAnimsHumanForearm, g_InjuryAnimsHumanForearm, 0, 0 }, - { IBH_LBICEP, g_DeathAnimsHumanLbicep, g_InjuryAnimsHumanLbicep, 0, 0 }, - { IBH_RHAND, g_DeathAnimsHumanRhand, g_InjuryAnimsHumanRhand, 0, 0 }, - { IBH_RFOREARM, g_DeathAnimsHumanRforearm, g_InjuryAnimsHumanRforearm, 0, 0 }, - { IBH_RBICEP, g_DeathAnimsHumanRbicep, g_InjuryAnimsHumanRbicep, 0, 0 }, - { IBH_TORSO, g_DeathAnimsHumanTorso, g_InjuryAnimsHumanTorso, 0, 0 }, - { IBH_GUN, g_DeathAnimsHumanGun, g_InjuryAnimsHumanGun, 0, 0 }, - { IBH_HAT, NULL, NULL, 0, 0 }, + { HITPART_LFOOT, g_DeathAnimsHumanLfoot, g_InjuryAnimsHumanLfoot, 0, 0 }, + { HITPART_LSHIN, g_DeathAnimsHumanLshin, g_InjuryAnimsHumanLshin, 0, 0 }, + { HITPART_LTHIGH, g_DeathAnimsHumanLthigh, g_InjuryAnimsHumanLthigh, 0, 0 }, + { HITPART_RFOOT, g_DeathAnimsHumanRfoot, g_InjuryAnimsHumanRfoot, 0, 0 }, + { HITPART_RSHIN, g_DeathAnimsHumanRshin, g_InjuryAnimsHumanRshin, 0, 0 }, + { HITPART_RTHIGH, g_DeathAnimsHumanRthigh, g_InjuryAnimsHumanRthigh, 0, 0 }, + { HITPART_PELVIS, g_DeathAnimsHumanPelvis, g_InjuryAnimsHumanPelvis, 0, 0 }, + { HITPART_HEAD, g_DeathAnimsHumanHead, g_InjuryAnimsHumanHead, 0, 0 }, + { HITPART_LHAND, g_DeathAnimsHumanLhand, g_InjuryAnimsHumanLhand, 0, 0 }, + { HITPART_LFOREARM, g_DeathAnimsHumanForearm, g_InjuryAnimsHumanForearm, 0, 0 }, + { HITPART_LBICEP, g_DeathAnimsHumanLbicep, g_InjuryAnimsHumanLbicep, 0, 0 }, + { HITPART_RHAND, g_DeathAnimsHumanRhand, g_InjuryAnimsHumanRhand, 0, 0 }, + { HITPART_RFOREARM, g_DeathAnimsHumanRforearm, g_InjuryAnimsHumanRforearm, 0, 0 }, + { HITPART_RBICEP, g_DeathAnimsHumanRbicep, g_InjuryAnimsHumanRbicep, 0, 0 }, + { HITPART_TORSO, g_DeathAnimsHumanTorso, g_InjuryAnimsHumanTorso, 0, 0 }, + { HITPART_GUN, g_DeathAnimsHumanGun, g_InjuryAnimsHumanGun, 0, 0 }, + { HITPART_HAT, NULL, NULL, 0, 0 }, { -1, NULL, NULL, 0, 0 }, }; struct animtable g_AnimTablesSkedar[] = { { 0, NULL, NULL, 0, 0 }, - { IBH_LFOOT, g_DeathAnimsSkedarLfoot, g_InjuryAnimsSkedarLfoot, 0, 0 }, - { IBH_LSHIN, g_DeathAnimsSkedarLshin, g_InjuryAnimsSkedarLshin, 0, 0 }, - { IBH_LTHIGH, g_DeathAnimsSkedarLthigh, g_InjuryAnimsSkedarLthigh, 0, 0 }, - { IBH_RFOOT, g_DeathAnimsSkedarRfoot, g_InjuryAnimsSkedarRfoot, 0, 0 }, - { IBH_RSHIN, g_DeathAnimsSkedarRshin, g_InjuryAnimsSkedarRshin, 0, 0 }, - { IBH_RTHIGH, g_DeathAnimsSkedarRthigh, g_InjuryAnimsSkedarRthigh, 0, 0 }, - { IBH_PELVIS, g_DeathAnimsSkedarPelvis, g_InjuryAnimsSkedarPelvis, 0, 0 }, - { IBH_HEAD, g_DeathAnimsSkedarHead, g_InjuryAnimsSkedarHead, 0, 0 }, - { IBH_LHAND, g_DeathAnimsSkedarLhand, g_InjuryAnimsSkedarLhand, 0, 0 }, - { IBH_LFOREARM, g_DeathAnimsSkedarLforearm, g_InjuryAnimsSkedarLforearm, 0, 0 }, - { IBH_LBICEP, g_DeathAnimsSkedarLbicep, g_InjuryAnimsSkedarLbicep, 0, 0 }, - { IBH_RHAND, g_DeathAnimsSkedarRhand, g_InjuryAnimsSkedarRhand, 0, 0 }, - { IBH_RFOREARM, g_DeathAnimsSkedarRforearm, g_InjuryAnimsSkedarRforearm, 0, 0 }, - { IBH_RBICEP, g_DeathAnimsSkedarRbicep, g_InjuryAnimsSkedarRbicep, 0, 0 }, - { IBH_TORSO, g_DeathAnimsSkedarTorso, g_InjuryAnimsSkedarTorso, 0, 0 }, - { IBH_GUN, g_DeathAnimsSkedarGun, g_InjuryAnimsSkedarGun, 0, 0 }, - { IBH_HAT, g_DeathAnimsSkedarHead, g_InjuryAnimsSkedarHead, 0, 0 }, - { IBH_TAIL, g_DeathAnimsSkedarTail, g_InjuryAnimsSkedarTail, 0, 0 }, + { HITPART_LFOOT, g_DeathAnimsSkedarLfoot, g_InjuryAnimsSkedarLfoot, 0, 0 }, + { HITPART_LSHIN, g_DeathAnimsSkedarLshin, g_InjuryAnimsSkedarLshin, 0, 0 }, + { HITPART_LTHIGH, g_DeathAnimsSkedarLthigh, g_InjuryAnimsSkedarLthigh, 0, 0 }, + { HITPART_RFOOT, g_DeathAnimsSkedarRfoot, g_InjuryAnimsSkedarRfoot, 0, 0 }, + { HITPART_RSHIN, g_DeathAnimsSkedarRshin, g_InjuryAnimsSkedarRshin, 0, 0 }, + { HITPART_RTHIGH, g_DeathAnimsSkedarRthigh, g_InjuryAnimsSkedarRthigh, 0, 0 }, + { HITPART_PELVIS, g_DeathAnimsSkedarPelvis, g_InjuryAnimsSkedarPelvis, 0, 0 }, + { HITPART_HEAD, g_DeathAnimsSkedarHead, g_InjuryAnimsSkedarHead, 0, 0 }, + { HITPART_LHAND, g_DeathAnimsSkedarLhand, g_InjuryAnimsSkedarLhand, 0, 0 }, + { HITPART_LFOREARM, g_DeathAnimsSkedarLforearm, g_InjuryAnimsSkedarLforearm, 0, 0 }, + { HITPART_LBICEP, g_DeathAnimsSkedarLbicep, g_InjuryAnimsSkedarLbicep, 0, 0 }, + { HITPART_RHAND, g_DeathAnimsSkedarRhand, g_InjuryAnimsSkedarRhand, 0, 0 }, + { HITPART_RFOREARM, g_DeathAnimsSkedarRforearm, g_InjuryAnimsSkedarRforearm, 0, 0 }, + { HITPART_RBICEP, g_DeathAnimsSkedarRbicep, g_InjuryAnimsSkedarRbicep, 0, 0 }, + { HITPART_TORSO, g_DeathAnimsSkedarTorso, g_InjuryAnimsSkedarTorso, 0, 0 }, + { HITPART_GUN, g_DeathAnimsSkedarGun, g_InjuryAnimsSkedarGun, 0, 0 }, + { HITPART_HAT, g_DeathAnimsSkedarHead, g_InjuryAnimsSkedarHead, 0, 0 }, + { HITPART_TAIL, g_DeathAnimsSkedarTail, g_InjuryAnimsSkedarTail, 0, 0 }, { -1, NULL, NULL, 0, 0 }, }; @@ -3019,7 +3019,7 @@ u8 var80068080 = 50; * - Updating kill statistics * - Dropping items */ -void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 ibh, struct shorthand *hand, bool knockout, s32 aplayernum) +void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 hitpart, struct shorthand *hand, bool knockout, s32 aplayernum) { bool overridden = false; bool instant; @@ -3133,8 +3133,8 @@ void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 ibh // instant = whether to merge into death animation or switch to it instantly instant = chr->actiontype == ACT_ARGH && chr->act_argh.lvframe60 == g_Vars.lvframe60; - for (i = 0; g_AnimTablesByRace[race][i].ibh != -1; i++) { - if (g_AnimTablesByRace[race][i].ibh == ibh) { + for (i = 0; g_AnimTablesByRace[race][i].hitpart != -1; i++) { + if (g_AnimTablesByRace[race][i].hitpart == hitpart) { index = i; break; } @@ -3265,10 +3265,10 @@ void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 ibh overridden = true; - if (ibh == IBH_LBICEP || ibh == IBH_RBICEP) { + if (hitpart == HITPART_LBICEP || hitpart == HITPART_RBICEP) { row = &rows[0]; - if (ibh == IBH_LBICEP) { + if (hitpart == HITPART_LBICEP) { flip = true; } else { flip = false; @@ -3440,7 +3440,7 @@ void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 ibh } } -void chrBeginArgh(struct chrdata *chr, f32 angle, s32 ibh) +void chrBeginArgh(struct chrdata *chr, f32 angle, s32 hitpart) { bool doneanim = false; s32 instant; @@ -3477,12 +3477,12 @@ void chrBeginArgh(struct chrdata *chr, f32 angle, s32 ibh) instant = chr->actiontype == ACT_ARGH && chr->act_argh.lvframe60 == g_Vars.lvframe60; - for (i = 0; g_AnimTablesByRace[race][i].ibh != -1; i++) { - if (g_AnimTablesByRace[race][i].ibh == ibh) { + for (i = 0; g_AnimTablesByRace[race][i].hitpart != -1; i++) { + if (g_AnimTablesByRace[race][i].hitpart == hitpart) { index = i; - if (chr->ivebeenhit == 0) { - chr->ivebeenhit = ibh; + if (chr->hitpart == 0) { + chr->hitpart = hitpart; } break; @@ -3491,7 +3491,7 @@ void chrBeginArgh(struct chrdata *chr, f32 angle, s32 ibh) // If shot in the butt from behind, 2 in 5 chance of doing a special anim if (race == RACE_HUMAN - && ibh == IBH_PELVIS + && hitpart == HITPART_PELVIS && angle > 2.3558194637299f && angle < 3.9263656139374f && random() % 5 < 2) { @@ -3568,7 +3568,7 @@ void chrBeginArgh(struct chrdata *chr, f32 angle, s32 ibh) } } -void chrReactToDamage(struct chrdata *chr, struct coord *vector, f32 angle, s32 ibh, struct shorthand *hand, s32 aplayernum) +void chrReactToDamage(struct chrdata *chr, struct coord *vector, f32 angle, s32 hitpart, struct shorthand *hand, s32 aplayernum) { s32 race = CHRRACE(chr); bool knockedout = false; @@ -3603,7 +3603,7 @@ void chrReactToDamage(struct chrdata *chr, struct coord *vector, f32 angle, s32 } if (chr->damage >= chr->maxdamage) { - chrBeginDeath(chr, vector, angle, ibh, hand, false, aplayernum); + chrBeginDeath(chr, vector, angle, hitpart, hand, false, aplayernum); } else if (animnum == ANIM_SNIPING_GETDOWN || animnum == ANIM_SNIPING_GETUP || animnum == ANIM_SNIPING_ONGROUND) { @@ -3633,7 +3633,7 @@ void chrReactToDamage(struct chrdata *chr, struct coord *vector, f32 angle, s32 chrBeginArgh(chr, 0, 0); } } else if (!knockedout) { - chrBeginArgh(chr, angle, ibh); + chrBeginArgh(chr, angle, hitpart); } } @@ -3750,7 +3750,7 @@ s32 handGetBlurAmount(struct shorthand *hand) return amount; } -void chrKnockOut(struct chrdata *chr, f32 angle, s32 ibh, struct shorthand *hand) +void chrKnockOut(struct chrdata *chr, f32 angle, s32 hitpart, struct shorthand *hand) { if (chr->actiontype != ACT_DRUGGEDCOMINGUP && chr->actiontype != ACT_DRUGGEDDROP @@ -4137,7 +4137,7 @@ bool func0f034080(struct chrdata *chr, struct modelnode *node, struct prop *prop */ void chrDamageByMisc(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop) { - chrDamage(chr, damage, vector, hand, prop, IBH_GENERAL, + chrDamage(chr, damage, vector, hand, prop, HITPART_GENERAL, false, // damageshield NULL, // prop2 NULL, // node @@ -4150,7 +4150,7 @@ void chrDamageByMisc(struct chrdata *chr, f32 damage, struct coord *vector, stru void chrDamageByLaser(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop) { - chrDamage(chr, damage, vector, hand, prop, IBH_GENERAL, + chrDamage(chr, damage, vector, hand, prop, HITPART_GENERAL, true, // damageshield chr->prop, // prop2 NULL, // node @@ -4161,9 +4161,9 @@ void chrDamageByLaser(struct chrdata *chr, f32 damage, struct coord *vector, str NULL); // explosionpos } -void func0f0341dc(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop, u32 ibh, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg10) +void func0f0341dc(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop, u32 hitpart, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg10) { - chrDamage(chr, damage, vector, hand, prop, ibh, + chrDamage(chr, damage, vector, hand, prop, hitpart, true, // damageshield prop2, // prop2 node, // node @@ -4175,20 +4175,20 @@ void func0f0341dc(struct chrdata *chr, f32 damage, struct coord *vector, struct } /** - * Unused, and same as chrDamageByImpact but sets ibh to IBH_GENERAL instead of argument. + * Unused, and same as chrDamageByImpact but sets hitpart to HITPART_GENERAL instead of argument. */ void func0f034248(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop) { struct modelnode *node = NULL; struct model *model = NULL; s32 side = 0; - s32 ibh = IBH_GENERAL; + s32 hitpart = HITPART_GENERAL; if (chrGetShield(chr) >= 0 && chr->model) { - chrCalculateShieldHit(chr, &chr->prop->pos, vector, &node, &ibh, &model, &side); + chrCalculateShieldHit(chr, &chr->prop->pos, vector, &node, &hitpart, &model, &side); } - chrDamage(chr, damage, vector, hand, prop, IBH_GENERAL, + chrDamage(chr, damage, vector, hand, prop, HITPART_GENERAL, true, // damageshield chr->prop, // prop2 node, // node @@ -4202,17 +4202,17 @@ void func0f034248(struct chrdata *chr, f32 damage, struct coord *vector, struct /** * Used for punching, but also used by AI commands to make chrs take damage. */ -void chrDamageByImpact(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop, s32 ibh) +void chrDamageByImpact(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop, s32 hitpart) { struct modelnode *node = NULL; struct model *model = NULL; s32 side = 0; if (chrGetShield(chr) >= 0 && chr->model) { - chrCalculateShieldHit(chr, &chr->prop->pos, vector, &node, &ibh, &model, &side); + chrCalculateShieldHit(chr, &chr->prop->pos, vector, &node, &hitpart, &model, &side); } - chrDamage(chr, damage, vector, hand, prop, ibh, + chrDamage(chr, damage, vector, hand, prop, hitpart, true, // damageshield chr->prop, // prop2 node, // node @@ -4225,7 +4225,7 @@ void chrDamageByImpact(struct chrdata *chr, f32 damage, struct coord *vector, st void chrDamageByExplosion(struct chrdata *chr, f32 damage, struct coord *vector, struct prop *prop, struct coord *explosionpos) { - chrDamage(chr, damage, vector, NULL, prop, IBH_GENERAL, + chrDamage(chr, damage, vector, NULL, prop, HITPART_GENERAL, true, // damageshield chr->prop, // prop2 NULL, // node @@ -4271,7 +4271,7 @@ void playerUpdateDamageStats(struct prop *attacker, struct prop *victim, f32 dam * vector - position of the attacker? * hand - shorthand struct defining the weapon and gun function being used * aprop - the attacker's prop struct - * ibh - "i've been hit" value, ie. the body part (see IBH constants) + * hitpart - "i've been hit" value, ie. the body part (see HITPART constants) * damageshield - false if attack should bypass shield if any * prop2 - ? * node - if shielded, model node (of type bbox) which was hit @@ -4282,7 +4282,7 @@ void playerUpdateDamageStats(struct prop *attacker, struct prop *victim, f32 dam * explosionpos - position of said explosion */ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, - struct prop *aprop, s32 ibh, bool damageshield, struct prop *prop2, + 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) { @@ -4308,7 +4308,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho s32 aplayernum = -1; s32 choketype = CHOKETYPE_NONE; - if (ibh == IBH_HEAD) { + if (hitpart == HITPART_HEAD) { choketype = CHOKETYPE_GURGLE; } @@ -4605,12 +4605,12 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho } // Handle hat shots. This is left over from GE, as hats don't exist in PD - if (damage > 0 && ibh == IBH_HAT && chr->weapons_held[2]) { + if (damage > 0 && hitpart == HITPART_HAT && chr->weapons_held[2]) { s32 type = hatGetType(chr->weapons_held[2]); if (type == HATTYPE_CLOTH) { // Hat remains on head and damages the chr (eg. Moonraker Elite) - ibh = IBH_HEAD; + hitpart = HITPART_HEAD; } else if (type != HATTYPE_METAL) { // Normal hat damage = 0; @@ -4642,19 +4642,19 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho alreadydead = true; } - if (!alreadydead && ibh) { - switch (ibh) { - case IBH_HEAD: + if (!alreadydead && hitpart) { + switch (hitpart) { + case HITPART_HEAD: mpstatsIncrementPlayerShotCount2(hand, SHOTREGION_HEAD); break; - case IBH_GUN: + case HITPART_GUN: mpstatsIncrementPlayerShotCount2(hand, SHOTREGION_GUN); break; - case IBH_HAT: + case HITPART_HAT: mpstatsIncrementPlayerShotCount2(hand, SHOTREGION_HAT); break; - case IBH_PELVIS: - case IBH_TORSO: + case HITPART_PELVIS: + case HITPART_TORSO: mpstatsIncrementPlayerShotCount2(hand, SHOTREGION_BODY); break; default: @@ -4675,7 +4675,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho // If chr is dying or already dead, consider making their head flinch // then we're done if (chr->actiontype == ACT_DIE || chr->actiontype == ACT_DEAD) { - if (ibh == IBH_HEAD && chr->actiontype == ACT_DIE && race != RACE_SKEDAR && isfar) { + if (hitpart == HITPART_HEAD && chr->actiontype == ACT_DIE && race != RACE_SKEDAR && isfar) { struct coord pos; pos.x = vprop->pos.x - vector->x; pos.y = vprop->pos.y - vector->y; @@ -4726,24 +4726,24 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho forceapplydamage = true; } - if (ibh == IBH_GENERAL) { + if (hitpart == HITPART_GENERAL) { // Halve the damage because it's doubled for torso below - ibh = IBH_TORSO; + hitpart = HITPART_TORSO; damage *= 0.5f; - } else if (ibh == IBH_GENERALHALF) { + } else if (hitpart == HITPART_GENERALHALF) { // Likewise, quarter it here so it becomes half below - ibh = IBH_TORSO; + hitpart = HITPART_TORSO; damage *= 0.25f; } // Hits to a Skedar's tail are 10x more lethal - if (race == RACE_SKEDAR && ibh == IBH_TAIL) { + if (race == RACE_SKEDAR && hitpart == HITPART_TAIL) { damage *= 10; } // Apply damage multipliers based on which body parts were hit, // and flinch head if shot in the head - if (ibh == IBH_HEAD) { + if (hitpart == HITPART_HEAD) { if (race == RACE_SKEDAR) { damage += damage; chrFlinchHead(chr, angle); @@ -4759,14 +4759,14 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho } } } - } else if (ibh == IBH_TORSO) { + } else if (hitpart == HITPART_TORSO) { // Double damage for torso hits damage += damage; - } else if (ibh == IBH_GUN) { + } else if (hitpart == HITPART_GUN) { // No damage for gun hits damage = 0; makedizzy = false; - } else if (ibh == IBH_HAT) { + } else if (hitpart == HITPART_HAT) { // No damage for hat hits damage = 0; makedizzy = false; @@ -4956,7 +4956,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho // Handle one-hit knockouts if (onehitko && chr->aibot == NULL && race == RACE_HUMAN) { - chrKnockOut(chr, angle, ibh, hand); + chrKnockOut(chr, angle, hitpart, hand); func0f0926bc(chr->prop, 9, 0); if (canchoke) { @@ -5013,7 +5013,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho chr->damage = chr->maxdamage; if (race == RACE_DRCAROLL || race == RACE_EYESPY || race == RACE_ROBOT) { - chrBeginDeath(chr, vector, angle, ibh, hand, false, aplayernum); + chrBeginDeath(chr, vector, angle, hitpart, hand, false, aplayernum); } else { chrYeetFromPos(chr, explosionpos, explosionforce); } @@ -5063,7 +5063,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho if (makedizzy && chr->damage >= chr->maxdamage) { chr->damage = chr->maxdamage - 0.1f; - chrKnockOut(chr, angle, ibh, hand); + chrKnockOut(chr, angle, hitpart, hand); } // If chr has armour or the weapon doesn't stun @@ -5074,7 +5074,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho if (!chrIsAnimPreventingArgh(chr, &endframe)) { chrFlinchBody(chr); } - } else if (ibh != IBH_HAT) { + } else if (hitpart != HITPART_HAT) { // Cancel current animation and prepare for argh f32 endframe = -1; @@ -5088,7 +5088,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho chr->act_preargh.dir.y = vector->y; chr->act_preargh.dir.z = vector->z; chr->act_preargh.relshotdir = angle; - chr->act_preargh.hitpart = ibh; + chr->act_preargh.hitpart = hitpart; chr->act_preargh.aplayernum = aplayernum; chr->act_preargh.hand.weaponnum = hand->weaponnum; chr->act_preargh.hand.unk0639 = hand->unk0639; @@ -5097,7 +5097,7 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct sho chr->sleep = 0; } else { - chrReactToDamage(chr, vector, angle, ibh, hand, aplayernum); + chrReactToDamage(chr, vector, angle, hitpart, hand, aplayernum); } } } @@ -6675,20 +6675,20 @@ void chrGoPosChooseAnimation(struct chrdata *chr) if (heavy) { if (gospeed == SPEED_RUN) { // Human, heavy weapon, running - if (chr->ivebeenhit == IBH_LFOOT - || chr->ivebeenhit == IBH_LSHIN - || chr->ivebeenhit == IBH_LTHIGH - || chr->ivebeenhit == IBH_RFOOT - || chr->ivebeenhit == IBH_RSHIN - || chr->ivebeenhit == IBH_RTHIGH) { + if (chr->hitpart == HITPART_LFOOT + || chr->hitpart == HITPART_LSHIN + || chr->hitpart == HITPART_LTHIGH + || chr->hitpart == HITPART_RFOOT + || chr->hitpart == HITPART_RSHIN + || chr->hitpart == HITPART_RTHIGH) { anim = 0x20a; speed = 0.4; - } else if (chr->ivebeenhit == IBH_LHAND - || chr->ivebeenhit == IBH_LFOREARM - || chr->ivebeenhit == IBH_LBICEP - || chr->ivebeenhit == IBH_RHAND - || chr->ivebeenhit == IBH_RFOREARM - || chr->ivebeenhit == IBH_RBICEP) { + } else if (chr->hitpart == HITPART_LHAND + || chr->hitpart == HITPART_LFOREARM + || chr->hitpart == HITPART_LBICEP + || chr->hitpart == HITPART_RHAND + || chr->hitpart == HITPART_RFOREARM + || chr->hitpart == HITPART_RBICEP) { anim = 0x20d; speed = 0.4; } else { @@ -6705,38 +6705,38 @@ void chrGoPosChooseAnimation(struct chrdata *chr) } } else if (gospeed == SPEED_JOG) { // Human, heavy weapon, jogging - if (chr->ivebeenhit == IBH_LFOOT - || chr->ivebeenhit == IBH_LSHIN - || chr->ivebeenhit == IBH_LTHIGH - || chr->ivebeenhit == IBH_RFOOT - || chr->ivebeenhit == IBH_RSHIN - || chr->ivebeenhit == IBH_RTHIGH) { + if (chr->hitpart == HITPART_LFOOT + || chr->hitpart == HITPART_LSHIN + || chr->hitpart == HITPART_LTHIGH + || chr->hitpart == HITPART_RFOOT + || chr->hitpart == HITPART_RSHIN + || chr->hitpart == HITPART_RTHIGH) { anim = 0x1f9; - } else if (chr->ivebeenhit == IBH_LHAND - || chr->ivebeenhit == IBH_LFOREARM - || chr->ivebeenhit == IBH_LBICEP - || chr->ivebeenhit == IBH_RHAND - || chr->ivebeenhit == IBH_RFOREARM - || chr->ivebeenhit == IBH_RBICEP) { + } else if (chr->hitpart == HITPART_LHAND + || chr->hitpart == HITPART_LFOREARM + || chr->hitpart == HITPART_LBICEP + || chr->hitpart == HITPART_RHAND + || chr->hitpart == HITPART_RFOREARM + || chr->hitpart == HITPART_RBICEP) { anim = 0x1f8; } else { anim = 0x2a; } } else { // Human, heavy weapon, walking - if (chr->ivebeenhit == IBH_LFOOT - || chr->ivebeenhit == IBH_LSHIN - || chr->ivebeenhit == IBH_LTHIGH - || chr->ivebeenhit == IBH_RFOOT - || chr->ivebeenhit == IBH_RSHIN - || chr->ivebeenhit == IBH_RTHIGH) { + if (chr->hitpart == HITPART_LFOOT + || chr->hitpart == HITPART_LSHIN + || chr->hitpart == HITPART_LTHIGH + || chr->hitpart == HITPART_RFOOT + || chr->hitpart == HITPART_RSHIN + || chr->hitpart == HITPART_RTHIGH) { anim = 0x1f9; - } else if (chr->ivebeenhit == IBH_LHAND - || chr->ivebeenhit == IBH_LFOREARM - || chr->ivebeenhit == IBH_LBICEP - || chr->ivebeenhit == IBH_RHAND - || chr->ivebeenhit == IBH_RFOREARM - || chr->ivebeenhit == IBH_RBICEP) { + } else if (chr->hitpart == HITPART_LHAND + || chr->hitpart == HITPART_LFOREARM + || chr->hitpart == HITPART_LBICEP + || chr->hitpart == HITPART_RHAND + || chr->hitpart == HITPART_RFOREARM + || chr->hitpart == HITPART_RBICEP) { anim = 0x1f8; } else { if (random() % 2) { @@ -6749,27 +6749,27 @@ void chrGoPosChooseAnimation(struct chrdata *chr) } else { if (gospeed == SPEED_RUN) { // Human, light weapon, running - if (chr->ivebeenhit == IBH_LFOOT - || chr->ivebeenhit == IBH_LSHIN - || chr->ivebeenhit == IBH_LTHIGH) { + if (chr->hitpart == HITPART_LFOOT + || chr->hitpart == HITPART_LSHIN + || chr->hitpart == HITPART_LTHIGH) { anim = 0x20a; flip = true; speed = 0.4; - } else if (chr->ivebeenhit == IBH_RFOOT - || chr->ivebeenhit == IBH_RSHIN - || chr->ivebeenhit == IBH_RTHIGH) { + } else if (chr->hitpart == HITPART_RFOOT + || chr->hitpart == HITPART_RSHIN + || chr->hitpart == HITPART_RTHIGH) { anim = 0x20a; speed = 0.4; flip = false; - } else if (chr->ivebeenhit == IBH_LHAND - || chr->ivebeenhit == IBH_LFOREARM - || chr->ivebeenhit == IBH_LBICEP) { + } else if (chr->hitpart == HITPART_LHAND + || chr->hitpart == HITPART_LFOREARM + || chr->hitpart == HITPART_LBICEP) { anim = 0x20d; speed = 0.4; flip = true; - } else if (chr->ivebeenhit == IBH_RHAND - || chr->ivebeenhit == IBH_RFOREARM - || chr->ivebeenhit == IBH_RBICEP) { + } else if (chr->hitpart == HITPART_RHAND + || chr->hitpart == HITPART_RFOREARM + || chr->hitpart == HITPART_RBICEP) { anim = 0x20d; speed = 0.4; flip = false; @@ -6801,24 +6801,24 @@ void chrGoPosChooseAnimation(struct chrdata *chr) } } else if (gospeed == SPEED_JOG) { // Human, light weapon, jogging - if (chr->ivebeenhit == IBH_LFOOT - || chr->ivebeenhit == IBH_LSHIN - || chr->ivebeenhit == IBH_LTHIGH) { + if (chr->hitpart == HITPART_LFOOT + || chr->hitpart == HITPART_LSHIN + || chr->hitpart == HITPART_LTHIGH) { anim = 0x1f9; flip = false; - } else if (chr->ivebeenhit == IBH_RFOOT - || chr->ivebeenhit == IBH_RSHIN - || chr->ivebeenhit == IBH_RTHIGH) { + } else if (chr->hitpart == HITPART_RFOOT + || chr->hitpart == HITPART_RSHIN + || chr->hitpart == HITPART_RTHIGH) { anim = 0x1f9; flip = true; - } else if (chr->ivebeenhit == IBH_LHAND - || chr->ivebeenhit == IBH_LFOREARM - || chr->ivebeenhit == IBH_LBICEP) { + } else if (chr->hitpart == HITPART_LHAND + || chr->hitpart == HITPART_LFOREARM + || chr->hitpart == HITPART_LBICEP) { anim = 0x1f8; flip = false; - } else if (chr->ivebeenhit == IBH_RHAND - || chr->ivebeenhit == IBH_RFOREARM - || chr->ivebeenhit == IBH_RBICEP) { + } else if (chr->hitpart == HITPART_RHAND + || chr->hitpart == HITPART_RFOREARM + || chr->hitpart == HITPART_RBICEP) { anim = 0x1f8; flip = true; } else if (stageGetIndex(g_Vars.stagenum) == STAGE_MAIANSOS) { @@ -6844,24 +6844,24 @@ void chrGoPosChooseAnimation(struct chrdata *chr) // Human, light weapon, walking s32 anims[] = {0x6b, 0x1b, 0x16}; - if (chr->ivebeenhit == IBH_LFOOT - || chr->ivebeenhit == IBH_LSHIN - || chr->ivebeenhit == IBH_LTHIGH) { + if (chr->hitpart == HITPART_LFOOT + || chr->hitpart == HITPART_LSHIN + || chr->hitpart == HITPART_LTHIGH) { anim = 0x1f9; flip = false; - } else if (chr->ivebeenhit == IBH_RFOOT - || chr->ivebeenhit == IBH_RSHIN - || chr->ivebeenhit == IBH_RTHIGH) { + } else if (chr->hitpart == HITPART_RFOOT + || chr->hitpart == HITPART_RSHIN + || chr->hitpart == HITPART_RTHIGH) { anim = 0x1f9; flip = true; - } else if (chr->ivebeenhit == IBH_LHAND - || chr->ivebeenhit == IBH_LFOREARM - || chr->ivebeenhit == IBH_LBICEP) { + } else if (chr->hitpart == HITPART_LHAND + || chr->hitpart == HITPART_LFOREARM + || chr->hitpart == HITPART_LBICEP) { anim = 0x1f8; flip = false; - } else if (chr->ivebeenhit == IBH_RHAND - || chr->ivebeenhit == IBH_RFOREARM - || chr->ivebeenhit == IBH_RBICEP) { + } else if (chr->hitpart == HITPART_RHAND + || chr->hitpart == HITPART_RFOREARM + || chr->hitpart == HITPART_RBICEP) { anim = 0x1f8; flip = true; } else if (male) { @@ -10362,7 +10362,7 @@ glabel chrTickDruggedComingUp // if (!done) { // i++; // -// if (g_AnimTablesByRace[race][i].ibh == -1) { +// if (g_AnimTablesByRace[race][i].hitpart == -1) { // done = true; // } // } @@ -12505,14 +12505,14 @@ bool func0f03fde4(struct chrdata *chr, s32 handnum, struct coord *arg2) * Shield hits are calculated using the bounding box of each body part. * This gives a bit of padding around the chr which can register as a hit. * - * nodeptr - will be populated with a pointer to the bbox model node. - * ibhptr - will be populated with the IBH value. See the IBH constants. - * modelptr - will be populated with a pointer to the chr's model. - * sideptr - will be populated with an index in the range 0-5 which - * represents which side of the node's bounding box was hit. + * nodeptr - will be populated with a pointer to the bbox model node. + * hitpartptr - will be populated with the HITPART constant value. + * modelptr - will be populated with a pointer to the chr's model. + * sideptr - will be populated with an index in the range 0-5 which + * represents which side of the node's bounding box was hit. */ void chrCalculateShieldHit(struct chrdata *chr, struct coord *pos, struct coord *vector, - struct modelnode **nodeptr, s32 *ibhptr, struct model **modelptr, s32 *sideptr) + struct modelnode **nodeptr, s32 *hitpartptr, struct model **modelptr, s32 *sideptr) { u32 stack1; struct prop *prop = chr->prop; @@ -12594,7 +12594,7 @@ void chrCalculateShieldHit(struct chrdata *chr, struct coord *pos, struct coord Mtxf sp48; struct modelrodata_bbox *rodata = &bestnode->rodata->bbox; - *ibhptr = rodata->ibh; + *hitpartptr = rodata->hitpart; *nodeptr = bestnode; *modelptr = chr->model; *sideptr = 0; @@ -12641,8 +12641,8 @@ void chrCalculateShieldHit(struct chrdata *chr, struct coord *pos, struct coord if ((node->type & 0xff) == MODELNODETYPE_BBOX) { struct modelrodata_bbox *rodata = &node->rodata->bbox; - if (rodata->ibh == IBH_TORSO) { - *ibhptr = rodata->ibh; + if (rodata->hitpart == HITPART_TORSO) { + *hitpartptr = rodata->hitpart; *nodeptr = node; *modelptr = chr->model; *sideptr = 0; diff --git a/src/game/game_1999b0.c b/src/game/game_1999b0.c index 89f4d2492..284f93241 100644 --- a/src/game/game_1999b0.c +++ b/src/game/game_1999b0.c @@ -237,7 +237,7 @@ bool aibotDoFarsightThing(struct chrdata *chr, u32 arg1, struct coord *vector, s struct modelnode *node = NULL; struct model *model = NULL; s32 side = -1; - s32 ibh = IBH_GENERAL; + s32 hitpart = HITPART_GENERAL; struct shorthand hand = {WEAPON_FARSIGHT, 0, 0, FUNC_PRIMARY}; f32 damage = handGetDamage(&hand); s32 fallback = 30; @@ -270,11 +270,11 @@ bool aibotDoFarsightThing(struct chrdata *chr, u32 arg1, struct coord *vector, s handPlayPropHitSound(&hand, oppprop, -1); if (oppchr->model && chrGetShield(oppchr) > 0) { - chrCalculateShieldHit(oppchr, &oppprop->pos, vector, &node, &ibh, &model, &side); + chrCalculateShieldHit(oppchr, &oppprop->pos, vector, &node, &hitpart, &model, &side); } - chrEmitSparks(oppchr, oppprop, ibh, &oppprop->pos, vector, chr); - func0f0341dc(oppchr, damage, vector, &hand, chr->prop, IBH_GENERAL, oppprop, node, model, side, 0); + chrEmitSparks(oppchr, oppprop, hitpart, &oppprop->pos, vector, chr); + func0f0341dc(oppchr, damage, vector, &hand, chr->prop, HITPART_GENERAL, oppprop, node, model, side, 0); } } diff --git a/src/game/prop.c b/src/game/prop.c index 481c789a6..78bd2d8a2 100644 --- a/src/game/prop.c +++ b/src/game/prop.c @@ -2385,7 +2385,7 @@ void handInflictCloseRangeDamage(s32 handnum, struct shorthand *hand, bool arg2) struct modelnode *node = NULL; struct model *model = NULL; s32 side = -1; - s32 ibh = IBH_TORSO; + s32 hitpart = HITPART_TORSO; if (!chrIsAvoiding(chr)) { handCalculateShotSpread(&spb8, &vector, handnum, true); @@ -2394,19 +2394,19 @@ void handInflictCloseRangeDamage(s32 handnum, struct shorthand *hand, bool arg2) handPlayPropHitSound(hand, prop, -1); if (chr->model && chrGetShield(chr) > 0) { - chrCalculateShieldHit(chr, &playerprop->pos, &vector, &node, &ibh, &model, &side); + chrCalculateShieldHit(chr, &playerprop->pos, &vector, &node, &hitpart, &model, &side); } if (bmoveGetCrouchPos() == CROUCHPOS_DUCK) { - ibh = IBH_GENERAL; + hitpart = HITPART_GENERAL; } else if (bmoveGetCrouchPos() == CROUCHPOS_SQUAT) { - ibh = IBH_GENERALHALF; + hitpart = HITPART_GENERALHALF; } else { - ibh = IBH_TORSO; + hitpart = HITPART_TORSO; } func0f0341dc(chr, handGetDamage(hand), &vector, hand, - g_Vars.currentplayer->prop, ibh, chr->prop, node, model, side, 0); + g_Vars.currentplayer->prop, hitpart, chr->prop, node, model, side, 0); } } } diff --git a/src/include/commands.h b/src/include/commands.h index 7e9fc4cef..3ccadc3b0 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -268,7 +268,7 @@ #define damage_chr(chr, weapon) \ mkshort(0x0019), \ chr, \ - IBH_HEAD, \ + HITPART_HEAD, \ weapon, \ 0, \ 0, \ @@ -279,14 +279,14 @@ * done, nor is any bullet beam shown and the chrs don't even need line of sight * to each other. * - * The ibh value is the body part the victim is shot in. - * It's expected to be an IBH constant. + * The hitpart value is the body part the victim is shot in. + * It's expected to be a HITPART constant. */ -#define chr_damage_chr(achr, vchr, ibh) \ +#define chr_damage_chr(achr, vchr, hitpart) \ mkshort(0x001a), \ achr, \ vchr, \ - ibh, + hitpart, /** * Makes the chr consider throwing a grenade, using their grenade probability diff --git a/src/include/constants.h b/src/include/constants.h index 10d08e3d7..233a1a0de 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -1072,6 +1072,27 @@ #define HEALTHSHOWMODE_CURRENT 4 // full height, showing current amount #define HEALTHSHOWMODE_CLOSING 5 // height collapsing +#define HITPART_LFOOT 1 +#define HITPART_LSHIN 2 +#define HITPART_LTHIGH 3 +#define HITPART_RFOOT 4 +#define HITPART_RSHIN 5 +#define HITPART_RTHIGH 6 +#define HITPART_PELVIS 7 +#define HITPART_HEAD 8 +#define HITPART_LHAND 9 +#define HITPART_LFOREARM 10 +#define HITPART_LBICEP 11 +#define HITPART_RHAND 12 +#define HITPART_RFOREARM 13 +#define HITPART_RBICEP 14 +#define HITPART_TORSO 15 +#define HITPART_TAIL 16 +#define HITPART_GUN 100 +#define HITPART_HAT 110 +#define HITPART_GENERAL 200 +#define HITPART_GENERALHALF 201 + #define HUDMSGFLAG_ONLYIFALIVE 0x1 #define HUDMSGFLAG_2 0x2 #define HUDMSGFLAG_4 0x4 @@ -1095,28 +1116,6 @@ #define HUDMSGTYPE_TRAINING 10 #define HUDMSGTYPE_11 11 -// chr->ivebeenhit values -#define IBH_LFOOT 1 -#define IBH_LSHIN 2 -#define IBH_LTHIGH 3 -#define IBH_RFOOT 4 -#define IBH_RSHIN 5 -#define IBH_RTHIGH 6 -#define IBH_PELVIS 7 -#define IBH_HEAD 8 -#define IBH_LHAND 9 -#define IBH_LFOREARM 10 -#define IBH_LBICEP 11 -#define IBH_RHAND 12 -#define IBH_RFOREARM 13 -#define IBH_RBICEP 14 -#define IBH_TORSO 15 -#define IBH_TAIL 16 -#define IBH_GUN 100 -#define IBH_HAT 110 -#define IBH_GENERAL 200 -#define IBH_GENERALHALF 201 - #define IDLEACTION_STANDING 0x01 #define IDLEACTION_SITTING_TYPING 0x02 #define IDLEACTION_SITTING_DORMANT 0x03 diff --git a/src/include/game/chr/chr.h b/src/include/game/chr/chr.h index 4b0e841ff..0ee8d3c7c 100644 --- a/src/include/game/chr/chr.h +++ b/src/include/game/chr/chr.h @@ -36,7 +36,7 @@ bool func0f024b18(struct model *model, struct modelnode *node); void chrRenderAttachedObject(struct prop *prop, struct modelrenderdata *renderdata, bool withalpha, struct chrdata *chr); void bodyGetBloodColour(s16 bodynum, u8 *colour1, u32 *colour2); Gfx *chrRender(struct prop *prop, Gfx *gdl, bool withalpha); -void chrEmitSparks(struct chrdata *chr, struct prop *prop, s32 ibh, struct coord *coord, struct coord *coord2, struct chrdata *chr2); +void chrEmitSparks(struct chrdata *chr, struct prop *prop, s32 hitpart, struct coord *coord, struct coord *coord2, struct chrdata *chr2); u32 func0f0260c4(void); u32 func0f0268bc(void); u32 func0f0270f4(void); diff --git a/src/include/game/chr/chraction.h b/src/include/game/chr/chraction.h index 5581bca84..9463caec6 100644 --- a/src/include/game/chr/chraction.h +++ b/src/include/game/chr/chraction.h @@ -49,23 +49,23 @@ void chrStartAnim(struct chrdata *chr, s32 animnum, f32 startframe, f32 endframe void func0f031254(struct chrdata *chr); void chrAttack(struct chrdata *chr, struct attackanimgroup **animgroups, bool flip, bool *firing, u32 attackflags, s32 entityid, bool standing); void chrAttackAmount(struct chrdata *chr, u32 attackflags, u32 entityid, u32 maxshots); -void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 ibh, struct shorthand *hand, bool knockout, s32 aplayernum); -void chrBeginArgh(struct chrdata *chr, f32 angle, s32 ibh); -void chrReactToDamage(struct chrdata *chr, struct coord *dir, f32 angle, s32 ibh, struct shorthand *hand, s32 playernum); +void chrBeginDeath(struct chrdata *chr, struct coord *dir, f32 relangle, s32 hitpart, struct shorthand *hand, bool knockout, s32 aplayernum); +void chrBeginArgh(struct chrdata *chr, f32 angle, s32 hitpart); +void chrReactToDamage(struct chrdata *chr, struct coord *dir, f32 angle, s32 hitpart, struct shorthand *hand, s32 playernum); void chrYeetFromPos(struct chrdata *chr, struct coord *pos, f32 arg2); s32 handGetBlurAmount(struct shorthand *hand); -void chrKnockOut(struct chrdata *chr, f32 angle, s32 ibh, struct shorthand *hand); +void chrKnockOut(struct chrdata *chr, f32 angle, s32 hitpart, struct shorthand *hand); bool chrIsAnimPreventingArgh(struct chrdata *chr, f32 *arg1); void chrChoke(struct chrdata *chr, s32 choketype); void chrSetShield(struct chrdata *chr, f32 shield); bool func0f034080(struct chrdata *chr, struct modelnode *node, struct prop *prop, struct model *model, s32 side, s16 *arg5); void chrDamageByMisc(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop); void chrDamageByLaser(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop); -void func0f0341dc(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop, u32 ibh, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg10); +void func0f0341dc(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop, u32 hitpart, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg10); void chrDamageByImpact(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *prop, s32 arg5); void chrDamageByExplosion(struct chrdata *chr, f32 damage, struct coord *vector, struct prop *prop, struct coord *explosionpos); void playerUpdateDamageStats(struct prop *attacker, struct prop *victim, f32 damage); -void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, struct prop *aprop, s32 ibh, bool damageshield, struct prop *prop2, struct modelnode *node, struct model *model, s32 side, s16 *arg11, bool explosion, struct coord *explosionpos); +void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct shorthand *hand, 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); u32 func0f03645c(void); bool func0f03654c(struct chrdata *chr, struct coord *pos, s16 *rooms, struct coord *pos2, s16 *rooms2, struct coord *vector, f32 arg6, u32 types); bool propchrHasClearLineToPos(struct prop *prop, struct coord *dstpos, struct coord *vector); @@ -144,7 +144,7 @@ u32 func0f03f778(void); f32 chrGetAimLimitAngle(f32 sqdist); void chrCalculateHit(struct chrdata *chr, bool *angleokptr, bool *hit, struct shorthand *hand); bool func0f03fde4(struct chrdata *chr, s32 handnum, struct coord *arg2); -void chrCalculateShieldHit(struct chrdata *chr, struct coord *pos, struct coord *vector, struct modelnode **node, s32 *ibh, struct model **model, s32 *side); +void chrCalculateShieldHit(struct chrdata *chr, struct coord *pos, struct coord *vector, struct modelnode **node, s32 *hitpart, struct model **model, s32 *side); void func0f04031c(struct coord *coord, f32 arg1, struct coord *coord2, f32 *arg3); u32 func0f0404d4(void); u32 func0f041a74(void); diff --git a/src/include/types.h b/src/include/types.h index daa59a2dd..0ed9ac108 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -561,7 +561,7 @@ struct modelrodata_reorder { // type 0x09 }; struct modelrodata_bbox { // type 0x0a - s32 ibh; + s32 hitpart; f32 xmin; f32 xmax; f32 ymin; @@ -1387,7 +1387,7 @@ struct chrdata { /*0x2ec*/ f32 elapseextra; /*0x2f0*/ struct coord extraspeed; /*0x2fc*/ u8 yvisang; - /*0x2fd*/ u8 ivebeenhit; + /*0x2fd*/ u8 hitpart; /*0x2fe*/ u8 race; /*0x2ff*/ u8 blurnumtimesdied; /*0x300*/ struct prop *gunprop; @@ -5056,7 +5056,7 @@ struct animtablerow { }; struct animtable { - s32 ibh; + s32 hitpart; struct animtablerow *deathanims; struct animtablerow *injuryanims; s32 deathanimcount; diff --git a/src/lib/model.c b/src/lib/model.c index a978e219d..52f46766a 100644 --- a/src/lib/model.c +++ b/src/lib/model.c @@ -6112,7 +6112,7 @@ s32 func000225d4(struct model *model, struct coord *arg1, struct coord *arg2, st if (func000220fc(rodata, mtx, arg1, arg2)) { *startnode = node; - return rodata->bbox.ibh; + return rodata->bbox.hitpart; } dochildren = false;