mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fcdb5633d4 | ||
|
|
4e2bfd6b08 | ||
|
|
8c0fab1f6b | ||
|
|
05f15f0262 | ||
|
|
147cb50a66 | ||
|
|
0ff6157b42 | ||
|
|
2bbb92420f | ||
|
|
4678f41b5a | ||
|
|
7439ba2634 | ||
|
|
4c047bf8a3 | ||
|
|
694b699f15 | ||
|
|
25b408816a | ||
|
|
b819423d2a | ||
|
|
720f937b4f | ||
|
|
25094253e5 | ||
|
|
bdffc061d3 | ||
|
|
dfe4b6b2e0 | ||
|
|
972d978882 | ||
|
|
e99cca2b87 | ||
|
|
108719ac83 | ||
|
|
6feda61424 | ||
|
|
19c94b8513 | ||
|
|
af7b5cbb6b | ||
|
|
56009e1634 | ||
|
|
7bd3bd4128 | ||
|
|
696be7fac5 | ||
|
|
66dd966d8a | ||
|
|
8ce9ae89eb | ||
|
|
361e961b38 | ||
|
|
f8c1bf1ebb | ||
|
|
748cbb030a | ||
|
|
473fbf81b4 | ||
|
|
225f36808d | ||
|
|
879315b4d0 | ||
|
|
971be61d95 |
+32
-31
@@ -1,5 +1,5 @@
|
||||
;sfall configuration settings
|
||||
;v3.7
|
||||
;v3.7b
|
||||
|
||||
[Main]
|
||||
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
|
||||
@@ -267,6 +267,9 @@ DamageFormula=0
|
||||
;Prevents you from using 0 to escape from dialogue at any time.
|
||||
DialogueFix=1
|
||||
|
||||
;Prevents you from using number keys to enter unvisited areas on a town map
|
||||
TownMapHotkeysFix=1
|
||||
|
||||
;Set to 1 to disable the horrigan encounter
|
||||
DisableHorrigan=0
|
||||
|
||||
@@ -392,6 +395,7 @@ UseScrollingQuestsList=1
|
||||
ExtraSaveSlots=0
|
||||
|
||||
;Set to 1 to speed up the hp/ac counter animations
|
||||
;Set to 2 to update the hp/ac counter instantly when the number is not negative
|
||||
SpeedInterfaceCounterAnims=0
|
||||
|
||||
;These lines allow you to control the karma frm's displayed on the character screen
|
||||
@@ -419,18 +423,12 @@ DisplayBonusDamage=0
|
||||
;Modify the maximum number of animations allowed to run on a map. (Default is 32)
|
||||
AnimationsAtOnceLimit=120
|
||||
|
||||
;Set to 1 to fix issues with the wield_obj_critter script function.
|
||||
WieldObjCritterFix=1
|
||||
|
||||
;Set to 1 to remove the limits that stop the player rolling critical successes/misses in the first few days of game time
|
||||
RemoveCriticalTimelimits=0
|
||||
|
||||
;Set to 1 to enable party members with level 6 protos to reach level 6
|
||||
NPCStage6Fix=0
|
||||
|
||||
;Set to 1 to fix the problem with melee weapon equiped npcs being unable to attack multi-hex critters
|
||||
MultiHexPathingFix=1
|
||||
|
||||
;Change the colour of the font used on the main menu for the Fallout/sfall version number
|
||||
;It's the last byte ('3c' by default,) that picks the colour used. The first byte supplies additional flags
|
||||
;MainMenuFontColour=0x0600003c
|
||||
@@ -482,13 +480,15 @@ QuickPocketsApCostReduction=2
|
||||
;Set to 1 to allow objects seeing through other objects with their ShootThru flag set
|
||||
ObjCanSeeObj_ShootThru_Fix=0
|
||||
|
||||
;These options change the bullet distribution of burst attacks
|
||||
;All the bullets are divided into three groups: central, left and right. These three groups will then travel along three parallel tracks, trying to hit targets on the way
|
||||
;Set the mod to 1 to enable the next four lines
|
||||
;Set to 1 to use the balanced bullet distribution formula for burst attacks
|
||||
ComputeSprayMod=1
|
||||
|
||||
;These options modify the bullet distribution of burst attacks if ComputeSprayMod is 1
|
||||
;All the bullets are divided into three groups: central, left and right
|
||||
;These three groups will then travel along three parallel tracks, trying to hit targets on the way
|
||||
;CenterMult/Div set the ratio of how many bullets go to the central group, and remaining bullets are divided equally to left and right sides
|
||||
;TargetMult/Div set the ratio of how many bullets in the central group will attack the primary target directly
|
||||
;Multipliers are capped at divisor values.
|
||||
ComputeSprayMod=0
|
||||
;Multipliers are capped at divisor values
|
||||
ComputeSpray_CenterMult=1
|
||||
ComputeSpray_CenterDiv=3
|
||||
ComputeSpray_TargetMult=1
|
||||
@@ -524,6 +524,8 @@ CheckWeaponAmmoCost=0
|
||||
CombatPanelAnimDelay=1000
|
||||
;Controls the speed of dialog panel animations (lower - faster; valid range: 0..255)
|
||||
DialogPanelAnimDelay=33
|
||||
;Controls the speed of pipboy alarm clock animations (lower - faster; valid range: 0..127)
|
||||
PipboyTimeAnimDelay=50
|
||||
|
||||
;Allows you to directly control other critters in combat
|
||||
;Set to 0 to disable
|
||||
@@ -536,31 +538,30 @@ ControlCombat=0
|
||||
;Set to 1 to stack empty identical weapons, no matter what type of ammo was loaded before
|
||||
StackEmptyWeapons=0
|
||||
|
||||
;Changes the way weapon reloading works when you drag ammo onto a weapon in the inventory
|
||||
;Set to -1 to disable (vanilla behavior with the 'Move Items' window)
|
||||
;Set to 0 to use all the ammo boxes to reload
|
||||
;Set to 1 or more to reserve the specified amount of ammo boxes and use all the rest to reload
|
||||
;If the amount of ammo boxes in the inventory is less than or equal to the reserve, only one box will be used
|
||||
ReloadReserve=-1
|
||||
|
||||
;Allows 9 options (lines of text) to be displayed correctly in a dialog window
|
||||
DialogOptions9Lines=0
|
||||
DialogOptions9Lines=1
|
||||
|
||||
;Set to 1 to leave the music playing in dialogue with talking heads
|
||||
EnableMusicInDialogue=0
|
||||
|
||||
;Prevents 'Too Many Items' bug from corrupting game saves
|
||||
TooManyItemsBugFix=1
|
||||
;Set to 1 to fix the bug that unable to sell used geiger counters or stealth boys
|
||||
CanSellUsedGeiger=1
|
||||
|
||||
;Set to 1 to fix a minor visual glitch when picking up a solo item from the top of inventory with a stack of multiple items at the bottom
|
||||
;Also fixes the inability to reload weapons by dragging ammo onto weapons in the inventory list
|
||||
InventoryDragIssuesFix=1
|
||||
|
||||
;Set to 1 to add proper checks for NPC's addiction instead of always using global variables
|
||||
;Also fixes Jet Antidote not working on NPCs
|
||||
NPCDrugAddictionFix=1
|
||||
|
||||
;Set to 1 to fix issues with NPC stats being dropped unreasonably if one has mutiple of the same armor in inventory and equips the armor,
|
||||
;And either you order NPC to remove the armor through dialog or one levels up
|
||||
ArmorCorruptsNPCStatsFix=1
|
||||
|
||||
;Set to 1 to fix the bug that NPCs become unresponsive and act like walking containers if you move to another map while they are under 'lost next turn' critical miss effect
|
||||
NPCTurnsIntoContainerFix=1
|
||||
|
||||
;Set to 1 to fix issues with being able to charge the car with using cells on scenary/critters and cells getting consumed even when the car is already fully charged
|
||||
;Set to 1 to fix the issue with being able to charge the car by using cells on other scenary/critters
|
||||
CarChargingFix=1
|
||||
|
||||
;Set to 1 to skip weapon equip/unequip animations when performing various actions
|
||||
InstantWeaponEquip=0
|
||||
|
||||
;To change the carry weight limit, uncomment the next line (Default is 999)
|
||||
;CarryWeightLimit=999
|
||||
|
||||
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
[Debugging]
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,16 @@
|
||||
procedure start;
|
||||
#include ".\HEADERS\dik.h"
|
||||
|
||||
procedure start begin
|
||||
variable event, keyDX;
|
||||
if not init_hook then begin
|
||||
event := get_sfall_arg;
|
||||
keyDX := get_sfall_arg;
|
||||
|
||||
if ((event == 1) and (keyDX == DIK_SEMICOLON)) then begin
|
||||
tap_key(DIK_CAPITAL);
|
||||
tap_key(DIK_A);
|
||||
tap_key(DIK_CAPITAL);
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
"Take All" Hotkey mod for Fallout 2 by NovaRain
|
||||
----------------------------------------
|
||||
|
||||
- makes pressing the semicolon key send an uppercase A after a semicolon.
|
||||
- the uppercase A (shift + A if Caps Lock is off) is the built-in hotkey for the TAKE ALL button on the loot screen.
|
||||
|
||||
To use, copy hs_keypress.int file to your scripts folder.
|
||||
|
||||
This mod is a simple example of how you can use HOOK_KEYPRESS hooks.
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef H_DIK
|
||||
#define H_DIK
|
||||
|
||||
// Listed are keyboard scan code constants (in decimal), taken from dinput.h
|
||||
// Listed are keyboard scan code constants (in decimal), taken from dinput.h
|
||||
|
||||
#define DIK_ESCAPE 1
|
||||
#define DIK_1 2
|
||||
@@ -14,9 +14,9 @@
|
||||
#define DIK_8 9
|
||||
#define DIK_9 10
|
||||
#define DIK_0 11
|
||||
#define DIK_MINUS 12 /* - on main keyboard */
|
||||
#define DIK_MINUS 12 /* - on main keyboard */
|
||||
#define DIK_EQUALS 13
|
||||
#define DIK_BACK 14 /* backspace */
|
||||
#define DIK_BACK 14 /* backspace */
|
||||
#define DIK_TAB 15
|
||||
#define DIK_Q 16
|
||||
#define DIK_W 17
|
||||
@@ -116,20 +116,20 @@
|
||||
#define DIK_RWIN 0xDC /* Right Windows key */
|
||||
#define DIK_APPS 0xDD /* AppMenu key */
|
||||
|
||||
#define DIK_BACKSPACE DIK_BACK /* backspace */
|
||||
#define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */
|
||||
#define DIK_LALT DIK_LMENU /* left Alt */
|
||||
#define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */
|
||||
#define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */
|
||||
#define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */
|
||||
#define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */
|
||||
#define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */
|
||||
#define DIK_RALT DIK_RMENU /* right Alt */
|
||||
#define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */
|
||||
#define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */
|
||||
#define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */
|
||||
#define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */
|
||||
#define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */
|
||||
#define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */
|
||||
#define DIK_BACKSPACE DIK_BACK /* backspace */
|
||||
#define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */
|
||||
#define DIK_LALT DIK_LMENU /* left Alt */
|
||||
#define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */
|
||||
#define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */
|
||||
#define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */
|
||||
#define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */
|
||||
#define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */
|
||||
#define DIK_RALT DIK_RMENU /* right Alt */
|
||||
#define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */
|
||||
#define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */
|
||||
#define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */
|
||||
#define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */
|
||||
#define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */
|
||||
#define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */
|
||||
|
||||
#endif
|
||||
|
||||
@@ -16,32 +16,32 @@
|
||||
#define SKILLDEX (0x4000)
|
||||
|
||||
//Valid arguments to register_hook
|
||||
#define HOOK_TOHIT (0)
|
||||
#define HOOK_AFTERHITROLL (1)
|
||||
#define HOOK_CALCAPCOST (2)
|
||||
#define HOOK_DEATHANIM1 (3)
|
||||
#define HOOK_DEATHANIM2 (4)
|
||||
#define HOOK_COMBATDAMAGE (5)
|
||||
#define HOOK_ONDEATH (6)
|
||||
#define HOOK_FINDTARGET (7)
|
||||
#define HOOK_USEOBJON (8)
|
||||
#define HOOK_REMOVEINVENOBJ (9)
|
||||
#define HOOK_BARTERPRICE (10)
|
||||
#define HOOK_MOVECOST (11)
|
||||
#define HOOK_HEXMOVEBLOCKING (12)
|
||||
#define HOOK_HEXAIBLOCKING (13)
|
||||
#define HOOK_TOHIT (0)
|
||||
#define HOOK_AFTERHITROLL (1)
|
||||
#define HOOK_CALCAPCOST (2)
|
||||
#define HOOK_DEATHANIM1 (3)
|
||||
#define HOOK_DEATHANIM2 (4)
|
||||
#define HOOK_COMBATDAMAGE (5)
|
||||
#define HOOK_ONDEATH (6)
|
||||
#define HOOK_FINDTARGET (7)
|
||||
#define HOOK_USEOBJON (8)
|
||||
#define HOOK_REMOVEINVENOBJ (9)
|
||||
#define HOOK_BARTERPRICE (10)
|
||||
#define HOOK_MOVECOST (11)
|
||||
#define HOOK_HEXMOVEBLOCKING (12)
|
||||
#define HOOK_HEXAIBLOCKING (13)
|
||||
#define HOOK_HEXSHOOTBLOCKING (14)
|
||||
#define HOOK_HEXSIGHTBLOCKING (15)
|
||||
#define HOOK_ITEMDAMAGE (16)
|
||||
#define HOOK_AMMOCOST (17)
|
||||
#define HOOK_USEOBJ (18)
|
||||
#define HOOK_KEYPRESS (19)
|
||||
#define HOOK_MOUSECLICK (20)
|
||||
#define HOOK_USESKILL (21)
|
||||
#define HOOK_STEAL (22)
|
||||
#define HOOK_ITEMDAMAGE (16)
|
||||
#define HOOK_AMMOCOST (17)
|
||||
#define HOOK_USEOBJ (18)
|
||||
#define HOOK_KEYPRESS (19)
|
||||
#define HOOK_MOUSECLICK (20)
|
||||
#define HOOK_USESKILL (21)
|
||||
#define HOOK_STEAL (22)
|
||||
#define HOOK_WITHINPERCEPTION (23)
|
||||
#define HOOK_INVENTORYMOVE (24)
|
||||
#define HOOK_INVENWIELD (25)
|
||||
#define HOOK_INVENWIELD (25)
|
||||
|
||||
//Valid arguments to list_begin
|
||||
#define LIST_CRITTERS (0)
|
||||
|
||||
@@ -390,7 +390,7 @@ What you can do:
|
||||
- add AP costs for all inventory movement including reloading
|
||||
- apply or remove some special scripted effects depending on PC's armor
|
||||
|
||||
int arg1 - Target slot (0 - main backback, 1 - left hand, 2 - right hand, 3 - armor slot, 4 - weapon, when reloading it by dropping ammo)
|
||||
int arg1 - Target slot (0 - main backpack, 1 - left hand, 2 - right hand, 3 - armor slot, 4 - weapon, when reloading it by dropping ammo)
|
||||
Item arg2 - Item being moved
|
||||
Item arg3 - Item being replaced or weapon being reloaded (can be 0)
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
0x81ba - void set_npc_stat_min(int stat, int value)
|
||||
|
||||
0x816b - int input_funcs_available()
|
||||
ox816c - int key_pressed(int dxScancode)
|
||||
0x816c - int key_pressed(int dxScancode)
|
||||
0x8162 - void tap_key(int dxScancode)
|
||||
0x821c - int get_mouse_x()
|
||||
0x821d - int get_mouse_y()
|
||||
@@ -277,7 +277,7 @@ ox816c - int key_pressed(int dxScancode)
|
||||
0x8214 - void set_hero_race(int style)
|
||||
0x8215 - void set_hero_style(int style)
|
||||
|
||||
0x8216 - void set_critter_burst_disable(int critter, int disable)
|
||||
0x8216 - void set_critter_burst_disable(objptr critter, int disable)
|
||||
|
||||
0x8217 - int get_weapon_ammo_pid(objptr weapon)
|
||||
0x8218 - void set_weapon_ammo_pid(objptr weapon, int pid)
|
||||
@@ -349,4 +349,4 @@ ox816c - int key_pressed(int dxScancode)
|
||||
0x826f - int art_exists(int artFID)
|
||||
0x8270 - int obj_is_carrying_obj(ObjectPtr invenObj, ObjectPtr itemObj)
|
||||
|
||||
* These functions require AllowUnsafeScripting to be enabled in ddraw.ini
|
||||
* These functions require AllowUnsafeScripting to be enabled in ddraw.ini
|
||||
|
||||
@@ -48,7 +48,7 @@ set_fake_trait and set_fake_perk can be used to add additional traits and perks
|
||||
|
||||
has_fake_trait and has_fake_perk return the number of levels the player has of the perks/traits with the given name.
|
||||
|
||||
perk_add_mode, set_selectable_perk, set_perkbox_title, hide_real_perks, show_real_perks and clear_selectable_perks control the behaviour of the select a perk box. set_selectable_perk can be used to add additional items by setting the 'active' parameter to 1, and to remove them again by setting it to 0. set_perkbox_title can be used to change the title of the box, or by using "" it will be set back to the default. hide and show_real_perks can be used to prevent the dialog from displaying any of the original 119 perks. perk_add_mode modifies what happens when a fake perk is selected from the perks dialog. It is treated as a set of flags - if bit 1 is set then it is added to the players traits, if bit 2 is set it is added to the players perks, and if bit 3 is set it is removed from the list of selectable perks. The default is 0x2. clear_selectable_perks restores the dialog to it's default state.
|
||||
perk_add_mode, set_selectable_perk, set_perkbox_title, hide_real_perks, show_real_perks and clear_selectable_perks control the behaviour of the select a perk box. set_selectable_perk can be used to add additional items by setting the 'active' parameter to 1, and to remove them again by setting it to 0. set_perkbox_title can be used to change the title of the box, or by using "" it will be set back to the default. hide and show_real_perks can be used to prevent the dialog from displaying any of the original 119 perks. perk_add_mode modifies what happens when a fake perk is selected from the perks dialog. It is treated as a set of flags - if bit 1 is set then it is added to the players traits, if bit 2 is set it is added to the players perks, and if bit 3 is set it is removed from the list of selectable perks. The default is 0x2. clear_selectable_perks restores the dialog to it's default state.
|
||||
|
||||
show_iface_tag, hide_iface_tag and is_iface_tag_active relate to the boxes that appear above the interface such as SNEAK and LEVEL. You can use 3 for LEVEL and 4 for ADDICT, or the range from 5 to 9 for custom boxes. Remember to add your messages to intrface.msg and setup the font colours in ddraw.ini if you're going to use custom boxes.
|
||||
|
||||
@@ -62,7 +62,7 @@ nb_* functions are reserved for the brotherhood tactical training mod, and shoul
|
||||
|
||||
The fs_* functions are used to manipulate a virtual file system. Files saved here should have paths relative to the data folder, and use backslashes as the directory seperator. They will take precedence over files stored in the normal data folder. They will also be saved into save games, so be avoid creating large files. Using fs_copy followed by fs_read_xxx, you can read the contents of existing files.
|
||||
|
||||
get/set_proto_data are used to manipulate the in memory copies of the .pro files fallout makes when they are loaded. The offset refers to the offset in memory from the start of the proto to the element you are reading, and is equal to the file offset minus 12. Changes are not stored on disc, and are not permenent. If you modify the protos, and then fallout subsequently reloads the file your changes will be lost.
|
||||
get/set_proto_data are used to manipulate the in memory copies of the .pro files fallout makes when they are loaded. The offset refers to the offset in memory from the start of the proto to the element you are reading. Changes are not stored on disc, and are not permenent. If you modify the protos, and then fallout subsequently reloads the file your changes will be lost.
|
||||
|
||||
the list_xxx functions can be used to loop over all items on a map. list_begin takes an argument telling sfall what you want to list. (Defined in sfall.h) It returns a list pointer, which you iterate through with list_next. Finally, when you've finished with the list use list_end on it. Not calling list_end will result in a memory leak. Alternatively, use list_as_array to get the whole list at once as a temp array variable, which can be looped over using len_array and which you don't need to remember to free afterwards.
|
||||
|
||||
@@ -81,44 +81,44 @@ get/set_critter_skill_points will get/set the number of additional points a crit
|
||||
------ FUNCTION REFERENCE (incomplete) -------
|
||||
----------------------------------------------
|
||||
|
||||
> int game_loaded()
|
||||
> int game_loaded()
|
||||
- returns 1 the first time it is called after a new game or game load, and 0 any time after. It works on an individual basis for each script, so one script wont interfere with others. It's primary use is for global scripts, so that they know when to call set_global_script_repeat, but it can be called from normal scripts too.
|
||||
|
||||
> void inc_npc_level(string npc)
|
||||
- takes an npc name as an argument. The npc must be in your party. This function ignores player level requirements and the minimum 3 player level delay between npc level gains. It also ignores the random element, regardless of sfall's NPCAutoLevel setting.
|
||||
> void inc_npc_level(string npc)
|
||||
- takes an npc name as an argument. The npc must be in your party. This function ignores player level requirements and the minimum 3 player level delay between npc level gains. It also ignores the random element, regardless of sfall's NPCAutoLevel setting.
|
||||
|
||||
> int get_npc_level(string npc)
|
||||
- also takes the npc name as an argument, and returns the npc's current level. Again, the npc needs to be in your party.
|
||||
|
||||
> int get_ini_setting(string setting)
|
||||
- reads an integer value from an ini file in the fallout directory.
|
||||
- It only takes a single argument; seperate the file name, section and key with a '|' character; e.g. 'myvar:=get_ini_setting("myini.ini|mysec|var1")' If the file or key cannot be found, -1 is returned.
|
||||
- The file name is limited to 16 chars, including the extension.
|
||||
- The section name is limited to 8 characters.
|
||||
> int get_ini_setting(string setting)
|
||||
- reads an integer value from an ini file in the fallout directory.
|
||||
- It only takes a single argument; seperate the file name, section and key with a '|' character; e.g. 'myvar:=get_ini_setting("myini.ini|mysec|var1")' If the file or key cannot be found, -1 is returned.
|
||||
- The file name is limited to 16 chars, including the extension.
|
||||
- The section name is limited to 8 characters.
|
||||
- It can also be used to get sfalls settings, by using ddraw.ini as the file name.
|
||||
|
||||
> string get_ini_string(string setting)
|
||||
- reads a string value from an ini file in the fallout directory.
|
||||
- reads a string value from an ini file in the fallout directory.
|
||||
|
||||
> int get_game_mode()
|
||||
- is a more flexible version of in_world_map. It will return a set of flags indicating which mode the game is currently in.
|
||||
- is a more flexible version of in_world_map. It will return a set of flags indicating which mode the game is currently in.
|
||||
- These flags are the same as those used in the set_shader_mode function.
|
||||
|
||||
> int get_uptime()
|
||||
- is just a wrapper around the windows GetTickCount() function. It's useful for making time fade effects in shaders, since they already have access to the current tick count.
|
||||
|
||||
> boolean in_world_map()
|
||||
- returns 1 if the player is looking at the world map, or 0 at any other time.
|
||||
> boolean in_world_map()
|
||||
- returns 1 if the player is looking at the world map, or 0 at any other time.
|
||||
- Obviously this is only useful in global scripts, since normal scripts will never get the chance to run on the world map.
|
||||
|
||||
> void force_encounter(int map)
|
||||
- can be called either from a global script while traveling on the world map, or from a normal script while on a local map.
|
||||
> void force_encounter(int map)
|
||||
- can be called either from a global script while traveling on the world map, or from a normal script while on a local map.
|
||||
- In either case the encounter occurs shortly after the next time the player moves on the world map.
|
||||
- The player will not get an outdoorsman skill check.
|
||||
|
||||
> void force_encounter_with_flags(int map, int flags)
|
||||
- does the same thing as force_encounter, but allows the specification of some extra options.
|
||||
- Forcing a random encounter on a map that is not normally used for random encounters may cause the player to lose the car, if they have it.
|
||||
- does the same thing as force_encounter, but allows the specification of some extra options.
|
||||
- Forcing a random encounter on a map that is not normally used for random encounters may cause the player to lose the car, if they have it.
|
||||
- In this case use force_encounter_with_flags with the ENCOUNTER_FLAG_NO_CAR flag set.
|
||||
|
||||
> int get_light_level()
|
||||
@@ -130,7 +130,7 @@ get/set_critter_skill_points will get/set the number of additional points a crit
|
||||
- This function works in addition to the WorldMapTimeMod setting in ddraw.ini and the pathfinder perk, rather than overriding it, so calling set_map_time_multi(0.5) when the player has 2 levels of pathfinder would result in time passing at 25% the normal speed on the world map.
|
||||
|
||||
> void remove_script(objptr)
|
||||
- accepts a pointer to an object and will remove the script from that object.
|
||||
- accepts a pointer to an object and will remove the script from that object.
|
||||
|
||||
> void set_script(objptr, int scriptid)
|
||||
- accepts a pointer to an object and scriptID, and applies the given script to an object (scriptID accept the same values as create_object_sid from sfall 3.6)
|
||||
@@ -138,31 +138,31 @@ get/set_critter_skill_points will get/set the number of additional points a crit
|
||||
- if you add 0x80000000 to the sid when calling set_script, map_enter_p_proc will be SKIPPED. The start proc will always be run.
|
||||
|
||||
> int get_script(objptr)
|
||||
- accepts a pointer to an object and returns it's scriptID (line number in scripts.lst), or -1 if the object is unscripted.
|
||||
- accepts a pointer to an object and returns it's scriptID (line number in scripts.lst), or -1 if the object is unscripted.
|
||||
|
||||
> void set_self(int obj)
|
||||
- overrides the scripts self_obj for the next function call.
|
||||
- It is primarily used to allow the calling of functions which take an implicit self_obj parameter (e.g. drop_obj) from global scripts, but it can also be used from normal scripts;
|
||||
> void set_self(int obj)
|
||||
- overrides the scripts self_obj for the next function call.
|
||||
- It is primarily used to allow the calling of functions which take an implicit self_obj parameter (e.g. drop_obj) from global scripts, but it can also be used from normal scripts;
|
||||
- self_obj will revert back to its original value after the next function call.
|
||||
- calling self_obj(0) will also revert self_obj to original value
|
||||
- source_obj, target_obj, and similar functions will not work if preceeded by "set_self"
|
||||
|
||||
> void mod_skill_points_per_level(int x)
|
||||
- accepts a value of between -100 and 100, and modifies the number of skill points the player recieves when they level up.
|
||||
- This is a modification of what would otherwise happen, rather than a replacement.
|
||||
- accepts a value of between -100 and 100, and modifies the number of skill points the player recieves when they level up.
|
||||
- This is a modification of what would otherwise happen, rather than a replacement.
|
||||
- The value is not saved into the save game, so should be reset in the game_loaded section of a script.
|
||||
|
||||
> void seq_perk_freq(int x)
|
||||
- sets the number of levels between each perk.
|
||||
- Setting 0 will reset it back to the default.
|
||||
- This overrides the effects of the skilled trait.
|
||||
- It is not saved into the save game, so needs to be called once per reload.
|
||||
- sets the number of levels between each perk.
|
||||
- Setting 0 will reset it back to the default.
|
||||
- This overrides the effects of the skilled trait.
|
||||
- It is not saved into the save game, so needs to be called once per reload.
|
||||
- Be careful not to let the player obtain a perk when no perks are available to pick, or the game may crash.
|
||||
|
||||
> ObjectPtr get_last_target(objptr)
|
||||
- will return the last critter to be deliberately attacked
|
||||
> ObjectPtr get_last_attacker(objptr)
|
||||
- will return the last critter to deliberately launch an attack against the argument critter.
|
||||
> ObjectPtr get_last_target(objptr)
|
||||
- will return the last critter to be deliberately attacked
|
||||
> ObjectPtr get_last_attacker(objptr)
|
||||
- will return the last critter to deliberately launch an attack against the argument critter.
|
||||
- If a critter has not launched/recieved an attack, it will return 0. This is only stored for the duration of combat, and outside of combat both functions will always return 0.
|
||||
|
||||
> void set_base_pickpocket_mod(int max, int mod)
|
||||
@@ -173,43 +173,43 @@ get/set_critter_skill_points will get/set the number of additional points a crit
|
||||
> void set_critter_pickpocket_mod(CritterPtr, int max, int mod)
|
||||
- the same as above, but applies only to specific critter
|
||||
|
||||
> void reg_anim_combat_check
|
||||
> void reg_anim_combat_check
|
||||
- allows to enable all reg_anim_* functions in combat (including vanilla functions) if set to 0. It is automatically reset at the end of each frame, so you need to call it before "reg_anim_begin" - "reg_anim_end" block.
|
||||
|
||||
|
||||
Some additional reg_anim_* functions were introduced. They all work in the same convention as vanilla functions and use the same underlying code.
|
||||
|
||||
> void reg_anim_destroy(object)
|
||||
Some additional reg_anim_* functions were introduced. They all work in the same convention as vanilla functions and use the same underlying code.
|
||||
|
||||
> void reg_anim_destroy(object)
|
||||
- given object is destroyed at the end of current animation set
|
||||
|
||||
> void reg_anim_animate_and_hide(object, animID, delay)
|
||||
|
||||
> void reg_anim_animate_and_hide(object, animID, delay)
|
||||
- exactly like "reg_anim_animate" but the object will automatically disappear after the last animation frame (but not destroyed)
|
||||
|
||||
> void reg_anim_light(object, light, delay)
|
||||
> void reg_anim_light(object, light, delay)
|
||||
- change light of any object. light argument is a light radius (0-8), but you can use highest 2 bytes to pass light intensity as well (example: 0xFFFF0008 - intensity 65535 and radius 8). If highest 2 bytes are 0, intensity will not be changed. Intensity range is from 0 to 65535 (0xFFFF).
|
||||
|
||||
> void reg_anim_change_fid(object, fid, delay)
|
||||
> void reg_anim_change_fid(object, fid, delay)
|
||||
- should work like art_change_fid_num but in reg_anim sequence
|
||||
|
||||
> void reg_anim_take_out(object, holdFrameID, delay)
|
||||
> void reg_anim_take_out(object, holdFrameID, delay)
|
||||
- plays "take out weapon" animation for given holdFrameID. It is not required to have such weapon in critter's inventory.
|
||||
|
||||
> void reg_anim_turn_towards(object, tile/target, delay)
|
||||
|
||||
> void reg_anim_turn_towards(object, tile/target, delay)
|
||||
- makes object change it's direction to face given tile num or target object.
|
||||
|
||||
> int metarule2_explosions(int arg1, int arg2)
|
||||
was made as a dirty easy hack to allow dynamically change some explosion parameters (ranged attack). All changed parameters are reset to vanilla state automatically after each attack action. Following macros are available in sfall.h:
|
||||
|
||||
> void set_attack_explosion_pattern(x, y)
|
||||
> void set_attack_explosion_pattern(x, y)
|
||||
- currently y is not used and x means: 1 - reduced explosion pattern (3 effects are spawned instead of 7), 0 - full pattern
|
||||
|
||||
> void set_attack_explosion_art(x, y)
|
||||
> void set_attack_explosion_art(x, y)
|
||||
- y not used and x is a misc frame ID (last 3 bytes, without object type) to use for the next explosion.
|
||||
|
||||
> void set_attack_explosion_radius(x)
|
||||
|
||||
> void set_attack_explosion_radius(x)
|
||||
- changes radius at which explosion will hit secondary targets for the next attack (from the experiments it is limited to something around 8 by the engine)
|
||||
|
||||
> void set_attack_is_explosion_fire
|
||||
> void set_attack_is_explosion_fire
|
||||
- if you call this right before using a weapon with fire damage type, it will produce explosion effects (and radius damage) just like "explosion" type, but all targets will still recieve fire damage.
|
||||
|
||||
|
||||
@@ -219,20 +219,20 @@ Some utility/math functions are available:
|
||||
- takes a string and a seperator, searches the string for all instances of the seperator, and returns a temp array filled with the pieces of the string split at each instance. If you give an empty string as the seperator, the string is split into individual characters.
|
||||
- you can use this to search for a substring in a string like this: strlen(get_array(string_split(haystack, needle), 0))
|
||||
|
||||
> string substr(string, start, length)
|
||||
> string substr(string, start, length)
|
||||
- cuts a substring from a string starting at "start" up to "length" characters. If start is negative - it indicates starting position from the end of the string (for example substr("test", -2, 2) will return last 2 charactes: "st"). If length is negative - it means so many characters will be omitted from the end of string (example: substr("test", 0, -2) will return string without last 2 characters: "te")
|
||||
|
||||
> int strlen(char* string)
|
||||
> int strlen(char* string)
|
||||
- returns string length
|
||||
|
||||
> string sprintf(char* format, any value)
|
||||
- formats given value using standart syntax of C printf function (google "printf" for format details). However it is limited to formatting only 1 value.
|
||||
> string sprintf(char* format, any value)
|
||||
- formats given value using standart syntax of C printf function (google "printf" for format details). However it is limited to formatting only 1 value.
|
||||
- can be used to get character by ASCII code ("%c")
|
||||
|
||||
> int typeof(any value)
|
||||
> int typeof(any value)
|
||||
- returns type of the given value: VALTYPE_INT, VALTYPE_FLOAT or VALTYPE_STR.
|
||||
|
||||
> int charcode(char* string)
|
||||
> int charcode(char* string)
|
||||
- returns ASCII code for the first character in given string
|
||||
|
||||
> ^ operator (exponentiation)
|
||||
@@ -276,7 +276,7 @@ Some utility/math functions are available:
|
||||
|
||||
> string message_str_game(int fileId, int messageId)
|
||||
- works exactly the same as message_str, except you get messages from files in "text/english/game" folder
|
||||
- use GAME_MSG_* defines or mstr_* macros from sfall.h to use specific msg file
|
||||
- use GAME_MSG_* defines or mstr_* macros from sfall.h to use specific msg file
|
||||
|
||||
> int sneak_success
|
||||
- returns 1 if last sneak attempt (roll against skill) was successful, 0 otherwise
|
||||
|
||||
+4
-6
@@ -18,8 +18,8 @@
|
||||
|
||||
#include "main.h"
|
||||
#include "AI.h"
|
||||
#include "SafeWrite.h"
|
||||
#include "FalloutEngine.h"
|
||||
#include "SafeWrite.h"
|
||||
|
||||
#include <hash_map>
|
||||
|
||||
@@ -45,8 +45,6 @@ static void _stdcall CombatAttackHook(DWORD source, DWORD target) {
|
||||
targets[source]=target;
|
||||
}
|
||||
|
||||
//static const DWORD _ai_attack=0x42A748;
|
||||
static const DWORD _combat_attack=0x422F3C;
|
||||
static void __declspec(naked) combat_attack_hook() {
|
||||
_asm {
|
||||
pushad;
|
||||
@@ -54,7 +52,7 @@ static void __declspec(naked) combat_attack_hook() {
|
||||
push eax;
|
||||
call CombatAttackHook;
|
||||
popad;
|
||||
jmp _combat_attack;
|
||||
jmp combat_attack_;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +80,7 @@ end:
|
||||
|
||||
static void __declspec(naked) BlockCombatHook2() {
|
||||
__asm {
|
||||
mov eax, dword ptr ds:[0x518F10];
|
||||
mov eax, dword ptr ds:[_intfaceEnabled];
|
||||
test eax, eax;
|
||||
jz end;
|
||||
mov eax, CombatDisabled;
|
||||
@@ -123,4 +121,4 @@ void _stdcall AICombatStart() {
|
||||
void _stdcall AICombatEnd() {
|
||||
targets.clear();
|
||||
sources.clear();
|
||||
}
|
||||
}
|
||||
|
||||
+6
-7
@@ -663,7 +663,6 @@ static void __declspec(naked) DisplayBonusHtHDmg2() {
|
||||
}
|
||||
}
|
||||
|
||||
static const DWORD roll_random=0x4A30C0;
|
||||
static const DWORD UnarmedAttacksFixEnd=0x423A0D;
|
||||
static void __declspec(naked) UnarmedAttacksFix() {
|
||||
__asm {
|
||||
@@ -674,7 +673,7 @@ static void __declspec(naked) UnarmedAttacksFix() {
|
||||
PowKickHPunch:
|
||||
mov edx,0x64;
|
||||
mov eax,0x1;
|
||||
call roll_random;
|
||||
call roll_random_;
|
||||
cmp eax,0x5; // 5% chance of critical hit
|
||||
jle CriticalHit;
|
||||
jmp end;
|
||||
@@ -687,7 +686,7 @@ HKickJabCheck:
|
||||
HKickJab:
|
||||
mov edx,0x64;
|
||||
mov eax,0x1;
|
||||
call roll_random;
|
||||
call roll_random_;
|
||||
cmp eax,0xa; // 10% chance of critical hit
|
||||
jle CriticalHit;
|
||||
jmp end;
|
||||
@@ -696,7 +695,7 @@ Haymaker:
|
||||
jnz PalmStrike;
|
||||
mov edx,0x64;
|
||||
mov eax,0x1;
|
||||
call roll_random;
|
||||
call roll_random_;
|
||||
cmp eax,0xf; // 15% chance of critical hit
|
||||
jle CriticalHit;
|
||||
jmp end;
|
||||
@@ -705,7 +704,7 @@ PalmStrike:
|
||||
jnz PiercingStrike;
|
||||
mov edx,0x64;
|
||||
mov eax,0x1;
|
||||
call roll_random;
|
||||
call roll_random_;
|
||||
cmp eax,0x14; // 20% chance of critical hit
|
||||
jle CriticalHit;
|
||||
jmp end;
|
||||
@@ -714,7 +713,7 @@ PiercingStrike:
|
||||
jnz PiercingKick;
|
||||
mov edx,0x64;
|
||||
mov eax,0x1;
|
||||
call roll_random;
|
||||
call roll_random_;
|
||||
cmp eax,0x28; // 40% chance of critical hit
|
||||
jle CriticalHit;
|
||||
jmp end;
|
||||
@@ -723,7 +722,7 @@ PiercingKick:
|
||||
jnz end;
|
||||
mov edx,0x64;
|
||||
mov eax,0x1;
|
||||
call roll_random;
|
||||
call roll_random_;
|
||||
cmp eax,0x32; // 50% chance of critical hit
|
||||
jg end;
|
||||
CriticalHit:
|
||||
|
||||
+201
-277
File diff suppressed because it is too large
Load Diff
+6
-4
@@ -250,6 +250,7 @@ void LoadArrays(HANDLE h) {
|
||||
if (nextarrayid == 0) nextarrayid++;
|
||||
arrays.insert(array_pair(nextarrayid, arrayVar));
|
||||
savedArrays[arrayVar.key] = nextarrayid++;
|
||||
arrayVar.keyHash.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,7 +409,8 @@ DWORD _stdcall GetArray(DWORD id, DWORD key, DWORD keyType, DWORD* resultType) {
|
||||
return 0;
|
||||
} else {
|
||||
el = key;
|
||||
if (arr.size() <= el) return 0;
|
||||
// check for invalid index
|
||||
if (el < 0 || el >= arr.size()) return 0;
|
||||
}
|
||||
switch(arr.val[el].type) {
|
||||
case DATATYPE_NONE: return 0;
|
||||
@@ -436,9 +438,6 @@ void _stdcall SetArray(DWORD id, DWORD key, DWORD keyType, DWORD val, DWORD valT
|
||||
if (valType == DATATYPE_INT && val == 0 && allowUnset) {
|
||||
// after assigning zero to a key, no need to store it, because "get_array" returns 0 for non-existent keys: try unset
|
||||
if (el >= 0) {
|
||||
// remove key=>value pair from vector
|
||||
arr.clearRange(el, el + 2);
|
||||
arr.val.erase(arr.val.begin() + el, arr.val.begin() + (el + 2));
|
||||
// remove from hashtable
|
||||
arr.keyHash.erase(elIter);
|
||||
// shift all keyHash references
|
||||
@@ -446,6 +445,9 @@ void _stdcall SetArray(DWORD id, DWORD key, DWORD keyType, DWORD val, DWORD valT
|
||||
if (elIter->second >= (DWORD)el)
|
||||
elIter->second -= 2;
|
||||
}
|
||||
// remove key=>value pair from vector
|
||||
arr.clearRange(el, el + 2);
|
||||
arr.val.erase(arr.val.begin() + el, arr.val.begin() + (el + 2));
|
||||
}
|
||||
} else {
|
||||
if (el == -1) {
|
||||
|
||||
+2
-2
@@ -19,10 +19,10 @@
|
||||
#include "main.h"
|
||||
|
||||
#include "BarBoxes.h"
|
||||
#include "FalloutEngine.h"
|
||||
|
||||
static const DWORD DisplayBoxesRet1=0x4615A8;
|
||||
static const DWORD DisplayBoxesRet2=0x4615BE;
|
||||
static const DWORD _add_bar_box=0x4616F0;
|
||||
struct sBox {
|
||||
DWORD msg;
|
||||
DWORD colour;
|
||||
@@ -39,7 +39,7 @@ start:
|
||||
test eax, eax;
|
||||
jz next;
|
||||
lea eax, [ebx+5];
|
||||
call _add_bar_box;
|
||||
call add_bar_box_;
|
||||
add esi, eax;
|
||||
next:
|
||||
inc ebx;
|
||||
|
||||
+169
-116
@@ -4,7 +4,7 @@
|
||||
#include "Define.h"
|
||||
#include "FalloutEngine.h"
|
||||
|
||||
//DWORD WeightOnBody = 0;
|
||||
DWORD WeightOnBody = 0;
|
||||
|
||||
static void __declspec(naked) SharpShooterFix() {
|
||||
__asm {
|
||||
@@ -22,7 +22,6 @@ end:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void __declspec(naked) pipboy_hack() {
|
||||
__asm {
|
||||
cmp ebx, 0x210 // Back button?
|
||||
@@ -181,7 +180,8 @@ itsJet:
|
||||
mov eax, 0x47A3FB
|
||||
jmp eax
|
||||
}
|
||||
}*/
|
||||
}
|
||||
*/
|
||||
|
||||
static void __declspec(naked) item_d_load_hack() {
|
||||
__asm {
|
||||
@@ -293,7 +293,7 @@ end:
|
||||
static void __declspec(naked) gdProcessUpdate_hack() {
|
||||
__asm {
|
||||
add eax, esi
|
||||
cmp eax, dword ptr ds:[0x58ECCC] // _optionRect.offy
|
||||
cmp eax, dword ptr ds:[_optionRect + 0xC] // _optionRect.offy
|
||||
jge skip
|
||||
add eax, 2
|
||||
mov esi, 0x44702D
|
||||
@@ -304,8 +304,6 @@ skip:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void __declspec(naked) invenWieldFunc_item_get_type_hook() {
|
||||
__asm {
|
||||
pushad
|
||||
@@ -341,9 +339,7 @@ noWeapon:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
static void __declspec(naked) loot_container_hook() {
|
||||
static void __declspec(naked) loot_container_hack() {
|
||||
__asm {
|
||||
mov eax, [esp+0x114+0x4]
|
||||
test eax, eax
|
||||
@@ -369,10 +365,8 @@ noArmor:
|
||||
retn
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
static void __declspec(naked) barter_inventory_hook() {
|
||||
static void __declspec(naked) barter_inventory_hack() {
|
||||
__asm {
|
||||
mov eax, [esp+0x20+0x4]
|
||||
test eax, eax
|
||||
@@ -396,9 +390,6 @@ end:
|
||||
retn
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
static void __declspec(naked) barter_attempt_transaction_hook() {
|
||||
__asm {
|
||||
@@ -428,7 +419,6 @@ end:
|
||||
retn
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
static void __declspec(naked) inven_pickup_hack() {
|
||||
__asm {
|
||||
@@ -442,61 +432,58 @@ static void __declspec(naked) inven_pickup_hack() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static DWORD inven_pickup_loop=-1;
|
||||
static const DWORD inven_pickup_hook1_Loop = 0x471145;
|
||||
static void __declspec(naked) inven_pickup_hack2() {
|
||||
__asm {
|
||||
cmp inven_pickup_loop, -1
|
||||
jne inLoop
|
||||
test eax, eax
|
||||
jnz startLoop
|
||||
mov eax, 0x47125C
|
||||
jmp eax
|
||||
startLoop:
|
||||
jz end
|
||||
mov eax, ds:[_i_wid]
|
||||
call GNW_find_
|
||||
mov ecx, [eax+0x8+0x4] // ecx = _i_wid.rect.y
|
||||
mov eax, [eax+0x8+0x0] // eax = _i_wid.rect.x
|
||||
add eax, 44 // x_start
|
||||
mov ebx, 64
|
||||
add ebx, eax // x_end
|
||||
xor edx, edx
|
||||
mov inven_pickup_loop, edx
|
||||
nextLoop:
|
||||
mov eax, 124 // x_start
|
||||
mov ebx, 188 // x_end
|
||||
add edx, 35 // y_start
|
||||
next:
|
||||
push eax
|
||||
push edx
|
||||
push ecx
|
||||
push ebx
|
||||
imul edx, edx, 48
|
||||
add edx, 35
|
||||
add edx, ecx // y_start
|
||||
mov ecx, edx
|
||||
add ecx, 48 // y_end
|
||||
jmp inven_pickup_hook1_Loop
|
||||
inLoop:
|
||||
call mouse_click_in_
|
||||
pop ebx
|
||||
pop ecx
|
||||
pop edx
|
||||
test eax, eax
|
||||
mov eax, inven_pickup_loop
|
||||
jnz foundRect
|
||||
inc eax
|
||||
mov inven_pickup_loop, eax
|
||||
imul edx, eax, 48
|
||||
jmp nextLoop
|
||||
foundRect:
|
||||
mov inven_pickup_loop, -1
|
||||
mov edx, [esp+0x40] // inventory_offset
|
||||
add edx, eax
|
||||
mov eax, ds:[_pud]
|
||||
push eax
|
||||
mov eax, [eax] // itemsCount
|
||||
test eax, eax
|
||||
jz skip
|
||||
dec eax
|
||||
cmp edx, eax
|
||||
jle inRange
|
||||
skip:
|
||||
pop eax
|
||||
jnz found
|
||||
inc edx
|
||||
cmp edx, 6
|
||||
jb next
|
||||
end:
|
||||
mov eax, 0x47125C
|
||||
jmp eax
|
||||
found:
|
||||
mov ebx, 0x4711DF
|
||||
add edx, [esp+0x40] // inventory_offset
|
||||
mov eax, ds:[_pud]
|
||||
mov ecx, [eax] // itemsCount
|
||||
jecxz skip
|
||||
dec ecx
|
||||
cmp edx, ecx
|
||||
ja skip
|
||||
sub ecx, edx
|
||||
mov edx, ecx
|
||||
mov ebx, 0x471181
|
||||
skip:
|
||||
jmp ebx
|
||||
inRange:
|
||||
xchg edx, eax
|
||||
sub edx, eax
|
||||
pop eax
|
||||
mov ecx, 0x471181
|
||||
jmp ecx
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
static void __declspec(naked) drop_ammo_into_weapon_hook() {
|
||||
__asm {
|
||||
dec esi
|
||||
@@ -536,7 +523,6 @@ end:
|
||||
retn
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
static void __declspec(naked) PipStatus_AddHotLines_hook() {
|
||||
__asm {
|
||||
@@ -573,6 +559,19 @@ static void __declspec(naked) op_wield_obj_critter_adjust_ac_hook() {
|
||||
}
|
||||
}
|
||||
|
||||
// Haenlomal
|
||||
static void __declspec(naked) MultiHexFix() {
|
||||
__asm {
|
||||
xor ecx, ecx; // argument value for make_path_func: ecx=0 (unknown arg)
|
||||
test byte ptr ds:[ebx+0x25], 0x08; // is target multihex?
|
||||
mov ebx, dword ptr ds:[ebx+0x4]; // argument value for make_path_func: target's tilenum (end_tile)
|
||||
je end; // skip if not multihex
|
||||
inc ebx; // otherwise, increase tilenum by 1
|
||||
end:
|
||||
retn; // call make_path_func (at 0x429024, 0x429175)
|
||||
}
|
||||
}
|
||||
|
||||
//checks if an attacked object is a critter before attempting dodge animation
|
||||
static void __declspec(naked) action_melee_hack() {
|
||||
__asm {
|
||||
@@ -583,7 +582,7 @@ static void __declspec(naked) action_melee_hack() {
|
||||
cmp ebx, OBJ_TYPE_CRITTER // check if object FID type flag is set to critter
|
||||
jne end // if object not a critter leave jump condition flags
|
||||
// set to skip dodge animation
|
||||
test byte ptr [eax+0x44], 3 // (original code) DAM_KNOCKED_OUT or DAM_KNOCKED_DOWN
|
||||
test byte ptr [eax+0x44], 0x3 // (original code) DAM_KNOCKED_OUT or DAM_KNOCKED_DOWN
|
||||
jnz end
|
||||
mov edx, 0x4113FE
|
||||
end:
|
||||
@@ -600,7 +599,7 @@ static void __declspec(naked) action_ranged_hack() {
|
||||
cmp ebx, OBJ_TYPE_CRITTER // check if object FID type flag is set to critter
|
||||
jne end // if object not a critter leave jump condition flags
|
||||
// set to skip dodge animation
|
||||
test byte ptr [eax+0x44], 3 // (original code) DAM_KNOCKED_OUT or DAM_KNOCKED_DOWN
|
||||
test byte ptr [eax+0x44], 0x3 // (original code) DAM_KNOCKED_OUT or DAM_KNOCKED_DOWN
|
||||
jnz end
|
||||
mov edx, 0x411BD2
|
||||
end:
|
||||
@@ -608,7 +607,6 @@ end:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void __declspec(naked) set_new_results_hack() {
|
||||
__asm {
|
||||
test ah, 0x1 // DAM_KNOCKED_OUT?
|
||||
@@ -680,18 +678,42 @@ static void __declspec(naked) partyMemberPrepLoadInstance_hack() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) barter_attempt_transaction_hack() {
|
||||
__asm {
|
||||
cmp dword ptr [eax+0x64], PID_ACTIVE_GEIGER_COUNTER
|
||||
je found
|
||||
cmp dword ptr [eax+0x64], PID_ACTIVE_STEALTH_BOY
|
||||
je found
|
||||
mov eax, 0x474D34
|
||||
jmp eax
|
||||
found:
|
||||
call item_m_turn_off_
|
||||
mov eax, 0x474D17
|
||||
jmp eax // Is there any other activated items among the ones being sold?
|
||||
}
|
||||
}
|
||||
|
||||
static void __declspec(naked) item_m_turn_off_hook() {
|
||||
__asm {
|
||||
and byte ptr [eax+0x25], 0xDF // Rest flag of used items
|
||||
jmp queue_remove_this_
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BugsInit()
|
||||
{
|
||||
dlog("Applying sharpshooter patch.", DL_INIT);
|
||||
// http://www.nma-fallout.com/showthread.php?178390-FO2-Engine-Tweaks&p=4050162&viewfull=1#post4050162
|
||||
// by Slider2k
|
||||
HookCall(0x4244AB, &SharpShooterFix); // hooks stat_level_() call in detemine_to_hit_func_()
|
||||
// // removes this line by making unconditional jump:
|
||||
// if ( who == obj_dude )
|
||||
// dist -= 2 * perk_level_(obj_dude, PERK_sharpshooter);
|
||||
SafeWrite8(0x424527, 0xEB); // in detemine_to_hit_func_()
|
||||
dlogr(" Done", DL_INIT);
|
||||
//if (GetPrivateProfileIntA("Misc", "SharpshooterFix", 1, ini)) {
|
||||
dlog("Applying sharpshooter patch.", DL_INIT);
|
||||
// http://www.nma-fallout.com/showthread.php?178390-FO2-Engine-Tweaks&p=4050162&viewfull=1#post4050162
|
||||
// by Slider2k
|
||||
HookCall(0x4244AB, &SharpShooterFix); // hooks stat_level_() call in detemine_to_hit_func_()
|
||||
// // removes this line by making unconditional jump:
|
||||
// if ( who == obj_dude )
|
||||
// dist -= 2 * perk_level_(obj_dude, PERK_sharpshooter);
|
||||
SafeWrite8(0x424527, 0xEB); // in detemine_to_hit_func_()
|
||||
dlogr(" Done", DL_INIT);
|
||||
//}
|
||||
|
||||
// Fixes for clickability issue in Pip-Boy and exploit that allows to rest in places where you shouldn't be able to rest
|
||||
dlog("Applying fix for Pip-Boy rest exploit.", DL_INIT);
|
||||
@@ -700,19 +722,20 @@ void BugsInit()
|
||||
dlogr(" Done.", DL_INIT);
|
||||
|
||||
// Fix for "Too Many Items" bug
|
||||
if (GetPrivateProfileIntA("Misc", "TooManyItemsBugFix", 1, ini)) {
|
||||
//if (GetPrivateProfileIntA("Misc", "TooManyItemsBugFix", 1, ini)) {
|
||||
dlog("Applying preventive patch for \"Too Many Items\" bug.", DL_INIT);
|
||||
HookCall(0x4A596A, &scr_write_ScriptNode_hook);
|
||||
HookCall(0x4A59C1, &scr_write_ScriptNode_hook);
|
||||
dlogr(" Done.", DL_INIT);
|
||||
}
|
||||
//}
|
||||
|
||||
// Fixes for being able to charge the car with using cells on scenary/critters
|
||||
// and cells getting consumed even when the car is already fully charged
|
||||
// Fix for cells getting consumed even when the car is already fully charged
|
||||
MakeCall(0x49BE70, &obj_use_power_on_car_hack, false);
|
||||
|
||||
// Fix for being able to charge the car by using cells on other scenary/critters
|
||||
if (GetPrivateProfileIntA("Misc", "CarChargingFix", 1, ini)) {
|
||||
dlog("Applying car charging issues fix.", DL_INIT);
|
||||
dlog("Applying car charging fix.", DL_INIT);
|
||||
MakeCall(0x49C36D, &protinst_default_use_item_hack, true);
|
||||
MakeCall(0x49BE70, &obj_use_power_on_car_hack, false);
|
||||
dlogr(" Done.", DL_INIT);
|
||||
}
|
||||
|
||||
@@ -731,21 +754,21 @@ void BugsInit()
|
||||
|
||||
// Evil bug! If party member has the same armor type in inventory as currently equipped, then
|
||||
// on level up he loses Armor Class equal to the one received from this armor.
|
||||
// The same happens if you just order NPC to remove the armor through dialog.
|
||||
if (GetPrivateProfileIntA("Misc", "ArmorCorruptsNPCStatsFix", 1, ini)) {
|
||||
// The same happens if you just order NPC to remove the armor through dialogue.
|
||||
//if (GetPrivateProfileIntA("Misc", "ArmorCorruptsNPCStatsFix", 1, ini)) {
|
||||
dlog("Applying fix for armor reducing NPC original stats when removed.", DL_INIT);
|
||||
HookCall(0x495F3B, &partyMemberCopyLevelInfo_stat_level_hook);
|
||||
HookCall(0x45419B, &correctFidForRemovedItem_adjust_ac_hook);
|
||||
dlogr(" Done.", DL_INIT);
|
||||
}
|
||||
//}
|
||||
|
||||
// Fix of invalid stats when party member gains a level while being on drugs
|
||||
dlog("Applying fix for addicted party member level up bug.", DL_INIT);
|
||||
HookCall(0x495D5C, &partyMemberCopyLevelInfo_hook);
|
||||
dlogr(" Done.", DL_INIT);
|
||||
|
||||
// Allow for 9 options (lines of text) to be displayed correctly in a dialog window
|
||||
if (GetPrivateProfileIntA("Misc", "DialogOptions9Lines", 0, ini)) {
|
||||
// Allow 9 options (lines of text) to be displayed correctly in a dialog window
|
||||
if (GetPrivateProfileIntA("Misc", "DialogOptions9Lines", 1, ini)) {
|
||||
dlog("Applying 9 dialog options patch.", DL_INIT);
|
||||
MakeCall(0x44701C, &gdProcessUpdate_hack, true);
|
||||
dlogr(" Done.", DL_INIT);
|
||||
@@ -761,18 +784,22 @@ void BugsInit()
|
||||
SafeWrite8(0x4AC377, 0x7F); // jg
|
||||
dlogr(" Done.", DL_INIT);
|
||||
|
||||
// Fix for not counting in weight of equipped items
|
||||
/*MakeCall(0x473B4E, &loot_container_hook, false);
|
||||
MakeCall(0x47588A, &barter_inventory_hook, false);
|
||||
HookCall(0x474CB8, &barter_attempt_transaction_hook);
|
||||
HookCall(0x4742AD, &move_inventory_hook);
|
||||
HookCall(0x4771B5, &item_add_mult_hook);*/
|
||||
// Fix for not counting in the weight of equipped items on NPC when stealing or bartering
|
||||
//if (GetPrivateProfileIntA("Misc", "NPCWeightFix", 1, ini)) {
|
||||
dlog("Applying fix for not counting in weight of equipped items on NPC.", DL_INIT);
|
||||
MakeCall(0x473B4E, &loot_container_hack, false);
|
||||
MakeCall(0x47588A, &barter_inventory_hack, false);
|
||||
HookCall(0x474CB8, &barter_attempt_transaction_hook);
|
||||
HookCall(0x4742AD, &move_inventory_hook);
|
||||
HookCall(0x4771B5, &item_add_mult_hook);
|
||||
dlogr(" Done.", DL_INIT);
|
||||
//}
|
||||
|
||||
// Corrects "Weight of items" text element width to be 64 (and not 80), which matches container element width
|
||||
SafeWrite8(0x475541, 64);
|
||||
SafeWrite8(0x475789, 64);
|
||||
|
||||
if (GetPrivateProfileIntA("Misc", "InventoryDragIssuesFix", 1, ini)) {
|
||||
//if (GetPrivateProfileIntA("Misc", "InventoryDragIssuesFix", 1, ini)) {
|
||||
dlog("Applying inventory reverse order issues fix.", DL_INIT);
|
||||
// Fix for minor visual glitch when picking up solo item from the top of inventory
|
||||
// and there is multiple item stack at the bottom of inventory
|
||||
@@ -780,56 +807,82 @@ void BugsInit()
|
||||
// Fix for error in player's inventory, related to IFACE_BAR_MODE=1 in f2_res.ini, and
|
||||
// also for reverse order error
|
||||
MakeCall(0x47114A, &inven_pickup_hack2, true);
|
||||
// Fix for using only one box of ammo when a weapon is above the ammo in the inventory list
|
||||
HookCall(0x476598, &drop_ammo_into_weapon_hook);
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
//}
|
||||
|
||||
// Fix for using only one pack of ammo, when the weapon is before the ammo
|
||||
//HookCall(0x476598, &drop_ammo_into_weapon_hook);
|
||||
//if (GetPrivateProfileIntA("Misc", "BlackSkilldexFix", 1, ini)) {
|
||||
dlog("Applying black skilldex patch.", DL_INIT);
|
||||
HookCall(0x497D0F, &PipStatus_AddHotLines_hook);
|
||||
dlogr(" Done", DL_INIT);
|
||||
//}
|
||||
|
||||
dlog("Applying black skilldex patch.", DL_INIT);
|
||||
HookCall(0x497D0F, &PipStatus_AddHotLines_hook);
|
||||
dlogr(" Done", DL_INIT);
|
||||
//if (GetPrivateProfileIntA("Misc", "FixWithdrawalPerkDescCrash", 1, ini)) {
|
||||
dlog("Applying withdrawal perk description crash fix.", DL_INIT);
|
||||
HookCall(0x47A501, &perform_withdrawal_start_display_print_hook);
|
||||
dlogr(" Done", DL_INIT);
|
||||
//}
|
||||
|
||||
dlog("Applying withdrawal perk description crash fix.", DL_INIT);
|
||||
HookCall(0x47A501, &perform_withdrawal_start_display_print_hook);
|
||||
dlogr(" Done", DL_INIT);
|
||||
//if (GetPrivateProfileIntA("Misc", "JetAntidoteFix", 1, ini)) {
|
||||
dlog("Applying Jet Antidote fix.", DL_INIT);
|
||||
// the original jet antidote fix
|
||||
MakeCall(0x47A013, &item_d_take_drug_hack1, true);
|
||||
dlogr(" Done", DL_INIT);
|
||||
//}
|
||||
|
||||
dlog("Applying Jet Antidote fix.", DL_INIT);
|
||||
// the original jet antidote fix
|
||||
MakeCall(0x47A013, &item_d_take_drug_hack1, true);
|
||||
dlogr(" Done", DL_INIT);
|
||||
|
||||
if (GetPrivateProfileIntA("Misc", "NPCDrugAddictionFix", 1, ini)) {
|
||||
//if (GetPrivateProfileIntA("Misc", "NPCDrugAddictionFix", 1, ini)) {
|
||||
dlog("Applying NPC's drug addiction fix.", DL_INIT);
|
||||
// proper checks for NPC's addiction instead of always using global vars
|
||||
MakeCall(0x47A644, &item_d_check_addict_hack, true);
|
||||
MakeCall(0x479FC5, &item_d_take_drug_hack, true);
|
||||
dlogr(" Done.", DL_INIT);
|
||||
}
|
||||
//}
|
||||
|
||||
dlog("Applying shiv patch.", DL_INIT);
|
||||
SafeWrite8(0x477B2B, 0xEB);
|
||||
dlogr(" Done", DL_INIT);
|
||||
//if (GetPrivateProfileInt("Misc", "ShivPatch", 1, ini)) {
|
||||
dlog("Applying shiv patch.", DL_INIT);
|
||||
SafeWrite8(0x477B2B, 0xEB);
|
||||
dlogr(" Done", DL_INIT);
|
||||
//}
|
||||
|
||||
if (GetPrivateProfileIntA("Misc", "WieldObjCritterFix", 1, ini)) {
|
||||
//if (GetPrivateProfileIntA("Misc", "WieldObjCritterFix", 1, ini)) {
|
||||
dlog("Applying wield_obj_critter fix.", DL_INIT);
|
||||
SafeWrite8(0x456912, 0x1E);
|
||||
HookCall(0x45697F, &op_wield_obj_critter_adjust_ac_hook);
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
//}
|
||||
|
||||
dlog("Applying Dodgy Door Fix.", DL_INIT);
|
||||
MakeCall(0x4113D6, &action_melee_hack, true);
|
||||
MakeCall(0x411BCC, &action_ranged_hack, true);
|
||||
dlogr(" Done", DL_INIT);
|
||||
//if (GetPrivateProfileIntA("Misc", "MultiHexPathingFix", 1, ini)) {
|
||||
dlog("Applying MultiHex Pathing Fix.", DL_INIT);
|
||||
MakeCall(0x42901F, &MultiHexFix, false);
|
||||
MakeCall(0x429170, &MultiHexFix, false);
|
||||
dlogr(" Done", DL_INIT);
|
||||
//}
|
||||
|
||||
// Fix for "NPC turns into a container"
|
||||
if (GetPrivateProfileIntA("Misc", "NPCTurnsIntoContainerFix", 1, ini)) {
|
||||
//if (GetPrivateProfileIntA("Misc", "DodgyDoorsFix", 1, ini)) {
|
||||
dlog("Applying Dodgy Door Fix.", DL_INIT);
|
||||
MakeCall(0x4113D6, &action_melee_hack, true);
|
||||
MakeCall(0x411BCC, &action_ranged_hack, true);
|
||||
dlogr(" Done", DL_INIT);
|
||||
//}
|
||||
|
||||
// Fix for "NPC turns into a container" bug
|
||||
//if (GetPrivateProfileIntA("Misc", "NPCTurnsIntoContainerFix", 1, ini)) {
|
||||
dlog("Applying fix for \"NPC turns into a container\" bug.", DL_INIT);
|
||||
MakeCall(0x424F8E, &set_new_results_hack, false);
|
||||
MakeCall(0x42E46E, &critter_wake_clear_hack, true);
|
||||
MakeCall(0x488EF3, &obj_load_func_hack, true);
|
||||
HookCall(0x4949B2, &partyMemberPrepLoadInstance_hack);
|
||||
dlogr(" Done", DL_INIT);
|
||||
//}
|
||||
|
||||
// Fix for unable to sell used geiger counters or stealth boys
|
||||
if (GetPrivateProfileIntA("Misc", "CanSellUsedGeiger", 1, ini)) {
|
||||
dlog("Applying fix for unable to sell used geiger counters or stealth boys.", DL_INIT);
|
||||
SafeWrite8(0x478115, 0xBA);
|
||||
SafeWrite8(0x478138, 0xBA);
|
||||
MakeCall(0x474D22, &barter_attempt_transaction_hack, true);
|
||||
HookCall(0x4798B1, &item_m_turn_off_hook);
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
}
|
||||
|
||||
+9
-2
@@ -34,6 +34,10 @@ static void __declspec(naked) compute_spray_rounds_distribution() {
|
||||
imul ebx; // multiply eax by ebx and store result in edx:eax
|
||||
mov ebx, compute_spray_center_div; // divisor
|
||||
idiv ebx; // divide edx:eax by ebx and store result in eax (edx)
|
||||
test edx, edx; // if remainder (edx) is not 0
|
||||
jz divEnd1;
|
||||
inc eax; // round up
|
||||
divEnd1:
|
||||
mov [esp+16], eax; // roundsCenter
|
||||
test eax, eax; // if (roundsCenter == 0)
|
||||
jnz loc_42350F;
|
||||
@@ -52,7 +56,10 @@ loc_42350F:
|
||||
imul ebx;
|
||||
mov ebx, compute_spray_target_div;
|
||||
idiv ebx;
|
||||
|
||||
test edx, edx; // if remainder (edx) is not 0
|
||||
jz divEnd2;
|
||||
inc eax; // round up
|
||||
divEnd2:
|
||||
mov ebp, eax;
|
||||
mov ebx, [esp+16];
|
||||
// at this point, eax should contain the same value as ebp (roundsMainTarget); ebx should contain value of roundsCenter
|
||||
@@ -62,7 +69,7 @@ loc_42350F:
|
||||
|
||||
|
||||
void ComputeSprayModInit() {
|
||||
if (GetPrivateProfileIntA("Misc", "ComputeSprayMod", 0, ini)) {
|
||||
if (GetPrivateProfileIntA("Misc", "ComputeSprayMod", 1, ini)) {
|
||||
dlog("Applying ComputeSpray changes.", DL_INIT);
|
||||
compute_spray_center_mult = GetPrivateProfileIntA("Misc", "ComputeSpray_CenterMult", 1, ini);
|
||||
compute_spray_center_div = GetPrivateProfileIntA("Misc", "ComputeSpray_CenterDiv", 3, ini);
|
||||
|
||||
+36
-12
@@ -27,21 +27,45 @@ static const DWORD ExpectedCRC[]= {0xe1680293, 0xef34f989};
|
||||
|
||||
static void inline Fail(const char* a) { MessageBoxA(0, a, "Error", MB_TASKMODAL); ExitProcess(1); }
|
||||
|
||||
static DWORD crcInternal(BYTE* data, DWORD size) {
|
||||
DWORD table[256];
|
||||
const DWORD kPoly = 0x1EDC6F41;
|
||||
for (DWORD i = 0;i < 256;i++) {
|
||||
DWORD r = i;
|
||||
for (int j = 0;j < 8;j++) {
|
||||
if ((r & 1) != 0) r = (r >> 1) ^ kPoly;
|
||||
else r >>= 1;
|
||||
}
|
||||
table[i] = r;
|
||||
}
|
||||
static const DWORD CRC_table[256] = {
|
||||
0x00000000, 0x0A5F4D75, 0x14BE9AEA, 0x1EE1D79F, 0x14C5EB57, 0x1E9AA622, 0x007B71BD, 0x0A243CC8,
|
||||
0x1433082D, 0x1E6C4558, 0x008D92C7, 0x0AD2DFB2, 0x00F6E37A, 0x0AA9AE0F, 0x14487990, 0x1E1734E5,
|
||||
0x15DECED9, 0x1F8183AC, 0x01605433, 0x0B3F1946, 0x011B258E, 0x0B4468FB, 0x15A5BF64, 0x1FFAF211,
|
||||
0x01EDC6F4, 0x0BB28B81, 0x15535C1E, 0x1F0C116B, 0x15282DA3, 0x1F7760D6, 0x0196B749, 0x0BC9FA3C,
|
||||
0x16054331, 0x1C5A0E44, 0x02BBD9DB, 0x08E494AE, 0x02C0A866, 0x089FE513, 0x167E328C, 0x1C217FF9,
|
||||
0x02364B1C, 0x08690669, 0x1688D1F6, 0x1CD79C83, 0x16F3A04B, 0x1CACED3E, 0x024D3AA1, 0x081277D4,
|
||||
0x03DB8DE8, 0x0984C09D, 0x17651702, 0x1D3A5A77, 0x171E66BF, 0x1D412BCA, 0x03A0FC55, 0x09FFB120,
|
||||
0x17E885C5, 0x1DB7C8B0, 0x03561F2F, 0x0909525A, 0x032D6E92, 0x097223E7, 0x1793F478, 0x1DCCB90D,
|
||||
0x11B258E1, 0x1BED1594, 0x050CC20B, 0x0F538F7E, 0x0577B3B6, 0x0F28FEC3, 0x11C9295C, 0x1B966429,
|
||||
0x058150CC, 0x0FDE1DB9, 0x113FCA26, 0x1B608753, 0x1144BB9B, 0x1B1BF6EE, 0x05FA2171, 0x0FA56C04,
|
||||
0x046C9638, 0x0E33DB4D, 0x10D20CD2, 0x1A8D41A7, 0x10A97D6F, 0x1AF6301A, 0x0417E785, 0x0E48AAF0,
|
||||
0x105F9E15, 0x1A00D360, 0x04E104FF, 0x0EBE498A, 0x049A7542, 0x0EC53837, 0x1024EFA8, 0x1A7BA2DD,
|
||||
0x07B71BD0, 0x0DE856A5, 0x1309813A, 0x1956CC4F, 0x1372F087, 0x192DBDF2, 0x07CC6A6D, 0x0D932718,
|
||||
0x138413FD, 0x19DB5E88, 0x073A8917, 0x0D65C462, 0x0741F8AA, 0x0D1EB5DF, 0x13FF6240, 0x19A02F35,
|
||||
0x1269D509, 0x1836987C, 0x06D74FE3, 0x0C880296, 0x06AC3E5E, 0x0CF3732B, 0x1212A4B4, 0x184DE9C1,
|
||||
0x065ADD24, 0x0C059051, 0x12E447CE, 0x18BB0ABB, 0x129F3673, 0x18C07B06, 0x0621AC99, 0x0C7EE1EC,
|
||||
0x1EDC6F41, 0x14832234, 0x0A62F5AB, 0x003DB8DE, 0x0A198416, 0x0046C963, 0x1EA71EFC, 0x14F85389,
|
||||
0x0AEF676C, 0x00B02A19, 0x1E51FD86, 0x140EB0F3, 0x1E2A8C3B, 0x1475C14E, 0x0A9416D1, 0x00CB5BA4,
|
||||
0x0B02A198, 0x015DECED, 0x1FBC3B72, 0x15E37607, 0x1FC74ACF, 0x159807BA, 0x0B79D025, 0x01269D50,
|
||||
0x1F31A9B5, 0x156EE4C0, 0x0B8F335F, 0x01D07E2A, 0x0BF442E2, 0x01AB0F97, 0x1F4AD808, 0x1515957D,
|
||||
0x08D92C70, 0x02866105, 0x1C67B69A, 0x1638FBEF, 0x1C1CC727, 0x16438A52, 0x08A25DCD, 0x02FD10B8,
|
||||
0x1CEA245D, 0x16B56928, 0x0854BEB7, 0x020BF3C2, 0x082FCF0A, 0x0270827F, 0x1C9155E0, 0x16CE1895,
|
||||
0x1D07E2A9, 0x1758AFDC, 0x09B97843, 0x03E63536, 0x09C209FE, 0x039D448B, 0x1D7C9314, 0x1723DE61,
|
||||
0x0934EA84, 0x036BA7F1, 0x1D8A706E, 0x17D53D1B, 0x1DF101D3, 0x17AE4CA6, 0x094F9B39, 0x0310D64C,
|
||||
0x0F6E37A0, 0x05317AD5, 0x1BD0AD4A, 0x118FE03F, 0x1BABDCF7, 0x11F49182, 0x0F15461D, 0x054A0B68,
|
||||
0x1B5D3F8D, 0x110272F8, 0x0FE3A567, 0x05BCE812, 0x0F98D4DA, 0x05C799AF, 0x1B264E30, 0x11790345,
|
||||
0x1AB0F979, 0x10EFB40C, 0x0E0E6393, 0x04512EE6, 0x0E75122E, 0x042A5F5B, 0x1ACB88C4, 0x1094C5B1,
|
||||
0x0E83F154, 0x04DCBC21, 0x1A3D6BBE, 0x106226CB, 0x1A461A03, 0x10195776, 0x0EF880E9, 0x04A7CD9C,
|
||||
0x196B7491, 0x133439E4, 0x0DD5EE7B, 0x078AA30E, 0x0DAE9FC6, 0x07F1D2B3, 0x1910052C, 0x134F4859,
|
||||
0x0D587CBC, 0x070731C9, 0x19E6E656, 0x13B9AB23, 0x199D97EB, 0x13C2DA9E, 0x0D230D01, 0x077C4074,
|
||||
0x0CB5BA48, 0x06EAF73D, 0x180B20A2, 0x12546DD7, 0x1870511F, 0x122F1C6A, 0x0CCECBF5, 0x06918680,
|
||||
0x1886B265, 0x12D9FF10, 0x0C38288F, 0x066765FA, 0x0C435932, 0x061C1447, 0x18FDC3D8, 0x12A28EAD
|
||||
};
|
||||
|
||||
static DWORD crcInternal(BYTE* data, DWORD size) {
|
||||
DWORD crc=0xffffffff;
|
||||
for (DWORD i = 0;i < size;i++) {
|
||||
crc = table[(((BYTE)(crc)) ^ data[i])] ^ (crc >> 8);
|
||||
crc = CRC_table[(((BYTE)(crc)) ^ data[i])] ^ (crc >> 8);
|
||||
}
|
||||
return crc^0xffffffff;
|
||||
}
|
||||
|
||||
+4
-5
@@ -60,10 +60,9 @@ void ConsoleExit() {
|
||||
|
||||
|
||||
|
||||
/* An attempt to make popup display function.. failed to make it work, though all arguments are there.
|
||||
/* An attempt to make popup display function.. failed to make it work, though all arguments are there.
|
||||
I missed something...
|
||||
|
||||
static const DWORD dialog_out_Addr = 0x41CF20;
|
||||
void DisplayAlertPopup(const char* msg, const char* line2) {
|
||||
__asm {
|
||||
push 1
|
||||
@@ -78,6 +77,6 @@ void DisplayAlertPopup(const char* msg, const char* line2) {
|
||||
mov eax, line2
|
||||
mov esi, 0FFFFFFFFh
|
||||
mov edi, 2
|
||||
call dialog_out_Addr
|
||||
}
|
||||
}*/
|
||||
call dialog_out_
|
||||
}
|
||||
}*/
|
||||
|
||||
+14
-14
@@ -18,8 +18,9 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#include "Version.h"
|
||||
#include <stdio.h>
|
||||
#include "FalloutEngine.h"
|
||||
#include "version.h"
|
||||
|
||||
static DWORD InCredits=0;
|
||||
static DWORD CreditsLine=0;
|
||||
@@ -28,7 +29,7 @@ static const char* ExtraLines[]={
|
||||
"#SFALL " VERSION_STRING,
|
||||
"",
|
||||
"sfall is free software, licensed under the GPL",
|
||||
"Copyright 2008-2015 The sfall team",
|
||||
"Copyright 2008-2016 The sfall team",
|
||||
"",
|
||||
"@Author",
|
||||
"Timeslip",
|
||||
@@ -51,6 +52,8 @@ static const char* ExtraLines[]={
|
||||
"Tehnokrat",
|
||||
"Crafty",
|
||||
"Slider2k",
|
||||
"Vennor",
|
||||
"Oppen",
|
||||
"",
|
||||
"@Additional thanks to",
|
||||
"Nirran",
|
||||
@@ -77,8 +80,7 @@ static void _stdcall ShowCreditsHook() {
|
||||
CreditsLine=0;
|
||||
__asm {
|
||||
mov eax, creditsFile;
|
||||
mov ebx, 0x42C860;
|
||||
call ebx;
|
||||
call credits_;
|
||||
}
|
||||
InCredits=0;
|
||||
}
|
||||
@@ -89,22 +91,21 @@ static DWORD _stdcall CreditsNextLine(char* buf, DWORD* font, DWORD* colour) {
|
||||
if(strlen(line)) {
|
||||
if(line[0]=='#') {
|
||||
line++;
|
||||
*font=*(DWORD*)0x56D74C;
|
||||
*font=*(DWORD*)_name_font;
|
||||
*colour=*(BYTE*)0x6A7F01;
|
||||
} else if(line[0]=='@') {
|
||||
line++;
|
||||
*font=*(DWORD*)0x56D748;
|
||||
*colour=*(DWORD*)0x56D750;
|
||||
*font=*(DWORD*)_title_font;
|
||||
*colour=*(DWORD*)_title_color;
|
||||
} else {
|
||||
*font=*(DWORD*)0x56D74C;
|
||||
*colour=*(DWORD*)0x56D744;
|
||||
*font=*(DWORD*)_name_font;
|
||||
*colour=*(DWORD*)_name_color;
|
||||
}
|
||||
}
|
||||
strcpy_s(buf, 256, line);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const DWORD _credits_get_next_line=0x42CE6C;
|
||||
static void __declspec(naked) CreditsNextLineHook() {
|
||||
__asm {
|
||||
pushad;
|
||||
@@ -113,14 +114,13 @@ static void __declspec(naked) CreditsNextLineHook() {
|
||||
push eax;
|
||||
call CreditsNextLine;
|
||||
test eax, eax;
|
||||
jz fail;
|
||||
popad;
|
||||
jz fail;
|
||||
xor eax, eax;
|
||||
inc eax;
|
||||
retn;
|
||||
fail:
|
||||
popad;
|
||||
jmp _credits_get_next_line;
|
||||
jmp credits_get_next_line_;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,4 +128,4 @@ void CreditsInit() {
|
||||
HookCall(0x480C49, &ShowCreditsHook);
|
||||
HookCall(0x43F881, &ShowCreditsHook);
|
||||
HookCall(0x42CB49, &CreditsNextLineHook);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-7
@@ -18,9 +18,10 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#include "Criticals.h"
|
||||
#include "Logging.h"
|
||||
#include <stdio.h>
|
||||
#include "Criticals.h"
|
||||
#include "FalloutEngine.h"
|
||||
#include "Logging.h"
|
||||
|
||||
static const DWORD CritTableCount=2*19+1; //Number of species in new critical table
|
||||
//static const DWORD origCritTableSize = 6*9*20; //Number of entries in original table
|
||||
@@ -72,13 +73,13 @@ void _stdcall ResetCriticalTable(DWORD critter, DWORD bodypart, DWORD slot, DWOR
|
||||
//It's been a long time since we worried about win9x compatibility, so just sprintf it for goodness sake...
|
||||
char section[16];
|
||||
sprintf_s(section, "c_%02d_%d_%d", critter, bodypart, slot);
|
||||
CritStruct* defaultTable=(CritStruct*)0x510978;
|
||||
CritStruct* defaultTable=(CritStruct*)_crit_succ_eff;
|
||||
critTable[slot].values[element]=critTable[slot].DamageMultiplier=GetPrivateProfileIntA(section, CritNames[element], defaultTable[slot].values[element], ".\\CriticalOverrides.ini");
|
||||
}
|
||||
|
||||
void CritLoad() {
|
||||
if (!Inited) return;
|
||||
CritStruct* defaultTable=(CritStruct*)0x510978;
|
||||
CritStruct* defaultTable=(CritStruct*)_crit_succ_eff;
|
||||
if (mode==1) {
|
||||
char section[16];
|
||||
dlogr("Setting up critical hit table using CriticalOverrides.ini", DL_CRITICALS);
|
||||
@@ -106,7 +107,7 @@ void CritLoad() {
|
||||
dlogr("Setting up critical hit table using RP fixes", DL_CRITICALS);
|
||||
memcpy(critTable, defaultTable, 6*9*19*sizeof(CritStruct));
|
||||
memset(&critTable[6*9*19], 0, 6*9*19*sizeof(CritStruct));
|
||||
memcpy(playerCrit, (void*)0x5179B0, 6*9*sizeof(CritStruct));
|
||||
memcpy(playerCrit, (void*)_pc_crit_succ_eff, 6*9*sizeof(CritStruct));
|
||||
|
||||
if (mode==3) {
|
||||
char buf[32], buf2[32], buf3[32];
|
||||
@@ -150,7 +151,7 @@ void CritInit() {
|
||||
dlog(". ", DL_INIT);
|
||||
|
||||
if(mode==2 || mode==3) {
|
||||
CritStruct* defaultTable=(CritStruct*)0x510978;
|
||||
CritStruct* defaultTable=(CritStruct*)_crit_succ_eff;
|
||||
|
||||
SetEntry(2,4,1,4,0);
|
||||
SetEntry(2,4,1,5,5216);
|
||||
@@ -250,4 +251,4 @@ void CritInit() {
|
||||
|
||||
Inited=true;
|
||||
dlogr(" Done", DL_INIT);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user