mirror of
https://gitlab.com/ryandwyer/perfect-dark
synced 2026-08-17 12:59:41 -04:00
Attempt to decompile aiSayQuip
This commit is contained in:
+63
-11
@@ -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.
|
||||
|
||||
+31
-26
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <ultra64.h>
|
||||
#include "types.h"
|
||||
|
||||
u32 audioIsFiltered(void);
|
||||
bool audioIsFiltered(s32 audioid);
|
||||
u32 func0000e9d0(void);
|
||||
u32 func0000e9dc(void);
|
||||
void audioSetSfxVolume(u16 volume);
|
||||
|
||||
Reference in New Issue
Block a user