Merge pull request #2133 from KieronJ/target

Renames for TARGET
This commit is contained in:
Kieron 2025-10-22 17:55:08 +01:00 committed by GitHub
commit 846e8f1af7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
48 changed files with 489 additions and 459 deletions

View File

@ -1115,7 +1115,7 @@
8004E41C 60 sna_sub_8004E41C
8004E458 104 sub_8004E458
8004E4C0 92 sub_8004E4C0
8004E51C 108 sub_8004E51C
8004E51C 108 sna_line_check
8004E588 96 sub_8004E588
8004E5E8 308 sub_8004E5E8
8004E71C 236 sna_8004E71C

View File

@ -80,7 +80,7 @@ static void Act(BakudanWork *work)
work->map_index = target->map;
// if the target is not alive, destroy the actor
if (!target->field_20)
if (!target->body)
{
GV_DestroyActor(&work->actor);
return;

View File

@ -10,6 +10,7 @@
#include "anime/animconv/anime.h"
#include "game/game.h"
#include "sd/g_sound.h"
#include "linkvar.h"
#include "strcode.h"
/*---------------------------------------------------------------------------*/
@ -31,14 +32,14 @@ typedef struct _Work
/*---------------------------------------------------------------------------*/
BLAST_DATA blast_data_8009F4B8[8] = {
{ 0x100, 5, 0x3E8, 0x7D0, 2 },
{ 0x100, 5, 0x3E8, 0x7D0, 6 },
{ 0x100, 5, 0x3E8, 0x7D0, 5 },
{ 0x100, 5, 0x3E8, 0x7D0, 4 },
{ 0x100, 5, 0x3E8, 0x7D0, 3 },
{ 0x100, 5, 0x3E8, 0x7D0, -1 },
{ 0x400, 5, 0x3E8, 0x7D0, 10 },
{ 0, 0, 1, 1, -1 }
{ 0x100, 5, 0x3E8, 0x7D0, WP_Grenade },
{ 0x100, 5, 0x3E8, 0x7D0, WP_C4 },
{ 0x100, 5, 0x3E8, 0x7D0, WP_Claymore },
{ 0x100, 5, 0x3E8, 0x7D0, WP_Stinger },
{ 0x100, 5, 0x3E8, 0x7D0, WP_Nikita },
{ 0x100, 5, 0x3E8, 0x7D0, WP_None },
{ 0x400, 5, 0x3E8, 0x7D0, WP_Max },
{ 0, 0, 1, 1, WP_None }
};
/*---------------------------------------------------------------------------*/
@ -106,7 +107,7 @@ static void InitBlastTarget(BLAST_DATA *blast_data, Work *work, int side)
GM_Target_8002DCCC(target, 7, 2, blast_data->field_0 >> 1, blast_data->field_4, svector_8009F558);
target->field_44 = blast_data->field_10;
target->weapon = blast_data->weapon;
GM_MoveTarget(&work->target, &work->pos);
GM_PowerTarget(target);
@ -125,7 +126,7 @@ static void InitBlastTarget(BLAST_DATA *blast_data, Work *work, int side)
GM_Target_8002DCCC(target, 7, 2, blast_data->field_0 >> 1, 3, svector_8009F558);
target->field_44 = blast_data->field_10;
target->weapon = blast_data->weapon;
GM_MoveTarget(&work->target, &work->pos);
GM_PowerTarget(target);

View File

@ -14,7 +14,7 @@ typedef struct BLAST_DATA
int field_4;
int field_8_z; // size
int field_C; // also size?
int field_10; // TARGET->field_44
int weapon;
} BLAST_DATA;
void *NewBlast( MATRIX *world, BLAST_DATA *blast_data );

View File

@ -329,7 +329,7 @@ static void Act(JiraiWork *work)
return;
}
if ((target2->field_40 & 1) && (GM_PlayerStatus & (PLAYER_INVINCIBLE | PLAYER_GROUND)))
if ((target2->push_side & PLAYER_SIDE) && (GM_PlayerStatus & (PLAYER_INVINCIBLE | PLAYER_GROUND)))
{
target2->damaged &= ~TARGET_PUSH;
dword_8009F444 = 0;

View File

@ -283,9 +283,21 @@ Target_Data stru_8009EFE4[4] =
{{0, 0, 0, 0}, {501, 600, 501, 0}, 0, 0, 7, 0}
};
MATRIX stru_8009F064 = {{{-200, 200, 600}, {0, 400, 200}, {400, 0, 5}}, {50, 0, 1}};
MATRIX stru_8009F084 = {{{200, 200, 600}, {0, 400, 200}, {400, 0, -5}}, {50, 0, 1}};
MATRIX stru_8009F0A4 = {{{0, 200, 600}, {0, 500, 250}, {500, 0, 0}}, {100, 0, 3}};
typedef struct _PUNCH
{
SVECTOR field_0;
SVECTOR size;
SVECTOR field_10;
int life;
int faint;
} PUNCH;
PUNCH punch_info[] =
{
{{-200, 200, 600}, {400, 200, 400}, {5, 0, 50}, 0, 1},
{{200, 200, 600}, {400, 200, 400}, {-5, 0, 50}, 0, 1},
{{0, 200, 600}, {500, 250, 500}, {0, 0, 100}, 0, 3}
};
GV_PAD GV_PadData_8009F0C4 = {0, 0, 0, 0, -1, 0, 0, 0, 0, 0};
@ -714,7 +726,7 @@ int sna_8004F544(SnaInitWork *work, SVECTOR param_2, int a3, int a4, int a5)
DG_PutVector(&vec3, &vec2, 1);
DG_SetPos(&mtx);
iVar2 = sub_8004E51C(&vec1, work->control.map->hzd, a4, a5);
iVar2 = sna_line_check(&vec1, work->control.map->hzd, a4, a5);
bVar1 = a3 < iVar2;
@ -795,19 +807,19 @@ void UpdateLife_8004F6E8(SnaInitWork *work)
}
if (sna_check_flags1_8004E31C(work,SNA_FLAG1_UNK25) &&
(GM_SnakeCurrentHealth == work->field_89C_pTarget->field_26_hp))
(GM_SnakeCurrentHealth == work->field_89C_pTarget->life))
{
return;
}
if ((work->field_9A8_current_item == IT_BodyArmor) && (work->field_89C_pTarget->a_mode == 1))
{
work->field_89C_pTarget->field_28 /= 2;
work->field_89C_pTarget->field_26_hp += work->field_89C_pTarget->field_28;
work->field_89C_pTarget->field_28 = 0;
work->field_89C_pTarget->life_lost /= 2;
work->field_89C_pTarget->life += work->field_89C_pTarget->life_lost;
work->field_89C_pTarget->life_lost = 0;
}
health = work->field_89C_pTarget->field_26_hp + GM_SnakeCurrentHealth - work->field_A22_snake_current_health;
health = work->field_89C_pTarget->life + GM_SnakeCurrentHealth - work->field_A22_snake_current_health;
if (health > GM_SnakeMaxHealth)
{
@ -819,7 +831,7 @@ void UpdateLife_8004F6E8(SnaInitWork *work)
health = 0;
}
if (work->field_89C_pTarget->field_44 != 10)
if (work->field_89C_pTarget->weapon != WP_Max)
{
health = sna_update_life_helper_8004F6E8(health, work->field_9A8_current_item);
}
@ -828,7 +840,7 @@ void UpdateLife_8004F6E8(SnaInitWork *work)
health = 0;
}
work->field_89C_pTarget->field_26_hp = health;
work->field_89C_pTarget->life = health;
work->field_A22_snake_current_health = health;
GM_SnakeCurrentHealth = health;
@ -983,27 +995,27 @@ void GM_CheckShukanReverseAnalog(unsigned char *pInput)
}
}
int sub_8004FCB8(SnaInitWork *work, MATRIX *pMtx, int param_3)
int sub_8004FCB8(SnaInitWork *work, PUNCH *punch, int a_mode)
{
TARGET *pTarget;
SVECTOR vec;
SVECTOR vec_arr[2];
TARGET *target;
SVECTOR vec;
SVECTOR line[2];
pTarget = &work->field_8A0_target;
GM_SetTarget(pTarget, 4, PLAYER_SIDE, (SVECTOR *)&pMtx->m[1][1]);
DG_RotVector((SVECTOR *)&pMtx->m[2][2], &vec, 1);
GM_Target_8002DCCC(pTarget, 3, param_3, pMtx->t[1], pMtx->t[2], &vec);
DG_PutVector((SVECTOR *)&pMtx->m[0], &vec, 1);
target = &work->field_8A0_target;
GM_SetTarget(target, 4, PLAYER_SIDE, &punch->size);
DG_RotVector(&punch->field_10, &vec, 1);
GM_Target_8002DCCC(target, 3, a_mode, punch->life, punch->faint, &vec);
DG_PutVector(&punch->field_0, &vec, 1);
vec_arr[0].vx = work->body.objs->objs[5].world.t[0];
vec_arr[0].vy = work->body.objs->objs[5].world.t[1];
vec_arr[0].vz = work->body.objs->objs[5].world.t[2];
vec_arr[1] = vec;
line[0].vx = work->body.objs->objs[5].world.t[0];
line[0].vy = work->body.objs->objs[5].world.t[1];
line[0].vz = work->body.objs->objs[5].world.t[2];
line[1] = vec;
if ( sub_8004E51C(vec_arr, work->control.map->hzd, HZD_CHECK_ALL, SEGMENT_ATR) < 0 )
if ( sna_line_check(line, work->control.map->hzd, HZD_CHECK_ALL, SEGMENT_ATR) < 0 )
{
GM_MoveTarget(pTarget, &vec);
return GM_PowerTarget(pTarget);
GM_MoveTarget(target, &vec);
return GM_PowerTarget(target);
}
return 0;
@ -1042,21 +1054,21 @@ int sna_8004FDE8(SnaInitWork *work, Target_Data *pTargetData)
if (pTarget->class & 0x20)
{
pTarget->damaged &= ~flags;
pTarget->field_2A += pTargetData->field_1C;
pTarget->faint += pTargetData->field_1C;
return 0;
}
vecs[0] = work->control.mov;
vecs[1] = pTarget->center;
if (sub_8004E51C(vecs, work->control.map->hzd, HZD_CHECK_ALL, SEGMENT_ATR) < 0)
if (sna_line_check(vecs, work->control.map->hzd, HZD_CHECK_ALL, SEGMENT_ATR) < 0)
{
work->field_8E8_pTarget = pTarget;
return 1;
}
pTarget->damaged &= ~flags;
pTarget->field_2A += pTargetData->field_1C;
pTarget->faint += pTargetData->field_1C;
}
return 0;
@ -1799,11 +1811,11 @@ helper3:
void sna_act_unk2_80051170(TARGET *param_1)
{
param_1->field_28 = 0;
param_1->field_2A = 0;
param_1->life_lost = 0;
param_1->faint = 0;
param_1->damaged &= ~(0x80 | 0x04);
param_1->field_2C_vec = DG_ZeroVector;
param_1->field_44 = -1;
param_1->scale = DG_ZeroVector;
param_1->weapon = WP_None;
param_1->a_mode = 0;
}
@ -2190,7 +2202,7 @@ void sna_80051A10(SnaInitWork *work, SVECTOR *pPos, SVECTOR *pOut, SVECTOR *pVec
vec = *pPos;
vec2 = *pVec;
if (sub_8004E51C(&vec, work->control.map->hzd, HZD_CHECK_ALL, SEGMENT_ATR) < 0)
if (sna_line_check(&vec, work->control.map->hzd, HZD_CHECK_ALL, SEGMENT_ATR) < 0)
{
vec2 = *pVec;
}
@ -3781,7 +3793,7 @@ void sna_anim_shot_flinch_800544E0(SnaInitWork *work, int time)
work->field_9CC_anim_update_fn_1p = sna_fn_80052540;
sna_set_invuln_8004F2A0(work, 0);
if (work->field_89C_pTarget->field_26_hp < 1)
if (work->field_89C_pTarget->life < 1)
{
GM_SeSet2(0, 0x3f, SE_PLAYEROUT);
sna_8004F8E4(work, work->field_A26_stance == SNA_STANCE_CROUCH ? 125 : 128);
@ -3828,7 +3840,7 @@ void sna_act_helper2_helper7_80054648(SnaInitWork *work, int time)
SetAction_8004E22C(work, work->actpack->special2->field_4, 4);
if (work->field_89C_pTarget->field_26_hp <= 0)
if (work->field_89C_pTarget->life <= 0)
{
GM_SeSet2(0, 63, SE_PLAYEROUT);
sna_8004F8E4(work, 128);
@ -3869,7 +3881,7 @@ void sna_anim_knockdown_80054710(SnaInitWork *work, int time)
SetAction_8004E22C(work, bVar1, 4);
if (work->field_89C_pTarget->field_26_hp < 1 && GM_GameOverTimer == 0)
if (work->field_89C_pTarget->life < 1 && GM_GameOverTimer == 0)
{
GM_SeSet2(0, 0x3f, SE_PLAYEROUT);
GM_GameOverTimer = -1;
@ -3943,7 +3955,7 @@ void sna_anim_knockdown_idle_80054930(SnaInitWork *work, int time)
action_flag = work->actpack->damage->field_5;
}
SetAction_8004E22C(work, action_flag, 4);
if (work->field_89C_pTarget->field_26_hp <= 0)
if (work->field_89C_pTarget->life <= 0)
{
v5 = 127;
if (work->field_A54.prone_bool_thing == 1)
@ -4010,7 +4022,7 @@ void sna_anim_knockdown_shot_80054B50(SnaInitWork *work)
GM_ClearPlayerStatusFlag(PLAYER_DAMAGED);
if (work->field_89C_pTarget->field_26_hp <= 0 && !GM_GameOverTimer)
if (work->field_89C_pTarget->life <= 0 && !GM_GameOverTimer)
{
GM_SeSet2(0, 63, SE_PLAYEROUT);
sna_8004F8E4(work, work->field_A54.prone_bool_thing == 1 ? 126 : 127);
@ -4045,7 +4057,7 @@ void sna_anim_knockdown_shot_tank_80054C08(SnaInitWork *work, int time)
SetAction_8004E22C(work, bVar1, 4);
if (work->field_89C_pTarget->field_26_hp < 1 && GM_GameOverTimer == 0)
if (work->field_89C_pTarget->life < 1 && GM_GameOverTimer == 0)
{
GM_SeSet2(0, 0x3f, SE_PLAYEROUT);
GM_GameOverTimer = -1;
@ -5575,7 +5587,7 @@ void sna_800571B8(SnaInitWork *work, int time)
if (time == 6)
{
GM_SeSet(&work->control.mov, SE_C4_PUT);
NewBakudan(work->field_8E8_pTarget->field_20, &svector_800AB7F4, 1, 1, work->field_8E8_pTarget);
NewBakudan(work->field_8E8_pTarget->body, &svector_800AB7F4, 1, 1, work->field_8E8_pTarget);
work->field_914_trigger = 5;
work->field_8E8_pTarget->damaged &= ~(0x40);
work->field_8E8_pTarget = 0;
@ -6588,7 +6600,7 @@ void sna_anim_chokethrow_begin2_80058C80(SnaInitWork *work, int time)
field_8E8_pTarget = work->field_8E8_pTarget;
field_8E8_pTarget->field_2A--;
field_8E8_pTarget->faint--;
DG_SetPos2(&field_8E8_pTarget->center, &work->control.rot);
@ -6700,8 +6712,8 @@ void sna_anim_choke_kill_80058F88(SnaInitWork *work, int time)
SetAction_8004E22C(work, action_flag, 4);
field_8E8_pTarget->a_mode = action_flag;
field_8E8_pTarget->field_28 = 5;
field_8E8_pTarget->field_2A--;
field_8E8_pTarget->life_lost = 5;
field_8E8_pTarget->faint--;
work->field_A54.choke_count = 0;
}
@ -6743,8 +6755,8 @@ void sna_anim_choke_drag_80059054(SnaInitWork *work, int time)
}
else
{
if (!((work->field_8E8_pTarget->field_26_hp > 0) &&
((iVar3 < 0x5a && work->field_8E8_pTarget->field_42 != 0))))
if (!((work->field_8E8_pTarget->life > 0) &&
((iVar3 < 0x5a && work->field_8E8_pTarget->captured != 0))))
{
GM_ClearPlayerStatusFlag(PLAYER_MOVE);
@ -6799,7 +6811,7 @@ void sna_anim_punch_helper_800591F4(SnaInitWork *work, int time)
if ( time == 4 )
{
sub_8004FCB8(work, &stru_8009F064, 3);
sub_8004FCB8(work, &punch_info[0], 3);
sound = SE_PUNCH_SWING;
if ( GM_CheckPlayerStatusFlag(PLAYER_IN_THE_WATER) )
@ -6824,7 +6836,7 @@ void sna_anim_punch_helper_800591F4(SnaInitWork *work, int time)
if ( time == 11 )
{
sub_8004FCB8(work, &stru_8009F084, 3);
sub_8004FCB8(work, &punch_info[1], 3);
sound = SE_PUNCH_SWING;
if ( GM_CheckPlayerStatusFlag(PLAYER_IN_THE_WATER) )
@ -6849,7 +6861,7 @@ void sna_anim_punch_helper_800591F4(SnaInitWork *work, int time)
if ( time == 22 )
{
sub_8004FCB8(work, &stru_8009F0A4, 4);
sub_8004FCB8(work, &punch_info[2], 4);
sound = SE_KICK_SWING;
if ( GM_CheckPlayerStatusFlag(PLAYER_IN_THE_WATER) )
@ -6883,8 +6895,8 @@ void sna_anim_choke_helper_8005951C(SnaInitWork *work, int time)
sinceLastChoke = ++work->field_904_frames_last_choke;
if (((work->field_8E8_pTarget->field_26_hp < 1 || sinceLastChoke >= 90) ||
work->field_8E8_pTarget->field_42 == 0))
if (((work->field_8E8_pTarget->life < 1 || sinceLastChoke >= 90) ||
work->field_8E8_pTarget->captured == 0))
{
sna_sub_8004E41C(work, 2);
sna_start_anim_8004E1F4(work, sna_anim_choke_hold_80059154);
@ -6923,7 +6935,7 @@ void sna_anim_choke_rechoke_helper_8005961C(SnaInitWork *work, int time)
{
if (time == 0 || (work->field_9B0_pad_ptr->press & PAD_SQUARE) != 0)
{
work->field_8E8_pTarget->field_2A--;
work->field_8E8_pTarget->faint--;
if (++work->field_A54.choke_count >= 10) // feels good
{
@ -6935,7 +6947,7 @@ void sna_anim_choke_rechoke_helper_8005961C(SnaInitWork *work, int time)
}
}
if (work->body.is_end == 0 && work->field_8E8_pTarget->field_42 != 0)
if (work->body.is_end == 0 && work->field_8E8_pTarget->captured != 0)
{
return;
}
@ -7465,7 +7477,7 @@ static inline void sna_init_main_logic_helper4_800596FC(SnaInitWork *work)
}
else
{
work->field_A2C = pTarget->field_2C_vec;
work->field_A2C = pTarget->scale;
work->field_A2C.vx /= 2;
work->field_A2C.vy /= 4;
work->field_A2C.vz /= 2;
@ -7504,7 +7516,7 @@ static inline void sna_init_main_logic_helper4_800596FC(SnaInitWork *work)
{
sna_set_invuln_8004F2A0(work, 0x20);
if (pTarget->field_28 > 0)
if (pTarget->life_lost > 0)
{
sna_act_helper2_helper4_8004F090(work, pTarget->a_mode);
}
@ -7526,7 +7538,7 @@ static inline void sna_init_main_logic_helper4_800596FC(SnaInitWork *work)
}
if ((pTarget->field_26_hp < 1) && ((GM_GameOverTimer > -2) && (GM_GameOverTimer < 1)))
if ((pTarget->life < 1) && ((GM_GameOverTimer > -2) && (GM_GameOverTimer < 1)))
{
if (GM_CheckPlayerStatusFlag(PLAYER_INTRUDE | PLAYER_GROUND))
{
@ -8039,9 +8051,9 @@ void sna_act_8005AD10(SnaInitWork *work)
if ( pTarget->damaged & 8 )
{
GV_AddVec3(&pTarget->field_34_vec, &work->control.step, &work->control.step);
GV_AddVec3(&pTarget->offset, &work->control.step, &work->control.step);
pTarget->damaged &= ~0x8;
pTarget->field_34_vec = DG_ZeroVector;
pTarget->offset = DG_ZeroVector;
}
height = (short)work->body.height;
@ -8152,7 +8164,7 @@ void sna_act_8005AD10(SnaInitWork *work)
sna_init_main_logic_800596FC(work);
pTarget2 = work->field_89C_pTarget;
pTarget2->field_2C_vec = work->control.step;
pTarget2->scale = work->control.step;
GM_PushTarget(pTarget2);
if ( ((GM_Camera.first_person != 0) && GM_CheckPlayerStatusFlag(PLAYER_NORMAL_WATCH)) || GM_CheckPlayerStatusFlag(PLAYER_INTRUDE) )

View File

@ -329,7 +329,7 @@ void CheckSnakeDead_8004E384(SnaInitWork *snake);
void sna_sub_8004E41C(SnaInitWork *snake, unsigned short flags);
int sub_8004E458(short param_1, int param_2);
int sub_8004E4C0(SnaInitWork *work, int param_2);
int sub_8004E51C(SVECTOR *param_1, void *param_2, int param_3, int param_4);
int sna_line_check(SVECTOR *line, HZD_HDL *hzd, int flag, int exclude);
void sub_8004E588(HZD_HDL *param_1, SVECTOR *param_2, int *levels);
int sub_8004E930(SnaInitWork *snake, int arg1);
void sub_8004E9D0(SnaInitWork *work);

View File

@ -216,15 +216,16 @@ int sub_8004E4C0(SnaInitWork *work, int param_2)
return param_2;
}
int sub_8004E51C(SVECTOR *param_1, void *param_2, int param_3, int param_4)
int sna_line_check(SVECTOR *line, HZD_HDL *hzd, int flag, int exclude)
{
if (HZD_LineCheck(param_2, param_1, &param_1[1], param_3, param_4) == 0)
if (HZD_LineCheck(hzd, &line[0], &line[1], flag, exclude) == 0)
{
return -1;
}
HZD_LineNearVec(&param_1[1]);
GV_SubVec3(&param_1[1], param_1, param_1);
return GV_VecLen3(param_1);
HZD_LineNearVec(&line[1]);
GV_SubVec3(&line[1], line, line);
return GV_VecLen3(line);
}
void sub_8004E588(HZD_HDL *param_1, SVECTOR *param_2, int *levels)
@ -310,7 +311,7 @@ int sna_8004E71C(int a1, HZD_HDL *pHzd, SVECTOR *pVec, int a4)
vec_saved = *pVec;
if ( sub_8004E51C(&vec, pHzd, HZD_CHECK_DYNSEG | HZD_CHECK_SEG, SEGMENT_ATR) >= 0 )
if ( sna_line_check(&vec, pHzd, HZD_CHECK_DYNSEG | HZD_CHECK_SEG, SEGMENT_ATR) >= 0 )
{
*pVec = vec_saved;
}
@ -343,7 +344,7 @@ int sna_8004E808(SnaInitWork *work, int a2, int a3, int a4, int a5)
return 1;
}
if (sub_8004E51C(&SStack48, work->control.map->hzd, HZD_CHECK_DYNFLR | HZD_CHECK_FLR, SEGMENT_ATR) < 0)
if (sna_line_check(&SStack48, work->control.map->hzd, HZD_CHECK_DYNFLR | HZD_CHECK_FLR, SEGMENT_ATR) < 0)
{
return 1;
}

View File

@ -238,9 +238,21 @@ Target_Data stru_8009EFE4[4] =
{{0, 0, 0, 0}, {501, 600, 501, 0}, 0, 0, 7, 0}
};
MATRIX stru_8009F064 = {{{-200, 200, 600}, {0, 400, 200}, {400, 0, 5}}, {50, 0, 1}};
MATRIX stru_8009F084 = {{{200, 200, 600}, {0, 400, 200}, {400, 0, -5}}, {50, 0, 1}};
MATRIX stru_8009F0A4 = {{{0, 200, 600}, {0, 500, 250}, {500, 0, 0}}, {100, 0, 3}};
typedef struct _PUNCH
{
SVECTOR field_0;
SVECTOR size;
SVECTOR field_10;
int life;
int faint;
} PUNCH;
PUNCH punch_info[] =
{
{{-200, 200, 600}, {400, 200, 400}, {5, 0, 50}, 0, 1},
{ {200, 200, 600}, {400, 200, 400}, {-5, 0, 50}, 0, 1},
{{0, 200, 600}, {500, 250, 500}, {0, 0, 100}, 0, 3}
};
GV_PAD GV_PadData_8009F0C4 = {0, 0, 0, 0, -1, 0, 0, 0, 0, 0};
@ -659,7 +671,7 @@ int sna_8004F544(SnaInitWork *work, SVECTOR param_2, int a3, int a4, int a5)
DG_PutVector(&vec3, &vec2, 1);
DG_SetPos(&mtx);
iVar2 = sub_8004E51C(&vec1, work->control.map->hzd, a4, a5);
iVar2 = sna_line_check(&vec1, work->control.map->hzd, a4, a5);
bVar1 = a3 < iVar2;
@ -739,9 +751,9 @@ void UpdateLife_8004F6E8(SnaInitWork *work)
{
target = work->field_89C_pTarget;
if (target->field_28 > 0)
if (target->life_lost > 0)
{
target->field_26_hp += target->field_28;
target->life += target->life_lost;
sna_act_unk2_80051170(work->field_89C_pTarget);
sna_set_flags1_8004E2F4(work, SNA_FLAG1_UNK25);
@ -756,19 +768,19 @@ void UpdateLife_8004F6E8(SnaInitWork *work)
}
if (sna_check_flags1_8004E31C(work,SNA_FLAG1_UNK25) &&
(GM_SnakeCurrentHealth == work->field_89C_pTarget->field_26_hp))
(GM_SnakeCurrentHealth == work->field_89C_pTarget->life))
{
return;
}
if ((work->field_9A8_current_item == IT_BodyArmor) && (work->field_89C_pTarget->a_mode == 1))
{
work->field_89C_pTarget->field_28 /= 2;
work->field_89C_pTarget->field_26_hp += work->field_89C_pTarget->field_28;
work->field_89C_pTarget->field_28 = 0;
work->field_89C_pTarget->life_lost /= 2;
work->field_89C_pTarget->life += work->field_89C_pTarget->life_lost;
work->field_89C_pTarget->life_lost = 0;
}
health = work->field_89C_pTarget->field_26_hp + GM_SnakeCurrentHealth - work->field_A22_snake_current_health;
health = work->field_89C_pTarget->life + GM_SnakeCurrentHealth - work->field_A22_snake_current_health;
if (health > GM_SnakeMaxHealth)
{
@ -780,7 +792,7 @@ void UpdateLife_8004F6E8(SnaInitWork *work)
health = 0;
}
if (work->field_89C_pTarget->field_44 != 10)
if (work->field_89C_pTarget->weapon != WP_Max)
{
health = sna_update_life_helper_8004F6E8(health, work->field_9A8_current_item);
}
@ -789,7 +801,7 @@ void UpdateLife_8004F6E8(SnaInitWork *work)
health = 0;
}
work->field_89C_pTarget->field_26_hp = health;
work->field_89C_pTarget->life = health;
work->field_A22_snake_current_health = health;
GM_SnakeCurrentHealth = health;
@ -924,27 +936,27 @@ void GM_CheckShukanReverseAnalog(unsigned char *pInput)
}
}
int sub_8004FCB8(SnaInitWork *work, MATRIX *pMtx, int param_3)
int sub_8004FCB8(SnaInitWork *work, PUNCH *punch, int a_mode)
{
TARGET *pTarget;
SVECTOR vec;
SVECTOR vec_arr[2];
TARGET *target;
SVECTOR vec;
SVECTOR line[2];
pTarget = &work->field_8A0_target;
GM_SetTarget(pTarget, 4, PLAYER_SIDE, (SVECTOR *)&pMtx->m[1][1]);
DG_RotVector((SVECTOR *)&pMtx->m[2][2], &vec, 1);
GM_Target_8002DCCC(pTarget, 3, param_3, pMtx->t[1], pMtx->t[2], &vec);
DG_PutVector((SVECTOR *)&pMtx->m[0], &vec, 1);
target = &work->field_8A0_target;
GM_SetTarget(target, 4, PLAYER_SIDE, &punch->size);
DG_RotVector(&punch->field_10, &vec, 1);
GM_Target_8002DCCC(target, 3, a_mode, punch->life, punch->faint, &vec);
DG_PutVector(&punch->field_0, &vec, 1);
vec_arr[0].vx = work->body.objs->objs[5].world.t[0];
vec_arr[0].vy = work->body.objs->objs[5].world.t[1];
vec_arr[0].vz = work->body.objs->objs[5].world.t[2];
vec_arr[1] = vec;
line[0].vx = work->body.objs->objs[5].world.t[0];
line[0].vy = work->body.objs->objs[5].world.t[1];
line[0].vz = work->body.objs->objs[5].world.t[2];
line[1] = vec;
if ( sub_8004E51C(vec_arr, work->control.map->hzd, HZD_CHECK_ALL, SEGMENT_ATR) < 0 )
if ( sna_line_check(line, work->control.map->hzd, HZD_CHECK_ALL, SEGMENT_ATR) < 0 )
{
GM_MoveTarget(pTarget, &vec);
return GM_PowerTarget(pTarget);
GM_MoveTarget(target, &vec);
return GM_PowerTarget(target);
}
return 0;
@ -983,21 +995,21 @@ int sna_8004FDE8(SnaInitWork *work, Target_Data *pTargetData)
if (pTarget->class & 0x20)
{
pTarget->damaged &= ~flags;
pTarget->field_2A += pTargetData->field_1C;
pTarget->faint += pTargetData->field_1C;
return 0;
}
vecs[0] = work->control.mov;
vecs[1] = pTarget->center;
if (sub_8004E51C(vecs, work->control.map->hzd, HZD_CHECK_ALL, SEGMENT_ATR) < 0)
if (sna_line_check(vecs, work->control.map->hzd, HZD_CHECK_ALL, SEGMENT_ATR) < 0)
{
work->field_8E8_pTarget = pTarget;
return 1;
}
pTarget->damaged &= ~flags;
pTarget->field_2A += pTargetData->field_1C;
pTarget->faint += pTargetData->field_1C;
}
return 0;
@ -1740,11 +1752,11 @@ helper3:
void sna_act_unk2_80051170(TARGET *param_1)
{
param_1->field_28 = 0;
param_1->field_2A = 0;
param_1->life_lost = 0;
param_1->faint = 0;
param_1->damaged &= ~(0x80 | 0x04);
param_1->field_2C_vec = DG_ZeroVector;
param_1->field_44 = -1;
param_1->scale = DG_ZeroVector;
param_1->weapon = WP_None;
param_1->a_mode = 0;
}
@ -3110,7 +3122,7 @@ void sna_anim_shot_flinch_800544E0(SnaInitWork *work, int time)
work->field_9CC_anim_update_fn_1p = sna_fn_80052540;
sna_set_invuln_8004F2A0(work, 0);
if (work->field_89C_pTarget->field_26_hp < 1)
if (work->field_89C_pTarget->life < 1)
{
GM_SeSet2(0, 0x3f, SE_PLAYEROUT);
sna_8004F8E4(work, work->field_A26_stance == SNA_STANCE_CROUCH ? 125 : 128);
@ -3157,7 +3169,7 @@ void sna_act_helper2_helper7_80054648(SnaInitWork *work, int time)
SetAction_8004E22C(work, work->actpack->special2->field_4, 4);
if (work->field_89C_pTarget->field_26_hp <= 0)
if (work->field_89C_pTarget->life <= 0)
{
GM_SeSet2(0, 63, SE_PLAYEROUT);
sna_8004F8E4(work, 128);
@ -3190,7 +3202,7 @@ void sna_anim_knockdown_80054710(SnaInitWork *work, int time)
SetAction_8004E22C(work, bVar1, 4);
if (work->field_89C_pTarget->field_26_hp < 1 && GM_GameOverTimer == 0)
if (work->field_89C_pTarget->life < 1 && GM_GameOverTimer == 0)
{
GM_SeSet2(0, 0x3f, SE_PLAYEROUT);
GM_GameOverTimer = -1;
@ -3264,7 +3276,7 @@ void sna_anim_knockdown_idle_80054930(SnaInitWork *work, int time)
action_flag = work->actpack->damage->field_5;
}
SetAction_8004E22C(work, action_flag, 4);
if (work->field_89C_pTarget->field_26_hp <= 0)
if (work->field_89C_pTarget->life <= 0)
{
v5 = 127;
if (work->field_A54.prone_bool_thing == 1)
@ -3331,7 +3343,7 @@ void sna_anim_knockdown_shot_80054B50(SnaInitWork *work)
GM_ClearPlayerStatusFlag(PLAYER_DAMAGED);
if (work->field_89C_pTarget->field_26_hp <= 0 && !GM_GameOverTimer)
if (work->field_89C_pTarget->life <= 0 && !GM_GameOverTimer)
{
GM_SeSet2(0, 63, SE_PLAYEROUT);
sna_8004F8E4(work, work->field_A54.prone_bool_thing == 1 ? 126 : 127);
@ -3366,7 +3378,7 @@ void sna_anim_knockdown_shot_tank_80054C08(SnaInitWork *work, int time)
SetAction_8004E22C(work, bVar1, 4);
if (work->field_89C_pTarget->field_26_hp < 1 && GM_GameOverTimer == 0)
if (work->field_89C_pTarget->life < 1 && GM_GameOverTimer == 0)
{
GM_SeSet2(0, 0x3f, SE_PLAYEROUT);
GM_GameOverTimer = -1;
@ -4630,7 +4642,7 @@ void sna_80051A10(SnaInitWork *work, SVECTOR *pPos, SVECTOR *pOut, SVECTOR *pVec
vec = *pPos;
vec2 = *pVec;
if (sub_8004E51C(&vec, work->control.map->hzd, HZD_CHECK_ALL, SEGMENT_ATR) < 0)
if (sna_line_check(&vec, work->control.map->hzd, HZD_CHECK_ALL, SEGMENT_ATR) < 0)
{
vec2 = *pVec;
}
@ -5336,7 +5348,7 @@ void sna_800571B8(SnaInitWork *work, int time)
if (time == 6)
{
GM_SeSet(&work->control.mov, SE_C4_PUT);
NewBakudan(work->field_8E8_pTarget->field_20, &svector_800AB7F4, 1, 1, work->field_8E8_pTarget);
NewBakudan(work->field_8E8_pTarget->body, &svector_800AB7F4, 1, 1, work->field_8E8_pTarget);
work->field_914_trigger = 5;
work->field_8E8_pTarget->damaged &= ~(0x40);
work->field_8E8_pTarget = 0;
@ -6303,7 +6315,7 @@ void sna_anim_chokethrow_begin2_80058C80(SnaInitWork *work, int time)
field_8E8_pTarget = work->field_8E8_pTarget;
field_8E8_pTarget->field_2A--;
field_8E8_pTarget->faint--;
DG_SetPos2(&field_8E8_pTarget->center, &work->control.rot);
@ -6391,8 +6403,8 @@ void sna_anim_choke_kill_80058F88(SnaInitWork *work, int time)
SetAction_8004E22C(work, action_flag, 4);
field_8E8_pTarget->a_mode = action_flag;
field_8E8_pTarget->field_28 = 5;
field_8E8_pTarget->field_2A--;
field_8E8_pTarget->life_lost = 5;
field_8E8_pTarget->faint--;
work->field_A54.choke_count = 0;
}
@ -6429,8 +6441,8 @@ void sna_anim_choke_drag_80059054(SnaInitWork *work, int time)
}
else
{
if (!((work->field_8E8_pTarget->field_26_hp > 0) &&
((iVar3 < 0x5a && work->field_8E8_pTarget->field_42 != 0))))
if (!((work->field_8E8_pTarget->life > 0) &&
((iVar3 < 0x5a && work->field_8E8_pTarget->captured != 0))))
{
GM_ClearPlayerStatusFlag(PLAYER_MOVE);
@ -6485,7 +6497,7 @@ void sna_anim_punch_helper_800591F4(SnaInitWork *work, int time)
if ( time == 4 )
{
sub_8004FCB8(work, &stru_8009F064, 3);
sub_8004FCB8(work, &punch_info[0], 3);
sound = SE_PUNCH_SWING;
if ( GM_CheckPlayerStatusFlag(PLAYER_IN_THE_WATER) )
@ -6510,7 +6522,7 @@ void sna_anim_punch_helper_800591F4(SnaInitWork *work, int time)
if ( time == 11 )
{
sub_8004FCB8(work, &stru_8009F084, 3);
sub_8004FCB8(work, &punch_info[1], 3);
sound = SE_PUNCH_SWING;
if ( GM_CheckPlayerStatusFlag(PLAYER_IN_THE_WATER) )
@ -6535,7 +6547,7 @@ void sna_anim_punch_helper_800591F4(SnaInitWork *work, int time)
if ( time == 22 )
{
sub_8004FCB8(work, &stru_8009F0A4, 4);
sub_8004FCB8(work, &punch_info[2], 4);
sound = SE_KICK_SWING;
if ( GM_CheckPlayerStatusFlag(PLAYER_IN_THE_WATER) )
@ -6569,8 +6581,8 @@ void sna_anim_choke_helper_8005951C(SnaInitWork *work, int time)
sinceLastChoke = ++work->field_904_frames_last_choke;
if (((work->field_8E8_pTarget->field_26_hp < 1 || sinceLastChoke >= 90) ||
work->field_8E8_pTarget->field_42 == 0))
if (((work->field_8E8_pTarget->life < 1 || sinceLastChoke >= 90) ||
work->field_8E8_pTarget->captured == 0))
{
sna_sub_8004E41C(work, 2);
sna_start_anim_8004E1F4(work, sna_anim_choke_hold_80059154);
@ -6609,7 +6621,7 @@ void sna_anim_choke_rechoke_helper_8005961C(SnaInitWork *work, int time)
{
if (time == 0 || (work->field_9B0_pad_ptr->press & PAD_SQUARE) != 0)
{
work->field_8E8_pTarget->field_2A--;
work->field_8E8_pTarget->faint--;
if (++work->field_A54.choke_count >= 10) // feels good
{
@ -6621,7 +6633,7 @@ void sna_anim_choke_rechoke_helper_8005961C(SnaInitWork *work, int time)
}
}
if (work->body.is_end == 0 && work->field_8E8_pTarget->field_42 != 0)
if (work->body.is_end == 0 && work->field_8E8_pTarget->captured != 0)
{
return;
}
@ -6977,9 +6989,9 @@ static inline void sna_init_main_logic_helper3_800596FC(SnaInitWork *work)
{
pTarget = work->field_89C_pTarget;
if (pTarget->field_28 > 0)
if (pTarget->life_lost > 0)
{
pTarget->field_26_hp += pTarget->field_28;
pTarget->life += pTarget->life_lost;
sna_act_unk2_80051170(work->field_89C_pTarget);
}
@ -7162,7 +7174,7 @@ static inline void sna_init_main_logic_helper4_800596FC(SnaInitWork *work)
}
else
{
work->field_A2C = pTarget->field_2C_vec;
work->field_A2C = pTarget->scale;
work->field_A2C.vx /= 2;
work->field_A2C.vy /= 4;
work->field_A2C.vz /= 2;
@ -7201,7 +7213,7 @@ static inline void sna_init_main_logic_helper4_800596FC(SnaInitWork *work)
{
sna_set_invuln_8004F2A0(work, 0x20);
if (pTarget->field_28 > 0)
if (pTarget->life_lost > 0)
{
sna_act_helper2_helper4_8004F090(work, pTarget->a_mode);
}
@ -7223,7 +7235,7 @@ static inline void sna_init_main_logic_helper4_800596FC(SnaInitWork *work)
}
if ((pTarget->field_26_hp < 1) && ((GM_GameOverTimer > -2) && (GM_GameOverTimer < 1)))
if ((pTarget->life < 1) && ((GM_GameOverTimer > -2) && (GM_GameOverTimer < 1)))
{
if (GM_CheckPlayerStatusFlag(PLAYER_INTRUDE | PLAYER_GROUND))
{
@ -7637,9 +7649,9 @@ void sna_act_8005AD10(SnaInitWork *work)
if ( pTarget->damaged & 8 )
{
GV_AddVec3(&pTarget->field_34_vec, &work->control.step, &work->control.step);
GV_AddVec3(&pTarget->offset, &work->control.step, &work->control.step);
pTarget->damaged &= ~0x8;
pTarget->field_34_vec = DG_ZeroVector;
pTarget->offset = DG_ZeroVector;
}
height = (short)work->body.height;
@ -7725,7 +7737,7 @@ void sna_act_8005AD10(SnaInitWork *work)
sna_init_main_logic_800596FC(work);
pTarget2 = work->field_89C_pTarget;
pTarget2->field_2C_vec = work->control.step;
pTarget2->scale = work->control.step;
GM_PushTarget(pTarget2);
if (GM_Camera.first_person != 0)

View File

@ -332,7 +332,7 @@ void CheckSnakeDead_8004E384(SnaInitWork *snake);
void sna_sub_8004E41C(SnaInitWork *snake, unsigned short flags);
int sub_8004E458(short param_1, int param_2);
int sub_8004E4C0(SnaInitWork *work, int param_2);
int sub_8004E51C(SVECTOR *param_1, void *param_2, int param_3, int param_4);
int sna_line_check(SVECTOR *line, HZD_HDL *hzd, int flag, int exclude);
void sub_8004E588(HZD_HDL *param_1, SVECTOR *param_2, int *levels);
int sub_8004E930(SnaInitWork *snake, int arg1);
void sub_8004E9D0(SnaInitWork *work);

View File

@ -7,6 +7,7 @@
#include "common.h"
#include "libgv/libgv.h"
#include "game.h"
#include "linkvar.h"
// Instead of dynamically allocating TARGETs,
// the game uses the big TARGET array gTargets_800B64E0.
@ -213,8 +214,8 @@ TARGET *GM_CaptureTarget(TARGET *target)
iter->a_mode = target->a_mode;
iter->field_18 = target->field_18;
iter->field_1C = target->field_1C;
iter->field_2A -= target->field_2A;
iter->field_42 = 1;
iter->faint -= target->faint;
iter->captured = 1;
target->damaged |= TARGET_CAPTURE;
@ -276,7 +277,7 @@ int GM_TouchTarget(TARGET *target)
iter = gTargets_800B64E0;
i = gTargets_lastSlotUsed_800ABA68;
hp = target->field_26_hp;
hp = target->life;
iter = gTargets_800B64E0;
for (i = gTargets_lastSlotUsed_800ABA68; i > 0; iter++, i--)
@ -296,9 +297,9 @@ int GM_TouchTarget(TARGET *target)
// Touch if there is an intersection for the class
if (GM_TargetIntersects(iter, target))
{
oldhp = iter->field_26_hp;
iter->field_26_hp -= hp;
iter->field_28 += oldhp - iter->field_26_hp;
oldhp = iter->life;
iter->life -= hp;
iter->life_lost += oldhp - iter->life;
iter->damaged |= TARGET_TOUCH;
target->damaged |= TARGET_TOUCH;
@ -309,9 +310,9 @@ int GM_TouchTarget(TARGET *target)
return (target->damaged & TARGET_TOUCH) >> 7;
}
static inline int sub_helper_8002D7DC(int which, int a, int b)
static inline int sub_helper_8002D7DC(int mode, int a, int b)
{
switch (which & 0x3)
switch (mode & 0x3)
{
case 0:
return 0;
@ -340,13 +341,13 @@ int GM_PowerTarget(TARGET *target)
SVECTOR dist;
SVECTOR scaled;
int hp, hp2;
int f24;
int p_mode;
TARGET *iter;
int i;
int hp_diff;
hp = target->field_26_hp;
f24 = target->field_24;
hp = target->life;
p_mode = target->p_mode;
iter = gTargets_800B64E0;
for (i = gTargets_lastSlotUsed_800ABA68; i > 0; iter++, i--)
@ -368,24 +369,24 @@ int GM_PowerTarget(TARGET *target)
iter->damaged |= TARGET_POWER;
hp2 = iter->field_26_hp;
iter->field_26_hp = sub_helper_8002D7DC(iter->field_24, hp2, hp);
hp = sub_helper_8002D7DC(f24, hp, hp2);
hp2 = iter->life;
iter->life = sub_helper_8002D7DC(iter->p_mode, hp2, hp);
hp = sub_helper_8002D7DC(p_mode, hp, hp2);
iter->field_28 += hp2 - iter->field_26_hp;
iter->field_2A -= target->field_2A;
iter->life_lost += hp2 - iter->life;
iter->faint -= target->faint;
iter->a_mode = target->a_mode;
iter->field_44 = target->field_44;
iter->weapon = target->weapon;
if (f24 & 0x4)
if (p_mode & 0x4)
{
GV_SubVec3(&iter->center, &target->center, &dist);
SCALE_VXZ(&dist, target->field_2C_vec.vx, &scaled);
GV_AddVec3(&iter->field_2C_vec, &scaled, &iter->field_2C_vec);
SCALE_VXZ(&dist, target->scale.vx, &scaled);
GV_AddVec3(&iter->scale, &scaled, &iter->scale);
}
else
{
GV_AddVec3(&iter->field_2C_vec, &target->field_2C_vec, &iter->field_2C_vec);
GV_AddVec3(&iter->scale, &target->scale, &iter->scale);
}
if (hp < 0)
@ -394,8 +395,8 @@ int GM_PowerTarget(TARGET *target)
}
}
hp_diff = target->field_26_hp - hp;
target->field_26_hp = hp;
hp_diff = target->life - hp;
target->life = hp;
if (hp_diff > 0)
{
@ -463,8 +464,8 @@ static inline int sub_helper_8002DA14(TARGET *target, TARGET *iter)
if (abs(val) <= abs(val2))
{
val /= 2;
target->field_34_vec.vx += val;
iter->field_34_vec.vx -= val;
target->offset.vx += val;
iter->offset.vx -= val;
if (val > 0)
{
@ -478,8 +479,8 @@ static inline int sub_helper_8002DA14(TARGET *target, TARGET *iter)
else
{
val2 /= 2;
target->field_34_vec.vz += val2;
iter->field_34_vec.vz -= val2;
target->offset.vz += val2;
iter->offset.vz -= val2;
if (val2 > 0)
{
@ -493,7 +494,7 @@ static inline int sub_helper_8002DA14(TARGET *target, TARGET *iter)
if (iter->field_3C & 1)
{
target->field_34_vec.pad = which;
target->offset.pad = which;
}
}
@ -510,14 +511,14 @@ int GM_PushTarget(TARGET *target)
return 0;
}
target->field_34_vec = DG_ZeroVector;
target->field_34_vec.pad = 0;
target->offset = DG_ZeroVector;
target->offset.pad = 0;
iter = gTargets_800B64E0;
for (count = gTargets_lastSlotUsed_800ABA68; count > 0; iter++, count--)
{
iter->field_40 = 0;
iter->push_side = NO_SIDE;
if ((target == iter) || !(iter->class & TARGET_PUSH) || !GM_TargetIntersectsNoSide(iter, target))
{
@ -528,7 +529,7 @@ int GM_PushTarget(TARGET *target)
{
iter->damaged |= TARGET_PUSH;
target->damaged |= TARGET_PUSH;
iter->field_40 = target->side;
iter->push_side = target->side;
}
}
@ -546,28 +547,28 @@ void GM_SetTarget(TARGET *target, int class, int side, SVECTOR *size)
target->field_3C = 0;
}
void GM_Target_8002DCB4(TARGET *target, int a2, int a3, int *a4, SVECTOR *a5)
void GM_Target_8002DCB4(TARGET *target, int a_mode, int faint, int *a4, SVECTOR *a5)
{
target->field_18 = a4;
target->a_mode = a2;
target->field_2A = a3;
target->a_mode = a_mode;
target->faint = faint;
target->field_1C = a5;
}
void GM_Target_8002DCCC(TARGET *target, int a2, int a3, int hp, int a5, SVECTOR *a6)
void GM_Target_8002DCCC(TARGET *target, int p_mode, int a_mode, int life, int faint, SVECTOR *scale)
{
target->field_24 = a2;
target->a_mode = a3;
target->field_26_hp = hp;
target->field_28 = 0;
target->field_2A = a5;
target->field_2C_vec = *a6;
target->field_44 = -1;
target->p_mode = p_mode;
target->a_mode = a_mode;
target->life = life;
target->life_lost = 0;
target->faint = faint;
target->scale = *scale;
target->weapon = WP_None;
}
void sub_8002DD14(TARGET *target, MATRIX *pMatrix)
void GM_TargetBody(TARGET *target, MATRIX *body)
{
target->field_20 = pMatrix;
target->body = body;
}
void sub_8002DD1C(SVECTOR *svec1, SVECTOR *svec2, TARGET *target)

View File

@ -7,26 +7,26 @@
typedef struct TARGET
{
unsigned short class;
unsigned short side;
unsigned short map;
unsigned short damaged;
SVECTOR center;
SVECTOR size;
int *field_18;
SVECTOR *field_1C;
MATRIX *field_20;
short field_24;
short field_26_hp;
short field_28;
short field_2A;
SVECTOR field_2C_vec;
SVECTOR field_34_vec;
short field_3C;
short a_mode;
short field_40;
short field_42;
int field_44;
u_short class;
u_short side;
u_short map;
u_short damaged;
SVECTOR center;
SVECTOR size;
int *field_18; /* unused */
SVECTOR *field_1C; /* unused */
MATRIX *body;
short p_mode;
short life;
short life_lost;
short faint;
SVECTOR scale;
SVECTOR offset;
short field_3C;
short a_mode;
short push_side;
short captured;
int weapon;
} TARGET;
enum
@ -85,9 +85,9 @@ int GM_TouchTarget(TARGET *target);
int GM_PowerTarget(TARGET *target);
int GM_PushTarget(TARGET *target);
void GM_SetTarget(TARGET *target, int class, int side, SVECTOR *size);
void GM_Target_8002DCB4(TARGET *target, int a2, int a3, int *a4, SVECTOR *a5);
void GM_Target_8002DCCC(TARGET *target, int a2, int a3, int hp, int a5, SVECTOR *a6);
void sub_8002DD14(TARGET *target, MATRIX *pMatrix) ;
void GM_Target_8002DCB4(TARGET *target, int a_mode, int faint, int *a4, SVECTOR *a5);
void GM_Target_8002DCCC(TARGET *target, int p_mode, int a_mode, int life, int faint, SVECTOR *scale);
void GM_TargetBody(TARGET *target, MATRIX *body) ;
void sub_8002DD1C(SVECTOR *a1, SVECTOR *a2, TARGET *a3);
int sub_8002DDE0(SVECTOR *a1, SVECTOR *a2, TARGET *a3, SVECTOR *a4);
int GM_Target_8002E1B8(SVECTOR *pVec, SVECTOR *pVec1, int map_bit, SVECTOR *pVec2, int side);

View File

@ -204,6 +204,7 @@ enum // GM_Weapons[]
WP_StunGrenade = 7,
WP_ChaffGrenade = 8,
WP_Rifle = 9,
WP_Max = 10,
};
#define GM_TotalWeapons 10

View File

@ -1054,7 +1054,7 @@ void UpdateEnvironmentalEffects_8003C4EC(void)
blastData.field_4 = 5;
blastData.field_8_z = 1024;
blastData.field_C = 2000;
blastData.field_10 = 10;
blastData.weapon = WP_Max;
GM_CurrentMap = GM_PlayerMap;

View File

@ -10,6 +10,7 @@
#include "game/game.h"
#include "anime/animconv/anime.h"
#include "sd/g_sound.h"
#include "linkvar.h"
#include "spark.h"
extern MAP *claymore_MAP_800bdf08;
@ -311,7 +312,7 @@ STATIC void claymore_loader_80073930(ClaymoreWork *work)
vec.vy = work->field_34.vy / 32;
vec.vz = work->field_34.vz / 32;
GM_Target_8002DCCC(pTarget, 0, 2, 256, 0, &vec);
pTarget->field_44 = 5;
pTarget->weapon = WP_Claymore;
}
STATIC const SVECTOR svector_80012EDC = {0, 0, 1500, 0};

View File

@ -824,7 +824,7 @@ void s07c_meryl72_unk1_800C9B30( Meryl72Work* work, int time )
if ( time == 0 )
{
work->fC08 = 1;
work->fAEA = target->field_2A;
work->fAEA = target->faint;
work->fAEC = 0;
if ( !work->stage )
{
@ -836,7 +836,7 @@ void s07c_meryl72_unk1_800C9B30( Meryl72Work* work, int time )
}
}
if ( work->fAEA != target->field_2A )
if ( work->fAEA != target->faint )
{
if ( !work->stage )
{
@ -846,7 +846,7 @@ void s07c_meryl72_unk1_800C9B30( Meryl72Work* work, int time )
{
GM_SeSet( &work->control.mov, 0xC4 );
}
work->fAEA = target->field_2A;
work->fAEA = target->faint;
}
if ( target->damaged & TARGET_POWER )
@ -860,11 +860,11 @@ void s07c_meryl72_unk1_800C9B30( Meryl72Work* work, int time )
{
GM_SeSet( &work->control.mov, 0xC2);
}
target->field_2C_vec = DG_ZeroVector;
target->field_28 = 0;
target->scale = DG_ZeroVector;
target->life_lost = 0;
target->damaged = TARGET_STALE;
if ( target->field_26_hp <= 0 )
if ( target->life <= 0 )
{
work->f8BC.field_14 = 6;
target->side = ENEMY_SIDE;
@ -875,7 +875,7 @@ void s07c_meryl72_unk1_800C9B30( Meryl72Work* work, int time )
GM_GameOverTimer = -2;
}
SetMode( work, s07c_meryl72_unk1_800CA538 );
target->field_42 = 0;
target->captured = 0;
}
}
@ -890,7 +890,7 @@ void s07c_meryl72_unk1_800C9B30( Meryl72Work* work, int time )
work->fAEC = 0;
}
if ( work->fAEC == 0x32 && target->field_2A > 0 )
if ( work->fAEC == 0x32 && target->faint > 0 )
{
SetAction( work, ACTION30, ACTINTERP );
}
@ -916,7 +916,7 @@ void s07c_meryl72_unk1_800C9B30( Meryl72Work* work, int time )
case 0x27:
work->f8BC.field_14 = 5;
target->side = ENEMY_SIDE;
target->field_26_hp = 0;
target->life = 0;
if ( !GM_GameOverTimer && GM_SnakeCurrentHealth > 0 )
{
ExecProc_800C7C58( work, 1 ) ;
@ -934,7 +934,7 @@ void s07c_meryl72_unk1_800C9B30( Meryl72Work* work, int time )
if ( work->sn_dis > 800 )
{
target->field_42 = 0 ;
target->captured = 0 ;
}
work->target->class |= ( TARGET_SEEK | TARGET_POWER ) ;
@ -967,7 +967,7 @@ void s07c_meryl72_unk1_800C9F98( Meryl72Work *work, int time )
{
work->fC08 = 1 ;
SetAction( work, ACTION37, ACTINTERP ) ;
work->target->field_2A = 0;
work->target->faint = 0;
if ( GM_StreamStatus() != -1 )
{
GM_StreamPlayStop();
@ -1031,9 +1031,9 @@ void s07c_meryl72_unk1_800CA0EC( Meryl72Work *work, int time )
SetAction( work, ACTION46, ACTINTERP );
}
if ( work->target->field_2A <= 0 )
if ( work->target->faint <= 0 )
{
work->target->field_2A = 7 ;
work->target->faint = 7 ;
svec.vx = work->body.objs->objs[6].world.t[0];
svec.vy = work->body.objs->objs[6].world.t[1];
svec.vz = work->body.objs->objs[6].world.t[2];
@ -1054,9 +1054,9 @@ void s07c_meryl72_unk1_800CA0EC( Meryl72Work *work, int time )
if ( work->fAEA < time )
{
if ( work->target->field_2A <= 0 )
if ( work->target->faint <= 0 )
{
work->target->field_2A = work->param.faint;
work->target->faint = work->param.faint;
}
SetMode( work, s07c_meryl72_unk1_800CA314 );
return;
@ -1179,7 +1179,7 @@ void s07c_meryl72_unk1_800CA538( Meryl72Work *work, int time )
s2 = 0xF;
unk = (UNK*)&work->f8BC;
work->f8BC.field_1C = 0;
work->control.step = work->target->field_2C_vec;
work->control.step = work->target->scale;
ctrl = &work->control;
@ -1206,7 +1206,7 @@ void s07c_meryl72_unk1_800CA538( Meryl72Work *work, int time )
break;
case 1:
SetAction( work, ACTION43, ACTINTERP );
if ( work->target->field_26_hp <= 0 )
if ( work->target->life <= 0 )
{
if ( !work->stage )
{
@ -1300,7 +1300,7 @@ void s07c_meryl72_unk1_800CA538( Meryl72Work *work, int time )
}
}
if ( time == 2 && work->target->field_26_hp <= 0 )
if ( time == 2 && work->target->life <= 0 )
{
GM_GameStatus |= STATE_PADRELEASE;
if ( GM_StreamStatus() == -1 )
@ -1345,8 +1345,8 @@ void s07c_meryl72_unk1_800CA538( Meryl72Work *work, int time )
if ( work->body.is_end )
{
work->f8BC.field_1C = 1;
work->target->field_2C_vec = DG_ZeroVector;
if ( work->target->field_26_hp <= 0 )
work->target->scale = DG_ZeroVector;
if ( work->target->life <= 0 )
{
SetMode( work, s07c_meryl72_unk1_800CAA48 );
}

View File

@ -64,10 +64,10 @@ int s07c_meryl72_unk1_800C7D1C( Meryl72Work *work )
switch ( target->a_mode )
{
case 3:
target->field_2C_vec = DG_ZeroVector;
target->field_26_hp -= GM_SnakeMaxHealth / 48;
target->scale = DG_ZeroVector;
target->life -= GM_SnakeMaxHealth / 48;
if ( ( target->field_2A <= 0 ) || ( ( target->field_26_hp << 16 ) <= 0 ) )
if ( ( target->faint <= 0 ) || ( ( target->life << 16 ) <= 0 ) )
{
work->f8BC.field_14 = 1;
SetMode( work, s07c_meryl72_unk1_800CA538 ) ;
@ -80,12 +80,12 @@ int s07c_meryl72_unk1_800C7D1C( Meryl72Work *work )
break;
case 4:
work->f8BC.field_14 = 0;
target->field_26_hp -= GM_SnakeMaxHealth / 32;
target->life -= GM_SnakeMaxHealth / 32;
SetMode( work, s07c_meryl72_unk1_800CA538 ) ;
break;
case 1:
target->field_2C_vec = DG_ZeroVector;
if ( target->field_26_hp <= 0 )
target->scale = DG_ZeroVector;
if ( target->life <= 0 )
{
work->f8BC.field_14 = 1;
SetMode( work, s07c_meryl72_unk1_800CA538 ) ;
@ -100,10 +100,10 @@ int s07c_meryl72_unk1_800C7D1C( Meryl72Work *work )
SetMode( work, s07c_meryl72_unk1_800CA538 ) ;
}
target->field_28 = 0;
target->life_lost = 0;
target->damaged = 0;
if ( target->field_26_hp <= 0 && !GM_GameOverTimer && GM_SnakeCurrentHealth > 0 )
if ( target->life <= 0 && !GM_GameOverTimer && GM_SnakeCurrentHealth > 0 )
{
ExecProc_800C7C58( work, 1 ) ;
GM_GameOver();

View File

@ -94,9 +94,9 @@ void s07c_meryl72_800C6C48( Meryl72Work *work )
param = &work->param;
target = work->target;
if ( param->life != target->field_26_hp )
if ( param->life != target->life )
{
param->life = target->field_26_hp;
param->life = target->life;
work->fC36 = 150;
}
@ -175,7 +175,7 @@ void s07c_meryl72_800C6E48( Meryl72Work *work )
GM_SetTarget( target, TARGET_FLAG, ENEMY_SIDE, &s07c_dword_800C32F0 );
GM_Target_8002DCCC( target, 1, -1, life, faint, &s07c_dword_800C32F8 );
GM_Target_8002DCB4( target, -1, faint, NULL, NULL );
sub_8002DD14( target, &work->body.objs->objs[1].world );
GM_TargetBody( target, &work->body.objs->objs[1].world );
GM_SetTarget( &work->target2, TARGET_POWER | TARGET_TOUCH, PLAYER_SIDE, &s07c_dword_800C3300 );
GM_Target_8002DCCC( &work->target2, 7, 5, 0, 0, &s07c_dword_800C3308 );
@ -279,7 +279,7 @@ void s07c_meryl72_800C7194( Meryl72Work *work )
args.argc = 1;
args.argv = data;
data[0] = work->target->field_26_hp;
data[0] = work->target->life;
GCL_ForceExecProc( work->fC3C, &args );
}
}

View File

@ -293,7 +293,7 @@ void s07c_meryl72_unk1_800CBCD8(Meryl72Work *work)
return;
}
GV_AddVec3(&target->field_34_vec, &work->control.step, &work->control.step);
GV_AddVec3(&target->offset, &work->control.step, &work->control.step);
target->damaged &= ~TARGET_PUSH;
f18 = work->f8BC.field_18;
@ -302,23 +302,23 @@ void s07c_meryl72_unk1_800CBCD8(Meryl72Work *work)
return;
}
if (target->field_34_vec.pad != 0)
if (target->offset.pad != 0)
{
if (GV_Time & 256)
{
ang = target->field_34_vec.pad * 1024;
ang = target->offset.pad * 1024;
if (!(work->param.fAF8 & 0x1))
{
ang = (target->field_34_vec.pad + 2) * 1024;
ang = (target->offset.pad + 2) * 1024;
}
}
else if (work->param.fAF8 & 1)
{
ang = (target->field_34_vec.pad + 2) * 1024;
ang = (target->offset.pad + 2) * 1024;
}
else
{
ang = target->field_34_vec.pad * 1024;
ang = target->offset.pad * 1024;
}
ang &= 0xFFF;

View File

@ -175,7 +175,7 @@ void InitTarget_800D3800( ZakoWork *work )
GM_Target_8002DCCC( target, 1, -1, life, faint, &ZAKO_TARGET_FORCE_800C38D4 );
GM_Target_8002DCB4( target, -1, faint, NULL, NULL);
sub_8002DD14( target, &( work->body.objs->objs[1].world ) );
GM_TargetBody( target, &( work->body.objs->objs[1].world ) );
work->local_data = work->param_life;
target2 = &work->field_904;

View File

@ -524,7 +524,7 @@ void s11e_zk11ecom_800D57A0( ZakoWork* work, int time )
}
else if ( ctrl->mov.vy - ctrl->levels[0] > 3000 )
{
work->target->field_26_hp = 0;
work->target->life = 0;
GM_SeSet( &ctrl->mov, 0x8E ) ;
}
}
@ -549,7 +549,7 @@ void s11e_zk11ecom_800D57A0( ZakoWork* work, int time )
GM_SetNoise( 0x64, 4, &work->control.mov ) ;
ZAKO11E_PutBlood_800D7A14( work, 6, 1 ) ;
if ( work->target->field_26_hp <= 0 )
if ( work->target->life <= 0 )
{
SetZakoMode( work, s11e_zk11ecom_800D6BD8 );
}
@ -602,25 +602,25 @@ void s11e_zk11ecom_800D5B04( ZakoWork *work, int time )
if ( time == 0 )
{
work->field_B5A = target->field_2A;
work->field_B5A = target->faint;
GM_SeSet( &work->control.mov, 0x8F );
}
if ( work->field_B5A != target->field_2A )
if ( work->field_B5A != target->faint )
{
GM_SeSet( &work->control.mov, 0x8F );
work->field_B5A = target->field_2A;
work->field_B5A = target->faint;
}
if ( target->damaged & TARGET_POWER )
{
ZAKO11E_PutBlood_800D7A14( work, 5, 0 );
GM_SeSet( &work->control.mov, 0x8F );
target->field_2C_vec = DG_ZeroVector;
target->field_28 = 0;
target->scale = DG_ZeroVector;
target->life_lost = 0;
target->damaged = TARGET_STALE;
if ( target->field_26_hp <= 0 )
if ( target->life <= 0 )
{
v1 = target->a_mode;
if ( v1 == 1 )
@ -630,7 +630,7 @@ void s11e_zk11ecom_800D5B04( ZakoWork *work, int time )
work->unknown.field_14 = 5;
target->side = ENEMY_SIDE;
SetZakoMode( work, s11e_zk11ecom_800D649C );
target->field_42 = 0;
target->captured = 0;
}
}
switch ( GM_PlayerAction )
@ -644,7 +644,7 @@ void s11e_zk11ecom_800D5B04( ZakoWork *work, int time )
work->field_B5C = 0;
}
if ( work->field_B5C == 0x32 && target->field_2A > 0 )
if ( work->field_B5C == 0x32 && target->faint > 0 )
{
SetAction( work, ACTION48, ACTINTERP );
}
@ -670,7 +670,7 @@ void s11e_zk11ecom_800D5B04( ZakoWork *work, int time )
case 0x27:
work->unknown.field_14 = 4;
target->side = ENEMY_SIDE;
target->field_26_hp = 0;
target->life = 0;
SetZakoMode( work, s11e_zk11ecom_800D649C );
return;
default:
@ -682,7 +682,7 @@ void s11e_zk11ecom_800D5B04( ZakoWork *work, int time )
if ( work->sn_dis > 800 )
{
target->field_42 = 0;
target->captured = 0;
}
work->target->class |= ( TARGET_SEEK | TARGET_POWER) ;
@ -715,7 +715,7 @@ void s11e_zk11ecom_800D5EEC( ZakoWork *work, int time )
if ( time == 0 )
{
SetAction( work, ACTION32, ACTINTERP ) ;
work->target->field_2A = 0;
work->target->faint = 0;
}
if ( CheckDamage_800D46A0( work ) )
@ -797,9 +797,9 @@ void s11e_zk11ecom_800D603C( ZakoWork *work, int time )
{
if ( work->field_B5A < time )
{
if ( work->target->field_2A <= 0 )
if ( work->target->faint <= 0 )
{
work->target->field_2A = work->param_faint;
work->target->faint = work->param_faint;
}
SetZakoMode( work, s11e_zk11ecom_800D627C );
}
@ -867,7 +867,7 @@ void s11e_zk11ecom_800D627C( ZakoWork* work, int time )
if ( work->body.is_end )
{
work->local_data = work->target->field_26_hp;
work->local_data = work->target->life;
SetZakoMode( work, ActStandStill_800D4C2C );
}
}
@ -924,7 +924,7 @@ void s11e_zk11ecom_800D649C( ZakoWork *work, int time )
unk = &work->unknown;
work->unknown.field_1E = 0;
work->act_status |= 0x8;
work->control.step = work->target->field_2C_vec;
work->control.step = work->target->scale;
ctrl = &work->control;
@ -941,7 +941,7 @@ void s11e_zk11ecom_800D649C( ZakoWork *work, int time )
break;
case 1:
SetAction( work, ACTION37, ACTINTERP );
if ( work->target->field_26_hp <= 0 )
if ( work->target->life <= 0 )
{
if ( GM_CurrentWeaponId == WP_Rifle )
{
@ -983,7 +983,7 @@ void s11e_zk11ecom_800D649C( ZakoWork *work, int time )
break;
}
if ( work->target->field_26_hp <= 0 && work->field_C48 >= 0 )
if ( work->target->life <= 0 && work->field_C48 >= 0 )
{
args.argc = 3;
args.argv = data;
@ -1064,7 +1064,7 @@ void s11e_zk11ecom_800D649C( ZakoWork *work, int time )
{
if (ctrl->mov.vy - ctrl->levels[0] > 3000)
{
work->target->field_26_hp = 0;
work->target->life = 0;
SetZakoMode( work, s11e_zk11ecom_800D69F8 );
return;
}
@ -1074,8 +1074,8 @@ void s11e_zk11ecom_800D649C( ZakoWork *work, int time )
if ( work->body.is_end )
{
work->unknown.field_1E = 1;
work->target->field_2C_vec = DG_ZeroVector;
if ( work->target->field_26_hp <= 0 )
work->target->scale = DG_ZeroVector;
if ( work->target->life <= 0 )
{
SetZakoMode( work, s11e_zk11ecom_800D6BD8 );
}
@ -1094,7 +1094,7 @@ void s11e_zk11ecom_800D69F8( ZakoWork* work, int time )
work->unknown.field_1E = 0;
work->act_status |= 0x8;
ctrl->step = work->target->field_2C_vec;
ctrl->step = work->target->scale;
if ( time == 0 && work->unknown.field_14 != 2 )
{
@ -1130,7 +1130,7 @@ void s11e_zk11ecom_800D69F8( ZakoWork* work, int time )
else if ( ctrl->level_flag )
{
work->unknown.field_1E = 1;
work->target->field_2C_vec = DG_ZeroVector;
work->target->scale = DG_ZeroVector;
GM_SeSet( &ctrl->mov, SE_HIT_FLOOR );
ZAKO11E_PutBlood_800D7A14( work, 6, 1 );
SetZakoMode( work, s11e_zk11ecom_800D6BD8 );

View File

@ -66,8 +66,8 @@ int s11e_zk11ecom_800D4440( ZakoWork *work ) {
switch ( val )
{
case 2:
target->field_2C_vec = DG_ZeroVector;
if ( target->field_2A <= 0 )
target->scale = DG_ZeroVector;
if ( target->faint <= 0 )
{
work->unknown.field_14 = 1;
SetZakoMode( work, s11e_zk11ecom_800D649C ) ;
@ -82,8 +82,8 @@ int s11e_zk11ecom_800D4440( ZakoWork *work ) {
SetZakoMode( work, s11e_zk11ecom_800D649C ) ;
break;
case 0:
target->field_2C_vec = DG_ZeroVector;
if ( target->field_26_hp <= 0 || ( work->local_data - target->field_26_hp ) >= 192 )
target->scale = DG_ZeroVector;
if ( target->life <= 0 || ( work->local_data - target->life ) >= 192 )
{
work->unknown.field_14 = 1;
SetZakoMode( work, s11e_zk11ecom_800D649C ) ;
@ -95,7 +95,7 @@ int s11e_zk11ecom_800D4440( ZakoWork *work ) {
}
break;
case 1:
if ( s11e_zk11ecom_800D4404( &target->field_2C_vec ) < 100 )
if ( s11e_zk11ecom_800D4404( &target->scale ) < 100 )
{
work->unknown.field_14 = 3;
}
@ -117,7 +117,7 @@ int s11e_zk11ecom_800D4440( ZakoWork *work ) {
break;
}
target->field_28 = 0;
target->life_lost = 0;
target->damaged = 0;
return 1;
}

View File

@ -349,7 +349,7 @@ void Zako11EPushMove_800D889C( ZakoWork *work )
return;
}
GV_AddVec3( &target->field_34_vec, &work->control.step, &work->control.step );
GV_AddVec3( &target->offset, &work->control.step, &work->control.step );
target->damaged &= ~( 0x8 );
if ( work->unknown.last_set - 1 >= 2u )
@ -357,25 +357,25 @@ void Zako11EPushMove_800D889C( ZakoWork *work )
return;
}
if ( target->field_34_vec.pad )
if ( target->offset.pad )
{
if ( GV_Time & 256 )
{
s1 = target->field_34_vec.pad * 1024;
s1 = target->offset.pad * 1024;
if ( !( work->field_B74 & 1 ) )
{
s1 = ( target->field_34_vec.pad + 2 ) * 1024;
s1 = ( target->offset.pad + 2 ) * 1024;
}
}
else
{
if ( work->field_B74 & 1 )
{
s1 = ( target->field_34_vec.pad + 2 ) * 1024;
s1 = ( target->offset.pad + 2 ) * 1024;
}
else
{
s1 = target->field_34_vec.pad * 1024;
s1 = target->offset.pad * 1024;
}
}
s1 &= 0xFFF;

View File

@ -224,8 +224,8 @@ int s11i_asiato_800C9924( Zako11FWork *work )
switch ( a_mode )
{
case 2:
target->field_2C_vec = DG_ZeroVector;
if ( target->field_2A <= 0 )
target->scale = DG_ZeroVector;
if ( target->faint <= 0 )
{
work->unknown.field_14 = 1;
SetZako11FMode( work, s11i_asiato_800CBACC ) ;
@ -240,8 +240,8 @@ int s11i_asiato_800C9924( Zako11FWork *work )
SetZako11FMode( work, s11i_asiato_800CBACC ) ;
break;
case 0:
target->field_2C_vec = DG_ZeroVector;
if ( target->field_26_hp <= 0 )
target->scale = DG_ZeroVector;
if ( target->life <= 0 )
{
work->unknown.field_14 = 1;
SetZako11FMode( work, s11i_asiato_800CBACC ) ;
@ -252,7 +252,7 @@ int s11i_asiato_800C9924( Zako11FWork *work )
}
break;
case 1:
if ( s11i_asiato_800C98E8( &target->field_2C_vec ) < 100 )
if ( s11i_asiato_800C98E8( &target->scale ) < 100 )
{
work->unknown.field_14 = 3;
}
@ -274,7 +274,7 @@ int s11i_asiato_800C9924( Zako11FWork *work )
break;
}
target->field_28 = 0;
target->life_lost = 0;
target->damaged = 0;
return 1;
}
@ -981,7 +981,7 @@ void s11i_asiato_800CADDC( Zako11FWork *work, int time )
// if they fall from a height?
else if ( control->mov.vy - control->levels[0] > 3000 )
{
work->target->field_26_hp = 0;
work->target->life = 0;
GM_SeSet( &control->mov, 0x8E ) ;
}
}
@ -1006,7 +1006,7 @@ void s11i_asiato_800CADDC( Zako11FWork *work, int time )
ZAKO11F_PutBlood_800CCFD4( work, 6, 1 ) ;
if ( work->target->field_26_hp <= 0 )
if ( work->target->life <= 0 )
{
SetZako11FMode( work, s11i_asiato_800CC218 );
}
@ -1052,25 +1052,25 @@ void s11i_asiato_800CB140( Zako11FWork *work, int time )
if ( time == 0 )
{
work->field_B5A = target->field_2A;
work->field_B5A = target->faint;
GM_SeSet( &work->control.mov, 0x8F );
}
if ( work->field_B5A != target->field_2A )
if ( work->field_B5A != target->faint )
{
GM_SeSet( &work->control.mov, 0x8F );
work->field_B5A = target->field_2A;
work->field_B5A = target->faint;
}
if ( target->damaged & TARGET_POWER )
{
ZAKO11F_PutBlood_800CCFD4( work, 5, 0 );
GM_SeSet( &work->control.mov, 0x8F );
target->field_2C_vec = DG_ZeroVector;
target->field_28 = 0;
target->scale = DG_ZeroVector;
target->life_lost = 0;
target->damaged = TARGET_STALE;
if ( target->field_26_hp <= 0 )
if ( target->life <= 0 )
{
a_mode = target->a_mode;
if (target->a_mode == 1)
@ -1081,7 +1081,7 @@ void s11i_asiato_800CB140( Zako11FWork *work, int time )
work->unknown.field_14 = 5;
target->side = ENEMY_SIDE;
SetZako11FMode( work, s11i_asiato_800CBACC );
target->field_42 = 0;
target->captured = 0;
}
}
@ -1096,7 +1096,7 @@ void s11i_asiato_800CB140( Zako11FWork *work, int time )
work->field_B5C = 0;
}
if ( work->field_B5C == 50 && target->field_2A > 0 )
if ( work->field_B5C == 50 && target->faint > 0 )
{
SetAction( work, ACTION48, ACTINTERP );
}
@ -1127,7 +1127,7 @@ void s11i_asiato_800CB140( Zako11FWork *work, int time )
case 39:
work->unknown.field_14 = 4;
target->side = ENEMY_SIDE;
target->field_26_hp = 0;
target->life = 0;
SetZako11FMode( work, s11i_asiato_800CBACC );
return;
@ -1140,7 +1140,7 @@ void s11i_asiato_800CB140( Zako11FWork *work, int time )
if ( work->sn_dis > 800 )
{
target->field_42 = 0;
target->captured = 0;
}
work->target->class |= (TARGET_SEEK | TARGET_POWER);
@ -1174,7 +1174,7 @@ void s11i_asiato_800CB528(Zako11FWork *work, int time)
if (time == 0)
{
SetAction(work, ACTION32, ACTINTERP);
work->target->field_2A = 0;
work->target->faint = 0;
}
if (CheckDamage_800C9B6C(work))
@ -1246,9 +1246,9 @@ void s11i_asiato_800CB678(Zako11FWork *work, int time)
}
else if (work->field_B5A < time)
{
if (work->target->field_2A <= 0)
if (work->target->faint <= 0)
{
work->target->field_2A = work->param.faint;
work->target->faint = work->param.faint;
}
SetZako11FMode(work, s11i_asiato_800CB8B8);
@ -1365,12 +1365,12 @@ void s11i_asiato_800CBACC(Zako11FWork *work, int time)
unk = &work->unknown;
work->unknown.field_1E = 0;
work->act_status |= 0x8;
work->control.step = work->target->field_2C_vec;
work->control.step = work->target->scale;
control = &work->control;
if (time == 0)
{
if (work->target->field_26_hp <= 0)
if (work->target->life <= 0)
{
GM_SeSetMode(&work->control.mov, 0x8D, GM_SEMODE_BOMB);
s11i_zk11fcom_800D0DB8();
@ -1388,7 +1388,7 @@ void s11i_asiato_800CBACC(Zako11FWork *work, int time)
case 1:
SetAction(work, ACTION37, ACTINTERP);
if (work->target->field_26_hp <= 0)
if (work->target->life <= 0)
{
if (GM_CurrentWeaponId == WP_Rifle)
{
@ -1508,12 +1508,12 @@ void s11i_asiato_800CBACC(Zako11FWork *work, int time)
}
else if (control->mov.vy - control->levels[0] > 3000)
{
if (work->target->field_26_hp > 0)
if (work->target->life > 0)
{
s11i_zk11fcom_800D0DB8();
}
work->target->field_26_hp = 0;
work->target->life = 0;
SetZako11FMode(work, s11i_asiato_800CC038);
return;
}
@ -1522,9 +1522,9 @@ void s11i_asiato_800CBACC(Zako11FWork *work, int time)
if (work->body.is_end)
{
work->unknown.field_1E = 1;
work->target->field_2C_vec = DG_ZeroVector;
work->target->scale = DG_ZeroVector;
if (work->target->field_26_hp <= 0)
if (work->target->life <= 0)
{
SetZako11FMode(work, s11i_asiato_800CC218);
}
@ -1544,7 +1544,7 @@ void s11i_asiato_800CC038(Zako11FWork *work, int time)
work->unknown.field_1E = 0;
work->act_status |= 0x8;
control->step = work->target->field_2C_vec;
control->step = work->target->scale;
if (time == 0 && work->unknown.field_14 != 2)
{
@ -1580,7 +1580,7 @@ void s11i_asiato_800CC038(Zako11FWork *work, int time)
else if (control->level_flag != 0)
{
work->unknown.field_1E = 1;
work->target->field_2C_vec = DG_ZeroVector;
work->target->scale = DG_ZeroVector;
GM_SeSet(&control->mov, SE_HIT_FLOOR);
ZAKO11F_PutBlood_800CCFD4(work, 6, 1);
SetZako11FMode(work, s11i_asiato_800CC218);

View File

@ -151,7 +151,7 @@ void InitTarget_800C8A10( Zako11FWork *work )
GM_Target_8002DCCC( target, 1, -1, life, faint, &ZAKO11F_TARGET_FORCE_800C3664 );
GM_Target_8002DCB4( target, -1, faint, NULL, NULL);
sub_8002DD14( target, &( work->body.objs->objs[1].world ) );
GM_TargetBody( target, &( work->body.objs->objs[1].world ) );
target2 = &work->field_904;
GM_SetTarget( target2, TARGET_POWER, PLAYER_SIDE, &ZAKO11F_ATTACK_SIZE_800C366C );

View File

@ -342,7 +342,7 @@ void Zako11FPushMove_800CDFAC( Zako11FWork *work )
return;
}
GV_AddVec3( &target->field_34_vec, &work->control.step, &work->control.step );
GV_AddVec3( &target->offset, &work->control.step, &work->control.step );
target->damaged &= ~TARGET_PUSH;
set = work->unknown.last_set;
@ -351,25 +351,25 @@ void Zako11FPushMove_800CDFAC( Zako11FWork *work )
return;
}
if ( target->field_34_vec.pad )
if ( target->offset.pad )
{
if ( GV_Time & 256 )
{
ang = target->field_34_vec.pad * 1024;
ang = target->offset.pad * 1024;
if ( !( work->param.index & 1 ) )
{
ang = ( target->field_34_vec.pad + 2 ) * 1024;
ang = ( target->offset.pad + 2 ) * 1024;
}
}
else
{
if ( work->param.index & 1 )
{
ang = ( target->field_34_vec.pad + 2 ) * 1024;
ang = ( target->offset.pad + 2 ) * 1024;
}
else
{
ang = target->field_34_vec.pad * 1024;
ang = target->offset.pad * 1024;
}
}

View File

@ -811,9 +811,9 @@ void Johnny_800C50D0(JohnnyWork *work)
void Johnny_800C5124(TARGET *target)
{
target->a_mode = 0;
target->field_28 = 0;
target->life_lost = 0;
target->damaged &= ~(TARGET_TOUCH | TARGET_POWER | TARGET_CAPTURE);
target->field_2C_vec = DG_ZeroVector;
target->scale = DG_ZeroVector;
}
void Johnny_800C8400(JohnnyWork *work, int action);
@ -857,7 +857,7 @@ void s03c_johnny_800C5168(JohnnyWork *work)
AN_Fog(&work->control.mov);
if (target->field_2A <= 0)
if (target->faint <= 0)
{
work->unkB38 = Johnny_800C9144;
work->unkB4E = 0;
@ -877,7 +877,7 @@ void s03c_johnny_800C5168(JohnnyWork *work)
AN_Fog(&work->control.mov);
if (target->field_2A <= 0)
if (target->faint <= 0)
{
work->unkB38 = Johnny_800C9144;
work->unkB4E = 0;
@ -899,7 +899,7 @@ void s03c_johnny_800C5168(JohnnyWork *work)
}
else
{
work->unkB30 = target->field_2C_vec;
work->unkB30 = target->scale;
work->unkB38 = Johnny_800C854C;
work->unkB4E = 0;
@ -2567,7 +2567,7 @@ void Johnny_800C8400(JohnnyWork *work, int action)
{
work->unkB1C &= ~0x200;
if (work->target->field_26_hp <= 0)
if (work->target->life <= 0)
{
work->unkB38 = Johnny_800C9144;
work->unkB4E = 0;
@ -2609,7 +2609,7 @@ void Johnny_800C854C(JohnnyWork *work, int action)
{
work->unkB1C |= 0x200;
SetAction(work, 20);
work->target->field_26_hp--;
work->target->life--;
}
if (action < 12)
@ -2620,7 +2620,7 @@ void Johnny_800C854C(JohnnyWork *work, int action)
if (work->object.is_end != 0)
{
work->unkB50 = 1;
if (work->target->field_26_hp > 0)
if (work->target->life > 0)
{
work->unkB38 = Johnny_800C873C;
}
@ -2649,7 +2649,7 @@ void Johnny_800C8654(JohnnyWork *work, int action)
{
SetAction(work, 19);
work->control.turn.vy = GM_PlayerControl->turn.vy + 2048;
work->target->field_26_hp--;
work->target->life--;
}
if (action == 20)
{
@ -2659,7 +2659,7 @@ void Johnny_800C8654(JohnnyWork *work, int action)
if (work->object.is_end != 0)
{
work->unkB50 = 2;
if (work->target->field_26_hp > 0)
if (work->target->life > 0)
{
work->unkB38 = Johnny_800C873C;
}
@ -2687,10 +2687,10 @@ void Johnny_800C873C(JohnnyWork *work, int action)
if (work->unkB24 & 8)
{
work->target->field_2A = 0;
work->target->faint = 0;
}
if (work->target->field_2A <= 0)
if (work->target->faint <= 0)
{
if (work->unkB4E == 0)
{
@ -2846,8 +2846,8 @@ void Johnny_800C8B14(JohnnyWork *work, int action)
}
if (s03c_johnny_800C8A2C(work, 7) == 0 && (work->unkB24 & 8))
{
work->target->field_42 = 0;
work->target->field_2A = 0;
work->target->captured = 0;
work->target->faint = 0;
GM_SeSet(&work->control.mov, 0x8E);
work->unkB38 = Johnny_800C8C34;
work->unkB4E = 0;
@ -2905,7 +2905,7 @@ void Johnny_800C8D58(JohnnyWork *work, int action)
GM_SeSet(&work->control.mov, 0x8E);
GM_SeSet(&work->control.mov, 0x90);
SetAction(work, 29);
work->target->field_26_hp -= 255;
work->target->life -= 255;
GM_TotalEnemiesKilled++;
}
if (action > 48 && action < 60)
@ -2967,8 +2967,8 @@ void Johnny_800C8E84(JohnnyWork *work, int action)
if (work->unkB24 & 8)
{
work->target->field_42 = 0;
work->target->field_2A = 0;
work->target->captured = 0;
work->target->faint = 0;
GM_SeSet(&control->mov, 0x8E);

View File

@ -666,7 +666,7 @@ void s00a_command_800C6BCC( WatcherWork* work, int time )
//if they fall from a height?
else if ( ctrl->mov.vy - ctrl->levels[0] > 3000 )
{
work->target->field_26_hp = 0;
work->target->life = 0;
GM_SeSetMode( &ctrl->mov, 0x8E, GM_SEMODE_BOMB ) ;
}
}
@ -690,7 +690,7 @@ void s00a_command_800C6BCC( WatcherWork* work, int time )
GM_SetNoise( 0x64, 4, &work->control.mov ) ;
ENE_PutBlood_800C8FF8( work, 6, 1 ) ;
if ( work->target->field_26_hp <= 0 )
if ( work->target->life <= 0 )
{
SetMode( work, s00a_command_800C8054 );
}
@ -746,25 +746,25 @@ void s00a_command_800C6FA8( WatcherWork* work, int time )
if ( time == 0 )
{
work->field_B5A = target->field_2A;
work->field_B5A = target->faint;
GM_SeSet( &work->control.mov, 0x8F );
}
if ( work->field_B5A != target->field_2A )
if ( work->field_B5A != target->faint )
{
GM_SeSet( &work->control.mov, 0x8F );
work->field_B5A = target->field_2A;
work->field_B5A = target->faint;
}
if ( target->damaged & TARGET_POWER )
{
ENE_PutBlood_800C8FF8( work, 5, 0 );
GM_SeSet( &work->control.mov, 0x8F );
target->field_2C_vec = DG_ZeroVector;
target->field_28 = 0;
target->scale = DG_ZeroVector;
target->life_lost = 0;
target->damaged = TARGET_STALE;
if ( target->field_26_hp <= 0 )
if ( target->life <= 0 )
{
v1 = target->a_mode;
if ( v1 == 1 )
@ -774,7 +774,7 @@ void s00a_command_800C6FA8( WatcherWork* work, int time )
work->unknown.field_14 = 5;
target->side = ENEMY_SIDE;
SetMode( work, s00a_command_800C78E0 );
target->field_42 = 0;
target->captured = 0;
}
}
switch ( GM_PlayerAction )
@ -788,7 +788,7 @@ void s00a_command_800C6FA8( WatcherWork* work, int time )
work->field_B5C = 0;
}
if ( work->field_B5C == 0x32 && target->field_2A > 0 )
if ( work->field_B5C == 0x32 && target->faint > 0 )
{
SetAction( work, ACTION48, ACTINTERP );
}
@ -813,7 +813,7 @@ void s00a_command_800C6FA8( WatcherWork* work, int time )
case 0x27:
work->unknown.field_14 = 4;
target->side = ENEMY_SIDE;
target->field_26_hp = 0;
target->life = 0;
SetMode( work, s00a_command_800C78E0 );
return;
default:
@ -831,11 +831,11 @@ void s00a_command_800C6FA8( WatcherWork* work, int time )
if ( work->sn_dis > 800 || a0 > 500 )
{
target->field_42 = 0;
target->captured = 0;
}
if ( !( work->control.map->index & GM_PlayerMap ) )
{
target->field_42 = 0;
target->captured = 0;
}
work->target->class |= ( TARGET_SEEK | TARGET_POWER) ;
work->vision.facedir = work->control.rot.vy;
@ -916,7 +916,7 @@ void s00a_command_800C7498( WatcherWork* work, int time )
SetAction( work, ACTION40, ACTINTERP );
}
if ( work->target->field_2A <= 0 )
if ( work->target->faint <= 0 )
{
x = work->control.mov.vx % 60;
work->field_B5A = abs(x) + 90;
@ -939,9 +939,9 @@ void s00a_command_800C7498( WatcherWork* work, int time )
}
else if ( work->field_B5A < time )
{
if ( work->target->field_2A <= 0 )
if ( work->target->faint <= 0 )
{
work->target->field_2A = work->param_faint;
work->target->faint = work->param_faint;
}
SetMode( work, s00a_command_800C76C4 );
@ -1039,7 +1039,7 @@ void s00a_command_800C78E0( WatcherWork *work, int time )
unk = &work->unknown;
work->unknown.field_1E = 0;
work->act_status |= 0x8;
work->control.step = work->target->field_2C_vec;
work->control.step = work->target->scale;
ctrl = &work->control;
@ -1056,7 +1056,7 @@ void s00a_command_800C78E0( WatcherWork *work, int time )
break;
case 1:
SetAction( work, ACTION37, ACTINTERP );
if ( work->target->field_26_hp <= 0 )
if ( work->target->life <= 0 )
{
if ( GM_CurrentWeaponId == WP_Rifle )
{
@ -1171,7 +1171,7 @@ void s00a_command_800C78E0( WatcherWork *work, int time )
{
if (ctrl->mov.vy - ctrl->levels[0] > 3000)
{
work->target->field_26_hp = 0;
work->target->life = 0;
SetMode( work, s00a_command_800C7E28 );
return;
}
@ -1181,8 +1181,8 @@ void s00a_command_800C78E0( WatcherWork *work, int time )
if ( work->body.is_end )
{
work->unknown.field_1E = 1;
work->target->field_2C_vec = DG_ZeroVector;
if ( work->target->field_26_hp <= 0 )
work->target->scale = DG_ZeroVector;
if ( work->target->life <= 0 )
{
SetMode( work, s00a_command_800C8054 );
}
@ -1213,7 +1213,7 @@ void s00a_command_800C7E28( WatcherWork* work, int time )
if ( work->unknown.last_set < 39 )
{
ctrl->step = work->target->field_2C_vec;
ctrl->step = work->target->scale;
if ( work->body.is_end )
{
if ( work->unknown.field_14 < 3 )
@ -1237,13 +1237,13 @@ void s00a_command_800C7E28( WatcherWork* work, int time )
{
if ( !ctrl->touch_flag )
{
ctrl->step = work->target->field_2C_vec;
ctrl->step = work->target->scale;
}
if ( ctrl->level_flag )
{
work->unknown.field_1E = 1;
work->target->field_2C_vec = DG_ZeroVector;
work->target->scale = DG_ZeroVector;
GM_SeSetMode( &ctrl->mov, SE_HIT_FLOOR, GM_SEMODE_BOMB );
ENE_PutBlood_800C8FF8( work, 6, 1 );
SetMode( work, s00a_command_800C8054 );
@ -1276,7 +1276,7 @@ void s00a_command_800C8054( WatcherWork *work, int time )
GM_ConfigControlAttribute( &work->control, 0 );
work->alert_level = 0;
work->sn_dis = 30000;
sub_8002DD14( work->target, NULL );
GM_TargetBody( work->target, NULL );
}
if ( time == 4 && TOPCOMMAND_800E0F20.mode == 0 )

View File

@ -782,7 +782,7 @@ void CameraAct_800D5F64(CameraWork *work)
{
if (target->a_mode != 2)
{
target->field_28 = 0;
target->life_lost = 0;
target->damaged = 0;
}
else

View File

@ -71,8 +71,8 @@ int s00a_command_800C5194( WatcherWork *work ) {
switch ( val )
{
case 2:
target->field_2C_vec = DG_ZeroVector;
if ( target->field_2A <= 0 )
target->scale = DG_ZeroVector;
if ( target->faint <= 0 )
{
work->unknown.field_14 = 1;
SetMode( work, s00a_command_800C78E0 ) ;
@ -87,8 +87,8 @@ int s00a_command_800C5194( WatcherWork *work ) {
SetMode( work, s00a_command_800C78E0 ) ;
break;
case 0:
target->field_2C_vec = DG_ZeroVector;
if ( target->field_26_hp <= 0 )
target->scale = DG_ZeroVector;
if ( target->life <= 0 )
{
work->unknown.field_14 = 1;
SetMode( work, s00a_command_800C78E0 ) ;
@ -99,7 +99,7 @@ int s00a_command_800C5194( WatcherWork *work ) {
}
break;
case 1:
if ( s00a_command_800C5158( &target->field_2C_vec ) < 100 )
if ( s00a_command_800C5158( &target->scale ) < 100 )
{
work->unknown.field_14 = 3;
}
@ -118,7 +118,7 @@ int s00a_command_800C5194( WatcherWork *work ) {
break;
}
target->field_28 = 0;
target->life_lost = 0;
target->damaged = 0;
return 1;
}
@ -139,11 +139,11 @@ int s00a_command_800C5370( WatcherWork * work )
if ( TOPCOMMAND_800E0F20.mode == TOP_COMM_TRAVEL )
{
work->target->field_2A = 0;
work->target->faint = 0;
}
else
{
work->target->field_2A -= 5;
work->target->faint -= 5;
}
return 1;
@ -177,7 +177,7 @@ void InitTarget_800C5484( WatcherWork *work )
GM_Target_8002DCCC( target, 1, -1, life, faint, &ENEMY_TARGET_FORCE_800C35AC );
GM_Target_8002DCB4( target, -1, faint, NULL, NULL);
sub_8002DD14( target, &( work->body.objs->objs[1].world ) );
GM_TargetBody( target, &( work->body.objs->objs[1].world ) );
target2 = &work->field_904;
GM_SetTarget( target2, TARGET_POWER, PLAYER_SIDE, &ENEMY_ATTACK_SIZE_800C35B4 );
@ -249,7 +249,7 @@ void s00a_command_800C55B0( WatcherWork* work )
work->field_BA4 = COM_NO_POINT_800C35D4;
work->field_BA2 = 0;
sub_8002DD14( work->target, &( work->body.objs->objs[1].world ) );
GM_TargetBody( work->target, &( work->body.objs->objs[1].world ) );
reset_num = work->field_B81;
if ( reset_num != 0xFF )

View File

@ -378,7 +378,7 @@ void EnemyPushMove_800CA0E8( WatcherWork *work )
return;
}
GV_AddVec3( &target->field_34_vec, &work->control.step, &work->control.step );
GV_AddVec3( &target->offset, &work->control.step, &work->control.step );
target->damaged &= ~( 0x8 );
if ( work->unknown.last_set - 1 >= 2u )
@ -386,25 +386,25 @@ void EnemyPushMove_800CA0E8( WatcherWork *work )
return;
}
if ( target->field_34_vec.pad )
if ( target->offset.pad )
{
if ( GV_Time & 256 )
{
s1 = target->field_34_vec.pad * 1024;
s1 = target->offset.pad * 1024;
if ( !( work->field_B78 & 1 ) )
{
s1 = ( target->field_34_vec.pad + 2 ) * 1024;
s1 = ( target->offset.pad + 2 ) * 1024;
}
}
else
{
if ( work->field_B78 & 1 )
{
s1 = ( target->field_34_vec.pad + 2 ) * 1024;
s1 = ( target->offset.pad + 2 ) * 1024;
}
else
{
s1 = target->field_34_vec.pad * 1024;
s1 = target->offset.pad * 1024;
}
}
s1 &= 0xFFF;

View File

@ -300,7 +300,7 @@ void s07a_meryl7_800D5780( WatcherWork *work )
GM_Target_8002DCCC( target, 1, -1, life, faint, &ENEMY_TARGET_FORCE_800C35AC );
GM_Target_8002DCB4( target, -1, faint, NULL, NULL);
sub_8002DD14( target, &( work->body.objs->objs[1].world ) );
GM_TargetBody( target, &( work->body.objs->objs[1].world ) );
target2 = &work->field_904;
GM_SetTarget( target2, TARGET_POWER, PLAYER_SIDE, &ENEMY_ATTACK_SIZE_800C35B4 );

View File

@ -743,30 +743,30 @@ void s07a_meryl_unk_800D8290( WatcherWork *work, int time )
if ( time == 0 )
{
work->field_B5A = target->field_2A;
work->field_B5A = target->faint;
GM_SeSet( &work->control.mov, 0xBE );
}
if ( work->field_B5A != target->field_2A )
if ( work->field_B5A != target->faint )
{
GM_SeSet( &work->control.mov, 0xBE );
work->field_B5A = target->field_2A;
work->field_B5A = target->faint;
}
if ( target->damaged & TARGET_POWER )
{
ENE_PutBlood_800D973C( work, 5, 0 );
GM_SeSet( &work->control.mov, 0xBE );
target->field_2C_vec = DG_ZeroVector;
target->field_28 = 0;
target->scale = DG_ZeroVector;
target->life_lost = 0;
target->damaged = TARGET_STALE;
if ( target->field_26_hp <= 0 )
if ( target->life <= 0 )
{
work->unknown.field_14 = 5;
target->side = ENEMY_SIDE;
SetMode( work, s07a_meryl_unk_800D8CB4 );
target->field_42 = 0;
target->captured = 0;
}
}
switch ( GM_PlayerAction )
@ -780,7 +780,7 @@ void s07a_meryl_unk_800D8290( WatcherWork *work, int time )
work->field_B5C = 0;
}
if ( work->field_B5C == 0x32 && target->field_2A > 0 )
if ( work->field_B5C == 0x32 && target->faint > 0 )
{
SetAction( work, ACTION48, ACTINTERP );
}
@ -805,7 +805,7 @@ void s07a_meryl_unk_800D8290( WatcherWork *work, int time )
case 0x27:
work->unknown.field_14 = 4;
target->side = ENEMY_SIDE;
target->field_26_hp = 0;
target->life = 0;
SetMode( work, s07a_meryl_unk_800D8CB4 );
return;
default:
@ -817,7 +817,7 @@ void s07a_meryl_unk_800D8290( WatcherWork *work, int time )
if ( work->sn_dis > 800 )
{
target->field_42 = 0;
target->captured = 0;
}
work->target->class |= ( TARGET_SEEK | TARGET_POWER) ;
@ -911,7 +911,7 @@ void s07a_meryl_unk_800D8798( WatcherWork *work, int time )
SetAction( work, ACTION40, ACTINTERP );
}
if ( work->target->field_2A <= 0 )
if ( work->target->faint <= 0 )
{
x = work->control.mov.vx % 90;
work->field_B5A = abs(x) + 90;
@ -939,9 +939,9 @@ void s07a_meryl_unk_800D8798( WatcherWork *work, int time )
{
if ( work->field_B5A < time )
{
if ( work->target->field_2A <= 0 )
if ( work->target->faint <= 0 )
{
work->target->field_2A = work->param_faint;
work->target->faint = work->param_faint;
}
SetMode( work, s07a_meryl_unk_800D8AA0 );
}
@ -1057,7 +1057,7 @@ void s07a_meryl_unk_800D8CB4( WatcherWork *work, int time )
unk = &work->unknown;
work->unknown.field_1E = 0;
work->act_status |= 0x8;
work->control.step = work->target->field_2C_vec;
work->control.step = work->target->scale;
ctrl = &work->control;
@ -1074,7 +1074,7 @@ void s07a_meryl_unk_800D8CB4( WatcherWork *work, int time )
break;
case 1:
SetAction( work, ACTION37, ACTINTERP );
if ( work->target->field_26_hp <= 0 )
if ( work->target->life <= 0 )
{
if ( GM_CurrentWeaponId == WP_Rifle )
{
@ -1118,7 +1118,7 @@ void s07a_meryl_unk_800D8CB4( WatcherWork *work, int time )
}
}
if ( time == 2 && work->target->field_26_hp <= 0 && GM_GameOverTimer == 0 && GM_SnakeCurrentHealth > 0 )
if ( time == 2 && work->target->life <= 0 && GM_GameOverTimer == 0 && GM_SnakeCurrentHealth > 0 )
{
if ( work->field_C3C >= 0 )
{
@ -1203,8 +1203,8 @@ void s07a_meryl_unk_800D8CB4( WatcherWork *work, int time )
if ( work->body.is_end )
{
work->unknown.field_1E = 1;
work->target->field_2C_vec = DG_ZeroVector;
if ( work->target->field_26_hp <= 0 )
work->target->scale = DG_ZeroVector;
if ( work->target->life <= 0 )
{
SetMode( work, s07a_meryl_unk_800D9410 );
}
@ -1223,7 +1223,7 @@ void s07a_meryl_unk_800D9230( WatcherWork* work, int time )
work->unknown.field_1E = 0;
work->act_status |= 0x8;
ctrl->step = work->target->field_2C_vec;
ctrl->step = work->target->scale;
if ( time == 0 && work->unknown.field_14 != 2 )
{
@ -1260,7 +1260,7 @@ void s07a_meryl_unk_800D9230( WatcherWork* work, int time )
else if ( ctrl->level_flag )
{
work->unknown.field_1E = 1;
work->target->field_2C_vec = DG_ZeroVector;
work->target->scale = DG_ZeroVector;
GM_SeSet( &ctrl->mov, SE_HIT_FLOOR );
ENE_PutBlood_800D973C( work, 6, 1 );
SetMode( work, s07a_meryl_unk_800D9410 );
@ -1399,12 +1399,12 @@ void s07a_meryl_unk_800D952C( WatcherWork *work )
if ( s07a_meryl_unk_800D66F4( &GM_PlayerPosition ) || s07a_meryl_unk_800D66B0( &ctrl->mov ) )
{
work->visible = 0;
sub_8002DD14( work->target, 0 );
GM_TargetBody( work->target, NULL );
}
else
{
work->visible = 1;
sub_8002DD14( work->target, &( work->body.objs->objs[1].world ) );
GM_TargetBody( work->target, &( work->body.objs->objs[1].world ) );
}
}
}

View File

@ -92,8 +92,8 @@ int s07a_meryl_unk_800D6860( WatcherWork *work )
switch ( val )
{
case 2:
target->field_2C_vec = DG_ZeroVector;
if ( target->field_2A <= 0 )
target->scale = DG_ZeroVector;
if ( target->faint <= 0 )
{
work->unknown.field_14 = 1;
SetMode( work, s07a_meryl_unk_800D8CB4 ) ;
@ -108,8 +108,8 @@ int s07a_meryl_unk_800D6860( WatcherWork *work )
SetMode( work, s07a_meryl_unk_800D8CB4 ) ;
break;
case 0:
target->field_2C_vec = DG_ZeroVector;
if ( target->field_26_hp <= 0 )
target->scale = DG_ZeroVector;
if ( target->life <= 0 )
{
work->unknown.field_14 = 1;
SetMode( work, s07a_meryl_unk_800D8CB4 ) ;
@ -120,7 +120,7 @@ int s07a_meryl_unk_800D6860( WatcherWork *work )
}
break;
case 1:
if ( s07a_meryl_unk_800D6824( &target->field_2C_vec ) < 100 )
if ( s07a_meryl_unk_800D6824( &target->scale ) < 100 )
{
work->unknown.field_14 = 3;
}
@ -142,7 +142,7 @@ int s07a_meryl_unk_800D6860( WatcherWork *work )
break;
}
target->field_28 = 0;
target->life_lost = 0;
target->damaged = 0;
return 1;
}
@ -164,11 +164,11 @@ int s07a_meryl_unk_800D6A50( WatcherWork * work )
if ( TOPCOMMAND_800E0F20.mode == TOP_COMM_TRAVEL )
{
work->target->field_2A = 0;
work->target->faint = 0;
}
else
{
work->target->field_2A -= 5;
work->target->faint -= 5;
}
return 1;

View File

@ -396,7 +396,7 @@ void EnemyPushMove_800DB23C( WatcherWork *work )
return;
}
GV_AddVec3( &target->field_34_vec, &work->control.step, &work->control.step );
GV_AddVec3( &target->offset, &work->control.step, &work->control.step );
target->damaged &= ~( 0x8 );
if ( work->unknown.last_set - 1 >= 2u )
@ -404,25 +404,25 @@ void EnemyPushMove_800DB23C( WatcherWork *work )
return;
}
if ( target->field_34_vec.pad )
if ( target->offset.pad )
{
if ( GV_Time & 256 )
{
s1 = target->field_34_vec.pad * 1024;
s1 = target->offset.pad * 1024;
if ( !( work->field_B78 & 1 ) )
{
s1 = ( target->field_34_vec.pad + 2 ) * 1024;
s1 = ( target->offset.pad + 2 ) * 1024;
}
}
else
{
if ( work->field_B78 & 1 )
{
s1 = ( target->field_34_vec.pad + 2 ) * 1024;
s1 = ( target->offset.pad + 2 ) * 1024;
}
else
{
s1 = target->field_34_vec.pad * 1024;
s1 = target->offset.pad * 1024;
}
}
s1 &= 0xFFF;

View File

@ -257,7 +257,7 @@ void InitTarget_800C444C( WatcherWork *work )
GM_Target_8002DCCC( target, 1, -1, life, faint, &ENEMY_TARGET_FORCE_800C35AC );
GM_Target_8002DCB4( target, -1, faint, NULL, NULL);
sub_8002DD14( target, &( work->body.objs->objs[1].world ) );
GM_TargetBody( target, &( work->body.objs->objs[1].world ) );
target2 = &work->field_904;
GM_SetTarget( target2, TARGET_POWER, PLAYER_SIDE, &ENEMY_ATTACK_SIZE_800C35B4 );

View File

@ -912,7 +912,7 @@ void GunCame_Act_800C80F4(GunCameWork *work)
{
if (target->a_mode != 2)
{
target->field_28 = 0;
target->life_lost = 0;
target->damaged = 0;
}
else if (s03e_dword_800C32B8 == 0)

View File

@ -126,7 +126,7 @@ void s13a_smktrgt_800DBD60(SmktrgtWork *work, int index)
{
sp38 = DG_ZeroVector;
target2->field_26_hp = 32;
target2->life = 32;
GM_MoveTarget(target2, &work->fA24[index]);
GM_PowerTarget(target2);
@ -192,11 +192,11 @@ void s13a_smktrgt_800DBD60(SmktrgtWork *work, int index)
}
else
{
target2->field_26_hp = 32;
target2->life = 32;
GM_MoveTarget(target2, &work->fB64[index]);
GM_PowerTarget(target2);
target1->field_26_hp = 32;
target1->life = 32;
GM_MoveTarget(target1, &work->fBE4[index]);
GM_PowerTarget(target1);

View File

@ -8,6 +8,7 @@
#include "game/game.h"
#include "takabe/thing.h"
#include "bullet/bakudan.h"
#include "linkvar.h"
typedef struct DummyWallWork
{
@ -79,7 +80,7 @@ void DummyWallAct_800D6E64(DummyWallWork *work)
{
target->damaged &= ~TARGET_POWER;
if (work->field_168 != 0 ||
(target->a_mode == 2 && (target->field_44 == 6 || target->field_44 == 4) && target->field_26_hp < -128))
(target->a_mode == 2 && (target->weapon == WP_C4 || target->weapon == WP_Stinger) && target->life < -128))
{
work->field_164 = 1;
if (work->field_168 == 0)
@ -112,13 +113,13 @@ void DummyWallAct_800D6E64(DummyWallWork *work)
GCL_ExecProc(work->field_188, NULL);
}
}
target->field_26_hp = 0;
target->life = 0;
}
svec2 = &work->field_15C;
GM_MoveTarget(target, svec2);
target->field_26_hp = 0;
target->life = 0;
target->damaged &= ~TARGET_PUSH;
DG_SetPos2(&work->field_14C, &work->field_154);

View File

@ -112,7 +112,7 @@ void GlassAct_800D302C(GlassWork *work)
GM_SeSet(&work->pos, SE_GLASS_SHATTER);
DG_TransposeMatrix(&work->world, &world);
gte_ApplyMatrixSV(&world, &target->field_2C_vec, &sp30);
gte_ApplyMatrixSV(&world, &target->scale, &sp30);
if (sp30.vz > 0)
{

View File

@ -127,7 +127,7 @@ void PanelAct_800D1E58(PanelWork *work)
if ((target->damaged & TARGET_POWER) && (work->f86 == 0))
{
target->damaged &= ~TARGET_POWER;
target->field_2C_vec = DG_ZeroVector;
target->scale = DG_ZeroVector;
PanelTexPack_800D1BD0(&work->prim->packs[0]->poly_gt4, work->tex, 1, work);
PanelTexPack_800D1BD0(&work->prim->packs[1]->poly_gt4, work->tex, 1, work);
@ -198,7 +198,7 @@ void PanelCreateTarget_800D1FF0(PanelWork *work)
target = GM_AllocTarget();
work->target = target;
target->field_2C_vec = DG_ZeroVector;
target->scale = DG_ZeroVector;
GM_SetTarget(target, (TARGET_SEEK | TARGET_POWER), NO_SIDE, &size);
GM_Target_8002DCCC(target, 1, -1, 2, 0, &DG_ZeroVector);

View File

@ -72,19 +72,19 @@ void s04c_at_800D71A4(AtWork *work)
break;
case 2:
target->field_26_hp = 0;
target->life = 0;
break;
case 3:
target->field_26_hp -= 10;
target->life -= 10;
break;
case 4:
target->field_26_hp -= 20;
target->life -= 20;
break;
}
hp = target->field_26_hp;
hp = target->life;
if (hp < 0)
{
hp = 0;
@ -120,7 +120,7 @@ void AtAct_800D7324(AtWork *work)
GM_ActObject2(&work->body);
s04c_at_800D71A4(work);
work->target->field_28 = 0;
work->target->life_lost = 0;
switch (work->f728)
{
@ -276,7 +276,7 @@ int AtGetResources_800D75BC(AtWork *work, int name, int map)
work->f730 = 0;
work->f72C = 0;
work->target->field_26_hp = work->f738;
work->target->life = work->f738;
if (GCL_GetOption('u'))
{

View File

@ -280,13 +280,13 @@ void s04c_wire_800D2E7C(WireWork *work)
if (work->f203C->damaged & 0x8)
{
x = work->f203C->field_34_vec.vx;
x = work->f203C->offset.vx;
if (x != 0)
{
work->f20BC.vx += (x / abs(x)) * 150;
}
z = work->f203C->field_34_vec.vz;
z = work->f203C->offset.vz;
if (z != 0)
{
work->f20BC.vz += (z / abs(z)) * 150;

View File

@ -47,12 +47,12 @@ void Monitor1Act_800DC8BC(Monitor1Work *work)
work->flag2 = 0;
DG_GetLightMatrix(&control->mov, light);
if ((target->damaged & TARGET_POWER) && target->field_26_hp != 255 && work->bound == 0)
if ((target->damaged & TARGET_POWER) && target->life != 255 && work->bound == 0)
{
work->flag = 1;
work->bound = 1;
target->field_26_hp = 255;
target->life = 255;
target->damaged &= ~TARGET_POWER;
GM_SeSet(&control->mov, SE_ELECTRIC_PANEL);

View File

@ -201,7 +201,7 @@ void s12a_wolf2_800D37A8(Wolf2Work *work)
{
if ((target->damaged & TARGET_POWER) && target->a_mode != 2)
{
work->f7A4 -= work->f65C->field_28 / 4;
work->f7A4 -= work->f65C->life_lost / 4;
s12a_wolf2_800D375C(work);
work->f6B0 = 0;
@ -254,11 +254,11 @@ void s12a_wolf2_800D37A8(Wolf2Work *work)
if (target->a_mode == 2)
{
work->f7A4 -= work->f65C->field_28 / 4;
work->f7A4 -= work->f65C->life_lost / 4;
}
else
{
work->f7A4 -= work->f660->field_28 / 8;
work->f7A4 -= work->f660->life_lost / 8;
}
s12a_wolf2_800D375C(work);
@ -303,13 +303,13 @@ void s12a_wolf2_800D37A8(Wolf2Work *work)
}
work->f65C->damaged &= ~TARGET_POWER;
work->f65C->field_28 = 0;
work->f65C->field_26_hp = 1024;
work->f65C->life_lost = 0;
work->f65C->life = 1024;
work->f65C->a_mode = 0;
work->f660->damaged &= ~TARGET_POWER;
work->f660->field_28 = 0;
work->f660->field_26_hp = 1024;
work->f660->life_lost = 0;
work->f660->life = 1024;
work->f660->a_mode = 0;
if (work->f6AC == 1 && GM_StreamStatus() == 2)

View File

@ -614,10 +614,10 @@ void Dog_800CAB68(DogWork *work, int index, int hp)
}
target = &work->field_1194[index];
target->field_26_hp = hp;
target->field_2C_vec.vx = GV_RandU(32);
target->field_2C_vec.vy = GV_RandU(32);
target->field_2C_vec.vz = GV_RandU(32);
target->life = hp;
target->scale.vx = GV_RandU(32);
target->scale.vy = GV_RandU(32);
target->scale.vz = GV_RandU(32);
GM_MoveTarget(target, &GM_PlayerPosition);
GM_PowerTarget(target);
}

View File

@ -292,7 +292,7 @@ void CrowAct_800DDD08(CrowWork *work)
GM_ConfigControlHazard(&entry->control, 50, 50, 50);
work->f28--;
entry->f39C = entry->target->field_2C_vec;
entry->f39C = entry->target->scale;
entry->f39C.vx = GV_RandS(64);
entry->f39C.vy = GV_RandU(32) + 32;
entry->f39C.vz = GV_RandU(64);

View File

@ -544,7 +544,7 @@ void Valcan_800D990C(ValcanWork *work)
if (now < 0)
{
now = 0;
work->field_664->field_26_hp = 0;
work->field_664->life = 0;
work->field_900 = 0;
}