1#pragma helper_mask_gpr 0x30
2#pragma helper_mask_fpr 0x1000
3#pragma name_counter 836
5#pragma argument_flag_ones 189, 248, 267, 286, 342, 348, 410, 430, 470, 490
6#pragma argument_flag_ones 540, 545, 617, 622, 693, 699, 746, 747, 749
15#include "btactstatus.hpp"
18#include "clothread.hpp"
19#include "collisiondata.hpp"
21#include "dun/gameloop.hpp"
23#include "framevu1.hpp"
26#include "motionmodel.hpp"
27#include "shot_effect.hpp"
28#include "shot_freefuncs.hpp"
30#include "userstatus.hpp"
33void sound_play(
float from,
float to,
float now,
int se_no) {
34 if (now >= from && now <= to) {
35 SndSePlay(se_no, -1, 0);
39void basic_damage(
int kind,
int owner) {
60 sceVu0FVECTOR rotation;
68 driveNoInterpolate = 1;
100 int damage = NowWeaponHave->
attack;
102 if (StatusErrCheck(AILMENT_STAMINA) != 0) {
109 element_se = NowWeaponHave->
best_elem + 0x65;
112 if (element_se == 0x66) {
116 sceVu0FVECTOR hit_pos;
117 sceVu0FVECTOR chara_pos;
120 sceVu0CopyVector(chara_pos, CharaMain.
pos);
122 if (time >= 825 && time <= 828.0f) {
123 NowColData->
Set(hit_pos, damage, 1, 2.8f, 0.0f, 2, 2, 0, 0);
128 if (time >= 833 && time <= 835) {
129 NowColData->
Set(hit_pos, damage, 1, 5.3f, 0.0f, 2, 2, 0, 0);
134 if (time >= 842 && time <= 844.0f) {
135 NowColData->
Set(hit_pos, damage, 1, 6.2f, 0.0f, 2, 2, 0, 0);
140 if (time >= 851 && time <= 854) {
141 NowColData->
Set(hit_pos, damage, 1, 6.2f, 0.0f, 2, 2, 0, 0);
146 if (time >= 862 && time <= 866) {
148 NowColData->
Set(hit_pos, damage, 1, 6.2f, 0.0f, 2, 2, 0, 0);
153 if (time >= 193.0f && time <= 196.0f) {
155 NowColData->
Set(hit_pos, damage, 1, 6.0f, 0.0f, 2, 2, 0, 0);
160 if (time >= 720.0f && time <= 722) {
162 NowColData->
Set(hit_pos, damage, 1, 12.0f, 0.0f, 2, 2, 0, 0);
167 int swing_motions[4] = {0x25, 0x26, 0x27, 0x28};
169 for (
int i = 0; i < 4; i++) {
173 if (swing_start < time && swing_end > time) {
178 sound_play(825, 825.3f, time, 0x190);
179 sound_play(833, 833.3f, time, 0x191);
180 sound_play(842, 842.3f, time, 0x190);
181 sound_play(852.0f, 852.3f, time, 0x190);
182 sound_play(864.0f, 864.3f, time, 0x191);
183 sound_play(193.0f, 193.3f, time, 0x191);
184 sound_play(717, 717.3f, time, 0x191);
185 sound_play(825, 825.3f, time, 0x1A4);
186 sound_play(833, 833.3f, time, 0x1A5);
187 sound_play(842, 842.3f, time, 0x1A5);
188 sound_play(852.0f, 852.3f, time, 0x1A4);
189 sound_play(864.0f, 864.3f, time, 0x1A6);
191 sceVu0FVECTOR forward = {0.0f, 0.0f, 1.0f, 1.0f};
192 sceVu0FVECTOR rotation;
193 sceVu0FMATRIX matrix;
195 CharaMain.
frame->GetRotation(rotation);
196 sceVu0UnitMatrix(matrix);
197 sceVu0RotMatrixY(matrix, matrix, rotation[1]);
198 sceVu0ApplyMatrix(BtActStatus.
move_vector, matrix, forward);
201 if (time >= 820.0f && time <= 820.5f) {
208 if (GamePad.
On(PadInput_OK) == 0) {
214 if (time >= 824.0f && time <= 825) {
217 CWeaponFx.
Set(8, 32.0f, tip);
222 if (time >= end - 1.0f && time <= end) {
237 driveNoInterpolate = 1;
238 CharaMain.
frame->SearchFrame(
"dcol1");
242 if (lockOnTargetFlag != 0) {
246 BtActStatus.unk_028 = 0;
268 if (time >= 832.0f && time <= 833) {
269 CWeaponFx.
Set(0xA, 32.0f, 32.0f);
274 if (time >= end - 1.0f && time <= end) {
284 driveNoInterpolate = 1;
285 CharaMain.
frame->SearchFrame(
"dcol1");
289 if (lockOnTargetFlag != 0) {
293 BtActStatus.unk_028 = 0;
314 if (time >= 841 && time <= 841.5f) {
315 CWeaponFx.
Set(8, 32.0f, 64.0f);
320 if (time >= end - 1.0f && time <= end) {
330 driveNoInterpolate = 1;
331 CharaMain.
frame->SearchFrame(
"dcol1");
335 if (lockOnTargetFlag != 0) {
339 BtActStatus.unk_028 = 0;
360 if (time >= 849 && time <= 849.5f) {
361 CWeaponFx.
Set(0xA, 32.0f, 32.0f);
366 if (time >= end - 1.0f && time <= end) {
376 driveNoInterpolate = 1;
377 CharaMain.
frame->SearchFrame(
"dcol1");
380 if (lockOnTargetFlag != 0) {
384 BtActStatus.unk_028 = 0;
397 if (time >= 867.5f && time <= 868.0f) {
404 if (time >= 861 && time <= 861.5f) {
405 CWeaponFx.
Set(0xE, 24.0f, 32.0f);
410 if (time >= end - 1.0f && time <= end) {
411 if (lockOnTargetFlag != 0) {
415 BtActStatus.unk_028 = 0;
426 if (GamePad.
On(PadInput_OK) == 0) {
435 setUnitAmbientAnime(15.0f, 1.0f, 0.0f, 122.0f, 208.0f);
440 setUnitAmbientAnime(15.0f, 1.0f, 0.0f, 122.0f, 208.0f);
458 driveNoInterpolate = 1;
459 SwordDmgCheck1(2.0f, 0);
463 sceVu0FVECTOR shot_pos;
464 sceVu0FVECTOR shot_vector = {0.0001f, 0.9998f, 0.0001f, 1.0f};
466 sceVu0CopyVector(shot_pos, CharaMain.
pos);
467 NowMainEffect->
Set(shot_pos, shot_vector, 0, -1, 0, NULL, -1);
470 NowMainEffect->
SetDmg((
int) (1.5f * (
float) damage));
473 SwordDmgCheck1(3.0f, 0);
476 driveNoInterpolate = 1;
477 SndSePlay(SE_CHARA_SHOUT_4, -1, 0);
480 if (lockOnTargetFlag != 0) {
484 BtActStatus.unk_028 = 0;
492 if (time >= 720.0f && time <= 720.5f) {
493 CWeaponFx.
Set(0x1E, 28.0f, 16.0f);
503 if (time >= end - 1.0f && time <= end) {
504 if (lockOnTargetFlag != 0) {
508 BtActStatus.unk_028 = 0;
523 if (time >= 187.0f && time < 188.0f) {
524 sceVu0FVECTOR shot_from;
525 sceVu0FVECTOR shot_to;
527 sceVu0CopyVector(shot_from, CharaMain.
pos);
528 getCharacterVector(shot_to, 0.0f);
529 sceVu0ScaleVectorXYZ(shot_to, shot_to, 16.0f);
530 shot_to[0] += shot_from[0];
531 shot_to[1] = shot_from[1];
532 shot_to[2] += shot_from[2];
534 ParabolicInitialVector(&BtActStatus.
jump_velocity_x, shot_from, shot_to, 0.1f, 40.0f);
541 if (time >= end - 1.0f && time <= end) {
544 driveNoInterpolate = 1;
554 driveNoInterpolate = 1;
555 CWeaponFx.
Set(0x14, 16.0f, 64.0f);
557 SndSePlay(SE_CHARA_SHOUT_3, -1, 0);
566 if (time >= end - 1.0f && time <= end) {
568 driveNoInterpolate = 1;
579 driveNoInterpolate = 1;
589 if (time >= end - 1.0f && time <= end) {
590 if (lockOnTargetFlag != 0) {
594 BtActStatus.unk_028 = 0;
614 sceVu0FVECTOR rotation;
622 driveNoInterpolate = 1;
642void UngagaKey_Play() {
644 sceVu0FVECTOR hit_left;
645 sceVu0FVECTOR hit_right;
646 sceVu0FVECTOR chara_pos;
650 sceVu0CopyVector(chara_pos, CharaMain.
pos);
655 element_se = NowWeaponHave->
best_elem + 0x65;
658 int damage = NowWeaponHave->
attack;
660 if (StatusErrCheck(AILMENT_STAMINA) != 0) {
664 if (time >= 674 && time <= 677) {
665 NowColData->
Set(hit_left, damage, 1, 6.0f, 0, 2, 2, 0, 0);
668 NowColData->
Set(hit_right, damage, 1, 6.0f, 0.0f, 2, 2, 0, 0);
673 if (time >= 686 && time <= 692.0f) {
674 NowColData->
Set(hit_left, damage, 1, 6.0f, 0.0f, 2, 2, 0, 0);
677 NowColData->
Set(hit_right, damage, 1, 6.0f, 0.0f, 2, 2, 0, 0);
682 if (time >= 700.0f && time <= 704.0f) {
683 NowColData->
Set(hit_left, damage, 1, 6.0f, 0.0f, 2, 2, 0, 0);
686 NowColData->
Set(hit_right, damage, 1, 6.0f, 0.0f, 2, 2, 0, 0);
691 int swing_motions[3] = {0x25, 0x26, 0x27};
693 for (
int i = 0; i < 3; i++) {
697 if (swing_start < time && swing_end > time) {
702 if (time >= 674 && time <= 674.5f) {
703 CWeaponFx.
Set(0x10, 16.0f, 64.0f);
706 if (time >= 686 && time <= 686.5f) {
707 CWeaponFx.
Set(0x10, 16.0f, 64.0f);
710 if (time >= 699 && time <= 699.5f) {
711 CWeaponFx.
Set(0x10, 16.0f, 64.0f);
714 sound_play(675, 675.3f, time, 0x1A4);
715 sound_play(687, 687.3f, time, 0x1A5);
716 sound_play(700.0f, 700.3f, time, 0x1A5);
718 sceVu0FVECTOR forward = {0.0f, 0.0f, 1.0f, 1.0f};
719 sceVu0FVECTOR rotation;
720 sceVu0FMATRIX matrix;
722 CharaMain.
frame->GetRotation(rotation);
723 sceVu0UnitMatrix(matrix);
724 sceVu0RotMatrixY(matrix, matrix, rotation[1]);
725 sceVu0ApplyMatrix(BtActStatus.
move_vector, matrix, forward);
728 if (GamePad.
On(PadInput_OK) == 0) {
738 if (time >= end - 1.0f && time <= end) {
748 driveNoInterpolate = 1;
757 driveNoInterpolate = 1;
761 if (lockOnTargetFlag != 0) {
765 BtActStatus.unk_028 = 0;
776 if (time >= 679 && time <= 679.5f) {
781 if (GamePad.
On(PadInput_OK) == 0) {
791 if (time >= end - 0.5f && time <= end) {
801 driveNoInterpolate = 1;
806 if (lockOnTargetFlag != 0) {
810 BtActStatus.unk_028 = 0;
820 if (time >= 699 && time <= 699.5f) {
825 if (GamePad.
On(PadInput_OK) == 0) {
835 if (time >= end - 1.0f && time <= end) {
836 if (lockOnTargetFlag != 0) {
840 BtActStatus.unk_028 = 0;
849 if (GamePad.
On(PadInput_OK) == 0) {
856 BtActStatus.unk_028 = 0;
860 if (lockOnTargetFlag != 0) {
867 if (time >= end - 2.0f && time <= end) {
870 SndSePlay(SE_CHARA_SHOUT_3, -1, 0);
875 if (GamePad.
On(PadInput_OK) == 0) {
892 sceVu0FVECTOR effect_pos;
893 sceVu0FVECTOR effect_vector;
895 SndSeSeqPlayStop(0x192, 30, 1);
898 getCharacterVector(effect_vector, 0.0f);
899 effect_vector[0] += effect_pos[0];
900 effect_vector[1] += effect_pos[1];
901 effect_vector[2] += effect_pos[2];
902 NowMainEffect->
Set(effect_pos, effect_vector, 4, 2, 0, NULL, -1);
906 NowMainEffect->
SetDmg((
int) (1.5f * (
float) damage));
908 SwordDmgCheck1(0.8f, 0);
922 if (time >= end - 2.0f && time <= end) {
923 BtActStatus.unk_028 = 0;
927 if (lockOnTargetFlag != 0) {
939 sceVu0FVECTOR rotation;
947 driveNoInterpolate = 1;
962 int damage = NowWeaponHave->
attack;
964 if (StatusErrCheck(AILMENT_STAMINA) != 0) {
971 element_se = NowWeaponHave->
best_elem + 0x65;
974 if (element_se == 0x66) {
978 sceVu0FVECTOR shot_vector = {0.001f, 1.0f, 0.001f, 1.0f};
979 sceVu0FVECTOR hit_pos;
980 sceVu0FVECTOR chara_pos;
983 sceVu0CopyVector(chara_pos, CharaMain.
pos);
985 if (time >= 99.0f && time <= 102.0f) {
986 NowColData->
Set(hit_pos, damage, 1, 5.0f, 0.0f, 2, 2, 0, 0);
991 if (time >= 462.0f && time <= 482.0f) {
993 NowColData->
Set(hit_pos, damage, 1, 5.0f, 0.0f, 2, 2, 0, 0);
1009 if (time >= 482.0f && time < 482.4f) {
1010 NowMainEffect->
Set(hit_pos, shot_vector, 2, -1, 0, NULL, -1);
1013 NowMainEffect->
SetDmg((
int) (1.2f * (
float) damage));
1016 NowColData->
SetKickBack(chara_pos, 2.5f, 0.1f, 2);
1022 if (time >= 103.0f && time < 103.4f) {
1028 if (time >= 98.0f && time < 98.3f) {
1029 SndSePlay(SE_CHARA_SHOUT, -1, 0);
1032 if (time >= 471 && time < 471.4f) {
1033 SndSePlay(SE_CHARA_SHOUT_2, -1, 0);
1036 if (time >= 471 && time < 471.4f) {
1037 SndSePlay(SE_CHARA_ACTION_3, -1, 0);
1040 if (time >= 478.0f && time < 478.4f) {
1041 SndSePlay(SE_CHARA_ACTION_3, -1, 0);
1044 if (time >= 481 && time < 481.4f) {
1045 SndSePlay(SE_CHARA_ACTION_4, -1, 0);
1048 sceVu0FVECTOR forward = {0.0f, 0.0f, 1.0f, 1.0f};
1049 sceVu0FVECTOR rotation;
1050 sceVu0FMATRIX matrix;
1052 CharaMain.
frame->GetRotation(rotation);
1053 sceVu0UnitMatrix(matrix);
1054 sceVu0RotMatrixY(matrix, matrix, rotation[1]);
1055 sceVu0ApplyMatrix(BtActStatus.
move_vector, matrix, forward);
1058 if (time >= 94.5f && time <= 95.0f) {
1065 if (GamePad.
On(PadInput_OK) == 0) {
1073 if (time >= 95.0f && time <= 95.5f && BtActStatus.
action_step == 0) {
1082 if (time >= end - 1.0f && time <= end) {
1083 if (lockOnTargetFlag != 0) {
1087 BtActStatus.unk_028 = 0;
1102 setUnitAmbientAnime(15.0f, 1.0f, 0.0f, 122.0f, 208.0f);
1110 if (GamePad.
On(PadInput_OK) == 0) {
1112 sceVu0FVECTOR restart_rotation;
1132 SwordDmgCheck1(2.0f, 0);
1133 SndSePlay(SE_GORO_SMASH, -1, 0);
1143 if (time >= end - 1.0f && time <= end) {
1144 BtActStatus.unk_028 = 0;
1152 if (lockOnTargetFlag != 0) {
tagMOTION_TYPE motion_type
int Set(float *position, int damage, int life, float radius, float scale_rate, int target_mask, int kind, int flags, int attribute)
void SetKickBack(float *origin, float speed, float decay, int mode)
virtual void GetRotation(float *out_rotation)
void SetVsMonster(char *effectiveness)
void SetWepStatus(int status)
void SetAttribute(int attribute)
int Set(float *position, float *target, int owner, int sub_id, int source, CFrame *parent, int initial_phase)
void Set(int hold, float fade, float fade_out)
sceVu0FVECTOR move_vector
MOTION_INFO * motion_info