Showing preview only (4,348K chars total). Download the full file or copy to clipboard to get everything.
Repository: alexbatalov/fallout2-re
Branch: main
Commit: b135fc46ef40
Files: 262
Total size: 4.1 MB
Directory structure:
gitextract_y86dh7pr/
├── .clang-format
├── .editorconfig
├── .gitattributes
├── .github/
│ └── workflows/
│ └── ci-build.yml
├── .gitignore
├── CMakeLists.txt
├── CMakeSettings.json
├── LICENSE.md
├── README.md
├── src/
│ ├── game/
│ │ ├── ability.c
│ │ ├── ability.h
│ │ ├── actions.c
│ │ ├── actions.h
│ │ ├── amutex.c
│ │ ├── amutex.h
│ │ ├── anim.c
│ │ ├── anim.h
│ │ ├── art.c
│ │ ├── art.h
│ │ ├── artload.c
│ │ ├── artload.h
│ │ ├── automap.c
│ │ ├── automap.h
│ │ ├── bmpdlog.c
│ │ ├── bmpdlog.h
│ │ ├── cache.c
│ │ ├── cache.h
│ │ ├── cd.c
│ │ ├── cd.h
│ │ ├── combat.c
│ │ ├── combat.h
│ │ ├── combat_defs.h
│ │ ├── combatai.c
│ │ ├── combatai.h
│ │ ├── combatai_defs.h
│ │ ├── config.c
│ │ ├── config.h
│ │ ├── counter.c
│ │ ├── counter.h
│ │ ├── credits.c
│ │ ├── credits.h
│ │ ├── critter.c
│ │ ├── critter.h
│ │ ├── cycle.c
│ │ ├── cycle.h
│ │ ├── diskspce.c
│ │ ├── diskspce.h
│ │ ├── display.c
│ │ ├── display.h
│ │ ├── editor.c
│ │ ├── editor.h
│ │ ├── elevator.c
│ │ ├── elevator.h
│ │ ├── endgame.c
│ │ ├── endgame.h
│ │ ├── ereg.c
│ │ ├── ereg.h
│ │ ├── fontmgr.c
│ │ ├── fontmgr.h
│ │ ├── game.c
│ │ ├── game.h
│ │ ├── game_vars.h
│ │ ├── gconfig.c
│ │ ├── gconfig.h
│ │ ├── gdebug.c
│ │ ├── gdebug.h
│ │ ├── gdialog.c
│ │ ├── gdialog.h
│ │ ├── gmemory.c
│ │ ├── gmemory.h
│ │ ├── gmouse.c
│ │ ├── gmouse.h
│ │ ├── gmovie.c
│ │ ├── gmovie.h
│ │ ├── graphlib.c
│ │ ├── graphlib.h
│ │ ├── gsound.c
│ │ ├── gsound.h
│ │ ├── gz.c
│ │ ├── gz.h
│ │ ├── heap.c
│ │ ├── heap.h
│ │ ├── intface.c
│ │ ├── intface.h
│ │ ├── inventry.c
│ │ ├── inventry.h
│ │ ├── item.c
│ │ ├── item.h
│ │ ├── light.c
│ │ ├── light.h
│ │ ├── lip_sync.c
│ │ ├── lip_sync.h
│ │ ├── loadsave.c
│ │ ├── loadsave.h
│ │ ├── main.c
│ │ ├── main.h
│ │ ├── mainmenu.c
│ │ ├── mainmenu.h
│ │ ├── map.c
│ │ ├── map.h
│ │ ├── map_defs.h
│ │ ├── message.c
│ │ ├── message.h
│ │ ├── moviefx.c
│ │ ├── moviefx.h
│ │ ├── object.c
│ │ ├── object.h
│ │ ├── object_types.h
│ │ ├── options.c
│ │ ├── options.h
│ │ ├── palette.c
│ │ ├── palette.h
│ │ ├── party.c
│ │ ├── party.h
│ │ ├── perk.c
│ │ ├── perk.h
│ │ ├── perk_defs.h
│ │ ├── pipboy.c
│ │ ├── pipboy.h
│ │ ├── protinst.c
│ │ ├── protinst.h
│ │ ├── proto.c
│ │ ├── proto.h
│ │ ├── proto_types.h
│ │ ├── queue.c
│ │ ├── queue.h
│ │ ├── reaction.c
│ │ ├── reaction.h
│ │ ├── roll.c
│ │ ├── roll.h
│ │ ├── scripts.c
│ │ ├── scripts.h
│ │ ├── select.c
│ │ ├── select.h
│ │ ├── selfrun.c
│ │ ├── selfrun.h
│ │ ├── sfxcache.c
│ │ ├── sfxcache.h
│ │ ├── sfxlist.c
│ │ ├── sfxlist.h
│ │ ├── skill.c
│ │ ├── skill.h
│ │ ├── skill_defs.h
│ │ ├── skilldex.c
│ │ ├── skilldex.h
│ │ ├── stat.c
│ │ ├── stat.h
│ │ ├── stat_defs.h
│ │ ├── strparse.c
│ │ ├── strparse.h
│ │ ├── textobj.c
│ │ ├── textobj.h
│ │ ├── tile.c
│ │ ├── tile.h
│ │ ├── trait.c
│ │ ├── trait.h
│ │ ├── trait_defs.h
│ │ ├── trap.c
│ │ ├── trap.h
│ │ ├── version.c
│ │ ├── version.h
│ │ ├── wordwrap.c
│ │ ├── wordwrap.h
│ │ ├── worldmap.c
│ │ └── worldmap.h
│ ├── int/
│ │ ├── audio.c
│ │ ├── audio.h
│ │ ├── audiof.c
│ │ ├── audiof.h
│ │ ├── datafile.c
│ │ ├── datafile.h
│ │ ├── dialog.c
│ │ ├── dialog.h
│ │ ├── export.c
│ │ ├── export.h
│ │ ├── intlib.c
│ │ ├── intlib.h
│ │ ├── intrpret.c
│ │ ├── intrpret.h
│ │ ├── memdbg.c
│ │ ├── memdbg.h
│ │ ├── mousemgr.c
│ │ ├── mousemgr.h
│ │ ├── movie.c
│ │ ├── movie.h
│ │ ├── nevs.c
│ │ ├── nevs.h
│ │ ├── pcx.c
│ │ ├── pcx.h
│ │ ├── region.c
│ │ ├── region.h
│ │ ├── share1.c
│ │ ├── share1.h
│ │ ├── sound.c
│ │ ├── sound.h
│ │ ├── support/
│ │ │ ├── intextra.c
│ │ │ └── intextra.h
│ │ ├── widget.c
│ │ ├── widget.h
│ │ ├── window.c
│ │ └── window.h
│ ├── memory_defs.h
│ ├── mmx.c
│ ├── mmx.h
│ ├── movie_lib.c
│ ├── movie_lib.h
│ ├── plib/
│ │ ├── assoc/
│ │ │ ├── assoc.c
│ │ │ └── assoc.h
│ │ ├── color/
│ │ │ ├── color.c
│ │ │ └── color.h
│ │ ├── db/
│ │ │ ├── db.c
│ │ │ └── db.h
│ │ ├── gnw/
│ │ │ ├── button.c
│ │ │ ├── button.h
│ │ │ ├── debug.c
│ │ │ ├── debug.h
│ │ │ ├── doscmdln.c
│ │ │ ├── doscmdln.h
│ │ │ ├── dxinput.c
│ │ │ ├── dxinput.h
│ │ │ ├── gnw.c
│ │ │ ├── gnw.h
│ │ │ ├── gnw95dx.c
│ │ │ ├── gnw95dx.h
│ │ │ ├── gnw_types.h
│ │ │ ├── grbuf.c
│ │ │ ├── grbuf.h
│ │ │ ├── input.c
│ │ │ ├── input.h
│ │ │ ├── intrface.c
│ │ │ ├── intrface.h
│ │ │ ├── kb.c
│ │ │ ├── kb.h
│ │ │ ├── memory.c
│ │ │ ├── memory.h
│ │ │ ├── mouse.c
│ │ │ ├── mouse.h
│ │ │ ├── rect.c
│ │ │ ├── rect.h
│ │ │ ├── svga.c
│ │ │ ├── svga.h
│ │ │ ├── svga_types.h
│ │ │ ├── text.c
│ │ │ ├── text.h
│ │ │ ├── vcr.c
│ │ │ ├── vcr.h
│ │ │ ├── winmain.c
│ │ │ └── winmain.h
│ │ └── xfile/
│ │ ├── dfile.c
│ │ ├── dfile.h
│ │ ├── xfile.c
│ │ ├── xfile.h
│ │ ├── xsys_find.c
│ │ └── xsys_find.h
│ ├── sound_decoder.c
│ └── sound_decoder.h
└── third_party/
├── fpattern/
│ ├── CMakeLists.txt
│ ├── LICENSE
│ └── README.md
└── zlib/
├── CMakeLists.txt
├── LICENSE
└── README.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .clang-format
================================================
BasedOnStyle: WebKit
AllowShortIfStatementsOnASingleLine: WithoutElse
================================================
FILE: .editorconfig
================================================
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_white_space = true
================================================
FILE: .gitattributes
================================================
# Force LF
*.c text eol=lf
*.h text eol=lf
*.md text eol=lf
*.json text eol=lf
*.yml text eol=lf
.clang-format text eol=lf
.editorconfig text eol=lf
.gitattributes text eol=lf
.gitignore text eol=lf
CMakeLists.txt text eol=lf
LICENSE text eol=lf
================================================
FILE: .github/workflows/ci-build.yml
================================================
name: CI
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
defaults:
run:
shell: bash
jobs:
build:
runs-on: windows-2019
steps:
- name: Clone
uses: actions/checkout@v3
- name: Cache cmake build
uses: actions/cache@v3
with:
path: build
key: windows-x86-cmake-v1
- name: Configure
run: |
cmake \
-B build \
-G "Visual Studio 16 2019" \
-A Win32 \
# EOL
- name: Build
run: |
cmake \
--build build \
--config RelWithDebInfo \
# EOL
- name: Upload
uses: actions/upload-artifact@v3
with:
name: fallout2-re
path: build/RelWithDebInfo/fallout2-re.exe
retention-days: 7
================================================
FILE: .gitignore
================================================
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Dd]ebug-Remote/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Nuget personal access tokens and Credentials
nuget.config
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
.idea/
*.sln.iml
# CMake
/out
================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required(VERSION 3.13)
set(EXECUTABLE_NAME fallout2-re)
project(${EXECUTABLE_NAME})
add_executable(${EXECUTABLE_NAME} WIN32
"src/game/ability.c"
"src/game/ability.h"
"src/game/actions.c"
"src/game/actions.h"
"src/game/amutex.c"
"src/game/amutex.h"
"src/game/anim.c"
"src/game/anim.h"
"src/game/art.c"
"src/game/art.h"
"src/game/artload.c"
"src/game/artload.h"
"src/game/automap.c"
"src/game/automap.h"
"src/game/bmpdlog.c"
"src/game/bmpdlog.h"
"src/game/cache.c"
"src/game/cache.h"
"src/game/cd.c"
"src/game/cd.h"
"src/game/combat_defs.h"
"src/game/combat.c"
"src/game/combat.h"
"src/game/combatai_defs.h"
"src/game/combatai.c"
"src/game/combatai.h"
"src/game/config.c"
"src/game/config.h"
"src/game/counter.c"
"src/game/counter.h"
"src/game/credits.c"
"src/game/credits.h"
"src/game/critter.c"
"src/game/critter.h"
"src/game/cycle.c"
"src/game/cycle.h"
"src/game/diskspce.c"
"src/game/diskspce.h"
"src/game/display.c"
"src/game/display.h"
"src/game/editor.c"
"src/game/editor.h"
"src/game/elevator.c"
"src/game/elevator.h"
"src/game/endgame.c"
"src/game/endgame.h"
"src/game/ereg.c"
"src/game/ereg.h"
"src/game/fontmgr.c"
"src/game/fontmgr.h"
"src/game/game_vars.h"
"src/game/game.c"
"src/game/game.h"
"src/game/gconfig.c"
"src/game/gconfig.h"
"src/game/gdebug.c"
"src/game/gdebug.h"
"src/game/gdialog.c"
"src/game/gdialog.h"
"src/game/gmemory.c"
"src/game/gmemory.h"
"src/game/gmouse.c"
"src/game/gmouse.h"
"src/game/gmovie.c"
"src/game/gmovie.h"
"src/game/graphlib.c"
"src/game/graphlib.h"
"src/game/gsound.c"
"src/game/gsound.h"
"src/game/gz.c"
"src/game/gz.h"
"src/game/heap.c"
"src/game/heap.h"
"src/game/intface.c"
"src/game/intface.h"
"src/game/inventry.c"
"src/game/inventry.h"
"src/game/item.c"
"src/game/item.h"
"src/game/light.c"
"src/game/light.h"
"src/game/lip_sync.c"
"src/game/lip_sync.h"
"src/game/loadsave.c"
"src/game/loadsave.h"
"src/game/main.c"
"src/game/main.h"
"src/game/mainmenu.c"
"src/game/mainmenu.h"
"src/game/map_defs.h"
"src/game/map.c"
"src/game/map.h"
"src/game/message.c"
"src/game/message.h"
"src/game/moviefx.c"
"src/game/moviefx.h"
"src/game/object_types.h"
"src/game/object.c"
"src/game/object.h"
"src/game/options.c"
"src/game/options.h"
"src/game/palette.c"
"src/game/palette.h"
"src/game/party.c"
"src/game/party.h"
"src/game/perk_defs.h"
"src/game/perk.c"
"src/game/perk.h"
"src/game/pipboy.c"
"src/game/pipboy.h"
"src/game/protinst.c"
"src/game/protinst.h"
"src/game/proto_types.h"
"src/game/proto.c"
"src/game/proto.h"
"src/game/queue.c"
"src/game/queue.h"
"src/game/reaction.c"
"src/game/reaction.h"
"src/game/roll.c"
"src/game/roll.h"
"src/game/scripts.c"
"src/game/scripts.h"
"src/game/select.c"
"src/game/select.h"
"src/game/selfrun.c"
"src/game/selfrun.h"
"src/game/sfxcache.c"
"src/game/sfxcache.h"
"src/game/sfxlist.c"
"src/game/sfxlist.h"
"src/game/skill_defs.h"
"src/game/skill.c"
"src/game/skill.h"
"src/game/skilldex.c"
"src/game/skilldex.h"
"src/game/stat_defs.h"
"src/game/stat.c"
"src/game/stat.h"
"src/game/strparse.c"
"src/game/strparse.h"
"src/game/textobj.c"
"src/game/textobj.h"
"src/game/tile.c"
"src/game/tile.h"
"src/game/trait_defs.h"
"src/game/trait.c"
"src/game/trait.h"
"src/game/trap.c"
"src/game/trap.h"
"src/game/version.c"
"src/game/version.h"
"src/game/wordwrap.c"
"src/game/wordwrap.h"
"src/game/worldmap.c"
"src/game/worldmap.h"
"src/int/audio.c"
"src/int/audio.h"
"src/int/audiof.c"
"src/int/audiof.h"
"src/int/datafile.c"
"src/int/datafile.h"
"src/int/dialog.c"
"src/int/dialog.h"
"src/int/export.c"
"src/int/export.h"
"src/int/intlib.c"
"src/int/intlib.h"
"src/int/intrpret.c"
"src/int/intrpret.h"
"src/int/memdbg.c"
"src/int/memdbg.h"
"src/int/mousemgr.c"
"src/int/mousemgr.h"
"src/int/movie.c"
"src/int/movie.h"
"src/int/nevs.c"
"src/int/nevs.h"
"src/int/pcx.c"
"src/int/pcx.h"
"src/int/region.c"
"src/int/region.h"
"src/int/share1.c"
"src/int/share1.h"
"src/int/sound.c"
"src/int/sound.h"
"src/int/support/intextra.c"
"src/int/support/intextra.h"
"src/int/widget.c"
"src/int/widget.h"
"src/int/window.c"
"src/int/window.h"
"src/plib/assoc/assoc.c"
"src/plib/assoc/assoc.h"
"src/plib/color/color.c"
"src/plib/color/color.h"
"src/plib/db/db.c"
"src/plib/db/db.h"
"src/plib/gnw/button.c"
"src/plib/gnw/button.h"
"src/plib/gnw/debug.c"
"src/plib/gnw/debug.h"
"src/plib/gnw/doscmdln.c"
"src/plib/gnw/doscmdln.h"
"src/plib/gnw/dxinput.c"
"src/plib/gnw/dxinput.h"
"src/plib/gnw/gnw95dx.c"
"src/plib/gnw/gnw95dx.h"
"src/plib/gnw/grbuf.c"
"src/plib/gnw/grbuf.h"
"src/plib/gnw/input.c"
"src/plib/gnw/input.h"
"src/plib/gnw/gnw_types.h"
"src/plib/gnw/gnw.c"
"src/plib/gnw/gnw.h"
"src/plib/gnw/intrface.c"
"src/plib/gnw/intrface.h"
"src/plib/gnw/kb.c"
"src/plib/gnw/kb.h"
"src/plib/gnw/memory.c"
"src/plib/gnw/memory.h"
"src/plib/gnw/mouse.c"
"src/plib/gnw/mouse.h"
"src/plib/gnw/rect.c"
"src/plib/gnw/rect.h"
"src/plib/gnw/svga_types.h"
"src/plib/gnw/svga.c"
"src/plib/gnw/svga.h"
"src/plib/gnw/text.c"
"src/plib/gnw/text.h"
"src/plib/gnw/vcr.c"
"src/plib/gnw/vcr.h"
"src/plib/gnw/winmain.c"
"src/plib/gnw/winmain.h"
"src/plib/xfile/dfile.c"
"src/plib/xfile/dfile.h"
"src/plib/xfile/xfile.c"
"src/plib/xfile/xfile.h"
"src/plib/xfile/xsys_find.c"
"src/plib/xfile/xsys_find.h"
"src/memory_defs.h"
"src/mmx.c"
"src/mmx.h"
"src/movie_lib.c"
"src/movie_lib.h"
"src/sound_decoder.c"
"src/sound_decoder.h"
)
target_include_directories(${EXECUTABLE_NAME} PUBLIC src)
target_compile_definitions(${EXECUTABLE_NAME} PUBLIC
_CRT_SECURE_NO_WARNINGS
_CRT_NONSTDC_NO_WARNINGS
)
target_link_libraries(${EXECUTABLE_NAME}
winmm
)
add_subdirectory("third_party/fpattern")
target_link_libraries(${EXECUTABLE_NAME} ${FPATTERN_LIBRARY})
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${FPATTERN_INCLUDE_DIR})
add_subdirectory("third_party/zlib")
target_link_libraries(${EXECUTABLE_NAME} ${ZLIB_LIBRARIES})
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${ZLIB_INCLUDE_DIRS})
================================================
FILE: CMakeSettings.json
================================================
{
"configurations": [
{
"name": "x86-Debug",
"generator": "Visual Studio 16 2019",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x86" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": ""
},
{
"name": "x86-Release",
"generator": "Visual Studio 16 2019",
"configurationType": "Release",
"inheritEnvironments": [ "msvc_x86" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": ""
}
]
}
================================================
FILE: LICENSE.md
================================================
# Sustainable Use License
Version 1.0
## Acceptance
By using the software, you agree to all of the terms and conditions below.
## Copyright License
The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations below.
## Limitations
You may use or modify the software only for your own internal business purposes or for non-commercial or personal use. You may distribute the software or provide it to others only if you do so free of charge for non-commercial purposes. You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
## Patents
The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
## Notices
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms. If you modify the software, you must include in any modified copies of the software a prominent notice stating that you have modified the software.
## No Other Rights
These terms do not imply any licenses other than those expressly granted in these terms.
## Termination
If you use the software in violation of these terms, such use is not licensed, and your license will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your license will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your license to terminate automatically and permanently.
## No Liability
As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
## Definitions
The "licensor" is the entity offering these terms.
The "software" is the software the licensor makes available under these terms, including any portion of it.
"You" refers to the individual or entity agreeing to these terms.
"Your company" is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. Control means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
"Your license" is the license granted to you for the software under these terms.
"Use" means anything you do with the software requiring your license.
"Trademark" means trademarks, service marks, and similar rights.
================================================
FILE: README.md
================================================
# Fallout 2 Reference Edition
In this repository you'll find reverse engineered source code for Fallout 2.
As a player/gamer you're most likely interested in [Fallout 2 Community Edition](https://github.com/alexbatalov/fallout2-ce) which is based on this project.
If you're a developer you might also want to check [Fallout Reference Edition](https://github.com/alexbatalov/fallout1-re) to see evolution of the engine.
## Goal
The goal of this project is to restore original source code as close possible with all it's imperfections. In very many respects this goal can be considered achieved.
## Status
There is a small number of functions which are not yet decompiled. These functions are not essential to gameplay, most of them are leftovers from Fallout 1, others are a part of larger APIs that were not fully utilized. Aside from these missing functions there is ongoing effort to update the codebase to C89 to make sure the game can be compiled with Watcom C compiler (which might be handy to achieve binary identical results). This tasks are low priority and probably will never be completed.
## Installation
You must own the game to play. Purchase your copy on [GOG](https://www.gog.com/game/fallout_2) or [Steam](https://store.steampowered.com/app/38410). Download latest build or build from source. The `fallout2-re.exe` serves as a drop-in replacement for `fallout2.exe`. Copy it to your Fallout 2 directory and run.
## Legal
The source code in this repository is produced by reverse engineering the original binary. There are couple of exceptions for reverse engineering under DMCA - documentation, interoperability, fair use. Documentation is needed to achieve interoperability. Running your legally purchased copy on modern Mac M1 for example (interoperability in action) constitutes fair use. Publishing this stuff to wide audience is questionable. Eventually it's up to Bethesda/Microsoft to takedown the project or leave it be. See [#29](https://github.com/alexbatalov/fallout2-re/issues/29) for discussion.
## License
The source code is this repository is available under the [Sustainable Use License](LICENSE.md).
================================================
FILE: src/game/ability.c
================================================
#include "game/ability.h"
#include <string.h>
#include "plib/gnw/memory.h"
// 0x410010
int abil_init(Ability* ability, int initialCapacity)
{
ability->length = 0;
ability->capacity = 0;
ability->entries = NULL;
if (initialCapacity != 0) {
ability->entries = (AbilityData*)mem_malloc(sizeof(*ability->entries) * initialCapacity);
if (ability->entries != NULL) {
ability->length = 0;
ability->capacity = initialCapacity;
return 0;
}
}
return -1;
}
// 0x410058
int abil_resize(Ability* ability, int capacity)
{
AbilityData* entries;
if (capacity >= ability->length) {
entries = (AbilityData*)mem_realloc(ability->entries, sizeof(*ability->entries) * capacity);
if (entries != NULL) {
ability->entries = entries;
ability->capacity = capacity;
return 0;
}
}
return -1;
}
// 0x410094
int abil_free(Ability* ability)
{
if (ability->entries != NULL) {
mem_free(ability->entries);
}
return 0;
}
// 0x4100A8
int abil_find(Ability* ability, int a2, int* indexPtr)
{
int right;
int left;
int mid;
int cmp;
int rc;
if (ability->length == 0) {
rc = -1;
*indexPtr = 0;
} else {
right = ability->length - 1;
left = 0;
while (right >= left) {
mid = (right + left) >> 1;
if (a2 == ability->entries[mid].field_0) {
cmp = 0;
break;
}
if (a2 < ability->entries[mid].field_0) {
right = mid - 1;
cmp = -1;
} else {
left = mid + 1;
cmp = 1;
}
}
if (cmp == 0) {
*indexPtr = mid;
rc = 0;
} else {
if (cmp < 0) {
*indexPtr = mid;
} else {
*indexPtr = mid + 1;
}
rc = -1;
}
}
return rc;
}
// 0x410130
int abil_search(Ability* ability, int a2)
{
int index;
if (abil_find(ability, a2, &index) == 0) {
return index;
}
return -1;
}
// 0x410154
int abil_insert(Ability* ability, AbilityData* entry)
{
int index;
if (abil_find(ability, entry->field_0, &index) == 0) {
return -1;
}
if (ability->capacity == ability->length && abil_resize(ability, ability->capacity * 2) == -1) {
return -1;
}
if (sizeof(*ability->entries) * (ability->length - index) != 0) {
memmove((unsigned char*)ability->entries + sizeof(*ability->entries) * index + sizeof(*ability->entries),
(unsigned char*)ability->entries + sizeof(*ability->entries) * index,
sizeof(*ability->entries) * (ability->length - index));
}
ability->entries[index].field_0 = entry->field_0;
ability->entries[index].field_4 = entry->field_4;
ability->entries[index].field_8 = entry->field_8;
ability->length++;
return 0;
}
// 0x41021C
int abil_delete(Ability* ability, int a2)
{
int index;
if (abil_find(ability, a2, &index) == -1) {
return -1;
}
ability->length--;
if (sizeof(*ability->entries) * (ability->length - index) != 0) {
memmove((unsigned char*)ability->entries + sizeof(*ability->entries) * index,
(unsigned char*)ability->entries + sizeof(*ability->entries) * index + sizeof(*ability->entries),
sizeof(*ability->entries) * (ability->length - index));
}
return 0;
}
// 0x41026C
int abil_copy(Ability* dest, Ability* src)
{
int index;
if (abil_init(dest, src->capacity) == -1) {
return -1;
}
for (index = 0; index < src->length; index++) {
if (abil_insert(dest, &(src->entries[index])) == -1) {
return -1;
}
}
return 0;
}
// 0x4102B0
int abil_load(File* stream, Ability* ability)
{
if (db_freadInt(stream, &(ability->length)) == -1
|| db_freadInt(stream, &(ability->capacity)) == -1
|| abil_read_ability_data(ability, stream) == -1) return -1;
return 0;
}
// 0x4102EC
int abil_read_ability_data(Ability* ability, File* stream)
{
int index;
ability->entries = (AbilityData*)mem_malloc(sizeof(*ability->entries) * ability->capacity);
if (ability->entries == NULL) {
return -1;
}
for (index = 0; index < ability->length; index++) {
if (db_freadInt(stream, &(ability->entries[index].field_0)) == -1
|| db_freadInt(stream, &(ability->entries[index].field_4)) == -1
|| db_freadInt(stream, &(ability->entries[index].field_8)) == -1) {
return -1;
}
}
return 0;
}
// 0x410378
int abil_save(File* stream, Ability* ability)
{
if (db_fwriteInt(stream, ability->length) == -1
|| db_fwriteInt(stream, ability->capacity) == -1
|| abil_write_ability_data(ability->length, ability->entries, stream) == -1) {
return -1;
}
return 0;
}
// 0x4103B8
int abil_write_ability_data(int length, AbilityData* entries, File* stream)
{
int index;
for (index = 0; index < length; index++) {
if (db_fwriteInt(stream, entries[index].field_0) == -1
|| db_fwriteInt(stream, entries[index].field_4) == -1
|| db_fwriteInt(stream, entries[index].field_8) == -1) {
return -1;
}
}
return 0;
}
================================================
FILE: src/game/ability.h
================================================
#ifndef FALLOUT_GAME_ABILITY_H_
#define FALLOUT_GAME_ABILITY_H_
#include "plib/db/db.h"
typedef struct AbilityData {
int field_0;
int field_4;
int field_8;
} AbilityData;
typedef struct Ability {
int length;
int capacity;
AbilityData* entries;
} Ability;
int abil_init(Ability* ability, int initialCapacity);
int abil_resize(Ability* ability, int capacity);
int abil_free(Ability* ability);
int abil_find(Ability* ability, int a2, int* indexPtr);
int abil_search(Ability* ability, int a2);
int abil_insert(Ability* ability, AbilityData* entry);
int abil_delete(Ability* ability, int a2);
int abil_copy(Ability* dest, Ability* src);
int abil_load(File* stream, Ability* ability);
int abil_read_ability_data(Ability* ability, File* stream);
int abil_save(File* stream, Ability* ability);
int abil_write_ability_data(int length, AbilityData* entries, File* stream);
#endif /* FALLOUT_GAME_ABILITY_H_ */
================================================
FILE: src/game/actions.c
================================================
#include "game/actions.h"
#include <limits.h>
#include <string.h>
#include "game/anim.h"
#include "plib/color/color.h"
#include "game/combat.h"
#include "game/combatai.h"
#include "game/config.h"
#include "plib/gnw/input.h"
#include "game/critter.h"
#include "plib/gnw/debug.h"
#include "game/display.h"
#include "game/game.h"
#include "game/gconfig.h"
#include "game/gmouse.h"
#include "game/gsound.h"
#include "plib/gnw/rect.h"
#include "game/intface.h"
#include "game/item.h"
#include "game/map.h"
#include "plib/gnw/memory.h"
#include "game/object.h"
#include "game/perk.h"
#include "game/proto.h"
#include "game/protinst.h"
#include "game/roll.h"
#include "game/scripts.h"
#include "game/skill.h"
#include "game/stat.h"
#include "game/textobj.h"
#include "game/tile.h"
#include "game/trait.h"
#include "plib/gnw/svga.h"
static int pick_death(Object* attacker, Object* defender, Object* weapon, int damage, int anim, bool isFallingBack);
static int check_death(Object* obj, int anim, int minViolenceLevel, bool isFallingBack);
static int internal_destroy(Object* a1, Object* a2);
static int show_death(Object* obj, int anim);
static int action_melee(Attack* attack, int a2);
static int action_ranged(Attack* attack, int a2);
static int is_next_to(Object* a1, Object* a2);
static int action_climb_ladder(Object* a1, Object* a2);
static int report_explosion(Attack* attack, Object* a2);
static int finished_explosion(Object* a1, Object* a2);
static int compute_explosion_damage(int min, int max, Object* a3, int* a4);
static int can_talk_to(Object* a1, Object* a2);
static int talk_to(Object* a1, Object* a2);
static int report_dmg(Attack* attack, Object* a2);
static int compute_dmg_damage(int min, int max, Object* obj, int* a4, int damage_type);
// 0x5106D0
static bool action_in_explode = false;
// 0x5106D4
unsigned int rotation = 0;
// 0x5106D8
int obj_fid = -1;
// 0x5106DC
int obj_pid_old = -1;
// TODO: Strange location in debug build, check if it's static in |pick_death|.
//
// 0x5106E0
static int death_2[DAMAGE_TYPE_COUNT] = {
ANIM_DANCING_AUTOFIRE,
ANIM_SLICED_IN_HALF,
ANIM_CHARRED_BODY,
ANIM_CHARRED_BODY,
ANIM_ELECTRIFY,
ANIM_FALL_BACK,
ANIM_BIG_HOLE,
};
// TODO: Strange location in debug build, check if it's static in |pick_death|.
//
// 0x5106FC
static int death_3[DAMAGE_TYPE_COUNT] = {
ANIM_CHUNKS_OF_FLESH,
ANIM_SLICED_IN_HALF,
ANIM_FIRE_DANCE,
ANIM_MELTED_TO_NOTHING,
ANIM_ELECTRIFIED_TO_NOTHING,
ANIM_FALL_BACK,
ANIM_EXPLODED_TO_NOTHING,
};
// NOTE: Unused.
//
// 0x410410
void switch_dude()
{
Object* critter;
int gender;
critter = pick_object(OBJ_TYPE_CRITTER, false);
if (critter != NULL) {
gender = critterGetStat(critter, STAT_GENDER);
stat_set_base(obj_dude, STAT_GENDER, gender);
obj_dude = critter;
obj_fid = critter->fid;
obj_pid_old = critter->pid;
critter->pid = 0x1000000;
}
}
// 0x410468
int action_knockback(Object* obj, int* anim, int maxDistance, int rotation, int delay)
{
if (critter_flag_check(obj->pid, CRITTER_NO_KNOCKBACK)) {
return -1;
}
if (*anim == ANIM_FALL_FRONT) {
int fid = art_id(OBJ_TYPE_CRITTER, obj->fid & 0xFFF, *anim, (obj->fid & 0xF000) >> 12, obj->rotation + 1);
if (!art_exists(fid)) {
*anim = ANIM_FALL_BACK;
}
}
int distance;
int tile;
for (distance = 1; distance <= maxDistance; distance++) {
tile = tile_num_in_direction(obj->tile, rotation, distance);
if (obj_blocking_at(obj, tile, obj->elevation) != NULL) {
distance--;
break;
}
}
const char* soundEffectName = gsnd_build_character_sfx_name(obj, *anim, CHARACTER_SOUND_EFFECT_KNOCKDOWN);
register_object_play_sfx(obj, soundEffectName, delay);
// TODO: Check, probably step back because we've started with 1?
distance--;
if (distance <= 0) {
tile = obj->tile;
register_object_animate(obj, *anim, 0);
} else {
tile = tile_num_in_direction(obj->tile, rotation, distance);
register_object_animate_and_move_straight(obj, tile, obj->elevation, *anim, 0);
}
return tile;
}
// 0x410568
int action_blood(Object* obj, int anim, int delay)
{
int violence_level = VIOLENCE_LEVEL_MAXIMUM_BLOOD;
config_get_value(&game_config, GAME_CONFIG_PREFERENCES_KEY, GAME_CONFIG_VIOLENCE_LEVEL_KEY, &violence_level);
if (violence_level == VIOLENCE_LEVEL_NONE) {
return anim;
}
int bloodyAnim;
if (anim == ANIM_FALL_BACK) {
bloodyAnim = ANIM_FALL_BACK_BLOOD;
} else if (anim == ANIM_FALL_FRONT) {
bloodyAnim = ANIM_FALL_FRONT_BLOOD;
} else {
return anim;
}
int fid = art_id(OBJ_TYPE_CRITTER, obj->fid & 0xFFF, bloodyAnim, (obj->fid & 0xF000) >> 12, obj->rotation + 1);
if (art_exists(fid)) {
register_object_animate(obj, bloodyAnim, delay);
} else {
bloodyAnim = anim;
}
return bloodyAnim;
}
// 0x41060C
static int pick_death(Object* attacker, Object* defender, Object* weapon, int damage, int anim, bool isFallingBack)
{
int normalViolenceLevelDamageThreshold = 15;
int maximumBloodViolenceLevelDamageThreshold = 45;
int damageType = item_w_damage_type(attacker, weapon);
if (weapon != NULL && weapon->pid == PROTO_ID_MOLOTOV_COCKTAIL) {
normalViolenceLevelDamageThreshold = 5;
maximumBloodViolenceLevelDamageThreshold = 15;
damageType = DAMAGE_TYPE_FIRE;
anim = ANIM_FIRE_SINGLE;
}
if (attacker == obj_dude && perkHasRank(attacker, PERK_PYROMANIAC) && damageType == DAMAGE_TYPE_FIRE) {
normalViolenceLevelDamageThreshold = 1;
maximumBloodViolenceLevelDamageThreshold = 1;
}
if (weapon != NULL && item_w_perk(weapon) == PERK_WEAPON_FLAMEBOY) {
normalViolenceLevelDamageThreshold /= 3;
maximumBloodViolenceLevelDamageThreshold /= 3;
}
int violenceLevel = VIOLENCE_LEVEL_MAXIMUM_BLOOD;
config_get_value(&game_config, GAME_CONFIG_PREFERENCES_KEY, GAME_CONFIG_VIOLENCE_LEVEL_KEY, &violenceLevel);
if (critter_flag_check(defender->pid, CRITTER_SPECIAL_DEATH)) {
return check_death(defender, ANIM_EXPLODED_TO_NOTHING, VIOLENCE_LEVEL_NORMAL, isFallingBack);
}
bool hasBloodyMess = false;
if (attacker == obj_dude && trait_level(TRAIT_BLOODY_MESS)) {
hasBloodyMess = true;
}
// NOTE: Original code is slightly different. There are lots of jumps and
// conditions. It's easier to set the default in advance, rather than catch
// it with bunch of "else" statements.
int deathAnim = ANIM_FALL_BACK;
if ((anim == ANIM_THROW_PUNCH && damageType == DAMAGE_TYPE_NORMAL)
|| anim == ANIM_KICK_LEG
|| anim == ANIM_THRUST_ANIM
|| anim == ANIM_SWING_ANIM
|| (anim == ANIM_THROW_ANIM && damageType != DAMAGE_TYPE_EXPLOSION)) {
if (violenceLevel == VIOLENCE_LEVEL_MAXIMUM_BLOOD && hasBloodyMess) {
deathAnim = ANIM_BIG_HOLE;
}
} else {
if (anim == ANIM_FIRE_SINGLE && damageType == DAMAGE_TYPE_NORMAL) {
if (violenceLevel == VIOLENCE_LEVEL_MAXIMUM_BLOOD) {
if (hasBloodyMess || maximumBloodViolenceLevelDamageThreshold <= damage) {
deathAnim = ANIM_BIG_HOLE;
}
}
} else {
if (violenceLevel > VIOLENCE_LEVEL_MINIMAL && (hasBloodyMess || normalViolenceLevelDamageThreshold <= damage)) {
if (violenceLevel > VIOLENCE_LEVEL_NORMAL && (hasBloodyMess || maximumBloodViolenceLevelDamageThreshold <= damage)) {
deathAnim = death_3[damageType];
if (check_death(defender, deathAnim, VIOLENCE_LEVEL_MAXIMUM_BLOOD, isFallingBack) != deathAnim) {
deathAnim = death_2[damageType];
}
} else {
deathAnim = death_2[damageType];
}
}
}
}
if (!isFallingBack && deathAnim == ANIM_FALL_BACK) {
deathAnim = ANIM_FALL_FRONT;
}
return check_death(defender, deathAnim, VIOLENCE_LEVEL_NONE, isFallingBack);
}
// 0x410814
static int check_death(Object* obj, int anim, int minViolenceLevel, bool isFallingBack)
{
int fid;
int violenceLevel = VIOLENCE_LEVEL_MAXIMUM_BLOOD;
config_get_value(&game_config, GAME_CONFIG_PREFERENCES_KEY, GAME_CONFIG_VIOLENCE_LEVEL_KEY, &violenceLevel);
if (violenceLevel >= minViolenceLevel) {
fid = art_id(OBJ_TYPE_CRITTER, obj->fid & 0xFFF, anim, (obj->fid & 0xF000) >> 12, obj->rotation + 1);
if (art_exists(fid)) {
return anim;
}
}
if (isFallingBack) {
return ANIM_FALL_BACK;
}
fid = art_id(OBJ_TYPE_CRITTER, obj->fid & 0xFFF, ANIM_FALL_FRONT, (obj->fid & 0xF000) >> 12, obj->rotation + 1);
if (art_exists(fid)) {
return ANIM_FALL_BACK;
}
return ANIM_FALL_FRONT;
}
// 0x4108C8
static int internal_destroy(Object* a1, Object* a2)
{
return obj_destroy(a2);
}
// TODO: Check very carefully, lots of conditions and jumps.
//
// 0x4108D0
void show_damage_to_object(Object* a1, int damage, int flags, Object* weapon, bool isFallingBack, int knockbackDistance, int knockbackRotation, int a8, Object* a9, int a10)
{
int anim;
int fid;
const char* sfx_name;
if (critter_flag_check(a1->pid, CRITTER_NO_KNOCKBACK)) {
knockbackDistance = 0;
}
anim = FID_ANIM_TYPE(a1->fid);
if (!critter_is_prone(a1)) {
if ((flags & DAM_DEAD) != 0) {
fid = art_id(OBJ_TYPE_MISC, 10, 0, 0, 0);
if (fid == a9->fid) {
anim = check_death(a1, ANIM_EXPLODED_TO_NOTHING, VIOLENCE_LEVEL_MAXIMUM_BLOOD, isFallingBack);
} else if (a9->pid == PROTO_ID_0x20001EB) {
anim = check_death(a1, ANIM_ELECTRIFIED_TO_NOTHING, VIOLENCE_LEVEL_MAXIMUM_BLOOD, isFallingBack);
} else if (a9->fid == FID_0x20001F5) {
anim = check_death(a1, a8, VIOLENCE_LEVEL_MAXIMUM_BLOOD, isFallingBack);
} else {
anim = pick_death(a9, a1, weapon, damage, a8, isFallingBack);
}
if (anim != ANIM_FIRE_DANCE) {
if (knockbackDistance != 0 && (anim == ANIM_FALL_FRONT || anim == ANIM_FALL_BACK)) {
action_knockback(a1, &anim, knockbackDistance, knockbackRotation, a10);
anim = action_blood(a1, anim, -1);
} else {
sfx_name = gsnd_build_character_sfx_name(a1, anim, CHARACTER_SOUND_EFFECT_DIE);
register_object_play_sfx(a1, sfx_name, a10);
anim = pick_fall(a1, anim);
register_object_animate(a1, anim, 0);
if (anim == ANIM_FALL_FRONT || anim == ANIM_FALL_BACK) {
anim = action_blood(a1, anim, -1);
}
}
} else {
fid = art_id(OBJ_TYPE_CRITTER, a1->fid & 0xFFF, ANIM_FIRE_DANCE, (a1->fid & 0xF000) >> 12, a1->rotation + 1);
if (art_exists(fid)) {
sfx_name = gsnd_build_character_sfx_name(a1, anim, CHARACTER_SOUND_EFFECT_UNUSED);
register_object_play_sfx(a1, sfx_name, a10);
register_object_animate(a1, anim, 0);
int randomDistance = roll_random(2, 5);
int randomRotation = roll_random(0, 5);
while (randomDistance > 0) {
int tile = tile_num_in_direction(a1->tile, randomRotation, randomDistance);
Object* v35 = NULL;
make_straight_path(a1, a1->tile, tile, NULL, &v35, 4);
if (v35 == NULL) {
register_object_turn_towards(a1, tile);
register_object_move_straight_to_tile(a1, tile, a1->elevation, anim, 0);
break;
}
randomDistance--;
}
}
anim = ANIM_BURNED_TO_NOTHING;
sfx_name = gsnd_build_character_sfx_name(a1, anim, CHARACTER_SOUND_EFFECT_UNUSED);
register_object_play_sfx(a1, sfx_name, -1);
register_object_animate(a1, anim, 0);
}
} else {
if ((flags & (DAM_KNOCKED_OUT | DAM_KNOCKED_DOWN)) != 0) {
anim = isFallingBack ? ANIM_FALL_BACK : ANIM_FALL_FRONT;
sfx_name = gsnd_build_character_sfx_name(a1, anim, CHARACTER_SOUND_EFFECT_UNUSED);
register_object_play_sfx(a1, sfx_name, a10);
if (knockbackDistance != 0) {
action_knockback(a1, &anim, knockbackDistance, knockbackRotation, 0);
} else {
anim = pick_fall(a1, anim);
register_object_animate(a1, anim, 0);
}
} else if ((flags & DAM_ON_FIRE) != 0 && art_exists(art_id(OBJ_TYPE_CRITTER, a1->fid & 0xFFF, ANIM_FIRE_DANCE, (a1->fid & 0xF000) >> 12, a1->rotation + 1))) {
register_object_animate(a1, ANIM_FIRE_DANCE, a10);
fid = art_id(OBJ_TYPE_CRITTER, a1->fid & 0xFFF, ANIM_STAND, (a1->fid & 0xF000) >> 12, a1->rotation + 1);
register_object_change_fid(a1, fid, -1);
} else {
if (knockbackDistance != 0) {
anim = isFallingBack ? ANIM_FALL_BACK : ANIM_FALL_FRONT;
action_knockback(a1, &anim, knockbackDistance, knockbackRotation, a10);
if (anim == ANIM_FALL_BACK) {
register_object_animate(a1, ANIM_BACK_TO_STANDING, -1);
} else {
register_object_animate(a1, ANIM_PRONE_TO_STANDING, -1);
}
} else {
if (isFallingBack || !art_exists(art_id(OBJ_TYPE_CRITTER, a1->fid & 0xFFF, ANIM_HIT_FROM_BACK, (a1->fid & 0xF000) >> 12, a1->rotation + 1))) {
anim = ANIM_HIT_FROM_FRONT;
} else {
anim = ANIM_HIT_FROM_BACK;
}
sfx_name = gsnd_build_character_sfx_name(a1, anim, CHARACTER_SOUND_EFFECT_UNUSED);
register_object_play_sfx(a1, sfx_name, a10);
register_object_animate(a1, anim, 0);
}
}
}
} else {
if ((flags & DAM_DEAD) != 0 && (a1->data.critter.combat.results & DAM_DEAD) == 0) {
anim = action_blood(a1, anim, a10);
} else {
return;
}
}
if (weapon != NULL) {
if ((flags & DAM_EXPLODE) != 0) {
register_object_must_call(a1, weapon, obj_drop, -1);
fid = art_id(OBJ_TYPE_MISC, 10, 0, 0, 0);
register_object_change_fid(weapon, fid, 0);
register_object_animate_and_hide(weapon, ANIM_STAND, 0);
sfx_name = gsnd_build_weapon_sfx_name(WEAPON_SOUND_EFFECT_HIT, weapon, HIT_MODE_RIGHT_WEAPON_PRIMARY, a1);
register_object_play_sfx(weapon, sfx_name, 0);
register_object_must_erase(weapon);
} else if ((flags & DAM_DESTROY) != 0) {
register_object_must_call(a1, weapon, internal_destroy, -1);
} else if ((flags & DAM_DROP) != 0) {
register_object_must_call(a1, weapon, obj_drop, -1);
}
}
if ((flags & DAM_DEAD) != 0) {
// TODO: Get rid of casts.
register_object_must_call(a1, (void*)anim, (AnimationCallback*)show_death, -1);
}
}
// 0x410E24
static int show_death(Object* obj, int anim)
{
Rect v7;
Rect v8;
int fid;
obj_bound(obj, &v8);
if (anim < 48 && anim > 63) {
fid = art_id(OBJ_TYPE_CRITTER, obj->fid & 0xFFF, anim + 28, (obj->fid & 0xF000) >> 12, obj->rotation + 1);
if (obj_change_fid(obj, fid, &v7) == 0) {
rect_min_bound(&v8, &v7, &v8);
}
if (obj_set_frame(obj, 0, &v7) == 0) {
rect_min_bound(&v8, &v7, &v8);
}
}
if (critter_flag_check(obj->pid, CRITTER_FLAT) == 0) {
obj->flags |= OBJECT_NO_BLOCK;
if (obj_toggle_flat(obj, &v7) == 0) {
rect_min_bound(&v8, &v7, &v8);
}
}
if (obj_turn_off_outline(obj, &v7) == 0) {
rect_min_bound(&v8, &v7, &v8);
}
if (anim >= 30 && anim <= 31 && critter_flag_check(obj->pid, CRITTER_SPECIAL_DEATH) == 0 && critter_flag_check(obj->pid, CRITTER_NO_DROP) == 0) {
item_drop_all(obj, obj->tile);
}
tile_refresh_rect(&v8, obj->elevation);
return 0;
}
// NOTE: Unused.
//
// 0x410F48
int show_damage_target(Attack* attack)
{
int frontHit;
if (FID_TYPE(attack->defender->fid) == OBJ_TYPE_CRITTER) {
// NOTE: Uninline.
frontHit = is_hit_from_front(attack->attacker, attack->defender);
register_begin(ANIMATION_REQUEST_RESERVED);
register_priority(1);
show_damage_to_object(attack->defender,
attack->defenderDamage,
attack->defenderFlags,
attack->weapon,
frontHit,
attack->defenderKnockback,
tile_dir(attack->attacker->tile, attack->defender->tile),
item_w_anim(attack->attacker, attack->hitMode),
attack->attacker,
0);
register_end();
}
return 0;
}
// 0x410FEC
int show_damage_extras(Attack* attack)
{
int v6;
int v8;
int v9;
for (int index = 0; index < attack->extrasLength; index++) {
Object* obj = attack->extras[index];
if (FID_TYPE(obj->fid) == OBJ_TYPE_CRITTER) {
int delta = attack->attacker->rotation - obj->rotation;
if (delta < 0) {
delta = -delta;
}
v6 = delta != 0 && delta != 1 && delta != 5;
register_begin(ANIMATION_REQUEST_RESERVED);
register_priority(1);
v8 = item_w_anim(attack->attacker, attack->hitMode);
v9 = tile_dir(attack->attacker->tile, obj->tile);
show_damage_to_object(obj, attack->extrasDamage[index], attack->extrasFlags[index], attack->weapon, v6, attack->extrasKnockback[index], v9, v8, attack->attacker, 0);
register_end();
}
}
return 0;
}
// 0x4110AC
void show_damage(Attack* attack, int a2, int a3)
{
int v5;
int v14;
int v17;
int v15;
v5 = a3;
for (int index = 0; index < attack->extrasLength; index++) {
Object* object = attack->extras[index];
if (FID_TYPE(object->fid) == OBJ_TYPE_CRITTER) {
register_ping(2, v5);
v5 = 0;
}
}
if ((attack->attackerFlags & DAM_HIT) == 0) {
if ((attack->attackerFlags & DAM_CRITICAL) != 0) {
show_damage_to_object(attack->attacker, attack->attackerDamage, attack->attackerFlags, attack->weapon, 1, 0, 0, a2, attack->attacker, -1);
} else if ((attack->attackerFlags & DAM_BACKWASH) != 0) {
show_damage_to_object(attack->attacker, attack->attackerDamage, attack->attackerFlags, attack->weapon, 1, 0, 0, a2, attack->attacker, -1);
}
} else {
if (attack->defender != NULL) {
// TODO: Looks very similar to show_damage_extras.
int delta = attack->defender->rotation - attack->attacker->rotation;
if (delta < 0) {
delta = -delta;
}
v15 = delta != 0 && delta != 1 && delta != 5;
if (FID_TYPE(attack->defender->fid) == OBJ_TYPE_CRITTER) {
if (attack->attacker->fid == 33554933) {
v14 = tile_dir(attack->attacker->tile, attack->defender->tile);
show_damage_to_object(attack->defender, attack->defenderDamage, attack->defenderFlags, attack->weapon, v15, attack->defenderKnockback, v14, a2, attack->attacker, a3);
} else {
v17 = item_w_anim(attack->attacker, attack->hitMode);
v14 = tile_dir(attack->attacker->tile, attack->defender->tile);
show_damage_to_object(attack->defender, attack->defenderDamage, attack->defenderFlags, attack->weapon, v15, attack->defenderKnockback, v14, v17, attack->attacker, a3);
}
} else {
tile_dir(attack->attacker->tile, attack->defender->tile);
item_w_anim(attack->attacker, attack->hitMode);
}
}
if ((attack->attackerFlags & DAM_DUD) != 0) {
show_damage_to_object(attack->attacker, attack->attackerDamage, attack->attackerFlags, attack->weapon, 1, 0, 0, a2, attack->attacker, -1);
}
}
}
// 0x411224
int action_attack(Attack* attack)
{
if (register_clear(attack->attacker) == -2) {
return -1;
}
if (register_clear(attack->defender) == -2) {
return -1;
}
for (int index = 0; index < attack->extrasLength; index++) {
if (register_clear(attack->extras[index]) == -2) {
return -1;
}
}
int anim = item_w_anim(attack->attacker, attack->hitMode);
if (anim < ANIM_FIRE_SINGLE && anim != ANIM_THROW_ANIM) {
return action_melee(attack, anim);
} else {
return action_ranged(attack, anim);
}
}
// 0x4112B4
static int action_melee(Attack* attack, int anim)
{
int fid;
Art* art;
CacheEntry* cache_entry;
int v17;
int v18;
int delta;
int flag;
const char* sfx_name;
char sfx_name_temp[16];
register_begin(ANIMATION_REQUEST_RESERVED);
register_priority(1);
fid = art_id(OBJ_TYPE_CRITTER, attack->attacker->fid & 0xFFF, anim, (attack->attacker->fid & 0xF000) >> 12, attack->attacker->rotation + 1);
art = art_ptr_lock(fid, &cache_entry);
if (art != NULL) {
v17 = art_frame_action_frame(art);
} else {
v17 = 0;
}
art_ptr_unlock(cache_entry);
tile_num_in_direction(attack->attacker->tile, attack->attacker->rotation, 1);
register_object_turn_towards(attack->attacker, attack->defender->tile);
delta = attack->attacker->rotation - attack->defender->rotation;
if (delta < 0) {
delta = -delta;
}
flag = delta != 0 && delta != 1 && delta != 5;
if (anim != ANIM_THROW_PUNCH && anim != ANIM_KICK_LEG) {
sfx_name = gsnd_build_weapon_sfx_name(WEAPON_SOUND_EFFECT_ATTACK, attack->weapon, attack->hitMode, attack->defender);
} else {
sfx_name = gsnd_build_character_sfx_name(attack->attacker, anim, CHARACTER_SOUND_EFFECT_UNUSED);
}
strcpy(sfx_name_temp, sfx_name);
combatai_msg(attack->attacker, attack, AI_MESSAGE_TYPE_ATTACK, 0);
if (attack->attackerFlags & 0x0300) {
register_object_play_sfx(attack->attacker, sfx_name_temp, 0);
if (anim != ANIM_THROW_PUNCH && anim != ANIM_KICK_LEG) {
sfx_name = gsnd_build_weapon_sfx_name(WEAPON_SOUND_EFFECT_HIT, attack->weapon, attack->hitMode, attack->defender);
} else {
sfx_name = gsnd_build_character_sfx_name(attack->attacker, anim, CHARACTER_SOUND_EFFECT_CONTACT);
}
strcpy(sfx_name_temp, sfx_name);
register_object_animate(attack->attacker, anim, 0);
register_object_play_sfx(attack->attacker, sfx_name_temp, v17);
show_damage(attack, anim, 0);
} else {
if (attack->defender->data.critter.combat.results & 0x03) {
register_object_play_sfx(attack->attacker, sfx_name_temp, -1);
register_object_animate(attack->attacker, anim, 0);
} else {
fid = art_id(OBJ_TYPE_CRITTER, attack->defender->fid & 0xFFF, ANIM_DODGE_ANIM, (attack->defender->fid & 0xF000) >> 12, attack->defender->rotation + 1);
art = art_ptr_lock(fid, &cache_entry);
if (art != NULL) {
v18 = art_frame_action_frame(art);
art_ptr_unlock(cache_entry);
if (v18 <= v17) {
register_object_play_sfx(attack->attacker, sfx_name_temp, -1);
register_object_animate(attack->attacker, anim, 0);
sfx_name = gsnd_build_character_sfx_name(attack->defender, ANIM_DODGE_ANIM, CHARACTER_SOUND_EFFECT_UNUSED);
register_object_play_sfx(attack->defender, sfx_name, v17 - v18);
register_object_animate(attack->defender, ANIM_DODGE_ANIM, 0);
} else {
sfx_name = gsnd_build_character_sfx_name(attack->defender, ANIM_DODGE_ANIM, CHARACTER_SOUND_EFFECT_UNUSED);
register_object_play_sfx(attack->defender, sfx_name, -1);
register_object_animate(attack->defender, ANIM_DODGE_ANIM, 0);
register_object_play_sfx(attack->attacker, sfx_name_temp, v18 - v17);
register_object_animate(attack->attacker, anim, 0);
}
}
}
}
if ((attack->attackerFlags & DAM_HIT) != 0) {
if ((attack->defenderFlags & DAM_DEAD) == 0) {
combatai_msg(attack->attacker, attack, AI_MESSAGE_TYPE_HIT, -1);
}
} else {
combatai_msg(attack->attacker, attack, AI_MESSAGE_TYPE_MISS, -1);
}
if (register_end() == -1) {
return -1;
}
show_damage_extras(attack);
return 0;
}
// NOTE: Unused.
//
// 0x4115CC
int throw_change_fid(Object* object, int fid)
{
Rect rect;
debug_printf("\n[throw_change_fid!]: %d", fid);
obj_change_fid(object, fid, &rect);
tile_refresh_rect(&rect, map_elevation);
return 0;
}
// 0x411600
static int action_ranged(Attack* attack, int anim)
{
Object* neighboors[6];
memset(neighboors, 0, sizeof(neighboors));
register_begin(ANIMATION_REQUEST_RESERVED);
register_priority(1);
Object* projectile = NULL;
Object* v50 = NULL;
int weaponFid = -1;
Proto* weaponProto;
Object* weapon = attack->weapon;
proto_ptr(weapon->pid, &weaponProto);
int fid = art_id(OBJ_TYPE_CRITTER, attack->attacker->fid & 0xFFF, anim, (attack->attacker->fid & 0xF000) >> 12, attack->attacker->rotation + 1);
CacheEntry* artHandle;
Art* art = art_ptr_lock(fid, &artHandle);
int actionFrame = (art != NULL) ? art_frame_action_frame(art) : 0;
art_ptr_unlock(artHandle);
item_w_range(attack->attacker, attack->hitMode);
int damageType = item_w_damage_type(attack->attacker, attack->weapon);
tile_num_in_direction(attack->attacker->tile, attack->attacker->rotation, 1);
register_object_turn_towards(attack->attacker, attack->defender->tile);
bool isGrenade = false;
if (anim == ANIM_THROW_ANIM) {
if (damageType == DAMAGE_TYPE_EXPLOSION || damageType == DAMAGE_TYPE_PLASMA || damageType == DAMAGE_TYPE_EMP) {
isGrenade = true;
}
} else {
register_object_animate(attack->attacker, ANIM_POINT, -1);
}
combatai_msg(attack->attacker, attack, AI_MESSAGE_TYPE_ATTACK, 0);
const char* sfx;
if (((attack->attacker->fid & 0xF000) >> 12) != 0) {
sfx = gsnd_build_weapon_sfx_name(WEAPON_SOUND_EFFECT_ATTACK, weapon, attack->hitMode, attack->defender);
} else {
sfx = gsnd_build_character_sfx_name(attack->attacker, anim, CHARACTER_SOUND_EFFECT_UNUSED);
}
register_object_play_sfx(attack->attacker, sfx, -1);
register_object_animate(attack->attacker, anim, 0);
if (anim != ANIM_FIRE_CONTINUOUS) {
if ((attack->attackerFlags & DAM_HIT) != 0 || (attack->attackerFlags & DAM_CRITICAL) == 0) {
bool l56 = false;
int projectilePid = item_w_proj_pid(weapon);
Proto* projectileProto;
if (proto_ptr(projectilePid, &projectileProto) != -1 && projectileProto->fid != -1) {
if (anim == ANIM_THROW_ANIM) {
projectile = weapon;
weaponFid = weapon->fid;
int weaponFlags = weapon->flags;
int leftItemAction;
int rightItemAction;
intface_get_item_states(&leftItemAction, &rightItemAction);
item_remove_mult(attack->attacker, weapon, 1);
v50 = item_replace(attack->attacker, weapon, weaponFlags & OBJECT_IN_ANY_HAND);
obj_change_fid(projectile, projectileProto->fid, NULL);
cAIPrepWeaponItem(attack->attacker, weapon);
if (attack->attacker == obj_dude) {
if (v50 == NULL) {
if ((weaponFlags & OBJECT_IN_LEFT_HAND) != 0) {
leftItemAction = INTERFACE_ITEM_ACTION_DEFAULT;
} else if ((weaponFlags & OBJECT_IN_RIGHT_HAND) != 0) {
rightItemAction = INTERFACE_ITEM_ACTION_DEFAULT;
}
}
intface_update_items(false, leftItemAction, rightItemAction);
}
obj_connect(weapon, attack->attacker->tile, attack->attacker->elevation, NULL);
} else {
obj_new(&projectile, projectileProto->fid, -1);
}
obj_turn_off(projectile, NULL);
obj_set_light(projectile, 9, projectile->lightIntensity, NULL);
int projectileOrigin = combat_bullet_start(attack->attacker, attack->defender);
obj_move_to_tile(projectile, projectileOrigin, attack->attacker->elevation, NULL);
int projectileRotation = tile_dir(attack->attacker->tile, attack->defender->tile);
obj_set_rotation(projectile, projectileRotation, NULL);
register_object_funset(projectile, OBJECT_HIDDEN, actionFrame);
const char* sfx = gsnd_build_weapon_sfx_name(WEAPON_SOUND_EFFECT_AMMO_FLYING, weapon, attack->hitMode, attack->defender);
register_object_play_sfx(projectile, sfx, 0);
int v24;
if ((attack->attackerFlags & DAM_HIT) != 0) {
register_object_move_straight_to_tile(projectile, attack->defender->tile, attack->defender->elevation, ANIM_WALK, 0);
actionFrame = make_straight_path(projectile, projectileOrigin, attack->defender->tile, NULL, NULL, 32) - 1;
v24 = attack->defender->tile;
} else {
register_object_move_straight_to_tile(projectile, attack->tile, attack->defender->elevation, ANIM_WALK, 0);
actionFrame = 0;
v24 = attack->tile;
}
if (isGrenade || damageType == DAMAGE_TYPE_EXPLOSION) {
if ((attack->attackerFlags & DAM_DROP) == 0) {
int explosionFrmId;
if (isGrenade) {
switch (damageType) {
case DAMAGE_TYPE_EMP:
explosionFrmId = 2;
break;
case DAMAGE_TYPE_PLASMA:
explosionFrmId = 31;
break;
default:
explosionFrmId = 29;
break;
}
} else {
explosionFrmId = 10;
}
if (isGrenade) {
register_object_change_fid(projectile, weaponFid, -1);
}
int explosionFid = art_id(OBJ_TYPE_MISC, explosionFrmId, 0, 0, 0);
register_object_change_fid(projectile, explosionFid, -1);
const char* sfx = gsnd_build_weapon_sfx_name(WEAPON_SOUND_EFFECT_HIT, weapon, attack->hitMode, attack->defender);
register_object_play_sfx(projectile, sfx, 0);
register_object_animate_and_hide(projectile, ANIM_STAND, 0);
for (int rotation = 0; rotation < ROTATION_COUNT; rotation++) {
if (obj_new(&(neighboors[rotation]), explosionFid, -1) != -1) {
obj_turn_off(neighboors[rotation], NULL);
int v31 = tile_num_in_direction(v24, rotation, 1);
obj_move_to_tile(neighboors[rotation], v31, projectile->elevation, NULL);
int delay;
if (rotation != ROTATION_NE) {
delay = 0;
} else {
if (damageType == DAMAGE_TYPE_PLASMA) {
delay = 4;
} else {
delay = 2;
}
}
register_object_funset(neighboors[rotation], OBJECT_HIDDEN, delay);
register_object_animate_and_hide(neighboors[rotation], ANIM_STAND, 0);
}
}
l56 = true;
}
} else {
if (anim != ANIM_THROW_ANIM) {
register_object_must_erase(projectile);
}
}
if (!l56) {
const char* sfx = gsnd_build_weapon_sfx_name(WEAPON_SOUND_EFFECT_HIT, weapon, attack->hitMode, attack->defender);
register_object_play_sfx(weapon, sfx, actionFrame);
}
actionFrame = 0;
} else {
if ((attack->attackerFlags & DAM_HIT) == 0) {
Object* defender = attack->defender;
if ((defender->data.critter.combat.results & (DAM_KNOCKED_OUT | DAM_KNOCKED_DOWN)) == 0) {
register_object_animate(defender, ANIM_DODGE_ANIM, actionFrame);
l56 = true;
}
}
}
}
}
show_damage(attack, anim, actionFrame);
if ((attack->attackerFlags & DAM_HIT) == 0) {
combatai_msg(attack->defender, attack, AI_MESSAGE_TYPE_MISS, -1);
} else {
if ((attack->defenderFlags & DAM_DEAD) == 0) {
combatai_msg(attack->defender, attack, AI_MESSAGE_TYPE_HIT, -1);
}
}
if (projectile != NULL && (isGrenade || damageType == DAMAGE_TYPE_EXPLOSION)) {
register_object_must_erase(projectile);
} else if (anim == ANIM_THROW_ANIM && projectile != NULL) {
register_object_change_fid(projectile, weaponFid, -1);
}
for (int rotation = 0; rotation < ROTATION_COUNT; rotation++) {
if (neighboors[rotation] != NULL) {
register_object_must_erase(neighboors[rotation]);
}
}
if ((attack->attackerFlags & (DAM_KNOCKED_OUT | DAM_KNOCKED_DOWN | DAM_DEAD)) == 0) {
if (anim == ANIM_THROW_ANIM) {
bool l9 = false;
if (v50 != NULL) {
int v38 = item_w_anim_code(v50);
if (v38 != 0) {
register_object_take_out(attack->attacker, v38, -1);
l9 = true;
}
}
if (!l9) {
int fid = art_id(OBJ_TYPE_CRITTER, attack->attacker->fid & 0xFFF, ANIM_STAND, 0, attack->attacker->rotation + 1);
register_object_change_fid(attack->attacker, fid, -1);
}
} else {
register_object_animate(attack->attacker, ANIM_UNPOINT, -1);
}
}
if (register_end() == -1) {
debug_printf("Something went wrong with a ranged attack sequence!\n");
if (projectile != NULL && (isGrenade || damageType == DAMAGE_TYPE_EXPLOSION || anim != ANIM_THROW_ANIM)) {
obj_erase_object(projectile, NULL);
}
for (int rotation = 0; rotation < ROTATION_COUNT; rotation++) {
if (neighboors[rotation] != NULL) {
obj_erase_object(neighboors[rotation], NULL);
}
}
return -1;
}
show_damage_extras(attack);
return 0;
}
// 0x411D68
static int is_next_to(Object* a1, Object* a2)
{
if (obj_dist(a1, a2) > 1) {
if (a2 == obj_dude) {
MessageListItem messageListItem;
// You cannot get there.
messageListItem.num = 2000;
if (message_search(&misc_message_file, &messageListItem)) {
display_print(messageListItem.text);
}
}
return -1;
}
return 0;
}
// 0x411DB4
static int action_climb_ladder(Object* a1, Object* a2)
{
if (a1 == obj_dude) {
int anim = FID_ANIM_TYPE(obj_dude->fid);
if (anim == ANIM_WALK || anim == ANIM_RUNNING) {
register_clear(obj_dude);
}
}
int animationRequestOptions;
int actionPoints;
if (isInCombat()) {
animationRequestOptions = ANIMATION_REQUEST_RESERVED;
actionPoints = a1->data.critter.combat.ap;
} else {
animationRequestOptions = ANIMATION_REQUEST_UNRESERVED;
actionPoints = -1;
}
if (a1 == obj_dude) {
animationRequestOptions = ANIMATION_REQUEST_RESERVED;
}
animationRequestOptions |= ANIMATION_REQUEST_NO_STAND;
register_begin(animationRequestOptions);
int tile = tile_num_in_direction(a2->tile, ROTATION_SE, 1);
if (actionPoints != -1 || obj_dist(a1, a2) < 5) {
register_object_move_to_tile(a1, tile, a2->elevation, actionPoints, 0);
} else {
register_object_run_to_tile(a1, tile, a2->elevation, actionPoints, 0);
}
register_object_must_call(a1, a2, is_next_to, -1);
register_object_turn_towards(a1, a2->tile);
register_object_must_call(a1, a2, check_scenery_ap_cost, -1);
int weaponAnimationCode = (a1->fid & 0xF000) >> 12;
if (weaponAnimationCode != 0) {
const char* puttingAwaySfx = gsnd_build_character_sfx_name(a1, ANIM_PUT_AWAY, CHARACTER_SOUND_EFFECT_UNUSED);
register_object_play_sfx(a1, puttingAwaySfx, -1);
register_object_animate(a1, ANIM_PUT_AWAY, 0);
}
const char* climbingSfx = gsnd_build_character_sfx_name(a1, ANIM_CLIMB_LADDER, CHARACTER_SOUND_EFFECT_UNUSED);
register_object_play_sfx(a1, climbingSfx, -1);
register_object_animate(a1, ANIM_CLIMB_LADDER, 0);
register_object_call(a1, a2, obj_use, -1);
if (weaponAnimationCode != 0) {
register_object_take_out(a1, weaponAnimationCode, -1);
}
return register_end();
}
// 0x411F2C
int a_use_obj(Object* a1, Object* a2, Object* a3)
{
Proto* proto = NULL;
int type = FID_TYPE(a2->fid);
int sceneryType = -1;
if (type == OBJ_TYPE_SCENERY) {
if (proto_ptr(a2->pid, &proto) == -1) {
return -1;
}
sceneryType = proto->scenery.type;
}
if (sceneryType != SCENERY_TYPE_LADDER_UP || a3 != NULL) {
if (a1 == obj_dude) {
int anim = FID_ANIM_TYPE(obj_dude->fid);
if (anim == ANIM_WALK || anim == ANIM_RUNNING) {
register_clear(obj_dude);
}
}
int animationRequestOptions;
int actionPoints;
if (isInCombat()) {
animationRequestOptions = ANIMATION_REQUEST_RESERVED;
actionPoints = a1->data.critter.combat.ap;
} else {
animationRequestOptions = ANIMATION_REQUEST_UNRESERVED;
actionPoints = -1;
}
if (a1 == obj_dude) {
animationRequestOptions = ANIMATION_REQUEST_RESERVED;
}
register_begin(animationRequestOptions);
if (actionPoints != -1 || obj_dist(a1, a2) < 5) {
register_object_move_to_object(a1, a2, actionPoints, 0);
} else {
register_object_run_to_object(a1, a2, -1, 0);
}
register_object_must_call(a1, a2, is_next_to, -1);
if (a3 == NULL) {
register_object_call(a1, a2, check_scenery_ap_cost, -1);
}
int a2a = (a1->fid & 0xF000) >> 12;
if (a2a != 0) {
const char* sfx = gsnd_build_character_sfx_name(a1, ANIM_PUT_AWAY, CHARACTER_SOUND_EFFECT_UNUSED);
register_object_play_sfx(a1, sfx, -1);
register_object_animate(a1, ANIM_PUT_AWAY, 0);
}
int anim;
int objectType = FID_TYPE(a2->fid);
if (objectType == OBJ_TYPE_CRITTER && critter_is_prone(a2)) {
anim = ANIM_MAGIC_HANDS_GROUND;
} else if (objectType == OBJ_TYPE_SCENERY && (proto->scenery.extendedFlags & 0x01) != 0) {
anim = ANIM_MAGIC_HANDS_GROUND;
} else {
anim = ANIM_MAGIC_HANDS_MIDDLE;
}
if (sceneryType != SCENERY_TYPE_STAIRS && a3 == NULL) {
register_object_animate(a1, anim, -1);
}
if (a3 != NULL) {
// TODO: Get rid of cast.
register_object_call3(a1, a2, a3, obj_use_item_on, -1);
} else {
register_object_call(a1, a2, obj_use, -1);
}
if (a2a != 0) {
register_object_take_out(a1, a2a, -1);
}
return register_end();
}
return action_climb_ladder(a1, a2);
}
// 0x411F2C
int action_use_an_item_on_object(Object* a1, Object* a2, Object* a3)
{
return a_use_obj(a1, a2, a3);
}
// 0x412114
int action_use_an_object(Object* a1, Object* a2)
{
return a_use_obj(a1, a2, NULL);
}
// NOTE: Unused.
//
// 0x412120
int get_an_object(Object* item)
{
return action_get_an_object(obj_dude, item);
}
// 0x412134
int action_get_an_object(Object* critter, Object* item)
{
if (FID_TYPE(item->fid) != OBJ_TYPE_ITEM) {
return -1;
}
if (critter == obj_dude) {
int animationCode = FID_ANIM_TYPE(obj_dude->fid);
if (animationCode == ANIM_WALK || animationCode == ANIM_RUNNING) {
register_clear(obj_dude);
}
}
if (isInCombat()) {
register_begin(ANIMATION_REQUEST_RESERVED);
register_object_move_to_object(critter, item, critter->data.critter.combat.ap, 0);
} else {
register_begin(critter == obj_dude ? ANIMATION_REQUEST_RESERVED : ANIMATION_REQUEST_UNRESERVED);
if (obj_dist(critter, item) >= 5) {
register_object_run_to_object(critter, item, -1, 0);
} else {
register_object_move_to_object(critter, item, -1, 0);
}
}
register_object_must_call(critter, item, is_next_to, -1);
register_object_call(critter, item, check_scenery_ap_cost, -1);
Proto* itemProto;
proto_ptr(item->pid, &itemProto);
if (itemProto->item.type != ITEM_TYPE_CONTAINER || proto_action_can_pickup(item->pid)) {
register_object_animate(critter, ANIM_MAGIC_HANDS_GROUND, 0);
int fid = art_id(OBJ_TYPE_CRITTER, critter->fid & 0xFFF, ANIM_MAGIC_HANDS_GROUND, (critter->fid & 0xF000) >> 12, critter->rotation + 1);
int actionFrame;
CacheEntry* cacheEntry;
Art* art = art_ptr_lock(fid, &cacheEntry);
if (art != NULL) {
actionFrame = art_frame_action_frame(art);
} else {
actionFrame = -1;
}
char sfx[16];
if (art_get_base_name(FID_TYPE(item->fid), item->fid & 0xFFF, sfx) == 0) {
// NOTE: looks like they copy sfx one more time, what for?
register_object_play_sfx(item, sfx, actionFrame);
}
register_object_call(critter, item, obj_pickup, actionFrame);
} else {
int weaponAnimationCode = (critter->fid & 0xF000) >> 12;
if (weaponAnimationCode != 0) {
const char* sfx = gsnd_build_character_sfx_name(critter, ANIM_PUT_AWAY, CHARACTER_SOUND_EFFECT_UNUSED);
register_object_play_sfx(critter, sfx, -1);
register_object_animate(critter, ANIM_PUT_AWAY, -1);
}
// ground vs middle animation
int anim = (itemProto->item.data.container.openFlags & 0x01) == 0
? ANIM_MAGIC_HANDS_MIDDLE
: ANIM_MAGIC_HANDS_GROUND;
register_object_animate(critter, anim, 0);
int fid = art_id(OBJ_TYPE_CRITTER, critter->fid & 0xFFF, anim, 0, critter->rotation + 1);
int actionFrame;
CacheEntry* cacheEntry;
Art* art = art_ptr_lock(fid, &cacheEntry);
if (art == NULL) {
actionFrame = art_frame_action_frame(art);
art_ptr_unlock(cacheEntry);
} else {
actionFrame = -1;
}
if (item->frame != 1) {
register_object_call(critter, item, obj_use_container, actionFrame);
}
if (weaponAnimationCode != 0) {
register_object_take_out(critter, weaponAnimationCode, -1);
}
if (item->frame == 0 || item->frame == 1) {
register_object_call(critter, item, scripts_request_loot_container, -1);
}
}
return register_end();
}
// TODO: Looks like the name is a little misleading, container can only be a
// critter, which is enforced by this function as well as at the call sites.
// Used to loot corpses, so probably should be something like actionLootCorpse.
// Check if it can be called with a living critter.
//
// 0x4123E8
int action_loot_container(Object* critter, Object* container)
{
if (FID_TYPE(container->fid) != OBJ_TYPE_CRITTER) {
return -1;
}
if (critter == obj_dude) {
int anim = FID_ANIM_TYPE(obj_dude->fid);
if (anim == ANIM_WALK || anim == ANIM_RUNNING) {
register_clear(obj_dude);
}
}
if (isInCombat()) {
register_begin(ANIMATION_REQUEST_RESERVED);
register_object_move_to_object(critter, container, critter->data.critter.combat.ap, 0);
} else {
register_begin(critter == obj_dude ? ANIMATION_REQUEST_RESERVED : ANIMATION_REQUEST_UNRESERVED);
if (obj_dist(critter, container) < 5) {
register_object_move_to_object(critter, container, -1, 0);
} else {
register_object_run_to_object(critter, container, -1, 0);
}
}
register_object_must_call(critter, container, is_next_to, -1);
register_object_call(critter, container, check_scenery_ap_cost, -1);
register_object_call(critter, container, scripts_request_loot_container, -1);
return register_end();
}
// 0x4124E0
int action_skill_use(int skill)
{
if (skill == SKILL_SNEAK) {
register_clear(obj_dude);
pc_flag_toggle(DUDE_STATE_SNEAKING);
return 0;
}
return -1;
}
// NOTE: Inlined.
//
// 0x412500
int action_use_skill_in_combat_error(Object* critter)
{
MessageListItem messageListItem;
if (critter == obj_dude) {
messageListItem.num = 902;
if (message_search(&proto_main_msg_file, &messageListItem) == 1) {
display_print(messageListItem.text);
}
}
return -1;
}
// skill_use
// 0x41255C
int action_use_skill_on(Object* a1, Object* a2, int skill)
{
switch (skill) {
case SKILL_FIRST_AID:
case SKILL_DOCTOR:
if (isInCombat()) {
// NOTE: Uninline.
return action_use_skill_in_combat_error(a1);
}
if (PID_TYPE(a2->pid) != OBJ_TYPE_CRITTER) {
return -1;
}
break;
case SKILL_LOCKPICK:
if (isInCombat()) {
// NOTE: Uninline.
return action_use_skill_in_combat_error(a1);
}
if (PID_TYPE(a2->pid) != OBJ_TYPE_ITEM && PID_TYPE(a2->pid) != OBJ_TYPE_SCENERY) {
return -1;
}
break;
case SKILL_STEAL:
if (isInCombat()) {
// NOTE: Uninline.
return action_use_skill_in_combat_error(a1);
}
if (PID_TYPE(a2->pid) != OBJ_TYPE_ITEM && PID_TYPE(a2->pid) != OBJ_TYPE_CRITTER) {
return -1;
}
if (a2 == a1) {
return -1;
}
break;
case SKILL_TRAPS:
if (isInCombat()) {
// NOTE: Uninline.
return action_use_skill_in_combat_error(a1);
}
if (PID_TYPE(a2->pid) == OBJ_TYPE_CRITTER) {
return -1;
}
break;
case SKILL_SCIENCE:
case SKILL_REPAIR:
if (isInCombat()) {
// NOTE: Uninline.
return action_use_skill_in_combat_error(a1);
}
if (PID_TYPE(a2->pid) != OBJ_TYPE_CRITTER) {
break;
}
if (critterGetKillType(a2) == KILL_TYPE_ROBOT) {
break;
}
if (critterGetKillType(a2) == KILL_TYPE_BRAHMIN
&& skill == SKILL_SCIENCE) {
break;
}
return -1;
case SKILL_SNEAK:
pc_flag_toggle(DUDE_STATE_SNEAKING);
return 0;
default:
debug_printf("\nskill_use: invalid skill used.");
}
// Performer is either dude, or party member who's best at the specified
// skill in entire party, and this skill is his/her own best.
Object* performer = obj_dude;
if (a1 == obj_dude) {
Object* partyMember = partyMemberWithHighestSkill(skill);
if (partyMember == obj_dude) {
partyMember = NULL;
}
// Only dude can perform stealing.
if (skill == SKILL_STEAL) {
partyMember = NULL;
}
if (partyMember != NULL) {
if (partyMemberSkill(partyMember) != skill) {
partyMember = NULL;
}
}
if (partyMember != NULL) {
performer = partyMember;
int anim = FID_ANIM_TYPE(partyMember->fid);
if (anim != ANIM_WALK && anim != ANIM_RUNNING) {
if (anim != ANIM_STAND) {
performer = obj_dude;
partyMember = NULL;
}
} else {
register_clear(partyMember);
}
}
if (partyMember != NULL) {
bool v32 = false;
if (obj_dist(obj_dude, a2) <= 1) {
v32 = true;
}
char* msg = skillGetPartyMemberString(partyMember, v32);
Rect rect;
if (text_object_create(partyMember, msg, 101, colorTable[32747], colorTable[0], &rect) == 0) {
tile_refresh_rect(&rect, map_elevation);
}
if (v32) {
performer = obj_dude;
partyMember = NULL;
}
}
if (partyMember == NULL) {
int anim = FID_ANIM_TYPE(performer->fid);
if (anim == ANIM_WALK || anim == ANIM_RUNNING) {
register_clear(performer);
}
}
}
if (isInCombat()) {
register_begin(ANIMATION_REQUEST_RESERVED);
register_object_move_to_object(performer, a2, performer->data.critter.combat.ap, 0);
} else {
register_begin(a1 == obj_dude ? ANIMATION_REQUEST_RESERVED : ANIMATION_REQUEST_UNRESERVED);
if (a2 != obj_dude) {
if (obj_dist(performer, a2) >= 5) {
register_object_run_to_object(performer, a2, -1, 0);
} else {
register_object_move_to_object(performer, a2, -1, 0);
}
}
}
register_object_must_call(performer, a2, is_next_to, -1);
int anim = (FID_TYPE(a2->fid) == OBJ_TYPE_CRITTER && critter_is_prone(a2)) ? ANIM_MAGIC_HANDS_GROUND : ANIM_MAGIC_HANDS_MIDDLE;
int fid = art_id(OBJ_TYPE_CRITTER, performer->fid & 0xFFF, anim, 0, performer->rotation + 1);
CacheEntry* artHandle;
Art* art = art_ptr_lock(fid, &artHandle);
if (art != NULL) {
art_frame_action_frame(art);
art_ptr_unlock(artHandle);
}
register_object_animate(performer, anim, -1);
// TODO: Get rid of casts.
register_object_call3(performer, a2, (void*)skill, (AnimationCallback3*)obj_use_skill_on, -1);
return register_end();
}
// NOTE: Unused.
//
// 0x4129CC
Object* pick_object(int objectType, bool a2)
{
Object* foundObject;
int mouseEvent;
int keyCode;
foundObject = NULL;
do {
get_input();
} while ((mouse_get_buttons() & MOUSE_EVENT_LEFT_BUTTON_REPEAT) != 0);
gmouse_set_cursor(MOUSE_CURSOR_PLUS);
gmouse_3d_off();
do {
if (get_input() == -2) {
mouseEvent = mouse_get_buttons();
if ((mouseEvent & MOUSE_EVENT_LEFT_BUTTON_UP) != 0) {
keyCode = 0;
foundObject = object_under_mouse(objectType, a2, map_elevation);
break;
}
if ((mouseEvent & MOUSE_EVENT_RIGHT_BUTTON_DOWN) != 0) {
keyCode = KEY_ESCAPE;
break;
}
}
} while (game_user_wants_to_quit == 0);
gmouse_set_cursor(MOUSE_CURSOR_ARROW);
gmouse_3d_on();
if (keyCode == KEY_ESCAPE) {
return NULL;
}
return foundObject;
}
// NOTE: Unused.
//
// 0x412A54
int pick_hex()
{
int elevation;
int inputEvent;
int tile;
Rect rect;
elevation = map_elevation;
while (1) {
inputEvent = get_input();
if (inputEvent == -2) {
break;
}
if (inputEvent == KEY_CTRL_ARROW_RIGHT) {
rotation++;
if (rotation > 5) {
rotation = 0;
}
obj_set_rotation(obj_mouse, rotation, &rect);
tile_refresh_rect(&rect, obj_mouse->elevation);
}
if (inputEvent == KEY_CTRL_ARROW_LEFT) {
rotation--;
if (rotation == -1) {
rotation = 5;
}
obj_set_rotation(obj_mouse, rotation, &rect);
tile_refresh_rect(&rect, obj_mouse->elevation);
}
if (inputEvent == KEY_PAGE_UP || inputEvent == KEY_PAGE_DOWN) {
if (inputEvent == KEY_PAGE_UP) {
map_set_elevation(map_elevation + 1);
} else {
map_set_elevation(map_elevation - 1);
}
rect.ulx = 30;
rect.uly = 62;
rect.lrx = 50;
rect.lry = 88;
}
if (game_user_wants_to_quit != 0) {
return -1;
}
}
if ((mouse_get_buttons() & MOUSE_EVENT_LEFT_BUTTON_DOWN) == 0) {
return -1;
}
if (!mouse_click_in(0, 0, scr_size.lrx - scr_size.ulx, scr_size.lry - scr_size.uly - 100)) {
return -1;
}
mouse_get_position(&(rect.ulx), &(rect.uly));
tile = tile_num(rect.ulx, rect.uly, elevation);
if (tile == -1) {
return -1;
}
return tile;
}
// 0x412BC4
bool is_hit_from_front(Object* a1, Object* a2)
{
int diff = a1->rotation - a2->rotation;
if (diff < 0) {
diff = -diff;
}
return diff != 0 && diff != 1 && diff != 5;
}
// 0x412BEC
bool can_see(Object* a1, Object* a2)
{
int diff;
diff = a1->rotation - tile_dir(a1->tile, a2->tile);
if (diff < 0) {
diff = -diff;
}
return diff == 0 || diff == 1 || diff == 5;
}
// looks like it tries to change fall animation depending on object's current rotation
// 0x412C1C
int pick_fall(Object* obj, int anim)
{
int i;
int rotation;
int tile_num;
int fid;
if (anim == ANIM_FALL_FRONT) {
rotation = obj->rotation;
for (i = 1; i < 3; i++) {
tile_num = tile_num_in_direction(obj->tile, rotation, i);
if (obj_blocking_at(obj, tile_num, obj->elevation) != NULL) {
anim = ANIM_FALL_BACK;
break;
}
}
} else if (anim == ANIM_FALL_BACK) {
rotation = (obj->rotation + 3) % ROTATION_COUNT;
for (i = 1; i < 3; i++) {
tile_num = tile_num_in_direction(obj->tile, rotation, i);
if (obj_blocking_at(obj, tile_num, obj->elevation) != NULL) {
anim = ANIM_FALL_FRONT;
break;
}
}
}
if (anim == ANIM_FALL_FRONT) {
fid = art_id(OBJ_TYPE_CRITTER, obj->fid & 0xFFF, ANIM_FALL_FRONT, (obj->fid & 0xF000) >> 12, obj->rotation + 1);
if (!art_exists(fid)) {
anim = ANIM_FALL_BACK;
}
}
return anim;
}
// 0x412CE4
bool action_explode_running()
{
return action_in_explode;
}
// action_explode
// 0x412CF4
int action_explode(int tile, int elevation, int minDamage, int maxDamage, Object* a5, bool a6)
{
if (a6 && action_in_explode) {
return -2;
}
Attack* attack = (Attack*)mem_malloc(sizeof(*attack));
if (attack == NULL) {
return -1;
}
Object* explosion;
int fid = art_id(OBJ_TYPE_MISC, 10, 0, 0, 0);
if (obj_new(&explosion, fid, -1) == -1) {
mem_free(attack);
return -1;
}
obj_turn_off(explosion, NULL);
explosion->flags |= OBJECT_TEMPORARY;
obj_move_to_tile(explosion, tile, elevation, NULL);
Object* adjacentExplosions[ROTATION_COUNT];
for (int rotation = 0; rotation < ROTATION_COUNT; rotation++) {
int fid = art_id(OBJ_TYPE_MISC, 10, 0, 0, 0);
if (obj_new(&(adjacentExplosions[rotation]), fid, -1) == -1) {
while (--rotation >= 0) {
obj_erase_object(adjacentExplosions[rotation], NULL);
}
obj_erase_object(explosion, NULL);
mem_free(attack);
return -1;
}
obj_turn_off(adjacentExplosions[rotation], NULL);
adjacentExplosions[rotation]->flags |= OBJECT_TEMPORARY;
int adjacentTile = tile_num_in_direction(tile, rotation, 1);
obj_move_to_tile(adjacentExplosions[rotation], adjacentTile, elevation, NULL);
}
Object* critter = obj_blocking_at(NULL, tile, elevation);
if (critter != NULL) {
if (FID_TYPE(critter->fid) != OBJ_TYPE_CRITTER || (critter->data.critter.combat.results & DAM_DEAD) != 0) {
critter = NULL;
}
}
combat_ctd_init(attack, explosion, critter, HIT_MODE_PUNCH, HIT_LOCATION_TORSO);
attack->tile = tile;
attack->attackerFlags = DAM_HIT;
game_ui_disable(1);
if (critter != NULL) {
if (register_clear(critter) == -2) {
debug_printf("Cannot clear target's animation for action_explode!\n");
}
attack->defenderDamage = compute_explosion_damage(minDamage, maxDamage, critter, &(attack->defenderKnockback));
}
compute_explosion_on_extras(attack, 0, 0, 1);
for (int index = 0; index < attack->extrasLength; index++) {
Object* critter = attack->extras[index];
if (register_clear(critter) == -2) {
debug_printf("Cannot clear extra's animation for action_explode!\n");
}
attack->extrasDamage[index] = compute_explosion_damage(minDamage, maxDamage, critter, &(attack->extrasKnockback[index]));
}
death_checks(attack);
if (a6) {
action_in_explode = true;
register_begin(ANIMATION_REQUEST_RESERVED);
register_priority(1);
register_object_play_sfx(explosion, "whn1xxx1", 0);
register_object_funset(explosion, OBJECT_HIDDEN, 0);
register_object_animate_and_hide(explosion, ANIM_STAND, 0);
show_damage(attack, 0, 1);
for (int rotation = 0; rotation < ROTATION_COUNT; rotation++) {
register_object_funset(adjacentExplosions[rotation], OBJECT_HIDDEN, 0);
register_object_animate_and_hide(adjacentExplosions[rotation], ANIM_STAND, 0);
}
register_object_must_call(explosion, 0, combat_explode_scenery, -1);
register_object_must_erase(explosion);
for (int rotation = 0; rotation < ROTATION_COUNT; rotation++) {
register_object_must_erase(adjacentExplosions[rotation]);
}
register_object_must_call(attack, a5, report_explosion, -1);
register_object_must_call(NULL, NULL, finished_explosion, -1);
if (register_end() == -1) {
action_in_explode = false;
obj_erase_object(explosion, NULL);
for (int rotation = 0; rotation < ROTATION_COUNT; rotation++) {
obj_erase_object(adjacentExplosions[rotation], NULL);
}
mem_free(attack);
game_ui_enable();
return -1;
}
show_damage_extras(attack);
} else {
if (critter != NULL) {
if ((attack->defenderFlags & DAM_DEAD) != 0) {
critter_kill(critter, -1, false);
}
}
for (int index = 0; index < attack->extrasLength; index++) {
if ((attack->extrasFlags[index] & DAM_DEAD) != 0) {
critter_kill(attack->extras[index], -1, false);
}
}
report_explosion(attack, a5);
combat_explode_scenery(explosion, NULL);
obj_erase_object(explosion, NULL);
for (int rotation = 0; rotation < ROTATION_COUNT; rotation++) {
obj_erase_object(adjacentExplosions[rotation], NULL);
}
}
return 0;
}
// 0x413144
static int report_explosion(Attack* attack, Object* a2)
{
bool mainTargetWasDead;
if (attack->defender != NULL) {
mainTargetWasDead = (attack->defender->data.critter.combat.results & DAM_DEAD) != 0;
} else {
mainTargetWasDead = false;
}
bool extrasWasDead[6];
for (int index = 0; index < attack->extrasLength; index++) {
extrasWasDead[index] = (attack->extras[index]->data.critter.combat.results & DAM_DEAD) != 0;
}
death_checks(attack);
combat_display(attack);
apply_damage(attack, false);
Object* anyDefender = NULL;
int xp = 0;
if (a2 != NULL) {
if (attack->defender != NULL && attack->defender != a2) {
if ((attack->defender->data.critter.combat.results & DAM_DEAD) != 0) {
if (a2 == obj_dude && !mainTargetWasDead) {
xp += critter_kill_exps(attack->defender);
}
} else {
critter_set_who_hit_me(attack->defender, a2);
anyDefender = attack->defender;
}
}
for (int index = 0; index < attack->extrasLength; index++) {
Object* critter = attack->extras[index];
if (critter != a2) {
if ((critter->data.critter.combat.results & DAM_DEAD) != 0) {
if (a2 == obj_dude && !extrasWasDead[index]) {
xp += critter_kill_exps(critter);
}
} else {
critter_set_who_hit_me(critter, a2);
if (anyDefender == NULL) {
anyDefender = critter;
}
}
}
}
if (anyDefender != NULL) {
if (!isInCombat()) {
STRUCT_664980 combat;
combat.attacker = anyDefender;
combat.defender = a2;
combat.actionPointsBonus = 0;
combat.accuracyBonus = 0;
combat.damageBonus = 0;
combat.minDamage = 0;
combat.maxDamage = INT_MAX;
combat.field_1C = 0;
scripts_request_combat(&combat);
}
}
}
mem_free(attack);
game_ui_enable();
if (a2 == obj_dude) {
combat_give_exps(xp);
}
return 0;
}
// 0x4132C0
static int finished_explosion(Object* a1, Object* a2)
{
action_in_explode = false;
return 0;
}
// calculate explosion damage applying threshold and resistances
// 0x4132CC
static int compute_explosion_damage(int min, int max, Object* a3, int* a4)
{
int v5 = roll_random(min, max);
int v7 = v5 - critterGetStat(a3, STAT_DAMAGE_THRESHOLD_EXPLOSION);
if (v7 > 0) {
v7 -= critterGetStat(a3, STAT_DAMAGE_RESISTANCE_EXPLOSION) * v7 / 100;
}
if (v7 < 0) {
v7 = 0;
}
if (a4 != NULL) {
if ((a3->flags & OBJECT_MULTIHEX) == 0) {
*a4 = v7 / 10;
}
}
return v7;
}
// 0x413330
int action_talk_to(Object* a1, Object* a2)
{
if (a1 != obj_dude) {
return -1;
}
if (FID_TYPE(a2->fid) != OBJ_TYPE_CRITTER) {
return -1;
}
int anim = FID_ANIM_TYPE(obj_dude->fid);
if (anim == ANIM_WALK || anim == ANIM_RUNNING) {
register_clear(obj_dude);
}
if (isInCombat()) {
register_begin(ANIMATION_REQUEST_RESERVED);
register_object_move_to_object(a1, a2, a1->data.critter.combat.ap, 0);
} else {
register_begin(a1 == obj_dude ? ANIMATION_REQUEST_RESERVED : ANIMATION_REQUEST_UNRESERVED);
if (obj_dist(a1, a2) >= 9 || combat_is_shot_blocked(a1, a1->tile, a2->tile, a2, NULL)) {
register_object_run_to_object(a1, a2, -1, 0);
}
}
register_object_must_call(a1, a2, can_talk_to, -1);
register_object_call(a1, a2, talk_to, -1);
return register_end();
}
// 0x413420
static int can_talk_to(Object* a1, Object* a2)
{
if (combat_is_shot_blocked(a1, a1->tile, a2->tile, a2, NULL) || obj_dist(a1, a2) >= 9) {
if (a1 == obj_dude) {
// You cannot get there. (used in actions.c)
MessageListItem messageListItem;
messageListItem.num = 2000;
if (message_search(&misc_message_file, &messageListItem)) {
display_print(messageListItem.text);
}
}
return -1;
}
return 0;
}
// 0x413488
static int talk_to(Object* a1, Object* a2)
{
scripts_request_dialog(a2);
return 0;
}
// 0x413494
void action_dmg(int tile, int elevation, int minDamage, int maxDamage, int damageType, bool animated, bool bypassArmor)
{
Attack* attack = (Attack*)mem_malloc(sizeof(*attack));
if (attack == NULL) {
return;
}
Object* attacker;
if (obj_new(&attacker, FID_0x20001F5, -1) == -1) {
mem_free(attack);
return;
}
obj_turn_off(attacker, NULL);
attacker->flags |= OBJECT_TEMPORARY;
obj_move_to_tile(attacker, tile, elevation, NULL);
Object* defender = obj_blocking_at(NULL, tile, elevation);
combat_ctd_init(attack, attacker, defender, HIT_MODE_PUNCH, HIT_LOCATION_TORSO);
attack->tile = tile;
attack->attackerFlags = DAM_HIT;
game_ui_disable(1);
if (defender != NULL) {
register_clear(defender);
int damage;
if (bypassArmor) {
damage = maxDamage;
} else {
damage = compute_dmg_damage(minDamage, maxDamage, defender, &(attack->defenderKnockback), damageType);
}
attack->defenderDamage = damage;
}
death_checks(attack);
if (animated) {
register_begin(ANIMATION_REQUEST_RESERVED);
register_object_play_sfx(attacker, "whc1xxx1", 0);
show_damage(attack, death_3[damageType], 0);
register_object_must_call(attack, NULL, report_dmg, 0);
register_object_must_erase(attacker);
if (register_end() == -1) {
obj_erase_object(attacker, NULL);
mem_free(attack);
return;
}
} else {
if (defender != NULL) {
if ((attack->defenderFlags & DAM_DEAD) != 0) {
critter_kill(defender, -1, 1);
}
}
// NOTE: Uninline.
report_dmg(attack, NULL);
obj_erase_object(attacker, NULL);
}
game_ui_enable();
}
// 0x41363C
static int report_dmg(Attack* attack, Object* a2)
{
combat_display(attack);
apply_damage(attack, false);
mem_free(attack);
game_ui_enable();
return 0;
}
// Calculate damage by applying threshold and resistances.
//
// 0x413660
static int compute_dmg_damage(int min, int max, Object* obj, int* a4, int damageType)
{
if (!critter_flag_check(obj->pid, CRITTER_NO_KNOCKBACK)) {
a4 = NULL;
}
int v8 = roll_random(min, max);
int v10 = v8 - critterGetStat(obj, STAT_DAMAGE_THRESHOLD + damageType);
if (v10 > 0) {
v10 -= critterGetStat(obj, STAT_DAMAGE_RESISTANCE + damageType) * v10 / 100;
}
if (v10 < 0) {
v10 = 0;
}
if (a4 != NULL) {
if ((obj->flags & OBJECT_MULTIHEX) == 0 && damageType != DAMAGE_TYPE_ELECTRICAL) {
*a4 = v10 / 10;
}
}
return v10;
}
// 0x4136EC
bool action_can_be_pushed(Object* a1, Object* a2)
{
// Cannot push anything but critters.
if (FID_TYPE(a2->fid) != OBJ_TYPE_CRITTER) {
return false;
}
// Cannot push itself.
if (a1 == a2) {
return false;
}
// Cannot push inactive critters.
if (!critter_is_active(a2)) {
return false;
}
if (action_can_talk_to(a1, a2) != 0) {
return false;
}
// Can only push critters that have push handler.
if (!scriptHasProc(a2->sid, SCRIPT_PROC_PUSH)) {
return false;
}
if (isInCombat()) {
if (a2->data.critter.combat.team == a1->data.critter.combat.team
&& a2 == a1->data.critter.combat.whoHitMe) {
return false;
}
// TODO: Check.
Object* whoHitMe = a2->data.critter.combat.whoHitMe;
if (whoHitMe != NULL
&& whoHitMe->data.critter.combat.team == a1->data.critter.combat.team) {
return false;
}
}
return true;
}
// 0x413790
int action_push_critter(Object* a1, Object* a2)
{
if (!action_can_be_pushed(a1, a2)) {
return -1;
}
int sid;
if (obj_sid(a2, &sid) == 0) {
scr_set_objs(sid, a1, a2);
exec_script_proc(sid, SCRIPT_PROC_PUSH);
bool scriptOverrides = false;
Script* scr;
if (scr_ptr(sid, &scr) != -1) {
scriptOverrides = scr->scriptOverrides;
}
if (scriptOverrides) {
return -1;
}
}
int rotation = tile_dir(a1->tile, a2->tile);
int tile;
do {
tile = tile_num_in_direction(a2->tile, rotation, 1);
if (obj_blocking_at(a2, tile, a2->elevation) == NULL) {
break;
}
tile = tile_num_in_direction(a2->tile, (rotation + 1) % ROTATION_COUNT, 1);
if (obj_blocking_at(a2, tile, a2->elevation) == NULL) {
break;
}
tile = tile_num_in_direction(a2->tile, (rotation + 5) % ROTATION_COUNT, 1);
if (obj_blocking_at(a2, tile, a2->elevation) == NULL) {
break;
}
tile = tile_num_in_direction(a2->tile, (rotation + 2) % ROTATION_COUNT, 1);
if (obj_blocking_at(a2, tile, a2->elevation) == NULL) {
break;
}
tile = tile_num_in_direction(a2->tile, (rotation + 4) % ROTATION_COUNT, 1);
if (obj_blocking_at(a2, tile, a2->elevation) == NULL) {
break;
}
tile = tile_num_in_direction(a2->tile, (rotation + 3) % ROTATION_COUNT, 1);
if (obj_blocking_at(a2, tile, a2->elevation) == NULL) {
break;
}
return -1;
} while (0);
int actionPoints;
if (isInCombat()) {
actionPoints = a2->data.critter.combat.ap;
} else {
actionPoints = -1;
}
register_begin(ANIMATION_REQUEST_RESERVED);
register_object_turn_towards(a2, tile);
register_object_move_to_tile(a2, tile, a2->elevation, actionPoints, 0);
return register_end();
}
// Returns -1 if can't see there (can't find a path there)
// Returns -2 if it's too far (> 12 tiles).
//
// 0x413970
int action_can_talk_to(Object* a1, Object* a2)
{
if (make_path_func(a1, a1->tile, a2->tile, NULL, 0, obj_sight_blocking_at) == 0) {
return -1;
}
if (tile_dist(a1->tile, a2->tile) > 12) {
return -2;
}
return 0;
}
================================================
FILE: src/game/actions.h
================================================
#ifndef FALLOUT_GAME_ACTIONS_H_
#define FALLOUT_GAME_ACTIONS_H_
#include <stdbool.h>
#include "game/combat_defs.h"
#include "game/object_types.h"
#include "game/proto_types.h"
extern unsigned int rotation;
extern int obj_fid;
extern int obj_pid_old;
void switch_dude();
int action_knockback(Object* obj, int* anim, int maxDistance, int rotation, int delay);
int action_blood(Object* obj, int anim, int delay);
void show_damage_to_object(Object* a1, int damage, int flags, Object* weapon, bool isFallingBack, int knockbackDistance, int knockbackRotation, int a8, Object* a9, int a10);
int show_damage_target(Attack* attack);
int show_damage_extras(Attack* attack);
void show_damage(Attack* attack, int a2, int a3);
int action_attack(Attack* attack);
int throw_change_fid(Object* object, int fid);
int a_use_obj(Object* a1, Object* a2, Object* a3);
int action_use_an_item_on_object(Object* a1, Object* a2, Object* a3);
int action_use_an_object(Object* a1, Object* a2);
int get_an_object(Object* item);
int action_get_an_object(Object* critter, Object* item);
int action_loot_container(Object* critter, Object* container);
int action_skill_use(int a1);
int action_use_skill_in_combat_error(Object* critter);
int action_use_skill_on(Object* a1, Object* a2, int skill);
Object* pick_object(int objectType, bool a2);
int pick_hex();
bool is_hit_from_front(Object* a1, Object* a2);
bool can_see(Object* a1, Object* a2);
int pick_fall(Object* obj, int anim);
bool action_explode_running();
int action_explode(int tile, int elevation, int minDamage, int maxDamage, Object* a5, bool a6);
int action_talk_to(Object* a1, Object* a2);
void action_dmg(int tile, int elevation, int minDamage, int maxDamage, int damageType, bool animated, bool bypassArmor);
bool action_can_be_pushed(Object* a1, Object* a2);
int action_push_critter(Object* a1, Object* a2);
int action_can_talk_to(Object* a1, Object* a2);
#endif /* FALLOUT_GAME_ACTIONS_H_ */
================================================
FILE: src/game/amutex.c
================================================
#include "game/amutex.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
// 0x530010
static HANDLE autorun_mutex;
// 0x4139C0
bool autorun_mutex_create()
{
autorun_mutex = CreateMutexA(NULL, FALSE, "InterplayGenericAutorunMutex");
if (GetLastError() == ERROR_ALREADY_EXISTS) {
CloseHandle(autorun_mutex);
return false;
}
return true;
}
// 0x413A00
void autorun_mutex_destroy()
{
if (autorun_mutex != NULL) {
CloseHandle(autorun_mutex);
}
}
================================================
FILE: src/game/amutex.h
================================================
#ifndef FALLOUT_GAME_AMUTEX_H_
#define FALLOUT_GAME_AMUTEX_H_
#include <stdbool.h>
bool autorun_mutex_create();
void autorun_mutex_destroy();
#endif /* FALLOUT_GAME_AMUTEX_H_ */
================================================
FILE: src/game/anim.c
================================================
#include "game/anim.h"
#include <stdio.h>
#include <string.h>
#include "game/art.h"
#include "plib/color/color.h"
#include "game/combat.h"
#include "game/combatai.h"
#include "game/combat_defs.h"
#include "plib/gnw/input.h"
#include "game/critter.h"
#include "plib/gnw/debug.h"
#include "game/display.h"
#include "game/game.h"
#include "game/gconfig.h"
#include "game/gmouse.h"
#include "game/gsound.h"
#include "plib/gnw/rect.h"
#include "game/intface.h"
#include "game/item.h"
#include "game/map.h"
#include "game/object.h"
#include "game/perk.h"
#include "game/proto.h"
#include "game/protinst.h"
#include "game/roll.h"
#include "game/scripts.h"
#include "game/stat.h"
#include "game/textobj.h"
#include "game/tile.h"
#include "game/trait.h"
#include "plib/gnw/svga.h"
#include "plib/gnw/vcr.h"
#define ANIMATION_SEQUENCE_LIST_CAPACITY 32
#define ANIMATION_DESCRIPTION_LIST_CAPACITY 55
#define ANIMATION_SAD_LIST_CAPACITY 24
#define ANIMATION_SEQUENCE_FORCED 0x01
typedef enum AnimationKind {
ANIM_KIND_MOVE_TO_OBJECT = 0,
ANIM_KIND_MOVE_TO_TILE = 1,
ANIM_KIND_MOVE_TO_TILE_STRAIGHT = 2,
ANIM_KIND_MOVE_TO_TILE_STRAIGHT_AND_WAIT_FOR_COMPLETE = 3,
ANIM_KIND_ANIMATE = 4,
ANIM_KIND_ANIMATE_REVERSED = 5,
ANIM_KIND_ANIMATE_AND_HIDE = 6,
ANIM_KIND_ROTATE_TO_TILE = 7,
ANIM_KIND_ROTATE_CLOCKWISE = 8,
ANIM_KIND_ROTATE_COUNTER_CLOCKWISE = 9,
ANIM_KIND_HIDE = 10,
ANIM_KIND_CALLBACK = 11,
ANIM_KIND_CALLBACK3 = 12,
ANIM_KIND_SET_FLAG = 14,
ANIM_KIND_UNSET_FLAG = 15,
ANIM_KIND_TOGGLE_FLAT = 16,
ANIM_KIND_SET_FID = 17,
ANIM_KIND_TAKE_OUT_WEAPON = 18,
ANIM_KIND_SET_LIGHT_DISTANCE = 19,
ANIM_KIND_MOVE_ON_STAIRS = 20,
ANIM_KIND_CHECK_FALLING = 23,
ANIM_KIND_TOGGLE_OUTLINE = 24,
ANIM_KIND_ANIMATE_FOREVER = 25,
ANIM_KIND_26 = 26,
ANIM_KIND_27 = 27,
ANIM_KIND_NOOP = 28,
} AnimationKind;
typedef enum AnimationSequenceFlags {
// Specifies that the animation sequence has high priority, it cannot be
// cleared.
ANIM_SEQ_PRIORITIZED = 0x01,
// Specifies that the animation sequence started combat animation mode and
// therefore should balance it with appropriate finish call.
ANIM_SEQ_COMBAT_ANIM_STARTED = 0x02,
// Specifies that the animation sequence is reserved (TODO: explain what it
// actually means).
ANIM_SEQ_RESERVED = 0x04,
// Specifies that the animation sequence is in the process of adding actions
// to it (that is in the middle of begin/end calls).
ANIM_SEQ_ACCUMULATING = 0x08,
// TODO: Add description.
ANIM_SEQ_0x10 = 0x10,
// TODO: Add description.
ANIM_SEQ_0x20 = 0x20,
// Specifies that the animation sequence is negligible and will be end
// immediately when a new animation sequence is requested for the same
// object.
ANIM_SEQ_INSIGNIFICANT = 0x40,
// Specifies that the animation sequence should not return to ANIM_STAND
// when it's completed.
ANIM_SEQ_NO_STAND = 0x80,
} AnimationSequenceFlags;
typedef enum AnimationSadFlags {
// Specifies that the animation should play from end to start.
ANIM_SAD_REVERSE = 0x01,
// Specifies that the animation should use straight movement mode (as
// opposed to normal movement mode).
ANIM_SAD_STRAIGHT = 0x02,
// Specifies that no frame change should occur during animation.
ANIM_SAD_NO_ANIM = 0x04,
// Specifies that the animation should be played fully from start to finish.
//
// NOTE: This flag is only used together with straight movement mode to
// implement knockdown. Without this flag when the knockdown distance is
// short, say 1 or 2 tiles, knockdown animation might not be completed by
// the time critter reached it's destination. With this flag set animation
// will be played to it's final frame.
ANIM_SAD_WAIT_FOR_COMPLETION = 0x10,
// Unknown, set once, never read.
ANIM_SAD_0x20 = 0x20,
// Specifies that the owner of the animation should be hidden when animation
// is completed.
ANIM_SAD_HIDE_ON_END = 0x40,
// Specifies that the animation should never end.
ANIM_SAD_FOREVER = 0x80,
} AnimationSadFlags;
typedef struct AnimationDescription {
int kind;
union {
Object* owner;
// - ANIM_KIND_CALLBACK
// - ANIM_KIND_CALLBACK3
void* param2;
};
union {
// - ANIM_KIND_MOVE_TO_OBJECT
Object* destination;
// - ANIM_KIND_CALLBACK
void* param1;
};
union {
// - ANIM_KIND_MOVE_TO_TILE
// - ANIM_KIND_ANIMATE_AND_MOVE_TO_TILE_STRAIGHT
// - ANIM_KIND_MOVE_TO_TILE_STRAIGHT
struct {
int tile;
int elevation;
};
// ANIM_KIND_SET_FID
int fid;
// ANIM_KIND_TAKE_OUT_WEAPON
int weaponAnimationCode;
// ANIM_KIND_SET_LIGHT_DISTANCE
int lightDistance;
// ANIM_KIND_TOGGLE_OUTLINE
bool outline;
};
int anim;
int delay;
// ANIM_KIND_CALLBACK
AnimationCallback* callback;
// ANIM_KIND_CALLBACK3
AnimationCallback3* callback3;
union {
// - ANIM_KIND_SET_FLAG
// - ANIM_KIND_UNSET_FLAG
unsigned int objectFlag;
// - ANIM_KIND_HIDE
// - ANIM_KIND_CALLBACK
unsigned int extendedFlags;
};
union {
// - ANIM_KIND_MOVE_TO_TILE
// - ANIM_KIND_MOVE_TO_OBJECT
int actionPoints;
// ANIM_KIND_26
int animationSequenceIndex;
// ANIM_KIND_CALLBACK3
void* param3;
};
CacheEntry* artCacheKey;
} AnimationDescription;
typedef struct AnimationSequence {
int field_0;
// Index of current animation in [animations] array or -1 if animations in
// this sequence is not playing.
int animationIndex;
// Number of scheduled animations in [animations] array.
int length;
unsigned int flags;
AnimationDescription animations[ANIMATION_DESCRIPTION_LIST_CAPACITY];
} AnimationSequence;
typedef struct PathNode {
int tile;
int from;
// actual type is likely char
int rotation;
int field_C;
int field_10;
} PathNode;
// TODO: I don't know what `sad` means, but it's definitely better than
// `STRUCT_530014`. Find a better name.
typedef struct AnimationSad {
unsigned int flags;
Object* obj;
int fid; // fid
int anim;
// Timestamp (in game ticks) when animation last occurred.
unsigned int animationTimestamp;
// Number of ticks per frame (taking art's fps and overall animation speed
// settings into account).
unsigned int ticksPerFrame;
int animationSequenceIndex;
int field_1C; // length of field_28
int field_20; // current index in field_28
int field_24;
union {
unsigned char rotations[3200];
StraightPathNode field_28[200];
};
} AnimationSad;
static_assert(sizeof(AnimationSad) == 3240, "wrong size");
static int anim_free_slot(int a1);
static int anim_preload(Object* object, int fid, CacheEntry** cacheEntryPtr);
static void anim_cleanup();
static int anim_set_check(int a1);
static int anim_set_continue(int a1, int a2);
static int anim_set_end(int a1);
static bool anim_can_use_door(Object* critter, Object* door);
static int anim_move_to_object(Object* from, Object* to, int a3, int anim, int animationSequenceIndex);
static int make_stair_path(Object* object, int from, int fromElevation, int to, int toElevation, StraightPathNode* a6, Object** obstaclePtr);
static int anim_move_to_tile(Object* obj, int tile_num, int elev, int a4, int anim, int animationSequenceIndex);
static int anim_move(Object* obj, int tile, int elev, int a3, int anim, int a5, int animationSequenceIndex);
static int anim_move_straight_to_tile(Object* obj, int tile, int elevation, int anim, int animationSequenceIndex, int flags);
static void object_move(int index);
static void object_straight_move(int index);
static int anim_animate(Object* obj, int anim, int animationSequenceIndex, int flags);
static void object_anim_compact();
static int anim_turn_towards(Object* obj, int delta, int animationSequenceIndex);
static int check_gravity(int tile, int elevation);
// 0x510718
static int curr_sad = 0;
// 0x51071C
static int curr_anim_set = -1;
// 0x510720
static bool anim_in_init = false;
// 0x510724
static bool anim_in_anim_stop = false;
// 0x510728
static bool anim_in_bk = false;
// 0x530014
static AnimationSad sad[ANIMATION_SAD_LIST_CAPACITY];
// 0x542FD4
static PathNode dad[2000];
// 0x54CC14
static AnimationSequence anim_set[ANIMATION_SEQUENCE_LIST_CAPACITY];
// 0x561814
static unsigned char seen[5000];
// 0x562B9C
static PathNode child[2000];
// 0x56C7DC
static int curr_anim_counter;
// anim_init
// 0x413A20
void anim_init()
{
anim_in_init = true;
anim_reset();
anim_in_init = false;
}
// 0x413A40
void anim_reset()
{
if (!anim_in_init) {
// NOTE: Uninline.
anim_stop();
}
curr_sad = 0;
curr_anim_set = -1;
for (int index = 0; index < ANIMATION_SEQUENCE_LIST_CAPACITY; index++) {
anim_set[index].field_0 = -1000;
anim_set[index].flags = 0;
}
}
// 0x413AB8
void anim_exit()
{
// NOTE: Uninline.
anim_stop();
}
// 0x413AF4
int register_begin(int requestOptions)
{
if (curr_anim_set != -1) {
return -1;
}
if (anim_in_anim_stop) {
return -1;
}
int v1 = anim_free_slot(requestOptions);
if (v1 == -1) {
return -1;
}
AnimationSequence* animationSequence = &(anim_set[v1]);
animationSequence->flags |= ANIM_SEQ_ACCUMULATING;
if ((requestOptions & ANIMATION_REQUEST_RESERVED) != 0) {
animationSequence->flags |= ANIM_SEQ_RESERVED;
}
if ((requestOptions & ANIMATION_REQUEST_INSIGNIFICANT) != 0) {
animationSequence->flags |= ANIM_SEQ_INSIGNIFICANT;
}
if ((requestOptions & ANIMATION_REQUEST_NO_STAND) != 0) {
animationSequence->flags |= ANIM_SEQ_NO_STAND;
}
curr_anim_set = v1;
curr_anim_counter = 0;
return 0;
}
// 0x413B80
static int anim_free_slot(int requestOptions)
{
int v1 = -1;
int v2 = 0;
for (int index = 0; index < ANIMATION_SEQUENCE_LIST_CAPACITY; index++) {
AnimationSequence* animationSequence = &(anim_set[index]);
if (animationSequence->field_0 != -1000 || (animationSequence->flags & ANIM_SEQ_ACCUMULATING) != 0 || (animationSequence->flags & ANIM_SEQ_0x20) != 0) {
if (!(animationSequence->flags & ANIM_SEQ_RESERVED)) {
v2++;
}
} else if (v1 == -1 && ((requestOptions & ANIMATION_REQUEST_0x100) == 0 || (animationSequence->flags & ANIM_SEQ_0x10) == 0)) {
v1 = index;
}
}
if (v1 == -1) {
if ((requestOptions & ANIMATION_REQUEST_RESERVED) != 0) {
debug_printf("Unable to begin reserved animation!\n");
}
return -1;
} else if ((requestOptions & ANIMATION_REQUEST_RESERVED) != 0 || v2 < 20) {
return v1;
}
return -1;
}
// 0x413C20
int register_priority(int a1)
{
if (curr_anim_set == -1) {
return -1;
}
if (a1 == 0) {
return -1;
}
anim_set[curr_anim_set].flags |= ANIM_SEQ_PRIORITIZED;
return 0;
}
// 0x413C4C
int register_clear(Object* a1)
{
for (int animationSequenceIndex = 0; animationSequenceIndex < ANIMATION_SEQUENCE_LIST_CAPACITY; animationSequenceIndex++) {
AnimationSequence* animationSequence = &(anim_set[animationSequenceIndex]);
if (animationSequence->field_0 == -1000) {
continue;
}
int animationDescriptionIndex;
for (animationDescriptionIndex = 0; animationDescriptionIndex < animationSequence->length; animationDescriptionIndex++) {
AnimationDescription* animationDescription = &(animationSequence->animations[animationDescriptionIndex]);
if (a1 != animationDescription->owner || animationDescription->kind == 11) {
continue;
}
break;
}
if (animationDescriptionIndex == animationSequence->length) {
continue;
}
if ((animationSequence->flags & ANIM_SEQ_PRIORITIZED) != 0) {
return -2;
}
anim_set_end(animationSequenceIndex);
return 0;
}
return -1;
}
// 0x413CCC
int register_end()
{
if (curr_anim_set == -1) {
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
animationSequence->field_0 = 0;
animationSequence->length = curr_anim_counter;
animationSequence->animationIndex = -1;
animationSequence->flags &= ~ANIM_SEQ_ACCUMULATING;
animationSequence->animations[0].delay = 0;
if (isInCombat()) {
combat_anim_begin();
animationSequence->flags |= ANIM_SEQ_COMBAT_ANIM_STARTED;
}
int v1 = curr_anim_set;
curr_anim_set = -1;
if (!(animationSequence->flags & ANIM_SEQ_0x10)) {
anim_set_continue(v1, 1);
}
return 0;
}
// NOTE: Inlined.
//
// 0x413D6C
static int anim_preload(Object* object, int fid, CacheEntry** cacheEntryPtr)
{
*cacheEntryPtr = NULL;
if (art_ptr_lock(fid, cacheEntryPtr) != NULL) {
art_ptr_unlock(*cacheEntryPtr);
*cacheEntryPtr = NULL;
return 0;
}
return -1;
}
// 0x413D98
static void anim_cleanup()
{
if (curr_anim_set == -1) {
return;
}
for (int index = 0; index < ANIMATION_SEQUENCE_LIST_CAPACITY; index++) {
anim_set[index].flags &= ~(ANIM_SEQ_ACCUMULATING | ANIM_SEQ_0x10);
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
for (int index = 0; index < curr_anim_counter; index++) {
AnimationDescription* animationDescription = &(animationSequence->animations[index]);
if (animationDescription->artCacheKey != NULL) {
art_ptr_unlock(animationDescription->artCacheKey);
}
if (animationDescription->kind == ANIM_KIND_CALLBACK && animationDescription->callback == gsnd_anim_sound) {
gsound_delete_sfx(animationDescription->param1);
}
}
curr_anim_set = -1;
}
// 0x413E2C
int check_registry(Object* obj)
{
if (curr_anim_set == -1) {
return -1;
}
if (curr_anim_counter >= ANIMATION_DESCRIPTION_LIST_CAPACITY) {
return -1;
}
if (obj == NULL) {
return 0;
}
for (int animationSequenceIndex = 0; animationSequenceIndex < ANIMATION_SEQUENCE_LIST_CAPACITY; animationSequenceIndex++) {
AnimationSequence* animationSequence = &(anim_set[animationSequenceIndex]);
if (animationSequenceIndex != curr_anim_set && animationSequence->field_0 != -1000) {
for (int animationDescriptionIndex = 0; animationDescriptionIndex < animationSequence->length; animationDescriptionIndex++) {
AnimationDescription* animationDescription = &(animationSequence->animations[animationDescriptionIndex]);
if (obj == animationDescription->owner && animationDescription->kind != 11) {
if ((animationSequence->flags & ANIM_SEQ_INSIGNIFICANT) == 0) {
return -1;
}
anim_set_end(animationSequenceIndex);
}
}
}
}
return 0;
}
// Returns -1 if object is playing some animation.
//
// 0x413EC8
int anim_busy(Object* a1)
{
if (curr_anim_counter >= ANIMATION_DESCRIPTION_LIST_CAPACITY || a1 == NULL) {
return 0;
}
for (int animationSequenceIndex = 0; animationSequenceIndex < ANIMATION_SEQUENCE_LIST_CAPACITY; animationSequenceIndex++) {
AnimationSequence* animationSequence = &(anim_set[animationSequenceIndex]);
if (animationSequenceIndex != curr_anim_set && animationSequence->field_0 != -1000) {
for (int animationDescriptionIndex = 0; animationDescriptionIndex < animationSequence->length; animationDescriptionIndex++) {
AnimationDescription* animationDescription = &(animationSequence->animations[animationDescriptionIndex]);
if (a1 != animationDescription->owner) {
continue;
}
if (animationDescription->kind == ANIM_KIND_CALLBACK) {
continue;
}
if (animationSequence->length == 1 && animationDescription->anim == ANIM_STAND) {
continue;
}
return -1;
}
}
}
return 0;
}
// 0x413F5C
int register_object_move_to_object(Object* owner, Object* destination, int actionPoints, int delay)
{
if (check_registry(owner) == -1 || actionPoints == 0) {
anim_cleanup();
return -1;
}
if (owner->tile == destination->tile && owner->elevation == destination->elevation) {
return 0;
}
AnimationDescription* animationDescription = &(anim_set[curr_anim_set].animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_MOVE_TO_OBJECT;
animationDescription->anim = ANIM_WALK;
animationDescription->owner = owner;
animationDescription->destination = destination;
animationDescription->actionPoints = actionPoints;
animationDescription->delay = delay;
int fid = art_id(FID_TYPE(owner->fid), owner->fid & 0xFFF, animationDescription->anim, (owner->fid & 0xF000) >> 12, owner->rotation + 1);
// NOTE: Uninline.
if (anim_preload(owner, fid, &(animationDescription->artCacheKey)) == -1) {
anim_cleanup();
return -1;
}
curr_anim_counter++;
return register_object_turn_towards(owner, destination->tile);
}
// 0x41405C
int register_object_run_to_object(Object* owner, Object* destination, int actionPoints, int delay)
{
if (check_registry(owner) == -1 || actionPoints == 0) {
anim_cleanup();
return -1;
}
if (owner->tile == destination->tile && owner->elevation == destination->elevation) {
return 0;
}
if (critterIsOverloaded(owner)) {
if (isPartyMember(owner)) {
char formattedText[92];
MessageListItem messageListItem;
if (owner == obj_dude) {
// You are overloaded.
strcpy(formattedText, getmsg(&misc_message_file, &messageListItem, 8000));
} else {
// %s is overloaded.
sprintf(formattedText,
getmsg(&misc_message_file, &messageListItem, 8001),
critter_name(owner));
}
display_print(formattedText);
}
return register_object_move_to_object(owner, destination, actionPoints, delay);
}
AnimationDescription* animationDescription = &(anim_set[curr_anim_set].animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_MOVE_TO_OBJECT;
animationDescription->owner = owner;
animationDescription->destination = destination;
if ((FID_TYPE(owner->fid) == OBJ_TYPE_CRITTER && (owner->data.critter.combat.results & DAM_CRIP_LEG_ANY) != 0)
|| (owner == obj_dude && is_pc_flag(0) && !perk_level(obj_dude, PERK_SILENT_RUNNING))
|| (!art_exists(art_id(FID_TYPE(owner->fid), owner->fid & 0xFFF, ANIM_RUNNING, 0, owner->rotation + 1)))) {
animationDescription->anim = ANIM_WALK;
} else {
animationDescription->anim = ANIM_RUNNING;
}
animationDescription->actionPoints = actionPoints;
animationDescription->delay = delay;
int fid = art_id(FID_TYPE(owner->fid), owner->fid & 0xFFF, animationDescription->anim, (owner->fid & 0xF000) >> 12, owner->rotation + 1);
// NOTE: Uninline.
if (anim_preload(owner, fid, &(animationDescription->artCacheKey)) == -1) {
anim_cleanup();
return -1;
}
curr_anim_counter++;
return register_object_turn_towards(owner, destination->tile);
}
// 0x414294
int register_object_move_to_tile(Object* owner, int tile, int elevation, int actionPoints, int delay)
{
if (check_registry(owner) == -1 || actionPoints == 0) {
anim_cleanup();
return -1;
}
if (tile == owner->tile && elevation == owner->elevation) {
return 0;
}
AnimationDescription* animationDescription = &(anim_set[curr_anim_set].animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_MOVE_TO_TILE;
animationDescription->anim = ANIM_WALK;
animationDescription->owner = owner;
animationDescription->tile = tile;
animationDescription->elevation = elevation;
animationDescription->actionPoints = actionPoints;
animationDescription->delay = delay;
int fid = art_id(FID_TYPE(owner->fid), owner->fid & 0xFFF, animationDescription->anim, (owner->fid & 0xF000) >> 12, owner->rotation + 1);
// NOTE: Uninline.
if (anim_preload(owner, fid, &(animationDescription->artCacheKey)) == -1) {
anim_cleanup();
return -1;
}
curr_anim_counter++;
return 0;
}
// 0x414394
int register_object_run_to_tile(Object* owner, int tile, int elevation, int actionPoints, int delay)
{
if (check_registry(owner) == -1 || actionPoints == 0) {
anim_cleanup();
return -1;
}
if (tile == owner->tile && elevation == owner->elevation) {
return 0;
}
if (critterIsOverloaded(owner)) {
if (isPartyMember(owner)) {
MessageListItem messageListItem;
char formattedText[72];
if (owner == obj_dude) {
// You are overloaded.
strcpy(formattedText, getmsg(&misc_message_file, &messageListItem, 8000));
} else {
// %s is overloaded.
sprintf(formattedText,
getmsg(&misc_message_file, &messageListItem, 8001),
critter_name(owner));
}
display_print(formattedText);
}
return register_object_move_to_tile(owner, tile, elevation, actionPoints, delay);
}
AnimationDescription* animationDescription = &(anim_set[curr_anim_set].animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_MOVE_TO_TILE;
animationDescription->owner = owner;
animationDescription->tile = tile;
animationDescription->elevation = elevation;
if ((FID_TYPE(owner->fid) == OBJ_TYPE_CRITTER && (owner->data.critter.combat.results & DAM_CRIP_LEG_ANY) != 0)
|| (owner == obj_dude && is_pc_flag(0) && !perk_level(obj_dude, PERK_SILENT_RUNNING))
|| (!art_exists(art_id(FID_TYPE(owner->fid), owner->fid & 0xFFF, ANIM_RUNNING, 0, owner->rotation + 1)))) {
animationDescription->anim = ANIM_WALK;
} else {
animationDescription->anim = ANIM_RUNNING;
}
animationDescription->actionPoints = actionPoints;
animationDescription->delay = delay;
int fid = art_id(FID_TYPE(owner->fid), owner->fid & 0xFFF, animationDescription->anim, (owner->fid & 0xF000) >> 12, owner->rotation + 1);
// NOTE: Uninline.
if (anim_preload(owner, fid, &(animationDescription->artCacheKey)) == -1) {
anim_cleanup();
return -1;
}
curr_anim_counter++;
return 0;
}
// 0x4145D0
int register_object_move_straight_to_tile(Object* object, int tile, int elevation, int anim, int delay)
{
if (check_registry(object) == -1) {
anim_cleanup();
return -1;
}
if (tile == object->tile && elevation == object->elevation) {
return 0;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_MOVE_TO_TILE_STRAIGHT;
animationDescription->owner = object;
animationDescription->tile = tile;
animationDescription->elevation = elevation;
animationDescription->anim = anim;
animationDescription->delay = delay;
int fid = art_id(FID_TYPE(object->fid), object->fid & 0xFFF, animationDescription->anim, (object->fid & 0xF000) >> 12, object->rotation + 1);
// NOTE: Uninline.
if (anim_preload(object, fid, &(animationDescription->artCacheKey)) == -1) {
anim_cleanup();
return -1;
}
curr_anim_counter++;
return 0;
}
// 0x4146C4
int register_object_animate_and_move_straight(Object* owner, int tile, int elevation, int anim, int delay)
{
if (check_registry(owner) == -1) {
anim_cleanup();
return -1;
}
if (tile == owner->tile && elevation == owner->elevation) {
return 0;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_MOVE_TO_TILE_STRAIGHT_AND_WAIT_FOR_COMPLETE;
animationDescription->owner = owner;
animationDescription->tile = tile;
animationDescription->elevation = elevation;
animationDescription->anim = anim;
animationDescription->delay = delay;
int fid = art_id(FID_TYPE(owner->fid), owner->fid & 0xFFF, animationDescription->anim, (owner->fid & 0xF000) >> 12, owner->rotation + 1);
// NOTE: Uninline.
if (anim_preload(owner, fid, &(animationDescription->artCacheKey)) == -1) {
anim_cleanup();
return -1;
}
curr_anim_counter++;
return 0;
}
// NOTE: Unused.
//
// 0x4147B
int register_object_move_on_stairs(Object* owner, Object* stairs, int delay)
{
int anim;
int destTile;
int destElevation;
AnimationSequence* animationSequence;
AnimationDescription* animationDescription;
int fid;
if (check_registry(owner) == -1) {
anim_cleanup();
return -1;
}
if (owner->elevation == stairs->elevation) {
anim = ANIM_UP_STAIRS_LEFT;
destTile = stairs->tile + 4;
destElevation = stairs->elevation + 1;
} else {
anim = ANIM_DOWN_STAIRS_RIGHT;
destTile = stairs->tile + 200;
destElevation = stairs->elevation;
}
if (destTile == owner->tile && destElevation == owner->elevation) {
return 0;
}
animationSequence = &(anim_set[curr_anim_set]);
animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_MOVE_ON_STAIRS;
animationDescription->owner = owner;
animationDescription->tile = destTile;
animationDescription->elevation = destElevation;
animationDescription->anim = anim;
animationDescription->delay = delay;
fid = art_id(FID_TYPE(owner->fid), owner->fid & 0xFFF, animationDescription->anim, (owner->fid & 0xF000) >> 12, owner->rotation + 1);
// NOTE: Uninline
if (anim_preload(owner, fid, &(animationDescription->artCacheKey)) == -1) {
anim_cleanup();
return -1;
}
curr_anim_counter++;
return 0;
}
// NOTE: Unused.
//
// 0x4148F0
int register_object_check_falling(Object* owner, int delay)
{
AnimationSequence* animationSequence;
AnimationDescription* animationDescription;
int fid;
if (check_registry(owner) == -1) {
anim_cleanup();
return -1;
}
animationSequence = &(anim_set[curr_anim_set]);
animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_CHECK_FALLING;
animationDescription->anim = ANIM_FALLING;
animationDescription->owner = owner;
animationDescription->delay = delay;
fid = art_id(FID_TYPE(owner->fid), owner->fid & 0xFFF, animationDescription->anim, (owner->fid & 0xF000) >> 12, owner->rotation + 1);
// NOTE: Uninline
if (anim_preload(owner, fid, &(animationDescription->artCacheKey)) == -1) {
anim_cleanup();
return -1;
}
curr_anim_counter++;
return 0;
}
// 0x4149D0
int register_object_animate(Object* owner, int anim, int delay)
{
if (check_registry(owner) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_ANIMATE;
animationDescription->owner = owner;
animationDescription->anim = anim;
animationDescription->delay = delay;
int fid = art_id(FID_TYPE(owner->fid), owner->fid & 0xFFF, animationDescription->anim, (owner->fid & 0xF000) >> 12, owner->rotation + 1);
// NOTE: Uninline.
if (anim_preload(owner, fid, &(animationDescription->artCacheKey)) == -1) {
anim_cleanup();
return -1;
}
curr_anim_counter++;
return 0;
}
// 0x414AA8
int register_object_animate_reverse(Object* owner, int anim, int delay)
{
if (check_registry(owner) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_ANIMATE_REVERSED;
animationDescription->owner = owner;
animationDescription->anim = anim;
animationDescription->delay = delay;
animationDescription->artCacheKey = NULL;
int fid = art_id(FID_TYPE(owner->fid), owner->fid & 0xFFF, animationDescription->anim, (owner->fid & 0xF000) >> 12, owner->rotation + 1);
// NOTE: Uninline.
if (anim_preload(owner, fid, &(animationDescription->artCacheKey)) == -1) {
anim_cleanup();
return -1;
}
curr_anim_counter++;
return 0;
}
// 0x414B7C
int register_object_animate_and_hide(Object* owner, int anim, int delay)
{
if (check_registry(owner) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_ANIMATE_AND_HIDE;
animationDescription->owner = owner;
animationDescription->anim = anim;
animationDescription->delay = delay;
animationDescription->artCacheKey = NULL;
int fid = art_id(FID_TYPE(owner->fid), owner->fid & 0xFFF, anim, (owner->fid & 0xF000) >> 12, owner->rotation + 1);
// NOTE: Uninline.
if (anim_preload(owner, fid, &(animationDescription->artCacheKey)) == -1) {
anim_cleanup();
return -1;
}
curr_anim_counter++;
return 0;
}
// 0x414C50
int register_object_turn_towards(Object* owner, int tile)
{
if (check_registry(owner) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_ROTATE_TO_TILE;
animationDescription->delay = -1;
animationDescription->artCacheKey = NULL;
animationDescription->owner = owner;
animationDescription->tile = tile;
curr_anim_counter++;
return 0;
}
// 0x414CC8
int register_object_inc_rotation(Object* owner)
{
if (check_registry(owner) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_ROTATE_CLOCKWISE;
animationDescription->delay = -1;
animationDescription->artCacheKey = NULL;
animationDescription->owner = owner;
curr_anim_counter++;
return 0;
}
// 0x414D38
int register_object_dec_rotation(Object* owner)
{
if (check_registry(owner) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_ROTATE_COUNTER_CLOCKWISE;
animationDescription->delay = -1;
animationDescription->artCacheKey = NULL;
animationDescription->owner = owner;
curr_anim_counter++;
return 0;
}
// NOTE: Unused.
//
// 0x414DA8
int register_object_erase(Object* object)
{
if (check_registry(object) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_HIDE;
animationDescription->delay = -1;
animationDescription->artCacheKey = NULL;
animationDescription->extendedFlags = 0;
animationDescription->owner = object;
curr_anim_counter++;
return 0;
}
// 0x414E20
int register_object_must_erase(Object* object)
{
if (check_registry(object) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_HIDE;
animationDescription->delay = -1;
animationDescription->artCacheKey = NULL;
animationDescription->extendedFlags = ANIMATION_SEQUENCE_FORCED;
animationDescription->owner = object;
curr_anim_counter++;
return 0;
}
// 0x414E98
int register_object_call(void* a1, void* a2, AnimationCallback* proc, int delay)
{
if (check_registry(NULL) == -1 || proc == NULL) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_CALLBACK;
animationDescription->extendedFlags = 0;
animationDescription->artCacheKey = NULL;
animationDescription->param2 = a2;
animationDescription->param1 = a1;
animationDescription->callback = proc;
animationDescription->delay = delay;
curr_anim_counter++;
return 0;
}
// Same as `register_object_call` but accepting 3 parameters.
//
// 0x414F20
int register_object_call3(void* a1, void* a2, void* a3, AnimationCallback3* proc, int delay)
{
if (check_registry(NULL) == -1 || proc == NULL) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_CALLBACK3;
animationDescription->extendedFlags = 0;
animationDescription->artCacheKey = NULL;
animationDescription->param2 = a2;
animationDescription->param1 = a1;
animationDescription->callback3 = proc;
animationDescription->param3 = a3;
animationDescription->delay = delay;
curr_anim_counter++;
return 0;
}
// 0x414FAC
int register_object_must_call(void* a1, void* a2, AnimationCallback* proc, int delay)
{
if (check_registry(NULL) == -1 || proc == NULL) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_CALLBACK;
animationDescription->extendedFlags = ANIMATION_SEQUENCE_FORCED;
animationDescription->artCacheKey = NULL;
animationDescription->param2 = a2;
animationDescription->param1 = a1;
animationDescription->callback = proc;
animationDescription->delay = delay;
curr_anim_counter++;
return 0;
}
// NOTE: Unused.
//
// The [flag] parameter should be one of OBJECT_* flags. The way it's handled
// down the road implies it should not be a group of flags (joined with bitwise
// OR), but a one particular flag.
//
// 0x415034
int register_object_fset(Object* object, int flag, int delay)
{
if (check_registry(object) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_SET_FLAG;
animationDescription->artCacheKey = NULL;
animationDescription->owner = object;
animationDescription->objectFlag = flag;
animationDescription->delay = delay;
curr_anim_counter++;
return 0;
}
// The [flag] parameter should be one of OBJECT_* flags. The way it's handled
// down the road implies it should not be a group of flags (joined with bitwise
// OR), but a one particular flag.
//
// 0x4150A8
int register_object_funset(Object* object, int flag, int delay)
{
if (check_registry(object) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_UNSET_FLAG;
animationDescription->artCacheKey = NULL;
animationDescription->owner = object;
animationDescription->objectFlag = flag;
animationDescription->delay = delay;
curr_anim_counter++;
return 0;
}
// 0x41518C
int register_object_change_fid(Object* owner, int fid, int delay)
{
if (check_registry(owner) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_SET_FID;
animationDescription->owner = owner;
animationDescription->fid = fid;
animationDescription->delay = delay;
// NOTE: Uninline.
if (anim_preload(owner, fid, &(animationDescription->artCacheKey)) == -1) {
anim_cleanup();
return -1;
}
curr_anim_counter++;
return 0;
}
// 0x415238
int register_object_take_out(Object* owner, int weaponAnimationCode, int delay)
{
const char* sfx = gsnd_build_character_sfx_name(owner, ANIM_TAKE_OUT, weaponAnimationCode);
if (register_object_play_sfx(owner, sfx, delay) == -1) {
return -1;
}
if (check_registry(owner) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_TAKE_OUT_WEAPON;
animationDescription->anim = ANIM_TAKE_OUT;
animationDescription->delay = 0;
animationDescription->owner = owner;
animationDescription->weaponAnimationCode = weaponAnimationCode;
int fid = art_id(FID_TYPE(owner->fid), owner->fid & 0xFFF, ANIM_TAKE_OUT, weaponAnimationCode, owner->rotation + 1);
// NOTE: Uninline.
if (anim_preload(owner, fid, &(animationDescription->artCacheKey)) == -1) {
anim_cleanup();
return -1;
}
curr_anim_counter++;
return 0;
}
// 0x415334
int register_object_light(Object* owner, int lightDistance, int delay)
{
if (check_registry(owner) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_SET_LIGHT_DISTANCE;
animationDescription->artCacheKey = NULL;
animationDescription->owner = owner;
animationDescription->lightDistance = lightDistance;
animationDescription->delay = delay;
curr_anim_counter++;
return 0;
}
// NOTE: Unused.
//
// 0x4153A8
int register_object_outline(Object* object, bool outline, int delay)
{
if (check_registry(object) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_TOGGLE_OUTLINE;
animationDescription->artCacheKey = NULL;
animationDescription->owner = object;
animationDescription->outline = outline;
animationDescription->delay = delay;
curr_anim_counter++;
return 0;
}
// 0x41541C
int register_object_play_sfx(Object* owner, const char* soundEffectName, int delay)
{
if (check_registry(owner) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_CALLBACK;
animationDescription->owner = owner;
if (soundEffectName != NULL) {
int volume = gsound_compute_relative_volume(owner);
animationDescription->param1 = gsound_load_sound_volume(soundEffectName, owner, volume);
if (animationDescription->param1 != NULL) {
animationDescription->callback = gsnd_anim_sound;
} else {
animationDescription->kind = ANIM_KIND_NOOP;
}
} else {
animationDescription->kind = ANIM_KIND_NOOP;
}
animationDescription->artCacheKey = NULL;
animationDescription->delay = delay;
curr_anim_counter++;
return 0;
}
// 0x4154C4
int register_object_animate_forever(Object* owner, int anim, int delay)
{
if (check_registry(owner) == -1) {
anim_cleanup();
return -1;
}
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->kind = ANIM_KIND_ANIMATE_FOREVER;
animationDescription->owner = owner;
animationDescription->anim = anim;
animationDescription->delay = delay;
int fid = art_id(FID_TYPE(owner->fid), owner->fid & 0xFFF, anim, (owner->fid & 0xF000) >> 12, owner->rotation + 1);
// NOTE: Uninline.
if (anim_preload(owner, fid, &(animationDescription->artCacheKey)) == -1) {
anim_cleanup();
return -1;
}
curr_anim_counter++;
return 0;
}
// 0x415598
int register_ping(int a1, int delay)
{
if (check_registry(NULL) == -1) {
anim_cleanup();
return -1;
}
int animationSequenceIndex = anim_free_slot(a1 | ANIMATION_REQUEST_0x100);
if (animationSequenceIndex == -1) {
return -1;
}
anim_set[animationSequenceIndex].flags = ANIM_SEQ_0x10;
AnimationSequence* animationSequence = &(anim_set[curr_anim_set]);
AnimationDescription* animationDescription = &(animationSequence->animations[curr_anim_counter]);
animationDescription->owner = NULL;
animationDescription->kind = ANIM_KIND_26;
animationDescription->artCacheKey = NULL;
animationDescription->animationSequenceIndex = animationSequenceIndex;
animationDescription->delay = delay;
curr_anim_counter++;
return 0;
}
// 0x4156A8
static int anim_set_check(int animationSequenceIndex)
{
if (animationSequenceIndex == -1) {
return -1;
}
AnimationSequence* animationSequence = &(anim_set[animationSequenceIndex]);
if (animationSequence->field_0 == -1000) {
return -1;
}
while (1) {
if (animationSequence->field_0 >= animationSequence->length) {
return 0;
}
if (animationSequence->field_0 > animationSequence->animationIndex) {
AnimationDescription* animationDescription = &(animationSequence->animations[animationSequence->field_0]);
if (animationDescription->delay < 0) {
return 0;
}
if (animationDescription->delay > 0) {
animationDescription->delay--;
return 0;
}
}
AnimationDescription* animationDescription = &(animationSequence->animations[animationSequence->field_0++]);
int rc;
Rect rect;
switch (animationDescription->kind) {
case ANIM_KIND_MOVE_TO_OBJECT:
rc = anim_move_to_object(animationDescription->owner, animationDescription->destination, animationDescription->actionPoints, animationDescription->anim, animationSequenceIndex);
break;
case ANIM_KIND_MOVE_TO_TILE:
rc = anim_move_to_tile(animationDescription->owner, animationDescription->tile, animationDescription->elevation, animationDescription->actionPoints, animationDescription->anim, animationSequenceIndex);
break;
case ANIM_KIND_MOVE_TO_TILE_STRAIGHT:
rc = anim_move_straight_to_tile(animationDescription->owner, animationDescription->tile, animationDescription->elevation, animationDescription->anim, animationSequenceIndex, 0);
break;
case ANIM_KIND_MOVE_TO_TILE_STRAIGHT_AND_WAIT_FOR_COMPLETE:
rc = anim_move_straight_to_tile(animationDescription->owner, animationDescription->tile, animationDescription->elevation, animationDescription->anim, animationSequenceIndex, ANIM_SAD_WAIT_FOR_COMPLETION);
break;
case ANIM_KIND_ANIMATE:
rc = anim_animate(animationDescription->owner, animationDescription->anim, animationSequenceIndex, 0);
break;
case ANIM_KIND_ANIMATE_REVERSED:
rc = anim_animate(animationDescription->owner, animationDescription->anim, animationSequenceIndex, ANIM_SAD_REVERSE);
break;
case ANIM_KIND_ANIMATE_AND_HIDE:
rc = anim_animate(animationDescription->owner, animationDescription->anim, animationSequenceIndex, ANIM_SAD_HIDE_ON_END);
if (rc == -1) {
// NOTE: Uninline.
rc = anim_hide(animationDescription->owner, animationSequenceIndex);
}
break;
case ANIM_KIND_ANIMATE_FOREVER:
rc = anim_animate(animationDescription->owner, animationDescription->anim, animationSequenceIndex, ANIM_SAD_FOREVER);
break;
case ANIM_KIND_ROTATE_TO_TILE:
if (!critter_is_prone(animationDescription->owner)) {
int rotation = tile_dir(animationDescription->owner->tile, animationDescription->tile);
dude_stand(animationDescription->owner, rotation, -1);
}
anim_set_continue(animationSequenceIndex, 0);
rc = 0;
break;
case ANIM_KIND_ROTATE_CLOCKWISE:
rc = anim_turn_towards(animationDescription->owner, 1, animationSequenceIndex);
break;
case ANIM_KIND_ROTATE_COUNTER_CLOCKWISE:
rc = anim_turn_towards(animationDescription->owner, -1, animationSequenceIndex);
break;
case ANIM_KIND_HIDE:
// NOTE: Uninline.
rc = anim_hide(animationDescription->owner, animationSequenceIndex);
break;
case ANIM_KIND_CALLBACK:
rc = animationDescription->callback(animationDescription->param1, animationDescription->param2);
if (rc == 0) {
rc = anim_set_continue(animationSequenceIndex, 0);
}
break;
case ANIM_KIND_CALLBACK3:
rc = animationDescription->callback3(animationDescription->param1, animationDescription->param2, animationDescription->param3);
if (rc == 0) {
rc = anim_set_continue(animationSequenceIndex, 0);
}
break;
case ANIM_KIND_SET_FLAG:
if (animationDescription->objectFlag == OBJECT_LIGHTING) {
if (obj_turn_on_light(animationDescription->owner, &rect) == 0) {
tile_refresh_rect(&rect, animationDescription->owner->elevation);
}
} else if (animationDescription->objectFlag == OBJECT_HIDDEN) {
if (obj_turn_off(animationDescription->owner, &rect) == 0) {
tile_refresh_rect(&rect, animationDescription->owner->elevation);
}
} else {
animationDescription->owner->flags |= animationDescription->objectFlag;
}
rc = anim_set_continue(animationSequenceIndex, 0);
break;
case ANIM_KIND_UNSET_FLAG:
if (animationDescription->objectFlag == OBJECT_LIGHTING) {
if (obj_turn_off_light(animationDescription->owner, &rect) == 0) {
tile_refresh_rect(&rect, animationDescription->owner->elevation);
}
} else if (animationDescription->objectFlag == OBJECT_HIDDEN) {
if (obj_turn_on(animationDescription->owner, &rect) == 0) {
tile_refresh_rect(&rect, animationDescription->owner->elevation);
}
} else {
animationDescription->owner->flags &= ~animationDescription->objectFlag;
}
rc = anim_set_continue(animationSequenceIndex, 0);
break;
case ANIM_KIND_TOGGLE_FLAT:
if (obj_toggle_flat(animationDescription->owner, &rect) == 0) {
tile_refresh_rect(&rect, animationDescription->owner->elevation);
}
rc = anim_set_continue(animationSequenceIndex, 0);
break;
case ANIM_KIND_SET_FID:
rc = anim_change_fid(animationDescription->owner, animationSequenceIndex, animationDescription->fid);
break;
case ANIM_KIND_TAKE_OUT_WEAPON:
rc = anim_animate(animationDescription->owner, ANIM_TAKE_OUT, animationSequenceIndex, animationDescription->tile);
break;
case ANIM_KIND_SET_LIGHT_DISTANCE:
obj_set_light(animationDescription->owner, animationDescription->lightDistance, animationDescription->owner->lightIntensity, &rect);
tile_refresh_rect(&rect, animationDescription->owner->elevation);
rc = anim_set_continue(animationSequenceIndex, 0);
break;
case ANIM_KIND_MOVE_ON_STAIRS:
rc = anim_move_on_stairs(animationDescription->owner, animationDescription->tile, animationDescription->elevation, animationDescription->anim, animationSequenceIndex);
break;
case ANIM_KIND_CHECK_FALLING:
rc = check_for_falling(animationDescription->owner, animationDescription->anim, animationSequenceIndex);
break;
case ANIM_KIND_TOGGLE_OUTLINE:
if (animationDescription->outline) {
if (obj_turn_on_outline(animationDescription->owner, &rect) == 0) {
tile_refresh_rect(&rect, animationDescription->owner->elevation);
}
} else {
if (obj_turn_off_outline(animationDescription->owner, &rect) == 0) {
tile_refresh_rect(&rect, animationDescription->owner->elevation);
}
}
rc = anim_set_continue(animationSequenceIndex, 0);
break;
case ANIM_KIND_26:
anim_set[animationDescription->animationSequenceIndex].flags &= ~ANIM_SEQ_0x10;
rc = anim_set_continue(animationDescription->animationSequenceIndex, 1);
if (rc != -1) {
rc = anim_set_continue(animationSequenceIndex, 0);
}
break;
case ANIM_KIND_NOOP:
rc = anim_set_continue(animationSequenceIndex, 0);
break;
default:
rc = -1;
break;
}
if (rc == -1) {
anim_set_end(animationSequenceIndex);
}
if (animationSequence->field_0 == -1000) {
return -1;
}
}
}
// 0x415B44
static int anim_set_continue(int animationSequenceIndex, int a2)
{
if (animationSequenceIndex == -1) {
return -1;
}
AnimationSequence* animationSequence = &(anim_set[animationSequenceIndex]);
if (animationSequence->field_0 == -1000) {
return -1;
}
animationSequence->animationIndex++;
if (animationSequence->animationIndex == animationSequence->length) {
return anim_set_end(animationSequenceIndex);
} else {
if (a2) {
return anim_set_check(animationSequenceIndex);
}
}
return 0;
}
// 0x415B9C
static int anim_set_end(int animationSequenceIndex)
{
AnimationSequence* animationSequence;
AnimationDescription* animationDescription;
int i;
Rect v27;
if (animationSequenceIndex == -1) {
return -1;
}
animationSequence = &(anim_set[animationSequenceIndex]);
if (animationSequence->field_0 == -1000) {
return -1;
}
for (i = 0; i < curr_sad; i++) {
AnimationSad* sad_entry = &(sad[i]);
if (sad_entry->animationSequenceIndex == animationSequenceIndex) {
sad_entry->field_20 = -1000;
}
}
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))) {
obj_erase_object(animationDescription->owner, &v27);
tile_refresh_rect(&v27, animationDescription->owner->elevation);
}
}
for (i = 0; i < animationSequence->length; i++) {
animationDescription = &(animationSequence->animations[i]);
if (animationDescription->artCacheKey) {
art_ptr_unlock(animationDescription->artCacheKey);
}
if (animationDescription->kind != 11 && animationDescription->kind != 12) {
// TODO: Check.
if (animationDescription->kind != ANIM_KIND_26) {
Object* owner = animationDescription->owner;
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) {
break;
}
}
}
if (i == j) {
int k = 0;
for (; k < animationSequence->animationIndex; k++) {
AnimationDescription* ad = &(animationSequence->animations[k]);
if (ad->kind == ANIM_KIND_HIDE && ad->owner == owner) {
break;
}
}
if (k == animationSequence->animationIndex) {
for (int m = 0; m < curr_sad; m++) {
if (sad[m].obj == owner) {
sad[m].field_20 = -1000;
break;
}
}
if ((animationSequence->flags & ANIM_SEQ_NO_STAND) == 0 && !critter_is_prone(owner)) {
dude_stand(owner, owner->rotation, -1);
}
}
}
}
}
} else if (i >= animationSequence->field_0) {
if (animationDescription->extendedFlags & ANIMATION_SEQUENCE_FORCED) {
animationDescription->callback(animationDescription->param1, animationDescription->param2);
} else {
if (animationDescription->kind == ANIM_KIND_CALLBACK && animationDescription->callback == gsnd_anim_sound) {
gsound_delete_sfx(animationDescription->param1);
}
}
}
}
animationSequence->animationIndex = -1;
animationSequence->field_0 = -1000;
if ((animationSequence->flags & ANIM_SEQ_COMBAT_ANIM_STARTED) != 0) {
combat_anim_finished();
}
if (anim_in_bk) {
animationSequence->flags = ANIM_SEQ_0x20;
} else {
animationSequence->flags = 0;
}
return 0;
}
// 0x415E24
static bool anim_can_use_door(Object* critter, Object* door)
{
if (critter == obj_dude) {
if (!obj_portal_is_walk_thru(door)) {
return false;
}
}
if (FID_TYPE(critter->fid) != OBJ_TYPE_CRITTER) {
return false;
}
if (FID_TYPE(door->fid) != OBJ_TYPE_SCENERY) {
return false;
}
int bodyType = critter_body_type(critter);
if (bodyType != BODY_TYPE_BIPED && bodyType != BODY_TYPE_ROBOTIC) {
return false;
}
Proto* proto;
if (proto_ptr(door->pid, &proto) == -1) {
return false;
}
if (proto->scenery.type != SCENERY_TYPE_DOOR) {
return false;
}
if (obj_is_locked(door)) {
return false;
}
if (critterGetKillType(critter) == KILL_TYPE_GECKO) {
return false;
}
return true;
}
// 0x415EE8
int make_path(Object* object, int from, int to, unsigned char* rotations, int a5)
{
return make_path_func(object, from, to, rotations, a5, obj_blocking_at);
}
// 0x415EFC
int make_path_func(Object* object, int from, int to, unsigned char* rotations, int a5, PathBuilderCallback* callback)
{
if (a5) {
if (callback(object, to, object->elevation) != NULL) {
return 0;
}
}
bool isCritter = false;
int kt = 0;
if (PID_TYPE(object->pid) == OBJ_TYPE_CRITTER) {
isCritter = true;
kt = critterGetKillType(object);
}
bool isNotInCombat = !isInCombat();
memset(seen, 0, sizeof(seen));
seen[from / 8] |= 1 << (from & 7);
child[0].tile = from;
child[0].from = -1;
child[0].rotation = 0;
child[0].field_C = EST(from, to);
child[0].field_10 = 0;
for (int index = 1; index < 2000; index += 1) {
child[index].tile = -1;
}
int toScreenX;
int toScreenY;
tile_coord(to, &toScreenX, &toScreenY, object->elevation);
int closedPathNodeListLength = 0;
int openPathNodeListLength = 1;
PathNode temp;
while (1) {
int v63 = -1;
PathNode* prev = NULL;
int v12 = 0;
for (int index = 0; v12 < openPathNodeListLength; index += 1) {
PathNode* curr = &(child[index]);
if (curr->tile != -1) {
v12++;
if (v63 == -1 || (curr->field_C + curr->field_10) < (prev->field_C + prev->field_10)) {
prev = curr;
v63 = index;
}
}
}
PathNode* curr = &(child[v63]);
memcpy(&temp, curr, sizeof(temp));
openPathNodeListLength -= 1;
curr->tile = -1;
if (temp.tile == to) {
if (openPathNodeListLength == 0) {
openPathNodeListLength = 1;
}
break;
}
PathNode* curr1 = &(dad[closedPathNodeListLength]);
memcpy(curr1, &temp, sizeof(temp));
closedPathNodeListLength += 1;
if (closedPathNodeListLength == 2000) {
return 0;
}
for (int rotation = 0; rotation < ROTATION_COUNT; rotation++) {
int tile = tile_num_in_direction(temp.tile, rotation, 1);
int bit = 1 << (tile & 7);
if ((seen[tile / 8] & bit) != 0) {
continue;
}
if (tile != to) {
Object* v24 = callback(object, tile, object->elevation);
if (v24 != NULL) {
if (!anim_can_use_door(object, v24)) {
continue;
}
}
}
int v25 = 0;
for (; v25 < 2000; v25++) {
if (child[v25].tile == -1) {
break;
}
}
openPathNodeListLength += 1;
if (openPathNodeListLength == 2000) {
return 0;
}
seen[tile / 8] |= bit;
PathNode* v27 = &(child[v25]);
v27->tile = tile;
v27->from = temp.tile;
v27->rotation = rotation;
int newX;
int newY;
tile_coord(tile, &newX, &newY, object->elevation);
v27->field_C = idist(newX, newY, toScreenX, toScreenY);
v27->field_10 = temp.field_10 + 50;
if (isNotInCombat && temp.rotation != rotation) {
v27->field_10 += 10;
}
if (isCritter) {
Object* o = obj_find_first_at_tile(object->elevation, v27->tile);
while (o != NULL) {
if (o->pid >= 0x20003D9 && o->pid <= 0x20003DC) {
break;
}
o = obj_find_next_at_tile();
}
if (o != NULL) {
if (kt == KILL_TYPE_GECKO) {
v27->field_10 += 100;
} else {
v27->field_10 += 400;
}
}
}
}
if (openPathNodeListLength == 0) {
break;
}
}
if (openPathNodeListLength != 0) {
unsigned char* v39 = rotations;
int index = 0;
for (; index < 800; index++) {
if (temp.tile == from) {
break;
}
if (v39 != NULL) {
*v39 = temp.rotation & 0xFF;
v39 += 1;
}
int j = 0;
while (dad[j].tile != temp.from) {
j++;
}
PathNode* v36 = &(dad[j]);
memcpy(&temp, v36, sizeof(temp));
}
if (rotations != NULL) {
// Looks like array resevering, probably because A* finishes it's path from end to start,
// this probably reverses it start-to-end.
unsigned char* beginning = rotations;
unsigned char* ending = rotations + index - 1;
int middle = index / 2;
for (int index = 0; index < middle; index++) {
unsigned char rotation = *ending;
*ending = *beginning;
*beginning = rotation;
ending -= 1;
beginning += 1;
}
}
return index;
}
return 0;
}
// 0x41633C
int idist(int x1, int y1, int x2, int y2)
{
int dx = x2 - x1;
if (dx < 0) {
dx = -dx;
}
int dy = y2 - y1;
if (dy < 0) {
dy = -dy;
}
int dm = (dx <= dy) ? dx : dy;
return dx + dy - (dm / 2);
}
// 0x416360
int EST(int tile1, int tile2)
{
int x1;
int y1;
tile_coord(tile1, &x1, &y1, map_elevation);
int x2;
int y2;
tile_coord(tile2, &x2, &y2, map_elevation);
return idist(x1, y1, x2, y2);
}
// 0x4163AC
int make_straight_path(Object* a1, int from, int to, StraightPathNode* pathNodes, Object** a5, int a6)
{
return make_straight_path_func(a1, from, to, pathNodes, a5, a6, obj_blocking_at);
}
// TODO: Rather complex, but understandable, needs testing.
//
// 0x4163C8
int make_straight_path_func(Object* a1, int from, int to, StraightPathNode* pathNodes, Object** a5, int a6, PathBuilderCallback* callback)
{
if (a5 != NULL) {
Object* v11 = callback(a1, from, a1->elevation);
if (v11 != NULL) {
if (v11 != *a5 && (a6 != 32 || (v11->flags & OBJECT_SHOOT_THRU) == 0)) {
*a5 = v11;
return 0;
}
}
}
int fromX;
int fromY;
tile_coord(from, &fromX, &fromY, a1->elevation);
fromX += 16;
fromY += 8;
int toX;
int toY;
tile_coord(to, &toX, &toY, a1->elevation);
toX += 16;
toY += 8;
int stepX;
int deltaX = toX - fromX;
if (deltaX > 0)
stepX = 1;
else if (deltaX < 0)
stepX = -1;
else
stepX = 0;
int stepY;
int deltaY = toY - fromY;
if (deltaY > 0)
stepY = 1;
else if (deltaY < 0)
stepY = -1;
else
stepY = 0;
int v48 = 2 * abs(toX - fromX);
int v47 = 2 * abs(toY - fromY);
int tileX = fromX;
int tileY = fromY;
int pathNodeIndex = 0;
int prevTile = from;
int v22 = 0;
int tile;
if (v48 <= v47) {
int middle = v48 - v47 / 2;
while (true) {
tile = tile_num(tileX, tileY, a1->elevation);
v22 += 1;
if (v22 == a6) {
if (pathNodeIndex >= 200) {
return 0;
}
if (pathNodes != NULL) {
StraightPathNode* pathNode = &(pathNodes[pathNodeIndex]);
pathNode->tile = tile;
pathNode->elevation = a1->elevation;
tile_coord(tile, &fromX, &fromY, a1->elevation);
pathNode->x = tileX - fromX - 16;
pathNode->y = tileY - fromY - 8;
}
v22 = 0;
pathNodeIndex++;
}
if (tileY == toY) {
if (a5 != NULL) {
*a5 = NULL;
}
break;
}
if (middle >= 0) {
tileX += stepX;
middle -= v47;
}
tileY += stepY;
middle += v48;
if (tile != prevTile) {
if (a5 != NULL) {
Object* obj = callback(a1, tile, a1->elevation);
if (obj != NULL) {
if (obj != *a5 && (a6 != 32 || (obj->flags & OBJECT_SHOOT_THRU) == 0)) {
*a5 = obj;
break;
}
}
}
prevTile = tile;
}
}
} else {
int middle = v47 - v48 / 2;
while (true) {
tile = tile_num(tileX, tileY, a1->elevation);
v22 += 1;
if (v22 == a6) {
if (pathNodeIndex >= 200) {
return 0;
}
if (pathNodes != NULL) {
StraightPathNode* pathNode = &(pathNodes[pathNodeIndex]);
pathNode->tile = tile;
pathNode->elevation = a1->elevation;
tile_coord(tile, &fromX, &fromY, a1->elevation);
pathNode->x = tileX - fromX - 16;
pathNode->y = tileY - fromY - 8;
}
v22 = 0;
pathNodeIndex++;
}
if (tileX == toX) {
if (a5 != NULL) {
*a5 = NULL;
}
break;
}
if (middle >= 0) {
tileY += stepY;
middle -= v48;
}
tileX += stepX;
middle += v47;
if (tile != prevTile) {
if (a5 != NULL) {
Object* obj = callback(a1, tile, a1->elevation);
if (obj != NULL) {
if (obj != *a5 && (a6 != 32 || (obj->flags & OBJECT_SHOOT_THRU) == 0)) {
*a5 = obj;
break;
}
}
}
prevTile = tile;
}
}
}
if (v22 != 0) {
if (pathNodeIndex >= 200) {
return 0;
}
if (pathNodes != NULL) {
StraightPathNode* pathNode = &(pathNodes[pathNodeIndex]);
pathNode->tile = tile;
pathNode->elevation = a1->elevation;
tile_coord(tile, &fromX, &fromY, a1->elevation);
pathNode->x = tileX - fromX - 16;
pathNode->y = tileY - fromY - 8;
}
pathNodeIndex += 1;
} else {
if (pathNodeIndex > 0 && pathNodes != NULL) {
pathNodes[pathNodeIndex - 1].elevation = a1->elevation;
}
}
return pathNodeIndex;
}
// 0x4167F8
static int anim_move_to_object(Object* from, Object* to, int a3, int anim, int animationSequenceIndex)
{
bool hidden = (to->flags & OBJECT_HIDDEN);
to->flags |= OBJECT_HIDDEN;
int moveSadIndex = anim_move(from, to->tile, to->elevation, -1, anim, 0, animationSequenceIndex);
if (!hidden) {
to->flags &= ~OBJECT_HIDDEN;
}
if (moveSadIndex == -1) {
return -1;
}
AnimationSad* sad_entry = &(sad[moveSadIndex]);
// NOTE: Original code is somewhat different. Due to some kind of
// optimization this value is either 1 or 2, which is later used in
// subsequent calculations and rotations array lookup.
bool isMultihex = (from->flags & OBJECT_MULTIHEX);
sad_entry->field_1C -= (isMultihex ? 2 : 1);
if (sad_entry->field_1C <= 0) {
sad_entry->field_20 = -1000;
anim_set_continue(animationSequenceIndex, 0);
}
sad_entry->field_24 = tile_num_in_direction(to->tile, sad_entry->rotations[isMultihex ? sad_entry->field_1C + 1 : sad_entry->field_1C], 1);
if (isMultihex) {
sad_entry->field_24 = tile_num_in_direction(sad_entry->field_24, sad_entry->rotations[sad_entry->field_1C], 1);
}
if (a3 != -1 && a3 < sad_entry->field_1C) {
sad_entry->field_1C = a3;
}
return 0;
}
// 0x41695C
static int make_stair_path(Object* object, int from, int fromElevation, int to, int toElevation, StraightPathNode* a6, Object** obstaclePtr)
{
int elevation = fromElevation;
if (elevation > toElevation) {
elevation = toElevation;
}
int fromX;
int fromY;
tile_coord(from, &fromX, &fromY, fromElevation);
fromX += 16;
fromY += 8;
int toX;
int toY;
tile_coord(to, &toX, &toY, toElevation);
toX += 16;
toY += 8;
if (obstaclePtr != NULL) {
*obstaclePtr = NULL;
}
int ddx = 2 * abs(toX - fromX);
int stepX;
int deltaX = toX - fromX;
if (deltaX > 0) {
stepX = 1;
} else if (deltaX < 0) {
stepX = -1;
} else {
stepX = 0;
}
int ddy = 2 * abs(toY - fromY);
int stepY;
int deltaY = toY - fromY;
if (deltaY > 0) {
stepY = 1;
} else if (deltaY < 0) {
stepY = -1;
} else {
stepY = 0;
}
int tileX = fromX;
int tileY = fromY;
int pathNodeIndex = 0;
int prevTile = from;
int iteration = 0;
int tile;
if (ddx > ddy) {
int middle = ddy - ddx / 2;
while (true) {
tile = tile_num(tileX, tileY, elevation);
iteration += 1;
if (iteration == 16) {
if (pathNodeIndex >= 200) {
return 0;
}
if (a6 != NULL) {
StraightPathNode* pathNode = &(a6[pathNodeIndex]);
pathNode->tile = tile;
pathNode->elevation = elevation;
tile_coord(tile, &fromX, &fromY, elevation);
pathNode->x = tileX - fromX - 16;
pathNode->y = tileY - fromY - 8;
}
iteration = 0;
pathNodeIndex++;
}
if (tileX == toX) {
break;
}
if (middle >= 0) {
tileY += stepY;
middle -= ddx;
}
tileX += stepX;
middle += ddy;
if (tile != prevTile) {
if (obstaclePtr != NULL) {
*obstaclePtr = obj_blocking_at(object, tile, object->elevation);
if (*obstaclePtr != NULL) {
break;
}
}
prevTile = tile;
}
}
} else {
int middle = ddx - ddy / 2;
while (true) {
tile = tile_num(tileX, tileY, elevation);
iteration += 1;
if (iteration == 16) {
if (pathNodeIndex >= 200) {
return 0;
}
if (a6 != NULL) {
StraightPathNode* pathNode = &(a6[pathNodeIndex]);
pathNode->tile = tile;
pathNode->elevation = elevation;
tile_coord(tile, &fromX, &fromY, elevation);
pathNode->x = tileX - fromX - 16;
pathNode->y = tileY - fromY - 8;
}
iteration = 0;
pathNodeIndex++;
}
if (tileY == toY) {
break;
}
if (middle >= 0) {
tileX += stepX;
middle -= ddy;
}
tileY += stepY;
middle += ddx;
if (tile != prevTile) {
if (obstaclePtr != NULL) {
*obstaclePtr = obj_blocking_at(object, tile, object->elevation);
if (*obstaclePtr != NULL) {
break;
}
}
prevTile = tile;
}
}
}
if (iteration != 0) {
if (pathNodeIndex >= 200) {
return 0;
}
if (a6 != NULL) {
StraightPathNode* pathNode = &(a6[pathNodeIndex]);
pathNode->tile = tile;
pathNode->elevation = elevation;
tile_coord(tile, &fromX, &fromY, elevation);
pathNode->x = tileX - fromX - 16;
pathNode->y = tileY - fromY - 8;
}
pathNodeIndex++;
} else {
if (pathNodeIndex > 0) {
if (a6 != NULL) {
a6[pathNodeIndex - 1].elevation = toElevation;
}
}
}
return pathNodeIndex;
}
// 0x416CFC
static int anim_move_to_tile(Object* obj, int tile, int elev, int a4, int anim, int animationSequenceIndex)
{
int v1;
v1 = anim_move(obj, tile, elev, -1, anim, 0, animationSequenceIndex);
if (v1 == -1) {
return -1;
}
if (obj_blocking_at(obj, tile, elev)) {
AnimationSad* sad_entry = &(sad[v1]);
sad_entry->field_1C--;
if (sad_entry->field_1C <= 0) {
sad_entry->field_20 = -1000;
anim_set_continue(animationSequenceIndex, 0);
}
sad_entry->field_24 = tile_num_in_direction(tile, sad_entry->rotations[sad_entry->field_1C], 1);
if (a4 != -1 && a4 < sad_entry->field_1C) {
sad_entry->field_1C = a4;
}
}
return 0;
}
// 0x416DFC
static int anim_move(Object* obj, int tile, int elev, int a3, int anim, int a5, int animationSequenceIndex)
{
if (curr_sad == ANIMATION_SAD_LIST_CAPACITY) {
return -1;
}
AnimationSad* sad_entry = &(sad[curr_sad]);
sad_entry->obj = obj;
if (a5) {
sad_entry->flags = ANIM_SAD_0x20;
} else {
sad_entry->flags = 0;
}
sad_entry->field_20 = -2000;
sad_entry->fid = art_id(FID_TYPE(obj->fid), obj->fid & 0xFFF, anim, (obj->fid & 0xF000) >> 12, obj->rotation + 1);
sad_entry->animationTimestamp = 0;
sad_entry->ticksPerFrame = compute_tpf(obj, sad_entry->fid);
sad_entry->field_24 = tile;
sad_entry->animationSequenceIndex = animationSequenceIndex;
sad_entry->anim = anim;
sad_entry->field_1C = make_path(obj, obj->tile, tile, sad_entry->rotations, a5);
if (sad_entry->field_1C == 0) {
sad_entry->field_20 = -1000;
return -1;
}
if (a3 != -1 && sad_entry->field_1C > a3) {
sad_entry->field_1C = a3;
}
return curr_sad++;
}
// 0x416F54
static int anim_move_straight_to_tile(Object* obj, int tile, int elevation, int anim, int animationSequenceIndex, int flags)
{
if (curr_sad == ANIMATION_SAD_LIST_CAPACITY) {
return -1;
}
AnimationSad* sad_entry = &(sad[curr_sad]);
sad_entry->obj = obj;
sad_entry->flags = flags | ANIM_SAD_STRAIGHT;
if (anim == -1) {
sad_entry->fid = obj->fid;
sad_entry->flags |= ANIM_SAD_NO_ANIM;
} else {
sad_entry->fid = art_id(FID_TYPE(obj->fid), obj->fid & 0xFFF, anim, (obj->fid & 0xF000) >> 12, obj->rotation + 1);
}
sad_entry->field_20 = -2000;
sad_entry->animationTimestamp = 0;
sad_entry->ticksPerFrame = compute_tpf(obj, sad_entry->fid);
sad_entry->animationSequenceIndex = animationSequenceIndex;
int v15;
if (FID_TYPE(obj->fid) == OBJ_TYPE_CRITTER) {
if (FID_ANIM_TYPE(obj->fid) == ANIM_JUMP_BEGIN)
v15 = 16;
else
v15 = 4;
} else {
v15 = 32;
}
sad_entry->field_1C = make_straight_path(obj, obj->tile, tile, sad_entry->field_28, NULL, v15);
if (sad_entry->field_1C == 0) {
sad_entry->field_20 = -1000;
return -1;
}
curr_sad++;
return 0;
}
// 0x41712C
int anim_move_on_stairs(Object* obj, int tile, int elevation, int anim, int animationSequenceIndex)
{
if (curr_sad == ANIMATION_SAD_LIST_CAPACITY) {
return -1;
}
AnimationSad* sad_entry = &(sad[curr_sad]);
sad_entry->flags = ANIM_SAD_STRAIGHT;
sad_entry->obj = obj;
if (anim == -1) {
sad_entry->fid = obj->fid;
sad_entry->flags |= ANIM_SAD_NO_ANIM;
} else {
sad_entry->fid = art_id(FID_TYPE(obj->fid), obj->fid & 0xFFF, anim, (obj->fid & 0xF000) >> 12, obj->rotation + 1);
}
sad_entry->field_20 = -2000;
sad_entry->animationTimestamp = 0;
sad_entry->ticksPerFrame = compute_tpf(obj, sad_entry->fid);
sad_entry->animationSequenceIndex = animationSequenceIndex;
sad_entry->field_1C = make_stair_path(obj, obj->tile, obj->elevation, tile, elevation, sad_entry->field_28, NULL);
if (sad_entry->field_1C == 0) {
sad_entry->field_20 = -1000;
return -1;
}
curr_sad++;
return 0;
}
// 0x417248
int check_for_falling(Object* obj, int anim, int a3)
{
if (curr_sad == ANIMATION_SAD_LIST_CAPACITY) {
return -1;
}
if (check_gravity(obj->tile, obj->elevation) == obj->elevation) {
return -1;
}
AnimationSad* sad_entry = &(sad[curr_sad]);
sad_entry->flags = ANIM_SAD_STRAIGHT;
sad_entry->obj = obj;
if (anim == -1) {
sad_entry->fid = obj->fid;
sad_entry->flags |= ANIM_SAD_NO_ANIM;
} else {
sad_entry->fid = art_id(FID_TYPE(obj->fid), obj->fid & 0xFFF, anim, (obj->fid & 0xF000) >> 12, obj->rotation + 1);
}
sad_entry->field_20 = -2000;
sad_entry->animationTimestamp = 0;
sad_entry->ticksPerFrame = compute_tpf(obj, sad_entry->fid);
sad_entry->animationSequenceIndex = a3;
sad_entry->field_1C = make_straight_path_func(obj, obj->tile, obj->tile, sad_entry->field_28, 0, 16, obj_blocking_at);
if (sad_entry->field_1C == 0) {
sad_entry->field_20 = -1000;
return -1;
}
curr_sad++;
return 0;
}
// 0x417360
static void object_move(int index)
{
AnimationSad* sad_entry = &(sad[index]);
Object* object = sad_entry->obj;
Rect dirty;
Rect temp;
if (sad_entry->field_20 == -2000) {
obj_move_to_tile(object, object->tile, object->elevation, &dirty);
obj_set_frame(object, 0, &temp);
rect_min_bound(&dirty, &temp, &dirty);
obj_set_rotation(object, sad_entry->rotations[0], &temp);
rect_min_bound(&dirty, &temp, &dirty);
int fid = art_id(FID_TYPE(object->fid), object->fid & 0xFFF, sad_entry->anim, (object->fid & 0xF000) >> 12, object->rotation + 1);
obj_change_fid(object, fid, &temp);
rect_min_bound(&dirty, &temp, &dirty);
sad_entry->field_20 = 0;
} else {
obj_inc_frame(object, &dirty);
}
int frameX;
int frameY;
CacheEntry* cacheHandle;
Art* art = art_ptr_lock(object->fid, &cacheHandle);
if (art != NULL) {
art_frame_hot(art, object->frame, object->rotation, &frameX, &frameY);
art_ptr_unlock(cacheHandle);
} else {
frameX = 0;
frameY = 0;
}
obj_offset(object, frameX, frameY, &temp);
rect_min_bound(&dirty, &temp, &dirty);
int rotation = sad_entry->rotations[sad_entry->field_20];
int y = off_tile[1][rotation];
int x = off_tile[0][rotation];
if ((x > 0 && x <= object->x) || (x < 0 && x >= object->x) || (y > 0 && y <= object->y) || (y < 0 && y >= object->y)) {
x = object->x - x;
y = object->y - y;
int v10 = tile_num_in_direction(object->tile, rotation, 1);
Object* v12 = obj_blocking_at(object, v10, object->elevation);
if (v12 != NULL) {
if (!anim_can_use_door(object, v12)) {
sad_entry->field_1C = make_path(object, object->tile, sad_entry->field_24, sad_entry->rotations, 1);
if (sad_entry->field_1C != 0) {
obj_move_to_tile(object, object->tile, object->elevation, &temp);
rect_min_bound(&dirty, &temp, &dirty);
obj_set_frame(object, 0, &temp);
rect_min_bound(&dirty, &temp, &dirty);
obj_set_rotation(object, sad_entry->rotations[0], &temp);
rect_min_bound(&dirty, &temp, &dirty);
sad_entry->field_20 = 0;
} else {
sad_entry->field_20 = -1000;
}
v10 = -1;
} else {
obj_use_door(object, v12, 0);
}
}
if (v10 != -1) {
obj_move_to_tile(object, v10, object->elevation, &temp);
rect_min_bound(&dirty, &temp, &dirty);
int v17 = 0;
if (isInCombat() && FID_TYPE(object->fid) == OBJ_TYPE_CRITTER) {
int v18 = critter_compute_ap_from_distance(object, 1);
if (combat_free_move < v18) {
int ap = object->data.critter.combat.ap;
int v20 = v18 - combat_free_move;
combat_free_move = 0;
if (v20 > ap) {
object->data.critter.combat.ap = 0;
} else {
object->data.critter.combat.ap = ap - v20;
}
} else {
combat_free_move -= v18;
}
if (object == obj_dude) {
intface_update_move_points(obj_dude->data.critter.combat.ap, combat_free_move);
}
v17 = (object->data.critter.combat.ap + combat_free_move) <= 0;
}
sad_entry->field_20 += 1;
if (sad_entry->field_20 == sad_entry->field_1C || v17) {
sad_entry->field_20 = -1000;
} else {
obj_set_rotation(object, sad_entry->rotations[sad_entry->field_20], &temp);
rect_min_bound(&dirty, &temp, &dirty);
obj_offset(object, x, y, &temp);
rect_min_bound(&dirty, &temp, &dirty);
}
}
}
tile_refresh_rect(&dirty, object->elevation);
if (sad_entry->field_20 == -1000) {
anim_set_continue(sad_entry->animationSequenceIndex, 1);
}
}
// 0x4177C0
static void object_straight_move(int index)
{
AnimationSad* sad_entry = &(sad[index]);
Object* object = sad_entry->obj;
Rect dirtyRect;
Rect temp;
if (sad_entry->field_20 == -2000) {
obj_change_fid(object, sad_entry->fid, &dirtyRect);
sad_entry->field_20 = 0;
} else {
obj_bound(object, &dirtyRect);
}
CacheEntry* cacheHandle;
Art* art = art_ptr_lock(object->fid, &cacheHandle);
if (art != NULL) {
int lastFrame = art_frame_max_frame(art) - 1;
art_ptr_unlock(cacheHandle);
if ((sad_entry->flags & ANIM_SAD_NO_ANIM) == 0) {
if ((sad_entry->flags & ANIM_SAD_WAIT_FOR_COMPLETION) == 0 || object->frame < lastFrame) {
obj_inc_frame(object, &temp);
rect_min_bound(&dirtyRect, &temp, &dirtyRect);
}
}
if (sad_entry->field_20 < sad_entry->field_1C) {
StraightPathNode* v12 = &(sad_entry->field_28[sad_entry->field_20]);
obj_move_to_tile(object, v12->tile, v12->elevation, &temp);
rect_min_bound(&dirtyRect, &temp, &dirtyRect);
obj_offset(object, v12->x, v12->y, &temp);
rect_min_bound(&dirtyRect, &temp, &dirtyRect);
sad_entry->field_20++;
}
if (sad_entry->field_20 == sad_entry->field_1C) {
if ((sad_entry->flags & ANIM_SAD_WAIT_FOR_COMPLETION) == 0 || object->frame == lastFrame) {
sad_entry->field_20 = -1000;
}
}
tile_refresh_rect(&dirtyRect, sad_entry->obj->elevation);
if (sad_entry->field_20 == -1000) {
anim_set_continue(sad_entry->animationSequenceIndex, 1);
}
}
}
// 0x4179B8
static int anim_animate(Object* obj, int anim, int animationSequenceIndex, int flags)
{
if (curr_sad == ANIMATION_SAD_LIST_CAPACITY) {
return -1;
}
AnimationSad* sad_entry = &(sad[curr_sad]);
int fid;
if (anim == ANIM_TAKE_OUT) {
sad_entry->flags = 0;
fid = art_id(FID_TYPE(obj->fid), obj->fid & 0xFFF, ANIM_TAKE_OUT, flags, obj->rotation + 1);
} else {
sad_entry->flags = flags;
fid = art_id(FID_TYPE(obj->fid), obj->fid & 0xFFF, anim, (obj->fid & 0xF000) >> 12, obj->rotation + 1);
}
if (!art_exists(fid)) {
return -1;
}
sad_entry->obj = obj;
sad_entry->fid = fid;
sad_entry->animationSequenceIndex = animationSequenceIndex;
sad_entry->animationTimestamp = 0;
sad_entry->ticksPerFrame = compute_tpf(obj, sad_entry->fid);
sad_entry->field_20 = 0;
sad_entry->field_1C = 0;
curr_sad++;
return 0;
}
// 0x417B30
void object_animate()
{
if (curr_sad == 0) {
return;
}
anim_in_bk = 1;
for (int index = 0; index < curr_sad; index++) {
AnimationSad* sad_entry = &(sad[index]);
if (sad_entry->field_20 == -1000) {
continue;
}
Object* object = sad_entry->obj;
unsigned int time = get_time();
if (elapsed_tocks(time, sad_entry->animationTimestamp) < sad_entry->ticksPerFrame) {
continue;
}
sad_entry->animationTimestamp = time;
if (anim_set_check(sad_entry->animationSequenceIndex) == -1) {
continue;
}
if (sad_entry->field_1C > 0) {
if ((sad_entry->flags & ANIM_SAD_STRAIGHT) != 0) {
object_straight_move(index);
} else {
int savedTile = object->tile;
object_move(index);
if (savedTile != object->tile) {
scr_chk_spatials_in(object, object->tile, object->elevation);
}
}
continue;
}
if (sad_entry->field_20 == 0) {
for (int index = 0; index < curr_sad; index++) {
AnimationSad* otherSad = &(sad[index]);
if (object == otherSad->obj && otherSad->field_20 == -2000) {
otherSad->field_20 = -1000;
anim_set_continue(otherSad->animationSequenceIndex, 1);
}
}
sad_entry->field_20 = -2000;
}
Rect dirtyRect;
Rect tempRect;
obj_bound(object, &dirtyRect);
if (object->fid == sad_entry->fid) {
if ((sad_entry->flags & ANIM_SAD_REVERSE) == 0) {
CacheEntry* cacheHandle;
Art* art = art_ptr_lock(object->fid, &cacheHandle);
if (art != NULL) {
if ((sad_entry->flags & ANIM_SAD_FOREVER) == 0 && object->frame == art_frame_max_frame(art) - 1) {
sad_entry->field_20 = -1000;
art_ptr_unlock(cacheHandle);
if ((sad_entry->flags & ANIM_SAD_HIDE_ON_END) != 0) {
// NOTE: Uninline.
anim_hide(object, -1);
}
anim_set_continue(sad_entry->animationSequenceIndex, 1);
continue;
} else {
obj_inc_frame(object, &tempRect);
rect_min_bound(&dirtyRect, &tempRect, &dirtyRect);
int frameX;
int frameY;
art_frame_hot(art, object->frame, object->rotation, &frameX, &frameY);
obj_offset(object, frameX, frameY, &tempRect);
rect_min_bound(&dirtyRect, &tempRect, &dirtyRect);
art_ptr_unlock(cacheHandle);
}
}
tile_refresh_rect(&dirtyRect, map_elevation);
continue;
}
if ((sad_entry->flags & ANIM_SAD_FOREVER) != 0 || object->frame != 0) {
int x;
int y;
CacheEntry* cacheHandle;
Art* art = art_ptr_lock(object->fid, &cacheHandle);
if (art != NULL) {
art_frame_hot(art, object->frame, object->rotation, &x, &y);
art_ptr_unlock(cacheHandle);
}
obj_dec_frame(object, &tempRect);
rect_min_bound(&dirtyRect, &tempRect, &dirtyRect);
obj_offset(object, -x, -y, &tempRect);
rect_min_bound(&dirtyRect, &tempRect, &dirtyRect);
tile_refresh_rect(&dirtyRect, map_elevation);
continue;
}
sad_entry->field_20 = -1000;
anim_set_continue(sad_entry->animationSequenceIndex, 1);
} else {
int x;
int y;
CacheEntry* cacheHandle;
Art* art = art_ptr_lock(object->fid, &cacheHandle);
if (art != NULL) {
art_frame_offset(art, object->rotation, &x, &y);
art_ptr_unlock(cacheHandle);
} else {
x = 0;
y = 0;
}
Rect v29;
obj_change_fid(object, sad_entry->fid, &v29);
rect_min_bound(&dirtyRect, &v29, &dirtyRect);
art = art_ptr_lock(object->fid, &cacheHandle);
if (art != NULL) {
int frame;
if ((sad_entry->flags & ANIM_SAD_REVERSE) != 0) {
frame = art_frame_max_frame(art) - 1;
} else {
frame = 0;
}
obj_set_frame(object, frame, &v29);
rect_min_bound(&dirtyRect, &v29, &dirtyRect);
int frameX;
int frameY;
art_frame_hot(art, object->frame, object->rotation, &frameX, &frameY);
Rect v19;
obj_offset(object, x + frameX, y + frameY, &v19);
rect_min_bound(&dirtyRect, &v19, &dirtyRect);
art_ptr_unlock(cacheHandle);
} else {
obj_set_frame(object, 0, &v29);
rect_min_bound(&dirtyRect, &v29, &dirtyRect);
}
tile_refresh_rect(&dirtyRect, map_elevation);
}
}
anim_in_bk = 0;
object_anim_compact();
}
// 0x417F18
static void object_anim_compact()
{
for (int index = 0; index < ANIMATION_SEQUENCE_LIST_CAPACITY; index++) {
AnimationSequence* animationSequence = &(anim_set[index]);
if ((animationSequence->flags & ANIM_SEQ_0x20) != 0) {
animationSequence->flags = 0;
}
}
int index = 0;
for (; index < curr_sad; index++) {
if (sad[index].field_20 == -1000) {
int v2 = index + 1;
for (; v2 < curr_sad; v2++) {
if (sad[v2].field_20 != -1000) {
break;
}
}
if (v2 == curr_sad) {
break;
}
if (index != v2) {
memcpy(&(sad[index]), &(sad[v2]), sizeof(AnimationSad));
sad[v2].field_20 = -1000;
sad[v2].flags = 0;
}
}
}
curr_sad = index;
}
// 0x417FFC
int check_move(int* a1)
{
int x;
int y;
mouse_get_position(&x, &y);
int tile = tile_num(x, y, map_elevation);
if (tile == -1) {
return -1;
}
if (isInCombat()) {
if (*a1 != -1) {
if (keys[DIK_LCONTROL] || keys[DIK_RCONTROL]) {
int hitMode;
bool aiming;
intface_get_attack(&hitMode, &aiming);
int v6 = item_mp_cost(obj_dude, hitMode, aiming);
*a1 = *a1 - v6;
if (*a1 <= 0) {
return -1;
}
}
}
} else {
bool interruptWalk;
configGetBool(&game_config, GAME_CONFIG_SYSTEM_KEY, GAME_CONFIG_INTERRUPT_WALK_KEY, &interruptWalk);
if (interruptWalk) {
register_clear(obj_dude);
}
}
return tile;
}
// 0x4180B4
int dude_move(int a1)
{
// 0x51072C
static int lastDest = -2;
int v1;
int tile = check_move(&v1);
if (tile == -1) {
return -1;
}
if (lastDest == tile) {
return dude_run(a1);
}
lastDest = tile;
register_begin(ANIMATION_REQUEST_RESERVED);
register_object_move_to_tile(obj_dude, tile, obj_dude->elevation, a1, 0);
return register_end();
}
// 0x41810C
int dude_run(int a1)
{
int a4;
int tile_num;
a4 = a1;
tile_num = check_move(&a4);
if (tile_num == -1) {
return -1;
}
if (!perk_level(obj_dude, PERK_SILENT_RUNNING)) {
pc_flag_off(DUDE_STATE_SNEAKING);
}
register_begin(ANIMATION_REQUEST_RESERVED);
register_object_run_to_tile(obj_dude, tile_num, obj_dude->elevation, a4, 0);
return register_end();
}
// 0x418168
void dude_fidget()
{
// 0x510730
static unsigned int last_time = 0;
// 0x510734
static unsigned int next_time = 0;
// 0x56C7E0
static Object* fidget_ptr[100];
if (game_user_wants_to_quit != 0) {
return;
}
if (isInCombat()) {
return;
}
if (vcr_status() != VCR_STATE_TURNED_OFF) {
return;
}
if ((obj_dude->flags & OBJECT_HIDDEN) != 0) {
return;
}
unsigned int v0 = get_bk_time();
if (elapsed_tocks(v0, last_time) <= next_time) {
return;
}
last_time = v0;
int v5 = 0;
Object* object = obj_find_first_at(obj_dude->elevation);
while (object != NULL) {
if (v5 >= 100) {
break;
}
if ((object->flags & OBJECT_HIDDEN) == 0 && FID_TYPE(object->fid) == OBJ_TYPE_CRITTER && FID_ANIM_TYPE(object->fid) == ANIM_STAND && !critter_is_dead(object)) {
Rect rect;
obj_bound(object, &rect);
Rect intersection;
if (rect_inside_bound(&rect, &scr_size, &intersection) == 0 && (map_data.field_34 != 97 || object->pid != 0x10000FA)) {
fidget_ptr[v5++] = object;
}
}
object = obj_find_next_at();
}
int v13;
if (v5 != 0) {
int r = roll_random(0, v5 - 1);
Object* object = fidget_ptr[r];
register_begin(ANIMATION_REQUEST_UNRESERVED | ANIMATION_REQUEST_INSIGNIFICANT);
bool v8 = false;
if (object == o
gitextract_y86dh7pr/
├── .clang-format
├── .editorconfig
├── .gitattributes
├── .github/
│ └── workflows/
│ └── ci-build.yml
├── .gitignore
├── CMakeLists.txt
├── CMakeSettings.json
├── LICENSE.md
├── README.md
├── src/
│ ├── game/
│ │ ├── ability.c
│ │ ├── ability.h
│ │ ├── actions.c
│ │ ├── actions.h
│ │ ├── amutex.c
│ │ ├── amutex.h
│ │ ├── anim.c
│ │ ├── anim.h
│ │ ├── art.c
│ │ ├── art.h
│ │ ├── artload.c
│ │ ├── artload.h
│ │ ├── automap.c
│ │ ├── automap.h
│ │ ├── bmpdlog.c
│ │ ├── bmpdlog.h
│ │ ├── cache.c
│ │ ├── cache.h
│ │ ├── cd.c
│ │ ├── cd.h
│ │ ├── combat.c
│ │ ├── combat.h
│ │ ├── combat_defs.h
│ │ ├── combatai.c
│ │ ├── combatai.h
│ │ ├── combatai_defs.h
│ │ ├── config.c
│ │ ├── config.h
│ │ ├── counter.c
│ │ ├── counter.h
│ │ ├── credits.c
│ │ ├── credits.h
│ │ ├── critter.c
│ │ ├── critter.h
│ │ ├── cycle.c
│ │ ├── cycle.h
│ │ ├── diskspce.c
│ │ ├── diskspce.h
│ │ ├── display.c
│ │ ├── display.h
│ │ ├── editor.c
│ │ ├── editor.h
│ │ ├── elevator.c
│ │ ├── elevator.h
│ │ ├── endgame.c
│ │ ├── endgame.h
│ │ ├── ereg.c
│ │ ├── ereg.h
│ │ ├── fontmgr.c
│ │ ├── fontmgr.h
│ │ ├── game.c
│ │ ├── game.h
│ │ ├── game_vars.h
│ │ ├── gconfig.c
│ │ ├── gconfig.h
│ │ ├── gdebug.c
│ │ ├── gdebug.h
│ │ ├── gdialog.c
│ │ ├── gdialog.h
│ │ ├── gmemory.c
│ │ ├── gmemory.h
│ │ ├── gmouse.c
│ │ ├── gmouse.h
│ │ ├── gmovie.c
│ │ ├── gmovie.h
│ │ ├── graphlib.c
│ │ ├── graphlib.h
│ │ ├── gsound.c
│ │ ├── gsound.h
│ │ ├── gz.c
│ │ ├── gz.h
│ │ ├── heap.c
│ │ ├── heap.h
│ │ ├── intface.c
│ │ ├── intface.h
│ │ ├── inventry.c
│ │ ├── inventry.h
│ │ ├── item.c
│ │ ├── item.h
│ │ ├── light.c
│ │ ├── light.h
│ │ ├── lip_sync.c
│ │ ├── lip_sync.h
│ │ ├── loadsave.c
│ │ ├── loadsave.h
│ │ ├── main.c
│ │ ├── main.h
│ │ ├── mainmenu.c
│ │ ├── mainmenu.h
│ │ ├── map.c
│ │ ├── map.h
│ │ ├── map_defs.h
│ │ ├── message.c
│ │ ├── message.h
│ │ ├── moviefx.c
│ │ ├── moviefx.h
│ │ ├── object.c
│ │ ├── object.h
│ │ ├── object_types.h
│ │ ├── options.c
│ │ ├── options.h
│ │ ├── palette.c
│ │ ├── palette.h
│ │ ├── party.c
│ │ ├── party.h
│ │ ├── perk.c
│ │ ├── perk.h
│ │ ├── perk_defs.h
│ │ ├── pipboy.c
│ │ ├── pipboy.h
│ │ ├── protinst.c
│ │ ├── protinst.h
│ │ ├── proto.c
│ │ ├── proto.h
│ │ ├── proto_types.h
│ │ ├── queue.c
│ │ ├── queue.h
│ │ ├── reaction.c
│ │ ├── reaction.h
│ │ ├── roll.c
│ │ ├── roll.h
│ │ ├── scripts.c
│ │ ├── scripts.h
│ │ ├── select.c
│ │ ├── select.h
│ │ ├── selfrun.c
│ │ ├── selfrun.h
│ │ ├── sfxcache.c
│ │ ├── sfxcache.h
│ │ ├── sfxlist.c
│ │ ├── sfxlist.h
│ │ ├── skill.c
│ │ ├── skill.h
│ │ ├── skill_defs.h
│ │ ├── skilldex.c
│ │ ├── skilldex.h
│ │ ├── stat.c
│ │ ├── stat.h
│ │ ├── stat_defs.h
│ │ ├── strparse.c
│ │ ├── strparse.h
│ │ ├── textobj.c
│ │ ├── textobj.h
│ │ ├── tile.c
│ │ ├── tile.h
│ │ ├── trait.c
│ │ ├── trait.h
│ │ ├── trait_defs.h
│ │ ├── trap.c
│ │ ├── trap.h
│ │ ├── version.c
│ │ ├── version.h
│ │ ├── wordwrap.c
│ │ ├── wordwrap.h
│ │ ├── worldmap.c
│ │ └── worldmap.h
│ ├── int/
│ │ ├── audio.c
│ │ ├── audio.h
│ │ ├── audiof.c
│ │ ├── audiof.h
│ │ ├── datafile.c
│ │ ├── datafile.h
│ │ ├── dialog.c
│ │ ├── dialog.h
│ │ ├── export.c
│ │ ├── export.h
│ │ ├── intlib.c
│ │ ├── intlib.h
│ │ ├── intrpret.c
│ │ ├── intrpret.h
│ │ ├── memdbg.c
│ │ ├── memdbg.h
│ │ ├── mousemgr.c
│ │ ├── mousemgr.h
│ │ ├── movie.c
│ │ ├── movie.h
│ │ ├── nevs.c
│ │ ├── nevs.h
│ │ ├── pcx.c
│ │ ├── pcx.h
│ │ ├── region.c
│ │ ├── region.h
│ │ ├── share1.c
│ │ ├── share1.h
│ │ ├── sound.c
│ │ ├── sound.h
│ │ ├── support/
│ │ │ ├── intextra.c
│ │ │ └── intextra.h
│ │ ├── widget.c
│ │ ├── widget.h
│ │ ├── window.c
│ │ └── window.h
│ ├── memory_defs.h
│ ├── mmx.c
│ ├── mmx.h
│ ├── movie_lib.c
│ ├── movie_lib.h
│ ├── plib/
│ │ ├── assoc/
│ │ │ ├── assoc.c
│ │ │ └── assoc.h
│ │ ├── color/
│ │ │ ├── color.c
│ │ │ └── color.h
│ │ ├── db/
│ │ │ ├── db.c
│ │ │ └── db.h
│ │ ├── gnw/
│ │ │ ├── button.c
│ │ │ ├── button.h
│ │ │ ├── debug.c
│ │ │ ├── debug.h
│ │ │ ├── doscmdln.c
│ │ │ ├── doscmdln.h
│ │ │ ├── dxinput.c
│ │ │ ├── dxinput.h
│ │ │ ├── gnw.c
│ │ │ ├── gnw.h
│ │ │ ├── gnw95dx.c
│ │ │ ├── gnw95dx.h
│ │ │ ├── gnw_types.h
│ │ │ ├── grbuf.c
│ │ │ ├── grbuf.h
│ │ │ ├── input.c
│ │ │ ├── input.h
│ │ │ ├── intrface.c
│ │ │ ├── intrface.h
│ │ │ ├── kb.c
│ │ │ ├── kb.h
│ │ │ ├── memory.c
│ │ │ ├── memory.h
│ │ │ ├── mouse.c
│ │ │ ├── mouse.h
│ │ │ ├── rect.c
│ │ │ ├── rect.h
│ │ │ ├── svga.c
│ │ │ ├── svga.h
│ │ │ ├── svga_types.h
│ │ │ ├── text.c
│ │ │ ├── text.h
│ │ │ ├── vcr.c
│ │ │ ├── vcr.h
│ │ │ ├── winmain.c
│ │ │ └── winmain.h
│ │ └── xfile/
│ │ ├── dfile.c
│ │ ├── dfile.h
│ │ ├── xfile.c
│ │ ├── xfile.h
│ │ ├── xsys_find.c
│ │ └── xsys_find.h
│ ├── sound_decoder.c
│ └── sound_decoder.h
└── third_party/
├── fpattern/
│ ├── CMakeLists.txt
│ ├── LICENSE
│ └── README.md
└── zlib/
├── CMakeLists.txt
├── LICENSE
└── README.md
Showing preview only (331K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3893 symbols across 193 files)
FILE: src/game/ability.c
function abil_init (line 8) | int abil_init(Ability* ability, int initialCapacity)
function abil_resize (line 27) | int abil_resize(Ability* ability, int capacity)
function abil_free (line 44) | int abil_free(Ability* ability)
function abil_find (line 53) | int abil_find(Ability* ability, int a2, int* indexPtr)
function abil_search (line 102) | int abil_search(Ability* ability, int a2)
function abil_insert (line 114) | int abil_insert(Ability* ability, AbilityData* entry)
function abil_delete (line 141) | int abil_delete(Ability* ability, int a2)
function abil_copy (line 161) | int abil_copy(Ability* dest, Ability* src)
function abil_load (line 179) | int abil_load(File* stream, Ability* ability)
function abil_read_ability_data (line 188) | int abil_read_ability_data(Ability* ability, File* stream)
function abil_save (line 209) | int abil_save(File* stream, Ability* ability)
function abil_write_ability_data (line 221) | int abil_write_ability_data(int length, AbilityData* entries, File* stream)
FILE: src/game/ability.h
type AbilityData (line 6) | typedef struct AbilityData {
type Ability (line 12) | typedef struct Ability {
FILE: src/game/actions.c
function switch_dude (line 94) | void switch_dude()
function action_knockback (line 112) | int action_knockback(Object* obj, int* anim, int maxDistance, int rotati...
function action_blood (line 153) | int action_blood(Object* obj, int anim, int delay)
function pick_death (line 182) | static int pick_death(Object* attacker, Object* defender, Object* weapon...
function check_death (line 260) | static int check_death(Object* obj, int anim, int minViolenceLevel, bool...
function internal_destroy (line 286) | static int internal_destroy(Object* a1, Object* a2)
function show_damage_to_object (line 294) | void show_damage_to_object(Object* a1, int damage, int flags, Object* we...
function show_death (line 434) | static int show_death(Object* obj, int anim)
function show_damage_target (line 475) | int show_damage_target(Attack* attack)
function show_damage_extras (line 502) | int show_damage_extras(Attack* attack)
function show_damage (line 530) | void show_damage(Attack* attack, int a2, int a3)
function action_attack (line 584) | int action_attack(Attack* attack)
function action_melee (line 609) | static int action_melee(Attack* attack, int anim)
function throw_change_fid (line 714) | int throw_change_fid(Object* object, int fid)
function action_ranged (line 726) | static int action_ranged(Attack* attack, int anim)
function is_next_to (line 983) | static int is_next_to(Object* a1, Object* a2)
function action_climb_ladder (line 1001) | static int action_climb_ladder(Object* a1, Object* a2)
function a_use_obj (line 1058) | int a_use_obj(Object* a1, Object* a2, Object* a3)
function action_use_an_item_on_object (line 1146) | int action_use_an_item_on_object(Object* a1, Object* a2, Object* a3)
function action_use_an_object (line 1152) | int action_use_an_object(Object* a1, Object* a2)
function get_an_object (line 1160) | int get_an_object(Object* item)
function action_get_an_object (line 1166) | int action_get_an_object(Object* critter, Object* item)
function action_loot_container (line 1266) | int action_loot_container(Object* critter, Object* container)
function action_skill_use (line 1299) | int action_skill_use(int skill)
function action_use_skill_in_combat_error (line 1313) | int action_use_skill_in_combat_error(Object* critter)
function action_use_skill_on (line 1329) | int action_use_skill_on(Object* a1, Object* a2, int skill)
function Object (line 1505) | Object* pick_object(int objectType, bool a2)
function pick_hex (line 1549) | int pick_hex()
function is_hit_from_front (line 1621) | bool is_hit_from_front(Object* a1, Object* a2)
function can_see (line 1632) | bool can_see(Object* a1, Object* a2)
function pick_fall (line 1646) | int pick_fall(Object* obj, int anim)
function action_explode_running (line 1684) | bool action_explode_running()
function action_explode (line 1691) | int action_explode(int tile, int elevation, int minDamage, int maxDamage...
function report_explosion (line 1836) | static int report_explosion(Attack* attack, Object* a2)
function finished_explosion (line 1912) | static int finished_explosion(Object* a1, Object* a2)
function compute_explosion_damage (line 1920) | static int compute_explosion_damage(int min, int max, Object* a3, int* a4)
function action_talk_to (line 1942) | int action_talk_to(Object* a1, Object* a2)
function can_talk_to (line 1974) | static int can_talk_to(Object* a1, Object* a2)
function talk_to (line 1993) | static int talk_to(Object* a1, Object* a2)
function action_dmg (line 2000) | void action_dmg(int tile, int elevation, int minDamage, int maxDamage, i...
function report_dmg (line 2069) | static int report_dmg(Attack* attack, Object* a2)
function compute_dmg_damage (line 2081) | static int compute_dmg_damage(int min, int max, Object* obj, int* a4, in...
function action_can_be_pushed (line 2107) | bool action_can_be_pushed(Object* a1, Object* a2)
function action_push_critter (line 2151) | int action_push_critter(Object* a1, Object* a2)
function action_can_talk_to (line 2227) | int action_can_talk_to(Object* a1, Object* a2)
FILE: src/game/amutex.c
function autorun_mutex_create (line 10) | bool autorun_mutex_create()
function autorun_mutex_destroy (line 22) | void autorun_mutex_destroy()
FILE: src/game/anim.c
type AnimationKind (line 42) | typedef enum AnimationKind {
type AnimationSequenceFlags (line 71) | typedef enum AnimationSequenceFlags {
type AnimationSadFlags (line 104) | typedef enum AnimationSadFlags {
type AnimationDescription (line 135) | typedef struct AnimationDescription {
type AnimationSequence (line 206) | typedef struct AnimationSequence {
type PathNode (line 217) | typedef struct PathNode {
type AnimationSad (line 228) | typedef struct AnimationSad {
function anim_init (line 307) | void anim_init()
function anim_reset (line 315) | void anim_reset()
function anim_exit (line 332) | void anim_exit()
function register_begin (line 339) | int register_begin(int requestOptions)
function anim_free_slot (line 377) | static int anim_free_slot(int requestOptions)
function register_priority (line 406) | int register_priority(int a1)
function register_clear (line 422) | int register_clear(Object* a1)
function register_end (line 457) | int register_end()
function anim_preload (line 487) | static int anim_preload(Object* object, int fid, CacheEntry** cacheEntry...
function anim_cleanup (line 501) | static void anim_cleanup()
function check_registry (line 527) | int check_registry(Object* obj)
function anim_busy (line 564) | int anim_busy(Object* a1)
function register_object_move_to_object (line 596) | int register_object_move_to_object(Object* owner, Object* destination, i...
function register_object_run_to_object (line 629) | int register_object_run_to_object(Object* owner, Object* destination, in...
function register_object_move_to_tile (line 688) | int register_object_move_to_tile(Object* owner, int tile, int elevation,...
function register_object_run_to_tile (line 722) | int register_object_run_to_tile(Object* owner, int tile, int elevation, ...
function register_object_move_straight_to_tile (line 785) | int register_object_move_straight_to_tile(Object* object, int tile, int ...
function register_object_animate_and_move_straight (line 820) | int register_object_animate_and_move_straight(Object* owner, int tile, i...
function register_object_move_on_stairs (line 856) | int register_object_move_on_stairs(Object* owner, Object* stairs, int de...
function register_object_check_falling (line 909) | int register_object_check_falling(Object* owner, int delay)
function register_object_animate (line 941) | int register_object_animate(Object* owner, int anim, int delay)
function register_object_animate_reverse (line 969) | int register_object_animate_reverse(Object* owner, int anim, int delay)
function register_object_animate_and_hide (line 998) | int register_object_animate_and_hide(Object* owner, int anim, int delay)
function register_object_turn_towards (line 1027) | int register_object_turn_towards(Object* owner, int tile)
function register_object_inc_rotation (line 1048) | int register_object_inc_rotation(Object* owner)
function register_object_dec_rotation (line 1068) | int register_object_dec_rotation(Object* owner)
function register_object_erase (line 1090) | int register_object_erase(Object* object)
function register_object_must_erase (line 1110) | int register_object_must_erase(Object* object)
function register_object_call (line 1130) | int register_object_call(void* a1, void* a2, AnimationCallback* proc, in...
function register_object_call3 (line 1155) | int register_object_call3(void* a1, void* a2, void* a3, AnimationCallbac...
function register_object_must_call (line 1179) | int register_object_must_call(void* a1, void* a2, AnimationCallback* pro...
function register_object_fset (line 1208) | int register_object_fset(Object* object, int flag, int delay)
function register_object_funset (line 1233) | int register_object_funset(Object* object, int flag, int delay)
function register_object_change_fid (line 1254) | int register_object_change_fid(Object* owner, int fid, int delay)
function register_object_take_out (line 1280) | int register_object_take_out(Object* owner, int weaponAnimationCode, int...
function register_object_light (line 1314) | int register_object_light(Object* owner, int lightDistance, int delay)
function register_object_outline (line 1337) | int register_object_outline(Object* object, bool outline, int delay)
function register_object_play_sfx (line 1358) | int register_object_play_sfx(Object* owner, const char* soundEffectName,...
function register_object_animate_forever (line 1390) | int register_object_animate_forever(Object* owner, int anim, int delay)
function register_ping (line 1418) | int register_ping(int a1, int delay)
function anim_set_check (line 1446) | static int anim_set_check(int animationSequenceIndex)
function anim_set_continue (line 1628) | static int anim_set_continue(int animationSequenceIndex, int a2)
function anim_set_end (line 1652) | static int anim_set_end(int animationSequenceIndex)
function anim_can_use_door (line 1755) | static bool anim_can_use_door(Object* critter, Object* door)
function make_path (line 1797) | int make_path(Object* object, int from, int to, unsigned char* rotations...
function make_path_func (line 1803) | int make_path_func(Object* object, int from, int to, unsigned char* rota...
function idist (line 1998) | int idist(int x1, int y1, int x2, int y2)
function EST (line 2016) | int EST(int tile1, int tile2)
function make_straight_path (line 2030) | int make_straight_path(Object* a1, int from, int to, StraightPathNode* p...
function make_straight_path_func (line 2038) | int make_straight_path_func(Object* a1, int from, int to, StraightPathNo...
function anim_move_to_object (line 2225) | static int anim_move_to_object(Object* from, Object* to, int a3, int ani...
function make_stair_path (line 2265) | static int make_stair_path(Object* object, int from, int fromElevation, ...
function anim_move_to_tile (line 2444) | static int anim_move_to_tile(Object* obj, int tile, int elev, int a4, in...
function anim_move (line 2471) | static int anim_move(Object* obj, int tile, int elev, int a3, int anim, ...
function anim_move_straight_to_tile (line 2508) | static int anim_move_straight_to_tile(Object* obj, int tile, int elevati...
function anim_move_on_stairs (line 2550) | int anim_move_on_stairs(Object* obj, int tile, int elevation, int anim, ...
function check_for_falling (line 2581) | int check_for_falling(Object* obj, int anim, int a3)
function object_move (line 2616) | static void object_move(int index)
function object_straight_move (line 2738) | static void object_straight_move(int index)
function anim_animate (line 2793) | static int anim_animate(Object* obj, int anim, int animationSequenceInde...
function object_animate (line 2828) | void object_animate()
function object_anim_compact (line 2997) | static void object_anim_compact()
function check_move (line 3031) | int check_move(int* a1)
function dude_move (line 3068) | int dude_move(int a1)
function dude_run (line 3093) | int dude_run(int a1)
function dude_fidget (line 3116) | void dude_fidget()
function dude_stand (line 3214) | void dude_stand(Object* obj, int rotation, int fid)
function dude_standup (line 3283) | void dude_standup(Object* a1)
function anim_turn_towards (line 3300) | static int anim_turn_towards(Object* obj, int delta, int animationSequen...
function anim_hide (line 3321) | int anim_hide(Object* object, int animationSequenceIndex)
function anim_change_fid (line 3337) | int anim_change_fid(Object* obj, int animationSequenceIndex, int fid)
function anim_stop (line 3357) | void anim_stop()
function check_gravity (line 3371) | static int check_gravity(int tile, int elevation)
function compute_tpf (line 3388) | unsigned int compute_tpf(Object* object, int fid)
FILE: src/game/anim.h
type AnimationRequestOptions (line 8) | typedef enum AnimationRequestOptions {
type AnimationType (line 21) | typedef enum AnimationType {
type Object (line 102) | typedef Object* PathBuilderCallback(Object* object, int tile, int elevat...
type StraightPathNode (line 104) | typedef struct StraightPathNode {
FILE: src/game/art.c
function art_init (line 94) | int art_init()
function art_reset (line 282) | void art_reset()
function art_exit (line 287) | void art_exit()
function art_get_disable (line 312) | int art_get_disable(int objectType)
function art_toggle_disable (line 320) | void art_toggle_disable(int objectType)
function art_total (line 330) | int art_total(int objectType)
function art_head_fidgets (line 336) | int art_head_fidgets(int headFid)
function scale_art (line 363) | void scale_art(int fid, unsigned char* dest, int width, int height, int ...
function Art (line 417) | Art* art_ptr_lock(int fid, CacheEntry** handlePtr)
function art_ptr_unlock (line 479) | int art_ptr_unlock(CacheEntry* handle)
function art_flush (line 485) | int art_flush()
function art_discard (line 493) | int art_discard(int fid)
function art_get_base_name (line 503) | int art_get_base_name(int objectType, int id, char* dest)
function art_get_code (line 523) | int art_get_code(int animation, int weaponType, char* a3, char* a4)
function art_read_lst (line 650) | int art_read_lst(const char* path, char** artListPtr, int* artListSizePtr)
function art_frame_fps (line 692) | int art_frame_fps(Art* art)
function art_frame_action_frame (line 702) | int art_frame_action_frame(Art* art)
function art_frame_max_frame (line 708) | int art_frame_max_frame(Art* art)
function art_frame_width (line 714) | int art_frame_width(Art* art, int frame, int direction)
function art_frame_length (line 727) | int art_frame_length(Art* art, int frame, int direction)
function art_frame_width_length (line 740) | int art_frame_width_length(Art* art, int frame, int direction, int* widt...
function art_frame_hot (line 769) | int art_frame_hot(Art* art, int frame, int direction, int* xPtr, int* yPtr)
function art_frame_offset (line 785) | int art_frame_offset(Art* art, int rotation, int* xPtr, int* yPtr)
function ArtFrame (line 811) | ArtFrame* frame_ptr(Art* art, int frame, int rotation)
function art_exists (line 833) | bool art_exists(int fid)
function art_fid_valid (line 861) | bool art_fid_valid(int fid)
function art_alias_num (line 887) | int art_alias_num(int index)
function artCritterFidShouldRun (line 893) | int artCritterFidShouldRun(int fid)
function art_alias_fid (line 903) | int art_alias_fid(int fid)
function art_data_size (line 927) | int art_data_size(int fid, int* sizePtr)
function art_data_load (line 976) | int art_data_load(int fid, int* sizePtr, unsigned char* data)
function art_data_free (line 1024) | void art_data_free(void* ptr)
function art_id (line 1030) | int art_id(int objectType, int frmId, int animType, int a3, int rotation)
FILE: src/game/art.h
type Head (line 9) | typedef enum Head {
type HeadAnimation (line 26) | typedef enum HeadAnimation {
type Background (line 41) | typedef enum Background {
type Art (line 67) | typedef struct Art {
type ArtFrame (line 81) | typedef struct ArtFrame {
type ArtListDescription (line 89) | typedef struct ArtListDescription {
type HeadDescription (line 97) | typedef struct HeadDescription {
type WeaponAnimation (line 103) | typedef enum WeaponAnimation {
type DudeNativeLook (line 118) | typedef enum DudeNativeLook {
FILE: src/game/artload.c
function art_readSubFrameData (line 9) | static int art_readSubFrameData(unsigned char* data, File* stream, int c...
function art_readFrameData (line 29) | static int art_readFrameData(Art* art, File* stream)
function load_frame (line 46) | int load_frame(const char* path, Art** artPtr)
function load_frame_into (line 92) | int load_frame_into(const char* path, unsigned char* data)
function art_writeSubFrameData (line 121) | int art_writeSubFrameData(unsigned char* data, File* stream, int count)
function art_writeFrameData (line 143) | int art_writeFrameData(Art* art, File* stream)
function save_frame (line 160) | int save_frame(const char* path, unsigned char* data)
FILE: src/game/automap.c
type AutomapFlags (line 37) | typedef enum AutomapFlags {
type AutomapFrm (line 51) | typedef enum AutomapFrm {
function automap_init (line 257) | int automap_init()
function automap_reset (line 265) | int automap_reset()
function automap_exit (line 273) | void automap_exit()
function automap_load (line 284) | int automap_load(File* stream)
function automap_save (line 290) | int automap_save(File* stream)
function automapDisplayMap (line 296) | int automapDisplayMap(int map)
function automap (line 302) | void automap(bool isInGame, bool isUsingScanner)
function draw_top_down_map (line 476) | static void draw_top_down_map(int window, int elevation, unsigned char* ...
function draw_top_down_map_pipboy (line 597) | int draw_top_down_map_pipboy(int window, int map, int elevation)
function automap_pip_save (line 659) | int automap_pip_save()
function WriteAM_Entry (line 879) | static int WriteAM_Entry(File* stream)
function AM_ReadEntry (line 911) | static int AM_ReadEntry(int map, int elevation)
function WriteAM_Header (line 998) | static int WriteAM_Header(File* stream)
function AM_ReadMainHeader (line 1028) | static int AM_ReadMainHeader(File* stream)
function decode_map_data (line 1051) | static void decode_map_data(int elevation)
function am_pip_init (line 1084) | static int am_pip_init()
function YesWriteIndex (line 1111) | int YesWriteIndex(int mapIndex, int elevation)
function copy_file_data (line 1123) | static int copy_file_data(File* stream1, File* stream2, int length)
function ReadAMList (line 1155) | int ReadAMList(AutomapHeader** automapHeaderPtr)
FILE: src/game/automap.h
type AutomapHeader (line 17) | typedef struct AutomapHeader {
type AutomapEntry (line 32) | typedef struct AutomapEntry {
FILE: src/game/bmpdlog.c
function dialog_out (line 120) | int dialog_out(const char* title, const char** body, int bodyLength, int...
function file_dialog (line 492) | int file_dialog(char* title, char** fileList, char* dest, int fileListLe...
function save_file_dialog (line 869) | int save_file_dialog(char* title, char** fileList, char* dest, int fileL...
function PrntFlist (line 1351) | static void PrntFlist(unsigned char* buffer, char** fileList, int pageOf...
FILE: src/game/bmpdlog.h
type DialogBoxOptions (line 4) | typedef enum DialogBoxOptions {
type DialogType (line 13) | typedef enum DialogType {
type FileDialogFrm (line 19) | typedef enum FileDialogFrm {
type FileDialogScrollDirection (line 30) | typedef enum FileDialogScrollDirection {
FILE: src/game/cache.c
function cache_init (line 34) | bool cache_init(Cache* cache, CacheSizeProc* sizeProc, CacheReadProc* re...
function cache_exit (line 61) | bool cache_exit(Cache* cache)
function cache_query (line 92) | int cache_query(Cache* cache, int key)
function cache_lock (line 108) | bool cache_lock(Cache* cache, int key, void** data, CacheEntry** cacheEn...
function cache_unlock (line 163) | bool cache_unlock(Cache* cache, CacheEntry* cacheEntry)
function cache_discard (line 185) | int cache_discard(Cache* cache, int key)
function cache_flush (line 212) | bool cache_flush(Cache* cache)
function cache_size (line 241) | int cache_size(Cache* cache, int* sizePtr)
function cache_stats (line 257) | bool cache_stats(Cache* cache, char* dest)
function cache_create_list (line 271) | int cache_create_list(Cache* cache, unsigned int a2, int** tagsPtr, int*...
function cache_destroy_list (line 356) | int cache_destroy_list(int** tagsPtr)
function cache_add (line 375) | static bool cache_add(Cache* cache, int key, int* indexPtr)
function cache_insert (line 473) | static bool cache_insert(Cache* cache, CacheEntry* cacheEntry, int index)
function cache_find (line 498) | static int cache_find(Cache* cache, int key, int* indexPtr)
function cache_create_item (line 539) | static int cache_create_item(CacheEntry** cacheEntryPtr)
function cache_init_item (line 553) | static bool cache_init_item(CacheEntry* cacheEntry)
function cache_destroy_item (line 568) | static bool cache_destroy_item(Cache* cache, CacheEntry* cacheEntry)
function cache_unlock_all (line 580) | static bool cache_unlock_all(Cache* cache)
function cache_reset_counter (line 599) | static bool cache_reset_counter(Cache* cache)
function cache_make_room (line 629) | static bool cache_make_room(Cache* cache, int size)
function cache_purge (line 705) | static bool cache_purge(Cache* cache)
function cache_resize_array (line 736) | static bool cache_resize_array(Cache* cache, int newCapacity)
function cache_compare_make_room (line 754) | static int cache_compare_make_room(const void* a1, const void* a2)
function cache_compare_reset_counter (line 783) | static int cache_compare_reset_counter(const void* a1, const void* a2)
FILE: src/game/cache.h
type CacheEntryFlags (line 16) | typedef enum CacheEntryFlags {
type CacheListRequestType (line 22) | typedef enum CacheListRequestType {
type CacheEntry (line 32) | typedef struct CacheEntry {
type Cache (line 51) | typedef struct Cache {
FILE: src/game/cd.c
function sub_420B10 (line 17) | int sub_420B10(const char* a1)
function sub_420B28 (line 23) | int sub_420B28(const char* a1, const char* a2)
function sub_420B8C (line 40) | int sub_420B8C(const char* a1)
function sub_420BDC (line 58) | int sub_420BDC(const char* a1, int a2)
function sub_420C18 (line 75) | int sub_420C18(const char* a1, const char* a2, int a3)
FILE: src/game/combat.c
function combat_init (line 1901) | int combat_init()
function combat_reset (line 1941) | void combat_reset()
function combat_exit (line 1965) | void combat_exit()
function find_cid (line 1971) | int find_cid(int a1, int cid, Object** critterList, int critterListLength)
function combat_load (line 1985) | int combat_load(File* stream)
function combat_save (line 2113) | int combat_save(File* stream)
function combat_safety_invalidate_weapon (line 2148) | bool combat_safety_invalidate_weapon(Object* attacker, Object* weapon, i...
function combat_safety_invalidate_weapon_func (line 2154) | bool combat_safety_invalidate_weapon_func(Object* attacker, Object* weap...
function combatTestIncidentalHit (line 2256) | bool combatTestIncidentalHit(Object* attacker, Object* defender, Object*...
function Object (line 2262) | Object* combat_whose_turn()
function combat_data_init (line 2272) | void combat_data_init(Object* obj)
function combatInitAIInfoList (line 2281) | static void combatInitAIInfoList()
function combatCopyAIInfo (line 2294) | static int combatCopyAIInfo(int srcIndex, int destIndex)
function Object (line 2308) | Object* combatAIInfoGetFriendlyDead(Object* obj)
function combatAIInfoSetFriendlyDead (line 2326) | int combatAIInfoSetFriendlyDead(Object* a1, Object* a2)
function Object (line 2350) | Object* combatAIInfoGetLastTarget(Object* obj)
function combatAIInfoSetLastTarget (line 2368) | int combatAIInfoSetLastTarget(Object* a1, Object* a2)
function Object (line 2396) | Object* combatAIInfoGetLastItem(Object* obj)
function combatAIInfoSetLastItem (line 2417) | int combatAIInfoSetLastItem(Object* obj, Object* a2)
function combatAIInfoGetLastMove (line 2442) | int combatAIInfoGetLastMove(Object* object)
function combatAIInfoSetLastMove (line 2462) | int combatAIInfoSetLastMove(Object* object, int move)
function combat_begin (line 2482) | static void combat_begin(Object* a1)
function combat_begin_extra (line 2558) | static void combat_begin_extra(Object* a1)
function combat_update_critters_in_los (line 2577) | static void combat_update_critters_in_los(int a1)
function combat_update_critter_outline_for_los (line 2589) | void combat_update_critter_outline_for_los(Object* critter, bool a2)
function combat_over (line 2675) | static void combat_over()
function combat_over_from_load (line 2764) | void combat_over_from_load()
function combat_give_exps (line 2774) | void combat_give_exps(int exp_points)
function combat_add_noncoms (line 2814) | static void combat_add_noncoms()
function combat_in_range (line 2851) | int combat_in_range(Object* critter)
function compare_faster (line 2870) | static int compare_faster(const void* a1, const void* a2)
function combat_sequence_init (line 2895) | static void combat_sequence_init(Object* a1, Object* a2)
function combat_sequence (line 2950) | static void combat_sequence()
function combat_end (line 2999) | void combat_end()
function combat_turn_run (line 3045) | void combat_turn_run()
function combat_input (line 3053) | static int combat_input()
function combat_end_turn (line 3117) | void combat_end_turn()
function combat_set_move_all (line 3123) | static void combat_set_move_all()
function combat_turn (line 3142) | static int combat_turn(Object* a1, bool a2)
function combat_should_end (line 3257) | static bool combat_should_end()
function combat (line 3296) | void combat(STRUCT_664980* attack)
function combat_ctd_init (line 3384) | void combat_ctd_init(Attack* attack, Object* attacker, Object* defender,...
function combat_attack (line 3405) | int combat_attack(Object* a1, Object* a2, int hitMode, int hitLocation)
function combat_bullet_start (line 3480) | int combat_bullet_start(const Object* a1, const Object* a2)
function check_ranged_miss (line 3487) | static bool check_ranged_miss(Attack* attack)
function shoot_along_path (line 3542) | static int shoot_along_path(Attack* attack, int endTile, int rounds, int...
function compute_spray (line 3619) | static int compute_spray(Attack* attack, int accuracy, int* roundsHitMai...
function correctAttackForPerks (line 3709) | static int correctAttackForPerks(Attack* attack)
function compute_attack (line 3730) | static int compute_attack(Attack* attack)
function compute_explosion_on_extras (line 3887) | void compute_explosion_on_extras(Attack* attack, int a2, bool isGrenade,...
function attack_crit_success (line 3989) | static int attack_crit_success(Attack* attack)
function attackFindInvalidFlags (line 4062) | static int attackFindInvalidFlags(Object* critter, Object* item)
function attack_crit_failure (line 4078) | static int attack_crit_failure(Attack* attack)
function do_random_cripple (line 4170) | static void do_random_cripple(int* flagsPtr)
function determine_to_hit (line 4191) | int determine_to_hit(Object* a1, Object* a2, int hitLocation, int hitMode)
function determine_to_hit_no_range (line 4197) | int determine_to_hit_no_range(Object* a1, Object* a2, int hitLocation, i...
function determine_to_hit_from_tile (line 4203) | int determine_to_hit_from_tile(Object* a1, int tile, Object* a3, int hit...
function determine_to_hit_func (line 4210) | static int determine_to_hit_func(Object* attacker, int tile, Object* def...
function compute_damage (line 4397) | static void compute_damage(Attack* attack, int ammoQuantity, int bonusDa...
function death_checks (line 4548) | void death_checks(Attack* attack)
function apply_damage (line 4559) | void apply_damage(Attack* attack, bool animated)
function check_for_death (line 4651) | static void check_for_death(Object* object, int damage, int* flags)
function set_new_results (line 4665) | static void set_new_results(Object* critter, int flags)
function damage_object (line 4703) | static void damage_object(Object* a1, int damage, bool animated, int a4,...
function combat_display (line 4770) | void combat_display(Attack* attack)
function combat_display_hit (line 5073) | static void combat_display_hit(char* dest, Object* critter, int damage)
function combat_display_flags (line 5132) | static void combat_display_flags(char* dest, int flags, Object* critter)
function combat_anim_begin (line 5205) | void combat_anim_begin()
function combat_anim_finished (line 5217) | void combat_anim_finished()
function combat_standup (line 5276) | static void combat_standup(Object* a1)
function print_tohit (line 5304) | static void print_tohit(unsigned char* dest, int destPitch, int accuracy)
function draw_loc_off (line 5337) | static void draw_loc_off(int a1, int a2)
function draw_loc_on (line 5343) | static void draw_loc_on(int a1, int a2)
function draw_loc (line 5349) | static void draw_loc(int eventCode, int color)
function get_called_shot_location (line 5364) | static int get_called_shot_location(Object* critter, int* hitLocation, i...
function combat_check_bad_shot (line 5510) | int combat_check_bad_shot(Object* attacker, Object* defender, int hitMod...
function combat_to_hit (line 5564) | bool combat_to_hit(Object* target, int* accuracy)
function combat_attack_this (line 5582) | void combat_attack_this(Object* a1)
function combat_outline_on (line 5684) | void combat_outline_on()
function combat_outline_off (line 5722) | void combat_outline_off()
function combat_highlight_change (line 5747) | void combat_highlight_change()
function combat_is_shot_blocked (line 5767) | bool combat_is_shot_blocked(Object* a1, int from, int to, Object* a4, in...
function combat_player_knocked_out_by (line 5809) | int combat_player_knocked_out_by()
function combat_explode_scenery (line 5823) | int combat_explode_scenery(Object* a1, Object* a2)
function combat_delete_critter (line 5830) | void combat_delete_critter(Object* obj)
function combatKillCritterOutsideCombat (line 5878) | void combatKillCritterOutsideCombat(Object* critter_obj, char* msg)
FILE: src/game/combat.h
function isInCombat (line 74) | static inline bool isInCombat()
FILE: src/game/combat_defs.h
type CombatState (line 13) | typedef enum CombatState {
type HitMode (line 19) | typedef enum HitMode {
type HitLocation (line 73) | typedef enum HitLocation {
type CombatAiInfo (line 87) | typedef struct CombatAiInfo {
type STRUCT_664980 (line 94) | typedef struct STRUCT_664980 {
type Attack (line 109) | typedef struct Attack {
type CriticalHitDescription (line 136) | typedef struct CriticalHitDescription {
type CombatBadShot (line 156) | typedef enum CombatBadShot {
FILE: src/game/combatai.c
function parse_hurt_str (line 226) | static void parse_hurt_str(char* str, int* valuePtr)
function cai_match_str_to_list (line 265) | static int cai_match_str_to_list(const char* str, const char** list, int...
function cai_init_cap (line 278) | static void cai_init_cap(AiPacket* ai)
function combat_ai_init (line 298) | int combat_ai_init()
function combat_ai_reset (line 461) | void combat_ai_reset()
function combat_ai_exit (line 466) | int combat_ai_exit()
function combat_ai_load (line 501) | int combat_ai_load(File* stream)
function combat_ai_save (line 522) | int combat_ai_save(File* stream)
function cai_cap_load (line 543) | static int cai_cap_load(File* stream, AiPacket* ai)
function cai_cap_save (line 587) | static int cai_cap_save(File* stream, AiPacket* ai)
function combat_ai_num (line 635) | int combat_ai_num()
function AiPacket (line 661) | static AiPacket* ai_cap(Object* obj)
function AiPacket (line 671) | static AiPacket* ai_cap_from_packet(int aiPacketId)
function ai_get_burst_value (line 686) | int ai_get_burst_value(Object* obj)
function ai_get_run_away_value (line 693) | int ai_get_run_away_value(Object* obj)
function ai_get_weapon_pref_value (line 721) | int ai_get_weapon_pref_value(Object* obj)
function ai_get_distance_pref_value (line 728) | int ai_get_distance_pref_value(Object* obj)
function ai_get_attack_who_value (line 735) | int ai_get_attack_who_value(Object* obj)
function ai_get_chem_use_value (line 742) | int ai_get_chem_use_value(Object* obj)
function ai_set_burst_value (line 749) | int ai_set_burst_value(Object* critter, int areaAttackMode)
function ai_set_run_away_value (line 761) | int ai_set_run_away_value(Object* obj, int runAwayMode)
function ai_set_weapon_pref_value (line 782) | int ai_set_weapon_pref_value(Object* critter, int bestWeapon)
function ai_set_distance_pref_value (line 794) | int ai_set_distance_pref_value(Object* critter, int distance)
function ai_set_attack_who_value (line 806) | int ai_set_attack_who_value(Object* critter, int attackWho)
function ai_set_chem_use_value (line 818) | int ai_set_chem_use_value(Object* critter, int chemUse)
function ai_get_disposition (line 830) | int ai_get_disposition(Object* obj)
function ai_set_disposition (line 841) | int ai_set_disposition(Object* obj, int disposition)
function ai_magic_hands (line 858) | static int ai_magic_hands(Object* critter, Object* item, int num)
function ai_check_drugs (line 893) | static int ai_check_drugs(Object* critter)
function ai_run_away (line 1056) | static void ai_run_away(Object* a1, Object* a2)
function ai_move_away (line 1104) | static int ai_move_away(Object* a1, Object* a2, int a3)
function ai_find_friend (line 1150) | static bool ai_find_friend(Object* a1, int a2, int a3)
function compare_nearer (line 1173) | static int compare_nearer(const void* a1, const void* a2)
function ai_sort_list_distance (line 1204) | static void ai_sort_list_distance(Object** critterList, int length, Obje...
function compare_strength (line 1213) | int compare_strength(const void* p1, const void* p2)
function ai_sort_list_strength (line 1247) | static void ai_sort_list_strength(Object** critterList, int length)
function compare_weakness (line 1255) | int compare_weakness(const void* p1, const void* p2)
function ai_sort_list_weakness (line 1289) | static void ai_sort_list_weakness(Object** critterList, int length)
function Object (line 1295) | static Object* ai_find_nearest_team(Object* a1, Object* a2, int a3)
function Object (line 1322) | static Object* ai_find_nearest_team_in_combat(Object* a1, Object* a2, in...
function ai_find_attackers (line 1353) | static int ai_find_attackers(Object* a1, Object** a2, Object** a3, Objec...
function Object (line 1420) | Object* ai_danger_source(Object* a1)
function caiSetupTeamCombat (line 1541) | int caiSetupTeamCombat(Object* a1, Object* a2)
function caiTeamCombatInit (line 1560) | int caiTeamCombatInit(Object** a1, int a2)
function caiTeamCombatExit (line 1601) | void caiTeamCombatExit()
function ai_have_ammo (line 1608) | static int ai_have_ammo(Object* critter_obj, Object* weapon_obj, Object*...
function caiHasWeapPrefType (line 1649) | static bool caiHasWeapPrefType(AiPacket* ai, int attackType)
function Object (line 1663) | static Object* ai_best_weapon(Object* attacker, Object* weapon1, Object*...
function ai_can_use_weapon (line 1815) | static bool ai_can_use_weapon(Object* critter, Object* weapon, int hitMode)
function Object (line 1845) | Object* ai_search_inven_weap(Object* critter, int a2, Object* a3)
function Object (line 1894) | Object* ai_search_inven_armor(Object* critter)
function ai_can_use_drug (line 1948) | static bool ai_can_use_drug(Object* critter, Object* item)
function Object (line 1999) | static Object* ai_search_environ(Object* critter, int itemType)
function Object (line 2058) | static Object* ai_retrieve_object(Object* a1, Object* a2)
function ai_pick_hit_mode (line 2079) | static int ai_pick_hit_mode(Object* a1, Object* a2, Object* a3)
function ai_move_steps_closer (line 2157) | static int ai_move_steps_closer(Object* a1, Object* a2, int actionPoints...
function ai_move_closer (line 2251) | static int ai_move_closer(Object* a1, Object* a2, int a3)
function cai_retargetTileFromFriendlyFire (line 2257) | static int cai_retargetTileFromFriendlyFire(Object* source, Object* targ...
function cai_retargetTileFromFriendlyFireSubFunc (line 2342) | static int cai_retargetTileFromFriendlyFireSubFunc(AiRetargetData* aiRet...
function cai_attackWouldIntersect (line 2368) | static bool cai_attackWouldIntersect(Object* attacker, Object* defender,...
function ai_switch_weapons (line 2397) | static int ai_switch_weapons(Object* a1, int* hitMode, Object** weapon, ...
function ai_called_shot (line 2435) | static int ai_called_shot(Object* a1, Object* a2, int a3)
function ai_attack (line 2476) | static int ai_attack(Object* a1, Object* a2, int a3)
function ai_try_attack (line 2500) | static int ai_try_attack(Object* a1, Object* a2)
function cAIPrepWeaponItem (line 2703) | int cAIPrepWeaponItem(Object* critter, Object* item)
function cai_attempt_w_reload (line 2712) | void cai_attempt_w_reload(Object* critter_obj, int a2)
function combat_ai_begin (line 2745) | void combat_ai_begin(int a1, void* a2)
function combat_ai_over (line 2760) | void combat_ai_over()
function cai_perform_distance_prefs (line 2770) | static int cai_perform_distance_prefs(Object* a1, Object* a2)
function cai_get_min_hp (line 2823) | static int cai_get_min_hp(AiPacket* ai)
function combat_ai (line 2840) | void combat_ai(Object* a1, Object* a2)
function combatai_want_to_join (line 2955) | bool combatai_want_to_join(Object* a1)
function combatai_want_to_stop (line 3001) | bool combatai_want_to_stop(Object* a1)
function combatai_switch_team (line 3022) | int combatai_switch_team(Object* obj, int team)
function combat_ai_set_ai_packet (line 3070) | int combat_ai_set_ai_packet(Object* object, int aiPacket)
function combatai_msg (line 3092) | int combatai_msg(Object* a1, Attack* attack, int type, int delay)
function ai_print_msg (line 3173) | static int ai_print_msg(Object* critter, int type)
function Object (line 3203) | Object* combat_ai_random_target(Attack* attack)
function combatai_rating (line 3241) | static int combatai_rating(Object* obj)
function combatai_check_retaliation (line 3276) | int combatai_check_retaliation(Object* a1, Object* a2)
function is_within_perception (line 3290) | bool is_within_perception(Object* a1, Object* a2)
function combatai_load_messages (line 3349) | static int combatai_load_messages()
function combatai_unload_messages (line 3375) | static int combatai_unload_messages()
function combatai_refresh_messages (line 3385) | void combatai_refresh_messages()
function combatai_notify_onlookers (line 3408) | void combatai_notify_onlookers(Object* a1)
function combatai_notify_friends (line 3427) | void combatai_notify_friends(Object* a1)
function combatai_delete_critter (line 3442) | void combatai_delete_critter(Object* obj)
FILE: src/game/combatai.h
type AiMessageType (line 15) | typedef enum AiMessageType {
type AiMessageRange (line 23) | typedef struct AiMessageRange {
type AiPacket (line 28) | typedef struct AiPacket {
type AiRetargetData (line 59) | typedef struct AiRetargetData {
FILE: src/game/combatai_defs.h
type AreaAttackMode (line 4) | typedef enum AreaAttackMode {
type RunAwayMode (line 13) | typedef enum RunAwayMode {
type BestWeapon (line 24) | typedef enum BestWeapon {
type DistanceMode (line 36) | typedef enum DistanceMode {
type AttackWho (line 45) | typedef enum AttackWho {
type ChemUse (line 54) | typedef enum ChemUse {
type Disposition (line 64) | typedef enum Disposition {
type HurtTooMuch (line 74) | typedef enum HurtTooMuch {
FILE: src/game/config.c
function config_init (line 22) | bool config_init(Config* config)
function config_exit (line 36) | void config_exit(Config* config)
function config_cmd_line_parse (line 69) | bool config_cmd_line_parse(Config* config, int argc, char** argv)
function config_get_string (line 111) | bool config_get_string(Config* config, const char* sectionKey, const cha...
function config_set_string (line 137) | bool config_set_string(Config* config, const char* sectionKey, const cha...
function config_get_value (line 181) | bool config_get_value(Config* config, const char* sectionKey, const char...
function config_get_values (line 198) | bool config_get_values(Config* config, const char* sectionKey, const cha...
function config_set_value (line 237) | bool config_set_value(Config* config, const char* sectionKey, const char...
function config_load (line 248) | bool config_load(Config* config, const char* filePath, bool isDb)
function config_save (line 284) | bool config_save(Config* config, const char* filePath, bool isDb)
function config_parse_line (line 349) | static bool config_parse_line(Config* config, char* string)
function config_split_line (line 391) | static bool config_split_line(char* string, char* key, char* value)
function config_add_section (line 422) | static bool config_add_section(Config* config, const char* sectionKey)
function config_strip_white_space (line 448) | static bool config_strip_white_space(char* string)
function config_get_double (line 485) | bool config_get_double(Config* config, const char* sectionKey, const cha...
function config_set_double (line 502) | bool config_set_double(Config* config, const char* sectionKey, const cha...
function configGetBool (line 511) | bool configGetBool(Config* config, const char* sectionKey, const char* k...
function configSetBool (line 528) | bool configSetBool(Config* config, const char* sectionKey, const char* k...
FILE: src/game/config.h
type assoc_array (line 12) | typedef assoc_array Config;
type assoc_array (line 18) | typedef assoc_array ConfigSection;
FILE: src/game/counter.c
function counter_on (line 23) | void counter_on(CounterOutputFunc* outputFunc)
function counter_off (line 35) | void counter_off()
function counter (line 44) | static void counter()
FILE: src/game/credits.c
function credits (line 42) | void credits(const char* filePath, int backgroundFid, bool useReversedSt...
function credits_get_next_line (line 248) | static bool credits_get_next_line(char* dest, int* font, int* color)
FILE: src/game/critter.c
function critter_init (line 110) | int critter_init()
function critter_reset (line 134) | void critter_reset()
function critter_exit (line 143) | void critter_exit()
function critter_load (line 149) | int critter_load(File* stream)
function critter_save (line 162) | int critter_save(File* stream)
function critter_copy (line 175) | void critter_copy(CritterProtoData* dest, CritterProtoData* src)
function critter_pc_set_name (line 219) | int critter_pc_set_name(const char* name)
function critter_pc_reset_name (line 230) | void critter_pc_reset_name()
function critter_get_hits (line 236) | int critter_get_hits(Object* critter)
function critter_adjust_hits (line 242) | int critter_adjust_hits(Object* critter, int hp)
function critter_get_poison (line 264) | int critter_get_poison(Object* critter)
function critter_adjust_poison (line 277) | int critter_adjust_poison(Object* critter, int amount)
function critter_check_poison (line 328) | int critter_check_poison(Object* obj, void* data)
function critter_get_rads (line 356) | int critter_get_rads(Object* obj)
function critter_adjust_rads (line 362) | int critter_adjust_rads(Object* obj, int amount)
function critter_check_rads (line 437) | int critter_check_rads(Object* obj)
function get_rad_damage_level (line 504) | static int get_rad_damage_level(Object* obj, void* data)
function clear_rad_damage (line 514) | static int clear_rad_damage(Object* obj, void* data)
function process_rads (line 528) | static void process_rads(Object* obj, int radiationLevel, bool isHealing)
function critter_process_rads (line 578) | int critter_process_rads(Object* obj, void* data)
function critter_load_rads (line 598) | int critter_load_rads(File* stream, void** dataPtr)
function critter_save_rads (line 618) | int critter_save_rads(File* stream, void* data)
function critter_get_base_damage_type (line 629) | int critter_get_base_damage_type(Object* obj)
function critter_kill_count_clear (line 646) | static int critter_kill_count_clear()
function critter_kill_count_inc (line 653) | int critter_kill_count_inc(int killType)
function critter_kill_count (line 664) | int critter_kill_count(int killType)
function critter_kill_count_load (line 674) | int critter_kill_count_load(File* stream)
function critter_kill_count_save (line 685) | int critter_kill_count_save(File* stream)
function critterGetKillType (line 696) | int critterGetKillType(Object* obj)
function critter_heal_hours (line 747) | int critter_heal_hours(Object* critter, int a2)
function critterClearObjDrugs (line 763) | static int critterClearObjDrugs(Object* obj, void* data)
function critter_kill (line 769) | void critter_kill(Object* critter, int anim, bool a3)
function critter_kill_exps (line 871) | int critter_kill_exps(Object* critter)
function critter_is_active (line 879) | bool critter_is_active(Object* critter)
function critter_is_dead (line 901) | bool critter_is_dead(Object* critter)
function critter_is_crippled (line 923) | bool critter_is_crippled(Object* critter)
function critter_is_prone (line 937) | bool critter_is_prone(Object* critter)
function critter_body_type (line 956) | int critter_body_type(Object* critter)
function critter_load_data (line 975) | int critter_load_data(CritterProtoData* critterData, const char* path)
function pc_load_data (line 994) | int pc_load_data(const char* path)
function critter_read_data (line 1036) | int critter_read_data(File* stream, CritterProtoData* critterData)
function critter_save_data (line 1068) | int critter_save_data(CritterProtoData* critterData, const char* path)
function pc_save_data (line 1087) | int pc_save_data(const char* path)
function critter_write_data (line 1124) | int critter_write_data(File* stream, CritterProtoData* critterData)
function pc_flag_off (line 1139) | void pc_flag_off(int state)
function pc_flag_on (line 1154) | void pc_flag_on(int state)
function pc_flag_toggle (line 1169) | void pc_flag_toggle(int state)
function is_pc_flag (line 1180) | bool is_pc_flag(int state)
function critter_sneak_check (line 1188) | int critter_sneak_check(Object* obj, void* data)
function critter_sneak_clear (line 1220) | int critter_sneak_clear(Object* obj, void* data)
function is_pc_sneak_working (line 1229) | bool is_pc_sneak_working()
function critter_wake_up (line 1240) | int critter_wake_up(Object* obj, void* data)
function critter_wake_clear (line 1259) | int critter_wake_clear(Object* obj, void* data)
function critter_set_who_hit_me (line 1278) | int critter_set_who_hit_me(Object* a1, Object* a2)
function critter_can_obj_dude_rest (line 1301) | bool critter_can_obj_dude_rest()
function critter_compute_ap_from_distance (line 1342) | int critter_compute_ap_from_distance(Object* critter, int actionPoints)
function critterIsOverloaded (line 1359) | bool critterIsOverloaded(Object* critter)
function critter_is_fleeing (line 1367) | bool critter_is_fleeing(Object* critter)
function critter_flag_check (line 1377) | bool critter_flag_check(int pid, int flag)
function critter_flag_set (line 1395) | void critter_flag_set(int pid, int flag)
function critter_flag_unset (line 1415) | void critter_flag_unset(int pid, int flag)
function critter_flag_toggle (line 1435) | void critter_flag_toggle(int pid, int flag)
FILE: src/game/critter.h
type RadiationLevel (line 23) | typedef enum RadiationLevel {
type DudeState (line 46) | typedef enum DudeState {
FILE: src/game/cycle.c
function cycle_init (line 97) | void cycle_init()
function cycle_reset (line 146) | void cycle_reset()
function cycle_exit (line 159) | void cycle_exit()
function cycle_disable (line 169) | void cycle_disable()
function cycle_enable (line 175) | void cycle_enable()
function cycle_is_enabled (line 181) | bool cycle_is_enabled()
function cycle_colors (line 187) | static void cycle_colors()
function change_cycle_speed (line 332) | void change_cycle_speed(int value)
function get_cycle_speed (line 341) | int get_cycle_speed()
FILE: src/game/diskspce.c
function GetFreeDiskSpace (line 10) | int GetFreeDiskSpace(long* diskSpacePtr)
FILE: src/game/display.c
function display_init (line 82) | int display_init()
function display_reset (line 171) | int display_reset()
function display_exit (line 180) | void display_exit()
function display_print (line 189) | void display_print(char* str)
function display_clear (line 284) | void display_clear()
function display_redraw (line 300) | void display_redraw()
function display_scroll_up (line 339) | void display_scroll_up(int btn, int keyCode)
function display_scroll_down (line 348) | void display_scroll_down(int btn, int keyCode)
function display_arrow_up (line 357) | void display_arrow_up(int btn, int keyCode)
function display_arrow_down (line 363) | void display_arrow_down(int btn, int keyCode)
function display_arrow_restore (line 369) | void display_arrow_restore(int btn, int keyCode)
function display_disable (line 375) | void display_disable()
function display_enable (line 385) | void display_enable()
FILE: src/game/editor.c
type EditorFolder (line 97) | typedef enum EditorFolder {
type KarmaEntry (line 190) | typedef struct KarmaEntry {
type GenericReputationEntry (line 197) | typedef struct GenericReputationEntry {
type PerkDialogOption (line 202) | typedef struct PerkDialogOption {
type KillInfo (line 210) | typedef struct KillInfo {
function editor_design (line 757) | int editor_design(bool isCreationMode)
function CharEditStart (line 1158) | static int CharEditStart()
function CharEditEnd (line 1751) | static void CharEditEnd()
function RstrBckgProc (line 1796) | static void RstrBckgProc()
function CharEditInit (line 1809) | void CharEditInit()
function get_input_str (line 1829) | int get_input_str(int win, int cancelKeyCode, char* text, int maxLength,...
function isdoschar (line 1920) | bool isdoschar(int ch)
function DrawFolder (line 1957) | static void DrawFolder()
function list_perks (line 2002) | static void list_perks()
function kills_list_comp (line 2092) | static int kills_list_comp(const void* a1, const void* a2)
function ListKills (line 2100) | static int ListKills()
function PrintBigNum (line 2148) | static void PrintBigNum(int x, int y, int flags, int value, int previous...
function PrintLevelWin (line 2256) | static void PrintLevelWin()
function PrintBasicStat (line 2339) | static void PrintBasicStat(int stat, bool animate, int previousValue)
function PrintGender (line 2408) | static void PrintGender()
function PrintAgeBig (line 2438) | static void PrintAgeBig()
function PrintBigname (line 2468) | static void PrintBigname()
function ListDrvdStats (line 2524) | static void ListDrvdStats()
function ListSkills (line 2819) | static void ListSkills(int a1)
function DrawInfoWin (line 2952) | static void DrawInfoWin()
function NameWindow (line 3097) | static int NameWindow()
function PrintName (line 3197) | static void PrintName(unsigned char* buf, int pitch)
function AgeWindow (line 3215) | static int AgeWindow()
function SexWindow (line 3459) | static void SexWindow()
function StatButton (line 3598) | static void StatButton(int eventCode)
function OptionWindow (line 3678) | static int OptionWindow()
function db_access (line 4104) | bool db_access(const char* fname)
function Save_as_ASCII (line 4116) | static int Save_as_ASCII(const char* fileName)
function ResetScreen (line 4590) | static void ResetScreen()
function RegInfoAreas (line 4616) | static void RegInfoAreas()
function CheckValidPlayer (line 4638) | static int CheckValidPlayer()
function SavePlayer (line 4658) | static void SavePlayer()
function RestorePlayer (line 4689) | static void RestorePlayer()
function DrawCard (line 4770) | static int DrawCard(int graphicId, const char* name, const char* attribu...
function FldrButton (line 4859) | static void FldrButton()
function InfoButton (line 4880) | static void InfoButton(int eventCode)
function SliderBtn (line 5004) | static void SliderBtn(int keyCode)
function tagskl_free (line 5135) | static int tagskl_free()
function TagSkillSelect (line 5157) | static void TagSkillSelect(int skill)
function ListTraits (line 5211) | static void ListTraits()
function get_trait_count (line 5291) | static int get_trait_count()
function TraitSelect (line 5309) | static void TraitSelect(int trait)
function list_karma (line 5356) | static void list_karma()
function editor_save (line 5507) | int editor_save(File* stream)
function editor_load (line 5518) | int editor_load(File* stream)
function editor_reset (line 5529) | void editor_reset()
function UpdateLevel (line 5538) | static int UpdateLevel()
function RedrwDPrks (line 5599) | static void RedrwDPrks()
function perks_dialog (line 5631) | static int perks_dialog()
function InputPDLoop (line 5826) | static int InputPDLoop(int count, void (*refreshProc)())
function ListDPerks (line 6089) | static int ListDPerks()
function RedrwDMPrk (line 6151) | void RedrwDMPrk()
function GetMutateTrait (line 6166) | static bool GetMutateTrait()
function RedrwDMTagSkl (line 6260) | static void RedrwDMTagSkl()
function Add4thTagSkill (line 6275) | static bool Add4thTagSkill()
function ListNewTagSkills (line 6306) | static void ListNewTagSkills()
function ListMyTraits (line 6341) | static int ListMyTraits(int a1)
function name_sort_comp (line 6400) | static int name_sort_comp(const void* a1, const void* a2)
function DrawCard2 (line 6408) | static int DrawCard2(int frmId, const char* name, const char* rank, char...
function push_perks (line 6502) | static void push_perks()
function pop_perks (line 6514) | static void pop_perks()
function PerkCount (line 6542) | static int PerkCount()
function is_supper_bonus (line 6563) | static int is_supper_bonus()
function folder_init (line 6577) | static int folder_init()
function folder_exit (line 6620) | static void folder_exit()
function folder_scroll (line 6634) | static void folder_scroll(int direction)
function folder_clear (line 6684) | static void folder_clear()
function folder_print_seperator (line 6716) | static int folder_print_seperator(const char* string)
function folder_print_line (line 6752) | static bool folder_print_line(const char* string)
function folder_print_kill (line 6777) | static bool folder_print_kill(const char* name, int kills)
function karma_vars_init (line 6816) | static int karma_vars_init()
function karma_vars_exit (line 6896) | static void karma_vars_exit()
function karma_vars_qsort_compare (line 6907) | static int karma_vars_qsort_compare(const void* a1, const void* a2)
function general_reps_init (line 6915) | static int general_reps_init()
function general_reps_exit (line 6981) | static void general_reps_exit()
function general_reps_qsort_compare (line 6992) | static int general_reps_qsort_compare(const void* a1, const void* a2)
FILE: src/game/editor.h
type TownReputationEntry (line 9) | typedef struct TownReputationEntry {
FILE: src/game/elevator.c
type ElevatorFrm (line 35) | typedef enum ElevatorFrm {
type ElevatorBackground (line 45) | typedef struct ElevatorBackground {
type ElevatorDescription (line 50) | typedef struct ElevatorDescription {
function elevator_select (line 346) | int elevator_select(int elevator, int* mapPtr, int* elevationPtr, int* t...
function elevator_start (line 478) | static int elevator_start(int elevator)
function elevator_end (line 624) | static void elevator_end()
function Check4Keys (line 652) | static int Check4Keys(int elevator, int keyCode)
FILE: src/game/elevator.h
type Elevator (line 4) | typedef enum Elevator {
FILE: src/game/endgame.c
type EndgameDeathEnding (line 44) | typedef struct EndgameDeathEnding {
type EndgameEnding (line 58) | typedef struct EndgameEnding {
function endgame_slideshow (line 209) | void endgame_slideshow()
function endgame_movie (line 232) | void endgame_movie()
function endgameEndingHandleContinuePlaying (line 259) | int endgameEndingHandleContinuePlaying()
function endgame_pan_desert (line 312) | static void endgame_pan_desert(int direction, const char* narratorFileName)
function endgame_display_image (line 433) | static void endgame_display_image(int fid, const char* narratorFileName)
function endgame_init (line 514) | static int endgame_init()
function endgame_exit (line 595) | static void endgame_exit()
function endgame_load_voiceover (line 632) | static void endgame_load_voiceover(const char* fileBaseName)
function endgame_play_voiceover (line 680) | static void endgame_play_voiceover()
function endgame_stop_voiceover (line 697) | static void endgame_stop_voiceover()
function endgame_load_palette (line 706) | static void endgame_load_palette(int type, int id)
function endgame_voiceover_callback (line 727) | static void endgame_voiceover_callback()
function endgame_load_subtitles (line 735) | static int endgame_load_subtitles(const char* filePath)
function endgame_show_subtitles (line 776) | static void endgame_show_subtitles()
function endgame_clear_subtitles (line 827) | static void endgame_clear_subtitles()
function endgame_movie_callback (line 842) | static void endgame_movie_callback()
function endgame_movie_bk_process (line 848) | static void endgame_movie_bk_process()
function endgame_load_slide_info (line 858) | static int endgame_load_slide_info()
function endgame_unload_slide_info (line 955) | static void endgame_unload_slide_info()
function endgameDeathEndingInit (line 967) | int endgameDeathEndingInit()
function endgameDeathEndingExit (line 1075) | int endgameDeathEndingExit()
function endgameSetupDeathEnding (line 1089) | void endgameSetupDeathEnding(int reason)
function endgameSetupInit (line 1147) | static int endgameSetupInit(int* percentage)
FILE: src/game/endgame.h
type EndgameDeathEndingReason (line 4) | typedef enum EndgameDeathEndingReason {
FILE: src/game/ereg.c
function annoy_user (line 9) | void annoy_user()
FILE: src/game/fontmgr.c
type InterfaceFontGlyph (line 15) | typedef struct InterfaceFontGlyph {
type InterfaceFontDescriptor (line 21) | typedef struct InterfaceFontDescriptor {
function FMInit (line 52) | int FMInit()
function FMExit (line 81) | void FMExit()
function FMLoadFont (line 91) | static int FMLoadFont(int font_index)
function FMtext_font (line 183) | void FMtext_font(int font)
function FMtext_height (line 198) | int FMtext_height()
function FMtext_width (line 208) | int FMtext_width(const char* string)
function FMtext_char_width (line 233) | int FMtext_char_width(int ch)
function FMtext_mono_width (line 251) | int FMtext_mono_width(const char* str)
function FMtext_spacing (line 261) | int FMtext_spacing()
function FMtext_size (line 271) | int FMtext_size(const char* str)
function FMtext_max (line 281) | int FMtext_max()
function FMtext_curr (line 300) | int FMtext_curr()
function FMtext_to_buf (line 306) | void FMtext_to_buf(unsigned char* buf, const char* string, int length, i...
function Swap4 (line 383) | static void Swap4(unsigned int* value)
function Swap2 (line 396) | static void Swap2(unsigned short* value)
FILE: src/game/game.c
function game_init (line 137) | int game_init(const char* windowTitle, bool isMapper, int font, int a4, ...
function game_reset (line 352) | void game_reset()
function game_exit (line 391) | void game_exit()
function game_handle_input (line 435) | int game_handle_input(int eventCode, bool isInCombatMode)
function game_ui_disable (line 878) | void game_ui_disable(int a1)
function game_ui_enable (line 891) | void game_ui_enable()
function game_ui_is_disabled (line 905) | bool game_ui_is_disabled()
function game_get_global_var (line 911) | int game_get_global_var(int var)
function game_set_global_var (line 922) | int game_set_global_var(int var, int value)
function game_load_info (line 936) | int game_load_info()
function game_load_info_vars (line 942) | int game_load_info_vars(const char* path, const char* section, int* vari...
function game_state (line 1001) | int game_state()
function game_state_request (line 1007) | int game_state_request(int a1)
function game_state_update (line 1026) | void game_state_update()
function game_display_counter (line 1048) | static void game_display_counter(double value)
function game_screendump (line 1057) | static int game_screendump(int width, int height, unsigned char* buffer,...
function game_unload_info (line 1083) | static void game_unload_info()
function game_help (line 1093) | static void game_help()
function game_quit_with_confirm (line 1148) | int game_quit_with_confirm()
function game_init_databases (line 1203) | static int game_init_databases()
function game_splash_screen (line 1266) | static void game_splash_screen()
FILE: src/game/game.h
type GameState (line 9) | typedef enum GameState {
FILE: src/game/game_vars.h
type GameGlobalVar (line 4) | typedef enum GameGlobalVar {
FILE: src/game/gconfig.c
function gconfig_init (line 40) | bool gconfig_init(bool isMapper, int argc, char** argv)
function gconfig_save (line 145) | bool gconfig_save()
function gconfig_exit (line 161) | bool gconfig_exit(bool shouldSave)
FILE: src/game/gconfig.h
type GameDifficulty (line 93) | typedef enum GameDifficulty {
type CombatDifficulty (line 99) | typedef enum CombatDifficulty {
type ViolenceLevel (line 105) | typedef enum ViolenceLevel {
type TargetHighlight (line 112) | typedef enum TargetHighlight {
FILE: src/game/gdebug.c
function fatal_error (line 11) | void fatal_error(const char* format, const char* message, const char* fi...
FILE: src/game/gdialog.c
type GameDialogReviewWindowButton (line 67) | typedef enum GameDialogReviewWindowButton {
type GameDialogReviewWindowButtonFrm (line 74) | typedef enum GameDialogReviewWindowButtonFrm {
type GameDialogReaction (line 84) | typedef enum GameDialogReaction {
type GameDialogReviewEntry (line 90) | typedef struct GameDialogReviewEntry {
type GameDialogOptionEntry (line 100) | typedef struct GameDialogOptionEntry {
type GameDialogBlock (line 111) | typedef struct GameDialogBlock {
type GameDialogButtonData (line 134) | typedef struct GameDialogButtonData {
type STRUCT_5189E4 (line 147) | typedef struct STRUCT_5189E4 {
type PartyMemberCustomizationOption (line 152) | typedef enum PartyMemberCustomizationOption {
function gdialogInit (line 656) | int gdialogInit()
function gdialogReset (line 662) | int gdialogReset()
function gdialogExit (line 669) | int gdialogExit()
function gdialogActive (line 676) | bool gdialogActive()
function gdialogEnter (line 683) | void gdialogEnter(Object* a1, int a2)
function gdialogSystemEnter (line 808) | void gdialogSystemEnter()
function gdialogSetupSpeech (line 832) | void gdialogSetupSpeech(const char* audioFileName)
function gdialogFreeSpeech (line 857) | void gdialogFreeSpeech()
function gdialogEnableBK (line 868) | int gdialogEnableBK()
function gdialogDisableBK (line 875) | int gdialogDisableBK()
function gdialogInitFromScript (line 882) | int gdialogInitFromScript(int headFid, int reaction)
function gdialogExitFromScript (line 938) | int gdialogExitFromScript()
function gdialogSetBackground (line 1019) | void gdialogSetBackground(int a1)
function gdialogDisplayMsg (line 1029) | void gdialogDisplayMsg(char* msg)
function gdialogStart (line 1061) | int gdialogStart()
function gdialogSayMessage (line 1069) | int gdialogSayMessage()
function gdialogOption (line 1087) | int gdialogOption(int messageListId, int messageId, const char* proc, in...
function gdialogOptionStr (line 1101) | int gdialogOptionStr(int messageListId, const char* text, const char* pr...
function gdialogOptionProc (line 1109) | int gdialogOptionProc(int messageListId, int messageId, int proc, int re...
function gdialogOptionProcStr (line 1117) | int gdialogOptionProcStr(int messageListId, const char* text, int proc, ...
function gdialogReply (line 1125) | int gdialogReply(Program* program, int messageListId, int messageId)
function gdialogReplyStr (line 1140) | int gdialogReplyStr(Program* program, int messageListId, const char* text)
function gdialogGo (line 1157) | int gdialogGo()
function gdialogUpdatePartyStatus (line 1184) | void gdialogUpdatePartyStatus()
function gdHide (line 1211) | static int gdHide()
function gdUnhide (line 1227) | static int gdUnhide()
function gdUnhideReply (line 1243) | static int gdUnhideReply()
function gdAddOption (line 1253) | static int gdAddOption(int messageListId, int messageId, int reaction)
function gdAddOptionStr (line 1273) | static int gdAddOptionStr(int messageListId, const char* text, int react...
function gdReviewInit (line 1293) | static int gdReviewInit(int* win)
function gdReviewExit (line 1431) | static int gdReviewExit(int* win)
function gdReview (line 1461) | static int gdReview()
function gdReviewPressed (line 1510) | static void gdReviewPressed(int btn, int keyCode)
function gdReviewDisplay (line 1516) | static void gdReviewDisplay(int win, int origin)
function gdReviewFree (line 1610) | static void gdReviewFree()
function gdAddReviewReply (line 1628) | static int gdAddReviewReply(int messageListId, int messageId)
function gdAddReviewReplyStr (line 1652) | static int gdAddReviewReplyStr(const char* string)
function gdAddReviewOptionChosen (line 1681) | static int gdAddReviewOptionChosen(int messageListId, int messageId)
function gdAddReviewOptionChosenStr (line 1697) | static int gdAddReviewOptionChosenStr(const char* string)
function gdProcessInit (line 1717) | static int gdProcessInit()
function gdProcessCleanup (line 1804) | static void gdProcessCleanup()
function gdProcessExit (line 1819) | static int gdProcessExit()
function gdUpdateMula (line 1843) | static void gdUpdateMula()
function gdProcess (line 1871) | static int gdProcess()
function gdProcessChoice (line 2024) | static int gdProcessChoice(int a1)
function gdProcessHighlight (line 2099) | static void gdProcessHighlight(int index)
function gdProcessUnHighlight (line 2153) | static void gdProcessUnHighlight(int index)
function gdProcessReply (line 2201) | static void gdProcessReply()
function gdProcessUpdate (line 2225) | static void gdProcessUpdate()
function gdCreateHeadWindow (line 2362) | static int gdCreateHeadWindow()
function gdDestroyHeadWindow (line 2404) | static void gdDestroyHeadWindow()
function gdSetupFidget (line 2427) | static void gdSetupFidget(int headFrmId, int reaction)
function gdWaitForFidget (line 2540) | static void gdWaitForFidget()
function gdPlayTransition (line 2564) | static void gdPlayTransition(int anim)
function reply_arrow_up (line 2615) | static void reply_arrow_up(int btn, int keyCode)
function reply_arrow_down (line 2623) | static void reply_arrow_down(int btn, int keyCode)
function reply_arrow_restore (line 2631) | static void reply_arrow_restore(int btn, int keyCode)
function demo_copy_title (line 2638) | static void demo_copy_title(int win)
function demo_copy_options (line 2677) | static void demo_copy_options(int win)
function gDialogRefreshOptionsRect (line 2718) | static void gDialogRefreshOptionsRect(int win, Rect* drawRect)
function gdialog_bk (line 2767) | static void gdialog_bk()
function talk_to_critter_reacts (line 2855) | void talk_to_critter_reacts(int a1)
function gdialog_scroll_subwin (line 2906) | static void gdialog_scroll_subwin(int win, int a2, unsigned char* a3, un...
function text_num_lines (line 2987) | static int text_num_lines(const char* a1, int a2)
function text_to_rect_wrapped (line 3003) | static int text_to_rect_wrapped(unsigned char* buffer, Rect* rect, char*...
function text_to_rect_func (line 3010) | static int text_to_rect_func(unsigned char* buffer, Rect* rect, char* st...
function gdialogSetBarterMod (line 3120) | void gdialogSetBarterMod(int modifier)
function gdActivateBarter (line 3127) | int gdActivateBarter(int modifier)
function barter_end_to_talk_to (line 3142) | void barter_end_to_talk_to()
function gdialog_barter_create_win (line 3153) | static int gdialog_barter_create_win()
function gdialog_barter_destroy_win (line 3247) | static void gdialog_barter_destroy_win()
function gdialog_barter_cleanup_tables (line 3290) | static void gdialog_barter_cleanup_tables()
function gdControlCreateWin (line 3323) | static int gdControlCreateWin()
function gdControlDestroyWin (line 3470) | static void gdControlDestroyWin()
function gdControlUpdateInfo (line 3514) | static void gdControlUpdateInfo()
function gdControlPressed (line 3610) | static void gdControlPressed(int btn, int keyCode)
function gdPickAIUpdateMsg (line 3620) | static int gdPickAIUpdateMsg(Object* critter)
function gdCanBarter (line 3640) | static int gdCanBarter()
function gdControl (line 3675) | static void gdControl()
function gdCustomCreateWin (line 3752) | static int gdCustomCreateWin()
function gdCustomDestroyWin (line 3874) | static void gdCustomDestroyWin()
function gdCustom (line 3920) | static void gdCustom()
function gdCustomUpdateInfo (line 3947) | static void gdCustomUpdateInfo()
function gdCustomSelectRedraw (line 4010) | static void gdCustomSelectRedraw(unsigned char* dest, int pitch, int typ...
function gdCustomSelect (line 4059) | static int gdCustomSelect(int a1)
function gdCustomUpdateSetting (line 4218) | static void gdCustomUpdateSetting(int option, int value)
function gdialog_barter_pressed (line 4243) | static void gdialog_barter_pressed(int btn, int keyCode)
function gdialog_window_create (line 4286) | static int gdialog_window_create()
function gdialog_window_destroy (line 4391) | static void gdialog_window_destroy()
function talk_to_create_background_window (line 4433) | static int talk_to_create_background_window()
function talk_to_refresh_background_window (line 4450) | static int talk_to_refresh_background_window()
function talkToRefreshDialogWindowRect (line 4473) | static int talkToRefreshDialogWindowRect(Rect* rect)
function talk_to_translucent_trans_buf_to_buf (line 4509) | static void talk_to_translucent_trans_buf_to_buf(unsigned char* src, int...
function gdDisplayFrame (line 4532) | static void gdDisplayFrame(Art* headFrm, int frame)
function gdBlendTableInit (line 4641) | static void gdBlendTableInit()
function gdBlendTableExit (line 4673) | static void gdBlendTableExit()
FILE: src/game/gmemory.c
function localmyfree (line 27) | void localmyfree(void* ptr)
function gmemory_init (line 41) | int gmemory_init()
function gfree (line 63) | void gfree(void* ptr)
FILE: src/game/gmouse.c
type ScrollableDirections (line 30) | typedef enum ScrollableDirections {
function gmouse_init (line 307) | int gmouse_init()
function gmouse_reset (line 326) | int gmouse_reset()
function gmouse_exit (line 350) | void gmouse_exit()
function gmouse_enable (line 374) | void gmouse_enable()
function gmouse_disable (line 386) | void gmouse_disable(int a1)
function gmouse_is_enabled (line 403) | int gmouse_is_enabled()
function gmouse_enable_scrolling (line 409) | void gmouse_enable_scrolling()
function gmouse_disable_scrolling (line 415) | void gmouse_disable_scrolling()
function gmouse_scrolling_is_enabled (line 423) | int gmouse_scrolling_is_enabled()
function gmouse_set_click_to_scroll (line 431) | void gmouse_set_click_to_scroll(int a1)
function gmouse_get_click_to_scroll (line 440) | int gmouse_get_click_to_scroll()
function gmouse_is_scrolling (line 446) | int gmouse_is_scrolling()
function gmouse_bk_process (line 484) | void gmouse_bk_process()
function gmouse_handle_event (line 887) | void gmouse_handle_event(int mouseX, int mouseY, int mouseState)
function gmouse_set_cursor (line 1245) | int gmouse_set_cursor(int cursor)
function gmouse_get_cursor (line 1315) | int gmouse_get_cursor()
function gmouse_set_mapper_mode (line 1323) | void gmouse_set_mapper_mode(int mode)
function gmouse_3d_enable_modes (line 1329) | void gmouse_3d_enable_modes()
function gmouse_3d_disable_modes (line 1337) | void gmouse_3d_disable_modes()
function gmouse_3d_modes_are_enabled (line 1345) | int gmouse_3d_modes_are_enabled()
function gmouse_3d_set_mode (line 1351) | void gmouse_3d_set_mode(int mode)
function gmouse_3d_get_mode (line 1423) | int gmouse_3d_get_mode()
function gmouse_3d_toggle_mode (line 1429) | void gmouse_3d_toggle_mode()
function gmouse_3d_refresh (line 1450) | void gmouse_3d_refresh()
function gmouse_3d_set_fid (line 1460) | int gmouse_3d_set_fid(int fid)
function gmouse_3d_get_fid (line 1511) | int gmouse_3d_get_fid()
function gmouse_3d_reset_fid (line 1521) | void gmouse_3d_reset_fid()
function gmouse_3d_on (line 1528) | void gmouse_3d_on()
function gmouse_3d_off (line 1592) | void gmouse_3d_off()
function gmouse_3d_is_on (line 1621) | bool gmouse_3d_is_on()
function Object (line 1627) | Object* object_under_mouse(int objectType, bool a2, int elevation)
function gmouse_3d_build_pick_frame (line 1668) | int gmouse_3d_build_pick_frame(int x, int y, int menuItem, int width, in...
function gmouse_3d_pick_frame_hot (line 1745) | int gmouse_3d_pick_frame_hot(int* a1, int* a2)
function gmouse_3d_build_menu_frame (line 1753) | int gmouse_3d_build_menu_frame(int x, int y, const int* menuItems, int m...
function gmouse_3d_menu_frame_hot (line 1866) | int gmouse_3d_menu_frame_hot(int* x, int* y)
function gmouse_3d_highlight_menu_frame (line 1874) | int gmouse_3d_highlight_menu_frame(int menuItemIndex)
function gmouse_3d_build_to_hit_frame (line 1909) | int gmouse_3d_build_to_hit_frame(const char* string, int color)
function gmouse_3d_build_hex_frame (line 1953) | int gmouse_3d_build_hex_frame(const char* string, int color)
function gmouse_3d_synch_item_highlight (line 1978) | void gmouse_3d_synch_item_highlight()
function gmouse_3d_init (line 1987) | static int gmouse_3d_init()
function gmouse_3d_reset (line 2044) | static int gmouse_3d_reset()
function gmouse_3d_exit (line 2071) | static void gmouse_3d_exit()
function gmouse_3d_lock_frames (line 2087) | static int gmouse_3d_lock_frames()
function gmouse_3d_unlock_frames (line 2164) | static void gmouse_3d_unlock_frames()
function gmouse_3d_set_flat_fid (line 2206) | static int gmouse_3d_set_flat_fid(int fid, Rect* rect)
function gmouse_3d_reset_flat_fid (line 2216) | static int gmouse_3d_reset_flat_fid(Rect* rect)
function gmouse_3d_move_to (line 2228) | static int gmouse_3d_move_to(int x, int y, int elevation, Rect* a4)
function gmouse_check_scrolling (line 2368) | static int gmouse_check_scrolling(int x, int y, int cursor)
function gmouse_remove_item_outline (line 2454) | void gmouse_remove_item_outline(Object* object)
function gmObjIsValidTarget (line 2466) | static int gmObjIsValidTarget(Object* object)
FILE: src/game/gmouse.h
type GameMouseMode (line 8) | typedef enum GameMouseMode {
type GameMouseActionMenuItem (line 25) | typedef enum GameMouseActionMenuItem {
type MouseCursorType (line 39) | typedef enum MouseCursorType {
FILE: src/game/gmovie.c
function gmovie_init (line 83) | int gmovie_init()
function gmovie_reset (line 103) | void gmovie_reset()
function gmovie_load (line 112) | int gmovie_load(File* stream)
function gmovie_save (line 122) | int gmovie_save(File* stream)
function gmovie_play (line 133) | int gmovie_play(int movie, int flags)
function gmPaletteFinish (line 306) | void gmPaletteFinish()
function gmovie_has_been_played (line 315) | bool gmovie_has_been_played(int movie)
function gmovieIsPlaying (line 321) | bool gmovieIsPlaying()
FILE: src/game/gmovie.h
type GameMovieFlags (line 8) | typedef enum GameMovieFlags {
type GameMovie (line 15) | typedef enum GameMovie {
FILE: src/game/graphlib.c
function HighRGB (line 41) | int HighRGB(int a1)
function CompLZS (line 63) | int CompLZS(unsigned char* a1, unsigned char* a2, int a3)
function InitTree (line 236) | static void InitTree()
function InsertNode (line 248) | static void InsertNode(int a1)
function DeleteNode (line 314) | static void DeleteNode(int a1)
function DecodeLZS (line 354) | int DecodeLZS(unsigned char* src, unsigned char* dest, int length)
function InitGreyTable (line 413) | void InitGreyTable(int a1, int a2)
function grey_buf (line 432) | void grey_buf(unsigned char* buffer, int width, int height, int pitch)
FILE: src/game/gsound.c
function gsound_init (line 169) | int gsound_init()
function gsound_reset (line 336) | void gsound_reset()
function gsound_exit (line 373) | int gsound_exit()
function gsound_sfx_enable (line 399) | void gsound_sfx_enable()
function gsound_sfx_disable (line 409) | void gsound_sfx_disable()
function gsound_sfx_is_enabled (line 417) | int gsound_sfx_is_enabled()
function gsound_set_master_volume (line 423) | int gsound_set_master_volume(int volume)
function gsound_get_master_volume (line 460) | int gsound_get_master_volume()
function gsound_set_sfx_volume (line 466) | int gsound_set_sfx_volume(int volume)
function gsound_get_sfx_volume (line 481) | int gsound_get_sfx_volume()
function gsound_background_disable (line 489) | void gsound_background_disable()
function gsound_background_enable (line 503) | void gsound_background_enable()
function gsound_background_is_enabled (line 515) | int gsound_background_is_enabled()
function gsound_background_volume_set (line 521) | void gsound_background_volume_set(int volume)
function gsound_background_volume_get (line 562) | int gsound_background_volume_get()
function gsound_background_volume_get_set (line 568) | int gsound_background_volume_get_set(int volume)
function gsound_background_fade_set (line 582) | void gsound_background_fade_set(int value)
function gsound_background_fade_get (line 590) | int gsound_background_fade_get()
function gsound_background_fade_get_set (line 598) | int gsound_background_fade_get_set(int value)
function gsound_background_callback_set (line 612) | void gsound_background_callback_set(SoundEndCallback* callback)
function SoundEndCallback (line 618) | SoundEndCallback* gsound_background_callback_get()
function SoundEndCallback (line 624) | SoundEndCallback* gsound_background_callback_get_set(SoundEndCallback* c...
function gsound_background_length_get (line 640) | int gsound_background_length_get()
function gsound_background_play (line 648) | int gsound_background_play(const char* fileName, int a2, int a3, int a4)
function gsound_background_play_level_music (line 798) | int gsound_background_play_level_music(const char* a1, int a2)
function gsound_background_play_preloaded (line 804) | int gsound_background_play_preloaded()
function gsound_background_stop (line 840) | void gsound_background_stop()
function gsound_background_restart_last (line 856) | void gsound_background_restart_last(int value)
function gsound_background_pause (line 867) | void gsound_background_pause()
function gsound_background_unpause (line 875) | void gsound_background_unpause()
function gsound_speech_disable (line 885) | void gsound_speech_disable()
function gsound_speech_enable (line 898) | void gsound_speech_enable()
function gsound_speech_is_enabled (line 908) | int gsound_speech_is_enabled()
function gsound_speech_volume_set (line 914) | void gsound_speech_volume_set(int volume)
function gsound_speech_volume_get (line 937) | int gsound_speech_volume_get()
function gsound_speech_volume_get_set (line 943) | int gsound_speech_volume_get_set(int volume)
function gsound_speech_callback_set (line 951) | void gsound_speech_callback_set(SoundEndCallback* callback)
function SoundEndCallback (line 957) | SoundEndCallback* gsound_speech_callback_get()
function SoundEndCallback (line 963) | SoundEndCallback* gsound_speech_callback_get_set(SoundEndCallback* callb...
function gsound_speech_length_get (line 977) | int gsound_speech_length_get()
function gsound_speech_play (line 983) | int gsound_speech_play(const char* fname, int a2, int a3, int a4)
function gsound_speech_play_preloaded (line 1091) | int gsound_speech_play_preloaded()
function gsound_speech_stop (line 1128) | void gsound_speech_stop()
function gsound_speech_pause (line 1139) | void gsound_speech_pause()
function gsound_speech_unpause (line 1147) | void gsound_speech_unpause()
function gsound_play_sfx_file_volume (line 1155) | int gsound_play_sfx_file_volume(const char* a1, int a2)
function Sound (line 1178) | Sound* gsound_load_sound(const char* name, Object* object)
function Sound (line 1295) | Sound* gsound_load_sound_volume(const char* name, Object* object, int vo...
function gsound_delete_sfx (line 1307) | void gsound_delete_sfx(Sound* sound)
function gsnd_anim_sound (line 1335) | int gsnd_anim_sound(Sound* sound, void* a2)
function gsound_play_sound (line 1355) | int gsound_play_sound(Sound* sound)
function gsound_compute_relative_volume (line 1378) | int gsound_compute_relative_volume(Object* obj)
function gsound_red_butt_press (line 1588) | void gsound_red_butt_press(int btn, int keyCode)
function gsound_red_butt_release (line 1594) | void gsound_red_butt_release(int btn, int keyCode)
function gsound_toggle_butt_press (line 1600) | void gsound_toggle_butt_press(int btn, int keyCode)
function gsound_toggle_butt_release (line 1608) | void gsound_toggle_butt_release(int btn, int keyCode)
function gsound_med_butt_press (line 1614) | void gsound_med_butt_press(int btn, int keyCode)
function gsound_med_butt_release (line 1620) | void gsound_med_butt_release(int btn, int keyCode)
function gsound_lrg_butt_press (line 1626) | void gsound_lrg_butt_press(int btn, int keyCode)
function gsound_lrg_butt_release (line 1632) | void gsound_lrg_butt_release(int btn, int keyCode)
function gsound_play_sfx_file (line 1638) | int gsound_play_sfx_file(const char* name)
function gsound_bkg_proc (line 1659) | static void gsound_bkg_proc()
function gsound_open (line 1665) | static int gsound_open(const char* fname, int flags, ...)
function gsound_compressed_tell (line 1680) | static long gsound_compressed_tell(int fileHandle)
function gsound_write (line 1686) | static int gsound_write(int fileHandle, const void* buf, unsigned int size)
function gsound_close (line 1692) | static int gsound_close(int fileHandle)
function gsound_read (line 1702) | static int gsound_read(int fileHandle, void* buffer, unsigned int size)
function gsound_seek (line 1712) | static long gsound_seek(int fileHandle, long offset, int origin)
function gsound_tell (line 1726) | static long gsound_tell(int handle)
function gsound_filesize (line 1736) | static long gsound_filesize(int handle)
function gsound_compressed_query (line 1746) | static bool gsound_compressed_query(char* filePath)
function gsound_internal_speech_callback (line 1752) | static void gsound_internal_speech_callback(void* userData, int a2)
function gsound_internal_background_callback (line 1764) | static void gsound_internal_background_callback(void* userData, int a2)
function gsound_internal_effect_callback (line 1776) | static void gsound_internal_effect_callback(void* userData, int a2)
function gsound_background_allocate (line 1784) | static int gsound_background_allocate(Sound** soundPtr, int a2, int a3)
function gsound_background_find_with_copy (line 1812) | static int gsound_background_find_with_copy(char* dest, const char* src)
function gsound_background_find_dont_copy (line 1911) | static int gsound_background_find_dont_copy(char* dest, const char* src)
function gsound_speech_find_dont_copy (line 1955) | static int gsound_speech_find_dont_copy(char* dest, const char* src)
function gsound_background_remove_last_copy (line 1992) | static void gsound_background_remove_last_copy()
function gsound_background_start (line 2008) | static int gsound_background_start()
function gsound_speech_start (line 2036) | static int gsound_speech_start()
function gsound_get_music_path (line 2056) | static int gsound_get_music_path(char** out_value, const char* key)
function Sound (line 2104) | static Sound* gsound_get_sound_ready_for_effect()
function gsound_file_exists_f (line 2164) | static bool gsound_file_exists_f(const char* fname)
function gsound_file_exists_db (line 2177) | static int gsound_file_exists_db(const char* path)
function gsound_setup_paths (line 2185) | static int gsound_setup_paths()
function gsound_sfx_q_start (line 2193) | int gsound_sfx_q_start()
function gsound_sfx_q_process (line 2199) | int gsound_sfx_q_process(Object* a1, void* data)
FILE: src/game/gsound.h
type WeaponSoundEffect (line 9) | typedef enum WeaponSoundEffect {
type SoundEffectActionType (line 18) | typedef enum SoundEffectActionType {
type ScenerySoundEffect (line 23) | typedef enum ScenerySoundEffect {
type CharacterSoundEffect (line 32) | typedef enum CharacterSoundEffect {
FILE: src/game/gz.c
function gzRealUncompressCopyReal_file (line 17) | int gzRealUncompressCopyReal_file(const char* existingFilePath, const ch...
function gzcompress_file (line 64) | int gzcompress_file(const char* existingFilePath, const char* newFilePath)
function gzdecompress_file (line 108) | int gzdecompress_file(const char* existingFilePath, const char* newFileP...
FILE: src/game/heap.c
type HeapBlockState (line 38) | typedef enum HeapBlockState {
type HeapBlockHeader (line 45) | typedef struct HeapBlockHeader {
type HeapBlockFooter (line 52) | typedef struct HeapBlockFooter {
type HeapMoveableExtent (line 56) | typedef struct HeapMoveableExtent {
function heap_init (line 146) | bool heap_init(Heap* heap, int a2)
function heap_exit (line 191) | bool heap_exit(Heap* heap)
function heap_allocate (line 222) | bool heap_allocate(Heap* heap, int* handleIndexPtr, int size, int a4)
function heap_deallocate (line 339) | bool heap_deallocate(Heap* heap, int* handleIndexPtr)
function heap_lock (line 408) | bool heap_lock(Heap* heap, int handleIndex, unsigned char** bufferPtr)
function heap_unlock (line 469) | bool heap_unlock(Heap* heap, int handleIndex)
function heap_validate (line 518) | bool heap_validate(Heap* heap)
function heap_stats (line 634) | bool heap_stats(Heap* heap, char* dest)
function heap_create_lists (line 668) | static bool heap_create_lists()
function heap_destroy_lists (line 709) | static void heap_destroy_lists()
function heap_init_handles (line 737) | static bool heap_init_handles(Heap* heap)
function heap_exit_handles (line 757) | static bool heap_exit_handles(Heap* heap)
function heap_acquire_handle (line 771) | static bool heap_acquire_handle(Heap* heap, int* handleIndexPtr)
function heap_release_handle (line 804) | static bool heap_release_handle(Heap* heap, int handleIndex)
function heap_clear_handles (line 815) | static bool heap_clear_handles(Heap* heap, HeapHandle* handles, unsigned...
function heap_find_free_block (line 828) | static bool heap_find_free_block(Heap* heap, int size, void** blockPtr, ...
function heap_build_free_list (line 1098) | static bool heap_build_free_list(Heap* heap)
function heap_sort_free_list (line 1161) | static bool heap_sort_free_list(Heap* heap)
function heap_qsort_compare_free (line 1171) | static int heap_qsort_compare_free(const void* a1, const void* a2)
function heap_build_moveable_list (line 1179) | static bool heap_build_moveable_list(Heap* heap, int* moveableExtentsLen...
function heap_sort_moveable_list (line 1265) | static bool heap_sort_moveable_list(Heap* heap, size_t count)
function heap_qsort_compare_moveable (line 1273) | static int heap_qsort_compare_moveable(const void* a1, const void* a2)
function heap_build_subblock_list (line 1283) | static bool heap_build_subblock_list(int extentIndex)
function heap_sort_subblock_list (line 1312) | static bool heap_sort_subblock_list(size_t count)
function heap_qsort_compare_subblock (line 1320) | static int heap_qsort_compare_subblock(const void* a1, const void* a2)
function heap_build_fake_move_list (line 1330) | static bool heap_build_fake_move_list(size_t count)
FILE: src/game/heap.h
type HeapHandle (line 6) | typedef struct HeapHandle {
type Heap (line 11) | typedef struct Heap {
FILE: src/game/intface.c
type InterfaceNumbersColor (line 53) | typedef enum InterfaceNumbersColor {
type Indicator (line 72) | typedef enum Indicator {
type IndicatorDescription (line 82) | typedef struct IndicatorDescription {
type InterfaceItemState (line 99) | typedef struct InterfaceItemState {
function intface_init (line 401) | int intface_init()
function intface_reset (line 702) | void intface_reset()
function intface_exit (line 718) | void intface_exit()
function intface_load (line 913) | int intface_load(File* stream)
function intface_save (line 971) | int intface_save(File* stream)
function intface_hide (line 988) | void intface_hide()
function intface_show (line 1000) | void intface_show()
function intface_is_hidden (line 1017) | int intface_is_hidden()
function intface_enable (line 1023) | void intface_enable()
function intface_disable (line 1046) | void intface_disable()
function intface_is_enabled (line 1066) | bool intface_is_enabled()
function intface_redraw (line 1072) | void intface_redraw()
function intface_update_hit_points (line 1087) | void intface_update_hit_points(bool animate)
function intface_update_ac (line 1175) | void intface_update_ac(bool animate)
function intface_update_move_points (line 1197) | void intface_update_move_points(int actionPointsLeft, int bonusActionPoi...
function intface_get_attack (line 1246) | int intface_get_attack(int* hitMode, bool* aiming)
function intface_update_items (line 1273) | int intface_update_items(bool animated, int leftItemAction, int rightIte...
function intface_toggle_items (line 1426) | int intface_toggle_items(bool animated)
function intface_get_item_states (line 1457) | int intface_get_item_states(int* leftItemAction, int* rightItemAction)
function intface_toggle_item_state (line 1465) | int intface_toggle_item_state()
function intface_use_item (line 1522) | void intface_use_item()
function intface_is_item_right_hand (line 1583) | int intface_is_item_right_hand()
function intface_get_current_item (line 1589) | int intface_get_current_item(Object** itemPtr)
function intface_update_ammo_lights (line 1601) | int intface_update_ammo_lights()
function intface_end_window_open (line 1635) | void intface_end_window_open(bool animated)
function intface_end_window_close (line 1687) | void intface_end_window_close(bool animated)
function intface_end_buttons_enable (line 1739) | void intface_end_buttons_enable()
function intface_end_buttons_disable (line 1762) | void intface_end_buttons_disable()
function intface_init_items (line 1787) | static int intface_init_items()
function intface_redraw_items (line 1798) | static int intface_redraw_items()
function intface_redraw_items_callback (line 2065) | static int intface_redraw_items_callback(Object* a1, Object* a2)
function intface_change_fid_callback (line 2072) | static int intface_change_fid_callback(Object* a1, Object* a2)
function intface_change_fid_animate (line 2079) | static void intface_change_fid_animate(int previousWeaponAnimationCode, ...
function intface_create_end_turn_button (line 2138) | static int intface_create_end_turn_button()
function intface_destroy_end_turn_button (line 2174) | static int intface_destroy_end_turn_button()
function intface_create_end_combat_button (line 2201) | static int intface_create_end_combat_button()
function intface_destroy_end_combat_button (line 2237) | static int intface_destroy_end_combat_button()
function intface_draw_ammo_lights (line 2264) | static void intface_draw_ammo_lights(int x, int ratio)
function intface_item_reload (line 2298) | static int intface_item_reload()
function intface_rotate_numbers (line 2329) | static void intface_rotate_numbers(int x, int y, int previousValue, int ...
function intface_fatal_error (line 2448) | static int intface_fatal_error(int rc)
function construct_box_bar_win (line 2456) | static int construct_box_bar_win()
function deconstruct_box_bar_win (line 2547) | static void deconstruct_box_bar_win()
function reset_box_bar_win (line 2566) | static void reset_box_bar_win()
function refresh_box_bar_win (line 2579) | int refresh_box_bar_win()
function bbox_comp (line 2650) | static int bbox_comp(const void* a, const void* b)
function draw_bboxes (line 2667) | static void draw_bboxes(int count)
function add_bar_box (line 2720) | static bool add_bar_box(int indicator)
function enable_box_bar_win (line 2735) | bool enable_box_bar_win()
function disable_box_bar_win (line 2746) | bool disable_box_bar_win()
FILE: src/game/intface.h
type Hand (line 12) | typedef enum Hand {
type InterfaceItemAction (line 20) | typedef enum InterfaceItemAction {
FILE: src/game/inventry.c
type InventoryArrowFrm (line 180) | typedef enum InventoryArrowFrm {
type InventoryWindowDescription (line 188) | typedef struct InventoryWindowConfiguration {
type InventoryCursorData (line 196) | typedef struct InventoryCursorData {
function inven_set_dude (line 367) | void inven_set_dude(Object* obj, int pid)
function inven_reset_dude (line 374) | void inven_reset_dude()
function inventry_msg_load (line 381) | static int inventry_msg_load()
function inventry_msg_unload (line 396) | static int inventry_msg_unload()
function handle_inventory (line 403) | void handle_inventory()
function setup_inventory (line 557) | bool setup_inventory(int inventoryWindowType)
function exit_inventory (line 993) | void exit_inventory(bool shouldEnableIso)
function display_inventory (line 1073) | void display_inventory(int a1, int a2, int inventoryWindowType)
function display_target_inventory (line 1229) | void display_target_inventory(int a1, int a2, Inventory* inventory, int ...
function display_inventory_info (line 1300) | static void display_inventory_info(Object* item, int quantity, unsigned ...
function display_body (line 1351) | void display_body(int fid, int inventoryWindowType)
function inven_init (line 1500) | int inven_init()
function inven_exit (line 1565) | void inven_exit()
function inven_set_mouse (line 1582) | void inven_set_mouse(int cursor)
function inven_hover_on (line 1595) | void inven_hover_on(int btn, int keyCode)
function inven_hover_off (line 1631) | void inven_hover_off(int btn, int keyCode)
function inven_update_lighting (line 1642) | static void inven_update_lighting(Object* a1)
function inven_pickup (line 1659) | void inven_pickup(int keyCode, int a2)
function switch_hand (line 1870) | void switch_hand(Object* a1, Object** a2, Object** a3, int a4)
function adjust_ac (line 1924) | void adjust_ac(Object* critter, Object* oldArmor, Object* newArmor)
function adjust_fid (line 1962) | void adjust_fid()
function use_inventory_on (line 2013) | void use_inventory_on(Object* a1)
function Object (line 2125) | Object* inven_right_hand(Object* critter)
function Object (line 2147) | Object* inven_left_hand(Object* critter)
function Object (line 2169) | Object* inven_worn(Object* critter)
function Object (line 2191) | Object* inven_pid_is_carried(Object* obj, int pid)
function inven_pid_quantity_carried (line 2211) | int inven_pid_quantity_carried(Object* object, int pid)
function display_stats (line 2232) | void display_stats()
function Object (line 2482) | Object* inven_find_type(Object* obj, int itemType, int* indexPtr)
function Object (line 2510) | Object* inven_find_id(Object* obj, int id)
function Object (line 2536) | Object* inven_index_ptr(Object* obj, int a2)
function inven_wield (line 2551) | int inven_wield(Object* a1, Object* a2, int a3)
function invenWieldFunc (line 2557) | int invenWieldFunc(Object* critter, Object* item, int a3, bool a4)
function inven_unwield (line 2699) | int inven_unwield(Object* critter_obj, int a2)
function invenUnwieldFunc (line 2705) | int invenUnwieldFunc(Object* obj, int a2, int a3)
function inven_from_button (line 2750) | int inven_from_button(int keyCode, Object** a2, Object*** a3, Object** a4)
function inven_display_msg (line 2846) | void inven_display_msg(char* string)
function inven_obj_examine_func (line 2933) | void inven_obj_examine_func(Object* critter, Object* item)
function inven_action_cursor (line 2997) | void inven_action_cursor(int keyCode, int inventoryWindowType)
function loot_container (line 3366) | int loot_container(Object* a1, Object* a2)
function inven_steal_container (line 3774) | int inven_steal_container(Object* a1, Object* a2)
function move_inventory (line 3794) | int move_inventory(Object* a1, int a2, Object* a3, bool a4)
function barter_compute_value (line 3935) | static int barter_compute_value(Object* a1, Object* a2)
function barter_attempt_transaction (line 3968) | static int barter_attempt_transaction(Object* a1, Object* a2, Object* a3...
function barter_move_inventory (line 4027) | static void barter_move_inventory(Object* a1, int quantity, int a3, int ...
function barter_move_from_table_inventory (line 4110) | static void barter_move_from_table_inventory(Object* a1, int quantity, i...
function display_table_inventories (line 4193) | static void display_table_inventories(int win, Object* a2, Object* a3, i...
function barter_inventory (line 4283) | void barter_inventory(int win, Object* a2, Object* a3, Object* a4, int a5)
function container_enter (line 4543) | void container_enter(int keyCode, int inventoryWindowType)
function container_exit (line 4585) | void container_exit(int keyCode, int inventoryWindowType)
function drop_into_container (line 4609) | int drop_into_container(Object* a1, Object* a2, int a3, Object** a4, int...
function drop_ammo_into_weapon (line 4646) | int drop_ammo_into_weapon(Object* weapon, Object* ammo, Object** a3, int...
function draw_amount (line 4711) | void draw_amount(int value, int inventoryWindowType)
function do_move_timer (line 4763) | static int do_move_timer(int inventoryWindowType, Object* item, int max)
function setup_move_timer_win (line 4905) | static int setup_move_timer_win(int inventoryWindowType, Object* item)
function exit_move_timer_win (line 5054) | static int exit_move_timer_win(int inventoryWindowType)
function inven_set_timer (line 5068) | int inven_set_timer(Object* a1)
FILE: src/game/inventry.h
type InventoryWindowCursor (line 12) | typedef enum InventoryWindowCursor {
type InventoryWindowType (line 21) | typedef enum InventoryWindowType {
FILE: src/game/item.c
function item_init (line 120) | int item_init()
function item_reset (line 137) | void item_reset()
function item_exit (line 143) | void item_exit()
function item_load (line 149) | int item_load(File* stream)
function item_save (line 155) | int item_save(File* stream)
function item_add_mult (line 161) | int item_add_mult(Object* owner, Object* itemToAdd, int quantity)
function item_add_force (line 223) | int item_add_force(Object* owner, Object* itemToAdd, int quantity)
function item_remove_mult (line 300) | int item_remove_mult(Object* owner, Object* itemToRemove, int quantity)
function item_compact (line 366) | static void item_compact(int inventoryItemIndex, Inventory* inventory)
function item_move_func (line 378) | static int item_move_func(Object* a1, Object* a2, Object* a3, int quanti...
function item_move (line 413) | int item_move(Object* a1, Object* a2, Object* a3, int quantity)
function item_move_force (line 419) | int item_move_force(Object* a1, Object* a2, Object* a3, int quantity)
function item_move_all (line 425) | void item_move_all(Object* a1, Object* a2)
function item_move_all_hidden (line 435) | int item_move_all_hidden(Object* a1, Object* a2)
function item_destroy_all_hidden (line 466) | int item_destroy_all_hidden(Object* a1)
function item_drop_all (line 499) | int item_drop_all(Object* critter, int tile)
function item_identical (line 565) | static bool item_identical(Object* a1, Object* a2)
function item_get_type (line 634) | int item_get_type(Object* item)
function item_material (line 657) | int item_material(Object* item)
function item_size (line 666) | int item_size(Object* item)
function item_weight (line 679) | int item_weight(Object* item)
function item_cost (line 735) | int item_cost(Object* obj)
function item_total_cost (line 786) | int item_total_cost(Object* obj)
function item_total_weight (line 841) | int item_total_weight(Object* obj)
function item_grey (line 883) | bool item_grey(Object* weapon)
function item_inv_fid (line 910) | int item_inv_fid(Object* item)
function Object (line 924) | Object* item_hit_with(Object* critter, int hitMode)
function item_mp_cost (line 941) | int item_mp_cost(Object* obj, int hitMode, bool aiming)
function item_count (line 959) | int item_count(Object* obj, Object* a2)
function item_queued (line 985) | int item_queued(Object* obj)
function Object (line 1013) | Object* item_replace(Object* a1, Object* a2, int a3)
function item_is_hidden (line 1057) | int item_is_hidden(Object* obj)
function item_w_subtype (line 1073) | int item_w_subtype(Object* weapon, int hitMode)
function item_w_skill (line 1093) | int item_w_skill(Object* weapon, int hitMode)
function item_w_skill_level (line 1128) | int item_w_skill_level(Object* critter, int hitMode)
function item_w_damage_min_max (line 1148) | int item_w_damage_min_max(Object* weapon, int* minDamagePtr, int* maxDam...
function item_w_damage (line 1169) | int item_w_damage(Object* critter, int hitMode)
function item_w_damage_type (line 1230) | int item_w_damage_type(Object* critter, Object* weapon)
function item_w_is_2handed (line 1248) | int item_w_is_2handed(Object* weapon)
function item_w_anim (line 1262) | int item_w_anim(Object* critter, int hitMode)
function item_w_anim_weap (line 1270) | int item_w_anim_weap(Object* weapon, int hitMode)
function item_w_max_ammo (line 1294) | int item_w_max_ammo(Object* ammoOrWeapon)
function item_w_curr_ammo (line 1311) | int item_w_curr_ammo(Object* ammoOrWeapon)
function item_w_caliber (line 1331) | int item_w_caliber(Object* ammoOrWeapon)
function item_w_set_curr_ammo (line 1351) | void item_w_set_curr_ammo(Object* ammoOrWeapon, int quantity)
function item_w_try_reload (line 1374) | int item_w_try_reload(Object* critter, Object* weapon)
function item_w_can_reload (line 1439) | bool item_w_can_reload(Object* weapon, Object* ammo)
function item_w_reload (line 1489) | int item_w_reload(Object* weapon, Object* ammo)
function item_w_range (line 1530) | int item_w_range(Object* critter, int hitMode)
function item_w_mp_cost (line 1573) | int item_w_mp_cost(Object* critter, int hitMode, bool aiming)
function item_w_min_st (line 1666) | int item_w_min_st(Object* weapon)
function item_w_crit_fail (line 1679) | int item_w_crit_fail(Object* weapon)
function item_w_perk (line 1692) | int item_w_perk(Object* weapon)
function item_w_rounds (line 1705) | int item_w_rounds(Object* weapon)
function item_w_anim_code (line 1718) | int item_w_anim_code(Object* weapon)
function item_w_proj_pid (line 1731) | int item_w_proj_pid(Object* weapon)
function item_w_ammo_pid (line 1744) | int item_w_ammo_pid(Object* weapon)
function item_w_sound_id (line 1758) | char item_w_sound_id(Object* weapon)
function item_w_called_shot (line 1771) | int item_w_called_shot(Object* critter, int hitMode)
function item_w_can_unload (line 1794) | int item_w_can_unload(Object* weapon)
function Object (line 1828) | Object* item_w_unload(Object* weapon)
function item_w_primary_mp_cost (line 1867) | int item_w_primary_mp_cost(Object* weapon)
function item_w_secondary_mp_cost (line 1882) | int item_w_secondary_mp_cost(Object* weapon)
function item_w_compute_ammo_cost (line 1895) | int item_w_compute_ammo_cost(Object* obj, int* inout_a2)
function item_w_is_grenade (line 1916) | bool item_w_is_grenade(Object* weapon)
function item_w_area_damage_radius (line 1923) | int item_w_area_damage_radius(Object* weapon, int hitMode)
function item_w_grenade_dmg_radius (line 1946) | int item_w_grenade_dmg_radius(Object* weapon)
function item_w_rocket_dmg_radius (line 1952) | int item_w_rocket_dmg_radius(Object* weapon)
function item_w_ac_adjust (line 1958) | int item_w_ac_adjust(Object* weapon)
function item_w_dr_adjust (line 1975) | int item_w_dr_adjust(Object* weapon)
function item_w_dam_mult (line 1992) | int item_w_dam_mult(Object* weapon)
function item_w_dam_div (line 2009) | int item_w_dam_div(Object* weapon)
function item_ar_ac (line 2026) | int item_ar_ac(Object* armor)
function item_ar_dr (line 2039) | int item_ar_dr(Object* armor, int damageType)
function item_ar_dt (line 2052) | int item_ar_dt(Object* armor, int damageType)
function item_ar_perk (line 2065) | int item_ar_perk(Object* armor)
function item_ar_male_fid (line 2078) | int item_ar_male_fid(Object* armor)
function item_ar_female_fid (line 2091) | int item_ar_female_fid(Object* armor)
function item_m_max_charges (line 2104) | int item_m_max_charges(Object* miscItem)
function item_m_curr_charges (line 2117) | int item_m_curr_charges(Object* miscItem)
function item_m_set_charges (line 2127) | int item_m_set_charges(Object* miscItem, int charges)
function item_m_cell (line 2144) | int item_m_cell(Object* miscItem)
function item_m_cell_pid (line 2159) | int item_m_cell_pid(Object* miscItem)
function item_m_uses_charges (line 2172) | bool item_m_uses_charges(Object* miscItem)
function item_m_use_charged_item (line 2185) | int item_m_use_charged_item(Object* critter, Object* miscItem)
function item_m_dec_charges (line 2221) | int item_m_dec_charges(Object* item)
function item_m_trickle (line 2236) | int item_m_trickle(Object* item, void* data)
function item_m_on (line 2268) | bool item_m_on(Object* obj)
function item_m_turn_on (line 2284) | int item_m_turn_on(Object* item)
function item_m_turn_off (line 2353) | int item_m_turn_off(Object* item)
function item_m_turn_off_from_queue (line 2389) | int item_m_turn_off_from_queue(Object* obj, void* data)
function item_m_stealth_effect_on (line 2398) | static int item_m_stealth_effect_on(Object* object)
function item_m_stealth_effect_off (line 2414) | static int item_m_stealth_effect_off(Object* critter, Object* item)
function item_c_max_size (line 2440) | int item_c_max_size(Object* container)
function item_c_curr_size (line 2453) | int item_c_curr_size(Object* container)
function item_a_ac_adjust (line 2473) | int item_a_ac_adjust(Object* armor)
function item_a_dr_adjust (line 2488) | int item_a_dr_adjust(Object* armor)
function item_a_dam_mult (line 2503) | int item_a_dam_mult(Object* armor)
function item_a_dam_div (line 2518) | int item_a_dam_div(Object* armor)
function insert_drug_effect (line 2533) | static int insert_drug_effect(Object* critter, Object* item, int a3, int...
function perform_drug_effect (line 2574) | static void perform_drug_effect(Object* critter, int* stats, int* mods, ...
function drug_effect_allowed (line 2678) | static bool drug_effect_allowed(Object* critter, int pid)
function item_d_take_drug (line 2714) | int item_d_take_drug(Object* critter, Object* item)
function item_d_clear (line 2789) | int item_d_clear(Object* obj, void* data)
function item_d_process (line 2801) | int item_d_process(Object* obj, void* data)
function item_d_load (line 2823) | int item_d_load(File* stream, void** dataPtr)
function item_d_save (line 2843) | int item_d_save(File* stream, void* data)
function insert_withdrawal (line 2854) | static int insert_withdrawal(Object* obj, int a2, int duration, int perk...
function item_wd_clear (line 2874) | int item_wd_clear(Object* obj, void* data)
function item_wd_clear_all (line 2890) | static int item_wd_clear_all(Object* a1, void* data)
function item_wd_process (line 2914) | int item_wd_process(Object* obj, void* data)
function item_wd_load (line 2941) | int item_wd_load(File* stream, void** dataPtr)
function item_wd_save (line 2962) | int item_wd_save(File* stream, void* data)
function perform_withdrawal_start (line 2974) | static void perform_withdrawal_start(Object* obj, int perk, int pid)
function perform_withdrawal_end (line 3003) | static void perform_withdrawal_end(Object* obj, int perk)
function pid_to_gvar (line 3022) | static int pid_to_gvar(int drugPid)
function item_d_set_addict (line 3037) | void item_d_set_addict(int drugPid)
function item_d_unset_addict (line 3050) | void item_d_unset_addict(int drugPid)
function item_d_check_addict (line 3066) | bool item_d_check_addict(int drugPid)
function item_caps_total (line 3084) | int item_caps_total(Object* obj)
function item_caps_adjust (line 3108) | int item_caps_adjust(Object* obj, int amount)
function item_caps_get_amount (line 3179) | int item_caps_get_amount(Object* item)
function item_caps_set_amount (line 3189) | int item_caps_set_amount(Object* item, int amount)
FILE: src/game/item.h
type AttackType (line 11) | typedef enum AttackType {
type DrugDescription (line 20) | typedef struct DrugDescription {
FILE: src/game/light.c
function light_init (line 17) | int light_init()
function light_reset (line 24) | void light_reset()
function light_exit (line 30) | void light_exit()
function light_get_ambient (line 36) | int light_get_ambient()
function light_set_ambient (line 42) | void light_set_ambient(int lightLevel, bool shouldUpdateScreen)
function light_increase_ambient (line 68) | void light_increase_ambient(int value, bool shouldUpdateScreen)
function light_decrease_ambient (line 74) | void light_decrease_ambient(int value, bool shouldUpdateScreen)
function light_get_tile (line 80) | int light_get_tile(int elevation, int tile)
function light_get_tile_true (line 101) | int light_get_tile_true(int elevation, int tile)
function light_set_tile (line 115) | void light_set_tile(int elevation, int tile, int lightIntensity)
function light_add_to_tile (line 129) | void light_add_to_tile(int elevation, int tile, int lightIntensity)
function light_subtract_from_tile (line 143) | void light_subtract_from_tile(int elevation, int tile, int lightIntensity)
function light_reset_tiles (line 157) | void light_reset_tiles()
FILE: src/game/lip_sync.c
function lips_bkg_proc (line 77) | void lips_bkg_proc()
function lips_play_speech (line 144) | int lips_play_speech()
function lips_stop_speech (line 185) | static int lips_stop_speech()
function lips_read_phoneme_type (line 196) | static int lips_read_phoneme_type(unsigned char* phoneme_type, File* str...
function lips_read_marker_type (line 204) | static int lips_read_marker_type(SpeechMarker* marker_type, File* stream)
function lips_read_lipsynch_info (line 220) | static int lips_read_lipsynch_info(LipsData* lipsData, File* stream)
function lips_load_file (line 264) | int lips_load_file(const char* audioFileName, const char* headFileName)
function lips_make_speech (line 425) | static int lips_make_speech()
function lips_free_speech (line 467) | int lips_free_speech()
FILE: src/game/lip_sync.h
type LipsFlags (line 12) | typedef enum LipsFlags {
type SpeechMarker (line 17) | typedef struct SpeechMarker {
type LipsData (line 22) | typedef struct LipsData {
FILE: src/game/loadsave.c
type LoadSaveWindowType (line 69) | typedef enum LoadSaveWindowType {
type LoadSaveSlotState (line 77) | typedef enum LoadSaveSlotState {
type LoadSaveScrollDirection (line 84) | typedef enum LoadSaveScrollDirection {
type LoadSaveSlotData (line 90) | typedef struct LoadSaveSlotData {
type LoadSaveFrm (line 113) | typedef enum LoadSaveFrm {
function InitLoadSave (line 314) | void InitLoadSave()
function ResetLoadSave (line 330) | void ResetLoadSave()
function SaveGame (line 339) | int SaveGame(int mode)
function QuickSnapShot (line 794) | static int QuickSnapShot()
function LoadGame (line 824) | int LoadGame(int mode)
function LSGameStart (line 1213) | static int LSGameStart(int windowType)
function LSGameEnd (line 1432) | static int LSGameEnd(int windowType)
function SaveSlot (line 1457) | static int SaveSlot()
function isLoadingGame (line 1552) | int isLoadingGame()
function LoadSlot (line 1558) | static int LoadSlot(int slot)
function SaveHeader (line 1629) | static int SaveHeader(int slot)
function LoadHeader (line 1739) | static int LoadHeader(int slot)
function GetSlotList (line 1831) | static int GetSlotList()
function ShowSlotList (line 1867) | static void ShowSlotList(int a1)
function DrawInfoBox (line 1909) | static void DrawInfoBox(int a1)
function LoadTumbSlot (line 1978) | static int LoadTumbSlot(int a1)
function GetComment (line 2013) | static int GetComment(int a1)
function get_input_str2 (line 2130) | static int get_input_str2(int win, int doneKeyCode, int cancelKeyCode, c...
function DummyFunc (line 2227) | static int DummyFunc(File* stream)
function PrepLoad (line 2233) | static int PrepLoad(File* stream)
function EndLoad (line 2243) | static int EndLoad(File* stream)
function GameMap2Slot (line 2257) | static int GameMap2Slot(File* stream)
function SlotMap2Game (line 2368) | static int SlotMap2Game(File* stream)
function mygets (line 2464) | static int mygets(char* dest, File* stream)
function copy_file (line 2491) | static int copy_file(const char* a1, const char* a2)
function KillOldMaps (line 2564) | void KillOldMaps()
function MapDirErase (line 2572) | int MapDirErase(const char* relativePath, const char* extension)
function MapDirEraseFile (line 2589) | int MapDirEraseFile(const char* a1, const char* a2)
function SaveBackup (line 2602) | static int SaveBackup()
function RestoreSave (line 2673) | static int RestoreSave()
function LoadObjDudeCid (line 2743) | static int LoadObjDudeCid(File* stream)
function SaveObjDudeCid (line 2757) | static int SaveObjDudeCid(File* stream)
function EraseSave (line 2763) | static int EraseSave()
FILE: src/game/loadsave.h
type LoadSaveMode (line 14) | typedef enum LoadSaveMode {
FILE: src/game/main.c
function RealMain (line 88) | int RealMain(int argc, char** argv)
function main_init_system (line 230) | static bool main_init_system(int argc, char** argv)
function main_reset_system (line 245) | static int main_reset_system()
function main_exit_system (line 255) | static void main_exit_system()
function main_load_new (line 266) | static int main_load_new(char* mapFileName)
function main_loadgame_new (line 294) | static int main_loadgame_new()
function main_unload_new (line 313) | static void main_unload_new()
function main_game_loop (line 320) | static void main_game_loop()
function main_selfrun_init (line 360) | static bool main_selfrun_init()
function main_selfrun_exit (line 377) | static void main_selfrun_exit()
function main_selfrun_record (line 389) | static void main_selfrun_record()
function main_selfrun_play (line 441) | static void main_selfrun_play()
function main_death_scene (line 491) | static void main_death_scene()
function main_death_voiceover_callback (line 609) | static void main_death_voiceover_callback()
function mainDeathGrabTextFile (line 617) | static int mainDeathGrabTextFile(const char* fileName, char* dest)
function mainDeathWordWrap (line 659) | static int mainDeathWordWrap(char* text, int width, short* beginnings, s...
FILE: src/game/mainmenu.c
type MainMenuButton (line 23) | typedef enum MainMenuButton {
function main_menu_create (line 96) | int main_menu_create()
function main_menu_destroy (line 198) | void main_menu_destroy()
function main_menu_hide (line 231) | void main_menu_hide(bool animate)
function main_menu_show (line 254) | void main_menu_show(bool animate)
function main_menu_is_shown (line 277) | int main_menu_is_shown()
function main_menu_is_enabled (line 283) | int main_menu_is_enabled()
function main_menu_set_timeout (line 291) | void main_menu_set_timeout(unsigned int timeout)
function main_menu_get_timeout (line 299) | unsigned int main_menu_get_timeout()
function main_menu_loop (line 305) | int main_menu_loop()
function main_menu_fatal_error (line 382) | static int main_menu_fatal_error()
function main_menu_play_sound (line 392) | static void main_menu_play_sound(const char* fileName)
FILE: src/game/mainmenu.h
type MainMenuOption (line 6) | typedef enum MainMenuOption {
FILE: src/game/map.c
function iso_init (line 145) | int iso_init()
function iso_reset (line 214) | void iso_reset()
function iso_exit (line 239) | void iso_exit()
function map_init (line 261) | void map_init()
function map_reset (line 287) | void map_reset()
function map_exit (line 296) | void map_exit()
function map_enable_bk_processes (line 307) | void map_enable_bk_processes()
function map_disable_bk_processes (line 322) | bool map_disable_bk_processes()
function map_bk_processes_are_disabled (line 340) | bool map_bk_processes_are_disabled()
function map_set_elevation (line 347) | int map_set_elevation(int elevation)
function map_is_elevation_empty (line 384) | bool map_is_elevation_empty(int elevation)
function map_set_global_var (line 392) | int map_set_global_var(int var, int value)
function map_get_global_var (line 405) | int map_get_global_var(int var)
function map_set_local_var (line 416) | int map_set_local_var(int var, int value)
function map_get_local_var (line 429) | int map_get_local_var(int var)
function map_malloc_local_var (line 442) | int map_malloc_local_var(int a1)
function map_set_entrance_hex (line 459) | void map_set_entrance_hex(int tile, int elevation, int rotation)
function map_set_name (line 469) | void map_set_name(const char* name)
function map_get_name (line 477) | void map_get_name(char* name)
function is_map_idx_same (line 500) | bool is_map_idx_same(int map1, int map2)
function get_map_idx_same (line 532) | int get_map_idx_same(int map1, int map2)
function map_get_index_number (line 592) | int map_get_index_number()
function map_scroll (line 598) | int map_scroll(int dx, int dy)
function mapSetEntranceInfo (line 713) | int mapSetEntranceInfo(int elevation, int tile_num, int orientation)
function map_new_map (line 722) | void map_new_map()
function map_load (line 754) | int map_load(char* fileName)
function map_load_idx (line 797) | int map_load_idx(int map)
function map_load_file (line 816) | int map_load_file(File* stream)
function map_load_in_game (line 1050) | int map_load_in_game(char* fileName)
function map_age_dead_critters (line 1087) | int map_age_dead_critters()
function map_target_load_area (line 1199) | int map_target_load_area()
function map_leave_map (line 1209) | int map_leave_map(MapTransition* transition)
function map_check_state (line 1229) | int map_check_state()
function map_fix_critter_combat_data (line 1283) | void map_fix_critter_combat_data()
function map_save (line 1301) | int map_save()
function map_save_file (line 1339) | int map_save_file(File* stream)
function map_save_in_game (line 1422) | int map_save_in_game(bool a1)
function map_setup_paths (line 1484) | void map_setup_paths()
function map_display_draw (line 1502) | static void map_display_draw(Rect* rect)
function map_scroll_refresh_game (line 1508) | static void map_scroll_refresh_game(Rect* rect)
function map_scroll_refresh_mapper (line 1523) | static void map_scroll_refresh_mapper(Rect* rect)
function map_allocate_global_vars (line 1545) | static int map_allocate_global_vars(int count)
function map_free_global_vars (line 1562) | static void map_free_global_vars()
function map_load_global_vars (line 1574) | static int map_load_global_vars(File* stream)
function map_allocate_local_vars (line 1586) | static int map_allocate_local_vars(int count)
function map_free_local_vars (line 1603) | static void map_free_local_vars()
function map_load_local_vars (line 1615) | static int map_load_local_vars(File* stream)
function map_place_dude_and_mouse (line 1625) | static void map_place_dude_and_mouse()
function square_init (line 1654) | static void square_init()
function square_reset (line 1664) | static void square_reset()
function square_load (line 1691) | static int square_load(File* stream, int flags)
function map_write_MapData (line 1726) | static int map_write_MapData(MapHeader* ptr, File* stream)
function map_read_MapData (line 1746) | static int map_read_MapData(MapHeader* ptr, File* stream)
FILE: src/game/map.h
type TileData (line 16) | typedef struct TileData {
type MapHeader (line 20) | typedef struct MapHeader {
type MapTransition (line 59) | typedef struct MapTransition {
FILE: src/game/map_defs.h
function elevationIsValid (line 16) | static inline bool elevationIsValid(int elevation)
function squareGridTileIsValid (line 21) | static inline bool squareGridTileIsValid(int tile)
function hexGridTileIsValid (line 26) | static inline bool hexGridTileIsValid(int tile)
FILE: src/game/message.c
function init_message (line 36) | int init_message()
function exit_message (line 104) | void exit_message()
function message_init (line 120) | bool message_init(MessageList* messageList)
function message_exit (line 130) | bool message_exit(MessageList* messageList)
function message_load (line 163) | bool message_load(MessageList* messageList, const char* path)
function message_search (line 243) | bool message_search(MessageList* msg, MessageListItem* entry)
function message_make_path (line 275) | bool message_make_path(char* dest, const char* path)
function message_find (line 297) | bool message_find(MessageList* msg, int num, int* out_index)
function message_add (line 335) | bool message_add(MessageList* msg, MessageListItem* new_entry)
function message_parse_number (line 396) | bool message_parse_number(int* out_num, const char* str)
function message_load_field (line 433) | int message_load_field(File* file, char* str)
function message_filter (line 500) | bool message_filter(MessageList* messageList)
FILE: src/game/message.h
type MessageListItem (line 12) | typedef struct MessageListItem {
type MessageList (line 19) | typedef struct MessageList {
FILE: src/game/moviefx.c
type MovieEffectFadeType (line 14) | typedef enum MovieEffectType {
type MovieEffect (line 20) | typedef struct MovieEffect {
function moviefx_init (line 52) | int moviefx_init()
function moviefx_reset (line 66) | void moviefx_reset()
function moviefx_exit (line 82) | void moviefx_exit()
function moviefx_start (line 98) | int moviefx_start(const char* filePath)
function moviefx_stop (line 227) | void moviefx_stop()
function moviefx_callback_func (line 243) | static void moviefx_callback_func(int frame)
function moviefx_palette_func (line 278) | static void moviefx_palette_func(unsigned char* palette, int start, int ...
function moviefx_add (line 290) | static void moviefx_add(MovieEffect* movie_effect)
function moviefx_remove_all (line 297) | static void moviefx_remove_all()
FILE: src/game/object.c
function obj_init (line 264) | int obj_init(unsigned char* buf, int width, int height, int pitch)
function obj_reset (line 355) | void obj_reset()
function obj_exit (line 366) | void obj_exit()
function obj_read_obj (line 391) | static int obj_read_obj(Object* obj, File* stream)
function obj_load (line 437) | int obj_load(File* stream)
function obj_load_func (line 447) | static int obj_load_func(File* stream)
function obj_fix_combat_cid_for_dude (line 577) | static void obj_fix_combat_cid_for_dude()
function object_fix_weapon_ammo (line 602) | static void object_fix_weapon_ammo(Object* obj)
function obj_write_obj (line 646) | static int obj_write_obj(Object* obj, File* stream)
function obj_save (line 672) | int obj_save(File* stream)
function obj_render_pre_roof (line 762) | void obj_render_pre_roof(Rect* rect, int elevation)
function obj_render_post_roof (line 873) | void obj_render_post_roof(Rect* rect, int elevation)
function obj_new (line 901) | int obj_new(Object** objectPtr, int fid, int pid)
function obj_pid_new (line 992) | int obj_pid_new(Object** objectPtr, int pid)
function obj_copy (line 1006) | int obj_copy(Object** a1, Object* a2)
function obj_connect (line 1079) | int obj_connect(Object* object, int tile, int elevation, Rect* rect)
function obj_disconnect (line 1106) | int obj_disconnect(Object* obj, Rect* rect)
function obj_offset (line 1145) | int obj_offset(Object* obj, int x, int y, Rect* rect)
function obj_move (line 1263) | int obj_move(Object* a1, int a2, int a3, int elevation, Rect* a5)
function obj_move_to_tile (line 1365) | int obj_move_to_tile(Object* obj, int tile, int elevation, Rect* rect)
function obj_reset_roof (line 1509) | int obj_reset_roof()
function obj_change_fid (line 1521) | int obj_change_fid(Object* obj, int fid, Rect* dirtyRect)
function obj_set_frame (line 1546) | int obj_set_frame(Object* obj, int frame, Rect* rect)
function obj_inc_frame (line 1583) | int obj_inc_frame(Object* obj, Rect* dirtyRect)
function obj_dec_frame (line 1626) | int obj_dec_frame(Object* obj, Rect* dirtyRect)
function obj_set_rotation (line 1665) | int obj_set_rotation(Object* obj, int direction, Rect* dirtyRect)
function obj_inc_rotation (line 1690) | int obj_inc_rotation(Object* obj, Rect* dirtyRect)
function obj_dec_rotation (line 1701) | int obj_dec_rotation(Object* obj, Rect* dirtyRect)
function obj_rebuild_all_light (line 1712) | void obj_rebuild_all_light()
function obj_set_light (line 1726) | int obj_set_light(Object* obj, int lightDistance, int lightIntensity, Re...
function obj_get_visible_light (line 1759) | int obj_get_visible_light(Object* obj)
function obj_turn_on_light (line 1780) | int obj_turn_on_light(Object* obj, Rect* rect)
function obj_turn_off_light (line 1805) | int obj_turn_off_light(Object* obj, Rect* rect)
function obj_turn_on (line 1830) | int obj_turn_on(Object* obj, Rect* rect)
function obj_turn_off (line 1861) | int obj_turn_off(Object* object, Rect* rect)
function obj_turn_on_outline (line 1895) | int obj_turn_on_outline(Object* object, Rect* rect)
function obj_turn_off_outline (line 1911) | int obj_turn_off_outline(Object* object, Rect* rect)
function obj_toggle_flat (line 1929) | int obj_toggle_flat(Object* object, Rect* rect)
function obj_erase_object (line 1983) | int obj_erase_object(Object* object, Rect* rect)
function obj_inven_free (line 2022) | int obj_inven_free(Inventory* inventory)
function obj_action_can_use (line 2049) | bool obj_action_can_use(Object* obj)
function obj_action_can_talk_to (line 2060) | bool obj_action_can_talk_to(Object* obj)
function obj_portal_is_walk_thru (line 2066) | bool obj_portal_is_walk_thru(Object* obj)
function Object (line 2081) | Object* objFindObjPtrFromID(int a1)
function Object (line 2097) | Object* obj_top_environment(Object* object)
function obj_remove_all (line 2112) | void obj_remove_all()
function Object (line 2151) | Object* obj_find_first()
function Object (line 2181) | Object* obj_find_next()
function Object (line 2209) | Object* obj_find_first_at(int elevation)
function Object (line 2233) | Object* obj_find_next_at()
function Object (line 2263) | Object* obj_find_first_at_tile(int elevation, int tile)
function Object (line 2285) | Object* obj_find_next_at_tile()
function obj_bound (line 2309) | void obj_bound(Object* obj, Rect* rect)
function obj_occupied (line 2380) | bool obj_occupied(int tile, int elevation)
function Object (line 2396) | Object* obj_blocking_at(Object* a1, int tile, int elev)
function Object (line 2449) | Object* obj_shoot_blocking_at(Object* obj, int tile, int elev)
function Object (line 2498) | Object* obj_ai_blocking_at(Object* a1, int tile, int elevation)
function obj_scroll_blocking_at (line 2561) | int obj_scroll_blocking_at(int tile, int elev)
function Object (line 2585) | Object* obj_sight_blocking_at(Object* a1, int tile, int elevation)
function obj_dist (line 2606) | int obj_dist(Object* object1, Object* object2)
function obj_dist_with_tile (line 2630) | int obj_dist_with_tile(Object* object1, int tile1, Object* object2, int ...
function obj_create_list (line 2654) | int obj_create_list(int tile, int elevation, int objectType, Object*** o...
function obj_delete_list (line 2726) | void obj_delete_list(Object** objectList)
function translucent_trans_buf_to_buf (line 2734) | void translucent_trans_buf_to_buf(unsigned char* src, int srcWidth, int ...
function dark_trans_buf_to_buf (line 2759) | void dark_trans_buf_to_buf(unsigned char* src, int srcWidth, int srcHeig...
function dark_translucent_trans_buf_to_buf (line 2790) | void dark_translucent_trans_buf_to_buf(unsigned char* src, int srcWidth,...
function intensity_mask_buf_to_buf (line 2818) | void intensity_mask_buf_to_buf(unsigned char* src, int srcWidth, int src...
function obj_outline_object (line 2852) | int obj_outline_object(Object* obj, int outlineType, Rect* rect)
function obj_remove_outline (line 2880) | int obj_remove_outline(Object* object, Rect* rect)
function obj_intersects_with (line 2896) | int obj_intersects_with(Object* object, int x, int y)
function obj_create_intersect_list (line 2987) | int obj_create_intersect_list(int x, int y, int elevation, int objectTyp...
function obj_delete_intersect_list (line 3033) | void obj_delete_intersect_list(ObjectWithFlags** entriesPtr)
function obj_set_seen (line 3044) | void obj_set_seen(int tile)
function obj_clear_seen (line 3050) | void obj_clear_seen()
function obj_process_seen (line 3056) | void obj_process_seen()
function obj_preload_art_cache (line 3142) | void obj_preload_art_cache(int flags)
function obj_offset_table_init (line 3227) | static int obj_offset_table_init()
function obj_offset_table_exit (line 3314) | static void obj_offset_table_exit()
function obj_order_table_init (line 3338) | static int obj_order_table_init()
function obj_order_comp_func_even (line 3373) | static int obj_order_comp_func_even(const void* a1, const void* a2)
function obj_order_comp_func_odd (line 3381) | static int obj_order_comp_func_odd(const void* a1, const void* a2)
function obj_order_table_exit (line 3391) | static void obj_order_table_exit()
function obj_render_table_init (line 3405) | static int obj_render_table_init()
function obj_render_table_exit (line 3426) | static void obj_render_table_exit()
function obj_light_table_init (line 3435) | static void obj_light_table_init()
function obj_blend_table_init (line 3456) | static void obj_blend_table_init()
function obj_blend_table_exit (line 3479) | static void obj_blend_table_exit()
function obj_save_obj (line 3489) | int obj_save_obj(File* stream, Object* object)
function obj_load_obj (line 3538) | int obj_load_obj(File* stream, Object** objectPtr, int elevation, Object...
function obj_save_dude (line 3609) | int obj_save_dude(File* stream)
function obj_load_dude (line 3631) | int obj_load_dude(File* stream)
function obj_create_object (line 3706) | static int obj_create_object(Object** objectPtr)
function obj_destroy_object (line 3734) | static void obj_destroy_object(Object** objectPtr)
function obj_create_object_node (line 3752) | static int obj_create_object_node(ObjectListNode** nodePtr)
function obj_destroy_object_node (line 3772) | static void obj_destroy_object_node(ObjectListNode** nodePtr)
function obj_node_ptr (line 3788) | static int obj_node_ptr(Object* object, ObjectListNode** nodePtr, Object...
function obj_insert (line 3834) | static void obj_insert(ObjectListNode* objectListNode)
function obj_remove (line 3895) | static int obj_remove(ObjectListNode* a1, ObjectListNode* a2)
function obj_connect_to_tile (line 3935) | static int obj_connect_to_tile(ObjectListNode* node, int tile, int eleva...
function obj_adjust_light (line 3967) | static int obj_adjust_light(Object* obj, int a2, Rect* rect)
function obj_render_outline (line 4633) | static void obj_render_outline(Object* object, Rect* rect)
function obj_render_object (line 4885) | static void obj_render_object(Object* object, Rect* rect, int light)
function obj_fix_violence_settings (line 5098) | void obj_fix_violence_settings(int* fid)
function obj_preload_sort (line 5149) | static int obj_preload_sort(const void* a1, const void* a2)
FILE: src/game/object.h
type ObjectWithFlags (line 10) | typedef struct ObjectWithFlags {
FILE: src/game/object_types.h
type Rotation (line 5) | typedef enum Rotation {
type OutlineType (line 34) | typedef enum OutlineType {
type ObjectFlags (line 43) | typedef enum ObjectFlags {
type CritterFlags (line 73) | typedef enum CritterFlags {
type CritterManeuver (line 98) | typedef enum CritterManeuver {
type Dam (line 105) | typedef enum Dam {
type Object (line 138) | typedef struct Object Object;
type InventoryItem (line 140) | typedef struct InventoryItem {
type Inventory (line 146) | typedef struct Inventory {
type WeaponObjectData (line 152) | typedef struct WeaponObjectData {
type AmmoItemData (line 157) | typedef struct AmmoItemData {
type MiscItemData (line 161) | typedef struct MiscItemData {
type KeyItemData (line 165) | typedef struct KeyItemData {
type ItemObjectData (line 169) | typedef union ItemObjectData {
type CritterCombatData (line 176) | typedef struct CritterCombatData {
type CritterObjectData (line 189) | typedef struct CritterObjectData {
type DoorSceneryData (line 197) | typedef struct DoorSceneryData {
type StairsSceneryData (line 201) | typedef struct StairsSceneryData {
type ElevatorSceneryData (line 206) | typedef struct ElevatorSceneryData {
type LadderSceneryData (line 211) | typedef struct LadderSceneryData {
type SceneryObjectData (line 216) | typedef union SceneryObjectData {
type MiscObjectData (line 223) | typedef struct MiscObjectData {
type ObjectData (line 230) | typedef struct ObjectData {
type Object (line 245) | typedef struct Object {
type ObjectListNode (line 275) | typedef struct ObjectListNode {
function builtTileGetTile (line 286) | static inline int builtTileGetTile(int builtTile)
function builtTileGetElevation (line 291) | static inline int builtTileGetElevation(int builtTile)
function builtTileGetRotation (line 296) | static inline int builtTileGetRotation(int builtTile)
function builtTileCreate (line 301) | static inline int builtTileCreate(int tile, int elevation)
FILE: src/game/options.c
type Preference (line 41) | typedef enum Preference {
type PauseWindowFrm (line 73) | typedef enum PauseWindowFrm {
type OptionsWindowFrm (line 81) | typedef enum OptionsWindowFrm {
type PreferencesWindowFrm (line 88) | typedef enum PreferencesWindowFrm {
type PreferenceDescription (line 107) | typedef struct PreferenceDescription {
function do_options (line 378) | int do_options()
function do_optionsFunc (line 384) | int do_optionsFunc(int initialKeyCode)
function OptnStart (line 471) | static int OptnStart()
function OptnEnd (line 592) | static int OptnEnd()
function PauseWindow (line 618) | int PauseWindow(bool a1)
function ShadeScreen (line 808) | static void ShadeScreen(bool a1)
function do_prefscreen (line 828) | static int do_prefscreen()
function PrefStart (line 884) | static int PrefStart()
function DoThing (line 1095) | static void DoThing(int eventCode)
function UpdateThing (line 1393) | static void UpdateThing(int index)
function PrefEnd (line 1622) | static int PrefEnd()
function init_options_menu (line 1640) | int init_options_menu()
function IncGamma (line 1654) | void IncGamma()
function DecGamma (line 1679) | void DecGamma()
function SetSystemPrefs (line 1704) | static void SetSystemPrefs()
function SavePrefs (line 1733) | static int SavePrefs(bool save)
function SetDefaults (line 1777) | static void SetDefaults(bool a1)
function SaveSettings (line 1811) | static void SaveSettings()
function RestoreSettings (line 1836) | static void RestoreSettings()
function JustUpdate (line 1863) | static void JustUpdate()
function save_options (line 1904) | int save_options(File* stream)
function load_options (line 1941) | int load_options(File* stream)
FILE: src/game/palette.c
function palette_init (line 24) | void palette_init()
function palette_reset (line 56) | void palette_reset()
function palette_exit (line 61) | void palette_exit()
function palette_fade_to (line 66) | void palette_fade_to(unsigned char* palette)
function palette_set_to (line 86) | void palette_set_to(unsigned char* palette)
function palette_set_entries (line 93) | void palette_set_entries(unsigned char* palette, int start, int end)
FILE: src/game/party.c
type PartyMemberAI (line 33) | typedef struct PartyMemberAI {
type PartyMemberLevelUpInfo (line 48) | typedef struct PartyMemberLevelUpInfo {
type PartyMember (line 56) | typedef struct PartyMember {
function partyMember_init (line 109) | int partyMember_init()
function partyMember_reset (line 261) | void partyMember_reset()
function partyMember_exit (line 270) | void partyMember_exit()
function partyMemberGetAIOptions (line 301) | static int partyMemberGetAIOptions(Object* object, PartyMemberAI** aiOpt...
function partyMemberAISlotInit (line 314) | static void partyMemberAISlotInit(PartyMemberAI* aiOptions)
function partyMemberSlotInit (line 359) | static int partyMemberSlotInit(int index)
function partyMemberAdd (line 373) | int partyMemberAdd(Object* object)
function partyMemberRemove (line 423) | int partyMemberRemove(Object* object)
function partyMemberPrepSave (line 475) | int partyMemberPrepSave()
function partyMemberUnPrepSave (line 496) | int partyMemberUnPrepSave()
function partyMemberSave (line 517) | int partyMemberSave(File* stream)
function partyMemberPrepLoad (line 538) | int partyMemberPrepLoad()
function partyMemberPrepLoadInstance (line 557) | static int partyMemberPrepLoadInstance(PartyMember* partyMember)
function partyMemberRecoverLoad (line 624) | int partyMemberRecoverLoad()
function partyMemberRecoverLoadInstance (line 661) | static int partyMemberRecoverLoadInstance(PartyMember* partyMember)
function partyMemberLoad (line 707) | int partyMemberLoad(File* stream)
function partyMemberClear (line 771) | void partyMemberClear()
function partyMemberSyncPosition (line 790) | int partyMemberSyncPosition()
function partyMemberRestingHeal (line 822) | int partyMemberRestingHeal(int a1)
function Object (line 841) | Object* partyMemberFindObjFromPid(int pid)
function isPotentialPartyMember (line 854) | bool isPotentialPartyMember(Object* object)
function isPartyMember (line 869) | bool isPartyMember(Object* object)
function getPartyMemberCount (line 894) | int getPartyMemberCount()
function partyMemberNewObjID (line 910) | static int partyMemberNewObjID()
function partyMemberNewObjIDRecurseFind (line 955) | static int partyMemberNewObjIDRecurseFind(Object* obj, int objectId)
function partyMemberPrepItemSaveAll (line 973) | int partyMemberPrepItemSaveAll()
function partyMemberPrepItemSave (line 989) | static int partyMemberPrepItemSave(Object* object)
function partyMemberItemSave (line 1011) | static int partyMemberItemSave(Object* object)
function partyMemberItemRecover (line 1068) | static int partyMemberItemRecover(PartyMember* partyMember)
function partyMemberClearItemList (line 1104) | static int partyMemberClearItemList()
function partyMemberSkill (line 1129) | int partyMemberSkill(Object* object)
function Object (line 1156) | Object* partyMemberWithHighestSkill(int skill)
function partyMemberHighestSkillLevel (line 1178) | int partyMemberHighestSkillLevel(int skill)
function partyFixMultipleMembers (line 1196) | static int partyFixMultipleMembers()
function partyMemberSaveProtos (line 1288) | void partyMemberSaveProtos()
function partyMemberHasAIDisposition (line 1299) | bool partyMemberHasAIDisposition(Object* critter, int disposition)
function partyMemberHasAIBurstValue (line 1322) | bool partyMemberHasAIBurstValue(Object* object, int areaAttackMode)
function partyMemberHasAIRunAwayValue (line 1345) | bool partyMemberHasAIRunAwayValue(Object* object, int runAwayMode)
function partyMemberHasAIWeaponPrefValue (line 1368) | bool partyMemberHasAIWeaponPrefValue(Object* object, int bestWeapon)
function partyMemberHasAIDistancePrefValue (line 1391) | bool partyMemberHasAIDistancePrefValue(Object* object, int distanceMode)
function partyMemberHasAIAttackWhoValue (line 1414) | bool partyMemberHasAIAttackWhoValue(Object* object, int attackWho)
function partyMemberHasAIChemUseValue (line 1437) | bool partyMemberHasAIChemUseValue(Object* object, int chemUse)
function partyMemberIncLevels (line 1461) | int partyMemberIncLevels()
function partyMemberCopyLevelInfo (line 1561) | static int partyMemberCopyLevelInfo(Object* critter, int a2)
function partyMemberNeedsHealing (line 1626) | bool partyMemberNeedsHealing()
function partyMemberMaxHealingNeeded (line 1651) | int partyMemberMaxHealingNeeded()
FILE: src/game/perk.c
type PerkDescription (line 15) | typedef struct PerkDescription {
function perk_init (line 174) | int perk_init()
function perk_reset (line 212) | void perk_reset()
function perk_exit (line 218) | void perk_exit()
function perk_load (line 229) | int perk_load(File* stream)
function perk_save (line 244) | int perk_save(File* stream)
function PerkRankData (line 260) | PerkRankData* perkGetLevelData(Object* critter)
function perk_can_add (line 278) | static bool perk_can_add(Object* critter, int perk)
function perk_defaults (line 399) | static void perk_defaults()
function perk_add (line 410) | int perk_add(Object* critter, int perk)
function perk_add_force (line 430) | int perk_add_force(Object* critter, int perk)
function perk_sub (line 454) | int perk_sub(Object* critter, int perk)
function perk_make_list (line 477) | int perk_make_list(Object* critter, int* perks)
function perk_level (line 491) | int perk_level(Object* critter, int perk)
function perk_skilldex_fid (line 520) | int perk_skilldex_fid(int perk)
function perk_add_effect (line 530) | void perk_add_effect(Object* critter, int perk)
function perk_remove_effect (line 570) | void perk_remove_effect(Object* critter, int perk)
function perk_adjust_skill (line 604) | int perk_adjust_skill(Object* critter, int skill)
FILE: src/game/perk.h
type PerkRankData (line 10) | typedef struct PerkRankData {
function perkIsValid (line 33) | static inline bool perkIsValid(int perk)
function perkHasRank (line 48) | static inline bool perkHasRank(Object* critter, int perk)
FILE: src/game/perk_defs.h
type Perk (line 4) | typedef enum Perk {
FILE: src/game/pipboy.c
type Holiday (line 66) | typedef enum Holiday {
type PipboyTextOptions (line 79) | typedef enum PipboyTextOptions {
type PipboyRestDuration (line 113) | typedef enum PipboyRestDuration {
type PipboyFrm (line 132) | typedef enum PipboyFrm {
type QuestDescription (line 150) | typedef struct QuestDescription {
type HolodiskDescription (line 161) | typedef struct HolodiskDescription {
type HolidayDescription (line 167) | typedef struct HolidayDescription {
type STRUCT_664350 (line 173) | typedef struct STRUCT_664350 {
type PipboyBomb (line 179) | typedef struct PipboyBomb {
function pipboy (line 392) | int pipboy(int intent)
function StartPipboy (line 467) | static int StartPipboy(int intent)
function EndPipboy (line 684) | static void EndPipboy()
function pip_init (line 724) | void pip_init()
function pip_num (line 729) | static void pip_num(int value, int digits, int x, int y)
function pip_date (line 741) | static void pip_date()
function pip_print (line 756) | static void pip_print(const char* text, int flags, int color)
function pip_back (line 792) | static void pip_back(int color)
function _save_pipboy (line 808) | int _save_pipboy(File* stream)
function save_pipboy (line 814) | int save_pipboy(File* stream)
function load_pipboy (line 820) | int load_pipboy(File* stream)
function PipStatus (line 826) | static void PipStatus(int a1)
function ListStatLines (line 1166) | static void ListStatLines(int a1)
function ShowHoloDisk (line 1216) | static void ShowHoloDisk()
function ListHoloDiskTitles (line 1350) | static int ListHoloDiskTitles(int a1)
function qscmp (line 1388) | static int qscmp(const void* a1, const void* a2)
function PipAutomaps (line 1397) | static void PipAutomaps(int a1)
function PrintAMelevList (line 1455) | static int PrintAMelevList(int a1)
function PrintAMList (line 1537) | static int PrintAMList(int a1)
function PipArchives (line 1621) | static void PipArchives(int a1)
function ListArchive (line 1656) | static int ListArchive(int a1)
function PipAlarm (line 1717) | static void PipAlarm(int a1)
function DrawAlarmText (line 1788) | static void DrawAlarmText(int a1)
function DrawAlrmHitPnts (line 1831) | static void DrawAlrmHitPnts()
function AddHotLines (line 1855) | static void AddHotLines(int start, int count, bool add_back_button)
function NixHotLines (line 1884) | static void NixHotLines()
function TimedRest (line 1915) | static bool TimedRest(int hours, int minutes, int duration)
function Check4Health (line 2118) | static bool Check4Health(int a1)
function AddHealth (line 2135) | static bool AddHealth()
function ClacTime (line 2147) | static void ClacTime(int* hours, int* minutes, int wakeUpHour)
function ScreenSaver (line 2177) | static int ScreenSaver()
function quest_init (line 2346) | static int quest_init()
function quest_exit (line 2439) | static void quest_exit()
function quest_qsort_compare (line 2452) | static int quest_qsort_compare(const void* a1, const void* a2)
function holodisks_init (line 2460) | static int holodisks_init()
function holodisks_exit (line 2529) | static void holodisks_exit()
FILE: src/game/pipboy.h
type PipboyOpenIntent (line 11) | typedef enum PipboyOpenIntent {
FILE: src/game/protinst.c
function obj_sid (line 43) | int obj_sid(Object* object, int* sidPtr)
function obj_new_sid (line 54) | int obj_new_sid(Object* object, int* sidPtr)
function obj_new_sid_inst (line 113) | int obj_new_sid_inst(Object* obj, int scriptType, int a3)
function obj_look_at (line 152) | int obj_look_at(Object* a1, Object* a2)
function obj_look_at_func (line 158) | int obj_look_at_func(Object* a1, Object* a2, void (*a3)(char* string))
function obj_examine (line 210) | int obj_examine(Object* a1, Object* a2)
function obj_examine_func (line 222) | int obj_examine_func(Object* critter, Object* target, void (*fn)(char* s...
function obj_pickup (line 528) | int obj_pickup(Object* critter, Object* item)
function obj_remove_from_inven (line 578) | int obj_remove_from_inven(Object* critter, Object* item)
function obj_drop (line 628) | int obj_drop(Object* a1, Object* a2)
function obj_destroy (line 682) | int obj_destroy(Object* obj)
function obj_use_book (line 711) | static int obj_use_book(Object* book)
function obj_use_flare (line 799) | static int obj_use_flare(Object* critter_obj, Object* flare)
function obj_use_radio (line 834) | int obj_use_radio(Object* item)
function obj_use_explosive (line 853) | static int obj_use_explosive(Object* explosive)
function obj_use_power_on_car (line 922) | int obj_use_power_on_car(Object* item)
function obj_use_misc_item (line 970) | static int obj_use_misc_item(Object* item)
function protinst_use_item (line 1003) | int protinst_use_item(Object* critter, Object* item)
function protinstTestDroppedExplosive (line 1061) | static int protinstTestDroppedExplosive(Object* a1)
function obj_use_item (line 1100) | int obj_use_item(Object* a1, Object* a2)
function protinst_default_use_item (line 1145) | static int protinst_default_use_item(Object* a1, Object* a2, Object* item)
function protinst_use_item_on (line 1222) | int protinst_use_item_on(Object* a1, Object* a2, Object* item)
function obj_use_item_on (line 1335) | int obj_use_item_on(Object* a1, Object* a2, Object* a3)
function check_scenery_ap_cost (line 1377) | int check_scenery_ap_cost(Object* obj, Object* a2)
function obj_use (line 1408) | int obj_use(Object* a1, Object* a2)
function obj_use_ladder_top (line 1484) | int obj_use_ladder_top(Object* a1, Object* ladder, int a3)
function obj_use_ladder_bottom (line 1518) | int obj_use_ladder_bottom(Object* a1, Object* ladder, int a3)
function obj_use_stairs (line 1552) | int obj_use_stairs(Object* a1, Object* stairs, int a3)
function set_door_state_open (line 1586) | static int set_door_state_open(Object* a1, Object* a2)
function set_door_state_closed (line 1593) | static int set_door_state_closed(Object* a1, Object* a2)
function check_door_state (line 1600) | static int check_door_state(Object* a1, Object* a2)
function obj_use_door (line 1678) | int obj_use_door(Object* a1, Object* a2, int a3)
function obj_use_container (line 1755) | int obj_use_container(Object* critter, Object* item)
function obj_use_skill_on (line 1838) | int obj_use_skill_on(Object* source, Object* target, int skill)
function obj_is_a_portal (line 1880) | bool obj_is_a_portal(Object* obj)
function obj_is_lockable (line 1895) | bool obj_is_lockable(Object* obj)
function obj_is_locked (line 1924) | bool obj_is_locked(Object* obj)
function obj_lock (line 1942) | int obj_lock(Object* object)
function obj_unlock (line 1963) | int obj_unlock(Object* object)
function obj_is_openable (line 1982) | bool obj_is_openable(Object* obj)
function obj_is_open (line 2011) | int obj_is_open(Object* object)
function obj_toggle_open (line 2017) | int obj_toggle_open(Object* obj)
function obj_open (line 2058) | int obj_open(Object* obj)
function obj_close (line 2068) | int obj_close(Object* obj)
function obj_lock_is_jammed (line 2078) | bool obj_lock_is_jammed(Object* obj)
function obj_jam_lock (line 2099) | int obj_jam_lock(Object* obj)
function obj_unjam_lock (line 2119) | int obj_unjam_lock(Object* obj)
function obj_unjam_all_locks (line 2139) | int obj_unjam_all_locks()
function obj_attempt_placement (line 2152) | int obj_attempt_placement(Object* obj, int tile, int elevation, int a4)
function objPMAttemptPlacement (line 2209) | int objPMAttemptPlacement(Object* obj, int tile, int elevation)
FILE: src/game/proto.c
function proto_make_path (line 166) | void proto_make_path(char* path, int pid)
function proto_list_str (line 178) | int proto_list_str(int pid, char* proto_path)
function proto_action_can_use (line 228) | bool proto_action_can_use(int pid)
function proto_action_can_use_on (line 247) | bool proto_action_can_use_on(int pid)
function proto_action_can_talk_to (line 266) | bool proto_action_can_talk_to(int pid)
function proto_action_can_pickup (line 287) | int proto_action_can_pickup(int pid)
function proto_critter_init (line 343) | int proto_critter_init(Proto* a1, int a2)
function clear_pupdate_data (line 378) | void clear_pupdate_data(Object* obj)
function proto_read_CombatData (line 386) | static int proto_read_CombatData(CritterCombatData* data, File* stream)
function proto_write_CombatData (line 400) | static int proto_write_CombatData(CritterCombatData* data, File* stream)
function proto_read_protoUpdateData (line 414) | int proto_read_protoUpdateData(Object* obj, File* stream)
function proto_write_protoUpdateData (line 510) | int proto_write_protoUpdateData(Object* obj, File* stream)
function proto_update_gen (line 594) | int proto_update_gen(Object* obj)
function proto_update_init (line 667) | int proto_update_init(Object* obj)
function proto_dude_update_gender (line 709) | int proto_dude_update_gender()
function proto_dude_init (line 746) | int proto_dude_init(const char* path)
function proto_data_member (line 806) | int proto_data_member(int pid, int member, ProtoDataMemberValue* value)
function proto_init (line 1039) | int proto_init()
function proto_reset (line 1171) | void proto_reset()
function proto_exit (line 1195) | void proto_exit()
function proto_header_load (line 1213) | int proto_header_load()
function proto_read_item_data (line 1256) | static int proto_read_item_data(ItemProtoData* item_data, int type, File...
function proto_read_scenery_data (line 1332) | static int proto_read_scenery_data(SceneryProtoData* scenery_data, int t...
function proto_read_protoSubNode (line 1366) | static int proto_read_protoSubNode(Proto* proto, File* stream)
function proto_write_item_data (line 1442) | static int proto_write_item_data(ItemProtoData* item_data, int type, Fil...
function proto_write_scenery_data (line 1518) | static int proto_write_scenery_data(SceneryProtoData* scenery_data, int ...
function proto_write_protoSubNode (line 1551) | static int proto_write_protoSubNode(Proto* proto, File* stream)
function proto_save_pid (line 1625) | int proto_save_pid(int pid)
function proto_load_pid (line 1651) | int proto_load_pid(int pid, Proto** protoPtr)
function proto_find_free_subnode (line 1683) | int proto_find_free_subnode(int type, Proto** protoPtr)
function proto_remove_some_list (line 1738) | static void proto_remove_some_list(int type)
function proto_remove_list (line 1757) | static void proto_remove_list(int type)
function proto_remove_all (line 1779) | void proto_remove_all()
function proto_ptr (line 1787) | int proto_ptr(int pid, Proto** protoPtr)
function proto_new_id (line 1823) | static int proto_new_id(int a1)
function proto_max_id (line 1832) | int proto_max_id(int a1)
function ResetPlayer (line 1838) | int ResetPlayer()
FILE: src/game/proto.h
type ItemDataMember (line 12) | typedef enum ItemDataMember {
type CritterDataMember (line 31) | typedef enum CritterDataMember {
type SceneryDataMember (line 46) | typedef enum SceneryDataMember {
type WallDataMember (line 61) | typedef enum WallDataMember {
type MiscDataMember (line 74) | typedef enum MiscDataMember {
type ProtoDataMemberType (line 85) | typedef enum ProtoDataMemberType {
type ProtoDataMemberValue (line 90) | typedef union ProtoDataMemberValue {
type PrototypeMesage (line 95) | typedef enum PrototypeMessage {
FILE: src/game/proto_types.h
type ItemProtoFlags (line 199) | typedef enum ItemProtoFlags {
type ItemProtoExtendedFlags (line 208) | typedef enum ItemProtoExtendedFlags {
type ProtoItemArmorData (line 222) | typedef struct {
type ProtoItemContainerData (line 231) | typedef struct {
type ProtoItemDrugData (line 236) | typedef struct {
type ProtoItemWeaponData (line 248) | typedef struct {
type ProtoItemAmmoData (line 268) | typedef struct {
type ProtoItemMiscData (line 277) | typedef struct {
type ProtoItemKeyData (line 283) | typedef struct {
type ItemProtoData (line 287) | typedef struct ItemProtoData {
type ItemProto (line 308) | typedef struct ItemProto {
type CritterProtoData (line 329) | typedef struct CritterProtoData {
type CritterProto (line 341) | typedef struct CritterProto {
type SceneryProtoDoorData (line 358) | typedef struct {
type SceneryProtoStairsData (line 363) | typedef struct {
type SceneryProtoElevatorData (line 368) | typedef struct {
type SceneryProtoLadderData (line 373) | typedef struct {
type SceneryProtoGenericData (line 377) | typedef struct {
type SceneryProtoData (line 381) | typedef struct SceneryProtoData {
type SceneryProto (line 391) | typedef struct SceneryProto {
type WallProto (line 409) | typedef struct WallProto {
type TileProto (line 423) | typedef struct TileProto {
type MiscProto (line 435) | typedef struct MiscProto {
type Proto (line 447) | typedef union Proto {
type ProtoListExtent (line 468) | typedef struct ProtoListExtent {
type ProtoList (line 475) | typedef struct ProtoList {
FILE: src/game/queue.c
type QueueListNode (line 18) | typedef struct QueueListNode {
function queue_init (line 61) | void queue_init()
function queue_reset (line 69) | int queue_reset()
function queue_exit (line 78) | int queue_exit()
function queue_load (line 85) | int queue_load(File* stream)
function queue_save (line 199) | int queue_save(File* stream)
function queue_add (line 246) | int queue_add(int delay, Object* obj, void* data, int eventType)
function queue_remove (line 285) | int queue_remove(Object* owner)
function queue_remove_this (line 313) | int queue_remove_this(Object* owner, int eventType)
function queue_find (line 343) | bool queue_find(Object* owner, int eventType)
function queue_process (line 358) | int queue_process()
function queue_clear (line 385) | void queue_clear()
function queue_clear_type (line 405) | void queue_clear_type(int eventType, QueueEventHandler* fn)
function queue_next_time (line 438) | int queue_next_time()
function queue_destroy (line 448) | static int queue_destroy(Object* obj, void* data)
function queue_explode (line 455) | static int queue_explode(Object* obj, void* data)
function queue_explode_exit (line 461) | static int queue_explode_exit(Object* obj, void* data)
function queue_do_explosion (line 467) | static int queue_do_explosion(Object* explosive, bool a2)
function queue_premature (line 512) | static int queue_premature(Object* obj, void* data)
function queue_leaving_map (line 526) | void queue_leaving_map()
function queue_is_empty (line 537) | bool queue_is_empty()
FILE: src/game/queue.h
type EventType (line 9) | typedef enum EventType {
type DrugEffectEvent (line 27) | typedef struct DrugEffectEvent {
type WithdrawalEvent (line 33) | typedef struct WithdrawalEvent {
type ScriptEvent (line 39) | typedef struct ScriptEvent {
type RadiationEvent (line 44) | typedef struct RadiationEvent {
type AmbientSoundEffectEvent (line 49) | typedef struct AmbientSoundEffectEvent {
type EventTypeDescription (line 58) | typedef struct EventTypeDescription {
FILE: src/game/reaction.c
function reaction_set (line 6) | int reaction_set(Object* critter, int value)
function level_to_reaction (line 15) | int level_to_reaction()
function reaction_lookup_internal (line 21) | int reaction_lookup_internal(int a1)
function reaction_to_level_internal (line 41) | int reaction_to_level_internal(int sid, int reaction)
function reaction_to_level (line 71) | int reaction_to_level(int a1)
function reaction_get (line 77) | int reaction_get(Object* critter)
function reaction_roll (line 89) | int reaction_roll()
function reaction_influence (line 97) | int reaction_influence()
FILE: src/game/reaction.h
type NpcReaction (line 6) | typedef enum NpcReaction {
FILE: src/game/roll.c
function roll_init (line 32) | void roll_init()
function roll_reset (line 41) | int roll_reset()
function roll_exit (line 47) | int roll_exit()
function roll_save (line 53) | int roll_save(File* stream)
function roll_load (line 59) | int roll_load(File* stream)
function roll_check (line 67) | int roll_check(int difficulty, int criticalSuccessModifier, int* howMuch...
function roll_check_critical (line 83) | int roll_check_critical(int delta, int criticalSuccessModifier)
function roll_random (line 112) | int roll_random(int min, int max)
function ran1 (line 131) | static int ran1(int max)
function init_random (line 155) | static void init_random()
function roll_set_seed (line 162) | void roll_set_seed(int seed)
function random_seed (line 173) | static int random_seed()
function seed_generator (line 182) | static void seed_generator(int seed)
function timer_read (line 208) | static unsigned int timer_read()
function check_chi_squared (line 214) | static void check_chi_squared()
FILE: src/game/roll.h
type Roll (line 6) | typedef enum Roll {
FILE: src/game/scripts.c
type ScriptListExtent (line 35) | typedef struct ScriptListExtent {
type ScriptList (line 44) | typedef struct ScriptList {
type ScriptState (line 54) | typedef struct ScriptState {
function game_time (line 201) | int game_time()
function game_time_date (line 207) | void game_time_date(int* monthPtr, int* dayPtr, int* yearPtr)
function game_time_hour (line 250) | int game_time_hour()
function gameTimeSetTime (line 270) | void gameTimeSetTime(int time)
function inc_game_time (line 280) | void inc_game_time(int ticks)
function inc_game_time_in_seconds (line 299) | void inc_game_time_in_seconds(int seconds)
function gtime_q_add (line 306) | int gtime_q_add()
function gtime_q_process (line 323) | int gtime_q_process(Object* obj, void* data)
function scriptsCheckGameEvents (line 356) | int scriptsCheckGameEvents(int* moviePtr, int window)
function scr_map_q_process (line 425) | int scr_map_q_process(Object* obj, void* data)
function new_obj_id (line 443) | int new_obj_id()
function scr_find_sid_from_program (line 473) | int scr_find_sid_from_program(Program* program)
function Object (line 492) | Object* scr_find_obj_from_program(Program* program)
function scr_set_objs (line 544) | int scr_set_objs(int sid, Object* source, Object* target)
function scr_set_ext_param (line 558) | void scr_set_ext_param(int sid, int value)
function scr_set_action_num (line 567) | int scr_set_action_num(int sid, int value)
function Program (line 581) | Program* loadProgram(const char* name)
function doBkProcesses (line 594) | static void doBkProcesses()
function script_chk_critters (line 629) | static void script_chk_critters()
function script_chk_timed_events (line 675) | static void script_chk_timed_events()
function scrSetQueueTestVals (line 721) | void scrSetQueueTestVals(Object* a1, int a2)
function scrQueueRemoveFixed (line 728) | int scrQueueRemoveFixed(Object* obj, void* data)
function script_q_add (line 735) | int script_q_add(int sid, int delay, int param)
function script_q_save (line 760) | int script_q_save(File* stream, void* data)
function script_q_load (line 771) | int script_q_load(File* stream, void** dataPtr)
function script_q_process (line 794) | int script_q_process(Object* obj, void* data)
function scripts_clear_state (line 811) | int scripts_clear_state()
function scripts_clear_combat_requests (line 820) | int scripts_clear_combat_requests(Script* script)
function scripts_check_state (line 829) | int scripts_check_state()
function scripts_check_state_in_combat (line 967) | int scripts_check_state_in_combat()
function scripts_request_combat (line 1033) | int scripts_request_combat(STRUCT_664980* a1)
function scripts_request_combat_locked (line 1052) | void scripts_request_combat_locked(STRUCT_664980* a1)
function scripts_request_worldmap (line 1064) | void scripts_request_worldmap()
function scripts_request_elevator (line 1075) | int scripts_request_elevator(Object* a1, int a2)
function scripts_request_explosion (line 1132) | int scripts_request_explosion(int tile, int elevation, int minDamage, in...
function scripts_request_dialog (line 1143) | void scripts_request_dialog(Object* obj)
function scripts_request_endgame_slideshow (line 1150) | void scripts_request_endgame_slideshow()
function scripts_request_loot_container (line 1156) | int scripts_request_loot_container(Object* a1, Object* a2)
function scripts_request_steal_container (line 1165) | int scripts_request_steal_container(Object* a1, Object* a2)
function script_make_path (line 1174) | void script_make_path(char* path)
function exec_script_proc (line 1182) | int exec_script_proc(int sid, int proc)
function scr_build_lookup_table (line 1269) | static int scr_build_lookup_table(Script* script)
function scriptHasProc (line 1283) | bool scriptHasProc(int sid, int proc)
function scrInitListInfo (line 1295) | static int scrInitListInfo()
function scrExitListInfo (line 1347) | static int scrExitListInfo()
function scr_find_str_run_info (line 1360) | int scr_find_str_run_info(int scriptIndex, int* a2, int sid)
function scr_index_to_name (line 1373) | static int scr_index_to_name(int scriptIndex, char* name)
function scr_set_dude_script (line 1381) | int scr_set_dude_script()
function scr_clear_dude_script (line 1415) | int scr_clear_dude_script()
function scr_init (line 1438) | int scr_init()
function scr_reset (line 1468) | int scr_reset()
function scr_game_init (line 1481) | int scr_game_init()
function scr_game_reset (line 1523) | int scr_game_reset()
function scr_exit (line 1534) | int scr_exit()
function scr_message_free (line 1559) | int scr_message_free()
function scr_game_exit (line 1580) | int scr_game_exit()
function scr_enable (line 1602) | int scr_enable()
function scr_disable (line 1615) | int scr_disable()
function scr_enable_critters (line 1622) | void scr_enable_critters()
function scr_disable_critters (line 1628) | void scr_disable_critters()
function scr_game_save (line 1634) | int scr_game_save(File* stream)
function scr_game_load (line 1640) | int scr_game_load(File* stream)
function scr_game_load2 (line 1651) | int scr_game_load2(File* stream)
function scr_header_load (line 1669) | static int scr_header_load()
function scr_write_ScriptSubNode (line 1709) | static int scr_write_ScriptSubNode(Script* scr, File* stream)
function scr_write_ScriptNode (line 1743) | static int scr_write_ScriptNode(ScriptListExtent* a1, File* stream)
function scr_save (line 1765) | int scr_save(File* stream)
function scr_read_ScriptSubNode (line 1860) | static int scr_read_ScriptSubNode(Script* scr, File* stream)
function scr_read_ScriptNode (line 1909) | static int scr_read_ScriptNode(ScriptListExtent* scriptExtent, File* str...
function scr_load (line 1931) | int scr_load(File* stream)
function scr_ptr (line 2009) | int scr_ptr(int sid, Script** scriptPtr)
function scr_new_id (line 2040) | static int scr_new_id(int scriptType)
function scr_new (line 2057) | int scr_new(int* sidPtr, int scriptType)
function scr_remove_local_vars (line 2128) | int scr_remove_local_vars(Script* script)
function scr_remove (line 2171) | int scr_remove(int sid)
function scr_remove_all (line 2268) | int scr_remove_all()
function scr_remove_all_force (line 2314) | int scr_remove_all_force()
function Script (line 2344) | Script* scr_find_first_at(int elevation)
function Script (line 2363) | Script* scr_find_next_at()
function scr_spatials_enable (line 2406) | void scr_spatials_enable()
function scr_spatials_disable (line 2412) | void scr_spatials_disable()
function scr_chk_spatials_in (line 2418) | bool scr_chk_spatials_in(Object* object, int tile, int elevation)
function scr_load_all_scripts (line 2471) | int scr_load_all_scripts()
function scr_exec_map_enter_scripts (line 2489) | void scr_exec_map_enter_scripts()
function scr_exec_map_update_scripts (line 2495) | void scr_exec_map_update_scripts()
function scrExecMapProcScripts (line 2501) | static void scrExecMapProcScripts(int proc)
function scr_exec_map_exit_scripts (line 2568) | void scr_exec_map_exit_scripts()
function scr_get_dialog_msg_file (line 2574) | int scr_get_dialog_msg_file(int a1, MessageList** messageListPtr)
function scr_get_local_var (line 2674) | int scr_get_local_var(int sid, int variable, int* value)
function scr_set_local_var (line 2714) | int scr_set_local_var(int sid, int variable, int value)
function scr_end_combat (line 2743) | bool scr_end_combat()
function scr_explode_scenery (line 2774) | int scr_explode_scenery(Object* a1, int tile, int radius, int elevation)
FILE: src/game/scripts.h
type ScriptRequests (line 27) | typedef enum ScriptRequests {
type ScriptType (line 41) | typedef enum ScriptType {
type ScriptProc (line 50) | typedef enum ScriptProc {
type ScriptsListEntry (line 84) | typedef struct ScriptsListEntry {
type Script (line 89) | typedef struct Script {
FILE: src/game/select.c
type PremadeCharacter (line 60) | typedef enum PremadeCharacter {
type PremadeCharacterDescription (line 67) | typedef struct PremadeCharacterDescription {
function select_character (line 193) | int select_character()
function select_init (line 297) | bool select_init()
function select_exit (line 550) | static void select_exit()
function select_update_display (line 668) | static bool select_update_display()
function select_display_portrait (line 697) | static bool select_display_portrait()
function select_display_stats (line 719) | static bool select_display_stats()
function select_display_bio (line 971) | static bool select_display_bio()
function select_fatal_error (line 1001) | static bool select_fatal_error(bool rc)
FILE: src/game/selfrun.c
type SelfrunState (line 12) | typedef enum SelfrunState {
function selfrun_get_list (line 26) | int selfrun_get_list(char*** fileListPtr, int* fileListLengthPtr)
function selfrun_free_list (line 42) | int selfrun_free_list(char*** fileListPtr)
function selfrun_prep_playback (line 54) | int selfrun_prep_playback(const char* fileName, SelfrunData* selfrunData)
function selfrun_playback_loop (line 85) | void selfrun_playback_loop(SelfrunData* selfrunData)
function selfrun_prep_recording (line 116) | int selfrun_prep_recording(const char* recordingName, const char* mapFil...
function selfrun_recording_loop (line 152) | void selfrun_recording_loop(SelfrunData* selfrunData)
function selfrun_playback_callback (line 179) | static void selfrun_playback_callback(int reason)
function selfrun_load_data (line 186) | static int selfrun_load_data(const char* path, SelfrunData* selfrunData)
function selfrun_save_data (line 214) | static int selfrun_save_data(const char* path, SelfrunData* selfrunData)
FILE: src/game/selfrun.h
type SelfrunData (line 7) | typedef struct SelfrunData {
FILE: src/game/sfxcache.c
type SoundEffect (line 19) | typedef struct SoundEffect {
function sfxc_init (line 70) | int sfxc_init(int cacheSize, const char* effectsPath)
function sfxc_exit (line 122) | void sfxc_exit()
function sfxc_is_initialized (line 140) | int sfxc_is_initialized()
function sfxc_flush (line 146) | void sfxc_flush()
function sfxc_cached_open (line 154) | int sfxc_cached_open(const char* fname, int mode, ...)
function sfxc_cached_close (line 190) | int sfxc_cached_close(int handle)
function sfxc_cached_read (line 208) | int sfxc_cached_read(int handle, void* buf, unsigned int size)
function sfxc_cached_write (line 250) | int sfxc_cached_write(int handle, const void* buf, unsigned int size)
function sfxc_cached_seek (line 256) | long sfxc_cached_seek(int handle, long offset, int origin)
function sfxc_cached_tell (line 301) | long sfxc_cached_tell(int handle)
function sfxc_cached_file_size (line 312) | long sfxc_cached_file_size(int handle)
function sfxc_effect_size (line 323) | static int sfxc_effect_size(int tag, int* sizePtr)
function sfxc_effect_load (line 336) | static int sfxc_effect_load(int tag, int* sizePtr, unsigned char* data)
function sfxc_effect_free (line 361) | static void sfxc_effect_free(void* ptr)
function sfxc_handle_list_create (line 367) | static int sfxc_handle_list_create()
function sfxc_handle_list_destroy (line 385) | static void sfxc_handle_list_destroy()
function sfxc_handle_create (line 400) | static int sfxc_handle_create(int* handlePtr, int tag, void* data, Cache...
function sfxc_handle_destroy (line 439) | static void sfxc_handle_destroy(int handle)
function sfxc_handle_is_legal (line 450) | static bool sfxc_handle_is_legal(int handle)
function sfxc_mode_is_legal (line 472) | static bool sfxc_mode_is_legal(int mode)
function sfxc_decode (line 482) | static int sfxc_decode(int handle, void* buf, unsigned int size)
function sfxc_ad_reader (line 523) | static int sfxc_ad_reader(int handle, void* buf, unsigned int size)
FILE: src/game/sfxlist.c
type SoundEffectsListEntry (line 13) | typedef struct SoundEffectsListEntry {
function sfxl_tag_is_legal (line 55) | bool sfxl_tag_is_legal(int a1)
function sfxl_init (line 61) | int sfxl_init(const char* soundEffectsPath, int a2, int debugLevel)
function sfxl_exit (line 165) | void sfxl_exit()
function sfxl_name_to_tag (line 175) | int sfxl_name_to_tag(char* name, int* tagPtr)
function sfxl_name (line 200) | int sfxl_name(int tag, char** pathPtr)
function sfxl_size_full (line 224) | int sfxl_size_full(int tag, int* sizePtr)
function sfxl_size_cached (line 239) | int sfxl_size_cached(int tag, int* sizePtr)
function sfxl_index_to_tag (line 254) | static int sfxl_index_to_tag(int tag, int* indexPtr)
function sfxl_destroy (line 277) | static void sfxl_destroy()
function sfxl_get_names (line 301) | static int sfxl_get_names()
function sfxl_copy_names (line 357) | static int sfxl_copy_names(char** fileNameList)
function sfxl_get_sizes (line 372) | static int sfxl_get_sizes()
function sfxl_sort_by_name (line 436) | static int sfxl_sort_by_name()
function sfxl_compare_by_name (line 445) | static int sfxl_compare_by_name(const void* a1, const void* a2)
function sfxl_ad_reader (line 454) | static int sfxl_ad_reader(int fileHandle, void* buf, unsigned int size)
FILE: src/game/skill.c
type SkillDescription (line 40) | typedef struct SkillDescription {
function skill_init (line 97) | int skill_init()
function skill_reset (line 140) | void skill_reset()
function skill_exit (line 151) | void skill_exit()
function skill_load (line 157) | int skill_load(File* stream)
function skill_save (line 163) | int skill_save(File* stream)
function skill_set_defaults (line 169) | void skill_set_defaults(CritterProtoData* data)
function skill_set_tags (line 177) | void skill_set_tags(int* skills, int count)
function skill_get_tags (line 185) | void skill_get_tags(int* skills, int count)
function skill_is_tagged (line 193) | bool skill_is_tagged(int skill)
function skill_level (line 202) | int skill_level(Object* critter, int skill)
function skill_base (line 244) | int skill_base(int skill)
function skill_points (line 250) | int skill_points(Object* obj, int skill)
function skill_inc_point (line 263) | int skill_inc_point(Object* obj, int skill)
function skill_inc_point_force (line 302) | int skill_inc_point_force(Object* obj, int skill)
function skillLevelCost (line 327) | static int skillLevelCost(int skillValue)
function skill_dec_point (line 348) | int skill_dec_point(Object* critter, int skill)
function skill_dec_point_force (line 400) | int skill_dec_point_force(Object* obj, int skill)
function skill_result (line 424) | int skill_result(Object* critter, int skill, int modifier, int* howMuch)
function skill_contest (line 456) | int skill_contest(Object* attacker, Object* defender, int skill, int att...
function skill_pic (line 499) | int skill_pic(int skill)
function show_skill_use_messages (line 505) | static void show_skill_use_messages(Object* obj, int skill, Object* a3, ...
function skill_use (line 545) | int skill_use(Object* obj, Object* a2, int skill, int criticalChanceModi...
function skill_check_stealing (line 1046) | int skill_check_stealing(Object* a1, Object* a2, Object* item, bool isPl...
function skill_game_difficulty (line 1130) | static int skill_game_difficulty(int skill)
function skill_use_slot_available (line 1162) | static int skill_use_slot_available(int skill)
function skill_use_slot_add (line 1180) | static int skill_use_slot_add(int skill)
function skill_use_slot_clear (line 1201) | static int skill_use_slot_clear()
function skill_use_slot_save (line 1208) | int skill_use_slot_save(File* stream)
function skill_use_slot_load (line 1214) | int skill_use_slot_load(File* stream)
FILE: src/game/skill.h
function skillIsValid (line 44) | static inline bool skillIsValid(int skill)
FILE: src/game/skill_defs.h
type Skill (line 10) | typedef enum Skill {
FILE: src/game/skilldex.c
type SkilldexFrm (line 33) | typedef enum SkilldexFrm {
type SkilldexSkill (line 43) | typedef enum SkilldexSkill {
function skilldex_select (line 115) | int skilldex_select()
function skilldex_start (line 146) | static int skilldex_start()
function skilldex_end (line 376) | static void skilldex_end()
FILE: src/game/skilldex.h
type SkilldexRC (line 4) | typedef enum SkilldexRC {
FILE: src/game/stat.c
type StatDescription (line 25) | typedef struct StatDescription {
function stat_init (line 95) | int stat_init()
function stat_reset (line 131) | int stat_reset()
function stat_exit (line 140) | int stat_exit()
function stat_load (line 148) | int stat_load(File* stream)
function stat_save (line 160) | int stat_save(File* stream)
function critterGetStat (line 172) | int critterGetStat(Object* critter, int stat)
function stat_get_base (line 383) | int stat_get_base(Object* critter, int stat)
function stat_get_base_direct (line 395) | int stat_get_base_direct(Object* critter, int stat)
function stat_get_bonus (line 417) | int stat_get_bonus(Object* critter, int stat)
function stat_set_base (line 429) | int stat_set_base(Object* critter, int stat, int value)
function inc_stat (line 479) | int inc_stat(Object* critter, int stat)
function dec_stat (line 491) | int dec_stat(Object* critter, int stat)
function stat_set_bonus (line 503) | int stat_set_bonus(Object* critter, int stat, int value)
function stat_set_defaults (line 535) | void stat_set_defaults(CritterProtoData* data)
function stat_recalc_derived (line 544) | void stat_recalc_derived(Object* critter)
function stat_pc_get (line 595) | int stat_pc_get(int pcStat)
function stat_pc_set (line 601) | int stat_pc_set(int pcStat, int value)
function stat_pc_set_defaults (line 634) | void stat_pc_set_defaults()
function stat_pc_min_exp (line 644) | int stat_pc_min_exp()
function statPcMinExpForLevel (line 652) | int statPcMinExpForLevel(int level)
function stat_picture (line 679) | int stat_picture(int stat)
function stat_result (line 698) | int stat_result(Object* critter, int stat, int modifier, int* howMuch)
function stat_pc_add_experience (line 715) | int stat_pc_add_experience(int xp)
function statPCAddExperienceCheckPMs (line 721) | int statPCAddExperienceCheckPMs(int xp, bool a2)
function statPcResetExperience (line 780) | int statPcResetExperience(int xp)
FILE: src/game/stat.h
function statIsValid (line 44) | static inline bool statIsValid(int stat)
function pcStatIsValid (line 49) | static inline bool pcStatIsValid(int pcStat)
FILE: src/game/stat_defs.h
type Stat (line 20) | typedef enum Stat {
type PcStat (line 74) | typedef enum PcStat {
FILE: src/game/strparse.c
function strParseValue (line 10) | int strParseValue(char** stringPtr, int* valuePtr)
function strParseStrFromList (line 53) | int strParseStrFromList(char** stringPtr, int* valuePtr, const char** st...
function strParseStrFromFunc (line 109) | int strParseStrFromFunc(char** stringPtr, int* valuePtr, StringParserCal...
function strParseStrSepVal (line 158) | int strParseStrSepVal(char** stringPtr, const char* key, int* valuePtr, ...
function strParseStrAndSepVal (line 212) | int strParseStrAndSepVal(char** stringPtr, char* key, int* valuePtr, con...
FILE: src/game/textobj.c
type TextObjectFlags (line 18) | typedef enum TextObjectFlags {
type TextObject (line 23) | typedef struct TextObject {
function text_object_init (line 71) | int text_object_init(unsigned char* windowBuffer, int width, int height)
function text_object_reset (line 104) | int text_object_reset()
function text_object_exit (line 122) | void text_object_exit()
function text_object_disable (line 132) | void text_object_disable()
function text_object_enable (line 138) | void text_object_enable()
function text_object_is_enabled (line 146) | int text_object_is_enabled()
function text_object_set_base_delay (line 152) | void text_object_set_base_delay(double value)
function text_object_get_base_delay (line 164) | unsigned int text_object_get_base_delay()
function text_object_set_line_delay (line 170) | void text_object_set_line_delay(double value)
function text_object_get_line_delay (line 182) | unsigned int text_object_get_line_delay()
function text_object_create (line 189) | int text_object_create(Object* object, char* string, int font, int color...
function text_object_render (line 325) | void text_object_render(Rect* rect)
function text_object_count (line 354) | int text_object_count()
function text_object_bk (line 360) | static void text_object_bk()
function text_object_get_offset (line 409) | static void text_object_get_offset(TextObject* textObject)
function text_object_remove (line 495) | void text_object_remove(Object* object)
FILE: src/game/tile.c
type STRUCT_51D99C (line 22) | typedef struct STRUCT_51D99C {
type STRUCT_51DA04 (line 27) | typedef struct STRUCT_51DA04 {
type STRUCT_51DA6C (line 32) | typedef struct STRUCT_51DA6C {
type STRUCT_51DB0C (line 39) | typedef struct STRUCT_51DB0C {
type STRUCT_51DB48 (line 45) | typedef struct STRUCT_51DB48 {
function tile_init (line 268) | int tile_init(TileData** a1, int squareGridWidth, int squareGridHeight, ...
function tile_set_border (line 428) | void tile_set_border(int windowWidth, int windowHeight, int hexGridWidth...
function tile_reset (line 450) | void tile_reset()
function tile_exit (line 455) | void tile_exit()
function tile_disable_refresh (line 460) | void tile_disable_refresh()
function tile_enable_refresh (line 466) | void tile_enable_refresh()
function tile_refresh_rect (line 472) | void tile_refresh_rect(Rect* rect, int elevation)
function tile_refresh_display (line 482) | void tile_refresh_display()
function tile_set_center (line 490) | int tile_set_center(int tile, int flags)
function refresh_mapper (line 564) | static void refresh_mapper(Rect* rect, int elevation)
function refresh_game (line 587) | static void refresh_game(Rect* rect, int elevation)
function tile_toggle_roof (line 603) | void tile_toggle_roof(int a1)
function tile_roof_visible (line 614) | int tile_roof_visible()
function tile_coord (line 620) | int tile_coord(int tile, int* screenX, int* screenY, int elevation)
function tile_num (line 658) | int tile_num(int screenX, int screenY, int elevation)
function tile_dist (line 733) | int tile_dist(int tile1, int tile2)
function tile_in_front_of (line 790) | bool tile_in_front_of(int tile1, int tile2)
function tile_to_right_of (line 807) | bool tile_to_right_of(int tile1, int tile2)
function tile_num_in_direction (line 829) | int tile_num_in_direction(int tile, int rotation, int distance)
function tile_dir (line 846) | int tile_dir(int tile1, int tile2)
function tile_num_beyond (line 880) | int tile_num_beyond(int from, int to, int distance)
function tile_on_edge (line 971) | static bool tile_on_edge(int tile)
function tile_enable_scroll_blocking (line 997) | void tile_enable_scroll_blocking()
function tile_disable_scroll_blocking (line 1003) | void tile_disable_scroll_blocking()
function tile_get_scroll_blocking (line 1009) | bool tile_get_scroll_blocking()
function tile_enable_scroll_limiting (line 1015) | void tile_enable_scroll_limiting()
function tile_disable_scroll_limiting (line 1021) | void tile_disable_scroll_limiting()
function tile_get_scroll_limiting (line 1027) | bool tile_get_scroll_limiting()
function square_coord (line 1033) | int square_coord(int squareTile, int* coordX, int* coordY, int elevation)
function square_coord_roof (line 1064) | int square_coord_roof(int squareTile, int* screenX, int* screenY, int el...
function square_num (line 1097) | int square_num(int screenX, int screenY, int elevation)
function square_num_roof (line 1114) | int square_num_roof(int screenX, int screenY, int elevation)
function square_xy (line 1129) | void square_xy(int screenX, int screenY, int elevation, int* coordX, int...
function square_xy_roof (line 1151) | void square_xy_roof(int screenX, int screenY, int elevation, int* coordX...
function square_render_roof (line 1174) | void square_render_roof(Rect* rect, int elevation)
function roof_fill_on (line 1232) | static void roof_fill_on(int a1, int a2, int elevation)
function tile_fill_roof (line 1262) | void tile_fill_roof(int a1, int a2, int elevation, int a4)
function roof_fill_off (line 1272) | static void roof_fill_off(int a1, int a2, int elevation)
function roof_draw (line 1302) | static void roof_draw(int fid, int x, int y, Rect* rect, int light)
function square_render_floor (line 1412) | void square_render_floor(Rect* rect, int elevation)
function square_roof_intersect (line 1461) | bool square_roof_intersect(int x, int y, int elevation)
function grid_toggle (line 1505) | void grid_toggle()
function grid_on (line 1513) | void grid_on()
function grid_off (line 1521) | void grid_off()
function get_grid_flag (line 1527) | int get_grid_flag()
function grid_render (line 1533) | void grid_render(Rect* rect, int elevation)
function grid_draw (line 1548) | void grid_draw(int tile, int elevation)
function draw_grid (line 1563) | void draw_grid(int tile, int elevation, Rect* rect)
function floor_draw (line 1616) | void floor_draw(int fid, int x, int y, Rect* rect)
function tile_make_line (line 1857) | int tile_make_line(int from, int to, int* tiles, int tilesCapacity)
function tile_scroll_to (line 1969) | int tile_scroll_to(int tile, int flags)
FILE: src/game/trait.c
type TraitDescription (line 12) | typedef struct TraitDescription {
function trait_init (line 55) | int trait_init()
function trait_reset (line 89) | void trait_reset()
function trait_exit (line 97) | void trait_exit()
function trait_load (line 105) | int trait_load(File* stream)
function trait_save (line 113) | int trait_save(File* stream)
function trait_set (line 121) | void trait_set(int trait1, int trait2)
function trait_get (line 130) | void trait_get(int* trait1, int* trait2)
function trait_pic (line 158) | int trait_pic(int trait)
function trait_level (line 166) | bool trait_level(int trait)
function trait_adjust_stat (line 174) | int trait_adjust_stat(int stat)
function trait_adjust_skill (line 278) | int trait_adjust_skill(int skill)
FILE: src/game/trait_defs.h
type Trait (line 8) | typedef enum Trait {
FILE: src/game/trap.c
type TrapEntry (line 8) | typedef struct TrapEntry {
type DuplicateEntry (line 15) | typedef struct DuplicateEntry {
function trap_exit (line 37) | void trap_exit()
function trap_init (line 42) | void trap_init()
function trap_report (line 47) | static void trap_report(int trap, int address, const char* file, int line)
function duplicate_report (line 64) | static void duplicate_report(int trap, int offset, const char* file, int...
function heap_report (line 84) | static void heap_report(int trap, int address, const char* file, int line)
FILE: src/game/version.c
function getverstr (line 6) | void getverstr(char* dest)
FILE: src/game/wordwrap.c
function word_wrap (line 10) | int word_wrap(const char* string, int width, short* breakpoints, short* ...
FILE: src/game/worldmap.c
type EncounterFormationType (line 99) | typedef enum EncounterFormationType {
type EncounterFrequencyType (line 109) | typedef enum EncounterFrequencyType {
type EncounterSceneryType (line 119) | typedef enum EncounterSceneryType {
type EncounterSituation (line 127) | typedef enum EncounterSituation {
type EncounterLogicalOperator (line 135) | typedef enum EncounterLogicalOperator {
type EncounterConditionType (line 141) | typedef enum EncounterConditionType {
type EncounterConditionalOperator (line 151) | typedef enum EncounterConditionalOperator {
type Daytime (line 160) | typedef enum Daytime {
type LockState (line 167) | typedef enum LockState {
type SubtileState (line 172) | typedef enum SubtileState {
type WorldMapEncounterFrm (line 178) | typedef enum WorldMapEncounterFrm {
type WorldmapArrowFrm (line 186) | typedef enum WorldmapArrowFrm {
type CitySize (line 192) | typedef enum CitySize {
type EntranceInfo (line 199) | typedef struct EntranceInfo {
type CityInfo (line 209) | typedef struct CityInfo {
type MapAmbientSoundEffectInfo (line 224) | typedef struct MapAmbientSoundEffectInfo {
type MapStartPointInfo (line 229) | typedef struct MapStartPointInfo {
type MapInfo (line 235) | typedef struct MapInfo {
type Terrain (line 248) | typedef struct Terrain {
type EncounterConditionEntry (line 255) | typedef struct EncounterConditionEntry {
type EncounterCondition (line 262) | typedef struct EncounterCondition {
type ENCOUNTER_ENTRY_ENC (line 268) | typedef struct ENCOUNTER_ENTRY_ENC {
type EncounterEntry (line 275) | typedef struct EncounterEntry {
type EncounterTable (line 286) | typedef struct EncounterTable {
type ENC_BASE_TYPE_38_48 (line 296) | typedef struct ENC_BASE_TYPE_38_48 {
type ENC_BASE_TYPE_38 (line 303) | typedef struct ENC_BASE_TYPE_38 {
type ENC_BASE_TYPE (line 319) | typedef struct ENC_BASE_TYPE {
type SubtileInfo (line 328) | typedef struct SubtileInfo {
type TileInfo (line 337) | typedef struct TileInfo {
type CitySizeDescription (line 347) | typedef struct CitySizeDescription {
type WmGenData (line 355) | typedef struct WmGenData {
function wmSetFlags (line 835) | static void wmSetFlags(int* flagsPtr, int flag, int value)
function wmWorldMap_init (line 845) | int wmWorldMap_init()
function wmGenDataInit (line 878) | static int wmGenDataInit()
function wmGenDataReset (line 984) | static int wmGenDataReset()
function wmWorldMap_exit (line 1069) | void wmWorldMap_exit()
function wmWorldMap_reset (line 1120) | int wmWorldMap_reset()
function wmWorldMap_save (line 1132) | int wmWorldMap_save(File* stream)
function wmWorldMap_load (line 1215) | int wmWorldMap_load(File* stream)
function wmWorldMapSaveTempData (line 1295) | static int wmWorldMapSaveTempData()
function wmWorldMapLoadTempData (line 1313) | static int wmWorldMapLoadTempData()
function wmConfigInit (line 1331) | static int wmConfigInit()
function wmReadEncounterType (line 1434) | static int wmReadEncounterType(Config* config, char* lookupName, char* s...
function wmParseEncounterTableIndex (line 1496) | static int wmParseEncounterTableIndex(EncounterEntry* entry, char* string)
function wmParseEncounterSubEncStr (line 1539) | static int wmParseEncounterSubEncStr(EncounterEntry* encounterEntry, cha...
function wmParseFindSubEncTypeMatch (line 1643) | static int wmParseFindSubEncTypeMatch(char* str, int* valuePtr)
function wmFindEncBaseTypeMatch (line 1664) | static int wmFindEncBaseTypeMatch(char* str, int* valuePtr)
function wmReadEncBaseType (line 1678) | static int wmReadEncBaseType(char* name, int* valuePtr)
function wmParseEncBaseSubTypeStr (line 1744) | static int wmParseEncBaseSubTypeStr(ENC_BASE_TYPE_38* ptr, char** string...
function wmEncBaseTypeSlotInit (line 1787) | static int wmEncBaseTypeSlotInit(ENC_BASE_TYPE* entry)
function wmEncBaseSubTypeSlotInit (line 1801) | static int wmEncBaseSubTypeSlotInit(ENC_BASE_TYPE_38* entry)
function wmEncounterSubEncSlotInit (line 1820) | static int wmEncounterSubEncSlotInit(ENCOUNTER_ENTRY_ENC* entry)
function wmEncounterTypeSlotInit (line 1833) | static int wmEncounterTypeSlotInit(EncounterEntry* entry)
function wmEncounterTableSlotInit (line 1848) | static int wmEncounterTableSlotInit(EncounterTable* encounterTable)
function wmTileSlotInit (line 1861) | static int wmTileSlotInit(TileInfo* tile)
function wmTerrainTypeSlotInit (line 1876) | static int wmTerrainTypeSlotInit(Terrain* terrain)
function wmConditionalDataInit (line 1886) | static int wmConditionalDataInit(EncounterCondition* condition)
function wmParseTerrainTypes (line 1906) | static int wmParseTerrainTypes(Config* config, char* string)
function wmParseTerrainRndMaps (line 1971) | static int wmParseTerrainRndMaps(Config* config, Terrain* terrain)
function wmParseSubTileInfo (line 2000) | static int wmParseSubTileInfo(TileInfo* tile, int row, int column, char*...
function wmParseFindEncounterTypeMatch (line 2027) | static int wmParseFindEncounterTypeMatch(char* string, int* valuePtr)
function wmParseFindTerrainTypeMatch (line 2044) | static int wmParseFindTerrainTypeMatch(char* string, int* valuePtr)
function wmParseEncounterItemType (line 2062) | static int wmParseEncounterItemType(char** stringPtr, ENC_BASE_TYPE_38_4...
function wmParseItemType (line 2108) | static int wmParseItemType(char* string, ENC_BASE_TYPE_38_48* ptr)
function wmParseConditional (line 2169) | static int wmParseConditional(char** stringPtr, const char* a2, Encounte...
function wmParseSubConditional (line 2200) | static int wmParseSubConditional(char** stringPtr, const char* a2, int* ...
function wmParseConditionalEval (line 2404) | static int wmParseConditionalEval(char** stringPtr, int* conditionalOper...
function wmAreaSlotInit (line 2436) | static int wmAreaSlotInit(CityInfo* area)
function wmAreaInit (line 2454) | static int wmAreaInit()
function wmParseFindMapIdxMatch (line 2615) | static int wmParseFindMapIdxMatch(char* string, int* valuePtr)
function wmEntranceSlotInit (line 2634) | static int wmEntranceSlotInit(EntranceInfo* entrance)
function wmMapSlotInit (line 2648) | static int wmMapSlotInit(MapInfo* map)
function wmMapInit (line 2663) | static int wmMapInit()
function wmRStartSlotInit (line 2824) | static int wmRStartSlotInit(MapStartPointInfo* rsp)
function wmMapMaxCount (line 2834) | int wmMapMaxCount()
function wmMapIdxToName (line 2840) | int wmMapIdxToName(int mapIdx, char* dest)
function wmMapMatchNameToIdx (line 2852) | int wmMapMatchNameToIdx(char* name)
function wmMapIdxIsSaveable (line 2884) | bool wmMapIdxIsSaveable(int mapIdx)
function wmMapIsSaveable (line 2890) | bool wmMapIsSaveable()
function wmMapDeadBodiesAge (line 2896) | bool wmMapDeadBodiesAge()
function wmMapCanRestHere (line 2902) | bool wmMapCanRestHere(int elevation)
function wmMapPipboyActive (line 2917) | bool wmMapPipboyActive()
function wmMapMarkVisited (line 2923) | int wmMapMarkVisited(int mapIdx)
function wmMatchEntranceFromMap (line 2946) | static int wmMatchEntranceFromMap(int areaIdx, int mapIdx, int* entrance...
function wmMatchEntranceElevFromMap (line 2964) | static int wmMatchEntranceElevFromMap(int cityIdx, int map, int elevatio...
function wmMatchAreaFromMap (line 2983) | static int wmMatchAreaFromMap(int mapIdx, int* cityIdxPtr)
function wmMapMarkMapEntranceState (line 3004) | int wmMapMarkMapEntranceState(int mapIdx, int elevation, int state)
function wmWorldMap (line 3033) | void wmWorldMap()
function wmWorldMapFunc (line 3039) | static int wmWorldMapFunc(int a1)
function wmCheckGameAreaEvents (line 3297) | int wmCheckGameAreaEvents()
function wmInterfaceCenterOnParty (line 3315) | static int wmInterfaceCenterOnParty()
function wmCheckGameEvents (line 3349) | static void wmCheckGameEvents()
function wmRndEncounterOccurred (line 3355) | static int wmRndEncounterOccurred()
function wmPartyFindCurSubTile (line 3547) | static int wmPartyFindCurSubTile()
function wmFindCurSubTileFromPos (line 3553) | static int wmFindCurSubTileFromPos(int x, int y, SubtileInfo** subtilePtr)
function wmFindCurTileFromPos (line 3568) | static int wmFindCurTileFromPos(int x, int y, TileInfo** tilePtr)
function wmRndEncounterPick (line 3577) | static int wmRndEncounterPick()
function wmSetupRandomEncounter (line 3680) | int wmSetupRandomEncounter()
function wmSetupCritterObjs (line 3795) | static int wmSetupCritterObjs(int type_idx, Object** critterPtr, int cri...
function wmSetupRndNextTileNumInit (line 3928) | static int wmSetupRndNextTileNumInit(ENC_BASE_TYPE* a1)
function wmSetupRndNextTileNum (line 3992) | static int wmSetupRndNextTileNum(ENC_BASE_TYPE* a1, ENC_BASE_TYPE_38* a2...
function wmEvalTileNumForPlacement (line 4108) | bool wmEvalTileNumForPlacement(int tile)
function wmEvalConditional (line 4122) | static bool wmEvalConditional(EncounterCondition* a1, int* a2)
function wmEvalSubConditional (line 4181) | static bool wmEvalSubConditional(int operand1, int condionalOperator, in...
function wmGameTimeIncrement (line 4198) | static bool wmGameTimeIncrement(int a1)
function wmGrabTileWalkMask (line 4228) | static int wmGrabTileWalkMask(int tileIdx)
function wmWorldPosInvalid (line 4264) | static bool wmWorldPosInvalid(int x, int y)
function wmPartyInitWalking (line 4286) | static void wmPartyInitWalking(int x, int y)
function wmPartyWalkingStep (line 4332) | static void wmPartyWalkingStep()
function wmInterfaceScrollTabsStart (line 4402) | static void wmInterfaceScrollTabsStart(int delta)
function wmInterfaceScrollTabsStop (line 4443) | static void wmInterfaceScrollTabsStop()
function wmInterfaceScrollTabsUpdate (line 4457) | static void wmInterfaceScrollTabsUpdate()
function wmInterfaceInit (line 4478) | static int wmInterfaceInit()
function wmInterfaceExit (line 4858) | static int wmInterfaceExit()
function wmInterfaceScroll (line 5026) | static int wmInterfaceScroll(int dx, int dy, bool* successPtr)
function wmInterfaceScrollPixel (line 5038) | static int wmInterfaceScrollPixel(int stepX, int stepY, int dx, int dy, ...
function wmMouseBkProc (line 5108) | static void wmMouseBkProc()
function wmMarkSubTileOffsetVisited (line 5186) | static int wmMarkSubTileOffsetVisited(int tile, int subtileX, int subtil...
function wmMarkSubTileOffsetKnown (line 5194) | static int wmMarkSubTileOffsetKnown(int tile, int subtileX, int subtileY...
function wmMarkSubTileOffsetVisitedFunc (line 5200) | static int wmMarkSubTileOffsetVisitedFunc(int tile, int subtileX, int su...
function wmMarkSubTileRadiusVisited (line 5258) | static void wmMarkSubTileRadiusVisited(int x, int y)
function wmSubTileMarkRadiusVisited (line 5270) | int wmSubTileMarkRadiusVisited(int x, int y, int
Condensed preview — 262 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (4,484K chars).
[
{
"path": ".clang-format",
"chars": 70,
"preview": "BasedOnStyle: WebKit\nAllowShortIfStatementsOnASingleLine: WithoutElse\n"
},
{
"path": ".editorconfig",
"chars": 148,
"preview": "root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\nindent_size = 4\nindent_style = space\ninsert_final_newline = true\ntrim_"
},
{
"path": ".gitattributes",
"chars": 246,
"preview": "# Force LF\n*.c text eol=lf\n*.h text eol=lf\n*.md text eol=lf\n*.json text eol=lf\n*.yml text eol=lf\n.clang-format text eol="
},
{
"path": ".github/workflows/ci-build.yml",
"chars": 876,
"preview": "name: CI\n\non:\n push:\n branches:\n - main\n pull_request:\n types:\n - opened\n - synchronize\n\ndefaults"
},
{
"path": ".gitignore",
"chars": 6647,
"preview": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n##\n## G"
},
{
"path": "CMakeLists.txt",
"chars": 6861,
"preview": "cmake_minimum_required(VERSION 3.13)\n\nset(EXECUTABLE_NAME fallout2-re)\n\nproject(${EXECUTABLE_NAME})\n\nadd_executable(${EX"
},
{
"path": "CMakeSettings.json",
"chars": 776,
"preview": "{\n \"configurations\": [\n {\n \"name\": \"x86-Debug\",\n \"generator\": \"Visual Studio 16 2019\",\n \"configuratio"
},
{
"path": "LICENSE.md",
"chars": 3599,
"preview": "# Sustainable Use License\n\nVersion 1.0\n\n## Acceptance\n\nBy using the software, you agree to all of the terms and conditio"
},
{
"path": "README.md",
"chars": 2146,
"preview": "# Fallout 2 Reference Edition\n\nIn this repository you'll find reverse engineered source code for Fallout 2.\n\nAs a player"
},
{
"path": "src/game/ability.c",
"chars": 5447,
"preview": "#include \"game/ability.h\"\n\n#include <string.h>\n\n#include \"plib/gnw/memory.h\"\n\n// 0x410010\nint abil_init(Ability* ability"
},
{
"path": "src/game/ability.h",
"chars": 929,
"preview": "#ifndef FALLOUT_GAME_ABILITY_H_\n#define FALLOUT_GAME_ABILITY_H_\n\n#include \"plib/db/db.h\"\n\ntypedef struct AbilityData {\n "
},
{
"path": "src/game/actions.c",
"chars": 71887,
"preview": "#include \"game/actions.h\"\n\n#include <limits.h>\n#include <string.h>\n\n#include \"game/anim.h\"\n#include \"plib/color/color.h\""
},
{
"path": "src/game/actions.h",
"chars": 1933,
"preview": "#ifndef FALLOUT_GAME_ACTIONS_H_\n#define FALLOUT_GAME_ACTIONS_H_\n\n#include <stdbool.h>\n\n#include \"game/combat_defs.h\"\n#in"
},
{
"path": "src/game/amutex.c",
"chars": 494,
"preview": "#include \"game/amutex.h\"\n\n#define WIN32_LEAN_AND_MEAN\n#include <windows.h>\n\n// 0x530010\nstatic HANDLE autorun_mutex;\n\n//"
},
{
"path": "src/game/amutex.h",
"chars": 181,
"preview": "#ifndef FALLOUT_GAME_AMUTEX_H_\n#define FALLOUT_GAME_AMUTEX_H_\n\n#include <stdbool.h>\n\nbool autorun_mutex_create();\nvoid a"
},
{
"path": "src/game/anim.c",
"chars": 102106,
"preview": "#include \"game/anim.h\"\n\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/art.h\"\n#include \"plib/color/color.h\"\n#inc"
},
{
"path": "src/game/anim.h",
"chars": 6589,
"preview": "#ifndef ANIMATION_H\n#define ANIMATION_H\n\n#include <stdbool.h>\n\n#include \"game/object_types.h\"\n\ntypedef enum AnimationReq"
},
{
"path": "src/game/art.c",
"chars": 25632,
"preview": "#include \"game/art.h\"\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"game/anim.h\"\n#include \"game"
},
{
"path": "src/game/art.h",
"chars": 5085,
"preview": "#ifndef FALLOUT_GAME_ART_H_\n#define FALLOUT_GAME_ART_H_\n\n#include \"game/cache.h\"\n#include \"game/heap.h\"\n#include \"game/o"
},
{
"path": "src/game/artload.c",
"chars": 5424,
"preview": "#include \"game/artload.h\"\n\n#include \"plib/gnw/memory.h\"\n\nstatic int art_readSubFrameData(unsigned char* data, File* stre"
},
{
"path": "src/game/artload.h",
"chars": 434,
"preview": "#ifndef FALLOUT_GAME_ARTLOAD_H_\n#define FALLOUT_GAME_ARTLOAD_H_\n\n#include \"game/art.h\"\n#include \"plib/db/db.h\"\n\nint load"
},
{
"path": "src/game/automap.c",
"chars": 29731,
"preview": "#include \"game/automap.h\"\n\n#include <stdio.h>\n#include <string.h>\n\n#include \"plib/color/color.h\"\n#include \"game/config.h"
},
{
"path": "src/game/automap.h",
"chars": 1389,
"preview": "#ifndef FALLOUT_GAME_AUTOMAP_H_\n#define FALLOUT_GAME_AUTOMAP_H_\n\n#include <stdbool.h>\n\n#include \"plib/db/db.h\"\n#include "
},
{
"path": "src/game/bmpdlog.c",
"chars": 48321,
"preview": "#include \"game/bmpdlog.h\"\n\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/art.h\"\n#include \"game/editor.h\"\n#inclu"
},
{
"path": "src/game/bmpdlog.h",
"chars": 1709,
"preview": "#ifndef FALLOUT_GAME_BMPDLOG_H_\n#define FALLOUT_GAME_BMPDLOG_H_\n\ntypedef enum DialogBoxOptions {\n DIALOG_BOX_LARGE = "
},
{
"path": "src/game/cache.c",
"chars": 19779,
"preview": "#include \"game/cache.h\"\n\n#include <limits.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"plib/"
},
{
"path": "src/game/cache.h",
"chars": 2535,
"preview": "#ifndef FALLOUT_GAME_CACHE_H_\n#define FALLOUT_GAME_CACHE_H_\n\n#include <stdbool.h>\n\n#include \"game/heap.h\"\n\n#define INVAL"
},
{
"path": "src/game/cd.c",
"chars": 2471,
"preview": "#include \"game/cd.h\"\n\n// NOTE: Actual file name is unknown. Functions in this module do not present\n// in debug symbols "
},
{
"path": "src/game/cd.h",
"chars": 296,
"preview": "#ifndef FALLOUT_GAME_CD_H_\n#define FALLOUT_GAME_CD_H_\n\nint sub_420B10(const char* a1);\nint sub_420B28(const char* a1, co"
},
{
"path": "src/game/combat.c",
"chars": 205292,
"preview": "#include \"game/combat.h\"\n\n#include <limits.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/actions.h\"\n#include"
},
{
"path": "src/game/combat.h",
"chars": 3278,
"preview": "#ifndef FALLOUT_GAME_COMBAT_H_\n#define FALLOUT_GAME_COMBAT_H_\n\n#include \"game/anim.h\"\n#include \"game/combat_defs.h\"\n#inc"
},
{
"path": "src/game/combat_defs.h",
"chars": 4452,
"preview": "#ifndef FALLOUT_GAME_COMBAT_DEFS_H_\n#define FALLOUT_GAME_COMBAT_DEFS_H_\n\n#include \"game/object_types.h\"\n\n#define EXPLOSI"
},
{
"path": "src/game/combatai.c",
"chars": 98753,
"preview": "#include \"game/combatai.h\"\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"game/actions.h\"\n#inclu"
},
{
"path": "src/game/combatai.h",
"chars": 4056,
"preview": "#ifndef FALLOUT_GAME_COMBATAI_H_\n#define FALLOUT_GAME_COMBATAI_H_\n\n#include <stdbool.h>\n\n#include \"game/combatai_defs.h\""
},
{
"path": "src/game/combatai_defs.h",
"chars": 1869,
"preview": "#ifndef FALLOUT_GAME_COMBATAI_DEFS_H_\n#define FALLOUT_GAME_COMBATAI_DEFS_H_\n\ntypedef enum AreaAttackMode {\n AREA_ATTA"
},
{
"path": "src/game/config.c",
"chars": 13352,
"preview": "#include \"game/config.h\"\n\n#include <ctype.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"plib/"
},
{
"path": "src/game/config.h",
"chars": 1710,
"preview": "#ifndef FALLOUT_GAME_CONFIG_H_\n#define FALLOUT_GAME_CONFIG_H_\n\n#include <stdbool.h>\n\n#include \"plib/assoc/assoc.h\"\n\n// A"
},
{
"path": "src/game/counter.c",
"chars": 1037,
"preview": "#include \"game/counter.h\"\n\n#include <time.h>\n\n#include \"plib/gnw/input.h\"\n#include \"plib/gnw/debug.h\"\n\nstatic void count"
},
{
"path": "src/game/counter.h",
"chars": 216,
"preview": "#ifndef FALLOUT_GAME_COUNTER_H_\n#define FALLOUT_GAME_COUNTER_H_\n\ntypedef void(CounterOutputFunc)(double a1);\n\nvoid count"
},
{
"path": "src/game/credits.c",
"chars": 11048,
"preview": "#include \"game/credits.h\"\n\n#include <string.h>\n\n#include \"game/art.h\"\n#include \"plib/color/color.h\"\n#include \"plib/gnw/i"
},
{
"path": "src/game/credits.h",
"chars": 147,
"preview": "#ifndef CREDITS_H\n#define CREDITS_H\n\n#include <stdbool.h>\n\nvoid credits(const char* path, int fid, bool useReversedStyle"
},
{
"path": "src/game/critter.c",
"chars": 34899,
"preview": "#include \"game/critter.h\"\n\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/anim.h\"\n#include \"game/editor.h\"\n#incl"
},
{
"path": "src/game/critter.h",
"chars": 3942,
"preview": "#ifndef FALLOUT_GAME_CRITTER_H_\n#define FALLOUT_GAME_CRITTER_H_\n\n#include <stdbool.h>\n\n#include \"plib/db/db.h\"\n#include "
},
{
"path": "src/game/cycle.c",
"chars": 7044,
"preview": "#include \"game/cycle.h\"\n\n#include \"plib/color/color.h\"\n#include \"plib/gnw/input.h\"\n#include \"game/gconfig.h\"\n#include \"g"
},
{
"path": "src/game/cycle.h",
"chars": 480,
"preview": "#ifndef FALLOUT_GAME_CYCLE_H_\n#define FALLOUT_GAME_CYCLE_H_\n\n#include <stdbool.h>\n\nextern unsigned char slime[12];\nexter"
},
{
"path": "src/game/diskspce.c",
"chars": 883,
"preview": "#include \"game/diskspce.h\"\n\n#include <ctype.h>\n#include <direct.h>\n#include <stdlib.h>\n\n#include \"game/gconfig.h\"\n\n// 0x"
},
{
"path": "src/game/diskspce.h",
"chars": 148,
"preview": "#ifndef FALLOUT_GAME_DISKSPCE_H_\n#define FALLOUT_GAME_DISKSPCE_H_\n\nint GetFreeDiskSpace(long* diskSpacePtr);\n\n#endif /* "
},
{
"path": "src/game/display.c",
"chars": 9302,
"preview": "#include \"game/display.h\"\n\n#include <stdbool.h>\n#include <string.h>\n\n#include \"game/art.h\"\n#include \"plib/color/color.h\""
},
{
"path": "src/game/display.h",
"chars": 527,
"preview": "#ifndef FALLOUT_GAME_DISPLAY_H_\n#define FALLOUT_GAME_DISPLAY_H_\n\nint display_init();\nint display_reset();\nvoid display_e"
},
{
"path": "src/game/editor.c",
"chars": 204402,
"preview": "#include \"game/editor.h\"\n\n#include <assert.h>\n#include <ctype.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/"
},
{
"path": "src/game/editor.h",
"chars": 990,
"preview": "#ifndef FALLOUT_GAME_EDITOR_H_\n#define FALLOUT_GAME_EDITOR_H_\n\n#include \"plib/db/db.h\"\n\n#define TOWN_REPUTATION_COUNT 19"
},
{
"path": "src/game/elevator.c",
"chars": 17026,
"preview": "#include \"game/elevator.h\"\n\n#include <ctype.h>\n#include <string.h>\n\n#include \"plib/gnw/input.h\"\n#include \"game/art.h\"\n#i"
},
{
"path": "src/game/elevator.h",
"chars": 949,
"preview": "#ifndef FALLOUT_GAME_ELEVATOR_H_\n#define FALLOUT_GAME_ELEVATOR_H_\n\ntypedef enum Elevator {\n ELEVATOR_BROTHERHOOD_OF_S"
},
{
"path": "src/game/endgame.c",
"chars": 29859,
"preview": "#include \"game/endgame.h\"\n\n#include <ctype.h>\n#include <limits.h>\n#include <math.h>\n#include <stdbool.h>\n#include <stdio"
},
{
"path": "src/game/endgame.h",
"chars": 562,
"preview": "#ifndef FALLOUT_GAME_ENDGAME_H_\n#define FALLOUT_GAME_ENDGAME_H_\n\ntypedef enum EndgameDeathEndingReason {\n // Dude die"
},
{
"path": "src/game/ereg.c",
"chars": 1362,
"preview": "#include \"game/ereg.h\"\n\n#define WIN32_LEAN_AND_MEAN\n#include <windows.h>\n\n#include \"game/gconfig.h\"\n\n// 0x440DD0\nvoid an"
},
{
"path": "src/game/ereg.h",
"chars": 113,
"preview": "#ifndef FALLOUT_GAME_EREG_H_\n#define FALLOUT_GAME_EREG_H_\n\nvoid annoy_user();\n\n#endif /* FALLOUT_GAME_EREG_H_ */\n"
},
{
"path": "src/game/fontmgr.c",
"chars": 8678,
"preview": "#include \"game/fontmgr.h\"\n\n#include <stdbool.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"plib/color/color.h\"\n#i"
},
{
"path": "src/game/fontmgr.h",
"chars": 483,
"preview": "#ifndef FALLOUT_GAME_FONTMGR_H_\n#define FALLOUT_GAME_FONTMGR_H_\n\nint FMInit();\nvoid FMExit();\nvoid FMtext_font(int font)"
},
{
"path": "src/game/game.c",
"chars": 33463,
"preview": "#include \"game/game.h\"\n\n#include <io.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"int/window.h\"\n#include \"game/a"
},
{
"path": "src/game/game.h",
"chars": 1140,
"preview": "#ifndef FALLOUT_GAME_GAME_H_\n#define FALLOUT_GAME_GAME_H_\n\n#include <stdbool.h>\n\n#include \"game/game_vars.h\"\n#include \"g"
},
{
"path": "src/game/game_vars.h",
"chars": 19613,
"preview": "#ifndef GAME_VARS_H\n#define GAME_VARS_H\n\ntypedef enum GameGlobalVar {\n GVAR_PLAYER_REPUTATION,\n GVAR_CHILDKILLER_R"
},
{
"path": "src/game/gconfig.c",
"chars": 8966,
"preview": "#include \"game/gconfig.h\"\n\n#include <stdio.h>\n#include <string.h>\n\n// A flag indicating if [game_config] was initialized"
},
{
"path": "src/game/gconfig.h",
"chars": 4912,
"preview": "#ifndef FALLOUT_GAME_GCONFIG_H_\n#define FALLOUT_GAME_GCONFIG_H_\n\n#include <stdbool.h>\n\n#include \"game/config.h\"\n\n// The "
},
{
"path": "src/game/gdebug.c",
"chars": 562,
"preview": "#include \"game/gdebug.h\"\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"plib/gnw/debug.h\"\n#inclu"
},
{
"path": "src/game/gdebug.h",
"chars": 187,
"preview": "#ifndef FALLOUT_GAME_GDEBUG_H_\n#define FALLOUT_GAME_GDEBUG_H_\n\nvoid fatal_error(const char* format, const char* message,"
},
{
"path": "src/game/gdialog.c",
"chars": 134895,
"preview": "#include \"game/gdialog.h\"\n\n#include <assert.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"int/window.h\"\n#include "
},
{
"path": "src/game/gdialog.h",
"chars": 1587,
"preview": "#ifndef FALLOUT_GAME_GDIALOG_H_\n#define FALLOUT_GAME_GDIALOG_H_\n\n#include <stdbool.h>\n\n#include \"game/art.h\"\n#include \"i"
},
{
"path": "src/game/gmemory.c",
"chars": 1134,
"preview": "#include \"game/gmemory.h\"\n\n#include \"plib/db/db.h\"\n#include \"plib/assoc/assoc.h\"\n#include \"plib/gnw/memory.h\"\n#include \""
},
{
"path": "src/game/gmemory.h",
"chars": 388,
"preview": "#ifndef FALLOUT_GAME_GMEMORY_H_\n#define FALLOUT_GAME_GMEMORY_H_\n\n#include <stddef.h>\n\nvoid* localmymalloc(size_t size);\n"
},
{
"path": "src/game/gmouse.c",
"chars": 73372,
"preview": "#include \"game/gmouse.h\"\n\n#include <assert.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/art.h\"\n#include \"ga"
},
{
"path": "src/game/gmouse.h",
"chars": 3838,
"preview": "#ifndef FALLOUT_GAME_GMOUSE_H_\n#define FALLOUT_GAME_GMOUSE_H_\n\n#include <stdbool.h>\n\n#include \"game/object_types.h\"\n\ntyp"
},
{
"path": "src/game/gmovie.c",
"chars": 7873,
"preview": "#include \"game/gmovie.h\"\n\n#include <stdio.h>\n#include <string.h>\n\n#define WIN32_LEAN_AND_MEAN\n#include <windows.h>\n\n#inc"
},
{
"path": "src/game/gmovie.h",
"chars": 930,
"preview": "#ifndef FALLOUT_GAME_GMOVIE_H_\n#define FALLOUT_GAME_GMOVIE_H_\n\n#include <stdbool.h>\n\n#include \"plib/db/db.h\"\n\ntypedef en"
},
{
"path": "src/game/graphlib.c",
"chars": 9510,
"preview": "#include \"game/graphlib.h\"\n\n#include <string.h>\n\n#include \"plib/color/color.h\"\n#include \"plib/gnw/debug.h\"\n#include \"pli"
},
{
"path": "src/game/graphlib.h",
"chars": 536,
"preview": "#ifndef FALLOUT_GAME_GRAPHLIB_H_\n#define FALLOUT_GAME_GRAPHLIB_H_\n\nextern int* dad;\nextern int match_length;\nextern int "
},
{
"path": "src/game/gsound.c",
"chars": 50211,
"preview": "#include \"game/gsound.h\"\n\n#include <stdio.h>\n#include <string.h>\n\n#define WIN32_LEAN_AND_MEAN\n#include <windows.h>\n\n#inc"
},
{
"path": "src/game/gsound.h",
"chars": 4185,
"preview": "#ifndef FALLOUT_GAME_GSOUND_H_\n#define FALLOUT_GAME_GSOUND_H_\n\n#include <stdbool.h>\n\n#include \"game/object_types.h\"\n#inc"
},
{
"path": "src/game/gz.c",
"chars": 3379,
"preview": "// NOTE: For unknown reason functions in this module use __stdcall instead\n// of regular __usercall.\n\n#include \"game/gz."
},
{
"path": "src/game/gz.h",
"chars": 332,
"preview": "#ifndef FALLOUT_GAME_GZ_H_\n#define FALLOUT_GAME_GZ_H_\n\nint gzRealUncompressCopyReal_file(const char* existingFilePath, c"
},
{
"path": "src/game/heap.c",
"chars": 43117,
"preview": "#include \"game/heap.h\"\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"plib/gnw/debug.h\"\n#include"
},
{
"path": "src/game/heap.h",
"chars": 876,
"preview": "#ifndef FALLOUT_GAME_HEAP_H_\n#define FALLOUT_GAME_HEAP_H_\n\n#include <stdbool.h>\n\ntypedef struct HeapHandle {\n unsigne"
},
{
"path": "src/game/intface.c",
"chars": 81006,
"preview": "#include \"game/intface.h\"\n\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/art.h\"\n#include \"game/anim.h\"\n#include"
},
{
"path": "src/game/intface.h",
"chars": 1889,
"preview": "#ifndef FALLOUT_GAME_INTFACE_H_\n#define FALLOUT_GAME_INTFACE_H_\n\n#include <stdbool.h>\n\n#include \"plib/db/db.h\"\n#include "
},
{
"path": "src/game/inventry.c",
"chars": 178719,
"preview": "#include \"game/inventry.h\"\n\n#include <assert.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/actions.h\"\n#inclu"
},
{
"path": "src/game/inventry.h",
"chars": 3577,
"preview": "#ifndef FALLOUT_GAME_INVENTRY_H_\n#define FALLOUT_GAME_INVENTRY_H_\n\n#include <stdbool.h>\n\n#include \"game/art.h\"\n#include "
},
{
"path": "src/game/item.c",
"chars": 79008,
"preview": "#include \"game/item.h\"\n\n#include <string.h>\n\n#include \"game/anim.h\"\n#include \"game/automap.h\"\n#include \"game/combat.h\"\n#"
},
{
"path": "src/game/item.h",
"chars": 5333,
"preview": "#ifndef FALLOUT_GAME_ITEM_H_\n#define FALLOUT_GAME_ITEM_H_\n\n#include <stdbool.h>\n\n#include \"plib/db/db.h\"\n#include \"game/"
},
{
"path": "src/game/light.c",
"chars": 3166,
"preview": "#include \"game/light.h\"\n\n#include <math.h>\n\n#include \"game/map_defs.h\"\n#include \"game/object.h\"\n#include \"game/perk.h\"\n#"
},
{
"path": "src/game/light.h",
"chars": 977,
"preview": "#ifndef FALLOUT_GAME_LIGHT_H_\n#define FALLOUT_GAME_LIGHT_H_\n\n#include <stdbool.h>\n\n#define LIGHT_LEVEL_MAX 65536\n#define"
},
{
"path": "src/game/lip_sync.c",
"chars": 13569,
"preview": "#include \"game/lip_sync.h\"\n\n#include <stdio.h>\n#include <string.h>\n\n#include \"int/audio.h\"\n#include \"plib/gnw/input.h\"\n#"
},
{
"path": "src/game/lip_sync.h",
"chars": 1277,
"preview": "#ifndef FALLOUT_GAME_LIP_SYNC_H_\n#define FALLOUT_GAME_LIP_SYNC_H_\n\n#include <stdbool.h>\n#include <stddef.h>\n\n#include \"p"
},
{
"path": "src/game/loadsave.c",
"chars": 79358,
"preview": "#include \"game/loadsave.h\"\n\n#include <assert.h>\n#include <direct.h>\n#include <stdio.h>\n#include <string.h>\n#include <tim"
},
{
"path": "src/game/loadsave.h",
"chars": 770,
"preview": "#ifndef FALLOUT_GAME_LOADSAVE_H_\n#define FALLOUT_GAME_LOADSAVE_H_\n\n#include <stdbool.h>\n\n#define WIN32_LEAN_AND_MEAN\n#in"
},
{
"path": "src/game/main.c",
"chars": 18171,
"preview": "#include \"main.h\"\n\n// NOTE: Actual file name is unknown. Functions in this module do not present\n// in debug symbols fro"
},
{
"path": "src/game/main.h",
"chars": 161,
"preview": "#ifndef FALLOUT_GAME_MAIN_H_\n#define FALLOUT_GAME_MAIN_H_\n\nextern int main_game_paused;\n\nint RealMain(int argc, char** a"
},
{
"path": "src/game/mainmenu.c",
"chars": 9052,
"preview": "#include \"game/mainmenu.h\"\n\n#include <ctype.h>\n#include <limits.h>\n#include <string.h>\n\n#include \"game/art.h\"\n#include \""
},
{
"path": "src/game/mainmenu.h",
"chars": 719,
"preview": "#ifndef FALLOUT_GAME_MAINMENU_H_\n#define FALLOUT_GAME_MAINMENU_H_\n\n#include <stdbool.h>\n\ntypedef enum MainMenuOption {\n "
},
{
"path": "src/game/map.c",
"chars": 42477,
"preview": "#include \"game/map.h\"\n\n#include <direct.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/anim.h\"\n#include \"game"
},
{
"path": "src/game/map.h",
"chars": 3018,
"preview": "#ifndef FALLOUT_GAME_MAP_H_\n#define FALLOUT_GAME_MAP_H_\n\n#include <stdbool.h>\n\n#define WIN32_LEAN_AND_MEAN\n#include <win"
},
{
"path": "src/game/map_defs.h",
"chars": 678,
"preview": "#ifndef MAPDEFS_H\n#define MAPDEFS_H\n\n#include <stdbool.h>\n\n#define ELEVATION_COUNT (3)\n\n#define SQUARE_GRID_WIDTH (100)\n"
},
{
"path": "src/game/message.c",
"chars": 12259,
"preview": "#include \"game/message.h\"\n\n#include <ctype.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"plib"
},
{
"path": "src/game/message.h",
"chars": 890,
"preview": "#ifndef FALLOUT_GAME_MESSAGE_H_\n#define FALLOUT_GAME_MESSAGE_H_\n\n#include <stdbool.h>\n\n// TODO: Convert to enum.\n#define"
},
{
"path": "src/game/moviefx.c",
"chars": 7847,
"preview": "#include \"game/moviefx.h\"\n\n#include <stdbool.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"ga"
},
{
"path": "src/game/moviefx.h",
"chars": 228,
"preview": "#ifndef FALLOUT_GAME_MOVIEFX_H_\n#define FALLOUT_GAME_MOVIEFX_H_\n\nint moviefx_init();\nvoid moviefx_reset();\nvoid moviefx_"
},
{
"path": "src/game/object.c",
"chars": 147632,
"preview": "#include \"game/object.h\"\n\n#include <assert.h>\n#include <string.h>\n\n#include \"game/anim.h\"\n#include \"game/art.h\"\n#include"
},
{
"path": "src/game/object.h",
"chars": 4907,
"preview": "#ifndef FALLOUT_GAME_OBJECT_H_\n#define FALLOUT_GAME_OBJECT_H_\n\n#include \"plib/db/db.h\"\n#include \"plib/gnw/rect.h\"\n#inclu"
},
{
"path": "src/game/object_types.h",
"chars": 8109,
"preview": "#ifndef FALLOUT_GAME_OBJECT_TYPES_H_\n#define FALLOUT_GAME_OBJECT_TYPES_H_\n\n// Rotation\ntypedef enum Rotation {\n ROTAT"
},
{
"path": "src/game/options.c",
"chars": 65174,
"preview": "#include \"game/options.h\"\n\n#include <math.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"plib/color/color.h\"\n#incl"
},
{
"path": "src/game/options.h",
"chars": 357,
"preview": "#ifndef FALLOUT_GAME_OPTIONS_H_\n#define FALLOUT_GAME_OPTIONS_H_\n\n#include <stdbool.h>\n\n#include \"plib/db/db.h\"\n\nint do_o"
},
{
"path": "src/game/palette.c",
"chars": 2338,
"preview": "#include \"game/palette.h\"\n\n#include <string.h>\n\n#include \"plib/color/color.h\"\n#include \"plib/gnw/input.h\"\n#include \"game"
},
{
"path": "src/game/palette.h",
"chars": 443,
"preview": "#ifndef FALLOUT_GAME_PALETTE_H_\n#define FALLOUT_GAME_PALETTE_H_\n\nextern unsigned char white_palette[256 * 3];\nextern uns"
},
{
"path": "src/game/party.c",
"chars": 45148,
"preview": "#include \"game/party.h\"\n\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/anim.h\"\n#include \"plib/color/color.h\"\n#i"
},
{
"path": "src/game/party.h",
"chars": 1586,
"preview": "#ifndef FALLOUT_GAME_PARTY_H_\n#define FALLOUT_GAME_PARTY_H_\n\n#include <stdbool.h>\n\n#include \"plib/db/db.h\"\n#include \"gam"
},
{
"path": "src/game/perk.c",
"chars": 22731,
"preview": "#include \"game/perk.h\"\n\n#include <stdio.h>\n\n#include \"plib/gnw/debug.h\"\n#include \"game/game.h\"\n#include \"game/gconfig.h\""
},
{
"path": "src/game/perk.h",
"chars": 1612,
"preview": "#ifndef FALLOUT_GAME_PERK_H_\n#define FALLOUT_GAME_PERK_H_\n\n#include <stdbool.h>\n\n#include \"plib/db/db.h\"\n#include \"game/"
},
{
"path": "src/game/perk_defs.h",
"chars": 3084,
"preview": "#ifndef PERK_DEFS_H\n#define PERK_DEFS_H\n\ntypedef enum Perk {\n PERK_AWARENESS,\n PERK_BONUS_HTH_ATTACKS,\n PERK_BO"
},
{
"path": "src/game/pipboy.c",
"chars": 73887,
"preview": "#include \"game/pipboy.h\"\n\n#include <ctype.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/automap.h\"\n#include "
},
{
"path": "src/game/pipboy.h",
"chars": 524,
"preview": "#ifndef FALLOUT_GAME_PIPBOY_H_\n#define FALLOUT_GAME_PIPBOY_H_\n\n#include <stdbool.h>\n\n#include \"game/art.h\"\n#include \"pli"
},
{
"path": "src/game/protinst.c",
"chars": 59374,
"preview": "#include \"game/protinst.h\"\n\n#include <assert.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/anim.h\"\n#include "
},
{
"path": "src/game/protinst.h",
"chars": 2003,
"preview": "#ifndef FALLOUT_GAME_PROTINST_H_\n#define FALLOUT_GAME_PROTINST_H_\n\n#include <stdbool.h>\n\n#include \"game/object_types.h\"\n"
},
{
"path": "src/game/proto.c",
"chars": 60652,
"preview": "#include \"game/proto.h\"\n\n#include <direct.h>\n#include <stdio.h>\n#include <string.h>\n\n#define WIN32_LEAN_AND_MEAN\n#includ"
},
{
"path": "src/game/proto.h",
"chars": 4619,
"preview": "#ifndef FALLOUT_GAME_PROTO_H_\n#define FALLOUT_GAME_PROTO_H_\n\n#include \"plib/db/db.h\"\n#include \"game/message.h\"\n#include "
},
{
"path": "src/game/proto_types.h",
"chars": 12467,
"preview": "#ifndef PROTO_TYPES_H\n#define PROTO_TYPES_H\n\n// Number of prototypes in prototype extent.\n#define PROTO_LIST_EXTENT_SIZE"
},
{
"path": "src/game/queue.c",
"chars": 14187,
"preview": "#include \"game/queue.h\"\n\n#include \"game/actions.h\"\n#include \"game/critter.h\"\n#include \"game/display.h\"\n#include \"game/ga"
},
{
"path": "src/game/queue.h",
"chars": 2304,
"preview": "#ifndef FALLOUT_GAME_QUEUE_H_\n#define FALLOUT_GAME_QUEUE_H_\n\n#include <stdbool.h>\n\n#include \"plib/db/db.h\"\n#include \"gam"
},
{
"path": "src/game/reaction.c",
"chars": 1789,
"preview": "#include \"game/reaction.h\"\n\n#include \"game/scripts.h\"\n\n// 0x4A29D0\nint reaction_set(Object* critter, int value)\n{\n sc"
},
{
"path": "src/game/reaction.h",
"chars": 529,
"preview": "#ifndef FALLOUT_GAME_REACTION_H_\n#define FALLOUT_GAME_REACTION_H_\n\n#include \"game/object_types.h\"\n\ntypedef enum NpcReact"
},
{
"path": "src/game/roll.c",
"chars": 4549,
"preview": "#include \"game/roll.h\"\n\n#include <limits.h>\n#include <stdlib.h>\n\n// clang-format off\n#define WIN32_LEAN_AND_MEAN\n#includ"
},
{
"path": "src/game/roll.h",
"chars": 557,
"preview": "#ifndef FALLOUT_GAME_ROLL_H_\n#define FALLOUT_GAME_ROLL_H_\n\n#include \"plib/db/db.h\"\n\ntypedef enum Roll {\n ROLL_CRITICA"
},
{
"path": "src/game/scripts.c",
"chars": 74380,
"preview": "#include \"game/scripts.h\"\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <time.h>\n\n#include \"int/w"
},
{
"path": "src/game/scripts.h",
"chars": 6885,
"preview": "#ifndef FALLOUT_GAME_SCRIPTS_H_\n#define FALLOUT_GAME_SCRIPTS_H_\n\n#include <stdbool.h>\n\n#include \"game/combat_defs.h\"\n#in"
},
{
"path": "src/game/select.c",
"chars": 27165,
"preview": "#include \"game/select.h\"\n\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/art.h\"\n#include \"game/editor.h\"\n#includ"
},
{
"path": "src/game/select.h",
"chars": 196,
"preview": "#ifndef FALLOUT_GAME_SELECT_H_\n#define FALLOUT_GAME_SELECT_H_\n\n#include <stdbool.h>\n\nextern int select_window_id;\n\nint s"
},
{
"path": "src/game/selfrun.c",
"chars": 5839,
"preview": "#include \"game/selfrun.h\"\n\n#include <direct.h>\n#include <stdlib.h>\n\n#include \"plib/gnw/input.h\"\n#include \"plib/db/db.h\"\n"
},
{
"path": "src/game/selfrun.h",
"chars": 830,
"preview": "#ifndef FALLOUT_GAME_SELFRUN_H_\n#define FALLOUT_GAME_SELFRUN_H_\n\n#define SELFRUN_RECORDING_FILE_NAME_LENGTH 13\n#define S"
},
{
"path": "src/game/sfxcache.c",
"chars": 11734,
"preview": "#include \"game/sfxcache.h\"\n\n#include <assert.h>\n#include <limits.h>\n#include <stdbool.h>\n#include <stdio.h>\n#include <st"
},
{
"path": "src/game/sfxcache.h",
"chars": 710,
"preview": "#ifndef FALLOUT_GAME_SFXCACHE_H_\n#define FALLOUT_GAME_SFXCACHE_H_\n\n// The maximum number of sound effects that can be lo"
},
{
"path": "src/game/sfxlist.c",
"chars": 10595,
"preview": "#include \"game/sfxlist.h\"\n\n#include <limits.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"pli"
},
{
"path": "src/game/sfxlist.h",
"chars": 489,
"preview": "#ifndef FALLOUT_GAME_SFXLIST_H_\n#define FALLOUT_GAME_SFXLIST_H_\n\n#include <stdbool.h>\n\n#define SFXL_OK 0\n#define SFXL_ER"
},
{
"path": "src/game/skill.c",
"chars": 35524,
"preview": "#include \"game/skill.h\"\n\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/actions.h\"\n#include \"plib/color/color.h\""
},
{
"path": "src/game/skill.h",
"chars": 1640,
"preview": "#ifndef FALLOUT_GAME_SKILL_H_\n#define FALLOUT_GAME_SKILL_H_\n\n#include <stdbool.h>\n\n#include \"plib/db/db.h\"\n#include \"gam"
},
{
"path": "src/game/skill_defs.h",
"chars": 589,
"preview": "#ifndef SKILL_DEFS_H\n#define SKILL_DEFS_H\n\n// max number of tagged skills\n#define NUM_TAGGED_SKILLS 4\n\n#define DEFAULT_T"
},
{
"path": "src/game/skilldex.c",
"chars": 10482,
"preview": "#include \"game/skilldex.h\"\n\n#include <stdbool.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/art.h\"\n#include "
},
{
"path": "src/game/skilldex.h",
"chars": 419,
"preview": "#ifndef FALLOUT_GAME_SKILLDEX_H_\n#define FALLOUT_GAME_SKILLDEX_H_\n\ntypedef enum SkilldexRC {\n SKILLDEX_RC_ERROR = -1,"
},
{
"path": "src/game/stat.c",
"chars": 23062,
"preview": "#include \"game/stat.h\"\n\n#include <stdio.h>\n\n#include \"game/combat.h\"\n#include \"plib/gnw/input.h\"\n#include \"game/critter."
},
{
"path": "src/game/stat.h",
"chars": 1596,
"preview": "#ifndef FALLOUT_GAME_STAT_H_\n#define FALLOUT_GAME_STAT_H_\n\n#include <stdbool.h>\n\n#include \"plib/db/db.h\"\n#include \"game/"
},
{
"path": "src/game/stat_defs.h",
"chars": 2099,
"preview": "#ifndef STAT_DEFS\n#define STAT_DEFS\n\n// The minimum value of SPECIAL stat.\n#define PRIMARY_STAT_MIN (1)\n\n// The maximum "
},
{
"path": "src/game/strparse.c",
"chars": 4383,
"preview": "#include \"game/strparse.h\"\n\n#include <stdlib.h>\n#include <string.h>\n\n#include \"plib/gnw/debug.h\"\n\n// strParseValue\n// 0x"
},
{
"path": "src/game/strparse.h",
"chars": 590,
"preview": "#ifndef FALLOUT_GAME_STRPARSE_H_\n#define FALLOUT_GAME_STRPARSE_H_\n\ntypedef int(StringParserCallback)(char* string, int* "
},
{
"path": "src/game/textobj.c",
"chars": 13793,
"preview": "#include \"game/textobj.h\"\n\n#include <string.h>\n\n#include \"plib/gnw/input.h\"\n#include \"plib/gnw/debug.h\"\n#include \"plib/g"
},
{
"path": "src/game/textobj.h",
"chars": 771,
"preview": "#ifndef FALLOUT_GAME_TEXTOBJ_H_\n#define FALLOUT_GAME_TEXTOBJ_H_\n\n#include <stdbool.h>\n\n#include \"plib/gnw/rect.h\"\n#inclu"
},
{
"path": "src/game/tile.c",
"chars": 46932,
"preview": "#include \"game/tile.h\"\n\n#include <assert.h>\n#include <string.h>\n\n#define _USE_MATH_DEFINES\n#include <math.h>\n\n#include \""
},
{
"path": "src/game/tile.h",
"chars": 2721,
"preview": "#ifndef FALLOUT_GAME_TILE_H_\n#define FALLOUT_GAME_TILE_H_\n\n#include <stdbool.h>\n\n#include \"plib/gnw/rect.h\"\n#include \"ga"
},
{
"path": "src/game/trait.c",
"chars": 6943,
"preview": "#include \"game/trait.h\"\n\n#include <stdio.h>\n\n#include \"game/game.h\"\n#include \"game/message.h\"\n#include \"game/object.h\"\n#"
},
{
"path": "src/game/trait.h",
"chars": 560,
"preview": "#ifndef FALLOUT_GAME_TRAIT_H_\n#define FALLOUT_GAME_TRAIT_H_\n\n#include <stdbool.h>\n\n#include \"plib/db/db.h\"\n#include \"gam"
},
{
"path": "src/game/trait_defs.h",
"chars": 581,
"preview": "#ifndef TRAIT_DEFS\n#define TRAIT_DEFS\n\n// The maximum number of traits a player is allowed to select.\n#define TRAITS_MAX"
},
{
"path": "src/game/trap.c",
"chars": 2616,
"preview": "#include \"game/trap.h\"\n\n#include <stdlib.h>\n\n#include \"plib/gnw/debug.h\"\n#include \"plib/gnw/gnw.h\"\n\ntypedef struct TrapE"
},
{
"path": "src/game/trap.h",
"chars": 130,
"preview": "#ifndef FALLOUT_GAME_TRAP_H_\n#define FALLOUT_GAME_TRAP_H_\n\nvoid trap_exit();\nvoid trap_init();\n\n#endif /* FALLOUT_GAME_T"
},
{
"path": "src/game/version.c",
"chars": 161,
"preview": "#include \"game/version.h\"\n\n#include <stdio.h>\n\n// 0x4B4580\nvoid getverstr(char* dest)\n{\n sprintf(dest, \"FALLOUT II %d"
},
{
"path": "src/game/version.h",
"chars": 324,
"preview": "#ifndef FALLOUT_GAME_VERSION_H_\n#define FALLOUT_GAME_VERSION_H_\n\n// The size of buffer for version string.\n#define VERSI"
},
{
"path": "src/game/wordwrap.c",
"chars": 1865,
"preview": "#include \"game/wordwrap.h\"\n\n#include <ctype.h>\n#include <stddef.h>\n#include <string.h>\n\n#include \"plib/gnw/text.h\"\n\n// 0"
},
{
"path": "src/game/wordwrap.h",
"chars": 233,
"preview": "#ifndef FALLOUT_GAME_WORDWRAP_H_\n#define FALLOUT_GAME_WORDWRAP_H_\n\n#define WORD_WRAP_MAX_COUNT 64\n\nint word_wrap(const c"
},
{
"path": "src/game/worldmap.c",
"chars": 190533,
"preview": "#include \"game/worldmap.h\"\n\n#include <assert.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/anim.h\"\n#include "
},
{
"path": "src/game/worldmap.h",
"chars": 8064,
"preview": "#ifndef FALLOUT_GAME_WORLDMAP_H_\n#define FALLOUT_GAME_WORLDMAP_H_\n\n#include <stdbool.h>\n\n#include \"plib/db/db.h\"\n\n#defin"
},
{
"path": "src/int/audio.c",
"chars": 6290,
"preview": "#include \"int/audio.h\"\n\n#include <assert.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"plib/db/db.h\"\n#include \"pl"
},
{
"path": "src/int/audio.h",
"chars": 536,
"preview": "#ifndef FALLOUT_INT_AUDIO_H_\n#define FALLOUT_INT_AUDIO_H_\n\n#include \"int/audiof.h\"\n\nint audioOpen(const char* fname, int"
},
{
"path": "src/int/audiof.c",
"chars": 6380,
"preview": "#include \"int/audiof.h\"\n\n#include <assert.h>\n#include <io.h>\n#include <stdio.h>\n#include <string.h>\n\n#define WIN32_LEAN_"
},
{
"path": "src/int/audiof.h",
"chars": 886,
"preview": "#ifndef FALLOUT_INT_AUDIOF_H_\n#define FALLOUT_INT_AUDIOF_H_\n\n#include <stdbool.h>\n\n#include \"sound_decoder.h\"\n\ntypedef e"
},
{
"path": "src/int/datafile.c",
"chars": 4498,
"preview": "#include \"int/datafile.h\"\n\n#include <string.h>\n\n#include \"plib/color/color.h\"\n#include \"plib/db/db.h\"\n#include \"int/memd"
},
{
"path": "src/int/datafile.h",
"chars": 914,
"preview": "#ifndef FALLOUT_INT_DATAFILE_H_\n#define FALLOUT_INT_DATAFILE_H_\n\ntypedef unsigned char*(DatafileLoader)(char* path, unsi"
},
{
"path": "src/int/dialog.c",
"chars": 16379,
"preview": "#include \"int/dialog.h\"\n\n#include <string.h>\n\n#include \"int/window.h\"\n#include \"plib/gnw/input.h\"\n#include \"int/memdbg.h"
},
{
"path": "src/int/dialog.h",
"chars": 1513,
"preview": "#ifndef FALLOUT_INT_DIALOG_H_\n#define FALLOUT_INT_DIALOG_H_\n\n#include \"int/intrpret.h\"\n\ntypedef void DialogWinDrawCallba"
},
{
"path": "src/int/export.c",
"chars": 11059,
"preview": "#include \"int/export.h\"\n\n#include <ctype.h>\n#include <string.h>\n\n#include \"int/intlib.h\"\n#include \"int/memdbg.h\"\n\ntypede"
},
{
"path": "src/int/export.h",
"chars": 883,
"preview": "#ifndef FALLOUT_INT_EXPORT_H_\n#define FALLOUT_INT_EXPORT_H_\n\n#include \"int/intrpret.h\"\n\nint exportGetVariable(const char"
},
{
"path": "src/int/intlib.c",
"chars": 89767,
"preview": "#include \"int/intlib.h\"\n\n#include <stdio.h>\n\n#include \"int/window.h\"\n#include \"plib/color/color.h\"\n#include \"plib/gnw/in"
},
{
"path": "src/int/intlib.h",
"chars": 841,
"preview": "#ifndef FALLOUT_INT_INTLIB_H_\n#define FALLOUT_INT_INTLIB_H_\n\n#include <stdbool.h>\n\n#include \"int/intrpret.h\"\n\ntypedef vo"
},
{
"path": "src/int/intrpret.c",
"chars": 118328,
"preview": "#include \"int/intrpret.h\"\n\n#include <assert.h>\n#include <limits.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <stdl"
},
{
"path": "src/int/intrpret.h",
"chars": 6920,
"preview": "#ifndef FALLOUT_INT_INTRPRET_H_\n#define FALLOUT_INT_INTRPRET_H_\n\n#include <setjmp.h>\n#include <stdbool.h>\n\ntypedef enum "
},
{
"path": "src/int/memdbg.c",
"chars": 2988,
"preview": "#include \"int/memdbg.h\"\n\n#include <stdarg.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\nstatic void def"
},
{
"path": "src/int/memdbg.h",
"chars": 651,
"preview": "#ifndef FALLOUT_INT_MEMDBG_H_\n#define FALLOUT_INT_MEMDBG_H_\n\n#include \"memory_defs.h\"\n\ntypedef void(MemoryManagerPrintEr"
},
{
"path": "src/int/mousemgr.c",
"chars": 22639,
"preview": "#include \"int/mousemgr.h\"\n\n#include <stdlib.h>\n#include <string.h>\n\n#include \"plib/gnw/input.h\"\n#include \"int/datafile.h"
},
{
"path": "src/int/mousemgr.h",
"chars": 705,
"preview": "#ifndef FALLOUT_INT_MOUSEMGR_H_\n#define FALLOUT_INT_MOUSEMGR_H_\n\n#include <stdbool.h>\n\ntypedef char*(MouseManagerNameMan"
},
{
"path": "src/int/movie.c",
"chars": 24587,
"preview": "#include \"int/movie.h\"\n\n#include <string.h>\n\n#include \"int/window.h\"\n#include \"plib/color/color.h\"\n#include \"plib/gnw/in"
},
{
"path": "src/int/movie.h",
"chars": 1955,
"preview": "#ifndef FALLOUT_INT_MOVIE_H_\n#define FALLOUT_INT_MOVIE_H_\n\n#include \"plib/gnw/rect.h\"\n\ntypedef enum MovieFlags {\n MOV"
},
{
"path": "src/int/nevs.c",
"chars": 5207,
"preview": "#include \"int/nevs.h\"\n\n#include <stdlib.h>\n#include <string.h>\n\n#include \"plib/gnw/debug.h\"\n#include \"int/intlib.h\"\n#inc"
},
{
"path": "src/int/nevs.h",
"chars": 558,
"preview": "#ifndef FALLOUT_INT_NEVS_H_\n#define FALLOUT_INT_NEVS_H_\n\n#include <stdbool.h>\n\n#include \"int/intrpret.h\"\n\ntypedef void(N"
},
{
"path": "src/int/pcx.c",
"chars": 4619,
"preview": "#include \"int/pcx.h\"\n\n#include \"plib/db/db.h\"\n#include \"int/memdbg.h\"\n\ntypedef struct PcxHeader {\n unsigned char iden"
},
{
"path": "src/int/pcx.h",
"chars": 185,
"preview": "#ifndef FALLOUT_INT_PCX_H_\n#define FALLOUT_INT_PCX_H_\n\nunsigned char* loadPCX(const char* path, int* widthPtr, int* heig"
},
{
"path": "src/int/region.c",
"chars": 6165,
"preview": "#include \"int/region.h\"\n\n#include <limits.h>\n#include <string.h>\n\n#include \"plib/gnw/debug.h\"\n#include \"int/memdbg.h\"\n\ns"
},
{
"path": "src/int/region.h",
"chars": 1348,
"preview": "#ifndef FALLOUT_INT_REGION_H_\n#define FALLOUT_INT_REGION_H_\n\n#include \"plib/gnw/rect.h\"\n#include \"int/intrpret.h\"\n\n#defi"
},
{
"path": "src/int/share1.c",
"chars": 809,
"preview": "#include \"int/share1.h\"\n\n#include <stdlib.h>\n#include <string.h>\n\n#include \"plib/db/db.h\"\n\nstatic int compare(const void"
},
{
"path": "src/int/share1.h",
"chars": 202,
"preview": "#ifndef FALLOUT_INT_SHARE1_H_\n#define FALLOUT_INT_SHARE1_H_\n\nchar** getFileList(const char* pattern, int* fileNameListLe"
},
{
"path": "src/int/sound.c",
"chars": 46983,
"preview": "#include \"int/sound.h\"\n\n#include <io.h>\n#include <limits.h>\n#include <math.h>\n#include <mmsystem.h>\n#include <stdlib.h>\n"
},
{
"path": "src/int/sound.h",
"chars": 4850,
"preview": "#ifndef FALLOUT_INT_SOUND_H_\n#define FALLOUT_INT_SOUND_H_\n\n#include <stdbool.h>\n\n#include \"memory_defs.h\"\n#include \"plib"
},
{
"path": "src/int/support/intextra.c",
"chars": 205605,
"preview": "#include \"int/support/intextra.h\"\n\n#include <limits.h>\n#include <stdio.h>\n#include <string.h>\n\n#include \"game/actions.h\""
},
{
"path": "src/int/support/intextra.h",
"chars": 650,
"preview": "#ifndef FALLOUT_INT_SUPPORT_INTEXTRA_H_\n#define FALLOUT_INT_SUPPORT_INTEXTRA_H_\n\n#include <stdbool.h>\n\n#include \"int/int"
},
{
"path": "src/int/widget.c",
"chars": 21693,
"preview": "#include \"int/widget.h\"\n\n#include <stdio.h>\n#include <string.h>\n\n#include \"int/datafile.h\"\n#include \"plib/gnw/button.h\"\n"
},
{
"path": "src/int/widget.h",
"chars": 1921,
"preview": "#ifndef FALLOUT_INT_WIDGET_H_\n#define FALLOUT_INT_WIDGET_H_\n\ntypedef void(UpdateRegionShowFunc)(void* value);\ntypedef vo"
},
{
"path": "src/int/window.c",
"chars": 95631,
"preview": "#include \"int/window.h\"\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"plib/db/db.h\"\n#include \"p"
}
]
// ... and 62 more files (download for full content)
About this extraction
This page contains the full source code of the alexbatalov/fallout2-re GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 262 files (4.1 MB), approximately 1.1M tokens, and a symbol index with 3893 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.