Attempt to decompile chrTickDruggedComingUp

This commit is contained in:
Ryan Dwyer 2021-04-25 21:56:01 +10:00
parent 147c6c2ff0
commit ea2a03b031
2 changed files with 79 additions and 4 deletions

View File

@ -5084,7 +5084,7 @@ void chrKnockOut(struct chrdata *chr, f32 angle, s32 ibh, struct shorthand *hand
mpstatsIncrementTotalKnockoutCount();
chr->actiontype = ACT_DRUGGEDCOMINGUP;
chr->act_druggedcomingup.unk02c = 0;
chr->act_druggedcomingup.timer60 = 0;
}
}
@ -12116,6 +12116,83 @@ glabel chrTickDruggedComingUp
/* f03da88: 27bd00a8 */ addiu $sp,$sp,0xa8
);
// Mismatch: regalloc
//void chrTickDruggedComingUp(struct chrdata *chr)
//{
// u16 thuds[] = {
// SFX_THUD_808D,
// SFX_THUD_808E,
// SFX_THUD_808F,
// SFX_THUD_8090,
// SFX_THUD_8091,
// SFX_THUD_8092,
// SFX_THUD_8093,
// SFX_THUD_8094,
// SFX_THUD_8095,
// SFX_THUD_8096,
// SFX_THUD_8097,
// };
//
// u32 stack;
//
// chr->act_druggedcomingup.timer60 += g_Vars.lvupdate240_60;
//
// if (chr->act_druggedcomingup.timer60 > 0) {
// s32 race = CHRRACE(chr);
// struct model *model = chr->model;
// s32 i = 0;
// bool done = false;
// struct prop *weapon;
//
// chrUncloak(chr, true);
//
// chr->actiontype = ACT_DRUGGEDDROP;
//
// while (!done) {
// if (i >= 0
// && g_AnimTablesByRace[race][i].deathanims != NULL
// && g_AnimTablesByRace[race][i].deathanimcount > 0) {
// struct animtablerow *row = &g_AnimTablesByRace[race][i].deathanims[random() % g_AnimTablesByRace[race][i].deathanimcount];
//
// chr->act_druggeddrop.thudframe1 = row->thudframe1;
// chr->act_druggeddrop.thudframe2 = row->thudframe2;
//
// modelSetAnimationWithMerge(model, row->animnum, row->flip, 0, row->speed, 16, true);
//
// if (row->endframe >= 0) {
// modelSetAnimEndFrame(model, row->endframe);
// }
//
// done = true;
// }
//
// if (!done) {
// i++;
//
// if (g_AnimTablesByRace[race][i].ibh == -1) {
// done = true;
// }
// }
// }
//
// weapon = chr->weapons_held[HAND_RIGHT];
//
// if (weapon && (weapon->obj->flags & OBJFLAG_00002000) == 0) {
// propobjSetDropped(weapon, DROPREASON_1);
// chr->hidden |= CHRHFLAG_00000001;
// }
//
// weapon = chr->weapons_held[HAND_LEFT];
//
// if (weapon && (weapon->obj->flags & OBJFLAG_00002000) == 0) {
// propobjSetDropped(weapon, DROPREASON_1);
// chr->hidden |= CHRHFLAG_00000001;
// }
//
// chrDropItems(chr);
// }
//}
void chrTickDruggedDrop(struct chrdata *chr)
{
struct model *model = chr->model;

View File

@ -1133,9 +1133,7 @@ struct act_druggedko {
};
struct act_druggedcomingup {
/*0x2c*/ s16 unk02c; // timer
/*0x30*/ f32 unk030;
/*0x34*/ f32 unk034;
/*0x2c*/ s16 timer60;
};
struct act_attackamount_2c {