mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Merge branch 'state_cleaning_tier_2' into luarefactor
# Conflicts: # .gitignore # Common/Game/collision/collide_room.h # Common/Game/control/control.h # Common/Game/items.h # Common/Specific/phd_global.h # Common/Specific/trmath.h # Scripting/src/TEN/Flow/Animations/Animations.h # Scripting/src/TEN/Flow/FlowHandler.cpp # Scripts/Settings.lua # TR5Main/Game/Lara/lara.cpp # TR5Main/Game/Lara/lara_basic.cpp # TR5Main/Game/Lara/lara_cheat.cpp # TR5Main/Game/Lara/lara_collide.cpp # TR5Main/Game/Lara/lara_crawl.cpp # TR5Main/Game/Lara/lara_helpers.cpp # TR5Main/Game/Lara/lara_jump.cpp # TR5Main/Game/Lara/lara_monkey.cpp # TR5Main/Game/Lara/lara_swim.cpp # TR5Main/Game/Lara/lara_tests.cpp # TR5Main/Game/animation.cpp # TR5Main/Game/camera.cpp # TR5Main/Game/collision/collide_item.cpp # TR5Main/Game/collision/collide_room.cpp # TR5Main/Game/collision/floordata.cpp # TR5Main/Game/control/control.cpp # TR5Main/Game/control/los.cpp # TR5Main/Game/control/volume.cpp # TR5Main/Game/effects/hair.cpp # TR5Main/Game/gui.cpp # TR5Main/Game/health.cpp # TR5Main/Game/items.cpp # TR5Main/Game/room.cpp # TR5Main/Game/savegame.cpp # TR5Main/Renderer/ConstantBuffers/MiscBuffer.h # TR5Main/Renderer/RenderPipelineState/RenderPipelineState.cpp # TR5Main/Renderer/RenderPipelineState/RenderPipelineState.h # TR5Main/Renderer/Renderer11Draw.cpp # TR5Main/Renderer/Renderer11Frame.cpp # TR5Main/Renderer/Renderer11Helper.cpp # TR5Main/Renderer/Renderer11Lara.cpp # TR5Main/Renderer/Renderer11PostProcess.cpp # TR5Main/Renderer/Renderer11Settings.cpp # TR5Main/Renderer/Renderer11String.cpp # TR5Main/Renderer/RendererSprites.h # TR5Main/Scripting/GameLogicScript.cpp # TR5Main/Scripting/GameScriptAnimations.cpp # TR5Main/Scripting/GameScriptItemInfo.cpp # TR5Main/Scripting/GameScriptItemInfo.h # TR5Main/Scripting/GameScriptMeshInfo.cpp # TR5Main/Scripting/GameScriptPosition.cpp # TR5Main/Specific/input.cpp # TR5Main/Specific/level.cpp # TR5Main/Specific/savegame/flatbuffers/ten_savegame_generated.h # TR5Main/TombEngine.vcxproj.filters # common/game/collision/collide_item.h
This commit is contained in:
commit
7587d3470c
637 changed files with 54779 additions and 59144 deletions
|
@ -14,12 +14,164 @@
|
|||
<ProjectCapability Include="SourceItemsFromImports" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)frameworkbase.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\animation.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\camera.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\collision\collide_item.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\collision\collide_room.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\collision\floordata.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\control\box.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\control\control.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\control\los.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\control\lot.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\control\trigger.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\control\volumetriggerer.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\debug\debug.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\effects\effects.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\effects\lightning.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\effects\tomb4fx.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\gui.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\itemdata\creature_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\itemdata\door_data.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\itemdata\itemdata.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\items.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\Lara\lara.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\Lara\lara_struct.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\pickup\pickup.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\room.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\savegame.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\bass\bass.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\bass\bassmix.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\bass\bass_fx.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\lua\lauxlib.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\lua\lua.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\lua\lua.hpp" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\lua\luaconf.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\lua\lualib.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\sol\config.hpp" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\sol\forward.hpp" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\sol\sol.hpp" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\async.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\async_logger-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\async_logger.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\cfg\argv.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\cfg\env.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\cfg\helpers-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\cfg\helpers.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\common-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\common.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\backtracer-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\backtracer.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\circular_q.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\console_globals.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\file_helper-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\file_helper.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\fmt_helper.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\log_msg-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\log_msg.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\log_msg_buffer-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\log_msg_buffer.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\mpmc_blocking_q.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\null_mutex.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\os-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\os.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\periodic_worker-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\periodic_worker.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\registry-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\registry.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\synchronous_factory.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\tcp_client-windows.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\tcp_client.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\thread_pool-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\thread_pool.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\windows_include.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bin_to_hex.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\args.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\chrono.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\color.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\compile.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\core.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\format-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\format.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\locale.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\os.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\ostream.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\printf.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\ranges.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\xchar.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\chrono.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\compile.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\fmt.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\ostr.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\xchar.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\formatter.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fwd.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\logger-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\logger.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\pattern_formatter-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\pattern_formatter.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\android_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\ansicolor_sink-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\ansicolor_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\base_sink-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\base_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\basic_file_sink-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\basic_file_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\daily_file_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\dist_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\dup_filter_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\hourly_file_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\mongo_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\msvc_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\null_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\ostream_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\qt_sinks.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\ringbuffer_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\rotating_file_sink-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\rotating_file_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\sink-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\stdout_color_sinks-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\stdout_color_sinks.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\stdout_sinks-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\stdout_sinks.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\syslog_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\systemd_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\tcp_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\wincolor_sink-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\wincolor_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\win_eventlog_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\spdlog-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\spdlog.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\stopwatch.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\tweakme.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\version.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\objectslist.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR2\Vehicles\boat_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR2\Vehicles\skidoo_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR3\Vehicles\biggun_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR3\Vehicles\kayak_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR3\Vehicles\minecart_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR3\Vehicles\quad_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR3\Vehicles\rubberboat_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR3\Vehicles\upv_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR4\Entity\tr4_wraith_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR4\Vehicles\jeep_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR4\Vehicles\motorbike_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR5\Entity\tr5_laserhead_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR5\Object\tr5_pushableblock_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Renderer\RenderEnums.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Renderer\Renderer11Enums.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Scripting\LanguageScript.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Sound\sound.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Sound\sound_effects.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\configuration.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\input.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\IO\ChunkId.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\IO\ChunkReader.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\IO\ChunkWriter.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\IO\LEB128.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\IO\Streams.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\RGBAColor8Byte.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\level.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\newtypes.h" />
|
||||
|
|
|
@ -20,5 +20,157 @@
|
|||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\configuration.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\setup.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\control\volumetriggerer.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\collision\collide_item.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\collision\collide_room.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\collision\floordata.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\control\box.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\control\control.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\control\los.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\control\lot.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\control\trigger.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\debug\debug.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\effects\effects.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\effects\lightning.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\effects\tomb4fx.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\itemdata\creature_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\itemdata\door_data.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\itemdata\itemdata.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\Lara\lara.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\Lara\lara_struct.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\pickup\pickup.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\camera.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\gui.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Game\savegame.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\bass\bass.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\bass\bass_fx.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\bass\bassmix.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\lua\lauxlib.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\lua\lua.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\lua\lua.hpp" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\lua\luaconf.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\lua\lualib.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\sol\config.hpp" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\sol\forward.hpp" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\sol\sol.hpp" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\cfg\argv.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\cfg\env.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\cfg\helpers.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\cfg\helpers-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\backtracer.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\backtracer-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\circular_q.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\console_globals.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\file_helper.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\file_helper-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\fmt_helper.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\log_msg.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\log_msg_buffer.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\log_msg_buffer-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\log_msg-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\mpmc_blocking_q.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\null_mutex.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\os.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\os-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\periodic_worker.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\periodic_worker-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\registry.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\registry-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\synchronous_factory.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\tcp_client.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\tcp_client-windows.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\thread_pool.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\thread_pool-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\details\windows_include.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\args.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\chrono.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\color.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\compile.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\core.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\format.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\format-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\locale.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\os.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\ostream.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\printf.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\ranges.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bundled\xchar.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\bin_to_hex.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\chrono.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\compile.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\fmt.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\ostr.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fmt\xchar.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\android_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\ansicolor_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\ansicolor_sink-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\base_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\base_sink-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\basic_file_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\basic_file_sink-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\daily_file_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\dist_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\dup_filter_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\hourly_file_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\mongo_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\msvc_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\null_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\ostream_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\qt_sinks.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\ringbuffer_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\rotating_file_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\rotating_file_sink-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\sink-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\stdout_color_sinks.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\stdout_color_sinks-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\stdout_sinks.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\stdout_sinks-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\syslog_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\systemd_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\tcp_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\win_eventlog_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\wincolor_sink.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\sinks\wincolor_sink-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\async.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\async_logger.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\async_logger-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\common.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\common-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\formatter.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\fwd.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\logger.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\logger-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\pattern_formatter.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\pattern_formatter-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\spdlog.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\spdlog-inl.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\stopwatch.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\tweakme.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Libs\spdlog\version.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR2\Vehicles\boat_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR2\Vehicles\skidoo_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR3\Vehicles\biggun_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR3\Vehicles\kayak_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR3\Vehicles\minecart_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR3\Vehicles\quad_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR3\Vehicles\rubberboat_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR3\Vehicles\upv_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR4\Entity\tr4_wraith_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR4\Vehicles\jeep_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR4\Vehicles\motorbike_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR5\Entity\tr5_laserhead_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\TR5\Object\tr5_pushableblock_info.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Objects\objectslist.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Renderer\RenderEnums.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Renderer\Renderer11Enums.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Scripting\LanguageScript.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Sound\sound.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Sound\sound_effects.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\IO\ChunkId.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\IO\ChunkReader.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\IO\ChunkWriter.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\IO\LEB128.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)Specific\IO\Streams.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)frameworkbase.h" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -2,10 +2,10 @@
|
|||
#include "Game/Lara/lara_struct.h"
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct CollisionInfo;
|
||||
|
||||
#define LARA_GRAB_THRESHOLD ANGLE(35.0f)
|
||||
#define FRONT_ARC ANGLE(90.0f) // TODO: Check use.
|
||||
#define LARA_GRAB_THRESHOLD ANGLE(40.0f)
|
||||
#define FRONT_ARC ANGLE(90.0f) // TODO: Check use.
|
||||
|
||||
// Lean rates
|
||||
#define LARA_LEAN_RATE ANGLE(1.5f)
|
||||
|
@ -26,6 +26,8 @@ struct COLL_INFO;
|
|||
#define LARA_WADE_TURN_MAX ANGLE(5.5f)
|
||||
#define LARA_SWAMP_TURN_MAX ANGLE(2.0f)
|
||||
#define LARA_JUMP_TURN_MAX ANGLE(3.0f)
|
||||
#define LARA_REACH_TURN_MAX ANGLE(1.3f)
|
||||
#define LARA_SLIDE_TURN_MAX ANGLE(5.70f)
|
||||
#define LARA_CRAWL_TURN_MAX ANGLE(2.0f)
|
||||
#define LARA_CRAWL_MOVE_TURN_MAX ANGLE(3.75f)
|
||||
#define LARA_CROUCH_ROLL_TURN_MAX ANGLE(2.75f)
|
||||
|
@ -33,46 +35,60 @@ struct COLL_INFO;
|
|||
|
||||
// Flex rates
|
||||
#define LARA_CRAWL_FLEX_RATE ANGLE(2.25f)
|
||||
#define LARA_CRAWL_FLEX_MAX ANGLE(45.0f) / 2 // 2 = hardcoded number of bones to flex (head and torso).
|
||||
#define LARA_CRAWL_FLEX_MAX ANGLE(45.0f) / 2 // 2 = hardcoded number of bones to flex (head and torso).
|
||||
|
||||
constexpr auto LARA_HEIGHT = CLICK(3) - 1; // Lara height in standard states.
|
||||
constexpr auto LARA_HEIGHT_CRAWL = 350; // Lara height in crawl states.
|
||||
constexpr auto LARA_HEIGHT_MONKEY = 600; // Lara height in monkey swing states.
|
||||
constexpr auto LARA_HEIGHT_SURFSWIM = 700; // Lara height in water treading states.
|
||||
constexpr auto LARA_HEIGHT_STRETCH = 870; // Lara height in jump-up and ledge hanging states.
|
||||
constexpr auto LARA_HEIGHT_REACH = 820; // Lara height in reach state.
|
||||
constexpr auto LARA_HEIGHT_SURFACE = 800; // Lara height when surfacing water.
|
||||
constexpr auto LARA_HEADROOM = 160; // Amount of reasonable space above Lara's head.
|
||||
constexpr auto LARA_RAD = 100;
|
||||
constexpr auto LARA_RAD_CRAWL = 200;
|
||||
constexpr auto LARA_RAD_UNDERWATER = 300;
|
||||
constexpr auto LARA_RAD_DEATH = 400;
|
||||
constexpr auto LARA_FREEFALL_SPEED = 131;
|
||||
constexpr auto LARA_HEIGHT = CLICK(3) - 1; // Lara height in basic states.
|
||||
constexpr auto LARA_HEIGHT_CRAWL = 350; // Lara height in crawl states.
|
||||
constexpr auto LARA_HEIGHT_MONKEY = 850; // Lara height in monkey swing states.
|
||||
constexpr auto LARA_HEIGHT_TREAD = 700; // Lara height in water treading states.
|
||||
constexpr auto LARA_HEIGHT_STRETCH = 870; // Lara height in jump-up and ledge hanging states.
|
||||
constexpr auto LARA_HEIGHT_REACH = 820; // Lara height in reach state.
|
||||
constexpr auto LARA_HEIGHT_SURFACE = 800; // Lara height when surfacing water.
|
||||
constexpr auto LARA_HEADROOM = 160; // Amount of reasonable space above Lara's head.
|
||||
constexpr auto LARA_RADIUS = 100;
|
||||
constexpr auto LARA_RADIUS_CRAWL = 200;
|
||||
constexpr auto LARA_RADIUS_UNDERWATER = 300;
|
||||
constexpr auto LARA_RADIUS_DEATH = 400;
|
||||
constexpr auto LARA_VELOCITY = 12;
|
||||
|
||||
constexpr auto LARA_JUMP_TIME = 22; // Frames to count before running jump is possible.
|
||||
constexpr auto LARA_POSE_TIME = 30 * 30; // 30 frames * 30 = 30 seconds to AFK pose.
|
||||
// TODO: Convert velocities to floats and eliminate the division that goes on with these values. @Sezz
|
||||
constexpr auto LARA_SWIM_ACCELERATION = 8;
|
||||
constexpr auto LARA_SWIM_DECELERATION = 6;
|
||||
constexpr auto LARA_TREAD_VELOCITY_MAX = 70;
|
||||
constexpr auto LARA_SWIM_VELOCITY_MAX = 200;
|
||||
constexpr auto LARA_SWIM_INTERTIA_VELOCITY_MIN = 134;
|
||||
|
||||
constexpr auto LARA_FREEFALL_VELOCITY = 131;
|
||||
constexpr auto LARA_DAMAGE_VELOCITY = 141;
|
||||
constexpr auto LARA_DEATH_VELOCITY = 155;
|
||||
constexpr auto LARA_DIVE_DEATH_VELOCITY = 134;
|
||||
constexpr auto LARA_TERMINAL_VELOCITY = CLICK(10);
|
||||
|
||||
constexpr auto LARA_POSITION_ADJUST_MAX_TIME = 30 * 3; // 30 frames * 3 = 3 seconds allowed for position adjustment.
|
||||
constexpr auto LARA_POSE_TIME = 30 * 30; // 30 frames * 30 = 30 seconds to AFK pose.
|
||||
constexpr auto LARA_RUN_JUMP_TIME = 22; // Frames to count before a running jump is possible.
|
||||
|
||||
constexpr auto LARA_HEALTH_MAX = 1000.0f;
|
||||
constexpr auto LARA_AIR_MAX = 1800.0f;
|
||||
constexpr auto LARA_SPRINT_MAX = 120.0f;
|
||||
constexpr auto LARA_SPRINT_ENERGY_MAX = 120.0f;
|
||||
constexpr auto LARA_POISON_POTENCY_MAX = 16.0f;
|
||||
|
||||
extern LaraInfo Lara;
|
||||
extern ITEM_INFO* LaraItem;
|
||||
extern COLL_INFO LaraCollision;
|
||||
extern CollisionInfo LaraCollision;
|
||||
extern byte LaraNodeUnderwater[NUM_LARA_MESHES];
|
||||
|
||||
#define LARA_MESHES(slot, mesh) Lara.meshPtrs[mesh] = MESHES(slot, mesh)
|
||||
#define CHECK_LARA_MESHES(slot, mesh) Lara.meshPtrs[mesh] == MESHES(slot, mesh)
|
||||
#define INIT_LARA_MESHES(mesh, to, from) Lara.meshPtrs[mesh] = LARA_MESHES(to, mesh) = LARA_MESHES(from, mesh)
|
||||
|
||||
#define LaraRoutineFunction void(ITEM_INFO* item, COLL_INFO* coll)
|
||||
#define LaraRoutineFunction void(ITEM_INFO* item, CollisionInfo* coll)
|
||||
extern std::function<LaraRoutineFunction> lara_control_routines[NUM_LARA_STATES + 1];
|
||||
extern std::function<LaraRoutineFunction> lara_collision_routines[NUM_LARA_STATES + 1];
|
||||
|
||||
void LaraControl(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void LaraAboveWater(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void LaraUnderWater(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void LaraSurface(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void LaraCheat(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void LaraControl(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void LaraAboveWater(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void LaraWaterSurface(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void LaraUnderwater(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void LaraCheat(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void AnimateLara(ITEM_INFO* item);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -2,7 +2,7 @@
|
|||
#include "Specific/phd_global.h"
|
||||
|
||||
struct PHD_3DPOS;
|
||||
struct PHD_VECTOR;
|
||||
struct Vector3Int;
|
||||
struct ITEM_INFO;
|
||||
|
||||
struct ANIM_FRAME
|
||||
|
@ -16,7 +16,7 @@ struct ANIM_FRAME
|
|||
|
||||
struct CHANGE_STRUCT
|
||||
{
|
||||
int goalAnimState;
|
||||
int TargetState;
|
||||
int numberRanges;
|
||||
int rangeIndex;
|
||||
};
|
||||
|
@ -33,7 +33,7 @@ struct ANIM_STRUCT
|
|||
{
|
||||
int framePtr;
|
||||
int interpolation;
|
||||
int currentAnimState;
|
||||
int ActiveState;
|
||||
int velocity;
|
||||
int acceleration;
|
||||
int Xvelocity;
|
||||
|
@ -68,9 +68,16 @@ struct BONE_MUTATOR
|
|||
bool IsEmpty() { return (Scale == Vector3::One) && (Offset == Vector3::Zero) && (Rotation == Vector3::Zero); };
|
||||
};
|
||||
|
||||
void AnimateLara(ITEM_INFO* item);
|
||||
void AnimateItem(ITEM_INFO* item);
|
||||
|
||||
bool HasStateDispatch(ITEM_INFO* item, int targetState = -1);
|
||||
bool TestLastFrame(ITEM_INFO* item, int animNumber = -1);
|
||||
|
||||
void TranslateItem(ITEM_INFO* item, int x, int y, int z);
|
||||
void SetAnimation(ITEM_INFO* item, int animIndex, int frameToStart = 0);
|
||||
|
||||
int GetCurrentRelativeFrameNumber(ITEM_INFO* item);
|
||||
int GetFrameNumber(ITEM_INFO* item, int frameToStart);
|
||||
int GetFrameNumber(int objectID, int animNumber, int frameToStart);
|
||||
int GetFrameCount(int animNumber);
|
||||
|
@ -79,10 +86,11 @@ int GetNextAnimState(int objectID, int animNumber);
|
|||
bool GetChange(ITEM_INFO* item, ANIM_STRUCT* anim);
|
||||
int GetFrame(ITEM_INFO* item, ANIM_FRAME* framePtr[], int* rate);
|
||||
ANIM_FRAME* GetBestFrame(ITEM_INFO* item);
|
||||
|
||||
BOUNDING_BOX* GetBoundsAccurate(ITEM_INFO* item);
|
||||
void GetLaraJointPosition(PHD_VECTOR* pos, int LM_enum);
|
||||
void GetJointAbsPosition(ITEM_INFO* item, PHD_VECTOR* vec, int joint);
|
||||
void ClampRotation(PHD_3DPOS* pos, short angle, short rot);
|
||||
bool TestLastFrame(ITEM_INFO* item, int animNumber = -1);
|
||||
void GetLaraJointPosition(Vector3Int* pos, int laraMeshIndex);
|
||||
void GetJointAbsPosition(ITEM_INFO* item, Vector3Int* vec, int joint);
|
||||
|
||||
void ClampRotation(PHD_3DPOS* pos, short angle, short rotation);
|
||||
|
||||
void DrawAnimatingItem(ITEM_INFO* item);
|
||||
|
|
|
@ -2,21 +2,21 @@
|
|||
#include "Game/items.h"
|
||||
#include "Specific/phd_global.h"
|
||||
|
||||
enum class CAMERA_TYPE
|
||||
enum class CameraType
|
||||
{
|
||||
CHASE_CAMERA,
|
||||
FIXED_CAMERA,
|
||||
LOOK_CAMERA,
|
||||
COMBAT_CAMERA,
|
||||
HEAVY_CAMERA
|
||||
Chase,
|
||||
Fixed,
|
||||
Look,
|
||||
Combat,
|
||||
Heavy
|
||||
};
|
||||
|
||||
struct CAMERA_INFO
|
||||
{
|
||||
GAME_VECTOR pos; // size=16, offset=0
|
||||
GAME_VECTOR target; // size=16, offset=16
|
||||
CAMERA_TYPE type; // size=4, offset=32
|
||||
CAMERA_TYPE oldType; // size=4, offset=36
|
||||
GameVector pos; // size=16, offset=0
|
||||
GameVector target; // size=16, offset=16
|
||||
CameraType type; // size=4, offset=32
|
||||
CameraType oldType; // size=4, offset=36
|
||||
int shift; // size=0, offset=40
|
||||
int flags; // size=0, offset=44
|
||||
bool fixedCamera; // size=0, offset=48
|
||||
|
@ -38,7 +38,7 @@ struct CAMERA_INFO
|
|||
ITEM_INFO* item; // size=144, offset=92
|
||||
ITEM_INFO* lastItem; // size=144, offset=96
|
||||
int mikeAtLara; // size=0, offset=104
|
||||
PHD_VECTOR mikePos; // size=12, offset=108
|
||||
Vector3Int mikePos; // size=12, offset=108
|
||||
};
|
||||
|
||||
enum CAMERA_FLAGS
|
||||
|
@ -53,14 +53,14 @@ constexpr auto NO_MINY = 0xFFFFFF;
|
|||
|
||||
constexpr auto FADE_SCREEN_SPEED = 16.0f / 255.0f;
|
||||
|
||||
extern PHD_VECTOR CurrentCameraPosition;
|
||||
extern Vector3Int CurrentCameraPosition;
|
||||
extern CAMERA_INFO Camera;
|
||||
extern GAME_VECTOR ForcedFixedCamera;
|
||||
extern GameVector ForcedFixedCamera;
|
||||
extern int UseForcedFixedCamera;
|
||||
extern int NumberCameras;
|
||||
extern int BinocularRange;
|
||||
extern int BinocularOn;
|
||||
extern CAMERA_TYPE BinocularOldCamera;
|
||||
extern CameraType BinocularOldCamera;
|
||||
extern bool LaserSight;
|
||||
extern int PhdPerspective;
|
||||
extern short CurrentFOV;
|
||||
|
@ -78,19 +78,19 @@ extern float CinematicBarsSpeed;
|
|||
void LookAt(CAMERA_INFO* cam, short roll);
|
||||
void AlterFOV(int value);
|
||||
void InitialiseCamera();
|
||||
void MoveCamera(GAME_VECTOR* ideal, int speed);
|
||||
void MoveCamera(GameVector* ideal, int speed);
|
||||
void ChaseCamera(ITEM_INFO* item);
|
||||
void UpdateCameraElevation();
|
||||
void CombatCamera(ITEM_INFO* item);
|
||||
bool CameraCollisionBounds(GAME_VECTOR* ideal, int push, int yFirst);
|
||||
bool CameraCollisionBounds(GameVector* ideal, int push, int yFirst);
|
||||
void FixedCamera(ITEM_INFO* item);
|
||||
void LookCamera(ITEM_INFO* item);
|
||||
void BounceCamera(ITEM_INFO* item, short bounce, short maxDistance);
|
||||
void BinocularCamera(ITEM_INFO* item);
|
||||
void ConfirmCameraTargetPos();
|
||||
void CalculateCamera();
|
||||
void LookLeftRight();
|
||||
void LookUpDown();
|
||||
void LookLeftRight(ITEM_INFO* item);
|
||||
void LookUpDown(ITEM_INFO* item);
|
||||
void ResetLook(ITEM_INFO* item);
|
||||
void RumbleScreen();
|
||||
bool TestBoundsCollideCamera(BOUNDING_BOX* bounds, PHD_3DPOS* pos, short radius);
|
||||
|
@ -100,4 +100,4 @@ void ItemsCollideCamera();
|
|||
void SetScreenFadeOut(float speed);
|
||||
void SetScreenFadeIn(float speed);
|
||||
void SetCinematicBars(float height, float speed);
|
||||
void UpdateFadeScreenAndCinematicBars();
|
||||
void UpdateFadeScreenAndCinematicBars();
|
||||
|
|
|
@ -3,15 +3,17 @@
|
|||
#include "Specific/trmath.h"
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
class FLOOR_INFO;
|
||||
struct CollisionInfo;
|
||||
struct FLOOR_INFO;
|
||||
struct ROOM_INFO;
|
||||
struct MESH_INFO;
|
||||
enum RoomEnvFlags;
|
||||
|
||||
constexpr auto NO_BAD_POS = (-NO_HEIGHT); // used by coll->Setup.BadHeightDown
|
||||
constexpr auto NO_BAD_NEG = NO_HEIGHT; // used by coll->Setup.BadHeightUp
|
||||
constexpr auto COLLISION_CHECK_DISTANCE = WALL_SIZE * 8;
|
||||
constexpr auto NO_LOWER_BOUND = -NO_HEIGHT; // used by coll->Setup.LowerFloorBound
|
||||
constexpr auto NO_UPPER_BOUND = NO_HEIGHT; // used by coll->Setup.UpperFloorBound
|
||||
constexpr auto COLLISION_CHECK_DISTANCE = SECTOR(8);
|
||||
|
||||
enum COLL_TYPE
|
||||
enum CollisionType
|
||||
{
|
||||
CT_NONE = 0, // 0x00
|
||||
CT_FRONT = (1 << 0), // 0x01
|
||||
|
@ -22,120 +24,140 @@ enum COLL_TYPE
|
|||
CT_CLAMP = (1 << 5) // 0x20
|
||||
};
|
||||
|
||||
enum class COLL_PROBE_MODE
|
||||
enum class CollisionProbeMode
|
||||
{
|
||||
QUADRANTS,
|
||||
FREE_FORWARD,
|
||||
FREE_FLAT
|
||||
Quadrants,
|
||||
FreeForward,
|
||||
FreeFlat
|
||||
};
|
||||
|
||||
enum class SPLAT_COLL
|
||||
enum class CornerType
|
||||
{
|
||||
NONE,
|
||||
WALL,
|
||||
STEP
|
||||
None,
|
||||
Inner,
|
||||
Outer
|
||||
};
|
||||
|
||||
enum class CORNER_RESULT
|
||||
{
|
||||
NONE,
|
||||
INNER,
|
||||
OUTER
|
||||
};
|
||||
|
||||
struct COLL_POSITION
|
||||
struct CollisionPosition
|
||||
{
|
||||
int Floor;
|
||||
int Ceiling;
|
||||
int Bridge;
|
||||
float SplitAngle;
|
||||
bool Slope;
|
||||
bool FloorSlope;
|
||||
bool CeilingSlope;
|
||||
bool DiagonalStep;
|
||||
|
||||
bool HasDiagonalSplit() { return SplitAngle == 45.0f * RADIAN || SplitAngle == 135.0f * RADIAN; }
|
||||
bool HasFlippedDiagonalSplit() { return HasDiagonalSplit() && SplitAngle != 45.0f * RADIAN; }
|
||||
};
|
||||
|
||||
struct COLL_RESULT
|
||||
struct CollisionResult
|
||||
{
|
||||
Vector3 Coordinates;
|
||||
int RoomNumber;
|
||||
|
||||
FLOOR_INFO* Block;
|
||||
FLOOR_INFO* BottomBlock;
|
||||
|
||||
COLL_POSITION Position;
|
||||
|
||||
int TiltX;
|
||||
int TiltZ;
|
||||
CollisionPosition Position;
|
||||
Vector2 FloorTilt; // x = x, y = z
|
||||
Vector2 CeilingTilt; // x = x, y = z
|
||||
};
|
||||
|
||||
struct COLL_SETUP
|
||||
struct CollisionSetup
|
||||
{
|
||||
COLL_PROBE_MODE Mode; // Probe rotation mode
|
||||
CollisionProbeMode Mode; // Probe rotation mode
|
||||
int Radius; // Collision bounds horizontal size
|
||||
int Height; // Collision bounds vertical size
|
||||
short ForwardAngle; // Forward angle direction
|
||||
|
||||
bool SlopesAreWalls; // Treat steep slopes as walls
|
||||
bool SlopesArePits; // Treat steep slopes as pits
|
||||
bool DeathFlagIsPit; // Treat death sectors as pits
|
||||
bool EnableObjectPush; // Can be pushed by objects
|
||||
bool EnableSpaz; // Push is treated as hurt
|
||||
|
||||
int Radius; // Collision bounds horizontal size
|
||||
int Height; // Collision bounds vertical size
|
||||
short ForwardAngle; // Forward angle direction
|
||||
int BadHeightDown; // Borderline step-up height
|
||||
int BadHeightUp; // Borderline step-down height
|
||||
int BadCeilingHeight; // Borderline ceiling height
|
||||
int LowerFloorBound; // Borderline floor step-up height
|
||||
int UpperFloorBound; // Borderline floor step-down height
|
||||
int LowerCeilingBound; // Borderline ceiling step-up height
|
||||
int UpperCeilingBound; // Borderline ceiling step-down height
|
||||
|
||||
PHD_VECTOR OldPosition; // Preserve old parameters to restore later
|
||||
int OldAnimState;
|
||||
bool BlockFloorSlopeUp; // Treat steep slopes as walls
|
||||
bool BlockFloorSlopeDown; // Treat steep slopes as pits
|
||||
bool BlockCeilingSlope; // Treat steep slopes on ceilings as walls
|
||||
bool BlockDeathFloorDown; // Treat death sectors as pits
|
||||
bool BlockMonkeySwingEdge; // Treat non-monkey sectors as walls
|
||||
|
||||
bool EnableObjectPush; // Can be pushed by objects
|
||||
bool EnableSpasm; // Convulse when pushed
|
||||
|
||||
// Preserve old parameters to restore later
|
||||
Vector3Int OldPosition;
|
||||
int OldState;
|
||||
int OldAnimNumber;
|
||||
int OldFrameNumber;
|
||||
};
|
||||
|
||||
struct COLL_INFO
|
||||
struct CollisionInfo
|
||||
{
|
||||
COLL_SETUP Setup; // In parameters
|
||||
CollisionSetup Setup; // In parameters
|
||||
|
||||
COLL_POSITION Middle;
|
||||
COLL_POSITION MiddleLeft;
|
||||
COLL_POSITION MiddleRight;
|
||||
COLL_POSITION Front;
|
||||
COLL_POSITION FrontLeft;
|
||||
COLL_POSITION FrontRight;
|
||||
CollisionPosition Middle;
|
||||
CollisionPosition MiddleLeft;
|
||||
CollisionPosition MiddleRight;
|
||||
CollisionPosition Front;
|
||||
CollisionPosition FrontLeft;
|
||||
CollisionPosition FrontRight;
|
||||
|
||||
PHD_VECTOR Shift;
|
||||
COLL_TYPE CollisionType;
|
||||
Vector3Int Shift;
|
||||
CollisionType CollisionType;
|
||||
Vector2 FloorTilt; // x = x, y = z
|
||||
Vector2 CeilingTilt; // x = x, y = z
|
||||
short NearestLedgeAngle;
|
||||
float NearestLedgeDistance;
|
||||
int TiltX;
|
||||
int TiltZ;
|
||||
|
||||
bool HitStatic;
|
||||
bool HitTallObject;
|
||||
|
||||
bool TriangleAtRight() { return MiddleRight.SplitAngle != 0.0f && MiddleRight.SplitAngle == Middle.SplitAngle; }
|
||||
bool TriangleAtLeft() { return MiddleLeft.SplitAngle != 0.0f && MiddleLeft.SplitAngle == Middle.SplitAngle; }
|
||||
bool DiagonalStepAtRight() { return MiddleRight.DiagonalStep && TriangleAtRight() && (NearestLedgeAngle % ANGLE(90)); }
|
||||
bool DiagonalStepAtLeft() { return MiddleLeft.DiagonalStep && TriangleAtLeft() && (NearestLedgeAngle % ANGLE(90)); }
|
||||
bool DiagonalStepAtRight() { return MiddleRight.DiagonalStep && TriangleAtRight() && (NearestLedgeAngle % ANGLE(90.0f)); }
|
||||
bool DiagonalStepAtLeft() { return MiddleLeft.DiagonalStep && TriangleAtLeft() && (NearestLedgeAngle % ANGLE(90.0f)); }
|
||||
};
|
||||
|
||||
[[nodiscard]] bool TestItemRoomCollisionAABB(ITEM_INFO* item);
|
||||
|
||||
COLL_RESULT GetCollisionResult(ITEM_INFO* item, short angle, int dist, int height);
|
||||
COLL_RESULT GetCollisionResult(FLOOR_INFO* floor, int x, int y, int z);
|
||||
COLL_RESULT GetCollisionResult(int x, int y, int z, short roomNumber);
|
||||
COLL_RESULT GetCollisionResult(ITEM_INFO* item);
|
||||
CollisionResult GetCollision(ITEM_INFO* item, short angle, int distance, int height = 0, int side = 0);
|
||||
CollisionResult GetCollision(FLOOR_INFO* floor, int x, int y, int z);
|
||||
CollisionResult GetCollision(int x, int y, int z, short roomNumber);
|
||||
CollisionResult GetCollision(ITEM_INFO* item);
|
||||
|
||||
void GetCollisionInfo(COLL_INFO* coll, ITEM_INFO* item, PHD_VECTOR offset, bool resetRoom = false);
|
||||
void GetCollisionInfo(COLL_INFO* coll, ITEM_INFO* item, bool resetRoom = false);
|
||||
void GetCollisionInfo(CollisionInfo* coll, ITEM_INFO* item, Vector3Int offset, bool resetRoom = false);
|
||||
void GetCollisionInfo(CollisionInfo* coll, ITEM_INFO* item, bool resetRoom = false);
|
||||
int GetQuadrant(short angle);
|
||||
short GetNearestLedgeAngle(ITEM_INFO* item, COLL_INFO* coll, float& dist);
|
||||
short GetNearestLedgeAngle(ITEM_INFO* item, CollisionInfo* coll, float& distance);
|
||||
|
||||
FLOOR_INFO* GetFloor(int x, int y, int z, short* roomNumber);
|
||||
int GetFloorHeight(FLOOR_INFO* floor, int x, int y, int z);
|
||||
int GetCeiling(FLOOR_INFO* floor, int x, int y, int z);
|
||||
int GetDistanceToFloor(int itemNumber, bool precise = true);
|
||||
void AlterFloorHeight(ITEM_INFO* item, int height);
|
||||
|
||||
int GetWaterSurface(int x, int y, int z, short roomNumber);
|
||||
int GetWaterSurface(ITEM_INFO* item);
|
||||
int GetWaterDepth(int x, int y, int z, short roomNumber);
|
||||
int GetWaterDepth(ITEM_INFO* item);
|
||||
int GetWaterHeight(int x, int y, int z, short roomNumber);
|
||||
int GetWaterHeight(ITEM_INFO* item);
|
||||
|
||||
int FindGridShift(int x, int z);
|
||||
void ShiftItem(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void MoveItem(ITEM_INFO* item, short angle, int x, int y = 0);
|
||||
void SnapItemToLedge(ITEM_INFO* item, COLL_INFO* coll, float offsetMultiplier = 0.0f);
|
||||
void SnapItemToLedge(ITEM_INFO* item, COLL_INFO* coll, short angle, float offsetMultiplier = 0.0f);
|
||||
void SnapItemToGrid(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void ShiftItem(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void MoveItem(ITEM_INFO* item, short angle, int x, int z = 0);
|
||||
void SnapItemToLedge(ITEM_INFO* item, CollisionInfo* coll, float offsetMultiplier = 0.0f, bool snapYRot = true);
|
||||
void SnapItemToLedge(ITEM_INFO* item, CollisionInfo* coll, short angle, float offsetMultiplier = 0.0f);
|
||||
void SnapItemToGrid(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
void CalcItemToFloorRotation(ITEM_INFO* item, int radiusDivide = 1);
|
||||
void CalculateItemRotationToSurface(ITEM_INFO* item, float radiusDivisor = 1.0f, short xOffset = 0, short zOffset = 0);
|
||||
|
||||
short GetSurfaceAspectAngle(float xTilt, float zTilt);
|
||||
short GetSurfaceSteepnessAngle(float xTilt, float zTilt);
|
||||
|
||||
bool TestEnvironment(RoomEnvFlags environmentType, ROOM_INFO* room);
|
||||
bool TestEnvironment(RoomEnvFlags environmentType, int roomNumber);
|
||||
bool TestEnvironment(RoomEnvFlags environmentType, ITEM_INFO* item);
|
||||
bool TestEnvironment(RoomEnvFlags environmentType, int x, int y, int z, int roomNumber);
|
||||
|
|
|
@ -5,6 +5,14 @@
|
|||
|
||||
constexpr auto WALL_PLANE = Vector3(0, 0, static_cast<float>(-CLICK(127)));
|
||||
|
||||
enum class CLIMB_DIRECTION : short
|
||||
{
|
||||
North = 0x0100,
|
||||
East = 0x0200,
|
||||
South = 0x0400,
|
||||
West = 0x0800
|
||||
};
|
||||
|
||||
enum class FLOOR_MATERIAL : unsigned char
|
||||
{
|
||||
Mud = 0,
|
||||
|
@ -51,6 +59,23 @@ struct SECTOR_FLAGS
|
|||
|
||||
bool MarkTriggerer;
|
||||
bool MarkTriggererActive; // TODO: IT NEEDS TO BE WRITTEN/READ FROM SAVEGAMES!
|
||||
|
||||
bool ClimbPossible(CLIMB_DIRECTION direction)
|
||||
{
|
||||
switch (direction)
|
||||
{
|
||||
case CLIMB_DIRECTION::North:
|
||||
return ClimbNorth;
|
||||
case CLIMB_DIRECTION::South:
|
||||
return ClimbSouth;
|
||||
case CLIMB_DIRECTION::East:
|
||||
return ClimbEast;
|
||||
case CLIMB_DIRECTION::West:
|
||||
return ClimbWest;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class FLOOR_INFO
|
||||
|
@ -70,7 +95,7 @@ class FLOOR_INFO
|
|||
|
||||
int SectorPlane(int x, int z) const;
|
||||
int SectorPlaneCeiling(int x, int z) const;
|
||||
std::pair<int, int> FLOOR_INFO::TiltXZ(int x, int z) const;
|
||||
Vector2 FLOOR_INFO::TiltXZ(int x, int z, bool floor) const;
|
||||
bool FloorIsSplit() const;
|
||||
bool FloorIsDiagonalStep() const;
|
||||
bool CeilingIsDiagonalStep() const;
|
||||
|
@ -103,9 +128,9 @@ class FLOOR_INFO
|
|||
|
||||
namespace TEN::Floordata
|
||||
{
|
||||
VectorInt2 GetSectorPoint(int x, int z);
|
||||
VectorInt2 GetRoomPosition(int roomNumber, int x, int z);
|
||||
FLOOR_INFO& GetFloor(int roomNumber, const VectorInt2& pos);
|
||||
Vector2Int GetSectorPoint(int x, int z);
|
||||
Vector2Int GetRoomPosition(int roomNumber, int x, int z);
|
||||
FLOOR_INFO& GetFloor(int roomNumber, const Vector2Int& pos);
|
||||
FLOOR_INFO& GetFloor(int roomNumber, int x, int z);
|
||||
FLOOR_INFO& GetFloorSide(int roomNumber, int x, int z, int* sideRoomNumber = nullptr);
|
||||
FLOOR_INFO& GetBottomFloor(int roomNumber, int x, int z, int* bottomRoomNumber = nullptr);
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
struct ITEM_INFO;
|
||||
struct BITE_INFO;
|
||||
struct CREATURE_INFO;
|
||||
struct LOT_INFO;
|
||||
struct CreatureInfo;
|
||||
struct LOTInfo;
|
||||
|
||||
enum TARGET_TYPE
|
||||
{
|
||||
|
@ -49,6 +49,7 @@ struct OBJECT_BONES
|
|||
{
|
||||
this->bone0 = angleY;
|
||||
this->bone1 = angleX;
|
||||
|
||||
if (total)
|
||||
{
|
||||
this->bone2 = angleY;
|
||||
|
@ -115,8 +116,6 @@ struct BITE_INFO
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct EntityStoringInfo
|
||||
{
|
||||
// position of the entity
|
||||
|
@ -185,40 +184,40 @@ constexpr auto CLIP_BOTTOM = 0x8;
|
|||
constexpr auto SECONDARY_CLIP = 0x10;
|
||||
constexpr auto ALL_CLIP = (CLIP_LEFT | CLIP_RIGHT | CLIP_TOP | CLIP_BOTTOM);
|
||||
|
||||
void GetCreatureMood(ITEM_INFO* item, AI_INFO* info, int violent);
|
||||
void CreatureMood(ITEM_INFO* item, AI_INFO* info, int violent);
|
||||
void FindAITargetObject(CREATURE_INFO* creature, short objectNumber);
|
||||
void GetAITarget(CREATURE_INFO* creature);
|
||||
int CreatureVault(short itemNum, short angle, int vault, int shift);
|
||||
void DropBaddyPickups(ITEM_INFO* item);
|
||||
int MoveCreature3DPos(PHD_3DPOS* srcpos, PHD_3DPOS* destpos, int velocity, short angdif, int angadd);
|
||||
void CreatureYRot2(PHD_3DPOS* srcpos, short angle, short angadd);
|
||||
bool SameZone(CREATURE_INFO* creature, ITEM_INFO* target);
|
||||
void FindAITargetObject(CREATURE_INFO* creature, short objNum);
|
||||
short AIGuard(CREATURE_INFO* creature);
|
||||
void GetCreatureMood(ITEM_INFO* item, AI_INFO* AI, int violent);
|
||||
void CreatureMood(ITEM_INFO* item, AI_INFO* AI, int violent);
|
||||
void FindAITargetObject(CreatureInfo* creature, short objectNumber);
|
||||
void GetAITarget(CreatureInfo* creature);
|
||||
int CreatureVault(short itemNumber, short angle, int vault, int shift);
|
||||
void DropEntityPickups(ITEM_INFO* item);
|
||||
bool MoveCreature3DPos(PHD_3DPOS* origin, PHD_3DPOS* target, int velocity, short angleDif, int angleAdd);
|
||||
void CreatureYRot2(PHD_3DPOS* srcPos, short angle, short angleAdd);
|
||||
bool SameZone(CreatureInfo* creature, ITEM_INFO* target);
|
||||
void FindAITargetObject(CreatureInfo* creature, short objNum);
|
||||
short AIGuard(CreatureInfo* creature);
|
||||
void AlertNearbyGuards(ITEM_INFO* item);
|
||||
void AlertAllGuards(short itemNumber);
|
||||
void CreatureKill(ITEM_INFO* item, int killAnim, int killState, short laraAnim);
|
||||
void CreatureKill(ITEM_INFO* item, int killAnim, int killState, int laraKillState);
|
||||
short CreatureEffect2(ITEM_INFO* item, BITE_INFO* bite, short damage, short angle, std::function<CreatureEffectFunction> func);
|
||||
short CreatureEffect(ITEM_INFO* item, BITE_INFO* bite, std::function<CreatureEffectFunction> func);
|
||||
void CreatureUnderwater(ITEM_INFO* item, int depth);
|
||||
void CreatureFloat(short itemNumber);
|
||||
void CreatureJoint(ITEM_INFO* item, short joint, short required);
|
||||
void CreatureTilt(ITEM_INFO* item, short angle);
|
||||
short CreatureTurn(ITEM_INFO* item, short maximumTurn);
|
||||
short CreatureTurn(ITEM_INFO* item, short maxTurn);
|
||||
void CreatureDie(short itemNumber, int explode);
|
||||
int BadFloor(int x, int y, int z, int boxHeight, int nextHeight, short roomNumber, LOT_INFO* LOT);
|
||||
int BadFloor(int x, int y, int z, int boxHeight, int nextHeight, short roomNumber, LOTInfo* LOT);
|
||||
int CreatureCreature(short itemNumber);
|
||||
int ValidBox(ITEM_INFO* item, short zoneNumber, short boxNumber);
|
||||
int EscapeBox(ITEM_INFO* item, ITEM_INFO* enemy, int boxNumber);
|
||||
void TargetBox(LOT_INFO* LOT, int boxNumber);
|
||||
int UpdateLOT(LOT_INFO* LOT, int expansion);
|
||||
int SearchLOT(LOT_INFO* LOT, int expansion);
|
||||
void TargetBox(LOTInfo* LOT, int boxNumber);
|
||||
int UpdateLOT(LOTInfo* LOT, int expansion);
|
||||
int SearchLOT(LOTInfo* LOT, int expansion);
|
||||
int CreatureActive(short itemNumber);
|
||||
void InitialiseCreature(short itemNumber);
|
||||
int StalkBox(ITEM_INFO* item, ITEM_INFO* enemy, int boxNumber);
|
||||
void CreatureAIInfo(ITEM_INFO* item, AI_INFO* info);
|
||||
TARGET_TYPE CalculateTarget(PHD_VECTOR* target, ITEM_INFO* item, LOT_INFO* LOT);
|
||||
void CreatureAIInfo(ITEM_INFO* item, AI_INFO* AI);
|
||||
TARGET_TYPE CalculateTarget(Vector3Int* target, ITEM_INFO* item, LOTInfo* LOT);
|
||||
int CreatureAnimation(short itemNumber, short angle, short tilt);
|
||||
void AdjustStopperFlag(ITEM_INFO* item, int dir, bool set);
|
||||
void InitialiseItemBoxData();
|
||||
void AdjustStopperFlag(ITEM_INFO* item, int direction, bool set);
|
||||
void InitialiseItemBoxData();
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
|
||||
struct BOUNDING_BOX;
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct CollisionInfo;
|
||||
class FLOOR_INFO;
|
||||
struct ANIM_STRUCT;
|
||||
struct MESH_INFO;
|
||||
struct ROOM_INFO;
|
||||
|
||||
enum class GAME_STATUS
|
||||
enum class GameStatus
|
||||
{
|
||||
GAME_STATUS_NONE,
|
||||
GAME_STATUS_NEW_GAME,
|
||||
GAME_STATUS_LOAD_GAME,
|
||||
GAME_STATUS_SAVE_GAME,
|
||||
GAME_STATUS_EXIT_TO_TITLE,
|
||||
GAME_STATUS_EXIT_GAME,
|
||||
GAME_STATUS_LARA_DEAD,
|
||||
GAME_STATUS_LEVEL_COMPLETED
|
||||
None,
|
||||
NewGame,
|
||||
LoadGame,
|
||||
SaveGame,
|
||||
ExitToTitle,
|
||||
ExitGame,
|
||||
LaraDead,
|
||||
LevelComplete
|
||||
};
|
||||
|
||||
enum HEADINGS
|
||||
|
@ -74,9 +74,9 @@ extern std::vector<short> OutsideRoomTable[OUTSIDE_SIZE][OUTSIDE_SIZE];
|
|||
|
||||
int DrawPhase();
|
||||
|
||||
GAME_STATUS DoTitle(int index, std::string const & ambient);
|
||||
GAME_STATUS DoLevel(int index, std::string const & ambient, bool loadFromSavegame);
|
||||
GAME_STATUS ControlPhase(int numFrames, int demoMode);
|
||||
GameStatus DoTitle(int index, std::string const & ambient);
|
||||
GameStatus DoLevel(int index, std::string const & ambient, bool loadFromSavegame);
|
||||
GameStatus ControlPhase(int numFrames, int demoMode);
|
||||
|
||||
int GetRandomControl();
|
||||
int GetRandomDraw();
|
||||
|
@ -84,17 +84,8 @@ int GetRandomDraw();
|
|||
void KillMoveItems();
|
||||
void KillMoveEffects();
|
||||
void UpdateShatters();
|
||||
int ExplodeItemNode(ITEM_INFO* item, int Node, int NoXZVel, int bits);
|
||||
bool ExplodeItemNode(ITEM_INFO* item, int node, int noXZVel, int bits);
|
||||
|
||||
void CleanUp();
|
||||
|
||||
void AlterFloorHeight(ITEM_INFO* item, int height);
|
||||
int GetFloorHeight(FLOOR_INFO* floor, int x, int y, int z);
|
||||
FLOOR_INFO* GetFloor(int x, int y, int z, short* roomNumber);
|
||||
int GetCeiling(FLOOR_INFO* floor, int x, int y, int z);
|
||||
int GetWaterSurface(int x, int y, int z, short roomNumber);
|
||||
int GetWaterDepth(int x, int y, int z, short roomNumber);
|
||||
int GetWaterHeight(int x, int y, int z, short roomNumber);
|
||||
int GetDistanceToFloor(int itemNumber, bool precise = true);
|
||||
|
||||
unsigned CALLBACK GameMain(void*);
|
||||
unsigned CALLBACK GameMain(void*);
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
|
||||
constexpr auto NO_LOS_ITEM = INT_MAX;
|
||||
|
||||
bool LOSAndReturnTarget(GAME_VECTOR* start, GAME_VECTOR* target, int push);
|
||||
bool LOS(GAME_VECTOR* start, GAME_VECTOR* end);
|
||||
int xLOS(GAME_VECTOR* start, GAME_VECTOR* end);
|
||||
int zLOS(GAME_VECTOR* start, GAME_VECTOR* end);
|
||||
int ClipTarget(GAME_VECTOR* start, GAME_VECTOR* target);
|
||||
int GetTargetOnLOS(GAME_VECTOR* src, GAME_VECTOR* dest, int DrawTarget, int firing);
|
||||
int ObjectOnLOS2(GAME_VECTOR* start, GAME_VECTOR* end, PHD_VECTOR* vec, MESH_INFO** mesh, GAME_OBJECT_ID priorityObject = GAME_OBJECT_ID::ID_NO_OBJECT);
|
||||
int DoRayBox(GAME_VECTOR* start, GAME_VECTOR* end, BOUNDING_BOX* box, PHD_3DPOS* itemOrStaticPos, PHD_VECTOR* hitPos, short closesItemNumber);
|
||||
bool LOSAndReturnTarget(GameVector* start, GameVector* target, int push);
|
||||
bool LOS(GameVector* start, GameVector* end);
|
||||
int xLOS(GameVector* start, GameVector* end);
|
||||
int zLOS(GameVector* start, GameVector* end);
|
||||
bool ClipTarget(GameVector* start, GameVector* target);
|
||||
bool GetTargetOnLOS(GameVector* src, GameVector* dest, int drawTarget, bool firing);
|
||||
int ObjectOnLOS2(GameVector* start, GameVector* end, Vector3Int* vec, MESH_INFO** mesh, GAME_OBJECT_ID priorityObject = GAME_OBJECT_ID::ID_NO_OBJECT);
|
||||
bool DoRayBox(GameVector* start, GameVector* end, BOUNDING_BOX* box, PHD_3DPOS* itemOrStaticPos, Vector3Int* hitPos, short closesItemNumber);
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#pragma once
|
||||
#include "Game/control/box.h"
|
||||
|
||||
extern std::vector<CREATURE_INFO*> ActiveCreatures;
|
||||
extern std::vector<CreatureInfo*> ActiveCreatures;
|
||||
|
||||
void InitialiseLOTarray(int allocMem);
|
||||
int EnableBaddieAI(short itemNum, int always);
|
||||
void InitialiseSlot(short itemNum, short slot);
|
||||
void DisableBaddieAI(short itemNumber);
|
||||
void ClearLOT(LOT_INFO* LOT);
|
||||
void DisableEntityAI(short itemNumber);
|
||||
void ClearLOT(LOTInfo* LOT);
|
||||
void CreateZone(ITEM_INFO* item);
|
||||
|
|
|
@ -62,7 +62,7 @@ extern int KeyTriggerActive;
|
|||
|
||||
bool GetKeyTrigger(ITEM_INFO* item);
|
||||
int GetSwitchTrigger(ITEM_INFO* item, short* itemNos, int attatchedToSwitch);
|
||||
int SwitchTrigger(short itemNum, short timer);
|
||||
int SwitchTrigger(short itemNumber, short timer);
|
||||
int KeyTrigger(short itemNum);
|
||||
int PickupTrigger(short itemNum);
|
||||
void RefreshCamera(short type, short* data);
|
||||
|
@ -74,4 +74,4 @@ void TestTriggers(int x, int y, int z, short roomNumber, bool heavy, int heavyFl
|
|||
void TestTriggers(ITEM_INFO* item, bool heavy, int heavyFlags = 0);
|
||||
void ProcessSectorFlags(FLOOR_INFO* floor);
|
||||
void ProcessSectorFlags(int x, int y, int z, short roomNumber);
|
||||
void ProcessSectorFlags(ITEM_INFO* item);
|
||||
void ProcessSectorFlags(ITEM_INFO* item);
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
#pragma once
|
||||
#include "Specific/phd_global.h"
|
||||
|
||||
enum class LaraWeaponType;
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct CollisionInfo;
|
||||
|
||||
enum RIPPLE_TYPE
|
||||
{
|
||||
|
@ -190,11 +191,11 @@ extern SPLASH_STRUCT Splashes[MAX_SPLASHES];
|
|||
extern RIPPLE_STRUCT Ripples[MAX_RIPPLES];
|
||||
extern SPARKS Sparks[MAX_SPARKS];
|
||||
extern SP_DYNAMIC SparkDynamics[MAX_SPARKS_DYNAMICS];
|
||||
extern int SmokeWeapon;
|
||||
extern LaraWeaponType SmokeWeapon;
|
||||
extern byte SmokeCountL;
|
||||
extern byte SmokeCountR;
|
||||
extern int SplashCount;
|
||||
extern PHD_VECTOR NodeVectors[MAX_NODE];
|
||||
extern Vector3Int NodeVectors[MAX_NODE];
|
||||
extern NODEOFFSET_INFO NodeOffsets[MAX_NODE];
|
||||
|
||||
extern FX_INFO EffectList[NUM_EFFECTS];
|
||||
|
@ -202,7 +203,7 @@ extern FX_INFO EffectList[NUM_EFFECTS];
|
|||
void DetatchSpark(int num, SpriteEnumFlag type);
|
||||
int GetFreeSpark();
|
||||
void UpdateSparks();
|
||||
void TriggerRicochetSpark(GAME_VECTOR* pos, short angle, int num, int unk);
|
||||
void TriggerRicochetSpark(GameVector* pos, short angle, int num, int unk);
|
||||
void TriggerCyborgSpark(int x, int y, int z, short xv, short yv, short zv);
|
||||
void TriggerExplosionSparks(int x, int y, int z, int extraTrig, int dynamic, int uw, int roomNumber);
|
||||
void TriggerExplosionSmokeEnd(int x, int y, int z, int uw);
|
||||
|
@ -229,4 +230,4 @@ void WadeSplash(ITEM_INFO* item, int wh, int wd);
|
|||
void Splash(ITEM_INFO* item);
|
||||
void TriggerRocketFire(int x, int y, int z);
|
||||
void TriggerExplosionBubbles(int x, int y, int z, short roomNumber);
|
||||
void Richochet(PHD_3DPOS* pos);
|
||||
void Richochet(PHD_3DPOS* pos);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
using std::vector;
|
||||
|
||||
struct PHD_VECTOR;
|
||||
struct Vector3Int;
|
||||
struct ENERGY_ARC;
|
||||
|
||||
namespace TEN::Effects::Lightning
|
||||
|
@ -22,10 +22,10 @@ namespace TEN::Effects::Lightning
|
|||
|
||||
struct LIGHTNING_INFO
|
||||
{
|
||||
PHD_VECTOR pos1;
|
||||
PHD_VECTOR pos2;
|
||||
PHD_VECTOR pos3;
|
||||
PHD_VECTOR pos4;
|
||||
Vector3Int pos1;
|
||||
Vector3Int pos2;
|
||||
Vector3Int pos3;
|
||||
Vector3Int pos4;
|
||||
signed char interpolation[9];
|
||||
byte r;
|
||||
byte g;
|
||||
|
@ -46,14 +46,14 @@ namespace TEN::Effects::Lightning
|
|||
|
||||
extern int LightningRandomSeed;
|
||||
extern float FloatSinCosTable[8192];
|
||||
extern PHD_VECTOR LightningPos[6];
|
||||
extern Vector3Int LightningPos[6];
|
||||
extern short LightningBuffer[1024];
|
||||
|
||||
extern std::vector<LIGHTNING_INFO> Lightning;
|
||||
|
||||
void InitialiseFloatSinCosTable();
|
||||
void UpdateLightning();
|
||||
void TriggerLightning(PHD_VECTOR* src, PHD_VECTOR* dest, char amplitude, byte r, byte g, byte b, byte life, char flags, char width, char segments);
|
||||
void CalcLightningSpline(PHD_VECTOR* pos, short* buffer, LIGHTNING_INFO* arc);
|
||||
void TriggerLightning(Vector3Int* src, Vector3Int* dest, char amplitude, byte r, byte g, byte b, byte life, char flags, char width, char segments);
|
||||
void CalcLightningSpline(Vector3Int* pos, short* buffer, LIGHTNING_INFO* arc);
|
||||
void TriggerLightningGlow(int x, int y, int z, byte size, byte r, byte g, byte b);
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
#include "Game/Lara/lara_struct.h"
|
||||
#include "Specific/phd_global.h"
|
||||
|
||||
enum class LaraWeaponType;
|
||||
struct ITEM_INFO;
|
||||
|
||||
struct SMOKE_SPARKS
|
||||
|
@ -198,7 +199,7 @@ extern FIRE_LIST Fires[MAX_FIRE_LIST];
|
|||
extern SMOKE_SPARKS SmokeSparks[MAX_SPARKS_SMOKE];
|
||||
|
||||
void TriggerBlood(int x, int y, int z, int unk, int num);
|
||||
void TriggerExplosionBubble(int x, int y, int z, short roomNum);
|
||||
void TriggerExplosionBubble(int x, int y, int z, short roomNumber);
|
||||
int GetFreeFireSpark();
|
||||
void TriggerGlobalStaticFlame();
|
||||
void TriggerGlobalFireSmoke();
|
||||
|
@ -209,14 +210,14 @@ void AddFire(int x, int y, int z, char size, short roomNum, short on);
|
|||
void UpdateFireSparks();
|
||||
int GetFreeSmokeSpark();
|
||||
void UpdateSmoke();
|
||||
byte TriggerGunSmoke_SubFunction(int weaponType);
|
||||
void TriggerGunSmoke(int x, int y, int z, short xv, short yv, short zv, byte initial, int weaponType, byte count);
|
||||
byte TriggerGunSmoke_SubFunction(LaraWeaponType weaponType);
|
||||
void TriggerGunSmoke(int x, int y, int z, short xv, short yv, short zv, byte initial, LaraWeaponType weaponType, byte count);
|
||||
void TriggerShatterSmoke(int x, int y, int z);
|
||||
int GetFreeBlood();
|
||||
void TriggerBlood(int x, int y, int z, int unk, int num);
|
||||
void UpdateBlood();
|
||||
int GetFreeGunshell();
|
||||
void TriggerGunShell(short hand, short objNum, LARA_WEAPON_TYPE weaponType);
|
||||
void TriggerGunShell(short hand, short objNum, LaraWeaponType weaponType);
|
||||
void UpdateGunShells();
|
||||
void AddWaterSparks(int x, int y, int z, int num);
|
||||
int GetFreeBubble();
|
||||
|
@ -235,5 +236,5 @@ int GetFreeShockwave();
|
|||
void TriggerShockwave(PHD_3DPOS* pos, short innerRad, short outerRad, int speed, char r, char g, char b, char life, short angle, short flags);
|
||||
void TriggerShockwaveHitEffect(int x, int y, int z, int color, short rot, int vel);
|
||||
void UpdateShockwaves();
|
||||
void TriggerSmallSplash(int x, int y, int z, int num);
|
||||
void SetFadeClip(short height, short speed);
|
||||
void TriggerSmallSplash(int x, int y, int z, int number);
|
||||
void SetFadeClip(short height, int velocity);
|
||||
|
|
|
@ -32,68 +32,83 @@ enum ZoneType : char
|
|||
ZONE_HUMAN_LONGJUMP_AND_MONKEY,
|
||||
};
|
||||
|
||||
struct LOT_INFO
|
||||
struct LOTInfo
|
||||
{
|
||||
std::vector<BOX_NODE> node;
|
||||
int head;
|
||||
int tail;
|
||||
int searchNumber;
|
||||
int blockMask;
|
||||
short step;
|
||||
short drop;
|
||||
short zoneCount;
|
||||
int targetBox;
|
||||
int requiredBox;
|
||||
short fly;
|
||||
bool canJump;
|
||||
bool canMonkey;
|
||||
bool isAmphibious;
|
||||
bool isJumping;
|
||||
bool isMonkeying;
|
||||
PHD_VECTOR target;
|
||||
ZoneType zone;
|
||||
bool initialised;
|
||||
bool Initialised;
|
||||
|
||||
std::vector<BOX_NODE> Node;
|
||||
int Head;
|
||||
int Tail;
|
||||
|
||||
int SearchNumber;
|
||||
int BlockMask;
|
||||
short Step;
|
||||
short Drop;
|
||||
short ZoneCount;
|
||||
int TargetBox;
|
||||
int RequiredBox;
|
||||
short Fly;
|
||||
|
||||
bool CanJump;
|
||||
bool CanMonkey;
|
||||
bool IsJumping;
|
||||
bool IsMonkeying;
|
||||
bool IsAmphibious;
|
||||
|
||||
Vector3Int Target;
|
||||
ZoneType Zone;
|
||||
};
|
||||
|
||||
enum MOOD_TYPE
|
||||
enum class MoodType
|
||||
{
|
||||
BORED_MOOD,
|
||||
ATTACK_MOOD,
|
||||
ESCAPE_MOOD,
|
||||
STALK_MOOD
|
||||
Bored,
|
||||
Attack,
|
||||
Escape,
|
||||
Stalk
|
||||
};
|
||||
|
||||
enum class CREATURE_AI_PRIORITY
|
||||
enum class CreatureAIPriority
|
||||
{
|
||||
HIGH,
|
||||
MEDIUM,
|
||||
LOW,
|
||||
NONE
|
||||
None,
|
||||
High,
|
||||
Medium,
|
||||
Low
|
||||
};
|
||||
|
||||
struct CREATURE_INFO
|
||||
struct CreatureInfo
|
||||
{
|
||||
short jointRotation[4];
|
||||
short maximumTurn;
|
||||
short flags;
|
||||
bool alerted;
|
||||
bool headLeft;
|
||||
bool headRight;
|
||||
bool reachedGoal;
|
||||
bool hurtByLara;
|
||||
bool patrol2;
|
||||
bool jumpAhead;
|
||||
bool monkeyAhead;
|
||||
MOOD_TYPE mood;
|
||||
ITEM_INFO* enemy;
|
||||
short aiTargetNum;
|
||||
ITEM_INFO* aiTarget;
|
||||
short pad;
|
||||
short itemNum;
|
||||
PHD_VECTOR target;
|
||||
LOT_INFO LOT;
|
||||
short ItemNumber;
|
||||
|
||||
short MaxTurn;
|
||||
short JointRotation[4];
|
||||
bool HeadLeft;
|
||||
bool HeadRight;
|
||||
|
||||
bool Patrol; // Unused?
|
||||
bool Alerted;
|
||||
bool Friendly;
|
||||
bool HurtByLara;
|
||||
bool Poisoned;
|
||||
bool JumpAhead;
|
||||
bool MonkeySwingAhead;
|
||||
bool ReachedGoal;
|
||||
|
||||
short Tosspad;
|
||||
short LocationAI;
|
||||
short FiredWeapon;
|
||||
|
||||
LOTInfo LOT;
|
||||
MoodType Mood;
|
||||
ITEM_INFO* Enemy;
|
||||
short AITargetNumber;
|
||||
ITEM_INFO* AITarget;
|
||||
short Pad; // Unused?
|
||||
Vector3Int Target;
|
||||
|
||||
#ifdef CREATURE_AI_PRIORITY_OPTIMIZATION
|
||||
CREATURE_AI_PRIORITY priority;
|
||||
size_t framesSinceLOTUpdate;
|
||||
CreatureAIPriority Priority;
|
||||
size_t FramesSinceLOTUpdate;
|
||||
#endif
|
||||
};
|
||||
|
||||
short Flags;
|
||||
};
|
||||
|
|
|
@ -2,13 +2,16 @@
|
|||
#include "Game/collision/floordata.h"
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct DOORPOS_DATA {
|
||||
|
||||
struct DOORPOS_DATA
|
||||
{
|
||||
FLOOR_INFO* floor;
|
||||
FLOOR_INFO data;
|
||||
short block;
|
||||
};
|
||||
|
||||
struct DOOR_DATA {
|
||||
struct DOOR_DATA
|
||||
{
|
||||
DOORPOS_DATA d1;
|
||||
DOORPOS_DATA d1flip;
|
||||
DOORPOS_DATA d2;
|
||||
|
@ -23,4 +26,4 @@ struct DOOR_DATA {
|
|||
unsigned char dn3;
|
||||
unsigned char dn4;
|
||||
ITEM_INFO* item;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -26,7 +26,8 @@ template<class... Ts> visitor(Ts...)->visitor<Ts...>; // line not needed in C++2
|
|||
|
||||
struct ITEM_INFO;
|
||||
|
||||
class ITEM_DATA {
|
||||
class ITEM_DATA
|
||||
{
|
||||
std::variant<std::nullptr_t,
|
||||
char,
|
||||
short,
|
||||
|
@ -43,23 +44,23 @@ class ITEM_DATA {
|
|||
long double,
|
||||
std::array<short, 4>,
|
||||
ITEM_INFO*,
|
||||
CREATURE_INFO,
|
||||
LASER_HEAD_INFO,
|
||||
QUAD_INFO,
|
||||
BIGGUNINFO,
|
||||
MOTORBIKE_INFO,
|
||||
JEEP_INFO,
|
||||
CreatureInfo,
|
||||
LaserHeadInfo,
|
||||
QuadInfo,
|
||||
BigGunInfo,
|
||||
MotorbikeInfo,
|
||||
JeepInfo,
|
||||
LaraInfo*,
|
||||
KAYAK_INFO,
|
||||
KayakInfo,
|
||||
DOOR_DATA,
|
||||
SKIDOO_INFO,
|
||||
SUB_INFO,
|
||||
BOAT_INFO,
|
||||
GAME_VECTOR,
|
||||
WRAITH_INFO,
|
||||
RUBBER_BOAT_INFO,
|
||||
PUSHABLE_INFO,
|
||||
CART_INFO
|
||||
SkidooInfo,
|
||||
UPVInfo,
|
||||
SpeedBoatInfo,
|
||||
GameVector,
|
||||
WraithInfo,
|
||||
RubberBoatInfo,
|
||||
PushableInfo,
|
||||
MinecartInfo
|
||||
> data;
|
||||
public:
|
||||
ITEM_DATA();
|
||||
|
@ -67,65 +68,81 @@ class ITEM_DATA {
|
|||
template<typename D>
|
||||
ITEM_DATA(D&& type) : data(std::move(type)) {}
|
||||
|
||||
|
||||
// conversion operators to keep original syntax!
|
||||
// TODO: should be removed later and
|
||||
template<typename T>
|
||||
operator T* () {
|
||||
if(std::holds_alternative<T>(data)) {
|
||||
operator T* ()
|
||||
{
|
||||
if (std::holds_alternative<T>(data))
|
||||
{
|
||||
auto& ref = std::get<T>(data);
|
||||
return &ref;
|
||||
}
|
||||
|
||||
throw std::runtime_error("ITEM_DATA does not hold the requested type!\n The code set the ITEM_DATA to a different type than the type that was attempted to read");
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
operator T& () {
|
||||
if(std::holds_alternative<T>(data)) {
|
||||
operator T& ()
|
||||
{
|
||||
if (std::holds_alternative<T>(data))
|
||||
{
|
||||
auto& ref = std::get<T>(data);
|
||||
return ref;
|
||||
}
|
||||
|
||||
throw std::runtime_error("ITEM_DATA does not hold the requested type!\n The code set the ITEM_DATA to a different type than the type that was attempted to read");
|
||||
}
|
||||
|
||||
/* Uncommented, we want to store pointers to global data, too (LaraInfo for example)
|
||||
template<typename T>
|
||||
ITEM_DATA& operator=(T* newData) {
|
||||
ITEM_DATA& operator=(T* newData)
|
||||
{
|
||||
data = *newData;
|
||||
return *this;
|
||||
}
|
||||
*/
|
||||
ITEM_DATA& operator=(std::nullptr_t null) {
|
||||
|
||||
ITEM_DATA& operator=(std::nullptr_t null)
|
||||
{
|
||||
data = nullptr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
ITEM_DATA& operator=(T& newData) {
|
||||
ITEM_DATA& operator=(T& newData)
|
||||
{
|
||||
data = newData;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
ITEM_DATA& operator=(T&& newData) {
|
||||
ITEM_DATA& operator=(T&& newData)
|
||||
{
|
||||
data = std::move(newData);
|
||||
return *this;
|
||||
}
|
||||
|
||||
operator bool() const {
|
||||
operator bool() const
|
||||
{
|
||||
return !std::holds_alternative<std::nullptr_t>(data);
|
||||
}
|
||||
|
||||
template<typename ... Funcs>
|
||||
void apply(Funcs&&... funcs) {
|
||||
void apply(Funcs&&... funcs)
|
||||
{
|
||||
std::visit(
|
||||
visitor{
|
||||
[](auto const&) {},
|
||||
std::forward<Funcs>(funcs)...
|
||||
},
|
||||
visitor
|
||||
{
|
||||
[](auto const&) {},
|
||||
std::forward<Funcs>(funcs)...
|
||||
},
|
||||
data);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool is() const {
|
||||
bool is() const
|
||||
{
|
||||
return std::holds_alternative<T>(data);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
@ -9,8 +10,19 @@
|
|||
|
||||
enum GAME_OBJECT_ID : short;
|
||||
|
||||
// used by fx->shade !
|
||||
#define RGB555(r, g, b) ((r << 7) & 0x7C00 | (g << 2) & 0x3E0 | (b >> 3) & 0x1F)
|
||||
#define WHITE555 RGB555(255, 255, 255)
|
||||
#define GRAY555 RGB555(128, 128, 128)
|
||||
#define BLACK555 RGB555( 0, 0, 0)
|
||||
|
||||
constexpr unsigned int NO_MESH_BITS = UINT_MAX;
|
||||
|
||||
constexpr auto NO_ITEM = -1;
|
||||
constexpr auto ALL_MESHBITS = -1;
|
||||
constexpr auto NOT_TARGETABLE = -16384;
|
||||
constexpr auto NUM_ITEMS = 1024;
|
||||
|
||||
enum AIObjectType
|
||||
{
|
||||
NO_AI = 0x0000,
|
||||
|
@ -40,84 +52,83 @@ enum ItemFlags
|
|||
IFLAG_ACTIVATION_MASK = 0x3E00 // bits 9-13
|
||||
};
|
||||
|
||||
struct EntityAnimationData
|
||||
{
|
||||
int AnimNumber;
|
||||
int FrameNumber;
|
||||
int ActiveState;
|
||||
int TargetState;
|
||||
int RequiredState; // TODO: Phase out this weird feature.
|
||||
|
||||
bool Airborne;
|
||||
int Velocity;
|
||||
int VerticalVelocity;
|
||||
int LateralVelocity;
|
||||
std::vector<BONE_MUTATOR> Mutator;
|
||||
};
|
||||
|
||||
struct ITEM_INFO
|
||||
{
|
||||
int floor;
|
||||
uint32_t touchBits;
|
||||
uint32_t meshBits;
|
||||
GAME_OBJECT_ID objectNumber;
|
||||
int currentAnimState;
|
||||
int goalAnimState;
|
||||
int requiredAnimState;
|
||||
int animNumber;
|
||||
int frameNumber;
|
||||
std::vector<BONE_MUTATOR> mutator;
|
||||
short roomNumber;
|
||||
ROOM_VECTOR location;
|
||||
short nextItem;
|
||||
short nextActive;
|
||||
short speed;
|
||||
short fallspeed;
|
||||
short hitPoints;
|
||||
int boxNumber;
|
||||
short timer;
|
||||
uint16_t flags; // ItemFlags enum
|
||||
short shade;
|
||||
short triggerFlags;
|
||||
short carriedItem;
|
||||
short afterDeath;
|
||||
short firedWeapon;
|
||||
short itemFlags[8];
|
||||
ITEM_DATA data;
|
||||
PHD_3DPOS pos;
|
||||
bool active;
|
||||
short status; // ItemStatus enum
|
||||
bool gravityStatus;
|
||||
bool hitStatus;
|
||||
bool collidable;
|
||||
bool lookedAt;
|
||||
bool poisoned;
|
||||
uint8_t aiBits; // AIObjectType enum
|
||||
bool inDrawRoom;
|
||||
bool friendly;
|
||||
uint32_t swapMeshFlags;
|
||||
short drawRoom;
|
||||
short TOSSPAD;
|
||||
PHD_3DPOS startPos;
|
||||
short locationAI;
|
||||
std::string luaName;
|
||||
std::string LuaName;
|
||||
GAME_OBJECT_ID ObjectNumber;
|
||||
int Status; // ItemStatus enum.
|
||||
bool Active;
|
||||
short NextItem;
|
||||
short NextActive;
|
||||
|
||||
ITEM_DATA Data;
|
||||
EntityAnimationData Animation;
|
||||
PHD_3DPOS Pose;
|
||||
PHD_3DPOS StartPose;
|
||||
int Floor;
|
||||
|
||||
int HitPoints;
|
||||
bool HitStatus;
|
||||
bool LookedAt;
|
||||
bool Collidable;
|
||||
bool InDrawRoom;
|
||||
|
||||
ROOM_VECTOR Location;
|
||||
short RoomNumber;
|
||||
int BoxNumber;
|
||||
int Timer;
|
||||
short Shade;
|
||||
|
||||
uint32_t TouchBits;
|
||||
uint32_t MeshBits;
|
||||
|
||||
uint16_t Flags; // ItemFlags enum
|
||||
short ItemFlags[8];
|
||||
short TriggerFlags;
|
||||
uint32_t SwapMeshFlags;
|
||||
|
||||
// TODO: Move to CreatureInfo?
|
||||
uint8_t AIBits; // AIObjectType enum.
|
||||
short AfterDeath;
|
||||
short CarriedItem;
|
||||
|
||||
// New LUA stuff
|
||||
std::string luaCallbackOnKilledName;
|
||||
std::string luaCallbackOnHitName;
|
||||
std::string luaCallbackOnCollidedWithObjectName;
|
||||
std::string luaCallbackOnCollidedWithRoomName;
|
||||
};
|
||||
|
||||
// used by fx->shade !
|
||||
#define RGB555(r, g, b) ((r << 7) & 0x7C00 | (g << 2) & 0x3E0 | (b >> 3) & 0x1F)
|
||||
#define WHITE555 RGB555(255, 255, 255)
|
||||
#define GRAY555 RGB555(128, 128, 128)
|
||||
#define BLACK555 RGB555( 0, 0, 0)
|
||||
|
||||
constexpr auto NO_ITEM = -1;
|
||||
constexpr auto ALL_MESHBITS = -1;
|
||||
constexpr auto NOT_TARGETABLE = -16384;
|
||||
constexpr auto NUM_ITEMS = 1024;
|
||||
|
||||
void EffectNewRoom(short fxNumber, short roomNumber);
|
||||
void ItemNewRoom(short itemNum, short roomNumber);
|
||||
void ItemNewRoom(short itemNumber, short roomNumber);
|
||||
void AddActiveItem(short itemNumber);
|
||||
void ClearItem(short itemNum);
|
||||
void ClearItem(short itemNumber);
|
||||
short CreateItem();
|
||||
void RemoveAllItemsInRoom(short roomNumber, short objectNumber);
|
||||
void RemoveActiveItem(short const itemNum);
|
||||
void RemoveDrawnItem(short itemNum);
|
||||
void InitialiseFXArray(int allocmem);
|
||||
short CreateNewEffect(short roomNum);
|
||||
void RemoveActiveItem(short itemNumber);
|
||||
void RemoveDrawnItem(short itemNumber);
|
||||
void InitialiseFXArray(int allocateMemory);
|
||||
short CreateNewEffect(short roomNumber);
|
||||
void KillEffect(short fxNumber);
|
||||
void InitialiseItem(short itemNum);
|
||||
void InitialiseItemArray(int numItems);
|
||||
void KillItem(short const itemNum);
|
||||
void UpdateItemRoom(ITEM_INFO* item, int height);
|
||||
void InitialiseItem(short itemNumber);
|
||||
void InitialiseItemArray(int totalItems);
|
||||
void KillItem(short itemNumber);
|
||||
void UpdateItemRoom(ITEM_INFO* item, int height, int xOffset = 0, int zOffset = 0);
|
||||
std::vector<int> FindAllItems(short objectNumber);
|
||||
ITEM_INFO* FindItem(int object_number);
|
||||
ITEM_INFO* FindItem(int objectNumber);
|
||||
int FindItem(ITEM_INFO* item);
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
#pragma once
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct PHD_VECTOR;
|
||||
struct CollisionInfo;
|
||||
struct Vector3Int;
|
||||
struct BOUNDING_BOX;
|
||||
enum GAME_OBJECT_ID : short;
|
||||
|
||||
extern int NumRPickups;
|
||||
extern short RPickups[16];
|
||||
extern PHD_VECTOR OldPickupPos;
|
||||
extern Vector3Int OldPickupPos;
|
||||
|
||||
void InitialisePickup(short itemNumber);
|
||||
void PickedUpObject(GAME_OBJECT_ID objectNumber, int count);
|
||||
void RemoveObjectFromInventory(GAME_OBJECT_ID objectNumber, int count);
|
||||
int GetInventoryCount(GAME_OBJECT_ID objID);
|
||||
void PickedUpObject(GAME_OBJECT_ID objectID, int count);
|
||||
void RemoveObjectFromInventory(GAME_OBJECT_ID objectID, int count);
|
||||
int GetInventoryCount(GAME_OBJECT_ID objectID);
|
||||
void CollectCarriedItems(ITEM_INFO* item);
|
||||
void PickupCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll);
|
||||
void PickupCollision(short itemNumber, ITEM_INFO* laraItem, CollisionInfo* coll);
|
||||
void RegeneratePickups();
|
||||
BOUNDING_BOX* FindPlinth(ITEM_INFO* item);
|
||||
|
||||
void PickupControl(short itemNum);
|
||||
void PickupControl(short itemNumber);
|
||||
|
||||
void InitialiseSearchObject(short itemNumber);
|
||||
void SearchObjectCollision(short itemNumber, ITEM_INFO* laraitem, COLL_INFO* laracoll);
|
||||
void SearchObjectCollision(short itemNumber, ITEM_INFO* laraItem, CollisionInfo* coll);
|
||||
void SearchObjectControl(short itemNumber);
|
||||
void DoPickup(ITEM_INFO* character);
|
||||
int UseSpecialItem(ITEM_INFO* item);
|
||||
void DoPickup(ITEM_INFO* laraItem);
|
||||
bool UseSpecialItem(ITEM_INFO* item);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "Specific/newtypes.h"
|
||||
#include "Specific/phd_global.h"
|
||||
|
||||
struct TRIGGER_VOLUME;
|
||||
struct TriggerVolume;
|
||||
|
||||
constexpr auto MAX_FLIPMAP = 256;
|
||||
|
||||
|
@ -45,7 +45,7 @@ struct MESH_INFO
|
|||
short staticNumber;
|
||||
short flags;
|
||||
Vector4 color;
|
||||
short hitPoints;
|
||||
short HitPoints;
|
||||
std::string luaName;
|
||||
};
|
||||
|
||||
|
@ -69,7 +69,7 @@ struct LIGHTINFO
|
|||
short Cutoff; // size=0, offset=30
|
||||
};
|
||||
|
||||
enum RoomEnumFlag
|
||||
enum RoomEnvFlags
|
||||
{
|
||||
ENV_FLAG_WATER = 0x0001,
|
||||
ENV_FLAG_SWAMP = 0x0004,
|
||||
|
@ -117,7 +117,7 @@ struct ROOM_INFO
|
|||
short itemNumber;
|
||||
short fxNumber;
|
||||
bool boundActive;
|
||||
std::vector<TRIGGER_VOLUME> triggerVolumes;
|
||||
std::vector<TriggerVolume> triggerVolumes;
|
||||
};
|
||||
|
||||
constexpr auto NUM_ROOMS = 1024;
|
||||
|
@ -130,12 +130,12 @@ extern int FlipStats[MAX_FLIPMAP];
|
|||
extern int FlipMap[MAX_FLIPMAP];
|
||||
|
||||
void DoFlipMap(short group);
|
||||
void AddRoomFlipItems(ROOM_INFO* r);
|
||||
void RemoveRoomFlipItems(ROOM_INFO* r);
|
||||
int IsObjectInRoom(short roomNumber, short objectNumber);
|
||||
bool IsPointInRoom(PHD_3DPOS const & pos, int roomNumber);
|
||||
void AddRoomFlipItems(ROOM_INFO* room);
|
||||
void RemoveRoomFlipItems(ROOM_INFO* room);
|
||||
bool IsObjectInRoom(short roomNumber, short objectNumber);
|
||||
bool IsPointInRoom(PHD_3DPOS const& pos, int roomNumber);
|
||||
PHD_3DPOS GetRoomCenter(int roomNumber);
|
||||
int IsRoomOutside(int x, int y, int z);
|
||||
std::set<int> GetRoomList(int roomNumber);
|
||||
|
||||
FLOOR_INFO* GetSector(ROOM_INFO* r, int x, int z);
|
||||
FLOOR_INFO* GetSector(ROOM_INFO* room, int x, int z);
|
||||
|
|
|
@ -1002,7 +1002,7 @@ bool check_divisibility_and_divide_by_pow5(uint32_t& n) FMT_NOEXCEPT {
|
|||
uint32_t threshold;
|
||||
int shift_amount;
|
||||
} infos[] = {{0xcccd, 16, 0x3333, 18}, {0xa429, 8, 0x0a, 20}};
|
||||
constexpr auto info = infos[N - 1];
|
||||
constexpr auto* info = infos[N - 1];
|
||||
n *= info.magic_number;
|
||||
const uint32_t comparison_mask = (1u << info.bits_for_comparison) - 1;
|
||||
bool result = (n & comparison_mask) <= info.threshold;
|
||||
|
@ -1018,7 +1018,7 @@ template <int N> uint32_t small_division_by_pow10(uint32_t n) FMT_NOEXCEPT {
|
|||
int shift_amount;
|
||||
uint32_t divisor_times_10;
|
||||
} infos[] = {{0xcccd, 19, 100}, {0xa3d8, 22, 1000}};
|
||||
constexpr auto info = infos[N - 1];
|
||||
constexpr auto* info = infos[N - 1];
|
||||
FMT_ASSERT(n <= info.divisor_times_10, "n is too large");
|
||||
return n * info.magic_number >> info.shift_amount;
|
||||
}
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
struct BOAT_INFO
|
||||
struct SpeedBoatInfo
|
||||
{
|
||||
int boatTurn;
|
||||
int leftFallspeed;
|
||||
int rightFallspeed;
|
||||
int water;
|
||||
int pitch;
|
||||
short tiltAngle;
|
||||
short extraRotation;
|
||||
short propRot;
|
||||
int TurnRate;
|
||||
short LeanAngle;
|
||||
short ExtraRotation;
|
||||
|
||||
int LeftVerticalVelocity;
|
||||
int RightVerticalVelocity;
|
||||
|
||||
int Water;
|
||||
int Pitch;
|
||||
};
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
#pragma once
|
||||
|
||||
struct SKIDOO_INFO
|
||||
struct SkidooInfo
|
||||
{
|
||||
short trackMesh;
|
||||
int skidooTurn;
|
||||
int leftFallspeed;
|
||||
int rightFallspeed;
|
||||
short momentumAngle;
|
||||
short extraRotation;
|
||||
int pitch;
|
||||
bool alreadyCdPlayed;
|
||||
bool armed;
|
||||
int flashTimer;
|
||||
short TurnRate;
|
||||
short MomentumAngle;
|
||||
short ExtraRotation;
|
||||
|
||||
int LeftVerticalVelocity;
|
||||
int RightVerticalVelocity;
|
||||
|
||||
int Pitch;
|
||||
int FlashTimer;
|
||||
short TrackMesh;
|
||||
bool Armed;
|
||||
};
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
struct BIGGUNINFO
|
||||
struct BigGunInfo
|
||||
{
|
||||
short xRot;
|
||||
short yRot;
|
||||
short startYRot;
|
||||
char flags;
|
||||
int fireCount;
|
||||
short barrelZ;
|
||||
Vector3Shrt Rotation;
|
||||
short BarrelZRotation;
|
||||
short StartYRot;
|
||||
long GunRotYAdd;
|
||||
|
||||
unsigned int FireCount;
|
||||
bool BarrelRotating;
|
||||
|
||||
char Flags;
|
||||
};
|
||||
|
|
|
@ -1,17 +1,24 @@
|
|||
#pragma once
|
||||
#include "Specific/phd_global.h"
|
||||
|
||||
struct KAYAK_INFO
|
||||
struct KayakInfo
|
||||
{
|
||||
int Vel;
|
||||
int Rot;
|
||||
int FallSpeedF;
|
||||
int FallSpeedL;
|
||||
int FallSpeedR;
|
||||
int Water;
|
||||
int TurnRate;
|
||||
|
||||
int Velocity;
|
||||
int FrontVerticalVelocity;
|
||||
int LeftVerticalVelocity;
|
||||
int RightVerticalVelocity;
|
||||
|
||||
unsigned int LeftRightCount;
|
||||
int WaterHeight;
|
||||
PHD_3DPOS OldPos;
|
||||
char Turn;
|
||||
char Forward;
|
||||
char TrueWater;
|
||||
bool Turn;
|
||||
bool Forward;
|
||||
bool TrueWater;
|
||||
|
||||
int CurrentStartWake;
|
||||
int WakeShade;
|
||||
|
||||
char Flags;
|
||||
};
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
struct CART_INFO
|
||||
struct MinecartInfo
|
||||
{
|
||||
int Speed;
|
||||
int MidPos;
|
||||
int FrontPos;
|
||||
short TurnRot;
|
||||
int TurnX;
|
||||
int TurnZ;
|
||||
short TurnLen;
|
||||
short TurnRot;
|
||||
short YVel;
|
||||
short Gradient;
|
||||
|
||||
int Velocity;
|
||||
int VerticalVelocity;
|
||||
int Gradient;
|
||||
unsigned int StopDelay;
|
||||
|
||||
int FloorHeightMiddle;
|
||||
int FloorHeightFront;
|
||||
|
||||
char Flags;
|
||||
char StopDelay;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,18 +1,25 @@
|
|||
#pragma once
|
||||
|
||||
struct QUAD_INFO
|
||||
struct QuadInfo
|
||||
{
|
||||
int velocity;
|
||||
short frontRot;
|
||||
short rearRot;
|
||||
int revs;
|
||||
int engineRevs;
|
||||
short trackMesh;
|
||||
int turnRate;
|
||||
int leftFallspeed;
|
||||
int rightFallspeed;
|
||||
short momentumAngle;
|
||||
short extraRotation;
|
||||
int pitch;
|
||||
char flags;
|
||||
short TurnRate;
|
||||
short FrontRot;
|
||||
short RearRot;
|
||||
short MomentumAngle;
|
||||
short ExtraRotation;
|
||||
|
||||
int Velocity;
|
||||
int LeftVerticalVelocity;
|
||||
int RightVerticalVelocity;
|
||||
|
||||
int Revs;
|
||||
int EngineRevs;
|
||||
int Pitch;
|
||||
|
||||
int SmokeStart;
|
||||
bool CanStartDrift;
|
||||
bool DriftStarting;
|
||||
bool NoDismount;
|
||||
|
||||
char Flags;
|
||||
};
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
#pragma once
|
||||
|
||||
struct RUBBER_BOAT_INFO
|
||||
struct RubberBoatInfo
|
||||
{
|
||||
int boatTurn;
|
||||
int leftFallspeed;
|
||||
int rightFallspeed;
|
||||
short tiltAngle;
|
||||
short extraRotation;
|
||||
int water;
|
||||
int pitch;
|
||||
short propRot;
|
||||
int TurnRate;
|
||||
short LeanAngle;
|
||||
short PropellerRotation;
|
||||
short ExtraRotation;
|
||||
|
||||
int LeftVerticalVelocity;
|
||||
int RightVerticalVelocity;
|
||||
|
||||
int Water;
|
||||
int Pitch;
|
||||
};
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
struct SUB_INFO
|
||||
struct UPVInfo
|
||||
{
|
||||
int Vel;
|
||||
int Velocity;
|
||||
int Rot;
|
||||
int RotX;
|
||||
int XRot;
|
||||
short FanRot;
|
||||
unsigned int HarpoonTimer;
|
||||
bool HarpoonLeft;
|
||||
|
||||
char Flags;
|
||||
char WeaponTimer;
|
||||
};
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
#pragma once
|
||||
struct WRAITH_INFO {
|
||||
int xPos;
|
||||
int yPos;
|
||||
int zPos;
|
||||
short xRot;
|
||||
short yRot;
|
||||
short zRot;
|
||||
|
||||
struct WraithInfo
|
||||
{
|
||||
Vector3Int Position;
|
||||
Vector3Int Velocity;
|
||||
|
||||
unsigned char r;
|
||||
unsigned char g;
|
||||
unsigned char b;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
struct JEEP_INFO {
|
||||
struct JeepInfo {
|
||||
short rot1;
|
||||
short rot2;
|
||||
short rot3;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
struct MOTORBIKE_INFO {
|
||||
struct MotorbikeInfo {
|
||||
int wheelRight; // (two wheel: front and back)
|
||||
int wheelLeft; // (one wheel: left)
|
||||
int velocity;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#pragma once
|
||||
struct LASER_HEAD_INFO {
|
||||
short baseItem;
|
||||
short tentacles[8];
|
||||
short puzzleItem;
|
||||
};
|
||||
|
||||
struct LaserHeadInfo
|
||||
{
|
||||
short BaseItem;
|
||||
short Tentacles[8];
|
||||
short PuzzleItem;
|
||||
};
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#pragma once
|
||||
struct PUSHABLE_INFO {
|
||||
|
||||
struct PushableInfo
|
||||
{
|
||||
int height; // height for collision, also in floor procedure
|
||||
int weight;
|
||||
int stackLimit;
|
||||
|
@ -19,4 +21,4 @@ struct PUSHABLE_INFO {
|
|||
bool disableE; // OCB 512 (W+E)
|
||||
bool disableN; // OCB 1024 (N+S)
|
||||
bool disableS; // OCB 1024 (N+S)
|
||||
};
|
||||
};
|
||||
|
|
|
@ -134,13 +134,13 @@ enum GAME_OBJECT_ID : short
|
|||
ID_MERCENARY_AUTOPISTOLS2,
|
||||
ID_SNOWMOBILE_GUN,
|
||||
ID_SNOWMOBILE_DRIVER,
|
||||
ID_FLAMETHROWER_BADDY,
|
||||
ID_FLAMETHROWER_GOON,
|
||||
ID_TRIBESMAN_WITH_AX,
|
||||
ID_TRIBESMAN_WITH_DARTS,
|
||||
ID_MP_WITH_STICK,
|
||||
ID_MP_WITH_GUN,
|
||||
ID_BADDY1, // TR4 - OK
|
||||
ID_BADDY2, // TR4 - OK
|
||||
ID_GOON1, // TR4 - OK
|
||||
ID_GOON2, // TR4 - OK
|
||||
ID_SAS_CAIRO, // TR4 - OK
|
||||
ID_SAS_DYING, // DEPRECATED?
|
||||
ID_SAS_CAPTAIN, // DEPRECATED?
|
||||
|
@ -164,7 +164,7 @@ enum GAME_OBJECT_ID : short
|
|||
ID_SNIPER,
|
||||
ID_CHEF,
|
||||
|
||||
/* Soprannatural, boss and others */
|
||||
/* Supernatural, boss and others */
|
||||
ID_WINGED_MUMMY = 220,
|
||||
ID_CENTAUR_MUTANT,
|
||||
ID_LARA_DOPPELGANGER,
|
||||
|
@ -826,8 +826,8 @@ enum GAME_OBJECT_ID : short
|
|||
ID_MESHSWAP8,
|
||||
ID_MESHSWAP9,
|
||||
ID_MESHSWAP10,
|
||||
ID_MESHSWAP_BADDY1,
|
||||
ID_MESHSWAP_BADDY2,
|
||||
ID_MESHSWAP_GOON1,
|
||||
ID_MESHSWAP_GOON2,
|
||||
ID_MESHSWAP_MAFIA2 = 1113,
|
||||
ID_MESHSWAP_IMP,
|
||||
ID_MESHSWAP_HITMAN,
|
||||
|
@ -970,6 +970,7 @@ enum GAME_OBJECT_ID : short
|
|||
ID_BRIDGE_TILT2, // OK
|
||||
ID_BRIDGE_TILT3,
|
||||
ID_BRIDGE_TILT4,
|
||||
ID_BRIDGE_CUSTOM,
|
||||
|
||||
ID_HORIZON = 1350,
|
||||
ID_BINOCULAR_GRAPHICS,
|
||||
|
|
|
@ -110,7 +110,7 @@ extern std::map<std::string, int> SoundTrackMap;
|
|||
extern std::unordered_map<int, SoundTrackInfo> SoundTracks;
|
||||
extern int SecretSoundIndex;
|
||||
|
||||
long SoundEffect(int effectID, PHD_3DPOS* position, int env_flags, float pitchMultiplier = 1.0f, float gainMultiplier = 1.0f);
|
||||
long SoundEffect(int effectID, PHD_3DPOS* position, int envFlags, float pitchMultiplier = 1.0f, float gainMultiplier = 1.0f);
|
||||
void StopSoundEffect(short effectID);
|
||||
bool LoadSample(char *buffer, int compSize, int uncompSize, int currentIndex);
|
||||
void FreeSamples();
|
||||
|
@ -146,4 +146,4 @@ float Sound_DistanceToListener(PHD_3DPOS *position);
|
|||
float Sound_DistanceToListener(Vector3 position);
|
||||
float Sound_Attenuate(float gain, float distance, float radius);
|
||||
bool Sound_UpdateEffectPosition(int index, PHD_3DPOS *position, bool force = false);
|
||||
bool Sound_UpdateEffectAttributes(int index, float pitch, float gain);
|
||||
bool Sound_UpdateEffectAttributes(int index, float pitch, float gain);
|
||||
|
|
|
@ -165,7 +165,7 @@ enum SOUND_EFFECTS
|
|||
SFX_TR4_LAUNCHER_2 = 160,
|
||||
SFX_TR4_TRAPDOOR_OPEN = 161,
|
||||
SFX_TR4_TRAPDOOR_CLOSE = 162,
|
||||
SFX_TR4_HK_STOP= 163,
|
||||
SFX_LARA_HK_STOP= 163,
|
||||
SFX_TR4_BABOON_STAND_WAIT = 164,
|
||||
SFX_TR4_BABOON_ATTACK_LOW = 165,
|
||||
SFX_TR4_BABOON_ATTACK_JUMP = 166,
|
||||
|
|
|
@ -103,4 +103,4 @@ public:
|
|||
state->EndWrite();
|
||||
delete state;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
@ -32,7 +32,8 @@ struct LEB128
|
|||
|
||||
result |= (long)(currentByte & 0x7F) << currentShift;
|
||||
currentShift += 7;
|
||||
} while ((currentByte & 0x80) != 0);
|
||||
}
|
||||
while ((currentByte & 0x80) != 0);
|
||||
|
||||
// Sign extend
|
||||
int shift = 64 - currentShift;
|
||||
|
@ -114,4 +115,3 @@ struct LEB128
|
|||
return length;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -11,12 +11,14 @@
|
|||
using namespace DirectX;
|
||||
using namespace DirectX::SimpleMath;
|
||||
|
||||
enum SeekOrigin {
|
||||
enum SeekOrigin
|
||||
{
|
||||
BEGIN,
|
||||
CURRENT
|
||||
};
|
||||
|
||||
class BaseStream {
|
||||
class BaseStream
|
||||
{
|
||||
public:
|
||||
virtual bool Read(char* buffer, int length) = 0;
|
||||
virtual bool Write(char const * buffer, int length) = 0;
|
||||
|
@ -68,7 +70,8 @@ public:
|
|||
bool WriteString(char const * str);
|
||||
};
|
||||
|
||||
class MemoryStream : public BaseStream {
|
||||
class MemoryStream : public BaseStream
|
||||
{
|
||||
private:
|
||||
char* m_startBuffer;
|
||||
char* m_buffer;
|
||||
|
@ -94,7 +97,8 @@ public:
|
|||
bool Close();
|
||||
};
|
||||
|
||||
class FileStream : public BaseStream {
|
||||
class FileStream : public BaseStream
|
||||
{
|
||||
private:
|
||||
std::fstream m_stream;
|
||||
|
||||
|
@ -114,4 +118,4 @@ public:
|
|||
bool IsEOF();
|
||||
|
||||
bool Close();
|
||||
};
|
||||
};
|
||||
|
|
|
@ -77,7 +77,7 @@ struct GameConfiguration {
|
|||
int JoyRoll;
|
||||
int JoyWalk;
|
||||
int shadowMapSize = 1024;
|
||||
std::vector<VectorInt2> SupportedScreenResolutions;
|
||||
std::vector<Vector2Int> SupportedScreenResolutions;
|
||||
std::string AdapterName;
|
||||
};
|
||||
|
||||
|
|
|
@ -180,14 +180,15 @@ enum INPUT_BUTTONS
|
|||
IN_LOOKRIGHT = (1 << 26), // 0x04000000
|
||||
IN_LOOKFORWARD = (1 << 27), // 0x08000000
|
||||
IN_LOOKBACK = (1 << 28), // 0x10000000
|
||||
IN_DUCK = (1 << 29), // 0x20000000
|
||||
IN_CROUCH = (1 << 29), // 0x20000000
|
||||
IN_SPRINT = (1 << 30), // 0x40000000
|
||||
IN_LOOKSWITCH = (1 << 31), // 0x80000000
|
||||
IN_ALL = ~0, // 0xFFFFFFFF (-1)
|
||||
};
|
||||
|
||||
#define IN_OPTIC_CONTROLS (IN_FORWARD | IN_BACK | IN_LEFT | IN_RIGHT | IN_ACTION | IN_SELECT | IN_DUCK | IN_SPRINT)
|
||||
#define IN_WAKE (IN_FORWARD | IN_BACK | IN_LEFT | IN_RIGHT | IN_LSTEP | IN_RSTEP | IN_WALK | IN_JUMP | IN_SPRINT | IN_ROLL | IN_DUCK | IN_DRAW | IN_FLARE | IN_ACTION)
|
||||
#define IN_OPTIC_CONTROLS (IN_FORWARD | IN_BACK | IN_LEFT | IN_RIGHT | IN_ACTION | IN_SELECT | IN_CROUCH | IN_SPRINT)
|
||||
#define IN_WAKE (IN_FORWARD | IN_BACK | IN_LEFT | IN_RIGHT | IN_LSTEP | IN_RSTEP | IN_WALK | IN_JUMP | IN_SPRINT | IN_ROLL | IN_CROUCH | IN_DRAW | IN_FLARE | IN_ACTION)
|
||||
#define IN_DIRECTION (IN_FORWARD | IN_BACK | IN_LEFT | IN_RIGHT)
|
||||
|
||||
enum IKEYS
|
||||
{
|
||||
|
@ -195,7 +196,7 @@ enum IKEYS
|
|||
KEY_BACK = 1,
|
||||
KEY_LEFT = 2,
|
||||
KEY_RIGHT = 3,
|
||||
KEY_DUCK = 4,
|
||||
KEY_CROUCH = 4,
|
||||
KEY_SPRINT = 5,
|
||||
KEY_WALK = 6,
|
||||
KEY_JUMP = 7,
|
||||
|
@ -205,8 +206,8 @@ enum IKEYS
|
|||
KEY_LOOK = 11,
|
||||
KEY_ROLL = 12,
|
||||
KEY_OPTION = 13,
|
||||
KEY_STEPL = 14,
|
||||
KEY_STEPR = 15,
|
||||
KEY_LSTEP = 14,
|
||||
KEY_RSTEP = 15,
|
||||
KEY_PAUSE = 16,
|
||||
KEY_SELECT = 17,
|
||||
};
|
||||
|
@ -224,5 +225,5 @@ void InitialiseDirectInput(HWND handle, HINSTANCE instance);
|
|||
void DI_ReadKeyboard(byte* keys);
|
||||
int DD_SpinMessageLoopMaybe();
|
||||
int S_UpdateInput();
|
||||
int Key(int number);
|
||||
bool Key(int number);
|
||||
void DefaultConflict();
|
||||
|
|
|
@ -1,77 +1,294 @@
|
|||
#pragma once
|
||||
|
||||
struct PHD_VECTOR
|
||||
struct Vector2Int
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
|
||||
Vector2Int()
|
||||
{
|
||||
this->x = 0;
|
||||
this->y = 0;
|
||||
}
|
||||
|
||||
Vector2Int(int x, int y)
|
||||
{
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
}
|
||||
};
|
||||
|
||||
struct Vector3Int
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
|
||||
PHD_VECTOR()
|
||||
bool operator ==(Vector3Int vector)
|
||||
{
|
||||
return (x == vector.x && y == vector.y && z == vector.z);
|
||||
}
|
||||
|
||||
bool operator !=(Vector3Int vector)
|
||||
{
|
||||
return (x != vector.x || y != vector.y || z != vector.z);
|
||||
}
|
||||
|
||||
Vector3Int operator =(Vector3Int vector)
|
||||
{
|
||||
this->x = vector.x;
|
||||
this->y = vector.y;
|
||||
this->z = vector.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3Int operator +(Vector3Int vector)
|
||||
{
|
||||
return Vector3Int(x + vector.x, y + vector.y, z + vector.z);
|
||||
}
|
||||
|
||||
Vector3Int operator -(Vector3Int vector)
|
||||
{
|
||||
return Vector3Int(x - vector.x, y - vector.y, z - vector.z);
|
||||
}
|
||||
|
||||
Vector3Int operator *(Vector3Int vector)
|
||||
{
|
||||
return Vector3Int(x * vector.x, y * vector.y, z * vector.z);
|
||||
}
|
||||
|
||||
Vector3Int operator *(float value)
|
||||
{
|
||||
return Vector3Int((int)round(x * value), (int)round(y * value), (int)round(z * value));
|
||||
}
|
||||
|
||||
Vector3Int operator /(float value)
|
||||
{
|
||||
return Vector3Int((int)round(x / value), (int)round(y / value), (int)round(z / value));
|
||||
}
|
||||
|
||||
Vector3Int& operator +=(const Vector3Int vector)
|
||||
{
|
||||
*this = *this + vector;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3Int& operator -=(Vector3Int vector)
|
||||
{
|
||||
*this = *this - vector;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3Int& operator *=(Vector3Int vector)
|
||||
{
|
||||
*this = *this * vector;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3Int& operator *=(float value)
|
||||
{
|
||||
*this = *this * value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3Int& operator /=(float value)
|
||||
{
|
||||
*this = *this / value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3Int()
|
||||
{
|
||||
this->x = 0;
|
||||
this->y = 0;
|
||||
this->z = 0;
|
||||
}
|
||||
|
||||
PHD_VECTOR(int xpos, int ypos, int zpos)
|
||||
Vector3Int(int x, int y, int z)
|
||||
{
|
||||
this->x = xpos;
|
||||
this->y = ypos;
|
||||
this->z = zpos;
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->z = z;
|
||||
}
|
||||
|
||||
Vector3 ToVector3()
|
||||
{
|
||||
return Vector3(x, y, z);
|
||||
}
|
||||
};
|
||||
|
||||
struct Vector3Shrt
|
||||
{
|
||||
short x;
|
||||
short y;
|
||||
short z;
|
||||
|
||||
bool operator ==(Vector3Shrt vector)
|
||||
{
|
||||
return (x == vector.x && y == vector.y && z == vector.z);
|
||||
}
|
||||
|
||||
bool operator !=(Vector3Shrt vector)
|
||||
{
|
||||
return (x != vector.x || y != vector.y || z != vector.z);
|
||||
}
|
||||
|
||||
Vector3Shrt operator =(Vector3Shrt vector)
|
||||
{
|
||||
this->x = vector.x;
|
||||
this->y = vector.y;
|
||||
this->z = vector.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3Shrt operator +(Vector3Shrt vector)
|
||||
{
|
||||
return Vector3Shrt(x + vector.x, y + vector.y, z + vector.z);
|
||||
}
|
||||
|
||||
Vector3Shrt operator -(Vector3Shrt vector)
|
||||
{
|
||||
return Vector3Shrt(x - vector.x, y - vector.y, z - vector.z);
|
||||
}
|
||||
|
||||
Vector3Shrt operator *(Vector3Shrt vector)
|
||||
{
|
||||
return Vector3Shrt(x * vector.x, y * vector.y, z * vector.z);
|
||||
}
|
||||
|
||||
Vector3Shrt operator *(float value)
|
||||
{
|
||||
return Vector3Shrt((short)round(x * value), (short)round(y * value), (short)round(z * value));
|
||||
}
|
||||
|
||||
Vector3Shrt operator /(float value)
|
||||
{
|
||||
return Vector3Shrt((short)round(x / value), (short)round(y / value), (short)round(z / value));
|
||||
}
|
||||
|
||||
Vector3Shrt& operator +=(const Vector3Shrt vector)
|
||||
{
|
||||
*this = *this + vector;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3Shrt& operator -=(Vector3Shrt vector)
|
||||
{
|
||||
*this = *this - vector;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3Shrt& operator *=(Vector3Shrt vector)
|
||||
{
|
||||
*this = *this * vector;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3Shrt& operator *=(float value)
|
||||
{
|
||||
*this = *this * value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3Shrt& operator /=(float value)
|
||||
{
|
||||
*this = *this / value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3Shrt()
|
||||
{
|
||||
this->x = 0;
|
||||
this->y = 0;
|
||||
this->z = 0;
|
||||
}
|
||||
|
||||
Vector3Shrt(short x, short y, short z)
|
||||
{
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->z = z;
|
||||
}
|
||||
|
||||
Vector3 ToVector3()
|
||||
{
|
||||
return Vector3(x, y, z);
|
||||
}
|
||||
};
|
||||
|
||||
struct RendererRectangle
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int right;
|
||||
int bottom;
|
||||
|
||||
RendererRectangle()
|
||||
{
|
||||
left = 0;
|
||||
top = 0;
|
||||
right = 0;
|
||||
bottom = 0;
|
||||
}
|
||||
|
||||
RendererRectangle(int left, int top, int right, int bottom)
|
||||
{
|
||||
this->left = left;
|
||||
this->top = top;
|
||||
this->right = right;
|
||||
this->bottom = bottom;
|
||||
}
|
||||
};
|
||||
|
||||
struct PHD_3DPOS
|
||||
{
|
||||
int xPos;
|
||||
int yPos;
|
||||
int zPos;
|
||||
short xRot;
|
||||
short yRot;
|
||||
short zRot;
|
||||
Vector3Int Position;
|
||||
Vector3Shrt Orientation;
|
||||
|
||||
PHD_3DPOS()
|
||||
{
|
||||
this->xPos = 0;
|
||||
this->yPos = 0;
|
||||
this->zPos = 0;
|
||||
this->xRot = 0;
|
||||
this->yRot = 0;
|
||||
this->zRot = 0;
|
||||
this->Position = Vector3Int();
|
||||
this->Orientation = Vector3Shrt();
|
||||
}
|
||||
|
||||
PHD_3DPOS(int x, int y, int z)
|
||||
PHD_3DPOS(Vector3Int pos)
|
||||
{
|
||||
this->xPos = x;
|
||||
this->yPos = y;
|
||||
this->zPos = z;
|
||||
this->xRot = 0;
|
||||
this->yRot = 0;
|
||||
this->zRot = 0;
|
||||
this->Position = pos;
|
||||
this->Orientation = Vector3Shrt();
|
||||
}
|
||||
|
||||
PHD_3DPOS(short xrot, short yrot, short zrot)
|
||||
PHD_3DPOS(int xPos, int yPos, int zPos)
|
||||
{
|
||||
this->xPos = 0;
|
||||
this->yPos = 0;
|
||||
this->zPos = 0;
|
||||
this->xRot = xrot;
|
||||
this->yRot = yrot;
|
||||
this->zRot = zrot;
|
||||
this->Position = Vector3Int(xPos, yPos, zPos);
|
||||
this->Orientation = Vector3Shrt();
|
||||
}
|
||||
|
||||
PHD_3DPOS(int x, int y, int z, short xrot, short yrot, short zrot)
|
||||
PHD_3DPOS(Vector3Shrt orient)
|
||||
{
|
||||
this->xPos = x;
|
||||
this->yPos = y;
|
||||
this->zPos = z;
|
||||
this->xRot = xrot;
|
||||
this->yRot = yrot;
|
||||
this->zRot = zrot;
|
||||
this->Position = Vector3Int();
|
||||
this->Orientation = orient;
|
||||
}
|
||||
|
||||
PHD_3DPOS(short xOrient, short yOrient, short zOrient)
|
||||
{
|
||||
this->Position = Vector3Int();
|
||||
this->Orientation = Vector3Shrt(xOrient, yOrient, zOrient);
|
||||
}
|
||||
|
||||
PHD_3DPOS(Vector3Int pos, Vector3Shrt orient)
|
||||
{
|
||||
this->Position = pos;
|
||||
this->Orientation = orient;
|
||||
}
|
||||
|
||||
PHD_3DPOS(int xPos, int yPos, int zPos, short xOrient, short yOrient, short zOrient)
|
||||
{
|
||||
this->Position = Vector3Int(xPos, yPos, zPos);
|
||||
this->Orientation = Vector3Shrt(xOrient, yOrient, zOrient);
|
||||
}
|
||||
};
|
||||
|
||||
struct GAME_VECTOR
|
||||
struct GameVector
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
|
@ -79,7 +296,7 @@ struct GAME_VECTOR
|
|||
int boxNumber;
|
||||
short roomNumber;
|
||||
|
||||
GAME_VECTOR()
|
||||
GameVector()
|
||||
{
|
||||
this->x = 0;
|
||||
this->y = 0;
|
||||
|
@ -88,7 +305,7 @@ struct GAME_VECTOR
|
|||
this->boxNumber = 0;
|
||||
}
|
||||
|
||||
GAME_VECTOR(int xpos, int ypos, int zpos)
|
||||
GameVector(int xpos, int ypos, int zpos)
|
||||
{
|
||||
this->x = xpos;
|
||||
this->y = ypos;
|
||||
|
@ -97,7 +314,7 @@ struct GAME_VECTOR
|
|||
this->boxNumber = 0;
|
||||
}
|
||||
|
||||
GAME_VECTOR(int xpos, int ypos, int zpos, short roomNumber)
|
||||
GameVector(int xpos, int ypos, int zpos, short roomNumber)
|
||||
{
|
||||
this->x = xpos;
|
||||
this->y = ypos;
|
||||
|
@ -106,7 +323,7 @@ struct GAME_VECTOR
|
|||
this->boxNumber = 0;
|
||||
}
|
||||
|
||||
GAME_VECTOR(int xpos, int ypos, int zpos, short roomNumber, short boxNumber)
|
||||
GameVector(int xpos, int ypos, int zpos, short roomNumber, short boxNumber)
|
||||
{
|
||||
this->x = xpos;
|
||||
this->y = ypos;
|
||||
|
@ -334,4 +551,4 @@ struct BOUNDING_BOX
|
|||
short Z2;
|
||||
};
|
||||
|
||||
BOUNDING_BOX operator+(BOUNDING_BOX const& box, PHD_3DPOS const& vec);
|
||||
BOUNDING_BOX operator+(BOUNDING_BOX const& box, PHD_3DPOS const& vec);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "Specific/phd_global.h"
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct CollisionInfo;
|
||||
enum ZoneType : char;
|
||||
|
||||
constexpr auto UNIT_SHADOW = 256;
|
||||
|
@ -44,10 +44,10 @@ struct OBJECT_INFO
|
|||
std::function<int(short itemNumber)> ceilingBorder;
|
||||
std::function<void(ITEM_INFO* item)> drawRoutine;
|
||||
std::function<void(ITEM_INFO* item)> drawRoutineExtra;
|
||||
std::function<void(short item_num, ITEM_INFO* laraitem, COLL_INFO* coll)> collision;
|
||||
std::function<void(short item_num, ITEM_INFO* laraitem, CollisionInfo* coll)> collision;
|
||||
ZoneType zoneType;
|
||||
int animIndex;
|
||||
short hitPoints;
|
||||
short HitPoints;
|
||||
short pivotLength;
|
||||
short radius;
|
||||
short shadowSize;
|
||||
|
@ -95,4 +95,4 @@ extern STATIC_INFO StaticObjects[MAX_STATICS];
|
|||
void InitialiseGameFlags();
|
||||
void InitialiseSpecialEffects();
|
||||
void InitialiseHair();
|
||||
void InitialiseObjects();
|
||||
void InitialiseObjects();
|
||||
|
|
|
@ -1,48 +1,12 @@
|
|||
#pragma once
|
||||
#include "Specific/phd_global.h"
|
||||
|
||||
struct VectorInt2
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
struct VectorInt3
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
};
|
||||
|
||||
struct RendererRectangle
|
||||
{
|
||||
int left;
|
||||
int top;
|
||||
int right;
|
||||
int bottom;
|
||||
|
||||
RendererRectangle()
|
||||
{
|
||||
left = 0;
|
||||
top = 0;
|
||||
right = 0;
|
||||
bottom = 0;
|
||||
}
|
||||
|
||||
RendererRectangle(int left, int top, int right, int bottom)
|
||||
{
|
||||
this->left = left;
|
||||
this->top = top;
|
||||
this->right = right;
|
||||
this->bottom = bottom;
|
||||
}
|
||||
};
|
||||
|
||||
constexpr auto PI = 3.14159265358979323846f;
|
||||
constexpr auto RADIAN = 0.01745329252f;
|
||||
constexpr auto ONE_DEGREE = 182;
|
||||
constexpr auto PREDICTIVE_SCALE_FACTOR = 14;
|
||||
constexpr auto WALL_SIZE = 1024;
|
||||
constexpr auto WALL_MASK = WALL_SIZE - 1;
|
||||
constexpr auto STEP_SIZE = WALL_SIZE / 4;
|
||||
constexpr auto STOP_SIZE = WALL_SIZE / 2;
|
||||
constexpr auto GRID_SNAP_SIZE = STEP_SIZE / 2;
|
||||
|
@ -59,7 +23,7 @@ constexpr auto SQUARE = [](auto x) { return x * x; };
|
|||
constexpr auto CLICK = [](auto x) { return STEP_SIZE * x; };
|
||||
constexpr auto SECTOR = [](auto x) { return WALL_SIZE * x; };
|
||||
constexpr auto MESH_BITS = [](auto x) { return 1 << x; };
|
||||
constexpr auto OFFSET_RADIUS = [](auto x) { return roundf(x * sqrt(2) + 4); };
|
||||
constexpr auto OFFSET_RADIUS = [](auto x) { return round(x * sqrt(2) + 4); };
|
||||
|
||||
short ANGLE(float angle);
|
||||
short FROM_DEGREES(float angle);
|
||||
|
@ -82,22 +46,21 @@ void phd_RotBoundingBoxNoPersp(PHD_3DPOS* pos, BOUNDING_BOX* bounds, BOUNDING_BO
|
|||
int phd_Distance(PHD_3DPOS* first, PHD_3DPOS* second);
|
||||
|
||||
void InterpolateAngle(short angle, short* rotation, short* outAngle, int shift);
|
||||
void GetMatrixFromTrAngle(Matrix* matrix, short* frameptr, int index);
|
||||
void GetMatrixFromTrAngle(Matrix* matrix, short* framePtr, int index);
|
||||
|
||||
constexpr auto FP_SHIFT = 16;
|
||||
constexpr auto FP_ONE = (1 << FP_SHIFT);
|
||||
constexpr auto W2V_SHIFT = 14;
|
||||
|
||||
void FP_VectorMul(PHD_VECTOR* v, int scale, PHD_VECTOR* result);
|
||||
void FP_VectorMul(Vector3Int* v, int scale, Vector3Int* result);
|
||||
__int64 FP_Mul(__int64 a, __int64 b);
|
||||
__int64 FP_Div(__int64 a, __int64 b);
|
||||
int FP_DotProduct(PHD_VECTOR* a, PHD_VECTOR* b);
|
||||
void FP_CrossProduct(PHD_VECTOR* a, PHD_VECTOR* b, PHD_VECTOR* n);
|
||||
int FP_DotProduct(Vector3Int* a, Vector3Int* b);
|
||||
void FP_CrossProduct(Vector3Int* a, Vector3Int* b, Vector3Int* n);
|
||||
void FP_GetMatrixAngles(MATRIX3D* m, short* angles);
|
||||
__int64 FP_ToFixed(__int64 value);
|
||||
__int64 FP_FromFixed(__int64 value);
|
||||
PHD_VECTOR* FP_Normalise(PHD_VECTOR* v);
|
||||
|
||||
Vector3Int* FP_Normalise(Vector3Int* v);
|
||||
|
||||
#define MULFP(a,b) (int)((((__int64)a*(__int64)b))>>16)
|
||||
#define DIVFP(a,b) (int)(((a)/(b>>8))<<8)
|
||||
#define DIVFP(a,b) (int)(((a)/(b>>8))<<8)
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -29,7 +29,10 @@ public:
|
|||
virtual bool HasMonkeyTurn180() const = 0;
|
||||
virtual bool HasMonkeyAutoJump() const = 0;
|
||||
virtual bool HasOscillateHang() const = 0;
|
||||
virtual bool HasSprintJump() const = 0;
|
||||
virtual bool HasAFKPose() const = 0;
|
||||
virtual bool HasOverhangClimb() const = 0;
|
||||
virtual bool HasSlideExtended() const = 0;
|
||||
virtual ScriptInterfaceLevel * GetLevel(int level) = 0;
|
||||
virtual bool CanPlayAnyLevel() const = 0;
|
||||
virtual bool DoFlow() = 0;
|
||||
|
|
|
@ -10,12 +10,15 @@ New custom animations which Lara can perform.
|
|||
void Animations::Register(sol::table& parent)
|
||||
{
|
||||
parent.new_usertype<Animations>("Animations",
|
||||
"crawlExtended", &Animations::CrawlExtended,
|
||||
"crouchRoll", &Animations::CrouchRoll,
|
||||
"crawlspaceSwandive", &Animations::CrawlspaceSwandive,
|
||||
"monkeyTurn180", &Animations::MonkeyTurn180,
|
||||
"monkeyAutoJump", &Animations::MonkeyAutoJump,
|
||||
"oscillateHang", &Animations::OscillateHang,
|
||||
"pose", &Animations::Pose
|
||||
"crawlExtended", &Animations::HasCrawlExtended,
|
||||
"crouchRoll", &Animations::HasCrouchRoll,
|
||||
"crawlspaceSwandive", &Animations::HasCrawlspaceDive,
|
||||
"monkeyAutoJump", &Animations::HasMonkeyAutoJump,
|
||||
"monkeyTurn180", &Animations::HasMonkeyTurn180,
|
||||
"oscillateHang", &Animations::HasOscillateHang,
|
||||
"overhangClimb", &Animations::HasOverhangClimb,
|
||||
"slideExtended", &Animations::HasSlideExtended,
|
||||
"sprintJump", &Animations::HasSprintJump,
|
||||
"pose", &Animations::HasPose
|
||||
);
|
||||
}
|
||||
|
|
|
@ -3,19 +3,23 @@
|
|||
#include "ScriptAssert.h"
|
||||
#include <string>
|
||||
|
||||
namespace sol {
|
||||
namespace sol
|
||||
{
|
||||
class state;
|
||||
}
|
||||
|
||||
struct Animations
|
||||
{
|
||||
bool CrawlExtended; // Extended crawl moveset
|
||||
bool CrouchRoll; // Crouch roll
|
||||
bool CrawlspaceSwandive; // Swandive into crawlspaces
|
||||
bool MonkeyTurn180; // 180 degree turn on monkey swing
|
||||
bool MonkeyAutoJump; // Auto jump to monkey swing when pressing UP + ACTION beneath
|
||||
bool OscillateHang; // Grab thin ledge animation from TR1 and 2
|
||||
bool Pose; // Crossed arms AFK posing
|
||||
bool HasPose; // Crossed arms AFK posing.
|
||||
bool HasSlideExtended; // Extended slope sliding functionality (not ready yet).
|
||||
bool HasSprintJump; // Sprint jump.
|
||||
bool HasMonkeyAutoJump; // Auto jump to monkey swing when pressing UP + ACTION. TODO: Make this a player setting.
|
||||
bool HasCrawlspaceDive; // Dive into crawlspaces.
|
||||
bool HasCrawlExtended; // Extended crawl moveset.
|
||||
bool HasCrouchRoll; // Crouch roll.
|
||||
bool HasOverhangClimb; // Overhang functionality.
|
||||
bool HasMonkeyTurn180;
|
||||
bool HasOscillateHang;
|
||||
|
||||
static void Register(sol::table &);
|
||||
};
|
||||
|
|
|
@ -130,9 +130,7 @@ Specify which translations in the strings table correspond to which languages.
|
|||
FlowHandler::~FlowHandler()
|
||||
{
|
||||
for (auto& lev : Levels)
|
||||
{
|
||||
delete lev;
|
||||
}
|
||||
}
|
||||
|
||||
void FlowHandler::SetLanguageNames(sol::as_table_t<std::vector<std::string>> && src)
|
||||
|
@ -180,9 +178,7 @@ void FlowHandler::SetGameFarView(byte val)
|
|||
GameFarView = 32;
|
||||
}
|
||||
else
|
||||
{
|
||||
GameFarView = val;
|
||||
}
|
||||
}
|
||||
|
||||
void FlowHandler::LoadFlowScript()
|
||||
|
@ -197,9 +193,7 @@ void FlowHandler::LoadFlowScript()
|
|||
char const * FlowHandler::GetString(const char* id) const
|
||||
{
|
||||
if (!ScriptAssert(m_translationsMap.find(id) != m_translationsMap.end(), std::string{ "Couldn't find string " } + id))
|
||||
{
|
||||
return "String not found";
|
||||
}
|
||||
else
|
||||
return m_translationsMap.at(string(id)).at(0).c_str();
|
||||
}
|
||||
|
@ -240,7 +234,7 @@ bool FlowHandler::DoFlow()
|
|||
// First we need to fill some legacy variables in PCTomb5.exe
|
||||
Level* level = Levels[CurrentLevel];
|
||||
|
||||
GAME_STATUS status;
|
||||
GameStatus status;
|
||||
|
||||
if (CurrentLevel == 0)
|
||||
{
|
||||
|
@ -274,17 +268,17 @@ bool FlowHandler::DoFlow()
|
|||
|
||||
switch (status)
|
||||
{
|
||||
case GAME_STATUS::GAME_STATUS_EXIT_GAME:
|
||||
case GameStatus::ExitGame:
|
||||
return true;
|
||||
case GAME_STATUS::GAME_STATUS_EXIT_TO_TITLE:
|
||||
case GameStatus::ExitToTitle:
|
||||
CurrentLevel = 0;
|
||||
break;
|
||||
case GAME_STATUS::GAME_STATUS_NEW_GAME:
|
||||
case GameStatus::NewGame:
|
||||
CurrentLevel = (SelectedLevelForNewGame != 0 ? SelectedLevelForNewGame : 1);
|
||||
SelectedLevelForNewGame = 0;
|
||||
InitialiseGame = true;
|
||||
break;
|
||||
case GAME_STATUS::GAME_STATUS_LOAD_GAME:
|
||||
case GameStatus::LoadGame:
|
||||
// Load the header of the savegame for getting the level to load
|
||||
SaveGame::LoadHeader(SelectedSaveGame, &header);
|
||||
|
||||
|
@ -293,7 +287,7 @@ bool FlowHandler::DoFlow()
|
|||
loadFromSavegame = true;
|
||||
|
||||
break;
|
||||
case GAME_STATUS::GAME_STATUS_LEVEL_COMPLETED:
|
||||
case GameStatus::LevelComplete:
|
||||
if (LevelComplete == Levels.size())
|
||||
{
|
||||
// TODO: final credits
|
||||
|
@ -310,4 +304,4 @@ bool FlowHandler::DoFlow()
|
|||
bool FlowHandler::CanPlayAnyLevel() const
|
||||
{
|
||||
return PlayAnyLevel;
|
||||
}
|
||||
}
|
|
@ -9,7 +9,7 @@
|
|||
#include "ScriptInterfaceGame.h"
|
||||
#include "Flow/ScriptInterfaceFlowHandler.h"
|
||||
|
||||
class FlowHandler : public ScriptInterfaceFlowHandler
|
||||
class FlowHandler : public ScriptInterfaceFlowHandler
|
||||
{
|
||||
private:
|
||||
Settings m_settings;
|
||||
|
@ -54,13 +54,16 @@ public:
|
|||
bool IsFlyCheatEnabled() const;
|
||||
bool CanPlayAnyLevel() const;
|
||||
|
||||
bool HasCrawlExtended() const override { return Anims.CrawlExtended; }
|
||||
bool HasCrouchRoll() const override { return Anims.CrouchRoll; }
|
||||
bool HasCrawlspaceSwandive() const override { return Anims.CrawlspaceSwandive; }
|
||||
bool HasMonkeyTurn180() const override { return Anims.MonkeyTurn180; }
|
||||
bool HasMonkeyAutoJump() const override { return Anims.MonkeyAutoJump; }
|
||||
bool HasOscillateHang() const override { return Anims.OscillateHang; }
|
||||
bool HasAFKPose() const override { return Anims.Pose; }
|
||||
bool HasCrawlExtended() const override { return Anims.HasCrawlExtended; }
|
||||
bool HasCrouchRoll() const override { return Anims.HasCrouchRoll; }
|
||||
bool HasCrawlspaceSwandive() const override { return Anims.HasCrawlspaceDive; }
|
||||
bool HasMonkeyTurn180() const override { return Anims.HasMonkeyTurn180; }
|
||||
bool HasMonkeyAutoJump() const override { return Anims.HasMonkeyAutoJump; }
|
||||
bool HasAFKPose() const override { return Anims.HasPose; }
|
||||
bool HasOverhangClimb() const override { return Anims.HasOverhangClimb; }
|
||||
bool HasSlideExtended() const override { return Anims.HasSlideExtended; }
|
||||
bool HasSprintJump() const override { return Anims.HasSprintJump; }
|
||||
bool HasOscillateHang() const override { return Anims.HasOscillateHang; }
|
||||
bool DoFlow() override;
|
||||
};
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ using namespace TEN::Effects::Lightning;
|
|||
namespace Misc {
|
||||
[[nodiscard]] static bool HasLineOfSight(short roomNumber1, Vec3 pos1, Vec3 pos2)
|
||||
{
|
||||
GAME_VECTOR vec1, vec2;
|
||||
GameVector vec1, vec2;
|
||||
pos1.StoreInGameVector(vec1);
|
||||
vec1.roomNumber = roomNumber1;
|
||||
pos2.StoreInGameVector(vec2);
|
||||
|
@ -35,12 +35,12 @@ namespace Misc {
|
|||
|
||||
static void AddLightningArc(Vec3 src, Vec3 dest, ScriptColor color, int lifetime, int amplitude, int beamWidth, int segments, int flags)
|
||||
{
|
||||
PHD_VECTOR p1;
|
||||
Vector3Int p1;
|
||||
p1.x = src.x;
|
||||
p1.y = src.y;
|
||||
p1.z = src.z;
|
||||
|
||||
PHD_VECTOR p2;
|
||||
Vector3Int p2;
|
||||
p2.x = dest.x;
|
||||
p2.y = dest.y;
|
||||
p2.z = dest.z;
|
||||
|
@ -51,9 +51,9 @@ namespace Misc {
|
|||
static void AddShockwave(Vec3 pos, int innerRadius, int outerRadius, ScriptColor color, int lifetime, int speed, int angle, int flags)
|
||||
{
|
||||
PHD_3DPOS p;
|
||||
p.xPos = pos.x;
|
||||
p.yPos = pos.y;
|
||||
p.zPos = pos.z;
|
||||
p.Position.x = pos.x;
|
||||
p.Position.y = pos.y;
|
||||
p.Position.z = pos.z;
|
||||
|
||||
TriggerShockwave(&p, innerRadius, outerRadius, speed, color.GetR(), color.GetG(), color.GetB(), lifetime, FROM_DEGREES(angle), flags);
|
||||
}
|
||||
|
@ -88,12 +88,12 @@ namespace Misc {
|
|||
{
|
||||
PHD_3DPOS pos;
|
||||
|
||||
pos.xPos = p.x;
|
||||
pos.yPos = p.y;
|
||||
pos.zPos = p.z;
|
||||
pos.xRot = 0;
|
||||
pos.yRot = 0;
|
||||
pos.zRot = 0;
|
||||
pos.Position.x = p.x;
|
||||
pos.Position.y = p.y;
|
||||
pos.Position.z = p.z;
|
||||
pos.Orientation.x = 0;
|
||||
pos.Orientation.y = 0;
|
||||
pos.Orientation.z = 0;
|
||||
|
||||
SoundEffect(id, &pos, flags);
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ static std::unique_ptr<Moveable> Create(
|
|||
ptr->SetHP(USE_IF_HAVE(short, hp, 10));
|
||||
ptr->SetOCB(USE_IF_HAVE(short, ocb, 0));
|
||||
ptr->SetAIBits(USE_IF_HAVE(aiBitsType, aiBits, aiBitsType{}));
|
||||
item->carriedItem = NO_ITEM;
|
||||
item->CarriedItem = NO_ITEM;
|
||||
|
||||
// call this when resetting name too?
|
||||
dynamic_cast<ObjectsHandler*>(g_GameScriptEntities)->AddMoveableToMap(item, ptr.get());
|
||||
|
@ -373,16 +373,16 @@ void Moveable::Register(sol::table & parent)
|
|||
|
||||
void Moveable::Init()
|
||||
{
|
||||
bool cond = IsPointInRoom(m_item->pos, m_item->roomNumber);
|
||||
bool cond = IsPointInRoom(m_item->Pose, m_item->RoomNumber);
|
||||
std::string err{ "Position of item \"{}\" does not match its room ID." };
|
||||
if (!ScriptAssertF(cond, err, m_item->luaName))
|
||||
if (!ScriptAssertF(cond, err, m_item->LuaName))
|
||||
{
|
||||
ScriptWarn("Resetting to the center of the room.");
|
||||
PHD_3DPOS center = GetRoomCenter(m_item->roomNumber);
|
||||
PHD_3DPOS center = GetRoomCenter(m_item->RoomNumber);
|
||||
// reset position but not rotation
|
||||
m_item->pos.xPos = center.xPos;
|
||||
m_item->pos.yPos = center.yPos;
|
||||
m_item->pos.zPos = center.zPos;
|
||||
m_item->Pose.Position.x = center.Position.x;
|
||||
m_item->Pose.Position.y = center.Position.y;
|
||||
m_item->Pose.Position.z = center.Position.z;
|
||||
}
|
||||
InitialiseItem(m_num);
|
||||
m_initialised = true;
|
||||
|
@ -390,12 +390,12 @@ void Moveable::Init()
|
|||
|
||||
GAME_OBJECT_ID Moveable::GetObjectID() const
|
||||
{
|
||||
return m_item->objectNumber;
|
||||
return m_item->ObjectNumber;
|
||||
}
|
||||
|
||||
void Moveable::SetObjectID(GAME_OBJECT_ID id)
|
||||
{
|
||||
m_item->objectNumber = id;
|
||||
m_item->ObjectNumber = id;
|
||||
}
|
||||
|
||||
|
||||
|
@ -451,7 +451,7 @@ std::string Moveable::GetOnCollidedWithRoom() const
|
|||
|
||||
std::string Moveable::GetName() const
|
||||
{
|
||||
return m_item->luaName;
|
||||
return m_item->LuaName;
|
||||
}
|
||||
|
||||
bool Moveable::SetName(std::string const & id)
|
||||
|
@ -464,11 +464,11 @@ bool Moveable::SetName(std::string const & id)
|
|||
if (s_callbackSetName(id, m_num))
|
||||
{
|
||||
// remove the old name if we have one
|
||||
if (id != m_item->luaName)
|
||||
if (id != m_item->LuaName)
|
||||
{
|
||||
if(!m_item->luaName.empty())
|
||||
s_callbackRemoveName(m_item->luaName);
|
||||
m_item->luaName = id;
|
||||
if(!m_item->LuaName.empty())
|
||||
s_callbackRemoveName(m_item->LuaName);
|
||||
m_item->LuaName = id;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -483,12 +483,12 @@ bool Moveable::SetName(std::string const & id)
|
|||
|
||||
Vec3 Moveable::GetPos() const
|
||||
{
|
||||
return Vec3(m_item->pos );
|
||||
return Vec3(m_item->Pose);
|
||||
}
|
||||
|
||||
void Moveable::SetPos(Vec3 const& pos)
|
||||
{
|
||||
pos.StoreInPHDPos(m_item->pos);
|
||||
pos.StoreInPHDPos(m_item->Pose);
|
||||
}
|
||||
|
||||
// This does not guarantee that the returned value will be identical
|
||||
|
@ -498,28 +498,28 @@ void Moveable::SetPos(Vec3 const& pos)
|
|||
Rotation Moveable::GetRot() const
|
||||
{
|
||||
return {
|
||||
static_cast<int>(TO_DEGREES(m_item->pos.xRot)) % 360,
|
||||
static_cast<int>(TO_DEGREES(m_item->pos.yRot)) % 360,
|
||||
static_cast<int>(TO_DEGREES(m_item->pos.zRot)) % 360
|
||||
static_cast<int>(TO_DEGREES(m_item->Pose.Orientation.x)) % 360,
|
||||
static_cast<int>(TO_DEGREES(m_item->Pose.Orientation.y)) % 360,
|
||||
static_cast<int>(TO_DEGREES(m_item->Pose.Orientation.z)) % 360
|
||||
};
|
||||
}
|
||||
|
||||
void Moveable::SetRot(Rotation const& rot)
|
||||
{
|
||||
m_item->pos.xRot = FROM_DEGREES(rot.x);
|
||||
m_item->pos.yRot = FROM_DEGREES(rot.y);
|
||||
m_item->pos.zRot = FROM_DEGREES(rot.z);
|
||||
m_item->Pose.Orientation.x = FROM_DEGREES(rot.x);
|
||||
m_item->Pose.Orientation.y = FROM_DEGREES(rot.y);
|
||||
m_item->Pose.Orientation.z = FROM_DEGREES(rot.z);
|
||||
}
|
||||
|
||||
short Moveable::GetHP() const
|
||||
{
|
||||
return(m_item->hitPoints);
|
||||
return(m_item->HitPoints);
|
||||
}
|
||||
|
||||
void Moveable::SetHP(short hp)
|
||||
{
|
||||
if(Objects[m_item->objectNumber].intelligent &&
|
||||
(hp < 0 || hp > Objects[m_item->objectNumber].hitPoints))
|
||||
if(Objects[m_item->ObjectNumber].intelligent &&
|
||||
(hp < 0 || hp > Objects[m_item->ObjectNumber].HitPoints))
|
||||
{
|
||||
ScriptAssert(false, "Invalid HP value: " + std::to_string(hp));
|
||||
if (hp < 0)
|
||||
|
@ -527,24 +527,24 @@ void Moveable::SetHP(short hp)
|
|||
hp = 0;
|
||||
ScriptWarn("Setting HP to 0.");
|
||||
}
|
||||
else if (hp > Objects[m_item->objectNumber].hitPoints)
|
||||
else if (hp > Objects[m_item->ObjectNumber].HitPoints)
|
||||
{
|
||||
hp = Objects[m_item->objectNumber].hitPoints;
|
||||
hp = Objects[m_item->ObjectNumber].HitPoints;
|
||||
ScriptWarn("Setting HP to default value (" + std::to_string(hp) + ")");
|
||||
}
|
||||
}
|
||||
|
||||
m_item->hitPoints = hp;
|
||||
m_item->HitPoints = hp;
|
||||
}
|
||||
|
||||
short Moveable::GetOCB() const
|
||||
{
|
||||
return m_item->triggerFlags;
|
||||
return m_item->TriggerFlags;
|
||||
}
|
||||
|
||||
void Moveable::SetOCB(short ocb)
|
||||
{
|
||||
m_item->triggerFlags = ocb;
|
||||
m_item->TriggerFlags = ocb;
|
||||
}
|
||||
|
||||
aiBitsType Moveable::GetAIBits() const
|
||||
|
@ -554,7 +554,7 @@ aiBitsType Moveable::GetAIBits() const
|
|||
aiBitsArray ret{};
|
||||
for (size_t i = 0; i < ret.size(); ++i)
|
||||
{
|
||||
uint8_t isSet = m_item->aiBits & (1 << i);
|
||||
uint8_t isSet = m_item->AIBits & (1 << i);
|
||||
ret[i] = static_cast<int>( isSet > 0);
|
||||
}
|
||||
return ret;
|
||||
|
@ -564,39 +564,39 @@ void Moveable::SetAIBits(aiBitsType const & bits)
|
|||
{
|
||||
for (size_t i = 0; i < bits.value().size(); ++i)
|
||||
{
|
||||
m_item->aiBits &= ~(1 << i);
|
||||
m_item->AIBits &= ~(1 << i);
|
||||
uint8_t isSet = bits.value()[i] > 0;
|
||||
m_item->aiBits |= isSet << i;
|
||||
m_item->AIBits |= isSet << i;
|
||||
}
|
||||
}
|
||||
|
||||
int Moveable::GetAnimNumber() const
|
||||
{
|
||||
return m_item->animNumber - Objects[m_item->objectNumber].animIndex;
|
||||
return m_item->Animation.AnimNumber - Objects[m_item->ObjectNumber].animIndex;
|
||||
}
|
||||
|
||||
void Moveable::SetAnimNumber(int animNumber)
|
||||
{
|
||||
//TODO fixme: we need bounds checking with an error message once it's in the level file format
|
||||
m_item->animNumber = animNumber + Objects[m_item->objectNumber].animIndex;
|
||||
m_item->Animation.AnimNumber = animNumber + Objects[m_item->ObjectNumber].animIndex;
|
||||
}
|
||||
|
||||
int Moveable::GetFrameNumber() const
|
||||
{
|
||||
return m_item->frameNumber - g_Level.Anims[m_item->animNumber].frameBase;
|
||||
return m_item->Animation.FrameNumber - g_Level.Anims[m_item->Animation.AnimNumber].frameBase;
|
||||
}
|
||||
|
||||
|
||||
void Moveable::SetFrameNumber(int frameNumber)
|
||||
{
|
||||
auto const fBase = g_Level.Anims[m_item->animNumber].frameBase;
|
||||
auto const fEnd = g_Level.Anims[m_item->animNumber].frameEnd;
|
||||
auto const fBase = g_Level.Anims[m_item->Animation.AnimNumber].frameBase;
|
||||
auto const fEnd = g_Level.Anims[m_item->Animation.AnimNumber].frameEnd;
|
||||
auto frameCount = fEnd - fBase;
|
||||
bool cond = frameNumber < frameCount;
|
||||
const char* err = "Invalid frame number {}; max frame number for anim {} is {}.";
|
||||
if (ScriptAssertF(cond, err, frameNumber, m_item->animNumber, frameCount-1))
|
||||
if (ScriptAssertF(cond, err, frameNumber, m_item->Animation.AnimNumber, frameCount-1))
|
||||
{
|
||||
m_item->frameNumber = frameNumber + fBase;
|
||||
m_item->Animation.FrameNumber = frameNumber + fBase;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -606,22 +606,22 @@ void Moveable::SetFrameNumber(int frameNumber)
|
|||
|
||||
bool Moveable::GetActive() const
|
||||
{
|
||||
return m_item->active;
|
||||
return m_item->Active;
|
||||
}
|
||||
|
||||
void Moveable::SetActive(bool active)
|
||||
{
|
||||
m_item->active = active;
|
||||
m_item->Active = active;
|
||||
}
|
||||
|
||||
bool Moveable::GetHitStatus() const
|
||||
{
|
||||
return m_item->hitStatus;
|
||||
return m_item->HitStatus;
|
||||
}
|
||||
|
||||
short Moveable::GetRoom() const
|
||||
{
|
||||
return m_item->roomNumber;
|
||||
return m_item->RoomNumber;
|
||||
}
|
||||
|
||||
void Moveable::SetRoom(short room)
|
||||
|
@ -635,44 +635,44 @@ void Moveable::SetRoom(short room)
|
|||
}
|
||||
|
||||
if (!m_initialised)
|
||||
m_item->roomNumber = room;
|
||||
m_item->RoomNumber = room;
|
||||
else
|
||||
ItemNewRoom(m_num, room);
|
||||
}
|
||||
|
||||
short Moveable::GetStatus() const
|
||||
{
|
||||
return m_item->status;
|
||||
return m_item->Status;
|
||||
}
|
||||
|
||||
void Moveable::EnableItem()
|
||||
{
|
||||
if (!m_item->active)
|
||||
if (!m_item->Active)
|
||||
{
|
||||
if (Objects[m_item->objectNumber].intelligent)
|
||||
if (Objects[m_item->ObjectNumber].intelligent)
|
||||
{
|
||||
if (m_item->status == ITEM_DEACTIVATED)
|
||||
if (m_item->Status == ITEM_DEACTIVATED)
|
||||
{
|
||||
m_item->touchBits = 0;
|
||||
m_item->status = ITEM_ACTIVE;
|
||||
m_item->TouchBits = 0;
|
||||
m_item->Status = ITEM_ACTIVE;
|
||||
AddActiveItem(m_num);
|
||||
EnableBaddieAI(m_num, 1);
|
||||
}
|
||||
else if (m_item->status == ITEM_INVISIBLE)
|
||||
else if (m_item->Status == ITEM_INVISIBLE)
|
||||
{
|
||||
m_item->touchBits = 0;
|
||||
m_item->TouchBits = 0;
|
||||
if (EnableBaddieAI(m_num, 0))
|
||||
m_item->status = ITEM_ACTIVE;
|
||||
m_item->Status = ITEM_ACTIVE;
|
||||
else
|
||||
m_item->status = ITEM_INVISIBLE;
|
||||
m_item->Status = ITEM_INVISIBLE;
|
||||
AddActiveItem(m_num);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_item->touchBits = 0;
|
||||
m_item->TouchBits = 0;
|
||||
AddActiveItem(m_num);
|
||||
m_item->status = ITEM_ACTIVE;
|
||||
m_item->Status = ITEM_ACTIVE;
|
||||
}
|
||||
|
||||
// Try add colliding in case the item went from invisible -> activated
|
||||
|
@ -682,23 +682,23 @@ void Moveable::EnableItem()
|
|||
|
||||
void Moveable::DisableItem()
|
||||
{
|
||||
if (m_item->active)
|
||||
if (m_item->Active)
|
||||
{
|
||||
if (Objects[m_item->objectNumber].intelligent)
|
||||
if (Objects[m_item->ObjectNumber].intelligent)
|
||||
{
|
||||
if (m_item->status == ITEM_ACTIVE)
|
||||
if (m_item->Status == ITEM_ACTIVE)
|
||||
{
|
||||
m_item->touchBits = 0;
|
||||
m_item->status = ITEM_DEACTIVATED;
|
||||
m_item->TouchBits = 0;
|
||||
m_item->Status = ITEM_DEACTIVATED;
|
||||
RemoveActiveItem(m_num);
|
||||
DisableBaddieAI(m_num);
|
||||
DisableEntityAI(m_num);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_item->touchBits = 0;
|
||||
m_item->TouchBits = 0;
|
||||
RemoveActiveItem(m_num);
|
||||
m_item->status = ITEM_DEACTIVATED;
|
||||
m_item->Status = ITEM_DEACTIVATED;
|
||||
}
|
||||
// Try add colliding in case the item went from invisible -> deactivated
|
||||
dynamic_cast<ObjectsHandler*>(g_GameScriptEntities)->TryAddColliding(m_num);
|
||||
|
@ -707,14 +707,14 @@ void Moveable::DisableItem()
|
|||
|
||||
void Moveable::MakeInvisible()
|
||||
{
|
||||
m_item->status = ITEM_INVISIBLE;
|
||||
if (m_item->active)
|
||||
m_item->Status = ITEM_INVISIBLE;
|
||||
if (m_item->Active)
|
||||
{
|
||||
m_item->touchBits = 0;
|
||||
m_item->TouchBits = 0;
|
||||
RemoveActiveItem(m_num);
|
||||
if (Objects[m_item->objectNumber].intelligent)
|
||||
if (Objects[m_item->ObjectNumber].intelligent)
|
||||
{
|
||||
DisableBaddieAI(m_num);
|
||||
DisableEntityAI(m_num);
|
||||
}
|
||||
}
|
||||
dynamic_cast<ObjectsHandler*>(g_GameScriptEntities)->TryRemoveColliding(m_num);
|
||||
|
@ -737,7 +737,7 @@ void Moveable::Destroy()
|
|||
{
|
||||
if (m_num > NO_ITEM) {
|
||||
dynamic_cast<ObjectsHandler*>(g_GameScriptEntities)->RemoveMoveableFromMap(m_item, this);
|
||||
s_callbackRemoveName(m_item->luaName);
|
||||
s_callbackRemoveName(m_item->LuaName);
|
||||
KillItem(m_num);
|
||||
}
|
||||
|
||||
|
|
|
@ -135,13 +135,13 @@ The following constants are inside ObjID.
|
|||
MERCENARY_AUTOPISTOLS2
|
||||
SNOWMOBILE_GUN
|
||||
SNOWMOBILE_DRIVER
|
||||
FLAMETHROWER_BADDY
|
||||
FLAMETHROWER_GOON
|
||||
TRIBESMAN_WITH_AX
|
||||
TRIBESMAN_WITH_DARTS
|
||||
MP_WITH_STICK
|
||||
MP_WITH_GUN
|
||||
BADDY1
|
||||
BADDY2
|
||||
GOON1
|
||||
GOON2
|
||||
SAS_CAIRO
|
||||
SAS_DYING
|
||||
SAS_CAPTAIN
|
||||
|
@ -806,8 +806,8 @@ The following constants are inside ObjID.
|
|||
MESHSWAP8
|
||||
MESHSWAP9
|
||||
MESHSWAP10
|
||||
MESHSWAP_BADDY1
|
||||
MESHSWAP_BADDY2
|
||||
MESHSWAP_GOON1
|
||||
MESHSWAP_GOON2
|
||||
MESHSWAP_MAFIA2
|
||||
MESHSWAP_IMP
|
||||
MESHSWAP_HITMAN
|
||||
|
@ -1102,13 +1102,13 @@ static const std::unordered_map<std::string, GAME_OBJECT_ID> kObjIDs {
|
|||
{"MERCENARY_AUTOPISTOLS2", ID_MERCENARY_AUTOPISTOLS2},
|
||||
{"SNOWMOBILE_GUN", ID_SNOWMOBILE_GUN},
|
||||
{"SNOWMOBILE_DRIVER", ID_SNOWMOBILE_DRIVER},
|
||||
{"FLAMETHROWER_BADDY", ID_FLAMETHROWER_BADDY},
|
||||
{"FLAMETHROWER_GOON", ID_FLAMETHROWER_GOON},
|
||||
{"TRIBESMAN_WITH_AX", ID_TRIBESMAN_WITH_AX},
|
||||
{"TRIBESMAN_WITH_DARTS", ID_TRIBESMAN_WITH_DARTS},
|
||||
{"MP_WITH_STICK", ID_MP_WITH_STICK},
|
||||
{"MP_WITH_GUN", ID_MP_WITH_GUN},
|
||||
{"BADDY1", ID_BADDY1},
|
||||
{"BADDY2", ID_BADDY2},
|
||||
{"GOON1", ID_GOON1},
|
||||
{"GOON2", ID_GOON2},
|
||||
{"SAS_CAIRO", ID_SAS_CAIRO},
|
||||
{"SAS_DYING", ID_SAS_DYING},
|
||||
{"SAS_CAPTAIN", ID_SAS_CAPTAIN},
|
||||
|
@ -1773,8 +1773,8 @@ static const std::unordered_map<std::string, GAME_OBJECT_ID> kObjIDs {
|
|||
{"MESHSWAP8", ID_MESHSWAP8},
|
||||
{"MESHSWAP9", ID_MESHSWAP9},
|
||||
{"MESHSWAP10", ID_MESHSWAP10},
|
||||
{"MESHSWAP_BADDY1", ID_MESHSWAP_BADDY1},
|
||||
{"MESHSWAP_BADDY2", ID_MESHSWAP_BADDY2},
|
||||
{"MESHSWAP_GOON1", ID_MESHSWAP_GOON1},
|
||||
{"MESHSWAP_GOON2", ID_MESHSWAP_GOON2},
|
||||
{"MESHSWAP_MAFIA2", ID_MESHSWAP_MAFIA2},
|
||||
{"MESHSWAP_IMP", ID_MESHSWAP_IMP},
|
||||
{"MESHSWAP_HITMAN", ID_MESHSWAP_HITMAN},
|
||||
|
|
|
@ -130,11 +130,11 @@ void ObjectsHandler::TestCollidingObjects()
|
|||
if (!item->luaCallbackOnCollidedWithObjectName.empty())
|
||||
{
|
||||
//test against other moveables
|
||||
GetCollidedObjects(item, 0, true, CollidedItems, nullptr, 0, true);
|
||||
GetCollidedObjects(item, 0, true, CollidedItems, nullptr, 0);
|
||||
size_t i = 0;
|
||||
while (CollidedItems[i])
|
||||
{
|
||||
short idTwo = GetIndexByName(CollidedItems[i]->luaName);
|
||||
short idTwo = GetIndexByName(CollidedItems[i]->LuaName);
|
||||
g_GameScript->ExecuteFunction(item->luaCallbackOnCollidedWithObjectName, idOne, idTwo);
|
||||
++i;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ void ObjectsHandler::TestCollidingObjects()
|
|||
void ObjectsHandler::AssignLara()
|
||||
{
|
||||
#if TEN_OPTIONAL_LUA
|
||||
m_table_objects.set("Lara", Moveable(Lara.itemNumber, false));
|
||||
m_table_objects.set("Lara", Moveable(Lara.ItemNumber, false));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
{
|
||||
ITEM_INFO* item = &g_Level.Items[id];
|
||||
bool hasName = !(item->luaCallbackOnCollidedWithObjectName.empty() && item->luaCallbackOnCollidedWithRoomName.empty());
|
||||
if(hasName && item->collidable && (item->status != ITEM_INVISIBLE))
|
||||
if(hasName && item->Collidable && (item->Status != ITEM_INVISIBLE))
|
||||
return m_collidingItems.insert(id).second;
|
||||
|
||||
return false;
|
||||
|
@ -31,7 +31,7 @@ public:
|
|||
{
|
||||
ITEM_INFO* item = &g_Level.Items[id];
|
||||
bool hasName = !(item->luaCallbackOnCollidedWithObjectName.empty() && item->luaCallbackOnCollidedWithRoomName.empty());
|
||||
if(!force && hasName && item->collidable && (item->status != ITEM_INVISIBLE))
|
||||
if(!force && hasName && item->Collidable && (item->Status != ITEM_INVISIBLE))
|
||||
return false;
|
||||
|
||||
return m_collidingItemsToRemove.insert(id).second;
|
||||
|
|
|
@ -81,14 +81,14 @@ void Static::Register(sol::table & parent)
|
|||
|
||||
Vec3 Static::GetPos() const
|
||||
{
|
||||
return Vec3{ m_mesh.pos.xPos, m_mesh.pos.yPos, m_mesh.pos.zPos };
|
||||
return Vec3{ m_mesh.pos.Position.x, m_mesh.pos.Position.y, m_mesh.pos.Position.z };
|
||||
}
|
||||
|
||||
void Static::SetPos(Vec3 const& pos)
|
||||
{
|
||||
m_mesh.pos.xPos = pos.x;
|
||||
m_mesh.pos.yPos = pos.y;
|
||||
m_mesh.pos.zPos = pos.z;
|
||||
m_mesh.pos.Position.x = pos.x;
|
||||
m_mesh.pos.Position.y = pos.y;
|
||||
m_mesh.pos.Position.z = pos.z;
|
||||
}
|
||||
|
||||
// This does not guarantee that the returned value will be identical
|
||||
|
@ -98,17 +98,17 @@ void Static::SetPos(Vec3 const& pos)
|
|||
Rotation Static::GetRot() const
|
||||
{
|
||||
return {
|
||||
static_cast<int>(TO_DEGREES(m_mesh.pos.xRot)) % 360,
|
||||
static_cast<int>(TO_DEGREES(m_mesh.pos.yRot)) % 360,
|
||||
static_cast<int>(TO_DEGREES(m_mesh.pos.zRot)) % 360
|
||||
static_cast<int>(TO_DEGREES(m_mesh.pos.Orientation.x)) % 360,
|
||||
static_cast<int>(TO_DEGREES(m_mesh.pos.Orientation.y)) % 360,
|
||||
static_cast<int>(TO_DEGREES(m_mesh.pos.Orientation.z)) % 360
|
||||
};
|
||||
}
|
||||
|
||||
void Static::SetRot(Rotation const& rot)
|
||||
{
|
||||
m_mesh.pos.xRot = FROM_DEGREES(rot.x);
|
||||
m_mesh.pos.yRot = FROM_DEGREES(rot.y);
|
||||
m_mesh.pos.zRot = FROM_DEGREES(rot.z);
|
||||
m_mesh.pos.Orientation.x = FROM_DEGREES(rot.x);
|
||||
m_mesh.pos.Orientation.y = FROM_DEGREES(rot.y);
|
||||
m_mesh.pos.Orientation.z = FROM_DEGREES(rot.z);
|
||||
}
|
||||
|
||||
std::string Static::GetName() const
|
||||
|
|
|
@ -46,16 +46,16 @@ Rotation::Rotation(int aX, int aY, int aZ)
|
|||
|
||||
void Rotation::StoreInPHDPos(PHD_3DPOS& pos) const
|
||||
{
|
||||
pos.xRot = x;
|
||||
pos.yRot = y;
|
||||
pos.zRot = z;
|
||||
pos.Orientation.x = x;
|
||||
pos.Orientation.y = y;
|
||||
pos.Orientation.z = z;
|
||||
}
|
||||
|
||||
Rotation::Rotation(PHD_3DPOS const & pos)
|
||||
{
|
||||
x = pos.xRot;
|
||||
y = pos.yRot;
|
||||
z = pos.zRot;
|
||||
x = pos.Orientation.x;
|
||||
y = pos.Orientation.y;
|
||||
z = pos.Orientation.z;
|
||||
}
|
||||
|
||||
/***
|
||||
|
|
|
@ -57,18 +57,18 @@ Vec3::Vec3(int aX, int aY, int aZ) : x{aX}, y{aY}, z{aZ}
|
|||
{
|
||||
}
|
||||
|
||||
Vec3::Vec3(PHD_3DPOS const& pos) : x{pos.xPos}, y{pos.yPos}, z{pos.zPos}
|
||||
Vec3::Vec3(PHD_3DPOS const& pos) : x{pos.Position.x}, y{pos.Position.y}, z{pos.Position.z}
|
||||
{
|
||||
}
|
||||
|
||||
void Vec3::StoreInPHDPos(PHD_3DPOS& pos) const
|
||||
{
|
||||
pos.xPos = x;
|
||||
pos.yPos = y;
|
||||
pos.zPos = z;
|
||||
pos.Position.x = x;
|
||||
pos.Position.y = y;
|
||||
pos.Position.z = z;
|
||||
}
|
||||
|
||||
void Vec3::StoreInGameVector(GAME_VECTOR& pos) const
|
||||
void Vec3::StoreInGameVector(GameVector& pos) const
|
||||
{
|
||||
pos.x = x;
|
||||
pos.y = y;
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
namespace sol {
|
||||
class state;
|
||||
}
|
||||
struct PHD_3DPOS;
|
||||
struct GAME_VECTOR;
|
||||
|
||||
struct PHD_3DPOS;
|
||||
struct GameVector;
|
||||
|
||||
class Vec3 {
|
||||
public:
|
||||
|
@ -20,7 +20,7 @@ public:
|
|||
|
||||
void ToLength(int newLength);
|
||||
void StoreInPHDPos(PHD_3DPOS& pos) const;
|
||||
void StoreInGameVector(GAME_VECTOR& vec) const;
|
||||
void StoreInGameVector(GameVector& vec) const;
|
||||
|
||||
static void Register(sol::table &);
|
||||
};
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
-- TR5Main engine settings file
|
||||
-- TombEngine settings file
|
||||
-- Created by MontyTRC
|
||||
<<<<<<< HEAD
|
||||
-- Place in this Lua script all the engine settings for your game
|
||||
-- WARNING: bad values could make your game unplayable, please follow with attention the reference guide
|
||||
=======
|
||||
-- Place all the engine settings for your game in this Lua script.
|
||||
-- WARNING: Bad values could make your game unplayable; please follow reference guide attentively.
|
||||
>>>>>>> state_cleaning_tier_2
|
||||
|
||||
local Flow = TEN.Flow
|
||||
|
||||
|
@ -17,6 +22,7 @@ settings.showDebugInfo = true;
|
|||
settings.errorMode = Flow.ErrorMode.WARN;
|
||||
Flow.SetSettings(settings);
|
||||
|
||||
<<<<<<< HEAD
|
||||
local anims = Flow.Animations.new();
|
||||
anims.crawlExtended = true;
|
||||
anims.crouchRoll = true;
|
||||
|
@ -26,3 +32,15 @@ anims.monkeyAutoJump = false;
|
|||
anims.oscillateHang = true;
|
||||
anims.pose = false;
|
||||
Flow.SetAnimations(anims);
|
||||
=======
|
||||
local anims = Animations.new();
|
||||
anims.hasPose = false;
|
||||
anims.hasSlideExtended = false;
|
||||
anims.hasSprintJump = true;
|
||||
anims.hasMonkeyAutoJump = false;
|
||||
anims.hasCrawlspaceDive = true;
|
||||
anims.hasCrawlExtended = true;
|
||||
anims.hasCrouchRoll = true;
|
||||
anims.hasOverhangClimb = false;
|
||||
SetAnimations(anims);
|
||||
>>>>>>> state_cleaning_tier_2
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,8 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct COLL_RESULT;
|
||||
struct CollisionInfo;
|
||||
struct CollisionResult;
|
||||
|
||||
// ------------------------------
|
||||
// BASIC MOVEMENT & MISCELLANEOUS
|
||||
|
@ -13,59 +13,61 @@ struct COLL_RESULT;
|
|||
// MISCELLANEOUS:
|
||||
// --------------
|
||||
|
||||
void lara_void_func(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_default_col(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_special(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_null(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_controlled(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_controlled_no_look(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_void_func(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_default_col(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_special(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_null(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_controlled(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_controlled_no_look(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_vault(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_auto_jump(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
// ---------------
|
||||
// BASIC MOVEMENT:
|
||||
// ---------------
|
||||
|
||||
void lara_as_walk_forward(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_walk_forward(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_run_forward(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_run_forward(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_idle(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void PseudoLaraAsWadeIdle(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void PseudoLaraAsSwampIdle(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_idle(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_pose(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_run_back(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_run_back(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_turn_right_slow(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void PsuedoLaraAsSwampTurnRightSlow(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void PsuedoLaraAsWadeTurnRightSlow(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_turn_right_slow(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_turn_left_slow(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void PsuedoLaraAsWadeTurnLeftSlow(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void PsuedoLaraAsSwampTurnLeftSlow(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_turn_left_slow(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_death(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_death(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_splat(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_splat(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_walk_back(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void PseudoLaraAsSwampWalkBack(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_walk_back(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_turn_right_fast(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_turn_right_fast(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_turn_left_fast(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_turn_left_fast(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_step_right(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_step_right(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_step_left(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_step_left(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_roll_back(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_roll_back(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_roll_forward(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_roll_forward(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_wade_forward(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void PseudoLaraAsSwampWadeForward(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_wade_forward(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_sprint(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_sprint(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_sprint_dive(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_sprint_dive(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_walk_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_walk_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_run_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_run_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void PseudoLaraAsWadeIdle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void PseudoLaraAsSwampIdle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_pose(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_run_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_run_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_turn_right_slow(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void PsuedoLaraAsSwampTurnRightSlow(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void PsuedoLaraAsWadeTurnRightSlow(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_turn_right_slow(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_turn_left_slow(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void PsuedoLaraAsWadeTurnLeftSlow(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void PsuedoLaraAsSwampTurnLeftSlow(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_turn_left_slow(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_death(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_death(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_splat(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_splat(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_walk_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void PseudoLaraAsSwampWalkBack(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_walk_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_turn_right_fast(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_turn_right_fast(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_turn_left_fast(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_turn_left_fast(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_step_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_step_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_step_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_step_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_roll_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_roll_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_roll_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_roll_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_wade_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void PseudoLaraAsSwampWadeForward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_wade_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_sprint(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_sprint(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_sprint_dive(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_sprint_dive(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
|
|
@ -6,229 +6,241 @@
|
|||
#include "Game/items.h"
|
||||
#include "Game/Lara/lara.h"
|
||||
#include "Scripting/Flow/ScriptInterfaceFlowHandler.h"
|
||||
#include "Game/Lara/lara_helpers.h"
|
||||
#include "Sound/sound.h"
|
||||
#include "Specific/input.h"
|
||||
#include "Specific/level.h"
|
||||
#include "Specific/setup.h"
|
||||
|
||||
int NoCheatCounter;
|
||||
|
||||
void lara_as_swimcheat(ITEM_INFO* item, COLL_INFO* coll)
|
||||
void lara_as_swimcheat(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (TrInput & IN_FORWARD)
|
||||
{
|
||||
item->pos.xRot -= ANGLE(3);
|
||||
}
|
||||
item->Pose.Orientation.x -= ANGLE(3.0f);
|
||||
else if (TrInput & IN_BACK)
|
||||
{
|
||||
item->pos.xRot += ANGLE(3);
|
||||
}
|
||||
item->Pose.Orientation.x += ANGLE(3.0f);
|
||||
|
||||
if (TrInput & IN_LEFT)
|
||||
{
|
||||
Lara.turnRate -= 613;
|
||||
|
||||
if (Lara.turnRate < -ANGLE(6))
|
||||
Lara.turnRate = -ANGLE(6);
|
||||
lara->Control.TurnRate -= ANGLE(3.4f);
|
||||
if (lara->Control.TurnRate < -ANGLE(6.0f))
|
||||
lara->Control.TurnRate = -ANGLE(6.0f);
|
||||
}
|
||||
else if (TrInput & IN_RIGHT)
|
||||
{
|
||||
Lara.turnRate += 613;
|
||||
|
||||
if (Lara.turnRate > ANGLE(6))
|
||||
Lara.turnRate = ANGLE(6);
|
||||
lara->Control.TurnRate += ANGLE(3.4f);
|
||||
if (lara->Control.TurnRate > ANGLE(6.0f))
|
||||
lara->Control.TurnRate = ANGLE(6.0f);
|
||||
}
|
||||
|
||||
if (TrInput & IN_ACTION)
|
||||
{
|
||||
TriggerDynamicLight(item->pos.xPos, item->pos.yPos, item->pos.zPos, 31, 255, 255, 255);
|
||||
}
|
||||
TriggerDynamicLight(item->Pose.Position.x, item->Pose.Position.y, item->Pose.Position.z, 31, 150, 150, 150);
|
||||
|
||||
if (TrInput & IN_OPTION)
|
||||
{
|
||||
Lara.turnRate = -ANGLE(12);
|
||||
}
|
||||
lara->Control.TurnRate = -ANGLE(12.0f);
|
||||
|
||||
if (TrInput & IN_JUMP)
|
||||
{
|
||||
item->fallspeed += 16;
|
||||
|
||||
if (item->fallspeed > 400)
|
||||
item->fallspeed = 400;
|
||||
item->Animation.VerticalVelocity += LARA_SWIM_ACCELERATION * 2;
|
||||
if (item->Animation.VerticalVelocity > LARA_SWIM_VELOCITY_MAX * 2)
|
||||
item->Animation.VerticalVelocity = LARA_SWIM_VELOCITY_MAX * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item->fallspeed >= 8)
|
||||
item->fallspeed -= item->fallspeed >> 3;
|
||||
if (item->Animation.VerticalVelocity >= LARA_SWIM_ACCELERATION)
|
||||
item->Animation.VerticalVelocity -= item->Animation.VerticalVelocity / 8;
|
||||
else
|
||||
item->fallspeed = 0;
|
||||
item->Animation.VerticalVelocity = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void LaraCheatyBits()
|
||||
void LaraCheatyBits(ITEM_INFO* item)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (g_GameFlow->IsFlyCheatEnabled())
|
||||
{
|
||||
if (KeyMap[DIK_O])
|
||||
{
|
||||
if (Lara.Vehicle == NO_ITEM)
|
||||
if (lara->Vehicle == NO_ITEM)
|
||||
{
|
||||
LaraCheatGetStuff(item);
|
||||
DelsGiveLaraItemsCheat(item);
|
||||
|
||||
LaraCheatGetStuff();
|
||||
item->Pose.Position.y -= CLICK(0.5f);
|
||||
|
||||
DelsGiveLaraItemsCheat();
|
||||
|
||||
LaraItem->pos.yPos -= 128;
|
||||
|
||||
if (Lara.waterStatus != LW_FLYCHEAT)
|
||||
if (lara->Control.WaterStatus != WaterStatus::FlyCheat)
|
||||
{
|
||||
Lara.waterStatus = LW_FLYCHEAT;
|
||||
SetAnimation(LaraItem, LA_DOZY);
|
||||
LaraItem->gravityStatus = false;
|
||||
LaraItem->pos.xRot = ANGLE(30);
|
||||
LaraItem->fallspeed = 30;
|
||||
LaraItem->hitPoints = 1000;
|
||||
Lara.poisoned = 0;
|
||||
Lara.air = 1800;
|
||||
Lara.deathCount = 0;
|
||||
Lara.torsoYrot = 0;
|
||||
Lara.torsoXrot = 0;
|
||||
Lara.headYrot = 0;
|
||||
Lara.headXrot = 0;
|
||||
SetAnimation(item, LA_DOZY);
|
||||
item->Animation.VerticalVelocity = 30;
|
||||
item->Animation.Airborne = false;
|
||||
item->Pose.Orientation.x = ANGLE(30.0f);
|
||||
item->HitPoints = LARA_HEALTH_MAX;
|
||||
|
||||
ResetLaraFlex(item);
|
||||
lara->Control.WaterStatus = WaterStatus::FlyCheat;
|
||||
lara->Control.Count.Death = 0;
|
||||
lara->PoisonPotency = 0;
|
||||
lara->Air = LARA_AIR_MAX;
|
||||
}
|
||||
}
|
||||
else if (!NoCheatCounter)
|
||||
else if (!lara->Control.Count.NoCheat)
|
||||
{
|
||||
lara->Control.Count.NoCheat = 15;
|
||||
SayNo();
|
||||
NoCheatCounter = 15;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (NoCheatCounter)
|
||||
NoCheatCounter--;
|
||||
|
||||
if (lara->Control.Count.NoCheat)
|
||||
lara->Control.Count.NoCheat--;
|
||||
}
|
||||
|
||||
void LaraCheatGetStuff()
|
||||
void LaraCheatGetStuff(ITEM_INFO* item)
|
||||
{
|
||||
Lara.NumFlares = -1;
|
||||
Lara.NumSmallMedipacks = -1;
|
||||
Lara.NumLargeMedipacks = -1;
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
lara->Inventory.TotalFlares = -1;
|
||||
lara->Inventory.TotalSmallMedipacks = -1;
|
||||
lara->Inventory.TotalLargeMedipacks = -1;
|
||||
|
||||
if (Objects[ID_CROWBAR_ITEM].loaded)
|
||||
Lara.Crowbar = true;
|
||||
lara->Inventory.HasCrowbar = true;
|
||||
|
||||
if (Objects[ID_LASERSIGHT_ITEM].loaded)
|
||||
Lara.Lasersight = true;
|
||||
lara->Inventory.HasLasersight = true;
|
||||
|
||||
if (Objects[ID_CLOCKWORK_BEETLE].loaded)
|
||||
Lara.hasBeetleThings |= 1;
|
||||
lara->Inventory.BeetleComponents |= 1;
|
||||
|
||||
if (Objects[ID_WATERSKIN1_EMPTY].loaded)
|
||||
Lara.small_waterskin = 1;
|
||||
lara->Inventory.SmallWaterskin = 1;
|
||||
|
||||
if (Objects[ID_WATERSKIN2_EMPTY].loaded)
|
||||
Lara.big_waterskin = 1;
|
||||
lara->Inventory.BigWaterskin = 1;
|
||||
|
||||
if (Objects[ID_REVOLVER_ITEM].loaded)
|
||||
{
|
||||
Lara.Weapons[WEAPON_REVOLVER].Present = true;
|
||||
Lara.Weapons[WEAPON_REVOLVER].SelectedAmmo = WEAPON_AMMO1;
|
||||
Lara.Weapons[WEAPON_REVOLVER].HasLasersight = false;
|
||||
Lara.Weapons[WEAPON_REVOLVER].HasSilencer = false;
|
||||
Lara.Weapons[WEAPON_REVOLVER].Ammo[WEAPON_AMMO1].setInfinite(true);
|
||||
auto& weapon = lara->Weapons[(int)LaraWeaponType::Revolver];
|
||||
|
||||
weapon.Present = true;
|
||||
weapon.SelectedAmmo = WeaponAmmoType::Ammo1;
|
||||
weapon.HasLasersight = false;
|
||||
weapon.HasSilencer = false;
|
||||
weapon.Ammo[(int)WeaponAmmoType::Ammo1].setInfinite(true);
|
||||
}
|
||||
|
||||
if (Objects[ID_UZI_ITEM].loaded)
|
||||
{
|
||||
Lara.Weapons[WEAPON_UZI].Present = true;
|
||||
Lara.Weapons[WEAPON_UZI].SelectedAmmo = WEAPON_AMMO1;
|
||||
Lara.Weapons[WEAPON_UZI].HasLasersight = false;
|
||||
Lara.Weapons[WEAPON_UZI].HasSilencer = false;
|
||||
Lara.Weapons[WEAPON_UZI].Ammo[WEAPON_AMMO1].setInfinite(true);
|
||||
auto& weapon = lara->Weapons[(int)LaraWeaponType::Uzi];
|
||||
|
||||
weapon.Present = true;
|
||||
weapon.SelectedAmmo = WeaponAmmoType::Ammo1;
|
||||
weapon.HasLasersight = false;
|
||||
weapon.HasSilencer = false;
|
||||
weapon.Ammo[(int)WeaponAmmoType::Ammo1].setInfinite(true);
|
||||
}
|
||||
|
||||
if (Objects[ID_SHOTGUN_ITEM].loaded)
|
||||
{
|
||||
Lara.Weapons[WEAPON_SHOTGUN].Present = true;
|
||||
Lara.Weapons[WEAPON_SHOTGUN].SelectedAmmo = WEAPON_AMMO1;
|
||||
Lara.Weapons[WEAPON_SHOTGUN].HasLasersight = false;
|
||||
Lara.Weapons[WEAPON_SHOTGUN].HasSilencer = false;
|
||||
Lara.Weapons[WEAPON_SHOTGUN].Ammo[WEAPON_AMMO1].setInfinite(true);
|
||||
auto& weapon = lara->Weapons[(int)LaraWeaponType::Shotgun];
|
||||
|
||||
weapon.Present = true;
|
||||
weapon.SelectedAmmo = WeaponAmmoType::Ammo1;
|
||||
weapon.HasLasersight = false;
|
||||
weapon.HasSilencer = false;
|
||||
weapon.Ammo[(int)WeaponAmmoType::Ammo1].setInfinite(true);
|
||||
}
|
||||
|
||||
if (Objects[ID_HARPOON_ITEM].loaded)
|
||||
{
|
||||
Lara.Weapons[WEAPON_HARPOON_GUN].Present = true;
|
||||
Lara.Weapons[WEAPON_HARPOON_GUN].SelectedAmmo = WEAPON_AMMO1;
|
||||
Lara.Weapons[WEAPON_HARPOON_GUN].HasLasersight = false;
|
||||
Lara.Weapons[WEAPON_HARPOON_GUN].HasSilencer = false;
|
||||
Lara.Weapons[WEAPON_HARPOON_GUN].Ammo[WEAPON_AMMO1].setInfinite(true);
|
||||
{
|
||||
auto& weapon = lara->Weapons[(int)LaraWeaponType::HarpoonGun];
|
||||
|
||||
weapon.Present = true;
|
||||
weapon.SelectedAmmo = WeaponAmmoType::Ammo1;
|
||||
weapon.HasLasersight = false;
|
||||
weapon.HasSilencer = false;
|
||||
weapon.Ammo[(int)WeaponAmmoType::Ammo1].setInfinite(true);
|
||||
}
|
||||
|
||||
if (Objects[ID_GRENADE_GUN_ITEM].loaded)
|
||||
{
|
||||
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].Present = true;
|
||||
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].SelectedAmmo = WEAPON_AMMO1;
|
||||
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].HasSilencer = false;
|
||||
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].Ammo[WEAPON_AMMO1].setInfinite(true);
|
||||
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].Ammo[WEAPON_AMMO2].setInfinite(true);
|
||||
Lara.Weapons[WEAPON_GRENADE_LAUNCHER].Ammo[WEAPON_AMMO3].setInfinite(true);
|
||||
auto& weapon = lara->Weapons[(int)LaraWeaponType::GrenadeLauncher];
|
||||
|
||||
weapon.Present = true;
|
||||
weapon.SelectedAmmo = WeaponAmmoType::Ammo1;
|
||||
weapon.HasSilencer = false;
|
||||
weapon.Ammo[(int)WeaponAmmoType::Ammo1].setInfinite(true);
|
||||
weapon.Ammo[(int)WeaponAmmoType::Ammo2].setInfinite(true);
|
||||
weapon.Ammo[(int)WeaponAmmoType::Ammo3].setInfinite(true);
|
||||
}
|
||||
|
||||
if (Objects[ID_ROCKET_LAUNCHER_ITEM].loaded)
|
||||
{
|
||||
Lara.Weapons[WEAPON_ROCKET_LAUNCHER].Present = true;
|
||||
Lara.Weapons[WEAPON_ROCKET_LAUNCHER].SelectedAmmo = WEAPON_AMMO1;
|
||||
Lara.Weapons[WEAPON_ROCKET_LAUNCHER].HasLasersight = false;
|
||||
Lara.Weapons[WEAPON_ROCKET_LAUNCHER].HasSilencer = false;
|
||||
Lara.Weapons[WEAPON_ROCKET_LAUNCHER].Ammo[WEAPON_AMMO1].setInfinite(true);
|
||||
auto& weapon = lara->Weapons[(int)LaraWeaponType::RocketLauncher];
|
||||
|
||||
weapon.Present = true;
|
||||
weapon.SelectedAmmo = WeaponAmmoType::Ammo1;
|
||||
weapon.HasLasersight = false;
|
||||
weapon.HasSilencer = false;
|
||||
weapon.Ammo[(int)WeaponAmmoType::Ammo1].setInfinite(true);
|
||||
}
|
||||
|
||||
if (Objects[ID_HK_ITEM].loaded)
|
||||
{
|
||||
Lara.Weapons[WEAPON_HK].Present = true;
|
||||
Lara.Weapons[WEAPON_HK].SelectedAmmo = WEAPON_AMMO1;
|
||||
Lara.Weapons[WEAPON_HK].HasLasersight = false;
|
||||
Lara.Weapons[WEAPON_HK].HasSilencer = false;
|
||||
Lara.Weapons[WEAPON_HK].Ammo[WEAPON_AMMO1].setInfinite(true);
|
||||
auto& weapon = lara->Weapons[(int)LaraWeaponType::HK];
|
||||
|
||||
weapon.Present = true;
|
||||
weapon.SelectedAmmo = WeaponAmmoType::Ammo1;
|
||||
weapon.HasLasersight = false;
|
||||
weapon.HasSilencer = false;
|
||||
weapon.Ammo[(int)WeaponAmmoType::Ammo1].setInfinite(true);
|
||||
}
|
||||
|
||||
if (Objects[ID_CROSSBOW_ITEM].loaded)
|
||||
{
|
||||
Lara.Weapons[WEAPON_CROSSBOW].Present = true;
|
||||
Lara.Weapons[WEAPON_CROSSBOW].SelectedAmmo = WEAPON_AMMO1;
|
||||
Lara.Weapons[WEAPON_CROSSBOW].HasLasersight = false;
|
||||
Lara.Weapons[WEAPON_CROSSBOW].HasSilencer = false;
|
||||
Lara.Weapons[WEAPON_CROSSBOW].Ammo[WEAPON_AMMO1].setInfinite(true);
|
||||
Lara.Weapons[WEAPON_CROSSBOW].Ammo[WEAPON_AMMO2].setInfinite(true);
|
||||
Lara.Weapons[WEAPON_CROSSBOW].Ammo[WEAPON_AMMO3].setInfinite(true);
|
||||
{
|
||||
auto& weapon = lara->Weapons[(int)LaraWeaponType::Crossbow];
|
||||
|
||||
weapon.Present = true;
|
||||
weapon.SelectedAmmo = WeaponAmmoType::Ammo1;
|
||||
weapon.HasLasersight = false;
|
||||
weapon.HasSilencer = false;
|
||||
weapon.Ammo[(int)WeaponAmmoType::Ammo1].setInfinite(true);
|
||||
weapon.Ammo[(int)WeaponAmmoType::Ammo2].setInfinite(true);
|
||||
weapon.Ammo[(int)WeaponAmmoType::Ammo3].setInfinite(true);
|
||||
}
|
||||
}
|
||||
|
||||
void DelsGiveLaraItemsCheat()
|
||||
void DelsGiveLaraItemsCheat(ITEM_INFO* item)
|
||||
{
|
||||
int i;
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
for (i = 0; i < 8; ++i)
|
||||
for (int i = 0; i < 8; ++i)
|
||||
{
|
||||
if (Objects[ID_PUZZLE_ITEM1 + i].loaded)
|
||||
Lara.Puzzles[i] = 1;
|
||||
Lara.PuzzlesCombo[2 * i] = false;
|
||||
Lara.PuzzlesCombo[2 * i + 1] = false;
|
||||
lara->Inventory.Puzzles[i] = 1;
|
||||
|
||||
lara->Inventory.PuzzlesCombo[2 * i] = false;
|
||||
lara->Inventory.PuzzlesCombo[2 * i + 1] = false;
|
||||
}
|
||||
for (i = 0; i < 8; ++i)
|
||||
|
||||
for (int i = 0; i < 8; ++i)
|
||||
{
|
||||
if (Objects[ID_KEY_ITEM1 + i].loaded)
|
||||
Lara.Keys[i] = 1;
|
||||
Lara.KeysCombo[2 * i] = false;
|
||||
Lara.KeysCombo[2 * i + 1] = false;
|
||||
lara->Inventory.Keys[i] = 1;
|
||||
|
||||
lara->Inventory.KeysCombo[2 * i] = false;
|
||||
lara->Inventory.KeysCombo[2 * i + 1] = false;
|
||||
}
|
||||
for (i = 0; i < 3; ++i)
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
if (Objects[ID_PICKUP_ITEM1 + i].loaded)
|
||||
Lara.Pickups[i] = 1;
|
||||
Lara.PickupsCombo[2 * i] = false;
|
||||
Lara.PickupsCombo[2 * i + 1] = false;
|
||||
lara->Inventory.Pickups[i] = 1;
|
||||
|
||||
lara->Inventory.PickupsCombo[2 * i] = false;
|
||||
lara->Inventory.PickupsCombo[2 * i + 1] = false;
|
||||
}
|
||||
/* Hardcoded code */
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
#pragma once
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
|
||||
void lara_as_swimcheat(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void LaraCheatyBits();
|
||||
void LaraCheatGetStuff();
|
||||
void DelsGiveLaraItemsCheat();
|
||||
struct ITEM_INFO;
|
||||
struct CollisionInfo;
|
||||
|
||||
void lara_as_swimcheat(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void LaraCheatyBits(ITEM_INFO* item);
|
||||
void LaraCheatGetStuff(ITEM_INFO* item);
|
||||
void DelsGiveLaraItemsCheat(ITEM_INFO* item);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,14 +1,7 @@
|
|||
#pragma once
|
||||
#include "Game/collision/collide_room.h"
|
||||
#include "Game/items.h"
|
||||
|
||||
enum class CLIMB_DIRECTION : short
|
||||
{
|
||||
North = 0x0100,
|
||||
East = 0x0200,
|
||||
South = 0x0400,
|
||||
West = 0x0800
|
||||
};
|
||||
#include "Game/collision//floordata.h"
|
||||
|
||||
static CLIMB_DIRECTION LeftIntRightExtTab[4] =
|
||||
{
|
||||
|
@ -20,28 +13,34 @@ static CLIMB_DIRECTION LeftExtRightIntTab[4] =
|
|||
CLIMB_DIRECTION::East, CLIMB_DIRECTION::South, CLIMB_DIRECTION::West, CLIMB_DIRECTION::North
|
||||
};
|
||||
|
||||
// -----------------------------
|
||||
// LADDER CLIMB
|
||||
// Control & Collision Functions
|
||||
// -----------------------------
|
||||
|
||||
void lara_col_climb_end(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_climb_end(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_climb_down(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_climb_down(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_climb_up(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_climb_up(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_climb_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_climb_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_climb_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_climb_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_climb_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_climb_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_climb_stepoff_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_climb_stepoff_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
short GetClimbFlags(int x, int y, int z, short roomNumber);
|
||||
short GetClimbFlags(FLOOR_INFO* floor);
|
||||
|
||||
void lara_col_climbend(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_climbend(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_climbdown(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_climbdown(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_climbing(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_climbing(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_climbright(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_climbright(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_climbleft(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_climbleft(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_climbstnc(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_climbstnc(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_stepoff_left(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_stepoff_right(ITEM_INFO* item, COLL_INFO* coll);
|
||||
CLIMB_DIRECTION GetClimbDirection(short angle);
|
||||
|
||||
int LaraTestClimbPos(ITEM_INFO* item, int front, int right, int origin, int height, int* shift);
|
||||
void LaraDoClimbLeftRight(ITEM_INFO* item, COLL_INFO* coll, int result, int shift);
|
||||
int LaraClimbRightCornerTest(ITEM_INFO* item, COLL_INFO* coll);
|
||||
int LaraClimbLeftCornerTest(ITEM_INFO* item, COLL_INFO* coll);
|
||||
int LaraTestClimb(int x, int y, int z, int xFront, int zFront, int itemHeight, int itemRoom, int* shift);
|
||||
void LaraDoClimbLeftRight(ITEM_INFO* item, CollisionInfo* coll, int result, int shift);
|
||||
int LaraClimbRightCornerTest(ITEM_INFO* item, CollisionInfo* coll);
|
||||
int LaraClimbLeftCornerTest(ITEM_INFO* item, CollisionInfo* coll);
|
||||
int LaraTestClimb(ITEM_INFO* item, int x, int y, int z, int xFront, int zFront, int itemHeight, int itemRoom, int* shift);
|
||||
int LaraTestClimbUpPos(ITEM_INFO* item, int front, int right, int* shift, int* ledge);
|
||||
int LaraCheckForLetGo(ITEM_INFO* item, COLL_INFO* coll);
|
||||
bool LaraCheckForLetGo(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,30 +1,38 @@
|
|||
#pragma once
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct CollisionInfo;
|
||||
|
||||
constexpr auto DEFLECT_STRAIGHT_ANGLE = 5.0f;
|
||||
constexpr auto DEFLECT_DIAGONAL_ANGLE = 12.0f;
|
||||
constexpr auto DEFLECT_STRAIGHT_ANGLE_CRAWL = 2.0f;
|
||||
constexpr auto DEFLECT_DIAGONAL_ANGLE_CRAWL = 5.0f;
|
||||
|
||||
bool LaraDeflectEdge(ITEM_INFO* item, COLL_INFO* coll);
|
||||
bool LaraDeflectEdgeJump(ITEM_INFO* item, COLL_INFO* coll);
|
||||
bool LaraDeflectEdgeCrawl(ITEM_INFO* item, COLL_INFO* coll);
|
||||
bool LaraHitCeiling(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void LaraCollideStop(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void LaraCollideStopCrawl(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void LaraSnapToEdgeOfBlock(ITEM_INFO* item, COLL_INFO* coll, short angle);
|
||||
void LaraResetGravityStatus(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void LaraSnapToHeight(ITEM_INFO* item, COLL_INFO* coll);
|
||||
short GetDirOctant(int rot);
|
||||
// -----------------------------
|
||||
// COLLISION TEST FUNCTIONS
|
||||
// For State Control & Collision
|
||||
// -----------------------------
|
||||
|
||||
bool LaraDeflectEdge(ITEM_INFO* item, CollisionInfo* coll);
|
||||
bool LaraDeflectEdgeJump(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void LaraSlideEdgeJump(ITEM_INFO* item, CollisionInfo* coll);
|
||||
bool LaraDeflectEdgeCrawl(ITEM_INFO* item, CollisionInfo* coll);
|
||||
bool LaraDeflectEdgeMonkey(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void LaraCollideStop(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void LaraCollideStopCrawl(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void LaraCollideStopMonkey(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void LaraSnapToEdgeOfBlock(ITEM_INFO* item, CollisionInfo* coll, short angle);
|
||||
void LaraResetGravityStatus(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void LaraSnapToHeight(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void GetLaraDeadlyBounds();
|
||||
|
||||
void LaraJumpCollision(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void LaraSurfaceCollision(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void LaraSwimCollision(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void LaraJumpCollision(ITEM_INFO* item, CollisionInfo* coll, short moveAngle);
|
||||
void LaraSurfaceCollision(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void LaraSwimCollision(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
// TODO: Temporary placement.
|
||||
bool TestLaraHitCeiling(COLL_INFO* coll);
|
||||
void SetLaraHitCeiling(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void LaraWaterCurrent(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
bool TestLaraObjectCollision(ITEM_INFO* item, short angle, int dist, int height);
|
||||
bool TestLaraHitCeiling(CollisionInfo* coll);
|
||||
void SetLaraHitCeiling(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
bool TestLaraObjectCollision(ITEM_INFO* item, short angle, int distance, int height = 0, int side = 0);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -2,10 +2,10 @@
|
|||
#include "Game/Lara/lara_struct.h"
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct CollisionInfo;
|
||||
|
||||
// -----------------------------
|
||||
// CRAWL & CROUCH
|
||||
// CROUCH & CRAWL
|
||||
// Control & Collision Functions
|
||||
// -----------------------------
|
||||
|
||||
|
@ -13,27 +13,27 @@ struct COLL_INFO;
|
|||
// CROUCH:
|
||||
// -------
|
||||
|
||||
void lara_as_crouch_idle(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_crouch_idle(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_crouch_roll(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_crouch_roll(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_crouch_turn_left(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_crouch_turn_left(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_crouch_turn_right(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_crouch_turn_right(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_crouch_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_crouch_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_crouch_roll(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_crouch_roll(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_crouch_turn_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_crouch_turn_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_crouch_turn_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_crouch_turn_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
// ------
|
||||
// CRAWL:
|
||||
// ------
|
||||
|
||||
void lara_as_crawl_idle(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_crawl_idle(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_crawl_forward(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_crawl_forward(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_crawl_back(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_crawl_back(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_crawl_turn_left(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_crawl_turn_left(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_crawl_turn_right(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_crawl_turn_right(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_crawl_to_hang(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_crawl_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_crawl_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_crawl_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_crawl_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_crawl_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_crawl_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_crawl_turn_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_crawl_turn_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_crawl_turn_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_crawl_turn_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_crawl_to_hang(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -2,57 +2,60 @@
|
|||
#include "Game/Lara/lara.h"
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct CollisionInfo;
|
||||
|
||||
constexpr auto MAX_TARGETS = 8;
|
||||
|
||||
enum FireWeaponType
|
||||
enum class FireWeaponType
|
||||
{
|
||||
FW_MISS = -1,
|
||||
FW_NOAMMO = 0,
|
||||
FW_MAYBEHIT = 1
|
||||
Miss = -1,
|
||||
NoAmmo = 0,
|
||||
PossibleHit = 1
|
||||
};
|
||||
|
||||
struct WEAPON_INFO
|
||||
struct WeaponInfo
|
||||
{
|
||||
short lockAngles[4];
|
||||
short leftAngles[4];
|
||||
short rightAngles[4];
|
||||
short aimSpeed;
|
||||
short shotAccuracy;
|
||||
short gunHeight;
|
||||
short targetDist;
|
||||
byte damage;
|
||||
byte recoilFrame;
|
||||
byte flashTime;
|
||||
byte drawFrame;
|
||||
short sampleNum;
|
||||
byte explosiveDamage;
|
||||
short LockAngles[4];
|
||||
short LeftAngles[4];
|
||||
short RightAngles[4];
|
||||
int AimSpeed;
|
||||
short ShotAccuracy;
|
||||
int GunHeight;
|
||||
short TargetDist;
|
||||
byte Damage;
|
||||
byte RecoilFrame;
|
||||
byte FlashTime;
|
||||
byte DrawFrame;
|
||||
short SampleNum;
|
||||
byte ExplosiveDamage;
|
||||
};
|
||||
|
||||
enum WeaponState {
|
||||
WSTATE_AIM =0,
|
||||
WSTATE_DRAW = 1,
|
||||
WSTATE_RECOIL = 2,
|
||||
WSTATE_UNAIM = 4,
|
||||
WSTATE_UW_AIM = 6,
|
||||
WSTATE_UW_UNAIM = 7,
|
||||
WSTATE_UW_RECOIL = 8
|
||||
enum WeaponState
|
||||
{
|
||||
WEAPON_STATE_AIM = 0,
|
||||
WEAPON_STATE_DRAW = 1,
|
||||
WEAPON_STATE_RECOIL = 2,
|
||||
// 3?
|
||||
WEAPON_STATE_UNAIM = 4,
|
||||
// 5?
|
||||
WEAPON_STATE_UNDERWATER_AIM = 6,
|
||||
WEAPON_STATE_UNDERWATER_UNAIM = 7,
|
||||
WEAPON_STATE_UNDERWATER_RECOIL = 8
|
||||
};
|
||||
|
||||
extern WEAPON_INFO Weapons[static_cast<int>(LARA_WEAPON_TYPE::NUM_WEAPONS)];
|
||||
extern WeaponInfo Weapons[(int)LaraWeaponType::NumWeapons];
|
||||
|
||||
void SmashItem(short itemNum);
|
||||
GAME_OBJECT_ID WeaponObject(int weaponType);
|
||||
GAME_OBJECT_ID WeaponObject(LaraWeaponType weaponType);
|
||||
void LaraGun(ITEM_INFO* laraItem);
|
||||
Ammo& GetAmmo(ITEM_INFO* lara, int weaponType);
|
||||
void InitialiseNewWeapon(ITEM_INFO* lara);
|
||||
GAME_OBJECT_ID WeaponObjectMesh(ITEM_INFO* lara, int weaponType);
|
||||
void AimWeapon(ITEM_INFO* lara, WEAPON_INFO* winfo, LARA_ARM* arm);
|
||||
void HitTarget(ITEM_INFO* lara, ITEM_INFO* target, GAME_VECTOR* hitPos, int damage, int flag);
|
||||
FireWeaponType FireWeapon(LARA_WEAPON_TYPE weaponType, ITEM_INFO* target, ITEM_INFO* src, short* angles);
|
||||
void find_target_point(ITEM_INFO* item, GAME_VECTOR* target);
|
||||
void LaraTargetInfo(ITEM_INFO* lara, WEAPON_INFO* weapon);
|
||||
bool CheckForHoldingState(int state);
|
||||
void LaraGetNewTarget(ITEM_INFO* lara, WEAPON_INFO* weapon);
|
||||
HOLSTER_SLOT HolsterSlotForWeapon(LARA_WEAPON_TYPE weapon);
|
||||
Ammo& GetAmmo(ITEM_INFO* laraItem, LaraWeaponType weaponType);
|
||||
void InitialiseNewWeapon(ITEM_INFO* laraItem);
|
||||
GAME_OBJECT_ID WeaponObjectMesh(ITEM_INFO* laraItem, LaraWeaponType weaponType);
|
||||
void AimWeapon(ITEM_INFO* laraItem, WeaponInfo* weaponInfo, ArmInfo* arm);
|
||||
void HitTarget(ITEM_INFO* laraItem, ITEM_INFO* target, GameVector* hitPos, int damage, int flag);
|
||||
FireWeaponType FireWeapon(LaraWeaponType weaponType, ITEM_INFO* target, ITEM_INFO* src, short* angles);
|
||||
void FindTargetPoint(ITEM_INFO* laraItem, GameVector* target);
|
||||
void LaraTargetInfo(ITEM_INFO* laraItem, WeaponInfo* weaponInfo);
|
||||
bool CheckForHoldingState(LaraState state);
|
||||
void LaraGetNewTarget(ITEM_INFO* laraItem, WeaponInfo* weaponInfo);
|
||||
HolsterSlot HolsterSlotForWeapon(LaraWeaponType weaponType);
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "Game/items.h"
|
||||
#include "Game/Lara/lara.h"
|
||||
#include "Game/Lara/lara_fire.h"
|
||||
#include "Game/Lara/lara_helpers.h"
|
||||
#include "Game/Lara/lara_tests.h"
|
||||
#include "Sound/sound.h"
|
||||
#include "Specific/level.h"
|
||||
|
@ -16,155 +17,153 @@
|
|||
|
||||
using namespace TEN::Math::Random;
|
||||
|
||||
constexpr DirectX::SimpleMath::Vector3 FlareMainColor = Vector3(1, 0.52947, 0.3921);
|
||||
constexpr auto FlareMainColor = Vector3(1, 0.52947, 0.3921);
|
||||
|
||||
void FlareControl(short itemNum)
|
||||
void FlareControl(short itemNumber)
|
||||
{
|
||||
ITEM_INFO* flareItem = &g_Level.Items[itemNum];
|
||||
auto* flareItem = &g_Level.Items[itemNumber];
|
||||
|
||||
if (TestLaraSwamp(flareItem))
|
||||
if (TestEnvironment(ENV_FLAG_SWAMP, flareItem))
|
||||
{
|
||||
KillItem(itemNum);
|
||||
KillItem(itemNumber);
|
||||
return;
|
||||
}
|
||||
|
||||
if (flareItem->fallspeed)
|
||||
if (flareItem->Animation.VerticalVelocity)
|
||||
{
|
||||
flareItem->pos.xRot += ANGLE(3.0f);
|
||||
flareItem->pos.zRot += ANGLE(5.0f);
|
||||
flareItem->Pose.Orientation.x += ANGLE(3.0f);
|
||||
flareItem->Pose.Orientation.z += ANGLE(5.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
flareItem->pos.xRot = 0;
|
||||
flareItem->pos.zRot = 0;
|
||||
flareItem->Pose.Orientation.x = 0;
|
||||
flareItem->Pose.Orientation.z = 0;
|
||||
}
|
||||
|
||||
PHD_VECTOR oldPos = { flareItem->pos.xPos , flareItem->pos.yPos , flareItem->pos.zPos };
|
||||
auto oldPos = flareItem->Pose.Position;
|
||||
|
||||
int xVel = flareItem->speed * phd_sin(flareItem->pos.yRot);
|
||||
int zVel = flareItem->speed * phd_cos(flareItem->pos.yRot);
|
||||
int xVel = flareItem->Animation.Velocity * phd_sin(flareItem->Pose.Orientation.y);
|
||||
int zVel = flareItem->Animation.Velocity * phd_cos(flareItem->Pose.Orientation.y);
|
||||
|
||||
flareItem->pos.xPos += xVel;
|
||||
flareItem->pos.zPos += zVel;
|
||||
flareItem->Pose.Position.x += xVel;
|
||||
flareItem->Pose.Position.z += zVel;
|
||||
|
||||
if (TestLaraWater(flareItem) || TestLaraSwamp(flareItem)) // TODO: Generic water/swamp test function.
|
||||
if (TestEnvironment(ENV_FLAG_WATER, flareItem) ||
|
||||
TestEnvironment(ENV_FLAG_SWAMP, flareItem))
|
||||
{
|
||||
flareItem->fallspeed += (5 - flareItem->fallspeed) / 2;
|
||||
flareItem->speed += (5 - flareItem->speed) / 2;
|
||||
flareItem->Animation.VerticalVelocity += (5 - flareItem->Animation.VerticalVelocity) / 2;
|
||||
flareItem->Animation.Velocity += (5 - flareItem->Animation.Velocity) / 2;
|
||||
}
|
||||
else
|
||||
flareItem->fallspeed += 6;
|
||||
flareItem->Animation.VerticalVelocity += 6;
|
||||
|
||||
flareItem->pos.yPos += flareItem->fallspeed;
|
||||
flareItem->Pose.Position.y += flareItem->Animation.VerticalVelocity;
|
||||
|
||||
DoProjectileDynamics(itemNum, oldPos.x, oldPos.y, oldPos.z, xVel, flareItem->fallspeed, zVel);
|
||||
DoProjectileDynamics(itemNumber, oldPos.x, oldPos.y, oldPos.z, xVel, flareItem->Animation.VerticalVelocity, zVel);
|
||||
|
||||
short& age = flareItem->data;
|
||||
age &= 0x7FFF;
|
||||
if (age >= FLARE_AGE)
|
||||
int& life = flareItem->Data;
|
||||
life &= 0x7FFF;
|
||||
if (life >= FLARE_LIFE_MAX)
|
||||
{
|
||||
if (!flareItem->fallspeed && !flareItem->speed)
|
||||
if (!flareItem->Animation.VerticalVelocity && !flareItem->Animation.Velocity)
|
||||
{
|
||||
KillItem(itemNum);
|
||||
KillItem(itemNumber);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
age++;
|
||||
life++;
|
||||
|
||||
if (DoFlareLight((PHD_VECTOR*)&flareItem->pos, age))
|
||||
if (DoFlareLight((Vector3Int*)&flareItem->Pose, life))
|
||||
{
|
||||
TriggerChaffEffects(flareItem,age);
|
||||
TriggerChaffEffects(flareItem, life);
|
||||
/* Hardcoded code */
|
||||
|
||||
age |= 0x8000;
|
||||
life |= 0x8000;
|
||||
}
|
||||
}
|
||||
|
||||
void ReadyFlare(ITEM_INFO* laraItem)
|
||||
{
|
||||
LaraInfo*& laraInfo = laraItem->data;
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
|
||||
laraInfo->gunStatus = LG_HANDS_FREE;
|
||||
laraInfo->leftArm.xRot = 0;
|
||||
laraInfo->leftArm.yRot = 0;
|
||||
laraInfo->leftArm.zRot = 0;
|
||||
laraInfo->rightArm.xRot = 0;
|
||||
laraInfo->rightArm.yRot = 0;
|
||||
laraInfo->rightArm.zRot = 0;
|
||||
laraInfo->leftArm.lock = false;
|
||||
laraInfo->rightArm.lock = false;
|
||||
laraInfo->target = NULL;
|
||||
lara->Control.HandStatus = HandStatus::Free;
|
||||
lara->LeftArm.Rotation = Vector3Shrt();
|
||||
lara->RightArm.Rotation = Vector3Shrt();
|
||||
lara->LeftArm.Locked = false;
|
||||
lara->RightArm.Locked = false;
|
||||
lara->TargetEntity = NULL;
|
||||
}
|
||||
|
||||
void UndrawFlareMeshes(ITEM_INFO* laraItem)
|
||||
{
|
||||
LaraInfo*& laraInfo = laraItem->data;
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
|
||||
laraInfo->meshPtrs[LM_LHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_LHAND;
|
||||
lara->MeshPtrs[LM_LHAND] = Objects[ID_LARA_SKIN].meshIndex + LM_LHAND;
|
||||
}
|
||||
|
||||
void DrawFlareMeshes(ITEM_INFO* laraItem)
|
||||
{
|
||||
LaraInfo*& laraInfo = laraItem->data;
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
|
||||
laraInfo->meshPtrs[LM_LHAND] = Objects[ID_LARA_FLARE_ANIM].meshIndex + LM_LHAND;
|
||||
lara->MeshPtrs[LM_LHAND] = Objects[ID_LARA_FLARE_ANIM].meshIndex + LM_LHAND;
|
||||
}
|
||||
|
||||
void UndrawFlare(ITEM_INFO* laraItem)
|
||||
{
|
||||
LaraInfo*& laraInfo = laraItem->data;
|
||||
int flareFrame = laraInfo->flareFrame;
|
||||
int armFrame = laraInfo->leftArm.frameNumber;
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
|
||||
laraInfo->flareControlLeft = true;
|
||||
int flareFrame = lara->Flare.Frame;
|
||||
int armFrame = lara->LeftArm.FrameNumber;
|
||||
|
||||
if (laraItem->goalAnimState == LS_IDLE &&
|
||||
laraInfo->Vehicle == NO_ITEM)
|
||||
lara->Flare.ControlLeft = true;
|
||||
|
||||
if (laraItem->Animation.TargetState == LS_IDLE &&
|
||||
lara->Vehicle == NO_ITEM)
|
||||
{
|
||||
if (laraItem->animNumber == LA_STAND_IDLE)
|
||||
if (laraItem->Animation.AnimNumber == LA_STAND_IDLE)
|
||||
{
|
||||
laraItem->animNumber = LA_DISCARD_FLARE;
|
||||
flareFrame = armFrame + g_Level.Anims[laraItem->animNumber].frameBase;
|
||||
laraInfo->flareFrame = flareFrame;
|
||||
laraItem->frameNumber = flareFrame;
|
||||
laraItem->Animation.AnimNumber = LA_DISCARD_FLARE;
|
||||
flareFrame = armFrame + g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||
laraItem->Animation.FrameNumber = flareFrame;
|
||||
lara->Flare.Frame = flareFrame;
|
||||
}
|
||||
|
||||
if (laraItem->animNumber == LA_DISCARD_FLARE)
|
||||
if (laraItem->Animation.AnimNumber == LA_DISCARD_FLARE)
|
||||
{
|
||||
laraInfo->flareControlLeft = false;
|
||||
lara->Flare.ControlLeft = false;
|
||||
|
||||
if (flareFrame >= g_Level.Anims[laraItem->animNumber].frameBase + 31) // Last frame.
|
||||
if (flareFrame >= g_Level.Anims[laraItem->Animation.AnimNumber].frameBase + 31) // Last frame.
|
||||
{
|
||||
laraInfo->requestGunType = laraInfo->lastGunType;
|
||||
laraInfo->gunType = laraInfo->lastGunType;
|
||||
laraInfo->gunStatus = LG_HANDS_FREE;
|
||||
lara->Control.Weapon.RequestGunType = lara->Control.Weapon.LastGunType;
|
||||
lara->Control.Weapon.GunType = lara->Control.Weapon.LastGunType;
|
||||
lara->Control.HandStatus = HandStatus::Free;
|
||||
|
||||
InitialiseNewWeapon(laraItem);
|
||||
|
||||
laraInfo->target = NULL;
|
||||
laraInfo->rightArm.lock = false;
|
||||
laraInfo->leftArm.lock = false;
|
||||
lara->TargetEntity = NULL;
|
||||
lara->RightArm.Locked = false;
|
||||
lara->LeftArm.Locked = false;
|
||||
SetAnimation(laraItem, LA_STAND_IDLE);
|
||||
laraInfo->flareFrame = g_Level.Anims[laraItem->animNumber].frameBase;
|
||||
lara->Flare.Frame = g_Level.Anims[laraItem->Animation.AnimNumber].frameBase;
|
||||
return;
|
||||
}
|
||||
|
||||
laraInfo->flareFrame++;
|
||||
lara->Flare.Frame++;
|
||||
}
|
||||
}
|
||||
else if (laraItem->animNumber == LA_DISCARD_FLARE)
|
||||
else if (laraItem->Animation.AnimNumber == LA_DISCARD_FLARE)
|
||||
SetAnimation(laraItem, LA_STAND_IDLE);
|
||||
|
||||
if (armFrame >= 33 && armFrame < 72)
|
||||
{
|
||||
armFrame = 2;
|
||||
DoFlareInHand(laraItem, laraInfo->flareAge);
|
||||
DoFlareInHand(laraItem, lara->Flare.Life);
|
||||
}
|
||||
else if (!armFrame)
|
||||
{
|
||||
armFrame = 1;
|
||||
DoFlareInHand(laraItem, laraInfo->flareAge);
|
||||
DoFlareInHand(laraItem, lara->Flare.Life);
|
||||
}
|
||||
else if (armFrame >= 72 && armFrame < 95)
|
||||
{
|
||||
|
@ -173,7 +172,7 @@ void UndrawFlare(ITEM_INFO* laraItem)
|
|||
if (armFrame == 94)
|
||||
{
|
||||
armFrame = 1;
|
||||
DoFlareInHand(laraItem, laraInfo->flareAge);
|
||||
DoFlareInHand(laraItem, lara->Flare.Life);
|
||||
}
|
||||
}
|
||||
else if (armFrame >= 1 && armFrame < 33)
|
||||
|
@ -184,25 +183,26 @@ void UndrawFlare(ITEM_INFO* laraItem)
|
|||
{
|
||||
CreateFlare(laraItem, ID_FLARE_ITEM, true);
|
||||
UndrawFlareMeshes(laraItem);
|
||||
laraInfo->flareAge = 0;
|
||||
lara->Flare.Life = 0;
|
||||
}
|
||||
else if (armFrame == 33)
|
||||
{
|
||||
armFrame = 0;
|
||||
laraInfo->requestGunType = laraInfo->lastGunType;
|
||||
laraInfo->gunType = laraInfo->lastGunType;
|
||||
laraInfo->gunStatus = LG_HANDS_FREE;
|
||||
|
||||
lara->Control.Weapon.RequestGunType = lara->Control.Weapon.LastGunType;
|
||||
lara->Control.Weapon.GunType = lara->Control.Weapon.LastGunType;
|
||||
lara->Control.HandStatus = HandStatus::Free;
|
||||
|
||||
InitialiseNewWeapon(laraItem);
|
||||
|
||||
laraInfo->flareControlLeft = false;
|
||||
laraInfo->target = NULL;
|
||||
laraInfo->rightArm.lock = false;
|
||||
laraInfo->leftArm.lock = false;
|
||||
laraInfo->flareFrame = 0;
|
||||
lara->TargetEntity = NULL;
|
||||
lara->LeftArm.Locked = false;
|
||||
lara->RightArm.Locked = false;
|
||||
lara->Flare.ControlLeft = false;
|
||||
lara->Flare.Frame = 0;
|
||||
}
|
||||
else if (armFrame < 21)
|
||||
DoFlareInHand(laraItem, laraInfo->flareAge);
|
||||
DoFlareInHand(laraItem, lara->Flare.Life);
|
||||
}
|
||||
else if (armFrame >= 95 && armFrame < 110)
|
||||
{
|
||||
|
@ -211,30 +211,30 @@ void UndrawFlare(ITEM_INFO* laraItem)
|
|||
if (armFrame == 110)
|
||||
{
|
||||
armFrame = 1;
|
||||
DoFlareInHand(laraItem, laraInfo->flareAge);
|
||||
DoFlareInHand(laraItem, lara->Flare.Life);
|
||||
}
|
||||
}
|
||||
|
||||
laraInfo->leftArm.frameNumber = armFrame;
|
||||
SetFlareArm(laraItem, laraInfo->leftArm.frameNumber);
|
||||
lara->LeftArm.FrameNumber = armFrame;
|
||||
SetFlareArm(laraItem, lara->LeftArm.FrameNumber);
|
||||
}
|
||||
|
||||
void DrawFlare(ITEM_INFO* laraItem)
|
||||
{
|
||||
LaraInfo*& laraInfo = laraItem->data;
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
|
||||
if (laraItem->currentAnimState == LS_PICKUP_FLARE ||
|
||||
laraItem->currentAnimState == LS_PICKUP)
|
||||
if (laraItem->Animation.ActiveState == LS_PICKUP_FLARE ||
|
||||
laraItem->Animation.ActiveState == LS_PICKUP)
|
||||
{
|
||||
DoFlareInHand(laraItem, laraInfo->flareAge);
|
||||
laraInfo->flareControlLeft = false;
|
||||
laraInfo->leftArm.frameNumber = 93;
|
||||
DoFlareInHand(laraItem, lara->Flare.Life);
|
||||
lara->Flare.ControlLeft = false;
|
||||
lara->LeftArm.FrameNumber = 93;
|
||||
SetFlareArm(laraItem, 93);
|
||||
}
|
||||
else
|
||||
{
|
||||
int armFrame = laraInfo->leftArm.frameNumber + 1;
|
||||
laraInfo->flareControlLeft = true;
|
||||
int armFrame = lara->LeftArm.FrameNumber + 1;
|
||||
lara->Flare.ControlLeft = true;
|
||||
|
||||
if (armFrame < 33 || armFrame > 94)
|
||||
armFrame = 33;
|
||||
|
@ -244,11 +244,11 @@ void DrawFlare(ITEM_INFO* laraItem)
|
|||
{
|
||||
if (armFrame == 72)
|
||||
{
|
||||
SoundEffect(SFX_TR4_OBJ_GEM_SMASH, &laraItem->pos, TestLaraWater(laraItem));
|
||||
laraInfo->flareAge = 1;
|
||||
SoundEffect(SFX_TR4_OBJ_GEM_SMASH, &laraItem->Pose, TestEnvironment(ENV_FLAG_WATER, laraItem));
|
||||
lara->Flare.Life = 1;
|
||||
}
|
||||
|
||||
DoFlareInHand(laraItem, laraInfo->flareAge);
|
||||
DoFlareInHand(laraItem, lara->Flare.Life);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -256,18 +256,18 @@ void DrawFlare(ITEM_INFO* laraItem)
|
|||
{
|
||||
ReadyFlare(laraItem);
|
||||
armFrame = 0;
|
||||
DoFlareInHand(laraItem, laraInfo->flareAge);
|
||||
DoFlareInHand(laraItem, lara->Flare.Life);
|
||||
}
|
||||
}
|
||||
|
||||
laraInfo->leftArm.frameNumber = armFrame;
|
||||
lara->LeftArm.FrameNumber = armFrame;
|
||||
SetFlareArm(laraItem, armFrame);
|
||||
}
|
||||
}
|
||||
|
||||
void SetFlareArm(ITEM_INFO* laraItem, int armFrame)
|
||||
{
|
||||
LaraInfo*& laraInfo = laraItem->data;
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
int flareAnimNum = Objects[ID_LARA_FLARE_ANIM].animIndex;
|
||||
|
||||
if (armFrame >= 95)
|
||||
|
@ -279,82 +279,84 @@ void SetFlareArm(ITEM_INFO* laraItem, int armFrame)
|
|||
else if (armFrame >= 1)
|
||||
flareAnimNum += 1;
|
||||
|
||||
laraInfo->leftArm.animNumber = flareAnimNum;
|
||||
laraInfo->leftArm.frameBase = g_Level.Anims[flareAnimNum].framePtr;
|
||||
lara->LeftArm.AnimNumber = flareAnimNum;
|
||||
lara->LeftArm.FrameBase = g_Level.Anims[flareAnimNum].framePtr;
|
||||
}
|
||||
|
||||
void CreateFlare(ITEM_INFO* laraItem, GAME_OBJECT_ID objectNum, bool thrown)
|
||||
void CreateFlare(ITEM_INFO* laraItem, GAME_OBJECT_ID objectNumber, bool thrown)
|
||||
{
|
||||
LaraInfo*& laraInfo = laraItem->data;
|
||||
auto itemNum = CreateItem();
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
auto itemNumber = CreateItem();
|
||||
|
||||
if (itemNum != NO_ITEM)
|
||||
if (itemNumber != NO_ITEM)
|
||||
{
|
||||
ITEM_INFO* flareItem = &g_Level.Items[itemNum];
|
||||
auto* flareItem = &g_Level.Items[itemNumber];
|
||||
bool flag = false;
|
||||
flareItem->objectNumber = objectNum;
|
||||
flareItem->roomNumber = laraItem->roomNumber;
|
||||
|
||||
PHD_VECTOR pos = { -16, 32, 42 };
|
||||
flareItem->ObjectNumber = objectNumber;
|
||||
flareItem->RoomNumber = laraItem->RoomNumber;
|
||||
|
||||
auto pos = Vector3Int (-16, 32, 42);
|
||||
GetLaraJointPosition(&pos, LM_LHAND);
|
||||
|
||||
flareItem->pos.xPos = pos.x;
|
||||
flareItem->pos.yPos = pos.y;
|
||||
flareItem->pos.zPos = pos.z;
|
||||
flareItem->Pose.Position.x = pos.x;
|
||||
flareItem->Pose.Position.y = pos.y;
|
||||
flareItem->Pose.Position.z = pos.z;
|
||||
|
||||
auto probe = GetCollisionResult(pos.x, pos.y, pos.z, laraItem->roomNumber);
|
||||
int floorHeight = GetCollision(pos.x, pos.y, pos.z, laraItem->RoomNumber).Position.Floor;
|
||||
auto collided = GetCollidedObjects(flareItem, 0, true, CollidedItems, CollidedMeshes, true);
|
||||
if (probe.Position.Floor < pos.y || collided)
|
||||
if (floorHeight < pos.y || collided)
|
||||
{
|
||||
flag = true;
|
||||
flareItem->pos.yRot = laraItem->pos.yRot + ANGLE(180.0f);
|
||||
flareItem->pos.xPos = laraItem->pos.xPos + 320 * phd_sin(flareItem->pos.yRot);
|
||||
flareItem->pos.zPos = laraItem->pos.zPos + 320 * phd_cos(flareItem->pos.yRot);
|
||||
flareItem->roomNumber = laraItem->roomNumber;
|
||||
flareItem->Pose.Orientation.y = laraItem->Pose.Orientation.y + ANGLE(180.0f);
|
||||
flareItem->Pose.Position.x = laraItem->Pose.Position.x + 320 * phd_sin(flareItem->Pose.Orientation.y);
|
||||
flareItem->Pose.Position.z = laraItem->Pose.Position.z + 320 * phd_cos(flareItem->Pose.Orientation.y);
|
||||
flareItem->RoomNumber = laraItem->RoomNumber;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (thrown)
|
||||
flareItem->pos.yRot = laraItem->pos.yRot;
|
||||
flareItem->Pose.Orientation.y = laraItem->Pose.Orientation.y;
|
||||
else
|
||||
flareItem->pos.yRot = laraItem->pos.yRot - ANGLE(45.0f);
|
||||
flareItem->roomNumber = laraItem->roomNumber;
|
||||
flareItem->Pose.Orientation.y = laraItem->Pose.Orientation.y - ANGLE(45.0f);
|
||||
|
||||
flareItem->RoomNumber = laraItem->RoomNumber;
|
||||
}
|
||||
|
||||
InitialiseItem(itemNum);
|
||||
InitialiseItem(itemNumber);
|
||||
|
||||
flareItem->pos.xRot = 0;
|
||||
flareItem->pos.zRot = 0;
|
||||
flareItem->shade = -1;
|
||||
flareItem->Pose.Orientation.x = 0;
|
||||
flareItem->Pose.Orientation.z = 0;
|
||||
flareItem->Shade = -1;
|
||||
|
||||
if (thrown)
|
||||
{
|
||||
flareItem->speed = laraItem->speed + 50;
|
||||
flareItem->fallspeed = laraItem->fallspeed - 50;
|
||||
flareItem->Animation.Velocity = laraItem->Animation.Velocity + 50;
|
||||
flareItem->Animation.VerticalVelocity = laraItem->Animation.VerticalVelocity - 50;
|
||||
}
|
||||
else
|
||||
{
|
||||
flareItem->speed = laraItem->speed + 10;
|
||||
flareItem->fallspeed = laraItem->fallspeed + 50;
|
||||
flareItem->Animation.Velocity = laraItem->Animation.Velocity + 10;
|
||||
flareItem->Animation.VerticalVelocity = laraItem->Animation.VerticalVelocity + 50;
|
||||
}
|
||||
|
||||
if (flag)
|
||||
flareItem->speed >>= 1;
|
||||
flareItem->Animation.Velocity /= 2;
|
||||
|
||||
if (objectNum == ID_FLARE_ITEM)
|
||||
if (objectNumber == ID_FLARE_ITEM)
|
||||
{
|
||||
flareItem->data = (short)0;
|
||||
short& age = flareItem->data;
|
||||
if (DoFlareLight((PHD_VECTOR*)&flareItem->pos, laraInfo->flareAge))
|
||||
age = (laraInfo->flareAge | 0x8000);
|
||||
flareItem->Data = (int)0;
|
||||
int& life = flareItem->Data;
|
||||
if (DoFlareLight((Vector3Int*)&flareItem->Pose, lara->Flare.Life))
|
||||
life = lara->Flare.Life | 0x8000;
|
||||
else
|
||||
age = (laraInfo->flareAge & 0x7FFF);
|
||||
life = lara->Flare.Life & 0x7FFF;
|
||||
}
|
||||
else
|
||||
flareItem->itemFlags[3] = laraInfo->litTorch;
|
||||
flareItem->ItemFlags[3] = lara->LitTorch;
|
||||
|
||||
AddActiveItem(itemNum);
|
||||
flareItem->status = ITEM_ACTIVE;
|
||||
AddActiveItem(itemNumber);
|
||||
flareItem->Status = ITEM_ACTIVE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -363,73 +365,70 @@ void DrawFlareInAir(ITEM_INFO* flareItem)
|
|||
TENLog("DrawFlareInAir() not implemented!", LogLevel::Warning);
|
||||
}
|
||||
|
||||
void DoFlareInHand(ITEM_INFO* laraItem, int flareAge)
|
||||
void DoFlareInHand(ITEM_INFO* laraItem, int flareLife)
|
||||
{
|
||||
LaraInfo*& ItemInfo = laraItem->data;
|
||||
auto* lara = GetLaraInfo(laraItem);
|
||||
|
||||
PHD_VECTOR pos = { 11, 32, 41 };
|
||||
auto pos = Vector3Int(11, 32, 41);
|
||||
GetLaraJointPosition(&pos, LM_LHAND);
|
||||
|
||||
if (DoFlareLight(&pos, flareAge))
|
||||
TriggerChaffEffects(flareAge);
|
||||
if (DoFlareLight(&pos, flareLife))
|
||||
TriggerChaffEffects(flareLife);
|
||||
|
||||
/* Hardcoded code */
|
||||
|
||||
if (ItemInfo->flareAge >= FLARE_AGE)
|
||||
if (lara->Flare.Life >= FLARE_LIFE_MAX)
|
||||
{
|
||||
if (ItemInfo->gunStatus == LG_HANDS_FREE)
|
||||
ItemInfo->gunStatus = LG_UNDRAW_GUNS;
|
||||
if (lara->Control.HandStatus == HandStatus::Free)
|
||||
lara->Control.HandStatus = HandStatus::WeaponUndraw;
|
||||
}
|
||||
else if (ItemInfo->flareAge != 0)
|
||||
ItemInfo->flareAge++;
|
||||
else if (lara->Flare.Life != 0)
|
||||
lara->Flare.Life++;
|
||||
}
|
||||
|
||||
int DoFlareLight(PHD_VECTOR* pos, int age)
|
||||
int DoFlareLight(Vector3Int* pos, int flareLife)
|
||||
{
|
||||
int r, g, b;
|
||||
int falloff;
|
||||
|
||||
if (age >= FLARE_AGE || age == 0)
|
||||
if (flareLife >= FLARE_LIFE_MAX || flareLife == 0)
|
||||
return 0;
|
||||
|
||||
auto random = GenerateFloat();
|
||||
float random = GenerateFloat();
|
||||
|
||||
int x = pos->x + (random * 120);
|
||||
int y = pos->y + (random * 120) - 256;
|
||||
int y = pos->y + (random * 120) - CLICK(1);
|
||||
int z = pos->z + (random * 120);
|
||||
|
||||
if (age < 4)
|
||||
if (flareLife < 4)
|
||||
{
|
||||
falloff = 12 + ((1 - (age / 4.0f)) * 16);
|
||||
|
||||
r = FlareMainColor.x * 255;
|
||||
g = FlareMainColor.y * 255;
|
||||
b = FlareMainColor.z * 255;
|
||||
int falloff = 12 + ((1 - (flareLife / 4.0f)) * 16);
|
||||
|
||||
int r = FlareMainColor.x * 255;
|
||||
int g = FlareMainColor.y * 255;
|
||||
int b = FlareMainColor.z * 255;
|
||||
|
||||
TriggerDynamicLight(x, y, z, falloff, r, g, b);
|
||||
|
||||
return (random < 0.9f);
|
||||
}
|
||||
else if (age < (FLARE_AGE - 90))
|
||||
else if (flareLife < (FLARE_LIFE_MAX - 90))
|
||||
{
|
||||
auto multiplier = GenerateFloat(0.75f, 1.0f);
|
||||
falloff = 12 * multiplier;
|
||||
float multiplier = GenerateFloat(0.75f, 1.0f);
|
||||
int falloff = 12 * multiplier;
|
||||
|
||||
r = FlareMainColor.x * 255 * multiplier;
|
||||
g = FlareMainColor.y * 255 * multiplier;
|
||||
b = FlareMainColor.z * 255 * multiplier;
|
||||
int r = FlareMainColor.x * 255 * multiplier;
|
||||
int g = FlareMainColor.y * 255 * multiplier;
|
||||
int b = FlareMainColor.z * 255 * multiplier;
|
||||
TriggerDynamicLight(x, y, z, falloff, r, g, b);
|
||||
|
||||
return (random < 0.4f);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
auto multiplier = GenerateFloat(0.05f, 0.8f);
|
||||
falloff = 12 * (1.0f - ((age - (FLARE_AGE - 90)) / (FLARE_AGE - (FLARE_AGE - 90))));
|
||||
float multiplier = GenerateFloat(0.05f, 0.8f);
|
||||
int falloff = 12 * (1.0f - ((flareLife - (FLARE_LIFE_MAX - 90)) / (FLARE_LIFE_MAX - (FLARE_LIFE_MAX - 90))));
|
||||
|
||||
r = FlareMainColor.x * 255 * multiplier;
|
||||
g = FlareMainColor.y * 255 * multiplier;
|
||||
b = FlareMainColor.z * 255 * multiplier;
|
||||
int r = FlareMainColor.x * 255 * multiplier;
|
||||
int g = FlareMainColor.y * 255 * multiplier;
|
||||
int b = FlareMainColor.z * 255 * multiplier;
|
||||
TriggerDynamicLight(x, y, z, falloff, r, g, b);
|
||||
|
||||
return (random < 0.3f);
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
#pragma once
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct PHD_VECTOR;
|
||||
struct CollisionInfo;
|
||||
struct Vector3Int;
|
||||
enum GAME_OBJECT_ID : short;
|
||||
|
||||
constexpr auto FLARE_AGE = 60 * 30; // 60 * 30 frames = 60 seconds.
|
||||
constexpr auto FLARE_LIFE_MAX = 60 * 30; // 60 * 30 frames = 60 seconds.
|
||||
|
||||
void FlareControl(short itemNum);
|
||||
void FlareControl(short itemNumber);
|
||||
void ReadyFlare(ITEM_INFO* laraItem);
|
||||
void UndrawFlareMeshes(ITEM_INFO* laraItem);
|
||||
void DrawFlareMeshes(ITEM_INFO* laraItem);
|
||||
void UndrawFlare(ITEM_INFO* laraItem);
|
||||
void DrawFlare(ITEM_INFO* laraItem);
|
||||
void SetFlareArm(ITEM_INFO* laraItem, int armFrame);
|
||||
void CreateFlare(ITEM_INFO* laraItem, GAME_OBJECT_ID object, bool thrown);
|
||||
void CreateFlare(ITEM_INFO* laraItem, GAME_OBJECT_ID objectNumber, bool thrown);
|
||||
void DrawFlareInAir(ITEM_INFO* flareItem);
|
||||
void DoFlareInHand(ITEM_INFO* laraItem, int flareAge);
|
||||
int DoFlareLight(PHD_VECTOR* pos, int flareAge);
|
||||
void DoFlareInHand(ITEM_INFO* laraItem, int flareLife);
|
||||
int DoFlareLight(Vector3Int* pos, int flareLife);
|
||||
|
|
|
@ -6,96 +6,69 @@
|
|||
#include "Game/collision/collide_item.h"
|
||||
#include "Game/items.h"
|
||||
#include "Game/Lara/lara.h"
|
||||
#include "Game/Lara/lara_helpers.h"
|
||||
#include "Game/Lara/lara_overhang.h"
|
||||
#include "Game/Lara/lara_tests.h"
|
||||
#include "Specific/input.h"
|
||||
#include "Specific/level.h"
|
||||
|
||||
/*this file has all the lara_as/lara_col functions related to hanging*/
|
||||
// -----------------------------
|
||||
// LEDGE HANG
|
||||
// Control & Collision Functions
|
||||
// -----------------------------
|
||||
|
||||
void SetCornerAnim(ITEM_INFO* item, COLL_INFO* coll, bool flip)
|
||||
// State: LS_HANG (10)
|
||||
// Collision: lara_col_hang()
|
||||
void lara_as_hang(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
if (item->hitPoints <= 0)
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
lara->Control.IsClimbingLadder = false;
|
||||
|
||||
if (item->HitPoints <= 0)
|
||||
{
|
||||
SetAnimation(item, LA_FALL_START);
|
||||
|
||||
item->gravityStatus = true;
|
||||
item->speed = 2;
|
||||
item->pos.yPos += STEP_SIZE;
|
||||
item->fallspeed = 1;
|
||||
|
||||
Lara.gunStatus = LG_HANDS_FREE;
|
||||
|
||||
item->pos.yRot += Lara.nextCornerPos.yRot / 2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (flip)
|
||||
{
|
||||
if (Lara.isClimbing)
|
||||
{
|
||||
SetAnimation(item, LA_LADDER_IDLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAnimation(item, LA_REACH_TO_HANG, 21);
|
||||
}
|
||||
|
||||
coll->Setup.OldPosition.x = item->pos.xPos = Lara.nextCornerPos.xPos;
|
||||
coll->Setup.OldPosition.y = item->pos.yPos = Lara.nextCornerPos.yPos;
|
||||
coll->Setup.OldPosition.z = item->pos.zPos = Lara.nextCornerPos.zPos;
|
||||
item->pos.yRot = Lara.nextCornerPos.yRot;
|
||||
}
|
||||
}
|
||||
|
||||
/*normal hanging and shimmying*/
|
||||
void lara_as_hang(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
/*state 10*/
|
||||
/*collision: lara_col_hang*/
|
||||
Lara.isClimbing = false;
|
||||
|
||||
if (item->hitPoints <= 0)
|
||||
{
|
||||
item->goalAnimState = LS_IDLE;
|
||||
item->Animation.TargetState = LS_IDLE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (TrInput & IN_LOOK)
|
||||
LookUpDown();
|
||||
LookUpDown(item);
|
||||
|
||||
coll->Setup.EnableObjectPush = false;
|
||||
coll->Setup.EnableSpaz = false;
|
||||
coll->Setup.Mode = COLL_PROBE_MODE::FREE_FLAT;
|
||||
|
||||
coll->Setup.EnableSpasm = false;
|
||||
coll->Setup.Mode = CollisionProbeMode::FreeFlat;
|
||||
Camera.targetAngle = 0;
|
||||
Camera.targetElevation = -ANGLE(45.0f);
|
||||
}
|
||||
|
||||
void lara_col_hang(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_HANG (10)
|
||||
// Control: lara_as_hang()
|
||||
void lara_col_hang(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
/*state 10*/
|
||||
/*state code: lara_as_hang*/
|
||||
item->fallspeed = 0;
|
||||
item->gravityStatus = false;
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (item->animNumber == LA_REACH_TO_HANG)
|
||||
item->Animation.Airborne = false;
|
||||
item->Animation.VerticalVelocity = 0;
|
||||
|
||||
if (item->Animation.AnimNumber == LA_REACH_TO_HANG ||
|
||||
item->Animation.AnimNumber == LA_HANG_IDLE)
|
||||
{
|
||||
if (TrInput & IN_LEFT || TrInput & IN_LSTEP)
|
||||
{
|
||||
if (TestLaraHangSideways(item, coll, -ANGLE(90.0f)))
|
||||
{
|
||||
item->goalAnimState = LS_SHIMMY_LEFT;
|
||||
item->Animation.TargetState = LS_SHIMMY_LEFT;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (TestLaraHangCorner(item, coll, -90.0f))
|
||||
{
|
||||
case CORNER_RESULT::INNER:
|
||||
item->goalAnimState = LS_SHIMMY_INNER_LEFT;
|
||||
case CornerType::Inner:
|
||||
item->Animation.TargetState = LS_SHIMMY_INNER_LEFT;
|
||||
return;
|
||||
|
||||
case CORNER_RESULT::OUTER:
|
||||
item->goalAnimState = LS_SHIMMY_OUTER_LEFT;
|
||||
case CornerType::Outer:
|
||||
item->Animation.TargetState = LS_SHIMMY_OUTER_LEFT;
|
||||
return;
|
||||
|
||||
default:
|
||||
|
@ -104,12 +77,12 @@ void lara_col_hang(ITEM_INFO* item, COLL_INFO* coll)
|
|||
|
||||
switch (TestLaraHangCorner(item, coll, -45.0f))
|
||||
{
|
||||
case CORNER_RESULT::INNER:
|
||||
item->goalAnimState = LS_SHIMMY_45_INNER_LEFT;
|
||||
case CornerType::Inner:
|
||||
item->Animation.TargetState = LS_SHIMMY_45_INNER_LEFT;
|
||||
return;
|
||||
|
||||
case CORNER_RESULT::OUTER:
|
||||
item->goalAnimState = LS_SHIMMY_45_OUTER_LEFT;
|
||||
case CornerType::Outer:
|
||||
item->Animation.TargetState = LS_SHIMMY_45_OUTER_LEFT;
|
||||
return;
|
||||
|
||||
default:
|
||||
|
@ -121,18 +94,18 @@ void lara_col_hang(ITEM_INFO* item, COLL_INFO* coll)
|
|||
{
|
||||
if (TestLaraHangSideways(item, coll, ANGLE(90.0f)))
|
||||
{
|
||||
item->goalAnimState = LS_SHIMMY_RIGHT;
|
||||
item->Animation.TargetState = LS_SHIMMY_RIGHT;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (TestLaraHangCorner(item, coll, 90.0f))
|
||||
{
|
||||
case CORNER_RESULT::INNER:
|
||||
item->goalAnimState = LS_SHIMMY_INNER_RIGHT;
|
||||
case CornerType::Inner:
|
||||
item->Animation.TargetState = LS_SHIMMY_INNER_RIGHT;
|
||||
return;
|
||||
|
||||
case CORNER_RESULT::OUTER:
|
||||
item->goalAnimState = LS_SHIMMY_OUTER_RIGHT;
|
||||
case CornerType::Outer:
|
||||
item->Animation.TargetState = LS_SHIMMY_OUTER_RIGHT;
|
||||
return;
|
||||
|
||||
default:
|
||||
|
@ -141,12 +114,12 @@ void lara_col_hang(ITEM_INFO* item, COLL_INFO* coll)
|
|||
|
||||
switch (TestLaraHangCorner(item, coll, 45.0f))
|
||||
{
|
||||
case CORNER_RESULT::INNER:
|
||||
item->goalAnimState = LS_SHIMMY_45_INNER_RIGHT;
|
||||
case CornerType::Inner:
|
||||
item->Animation.TargetState = LS_SHIMMY_45_INNER_RIGHT;
|
||||
return;
|
||||
|
||||
case CORNER_RESULT::OUTER:
|
||||
item->goalAnimState = LS_SHIMMY_45_OUTER_RIGHT;
|
||||
case CornerType::Outer:
|
||||
item->Animation.TargetState = LS_SHIMMY_45_OUTER_RIGHT;
|
||||
return;
|
||||
|
||||
default:
|
||||
|
@ -155,148 +128,143 @@ void lara_col_hang(ITEM_INFO* item, COLL_INFO* coll)
|
|||
}
|
||||
}
|
||||
|
||||
Lara.moveAngle = item->pos.yRot;
|
||||
lara->Control.MoveAngle = item->Pose.Orientation.y;
|
||||
|
||||
TestLaraHang(item, coll);
|
||||
|
||||
if (item->animNumber == LA_REACH_TO_HANG)
|
||||
if (item->Animation.AnimNumber == LA_REACH_TO_HANG ||
|
||||
item->Animation.AnimNumber == LA_HANG_IDLE)
|
||||
{
|
||||
TestForObjectOnLedge(item, coll);
|
||||
|
||||
if (TrInput & IN_FORWARD)
|
||||
{
|
||||
if (coll->Front.Floor > -850 && TestValidLedge(item, coll) && !coll->HitStatic)
|
||||
if (coll->Front.Floor > -(CLICK(3.5f) - 46) &&
|
||||
TestValidLedge(item, coll) && !coll->HitStatic)
|
||||
{
|
||||
if (coll->Front.Floor < -650 &&
|
||||
if (coll->Front.Floor < -(CLICK(2.5f) + 10) &&
|
||||
coll->Front.Floor >= coll->Front.Ceiling &&
|
||||
coll->FrontLeft.Floor >= coll->FrontLeft.Ceiling &&
|
||||
coll->FrontRight.Floor >= coll->FrontRight.Ceiling)
|
||||
{
|
||||
if (TrInput & IN_WALK)
|
||||
item->Animation.TargetState = LS_HANDSTAND;
|
||||
else if (TrInput & IN_CROUCH)
|
||||
{
|
||||
item->goalAnimState = LS_HANDSTAND;
|
||||
}
|
||||
else if (TrInput & IN_DUCK)
|
||||
{
|
||||
item->goalAnimState = LS_HANG_TO_CRAWL;
|
||||
item->requiredAnimState = LS_CROUCH_IDLE;
|
||||
item->Animation.TargetState = LS_HANG_TO_CRAWL;
|
||||
item->Animation.RequiredState = LS_CROUCH_IDLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->goalAnimState = LS_GRABBING;
|
||||
}
|
||||
item->Animation.TargetState = LS_GRABBING;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (coll->Front.Floor < -650 &&
|
||||
coll->Front.Floor - coll->Front.Ceiling >= -256 &&
|
||||
coll->FrontLeft.Floor - coll->FrontLeft.Ceiling >= -256 &&
|
||||
coll->FrontRight.Floor - coll->FrontRight.Ceiling >= -256)
|
||||
if (coll->Front.Floor < -(CLICK(2.5f) + 10) &&
|
||||
coll->Front.Floor - coll->Front.Ceiling >= -CLICK(1) &&
|
||||
coll->FrontLeft.Floor - coll->FrontLeft.Ceiling >= -CLICK(1) &&
|
||||
coll->FrontRight.Floor - coll->FrontRight.Ceiling >= -CLICK(1))
|
||||
{
|
||||
item->goalAnimState = LS_HANG_TO_CRAWL;
|
||||
item->requiredAnimState = LS_CROUCH_IDLE;
|
||||
|
||||
item->Animation.TargetState = LS_HANG_TO_CRAWL;
|
||||
item->Animation.RequiredState = LS_CROUCH_IDLE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Lara.climbStatus != 0 &&
|
||||
coll->Middle.Ceiling <= -256 &&
|
||||
if (lara->Control.CanClimbLadder &&
|
||||
coll->Middle.Ceiling <= -CLICK(1) &&
|
||||
abs(coll->FrontLeft.Ceiling - coll->FrontRight.Ceiling) < SLOPE_DIFFERENCE)
|
||||
{
|
||||
if (TestLaraClimbStance(item, coll))
|
||||
{
|
||||
item->goalAnimState = LS_LADDER_IDLE;
|
||||
}
|
||||
if (TestLaraClimbIdle(item, coll))
|
||||
item->Animation.TargetState = LS_LADDER_IDLE;
|
||||
else if (TestLastFrame(item))
|
||||
{
|
||||
SetAnimation(item, LA_LADDER_SHIMMY_UP);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (TrInput & IN_BACK &&
|
||||
Lara.climbStatus &&
|
||||
coll->Middle.Floor > 344 &&
|
||||
item->animNumber == LA_REACH_TO_HANG)
|
||||
if (TrInput & IN_BACK && lara->Control.CanClimbLadder &&
|
||||
coll->Middle.Floor > (CLICK(1.5f) - 40) &&
|
||||
(item->Animation.AnimNumber == LA_REACH_TO_HANG ||
|
||||
item->Animation.AnimNumber == LA_HANG_IDLE))
|
||||
{
|
||||
if (TestLaraClimbStance(item, coll))
|
||||
{
|
||||
item->goalAnimState = LS_LADDER_IDLE;
|
||||
}
|
||||
if (TestLaraClimbIdle(item, coll))
|
||||
item->Animation.TargetState = LS_LADDER_IDLE;
|
||||
else if (TestLastFrame(item))
|
||||
{
|
||||
SetAnimation(item, LA_LADDER_SHIMMY_DOWN);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void lara_as_hangleft(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_SHIMMY_LEFT (30)
|
||||
// Collision: lara_col_shimmy_left()
|
||||
void lara_as_shimmy_left(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
/*state 30*/
|
||||
/*collision: lara_col_hangleft*/
|
||||
coll->Setup.Mode = CollisionProbeMode::FreeFlat;
|
||||
coll->Setup.EnableObjectPush = false;
|
||||
coll->Setup.EnableSpaz = false;
|
||||
coll->Setup.Mode = COLL_PROBE_MODE::FREE_FLAT;
|
||||
coll->Setup.EnableSpasm = false;
|
||||
Camera.targetAngle = 0;
|
||||
Camera.targetElevation = -ANGLE(45.0f);
|
||||
|
||||
if (!(TrInput & (IN_LEFT | IN_LSTEP)))
|
||||
item->goalAnimState = LS_HANG;
|
||||
item->Animation.TargetState = LS_HANG;
|
||||
}
|
||||
|
||||
void lara_col_hangleft(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_SHIMMY_LEFT (30)
|
||||
// Control: lara_as_shimmy_left()
|
||||
void lara_col_shimmy_left(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
/*state 30*/
|
||||
/*state code: lara_as_hangleft*/
|
||||
Lara.moveAngle = item->pos.yRot - ANGLE(90);
|
||||
coll->Setup.Radius = LARA_RAD;
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
lara->Control.MoveAngle = item->Pose.Orientation.y - ANGLE(90.0f);
|
||||
coll->Setup.Radius = LARA_RADIUS;
|
||||
|
||||
TestLaraHang(item, coll);
|
||||
Lara.moveAngle = item->pos.yRot - ANGLE(90);
|
||||
lara->Control.MoveAngle = item->Pose.Orientation.y - ANGLE(90.0f);
|
||||
}
|
||||
|
||||
void lara_as_hangright(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_SHIMMY_RIGHT (31)
|
||||
// Collision: lara_col_shimmy_right()
|
||||
void lara_as_shimmy_right(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
/*state 31*/
|
||||
/*collision: lara_col_hangright*/
|
||||
coll->Setup.EnableObjectPush = false;
|
||||
coll->Setup.EnableSpaz = false;
|
||||
coll->Setup.Mode = COLL_PROBE_MODE::FREE_FLAT;
|
||||
coll->Setup.EnableSpasm = false;
|
||||
coll->Setup.Mode = CollisionProbeMode::FreeFlat;
|
||||
Camera.targetAngle = 0;
|
||||
Camera.targetElevation = -ANGLE(45.0f);
|
||||
|
||||
if (!(TrInput & (IN_RIGHT | IN_RSTEP)))
|
||||
item->goalAnimState = LS_HANG;
|
||||
item->Animation.TargetState = LS_HANG;
|
||||
}
|
||||
|
||||
void lara_col_hangright(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_SHIMMY_RIGHT (31)
|
||||
// Control: lara_as_shimmy_right()
|
||||
void lara_col_shimmy_right(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
/*state 31*/
|
||||
/*state code: lara_as_hangright*/
|
||||
Lara.moveAngle = item->pos.yRot + ANGLE(90);
|
||||
coll->Setup.Radius = LARA_RAD;
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
lara->Control.MoveAngle = item->Pose.Orientation.y + ANGLE(90.0f);
|
||||
coll->Setup.Radius = LARA_RADIUS;
|
||||
TestLaraHang(item, coll);
|
||||
Lara.moveAngle = item->pos.yRot + ANGLE(90);
|
||||
lara->Control.MoveAngle = item->Pose.Orientation.y + ANGLE(90.0f);
|
||||
}
|
||||
|
||||
void lara_as_gymnast(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_SHIMMY_OUTER_LEFT (107), LS_SHIMMY_OUTER_RIGHT (108), LS_SHIMMY_INNER_LEFT (109), LS_SHIMMY_INNER_RIGHT (110),
|
||||
// Collision: lara_default_col()
|
||||
void lara_as_shimmy_corner(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
/*state 54*/
|
||||
/*collision: lara_default_col*/
|
||||
coll->Setup.EnableObjectPush = false;
|
||||
coll->Setup.EnableSpaz = false;
|
||||
}
|
||||
|
||||
/*go around corners*/
|
||||
|
||||
void lara_as_corner(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
/*state 107*/
|
||||
/*collision: lara_default_col*/
|
||||
Camera.laraNode = LM_TORSO;
|
||||
Camera.targetAngle = 0;
|
||||
Camera.targetElevation = -ANGLE(33.0f);
|
||||
SetCornerAnim(item, coll, TestLastFrame(item));
|
||||
}
|
||||
Camera.laraNode = LM_TORSO;
|
||||
|
||||
SetLaraCornerAnimation(item, coll, TestLastFrame(item));
|
||||
}
|
||||
|
||||
// State: LS_HANDSTAND (54)
|
||||
// Collision: lara_default_col()
|
||||
void lara_as_handstand(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
coll->Setup.EnableObjectPush = false;
|
||||
coll->Setup.EnableSpasm = false;
|
||||
}
|
||||
|
|
|
@ -2,16 +2,18 @@
|
|||
#include "Game/Lara/lara_struct.h"
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct CollisionInfo;
|
||||
|
||||
// Hanging and shimmying
|
||||
void lara_as_hang(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_hang(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_hangleft(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_hangleft(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_hangright(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_hangright(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_gymnast(ITEM_INFO* item, COLL_INFO* coll);
|
||||
// -----------------------------------
|
||||
// LEDGE HANG
|
||||
// State Control & Collision Functions
|
||||
// -----------------------------------
|
||||
|
||||
// Go around corners
|
||||
void lara_as_corner(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_hang(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_hang(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_shimmy_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_shimmy_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_shimmy_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_shimmy_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_shimmy_corner(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_handstand(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,19 +1,49 @@
|
|||
#pragma once
|
||||
#include "Game/collision/collide_room.h"
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct CollisionInfo;
|
||||
struct LaraInfo;
|
||||
struct VaultTestResult;
|
||||
|
||||
// -----------------------------
|
||||
// HELPER FUNCTIONS
|
||||
// For State Control & Collision
|
||||
// -----------------------------
|
||||
|
||||
void DoLaraStep(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void DoLaraCrawlVault(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void DoLaraCrawlToHangSnap(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void DoLaraLean(ITEM_INFO* item, COLL_INFO* coll, int maxAngle, short rate);
|
||||
void DoLaraCrawlFlex(ITEM_INFO* item, COLL_INFO* coll, short maxAngle, short rate);
|
||||
void SetLaraFallState(ITEM_INFO* item);
|
||||
void SetLaraFallBackState(ITEM_INFO* item);
|
||||
void HandleLaraMovementParameters(ITEM_INFO* item, CollisionInfo* coll);
|
||||
bool HandleLaraVehicle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void ApproachLaraTargetOrientation(ITEM_INFO* item, Vector3Shrt targetOrient, float rate = 1.0f);
|
||||
void EaseOutLaraHeight(ITEM_INFO* item, int height);
|
||||
void DoLaraLean(ITEM_INFO* item, CollisionInfo* coll, short maxAngle, short rate);
|
||||
void DoLaraStep(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void DoLaraMonkeyStep(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void DoLaraCrawlToHangSnap(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void DoLaraCrawlFlex(ITEM_INFO* item, CollisionInfo* coll, short maxAngle, short rate);
|
||||
void DoLaraTightropeBalance(ITEM_INFO* item);
|
||||
void DoLaraTightropeLean(ITEM_INFO* item);
|
||||
void DoLaraTightropeBalanceRegen(ITEM_INFO* item);
|
||||
void DoLaraFallDamage(ITEM_INFO* item);
|
||||
|
||||
LaraInfo*& GetLaraInfo(ITEM_INFO* item);
|
||||
short GetLaraSlideDirection(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
void ModulateLaraSlideVelocity(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void UpdateLaraSubsuitAngles(ITEM_INFO* item);
|
||||
void ModulateLaraSubsuitSwimTurn(ITEM_INFO* item);
|
||||
void ModulateLaraSwimTurn(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
void SetLaraJumpDirection(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void SetLaraRunJumpQueue(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void SetLaraVault(ITEM_INFO* item, CollisionInfo* coll, VaultTestResult vaultResult);
|
||||
void SetLaraLand(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void SetLaraFallAnimation(ITEM_INFO* item);
|
||||
void SetLaraFallBackAnimation(ITEM_INFO* item);
|
||||
void SetLaraMonkeyFallAnimation(ITEM_INFO* item);
|
||||
void SetLaraMonkeyRelease(ITEM_INFO* item);
|
||||
void SetLaraSlideAnimation(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void SetLaraCornerAnimation(ITEM_INFO* item, CollisionInfo* coll, bool flip);
|
||||
void SetLaraSwimDiveAnimation(ITEM_INFO* item);
|
||||
|
||||
void ResetLaraLean(ITEM_INFO* item, float rate = 1.0f, bool resetRoll = true, bool resetPitch = true);
|
||||
void ResetLaraFlex(ITEM_INFO* item, float rate = 1.0f);
|
||||
void HandleLaraMovementParameters(ITEM_INFO* item, COLL_INFO* coll);
|
||||
|
|
|
@ -4,21 +4,22 @@
|
|||
#include "Game/health.h"
|
||||
#include "Game/items.h"
|
||||
#include "Game/Lara/lara.h"
|
||||
#include "Game/Lara/lara_helpers.h"
|
||||
#include "Game/Lara/lara_tests.h"
|
||||
#include "Specific/level.h"
|
||||
#include "Specific/setup.h"
|
||||
|
||||
void InitialiseLara(int restore)
|
||||
{
|
||||
if (Lara.itemNumber == NO_ITEM)
|
||||
if (Lara.ItemNumber == NO_ITEM)
|
||||
return;
|
||||
|
||||
short itemNumber = Lara.itemNumber;
|
||||
short itemNumber = Lara.ItemNumber;
|
||||
|
||||
LaraItem->data = &Lara;
|
||||
LaraItem->collidable = false;
|
||||
LaraItem->location.roomNumber = LaraItem->roomNumber;
|
||||
LaraItem->location.yNumber = LaraItem->pos.yPos;
|
||||
LaraItem->Data = &Lara;
|
||||
LaraItem->Collidable = false;
|
||||
LaraItem->Location.roomNumber = LaraItem->RoomNumber;
|
||||
LaraItem->Location.yNumber = LaraItem->Pose.Position.y;
|
||||
|
||||
if (restore)
|
||||
{
|
||||
|
@ -33,125 +34,126 @@ void InitialiseLara(int restore)
|
|||
Lara.Vehicle = NO_ITEM;
|
||||
}
|
||||
|
||||
Lara.look = true;
|
||||
Lara.itemNumber = itemNumber;
|
||||
Lara.hitDirection = -1;
|
||||
Lara.sprintTimer = LARA_SPRINT_MAX;
|
||||
Lara.air = LARA_AIR_MAX;
|
||||
Lara.weaponItem = NO_ITEM;
|
||||
Lara.Control.CanLook = true;
|
||||
Lara.ItemNumber = itemNumber;
|
||||
Lara.HitDirection = -1;
|
||||
Lara.SprintEnergy = LARA_SPRINT_ENERGY_MAX;
|
||||
Lara.Air = LARA_AIR_MAX;
|
||||
Lara.Control.Weapon.WeaponItem = NO_ITEM;
|
||||
PoisonFlag = 0;
|
||||
Lara.poisoned = 0;
|
||||
Lara.waterSurfaceDist = 100;
|
||||
if (Lara.Weapons[static_cast<int>(LARA_WEAPON_TYPE::WEAPON_PISTOLS)].Present) {
|
||||
Lara.holsterInfo.leftHolster = HOLSTER_SLOT::Pistols;
|
||||
Lara.holsterInfo.rightHolster = HOLSTER_SLOT::Pistols;
|
||||
Lara.PoisonPotency = 0;
|
||||
Lara.WaterSurfaceDist = 100;
|
||||
|
||||
if (Lara.Weapons[(int)LaraWeaponType::Pistol].Present)
|
||||
{
|
||||
Lara.Control.Weapon.HolsterInfo.LeftHolster = HolsterSlot::Pistols;
|
||||
Lara.Control.Weapon.HolsterInfo.RightHolster = HolsterSlot::Pistols;
|
||||
}
|
||||
else {
|
||||
Lara.holsterInfo.leftHolster = HOLSTER_SLOT::Empty;
|
||||
Lara.holsterInfo.rightHolster = HOLSTER_SLOT::Empty;
|
||||
}
|
||||
if (Lara.Weapons[static_cast<int>(LARA_WEAPON_TYPE::WEAPON_SHOTGUN)].Present) {
|
||||
Lara.holsterInfo.backHolster = HOLSTER_SLOT::Shotgun;
|
||||
}
|
||||
else {
|
||||
Lara.holsterInfo.backHolster = HOLSTER_SLOT::Empty;
|
||||
else
|
||||
{
|
||||
Lara.Control.Weapon.HolsterInfo.LeftHolster = HolsterSlot::Empty;
|
||||
Lara.Control.Weapon.HolsterInfo.RightHolster = HolsterSlot::Empty;
|
||||
}
|
||||
|
||||
if (Lara.Weapons[(int)LaraWeaponType::Shotgun].Present)
|
||||
Lara.Control.Weapon.HolsterInfo.BackHolster = HolsterSlot::Shotgun;
|
||||
else
|
||||
Lara.Control.Weapon.HolsterInfo.BackHolster = HolsterSlot::Empty;
|
||||
|
||||
Lara.location = -1;
|
||||
Lara.highestLocation = -1;
|
||||
Lara.ropePtr = -1;
|
||||
LaraItem->hitPoints = LARA_HEALTH_MAX;
|
||||
Lara.gunStatus = LG_HANDS_FREE;
|
||||
Lara.Location = -1;
|
||||
Lara.HighestLocation = -1;
|
||||
Lara.Control.Rope.Ptr = -1;
|
||||
LaraItem->HitPoints = LARA_HEALTH_MAX;
|
||||
Lara.Control.HandStatus = HandStatus::Free;
|
||||
|
||||
LARA_WEAPON_TYPE gun = WEAPON_NONE;
|
||||
LaraWeaponType weapon = LaraWeaponType::None;
|
||||
|
||||
if (Objects[ID_HK_ITEM].loaded)
|
||||
gun = WEAPON_HK;
|
||||
weapon = LaraWeaponType::HK;
|
||||
|
||||
if (Objects[ID_PISTOLS_ITEM].loaded)
|
||||
gun = WEAPON_PISTOLS;
|
||||
weapon = LaraWeaponType::Pistol;
|
||||
|
||||
Lara.lastGunType = Lara.gunType = Lara.requestGunType = gun;
|
||||
Lara.Control.Weapon.LastGunType = Lara.Control.Weapon.GunType = Lara.Control.Weapon.RequestGunType = weapon;
|
||||
|
||||
LaraInitialiseMeshes();
|
||||
LaraInitialiseMeshes(LaraItem);
|
||||
|
||||
if (gun == WEAPON_PISTOLS)
|
||||
if (weapon == LaraWeaponType::Pistol)
|
||||
{
|
||||
Lara.Weapons[WEAPON_PISTOLS].Present = true;
|
||||
Lara.Weapons[WEAPON_PISTOLS].Ammo[WEAPON_AMMO1].setInfinite(true);
|
||||
Lara.Weapons[(int)LaraWeaponType::Pistol].Present = true;
|
||||
Lara.Weapons[(int)LaraWeaponType::Pistol].Ammo[(int)WeaponAmmoType::Ammo1].setInfinite(true);
|
||||
}
|
||||
else if (gun == WEAPON_HK)
|
||||
else if (weapon == LaraWeaponType::HK)
|
||||
{
|
||||
Lara.Weapons[WEAPON_HK].Present = true;
|
||||
Lara.Weapons[WEAPON_HK].Ammo[WEAPON_AMMO1] = 100;
|
||||
Lara.Weapons[(int)LaraWeaponType::HK].Present = true;
|
||||
Lara.Weapons[(int)LaraWeaponType::HK].Ammo[(int)WeaponAmmoType::Ammo1] = 100;
|
||||
}
|
||||
|
||||
Lara.Binoculars = true;
|
||||
Lara.Inventory.HasBinoculars = true;
|
||||
|
||||
if (!restore)
|
||||
{
|
||||
if (Objects[ID_FLARE_INV_ITEM].loaded)
|
||||
Lara.NumFlares = 3;
|
||||
Lara.Inventory.TotalFlares = 3;
|
||||
|
||||
Lara.NumSmallMedipacks = 3;
|
||||
Lara.NumLargeMedipacks = 1;
|
||||
Lara.Inventory.TotalSmallMedipacks = 3;
|
||||
Lara.Inventory.TotalLargeMedipacks = 1;
|
||||
}
|
||||
|
||||
InitialiseLaraAnims(LaraItem);
|
||||
Lara.BeetleLife = 3;
|
||||
Lara.Inventory.BeetleLife = 3;
|
||||
}
|
||||
|
||||
void LaraInitialiseMeshes()
|
||||
void LaraInitialiseMeshes(ITEM_INFO* item)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
for (int i = 0; i < NUM_LARA_MESHES; i++)
|
||||
{
|
||||
//Meshes[i] = Meshes[MESHES(ID_LARA_SKIN, i)];
|
||||
//LARA_MESHES(ID_LARA, MESHES(ID_LARA_SKIN, i));
|
||||
Lara.meshPtrs[i] = Objects[ID_LARA_SKIN].meshIndex + i;
|
||||
lara->MeshPtrs[i] = Objects[ID_LARA_SKIN].meshIndex + i;
|
||||
}
|
||||
|
||||
/* Hardcoded code */
|
||||
|
||||
if (Lara.gunType == WEAPON_HK)
|
||||
if (lara->Control.Weapon.GunType == LaraWeaponType::HK)
|
||||
lara->Control.Weapon.HolsterInfo.BackHolster = HolsterSlot::HK;
|
||||
else if (!lara->Weapons[(int)LaraWeaponType::Shotgun].Present)
|
||||
{
|
||||
Lara.holsterInfo.backHolster = HOLSTER_SLOT::HK;
|
||||
}
|
||||
else if (!Lara.Weapons[WEAPON_SHOTGUN].Present)
|
||||
{
|
||||
if (Lara.Weapons[WEAPON_HK].Present)
|
||||
Lara.holsterInfo.backHolster = HOLSTER_SLOT::HK;
|
||||
if (lara->Weapons[(int)LaraWeaponType::HK].Present)
|
||||
lara->Control.Weapon.HolsterInfo.BackHolster = HolsterSlot::HK;
|
||||
}
|
||||
else
|
||||
{
|
||||
Lara.holsterInfo.backHolster = HOLSTER_SLOT::Empty;
|
||||
}
|
||||
lara->Control.Weapon.HolsterInfo.BackHolster = HolsterSlot::Empty;
|
||||
|
||||
Lara.gunStatus = LG_HANDS_FREE;
|
||||
Lara.leftArm.frameNumber = 0;
|
||||
Lara.rightArm.frameNumber = 0;
|
||||
Lara.target = NULL;
|
||||
Lara.rightArm.lock = false;
|
||||
Lara.leftArm.lock = false;
|
||||
lara->Control.HandStatus = HandStatus::Free;
|
||||
lara->TargetEntity = NULL;
|
||||
lara->LeftArm.FrameNumber = 0;
|
||||
lara->RightArm.FrameNumber = 0;
|
||||
lara->LeftArm.Locked = false;
|
||||
lara->RightArm.Locked = false;
|
||||
}
|
||||
|
||||
void InitialiseLaraAnims(ITEM_INFO* item)
|
||||
{
|
||||
if (TestLaraWater(item))
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (TestEnvironment(ENV_FLAG_WATER, item))
|
||||
{
|
||||
Lara.waterStatus = LW_UNDERWATER;
|
||||
item->fallspeed = 0;
|
||||
lara->Control.WaterStatus = WaterStatus::Underwater;
|
||||
item->Animation.VerticalVelocity = 0;
|
||||
SetAnimation(item, LA_UNDERWATER_IDLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
Lara.waterStatus = LW_ABOVE_WATER;
|
||||
lara->Control.WaterStatus = WaterStatus::Dry;
|
||||
SetAnimation(item, LA_STAND_SOLID);
|
||||
}
|
||||
}
|
||||
|
||||
void InitialiseLaraLoad(short itemNum)
|
||||
{
|
||||
Lara.itemNumber = itemNum;
|
||||
Lara.ItemNumber = itemNum;
|
||||
LaraItem = &g_Level.Items[itemNum];
|
||||
}
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
#include "Game/Lara/lara_struct.h"
|
||||
|
||||
void InitialiseLara(int restore);
|
||||
void LaraInitialiseMeshes();
|
||||
void LaraInitialiseMeshes(ITEM_INFO* item);
|
||||
void InitialiseLaraAnims(ITEM_INFO* item);
|
||||
void InitialiseLaraLoad(short itemNumber);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,33 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct CollisionInfo;
|
||||
|
||||
// -----------------------------
|
||||
// JUMP
|
||||
// Control & Collision Functions
|
||||
// -----------------------------
|
||||
|
||||
void lara_as_forwardjump(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_forwardjump(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_fastfall(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_fastfall(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_reach(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_reach(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_land(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_compress(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_compress(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_backjump(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_backjump(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_rightjump(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_rightjump(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_leftjump(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_leftjump(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_upjump(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_upjump(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_fallback(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_fallback(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_swandive(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_swandive(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_fastdive(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_fastdive(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_jump_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_jump_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_freefall(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_freefall(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_reach(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_reach(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_land(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_jump_prepare(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_jump_prepare(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_jump_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_jump_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_jump_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_jump_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_jump_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_jump_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_jump_up(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_jump_up(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_fall_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_fall_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_swan_dive(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_swan_dive(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_freefall_dive(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_freefall_dive(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,24 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct CollisionInfo;
|
||||
|
||||
/*monkeyswing state handling functions*/
|
||||
void lara_as_monkey_idle(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_monkey_idle(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_monkeyswing(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_monkeyswing(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_monkeyr(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_monkeyr(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_monkeyl(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_monkeyl(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_monkey180(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_monkey180(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_hangturnr(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_hangturnl(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_hangturnlr(ITEM_INFO* item, COLL_INFO* coll);
|
||||
// -----------------------------
|
||||
// MONKEY SWING
|
||||
// Control & Collision Functions
|
||||
// -----------------------------
|
||||
|
||||
/*tests and other functions*/
|
||||
short TestMonkeyRight(ITEM_INFO* item, COLL_INFO* coll);
|
||||
short TestMonkeyLeft(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void MonkeySwingSnap(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void MonkeySwingFall(ITEM_INFO* item);
|
||||
void lara_as_monkey_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_monkey_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_monkey_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_monkey_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_monkey_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_monkey_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_monkey_shimmy_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_monkey_shimmy_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_monkey_shimmy_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_monkey_shimmy_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_monkey_turn_180(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_monkey_turn_180(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_monkey_turn_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_monkey_turn_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_monkey_turn_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_monkey_turn_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,96 +1,96 @@
|
|||
#pragma once
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct CollisionInfo;
|
||||
|
||||
// -----------------------------------
|
||||
// MISCELLANEOUS INTERACTABLE OBJECT
|
||||
// State Control & Collision Functions
|
||||
// Control & Collision Functions
|
||||
// -----------------------------------
|
||||
|
||||
// ------
|
||||
// PICKUP
|
||||
// ------
|
||||
|
||||
void lara_as_pickup(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_pickupflare(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_pickup(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_pickup_flare(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
// ------
|
||||
// SWITCH
|
||||
// ------
|
||||
|
||||
void lara_as_switchon(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_switchoff(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_turnswitch(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_switch_on(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_switch_off(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_turn_switch(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
// ----------
|
||||
// RECEPTACLE
|
||||
// ----------
|
||||
|
||||
void lara_as_usekey(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_usepuzzle(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_use_key(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_use_puzzle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
// --------
|
||||
// PUSHABLE
|
||||
// --------
|
||||
|
||||
void lara_as_pushblock(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_pullblock(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_ppready(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_pushable_push(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_pushable_pull(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_pushable_grab(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
// ------
|
||||
// PULLEY
|
||||
// ------
|
||||
|
||||
void lara_as_pulley(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_pulley(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
// --------------
|
||||
// HORIZONTAL BAR
|
||||
// --------------
|
||||
|
||||
void lara_as_parallelbars(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_pbleapoff(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_horizontal_bar_swing(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_horizontal_bar_leap(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
// ---------
|
||||
// TIGHTROPE
|
||||
// ---------
|
||||
|
||||
#ifdef NEW_TIGHTROPE
|
||||
void lara_as_trexit(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_tightrope_dismount(ITEM_INFO* item, CollisionInfo* coll);
|
||||
#endif
|
||||
void lara_as_trpose(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_trwalk(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_trfall(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_tightrope_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_tightrope_walk(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_tightrope_fall(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
// ----
|
||||
// ROPE
|
||||
// ----
|
||||
|
||||
void lara_as_ropel(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_roper(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_rope(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_rope(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_ropefwd(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_climbrope(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_climbroped(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_rope_turn_clockwise(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_rope_turn_counter_clockwise(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_rope_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_rope_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_rope_swing(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_rope_up(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_rope_down(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
// -------------
|
||||
// VERTICAL POLE
|
||||
// -------------
|
||||
|
||||
void lara_as_pole_idle(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_pole_idle(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_pole_up(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_pole_up(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_pole_down(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_pole_down(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_pole_turn_clockwise(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_pole_turn_clockwise(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_pole_turn_counter_clockwise(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_pole_turn_counter_clockwise(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_pole_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_pole_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_pole_up(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_pole_up(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_pole_down(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_pole_down(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_pole_turn_clockwise(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_pole_turn_clockwise(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_pole_turn_counter_clockwise(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_pole_turn_counter_clockwise(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
// --------
|
||||
// ZIP-LINE
|
||||
// --------
|
||||
|
||||
void lara_as_deathslide(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_zip_line(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,58 +1,65 @@
|
|||
#pragma once
|
||||
#include "Specific/trmath.h"
|
||||
|
||||
enum class LaraWeaponType;
|
||||
struct ITEM_INFO;
|
||||
enum GRENADE_TYPE
|
||||
{
|
||||
GRENADE_NORMAL,
|
||||
GRENADE_SUPER,
|
||||
GRENADE_FLASH,
|
||||
GRENADE_ULTRA,
|
||||
GRENADE_FLAGS
|
||||
};
|
||||
|
||||
#define PELLET_SCATTER ANGLE(20.0f)
|
||||
|
||||
constexpr auto HARPOON_DRAW_ANIM = 1;
|
||||
constexpr auto ROCKET_DRAW_ANIM = 0;
|
||||
constexpr auto HARPOON_SPEED = 256;
|
||||
constexpr auto HARPOON_VELOCITY = CLICK(1);
|
||||
constexpr auto HARPOON_TIME = 300;
|
||||
constexpr auto ROCKET_SPEED = 512;
|
||||
constexpr auto GRENADE_SPEED = 128;
|
||||
constexpr auto MAX_GRENADE_FALLSPEED = 128;
|
||||
constexpr auto GRENADE_YOFF = 180;
|
||||
constexpr auto GRENADE_ZOFF = 80;
|
||||
constexpr auto ROCKET_VELOCITY = CLICK(2);
|
||||
constexpr auto GRENADE_VELOCITY = CLICK(0.5f);
|
||||
constexpr auto MAX_GRENADE_VERTICAL_VELOCITY = CLICK(0.5f);
|
||||
constexpr auto GRENADE_Y_OFFSET = 180;
|
||||
constexpr auto GRENADE_Z_OFFSET = 80;
|
||||
constexpr auto CROSSBOW_DAMAGE = 5;
|
||||
constexpr auto CROSSBOW_AMMO1 = 1;
|
||||
constexpr auto CROSSBOW_AMMO2 = 2;
|
||||
constexpr auto CROSSBOW_AMMO3 = 2;
|
||||
constexpr auto CROSSBOW_HIT_RADIUS = 128;
|
||||
constexpr auto CROSSBOW_HIT_RADIUS = CLICK(0.5f);
|
||||
constexpr auto CROSSBOW_EXPLODE_RADIUS = SECTOR(2);
|
||||
constexpr auto GRENADE_HIT_RADIUS = 128;
|
||||
constexpr auto GRENADE_HIT_RADIUS = CLICK(0.5f);
|
||||
constexpr auto GRENADE_EXPLODE_RADIUS = SECTOR(2);
|
||||
constexpr auto ROCKET_HIT_RADIUS = 128;
|
||||
constexpr auto ROCKET_HIT_RADIUS = CLICK(0.5f);
|
||||
constexpr auto ROCKET_EXPLODE_RADIUS = SECTOR(2);
|
||||
constexpr auto HARPOON_HIT_RADIUS = 128;
|
||||
constexpr auto HARPOON_HIT_RADIUS = CLICK(0.5f);
|
||||
|
||||
void FireGrenade();
|
||||
enum class GrenadeType
|
||||
{
|
||||
Normal,
|
||||
Super,
|
||||
Flash,
|
||||
Ultra,
|
||||
Flags
|
||||
};
|
||||
|
||||
void AnimateShotgun(ITEM_INFO* laraItem, LaraWeaponType weaponType);
|
||||
void ReadyShotgun(ITEM_INFO* laraItem, LaraWeaponType weaponType);
|
||||
void FireShotgun(ITEM_INFO* laraItem);
|
||||
void DrawShotgun(ITEM_INFO* laraItem, LaraWeaponType weaponType);
|
||||
void UndrawShotgun(ITEM_INFO* laraItem, LaraWeaponType weaponType);
|
||||
void DrawShotgunMeshes(ITEM_INFO* laraItem, LaraWeaponType weaponType);
|
||||
void UndrawShotgunMeshes(ITEM_INFO* laraItem, LaraWeaponType weaponType);
|
||||
|
||||
void FireHarpoon(ITEM_INFO* laraItem);
|
||||
void HarpoonBoltControl(short itemNumber);
|
||||
void FireGrenade(ITEM_INFO* laraItem);
|
||||
void GrenadeControl(short itemNumber);
|
||||
//void GrenadeExplosionEffects(int x, int y, int z, short roomNumber);
|
||||
void FireHarpoon();
|
||||
void HarpoonBoltControl(short itemNumber);
|
||||
void draw_shotgun(int weaponType);
|
||||
void AnimateShotgun(int weaponType);
|
||||
void CrossbowBoltControl(short itemNumber);
|
||||
void FireCrossbow(PHD_3DPOS* pos);
|
||||
void FireCrossBowFromLaserSight(GAME_VECTOR* src, GAME_VECTOR* target);
|
||||
void RifleHandler(int weaponType);
|
||||
void DoExplosiveDamageOnBaddie(ITEM_INFO* src, ITEM_INFO* dest, int weapon);
|
||||
void TriggerUnderwaterExplosion(ITEM_INFO* item, int flag);
|
||||
void undraw_shotgun_meshes(int weapon);
|
||||
void undraw_shotgun(int weapon);
|
||||
void draw_shotgun_meshes(int weaponType);
|
||||
void FireHK(int mode);
|
||||
void FireShotgun();
|
||||
void HitSpecial(ITEM_INFO* projectile, ITEM_INFO* target, int flags);
|
||||
void ready_shotgun(int weaponType);
|
||||
void SomeSparkEffect(int x, int y, int z, int count);
|
||||
void FireRocket();
|
||||
void FireRocket(ITEM_INFO* laraItem);
|
||||
void RocketControl(short itemNumber);
|
||||
void FireCrossbow(ITEM_INFO* laraItem, PHD_3DPOS* pos);
|
||||
void CrossbowBoltControl(short itemNumber);
|
||||
void FireCrossBowFromLaserSight(ITEM_INFO* laraItem, GameVector* src, GameVector* target);
|
||||
|
||||
void FireHK(ITEM_INFO* laraItem, int mode);
|
||||
void RifleHandler(ITEM_INFO* laraItem, LaraWeaponType weaponType);
|
||||
|
||||
void DoExplosiveDamageOnBaddie(ITEM_INFO* laraItem, ITEM_INFO* src, ITEM_INFO* dest, LaraWeaponType weaponType);
|
||||
void TriggerUnderwaterExplosion(ITEM_INFO* item, int flag);
|
||||
void SomeSparkEffect(int x, int y, int z, int count);
|
||||
|
||||
void HitSpecial(ITEM_INFO* projectile, ITEM_INFO* target, int flags);
|
||||
|
|
1142
TR5Main/Game/Lara/lara_overhang.cpp
Normal file
1142
TR5Main/Game/Lara/lara_overhang.cpp
Normal file
File diff suppressed because it is too large
Load diff
25
TR5Main/Game/Lara/lara_overhang.h
Normal file
25
TR5Main/Game/Lara/lara_overhang.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
#pragma once
|
||||
#include "Specific/trmath.h"
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct CollisionInfo;
|
||||
|
||||
void lara_col_slopeclimb(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_slopeclimb(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_slopefall(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_slopehang(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_slopehang(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_slopeshimmy(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_slopeshimmy(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_slopeclimbup(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_slopeclimbdown(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_sclimbstart(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_sclimbstop(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_sclimbend(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
||||
void SlopeHangExtra(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void SlopeReachExtra(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void SlopeClimbExtra(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void SlopeClimbDownExtra(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void SlopeMonkeyExtra(ITEM_INFO* item, CollisionInfo* coll);
|
||||
bool LadderMonkeyExtra(ITEM_INFO* item, CollisionInfo* coll);
|
|
@ -6,140 +6,226 @@
|
|||
#include "Game/items.h"
|
||||
#include "Game/Lara/lara.h"
|
||||
#include "Game/Lara/lara_collide.h"
|
||||
#include "Game/Lara/lara_helpers.h"
|
||||
#include "Game/Lara/lara_tests.h"
|
||||
#include "Sound/sound.h"
|
||||
#include "Specific/input.h"
|
||||
#include "Specific/level.h"
|
||||
|
||||
/*this file has all the related functions to sliding*/
|
||||
// -----------------------------
|
||||
// SLIDE
|
||||
// Control & Collision Functions
|
||||
// -----------------------------
|
||||
|
||||
void lara_slide_slope(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_SLIDE_FORWARD (24)
|
||||
// Collision: lara_col_slide_forward()
|
||||
void lara_as_slide_forward(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
coll->Setup.BadHeightDown = NO_BAD_POS;
|
||||
coll->Setup.BadHeightUp = -512;
|
||||
coll->Setup.BadCeilingHeight = 0;
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
coll->Setup.ForwardAngle = Lara.moveAngle;
|
||||
Camera.targetElevation = -ANGLE(45.0f);
|
||||
|
||||
if (item->HitPoints <= 0)
|
||||
{
|
||||
item->Animation.TargetState = LS_DEATH;
|
||||
return;
|
||||
}
|
||||
|
||||
if (TrInput & IN_LOOK)
|
||||
LookUpDown(item);
|
||||
|
||||
if (TestLaraSlide(item, coll))
|
||||
{
|
||||
/*short direction = GetLaraSlideDirection(item, coll);
|
||||
|
||||
if (g_GameFlow->Animations.HasSlideExtended)
|
||||
{
|
||||
ApproachLaraTargetOrientation(item, direction, 12);
|
||||
ModulateLaraSlideVelocity(item, coll);
|
||||
|
||||
// TODO: Prepped for another time.
|
||||
if (TrInput & IN_LEFT)
|
||||
{
|
||||
lara->Control.TurnRate -= LARA_TURN_RATE;
|
||||
if (lara->Control.TurnRate < -LARA_SLIDE_TURN_MAX)
|
||||
lara->Control.TurnRate = -LARA_SLIDE_TURN_MAX;
|
||||
|
||||
DoLaraLean(item, coll, -LARA_LEAN_MAX, LARA_LEAN_RATE / 3 * 2);
|
||||
}
|
||||
else if (TrInput & IN_RIGHT)
|
||||
{
|
||||
lara->Control.TurnRate += LARA_TURN_RATE;
|
||||
if (lara->Control.TurnRate > LARA_SLIDE_TURN_MAX)
|
||||
lara->Control.TurnRate = LARA_SLIDE_TURN_MAX;
|
||||
|
||||
DoLaraLean(item, coll, LARA_LEAN_MAX, LARA_LEAN_RATE / 3 * 2);
|
||||
}
|
||||
}
|
||||
else
|
||||
ApproachLaraTargetOrientation(item, direction);*/
|
||||
|
||||
if (TrInput & IN_JUMP && TestLaraSlideJump(item, coll))
|
||||
{
|
||||
item->Animation.TargetState = LS_JUMP_FORWARD;
|
||||
StopSoundEffect(SFX_TR4_LARA_SLIPPING);
|
||||
return;
|
||||
}
|
||||
|
||||
item->Animation.TargetState = LS_SLIDE_FORWARD;
|
||||
return;
|
||||
}
|
||||
|
||||
if (TrInput & IN_FORWARD)
|
||||
item->Animation.TargetState = LS_RUN_FORWARD;
|
||||
else
|
||||
item->Animation.TargetState = LS_IDLE;
|
||||
|
||||
StopSoundEffect(SFX_TR4_LARA_SLIPPING);
|
||||
return;
|
||||
}
|
||||
|
||||
// State: LS_SLIDE_FORWARD (24)
|
||||
// Control: lara_as_slide_forward()
|
||||
void lara_col_slide_forward(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
item->Animation.Airborne = false;
|
||||
lara->Control.MoveAngle = item->Pose.Orientation.y;
|
||||
coll->Setup.Height = LARA_HEIGHT_CRAWL; // HACK: Behaves better with clamps.
|
||||
coll->Setup.LowerFloorBound = NO_LOWER_BOUND;
|
||||
coll->Setup.UpperFloorBound = -STEPUP_HEIGHT;
|
||||
coll->Setup.LowerCeilingBound = 0;
|
||||
coll->Setup.ForwardAngle = lara->Control.MoveAngle;
|
||||
GetCollisionInfo(coll, item);
|
||||
|
||||
// Temporary measure. @Sezz 2021.12.16
|
||||
if (TestLaraSwamp(item))
|
||||
if (TestLaraHitCeiling(coll))
|
||||
{
|
||||
item->goalAnimState = LS_IDLE;
|
||||
SetLaraHitCeiling(item, coll);
|
||||
return;
|
||||
}
|
||||
|
||||
if (coll->Middle.Floor > CLICK(1) && !TestEnvironment(ENV_FLAG_SWAMP, item))
|
||||
{
|
||||
SetLaraFallAnimation(item);
|
||||
StopSoundEffect(SFX_TR4_LARA_SLIPPING);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!LaraHitCeiling(item, coll))
|
||||
if (TestLaraSlide(item, coll))
|
||||
SetLaraSlideAnimation(item, coll);
|
||||
|
||||
LaraDeflectEdge(item, coll);
|
||||
|
||||
if (TestLaraStep(item, coll))
|
||||
{
|
||||
LaraDeflectEdge(item, coll);
|
||||
//DoLaraStep(item, coll);
|
||||
LaraSnapToHeight(item, coll);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (coll->Middle.Floor <= 200)
|
||||
// State: LS_SLIDE_BACK (32)
|
||||
// Collision: lara_col_slide_back()
|
||||
void lara_as_slide_back(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
Camera.targetElevation = -ANGLE(45.0f);
|
||||
Camera.targetAngle = ANGLE(135.0f);
|
||||
|
||||
if (item->HitPoints <= 0)
|
||||
{
|
||||
item->Animation.TargetState = LS_DEATH;
|
||||
return;
|
||||
}
|
||||
|
||||
if (TrInput & IN_LOOK)
|
||||
LookUpDown(item);
|
||||
|
||||
if (TestLaraSlide(item, coll))
|
||||
{
|
||||
/*short direction = GetLaraSlideDirection(item, coll) + ANGLE(180.0f);
|
||||
|
||||
if (g_GameFlow->Animations.HasSlideExtended)
|
||||
{
|
||||
TestLaraSlide(item, coll);
|
||||
ApproachLaraTargetOrientation(item, direction, 12);
|
||||
ModulateLaraSlideVelocity(item, coll);
|
||||
|
||||
item->pos.yPos += coll->Middle.Floor;
|
||||
|
||||
if (abs(coll->TiltX) <= 2 && abs(coll->TiltZ) <= 2)
|
||||
// TODO: Prepped for another time.
|
||||
if (TrInput & IN_LEFT)
|
||||
{
|
||||
if (TrInput & IN_FORWARD && item->currentAnimState != LS_SLIDE_BACK)
|
||||
{
|
||||
item->goalAnimState = LS_RUN_FORWARD;
|
||||
}
|
||||
else
|
||||
item->goalAnimState = LS_IDLE;
|
||||
lara->Control.TurnRate -= LARA_TURN_RATE;
|
||||
if (lara->Control.TurnRate < -LARA_SLIDE_TURN_MAX)
|
||||
lara->Control.TurnRate = -LARA_SLIDE_TURN_MAX;
|
||||
|
||||
StopSoundEffect(SFX_TR4_LARA_SLIPPING);
|
||||
DoLaraLean(item, coll, LARA_LEAN_MAX, LARA_LEAN_RATE / 3 * 2);
|
||||
}
|
||||
else if (TrInput & IN_RIGHT)
|
||||
{
|
||||
lara->Control.TurnRate += LARA_TURN_RATE;
|
||||
if (lara->Control.TurnRate > LARA_SLIDE_TURN_MAX)
|
||||
lara->Control.TurnRate = LARA_SLIDE_TURN_MAX;
|
||||
|
||||
DoLaraLean(item, coll, -LARA_LEAN_MAX, LARA_LEAN_RATE / 3 * 2);
|
||||
}
|
||||
}
|
||||
else
|
||||
ApproachLaraTargetOrientation(item, direction);*/
|
||||
|
||||
if (TrInput & IN_JUMP && TestLaraSlideJump(item, coll))
|
||||
{
|
||||
if (item->currentAnimState == LS_SLIDE_FORWARD)
|
||||
SetAnimation(item, LA_FALL_START);
|
||||
else
|
||||
SetAnimation(item, LA_FALL_BACK);
|
||||
|
||||
item->Animation.TargetState = LS_JUMP_BACK;
|
||||
StopSoundEffect(SFX_TR4_LARA_SLIPPING);
|
||||
|
||||
item->gravityStatus = true;
|
||||
item->fallspeed = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
item->Animation.TargetState = LS_SLIDE_BACK;
|
||||
return;
|
||||
}
|
||||
|
||||
item->Animation.TargetState = LS_IDLE;
|
||||
StopSoundEffect(SFX_TR4_LARA_SLIPPING);
|
||||
return;
|
||||
}
|
||||
|
||||
void LaraSlideEdgeJump(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_SLIDE_BACK (32)
|
||||
// Control: lara_as_slide_back()
|
||||
void lara_col_slide_back(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
ShiftItem(item, coll);
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
switch (coll->CollisionType)
|
||||
item->Animation.Airborne = false;
|
||||
lara->Control.MoveAngle = item->Pose.Orientation.y + ANGLE(180.0f);
|
||||
coll->Setup.Height = LARA_HEIGHT_CRAWL; // HACK: Behaves better with clamps.
|
||||
coll->Setup.LowerFloorBound = NO_LOWER_BOUND;
|
||||
coll->Setup.UpperFloorBound = -STEPUP_HEIGHT;
|
||||
coll->Setup.LowerCeilingBound = 0;
|
||||
coll->Setup.ForwardAngle = lara->Control.MoveAngle;
|
||||
GetCollisionInfo(coll, item);
|
||||
|
||||
if (TestLaraHitCeiling(coll))
|
||||
{
|
||||
case CT_LEFT:
|
||||
item->pos.yRot += ANGLE(5.0f);
|
||||
break;
|
||||
|
||||
case CT_RIGHT:
|
||||
item->pos.yRot -= ANGLE(5.0f);
|
||||
break;
|
||||
|
||||
case CT_TOP:
|
||||
case CT_TOP_FRONT:
|
||||
if (item->fallspeed <= 0)
|
||||
item->fallspeed = 1;
|
||||
break;
|
||||
|
||||
case CT_CLAMP:
|
||||
item->pos.zPos -= 400 * phd_cos(coll->Setup.ForwardAngle);
|
||||
item->pos.xPos -= 400 * phd_sin(coll->Setup.ForwardAngle);
|
||||
|
||||
item->speed = 0;
|
||||
|
||||
coll->Middle.Floor = 0;
|
||||
|
||||
if (item->fallspeed <= 0)
|
||||
item->fallspeed = 16;
|
||||
|
||||
break;
|
||||
SetLaraHitCeiling(item, coll);
|
||||
return;
|
||||
}
|
||||
}
|
||||
/*end tests and others*/
|
||||
/*-*/
|
||||
/*Lara state code*/
|
||||
void lara_as_slide(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
/*state 24*/
|
||||
/*collision: lara_col_slide*/
|
||||
Camera.targetElevation = -ANGLE(45.0f); // FIXED
|
||||
if ((TrInput & IN_JUMP) && !(TrInput & IN_BACK))
|
||||
|
||||
if (coll->Middle.Floor > CLICK(1) && !TestEnvironment(ENV_FLAG_SWAMP, item))
|
||||
{
|
||||
item->goalAnimState = LS_JUMP_FORWARD;
|
||||
SetLaraFallBackAnimation(item);
|
||||
StopSoundEffect(SFX_TR4_LARA_SLIPPING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void lara_col_slide(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
/*state 24*/
|
||||
/*state code: lara_as_slide*/
|
||||
Lara.moveAngle = item->pos.yRot;
|
||||
lara_slide_slope(item, coll);
|
||||
}
|
||||
if (TestLaraSlide(item, coll))
|
||||
SetLaraSlideAnimation(item, coll);
|
||||
|
||||
void lara_as_slideback(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
/*state 32*/
|
||||
/*collision: lara_col_slideback*/
|
||||
if ((TrInput & IN_JUMP) && !(TrInput & IN_FORWARD))
|
||||
LaraDeflectEdge(item, coll);
|
||||
|
||||
if (TestLaraStep(item, coll))
|
||||
{
|
||||
item->goalAnimState = LS_JUMP_BACK;
|
||||
StopSoundEffect(SFX_TR4_LARA_SLIPPING);
|
||||
//DoLaraStep(item, coll);
|
||||
LaraSnapToHeight(item, coll);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void lara_col_slideback(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
/*state 32*/
|
||||
/*state code: lara_as_slideback*/
|
||||
Lara.moveAngle = item->pos.yRot + ANGLE(180);
|
||||
lara_slide_slope(item, coll);
|
||||
}
|
||||
/*end Lara state code*/
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct CollisionInfo;
|
||||
|
||||
/*Tests and others*/
|
||||
void lara_slide_slope(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void LaraSlideEdgeJump(ITEM_INFO* item, COLL_INFO* coll);
|
||||
/*end tests and others*/
|
||||
/*-*/
|
||||
/*Lara state code*/
|
||||
void lara_as_slide(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_slide(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_slideback(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_col_slideback(ITEM_INFO* item, COLL_INFO* coll);
|
||||
/*end Lara state code*/
|
||||
// -----------------------------
|
||||
// SLIDE
|
||||
// Control & Collision Functions
|
||||
// -----------------------------
|
||||
|
||||
void lara_as_slide_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_slide_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_slide_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_slide_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
|
|
@ -7,229 +7,313 @@
|
|||
#include "Game/items.h"
|
||||
#include "Game/Lara/lara.h"
|
||||
#include "Game/Lara/lara_collide.h"
|
||||
#include "Game/Lara/lara_helpers.h"
|
||||
#include "Game/Lara/lara_swim.h"
|
||||
#include "Game/Lara/lara_tests.h"
|
||||
#include "Specific/level.h"
|
||||
#include "Specific/input.h"
|
||||
|
||||
void lara_col_surftread(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// -----------------------------
|
||||
// WATER SURFACE TREAD
|
||||
// Control & Collision Functions
|
||||
// -----------------------------
|
||||
|
||||
// State: LS_ONWATER_DIVE (35)
|
||||
// Collision: lara_col_surface_dive()
|
||||
void lara_as_surface_dive(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
Lara.moveAngle = item->pos.yRot;
|
||||
LaraSurfaceCollision(item, coll);
|
||||
if (TrInput & IN_FORWARD)
|
||||
item->Pose.Orientation.x -= ANGLE(1.0f);
|
||||
}
|
||||
|
||||
void lara_col_surfright(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_ONWATER_DIVE (35)
|
||||
// Control: lara_as_surface_dive()
|
||||
void lara_col_surface_dive(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
Lara.moveAngle = item->pos.yRot + ANGLE(90);
|
||||
LaraSurfaceCollision(item, coll);
|
||||
LaraSwimCollision(item, coll);
|
||||
}
|
||||
|
||||
void lara_col_surfleft(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_ONWATER_IDLE (33)
|
||||
// Collision: lara_col_surface_idle()
|
||||
void lara_as_surface_idle(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
Lara.moveAngle = item->pos.yRot - ANGLE(90);
|
||||
LaraSurfaceCollision(item, coll);
|
||||
}
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
void lara_col_surfback(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
Lara.moveAngle = item->pos.yRot + ANGLE(180);
|
||||
LaraSurfaceCollision(item, coll);
|
||||
}
|
||||
item->Animation.VerticalVelocity -= LARA_SWIM_DECELERATION;
|
||||
if (item->Animation.VerticalVelocity < 0)
|
||||
item->Animation.VerticalVelocity = 0;
|
||||
|
||||
void lara_col_surfswim(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
coll->Setup.BadHeightUp = -STEPUP_HEIGHT;
|
||||
Lara.moveAngle = item->pos.yRot;
|
||||
LaraSurfaceCollision(item, coll);
|
||||
TestLaraWaterClimbOut(item, coll);
|
||||
TestLaraLadderClimbOut(item, coll);
|
||||
}
|
||||
|
||||
void lara_as_surftread(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
item->fallspeed -= 4;
|
||||
if (item->fallspeed < 0)
|
||||
item->fallspeed = 0;
|
||||
|
||||
if (item->hitPoints <= 0)
|
||||
if (item->HitPoints <= 0)
|
||||
{
|
||||
item->goalAnimState = LS_WATER_DEATH;
|
||||
item->Animation.TargetState = LS_WATER_DEATH;
|
||||
return;
|
||||
}
|
||||
|
||||
if (TrInput & IN_LOOK)
|
||||
{
|
||||
LookUpDown();
|
||||
LookUpDown(item);
|
||||
return;
|
||||
}
|
||||
|
||||
if (TrInput & IN_LEFT)
|
||||
{
|
||||
item->pos.yRot -= ANGLE(4);
|
||||
lara->Control.TurnRate -= LARA_TURN_RATE * 1.25f;
|
||||
if (lara->Control.TurnRate < -LARA_MED_TURN_MAX)
|
||||
lara->Control.TurnRate = -LARA_MED_TURN_MAX;
|
||||
}
|
||||
else if (TrInput & IN_RIGHT)
|
||||
{
|
||||
item->pos.yRot += ANGLE(4);
|
||||
lara->Control.TurnRate += LARA_TURN_RATE * 1.25f;
|
||||
if (lara->Control.TurnRate > LARA_MED_TURN_MAX)
|
||||
lara->Control.TurnRate = LARA_MED_TURN_MAX;
|
||||
}
|
||||
|
||||
if (TrInput & IN_JUMP)
|
||||
if (DbInput & IN_JUMP)
|
||||
{
|
||||
Lara.diveCount++;
|
||||
if (Lara.diveCount == 10)
|
||||
SwimDive(item);
|
||||
SetLaraSwimDiveAnimation(item);
|
||||
return;
|
||||
}
|
||||
else if (TrInput & IN_FORWARD)
|
||||
|
||||
if (TrInput & IN_ROLL || (TrInput & IN_FORWARD && TrInput & IN_BACK))
|
||||
{
|
||||
item->goalAnimState = LS_ONWATER_FORWARD;
|
||||
item->Animation.TargetState = LS_ROLL_FORWARD;
|
||||
return;
|
||||
}
|
||||
|
||||
if (TrInput & IN_FORWARD)
|
||||
{
|
||||
item->Animation.TargetState = LS_ONWATER_FORWARD;
|
||||
return;
|
||||
}
|
||||
else if (TrInput & IN_BACK)
|
||||
{
|
||||
item->goalAnimState = LS_ONWATER_BACK;
|
||||
item->Animation.TargetState = LS_ONWATER_BACK;
|
||||
return;
|
||||
}
|
||||
else if (TrInput & IN_ROLL)
|
||||
|
||||
if (TrInput & IN_LSTEP || (TrInput & IN_WALK && TrInput & IN_LEFT))
|
||||
{
|
||||
item->goalAnimState = LS_ROLL_FORWARD;
|
||||
item->Animation.TargetState = LS_ONWATER_LEFT;
|
||||
return;
|
||||
}
|
||||
else if (TrInput & IN_LSTEP)
|
||||
else if (TrInput & IN_RSTEP || (TrInput & IN_WALK && TrInput & IN_RIGHT))
|
||||
{
|
||||
item->goalAnimState = LS_ONWATER_LEFT;
|
||||
return;
|
||||
}
|
||||
else if (TrInput & IN_RSTEP)
|
||||
{
|
||||
item->goalAnimState = LS_ONWATER_RIGHT;
|
||||
item->Animation.TargetState = LS_ONWATER_RIGHT;
|
||||
return;
|
||||
}
|
||||
|
||||
Lara.diveCount = 0;
|
||||
item->goalAnimState = LS_ONWATER_STOP;
|
||||
item->Animation.TargetState = LS_ONWATER_IDLE;
|
||||
}
|
||||
|
||||
void lara_as_surfright(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_ONWATER_IDLE (33)
|
||||
// Control: lara_as_surface_idle()
|
||||
void lara_col_surface_idle(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
if (item->hitPoints <= 0)
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
lara->Control.MoveAngle = item->Pose.Orientation.y;
|
||||
LaraSurfaceCollision(item, coll);
|
||||
}
|
||||
|
||||
// State: LS_ONWATER_FORWARD (34)
|
||||
// Collision: lara_col_surface_swim_forward()
|
||||
void lara_as_surface_swim_forward(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (item->HitPoints <= 0)
|
||||
{
|
||||
item->goalAnimState = LS_WATER_DEATH;
|
||||
item->Animation.TargetState = LS_WATER_DEATH;
|
||||
return;
|
||||
}
|
||||
|
||||
Lara.diveCount = 0;
|
||||
|
||||
|
||||
if (TrInput & IN_LEFT)
|
||||
{
|
||||
item->pos.yRot -= ANGLE(2);
|
||||
lara->Control.TurnRate -= LARA_TURN_RATE * 1.25f;
|
||||
if (lara->Control.TurnRate < -LARA_MED_TURN_MAX)
|
||||
lara->Control.TurnRate = -LARA_MED_TURN_MAX;
|
||||
}
|
||||
else if (TrInput & IN_RIGHT)
|
||||
{
|
||||
item->pos.yRot += ANGLE(2);
|
||||
}
|
||||
|
||||
if (!(TrInput & IN_RSTEP))
|
||||
{
|
||||
item->goalAnimState = LS_ONWATER_STOP;
|
||||
}
|
||||
|
||||
item->fallspeed += 8;
|
||||
if (item->fallspeed > 60)
|
||||
item->fallspeed = 60;
|
||||
}
|
||||
|
||||
void lara_as_surfleft(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
if (item->hitPoints <= 0)
|
||||
{
|
||||
item->goalAnimState = LS_WATER_DEATH;
|
||||
return;
|
||||
}
|
||||
|
||||
Lara.diveCount = 0;
|
||||
|
||||
if (TrInput & IN_LEFT)
|
||||
{
|
||||
item->pos.yRot -= ANGLE(2);
|
||||
}
|
||||
else if (TrInput & IN_RIGHT)
|
||||
{
|
||||
item->pos.yRot += ANGLE(2);
|
||||
}
|
||||
|
||||
if (!(TrInput & IN_LSTEP))
|
||||
{
|
||||
item->goalAnimState = LS_ONWATER_STOP;
|
||||
}
|
||||
|
||||
item->fallspeed += 8;
|
||||
if (item->fallspeed > 60)
|
||||
item->fallspeed = 60;
|
||||
}
|
||||
|
||||
void lara_as_surfback(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
if (item->hitPoints <= 0)
|
||||
{
|
||||
item->goalAnimState = LS_WATER_DEATH;
|
||||
return;
|
||||
}
|
||||
|
||||
Lara.diveCount = 0;
|
||||
|
||||
if (TrInput & IN_LEFT)
|
||||
{
|
||||
item->pos.yRot -= ANGLE(2);
|
||||
}
|
||||
else if (TrInput & IN_RIGHT)
|
||||
{
|
||||
item->pos.yRot += ANGLE(2);
|
||||
}
|
||||
|
||||
if (!(TrInput & IN_BACK))
|
||||
{
|
||||
item->goalAnimState = LS_ONWATER_STOP;
|
||||
}
|
||||
|
||||
item->fallspeed += 8;
|
||||
if (item->fallspeed > 60)
|
||||
item->fallspeed = 60;
|
||||
}
|
||||
|
||||
void lara_as_surfswim(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
if (item->hitPoints <= 0)
|
||||
{
|
||||
item->goalAnimState = LS_WATER_DEATH;
|
||||
return;
|
||||
}
|
||||
|
||||
Lara.diveCount = 0;
|
||||
|
||||
if (TrInput & IN_LEFT)
|
||||
{
|
||||
item->pos.yRot -= ANGLE(4);
|
||||
}
|
||||
else if (TrInput & IN_RIGHT)
|
||||
{
|
||||
item->pos.yRot += ANGLE(4);
|
||||
lara->Control.TurnRate += LARA_TURN_RATE * 1.25f;
|
||||
if (lara->Control.TurnRate > LARA_MED_TURN_MAX)
|
||||
lara->Control.TurnRate = LARA_MED_TURN_MAX;
|
||||
}
|
||||
|
||||
if (!(TrInput & IN_FORWARD))
|
||||
item->goalAnimState = LS_ONWATER_STOP;
|
||||
if (TrInput & IN_JUMP)
|
||||
item->goalAnimState = LS_ONWATER_STOP;
|
||||
item->Animation.TargetState = LS_ONWATER_IDLE;
|
||||
|
||||
item->fallspeed += 8;
|
||||
if (item->fallspeed > 60)
|
||||
item->fallspeed = 60;
|
||||
if (DbInput & IN_JUMP)
|
||||
SetLaraSwimDiveAnimation(item);
|
||||
|
||||
item->Animation.VerticalVelocity += LARA_SWIM_ACCELERATION;
|
||||
if (item->Animation.VerticalVelocity > LARA_TREAD_VELOCITY_MAX)
|
||||
item->Animation.VerticalVelocity = LARA_TREAD_VELOCITY_MAX;
|
||||
}
|
||||
|
||||
void lara_as_waterout(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_ONWATER_FORWARD (34)
|
||||
// Control: lara_as_surface_swim_forward()
|
||||
void lara_col_surface_swim_forward(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
lara->Control.MoveAngle = item->Pose.Orientation.y;
|
||||
coll->Setup.UpperFloorBound = -STEPUP_HEIGHT;
|
||||
LaraSurfaceCollision(item, coll);
|
||||
TestLaraWaterClimbOut(item, coll);
|
||||
TestLaraLadderClimbOut(item, coll);
|
||||
}
|
||||
|
||||
// State: LS_ONWATER_LEFT (48)
|
||||
// Collision: lara_col_surface_swim_left()
|
||||
void lara_as_surface_swim_left(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (item->HitPoints <= 0)
|
||||
{
|
||||
item->Animation.TargetState = LS_WATER_DEATH;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(TrInput & IN_WALK)) // WALK locks orientation.
|
||||
{
|
||||
if (TrInput & IN_LEFT)
|
||||
{
|
||||
lara->Control.TurnRate -= LARA_TURN_RATE * 1.25f;
|
||||
if (lara->Control.TurnRate < -LARA_SLOW_MED_TURN_MAX)
|
||||
lara->Control.TurnRate = -LARA_SLOW_MED_TURN_MAX;
|
||||
}
|
||||
else if (TrInput & IN_RIGHT)
|
||||
{
|
||||
lara->Control.TurnRate += LARA_TURN_RATE * 1.25f;
|
||||
if (lara->Control.TurnRate > LARA_SLOW_MED_TURN_MAX)
|
||||
lara->Control.TurnRate = LARA_SLOW_MED_TURN_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(TrInput & IN_LSTEP || (TrInput & IN_WALK && TrInput & IN_LEFT)))
|
||||
item->Animation.TargetState = LS_ONWATER_IDLE;
|
||||
|
||||
if (DbInput & IN_JUMP)
|
||||
SetLaraSwimDiveAnimation(item);
|
||||
|
||||
item->Animation.VerticalVelocity += LARA_SWIM_ACCELERATION;
|
||||
if (item->Animation.VerticalVelocity > LARA_TREAD_VELOCITY_MAX)
|
||||
item->Animation.VerticalVelocity = LARA_TREAD_VELOCITY_MAX;
|
||||
}
|
||||
|
||||
// State: LS_ONWATER_LEFT (48)
|
||||
// Control: lara_as_surface_swim_left()
|
||||
void lara_col_surface_swim_left(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
lara->Control.MoveAngle = item->Pose.Orientation.y - ANGLE(90.0f);
|
||||
LaraSurfaceCollision(item, coll);
|
||||
}
|
||||
|
||||
// State: LS_ONWATER_RIGHT (49)
|
||||
// Collision: lara_col_surface_swim_right()
|
||||
void lara_as_surface_swim_right(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (item->HitPoints <= 0)
|
||||
{
|
||||
item->Animation.TargetState = LS_WATER_DEATH;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(TrInput & IN_WALK)) // WALK locks orientation.
|
||||
{
|
||||
if (TrInput & IN_LEFT)
|
||||
{
|
||||
lara->Control.TurnRate -= LARA_TURN_RATE * 1.25f;
|
||||
if (lara->Control.TurnRate < -LARA_SLOW_MED_TURN_MAX)
|
||||
lara->Control.TurnRate = -LARA_SLOW_MED_TURN_MAX;
|
||||
}
|
||||
else if (TrInput & IN_RIGHT)
|
||||
{
|
||||
lara->Control.TurnRate += LARA_TURN_RATE * 1.25f;
|
||||
if (lara->Control.TurnRate > LARA_SLOW_MED_TURN_MAX)
|
||||
lara->Control.TurnRate = LARA_SLOW_MED_TURN_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(TrInput & IN_RSTEP || (TrInput & IN_WALK && TrInput & IN_RIGHT)))
|
||||
item->Animation.TargetState = LS_ONWATER_IDLE;
|
||||
|
||||
if (DbInput & IN_JUMP)
|
||||
SetLaraSwimDiveAnimation(item);
|
||||
|
||||
item->Animation.VerticalVelocity += LARA_SWIM_ACCELERATION;
|
||||
if (item->Animation.VerticalVelocity > LARA_TREAD_VELOCITY_MAX)
|
||||
item->Animation.VerticalVelocity = LARA_TREAD_VELOCITY_MAX;
|
||||
}
|
||||
|
||||
// State: LS_ONWATER_RIGHT (49)
|
||||
// Conrol: lara_as_surface_swim_right()
|
||||
void lara_col_surface_swim_right(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
lara->Control.MoveAngle = item->Pose.Orientation.y + ANGLE(90.0f);
|
||||
LaraSurfaceCollision(item, coll);
|
||||
}
|
||||
|
||||
// State: LS_ONWATER_BACK (47)
|
||||
// Collision: lara_col_surface_swim_back()
|
||||
void lara_as_surface_swim_back(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (item->HitPoints <= 0)
|
||||
{
|
||||
item->Animation.TargetState = LS_WATER_DEATH;
|
||||
return;
|
||||
}
|
||||
|
||||
if (TrInput & IN_LEFT)
|
||||
{
|
||||
lara->Control.TurnRate -= LARA_TURN_RATE * 1.25f;
|
||||
if (lara->Control.TurnRate < -LARA_SLOW_MED_TURN_MAX)
|
||||
lara->Control.TurnRate = -LARA_SLOW_MED_TURN_MAX;
|
||||
}
|
||||
else if (TrInput & IN_RIGHT)
|
||||
{
|
||||
lara->Control.TurnRate += LARA_TURN_RATE * 1.25f;
|
||||
if (lara->Control.TurnRate > LARA_SLOW_MED_TURN_MAX)
|
||||
lara->Control.TurnRate = LARA_SLOW_MED_TURN_MAX;
|
||||
}
|
||||
|
||||
if (DbInput & IN_JUMP)
|
||||
SetLaraSwimDiveAnimation(item);
|
||||
|
||||
if (!(TrInput & IN_BACK))
|
||||
item->Animation.TargetState = LS_ONWATER_IDLE;
|
||||
|
||||
item->Animation.VerticalVelocity += LARA_SWIM_ACCELERATION;
|
||||
if (item->Animation.VerticalVelocity > LARA_TREAD_VELOCITY_MAX)
|
||||
item->Animation.VerticalVelocity = LARA_TREAD_VELOCITY_MAX;
|
||||
}
|
||||
|
||||
// State: LS_ONWATER_BACK (47)
|
||||
// Control: lara_as_surface_swim_back()
|
||||
void lara_col_surface_swim_back(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
lara->Control.MoveAngle = item->Pose.Orientation.y + ANGLE(180.0f);
|
||||
LaraSurfaceCollision(item, coll);
|
||||
}
|
||||
|
||||
// State: LS_ONWATER_EXIT (55)
|
||||
// Collision: lara_default_col()
|
||||
void lara_as_surface_climb_out(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
coll->Setup.EnableObjectPush = false;
|
||||
coll->Setup.EnableSpaz = false;
|
||||
coll->Setup.EnableSpasm = false;
|
||||
Camera.flags = CF_FOLLOW_CENTER;
|
||||
Camera.laraNode = LM_HIPS; //forces the camera to follow Lara instead of snapping
|
||||
Camera.laraNode = LM_HIPS; // Forces the camera to follow Lara instead of snapping.
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,23 @@
|
|||
#pragma once
|
||||
|
||||
struct ITEM_INFO;
|
||||
struct COLL_INFO;
|
||||
struct CollisionInfo;
|
||||
|
||||
void _cdecl lara_col_surftread(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void _cdecl lara_col_surfright(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void _cdecl lara_col_surfleft(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void _cdecl lara_col_surfback(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void _cdecl lara_col_surfswim(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void _cdecl lara_as_surftread(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void _cdecl lara_as_surfright(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void _cdecl lara_as_surfleft(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void _cdecl lara_as_surfback(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void _cdecl lara_as_surfswim(ITEM_INFO* item, COLL_INFO* coll);
|
||||
void lara_as_waterout(ITEM_INFO* item, COLL_INFO* coll);
|
||||
// -----------------------------
|
||||
// WATER SURFACE TREAD
|
||||
// Control & Collision Functions
|
||||
// -----------------------------
|
||||
|
||||
void lara_as_surface_dive(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_col_surface_dive(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void _cdecl lara_as_surface_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void _cdecl lara_col_surface_idle(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void _cdecl lara_as_surface_swim_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void _cdecl lara_col_surface_swim_forward(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void _cdecl lara_as_surface_swim_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void _cdecl lara_col_surface_swim_left(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void _cdecl lara_as_surface_swim_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void _cdecl lara_col_surface_swim_right(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void _cdecl lara_as_surface_swim_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void _cdecl lara_col_surface_swim_back(ITEM_INFO* item, CollisionInfo* coll);
|
||||
void lara_as_surface_climb_out(ITEM_INFO* item, CollisionInfo* coll);
|
||||
|
|
|
@ -14,395 +14,192 @@
|
|||
#include "Specific/level.h"
|
||||
#include "Specific/input.h"
|
||||
|
||||
struct SUBSUIT_INFO
|
||||
{
|
||||
short XRot;
|
||||
short dXRot;
|
||||
short XRotVel;
|
||||
short Vel[2];
|
||||
short YVel;
|
||||
};
|
||||
SUBSUIT_INFO Subsuit;
|
||||
byte SubHitCount = 0;
|
||||
// -----------------------------
|
||||
// UNDERWATER SWIM
|
||||
// Control & Collision Functions
|
||||
// -----------------------------
|
||||
|
||||
void lara_col_waterroll(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_UNDERWATER_IDLE (13)
|
||||
// Collision: lara_col_underwater_idle()
|
||||
void lara_as_underwater_idle(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
LaraSwimCollision(item, coll);
|
||||
}
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
void lara_col_uwdeath(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
item->hitPoints = -1;
|
||||
Lara.air = -1;
|
||||
Lara.gunStatus = LG_HANDS_BUSY;
|
||||
LaraType laraType = g_GameFlow->GetLevel(CurrentLevel)->GetLaraType();
|
||||
|
||||
auto waterHeight = GetWaterHeight(item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber);
|
||||
if (waterHeight < (item->pos.yPos - (STEP_SIZE / 5 * 2) - 2) &&
|
||||
waterHeight != NO_HEIGHT)
|
||||
if (item->HitPoints <= 0)
|
||||
{
|
||||
item->pos.yPos -= 5;
|
||||
}
|
||||
|
||||
LaraSwimCollision(item, coll);
|
||||
}
|
||||
|
||||
void lara_col_dive(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
LaraSwimCollision(item, coll);
|
||||
}
|
||||
|
||||
void lara_col_tread(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
LaraSwimCollision(item, coll);
|
||||
}
|
||||
|
||||
void lara_col_glide(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
LaraSwimCollision(item, coll);
|
||||
}
|
||||
|
||||
void lara_col_swim(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
LaraSwimCollision(item, coll);
|
||||
}
|
||||
|
||||
void lara_as_waterroll(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
item->fallspeed = 0;
|
||||
}
|
||||
|
||||
void lara_as_uwdeath(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
Lara.look = 0;
|
||||
|
||||
item->fallspeed -= 8;
|
||||
if (item->fallspeed <= 0)
|
||||
item->fallspeed = 0;
|
||||
|
||||
if (item->pos.xRot < -ANGLE(2.0f) ||
|
||||
item->pos.xRot > ANGLE(2.0f))
|
||||
{
|
||||
if (item->pos.xRot >= 0)
|
||||
item->pos.xRot -= ANGLE(2.0f);
|
||||
else
|
||||
item->pos.xRot += ANGLE(2.0f);
|
||||
}
|
||||
else
|
||||
item->pos.xRot = 0;
|
||||
}
|
||||
|
||||
void lara_as_dive(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
if (TrInput & IN_FORWARD)
|
||||
item->pos.xRot -= ANGLE(1.0f);
|
||||
}
|
||||
|
||||
void lara_as_tread(ITEM_INFO* item, COLL_INFO* coll)
|
||||
{
|
||||
if (item->hitPoints <= 0)
|
||||
{
|
||||
item->goalAnimState = LS_WATER_DEATH;
|
||||
item->Animation.TargetState = LS_WATER_DEATH;
|
||||
return;
|
||||
}
|
||||
|
||||
auto level = g_GameFlow->GetLevel(CurrentLevel);
|
||||
|
||||
if (TrInput & IN_ROLL && level->GetLaraType() != LaraType::Divesuit)
|
||||
if ((TrInput & IN_ROLL || (TrInput & IN_FORWARD && TrInput & IN_BACK)) && laraType != LaraType::Divesuit)
|
||||
{
|
||||
SetAnimation(item, LA_UNDERWATER_ROLL_180_START);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (TrInput & IN_LOOK)
|
||||
LookUpDown();
|
||||
LookUpDown(item);
|
||||
|
||||
if (level->GetLaraType() == LaraType::Divesuit)
|
||||
SwimTurnSubsuit(item);
|
||||
if (laraType == LaraType::Divesuit)
|
||||
ModulateLaraSubsuitSwimTurn(item);
|
||||
else
|
||||
SwimTurn(item, coll);
|
||||
ModulateLaraSwimTurn(item, coll);
|
||||
|
||||
if (TrInput & IN_JUMP)
|
||||
item->goalAnimState = LS_UNDERWATER_FORWARD;
|
||||
item->Animation.TargetState = LS_UNDERWATER_SWIM_FORWARD;
|
||||
|
||||
item->fallspeed -= 6;
|
||||
item->Animation.VerticalVelocity -= 6;
|
||||
if (item->Animation.VerticalVelocity < 0)
|
||||
item->Animation.VerticalVelocity = 0;
|
||||
|
||||
if (item->fallspeed < 0)
|
||||
item->fallspeed = 0;
|
||||
|
||||
if (Lara.gunStatus == LG_HANDS_BUSY)
|
||||
Lara.gunStatus = LG_HANDS_FREE;
|
||||
if (lara->Control.HandStatus == HandStatus::Busy)
|
||||
lara->Control.HandStatus = HandStatus::Free;
|
||||
}
|
||||
|
||||
void lara_as_glide(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_UNDERWATER_IDLE (13)
|
||||
// Control: lara_as_underwater_idle()
|
||||
void lara_col_underwater_idle(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
if (item->hitPoints <= 0)
|
||||
{
|
||||
item->goalAnimState = LS_WATER_DEATH;
|
||||
return;
|
||||
}
|
||||
|
||||
auto level = g_GameFlow->GetLevel(CurrentLevel);
|
||||
|
||||
if (TrInput & IN_ROLL && level->GetLaraType() != LaraType::Divesuit)
|
||||
{
|
||||
SetAnimation(item, LA_UNDERWATER_ROLL_180_START);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (level->GetLaraType() != LaraType::Divesuit)
|
||||
SwimTurn(item, coll);
|
||||
else
|
||||
SwimTurnSubsuit(item);
|
||||
|
||||
if (TrInput & IN_JUMP)
|
||||
item->goalAnimState = LS_UNDERWATER_FORWARD;
|
||||
|
||||
item->fallspeed -= 6;
|
||||
if (item->fallspeed < 0)
|
||||
item->fallspeed = 0;
|
||||
|
||||
if (item->fallspeed <= 133)
|
||||
item->goalAnimState = LS_UNDERWATER_STOP;
|
||||
LaraSwimCollision(item, coll);
|
||||
}
|
||||
|
||||
void lara_as_swim(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_UNDERWATER_SWIM_FORWARD (17)
|
||||
// Collision: lara_col_underwater_swim_forward()
|
||||
void lara_as_underwater_swim_forward(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
if (item->hitPoints <= 0)
|
||||
LaraType laraType = g_GameFlow->GetLevel(CurrentLevel)->GetLaraType();
|
||||
|
||||
if (item->HitPoints <= 0)
|
||||
{
|
||||
item->goalAnimState = LS_WATER_DEATH;
|
||||
item->Animation.TargetState = LS_WATER_DEATH;
|
||||
return;
|
||||
}
|
||||
|
||||
auto level = g_GameFlow->GetLevel(CurrentLevel);
|
||||
|
||||
if (TrInput & IN_ROLL && level->GetLaraType() != LaraType::Divesuit)
|
||||
if (TrInput & IN_ROLL && laraType != LaraType::Divesuit)
|
||||
{
|
||||
SetAnimation(item, LA_UNDERWATER_ROLL_180_START);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (level->GetLaraType() != LaraType::Divesuit)
|
||||
SwimTurn(item, coll);
|
||||
|
||||
if (laraType != LaraType::Divesuit)
|
||||
ModulateLaraSwimTurn(item, coll);
|
||||
else
|
||||
SwimTurnSubsuit(item);
|
||||
ModulateLaraSubsuitSwimTurn(item);
|
||||
|
||||
item->fallspeed += 8;
|
||||
|
||||
if (item->fallspeed > 200)
|
||||
item->fallspeed = 200;
|
||||
item->Animation.VerticalVelocity += LARA_SWIM_ACCELERATION;
|
||||
if (item->Animation.VerticalVelocity > LARA_SWIM_VELOCITY_MAX)
|
||||
item->Animation.VerticalVelocity = LARA_SWIM_VELOCITY_MAX;
|
||||
|
||||
if (!(TrInput & IN_JUMP))
|
||||
item->goalAnimState = LS_UNDERWATER_INERTIA;
|
||||
item->Animation.TargetState = LS_UNDERWATER_INERTIA;
|
||||
}
|
||||
|
||||
void UpdateSubsuitAngles()
|
||||
// State: LS_UNDERWATER_SWIM_FORWARD (17)
|
||||
// Control: lara_as_underwater_swim_forward()
|
||||
void lara_col_underwater_swim_forward(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
if (Subsuit.YVel != 0)
|
||||
LaraSwimCollision(item, coll);
|
||||
}
|
||||
|
||||
// State: LS_UNDERWATER_INERTIA (18)
|
||||
// Collision: lara_col_underwater_inertia()
|
||||
void lara_as_underwater_inertia(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
LaraType laraType = g_GameFlow->GetLevel(CurrentLevel)->GetLaraType();
|
||||
|
||||
if (item->HitPoints <= 0)
|
||||
{
|
||||
LaraItem->pos.yPos += Subsuit.YVel / 4;
|
||||
Subsuit.YVel = ceil(0.9375 * Subsuit.YVel - 1); // YVel * (15/16)
|
||||
item->Animation.TargetState = LS_WATER_DEATH;
|
||||
return;
|
||||
}
|
||||
|
||||
Subsuit.Vel[0] = Subsuit.Vel[1] = -4 * LaraItem->fallspeed;
|
||||
|
||||
if (Subsuit.XRot >= Subsuit.dXRot)
|
||||
if (TrInput & IN_ROLL && laraType != LaraType::Divesuit)
|
||||
{
|
||||
if (Subsuit.XRot > Subsuit.dXRot)
|
||||
{
|
||||
if (Subsuit.XRot > 0 && Subsuit.dXRot < 0)
|
||||
Subsuit.XRot = ceil(0.75 * Subsuit.XRot);
|
||||
SetAnimation(item, LA_UNDERWATER_ROLL_180_START);
|
||||
return;
|
||||
}
|
||||
|
||||
Subsuit.XRot -= ANGLE(2.0f);
|
||||
if (laraType != LaraType::Divesuit)
|
||||
ModulateLaraSwimTurn(item, coll);
|
||||
else
|
||||
ModulateLaraSubsuitSwimTurn(item);
|
||||
|
||||
if (Subsuit.XRot < Subsuit.dXRot)
|
||||
Subsuit.XRot = Subsuit.dXRot;
|
||||
}
|
||||
if (TrInput & IN_JUMP)
|
||||
item->Animation.TargetState = LS_UNDERWATER_SWIM_FORWARD;
|
||||
|
||||
item->Animation.VerticalVelocity -= LARA_SWIM_DECELERATION;
|
||||
if (item->Animation.VerticalVelocity < 0)
|
||||
item->Animation.VerticalVelocity = 0;
|
||||
|
||||
if (item->Animation.VerticalVelocity < LARA_SWIM_INTERTIA_VELOCITY_MIN)
|
||||
item->Animation.TargetState = LS_UNDERWATER_IDLE;
|
||||
}
|
||||
|
||||
// State: LS_UNDERWATER_INERTIA (18)
|
||||
// Collision: lara_as_underwater_inertia()
|
||||
void lara_col_underwater_inertia(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
LaraSwimCollision(item, coll);
|
||||
}
|
||||
|
||||
// State: LS_WATER_DEATH (44)
|
||||
// Collision: lara_col_underwater_death()
|
||||
void lara_as_underwater_death(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
lara->Control.CanLook = false;
|
||||
|
||||
item->Animation.VerticalVelocity -= LARA_SWIM_DECELERATION;
|
||||
if (item->Animation.VerticalVelocity < 0)
|
||||
item->Animation.VerticalVelocity = 0;
|
||||
|
||||
if (item->Pose.Orientation.x < -ANGLE(2.0f) ||
|
||||
item->Pose.Orientation.x > ANGLE(2.0f))
|
||||
{
|
||||
if (item->Pose.Orientation.x >= 0)
|
||||
item->Pose.Orientation.x -= ANGLE(2.0f);
|
||||
else
|
||||
item->Pose.Orientation.x += ANGLE(2.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Subsuit.XRot < 0 && Subsuit.dXRot > 0)
|
||||
Subsuit.XRot = ceil(0.75 * Subsuit.XRot);
|
||||
|
||||
Subsuit.XRot += ANGLE(2.0f);
|
||||
|
||||
if (Subsuit.XRot > Subsuit.dXRot)
|
||||
Subsuit.XRot = Subsuit.dXRot;
|
||||
}
|
||||
|
||||
if (Subsuit.dXRot != 0)
|
||||
{
|
||||
short rot = Subsuit.dXRot >> 3;
|
||||
if (rot < -ANGLE(2.0f))
|
||||
rot = -ANGLE(2.0f);
|
||||
else if (rot > ANGLE(2.0f))
|
||||
rot = ANGLE(2.0f);
|
||||
|
||||
LaraItem->pos.xRot += rot;
|
||||
}
|
||||
|
||||
Subsuit.Vel[0] += abs(Subsuit.XRot >> 3);
|
||||
Subsuit.Vel[1] += abs(Subsuit.XRot >> 3);
|
||||
|
||||
if (Lara.turnRate > 0)
|
||||
{
|
||||
Subsuit.Vel[0] += 2 * abs(Lara.turnRate);
|
||||
}
|
||||
else if (Lara.turnRate < 0)
|
||||
{
|
||||
Subsuit.Vel[1] += 2 * abs(Lara.turnRate);
|
||||
}
|
||||
|
||||
if (Subsuit.Vel[0] > 1536)
|
||||
Subsuit.Vel[0] = 1536;
|
||||
|
||||
if (Subsuit.Vel[1] > 1536)
|
||||
Subsuit.Vel[1] = 1536;
|
||||
|
||||
if (Subsuit.Vel[0] != 0 || Subsuit.Vel[1] != 0)
|
||||
{
|
||||
SoundEffect(945, &LaraItem->pos, (((Subsuit.Vel[0] + Subsuit.Vel[1]) * 4) & 0x1F00) + 10);
|
||||
}
|
||||
item->Pose.Orientation.x = 0;
|
||||
}
|
||||
|
||||
void SwimTurnSubsuit(ITEM_INFO* item)
|
||||
// State: LS_WATER_DEATH (44)
|
||||
// Control: lara_as_underwater_death()
|
||||
void lara_col_underwater_death(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
if (item->pos.yPos < 14080)
|
||||
Subsuit.YVel += (14080 - item->pos.yPos) >> 4;
|
||||
auto* lara = GetLaraInfo(item);
|
||||
|
||||
if (TrInput & IN_FORWARD && item->pos.xRot > -ANGLE(85.0f))
|
||||
Subsuit.dXRot = -ANGLE(45.0f);
|
||||
else if (TrInput & IN_BACK && item->pos.xRot < ANGLE(85.0f))
|
||||
Subsuit.dXRot = ANGLE(45.0f);
|
||||
else
|
||||
Subsuit.dXRot = 0;
|
||||
item->HitPoints = -1;
|
||||
lara->Air = -1;
|
||||
lara->Control.HandStatus = HandStatus::Busy;
|
||||
|
||||
if (TrInput & IN_LEFT)
|
||||
int waterHeight = GetWaterHeight(item);
|
||||
if (waterHeight < (item->Pose.Position.y - (CLICK(0.4f) - 2)) &&
|
||||
waterHeight != NO_HEIGHT)
|
||||
{
|
||||
Lara.turnRate -= LARA_SUBSUIT_TURN_RATE;
|
||||
if (Lara.turnRate < -LARA_MED_TURN_MAX)
|
||||
Lara.turnRate = -LARA_MED_TURN_MAX;
|
||||
|
||||
item->pos.zRot -= LARA_LEAN_RATE;
|
||||
item->Pose.Position.y -= 5;
|
||||
}
|
||||
else if (TrInput & IN_RIGHT)
|
||||
{
|
||||
Lara.turnRate += LARA_SUBSUIT_TURN_RATE;
|
||||
if (Lara.turnRate > LARA_MED_TURN_MAX)
|
||||
Lara.turnRate = LARA_MED_TURN_MAX;
|
||||
|
||||
item->pos.zRot += LARA_LEAN_RATE;
|
||||
}
|
||||
LaraSwimCollision(item, coll);
|
||||
}
|
||||
|
||||
void SwimTurn(ITEM_INFO* item, COLL_INFO* coll)
|
||||
// State: LS_UNDERWATER_ROLL (66)
|
||||
// Collision: lara_col_underwater_roll_180()
|
||||
void lara_as_underwater_roll_180(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
if (TrInput & IN_FORWARD)
|
||||
item->pos.xRot -= ANGLE(2.0f);
|
||||
else if (TrInput & IN_BACK)
|
||||
item->pos.xRot += ANGLE(2.0f);
|
||||
|
||||
if (TrInput & IN_LEFT)
|
||||
{
|
||||
Lara.turnRate -= LARA_TURN_RATE;
|
||||
if (Lara.turnRate < -LARA_MED_TURN_MAX)
|
||||
Lara.turnRate = -LARA_MED_TURN_MAX;
|
||||
|
||||
item->pos.zRot -= LARA_LEAN_RATE;
|
||||
}
|
||||
else if (TrInput & IN_RIGHT)
|
||||
{
|
||||
Lara.turnRate += LARA_TURN_RATE;
|
||||
if (Lara.turnRate > LARA_MED_TURN_MAX)
|
||||
Lara.turnRate = LARA_MED_TURN_MAX;
|
||||
|
||||
item->pos.zRot += LARA_LEAN_RATE;
|
||||
}
|
||||
item->Animation.VerticalVelocity = 0;
|
||||
}
|
||||
|
||||
void SwimDive(ITEM_INFO* item)
|
||||
// State: LS_UNDERWATER_ROLL (66)
|
||||
// Control: lara_as_underwater_roll_180()
|
||||
void lara_col_underwater_roll_180(ITEM_INFO* item, CollisionInfo* coll)
|
||||
{
|
||||
|
||||
SetAnimation(item, LA_ONWATER_DIVE);
|
||||
item->goalAnimState = LS_UNDERWATER_FORWARD;
|
||||
item->pos.xRot = ANGLE(-45.0f);
|
||||
item->fallspeed = 80;
|
||||
Lara.waterStatus = LW_UNDERWATER;
|
||||
}
|
||||
|
||||
void LaraWaterCurrent(COLL_INFO* coll)
|
||||
{
|
||||
if (Lara.currentActive)
|
||||
{
|
||||
SINK_INFO* sink = &g_Level.Sinks[Lara.currentActive - 1];
|
||||
|
||||
short angle = mGetAngle(sink->x, sink->z, LaraItem->pos.xPos, LaraItem->pos.zPos);
|
||||
Lara.currentXvel += (sink->strength * 1024 * phd_sin(angle - ANGLE(90.0f)) - Lara.currentXvel) / 16;
|
||||
Lara.currentZvel += (sink->strength * 1024 * phd_cos(angle - ANGLE(90.0f)) - Lara.currentZvel) / 16;
|
||||
|
||||
LaraItem->pos.yPos += (sink->y - LaraItem->pos.yPos) >> 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
int shift = 0;
|
||||
|
||||
if (abs(Lara.currentXvel) <= 16)
|
||||
shift = (abs(Lara.currentXvel) > 8) + 2;
|
||||
else
|
||||
shift = 4;
|
||||
Lara.currentXvel -= Lara.currentXvel >> shift;
|
||||
|
||||
if (abs(Lara.currentXvel) < 4)
|
||||
Lara.currentXvel = 0;
|
||||
|
||||
if (abs(Lara.currentZvel) <= 16)
|
||||
shift = (abs(Lara.currentZvel) > 8) + 2;
|
||||
else
|
||||
shift = 4;
|
||||
Lara.currentZvel -= Lara.currentZvel >> shift;
|
||||
|
||||
if (abs(Lara.currentZvel) < 4)
|
||||
Lara.currentZvel = 0;
|
||||
|
||||
if (!Lara.currentXvel && !Lara.currentZvel)
|
||||
return;
|
||||
}
|
||||
|
||||
LaraItem->pos.xPos += Lara.currentXvel >> 8;
|
||||
LaraItem->pos.zPos += Lara.currentZvel >> 8;
|
||||
Lara.currentActive = 0;
|
||||
|
||||
coll->Setup.ForwardAngle = phd_atan(LaraItem->pos.zPos - coll->Setup.OldPosition.z, LaraItem->pos.xPos - coll->Setup.OldPosition.x);
|
||||
coll->Setup.Height = LARA_HEIGHT_CRAWL;
|
||||
|
||||
GetCollisionInfo(coll, LaraItem, PHD_VECTOR(0, 200, 0));
|
||||
|
||||
if (coll->CollisionType == CT_FRONT)
|
||||
{
|
||||
if (LaraItem->pos.xRot > ANGLE(35.0f))
|
||||
LaraItem->pos.xRot += ANGLE(1.0f);
|
||||
else if (LaraItem->pos.xRot < -ANGLE(35.0f))
|
||||
LaraItem->pos.xRot -= ANGLE(1.0f);
|
||||
else
|
||||
LaraItem->fallspeed = 0;
|
||||
}
|
||||
else if (coll->CollisionType == CT_TOP)
|
||||
LaraItem->pos.xRot -= ANGLE(1.0f);
|
||||
else if (coll->CollisionType == CT_TOP_FRONT)
|
||||
LaraItem->fallspeed = 0;
|
||||
else if (coll->CollisionType == CT_LEFT)
|
||||
LaraItem->pos.yRot += ANGLE(5.0f);
|
||||
else if (coll->CollisionType == CT_RIGHT)
|
||||
LaraItem->pos.yRot -= ANGLE(5.0f);
|
||||
|
||||
if (coll->Middle.Floor < 0 && coll->Middle.Floor != NO_HEIGHT)
|
||||
LaraItem->pos.yPos += coll->Middle.Floor;
|
||||
|
||||
ShiftItem(LaraItem, coll);
|
||||
|
||||
coll->Setup.OldPosition.x = LaraItem->pos.xPos;
|
||||
coll->Setup.OldPosition.y = LaraItem->pos.yPos;
|
||||
coll->Setup.OldPosition.z = LaraItem->pos.zPos;
|
||||
LaraSwimCollision(item, coll);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue