mirror of
https://github.com/pmret/papermario.git
synced 2024-11-08 12:02:30 +01:00
Lots of area func deduplication (#300)
* splat disasm update * a little * splat jtbl robustness * git subrepo pull (merge) --force tools/splat subrepo: subdir: "tools/splat" merged: "150dcdebfd" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "150dcdebfd" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * some rodata stuff * git subrepo pull tools/splat subrepo: subdir: "tools/splat" merged: "21bf3a381c" upstream: origin: "https://github.com/ethteck/splat.git" branch: "master" commit: "21bf3a381c" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * progress * All area rodata migrated * UnkDistFunc * SwitchToPartner * UnkNpcAIFunc23 * UnkNpcAIFunc24 * UnkNpcAIFunc25 * cleanup & symbol_addrs * disasm update
This commit is contained in:
parent
41417f4d70
commit
425dc5df56
@ -859,136 +859,15 @@ Script N(makeEntities) = SCRIPT({
|
|||||||
MakeEntity(0x802E9A18, 250, 237, 125, 0, MAKE_ENTITY_END);
|
MakeEntity(0x802E9A18, 250, 237, 125, 0, MAKE_ENTITY_END);
|
||||||
});
|
});
|
||||||
|
|
||||||
void N(func_80240000_BDED90)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void N(func_80240158_BDEEE8)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 x, z;
|
|
||||||
s32 var;
|
|
||||||
|
|
||||||
if (aiSettings->unk_14 >= 0) {
|
|
||||||
if (script->functionTemp[1].s <= 0) {
|
|
||||||
script->functionTemp[1].s = aiSettings->unk_14;
|
|
||||||
if (func_800490B4(territory, enemy, aiSettings->alertRadius, aiSettings->unk_10.f, 0)) {
|
|
||||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
|
|
||||||
ai_enemy_play_sound(npc, 0x2F4, 0x200000);
|
|
||||||
if (enemy->npcSettings->unk_2A & 1) {
|
|
||||||
script->functionTemp[0].s = 10;
|
|
||||||
} else {
|
|
||||||
script->functionTemp[0].s = 12;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
script->functionTemp[1].s--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
if (npc->moveSpeed < 4.0) {
|
|
||||||
func_8003D660(npc, 0);
|
|
||||||
} else {
|
|
||||||
func_8003D660(npc, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
x = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).x;
|
|
||||||
z = (*(enemy->territory->patrol.points + script->functionTemp[2].s)).z;
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z);
|
|
||||||
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
|
|
||||||
if (dist2D(npc->pos.x, npc->pos.z, x, z) <= npc->moveSpeed) {
|
|
||||||
script->functionTemp[0].s = 2;
|
|
||||||
script->functionTemp[1].s = (rand_int(1000) % 3) + 2;
|
|
||||||
if ((aiSettings->unk_2C <= 0) || (aiSettings->moveTime <= 0) ||
|
|
||||||
(aiSettings->waitTime <= 0) || (script->functionTemp[1].s == 0)) {
|
|
||||||
script->functionTemp[0].s = 4;
|
|
||||||
}
|
|
||||||
if (rand_int(10000) % 100 < aiSettings->moveTime) {
|
|
||||||
script->functionTemp[0].s = 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc1.inc.c"
|
#include "world/common/UnkNpcAIFunc1.inc.c"
|
||||||
|
|
||||||
void N(func_802404C0_BDF250)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
s32 var;
|
|
||||||
|
|
||||||
if ((aiSettings->unk_14 >= 0) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
|
||||||
ai_enemy_play_sound(npc, 0x2F4, 0x200000);
|
|
||||||
if (!(enemy->npcSettings->unk_2A & 1)) {
|
|
||||||
script->functionTemp[0].s = 12;
|
|
||||||
} else {
|
|
||||||
script->functionTemp[0].s = 10;
|
|
||||||
}
|
|
||||||
} else if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->duration--;
|
|
||||||
if (npc->duration == 0) {
|
|
||||||
script->functionTemp[1].s--;
|
|
||||||
if (script->functionTemp[1].s != 0) {
|
|
||||||
if (!(enemy->npcSettings->unk_2A & 0x10)) {
|
|
||||||
npc->yaw = clamp_angle(npc->yaw + 180.0f);
|
|
||||||
}
|
|
||||||
npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1);
|
|
||||||
} else {
|
|
||||||
script->functionTemp[0].s = 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void N(func_8024067C_BDF40C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -1052,17 +931,17 @@ ApiStatus N(func_80240B94_BDF924)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240000_BDED90)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240158_BDEEE8)(script, npcAISettings, territoryPtr);
|
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc1)(script, npcAISettings, territoryPtr);
|
||||||
case 3:
|
case 3:
|
||||||
N(func_802404C0_BDF250)(script, npcAISettings, territoryPtr);
|
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024067C_BDF40C)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc25)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
@ -1164,7 +1043,7 @@ ApiStatus N(func_8024113C_BDFECC)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240000_BDED90)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240E90_BDFC20)(script, npcAISettings, territoryPtr);
|
N(func_80240E90_BDFC20)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -1174,7 +1053,7 @@ ApiStatus N(func_8024113C_BDFECC)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_80241068_BDFDF8)(script, npcAISettings, territoryPtr);
|
N(func_80241068_BDFDF8)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024067C_BDF40C)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc25)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -275,39 +275,7 @@ Script N(makeEntities) = SCRIPT({
|
|||||||
MakeItemEntity(ITEM_STAR_PIECE, 540, 230, 13, 17, SI_SAVE_FLAG(1019));
|
MakeItemEntity(ITEM_STAR_PIECE, 540, 230, 13, 17, SI_SAVE_FLAG(1019));
|
||||||
});
|
});
|
||||||
|
|
||||||
void N(func_80240000_BE37B0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, (*(enemy->territory->patrol.points + i)).x, enemy->territory->patrol.points[i].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void N(func_80240158_BE3908)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
void N(func_80240158_BE3908)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||||
Enemy* enemy = script->owner1.enemy;
|
Enemy* enemy = script->owner1.enemy;
|
||||||
@ -359,52 +327,9 @@ void N(func_80240158_BE3908)(ScriptInstance* script, NpcAISettings* aiSettings,
|
|||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc1.inc.c"
|
#include "world/common/UnkNpcAIFunc1.inc.c"
|
||||||
|
|
||||||
void N(func_802404C0_BE3C70)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
s32 var;
|
|
||||||
|
|
||||||
if ((aiSettings->unk_14 >= 0) && func_800490B4(territory, enemy, aiSettings->chaseRadius, aiSettings->unk_28.f, 0)) {
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
fx_emote(0, npc, 0.0f, npc->collisionHeight, 1.0f, 2.0f, -20.0f, 15, &var);
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z);
|
|
||||||
ai_enemy_play_sound(npc, 0x2F4, 0x200000);
|
|
||||||
if (!(enemy->npcSettings->unk_2A & 1)) {
|
|
||||||
script->functionTemp[0].s = 12;
|
|
||||||
} else {
|
|
||||||
script->functionTemp[0].s = 10;
|
|
||||||
}
|
|
||||||
} else if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->duration--;
|
|
||||||
if (npc->duration == 0) {
|
|
||||||
script->functionTemp[1].s--;
|
|
||||||
if (script->functionTemp[1].s != 0) {
|
|
||||||
if (!(enemy->npcSettings->unk_2A & 0x10)) {
|
|
||||||
npc->yaw = clamp_angle(npc->yaw + 180.0f);
|
|
||||||
}
|
|
||||||
npc->duration = aiSettings->waitTime / 2 + rand_int(aiSettings->waitTime / 2 + 1);
|
|
||||||
} else {
|
|
||||||
script->functionTemp[0].s = 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void N(func_8024067C_BE3E2C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -468,17 +393,17 @@ ApiStatus N(func_80240B94_BE4344)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240000_BE37B0)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc24)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240158_BE3908)(script, aiSettings, territoryPtr);
|
N(func_80240158_BE3908)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc1)(script, aiSettings, territoryPtr);
|
||||||
case 3:
|
case 3:
|
||||||
N(func_802404C0_BE3C70)(script, aiSettings, territoryPtr);
|
N(UnkFunc14)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024067C_BE3E2C)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc25)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, aiSettings, territoryPtr);
|
N(NpcJumpFunc2)(script, aiSettings, territoryPtr);
|
||||||
@ -502,29 +427,7 @@ ApiStatus N(func_80240B94_BE4344)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void N(func_80240E90_BE4640)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef NON_MATCHING
|
#ifdef NON_MATCHING
|
||||||
// second npc_raycast_down_sides call
|
// second npc_raycast_down_sides call
|
||||||
@ -727,7 +630,7 @@ ApiStatus N(func_8024219C_BE594C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240E90_BE4640)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80241040_BE47F0)(script, aiSettings, territoryPtr);
|
N(func_80241040_BE47F0)(script, aiSettings, territoryPtr);
|
||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
ApiStatus func_802D2B50(void);
|
ApiStatus func_802D2B50(void);
|
||||||
|
|
||||||
ApiStatus N(func_802412C8_BE8EA8)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(SwitchToPartner)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(func_802412B0_BE8E90)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(func_802412B0_BE8E90)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(func_8024113C_BE8D1C)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(func_8024113C_BE8D1C)(ScriptInstance* script, s32 isInitialCall);
|
||||||
|
|
||||||
|
@ -552,7 +552,7 @@ Script N(80242C50) = SCRIPT({
|
|||||||
SpeakToPlayer(NPC_BOO2, NPC_ANIM(boo, Palette_01, Anim_6), NPC_ANIM(boo, Palette_01, Anim_6), 0, MESSAGE_ID(0x0E, 0x00A1));
|
SpeakToPlayer(NPC_BOO2, NPC_ANIM(boo, Palette_01, Anim_6), NPC_ANIM(boo, Palette_01, Anim_6), 0, MESSAGE_ID(0x0E, 0x00A1));
|
||||||
GetCurrentPartnerID(SI_VAR(0));
|
GetCurrentPartnerID(SI_VAR(0));
|
||||||
if (SI_VAR(0) != 9) {
|
if (SI_VAR(0) != 9) {
|
||||||
N(func_802412C8_BE8EA8)(9);
|
N(SwitchToPartner)(9);
|
||||||
spawn {
|
spawn {
|
||||||
SI_MAP_VAR(0) = 0;
|
SI_MAP_VAR(0) = 0;
|
||||||
ShowMessageAtScreenPos(MESSAGE_ID(0x0E, 0x00A2), 160, 40);
|
ShowMessageAtScreenPos(MESSAGE_ID(0x0E, 0x00A2), 160, 40);
|
||||||
@ -1001,39 +1001,7 @@ Script N(makeEntities) = SCRIPT({
|
|||||||
MakeEntity(0x802EA7E0, 17, 238, 80, 0, MAKE_ENTITY_END);
|
MakeEntity(0x802EA7E0, 17, 238, 80, 0, MAKE_ENTITY_END);
|
||||||
});
|
});
|
||||||
|
|
||||||
void N(func_80240000_BE7BE0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -1041,22 +1009,7 @@ void N(func_80240000_BE7BE0)(ScriptInstance* script, NpcAISettings* aiSettings,
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
void N(func_8024067C_BE825C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -1120,7 +1073,7 @@ ApiStatus N(func_80240B94_BE8774)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240000_BE7BE0)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc24)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(UnkFunc13)(script, aiSettings, territoryPtr);
|
N(UnkFunc13)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -1130,7 +1083,7 @@ ApiStatus N(func_80240B94_BE8774)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(UnkFunc14)(script, aiSettings, territoryPtr);
|
N(UnkFunc14)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024067C_BE825C)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc25)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, aiSettings, territoryPtr);
|
N(NpcJumpFunc2)(script, aiSettings, territoryPtr);
|
||||||
@ -1233,7 +1186,7 @@ ApiStatus N(func_8024113C_BE8D1C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240000_BE7BE0)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc24)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240E90_BE8A70)(script, aiSettings, territoryPtr);
|
N(func_80240E90_BE8A70)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -1243,7 +1196,7 @@ ApiStatus N(func_8024113C_BE8D1C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_80241068_BE8C48)(script, aiSettings, territoryPtr);
|
N(func_80241068_BE8C48)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024067C_BE825C)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc25)(script, aiSettings, territoryPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
enemy->varTable[0] = npc->pos.y;
|
enemy->varTable[0] = npc->pos.y;
|
||||||
@ -1254,7 +1207,4 @@ ApiStatus N(func_802412B0_BE8E90)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
return (gGameStatusPtr->pressedButtons >> 1) & ApiStatus_DONE2;
|
return (gGameStatusPtr->pressedButtons >> 1) & ApiStatus_DONE2;
|
||||||
}
|
}
|
||||||
|
|
||||||
ApiStatus N(func_802412C8_BE8EA8)(ScriptInstance* script, s32 isInitialCall) {
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
|
@ -1163,29 +1163,7 @@ NpcGroupList N(npcGroupList_802478E8) = {
|
|||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
|
|
||||||
void N(func_80240950_BED740)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef NON_MATCHING
|
#ifdef NON_MATCHING
|
||||||
void N(func_80240B00_BED8F0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
void N(func_80240B00_BED8F0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||||
@ -1387,7 +1365,7 @@ ApiStatus N(func_80241C5C_BEEA4C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240950_BED740)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240B00_BED8F0)(script, aiSettings, territoryPtr);
|
N(func_80240B00_BED8F0)(script, aiSettings, territoryPtr);
|
||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
|
@ -485,29 +485,7 @@ NpcAISettings N(npcAISettings_80244D24) = {
|
|||||||
.unk_2C = 1,
|
.unk_2C = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
void N(func_80240120_BFD9A0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef NON_MATCHING
|
#ifdef NON_MATCHING
|
||||||
// second npc_raycast_down_sides call
|
// second npc_raycast_down_sides call
|
||||||
@ -710,7 +688,7 @@ ApiStatus N(func_8024142C_BFECAC)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240120_BFD9A0)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802402D0_BFDB50)(script, aiSettings, territoryPtr);
|
N(func_802402D0_BFDB50)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -1000,7 +978,7 @@ ApiStatus N(func_802422B0_BFFB30)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240120_BFD9A0)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
|
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802402D0_BFDB50)(script, aiSettings, territoryPtr);
|
N(func_802402D0_BFDB50)(script, aiSettings, territoryPtr);
|
||||||
@ -1253,40 +1231,7 @@ Script N(init_80245784) = SCRIPT({
|
|||||||
|
|
||||||
const char N(dgb_00_name_hack)[] = "dgb_00";
|
const char N(dgb_00_name_hack)[] = "dgb_00";
|
||||||
|
|
||||||
ApiStatus N(func_8024252C_BFFDAC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -1294,23 +1239,7 @@ ApiStatus N(func_8024252C_BFFDAC)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
ApiStatus N(btl_state_draw_switch_to_player_C00428)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -1374,7 +1303,7 @@ ApiStatus N(func_802430C0_C00940)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_8024252C_BFFDAC)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc24)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(UnkFunc13)(script, aiSettings, territoryPtr);
|
N(UnkFunc13)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -1384,7 +1313,7 @@ ApiStatus N(func_802430C0_C00940)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(UnkFunc14)(script, aiSettings, territoryPtr);
|
N(UnkFunc14)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(btl_state_draw_switch_to_player_C00428)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc25)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, aiSettings, territoryPtr);
|
N(NpcJumpFunc2)(script, aiSettings, territoryPtr);
|
||||||
|
@ -870,40 +870,7 @@ ApiStatus N(func_8024086C_C31D4C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ApiStatus N(func_80240B20_C32000)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -911,23 +878,7 @@ ApiStatus N(func_80240B20_C32000)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
ApiStatus N(func_8024119C_C3267C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -991,7 +942,7 @@ ApiStatus N(func_802416B4_C32B94)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240B20_C32000)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -1001,7 +952,7 @@ ApiStatus N(func_802416B4_C32B94)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024119C_C3267C)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc25)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
@ -1067,7 +1018,7 @@ ApiStatus N(func_802419B0_C32E90)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240B20_C32000)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -1077,7 +1028,7 @@ ApiStatus N(func_802419B0_C32E90)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024119C_C3267C)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc25)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -356,7 +356,7 @@ Script N(80243EF8) = SCRIPT({
|
|||||||
EnablePartnerAI();
|
EnablePartnerAI();
|
||||||
GetCurrentPartnerID(SI_VAR(0));
|
GetCurrentPartnerID(SI_VAR(0));
|
||||||
if (SI_VAR(0) != SI_VAR(11)) {
|
if (SI_VAR(0) != SI_VAR(11)) {
|
||||||
N(func_802427EC_C38D1C)(SI_VAR(11));
|
N(SwitchToPartner)(SI_VAR(11));
|
||||||
} else {
|
} else {
|
||||||
func_802CF56C(2);
|
func_802CF56C(2);
|
||||||
}
|
}
|
||||||
@ -395,29 +395,7 @@ Script N(makeEntities) = SCRIPT({
|
|||||||
AssignScript(N(80243EF8));
|
AssignScript(N(80243EF8));
|
||||||
});
|
});
|
||||||
|
|
||||||
void N(func_80240000_C36530)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef NON_MATCHING
|
#ifdef NON_MATCHING
|
||||||
// second npc_raycast_down_sides call
|
// second npc_raycast_down_sides call
|
||||||
@ -620,7 +598,7 @@ ApiStatus N(func_8024130C_C3783C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240000_C36530)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802401B0_C366E0)(script, aiSettings, territoryPtr);
|
N(func_802401B0_C366E0)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -900,7 +878,7 @@ ApiStatus N(func_80242154_C38684)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240000_C36530)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
|
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802401B0_C366E0)(script, aiSettings, territoryPtr);
|
N(func_802401B0_C366E0)(script, aiSettings, territoryPtr);
|
||||||
@ -1062,12 +1040,7 @@ INCLUDE_ASM(ApiStatus, "world/area_dgb/dgb_04/C36530", dgb_04_func_8024259C_C38A
|
|||||||
s32 isInitialCall)
|
s32 isInitialCall)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ApiStatus N(func_802427EC_C38D1C)(ScriptInstance* script, s32 isInitialCall) {
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
s32 partnerID = get_variable(script, *script->ptrReadPos);
|
|
||||||
switch_to_partner(partnerID);
|
|
||||||
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ ApiStatus N(func_8024240C_C3893C)(ScriptInstance *script, s32 isInitialCall);
|
|||||||
ApiStatus N(UnkFunc18)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(UnkFunc18)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(UnkFunc38)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(UnkFunc38)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(func_8024259C_C38ACC)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(func_8024259C_C38ACC)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(func_802427EC_C38D1C)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(SwitchToPartner)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(UnkFunc19)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(UnkFunc19)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(UnkFunc20)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(UnkFunc20)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(UnkFunc39)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(UnkFunc39)(ScriptInstance* script, s32 isInitialCall);
|
||||||
|
@ -953,40 +953,7 @@ Script N(802469E0) = SCRIPT({
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ApiStatus N(func_80240000_C3FDB0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -994,23 +961,7 @@ ApiStatus N(func_80240000_C3FDB0)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
ApiStatus N(func_8024067C_C4042C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -1074,7 +1025,7 @@ ApiStatus N(func_80240B94_C40944)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240000_C3FDB0)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -1084,7 +1035,7 @@ ApiStatus N(func_80240B94_C40944)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024067C_C4042C)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc25)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
@ -1242,29 +1193,7 @@ ApiStatus N(func_802414AC_C4125C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void N(func_80241760_C41510)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef NON_MATCHING
|
#ifdef NON_MATCHING
|
||||||
// second npc_raycast_down_sides call
|
// second npc_raycast_down_sides call
|
||||||
@ -1467,7 +1396,7 @@ ApiStatus N(func_80242A6C_C4281C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80241760_C41510)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80241910_C416C0)(script, aiSettings, territoryPtr);
|
N(func_80241910_C416C0)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -1758,7 +1687,7 @@ ApiStatus N(func_802438F0_C436A0)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80241760_C41510)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, npcAISettings, territoryPtr);
|
||||||
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
|
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80241910_C416C0)(script, npcAISettings, territoryPtr);
|
N(func_80241910_C416C0)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -1010,29 +1010,7 @@ ApiStatus N(func_802410D4_C47CB4)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void N(func_80241424_C48004)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef NON_MATCHING
|
#ifdef NON_MATCHING
|
||||||
// second npc_raycast_down_sides call
|
// second npc_raycast_down_sides call
|
||||||
@ -1235,7 +1213,7 @@ ApiStatus N(func_80242730_C49310)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80241424_C48004)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802415D4_C481B4)(script, aiSettings, territoryPtr);
|
N(func_802415D4_C481B4)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -1518,7 +1496,7 @@ ApiStatus N(func_80243578_C4A158)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80241424_C48004)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
|
func_802DE894(npc->spriteInstanceID, 0, 0, 0, 0, 0, 0);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802415D4_C481B4)(script, aiSettings, territoryPtr);
|
N(func_802415D4_C481B4)(script, aiSettings, territoryPtr);
|
||||||
|
@ -576,40 +576,7 @@ ApiStatus N(func_8024061C_C4FB2C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
return ApiStatus_BLOCK;
|
return ApiStatus_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ApiStatus N(func_802408D0_C4FDE0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -617,23 +584,7 @@ ApiStatus N(func_802408D0_C4FDE0)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
ApiStatus N(func_80240F4C_C5045C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -697,7 +648,7 @@ ApiStatus N(func_80241464_C50974)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_802408D0_C4FDE0)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -707,7 +658,7 @@ ApiStatus N(func_80241464_C50974)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_80240F4C_C5045C)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc25)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -683,40 +683,7 @@ Script N(makeEntities) = SCRIPT({
|
|||||||
AssignScript(N(8024382C));
|
AssignScript(N(8024382C));
|
||||||
});
|
});
|
||||||
|
|
||||||
ApiStatus N(func_80240000_C55F40)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -724,23 +691,7 @@ ApiStatus N(func_80240000_C55F40)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
ApiStatus N(func_8024067C_C565BC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -804,7 +755,7 @@ ApiStatus N(func_80240B94_C56AD4)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240000_C55F40)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -814,7 +765,7 @@ ApiStatus N(func_80240B94_C56AD4)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024067C_C565BC)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc25)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -2869,40 +2869,7 @@ Script N(makeEntities) = SCRIPT({
|
|||||||
MakeEntity(0x802EAF80, 430, 0, -120, 0, ITEM_SPIN_JUMP, N(8024D2B0), 1939, MAKE_ENTITY_END);
|
MakeEntity(0x802EAF80, 430, 0, -120, 0, ITEM_SPIN_JUMP, N(8024D2B0), 1939, MAKE_ENTITY_END);
|
||||||
});
|
});
|
||||||
|
|
||||||
ApiStatus N(func_802405E0_95B7E0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -2910,23 +2877,7 @@ ApiStatus N(func_802405E0_95B7E0)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
ApiStatus N(func_80240C5C_95BE5C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -2990,7 +2941,7 @@ ApiStatus N(func_80241174_95C374)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_802405E0_95B7E0)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -3000,7 +2951,7 @@ ApiStatus N(func_80241174_95C374)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_80240C5C_95BE5C)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc25)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -2085,40 +2085,7 @@ Script N(makeEntities) = SCRIPT({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ApiStatus N(func_80240040_C9DF60)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -2126,23 +2093,7 @@ ApiStatus N(func_80240040_C9DF60)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
ApiStatus N(func_802406BC_C9E5DC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -2206,7 +2157,7 @@ ApiStatus N(func_80240BD4_C9EAF4)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240040_C9DF60)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc24)(script, npcAISettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
N(UnkFunc13)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -2216,7 +2167,7 @@ ApiStatus N(func_80240BD4_C9EAF4)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
N(UnkFunc14)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_802406BC_C9E5DC)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc25)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -112,10 +112,7 @@ INCLUDE_ASM(ApiStatus, "world/area_flo/flo_08/CAED40", flo_08_func_802401CC_CAEF
|
|||||||
s32 isInitialCall);
|
s32 isInitialCall);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ApiStatus N(func_8024041C_CAF15C)(ScriptInstance* script, s32 isInitialCall) {
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ Script N(80242178) = SCRIPT({
|
|||||||
EnablePartnerAI();
|
EnablePartnerAI();
|
||||||
GetCurrentPartnerID(SI_VAR(0));
|
GetCurrentPartnerID(SI_VAR(0));
|
||||||
if (SI_VAR(0) != SI_VAR(11)) {
|
if (SI_VAR(0) != SI_VAR(11)) {
|
||||||
N(func_8024041C_CAF15C)(SI_VAR(11));
|
N(SwitchToPartner)(SI_VAR(11));
|
||||||
} else {
|
} else {
|
||||||
func_802CF56C(2);
|
func_802CF56C(2);
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ ApiStatus N(UnkPartnerPosFunc2)(ScriptInstance* script, s32 isInitialCall);
|
|||||||
ApiStatus N(func_8024003C_CAED7C)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(func_8024003C_CAED7C)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(UnkFunc38)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(UnkFunc38)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(func_802401CC_CAEF0C)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(func_802401CC_CAEF0C)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(func_8024041C_CAF15C)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(SwitchToPartner)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(UnkFunc39)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(UnkFunc39)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(func_80240600_CAF340)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(func_80240600_CAF340)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(UnkFunc40)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(UnkFunc40)(ScriptInstance* script, s32 isInitialCall);
|
||||||
|
@ -1,28 +1,6 @@
|
|||||||
#include "flo_09.h"
|
#include "flo_09.h"
|
||||||
|
|
||||||
void N(func_80240320_CB5320)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef NON_MATCHING
|
#ifdef NON_MATCHING
|
||||||
void N(func_802404D0_CB54D0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
void N(func_802404D0_CB54D0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||||
@ -228,7 +206,7 @@ ApiStatus N(func_8024162C_CB662C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240320_CB5320)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, npcAISettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802404D0_CB54D0)(script, npcAISettings, territoryPtr);
|
N(func_802404D0_CB54D0)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -1186,29 +1186,7 @@ NpcGroupList N(npcGroupList_80247984) = {
|
|||||||
|
|
||||||
#include "world/common/UnkFunc41.inc.c"
|
#include "world/common/UnkFunc41.inc.c"
|
||||||
|
|
||||||
void N(func_802401C4_CC39D4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef NON_MATCHING
|
#ifdef NON_MATCHING
|
||||||
void N(func_802404D0_CB54D0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
void N(func_802404D0_CB54D0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
||||||
@ -1415,7 +1393,7 @@ ApiStatus N(func_802414D0_CC4CE0)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_802401C4_CC39D4)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240374_CC3B84)(script, aiSettings, territoryPtr);
|
N(func_80240374_CC3B84)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -1621,7 +1599,7 @@ ApiStatus N(func_80241DB8_CC55C8)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_802401C4_CC39D4)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80241704_CC4F14)(script, aiSettings, territoryPtr);
|
N(func_80241704_CC4F14)(script, aiSettings, territoryPtr);
|
||||||
@ -1722,27 +1700,7 @@ INCLUDE_ASM(ApiStatus, "world/area_flo/flo_13/CC3850", flo_13_func_80241DB8_CC55
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
void N(func_80242314_CC5B24)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim.w = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
|
|
||||||
gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
@ -1843,7 +1801,7 @@ ApiStatus N(func_8024262C_CC5E3C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(set_script_owner_npc_anim)(script, aiSettings, territoryPtr);
|
N(set_script_owner_npc_anim)(script, aiSettings, territoryPtr);
|
||||||
|
|
||||||
case 13:
|
case 13:
|
||||||
N(func_80242314_CC5B24)(script, aiSettings, territoryPtr);
|
N(UnkDistFunc)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 14:
|
case 14:
|
||||||
@ -1975,7 +1933,7 @@ ApiStatus N(func_80242A6C_CC627C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(set_script_owner_npc_anim)(script, aiSettings, territoryPtr);
|
N(set_script_owner_npc_anim)(script, aiSettings, territoryPtr);
|
||||||
|
|
||||||
case 13:
|
case 13:
|
||||||
N(func_80242314_CC5B24)(script, aiSettings, territoryPtr);
|
N(UnkDistFunc)(script, aiSettings, territoryPtr);
|
||||||
npc->collisionHeight = enemy->varTable[6];
|
npc->collisionHeight = enemy->varTable[6];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -309,29 +309,7 @@ Script N(80245224) = SCRIPT({
|
|||||||
spawn N(80244F70);
|
spawn N(80244F70);
|
||||||
});
|
});
|
||||||
|
|
||||||
void N(func_80240B10_CCBE20)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef NON_MATCHING
|
#ifdef NON_MATCHING
|
||||||
// second npc_raycast_down_sides call
|
// second npc_raycast_down_sides call
|
||||||
@ -539,7 +517,7 @@ ApiStatus N(func_80241E1C_CCD12C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240B10_CCBE20)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240CC0_CCBFD0)(script, aiSettings, territoryPtr);
|
N(func_80240CC0_CCBFD0)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -330,7 +330,7 @@ Script N(802438C8) = SCRIPT({
|
|||||||
EnablePartnerAI();
|
EnablePartnerAI();
|
||||||
GetCurrentPartnerID(SI_VAR(0));
|
GetCurrentPartnerID(SI_VAR(0));
|
||||||
if (SI_VAR(0) != SI_VAR(11)) {
|
if (SI_VAR(0) != SI_VAR(11)) {
|
||||||
N(func_802404FC_CD232C)(SI_VAR(11));
|
N(SwitchToPartner)(SI_VAR(11));
|
||||||
} else {
|
} else {
|
||||||
func_802CF56C(2);
|
func_802CF56C(2);
|
||||||
}
|
}
|
||||||
@ -519,10 +519,7 @@ INCLUDE_ASM(ApiStatus, "world/area_flo/flo_16/CD1F10", flo_16_func_802402AC_CD20
|
|||||||
s32 isInitialCall);
|
s32 isInitialCall);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ApiStatus N(func_802404FC_CD232C)(ScriptInstance* script, s32 isInitialCall) {
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -341,29 +341,7 @@ Script N(802451C4) = SCRIPT({
|
|||||||
bind N(80244DC8) to TRIGGER_FLOOR_TOUCH 44;
|
bind N(80244DC8) to TRIGGER_FLOOR_TOUCH 44;
|
||||||
});
|
});
|
||||||
|
|
||||||
void N(func_80240E50_CD2C80)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef NON_MATCHING
|
#ifdef NON_MATCHING
|
||||||
// second npc_raycast_down_sides call
|
// second npc_raycast_down_sides call
|
||||||
@ -566,7 +544,7 @@ ApiStatus N(func_8024215C_CD3F8C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240E50_CD2C80)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80241000_CD2E30)(script, aiSettings, territoryPtr);
|
N(func_80241000_CD2E30)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -675,7 +653,7 @@ ApiStatus N(func_80242754_CD4584)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240E50_CD2C80)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80241000_CD2E30)(script, aiSettings, territoryPtr);
|
N(func_80241000_CD2E30)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -20,7 +20,7 @@ ApiStatus N(UnkPartnerPosFunc2)(ScriptInstance* script, s32 isInitialCall);
|
|||||||
ApiStatus N(func_80240000_CD1E30)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(func_80240000_CD1E30)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(func_8024011C_CD1F4C)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(func_8024011C_CD1F4C)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(func_802402AC_CD20DC)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(func_802402AC_CD20DC)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(func_802404FC_CD232C)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(SwitchToPartner)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(func_802406E0_CD2510)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(func_802406E0_CD2510)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(UnkFunc44)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(UnkFunc44)(ScriptInstance* script, s32 isInitialCall);
|
||||||
ApiStatus N(func_80242754_CD4584)(ScriptInstance* script, s32 isInitialCall);
|
ApiStatus N(func_80242754_CD4584)(ScriptInstance* script, s32 isInitialCall);
|
||||||
|
@ -609,29 +609,7 @@ Script N(makeEntities) = SCRIPT({
|
|||||||
MakeItemEntity(ITEM_LETTER09, -245, 0, 105, 17, SI_SAVE_FLAG(1389));
|
MakeItemEntity(ITEM_LETTER09, -245, 0, 105, 17, SI_SAVE_FLAG(1389));
|
||||||
});
|
});
|
||||||
|
|
||||||
void N(func_80240070_CD7350)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef NON_MATCHING
|
#ifdef NON_MATCHING
|
||||||
// second npc_raycast_down_sides call
|
// second npc_raycast_down_sides call
|
||||||
@ -834,7 +812,7 @@ ApiStatus N(func_8024137C_CD865C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240070_CD7350)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240220_CD7500)(script, aiSettings, territoryPtr);
|
N(func_80240220_CD7500)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -1040,7 +1018,7 @@ ApiStatus N(func_80241C64_CD8F44)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240070_CD7350)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802415B0_CD8890)(script, aiSettings, territoryPtr);
|
N(func_802415B0_CD8890)(script, aiSettings, territoryPtr);
|
||||||
@ -1141,27 +1119,7 @@ INCLUDE_ASM(ApiStatus, "world/area_flo/flo_17/CD7350", flo_17_func_80241C64_CD8F
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
void N(func_802421C0_CD94A0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim.w = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
|
|
||||||
gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
@ -1262,7 +1220,7 @@ ApiStatus N(func_802424D8_CD97B8)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(set_script_owner_npc_anim)(script, aiSettings, territoryPtr);
|
N(set_script_owner_npc_anim)(script, aiSettings, territoryPtr);
|
||||||
|
|
||||||
case 13:
|
case 13:
|
||||||
N(func_802421C0_CD94A0)(script, aiSettings, territoryPtr);
|
N(UnkDistFunc)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 14:
|
case 14:
|
||||||
@ -1394,7 +1352,7 @@ ApiStatus N(func_80242918_CD9BF8)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(set_script_owner_npc_anim)(script, aiSettings, territoryPtr);
|
N(set_script_owner_npc_anim)(script, aiSettings, territoryPtr);
|
||||||
|
|
||||||
case 13:
|
case 13:
|
||||||
N(func_802421C0_CD94A0)(script, aiSettings, territoryPtr);
|
N(UnkDistFunc)(script, aiSettings, territoryPtr);
|
||||||
npc->collisionHeight = enemy->varTable[6];
|
npc->collisionHeight = enemy->varTable[6];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -505,27 +505,7 @@ ApiStatus N(func_802402F8_CEE558)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
void N(func_80240410_CEE670)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim.w = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x,
|
|
||||||
gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
@ -626,7 +606,7 @@ ApiStatus N(func_80240728_CEE988)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(set_script_owner_npc_anim)(script, aiSettings, territoryPtr);
|
N(set_script_owner_npc_anim)(script, aiSettings, territoryPtr);
|
||||||
|
|
||||||
case 13:
|
case 13:
|
||||||
N(func_80240410_CEE670)(script, aiSettings, territoryPtr);
|
N(UnkDistFunc)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 14:
|
case 14:
|
||||||
|
@ -504,29 +504,7 @@ static s32 N(pad_3CD8)[] = {
|
|||||||
0x00000000, 0x00000000,
|
0x00000000, 0x00000000,
|
||||||
};
|
};
|
||||||
|
|
||||||
void N(func_80240040_CF2C10)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim.w = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef NON_MATCHING
|
#ifdef NON_MATCHING
|
||||||
// second npc_raycast_down_sides call
|
// second npc_raycast_down_sides call
|
||||||
@ -729,7 +707,7 @@ ApiStatus N(func_8024134C_CF3F1C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240040_CF2C10)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802401F0_CF2DC0)(script, aiSettings, territoryPtr);
|
N(func_802401F0_CF2DC0)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -839,7 +817,7 @@ ApiStatus N(func_80241944_CF4514)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240040_CF2C10)(script, aiSettings, territoryPtr);
|
N(UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802401F0_CF2DC0)(script, aiSettings, territoryPtr);
|
N(func_802401F0_CF2DC0)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -29,12 +29,6 @@ void func_80240C34_A114B4(void) {
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_hos/hos_01/A11020", func_80240C84_A11504);
|
INCLUDE_ASM(s32, "world/area_hos/hos_01/A11020", func_80240C84_A11504);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_hos/hos_01/A11020", func_80240CB0_A11530);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240CB0_A11530)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_hos/hos_01/A11020", func_80240CDC_A1155C);
|
INCLUDE_ASM(s32, "world/area_hos/hos_01/A11020", func_80240CDC_A1155C);
|
||||||
|
@ -1,31 +1,6 @@
|
|||||||
#include "hos_02.h"
|
#include "hos_02.h"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_hos/hos_02/A17210", func_80240FF0_A17210);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240FF0_A17210)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_hos/hos_02/A17210", func_802411A0_A173C0);
|
INCLUDE_ASM(s32, "world/area_hos/hos_02/A17210", func_802411A0_A173C0);
|
||||||
|
|
||||||
@ -90,7 +65,7 @@ ApiStatus N(func_802422FC_A1851C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240FF0_A17210)(script, aiSettings, territoryPtr);
|
N(hos_02_UnkNpcAIFunc23)(script, aiSettings, territoryPtr);
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802411A0_A173C0)(script, aiSettings, territoryPtr);
|
N(func_802411A0_A173C0)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -2,32 +2,7 @@
|
|||||||
|
|
||||||
#define UNK_ALPHA_FUNC_NPC 7
|
#define UNK_ALPHA_FUNC_NPC 7
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_hos/hos_03/A1BDB0", func_80240CB0_A1BDB0);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240CB0_A1BDB0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_hos/hos_03/A1BDB0", func_80240E60_A1BF60);
|
INCLUDE_ASM(s32, "world/area_hos/hos_03/A1BDB0", func_80240E60_A1BF60);
|
||||||
|
|
||||||
@ -92,7 +67,7 @@ ApiStatus N(func_80241FBC_A1D0BC)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240CB0_A1BDB0)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(btl_merlee_on_start_turn_A1BF60)(script, aiSettings, territoryPtr);
|
N(btl_merlee_on_start_turn_A1BF60)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -2,29 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_isk/isk_04/97B670", func_802400BC_97B6EC);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_802400BC_97B6EC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -1,11 +1,5 @@
|
|||||||
#include "isk_04.h"
|
#include "isk_04.h"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_isk/isk_04/97BF60", func_80240930_97BF60);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240930_97BF60)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_isk/isk_04/97BF60", func_8024095C_97BF8C);
|
INCLUDE_ASM(s32, "world/area_isk/isk_04/97BF60", func_8024095C_97BF8C);
|
||||||
|
@ -7,29 +7,7 @@ static char* N(exit_str_3) = "isk_11";
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_isk/isk_08/984E30", func_8024007C_984EAC);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_8024007C_984EAC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -21,13 +21,7 @@ ApiStatus N(func_8024003C_988B9C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_802401CC_988D2C);
|
INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_802401CC_988D2C);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_isk/isk_10/988B60", func_8024041C_988F7C);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_8024041C_988F7C)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -5,29 +5,7 @@ static char* N(exit_str_1) = "isk_12";
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_isk/isk_18/997F70", func_8024007C_997FEC);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_8024007C_997FEC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -18,13 +18,7 @@ ApiStatus N(func_8024032C_91E89C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_802404BC_91EA2C);
|
INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_802404BC_91EA2C);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_iwa/iwa_10/91E6D0", func_8024070C_91EC7C);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_8024070C_91EC7C)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -2,43 +2,7 @@
|
|||||||
|
|
||||||
#define UNK_ALPHA_FUNC_NPC 5
|
#define UNK_ALPHA_FUNC_NPC 5
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_80240430_B2C8A0);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240430_B2C8A0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -46,26 +10,7 @@ ApiStatus N(func_80240430_B2C8A0)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_80240AAC_B2CF1C);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240AAC_B2CF1C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -131,7 +76,7 @@ ApiStatus N(func_80240FC4_B2D434)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240430_B2C8A0)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240588_B2C9F8)(script, npcAISettings, territoryPtr);
|
N(func_80240588_B2C9F8)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -141,7 +86,7 @@ ApiStatus N(func_80240FC4_B2D434)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_802408F0_B2CD60)(script, npcAISettings, territoryPtr);
|
N(func_802408F0_B2CD60)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_80240AAC_B2CF1C)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
@ -484,4 +429,4 @@ ApiStatus N(func_80242678_B2EAE8)(ScriptInstance *script, s32 isInitialCall) {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_jan/jan_02/B2C8A0", func_802426A8_B2EB18);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
|
@ -25,43 +25,7 @@ static char* N(exit_str_3) = "";
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_802405EC_B351BC);
|
INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_802405EC_B351BC);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_80240620_B351F0);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240620_B351F0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -69,26 +33,7 @@ ApiStatus N(func_80240620_B351F0)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_jan/jan_03/B34BD0", func_80240C9C_B3586C);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240C9C_B3586C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -154,7 +99,7 @@ ApiStatus N(func_802411B4_B35D84)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240620_B351F0)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240778_B35348)(script, npcAISettings, territoryPtr);
|
N(func_80240778_B35348)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -164,7 +109,7 @@ ApiStatus N(func_802411B4_B35D84)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_80240AE0_B356B0)(script, npcAISettings, territoryPtr);
|
N(func_80240AE0_B356B0)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_80240C9C_B3586C)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -16,13 +16,7 @@ ApiStatus N(func_8024069C_B5E94C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_8024082C_B5EADC);
|
INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_8024082C_B5EADC);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_jan/jan_08/B5E910", func_80240A7C_B5ED2C);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240A7C_B5ED2C)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -5,43 +5,7 @@ static char* N(exit_str_1) = "jan_16";
|
|||||||
static char* N(exit_str_2) = "kzn_01";
|
static char* N(exit_str_2) = "kzn_01";
|
||||||
static char* N(exit_str_3) = "";
|
static char* N(exit_str_3) = "";
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_jan/jan_22/B84180", func_80240000_B84180);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240000_B84180)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -49,26 +13,7 @@ ApiStatus N(func_80240000_B84180)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_jan/jan_22/B84180", func_8024067C_B847FC);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_8024067C_B847FC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -134,7 +79,7 @@ ApiStatus N(func_80240B94_B84D14)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240000_B84180)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240158_B842D8)(script, npcAISettings, territoryPtr);
|
N(func_80240158_B842D8)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -144,7 +89,7 @@ ApiStatus N(func_80240B94_B84D14)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_802404C0_B84640)(script, npcAISettings, territoryPtr);
|
N(func_802404C0_B84640)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024067C_B847FC)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -1,42 +1,6 @@
|
|||||||
#include "kkj_00.h"
|
#include "kkj_00.h"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kkj/kkj_00/ABB340", func_802400B0_ABB340);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_802400B0_ABB340)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -44,26 +8,7 @@ ApiStatus N(func_802400B0_ABB340)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kkj/kkj_00/ABB340", func_8024072C_ABB9BC);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_8024072C_ABB9BC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -129,7 +74,7 @@ ApiStatus N(func_80240C44_ABBED4)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_802400B0_ABB340)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240208_ABB498)(script, npcAISettings, territoryPtr);
|
N(func_80240208_ABB498)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -139,7 +84,7 @@ ApiStatus N(func_80240C44_ABBED4)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_80240570_ABB800)(script, npcAISettings, territoryPtr);
|
N(func_80240570_ABB800)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024072C_ABB9BC)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -5,43 +5,7 @@ static char* N(exit_str_1) = "kkj_02";
|
|||||||
static char* N(exit_str_2) = "kkj_14";
|
static char* N(exit_str_2) = "kkj_14";
|
||||||
static char* N(exit_str_3) = "";
|
static char* N(exit_str_3) = "";
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kkj/kkj_01/AC5170", func_80240000_AC5170);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240000_AC5170)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -49,26 +13,7 @@ ApiStatus N(func_80240000_AC5170)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kkj/kkj_01/AC5170", func_8024067C_AC57EC);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_8024067C_AC57EC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -134,7 +79,7 @@ ApiStatus N(func_80240B94_AC5D04)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240000_AC5170)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240158_AC52C8)(script, npcAISettings, territoryPtr);
|
N(func_80240158_AC52C8)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -144,7 +89,7 @@ ApiStatus N(func_80240B94_AC5D04)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_802404C0_AC5630)(script, npcAISettings, territoryPtr);
|
N(func_802404C0_AC5630)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024067C_AC57EC)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -3,32 +3,7 @@
|
|||||||
static char* N(exit_str_0) = "kmr_03";
|
static char* N(exit_str_0) = "kmr_03";
|
||||||
static char* N(exit_str_1) = "kmr_02";
|
static char* N(exit_str_1) = "kmr_02";
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kmr/kmr_05/8CE070", func_80240000_8CE070);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240000_8CE070)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kmr/kmr_05/8CE070", func_802401B0_8CE220);
|
INCLUDE_ASM(s32, "world/area_kmr/kmr_05/8CE070", func_802401B0_8CE220);
|
||||||
|
|
||||||
|
@ -3,32 +3,7 @@
|
|||||||
static char* N(exit_str_0) = "kmr_09";
|
static char* N(exit_str_0) = "kmr_09";
|
||||||
static char* N(exit_str_1) = "kmr_07";
|
static char* N(exit_str_1) = "kmr_07";
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kmr/kmr_06/8D1510", func_80240000_8D1510);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240000_8D1510)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kmr/kmr_06/8D1510", func_802401B0_8D16C0);
|
INCLUDE_ASM(s32, "world/area_kmr/kmr_06/8D1510", func_802401B0_8D16C0);
|
||||||
|
|
||||||
|
@ -3,32 +3,7 @@
|
|||||||
static char* N(exit_str_0) = "kmr_02";
|
static char* N(exit_str_0) = "kmr_02";
|
||||||
static char* N(exit_str_1) = "kmr_06";
|
static char* N(exit_str_1) = "kmr_06";
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_80240000_8D5E00);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240000_8D5E00)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_802401B0_8D5FB0);
|
INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_802401B0_8D5FB0);
|
||||||
|
|
||||||
@ -93,7 +68,7 @@ ApiStatus N(func_8024130C_8D710C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240000_8D5E00)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802401B0_8D5FB0)(script, aiSettings, territoryPtr);
|
N(func_802401B0_8D5FB0)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -2,29 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kpa/kpa_01/A470C0", func_802401DC_A4713C);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_802401DC_A4713C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -2,29 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kpa/kpa_03/A48720", func_802401DC_A4879C);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_802401DC_A4879C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -22,29 +22,7 @@ INCLUDE_ASM(s32, "world/area_kpa/kpa_102/A93A50", func_80241204_A94944);
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kpa/kpa_102/A93A50", func_802415D8_A94D18);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_802415D8_A94D18)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -2,29 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kpa/kpa_11/A52BD0", func_8024038C_A52C4C);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_8024038C_A52C4C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -6,29 +6,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kpa/kpa_113/A9CC70", func_8024022C_A9CE5C);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_8024022C_A9CE5C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -25,29 +25,7 @@ INCLUDE_ASM(s32, "world/area_kpa/kpa_50/A609D0", func_80240EF4_A618C4);
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kpa/kpa_50/A609D0", func_802412C8_A61C98);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_802412C8_A61C98)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -38,29 +38,7 @@ INCLUDE_ASM(s32, "world/area_kpa/kpa_51/A640E0", func_80241404_A65494);
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kpa/kpa_51/A640E0", func_802414C8_A65558);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_802414C8_A65558)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -2,29 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kpa/kpa_61/A6E6F0", func_8024038C_A6E76C);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_8024038C_A6E76C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -2,29 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kpa/kpa_70/A74B80", func_8024038C_A74BFC);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_8024038C_A74BFC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -3,43 +3,7 @@
|
|||||||
static char* N(exit_str_0) = "kpa_90";
|
static char* N(exit_str_0) = "kpa_90";
|
||||||
static char* N(exit_str_1) = "";
|
static char* N(exit_str_1) = "";
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kpa/kpa_91/A86A50", func_80240000_A86A50);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240000_A86A50)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -47,26 +11,7 @@ ApiStatus N(func_80240000_A86A50)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kpa/kpa_91/A86A50", func_8024067C_A870CC);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_8024067C_A870CC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -132,7 +77,7 @@ ApiStatus N(func_80240B94_A875E4)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240000_A86A50)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240158_A86BA8)(script, npcAISettings, territoryPtr);
|
N(func_80240158_A86BA8)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -142,7 +87,7 @@ ApiStatus N(func_80240B94_A875E4)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_802404C0_A86F10)(script, npcAISettings, territoryPtr);
|
N(func_802404C0_A86F10)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024067C_A870CC)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
@ -169,29 +114,7 @@ ApiStatus N(func_80240B94_A875E4)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kpa/kpa_91/A86A50", func_80240F0C_A8795C);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240F0C_A8795C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -1,42 +1,6 @@
|
|||||||
#include "kpa_95.h"
|
#include "kpa_95.h"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kpa/kpa_95/A8CB60", func_802400E0_A8CB60);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_802400E0_A8CB60)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -44,26 +8,7 @@ ApiStatus N(func_802400E0_A8CB60)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kpa/kpa_95/A8CB60", func_8024075C_A8D1DC);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_8024075C_A8D1DC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -129,7 +74,7 @@ ApiStatus N(func_80240C74_A8D6F4)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_802400E0_A8CB60)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240238_A8CCB8)(script, npcAISettings, territoryPtr);
|
N(func_80240238_A8CCB8)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -139,7 +84,7 @@ ApiStatus N(func_80240C74_A8D6F4)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_802405A0_A8D020)(script, npcAISettings, territoryPtr);
|
N(func_802405A0_A8D020)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024075C_A8D1DC)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
@ -166,29 +111,7 @@ ApiStatus N(func_80240C74_A8D6F4)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kpa/kpa_95/A8CB60", func_80240FEC_A8DA6C);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240FEC_A8DA6C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -1,31 +1,6 @@
|
|||||||
#include "kzn_02.h"
|
#include "kzn_02.h"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_802404E0_C5AC20);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_802404E0_C5AC20)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80240690_C5ADD0);
|
INCLUDE_ASM(s32, "world/area_kzn/kzn_02/C5AC20", func_80240690_C5ADD0);
|
||||||
|
|
||||||
@ -90,7 +65,7 @@ ApiStatus N(func_802417EC_C5BF2C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_802404E0_C5AC20)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240690_C5ADD0)(script, aiSettings, territoryPtr);
|
N(func_80240690_C5ADD0)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -205,7 +180,7 @@ ApiStatus N(func_80241DE4_C5C524)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_802404E0_C5AC20)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240690_C5ADD0)(script, aiSettings, territoryPtr);
|
N(func_80240690_C5ADD0)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -2,29 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C61020", func_8024038C_C6109C);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_8024038C_C6109C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -16,13 +16,7 @@ ApiStatus N(func_8024034C_C6847C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_802404DC_C6860C);
|
INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_802404DC_C6860C);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_04/C68440", func_8024072C_C6885C);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_8024072C_C6885C)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -4,32 +4,7 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_80240720_C6EA50);
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_802407F4_C6EB24);
|
INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_802407F4_C6EB24);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_80240820_C6EB50);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240820_C6EB50)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_802409D0_C6ED00);
|
INCLUDE_ASM(s32, "world/area_kzn/kzn_07/C6EA50", func_802409D0_C6ED00);
|
||||||
|
|
||||||
@ -94,7 +69,7 @@ ApiStatus N(func_80241B2C_C6FE5C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240820_C6EB50)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802409D0_C6ED00)(script, aiSettings, territoryPtr);
|
N(func_802409D0_C6ED00)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -1,31 +1,6 @@
|
|||||||
#include "kzn_08.h"
|
#include "kzn_08.h"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71ED0", func_80240A50_C71ED0);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240A50_C71ED0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71ED0", func_80240C00_C72080);
|
INCLUDE_ASM(s32, "world/area_kzn/kzn_08/C71ED0", func_80240C00_C72080);
|
||||||
|
|
||||||
@ -90,7 +65,7 @@ ApiStatus N(func_80241D5C_C731DC)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240A50_C71ED0)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240C00_C72080)(script, aiSettings, territoryPtr);
|
N(func_80240C00_C72080)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -205,7 +180,7 @@ ApiStatus N(func_80242354_C737D4)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240A50_C71ED0)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240C00_C72080)(script, aiSettings, territoryPtr);
|
N(func_80240C00_C72080)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -19,13 +19,7 @@ ApiStatus N(func_8024003C_C76D1C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_802401CC_C76EAC);
|
INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_802401CC_C76EAC);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C76CE0", func_8024041C_C770FC);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_8024041C_C770FC)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -157,29 +157,7 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77D00", func_80242774_C79454);
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77D00", func_80242A40_C79720);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80242A40_C79720)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -1,31 +1,6 @@
|
|||||||
#include "kzn_11.h"
|
#include "kzn_11.h"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_80240460_C80600);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240460_C80600)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_80240610_C807B0);
|
INCLUDE_ASM(s32, "world/area_kzn/kzn_11/C80600", func_80240610_C807B0);
|
||||||
|
|
||||||
@ -90,7 +65,7 @@ ApiStatus N(func_8024176C_C8190C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240460_C80600)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240610_C807B0)(script, aiSettings, territoryPtr);
|
N(func_80240610_C807B0)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -205,7 +180,7 @@ ApiStatus N(func_80241D64_C81F04)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240460_C80600)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240610_C807B0)(script, aiSettings, territoryPtr);
|
N(func_80240610_C807B0)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -157,29 +157,7 @@ INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C85DC0", func_80241A64_C87514);
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_kzn/kzn_17/C85DC0", func_80241D30_C877E0);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80241D30_C877E0)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -1,42 +1,6 @@
|
|||||||
#include "mac_00.h"
|
#include "mac_00.h"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80242570_7ED280);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80242570_7ED280)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -44,26 +8,7 @@ ApiStatus N(func_80242570_7ED280)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mac/mac_00/7ED280", func_80242BEC_7ED8FC);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80242BEC_7ED8FC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -129,7 +74,7 @@ ApiStatus N(func_80243104_7EDE14)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80242570_7ED280)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802426C8_7ED3D8)(script, npcAISettings, territoryPtr);
|
N(func_802426C8_7ED3D8)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -139,7 +84,7 @@ ApiStatus N(func_80243104_7EDE14)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_80242A30_7ED740)(script, npcAISettings, territoryPtr);
|
N(func_80242A30_7ED740)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_80242BEC_7ED8FC)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -6,43 +6,9 @@ extern u8 D_80258407_818C87;
|
|||||||
|
|
||||||
#include "world/common/UnkMusicFunc.inc.c"
|
#include "world/common/UnkMusicFunc.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mac/mac_01/8017D0", func_80241080_801900);
|
#define NAMESPACE dup_mac_01
|
||||||
/*
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
ApiStatus N(func_80241080_801900)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#define NAMESPACE mac_01
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -52,26 +18,9 @@ ApiStatus N(func_80241080_801900)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mac/mac_01/8017D0", func_802416FC_801F7C);
|
#define NAMESPACE dup_mac_01
|
||||||
/*
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
ApiStatus N(func_802416FC_801F7C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
#define NAMESPACE mac_01
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define NAMESPACE dup_mac_01
|
#define NAMESPACE dup_mac_01
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
@ -145,7 +94,7 @@ ApiStatus N(func_80241C14_802494)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80241080_801900)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802411D8_801A58)(script, npcAISettings, territoryPtr);
|
N(func_802411D8_801A58)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -155,7 +104,7 @@ ApiStatus N(func_80241C14_802494)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_80241540_801DC0)(script, npcAISettings, territoryPtr);
|
N(func_80241540_801DC0)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_802416FC_801F7C)(script, npcAISettings, territoryPtr);
|
N(UnkNpcAIFunc25)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
dup_NpcJumpFunc2(script, npcAISettings, territoryPtr);
|
dup_NpcJumpFunc2(script, npcAISettings, territoryPtr);
|
||||||
|
@ -1,42 +1,6 @@
|
|||||||
#include "mac_01.h"
|
#include "mac_01.h"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mac/mac_01/805DD0", func_80245550_805DD0);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80245550_805DD0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13_copy.inc.c"
|
#include "world/common/UnkFunc13_copy.inc.c"
|
||||||
|
|
||||||
@ -44,26 +8,7 @@ ApiStatus N(func_80245550_805DD0)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14_copy.inc.c"
|
#include "world/common/UnkFunc14_copy.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mac/mac_01/805DD0", func_80245BCC_80644C);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80245BCC_80644C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -129,7 +74,7 @@ ApiStatus N(func_802460E4_806964)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80245550_805DD0)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802456A8_805F28)(script, npcAISettings, territoryPtr);
|
N(func_802456A8_805F28)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -139,7 +84,7 @@ ApiStatus N(func_802460E4_806964)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_80245A10_806290)(script, npcAISettings, territoryPtr);
|
N(func_80245A10_806290)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_80245BCC_80644C)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -2,43 +2,7 @@
|
|||||||
|
|
||||||
#define UNK_ALPHA_FUNC_NPC 12
|
#define UNK_ALPHA_FUNC_NPC 12
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mac/mac_02/823BF0", func_80240930_823BF0);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240930_823BF0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -46,26 +10,7 @@ ApiStatus N(func_80240930_823BF0)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mac/mac_02/823BF0", func_80240FAC_82426C);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240FAC_82426C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -131,7 +76,7 @@ ApiStatus N(func_802414C4_824784)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240930_823BF0)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240A88_823D48)(script, npcAISettings, territoryPtr);
|
N(func_80240A88_823D48)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -141,7 +86,7 @@ ApiStatus N(func_802414C4_824784)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_80240DF0_8240B0)(script, npcAISettings, territoryPtr);
|
N(func_80240DF0_8240B0)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_80240FAC_82426C)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -13,43 +13,7 @@ INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_8024030C_85247C);
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_8024047C_8525EC);
|
INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_8024047C_8525EC);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_80240490_852600);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240490_852600)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -57,26 +21,7 @@ ApiStatus N(func_80240490_852600)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mac/mac_05/852170", func_80240B0C_852C7C);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240B0C_852C7C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -142,7 +87,7 @@ ApiStatus N(func_80241024_853194)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240490_852600)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802405E8_852758)(script, npcAISettings, territoryPtr);
|
N(func_802405E8_852758)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -152,7 +97,7 @@ ApiStatus N(func_80241024_853194)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_80240950_852AC0)(script, npcAISettings, territoryPtr);
|
N(func_80240950_852AC0)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_80240B0C_852C7C)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -17,43 +17,7 @@ static char* N(exit_str_3) = "";
|
|||||||
|
|
||||||
#include "world/common/SomeXYZFunc2.inc.c"
|
#include "world/common/SomeXYZFunc2.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mgm/mgm_00/E0E7A0", func_802402E0_E0EA80);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_802402E0_E0EA80)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -61,26 +25,7 @@ ApiStatus N(func_802402E0_E0EA80)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mgm/mgm_00/E0E7A0", func_8024095C_E0F0FC);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_8024095C_E0F0FC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -146,7 +91,7 @@ ApiStatus N(func_80240E74_E0F614)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_802402E0_E0EA80)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240438_E0EBD8)(script, npcAISettings, territoryPtr);
|
N(func_80240438_E0EBD8)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -156,7 +101,7 @@ ApiStatus N(func_80240E74_E0F614)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_802407A0_E0EF40)(script, npcAISettings, territoryPtr);
|
N(func_802407A0_E0EF40)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024095C_E0F0FC)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -7,32 +7,7 @@ INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_80240000_BAD940);
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_80240068_BAD9A8);
|
INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_80240068_BAD9A8);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_802400A0_BAD9E0);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_802400A0_BAD9E0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_80240250_BADB90);
|
INCLUDE_ASM(s32, "world/area_mim/mim_08/BAD940", func_80240250_BADB90);
|
||||||
|
|
||||||
@ -97,7 +72,7 @@ ApiStatus N(func_802413AC_BAECEC)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_802400A0_BAD9E0)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240250_BADB90)(script, aiSettings, territoryPtr);
|
N(func_80240250_BADB90)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -2,43 +2,7 @@
|
|||||||
|
|
||||||
#define UNK_ALPHA_FUNC_NPC 19
|
#define UNK_ALPHA_FUNC_NPC 19
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80240A80_9D7AA0);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240A80_9D7AA0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -46,26 +10,7 @@ ApiStatus N(func_80240A80_9D7AA0)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_802410FC_9D811C);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_802410FC_9D811C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -131,7 +76,7 @@ ApiStatus N(func_80241614_9D8634)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240A80_9D7AA0)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240BD8_9D7BF8)(script, npcAISettings, territoryPtr);
|
N(func_80240BD8_9D7BF8)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -141,7 +86,7 @@ ApiStatus N(func_80241614_9D8634)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_80240F40_9D7F60)(script, npcAISettings, territoryPtr);
|
N(func_80240F40_9D7F60)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_802410FC_9D811C)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
@ -510,13 +455,7 @@ ApiStatus N(func_80242FB8_9D9FD8)(ScriptInstance *script, s32 isInitialCall) {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80242FE4_9DA004);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80242FE4_9DA004)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80243010_9DA030);
|
INCLUDE_ASM(s32, "world/area_nok/nok_02/9D7AA0", func_80243010_9DA030);
|
||||||
|
|
||||||
|
@ -5,29 +5,7 @@ static char* N(exit_str_1) = "nok_12";
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_8024007C_9F4ABC);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_8024007C_9F4ABC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
@ -35,32 +13,7 @@ void N(func_8024007C_9F4ABC)(ScriptInstance *script, NpcAISettings *aiSettings,
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_80240394_9F4DD4);
|
INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_80240394_9F4DD4);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_802407D4_9F5214);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_802407D4_9F5214)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_80240984_9F53C4);
|
INCLUDE_ASM(s32, "world/area_nok/nok_11/9F4A40", func_80240984_9F53C4);
|
||||||
|
|
||||||
@ -125,7 +78,7 @@ ApiStatus N(func_80241AE0_9F6520)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_802407D4_9F5214)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240984_9F53C4)(script, aiSettings, territoryPtr);
|
N(func_80240984_9F53C4)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -2,29 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_802405EC_9FADDC);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_802405EC_9FADDC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
@ -32,43 +10,7 @@ void N(func_802405EC_9FADDC)(ScriptInstance *script, NpcAISettings *aiSettings,
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_80240904_9FB0F4);
|
INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_80240904_9FB0F4);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_80240D44_9FB534);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240D44_9FB534)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -76,26 +18,7 @@ ApiStatus N(func_80240D44_9FB534)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_12/9FAD60", func_802413C0_9FBBB0);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_802413C0_9FBBB0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -161,7 +84,7 @@ ApiStatus N(func_802418D8_9FC0C8)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240D44_9FB534)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240E9C_9FB68C)(script, npcAISettings, territoryPtr);
|
N(func_80240E9C_9FB68C)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -171,7 +94,7 @@ ApiStatus N(func_802418D8_9FC0C8)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_80241204_9FB9F4)(script, npcAISettings, territoryPtr);
|
N(func_80241204_9FB9F4)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_802413C0_9FBBB0)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -2,29 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_8024023C_A02A7C);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_8024023C_A02A7C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
@ -32,32 +10,7 @@ void N(func_8024023C_A02A7C)(ScriptInstance *script, NpcAISettings *aiSettings,
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_80240554_A02D94);
|
INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_80240554_A02D94);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_80240994_A031D4);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240994_A031D4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_80240B44_A03384);
|
INCLUDE_ASM(s32, "world/area_nok/nok_14/A02A00", func_80240B44_A03384);
|
||||||
|
|
||||||
@ -122,7 +75,7 @@ ApiStatus N(func_80241CA0_A044E0)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240994_A031D4)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240B44_A03384)(script, aiSettings, territoryPtr);
|
N(func_80240B44_A03384)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -19,29 +19,7 @@ static char* N(exit_str_3) = "";
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_8024035C_A0725C);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_8024035C_A0725C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
@ -49,32 +27,7 @@ void N(func_8024035C_A0725C)(ScriptInstance *script, NpcAISettings *aiSettings,
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_80240674_A07574);
|
INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_80240674_A07574);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_80240AB4_A079B4);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240AB4_A079B4)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_80240C64_A07B64);
|
INCLUDE_ASM(s32, "world/area_nok/nok_15/A06F00", func_80240C64_A07B64);
|
||||||
|
|
||||||
@ -139,7 +92,7 @@ ApiStatus N(func_80241DC0_A08CC0)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240AB4_A079B4)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240C64_A07B64)(script, aiSettings, territoryPtr);
|
N(func_80240C64_A07B64)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -36,32 +36,7 @@ ApiStatus N(func_80240000_DAD400)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_802402F4_DAD6F4);
|
INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_802402F4_DAD6F4);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_802403A0_DAD7A0);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_802403A0_DAD7A0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_80240550_DAD950);
|
INCLUDE_ASM(s32, "world/area_omo/omo_04/DAD400", func_80240550_DAD950);
|
||||||
|
|
||||||
@ -126,7 +101,7 @@ ApiStatus N(func_802416AC_DAEAAC)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_802403A0_DAD7A0)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240550_DAD950)(script, aiSettings, territoryPtr);
|
N(func_80240550_DAD950)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -19,32 +19,7 @@ INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_802405BC_DB287C);
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80240780_DB2A40);
|
INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80240780_DB2A40);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80240A54_DB2D14);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240A54_DB2D14)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80240C04_DB2EC4);
|
INCLUDE_ASM(s32, "world/area_omo/omo_05/DB22C0", func_80240C04_DB2EC4);
|
||||||
|
|
||||||
@ -109,7 +84,7 @@ ApiStatus N(func_80241D60_DB4020)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240A54_DB2D14)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240C04_DB2EC4)(script, aiSettings, territoryPtr);
|
N(func_80240C04_DB2EC4)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -13,43 +13,7 @@ INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_802401D8_DBD488);
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80240238_DBD4E8);
|
INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80240238_DBD4E8);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_8024056C_DBD81C);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_8024056C_DBD81C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -57,26 +21,7 @@ ApiStatus N(func_8024056C_DBD81C)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80240BE8_DBDE98);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240BE8_DBDE98)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -142,7 +87,7 @@ ApiStatus N(func_80241100_DBE3B0)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_8024056C_DBD81C)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802406C4_DBD974)(script, npcAISettings, territoryPtr);
|
N(func_802406C4_DBD974)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -152,7 +97,7 @@ ApiStatus N(func_80241100_DBE3B0)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_80240A2C_DBDCDC)(script, npcAISettings, territoryPtr);
|
N(func_80240A2C_DBDCDC)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_80240BE8_DBDE98)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
@ -187,32 +132,7 @@ INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_802415D4_DBE884);
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80241634_DBE8E4);
|
INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80241634_DBE8E4);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80241978_DBEC28);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80241978_DBEC28)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80241B28_DBEDD8);
|
INCLUDE_ASM(s32, "world/area_omo/omo_07/DBD2B0", func_80241B28_DBEDD8);
|
||||||
|
|
||||||
@ -279,7 +199,7 @@ ApiStatus N(func_80242C84_DBFF34)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80241978_DBEC28)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80241B28_DBEDD8)(script, aiSettings, territoryPtr);
|
N(func_80241B28_DBEDD8)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -10,43 +10,7 @@ INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_80240BB8_DCD888);
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_80240C18_DCD8E8);
|
INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_80240C18_DCD8E8);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_80240F4C_DCDC1C);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240F4C_DCDC1C)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -54,26 +18,7 @@ ApiStatus N(func_80240F4C_DCDC1C)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_09/DCD6B0", func_802415C8_DCE298);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_802415C8_DCE298)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -139,7 +84,7 @@ ApiStatus N(func_80241AE0_DCE7B0)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240F4C_DCDC1C)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_802410A4_DCDD74)(script, npcAISettings, territoryPtr);
|
N(func_802410A4_DCDD74)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -149,7 +94,7 @@ ApiStatus N(func_80241AE0_DCE7B0)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_8024140C_DCE0DC)(script, npcAISettings, territoryPtr);
|
N(func_8024140C_DCE0DC)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_802415C8_DCE298)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -16,13 +16,7 @@ ApiStatus N(func_802407CC_DDCFFC)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_8024095C_DDD18C);
|
INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_8024095C_DDD18C);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_11/DDCFC0", func_80240BAC_DDD3DC);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240BAC_DDD3DC)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -16,32 +16,7 @@ INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_80240B1C_DEF9BC);
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_80240CE0_DEFB80);
|
INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_80240CE0_DEFB80);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_80240FB4_DEFE54);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240FB4_DEFE54)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_80241164_DF0004);
|
INCLUDE_ASM(s32, "world/area_omo/omo_17/DEF400", func_80241164_DF0004);
|
||||||
|
|
||||||
@ -106,7 +81,7 @@ ApiStatus N(func_802422C0_DF1160)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240FB4_DEFE54)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80241164_DF0004)(script, aiSettings, territoryPtr);
|
N(func_80241164_DF0004)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -2,43 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/reflection.inc.c"
|
#include "world/common/reflection.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_pra/pra_35/D8D270", func_80240F20_D8E170);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240F20_D8E170)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -46,26 +10,7 @@ ApiStatus N(func_80240F20_D8E170)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_pra/pra_35/D8D270", func_8024159C_D8E7EC);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_8024159C_D8E7EC)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -131,7 +76,7 @@ ApiStatus N(func_80241AB4_D8ED04)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240F20_D8E170)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80241078_D8E2C8)(script, npcAISettings, territoryPtr);
|
N(func_80241078_D8E2C8)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -141,7 +86,7 @@ ApiStatus N(func_80241AB4_D8ED04)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_802413E0_D8E630)(script, npcAISettings, territoryPtr);
|
N(func_802413E0_D8E630)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_8024159C_D8E7EC)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
@ -1,31 +1,6 @@
|
|||||||
#include "sam_06.h"
|
#include "sam_06.h"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80240550_D203E0);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240550_D203E0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80240700_D20590);
|
INCLUDE_ASM(s32, "world/area_sam/sam_06/D203E0", func_80240700_D20590);
|
||||||
|
|
||||||
@ -90,7 +65,7 @@ ApiStatus N(func_8024185C_D216EC)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_80240550_D203E0)(script, aiSettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240700_D20590)(script, aiSettings, territoryPtr);
|
N(func_80240700_D20590)(script, aiSettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
|
@ -19,13 +19,7 @@ ApiStatus N(func_8024003C_D2FCBC)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_802401CC_D2FE4C);
|
INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_802401CC_D2FE4C);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_sam/sam_08/D2FC80", func_8024041C_D3009C);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_8024041C_D3009C)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -27,13 +27,7 @@ ApiStatus N(func_802400BC_95407C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_8024024C_95420C);
|
INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_8024024C_95420C);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_sbk/sbk_56/953FC0", func_8024049C_95445C);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_8024049C_95445C)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -31,13 +31,7 @@ ApiStatus N(func_8024031C_879EFC)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_802404AC_87A08C);
|
INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_802404AC_87A08C);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_07/879BE0", func_802406FC_87A2DC);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_802406FC_87A2DC)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -4,32 +4,7 @@ INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_80241020_87AC00);
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_80241390_87AF70);
|
INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_80241390_87AF70);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_802413F0_87AFD0);
|
#include "world/common/UnkNpcAIFunc23.inc.c"
|
||||||
/*
|
|
||||||
void N(func_802413F0_87AFD0)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
npc->duration = aiSettings->moveTime / 2 + rand_int(aiSettings->moveTime / 2 + 1);
|
|
||||||
if (is_point_within_region(enemy->territory->wander.wanderShape,
|
|
||||||
enemy->territory->wander.point.x, enemy->territory->wander.point.z,
|
|
||||||
npc->pos.x, npc->pos.z,
|
|
||||||
enemy->territory->wander.wanderSizeX, enemy->territory->wander.wanderSizeZ)) {
|
|
||||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, enemy->territory->wander.point.x, enemy->territory->wander.point.z);
|
|
||||||
} else {
|
|
||||||
npc->yaw = clamp_angle((npc->yaw + rand_int(60)) - 30.0f);
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
if (enemy->territory->wander.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->wander.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->pos.y * 100.0;
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_802415A0_87B180);
|
INCLUDE_ASM(s32, "world/area_tik/tik_07/87AC00", func_802415A0_87B180);
|
||||||
|
|
||||||
|
@ -2,29 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_09/882BF0", func_80240AAC_882C6C);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_80240AAC_882C6C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -18,13 +18,7 @@ ApiStatus N(func_802406BC_886A7C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_8024084C_886C0C);
|
INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_8024084C_886C0C);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_10/8866D0", func_80240A9C_886E5C);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240A9C_886E5C)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -45,13 +45,7 @@ ApiStatus N(func_80240C58_889828)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_80240DE8_8899B8);
|
INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_80240DE8_8899B8);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_12/8891C0", func_80241038_889C08);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80241038_889C08)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -2,29 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_12/88A530", func_802419DC_88A5AC);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_802419DC_88A5AC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -16,13 +16,7 @@ ApiStatus N(func_8024006C_892A8C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_802401FC_892C1C);
|
INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_802401FC_892C1C);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_17/892A50", func_8024044C_892E6C);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_8024044C_892E6C)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -16,13 +16,7 @@ ApiStatus N(func_8024062C_897C0C)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_802407BC_897D9C);
|
INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_802407BC_897D9C);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_19/897BD0", func_80240A0C_897FEC);
|
#include "world/common/SwitchToPartner.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240A0C_897FEC)(ScriptInstance* script, s32 isInitialCall) {
|
|
||||||
switch_to_partner(get_variable(script, *script->ptrReadPos));
|
|
||||||
return ApiStatus_DONE2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc19.inc.c"
|
#include "world/common/UnkFunc19.inc.c"
|
||||||
|
|
||||||
|
@ -2,29 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_20/89ACB0", func_802409DC_89AD2C);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_802409DC_89AD2C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -2,29 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_23/8A2D30", func_802409DC_8A2DAC);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_802409DC_8A2DAC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -4,29 +4,7 @@ INCLUDE_ASM(s32, "world/area_tik/tik_24/8A5DE0", func_80240360_8A5DE0);
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_tik/tik_24/8A5DE0", func_8024074C_8A61CC);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_8024074C_8A61CC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -2,29 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_trd/trd_01/99CD80", func_8024046C_99CDFC);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_8024046C_99CDFC)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
|
@ -2,29 +2,7 @@
|
|||||||
|
|
||||||
#include "world/common/set_script_owner_npc_anim.inc.c"
|
#include "world/common/set_script_owner_npc_anim.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_8024015C_9A113C);
|
#include "world/common/UnkDistFunc.inc.c"
|
||||||
/*
|
|
||||||
void N(func_8024015C_9A113C)(ScriptInstance *script, NpcAISettings *aiSettings, EnemyTerritoryThing *territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
if ((npc->duration <= 0) || (--npc->duration <= 0)) {
|
|
||||||
if (npc->turnAroundYawAdjustment == 0) {
|
|
||||||
npc->currentAnim = enemy->animList[9];
|
|
||||||
npc->moveSpeed = aiSettings->chaseSpeed;
|
|
||||||
if ((enemy->varTable[7] == 5) || (enemy->varTable[7] == 0) || (enemy->varTable[7] == 1)) {
|
|
||||||
npc->collisionHeight = enemy->varTable[6] / 2;
|
|
||||||
}
|
|
||||||
npc->duration = (dist2D(npc->pos.x, npc->pos.z, gPlayerStatusPtr->position.x, gPlayerStatusPtr->position.z) / npc->moveSpeed) + 0.8;
|
|
||||||
if (npc->duration < enemy->varTable[3]) {
|
|
||||||
npc->duration = enemy->varTable[3];
|
|
||||||
}
|
|
||||||
enemy->varTable[4] = npc->duration;
|
|
||||||
script->functionTemp[0].s = 14;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkNpcAIFunc12.inc.c"
|
#include "world/common/UnkNpcAIFunc12.inc.c"
|
||||||
|
|
||||||
@ -32,43 +10,7 @@ void N(func_8024015C_9A113C)(ScriptInstance *script, NpcAISettings *aiSettings,
|
|||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_80240474_9A1454);
|
INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_80240474_9A1454);
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_802408B4_9A1894);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_802408B4_9A1894)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc *npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
f32 ret;
|
|
||||||
f32 max;
|
|
||||||
f32 posX;
|
|
||||||
f32 posZ;
|
|
||||||
s32 i;
|
|
||||||
s32 j;
|
|
||||||
|
|
||||||
script->functionTemp[1].s = 0;
|
|
||||||
max = 32767.0f;
|
|
||||||
posX = npc->pos.x;
|
|
||||||
posZ = npc->pos.z;
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
|
|
||||||
for (i = 0, j = 0; i < enemy->territory->patrol.numPoints; i++, j++) {
|
|
||||||
ret = dist2D(posX, posZ, i[enemy->territory->patrol.points].x, i[enemy->territory->patrol.points].z);
|
|
||||||
if (ret < max) {
|
|
||||||
max = ret;
|
|
||||||
script->functionTemp[2].s = j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/UnkFunc13.inc.c"
|
#include "world/common/UnkFunc13.inc.c"
|
||||||
|
|
||||||
@ -76,26 +18,7 @@ ApiStatus N(func_802408B4_9A1894)(ScriptInstance* script, NpcAISettings* aiSetti
|
|||||||
|
|
||||||
#include "world/common/UnkFunc14.inc.c"
|
#include "world/common/UnkFunc14.inc.c"
|
||||||
|
|
||||||
INCLUDE_ASM(s32, "world/area_trd/trd_02/9A10C0", func_80240F30_9A1F10);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
/*
|
|
||||||
ApiStatus N(func_80240F30_9A1F10)(ScriptInstance* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory) {
|
|
||||||
Enemy* enemy = script->owner1.enemy;
|
|
||||||
Npc* npc = get_npc_unsafe(enemy->npcID);
|
|
||||||
|
|
||||||
script->functionTemp[2].s++;
|
|
||||||
if (script->functionTemp[2].s >= enemy->territory->patrol.numPoints) {
|
|
||||||
script->functionTemp[2].s = 0;
|
|
||||||
}
|
|
||||||
npc->currentAnim = enemy->animList[1];
|
|
||||||
if (enemy->territory->patrol.moveSpeedOverride < 0) {
|
|
||||||
npc->moveSpeed = aiSettings->moveSpeed;
|
|
||||||
} else {
|
|
||||||
npc->moveSpeed = enemy->territory->patrol.moveSpeedOverride / 32767.0;
|
|
||||||
}
|
|
||||||
script->functionTemp[0].s = 1;
|
|
||||||
return ApiStatus_DONE1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world/common/NpcJumpFunc2.inc.c"
|
#include "world/common/NpcJumpFunc2.inc.c"
|
||||||
|
|
||||||
@ -161,7 +84,7 @@ ApiStatus N(func_80241448_9A2428)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
|
|
||||||
switch (script->functionTemp[0].s) {
|
switch (script->functionTemp[0].s) {
|
||||||
case 0:
|
case 0:
|
||||||
N(func_802408B4_9A1894)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc24.inc.c"
|
||||||
case 1:
|
case 1:
|
||||||
N(func_80240A0C_9A19EC)(script, npcAISettings, territoryPtr);
|
N(func_80240A0C_9A19EC)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
@ -171,7 +94,7 @@ ApiStatus N(func_80241448_9A2428)(ScriptInstance* script, s32 isInitialCall) {
|
|||||||
N(func_80240D74_9A1D54)(script, npcAISettings, territoryPtr);
|
N(func_80240D74_9A1D54)(script, npcAISettings, territoryPtr);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
N(func_80240F30_9A1F10)(script, npcAISettings, territoryPtr);
|
#include "world/common/UnkNpcAIFunc25.inc.c"
|
||||||
break;
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
N(NpcJumpFunc2)(script, npcAISettings, territoryPtr);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user