mirror of
https://github.com/fallout2-ce/fallout2-ce.git
synced 2026-07-27 16:47:11 -07:00
Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d5fbe061c | ||
|
|
c33eeb0342 | ||
|
|
d8df3cdd73 | ||
|
|
8663fe5b60 | ||
|
|
4720ce1b7d | ||
|
|
cd38c82514 | ||
|
|
552505e3f5 | ||
|
|
b9dd399457 | ||
|
|
5f544ca985 | ||
|
|
0c7752fd33 | ||
|
|
0a5364972c | ||
|
|
1db054e47a | ||
|
|
8e60a2fba2 | ||
|
|
ca89abad6c | ||
|
|
21a98bebb1 | ||
|
|
283107bebe |
@@ -42,7 +42,13 @@ The following settings were moved into [`<DAT>/config/game.cfg`](files/ce.dat/co
|
||||
|
||||
| ddraw.ini section | ddraw.ini key | game.cfg section | game.cfg key |
|
||||
| --- | --- | --- | --- |
|
||||
| `Misc` | `StartingMap` | `start` | `map` |
|
||||
| `Misc` | `StartXPos` | `start` | `worldmap_x` |
|
||||
| `Misc` | `StartYPos` | `start` | `worldmap_y` |
|
||||
| `Misc` | `ViewXPos` | `start` | `worldmap_view_x` |
|
||||
| `Misc` | `ViewYPos` | `start` | `worldmap_view_y` |
|
||||
| `Misc` | `StartGDialogFix` | `dialog` | `start_gdialog_fix` |
|
||||
| `Misc` | `DisableSpecialMapIDs` | `maps` | `disable_special_map_ids` |
|
||||
|
||||
## Opcodes / Metarules
|
||||
|
||||
|
||||
@@ -11,6 +11,12 @@ month=6
|
||||
day=24
|
||||
; To start a new game somewhere other than artemple.map, set this to the map file name.
|
||||
map=
|
||||
; Starting worldmap marker position. -1 uses the starting map's world area.
|
||||
worldmap_x=-1
|
||||
worldmap_y=-1
|
||||
; Starting worldmap viewport position. -1 uses the default upper-left view.
|
||||
worldmap_view_x=-1
|
||||
worldmap_view_y=-1
|
||||
; Starting (tribal) and default (jumpsuit) player models. Can also be changed in-game via script.
|
||||
model_male=hmwarr
|
||||
model_male_default=hmjmps
|
||||
@@ -20,6 +26,11 @@ model_female_default=hfjmps
|
||||
; Set to 2 to make the pipboy available by only skipping the vault suit movie check.
|
||||
pipboy=0
|
||||
|
||||
[maps]
|
||||
; Set to 1 to apply transition tile, elevation, and rotation overrides on all maps,
|
||||
; including Fallout 2 map IDs 19 and 37.
|
||||
disable_special_map_ids=0
|
||||
|
||||
[karma]
|
||||
; FRM numbers for karma icons on the character screen. Number of points entries should be 1 less than number of frms entries.
|
||||
; Example: frms=47,48,49 points=-100,100
|
||||
|
||||
@@ -165,6 +165,16 @@ main_menu_scale_mode=1
|
||||
; Set to 1 to show a Help option in the in-game options menu which opens the F1 help screen.
|
||||
in_game_menu_help=1
|
||||
|
||||
; Weight/size indicator for PC, critters and containers
|
||||
; Set to 0 for vanilla behavior (no weight indicator)
|
||||
; Set to 1 to show a simple weight indicator; works with all inventory_columns values
|
||||
; Set to 2 to show a detailed weight indicator; works with inventory_columns > 1 only
|
||||
loot_weight_indicator=1
|
||||
|
||||
; Set to 0 to show container indicator at all times
|
||||
; Set to XX to show container indicator when size reaches XX%
|
||||
; Set to 100 to show container indicator when full
|
||||
loot_container_size_indicator_threshold=50
|
||||
|
||||
[qol]
|
||||
; Automatically open doors that are unlocked and has no script attached.
|
||||
|
||||
+9
-9
@@ -97,7 +97,7 @@ static int _compute_explosion_damage(int min, int max, Object* defender, int* kn
|
||||
static int _can_talk_to(Object* obj, Object* critter);
|
||||
static int _talk_to(Object* _, Object* critter);
|
||||
static int _report_dmg(Attack* attack, Object* _);
|
||||
static int _compute_dmg_damage(int min, int max, Object* obj, int* knockbackDistancePtr, int damageType);
|
||||
static int _compute_dmg_damage(int min, int max, Object* obj, int* knockbackDistancePtr, DamageType damageType);
|
||||
|
||||
static int hideProjectile(void* _, void* projectile);
|
||||
|
||||
@@ -200,7 +200,7 @@ int pickDeathAnim(Object* attacker, Object* defender, Object* weapon, int damage
|
||||
int normalViolenceLevelDamageThreshold = 15;
|
||||
int maximumBloodViolenceLevelDamageThreshold = 45;
|
||||
|
||||
int damageType = weaponGetDamageType(attacker, weapon);
|
||||
DamageType damageType = weaponGetDamageType(attacker, weapon);
|
||||
|
||||
if (weapon != nullptr && weapon->pid == PROTO_ID_MOLOTOV_COCKTAIL) {
|
||||
normalViolenceLevelDamageThreshold = 5;
|
||||
@@ -729,7 +729,7 @@ int _action_ranged(Attack* attack, int anim)
|
||||
|
||||
weaponGetRange(attack->attacker, attack->hitMode);
|
||||
|
||||
int damageType = weaponGetDamageType(attack->attacker, attack->weapon);
|
||||
DamageType damageType = weaponGetDamageType(attack->attacker, attack->weapon);
|
||||
|
||||
tileGetTileInDirection(attack->attacker->tile, attack->attacker->rotation, 1);
|
||||
|
||||
@@ -1306,7 +1306,7 @@ int actionLootCritter(Object* critter, Object* target)
|
||||
}
|
||||
|
||||
// 0x4124E0
|
||||
int _action_skill_use(int skill)
|
||||
int _action_skill_use(Skill skill)
|
||||
{
|
||||
if (skill == SKILL_SNEAK) {
|
||||
reg_anim_clear(gDude);
|
||||
@@ -1336,7 +1336,7 @@ static int _action_use_skill_in_combat_error(Object* critter)
|
||||
|
||||
// skill_use
|
||||
// 0x41255C
|
||||
int actionUseSkill(Object* user, Object* target, int skill)
|
||||
int actionUseSkill(Object* user, Object* target, Skill skill)
|
||||
{
|
||||
UseSkillOnHookResult hookResult = scriptHooks_UseSkillOn(&user, target, skill);
|
||||
if (!hookResult.shouldContinue) {
|
||||
@@ -1907,7 +1907,7 @@ int _talk_to(Object* _, Object* critter)
|
||||
}
|
||||
|
||||
// 0x413494
|
||||
void actionDamage(int tile, int elevation, int minDamage, int maxDamage, int damageType, bool animated, bool bypassArmor)
|
||||
void actionDamage(int tile, int elevation, int minDamage, int maxDamage, DamageType damageType, bool animated, bool bypassArmor)
|
||||
{
|
||||
Attack* attack = (Attack*)internal_malloc(sizeof(*attack));
|
||||
if (attack == nullptr) {
|
||||
@@ -1988,15 +1988,15 @@ int _report_dmg(Attack* attack, Object* _)
|
||||
// Calculate damage by applying threshold and resistances.
|
||||
//
|
||||
// 0x413660
|
||||
int _compute_dmg_damage(int min, int max, Object* obj, int* knockbackDistancePtr, int damageType)
|
||||
int _compute_dmg_damage(int min, int max, Object* obj, int* knockbackDistancePtr, DamageType damageType)
|
||||
{
|
||||
if (!critterFlagCheck(obj->pid, CRITTER_NO_KNOCKBACK)) {
|
||||
knockbackDistancePtr = nullptr;
|
||||
}
|
||||
|
||||
int damage = randomBetween(min, max) - critterGetStat(obj, STAT_DAMAGE_THRESHOLD + damageType);
|
||||
int damage = randomBetween(min, max) - critterGetStat(obj, static_cast<Stat>(STAT_DAMAGE_THRESHOLD + damageType));
|
||||
if (damage > 0) {
|
||||
damage -= critterGetStat(obj, STAT_DAMAGE_RESISTANCE + damageType) * damage / 100;
|
||||
damage -= critterGetStat(obj, static_cast<Stat>(STAT_DAMAGE_RESISTANCE + damageType)) * damage / 100;
|
||||
}
|
||||
|
||||
if (damage < 0) {
|
||||
|
||||
+5
-3
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "combat_defs.h"
|
||||
#include "obj_types.h"
|
||||
#include "proto_types.h"
|
||||
#include "skill_defs.h"
|
||||
|
||||
namespace fallout {
|
||||
|
||||
@@ -13,14 +15,14 @@ int _action_use_an_item_on_object(Object* user, Object* targetObj, Object* item)
|
||||
int _action_use_an_object(Object* user, Object* targetObj);
|
||||
int actionPickUp(Object* critter, Object* item);
|
||||
int actionLootCritter(Object* critter, Object* target);
|
||||
int _action_skill_use(int skill);
|
||||
int actionUseSkill(Object* user, Object* target, int skill);
|
||||
int _action_skill_use(Skill skill);
|
||||
int actionUseSkill(Object* user, Object* target, Skill skill);
|
||||
bool _is_hit_from_front(const Object* attacker, const Object* defender);
|
||||
bool _can_see(Object* source, Object* target);
|
||||
bool _action_explode_running();
|
||||
int actionExplode(int tile, int elevation, int minDamage, int maxDamage, Object* sourceObj, bool animate);
|
||||
int actionTalk(Object* obj, Object* critter);
|
||||
void actionDamage(int tile, int elevation, int minDamage, int maxDamage, int damageType, bool animated, bool bypassArmor);
|
||||
void actionDamage(int tile, int elevation, int minDamage, int maxDamage, DamageType damageType, bool animated, bool bypassArmor);
|
||||
bool actionCheckPush(Object* obj, Object* target);
|
||||
int actionPush(Object* obj, Object* target);
|
||||
int _action_can_talk_to(Object* obj, Object* critter);
|
||||
|
||||
+1
-1
@@ -1736,7 +1736,7 @@ static bool canUseDoor(Object* critter, Object* door)
|
||||
return false;
|
||||
}
|
||||
|
||||
int bodyType = critterGetBodyType(critter);
|
||||
BodyType bodyType = critterGetBodyType(critter);
|
||||
if (bodyType != BODY_TYPE_BIPED && bodyType != BODY_TYPE_ROBOTIC) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+3
-1
@@ -1789,11 +1789,13 @@ void FrmImage::resetInternal()
|
||||
|
||||
bool FrmImage::setFrame(const Art* art, int frame, int direction)
|
||||
{
|
||||
unsigned char* data = artGetFrameData(art, frame, direction, &_width, &_height, &_xOffset, &_yOffset);
|
||||
unsigned char* data = artGetFrameData(art, frame, direction, &_width, &_height, nullptr, nullptr);
|
||||
if (data == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
_xOffset = art->xOffsets[direction];
|
||||
_yOffset = art->yOffsets[direction];
|
||||
_data = data;
|
||||
return true;
|
||||
}
|
||||
|
||||
+239
-210
File diff suppressed because it is too large
Load Diff
@@ -67,12 +67,27 @@ namespace fallout {
|
||||
#define CS_WINDOW_SECONDARY_STAT_MID_X (379)
|
||||
#define CS_WINDOW_BIO_X (438)
|
||||
|
||||
typedef enum PremadeCharacter {
|
||||
enum PremadeCharacter : int {
|
||||
PREMADE_CHARACTER_NARG,
|
||||
PREMADE_CHARACTER_CHITSA,
|
||||
PREMADE_CHARACTER_MINGUN,
|
||||
PREMADE_CHARACTER_COUNT,
|
||||
} PremadeCharacter;
|
||||
PREMADE_CHARACTER_FIRST = PREMADE_CHARACTER_NARG
|
||||
};
|
||||
|
||||
inline PremadeCharacter operator++(PremadeCharacter& e, int)
|
||||
{
|
||||
PremadeCharacter result = e;
|
||||
e = static_cast<PremadeCharacter>(static_cast<int>(e) + 1);
|
||||
return result;
|
||||
}
|
||||
|
||||
inline PremadeCharacter operator--(PremadeCharacter& e, int)
|
||||
{
|
||||
PremadeCharacter result = e;
|
||||
e = static_cast<PremadeCharacter>(static_cast<int>(e) - 1);
|
||||
return result;
|
||||
}
|
||||
|
||||
typedef struct PremadeCharacterDescription {
|
||||
char fileName[20];
|
||||
@@ -91,7 +106,7 @@ static bool characterSelectorWindowFatalError(bool result);
|
||||
static void premadeCharactersLocalizePath(char* path);
|
||||
|
||||
// 0x51C84C premade_index
|
||||
static int gCurrentPremadeCharacter = PREMADE_CHARACTER_NARG;
|
||||
static PremadeCharacter gCurrentPremadeCharacter = PREMADE_CHARACTER_NARG;
|
||||
|
||||
// 0x51C850 premade_characters
|
||||
static PremadeCharacterDescription gPremadeCharacterDescriptions[PREMADE_CHARACTER_COUNT] = {
|
||||
@@ -223,9 +238,9 @@ int characterSelectorOpen()
|
||||
soundPlayFile("ib2p1xx1");
|
||||
// FALLTHROUGH
|
||||
case 500:
|
||||
gCurrentPremadeCharacter -= 1;
|
||||
if (gCurrentPremadeCharacter < 0) {
|
||||
gCurrentPremadeCharacter = gPremadeCharacterCount - 1;
|
||||
gCurrentPremadeCharacter--;
|
||||
if (gCurrentPremadeCharacter < PREMADE_CHARACTER_FIRST) {
|
||||
gCurrentPremadeCharacter--;
|
||||
}
|
||||
|
||||
characterSelectorWindowRefresh();
|
||||
@@ -234,9 +249,9 @@ int characterSelectorOpen()
|
||||
soundPlayFile("ib2p1xx1");
|
||||
// FALLTHROUGH
|
||||
case 501:
|
||||
gCurrentPremadeCharacter += 1;
|
||||
gCurrentPremadeCharacter++;
|
||||
if (gCurrentPremadeCharacter >= gPremadeCharacterCount) {
|
||||
gCurrentPremadeCharacter = 0;
|
||||
gCurrentPremadeCharacter = PREMADE_CHARACTER_FIRST;
|
||||
}
|
||||
|
||||
characterSelectorWindowRefresh();
|
||||
@@ -827,7 +842,7 @@ static bool characterSelectorWindowRenderStats()
|
||||
y += vh; // blank line
|
||||
|
||||
// SKILLS
|
||||
int skills[DEFAULT_TAGGED_SKILLS];
|
||||
Skill skills[DEFAULT_TAGGED_SKILLS];
|
||||
skillsGetTagged(skills, DEFAULT_TAGGED_SKILLS);
|
||||
|
||||
for (int index = 0; index < DEFAULT_TAGGED_SKILLS; index++) {
|
||||
|
||||
+860
-858
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -59,9 +59,9 @@ void _combat_delete_critter(Object* obj);
|
||||
void _combatKillCritterOutsideCombat(Object* critter_obj, char* msg);
|
||||
|
||||
int combatGetTargetHighlight();
|
||||
int criticalsGetValue(int killType, HitLocation hitLocation, int effect, CriticalHitDataMember dataMember);
|
||||
void criticalsSetValue(int killType, HitLocation hitLocation, int effect, CriticalHitDataMember dataMember, int value);
|
||||
void criticalsResetValue(int killType, HitLocation hitLocation, int effect, CriticalHitDataMember dataMember);
|
||||
int criticalsGetValue(KillType killType, HitLocation hitLocation, CriticalEffect effect, CriticalHitDataMember dataMember);
|
||||
void criticalsSetValue(KillType killType, HitLocation hitLocation, CriticalEffect effect, CriticalHitDataMember dataMember, int value);
|
||||
void criticalsResetValue(KillType killType, HitLocation hitLocation, CriticalEffect effect, CriticalHitDataMember dataMember);
|
||||
bool criticalsNoTimeLimits();
|
||||
int unarmedGetDamage(HitMode hitMode, int* minDamagePtr, int* maxDamagePtr);
|
||||
int unarmedGetBonusCriticalChance(HitMode hitMode);
|
||||
|
||||
+8
-8
@@ -610,7 +610,7 @@ static int aiPacketRead(File* stream, AiPacket* ai)
|
||||
if (fileReadInt32(stream, &(ai->miss.start)) == -1) return -1;
|
||||
if (fileReadInt32(stream, &(ai->miss.end)) == -1) return -1;
|
||||
|
||||
for (int index = 0; index < HIT_LOCATION_SPECIFIC_COUNT; index++) {
|
||||
for (int index = HIT_LOCATION_FIRST; index < HIT_LOCATION_SPECIFIC_COUNT; index++) {
|
||||
AiMessageRange* range = &(ai->hit[index]);
|
||||
if (fileReadInt32(stream, &(range->start)) == -1) return -1;
|
||||
if (fileReadInt32(stream, &(range->end)) == -1) return -1;
|
||||
@@ -654,7 +654,7 @@ static int aiPacketWrite(File* stream, AiPacket* ai)
|
||||
if (fileWriteInt32(stream, ai->miss.start) == -1) return -1;
|
||||
if (fileWriteInt32(stream, ai->miss.end) == -1) return -1;
|
||||
|
||||
for (int index = 0; index < HIT_LOCATION_SPECIFIC_COUNT; index++) {
|
||||
for (int index = HIT_LOCATION_FIRST; index < HIT_LOCATION_SPECIFIC_COUNT; index++) {
|
||||
AiMessageRange* range = &(ai->hit[index]);
|
||||
if (fileWriteInt32(stream, range->start) == -1) return -1;
|
||||
if (fileWriteInt32(stream, range->end) == -1) return -1;
|
||||
@@ -1981,7 +1981,7 @@ static bool _ai_can_use_weapon(Object* critter, Object* weapon, HitMode hitMode)
|
||||
|
||||
AiPacket* ai = aiGetPacket(critter);
|
||||
if (result) {
|
||||
int skill = weaponGetSkillForHitMode(weapon, hitMode);
|
||||
Skill skill = weaponGetSkillForHitMode(weapon, hitMode);
|
||||
if (skillGetValue(critter, skill) < ai->min_to_hit) {
|
||||
result = false;
|
||||
}
|
||||
@@ -1998,7 +1998,7 @@ static bool _ai_can_use_weapon(Object* critter, Object* weapon, HitMode hitMode)
|
||||
// 0x4299A0
|
||||
Object* _ai_search_inven_weap(Object* critter, bool checkRequiredActionPoints, Object* defender)
|
||||
{
|
||||
int bodyType = critterGetBodyType(critter);
|
||||
BodyType bodyType = critterGetBodyType(critter);
|
||||
if (bodyType != BODY_TYPE_BIPED
|
||||
&& bodyType != BODY_TYPE_ROBOTIC
|
||||
&& critter->pid != PROTO_ID_GORIS) {
|
||||
@@ -2062,7 +2062,7 @@ Object* _ai_search_inven_armor(Object* critter)
|
||||
if (armor != nullptr) {
|
||||
armorScore = armorGetArmorClass(armor);
|
||||
|
||||
for (int damageType = 0; damageType < DAMAGE_TYPE_COUNT; damageType++) {
|
||||
for (DamageType damageType = DAMAGE_TYPE_FIRST; damageType < DAMAGE_TYPE_COUNT; damageType++) {
|
||||
armorScore += armorGetDamageResistance(armor, damageType);
|
||||
armorScore += armorGetDamageThreshold(armor, damageType);
|
||||
}
|
||||
@@ -2081,7 +2081,7 @@ Object* _ai_search_inven_armor(Object* critter)
|
||||
|
||||
if (armor != candidate) {
|
||||
int candidateScore = armorGetArmorClass(candidate);
|
||||
for (int damageType = 0; damageType < DAMAGE_TYPE_COUNT; damageType++) {
|
||||
for (DamageType damageType = DAMAGE_TYPE_FIRST; damageType < DAMAGE_TYPE_COUNT; damageType++) {
|
||||
candidateScore += armorGetDamageResistance(candidate, damageType);
|
||||
candidateScore += armorGetDamageThreshold(candidate, damageType);
|
||||
}
|
||||
@@ -2128,7 +2128,7 @@ static bool aiCanUseItem(Object* critter, Object* item)
|
||||
return false;
|
||||
}
|
||||
|
||||
int killType = critterGetKillType(critter);
|
||||
KillType killType = critterGetKillType(critter);
|
||||
if (killType != KILL_TYPE_MAN
|
||||
&& killType != KILL_TYPE_WOMAN
|
||||
&& killType != KILL_TYPE_SUPER_MUTANT
|
||||
@@ -2661,7 +2661,7 @@ static HitLocation _ai_called_shot(Object* attacker, Object* defender, HitMode h
|
||||
}
|
||||
|
||||
if (critterGetStat(attacker, STAT_INTELLIGENCE) >= intelligenceRequired) {
|
||||
hitLocation = static_cast<HitLocation>(randomBetween(HIT_LOCATION_HEAD, HIT_LOCATION_SPECIFIC_COUNT));
|
||||
hitLocation = static_cast<HitLocation>(randomBetween(HIT_LOCATION_FIRST, HIT_LOCATION_SPECIFIC_COUNT));
|
||||
int chanceToHit = _determine_to_hit(attacker, defender, hitLocation, hitMode);
|
||||
if (chanceToHit < ai->min_to_hit) {
|
||||
hitLocation = HIT_LOCATION_TORSO;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "db.h"
|
||||
#include "obj_types.h"
|
||||
#include "sfall_script_hooks.h"
|
||||
#include "skill_defs.h"
|
||||
|
||||
namespace fallout {
|
||||
|
||||
|
||||
+31
-6
@@ -2,16 +2,38 @@
|
||||
#define COMBAT_DEFS_H
|
||||
|
||||
#include "obj_types.h"
|
||||
#include "stat_defs.h"
|
||||
|
||||
#define EXPLOSION_TARGET_COUNT (6)
|
||||
|
||||
#define CRTICIAL_EFFECT_COUNT (6)
|
||||
|
||||
#define WEAPON_CRITICAL_FAILURE_TYPE_COUNT (7)
|
||||
#define WEAPON_CRITICAL_FAILURE_EFFECT_COUNT (5)
|
||||
|
||||
namespace fallout {
|
||||
|
||||
enum CriticalEffect : int {
|
||||
CRITICAL_EFFECT_1 = 0,
|
||||
CRITICAL_EFFECT_2 = 1,
|
||||
CRITICAL_EFFECT_3 = 2,
|
||||
CRITICAL_EFFECT_4 = 3,
|
||||
CRITICAL_EFFECT_5 = 4,
|
||||
CRITICAL_EFFECT_6 = 5,
|
||||
CRITICAL_EFFECT_COUNT = 6,
|
||||
CRITICAL_EFFECT_FIRST = CRITICAL_EFFECT_1
|
||||
};
|
||||
|
||||
inline CriticalEffect operator++(CriticalEffect& e, int)
|
||||
{
|
||||
CriticalEffect result = e;
|
||||
e = static_cast<CriticalEffect>(static_cast<int>(e) + 1);
|
||||
return result;
|
||||
}
|
||||
|
||||
inline static bool criticalEffectIsValid(int effect)
|
||||
{
|
||||
return effect >= CRITICAL_EFFECT_FIRST && effect < CRITICAL_EFFECT_COUNT;
|
||||
}
|
||||
|
||||
enum CombatState : unsigned int {
|
||||
COMBAT_STATE_OUT_COMBAT = 0x00,
|
||||
COMBAT_STATE_IN_COMBAT = 0x01,
|
||||
@@ -95,11 +117,12 @@ enum HitMode : int {
|
||||
LAST_ADVANCED_KICK_HIT_MODE = HIT_MODE_PIERCING_KICK,
|
||||
FIRST_ADVANCED_UNARMED_HIT_MODE = FIRST_ADVANCED_PUNCH_HIT_MODE,
|
||||
LAST_ADVANCED_UNARMED_HIT_MODE = LAST_ADVANCED_KICK_HIT_MODE,
|
||||
HIT_MODE_FIRST = HIT_MODE_LEFT_WEAPON_PRIMARY,
|
||||
};
|
||||
|
||||
inline static bool hitModeIsValid(int hitMode)
|
||||
{
|
||||
return hitMode >= HIT_MODE_LEFT_WEAPON_PRIMARY && hitMode < HIT_MODE_COUNT;
|
||||
return hitMode >= HIT_MODE_FIRST && hitMode < HIT_MODE_COUNT;
|
||||
}
|
||||
|
||||
inline HitMode operator++(HitMode& e, int)
|
||||
@@ -121,11 +144,12 @@ enum HitLocation : int {
|
||||
HIT_LOCATION_UNCALLED = 8,
|
||||
HIT_LOCATION_COUNT = 9,
|
||||
HIT_LOCATION_SPECIFIC_COUNT = HIT_LOCATION_COUNT - 1,
|
||||
HIT_LOCATION_FIRST = HIT_LOCATION_HEAD,
|
||||
};
|
||||
|
||||
inline static bool hitLocationIsValid(int hitLocation)
|
||||
{
|
||||
return hitLocation >= HIT_LOCATION_HEAD && hitLocation < HIT_LOCATION_COUNT;
|
||||
return hitLocation >= HIT_LOCATION_FIRST && hitLocation < HIT_LOCATION_COUNT;
|
||||
}
|
||||
|
||||
inline HitLocation operator++(HitLocation& e, int)
|
||||
@@ -181,11 +205,12 @@ enum CriticalHitDataMember : int {
|
||||
CRIT_DATA_MEMBER_MESSAGE_ID = 5,
|
||||
CRIT_DATA_MEMBER_MASSIVE_CRITICAL_MESSAGE_ID = 6,
|
||||
CRIT_DATA_MEMBER_COUNT = 7,
|
||||
CRIT_DATA_MEMBER_FIRST = CRIT_DATA_MEMBER_DAMAGE_MULTIPLIER,
|
||||
};
|
||||
|
||||
inline static bool criticalHitDataMemberIsValid(int criticalHitDataMember)
|
||||
{
|
||||
return criticalHitDataMember >= CRIT_DATA_MEMBER_DAMAGE_MULTIPLIER && criticalHitDataMember < CRIT_DATA_MEMBER_COUNT;
|
||||
return criticalHitDataMember >= CRIT_DATA_MEMBER_FIRST && criticalHitDataMember < CRIT_DATA_MEMBER_COUNT;
|
||||
}
|
||||
|
||||
inline CriticalHitDataMember operator++(CriticalHitDataMember& e, int)
|
||||
@@ -205,7 +230,7 @@ typedef union CriticalHitDescription {
|
||||
|
||||
// Stat to check to upgrade this critical hit to massive critical hit or
|
||||
// -1 if there is no massive critical hit.
|
||||
int massiveCriticalStat;
|
||||
Stat massiveCriticalStat;
|
||||
|
||||
// Bonus/penalty to massive critical stat.
|
||||
int massiveCriticalStatModifier;
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace fallout {
|
||||
#define CONTENT_CONFIG_START_SECTION "start"
|
||||
#define CONTENT_CONFIG_KARMA_SECTION "karma"
|
||||
#define CONTENT_CONFIG_ITEMS_SECTION "items"
|
||||
#define CONTENT_CONFIG_MAPS_SECTION "maps"
|
||||
#define CONTENT_CONFIG_DIALOG_SECTION "dialog"
|
||||
#define CONTENT_CONFIG_MAIN_MENU_SECTION "main_menu"
|
||||
#define CONTENT_CONFIG_MOVIES_SECTION "movies"
|
||||
|
||||
+36
-44
@@ -80,7 +80,7 @@ static int _critterClearObjDrugs(Object* obj, void* data);
|
||||
static char _aCorpse[] = "corpse";
|
||||
|
||||
// 0x501494
|
||||
static char byte_501494[] = "";
|
||||
static char empty[] = "";
|
||||
|
||||
// 0x51833C name_critter
|
||||
static char* _name_critter = _aCorpse;
|
||||
@@ -107,7 +107,7 @@ static const int gRadiationEnduranceModifiers[RADIATION_LEVEL_COUNT] = {
|
||||
// [RADIATION_EFFECT_PRIMARY_STAT_COUNT] for more info.
|
||||
//
|
||||
// 0x518358 rad_stat
|
||||
static const int gRadiationEffectStats[RADIATION_EFFECT_COUNT] = {
|
||||
static const Stat gRadiationEffectStats[RADIATION_EFFECT_COUNT] = {
|
||||
STAT_STRENGTH,
|
||||
STAT_PERCEPTION,
|
||||
STAT_ENDURANCE,
|
||||
@@ -152,7 +152,7 @@ static char gDudeName[DUDE_NAME_MAX_LENGTH];
|
||||
static int _sneak_working;
|
||||
|
||||
// 0x56D780 pc_kill_counts
|
||||
static int gKillsByType[KILL_TYPE_COUNT];
|
||||
static int gKillsByType[KILL_TYPE_DEFAULT_COUNT];
|
||||
|
||||
// Something with radiation.
|
||||
//
|
||||
@@ -679,15 +679,15 @@ int radiationEventWrite(File* stream, void* data)
|
||||
}
|
||||
|
||||
// 0x42D82C critter_get_base_damage_type
|
||||
int critterGetDamageType(Object* obj)
|
||||
DamageType critterGetDamageType(Object* obj)
|
||||
{
|
||||
if (PID_TYPE(obj->pid) != OBJ_TYPE_CRITTER) {
|
||||
return 0;
|
||||
return DAMAGE_TYPE_NORMAL;
|
||||
}
|
||||
|
||||
Proto* proto;
|
||||
if (protoGetProto(obj->pid, &proto) == -1) {
|
||||
return 0;
|
||||
return DAMAGE_TYPE_NORMAL;
|
||||
}
|
||||
|
||||
return proto->critter.data.damageType;
|
||||
@@ -703,9 +703,9 @@ static int critter_kill_count_clear()
|
||||
}
|
||||
|
||||
// 0x42D878 critter_kill_count_inc
|
||||
int killsIncByType(int killType)
|
||||
int killsIncByType(KillType killType)
|
||||
{
|
||||
if (killType != -1 && killType < KILL_TYPE_COUNT) {
|
||||
if (killTypeIsValid(killType)) {
|
||||
gKillsByType[killType]++;
|
||||
return 0;
|
||||
}
|
||||
@@ -714,9 +714,9 @@ int killsIncByType(int killType)
|
||||
}
|
||||
|
||||
// 0x42D8A8 critter_kill_count
|
||||
int killsGetByType(int killType)
|
||||
int killsGetByType(KillType killType)
|
||||
{
|
||||
if (killType != -1 && killType < KILL_TYPE_COUNT) {
|
||||
if (killTypeIsValid(killType)) {
|
||||
return gKillsByType[killType];
|
||||
}
|
||||
|
||||
@@ -726,7 +726,7 @@ int killsGetByType(int killType)
|
||||
// 0x42D8C0 critter_kill_count_load
|
||||
int killsLoad(File* stream)
|
||||
{
|
||||
if (fileReadInt32List(stream, gKillsByType, KILL_TYPE_COUNT) == -1) {
|
||||
if (fileReadInt32List(stream, gKillsByType, KILL_TYPE_DEFAULT_COUNT) == -1) {
|
||||
fileClose(stream);
|
||||
return -1;
|
||||
}
|
||||
@@ -737,7 +737,7 @@ int killsLoad(File* stream)
|
||||
// 0x42D8F0 critter_kill_count_save
|
||||
int killsSave(File* stream)
|
||||
{
|
||||
if (fileWriteInt32List(stream, gKillsByType, KILL_TYPE_COUNT) == -1) {
|
||||
if (fileWriteInt32List(stream, gKillsByType, KILL_TYPE_DEFAULT_COUNT) == -1) {
|
||||
fileClose(stream);
|
||||
return -1;
|
||||
}
|
||||
@@ -746,7 +746,7 @@ int killsSave(File* stream)
|
||||
}
|
||||
|
||||
// 0x42D920 critter_kill_count_type
|
||||
int critterGetKillType(Object* obj)
|
||||
KillType critterGetKillType(Object* obj)
|
||||
{
|
||||
if (obj == gDude) {
|
||||
int gender = critterGetStat(obj, STAT_GENDER);
|
||||
@@ -757,7 +757,7 @@ int critterGetKillType(Object* obj)
|
||||
}
|
||||
|
||||
if (PID_TYPE(obj->pid) != OBJ_TYPE_CRITTER) {
|
||||
return -1;
|
||||
return KILL_TYPE_INVALID;
|
||||
}
|
||||
|
||||
Proto* proto;
|
||||
@@ -767,33 +767,25 @@ int critterGetKillType(Object* obj)
|
||||
}
|
||||
|
||||
// 0x42D974 critter_kill_name
|
||||
char* killTypeGetName(int killType)
|
||||
char* killTypeGetName(KillType killType)
|
||||
{
|
||||
if (killType != -1 && killType < KILL_TYPE_COUNT) {
|
||||
if (killType >= 0 && killType < KILL_TYPE_COUNT) {
|
||||
MessageListItem messageListItem;
|
||||
return getmsg(&gProtoMessageList, &messageListItem, 1450 + killType);
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
} else {
|
||||
return byte_501494;
|
||||
if (killTypeIsValid(killType)) {
|
||||
MessageListItem messageListItem;
|
||||
return getmsg(&gProtoMessageList, &messageListItem, 1450 + killType);
|
||||
}
|
||||
|
||||
return empty;
|
||||
}
|
||||
|
||||
// 0x42D9B4 critter_kill_info
|
||||
char* killTypeGetDescription(int killType)
|
||||
char* killTypeGetDescription(KillType killType)
|
||||
{
|
||||
if (killType != -1 && killType < KILL_TYPE_COUNT) {
|
||||
if (killType >= 0 && killType < KILL_TYPE_COUNT) {
|
||||
MessageListItem messageListItem;
|
||||
return getmsg(&gProtoMessageList, &messageListItem, 1469 + killType);
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
} else {
|
||||
return byte_501494;
|
||||
if (killTypeIsValid(killType)) {
|
||||
MessageListItem messageListItem;
|
||||
return getmsg(&gProtoMessageList, &messageListItem, 1469 + killType);
|
||||
}
|
||||
|
||||
return empty;
|
||||
}
|
||||
|
||||
// 0x42D9F4 critter_heal_hours
|
||||
@@ -1008,15 +1000,15 @@ bool critterIsProne(Object* critter)
|
||||
|
||||
// critter_body_type
|
||||
// 0x42DDC4 critter_body_type
|
||||
int critterGetBodyType(Object* critter)
|
||||
BodyType critterGetBodyType(Object* critter)
|
||||
{
|
||||
if (critter == nullptr) {
|
||||
debugPrint("\nError: critter_body_type: pobj was NULL!");
|
||||
return 0;
|
||||
return BODY_TYPE_BIPED;
|
||||
}
|
||||
|
||||
if (PID_TYPE(critter->pid) != OBJ_TYPE_CRITTER) {
|
||||
return 0;
|
||||
return BODY_TYPE_BIPED;
|
||||
}
|
||||
|
||||
Proto* proto;
|
||||
@@ -1091,9 +1083,9 @@ int gcdLoad(const char* path)
|
||||
}
|
||||
|
||||
proto->critter.data.baseStats[STAT_DAMAGE_RESISTANCE_EMP] = 100;
|
||||
proto->critter.data.bodyType = 0;
|
||||
proto->critter.data.bodyType = BODY_TYPE_BIPED;
|
||||
proto->critter.data.experience = 0;
|
||||
proto->critter.data.killType = 0;
|
||||
proto->critter.data.killType = KILL_TYPE_MAN;
|
||||
|
||||
fileClose(stream);
|
||||
return 0;
|
||||
@@ -1105,10 +1097,10 @@ int protoCritterDataRead(File* stream, CritterProtoData* critterData)
|
||||
if (fileReadInt32(stream, &(critterData->flags)) == -1) return -1;
|
||||
if (fileReadInt32List(stream, critterData->baseStats, SAVEABLE_STAT_COUNT) == -1) return -1;
|
||||
if (fileReadInt32List(stream, critterData->bonusStats, SAVEABLE_STAT_COUNT) == -1) return -1;
|
||||
if (fileReadInt32List(stream, critterData->skills, SKILL_COUNT) == -1) return -1;
|
||||
if (fileReadInt32(stream, &(critterData->bodyType)) == -1) return -1;
|
||||
if (fileReadInt32List(stream, reinterpret_cast<int*>(critterData->skills), SKILL_COUNT) == -1) return -1;
|
||||
if (fileReadInt32(stream, reinterpret_cast<int*>(&(critterData->bodyType))) == -1) return -1;
|
||||
if (fileReadInt32(stream, &(critterData->experience)) == -1) return -1;
|
||||
if (fileReadInt32(stream, &(critterData->killType)) == -1) return -1;
|
||||
if (fileReadInt32(stream, reinterpret_cast<int*>(&(critterData->killType))) == -1) return -1;
|
||||
|
||||
// NOTE: For unknown reason damage type is not present in two protos: Sentry
|
||||
// Bot and Weak Brahmin. These two protos are 412 bytes, not 416.
|
||||
@@ -1122,7 +1114,7 @@ int protoCritterDataRead(File* stream, CritterProtoData* critterData)
|
||||
//
|
||||
// Regardless of the reason, damage type is considered optional by original
|
||||
// code as seen at 0x42E01B.
|
||||
if (fileReadInt32(stream, &(critterData->damageType)) == -1) {
|
||||
if (fileReadInt32(stream, reinterpret_cast<int*>(&(critterData->damageType))) == -1) {
|
||||
critterData->damageType = DAMAGE_TYPE_NORMAL;
|
||||
}
|
||||
|
||||
@@ -1172,7 +1164,7 @@ int protoCritterDataWrite(File* stream, CritterProtoData* critterData)
|
||||
if (fileWriteInt32(stream, critterData->flags) == -1) return -1;
|
||||
if (fileWriteInt32List(stream, critterData->baseStats, SAVEABLE_STAT_COUNT) == -1) return -1;
|
||||
if (fileWriteInt32List(stream, critterData->bonusStats, SAVEABLE_STAT_COUNT) == -1) return -1;
|
||||
if (fileWriteInt32List(stream, critterData->skills, SKILL_COUNT) == -1) return -1;
|
||||
if (fileWriteInt32List(stream, reinterpret_cast<int*>(critterData->skills), SKILL_COUNT) == -1) return -1;
|
||||
if (fileWriteInt32(stream, critterData->bodyType) == -1) return -1;
|
||||
if (fileWriteInt32(stream, critterData->experience) == -1) return -1;
|
||||
if (fileWriteInt32(stream, critterData->killType) == -1) return -1;
|
||||
|
||||
+7
-7
@@ -39,14 +39,14 @@ void radiationProcess(Object* obj, int radiationLevel, bool direction);
|
||||
int radiationEventProcess(Object* obj, void* data);
|
||||
int radiationEventRead(File* stream, void** dataPtr);
|
||||
int radiationEventWrite(File* stream, void* data);
|
||||
int critterGetDamageType(Object* critter);
|
||||
int killsIncByType(int killType);
|
||||
int killsGetByType(int killType);
|
||||
DamageType critterGetDamageType(Object* critter);
|
||||
int killsIncByType(KillType killType);
|
||||
int killsGetByType(KillType killType);
|
||||
int killsLoad(File* stream);
|
||||
int killsSave(File* stream);
|
||||
int critterGetKillType(Object* critter);
|
||||
char* killTypeGetName(int killType);
|
||||
char* killTypeGetDescription(int killType);
|
||||
KillType critterGetKillType(Object* critter);
|
||||
char* killTypeGetName(KillType killType);
|
||||
char* killTypeGetDescription(KillType killType);
|
||||
int critterHealByHours(Object* obj, int hours);
|
||||
void critterKill(Object* critter, int anim, bool refreshRect);
|
||||
int critterGetExp(Object* critter);
|
||||
@@ -54,7 +54,7 @@ bool critterIsActive(Object* critter);
|
||||
bool critterIsDead(Object* critter);
|
||||
bool critterIsCrippled(Object* critter);
|
||||
bool critterIsProne(Object* critter);
|
||||
int critterGetBodyType(Object* critter);
|
||||
BodyType critterGetBodyType(Object* critter);
|
||||
// Checks physical/art capability only. Callers that expose weapon usability
|
||||
// decisions must still call scriptHooks_CanUseWeapon with the final result.
|
||||
bool critterCanUseWeapon(Object* critter, Object* weapon, HitMode hitMode);
|
||||
|
||||
@@ -175,11 +175,17 @@ namespace {
|
||||
constexpr SfallMigrationEntry kSfallMigrationEntries[] = {
|
||||
// [start]
|
||||
{ kSfallMisc, "StartingMap", CONTENT_CONFIG_START_SECTION, "map", "" },
|
||||
{ kSfallMisc, "StartXPos", CONTENT_CONFIG_START_SECTION, "worldmap_x", "-1" },
|
||||
{ kSfallMisc, "StartYPos", CONTENT_CONFIG_START_SECTION, "worldmap_y", "-1" },
|
||||
{ kSfallMisc, "ViewXPos", CONTENT_CONFIG_START_SECTION, "worldmap_view_x", "-1" },
|
||||
{ kSfallMisc, "ViewYPos", CONTENT_CONFIG_START_SECTION, "worldmap_view_y", "-1" },
|
||||
{ kSfallMisc, "MaleStartModel", CONTENT_CONFIG_START_SECTION, "model_male", "hmwarr" },
|
||||
{ kSfallMisc, "MaleDefaultModel", CONTENT_CONFIG_START_SECTION, "model_male_default", "hmjmps" },
|
||||
{ kSfallMisc, "FemaleStartModel", CONTENT_CONFIG_START_SECTION, "model_female", "hfprim" },
|
||||
{ kSfallMisc, "FemaleDefaultModel", CONTENT_CONFIG_START_SECTION, "model_female_default", "hfjmps" },
|
||||
{ kSfallMisc, "PipBoyAvailableAtGameStart", CONTENT_CONFIG_START_SECTION, "pipboy", "0" },
|
||||
// [maps]
|
||||
{ kSfallMisc, "DisableSpecialMapIDs", CONTENT_CONFIG_MAPS_SECTION, "disable_special_map_ids", "0" },
|
||||
// [karma]
|
||||
{ kSfallMisc, "KarmaFRMs", CONTENT_CONFIG_KARMA_SECTION, "frms" },
|
||||
{ kSfallMisc, "KarmaPoints", CONTENT_CONFIG_KARMA_SECTION, "points" },
|
||||
|
||||
+6
-1
@@ -3500,6 +3500,11 @@ int gameDialogGetWindow()
|
||||
return windowGetWindow(gGameDialogWindow) != nullptr ? gGameDialogWindow : -1;
|
||||
}
|
||||
|
||||
int gameDialogGetBackgroundWindow()
|
||||
{
|
||||
return windowGetWindow(gGameDialogBackgroundWindow) != nullptr ? gGameDialogBackgroundWindow : -1;
|
||||
}
|
||||
|
||||
// 0x448660 gdialog_barter_cleanup_tables
|
||||
void gameDialogBarterCleanupTables()
|
||||
{
|
||||
@@ -3784,7 +3789,7 @@ void partyMemberControlWindowUpdate()
|
||||
fontDrawText(windowBuffer + windowWidth * 96 + 240, formattedText, 115, windowWidth, COLOR_GREEN);
|
||||
|
||||
// Render best skill.
|
||||
int bestSkill = partyMemberGetBestSkill(gGameDialogSpeaker);
|
||||
Skill bestSkill = partyMemberGetBestSkill(gGameDialogSpeaker);
|
||||
text = skillGetName(bestSkill);
|
||||
snprintf(formattedText, sizeof(formattedText), "%s", text);
|
||||
fontDrawText(windowBuffer + windowWidth * 113 + 240, formattedText, 115, windowWidth, COLOR_GREEN);
|
||||
|
||||
@@ -41,6 +41,7 @@ int gameDialogBarter(int modifier);
|
||||
void gameDialogEndBarter();
|
||||
bool gameDialogIsBarterWindowExpanded();
|
||||
int gameDialogGetWindow();
|
||||
int gameDialogGetBackgroundWindow();
|
||||
|
||||
} // namespace fallout
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user