2020-08-04 08:49:11 +02:00
|
|
|
#include "common.h"
|
|
|
|
|
2020-08-13 07:03:47 +02:00
|
|
|
void default_trigger_function_handler(s32* arg0) {
|
|
|
|
arg0[0] |= 2;
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
|
|
|
INCLUDE_ASM(code_dbd70_len_700, clear_trigger_data);
|
|
|
|
|
2020-08-13 07:03:47 +02:00
|
|
|
void init_trigger_list(void) {
|
2020-08-14 06:08:55 +02:00
|
|
|
if ((*gGameStatusPtr)->isBattle == 0) {
|
2020-08-13 07:03:47 +02:00
|
|
|
*gCurrentTriggerListPtr = gTriggerList1;
|
|
|
|
} else {
|
|
|
|
*gCurrentTriggerListPtr = gTriggerList2;
|
|
|
|
}
|
|
|
|
|
|
|
|
gTriggerCount = 0;
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
|
|
|
INCLUDE_ASM(code_dbd70_len_700, create_trigger);
|
|
|
|
|
|
|
|
INCLUDE_ASM(code_dbd70_len_700, update_triggers);
|
|
|
|
|
2020-08-16 05:19:00 +02:00
|
|
|
void delete_trigger(Trigger* toDelete) {
|
2020-08-13 07:03:47 +02:00
|
|
|
s32 i;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_COUNT(gCurrentTriggerListPtr); i++) {
|
|
|
|
if ((*gCurrentTriggerListPtr)[i] == toDelete) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i < ARRAY_COUNT(gCurrentTriggerListPtr)) {
|
|
|
|
heap_free((*gCurrentTriggerListPtr)[i]);
|
|
|
|
(*gCurrentTriggerListPtr)[i] = NULL;
|
|
|
|
}
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
|
|
|
INCLUDE_ASM(code_dbd70_len_700, is_trigger_bound);
|
|
|
|
|
2020-08-16 05:19:00 +02:00
|
|
|
Trigger* get_trigger_by_id(s32 triggerID) {
|
2020-08-13 07:03:47 +02:00
|
|
|
return (*gCurrentTriggerListPtr)[triggerID];
|
|
|
|
}
|
2020-08-04 08:49:11 +02:00
|
|
|
|
|
|
|
INCLUDE_ASM(code_dbd70_len_700, func_80145CE8);
|
2020-08-14 17:18:05 +02:00
|
|
|
/*s32 func_80145CE8(s32 arg0) {
|
|
|
|
s32 i;
|
|
|
|
s32 ret;
|
|
|
|
|
|
|
|
if (func_800E52F8() == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_COUNT(gCurrentTriggerListPtr); i++) {
|
2020-08-19 02:55:56 +02:00
|
|
|
if (((*gCurrentTriggerListPtr)[i] == NULL) ||
|
2020-08-14 17:18:05 +02:00
|
|
|
((*gCurrentTriggerListPtr)[i]->unk_30 == 0) ||
|
|
|
|
((*gCurrentTriggerListPtr)[i]->colliderID != arg0) ||
|
|
|
|
((*gCurrentTriggerListPtr)[i]->genericFlagIndex & 0x100) == 0) {
|
|
|
|
ret = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}*/
|