124 key_id =
event[index].event->key_id;
126 if (chara_no != -1) {
127 for (i = 0; i < 96; i++) {
128 if (NowColData->
active[i] == 0) {
132 if (NowColData->
hit[i].
owner != chara_no) {
136 if (key_id != -1 && NowColData->
hit[i].
attack_no != key_id) {
140 sceVu0FVECTOR hit_position;
141 sceVu0CopyVector(hit_position, NowColData->
hit[i].
pos);
142 float radius =
event[index].event->radius;
144 if (DistVector(hit_position,
event[index].pos) <= radius) {
145 return &
event[index];
177 sceVu0FVECTOR event_position;
178 sceVu0FVECTOR target_position;
180 sceVu0CopyVector(target_position, position);
181 float target_height = target_position[1];
182 target_position[1] = 0.0f;
184 for (i = 0; i < 96; i++) {
185 if (
event[i].CheckSwitch() != 0) {
186 sceVu0CopyVector(event_position,
event[i].pos);
187 float height_difference = target_height - event_position[1];
188 height_difference = height_difference < 0.0f ? -height_difference : height_difference;
190 if (height_difference < 40.0f) {
191 event_position[1] = 0.0f;
192 float radius =
event[i].event->radius;
194 if (DistVector(event_position, target_position) <= radius + 10.0f) {
205 sceVu0FVECTOR local_origin = {0.0f, 0.0f, 0.0f, 0.0f};
206 sceVu0FMATRIX matrix;
207 sceVu0FMATRIX part_matrix;
214 for (row = 0; row < 16; row++) {
215 for (column = 0; column < 16; column++) {
222 for (
int slot_no = 0; slot_no < 64; slot_no++) {
223 if ((definition =
SearchPartsID(slot_no, parts_id)) == NULL) {
229 if (runtime_event == NULL) {
230 printf(
"** eventdata err \n");
236 runtime_event->
Set(definition);
237 float direction = (float) map->
cells[column + row * 20].
direction;
240 if (direction > 3.0f) {
244 if (direction == 3.0f) {
248 direction = (PI * (-90.0f * direction)) / 180.0f;
251 runtime_event->
dir[0] = 0.0f;
252 runtime_event->
dir[1] = atan2f(matrix[2][0], matrix[2][2]);
253 runtime_event->
dir[2] = 0.0f;
254 runtime_event->
dir[3] = 1.0f;
255 definition->
placement_frame->SetPosition(160.0f * (
float) column, 0.0f, 160.0f * (
float) row);
256 definition->
trigger_frame->GetWorldPosition(runtime_event->
pos, local_origin);
264 for (
int parts_id = 0; map->
parts[parts_id].
frame[0] != NULL; parts_id++) {
265 for (
int slot_no = 0; slot_no < 64; slot_no++) {
266 if ((definition =
SearchPartsID(slot_no, parts_id)) == NULL) {
271 runtime_event->
Set(definition);
275 if (direction > 3.0f) {
279 if (direction == 3.0f) {
283 float angle = (PI * (-90.0f * direction)) / 180.0f;
286 runtime_event->
dir[0] = 0.0f;
287 runtime_event->
dir[1] = atan2f(part_matrix[2][0], part_matrix[2][2]);
288 runtime_event->
dir[2] = 0.0f;
289 runtime_event->
dir[3] = 1.0f;
290 definition->
trigger_frame->GetWorldPosition(runtime_event->
pos, local_origin);