mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Removed some more unnecessary memset code.
Added note on effect flags to CriticalOverrides.ini.
This commit is contained in:
@@ -14,15 +14,16 @@ Part_0=1 ; Tell sfall that we want to modify the head entries
|
|||||||
|
|
||||||
[c_00_0] ; The entries for the head table of the men critter type.
|
[c_00_0] ; The entries for the head table of the men critter type.
|
||||||
e0_DamageMultiplier=100 ;First level critical
|
e0_DamageMultiplier=100 ;First level critical
|
||||||
e0_EffectFlags=0
|
e0_EffectFlags=0 ; The value of the flags (see DAM_* in Define.h)
|
||||||
|
; For multiple effects, use the sum of the flags (e.g. 2050 = knocked down + bypass armor)
|
||||||
e0_StatCheck=0
|
e0_StatCheck=0
|
||||||
e0_StatMod=0
|
e0_StatMod=0
|
||||||
e0_FailureEffect=0
|
e0_FailureEffect=0
|
||||||
e0_Message=0 ; This is an index into the msg file, not a string
|
e0_Message=0 ; This is an index into the msg file, not a string
|
||||||
e0_FailMessage=0
|
e0_FailMessage=0
|
||||||
e1_... ; Second level critical
|
;e1_... ; Second level critical
|
||||||
... ; And so on up to the hardest hitting level 5 critical
|
;... ; And so on up to the hardest hitting level 5 critical
|
||||||
e5_...
|
;e5_...
|
||||||
|
|
||||||
;You can skip any entries from this section to leave them at their defaults
|
;You can skip any entries from this section to leave them at their defaults
|
||||||
;Any missing entries for critters 19-37 will be replaced by a 0, since they have no default
|
;Any missing entries for critters 19-37 will be replaced by a 0, since they have no default
|
||||||
|
|||||||
+5
-6
@@ -21,20 +21,21 @@
|
|||||||
#include "BarBoxes.h"
|
#include "BarBoxes.h"
|
||||||
#include "FalloutEngine.h"
|
#include "FalloutEngine.h"
|
||||||
|
|
||||||
static const DWORD DisplayBoxesRet1 = 0x4615A8;
|
|
||||||
static const DWORD DisplayBoxesRet2 = 0x4615BE;
|
|
||||||
struct sBox {
|
struct sBox {
|
||||||
DWORD msg;
|
DWORD msg;
|
||||||
DWORD colour;
|
DWORD colour;
|
||||||
void* mem;
|
void* mem;
|
||||||
};
|
};
|
||||||
static sBox boxes[10];
|
|
||||||
static DWORD boxesEnabled[5];
|
static sBox boxes[10] = {0};
|
||||||
|
static DWORD boxesEnabled[5] = {0};
|
||||||
|
|
||||||
static const DWORD bboxMemAddr[] = {
|
static const DWORD bboxMemAddr[] = {
|
||||||
0x461266, 0x4612AC, 0x461374, 0x4613E8, 0x461479, 0x46148C, 0x4616BB,
|
0x461266, 0x4612AC, 0x461374, 0x4613E8, 0x461479, 0x46148C, 0x4616BB,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const DWORD DisplayBoxesRet1 = 0x4615A8;
|
||||||
|
static const DWORD DisplayBoxesRet2 = 0x4615BE;
|
||||||
static void __declspec(naked) DisplayBoxesHook() {
|
static void __declspec(naked) DisplayBoxesHook() {
|
||||||
__asm {
|
__asm {
|
||||||
mov ebx, 0;
|
mov ebx, 0;
|
||||||
@@ -64,8 +65,6 @@ void BarBoxesInit() {
|
|||||||
SafeWrite32(0x4612FE, (DWORD)boxes + 4); //.colour
|
SafeWrite32(0x4612FE, (DWORD)boxes + 4); //.colour
|
||||||
SafeWrite32(0x46133C, (DWORD)boxes + 0); //.msg
|
SafeWrite32(0x46133C, (DWORD)boxes + 0); //.msg
|
||||||
|
|
||||||
memset(boxes, 0, 12 * 10);
|
|
||||||
memset(boxesEnabled, 0, 5 * 4);
|
|
||||||
memcpy(boxes, (void*)0x518FE8, 12 * 5);
|
memcpy(boxes, (void*)0x518FE8, 12 * 5);
|
||||||
|
|
||||||
for (int i = 5; i < 10; i++) {
|
for (int i = 5; i < 10; i++) {
|
||||||
|
|||||||
+5
-5
@@ -90,7 +90,6 @@ void CritLoad() {
|
|||||||
if (mode == 1) {
|
if (mode == 1) {
|
||||||
dlogr("Setting up critical hit table using CriticalOverrides.ini", DL_CRITICALS);
|
dlogr("Setting up critical hit table using CriticalOverrides.ini", DL_CRITICALS);
|
||||||
char section[16];
|
char section[16];
|
||||||
memset(baseCritTable, 0, CritTableSize * sizeof(CritStruct));
|
|
||||||
for (DWORD critter = 0; critter < 20; critter++) {
|
for (DWORD critter = 0; critter < 20; critter++) {
|
||||||
for (DWORD part = 0; part < 9; part++) {
|
for (DWORD part = 0; part < 9; part++) {
|
||||||
for (DWORD crit = 0; crit < 6; crit++) {
|
for (DWORD crit = 0; crit < 6; crit++) {
|
||||||
@@ -113,8 +112,8 @@ void CritLoad() {
|
|||||||
} else {
|
} else {
|
||||||
dlogr("Setting up critical hit table using RP fixes", DL_CRITICALS);
|
dlogr("Setting up critical hit table using RP fixes", DL_CRITICALS);
|
||||||
memcpy(baseCritTable, defaultTable, 6 * 9 * 19 * sizeof(CritStruct));
|
memcpy(baseCritTable, defaultTable, 6 * 9 * 19 * sizeof(CritStruct));
|
||||||
memset(&baseCritTable[6 * 9 * 19], 0, 6 * 9 * 19 * sizeof(CritStruct));
|
//memset(&baseCritTable[6 * 9 * 19], 0, 6 * 9 * 19 * sizeof(CritStruct));
|
||||||
memcpy(&baseCritTable[6 * 9 * 38], (void*)_pc_crit_succ_eff, 6 * 9 * sizeof(CritStruct)); // PC crit table
|
memcpy(&baseCritTable[6 * 9 * 38], (CritStruct*)_pc_crit_succ_eff, 6 * 9 * sizeof(CritStruct)); // PC crit table
|
||||||
|
|
||||||
if (mode == 3) {
|
if (mode == 3) {
|
||||||
char buf[32], buf2[32], buf3[32];
|
char buf[32], buf2[32], buf3[32];
|
||||||
@@ -145,6 +144,7 @@ void CritLoad() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define SetEntry(critter, bodypart, effect, param, value) defaultTable[critter * 9 * 6 + bodypart * 6 + effect].values[param] = value;
|
#define SetEntry(critter, bodypart, effect, param, value) defaultTable[critter * 9 * 6 + bodypart * 6 + effect].values[param] = value;
|
||||||
|
|
||||||
void CritInit() {
|
void CritInit() {
|
||||||
mode = GetPrivateProfileIntA("Misc", "OverrideCriticalTable", 2, ini);
|
mode = GetPrivateProfileIntA("Misc", "OverrideCriticalTable", 2, ini);
|
||||||
if (mode < 0 || mode > 3) mode = 0;
|
if (mode < 0 || mode > 3) mode = 0;
|
||||||
@@ -152,13 +152,13 @@ void CritInit() {
|
|||||||
if (!mode) return;
|
if (!mode) return;
|
||||||
|
|
||||||
dlog("Initializing critical table override.", DL_INIT);
|
dlog("Initializing critical table override.", DL_INIT);
|
||||||
baseCritTable = new CritStruct[CritTableSize];
|
baseCritTable = new CritStruct[CritTableSize]();
|
||||||
critTable = new CritStruct[CritTableSize];
|
critTable = new CritStruct[CritTableSize];
|
||||||
playerCrit = &critTable[6 * 9 * 38];
|
playerCrit = &critTable[6 * 9 * 38];
|
||||||
SafeWrite32(0x423F96, (DWORD)playerCrit);
|
SafeWrite32(0x423F96, (DWORD)playerCrit);
|
||||||
SafeWrite32(0x423FB3, (DWORD)critTable);
|
SafeWrite32(0x423FB3, (DWORD)critTable);
|
||||||
|
|
||||||
if (mode == 2 || mode == 3) {
|
if (mode == 2 || mode == 3) { // bug fixes
|
||||||
CritStruct* defaultTable = (CritStruct*)_crit_succ_eff;
|
CritStruct* defaultTable = (CritStruct*)_crit_succ_eff;
|
||||||
|
|
||||||
SetEntry(2, 4, 1, 4, 0);
|
SetEntry(2, 4, 1, 4, 0);
|
||||||
|
|||||||
+1
-2
@@ -210,8 +210,7 @@ void SkillsInit() {
|
|||||||
SkillInfo *skills = (SkillInfo*)_skill_data;
|
SkillInfo *skills = (SkillInfo*)_skill_data;
|
||||||
|
|
||||||
sprintf(file, ".\\%s", buf);
|
sprintf(file, ".\\%s", buf);
|
||||||
multipliers = new double[7 * SKILL_count];
|
multipliers = new double[7 * SKILL_count]();
|
||||||
memset(multipliers, 0, 7 * SKILL_count * sizeof(double));
|
|
||||||
|
|
||||||
for (int i = 0; i < SKILL_count; i++) {
|
for (int i = 0; i < SKILL_count; i++) {
|
||||||
sprintf(key, "Skill%d", i);
|
sprintf(key, "Skill%d", i);
|
||||||
|
|||||||
Reference in New Issue
Block a user