mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Added a function to EngineUtils.cpp
Minor edits to ddraw.ini.
This commit is contained in:
+2
-2
@@ -38,7 +38,7 @@ SpeedMultiInitial=100
|
|||||||
;Set to 6 for DX9 fullscreen windowed (the resolution in f2_res.ini should be set to the same aspect ratio as your desktop resolution)
|
;Set to 6 for DX9 fullscreen windowed (the resolution in f2_res.ini should be set to the same aspect ratio as your desktop resolution)
|
||||||
;A DX9 mode is required for any graphics related script extender functions to work (i.e. fullscreen shaders)
|
;A DX9 mode is required for any graphics related script extender functions to work (i.e. fullscreen shaders)
|
||||||
;Modes 1, 2 and 3 are no longer supported
|
;Modes 1, 2 and 3 are no longer supported
|
||||||
;This option will always be read from the main ini file (i.e. ddraw.ini) when using the hi-res patch by Mash
|
;This option will always be read from the main ddraw.ini file when using the hi-res patch by Mash
|
||||||
Mode=0
|
Mode=0
|
||||||
|
|
||||||
;If using a DX9 mode, this changes the resolution
|
;If using a DX9 mode, this changes the resolution
|
||||||
@@ -797,7 +797,7 @@ DisableSpecialAreas=0
|
|||||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||||
[Debugging]
|
[Debugging]
|
||||||
;Extra sfall configuration settings that can be used by modders
|
;Extra sfall configuration settings that can be used by modders
|
||||||
;This section is not affected by the 'UseCommandLine' option. It will always be read from the main ini file (i.e. ddraw.ini)
|
;This section is not affected by the 'UseCommandLine' option. It will always be read from the main ddraw.ini file
|
||||||
|
|
||||||
;Set to 1 to enable sfall debugging mode
|
;Set to 1 to enable sfall debugging mode
|
||||||
Enable=0
|
Enable=0
|
||||||
|
|||||||
@@ -201,6 +201,21 @@ fo::AttackSubType GetWeaponType(DWORD weaponFlag) {
|
|||||||
return (type < 9) ? weapon_types[type] : fo::AttackSubType::NONE;
|
return (type < 9) ? weapon_types[type] : fo::AttackSubType::NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns the distance a critter can move in combat based on current APs
|
||||||
|
long __fastcall GetCombatMoveDistance(fo::GameObject* critter, long freeMove) {
|
||||||
|
freeMove += critter->critter.movePoints;
|
||||||
|
long flags = critter->critter.damageFlags & (fo::DamageFlag::DAM_CRIP_LEG_LEFT | fo::DamageFlag::DAM_CRIP_LEG_RIGHT);
|
||||||
|
|
||||||
|
// both legs crippled (8 AP per hex)
|
||||||
|
if (flags == (fo::DamageFlag::DAM_CRIP_LEG_LEFT | fo::DamageFlag::DAM_CRIP_LEG_RIGHT)) return (freeMove / 8);
|
||||||
|
|
||||||
|
// not crippled
|
||||||
|
if (flags == 0) return freeMove;
|
||||||
|
|
||||||
|
// one leg crippled (4 AP per hex)
|
||||||
|
return (freeMove / 4);
|
||||||
|
}
|
||||||
|
|
||||||
long ObjIsOpenable(fo::GameObject* object) {
|
long ObjIsOpenable(fo::GameObject* object) {
|
||||||
long result = 0;
|
long result = 0;
|
||||||
if (fo::func::obj_is_openable(object)) {
|
if (fo::func::obj_is_openable(object)) {
|
||||||
|
|||||||
@@ -95,6 +95,9 @@ long GetCurrentAttackMode();
|
|||||||
|
|
||||||
fo::AttackSubType GetWeaponType(DWORD weaponFlag);
|
fo::AttackSubType GetWeaponType(DWORD weaponFlag);
|
||||||
|
|
||||||
|
// Returns the distance a critter can move in combat based on current APs
|
||||||
|
long __fastcall GetCombatMoveDistance(fo::GameObject* critter, long freeMove);
|
||||||
|
|
||||||
long ObjIsOpenable(fo::GameObject* object);
|
long ObjIsOpenable(fo::GameObject* object);
|
||||||
|
|
||||||
bool HeroIsFemale();
|
bool HeroIsFemale();
|
||||||
|
|||||||
@@ -3135,7 +3135,7 @@ static long __fastcall CheckBarterAndBodyType(fo::GameObject* critter) {
|
|||||||
!(proto->critter.critterFlags & fo::CritterFlags::Barter) && proto->critter.bodyType);
|
!(proto->critter.critterFlags & fo::CritterFlags::Barter) && proto->critter.bodyType);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __declspec(naked) item_add_mult_hook_body_type() {
|
static void __declspec(naked) item_add_mult_hook() {
|
||||||
__asm {
|
__asm {
|
||||||
push edx;
|
push edx;
|
||||||
push ecx;
|
push ecx;
|
||||||
@@ -4004,7 +4004,7 @@ void BugFixes::init()
|
|||||||
SafeWrite8(0x4B039F, 20); // text_object_create_ (was 19)
|
SafeWrite8(0x4B039F, 20); // text_object_create_ (was 19)
|
||||||
|
|
||||||
// Fix for being unable to plant items on non-biped critters with the "Barter" flag set (e.g. Skynet and Goris)
|
// Fix for being unable to plant items on non-biped critters with the "Barter" flag set (e.g. Skynet and Goris)
|
||||||
HookCall(0x477183, item_add_mult_hook_body_type);
|
HookCall(0x477183, item_add_mult_hook);
|
||||||
|
|
||||||
// Fix for being able to use the "Push" action on members of the player's team in combat when they are knocked down
|
// Fix for being able to use the "Push" action on members of the player's team in combat when they are knocked down
|
||||||
HookCall(0x413718, action_can_be_pushed_hook);
|
HookCall(0x413718, action_can_be_pushed_hook);
|
||||||
|
|||||||
Reference in New Issue
Block a user