mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Updated define_extra.h
Added define of OBJ_DATA_SCRIPT_INDEX to define_extra.h. Moved Stats related reset code from ScriptExtender.cpp to Stats.cpp.
This commit is contained in:
@@ -311,10 +311,11 @@
|
|||||||
#define OBJ_DATA_FID (0x20)
|
#define OBJ_DATA_FID (0x20)
|
||||||
#define OBJ_DATA_ELEVATION (0x28)
|
#define OBJ_DATA_ELEVATION (0x28)
|
||||||
#define OBJ_DATA_PID (0x64)
|
#define OBJ_DATA_PID (0x64)
|
||||||
#define OBJ_DATA_CID (0x68) // combat id, used for savegame
|
#define OBJ_DATA_CID (0x68) // combat ID, used for savegame
|
||||||
#define OBJ_DATA_SID (0x78)
|
#define OBJ_DATA_SID (0x78) // script ID
|
||||||
|
#define OBJ_DATA_SCRIPT_INDEX (0x80) // script index number in scripts.lst
|
||||||
// items
|
// items
|
||||||
#define OBJ_DATA_CUR_CHARGES (0x3C)
|
#define OBJ_DATA_CUR_CHARGES (0x3C) // for key items it's the key code
|
||||||
// critters
|
// critters
|
||||||
#define OBJ_DATA_COMBAT_STATE (0x3C) // flags: 1 - combat, 2 - target is out of range, 4 - flee
|
#define OBJ_DATA_COMBAT_STATE (0x3C) // flags: 1 - combat, 2 - target is out of range, 4 - flee
|
||||||
#define OBJ_DATA_CUR_ACTION_POINT (0x40)
|
#define OBJ_DATA_CUR_ACTION_POINT (0x40)
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
#include "ScriptExtender.h"
|
#include "ScriptExtender.h"
|
||||||
#include "Skills.h"
|
#include "Skills.h"
|
||||||
#include "Sound.h"
|
#include "Sound.h"
|
||||||
|
#include "Stats.h"
|
||||||
#include "TalkingHeads.h"
|
#include "TalkingHeads.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "Worldmap.h"
|
#include "Worldmap.h"
|
||||||
@@ -92,10 +93,12 @@ static void _stdcall ResetState(DWORD onLoad) {
|
|||||||
ForceGraphicsRefresh(0); // disable refresh
|
ForceGraphicsRefresh(0); // disable refresh
|
||||||
WipeSounds();
|
WipeSounds();
|
||||||
if (GraphicsMode > 3) GraphicsResetOnGameLoad();
|
if (GraphicsMode > 3) GraphicsResetOnGameLoad();
|
||||||
|
StatsReset();
|
||||||
|
StatsResetMiscValues();
|
||||||
|
PerksReset();
|
||||||
Combat_OnGameLoad();
|
Combat_OnGameLoad();
|
||||||
Skills_OnGameLoad();
|
Skills_OnGameLoad();
|
||||||
InLoop = 0;
|
InLoop = 0;
|
||||||
PerksReset();
|
|
||||||
InventoryReset();
|
InventoryReset();
|
||||||
ClearSavPrototypes();
|
ClearSavPrototypes();
|
||||||
RegAnimCombatCheck(1);
|
RegAnimCombatCheck(1);
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "LoadGameHook.h"
|
#include "LoadGameHook.h"
|
||||||
#include "Logging.h"
|
#include "Logging.h"
|
||||||
#include "Stats.h"
|
|
||||||
#include "ScriptExtender.h"
|
#include "ScriptExtender.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
@@ -1707,18 +1706,6 @@ void ClearGlobalScripts() {
|
|||||||
selfOverrideMap.clear();
|
selfOverrideMap.clear();
|
||||||
globalExportedVars.clear();
|
globalExportedVars.clear();
|
||||||
HookScriptClear();
|
HookScriptClear();
|
||||||
|
|
||||||
// Stat ranges
|
|
||||||
StatsReset();
|
|
||||||
// Reset some settable game values back to the defaults
|
|
||||||
StandardApAcBonus = 4;
|
|
||||||
ExtraApAcBonus = 4;
|
|
||||||
// XP mod set to 100%
|
|
||||||
ExperienceMod = 1.0f;
|
|
||||||
// HP bonus
|
|
||||||
SafeWrite8(0x4AFBC1, 2);
|
|
||||||
// Skill points per level mod
|
|
||||||
SafeWrite8(0x43C27A, 5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RunScriptProcByNum(DWORD sptr, DWORD procNum) {
|
void RunScriptProcByNum(DWORD sptr, DWORD procNum) {
|
||||||
|
|||||||
@@ -214,6 +214,18 @@ void StatsReset() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StatsResetMiscValues() {
|
||||||
|
// Reset some settable game values back to the defaults
|
||||||
|
StandardApAcBonus = 4;
|
||||||
|
ExtraApAcBonus = 4;
|
||||||
|
// XP mod set to 100%
|
||||||
|
ExperienceMod = 1.0f;
|
||||||
|
// HP bonus
|
||||||
|
SafeWrite8(0x4AFBC1, 2);
|
||||||
|
// Skill points per level mod
|
||||||
|
SafeWrite8(0x43C27A, 5);
|
||||||
|
}
|
||||||
|
|
||||||
void StatsInit() {
|
void StatsInit() {
|
||||||
StatsReset();
|
StatsReset();
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
void StatsReset();
|
void StatsReset();
|
||||||
|
void StatsResetMiscValues();
|
||||||
void StatsInit();
|
void StatsInit();
|
||||||
void _stdcall SetPCStatMax(int stat, int i);
|
void _stdcall SetPCStatMax(int stat, int i);
|
||||||
void _stdcall SetPCStatMin(int stat, int i);
|
void _stdcall SetPCStatMin(int stat, int i);
|
||||||
|
|||||||
Reference in New Issue
Block a user