parent
fd69d73ec9
commit
a0661ca3c8
|
@ -12,6 +12,7 @@
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
#include "message.h"
|
||||||
#include "object.h"
|
#include "object.h"
|
||||||
#include "party_member.h"
|
#include "party_member.h"
|
||||||
#include "platform_compat.h"
|
#include "platform_compat.h"
|
||||||
|
@ -29,19 +30,58 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
// Maximum length of dude's name length.
|
||||||
|
#define DUDE_NAME_MAX_LENGTH (32)
|
||||||
|
|
||||||
|
// The number of effects caused by radiation.
|
||||||
|
//
|
||||||
|
// A radiation effect is an identifier and does not have it's own name. It's
|
||||||
|
// stat is specified in [gRadiationEffectStats], and it's amount is specified
|
||||||
|
// in [gRadiationEffectPenalties] for every [RadiationLevel].
|
||||||
|
#define RADIATION_EFFECT_COUNT 8
|
||||||
|
|
||||||
|
// Radiation levels.
|
||||||
|
//
|
||||||
|
// The names of levels are taken from Fallout 3, comments from Fallout 2.
|
||||||
|
typedef enum RadiationLevel {
|
||||||
|
// Very nauseous.
|
||||||
|
RADIATION_LEVEL_NONE,
|
||||||
|
|
||||||
|
// Slightly fatigued.
|
||||||
|
RADIATION_LEVEL_MINOR,
|
||||||
|
|
||||||
|
// Vomiting does not stop.
|
||||||
|
RADIATION_LEVEL_ADVANCED,
|
||||||
|
|
||||||
|
// Hair is falling out.
|
||||||
|
RADIATION_LEVEL_CRITICAL,
|
||||||
|
|
||||||
|
// Skin is falling off.
|
||||||
|
RADIATION_LEVEL_DEADLY,
|
||||||
|
|
||||||
|
// Intense agony.
|
||||||
|
RADIATION_LEVEL_FATAL,
|
||||||
|
|
||||||
|
// The number of radiation levels.
|
||||||
|
RADIATION_LEVEL_COUNT,
|
||||||
|
} RadiationLevel;
|
||||||
|
|
||||||
|
static int _get_rad_damage_level(Object* obj, void* data);
|
||||||
|
static int _critterClearObjDrugs(Object* obj, void* data);
|
||||||
|
|
||||||
// 0x50141C
|
// 0x50141C
|
||||||
char _aCorpse[] = "corpse";
|
static char _aCorpse[] = "corpse";
|
||||||
|
|
||||||
// 0x501494
|
// 0x501494
|
||||||
char byte_501494[] = "";
|
static char byte_501494[] = "";
|
||||||
|
|
||||||
// 0x51833C
|
// 0x51833C
|
||||||
char* _name_critter = _aCorpse;
|
static char* _name_critter = _aCorpse;
|
||||||
|
|
||||||
// Modifiers to endurance for performing radiation damage check.
|
// Modifiers to endurance for performing radiation damage check.
|
||||||
//
|
//
|
||||||
// 0x518340
|
// 0x518340
|
||||||
const int gRadiationEnduranceModifiers[RADIATION_LEVEL_COUNT] = {
|
static const int gRadiationEnduranceModifiers[RADIATION_LEVEL_COUNT] = {
|
||||||
2,
|
2,
|
||||||
0,
|
0,
|
||||||
-2,
|
-2,
|
||||||
|
@ -60,7 +100,7 @@ const int gRadiationEnduranceModifiers[RADIATION_LEVEL_COUNT] = {
|
||||||
// [RADIATION_EFFECT_PRIMARY_STAT_COUNT] for more info.
|
// [RADIATION_EFFECT_PRIMARY_STAT_COUNT] for more info.
|
||||||
//
|
//
|
||||||
// 0x518358
|
// 0x518358
|
||||||
const int gRadiationEffectStats[RADIATION_EFFECT_COUNT] = {
|
static const int gRadiationEffectStats[RADIATION_EFFECT_COUNT] = {
|
||||||
STAT_STRENGTH,
|
STAT_STRENGTH,
|
||||||
STAT_PERCEPTION,
|
STAT_PERCEPTION,
|
||||||
STAT_ENDURANCE,
|
STAT_ENDURANCE,
|
||||||
|
@ -79,7 +119,7 @@ const int gRadiationEffectStats[RADIATION_EFFECT_COUNT] = {
|
||||||
// List of stat modifiers caused by radiation at different radiation levels.
|
// List of stat modifiers caused by radiation at different radiation levels.
|
||||||
//
|
//
|
||||||
// 0x518378
|
// 0x518378
|
||||||
const int gRadiationEffectPenalties[RADIATION_LEVEL_COUNT][RADIATION_EFFECT_COUNT] = {
|
static const int gRadiationEffectPenalties[RADIATION_LEVEL_COUNT][RADIATION_EFFECT_COUNT] = {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
{ 0, 0, 0, 0, 0, 0, 0, 0 },
|
{ 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||||
{ -1, 0, 0, 0, 0, 0, 0, 0 },
|
{ -1, 0, 0, 0, 0, 0, 0, 0 },
|
||||||
|
@ -91,26 +131,26 @@ const int gRadiationEffectPenalties[RADIATION_LEVEL_COUNT][RADIATION_EFFECT_COUN
|
||||||
};
|
};
|
||||||
|
|
||||||
// 0x518438
|
// 0x518438
|
||||||
Object* _critterClearObj = NULL;
|
static Object* _critterClearObj = NULL;
|
||||||
|
|
||||||
// scrname.msg
|
// scrname.msg
|
||||||
//
|
//
|
||||||
// 0x56D754
|
// 0x56D754
|
||||||
MessageList gCritterMessageList;
|
static MessageList gCritterMessageList;
|
||||||
|
|
||||||
// 0x56D75C
|
// 0x56D75C
|
||||||
char gDudeName[DUDE_NAME_MAX_LENGTH];
|
static char gDudeName[DUDE_NAME_MAX_LENGTH];
|
||||||
|
|
||||||
// 0x56D77C
|
// 0x56D77C
|
||||||
int _sneak_working;
|
static int _sneak_working;
|
||||||
|
|
||||||
// 0x56D780
|
// 0x56D780
|
||||||
int gKillsByType[KILL_TYPE_COUNT];
|
static int gKillsByType[KILL_TYPE_COUNT];
|
||||||
|
|
||||||
// Something with radiation.
|
// Something with radiation.
|
||||||
//
|
//
|
||||||
// 0x56D7CC
|
// 0x56D7CC
|
||||||
int _old_rad_level;
|
static int _old_rad_level;
|
||||||
|
|
||||||
// scrname_init
|
// scrname_init
|
||||||
// 0x42CF50
|
// 0x42CF50
|
||||||
|
@ -489,7 +529,7 @@ int _critter_check_rads(Object* obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 0x42D618
|
// 0x42D618
|
||||||
int _get_rad_damage_level(Object* obj, void* data)
|
static int _get_rad_damage_level(Object* obj, void* data)
|
||||||
{
|
{
|
||||||
RadiationEvent* radiationEvent = (RadiationEvent*)data;
|
RadiationEvent* radiationEvent = (RadiationEvent*)data;
|
||||||
|
|
||||||
|
@ -739,7 +779,7 @@ int _critter_heal_hours(Object* critter, int a2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 0x42DA54
|
// 0x42DA54
|
||||||
int _critterClearObjDrugs(Object* obj, void* data)
|
static int _critterClearObjDrugs(Object* obj, void* data)
|
||||||
{
|
{
|
||||||
return obj == _critterClearObj;
|
return obj == _critterClearObj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,67 +2,15 @@
|
||||||
#define CRITTER_H
|
#define CRITTER_H
|
||||||
|
|
||||||
#include "db.h"
|
#include "db.h"
|
||||||
#include "message.h"
|
|
||||||
#include "obj_types.h"
|
#include "obj_types.h"
|
||||||
#include "proto_types.h"
|
#include "proto_types.h"
|
||||||
|
|
||||||
// Maximum length of dude's name length.
|
|
||||||
#define DUDE_NAME_MAX_LENGTH (32)
|
|
||||||
|
|
||||||
// The number of effects caused by radiation.
|
|
||||||
//
|
|
||||||
// A radiation effect is an identifier and does not have it's own name. It's
|
|
||||||
// stat is specified in [gRadiationEffectStats], and it's amount is specified
|
|
||||||
// in [gRadiationEffectPenalties] for every [RadiationLevel].
|
|
||||||
#define RADIATION_EFFECT_COUNT 8
|
|
||||||
|
|
||||||
// Radiation levels.
|
|
||||||
//
|
|
||||||
// The names of levels are taken from Fallout 3, comments from Fallout 2.
|
|
||||||
typedef enum RadiationLevel {
|
|
||||||
// Very nauseous.
|
|
||||||
RADIATION_LEVEL_NONE,
|
|
||||||
|
|
||||||
// Slightly fatigued.
|
|
||||||
RADIATION_LEVEL_MINOR,
|
|
||||||
|
|
||||||
// Vomiting does not stop.
|
|
||||||
RADIATION_LEVEL_ADVANCED,
|
|
||||||
|
|
||||||
// Hair is falling out.
|
|
||||||
RADIATION_LEVEL_CRITICAL,
|
|
||||||
|
|
||||||
// Skin is falling off.
|
|
||||||
RADIATION_LEVEL_DEADLY,
|
|
||||||
|
|
||||||
// Intense agony.
|
|
||||||
RADIATION_LEVEL_FATAL,
|
|
||||||
|
|
||||||
// The number of radiation levels.
|
|
||||||
RADIATION_LEVEL_COUNT,
|
|
||||||
} RadiationLevel;
|
|
||||||
|
|
||||||
typedef enum DudeState {
|
typedef enum DudeState {
|
||||||
DUDE_STATE_SNEAKING = 0,
|
DUDE_STATE_SNEAKING = 0,
|
||||||
DUDE_STATE_LEVEL_UP_AVAILABLE = 3,
|
DUDE_STATE_LEVEL_UP_AVAILABLE = 3,
|
||||||
DUDE_STATE_ADDICTED = 4,
|
DUDE_STATE_ADDICTED = 4,
|
||||||
} DudeState;
|
} DudeState;
|
||||||
|
|
||||||
extern char _aCorpse[];
|
|
||||||
extern char byte_501494[];
|
|
||||||
|
|
||||||
extern char* _name_critter;
|
|
||||||
extern const int gRadiationEnduranceModifiers[RADIATION_LEVEL_COUNT];
|
|
||||||
extern const int gRadiationEffectStats[RADIATION_EFFECT_COUNT];
|
|
||||||
extern const int gRadiationEffectPenalties[RADIATION_LEVEL_COUNT][RADIATION_EFFECT_COUNT];
|
|
||||||
extern Object* _critterClearObj;
|
|
||||||
|
|
||||||
extern MessageList gCritterMessageList;
|
|
||||||
extern char gDudeName[DUDE_NAME_MAX_LENGTH];
|
|
||||||
extern int _sneak_working;
|
|
||||||
extern int gKillsByType[KILL_TYPE_COUNT];
|
|
||||||
extern int _old_rad_level;
|
|
||||||
|
|
||||||
int critterInit();
|
int critterInit();
|
||||||
void critterReset();
|
void critterReset();
|
||||||
void critterExit();
|
void critterExit();
|
||||||
|
@ -80,7 +28,6 @@ int poisonEventProcess(Object* obj, void* data);
|
||||||
int critterGetRadiation(Object* critter);
|
int critterGetRadiation(Object* critter);
|
||||||
int critterAdjustRadiation(Object* obj, int amount);
|
int critterAdjustRadiation(Object* obj, int amount);
|
||||||
int _critter_check_rads(Object* critter);
|
int _critter_check_rads(Object* critter);
|
||||||
int _get_rad_damage_level(Object* obj, void* data);
|
|
||||||
int _clear_rad_damage(Object* obj, void* data);
|
int _clear_rad_damage(Object* obj, void* data);
|
||||||
void _process_rads(Object* obj, int radiationLevel, bool direction);
|
void _process_rads(Object* obj, int radiationLevel, bool direction);
|
||||||
int radiationEventProcess(Object* obj, void* data);
|
int radiationEventProcess(Object* obj, void* data);
|
||||||
|
@ -95,7 +42,6 @@ int critterGetKillType(Object* critter);
|
||||||
char* killTypeGetName(int killType);
|
char* killTypeGetName(int killType);
|
||||||
char* killTypeGetDescription(int killType);
|
char* killTypeGetDescription(int killType);
|
||||||
int _critter_heal_hours(Object* obj, int a2);
|
int _critter_heal_hours(Object* obj, int a2);
|
||||||
int _critterClearObjDrugs(Object* obj, void* data);
|
|
||||||
void critterKill(Object* critter, int anim, bool a3);
|
void critterKill(Object* critter, int anim, bool a3);
|
||||||
int critterGetExp(Object* critter);
|
int critterGetExp(Object* critter);
|
||||||
bool critterIsActive(Object* critter);
|
bool critterIsActive(Object* critter);
|
||||||
|
|
Loading…
Reference in New Issue