From b33320c1d600fa101cf88ac246b32a089bde7954 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sat, 15 Feb 2020 10:14:12 +1000 Subject: [PATCH] Attempt to decompile aiSayQuip --- src/game/chr/chraicommands.c | 291 +++++++++++++++- src/game/data/data_0083d0.c | 499 +++++++++++++-------------- src/game/game_02cde0.c | 4 +- src/include/commands.h | 74 +++- src/include/constants.h | 57 +-- src/include/game/chr/chraicommands.h | 2 +- src/include/game/data/data_0083d0.h | 9 +- src/include/game/game_02cde0.h | 4 +- src/include/game/game_066310.h | 2 +- src/include/library/library_0e9d0.h | 2 +- 10 files changed, 620 insertions(+), 324 deletions(-) diff --git a/src/game/chr/chraicommands.c b/src/game/chr/chraicommands.c index 6b5efd7cf..8638c6290 100644 --- a/src/game/chr/chraicommands.c +++ b/src/game/chr/chraicommands.c @@ -8694,7 +8694,7 @@ bool ai012f(void) * @cmd 0130 */ GLOBAL_ASM( -glabel ai0130 +glabel aiSayQuip /* f05a258: 27bdff58 */ addiu $sp,$sp,-168 /* f05a25c: afb00048 */ sw $s0,0x48($sp) /* f05a260: 3c10800a */ lui $s0,%hi(g_Vars) @@ -8724,8 +8724,8 @@ glabel ai0130 .L0f05a2bc: /* f05a2bc: 24010001 */ addiu $at,$zero,0x1 /* f05a2c0: 14610007 */ bne $v1,$at,.L0f05a2e0 -/* f05a2c4: 3c0a8007 */ lui $t2,%hi(quiptable_skedar) -/* f05a2c8: 254a96d8 */ addiu $t2,$t2,%lo(quiptable_skedar) +/* f05a2c4: 3c0a8007 */ lui $t2,%hi(g_SkedarQuipBank) +/* f05a2c8: 254a96d8 */ addiu $t2,$t2,%lo(g_SkedarQuipBank) /* f05a2cc: 28c10006 */ slti $at,$a2,0x6 /* f05a2d0: 1420002a */ bnez $at,.L0f05a37c /* f05a2d4: afaa0084 */ sw $t2,0x84($sp) @@ -8734,9 +8734,9 @@ glabel ai0130 .L0f05a2e0: /* f05a2e0: 80eb0006 */ lb $t3,0x6($a3) /* f05a2e4: 24030029 */ addiu $v1,$zero,0x29 -/* f05a2e8: 3c0c8007 */ lui $t4,%hi(quiptable_maian) +/* f05a2e8: 3c0c8007 */ lui $t4,%hi(g_MaianQuipBank) /* f05a2ec: 146b000d */ bne $v1,$t3,.L0f05a324 -/* f05a2f0: 258c9710 */ addiu $t4,$t4,%lo(quiptable_maian) +/* f05a2f0: 258c9710 */ addiu $t4,$t4,%lo(g_MaianQuipBank) /* f05a2f4: 28c10003 */ slti $at,$a2,0x3 /* f05a2f8: 14200020 */ bnez $at,.L0f05a37c /* f05a2fc: afac0084 */ sw $t4,0x84($sp) @@ -8751,8 +8751,8 @@ glabel ai0130 /* f05a320: 8fa8009c */ lw $t0,0x9c($sp) .L0f05a324: /* f05a324: 910e0007 */ lbu $t6,0x7($t0) -/* f05a328: 3c0b8007 */ lui $t3,%hi(quiptable_human_bank1) -/* f05a32c: 256b9518 */ addiu $t3,$t3,%lo(quiptable_human_bank1) +/* f05a328: 3c0b8007 */ lui $t3,%hi(g_SpecialQuipBank) +/* f05a32c: 256b9518 */ addiu $t3,$t3,%lo(g_SpecialQuipBank) /* f05a330: 55c00012 */ bnezl $t6,.L0f05a37c /* f05a334: afab0084 */ sw $t3,0x84($sp) /* f05a338: 90e202b1 */ lbu $v0,0x2b1($a3) @@ -8765,8 +8765,8 @@ glabel ai0130 /* f05a354: 90e202b1 */ lbu $v0,0x2b1($a3) .L0f05a358: /* f05a358: 00430019 */ multu $v0,$v1 -/* f05a35c: 3c098007 */ lui $t1,%hi(quiptable_human_bank0) -/* f05a360: 25298ff8 */ addiu $t1,$t1,%lo(quiptable_human_bank0) +/* f05a35c: 3c098007 */ lui $t1,%hi(g_GuardQuipBank) +/* f05a360: 25298ff8 */ addiu $t1,$t1,%lo(g_GuardQuipBank) /* f05a364: 0000c012 */ mflo $t8 /* f05a368: 0018c8c0 */ sll $t9,$t8,0x3 /* f05a36c: 03295021 */ addu $t2,$t9,$t1 @@ -8805,7 +8805,7 @@ glabel ai0130 /* f05a3e8: 8fa5007c */ lw $a1,0x7c($sp) /* f05a3ec: 8fa90084 */ lw $t1,0x84($sp) /* f05a3f0: 10610007 */ beq $v1,$at,.L0f05a410 -/* f05a3f4: 3c0a8007 */ lui $t2,%hi(quiptable_human_bank1) +/* f05a3f4: 3c0a8007 */ lui $t2,%hi(g_SpecialQuipBank) /* f05a3f8: 2401000f */ addiu $at,$zero,0xf /* f05a3fc: 10610004 */ beq $v1,$at,.L0f05a410 /* f05a400: 2401003a */ addiu $at,$zero,0x3a @@ -8813,7 +8813,7 @@ glabel ai0130 /* f05a408: 24010028 */ addiu $at,$zero,0x28 /* f05a40c: 14610004 */ bne $v1,$at,.L0f05a420 .L0f05a410: -/* f05a410: 254a9518 */ addiu $t2,$t2,%lo(quiptable_human_bank1) +/* f05a410: 254a9518 */ addiu $t2,$t2,%lo(g_SpecialQuipBank) /* f05a414: 112a0002 */ beq $t1,$t2,.L0f05a420 /* f05a418: 00000000 */ sll $zero,$zero,0x0 /* f05a41c: afa00090 */ sw $zero,0x90($sp) @@ -8989,7 +8989,7 @@ glabel ai0130 /* f05a698: afa20058 */ sw $v0,0x58($sp) /* f05a69c: a7ad00a4 */ sh $t5,0xa4($sp) .L0f05a6a0: -/* f05a6a0: 0fc133cd */ jal func0f04cf34 +/* f05a6a0: 0fc133cd */ jal audioWasNotPlayedRecently /* f05a6a4: 87a400a4 */ lh $a0,0xa4($sp) /* f05a6a8: 1440000a */ bnez $v0,.L0f05a6d4 /* f05a6ac: 24010001 */ addiu $at,$zero,0x1 @@ -8997,14 +8997,14 @@ glabel ai0130 /* f05a6b4: 00001825 */ or $v1,$zero,$zero /* f05a6b8: 24080001 */ addiu $t0,$zero,0x1 /* f05a6bc: 10e00003 */ beqz $a3,.L0f05a6cc -/* f05a6c0: 3c0e8007 */ lui $t6,%hi(quiptable_human_bank0) +/* f05a6c0: 3c0e8007 */ lui $t6,%hi(g_GuardQuipBank) /* f05a6c4: 10000001 */ beqz $zero,.L0f05a6cc /* f05a6c8: 90e302fe */ lbu $v1,0x2fe($a3) .L0f05a6cc: /* f05a6cc: 54610092 */ bnel $v1,$at,.L0f05a918 /* f05a6d0: 8fad0070 */ lw $t5,0x70($sp) .L0f05a6d4: -/* f05a6d4: 0fc133bb */ jal func0f04ceec +/* f05a6d4: 0fc133bb */ jal audioMarkAsRecentlyPlayed /* f05a6d8: 87a400a4 */ lh $a0,0xa4($sp) /* f05a6dc: 87b800a4 */ lh $t8,0xa4($sp) /* f05a6e0: 2401034e */ addiu $at,$zero,0x34e @@ -9158,7 +9158,7 @@ glabel ai0130 /* f05a910: 00000000 */ sll $zero,$zero,0x0 /* f05a914: 8fad0070 */ lw $t5,0x70($sp) .L0f05a918: -/* f05a918: 25ce8ff8 */ addiu $t6,$t6,%lo(quiptable_human_bank0) +/* f05a918: 25ce8ff8 */ addiu $t6,$t6,%lo(g_GuardQuipBank) /* f05a91c: a7a000a4 */ sh $zero,0xa4($sp) /* f05a920: 000dc0c0 */ sll $t8,$t5,0x3 /* f05a924: 030e1021 */ addu $v0,$t8,$t6 @@ -9169,7 +9169,7 @@ glabel ai0130 /* f05a934: 0043c821 */ addu $t9,$v0,$v1 /* f05a938: 87240000 */ lh $a0,0x0($t9) /* f05a93c: a3a800a3 */ sb $t0,0xa3($sp) -/* f05a940: 0fc133cd */ jal func0f04cf34 +/* f05a940: 0fc133cd */ jal audioWasNotPlayedRecently /* f05a944: afa30054 */ sw $v1,0x54($sp) /* f05a948: 8fa30054 */ lw $v1,0x54($sp) /* f05a94c: 1040000d */ beqz $v0,.L0f05a984 @@ -9178,7 +9178,7 @@ glabel ai0130 /* f05a958: 01432821 */ addu $a1,$t2,$v1 /* f05a95c: 84a40000 */ lh $a0,0x0($a1) /* f05a960: a3a800a3 */ sb $t0,0xa3($sp) -/* f05a964: 0fc133cd */ jal func0f04cf34 +/* f05a964: 0fc133cd */ jal audioWasNotPlayedRecently /* f05a968: afa50050 */ sw $a1,0x50($sp) /* f05a96c: 8fa50050 */ lw $a1,0x50($sp) /* f05a970: 10400004 */ beqz $v0,.L0f05a984 @@ -9196,7 +9196,7 @@ glabel ai0130 /* f05a998: 87ab00a4 */ lh $t3,0xa4($sp) /* f05a99c: 1160007a */ beqz $t3,.L0f05ab88 /* f05a9a0: 01602025 */ or $a0,$t3,$zero -/* f05a9a4: 0fc133bb */ jal func0f04ceec +/* f05a9a4: 0fc133bb */ jal audioMarkAsRecentlyPlayed /* f05a9a8: a3a800a3 */ sb $t0,0xa3($sp) /* f05a9ac: 87ac00a4 */ lh $t4,0xa4($sp) /* f05a9b0: 2401034e */ addiu $at,$zero,0x34e @@ -9350,6 +9350,261 @@ glabel ai0130 /* f05abd8: 00000000 */ sll $zero,$zero,0x0 ); +// regalloc difference near 64c +//bool aiSayQuip(void) +//{ +// u8 column; // 167 +// s16 audioid; // 164 +// u8 i; // 163 +// u8 *cmd = g_Vars.ailist + g_Vars.aioffset; // 156 +// s32 numnearbychrs; // 152 +// bool issomeonetalking; // 148 +// s32 probability; // 144 +// u32 stack; // 140 - not referenced +// s16 *chrnums; // 136 +// s16 (*bank)[4]; // 132 +// char *text; // 128 +// struct chrdata *chr = chrFindById(g_Vars.chrdata, cmd[2]); // 124 +// u32 prevplayernum = g_Vars.currentplayernum; // 120 +// s32 distance; // 116 - not referenced +// s32 row = cmd[3]; // 112 +// u32 playernum; // 108 - not referenced +// u8 flag = g_Vars.chrdata->hidden2 & CHRH2FLAG_1000; // 107 +// struct chrdata *loopchr; // 100 +// +// // Choose bank +// // 2c0 +// if ((g_Vars.chrdata ? g_Vars.chrdata->race : RACE_HUMAN) == RACE_SKEDAR) { +// bank = g_SkedarQuipBank; +// +// if (row > 5) { +// row = 0; +// } +// // 2e0 +// } else if (g_Vars.chrdata->headnum == HEAD_MAIAN_S) { +// bank = g_MaianQuipBank; +// +// if (row > 2) { +// row = random() & 1; +// } +// // 324 +// } else if (cmd[7] == 0) { +// if (g_Vars.chrdata->voicebox > 3) { +// g_Vars.chrdata->voicebox = 3; +// } +// +// bank = &g_GuardQuipBank[g_Vars.chrdata->voicebox * 41]; +// } else { +// // 37c +// bank = g_SpecialQuipBank; +// } +// +// // 37c +// if (!row && !cmd[4] && !cmd[6]) { +// g_Vars.chrdata->soundtimer = 0; +// g_Vars.aioffset += 10; +// return false; +// } +// +// // 3bc +// chrnums = teamGetChrIds(g_Vars.chrdata->team); +// numnearbychrs = 0; +// issomeonetalking = false; +// probability = cmd[4]; +// +// // Make it impossible for Elvis and Jon to use anything but special phrases +// // 3f0 +// if ((g_Vars.chrdata->headnum == HEAD_ELVIS +// || g_Vars.chrdata->headnum == HEAD_THEKING +// || g_Vars.chrdata->headnum == HEAD_ELVIS_GOGS +// || g_Vars.chrdata->headnum == HEAD_JONATHAN) && +// bank != g_SpecialQuipBank) { +// probability = 0; +// } +// +// // If the person talking is a player, and they've just died, +// // try using the other coop player. +// // 420 +// if (chr && chr->prop && chr->prop->type == PROPTYPE_PLAYER) { +// // 444 +// playernum = propGetPlayerNum(chr->prop); +// +// if (g_Vars.coopplayernum >= 0 && g_Vars.players[playernum]->isdead) { +// // 470 +// if (playernum == g_Vars.bondplayernum) { +// playernum = g_Vars.coopplayernum; +// } else { +// playernum = g_Vars.bondplayernum; +// } +// } +// +// setCurrentPlayerNum(playernum); +// } +// +// // If soundgap permits talking at this time and probability passes +// // 494 +// if ((g_Vars.chrdata->soundgap == 0 || g_Vars.chrdata->soundgap * 60 < g_Vars.chrdata->soundtimer) +// && probability > (u8)random()) { +// // Try and find a chr in the same squadron who is currently talking +// // 4dc +// while (*chrnums != -2) { +// loopchr = chrFindByLiteralId(*chrnums); +// +// if (loopchr && loopchr->unk020 +// && !chrIsDead(loopchr) +// && loopchr->actiontype != ACT_DEAD +// && g_Vars.chrdata->squadron == loopchr->squadron +// && loopchr->alertness >= 100 +// && g_Vars.chrdata->chrnum != loopchr->chrnum +// && chrGetDistanceToChr(g_Vars.chrdata, loopchr->chrnum) < 7000) { +// // 584 +// numnearbychrs++; +// +// // 594 +// if (loopchr->soundtimer < 60 && cmd[6] != 0 && cmd[6] != 255) { +// issomeonetalking = true; +// } +// } +// +// chrnums++; +// } +// +// // 5dc +// if (!issomeonetalking && +// ((numnearbychrs == 0 && (cmd[6] == 0 || cmd[6] == 255)) || +// (numnearbychrs > 0 && cmd[6] > 0))) { +// column = random() % 3; +// +// // 64c +// if ((cmd[7] & 0x80) == 0) { +// audioid = bank[row][1 + column]; +// } else { +// audioid = bank[row][1 + g_Vars.chrdata->tude]; +// } +// +// // 6a0 +// if (audioWasNotPlayedRecently(audioid) || (g_Vars.chrdata ? g_Vars.chrdata->race : RACE_HUMAN) == RACE_SKEDAR) { +// // 6d4 +// audioMarkAsRecentlyPlayed(audioid); +// +// // 6e8 +// if (audioid == 0x34e && flag == 0) { +// audioid = 0x34d; +// } +// +// // 700 +// g_Vars.chrdata->soundtimer = 0; +// g_Vars.chrdata->soundgap = cmd[5]; +// g_Vars.chrdata->propsoundcount++; +// +// // 72c +// if (audioid != 0x3f7 && audioid != 0x331 && audioid != 0x3a1) { +// func0f0926bc(g_Vars.chrdata->prop, 9, -1); +// // 7a8 +// func0f0939f8(0, g_Vars.chrdata->prop, audioid, -1, +// -1, 8, 0, 9, 0, -1, 0, -1, -1, -1, -1); +// } else { +// distance = chrGetDistanceLostToTargetInLastSecond(g_Vars.chrdata); +// +// if (ABS(distance) > 50) { +// func0f0926bc(g_Vars.chrdata->prop, 9, -1); +// // 840 +// func0f0939f8(0, g_Vars.chrdata->prop, audioid, -1, +// -1, 8, 0, 9, 0, -1, 0, -1, -1, -1, -1); +// } +// } +// +// // Consider putting text on screen +// // Note: if cmd[8] is 0 then it means no text, so the value +// // needs to be be decremented by one so it's 0-indexed. +// // 850 +// if (cmd[8] && (cmd[7] & 0x80) == 0) { +// if (column > 2) { +// column = 2; +// } +// +// text = langGet(g_QuipTexts[cmd[8] - 1][1 + column]); +// +// if (!audioIsFiltered(audioid)) { +// // 8ac +// func0f0de034(text, 6, cmd[9]); +// } +// } else if (cmd[8]) { +// text = langGet(g_QuipTexts[cmd[8] - 1][1 + g_Vars.chrdata->tude]); +// +// if (!audioIsFiltered(audioid)) { +// // 904 +// func0f0de034(text, 6, cmd[9]); +// } +// } +// } else { +// // Audio was played recently - try and find a different one +// audioid = 0; +// +// // 92c +// for (i = 1; i < 4; i++) { +// if (audioWasNotPlayedRecently(g_GuardQuipBank[row][i]) +// && audioWasNotPlayedRecently(bank[row][i])) { +// audioid = bank[row][i]; +// break; +// } +// } +// +// // 99c +// if (audioid) { +// audioMarkAsRecentlyPlayed(audioid); +// +// if (audioid == 0x34e && flag == 0) { +// audioid = 0x34d; +// } +// +// g_Vars.chrdata->soundtimer = 0; +// g_Vars.chrdata->soundgap = cmd[5]; +// g_Vars.chrdata->propsoundcount++; +// +// // 9fc +// if (audioid != 0x3f7 && audioid != 0x331 && audioid != 0x3a1) { +// func0f0926bc(g_Vars.chrdata->prop, 9, -1); +// // a80 +// func0f0939f8(0, g_Vars.chrdata->prop, audioid, -1, +// -1, 8, 0, 9, 0, -1, 0, -1, -1, -1, -1); +// } else { +// // a90 +// distance = chrGetDistanceLostToTargetInLastSecond(g_Vars.chrdata); +// +// if (ABS(distance) > 50) { +// func0f0926bc(g_Vars.chrdata->prop, 9, -1); +// // b28 +// func0f0939f8(0, g_Vars.chrdata->prop, audioid, -1, +// -1, 8, 0, 9, 0, -1, 0, -1, -1, -1, -1); +// } +// } +// +// // b44 +// if (cmd[8]) { +// text = langGet(g_QuipTexts[cmd[8] - 1][i]); +// +// if (!audioIsFiltered(audioid)) { +// // b78 +// func0f0de034(text, 6, cmd[9]); +// } +// } +// } else { +// g_Vars.chrdata->soundtimer = 0; +// g_Vars.chrdata->soundgap = cmd[5]; +// chrUnsetFlags(g_Vars.chrdata, CHRFLAG1_DISSPEE, BANK_1); +// } +// } +// } +// } +// +// setCurrentPlayerNum(prevplayernum); +// +// g_Vars.aioffset += 10; +// +// return false; +//} + void func0f05abdc(struct prop *prop) { if (prop && prop->chr && prop->chr->unk020 && prop->chr->propsoundcount > 0) { diff --git a/src/game/data/data_0083d0.c b/src/game/data/data_0083d0.c index 9f5f088da..5089c4f8c 100644 --- a/src/game/data/data_0083d0.c +++ b/src/game/data/data_0083d0.c @@ -6523,7 +6523,7 @@ bool (*g_CommandPointers[])(void) = { /*0x012d*/ NULL, /*0x012e*/ NULL, /*0x012f*/ ai012f, - /*0x0130*/ ai0130, + /*0x0130*/ aiSayQuip, /*0x0131*/ aiIncreaseSquadronAlertness, /*0x0132*/ aiSetAction, /*0x0133*/ aiSetTeamOrders, @@ -6832,271 +6832,254 @@ u32 var80068fdc = 0x00000000; struct coord var80068fe0 = {0, 0, 0}; struct coord var80068fec = {0, 0, 0}; -// f018 -u16 quiptable_human_bank0[] = { - 0x0000, 0x027b, 0x027b, 0x027c, - 0x0001, 0x027d, 0x027e, 0x027f, - 0x0002, 0x028a, 0x028b, 0x028c, - 0x0003, 0x035b, 0x035c, 0x035d, - 0x0004, 0x0290, 0x80fb, 0x0292, - 0x0005, 0x0293, 0x0294, 0x029d, - 0x0006, 0x0297, 0x0298, 0x0299, - 0x0007, 0x029a, 0x029b, 0x029c, - 0x0008, 0x02a7, 0x02a8, 0x02a9, - 0x0009, 0x026b, 0x026c, 0x026d, - 0x000a, 0x0037, 0x0037, 0x0037, - 0x000b, 0x0264, 0x0265, 0x0266, - 0x000c, 0x80f7, 0x80f7, 0x80f8, - 0x000d, 0x025e, 0x025f, 0x0260, - 0x000e, 0x0261, 0x0262, 0x0263, - 0x000f, 0x02a3, 0x02a4, 0x02a5, - 0x0010, 0x0272, 0x0273, 0x0274, - 0x0022, 0x0037, 0x0037, 0x0037, - 0x0012, 0x025b, 0x025c, 0x025c, - 0x0013, 0x026e, 0x026f, 0x0270, - 0x0014, 0x0037, 0x0037, 0x0037, - 0x0015, 0x0280, 0x0281, 0x0282, - 0x0016, 0x80f9, 0x80f9, 0x0287, - 0x0017, 0x80fa, 0x80fa, 0x0289, - 0x0018, 0x028d, 0x028e, 0x028f, - 0x0019, 0x80fc, 0x80fd, 0x02a2, - 0x001a, 0x0037, 0x0037, 0x0037, - 0x001b, 0x0275, 0x0277, 0x0278, - 0x001c, 0x8167, 0x04c9, 0x04ca, - 0x001d, 0x815d, 0x815e, 0x815f, - 0x001e, 0x1aa0, 0x1aa1, 0x1aa2, - 0x001f, 0x0037, 0x1aa3, 0x1aa4, - 0x0020, 0x1aa5, 0x1aa5, 0x1aa6, - 0x0021, 0x04c6, 0x04c6, 0x04c6, - 0x0022, 0x04c7, 0x04c7, 0x04c7, - 0x0023, 0x04cb, 0x04cb, 0x04cc, - 0x0024, 0x027b, 0x027b, 0x027d, - 0x0025, 0x027b, 0x027d, 0x027d, - 0x0026, 0x02a3, 0x02a4, 0x02a5, - 0x0027, 0x04c6, 0x04c6, 0x04c6, - 0x0028, 0x1aa6, 0x1aa6, 0x1aa6, +s16 g_GuardQuipBank[][4] = { + // Voicebox 0 + { 0, 0x027b, 0x027b, 0x027c }, + { 1, 0x027d, 0x027e, 0x027f }, + { 2, 0x028a, 0x028b, 0x028c }, + { 3, 0x035b, 0x035c, 0x035d }, + { 4, 0x0290, 0x80fb, 0x0292 }, + { 5, 0x0293, 0x0294, 0x029d }, + { 6, 0x0297, 0x0298, 0x0299 }, + { 7, 0x029a, 0x029b, 0x029c }, + { 8, 0x02a7, 0x02a8, 0x02a9 }, + { 9, 0x026b, 0x026c, 0x026d }, + { 10, 0x0037, 0x0037, 0x0037 }, + { 11, 0x0264, 0x0265, 0x0266 }, + { 12, 0x80f7, 0x80f7, 0x80f8 }, + { 13, 0x025e, 0x025f, 0x0260 }, + { 14, 0x0261, 0x0262, 0x0263 }, + { 15, 0x02a3, 0x02a4, 0x02a5 }, + { 16, 0x0272, 0x0273, 0x0274 }, + { 34, 0x0037, 0x0037, 0x0037 }, + { 18, 0x025b, 0x025c, 0x025c }, + { 19, 0x026e, 0x026f, 0x0270 }, + { 20, 0x0037, 0x0037, 0x0037 }, + { 21, 0x0280, 0x0281, 0x0282 }, + { 22, 0x80f9, 0x80f9, 0x0287 }, + { 23, 0x80fa, 0x80fa, 0x0289 }, + { 24, 0x028d, 0x028e, 0x028f }, + { 25, 0x80fc, 0x80fd, 0x02a2 }, + { 26, 0x0037, 0x0037, 0x0037 }, + { 27, 0x0275, 0x0277, 0x0278 }, + { 28, 0x8167, 0x04c9, 0x04ca }, + { 29, 0x815d, 0x815e, 0x815f }, + { 30, 0x1aa0, 0x1aa1, 0x1aa2 }, + { 31, 0x0037, 0x1aa3, 0x1aa4 }, + { 32, 0x1aa5, 0x1aa5, 0x1aa6 }, + { 33, 0x04c6, 0x04c6, 0x04c6 }, + { 34, 0x04c7, 0x04c7, 0x04c7 }, + { 35, 0x04cb, 0x04cb, 0x04cc }, + { 36, 0x027b, 0x027b, 0x027d }, + { 37, 0x027b, 0x027d, 0x027d }, + { 38, 0x02a3, 0x02a4, 0x02a5 }, + { 39, 0x04c6, 0x04c6, 0x04c6 }, + { 40, 0x1aa6, 0x1aa6, 0x1aa6 }, + // Voicebox 1 + { 0, 0x0322, 0x0323, 0x0324 }, + { 1, 0x0325, 0x0326, 0x0327 }, + { 2, 0x812e, 0x0335, 0x0336 }, + { 3, 0x035b, 0x035c, 0x035d }, + { 4, 0x033a, 0x033b, 0x033c }, + { 5, 0x033d, 0x033f, 0x0342 }, + { 6, 0x0343, 0x0344, 0x0345 }, + { 7, 0x0346, 0x0347, 0x0348 }, + { 8, 0x0349, 0x034a, 0x034b }, + { 9, 0x030e, 0x030f, 0x0310 }, + { 10, 0x0037, 0x0037, 0x0037 }, + { 11, 0x0306, 0x0307, 0x0308 }, + { 12, 0x0309, 0x8128, 0x030b }, + { 13, 0x8126, 0x0301, 0x0302 }, + { 14, 0x8127, 0x0304, 0x0305 }, + { 15, 0x0037, 0x0037, 0x0037 }, + { 16, 0x031c, 0x031d, 0x031e }, + { 34, 0x0037, 0x0037, 0x0037 }, + { 18, 0x8124, 0x8125, 0x02ff }, + { 19, 0x8129, 0x812a, 0x0316 }, + { 20, 0x031c, 0x031d, 0x031e }, + { 21, 0x0356, 0x0329, 0x0329 }, + { 22, 0x812b, 0x032f, 0x812c }, + { 23, 0x0331, 0x0332, 0x812d }, + { 24, 0x0337, 0x0338, 0x0339 }, + { 25, 0x812f, 0x034d, 0x034e }, + { 26, 0x0355, 0x0356, 0x0357 }, + { 27, 0x031f, 0x0320, 0x0321 }, + { 28, 0x04cf, 0x04d0, 0x04d1 }, + { 29, 0x8163, 0x8163, 0x8164 }, + { 30, 0x1ace, 0x1ace, 0x1acf }, + { 31, 0x1ad0, 0x1ad0, 0x1ad1 }, + { 32, 0x1ad2, 0x1ad2, 0x1ad3 }, + { 33, 0x8168, 0x8168, 0x8168 }, + { 34, 0x04ce, 0x04ce, 0x04ce }, + { 35, 0x04d2, 0x04d3, 0x04d3 }, + { 36, 0x0322, 0x0323, 0x0324 }, + { 37, 0x0324, 0x0327, 0x0327 }, + { 38, 0x0356, 0x0357, 0x035a }, + { 39, 0x812b, 0x032f, 0x812c }, + { 40, 0x1ad2, 0x1ad2, 0x1ad2 }, + // Voicebox 2 + { 0, 0x03e7, 0x03e8, 0x03e9 }, + { 1, 0x03ea, 0x03eb, 0x03ec }, + { 2, 0x03f9, 0x03fa, 0x03fb }, + { 3, 0x0420, 0x0421, 0x813d }, + { 4, 0x03ff, 0x8139, 0x0401 }, + { 5, 0x0403, 0x0405, 0x0407 }, + { 6, 0x0408, 0x0409, 0x040a }, + { 7, 0x040b, 0x040c, 0x040d }, + { 8, 0x040e, 0x040f, 0x0410 }, + { 9, 0x03d6, 0x03d6, 0x03d7 }, + { 10, 0x0037, 0x0037, 0x0037 }, + { 11, 0x03d0, 0x03d1, 0x8134 }, + { 12, 0x03d3, 0x8135, 0x03d5 }, + { 13, 0x8132, 0x03c8, 0x03c8 }, + { 14, 0x03cd, 0x03ce, 0x8133 }, + { 15, 0x0037, 0x0037, 0x0037 }, + { 16, 0x03e1, 0x03e2, 0x03e3 }, + { 34, 0x0037, 0x0037, 0x0037 }, + { 18, 0x03c4, 0x03c5, 0x03c6 }, + { 19, 0x03d9, 0x03da, 0x03db }, + { 20, 0x031c, 0x031d, 0x031e }, + { 21, 0x03ed, 0x03ee, 0x03ef }, + { 22, 0x8136, 0x03f4, 0x8137 }, + { 23, 0x8138, 0x03f7, 0x03f8 }, + { 24, 0x03fc, 0x03fd, 0x03fe }, + { 25, 0x813a, 0x813c, 0x0415 }, + { 26, 0x041b, 0x041c, 0x041d }, + { 27, 0x03e4, 0x03e5, 0x03e6 }, + { 28, 0x04d5, 0x04d6, 0x04d7 }, + { 29, 0x8165, 0x8165, 0x8166 }, + { 30, 0x1ad6, 0x1ad6, 0x1ad7 }, + { 31, 0x1ad8, 0x1ad8, 0x1ad9 }, + { 32, 0x1ada, 0x1ada, 0x1adb }, + { 33, 0x8168, 0x8168, 0x8168 }, + { 34, 0x04d4, 0x04d4, 0x04d4 }, + { 35, 0x04d8, 0x04d8, 0x04d9 }, + { 36, 0x03e7, 0x03e8, 0x03e9 }, + { 37, 0x03e8, 0x03eb, 0x03eb }, + { 38, 0x041b, 0x0417, 0x041d }, + { 39, 0x8134, 0x03f4, 0x8134 }, + { 40, 0x1adb, 0x1adb, 0x1adb }, + // Voicebox 3 + { 0, 0x0396, 0x0396, 0x0396 }, + { 1, 0x0037, 0x0398, 0x0399 }, + { 2, 0x03a4, 0x0037, 0x03a6 }, + { 3, 0x03c1, 0x03c2, 0x03c2 }, + { 4, 0x03aa, 0x03ab, 0x03ac }, + { 5, 0x03ad, 0x03ae, 0x0037 }, + { 6, 0x03b0, 0x03b0, 0x03b1 }, + { 7, 0x0037, 0x03b3, 0x03b4 }, + { 8, 0x03b5, 0x03b5, 0x03b6 }, + { 9, 0x0037, 0x0389, 0x038a }, + { 10, 0x0000, 0x0000, 0x0000 }, + { 11, 0x0381, 0x0382, 0x0037 }, + { 12, 0x0385, 0x0037, 0x0387 }, + { 13, 0x0037, 0x037e, 0x037f }, + { 14, 0x037e, 0x037f, 0x0380 }, + { 15, 0x0000, 0x0000, 0x0000 }, + { 16, 0x0384, 0x0385, 0x0037 }, + { 34, 0x03aa, 0x03ab, 0x03ac }, + { 18, 0x0037, 0x037b, 0x037c }, + { 19, 0x038d, 0x038d, 0x038d }, + { 20, 0x0384, 0x0385, 0x0387 }, + { 21, 0x039a, 0x039b, 0x0037 }, + { 22, 0x039f, 0x0037, 0x03a1 }, + { 23, 0x03a1, 0x03a2, 0x8130 }, + { 24, 0x03a7, 0x0037, 0x03a9 }, + { 25, 0x03b7, 0x03b8, 0x8131 }, + { 26, 0x03be, 0x0037, 0x03c0 }, + { 27, 0x0381, 0x0382, 0x0037 }, + { 28, 0x0000, 0x0000, 0x0000 }, + { 29, 0x0037, 0x0396, 0x0037 }, + { 30, 0x0037, 0x0396, 0x0037 }, + { 31, 0x0037, 0x0396, 0x0037 }, + { 32, 0x0037, 0x0396, 0x0037 }, + { 33, 0x037b, 0x037c, 0x037b }, + { 34, 0x03aa, 0x03b1, 0x03ab }, + { 35, 0x0000, 0x0000, 0x0000 }, + { 36, 0x0396, 0x0396, 0x0399 }, + { 37, 0x0399, 0x0399, 0x0396 }, + { 38, 0x03bc, 0x03be, 0x03c0 }, + { 39, 0x039f, 0x039f, 0x039f }, + { 40, 0x0000, 0x0000, 0x0000 }, }; -// f160 -u16 quiptable_f160[] = { - 0x0000, 0x0322, 0x0323, 0x0324, - 0x0001, 0x0325, 0x0326, 0x0327, - 0x0002, 0x812e, 0x0335, 0x0336, - 0x0003, 0x035b, 0x035c, 0x035d, - 0x0004, 0x033a, 0x033b, 0x033c, - 0x0005, 0x033d, 0x033f, 0x0342, - 0x0006, 0x0343, 0x0344, 0x0345, - 0x0007, 0x0346, 0x0347, 0x0348, - 0x0008, 0x0349, 0x034a, 0x034b, - 0x0009, 0x030e, 0x030f, 0x0310, - 0x000a, 0x0037, 0x0037, 0x0037, - 0x000b, 0x0306, 0x0307, 0x0308, - 0x000c, 0x0309, 0x8128, 0x030b, - 0x000d, 0x8126, 0x0301, 0x0302, - 0x000e, 0x8127, 0x0304, 0x0305, - 0x000f, 0x0037, 0x0037, 0x0037, - 0x0010, 0x031c, 0x031d, 0x031e, - 0x0022, 0x0037, 0x0037, 0x0037, - 0x0012, 0x8124, 0x8125, 0x02ff, - 0x0013, 0x8129, 0x812a, 0x0316, - 0x0014, 0x031c, 0x031d, 0x031e, - 0x0015, 0x0356, 0x0329, 0x0329, - 0x0016, 0x812b, 0x032f, 0x812c, - 0x0017, 0x0331, 0x0332, 0x812d, - 0x0018, 0x0337, 0x0338, 0x0339, - 0x0019, 0x812f, 0x034d, 0x034e, - 0x001a, 0x0355, 0x0356, 0x0357, - 0x001b, 0x031f, 0x0320, 0x0321, - 0x001c, 0x04cf, 0x04d0, 0x04d1, - 0x001d, 0x8163, 0x8163, 0x8164, - 0x001e, 0x1ace, 0x1ace, 0x1acf, - 0x001f, 0x1ad0, 0x1ad0, 0x1ad1, - 0x0020, 0x1ad2, 0x1ad2, 0x1ad3, - 0x0021, 0x8168, 0x8168, 0x8168, - 0x0022, 0x04ce, 0x04ce, 0x04ce, - 0x0023, 0x04d2, 0x04d3, 0x04d3, - 0x0024, 0x0322, 0x0323, 0x0324, - 0x0025, 0x0324, 0x0327, 0x0327, - 0x0026, 0x0356, 0x0357, 0x035a, - 0x0027, 0x812b, 0x032f, 0x812c, - 0x0028, 0x1ad2, 0x1ad2, 0x1ad2, +s16 g_SpecialQuipBank[][4] = { + { 0, 0x0af2, 0x0af3, 0x0af8 }, + { 1, 0x1aee, 0x1aef, 0x1aee }, + { 2, 0x023d, 0x023e, 0x0247 }, + { 3, 0x0248, 0x0249, 0x024b }, + { 4, 0x0246, 0x023f, 0x0240 }, + { 5, 0x024c, 0x0252, 0x0251 }, + { 6, 0x024f, 0x0258, 0x024d }, + { 7, 0x0243, 0x0244, 0x0245 }, + { 8, 0x1294, 0x1295, 0x1296 }, + { 9, 0x1297, 0x1298, 0x1297 }, + { 10, 0x1290, 0x127e, 0x8103 }, + { 11, 0x7324, 0x7325, 0x7326 }, + { 12, 0x128e, 0x1280, 0x1287 }, + { 13, 0x128d, 0x1283, 0x1286 }, + { 14, 0x1291, 0x1284, 0x128a }, + { 15, 0x1292, 0x1281, 0x1288 }, + { 16, 0x128b, 0x1282, 0x1289 }, + { 17, 0x000d, 0x000d, 0x000d }, + { 18, 0x815d, 0x815e, 0x815f }, + { 19, 0x1aa0, 0x1aa1, 0x1aa2 }, + { 20, 0x0037, 0x1aa3, 0x1aa4 }, + { 21, 0x1aa5, 0x1aa5, 0x1aa6 }, + { 22, 0x0446, 0x0461, 0x0465 }, + { 23, 0x0447, 0x045d, 0x0466 }, + { 24, 0x814a, 0x045e, 0x0463 }, + { 25, 0x0444, 0x045f, 0x0468 }, + { 26, 0x0448, 0x0449, 0x0449 }, + { 27, 0x044b, 0x0459, 0x045a }, + { 28, 0x05be, 0x0515, 0x05bf }, + { 29, 0x044b, 0x0459, 0x045a }, + { 30, 0x044b, 0x0459, 0x045a }, + { 31, 0x1aeb, 0x1aeb, 0x1aeb }, + { 32, 0x1b35, 0x1b36, 0x1b37 }, + { 33, 0x1ac0, 0x1ac1, 0x1ac3 }, + { 34, 0x0446, 0x0461, 0x0000 }, + { 35, 0x0447, 0x045d, 0x0000 }, + { 36, 0x814a, 0x045e, 0x1aee }, + { 37, 0x0444, 0x045f, 0x0000 }, + { 38, 0x051b, 0x051c, 0x051d }, + { 39, 0x051e, 0x051f, 0x0520 }, + { 40, 0x0521, 0x0522, 0x0525 }, + { 41, 0x0523, 0x0523, 0x0524 }, + { 42, 0x1adb, 0x1aa6, 0x1ad2 }, + { 43, 0x0af2, 0x0af8, 0x0af8 }, + { 44, 0x0525, 0x0525, 0x0525 }, + { 45, 0x1aec, 0x1aec, 0x1aec }, }; -// f2a8 -u16 quiptable_f2a8[] = { - 0x0000, 0x03e7, 0x03e8, 0x03e9, - 0x0001, 0x03ea, 0x03eb, 0x03ec, - 0x0002, 0x03f9, 0x03fa, 0x03fb, - 0x0003, 0x0420, 0x0421, 0x813d, - 0x0004, 0x03ff, 0x8139, 0x0401, - 0x0005, 0x0403, 0x0405, 0x0407, - 0x0006, 0x0408, 0x0409, 0x040a, - 0x0007, 0x040b, 0x040c, 0x040d, - 0x0008, 0x040e, 0x040f, 0x0410, - 0x0009, 0x03d6, 0x03d6, 0x03d7, - 0x000a, 0x0037, 0x0037, 0x0037, - 0x000b, 0x03d0, 0x03d1, 0x8134, - 0x000c, 0x03d3, 0x8135, 0x03d5, - 0x000d, 0x8132, 0x03c8, 0x03c8, - 0x000e, 0x03cd, 0x03ce, 0x8133, - 0x000f, 0x0037, 0x0037, 0x0037, - 0x0010, 0x03e1, 0x03e2, 0x03e3, - 0x0022, 0x0037, 0x0037, 0x0037, - 0x0012, 0x03c4, 0x03c5, 0x03c6, - 0x0013, 0x03d9, 0x03da, 0x03db, - 0x0014, 0x031c, 0x031d, 0x031e, - 0x0015, 0x03ed, 0x03ee, 0x03ef, - 0x0016, 0x8136, 0x03f4, 0x8137, - 0x0017, 0x8138, 0x03f7, 0x03f8, - 0x0018, 0x03fc, 0x03fd, 0x03fe, - 0x0019, 0x813a, 0x813c, 0x0415, - 0x001a, 0x041b, 0x041c, 0x041d, - 0x001b, 0x03e4, 0x03e5, 0x03e6, - 0x001c, 0x04d5, 0x04d6, 0x04d7, - 0x001d, 0x8165, 0x8165, 0x8166, - 0x001e, 0x1ad6, 0x1ad6, 0x1ad7, - 0x001f, 0x1ad8, 0x1ad8, 0x1ad9, - 0x0020, 0x1ada, 0x1ada, 0x1adb, - 0x0021, 0x8168, 0x8168, 0x8168, - 0x0022, 0x04d4, 0x04d4, 0x04d4, - 0x0023, 0x04d8, 0x04d8, 0x04d9, - 0x0024, 0x03e7, 0x03e8, 0x03e9, - 0x0025, 0x03e8, 0x03eb, 0x03eb, - 0x0026, 0x041b, 0x0417, 0x041d, - 0x0027, 0x8134, 0x03f4, 0x8134, - 0x0028, 0x1adb, 0x1adb, 0x1adb, +s16 g_QuipTexts[][4] = { + { 1, 0x0253, 0x0254, 0x0255 }, // "How dare you disturb me!", "You will regret this intrusion, girl!", "If I were you, I'd leave...NOW!" + { 2, 0x0256, 0x0257, 0x0256 }, // "Please don't kill me!", "Don't shoot!" + { 3, 0x1e40, 0x1e41, 0x1e42 }, // "What are you doing in my lab?", "I haven't seen you before...", "Who the hell are you?" + { 4, 0x1e43, 0x1e44, 0x1e45 }, // "Shut down the experiment.", "Pull the plug on that, NOW.", "Switch this thing off." + { 5, 0x1e46, 0x1e47, 0x1e48 }, // "I'll shut it down.", "Please don't hurt me.", "Allow me to assist you." + { 6, 0x1e49, 0x1e4a, 0x1e4b }, // "My experiments!", "There the experiment is down.", "Leave this area NOW!" + { 7, 0x1e4c, 0x1e4d, 0x1e4e }, // "Security!", "I'm calling security.", "Accidents will happen." + { 8, 0x1e4f, 0x1e50, 0x1e51 }, // "How did that happen?", "Looks like it's off already.", "Have you been tampering with this?" + { 9, 0x1e52, 0x1e53, 0x1e54 }, // "Someone's broken my equipment.", "What's happened to the terminal?", "You vandal - you've broken it." + { 10, 0x4a0a, 0x4a0c, 0x4a0c }, // "How dare you disturb me!", "If I were you, I'd leave... NOW!" }; -// f3f0 -u16 quiptable_f3f0[] = { - 0x0000, 0x0396, 0x0396, 0x0396, - 0x0001, 0x0037, 0x0398, 0x0399, - 0x0002, 0x03a4, 0x0037, 0x03a6, - 0x0003, 0x03c1, 0x03c2, 0x03c2, - 0x0004, 0x03aa, 0x03ab, 0x03ac, - 0x0005, 0x03ad, 0x03ae, 0x0037, - 0x0006, 0x03b0, 0x03b0, 0x03b1, - 0x0007, 0x0037, 0x03b3, 0x03b4, - 0x0008, 0x03b5, 0x03b5, 0x03b6, - 0x0009, 0x0037, 0x0389, 0x038a, - 0x000a, 0x0000, 0x0000, 0x0000, - 0x000b, 0x0381, 0x0382, 0x0037, - 0x000c, 0x0385, 0x0037, 0x0387, - 0x000d, 0x0037, 0x037e, 0x037f, - 0x000e, 0x037e, 0x037f, 0x0380, - 0x000f, 0x0000, 0x0000, 0x0000, - 0x0010, 0x0384, 0x0385, 0x0037, - 0x0022, 0x03aa, 0x03ab, 0x03ac, - 0x0012, 0x0037, 0x037b, 0x037c, - 0x0013, 0x038d, 0x038d, 0x038d, - 0x0014, 0x0384, 0x0385, 0x0387, - 0x0015, 0x039a, 0x039b, 0x0037, - 0x0016, 0x039f, 0x0037, 0x03a1, - 0x0017, 0x03a1, 0x03a2, 0x8130, - 0x0018, 0x03a7, 0x0037, 0x03a9, - 0x0019, 0x03b7, 0x03b8, 0x8131, - 0x001a, 0x03be, 0x0037, 0x03c0, - 0x001b, 0x0381, 0x0382, 0x0037, - 0x001c, 0x0000, 0x0000, 0x0000, - 0x001d, 0x0037, 0x0396, 0x0037, - 0x001e, 0x0037, 0x0396, 0x0037, - 0x001f, 0x0037, 0x0396, 0x0037, - 0x0020, 0x0037, 0x0396, 0x0037, - 0x0021, 0x037b, 0x037c, 0x037b, - 0x0022, 0x03aa, 0x03b1, 0x03ab, - 0x0023, 0x0000, 0x0000, 0x0000, - 0x0024, 0x0396, 0x0396, 0x0399, - 0x0025, 0x0399, 0x0399, 0x0396, - 0x0026, 0x03bc, 0x03be, 0x03c0, - 0x0027, 0x039f, 0x039f, 0x039f, - 0x0028, 0x0000, 0x0000, 0x0000, +s16 g_SkedarQuipBank[][4] = { + { 1, 0x0529, 0x052a, 0x052b }, + { 2, 0x052d, 0x052e, 0x052f }, + { 3, 0x0530, 0x0530, 0x0531 }, + { 1, 0x0532, 0x0533, 0x0534 }, + { 2, 0x0536, 0x0537, 0x0538 }, + { 3, 0x0539, 0x0539, 0x053a }, + { 0, 0x0000, 0x0000, 0x0000 }, }; -// f538 -u16 quiptable_human_bank1[] = { - 0x0000, 0x0af2, 0x0af3, 0x0af8, - 0x0001, 0x1aee, 0x1aef, 0x1aee, - 0x0002, 0x023d, 0x023e, 0x0247, - 0x0003, 0x0248, 0x0249, 0x024b, - 0x0004, 0x0246, 0x023f, 0x0240, - 0x0005, 0x024c, 0x0252, 0x0251, - 0x0006, 0x024f, 0x0258, 0x024d, - 0x0007, 0x0243, 0x0244, 0x0245, - 0x0008, 0x1294, 0x1295, 0x1296, - 0x0009, 0x1297, 0x1298, 0x1297, - 0x000a, 0x1290, 0x127e, 0x8103, - 0x000b, 0x7324, 0x7325, 0x7326, - 0x000c, 0x128e, 0x1280, 0x1287, - 0x000d, 0x128d, 0x1283, 0x1286, - 0x000e, 0x1291, 0x1284, 0x128a, - 0x000f, 0x1292, 0x1281, 0x1288, - 0x0010, 0x128b, 0x1282, 0x1289, - 0x0011, 0x000d, 0x000d, 0x000d, - 0x0012, 0x815d, 0x815e, 0x815f, - 0x0013, 0x1aa0, 0x1aa1, 0x1aa2, - 0x0014, 0x0037, 0x1aa3, 0x1aa4, - 0x0015, 0x1aa5, 0x1aa5, 0x1aa6, - 0x0016, 0x0446, 0x0461, 0x0465, - 0x0017, 0x0447, 0x045d, 0x0466, - 0x0018, 0x814a, 0x045e, 0x0463, - 0x0019, 0x0444, 0x045f, 0x0468, - 0x001a, 0x0448, 0x0449, 0x0449, - 0x001b, 0x044b, 0x0459, 0x045a, - 0x001c, 0x05be, 0x0515, 0x05bf, - 0x001d, 0x044b, 0x0459, 0x045a, - 0x001e, 0x044b, 0x0459, 0x045a, - 0x001f, 0x1aeb, 0x1aeb, 0x1aeb, - 0x0020, 0x1b35, 0x1b36, 0x1b37, - 0x0021, 0x1ac0, 0x1ac1, 0x1ac3, - 0x0022, 0x0446, 0x0461, 0x0000, - 0x0023, 0x0447, 0x045d, 0x0000, - 0x0024, 0x814a, 0x045e, 0x1aee, - 0x0025, 0x0444, 0x045f, 0x0000, - 0x0026, 0x051b, 0x051c, 0x051d, - 0x0027, 0x051e, 0x051f, 0x0520, - 0x0028, 0x0521, 0x0522, 0x0525, - 0x0029, 0x0523, 0x0523, 0x0524, - 0x002a, 0x1adb, 0x1aa6, 0x1ad2, - 0x002b, 0x0af2, 0x0af8, 0x0af8, - 0x002c, 0x0525, 0x0525, 0x0525, - 0x002d, 0x1aec, 0x1aec, 0x1aec, -}; - -// f6a8 -u16 quiptable_f6a8[] = { - 0x0001, 0x0253, 0x0254, 0x0255, - 0x0002, 0x0256, 0x0257, 0x0256, - 0x0003, 0x1e40, 0x1e41, 0x1e42, - 0x0004, 0x1e43, 0x1e44, 0x1e45, - 0x0005, 0x1e46, 0x1e47, 0x1e48, - 0x0006, 0x1e49, 0x1e4a, 0x1e4b, - 0x0007, 0x1e4c, 0x1e4d, 0x1e4e, - 0x0008, 0x1e4f, 0x1e50, 0x1e51, - 0x0009, 0x1e52, 0x1e53, 0x1e54, - 0x000a, 0x4a0a, 0x4a0c, 0x4a0c, -}; - -// f6f8 -u16 quiptable_skedar[] = { - 0x0001, 0x0529, 0x052a, 0x052b, - 0x0002, 0x052d, 0x052e, 0x052f, - 0x0003, 0x0530, 0x0530, 0x0531, -}; - -// f710 -u16 quiptable_f710[] = { - 0x0001, 0x0532, 0x0533, 0x0534, - 0x0002, 0x0536, 0x0537, 0x0538, - 0x0003, 0x0539, 0x0539, 0x053a, - 0x0000, 0x0000, 0x0000, 0x0000, -}; - -// f730 -u16 quiptable_maian[] = { - 0x0001, 0x05e2, 0x05e3, 0x05e4, - 0x0002, 0x05e5, 0x05e6, 0x05e7, - 0x0003, 0x05df, 0x05e0, 0x05e1, - 0x0000, 0x0000, 0x0000, 0x0000, +s16 g_MaianQuipBank[][4] = { + { 1, 0x05e2, 0x05e3, 0x05e4 }, + { 2, 0x05e5, 0x05e6, 0x05e7 }, + { 3, 0x05df, 0x05e0, 0x05e1 }, + { 0, 0x0000, 0x0000, 0x0000 }, }; /** diff --git a/src/game/game_02cde0.c b/src/game/game_02cde0.c index dbcd239a5..74e1978b1 100644 --- a/src/game/game_02cde0.c +++ b/src/game/game_02cde0.c @@ -34922,7 +34922,7 @@ s16 *squadronGetChrIds(s32 squadron_id) return &g_SquadronList[MAX_SQUADRONS - 1]; } -void func0f04ceec(s16 value) +void audioMarkAsRecentlyPlayed(s16 value) { var8009cd70[var8009cd98++] = value; @@ -34931,7 +34931,7 @@ void func0f04ceec(s16 value) } } -bool func0f04cf34(s16 value) +bool audioWasNotPlayedRecently(s16 value) { u8 i; diff --git a/src/include/commands.h b/src/include/commands.h index adb4ac54b..20075fa88 100644 --- a/src/include/commands.h +++ b/src/include/commands.h @@ -2575,21 +2575,73 @@ mkshort(0x012f), /** - * Makes chr say something out of a random set of 3. + * Allows the current chr to say a semi-random statement from some predefined + * lists. * - * Sets are defined in the 39850 file. The bank argument applies to humans only. - * Skedar and maians have their own hard coded banks. + * There are several banks (tables) of sound IDs. One for Skedar, one for + * Maians, and two banks (0 and 1) for humans. The human bank 0 is divided into + * four subbanks. Each subbank has similar phrases to the other subbanks but + * each subbank uses a different style of voice. The subbank used is determined + * by the chr's voicebox property. This allows them to have the same sounding + * voice among all their phrases. + * + * Each bank (table) contains rows and columns. The row can be selected via an + * argument to this command, but the column is determined randomly. All tables + * have 3 columns. + * + * ----------------------------------------------------------------------------- + * + * Arguments: + * + * The player argument is the player who the current chr is talking to. If the + * player has died then it'll attempt to use the coop player. If all players + * have died then it's likely their line will not be said. + * + * The row argument determines which row in the bank is used. Counting starts + * from 0. + * + * The probability argument determines the likelihood that the chr will say + * the line. The higher the number (up to 255), the more likely they are to + * talk. Note that under no conditions will the chr interrupt their existing + * talk to start a new one. + * + * The soundgap argument is the amount of time in seconds it takes for the chr + * to say their line, plus a suitable pause period at the end. The chr will not + * start a new phrase if they are in the soundgap of a previous phrase. + * + * The conditions argument determines under what conditions the chr will talk: + * 0 = only talk if no other chrs are nearby + * 1 = only talk if there are other chrs nearby and none of them are talking + * 255 = always talk, even if other chrs are nearby and talking + * (this applies after the probability check has passed) + * + * The bank argument determines which bank is used. Expected values are 0 or 1. + * For Skedar and Maians, this argument is ignored and they use their own banks. + * + * The textrow argument determines whether text will be shown on the screen as + * well as which row in the text bank will be used. Set to 0 to have no text. + * The column that is used is determined by the chr's tude property, however you + * can make it use the same column as the audio by bitwise ORing the bank + * argument with 0x80. + * + * The colour argument determines the colour of the text on the screen. This is + * expected to be a COLOUR constant. + * + * ----------------------------------------------------------------------------- + * + * If called with zero values for all of row, probability and onlyifothers, + * the chr's current speech (if any) will be stopped. */ -#define say_quip(chr, index, u1, u2, u3, bank, u4, channel) \ +#define say_quip(player, row, probability, soundgap, onlyifothers, bank, textrow, colour) \ mkshort(0x0130), \ - chr, \ - index, \ - u1, \ - u2, \ - u3, \ + player, \ + row, \ + probability, \ + soundgap, \ + onlyifothers, \ bank, \ - u4, \ - channel, + textrow, \ + colour, /** * Increases the alertness value for other chrs in the current chr's squadron. diff --git a/src/include/constants.h b/src/include/constants.h index 120eb4eea..c4cdbdb47 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -4,6 +4,7 @@ #define false 0 #define true 1 +#define ABS(val) (val > 0 ? val : -val) #define PLAYERCOUNT() ((g_Vars.players[0] ? 1 : 0) + (g_Vars.players[1] ? 1 : 0) + (g_Vars.players[2] ? 1 : 0) + (g_Vars.players[3] ? 1 : 0)) #define PLAYERCOUNT3012() ((g_Vars.players[3] ? 1 : 0) + (g_Vars.players[0] ? 1 : 0) + (g_Vars.players[1] ? 1 : 0) + (g_Vars.players[2] ? 1 : 0)) @@ -52,32 +53,35 @@ #define AIMCONTROL_HOLD 0 #define AIMCONTROL_TOGGLE 1 -#define AMMOTYPE_PISTOL 0x01 -#define AMMOTYPE_SMG 0x02 -#define AMMOTYPE_CROSSBOW 0x03 -#define AMMOTYPE_RIFLE 0x04 -#define AMMOTYPE_SHOTGUN 0x05 -#define AMMOTYPE_FARSIGHT 0x06 -#define AMMOTYPE_GRENADE 0x07 -#define AMMOTYPE_ROCKET 0x08 -#define AMMOTYPE_KNIFE 0x09 -#define AMMOTYPE_MAGNUM 0x0a -#define AMMOTYPE_DEVASTATOR 0x0b -#define AMMOTYPE_REMOTE_MINE 0x0c -#define AMMOTYPE_PROXY_MINE 0x0d -#define AMMOTYPE_TIMED_MINE 0x0e -#define AMMOTYPE_REAPER 0x0f -// 0x10 -// 0x11 -#define AMMOTYPE_NBOMB 0x12 -#define AMMOTYPE_SEDATIVE 0x13 -#define AMMOTYPE_CLOAK 0x14 -#define AMMOTYPE_BOOST 0x15 -#define AMMOTYPE_PSYCHOSIS 0x16 -// 0x17 -#define AMMOTYPE_BUG 0x18 -// 0x19 -#define AMMOTYPE_ECM_MINE 0x20 +#define AMMOTYPE_PISTOL 0x01 +#define AMMOTYPE_SMG 0x02 +#define AMMOTYPE_CROSSBOW 0x03 +#define AMMOTYPE_RIFLE 0x04 +#define AMMOTYPE_SHOTGUN 0x05 +#define AMMOTYPE_FARSIGHT 0x06 +#define AMMOTYPE_GRENADE 0x07 +#define AMMOTYPE_ROCKET 0x08 +#define AMMOTYPE_KNIFE 0x09 +#define AMMOTYPE_MAGNUM 0x0a +#define AMMOTYPE_DEVASTATOR 0x0b +#define AMMOTYPE_REMOTE_MINE 0x0c +#define AMMOTYPE_PROXY_MINE 0x0d +#define AMMOTYPE_TIMED_MINE 0x0e +#define AMMOTYPE_REAPER 0x0f +#define AMMOTYPE_HOMINGROCKET 0x10 +#define AMMOTYPE_DART 0x11 +#define AMMOTYPE_NBOMB 0x12 +#define AMMOTYPE_SEDATIVE 0x13 +#define AMMOTYPE_CLOAK 0x14 +#define AMMOTYPE_BOOST 0x15 +#define AMMOTYPE_PSYCHOSIS 0x16 +#define AMMOTYPE_17 0x17 +#define AMMOTYPE_BUG 0x18 +#define AMMOTYPE_MICROCAMERA 0x19 +#define AMMOTYPE_PLASTIQUE 0x1a +#define AMMOTYPE_TOKEN 0x1e +#define AMMOTYPE_1F 0x1f +#define AMMOTYPE_ECM_MINE 0x20 #define ANIM_IDLE 0x0000 #define ANIM_TWO_GUN_HOLD 0x0001 @@ -328,6 +332,7 @@ // chr->hidden2 #define CHRH2FLAG_0001 0x0001 +#define CHRH2FLAG_1000 0x1000 // chr->chrflags #define CHRCFLAG_00000001 0x00000001 // Villa takers, Attack Ship Cass and skedar - both set at end of intros diff --git a/src/include/game/chr/chraicommands.h b/src/include/game/chr/chraicommands.h index 6e1062aff..a62a5ca06 100644 --- a/src/include/game/chr/chraicommands.h +++ b/src/include/game/chr/chraicommands.h @@ -302,7 +302,7 @@ /*0x012b*/ bool aiIfTargetMovingCloser(void); /*0x012c*/ bool aiIfTargetMovingAway(void); /*0x012f*/ bool ai012f(void); -/*0x0130*/ bool ai0130(void); +/*0x0130*/ bool aiSayQuip(void); /*0x0131*/ bool aiIncreaseSquadronAlertness(void); /*0x0132*/ bool aiSetAction(void); /*0x0133*/ bool aiSetTeamOrders(void); diff --git a/src/include/game/data/data_0083d0.h b/src/include/game/data/data_0083d0.h index a102b36d3..8354e000d 100644 --- a/src/include/game/data/data_0083d0.h +++ b/src/include/game/data/data_0083d0.h @@ -218,10 +218,11 @@ extern u32 var8006845c; extern u8 g_ChrTeamIds[MAX_TEAMS]; extern u32 var8006846c; extern struct coord var80068fe0; -extern u16 quiptable_human_bank0[]; -extern u16 quiptable_human_bank1[]; -extern u16 quiptable_skedar[]; -extern u16 quiptable_maian[]; +extern s16 g_GuardQuipBank[][4]; +extern s16 g_SpecialQuipBank[][4]; +extern s16 g_QuipTexts[][4]; +extern s16 g_SkedarQuipBank[][4]; +extern s16 g_MaianQuipBank[][4]; extern s16 ciquiptable_bank0[][3]; extern s16 ciquiptable_bank1[][3]; extern s16 ciquiptable_bank2[][3]; diff --git a/src/include/game/game_02cde0.h b/src/include/game/game_02cde0.h index 3863f6bfd..0c761cf12 100644 --- a/src/include/game/game_02cde0.h +++ b/src/include/game/game_02cde0.h @@ -329,8 +329,8 @@ bool func0f04c6b4(struct chrdata *chr, u32 distance); bool func0f04c71c(struct chrdata *chr, u32 distance); s16 *teamGetChrIds(s32 team_id); s16 *squadronGetChrIds(s32 squadron_id); -void func0f04ceec(s16 value); -bool func0f04cf34(s16 value); +void audioMarkAsRecentlyPlayed(s16 value); +bool audioWasNotPlayedRecently(s16 value); void func0f04cf90(struct chrdata *chr, s32 arg1); bool func0f04d44c(struct chrdata *chr); void chrEmitSparks(struct chrdata *chr); diff --git a/src/include/game/game_066310.h b/src/include/game/game_066310.h index 8ec9b4891..4961e323b 100644 --- a/src/include/game/game_066310.h +++ b/src/include/game/game_066310.h @@ -351,7 +351,7 @@ u32 func0f0923d4(void); u32 func0f092420(void); u32 func0f092484(void); u32 func0f092610(void); -void func0f0926bc(struct prop *prop, u32 arg1, s32 arg2); +void func0f0926bc(struct prop *prop, u32 arg1, u16 arg2); s32 func0f0927d4(f32 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4); s32 func0f092914(s32 arg0); u32 func0f09294c(void); diff --git a/src/include/library/library_0e9d0.h b/src/include/library/library_0e9d0.h index ab59a8b2a..53f6124e4 100644 --- a/src/include/library/library_0e9d0.h +++ b/src/include/library/library_0e9d0.h @@ -3,7 +3,7 @@ #include #include "types.h" -u32 audioIsFiltered(void); +bool audioIsFiltered(s32 audioid); u32 func0000e9d0(void); u32 func0000e9dc(void); void audioSetSfxVolume(u16 volume);