Compare commits

...
Author SHA1 Message Date
jirik2077 3d5fbe061c fix -Wswitch warnings 2026-07-27 22:33:16 +02:00
jirik2077 c33eeb0342 premade character enum usage hardened 2026-07-27 22:25:33 +02:00
jirik2077 d8df3cdd73 editor folder, editor derived stat to be named enums 2026-07-27 22:19:17 +02:00
jirik2077 8663fe5b60 pcstat enum usage hardened 2026-07-27 22:08:02 +02:00
jirik2077 4720ce1b7d stat enum usage hardened 2026-07-27 21:51:30 +02:00
Mike Klaas cd38c82514 Remove 100 hard cap on outlined objects (#612)
Fixes odd highlighting behaviour in https://github.com/fallout2-ce/fallout2-ce/pull/603
2026-07-27 08:37:07 -07:00
alpacacommunist-cmd 552505e3f5 fixes party_member.cc memory leaks (#601)
updates functions:

--- File: src/party_member.cc ---
661 | static int _partyMemberRecoverLoadInstance(PartyMemberListItem* a1)
--- File: src/party_member.cc ---
710 | int partyMembersLoad(File* stream)
2026-07-27 13:09:37 +03:00
alpacacommunist-cmd b9dd399457 adds OBJECT_HIDDEN flag check for exit grids in objectSetLocation (#588) 2026-07-27 12:45:31 +03:00
5f544ca985 Change body replacement with the blood stains so the dropped items are on top (#602)
* change the body replacement sequence with the blood stains so that items are dropped after the blood is created

* chore: auto-format with clang-format

* typo

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-27 08:39:26 +02:00
jirik2077andgithub-actions[bot] 0c7752fd33 Type safe usages of DamageType, KillType, BodyType, Editor, Skill, CriticalEffect, RaceType enums. (#599)
* type safe usages or DamageType, KillType, BodyType, Editor, Skill, CriticalEffect, RaceType enums...
replaced numeric constants to Editor enum in character_editor.cc

* chore: auto-format with clang-format

* added defaults to the switches to satisfy -Wswitch

* chore: auto-format with clang-format

* copilot review fixes

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-27 06:20:57 +02:00
Mike Klaas 0a5364972c [Et tu] DisableSpecialMapIDs=1 (#611) 2026-07-26 21:03:46 -07:00
Mike Klaas 1db054e47a [Et tu] Implement Start{X|Y}Pos (#585)
* [Et tu] Implement `Start{X|Y}Pos`, `ViewX|Y`
2026-07-26 14:07:55 -07:00
8e60a2fba2 Show weight instead of size in container loot dialog for better comparison (#551)
* show weight instead of size in loot dialog

* chore: auto-format with clang-format

* added configuration

* chore: auto-format with clang-format

* added percentage mode only

* chore: auto-format with clang-format

* use percentage for simple indiator in containers, remove the percentage mode only, change default to simple indicator

* Update src/settings.h

typo

Co-authored-by: Mike Klaas <mike.klaas@gmail.com>

* changed the threshold to be applicable only to the containers and se it to 50%.. changed the colors for the weight indicator and the party member name in the loot dialog.. also tweaked label position for bigger critters like Marcus

* restore font to the previous value in case threshold filters out the indicator

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* missing leading space in  weight indicator comments in fallout2.cfg

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* use actual runtime value of the size of the columns instead of trusting the setting value

Co-authored-by: Mike Klaas <mike.klaas@gmail.com>

* minor reformulation of the comments in fallout2.cfg

Co-authored-by: Mike Klaas <mike.klaas@gmail.com>

* explicitly use std::ceil() over ceil() to follow convention in this file and to make copilot happy

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mike Klaas <mike.klaas@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-26 09:52:04 +02:00
Mike Klaas ca89abad6c [Et tu] Fix TMA (Tell me about) (#596)
* Honor frm global offsets in draw_image

* Return correct dialog window in getInterfaceWindowByType
2026-07-25 20:44:25 -07:00
Mike Klaas 21a98bebb1 Correct PC placement when screen is large (#591)
Fixes https://github.com/fallout2-ce/fallout2-ce/issues/578
2026-07-25 15:37:09 -07:00
Mike Klaas 283107bebe [Et tu] Move pipboy GAMEMODECHANGE hook (#595)
This now fires when the window is created, allowing scripts to manipulate it (and in particular, add "X days left" note)
2026-07-25 08:57:50 -07:00
Mike Klaas dd21129464 [Et tu] get/set_terrain_name (#593)
* [Et tu] get/set_terrain_name
2026-07-24 21:42:30 -07:00
Mike Klaas 7604061e1c Fix script use-after-free when scripts remove themselves (#573)
* Fix script use-after-free when scripts remove themselves
2026-07-24 08:02:15 -07:00
Mike Klaas f832d78949 [Et tu] Filter out GL* scripts as global if they are in scripts.lst (#586)
* [Et tu] Filter out GL* scripts as global if they are in scripts.lst

Matches Sfall, prevents Et tu problems since a lot of Fo1 scripts start with GL*
2026-07-23 22:26:32 -07:00
Mike Klaas 57b784b8a0 Trigger GameMode::kLoot later (#590)
Mods like https://github.com/FalloutTeamX/sfall-Extended/blob/Extended/artifacts/mods/gl_auto_closebox.ssl access loot_obj in the GAMEMODECHANGE handler.  We need to move it later to prevent crashes (and match Sfall)

Fixes https://github.com/fallout2-ce/fallout2-ce/issues/589
2026-07-23 22:07:31 -07:00
Mike Klaas d5fd197dd9 Fix OOM memory access with alternate damage calculation (#584)
Was causing absurd values and/or lock ups due to using uninitized memory.

Also fix correctness bugs with it.
2026-07-23 21:48:30 -07:00
jirik2077andgithub-actions[bot] 6375604af8 Typesafe combat_defs.h enum usages (#580)
* change HitMode, HitLocation, CriticalHitDescriptionDataMember and CombatBatShot to its respective underlying integer types and enforce enum usage in the functions

* chore: auto-format with clang-format

* renamed CriticalHitDescriptionDataMember to CriticalHitDataMember. implemented isValid functions for the refactored enums in combat_defs.h. created template function for getting validated enum value in interpreter.h.. used isValid enum functions around the place

* chore: auto-format with clang-format

* changed gCombatState from uint handling to bit flags enum

* chore: auto-format with clang-format

* remove unused valid/interpreter method for CombatBadShot

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-23 20:16:18 +02:00
Mike Klaas c02c5efcf6 Don't crash on long config file lengths (#581) 2026-07-22 21:36:56 -07:00
Mike Klaas 94a7e7207c Solidify opcode_exists (#579)
* Solidify opcode_exists

* add arg validation
2026-07-21 08:54:38 -07:00
alpacacommunist-cmd b8988b69a8 combatAi: heap fragmentation fix, free previously initialized lists before init (#569)
* free previously initialized lists before init

* adds reasoning comment, safer verification
2026-07-21 13:36:18 +03:00
Mike Klaas 9467f4f778 Allow compat_resolve_path to handle duplicate path separators (#575)
Alternate fix for https://github.com/fallout2-ce/fallout2-ce/pull/563.
2026-07-20 21:49:04 -07:00
V4nnura 447cf6edff Unify linux-armhf and linux-arm64 yaml code. (#574)
* Unify linux-armhf and linux-arm64.
2026-07-20 20:56:26 -07:00
alpacacommunist-cmd c9bcb719ee adds combatSave OBJECT_NO_SAVE predicate + combat list filters (#553)
* adds combatSave OBJECT_NO_SAVE predicate + combat list filters
2026-07-20 20:43:16 -07:00
Mike Klaas 5dc9135689 Fix start_gdialog talking-head crash (#572)
Use the start_gdialog target object when deriving talking-head reaction, matching sfall's crash fix for calls outside talk_p_proc. Keep the separate StartGDialogFix behavior as a modder-controlled game.cfg option so mods can opt into honoring explicit mood arguments unless mood is -1.

sfall references:

- Crash fix/changelog: https://github.com/sfall-team/sfall/blob/d91d01f6256f083fd80a8b90d2202699f604055d/CHANGELOG.md#L171-L175

- Crash patch and StartGDialogFix hook: https://github.com/sfall-team/sfall/blob/d91d01f6256f083fd80a8b90d2202699f604055d/sfall/Modules/BugFixes.cpp#L4138-L4146

- Optional mood behavior hook: https://github.com/sfall-team/sfall/blob/d91d01f6256f083fd80a8b90d2202699f604055d/sfall/Modules/BugFixes.cpp#L2089-L2099

Verified with: make
2026-07-19 10:59:22 -07:00
jirik2077 dfe7eeb3a8 Merge pull request #565 from fallout2-ce/fix_use_after_free_in_use_item_on
Heap-use-after-free fix in objectUseItemOnInternal if  object or item is destroyed by script itself
2026-07-19 06:29:46 +02:00
jirik2077 436ce12022 Merge branch 'main' into fix_use_after_free_in_use_item_on 2026-07-19 06:18:38 +02:00
Mike Klaas 1bc0711327 Reorganize README and include image examples (#566)
* Reorganize README and include image examples
2026-07-18 21:15:54 -07:00
jirik2077 5a87638781 review comments 2026-07-19 06:04:34 +02:00
Mike KlaasandCopilot Autofix powered by AI 10f59c6b45 Bundle example config in distribution (#564)
* add fallout2.cfg docs

* flesh out fallout2.cfg

* add linux

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-18 14:50:29 -07:00
github-actions[bot] 24562f57da chore: auto-format with clang-format 2026-07-18 19:22:04 +00:00
jirik2077 9711e61f89 fixes heap-use-after-free in objectUseItemOnInternal when object is destoryed by the script (fixing K9 and attaching pole in Mariposa cart) 2026-07-18 21:14:50 +02:00
jirik2077 d8d99fe94a Merge pull request #562 from fallout2-ce/deobfuscate_color_usage
Deobfuscate color usage
2026-07-18 08:38:19 +02:00
github-actions[bot] 1a9211d44d chore: auto-format with clang-format 2026-07-18 05:04:11 +00:00
jirik2077 d63f293291 fix typo 2026-07-18 07:01:41 +02:00
jirik2077 71eaabc957 unify the flag usage between text_font.h and window_manager.h.. deobfuscate more draw text flags usages 2026-07-18 06:59:35 +02:00
Mike Klaas aac42c162c Fix refresh after elevator transition (#561)
For some RPU elevator transitions, I was seeing the screen partially not update.  This was due to rejecting the setCenterTile due scroll blockers (I think).  This turns those off if EDG support is enabled.

This also seems to fix some of the jittery scrolling I was seeing in diagonal areas like SF
2026-07-17 20:35:38 -07:00
jirik2077 47156d2e45 deobfuscate the font transparency flag 2026-07-18 00:09:13 +02:00
github-actions[bot] 33744ecf2e chore: auto-format with clang-format 2026-07-17 21:19:31 +00:00
jirik2077 20e80d4bb3 fix the spaces and make rgb to rgb555 color conversion constexpre function 2026-07-17 23:02:48 +02:00
jirik2077 a756bc2700 convert to hexa 2026-07-17 21:51:54 +02:00
jirik2077 de73c90a89 create macros for the color usages 2026-07-17 21:51:26 +02:00
jirik2077 aa439efd04 Add guards for null references in skill.cc (#557)
* add guards for null reference in skill.cc

* removed skillGetBaseValue and add debugPrint
2026-07-17 09:17:37 +02:00
Mike Klaas 41f09fa343 Fix elevator cancelation in RPU (#546)
* Fix elevator cancelation in RPU

If you step into an elevator in RPU and cancel the floor selection, the door closes behind you (sometimes with glitchy graphics).  This is a latent bug in the elevators code that vanilla doesn't hit

  - elevator_select_ mutates the caller’s elevation to a UI/display level before the modal loop.
  - Escape/cancel returns 0 without writing a destination tile.
  - Caller then sees map == current map and elevation != current elevation, so it closes the nearby door.
  - tile is still -1.

* NovaRains approach

* dont default to first floor if not found
2026-07-16 20:06:48 -07:00
Mike Klaas 44067b1933 Avoid non-critter sneak check in obj_can_see_obj (#560)
* We call skillGetValue(gDude, SKILL_SNEAK) for every target
* For non-critters, that can result in OOB memory reads
* We only need it for gDude for sneaking

So let's only call it when dude is sneaking and is the target
2026-07-16 20:05:31 -07:00
alpacacommunist-cmdandCopilot Autofix powered by AI 68d7bd0668 Fix heap corruption in wmWorldMap_load when save file has more cities than current config (#533)
* Fix out-of-bounds write in wmWorldMap_load when numCities exceeds wmMaxAreaNum

* use ENTRANCE_LIST_CAPACITY to properly isolate city entrances

And read a rest to dummy struct

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* adds debug print warning regarding extra data in .sav

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-15 22:11:42 -07:00
Mike Klaas 799184ab96 HOOK_REMOVEINVENOBJ (#540)
* HOOK_REMOVEINVENOBJ

* PR feedback
2026-07-15 21:14:11 -07:00
Mike Klaas 5774372924 Implement set_object_data, and add memory safety and correct offsets (#547)
* Correct `get_object_data` indexes

Currently they are raw offset pointers.  This does not work with CE since pointers are wide (64bit) on some (most) platforms.  So, we can treat these offsets like constants and return the appropriate fields instead.

There are already used for the most part as enum constants:
2026-07-15 21:12:33 -07:00
jirik2077 e90b68837d fix an opposite scroll direction in towns list (#550) 2026-07-15 07:50:06 +02:00
Mike Klaas ceecc3ebdb Two crash fixes (#552)
* Sfall fix for > 160 maps for automap code (RPU triggers this)
* Logic fix for action menu, where actionIndex was incremented unconditionally and could go out of bounds.  This was a regression from vanilla
2026-07-14 22:08:18 -07:00
jirik2077 83b6e081b7 Support for EPA gender change operation (#542)
* support for EPA gender change operation

* fix unintented return
2026-07-13 10:44:01 +02:00
Mike Klaas 083bd4a4cc Implement Sfall npc level cap (10) (#545)
Also, fix off-by-one error that can cause proto corruption
2026-07-12 21:10:23 -07:00
Mike Klaas 27ae59578a Implement real_dude_obj (#537)
This is used by scripts which are party-control aware.  Implementing this means they won't crash and should still work properly
2026-07-12 20:21:33 -07:00
jirik2077 fdee9914e3 Fix division by zero in objectExamineFunc (#541) 2026-07-12 18:25:06 +02:00
Mike Klaas 258de7c21e Increase animation cap (Sfall) (#539)
Fixes #538
2026-07-11 14:26:34 -07:00
jirik2077 feb0cd61ff fix healing revision op_tokenize (#536) 2026-07-11 05:49:44 +02:00
Mike Klaas cbbe2f00f1 Normalize ini paths that start with \ to game root (#501)
* Normalize ini paths that start with `\` to game root

Sfall does this, and we were missing it. https://github.com/sfall-team/sfall/blob/master/sfall/Modules/Scripting/Handlers/IniFiles.cpp#L61-L78

An example is InventoryFilter, which starts its ini path with `\`: https://github.com/rotators/InventoryFilter/blob/master/source/gl_InvenFilter.ssl#L19

* Normalize cache key
2026-07-10 15:10:05 -07:00
Mike Klaas bf1d35b2de Fix possible double-free in animation_free (#513)
* Fix possible double-free in animation_free

Port of roughly: https://github.com/cambragol/fission-ce/commit/7fafbb11c7daf5fe7f5ae05b92a3bffaaaa7b5a4

Not sure how to trigger it in CE, but seems plausibly possible
2026-07-10 15:09:33 -07:00
Mike Klaas 4a9e822e82 Fix "Uncontrolled format string" Code Scanning results (#512)
* Fix "Uncontrolled format string" Code Scanning results

https://github.com/fallout2-ce/fallout2-ce/security/code-scanning

* PR comments

* fix missing early return in programExecuteProcedureAsync path
2026-07-10 15:09:15 -07:00
Mike Klaas 843803e26a Party member equipment management (#528)
Add equipment slots to the companion loot screen.

Items can be equipped directly from player or companion inventory. This also allows switching between party members so you can manage all companion's inventories easily. Does not allow equipping items that would otherwise be disallowed.

Also:

    Calls HOOK_UNWIELD when adding/removing equipment, meaning mods like npc armor work
    Uses HOOK_CANUSE for weapon use checks

Ctrl-click to equip is not implemented since it already transfers items between the two inventories. I tried making it work only for equippable items (and otherwise transfer), but that felt awkward and random. Ctrl-click unequip is implemented.
2026-07-10 15:08:44 -07:00
Mike Klaas ef0085dcca Support Sfall extra animation codes (#535)
Fixes #534
2026-07-10 12:37:03 -07:00
Mike Klaas 9c19d212a6 Fix blue/green channel mixup in PCX reading (#500) 2026-07-09 17:43:28 -07:00
jirik2077andgithub-actions[bot] 41d908274f Handle unimplemented fs_copy/fs_create/fs_find more gracefully in scripts (#530)
* handle unimplemented fs_copy/fs_create/fs_find more gracefully from the script point of view

* chore: auto-format with clang-format

* moved to sfall_opcodes

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-09 20:05:06 +02:00
Mike Klaas dafb7b3831 Add offset tracking to --scan-unimplemented (#517)
* Add offset tracking to --scan-unimplemented

* Add a bunch of missing opcodes
* Hardcode a list of implemented hooks to avoid filtering a long list of hooks that are already done
* Add tracking of specific offsets accessed in unsafe scripting so we can plan replacements

Sample output

```
OFFSET write_int (0x81d1 - 0x1d1 - 465):
  0x5190f8 (5345528):
    - ./mods/InventoryFilter.dat/scripts/gl_InvenFilter_debug.int
    - ./mods/InventoryFilter.dat/scripts/release_gl_InvenFilter.int
  0x59e95c (5892444):
    - ./mods/InventoryFilter.dat/scripts/gl_InvenFilter_debug.int
    - ./mods/InventoryFilter.dat/scripts/release_gl_InvenFilter.int
```

Then we can corrlated it with source:

```
// 0x5190F8 curr_rot
static int gInventoryWindowDudeRotation = 0;
```

* PR feedback
2026-07-08 12:31:49 -07:00
114 changed files with 6366 additions and 3253 deletions
+33 -50
View File
@@ -122,6 +122,7 @@ jobs:
mkdir -p out/dist/fallout2-ce-android-debug
cp os/android/app/build/outputs/apk/debug/app-debug.apk out/dist/fallout2-ce-android-debug/fallout2-ce.apk
cp out/dist/ce.dat out/dist/fallout2-ce-android-debug/ce.dat
cp files/fallout2.cfg out/dist/fallout2-ce-android-debug/EXAMPLE_fallout2.cfg
cd out/dist
zip -r fallout2-ce-android-debug.zip fallout2-ce-android-debug
@@ -178,6 +179,7 @@ jobs:
mkdir -p out/dist/fallout2-ce-ios
cp out/build/ios/fallout2-ce.ipa out/dist/fallout2-ce-ios/fallout2-ce-ios.ipa
cp out/dist/ce.dat out/dist/fallout2-ce-ios/ce.dat
cp files/fallout2.cfg out/dist/fallout2-ce-ios/EXAMPLE_fallout2.cfg
cd out/dist
zip -r fallout2-ce-ios.zip fallout2-ce-ios
@@ -243,6 +245,7 @@ jobs:
mkdir -p out/dist/fallout2-ce-linux-${{ matrix.arch }}
cp out/build/linux-${{ matrix.arch }}-debug/fallout2-ce out/dist/fallout2-ce-linux-${{ matrix.arch }}/fallout2-ce
cp out/dist/ce.dat out/dist/fallout2-ce-linux-${{ matrix.arch }}/ce.dat
cp files/fallout2.cfg out/dist/fallout2-ce-linux-${{ matrix.arch }}/EXAMPLE_fallout2.cfg
tar -czvf out/dist/fallout2-ce-linux-${{ matrix.arch }}.tar.gz -C out/dist fallout2-ce-linux-${{ matrix.arch }}
- name: Upload
@@ -252,23 +255,38 @@ jobs:
path: out/dist/fallout2-ce-linux-${{ matrix.arch }}.tar.gz
retention-days: 7
linux-armhf:
name: Linux (armhf)
linux-arm:
name: Linux (${{ matrix.arch }})
runs-on: ubuntu-22.04-arm
needs: [ce-dat]
strategy:
fail-fast: false
matrix:
arch:
- armhf
- arm64
steps:
- name: Clone
uses: actions/checkout@v4
- name: Dependencies
- name: Dependencies (armhf)
if: matrix.arch == 'armhf'
run: |
sudo dpkg --add-architecture armhf
sudo apt update
sudo apt install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libsdl2-dev:armhf zlib1g-dev:armhf
- name: Configure
- name: Dependencies (arm64)
if: matrix.arch == 'arm64'
run: |
sudo apt update
sudo apt install libsdl2-dev zlib1g-dev
- name: Configure (armhf)
if: matrix.arch == 'armhf'
run: |
cmake \
-B build \
@@ -279,45 +297,8 @@ jobs:
-D CMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ \
# EOL
- name: Build
run: cmake --build build
- name: Download ce.dat
uses: actions/download-artifact@v4
with:
name: ce-dat
path: out/dist
- name: Package
run: |
mkdir -p out/dist/fallout2-ce-linux-armhf
cp build/fallout2-ce out/dist/fallout2-ce-linux-armhf/fallout2-ce
cp out/dist/ce.dat out/dist/fallout2-ce-linux-armhf/ce.dat
tar -czvf out/dist/fallout2-ce-linux-armhf.tar.gz -C out/dist fallout2-ce-linux-armhf
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce-linux-armhf
path: out/dist/fallout2-ce-linux-armhf.tar.gz
retention-days: 7
linux-arm64:
name: Linux (arm64)
runs-on: ubuntu-22.04-arm
needs: [ce-dat]
steps:
- name: Clone
uses: actions/checkout@v4
- name: Dependencies
run: |
sudo apt update
sudo apt install libsdl2-dev zlib1g-dev
- name: Configure
- name: Configure (arm64)
if: matrix.arch == 'arm64'
run: cmake -B build -D CMAKE_BUILD_TYPE=Debug -D FALLOUT_VENDORED=OFF
- name: Build
@@ -331,16 +312,17 @@ jobs:
- name: Package
run: |
mkdir -p out/dist/fallout2-ce-linux-arm64
cp build/fallout2-ce out/dist/fallout2-ce-linux-arm64/fallout2-ce
cp out/dist/ce.dat out/dist/fallout2-ce-linux-arm64/ce.dat
tar -czvf out/dist/fallout2-ce-linux-arm64.tar.gz -C out/dist fallout2-ce-linux-arm64
mkdir -p out/dist/fallout2-ce-linux-${{ matrix.arch }}
cp build/fallout2-ce out/dist/fallout2-ce-linux-${{ matrix.arch }}/fallout2-ce
cp out/dist/ce.dat out/dist/fallout2-ce-linux-${{ matrix.arch }}/ce.dat
cp files/fallout2.cfg out/dist/fallout2-ce-linux-${{ matrix.arch }}/EXAMPLE_fallout2.cfg
tar -czvf out/dist/fallout2-ce-linux-${{ matrix.arch }}.tar.gz -C out/dist fallout2-ce-linux-${{ matrix.arch }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fallout2-ce-linux-arm64
path: out/dist/fallout2-ce-linux-arm64.tar.gz
name: fallout2-ce-linux-${{ matrix.arch }}
path: out/dist/fallout2-ce-linux-${{ matrix.arch }}.tar.gz
retention-days: 7
macos:
@@ -431,6 +413,7 @@ jobs:
mkdir -p out/dist/fallout2-ce-windows-${{ matrix.arch }}
cp out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce.exe out/dist/fallout2-ce-windows-${{ matrix.arch }}/fallout2-ce.exe
cp out/dist/ce.dat out/dist/fallout2-ce-windows-${{ matrix.arch }}/ce.dat
cp files/fallout2.cfg out/dist/fallout2-ce-windows-${{ matrix.arch }}/EXAMPLE_fallout2.cfg
cd out/dist
7z a fallout2-ce-windows-${{ matrix.arch }}.zip fallout2-ce-windows-${{ matrix.arch }}
@@ -445,7 +428,7 @@ jobs:
release:
name: Release Continuous build
runs-on: ubuntu-latest
needs: [android, ios, linux, linux-armhf, linux-arm64, macos, windows]
needs: [android, ios, linux, linux-arm, macos, windows]
permissions:
contents: write
steps:
+4
View File
@@ -70,6 +70,7 @@ jobs:
mkdir -p out/dist/fallout2-ce-android
cp os/android/app/build/outputs/apk/release/app-release.apk out/dist/fallout2-ce-android/fallout2-ce-android.apk
cp out/dist/ce.dat out/dist/fallout2-ce-android/ce.dat
cp files/fallout2.cfg out/dist/fallout2-ce-android/EXAMPLE_fallout2.cfg
cd out/dist
zip -r fallout2-ce-android.zip fallout2-ce-android
gh release upload ${{ github.event.release.tag_name }} fallout2-ce-android.zip
@@ -130,6 +131,7 @@ jobs:
mkdir -p out/dist/fallout2-ce-ios
cp build/fallout2-ce.ipa out/dist/fallout2-ce-ios/fallout2-ce-ios.ipa
cp out/dist/ce.dat out/dist/fallout2-ce-ios/ce.dat
cp files/fallout2.cfg out/dist/fallout2-ce-ios/EXAMPLE_fallout2.cfg
cd out/dist
zip -r fallout2-ce-ios.zip fallout2-ce-ios
gh release upload ${{ github.event.release.tag_name }} fallout2-ce-ios.zip
@@ -211,6 +213,7 @@ jobs:
mkdir -p out/dist/fallout2-ce-linux-${{ matrix.arch }}
cp build/fallout2-ce out/dist/fallout2-ce-linux-${{ matrix.arch }}/fallout2-ce
cp out/dist/ce.dat out/dist/fallout2-ce-linux-${{ matrix.arch }}/ce.dat
cp files/fallout2.cfg out/dist/fallout2-ce-linux-${{ matrix.arch }}/EXAMPLE_fallout2.cfg
tar -czvf fallout2-ce-linux-${{ matrix.arch }}.tar.gz -C out/dist fallout2-ce-linux-${{ matrix.arch }}
gh release upload ${{ github.event.release.tag_name }} fallout2-ce-linux-${{ matrix.arch }}.tar.gz
rm fallout2-ce-linux-${{ matrix.arch }}.tar.gz
@@ -341,6 +344,7 @@ jobs:
mkdir -p out/dist/fallout2-ce-windows-${{ matrix.arch }}
cp out/build/windows-${{ matrix.arch }}/RelWithDebInfo/fallout2-ce.exe out/dist/fallout2-ce-windows-${{ matrix.arch }}/fallout2-ce.exe
cp out/dist/ce.dat out/dist/fallout2-ce-windows-${{ matrix.arch }}/ce.dat
cp files/fallout2.cfg out/dist/fallout2-ce-windows-${{ matrix.arch }}/EXAMPLE_fallout2.cfg
cd out/dist
7z a fallout2-ce-windows-${{ matrix.arch }}.zip fallout2-ce-windows-${{ matrix.arch }}
gh release upload ${{ github.event.release.tag_name }} fallout2-ce-windows-${{ matrix.arch }}.zip
+90 -57
View File
@@ -1,18 +1,102 @@
# Fallout 2 Community Engine
Fallout 2 Community Engine is a fully working re-implementation of the Fallout 2 engine, optimized for a hassle-free experience on multiple platforms. It provides high resolution support, quality-of-life improvements, and dozens of bug fixes.
Fallout 2 Community Engine is a fully working re-implementation of the Fallout 2 engine, optimized for a hassle-free experience on multiple platforms, including Windows, Mac, iOS, Android, and Linux. It provides high resolution support, quality-of-life improvements, and dozens upon dozens of bug fixes.
This is a fork of the original Fallout2: CE project, which is no longer getting regular updates.
Popular Fallout 2 total conversion mods are partially supported. Original versions of Nevada and Sonora (that do not rely on extended features provided by Sfall) work. [Fallout 2 Restoration Project](https://github.com/BGforgeNet/Fallout2_Restoration_Project) is supported (in Beta). [Fallout Et Tu](https://github.com/rotators/Fo1in2) and [Olympus 2207](https://olympus2207.com) are not yet supported. Other mods (particularly Resurrection and Yesterday) are not tested.
Popular Fallout 2 total conversion mods are partially supported. Nevada and Sonora work. [Fallout 2 Restoration Project](https://github.com/BGforgeNet/Fallout2_Restoration_Project) is supported (in Beta). [Fallout Et Tu](https://github.com/rotators/Fo1in2) and [Olympus 2207](https://olympus2207.com) are not yet supported. Other mods (particularly Resurrection and Yesterday) are not tested.
Fallout2: CE has broad (though not total) compatibility with [Sfall](https://github.com/sfall-team/sfall) scripting extensions. Many traditional Fallout mods work out of the box.
Fallout2: CE has broad (though not total) compatibility with [Sfall](https://github.com/sfall-team/sfall) scripting extensions. Many traditional Fallout mods work out of the box, including NPC Armor, Party Orders, FO2Tweaks (we recommend v14.5+), Talking Heads, and many others.
There is also [Fallout 1 Community Edition](https://github.com/alexbatalov/fallout1-ce) (not affiliated with this fork).
## Installation — [Download Latest CE Release](https://github.com/fallout2-ce/fallout2-ce/releases)
## Installation
You *must* own the game to play. Purchase your copy on [GOG](https://www.gog.com/game/fallout_2), [Epic Games](https://store.epicgames.com/p/fallout-2) or [Steam](https://store.steampowered.com/app/38410).
You *must* own the game to play. Purchase your copy on [GOG](https://www.gog.com/game/fallout_2), [Epic Games](https://store.epicgames.com/p/fallout-2) or [Steam](https://store.steampowered.com/app/38410). Download latest [release](https://github.com/fallout2-ce/fallout2-ce/releases) or build from source.
Download CE from the link above, then extract the archive into your game folder. Launch `fallout2-ce.exe` on Windows (or the platform-specific executable) to play. CE has a lot of enhancements that require configuration. See [Configuration](#configuration) for examples.
For detailed instructions on how to play on Mac, Linux, iOS, or Android, see the [Platform-specific instructions](#platform-specific-installation).
## Quality of life benefits over vanilla Fallout
* High resolution support
* Party members can loot and barter in place of PC
* Directly equip party members instead of convincing them to use the right equipment.
* Expanded 2-column inventory, loot screens
* Expanded 4-row barter screen
* Expanded AP bar
* Ctrl-click to quickly move items when bartering, looting, or stealing, and auto-balance caps
* Music continues playing between maps
* Auto open doors
* Integrated "HELP" menu
* 44.1 kHz stereo sound/music supported, in .ogg and .wav format as well as legacy .acm
* Last used save slot is remembered
* Item/Corpse/Container/Critter highlighting (configure using [mods/sfall-mods.ini](https://github.com/sfall-team/sfall/blob/master/artifacts/config_files/sfall-mods.ini))
<table>
<tr>
<td align="center">
<img src="docs/images/two-column-inventory.jpg" alt="Expanded 2-column inventory" width="360"><br>
<sub>Expanded 2-column inventory</sub>
</td>
<td align="center">
<img src="docs/images/companion-equip.gif" alt="Companion equip screen" width="360"><br>
<sub>Companion equip screen</sub>
</td>
</tr>
<tr>
<td align="center">
<img src="docs/images/party-member-loot.gif" alt="Party member loot" width="360"><br>
<sub>Party member loot</sub>
</td>
<td align="center">
<img src="docs/images/help-menu.gif" alt="Integrated HELP menu" width="360"><br>
<sub>Integrated HELP menu</sub>
</td>
</tr>
</table>
There are also dozens of small things that just work a little better than they did in the original. Better pathfinding, fewer graphics glitches, less finicky weapon stacking, and much more.
## Configuration
The main configuration file is `fallout2.cfg`. This contains original game config as well as new CE settings.
Additional settings for screen resolution, UI customization, and map options are now integrated into the main `fallout2.cfg` file (previously part of `f2_res.ini` from Mash's HRP).
Here are some important settings in `fallout2.cfg` under the `[screen]` and `[ui]` sections. See [the example config](https://github.com/fallout2-ce/fallout2-ce/tree/refs/heads/main/files/fallout2.cfg) for a full list of settings.
```ini
[screen]
resolution_x=1600 ; actual game window size (screen resolution), in pixels
resolution_y=1080
windowed=1 ; 0 = fullscreen
scale=2 ; 1 = original scale, 2 = 2x scale, etc. (e.g. at scale 2 and screen resolution 1920x1080, in-game resolution will be 960x540, thus every pixel is twice as wide and tall)
[ui]
; Maximum number of columns shown in the main inventory and loot/steal windows (valid range: 1..2)
inventory_columns=2
; Set to 1 to expand the barter/trade window vertically, adding a 4th item slot per side (requires ce.dat)
expand_barter_window=1
[qol]
; Allow opening party member inventory from the long-press context menu.
party_trade_from_menu=1
; Allow switching to companions' inventories in loot screens (and barter, in the future)
party_loot_and_barter=1
```
**Recommendations:**
- **Desktops**: Use any size you see fit.
- **Tablets**: Set these values to logical resolution of your device, for example iPad Pro 11 is 1668x2388 (pixels), but its logical resolution is 834x1194 (points).
- **Mobile phones**: Set height to 480, calculate width according to your device screen (aspect) ratio, for example Samsung S21 is 20:9 device, so the width should be 480 * 20 / 9 = 1067.
In time this stuff will receive an in-game interface, right now you have to do it manually. To see all currently working fallout2.cfg settings, just run the game once and quit. It will be automatically updated with defaults for every supported setting.
*Note*: Use of the IFACE_BAR settings requires the `f2_res.dat` file, which contains graphical assets. Various versions are available, but one compatible with the above settings can be found here: [f2_res.dat](https://github.com/fallout2-ce/fallout2-ce/raw/refs/heads/main/files/f2_res.dat)
## Platform-specific installation
### Windows
@@ -103,57 +187,6 @@ docker run --rm -v $(pwd):/src emscripten/emsdk:3.1.74 sh -c 'git config --globa
```
- Demo available at https://github.com/ololoken/fallout2-ce-ems.git
## Configuration
The main configuration file is `fallout2.cfg`. There are several important settings you might need to adjust for your installation. Depending on your Fallout distribution main game assets `master.dat`, `critter.dat`, `patch000.dat`, and `data` folder might be either all lowercased, or all uppercased. You can either update `master_dat`, `critter_dat`, `master_patches` and `critter_patches` settings to match your file names, or rename files to match entries in your `fallout2.cfg`.
The `sound` folder (with `music` folder inside) might be located either in `data` folder, or be in the Fallout folder. Update `music_path1` setting to match your hierarchy, usually it's `data/sound/music/` or `sound/music/`. Make sure it matches your path exactly (so it might be `SOUND/MUSIC/` if you've installed Fallout from CD). Music files themselves (with `ACM` extension) should be all uppercased, regardless of `sound` and `music` folders.
Additional settings for screen resolution, UI customization, and map options are now integrated into the main `fallout2.cfg` file (previously part of `f2_res.ini` from Mash's HRP). When Fallout 2 CE starts, if it detects an existing `f2_res.ini` file, it automatically migrates these settings into `fallout2.cfg`. After migration, `fallout2.cfg` becomes the single source of truth for this configuration.
Here are some important settings in `fallout2.cfg` under the `[screen]` and `[ui]` sections. See [the example config](https://github.com/fallout2-ce/fallout2-ce/tree/refs/heads/main/files/fallout2.cfg) for a full list of settings.
```ini
[screen]
resolution_x=1600 ; actual game window size (screen resolution), in pixels
resolution_y=1080
windowed=1 ; 0 = fullscreen
scale=2 ; 1 = original scale, 2 = 2x scale, etc. (e.g. at scale 2 and screen resolution 1920x1080, in-game resolution will be 960x540, thus every pixel is twice as wide and tall)
[ui]
;Set to 1 to expand the barter/trade window vertically, adding a 4th item slot per side (requires ce.dat)
expand_barter_window=1
;Maximum number of columns shown in the main inventory and loot/steal windows (valid range: 1..2)
inventory_columns=2
splash_screen_size=1 ; Splash screen scaling (0=original size, 1=fit preserving aspect, 2=stretch to fill)
quick_toolbar_visible=0 ; Skills quick access toolbar visibility (iOS only) (0=hidden, 1=visible)
```
**Recommendations:**
- **Desktops**: Use any size you see fit.
- **Tablets**: Set these values to logical resolution of your device, for example iPad Pro 11 is 1668x2388 (pixels), but it's logical resolution is 834x1194 (points).
- **Mobile phones**: Set height to 480, calculate width according to your device screen (aspect) ratio, for example Samsung S21 is 20:9 device, so the width should be 480 * 20 / 9 = 1067.
In time this stuff will receive in-game interface, right now you have to do it manually. To see all currently working fallout2.cfg settings, just run the game once and quit. It will be automatically updated with defaults for every supported setting.
*Note*: Use of the IFACE_BAR settings requires the `f2_res.dat` file, which contains graphical assets. Various versions are available, but one compatible with the above settings can be found here: [f2_res.dat](https://github.com/fallout2-ce/fallout2-ce/raw/refs/heads/main/files/f2_res.dat)
## Quality of life benefits over vanilla Fallout
* High resolution support
* Expanded 2-column inventory
* Expanded 4-row barter screen
* Expanded AP bar
* Party members can loot and barter in place of PC
* Increased pathfinding nodes 5x for more accurate pathfinding, and use accurate path length for walk vs run
* Ctrl-click to quickly move items when bartering, looting, or stealing
* _a_ to select "all" when selecting item quantity, and for `Take All` when looting
* When bartering, caps default to the right amount to balance the trade
* Music continues playing between maps
* Auto open doors
* Integrated "HELP" menu
* 44.1 kHz stereo sound/music supported, in .ogg and .wav format as well as legacy .acm
* Last used save slot is remembered
* Item/Corpse/Container/Critter highlighting (configure using [mods/sfall-mods.ini](https://github.com/sfall-team/sfall/blob/master/artifacts/config_files/sfall-mods.ini))
## Contributing
+15 -3
View File
@@ -38,6 +38,18 @@ The following settings were moved into [`fallout2.cfg`](files/fallout2.cfg) inst
| `Misc` | `UseWalkDistance` | `qol` | `use_walk_distance` |
| `Misc` | `AutoOpenDoors` | `qol` | `auto_open_doors` |
The following settings were moved into [`<DAT>/config/game.cfg`](files/ce.dat/config/game.cfg):
| 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
See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/) for documentation on specific functions.
@@ -53,7 +65,7 @@ See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/)
| Perks and traits | set_perk_image<br>set_perk_*<br>set_pyromaniac_mod<br>apply_heaveho_fix<br>set_swiftlearner_mod<br>has/set_fake_perk<br>has/set_fake_trait<br>set_selectable_perk<br>set_perkbox_title<br>show/hide_real_perks<br>perk_add_mode<br>clear_selectable_perks<br>add/remove_trait<br>seq_perk_freq | not implemented | - |
| Virtual file system | fs_create<br>fs_copy<br>fs_find<br>fs_read/write_*<br>fs_delete<br>fs_size<br>fs_pos<br>fs_seek<br>fs_resize | đźš« | Open an issue if you have a use case for these |
| Combat / Knockback | set_weapon_knockback<br>set_target_knockback<br>set_attacker_knockback<br>remove_weapon_knockback<br>remove_target_knockback<br>remove_attacker_knockback | not implemented | - |
| Maps and encounters | in_world_map<br>force_encounter{_with_flags}<br>set_map_time_multi<br>get/set_map_enter_position<br>exec_map_update_scripts<br>get/set_terrain_name<br>set_town_title<br>get/set_can_rest_on_map<br>set_rest_heal_time<br>set_rest_mode<br>set_worldmap_heal_time | implemented: in_world_map, force_encounter, force_encounter_with_flags, set_map_time_multi | - |
| Maps and encounters | in_world_map<br>force_encounter{_with_flags}<br>set_map_time_multi<br>get/set_map_enter_position<br>exec_map_update_scripts<br>get/set_terrain_name<br>set_town_title<br>get/set_can_rest_on_map<br>set_rest_heal_time<br>set_rest_mode<br>set_worldmap_heal_time | implemented: in_world_map, force_encounter, force_encounter_with_flags, set_map_time_multi, get_terrain_name, set_terrain_name | - |
| Maps and encounters / Worldmap | get_world_map_x/y_pos<br>set_world_map_pos | âś… | - |
| Audio | play_sfall_sound<br>stop_sfall_sound | âś… | `play_sfall_sound` currently supports `.acm`, `.wav`, `.ogg` formats, and can load from `.dat` archives. `.mp3` is not yet supported. |
| Combat / Weapons and ammo | get/set_weapon_ammo_pid<br>get/set_weapon_ammo_count | âś… | - |
@@ -82,7 +94,7 @@ See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/)
| Interface / Cursor | get/set_cursor_mode | âś… | - |
| Locks | lock_is_jammed<br>unjam_lock<br>set_unjam_locks_time | not implemented | - |
| INI settings | get_ini_setting<br>get_ini_string<br>get_ini_section<br>get_ini_sections<br>get_ini_config<br>get_ini_config_db<br>set_ini_setting | âś… | `modified_ini` is intentionally omitted as deprecated. |
| Objects and scripts | set_self<br>set_dude_obj<br>real_dude_obj<br>remove_script<br>get/set_script<br>obj_is_carrying_obj<br>loot_obj<br>dialog_obj<br>obj_under_cursor<br>get/set_object_data<br>get/set_flags<br>set_unique_id<br>set_scr_name<br>obj_is_openable<br>get/set_proto_data<br>get_object_ai_data | implemented: set_self, get/set/remove_script, obj_is_carrying_obj, loot_obj, dialog_obj, obj_under_cursor, get_object_data, get_flags, set_flags, set_unique_id, obj_is_openable, get_proto_data, set_proto_data | - |
| Objects and scripts | set_self<br>set_dude_obj<br>real_dude_obj<br>remove_script<br>get/set_script<br>obj_is_carrying_obj<br>loot_obj<br>dialog_obj<br>obj_under_cursor<br>get/set_object_data<br>get/set_flags<br>set_unique_id<br>set_scr_name<br>obj_is_openable<br>get/set_proto_data<br>get_object_ai_data | âś… except set_dude_obj, set_scr_name | `get/set_object_data` maps supported object and `C_ATTACK_*` offsets instead of exposing arbitrary raw memory offsets. |
| Other / Game management | set_movie_path<br>stop/resume_game<br>mark_movie_played<br>game_loaded<br>get_game_mode<br>get_uptime<br>signal_close_game | implemented: game_loaded, get_game_mode, get_uptime, signal_close_game | - |
| Gameplay tweaks | set_pickpocket_max<br>set_hit_chance_max<br>set_xp_mod<br>set_critter_hit_chance_mod<br>set_base_hit_chance_mod<br>set_hp_per_level_mod<br>gdialog_get_barter_mod<br>get/set_unspent_ap_bonus<br>get/set_unspent_ap_perk_bonus<br>set_base_pickpocket_mod<br>set_critter_pickpocket_mod<br>get/set_inven_ap_cost<br>set_drugs_data<br>get_kill_counter<br>mod_kill_counter<br>set_pipboy_available | implemented: gdialog_get_barter_mod, get/set_unspent_ap{_perk}_bonus, get/set_inven_ap_cost | - |
| NPCs | inc_npc_level<br>get_npc_level<br>npc_engine_level_up | not implemented | - |
@@ -104,7 +116,7 @@ See [`https://sfall-team.github.io/sfall/`](https://sfall-team.github.io/sfall/)
| FindTarget | `HOOK_FINDTARGET` | đźš« | (maybe) |
| UseObjOn | `HOOK_USEOBJON` | âś… | - |
| UseObj | `HOOK_USEOBJ` | âś… | CE notes an sfall-matching inconsistency around return code `2` behavior between interface contexts. |
| RemoveInvenObj | `HOOK_REMOVEINVENOBJ` | đźš« | - |
| RemoveInvenObj | `HOOK_REMOVEINVENOBJ` | âś… | - |
| BarterPrice | `HOOK_BARTERPRICE` | âś… | - |
| ItemDamage | `HOOK_ITEMDAMAGE` | âś… | - |
| MoveCost | `HOOK_MOVECOST` | âś… | - |
Binary file not shown.

After

Width:  |  Height:  |  Size: 301 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

+14
View File
@@ -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
@@ -38,6 +49,9 @@ no_exit_hotkey=1
; Set to 1 to allow using '^' in dialog msg files to specify gender-based alternative text.
; Text must be enclosed in angle brackets, e.g. <MaleText^FemaleText>.
gender_words=0
; Set to 1 to enable the sfall StartGDialogFix behavior: talking-head dialogs honor the start_gdialog mood argument unless it is -1.
; When set to 0, CE still applies sfall's crash fix for calling start_gdialog outside talk_p_proc.
start_gdialog_fix=0
[main_menu]
; Custom version string shown on the main menu. Supports up to two %d placeholders for the game version numbers.
+74 -29
View File
@@ -1,3 +1,6 @@
; This is an example configuration for Fallout CE. If you'd like to use the recommended settings without
; disturbing your game config, copy everything from [ui] and [qol] into your fallout2.cfg
[debug]
;Set this to a valid path to save a copy of the console contents
console_output_path=
@@ -48,15 +51,20 @@ text_line_delay=2.000000
violence_level=3
[screen]
resolution_x=640
; Physical screen resolution of the full screen or window.
resolution_x=800
resolution_y=480
; Scale of physical pixels to logical pixels. For instance, if x/y is 1280 x 960 and scale is 2,
; the game will be rendered at 640 x 480 and then scaled up to 1280 x 960. This is useful for windowed mode on high DPI displays.
scale=1
; Set to 1 to run the game in windowed mode. Set to 0 to run in fullscreen mode.
windowed=1
[sound]
cache_size=448
debug=1
debug_sfxc=1
; Set to 1 to avoid restarting music when changing maps when the music is the same track.
gapless_music=1
initialize=1
master_volume=22281
@@ -70,7 +78,7 @@ speech=1
speech_volume=22281
[system]
art_cache_size=8
art_cache_size=32
color_cycling=1
critter_dat=critter.dat
critter_patches=data
@@ -87,60 +95,97 @@ scroll_lock=0
splash=5
[ui]
;Speed up or slow down all UI animations such as screen fade, dialog window show/hide, AC numbers roll, etc.
; Speed up or slow down all UI animations such as screen fade, dialog window show/hide, AC numbers roll, etc.
anim_speed=2.000000
;To use more than one save slot for quick saving (F6 key) without picking a slot beforehand
;Quick save will cyclically overwrite saves from the first slot on the specified page to the last slot on the n-th page
;auto_quick_save sets how many pages you want to use for quick saving (valid range: 1..10)
;Set to 0 to disable
; To use more than one save slot for quick saving (F6 key) without picking a slot beforehand
; Quick save will cyclically overwrite saves from the first slot on the specified page to the last slot on the n-th page
; auto_quick_save sets how many pages you want to use for quick saving (valid range: 1..10)
; Set to 0 to disable
auto_quick_save=3
;Set to 1 to display additional points of damage from Bonus HtH/Ranged Damage perks in the inventory
; Set to 1 to display additional points of damage from Bonus HtH/Ranged Damage perks in the inventory
display_bonus_damage=1
;Set to 1 to get notification of karma changes in the notification window
; Set to 1 to get notification of karma changes in the notification window
display_karma_changes=0
;Set to 1 to use the hi-res dialog border/background at resolutions above 640x480. Requires art\intrface\HR_ALLTLK.FRM (for example from f2_res.dat)
; Set to 1 to use the hi-res dialog border/background at resolutions above 640x480. Requires art\intrface\HR_ALLTLK.FRM (for example from f2_res.dat)
dialog_border=1
;Set to one to hide areas outside map bounds when using higher than 640x480 resolution, and to zero to disable
; Set to one to hide areas outside map bounds when using higher than 640x480 resolution, and to zero to disable
enable_high_resolution_stencil=1
;Set to 1 to extend the action points bar to show up to 16 AP instead of 10 (requires iface_apbar_e.frm)
extend_ap_bar=0
;Set to 1 to expand the barter/trade window vertically, adding a 4th item slot per side (requires barter_e.frm, trade_e.frm, and a screen height of at least 528 pixels)
expand_barter_window=0
; Set to 1 to extend the action points bar to show up to 16 AP instead of 10 (requires iface_apbar_e.frm)
extend_ap_bar=1
; Set to 1 to expand the barter/trade window vertically, adding a 4th item slot per side (requires barter_e.frm, trade_e.frm, and a screen height of at least 528 pixels)
expand_barter_window=1
; if iface_bar_mode=0 - the bottom of the map view window sits at the top of the IFACE Bar.
; if iface_bar_mode=1 - the bottom of the map view window extends to the base of the screen and is overlapped by the IFACE Bar.
iface_bar_mode=0
; 0 = no side art, 1 = metal, 2 = leather, 3-6 = alternative metal, 7 = alternative leather, 8 = brown metal
iface_bar_side_art=2
; 0 = Iface-bar side graphics extend from the Iface-Bar to the Screen edges.
; 1 = Iface-bar side graphics extend from the Screen edges to the Iface-Bar
iface_bar_sides_ori=0
; Set to 640 to use the original interface bar width, or 800 to use the 800pix wide asset from f2_res.dat.
iface_bar_width=800
;Whether to load EDG files (HRP format) when loading maps. If loaded, they override default edge clipping and scroll blocking behavior.
; Whether to load EDG files (HRP format) when loading maps. If loaded, they override default edge clipping and scroll blocking behavior.
edg_support=1
ignore_map_edges=0
;Set to 1 to display numbered dialogue options
; Set to 1 to display numbered dialogue options
numbers_in_dialogue=0
;Set to 1 to skip the 3 opening movies
;Set to 2 to also skip the splash screen
; Set to 1 to skip the 3 opening movies
; Set to 2 to also skip the splash screen
skip_opening_movies=0
; Set to 1 to scale the splash screen to fit the screen while preserving aspect ratio.
; Set to 2 to fill the screen
splash_screen_size=1
;Set to 1 to scale movies to fit the screen while preserving aspect ratio.
;Set to 0 to keep movies at their native size, centered on screen.
; Set to 1 to scale movies to fit the screen while preserving aspect ratio.
; Set to 0 to keep movies at their native size, centered on screen.
movie_aspect_fit=1
;Maximum number of columns shown in the main inventory and loot/steal windows (valid range: 1..2)
;2-column Loot/steal window requires minimum screen width of 673px
; Maximum number of columns shown in the main inventory and loot/steal windows (valid range: 1..2)
; 2-column Loot/steal window requires minimum screen width of 673px.
; This also enables npc equipment management on the loot screen
inventory_columns=2
;Set to 0 to keep the main menu art and controls at native size.
;Set to 1 to scale only the main menu background image to fit the screen while maintaining aspect ratio.
;Set to 2 to also scale the main menu button panel, red buttons, and button labels with the menu art.
; Set to 0 to keep the main menu art and controls at native size.
; Set to 1 to scale only the main menu background image to fit the screen while maintaining aspect ratio.
; Set to 2 to also scale the main menu button panel, red buttons, and button labels with the menu art.
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.
; 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.
auto_open_doors=0
; Overrides distance at which walk animation is used when using an object. 0 disables walking
; This is the number of empty tiles between the player and the target
; This is the number of empty tiles between the player and the target. 3 is the default
use_walk_distance=3
; Allow opening party member inventory from the long-press world menu.
; Allow opening party member inventory from the long-press context menu.
party_trade_from_menu=1
; Allow switching to companions' inventories in loot screens (and barter, in the future)
party_loot_and_barter=1
+27
View File
@@ -0,0 +1,27 @@
#include "test_utils.h"
#include "sfall.h"
procedure start begin
variable defaultName;
display_msg("Testing terrain name metarules...");
call assertEquals("get metarule exists", metarule_exist("get_terrain_name"), 1);
call assertEquals("set metarule exists", metarule_exist("set_terrain_name"), 1);
defaultName := get_terrain_name(0, 0);
call assertNotEquals("default terrain name is not error", defaultName, "Error");
call assertNotEquals("default terrain name is not empty", defaultName, "");
set_terrain_name(0, 0, "CE Terrain Override");
call assertEquals("terrain override is returned", get_terrain_name(0, 0), "CE Terrain Override");
set_terrain_name(0, 0, "CE Terrain Override 2");
call assertEquals("latest terrain override wins", get_terrain_name(0, 0), "CE Terrain Override 2");
call assertEquals("one argument get returns error", sfall_func1("get_terrain_name", 0), -1);
call assertEquals("invalid get returns error", get_terrain_name(-1, 0), "Error");
call assertNotEquals("current terrain name is available", get_current_terrain_name, "Error");
call report_test_results("terrain_name");
signal_close_game;
end
+10
View File
@@ -1,5 +1,6 @@
#include "lib.arrays.h" // For arrays_equal, len_array, etc.
#include "test_utils.h" // For assertEquals, VALTYPE_STR, report_test_results
#include "sfall.h"
// To test: copy test.ini into the game folder before running
procedure ini_test_suite begin
@@ -29,6 +30,15 @@ procedure ini_test_suite begin
call assertEquals("TC2 get_ini_setting empty int", get_ini_setting("test.ini|ValidSection|EmptyValue"), 0);
call assertEquals("TC2 get_ini_string empty string", get_ini_string("test.ini|ValidSection|EmptyValue"), "");
// Regression: sfall resolves leading-backslash paths relative to the game root.
result_array := get_ini_section("\\test.ini", "ValidSection");
call assertEquals("TC2B Size", len_array(result_array), 3);
call assertEquals("TC2B Key1", result_array["Key1"], "Value1");
call assertEquals("TC2B get_ini_setting int", get_ini_setting("\\test.ini|ValidSection|Key2"), 2);
call assertEquals("TC2B get_ini_string string", get_ini_string("\\test.ini|ValidSection|Key1"), "Value1");
result_array := get_ini_sections("\\test.ini");
call assertEquals("TC2B get_ini_sections size", len_array(result_array), 3);
// INI file not found
result_array := get_ini_section("nonexistent.ini", "AnySection");
call assertEquals("TC3 Size", len_array(result_array), 0);
+2 -1
View File
@@ -21,10 +21,11 @@ procedure start begin
call assertEquals("opcode_exists OP_NOOP", opcode_exists(OP_NOOP), 1);
// Probably will never be implemented on fallout2-ce
call assertEquals("opcode_exists OP_WRITE_INT", opcode_exists(OP_WRITE_INT), 0);
call assertEquals("opcode_exists bare index", opcode_exists(0x1B3), 0);
call assertEquals("opcode_exists 0xFFFF", opcode_exists(0xFFFF), 0);
end else begin
display_msg("Opcode exists metarule is not available, skipping tests.");
end
call report_test_results("metarule_exist");
end
end
@@ -0,0 +1,96 @@
#include "sfall.h"
#include "dik.h"
#include "define_lite.h"
#include "define_extra.h"
#include "../test_utils.h"
#define DAMAGE_TARGET_OVERRIDE 13
#define DAMAGE_SOURCE_OVERRIDE 7
#define FLAGS_SOURCE_OVERRIDE DAM_HIT
#define KNOCKBACK_OVERRIDE 2
#define TEST_LIGHT_DISTANCE 3
#define TEST_LIGHT_INTENSITY 0x10000
variable object_data_attack_hook_seen := false;
variable object_data_attack_reported := false;
procedure object_data_roundtrip_test begin
variable old_light_distance := get_object_data(dude_obj, OBJ_DATA_LIGHT_DISTANCE);
variable old_light_intensity := get_object_data(dude_obj, OBJ_DATA_LIGHT_INTENSITY);
set_object_data(dude_obj, OBJ_DATA_LIGHT_DISTANCE, TEST_LIGHT_DISTANCE);
set_object_data(dude_obj, OBJ_DATA_LIGHT_INTENSITY, TEST_LIGHT_INTENSITY);
call assertEquals("object light distance set", get_object_data(dude_obj, OBJ_DATA_LIGHT_DISTANCE), TEST_LIGHT_DISTANCE);
call assertEquals("object light intensity set", get_object_data(dude_obj, OBJ_DATA_LIGHT_INTENSITY), TEST_LIGHT_INTENSITY);
set_object_data(dude_obj, OBJ_DATA_LIGHT_DISTANCE, old_light_distance);
set_object_data(dude_obj, OBJ_DATA_LIGHT_INTENSITY, old_light_intensity);
call assertEquals("object light distance restored", get_object_data(dude_obj, OBJ_DATA_LIGHT_DISTANCE), old_light_distance);
call assertEquals("object light intensity restored", get_object_data(dude_obj, OBJ_DATA_LIGHT_INTENSITY), old_light_intensity);
end
procedure report_object_data_attack_results begin
if (object_data_attack_reported) then return;
object_data_attack_reported := true;
call report_test_results("object_data_attack");
end
procedure combatdamage_handler begin
variable target := get_sfall_arg_at(0);
variable attacker := get_sfall_arg_at(1);
variable attack_data := get_sfall_arg_at(12);
object_data_attack_hook_seen := true;
call assertTrue("attack data pointer exists", attack_data != 0);
call assertEquals("attack source matches hook attacker", get_object_data(attack_data, C_ATTACK_SOURCE), attacker);
call assertEquals("attack target matches hook target", get_object_data(attack_data, C_ATTACK_TARGET), target);
call assertEquals("combat_data returns same attack data", combat_data, attack_data);
set_object_data(attack_data, C_ATTACK_DAMAGE_TARGET, DAMAGE_TARGET_OVERRIDE);
set_object_data(attack_data, C_ATTACK_DAMAGE_SOURCE, DAMAGE_SOURCE_OVERRIDE);
set_object_data(attack_data, C_ATTACK_FLAGS_SOURCE, FLAGS_SOURCE_OVERRIDE);
set_object_data(attack_data, C_ATTACK_KNOCKBACK_VALUE, KNOCKBACK_OVERRIDE);
call assertEquals("attack target damage set", get_object_data(attack_data, C_ATTACK_DAMAGE_TARGET), DAMAGE_TARGET_OVERRIDE);
call assertEquals("attack source damage set", get_object_data(attack_data, C_ATTACK_DAMAGE_SOURCE), DAMAGE_SOURCE_OVERRIDE);
call assertEquals("attack source flags set", get_object_data(attack_data, C_ATTACK_FLAGS_SOURCE), FLAGS_SOURCE_OVERRIDE);
call assertEquals("attack knockback set", get_object_data(attack_data, C_ATTACK_KNOCKBACK_VALUE), KNOCKBACK_OVERRIDE);
set_sfall_return(DAMAGE_TARGET_OVERRIDE);
set_sfall_return(DAMAGE_SOURCE_OVERRIDE);
set_sfall_return(get_object_data(attack_data, C_ATTACK_FLAGS_TARGET));
set_sfall_return(FLAGS_SOURCE_OVERRIDE);
set_sfall_return(KNOCKBACK_OVERRIDE);
call report_object_data_attack_results();
end
procedure keypress_handler begin
variable
pressed := get_sfall_arg_at(0),
key := get_sfall_arg_at(1);
if (not pressed) then return;
if (key != DIK_J) then return;
if (not object_data_attack_hook_seen) then begin
display_msg("object_data_attack: enter combat and hit something to trigger HOOK_COMBATDAMAGE.");
end else begin
call report_object_data_attack_results();
end
end
procedure start begin
if (not game_loaded) then return;
display_msg("Testing get/set_object_data object fields...");
call object_data_roundtrip_test();
display_msg("object_data_attack ready: enter combat and hit something. Press J to repeat instructions.");
register_hook_proc(HOOK_KEYPRESS, keypress_handler);
register_hook_proc(HOOK_COMBATDAMAGE, combatdamage_handler);
end
+11 -11
View File
@@ -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);
@@ -773,7 +773,7 @@ int _action_ranged(Attack* attack, int anim)
int rightItemAction;
interfaceGetItemActions(&leftItemAction, &rightItemAction);
itemRemove(attack->attacker, weapon, 1);
itemRemoveWithReason(attack->attacker, weapon, 1, RemoveInventoryObjectHookReason::Throw);
replacedWeapon = itemReplace(attack->attacker, weapon, weaponFlags & OBJECT_IN_ANY_HAND);
objectSetFid(projectile, projectileProto->fid, nullptr);
_cAIPrepWeaponItem(attack->attacker, weapon);
@@ -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) {
@@ -1477,7 +1477,7 @@ int actionUseSkill(Object* user, Object* target, int skill)
char* msg = skillsGetGenericResponse(partyMember, isDude);
Rect rect;
if (textObjectAdd(partyMember, msg, 101, _colorTable[32747], _colorTable[0], &rect) == 0) {
if (textObjectAdd(partyMember, msg, 101, COLOR_LIGHT_YELLOW, COLOR_BLACK, &rect) == 0) {
tileWindowRefreshRect(&rect, gElevation);
}
@@ -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
View File
@@ -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);
+42 -13
View File
@@ -1,6 +1,8 @@
#include "animation.h"
#include <algorithm>
#include <array>
#include <cstddef>
#include <stdio.h>
#include <string.h>
@@ -38,9 +40,13 @@
namespace fallout {
#define ANIMATION_SEQUENCE_LIST_CAPACITY 32
// sfall exposes this as [Misc] AnimationsAtOnceLimit. Keep CE aligned with
// sfall's default 64 total / 52 non-reserved slots for now; this can become
// configurable later.
#define ANIMATION_SEQUENCE_LIST_CAPACITY 64
#define ANIMATION_DESCRIPTION_LIST_CAPACITY 55
#define ANIMATION_SAD_LIST_CAPACITY 24
#define ANIMATION_SAD_LIST_CAPACITY 64
#define ANIMATION_NON_RESERVED_LIST_CAPACITY 52
#define ANIMATION_SEQUENCE_FORCED 0x01
@@ -76,6 +82,11 @@ typedef enum AnimationKind {
ANIM_KIND_SET_LIGHT_INTENSITY,
} AnimationKind;
static bool animationKindIsCallback(int kind)
{
return kind == ANIM_KIND_CALLBACK || kind == ANIM_KIND_CALLBACK3;
}
typedef enum AnimationSequenceFlags {
// Specifies that the animation sequence has high priority, it cannot be
// cleared.
@@ -334,7 +345,7 @@ static AnimationSad gAnimationSads[ANIMATION_SAD_LIST_CAPACITY];
static PathNode gClosedPathNodeList[PATH_NODE_CAPACITY];
// 0x54CC14 anim_set
static AnimationSequence gAnimationSequences[32];
static AnimationSequence gAnimationSequences[ANIMATION_SEQUENCE_LIST_CAPACITY];
// 0x561814 seen_tile
static unsigned char gPathfinderProcessedTiles[5000];
@@ -438,7 +449,7 @@ static int _anim_free_slot(int requestOptions)
}
return -1;
} else if ((requestOptions & ANIMATION_REQUEST_RESERVED) != 0 || v2 < 20) {
} else if ((requestOptions & ANIMATION_REQUEST_RESERVED) != 0 || v2 < ANIMATION_NON_RESERVED_LIST_CAPACITY) {
return v1;
}
@@ -473,7 +484,7 @@ int reg_anim_clear(Object* a1)
int animationDescriptionIndex;
for (animationDescriptionIndex = 0; animationDescriptionIndex < animationSequence->length; animationDescriptionIndex++) {
AnimationDescription* animationDescription = &(animationSequence->animations[animationDescriptionIndex]);
if (a1 != animationDescription->owner || animationDescription->kind == 11) {
if (a1 != animationDescription->owner || animationKindIsCallback(animationDescription->kind)) {
continue;
}
@@ -587,7 +598,7 @@ static int _check_registry(Object* obj)
if (animationSequenceIndex != gAnimationSequenceCurrentIndex && animationSequence->step != ANIM_COMPLETE) {
for (int animationDescriptionIndex = 0; animationDescriptionIndex < animationSequence->length; animationDescriptionIndex++) {
AnimationDescription* animationDescription = &(animationSequence->animations[animationDescriptionIndex]);
if (obj == animationDescription->owner && animationDescription->kind != 11) {
if (obj == animationDescription->owner && !animationKindIsCallback(animationDescription->kind)) {
if ((animationSequence->flags & ANIM_SEQ_INSIGNIFICANT) == 0) {
return -1;
}
@@ -619,7 +630,7 @@ int animationIsBusy(Object* a1)
continue;
}
if (animationDescription->kind == ANIM_KIND_CALLBACK) {
if (animationKindIsCallback(animationDescription->kind)) {
continue;
}
@@ -1609,12 +1620,25 @@ static int _anim_set_end(int animationSequenceIndex)
}
}
std::array<Object*, ANIMATION_DESCRIPTION_LIST_CAPACITY> destroyedOwners = {};
std::size_t destroyedOwnersLength = 0;
auto ownerWasDestroyed = [&destroyedOwners, &destroyedOwnersLength](Object* owner) {
return std::find(destroyedOwners.begin(), destroyedOwners.begin() + destroyedOwnersLength, owner) != destroyedOwners.begin() + destroyedOwnersLength;
};
for (i = 0; i < animationSequence->length; i++) {
animationDescription = &(animationSequence->animations[i]);
if (animationDescription->kind == ANIM_KIND_HIDE && ((i < animationSequence->animationIndex) || (animationDescription->extendedFlags & ANIMATION_SEQUENCE_FORCED))) {
Object* owner = animationDescription->owner;
if (ownerWasDestroyed(owner)) {
continue;
}
destroyedOwners[destroyedOwnersLength++] = owner;
Rect rect;
int elevation = animationDescription->owner->elevation;
objectDestroy(animationDescription->owner, &rect);
int elevation = owner->elevation;
objectDestroy(owner, &rect);
tileWindowRefreshRect(&rect, elevation);
}
}
@@ -1623,18 +1647,23 @@ static int _anim_set_end(int animationSequenceIndex)
animationDescription = &(animationSequence->animations[i]);
if (animationDescription->artCacheKey) {
artUnlock(animationDescription->artCacheKey);
animationDescription->artCacheKey = nullptr;
}
if (animationDescription->kind != 11 && animationDescription->kind != 12) {
if (!animationKindIsCallback(animationDescription->kind)) {
// TODO: Check.
if (animationDescription->kind != ANIM_KIND_PING) {
Object* owner = animationDescription->owner;
if (ownerWasDestroyed(owner)) {
continue;
}
if (FID_TYPE(owner->fid) == OBJ_TYPE_CRITTER) {
int j = 0;
for (; j < i; j++) {
AnimationDescription* ad = &(animationSequence->animations[j]);
if (owner == ad->owner) {
if (ad->kind != ANIM_KIND_CALLBACK && ad->kind != ANIM_KIND_CALLBACK3) {
if (!animationKindIsCallback(ad->kind)) {
break;
}
}
@@ -1707,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;
}
@@ -2990,7 +3019,7 @@ int _check_move(int* actionPointsPtr)
if (isInCombat()) {
if (*actionPointsPtr != -1) {
if (gPressedPhysicalKeys[SDL_SCANCODE_RCTRL] || gPressedPhysicalKeys[SDL_SCANCODE_LCTRL]) {
int hitMode;
HitMode hitMode;
bool aiming;
interfaceGetCurrentHitMode(&hitMode, &aiming);
+27 -4
View File
@@ -47,6 +47,7 @@ static int artReadFrameData(unsigned char* data, File* stream, int count, int* p
static int artReadHeader(Art* art, File* stream);
static int artGetDataSize(const Art* art);
static int paddingForSize(int size);
static char artGetCritterWeaponCode(int weaponType);
// A frame is laid out like [ArtFrame header][pixel bytes][padding].
// These functions return a pointer to the pixel bytes, but must be given a pointer to a frame header,
@@ -583,7 +584,7 @@ int _art_get_code(int animation, int weaponType, char* weaponCodePtr, char* anim
return -1;
}
*weaponCodePtr = 'd' + (weaponType - 1);
*weaponCodePtr = artGetCritterWeaponCode(weaponType);
return 0;
} else if (animation == ANIM_PRONE_TO_STANDING) {
*animationCodePtr = 'h';
@@ -625,7 +626,7 @@ int _art_get_code(int animation, int weaponType, char* weaponCodePtr, char* anim
*weaponCodePtr = 'a';
*animationCodePtr = 'n';
} else {
*weaponCodePtr = 'd' + (weaponType - 1);
*weaponCodePtr = artGetCritterWeaponCode(weaponType);
*animationCodePtr = 'e';
}
return 0;
@@ -633,7 +634,7 @@ int _art_get_code(int animation, int weaponType, char* weaponCodePtr, char* anim
*animationCodePtr = 'a' + animation;
if (animation <= ANIM_WALK && weaponType > 0) {
*weaponCodePtr = 'd' + (weaponType - 1);
*weaponCodePtr = artGetCritterWeaponCode(weaponType);
return 0;
}
*weaponCodePtr = 'a';
@@ -641,6 +642,24 @@ int _art_get_code(int animation, int weaponType, char* weaponCodePtr, char* anim
return 0;
}
static char artGetCritterWeaponCode(int weaponType)
{
switch (weaponType) {
case WEAPON_ANIMATION_SFALL_S:
return 's';
case WEAPON_ANIMATION_SFALL_O:
return 'o';
case WEAPON_ANIMATION_SFALL_P:
return 'p';
case WEAPON_ANIMATION_SFALL_Q:
return 'q';
case WEAPON_ANIMATION_SFALL_T:
return 't';
default:
return 'd' + (weaponType - 1);
}
}
// 0x419428
char* artBuildFilePath(int fid)
{
@@ -957,9 +976,11 @@ int artAliasFid(int fid)
int anim = FID_ANIM_TYPE(fid);
if (type == OBJ_TYPE_CRITTER) {
if (anim == ANIM_ELECTRIFY
|| anim == ANIM_CHARRED_BODY
|| anim == ANIM_BURNED_TO_NOTHING
|| anim == ANIM_ELECTRIFIED_TO_NOTHING
|| anim == ANIM_ELECTRIFY_SF
|| anim == ANIM_CHARRED_BODY_SF
|| anim == ANIM_BURNED_TO_NOTHING_SF
|| anim == ANIM_ELECTRIFIED_TO_NOTHING_SF
|| anim == ANIM_FIRE_DANCE
@@ -1768,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;
}
+5
View File
@@ -100,6 +100,11 @@ typedef enum WeaponAnimation {
WEAPON_ANIMATION_LASER_RIFLE, // k
WEAPON_ANIMATION_MINIGUN, // l
WEAPON_ANIMATION_LAUNCHER, // m
WEAPON_ANIMATION_SFALL_S, // s
WEAPON_ANIMATION_SFALL_O, // o
WEAPON_ANIMATION_SFALL_P, // p
WEAPON_ANIMATION_SFALL_Q, // q
WEAPON_ANIMATION_SFALL_T, // t
WEAPON_ANIMATION_COUNT,
} WeaponAnimation;

Some files were not shown because too many files have changed in this diff Show More