mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 07:47:57 +03:00
Merge branch 'develop' into sezz_animation_refactors_tier_5
This commit is contained in:
commit
81b67fa068
130 changed files with 1980 additions and 778 deletions
|
@ -49,5 +49,4 @@ This is the credit list of **all** the people who contributed to TombEngine in a
|
|||
- JoeyQuint (Standing 180° turn, monkey swing 180° turn)
|
||||
|
||||
### TombEngine Marketing
|
||||
- Kubsy (Twitter and forum posts)
|
||||
- Stranger1992 (This website, Facebook, Instagram, Youtube and Twitch.
|
||||
- Stranger1992 (This website, Facebook, Instagram, Youtube, Twitter, and Twitch.
|
||||
|
|
66
CHANGELOG.md
66
CHANGELOG.md
|
@ -3,14 +3,44 @@
|
|||
The dates are in European standard format where date is presented as **YYYY-MM-DD**.
|
||||
TombEngine releases are located in this repository (alongside with Tomb Editor): https://github.com/TombEngine/TombEditorReleases
|
||||
|
||||
## [Version 1.8.1](link to release) - yyyy-mm-dd
|
||||
## [Version 1.8.2]
|
||||
|
||||
### Bug fixes
|
||||
* Fixed crashes when shooting, if gunflash or gunshell objects are not present in a level.
|
||||
* Fixed Teleporter object.
|
||||
* Fixed Wraith objects not working correctly in flipped rooms.
|
||||
* Fixed lensflare enabled status not saved in a savegame.
|
||||
* Fixed caustics not rendered correctly if texture compression was enabled.
|
||||
* Fixed exclusion blend mode not working correctly.
|
||||
* Fixed SSAO incorrectly applied through alpha blended textures.
|
||||
* Fixed HK sound effects.
|
||||
|
||||
### New features
|
||||
* Added muzzle glow effect for firearms.
|
||||
|
||||
### Lua API changes
|
||||
* Added `muzzleGlow` and `muzzleOffset` parameters to weapon settings.
|
||||
* Fixed `Moveable.GetJointPosition` not returning correct results if moveable is invisible or not rendered.
|
||||
|
||||
## [Version 1.8.1](https://github.com/TombEngine/TombEditorReleases/releases/tag/v1.8.1) - 2025-03-29
|
||||
|
||||
### Bug fixes
|
||||
* Fixed pathfinding for friendly NPCs such as monkeys.
|
||||
* Fixed particles remaining in the level after reloading from the savegame.
|
||||
* Fixed particles being canceled by fog bulbs.
|
||||
* Fixed crash in case hair object is the last object in a level.
|
||||
* Fixed crash with incorrectly applied animated textures on static meshes.
|
||||
* Fixed console window not hiding in non-debug mode on Windows 11.
|
||||
* Fixed key binding settings saving for the current play session after hitting Esc to cancel.
|
||||
* Fixed lensflare blending formula to avoid screen overbright.
|
||||
|
||||
### New features
|
||||
* Added Firefly Emitter object (ID 1099) with corresponding sprite slot (ID 1379).
|
||||
* Added live console input to perform Lua commands in realtime.
|
||||
|
||||
### Lua API changes
|
||||
* Added missing constructor for `Collision.Probe` without room number.
|
||||
* Added optional looping argument for `View.GetFlybyPosition` and `View.GetFlybyRotation` functions.
|
||||
|
||||
## [Version 1.8](https://github.com/TombEngine/TombEditorReleases/releases/tag/v1.8) - 2025-03-16
|
||||
|
||||
|
@ -33,7 +63,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
* Fixed custom shatter sounds with custom sound IDs not playing correctly.
|
||||
* Fixed crashes with sound samples larger than 2 megabytes.
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Added multithreading and an option for it to flow system settings.
|
||||
* Added ability to use floor trapdoors, keys and puzzle items underwater.
|
||||
- You must update your Lara object: https://github.com/TombEngine/Resources/raw/main/Wad2%20Objects/Lara/TEN_Lara.wad2
|
||||
|
@ -82,7 +112,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
* Fixed gravity being applied underwater when exiting the fly cheat.
|
||||
* Fixed gravity being applied when vaulting on the same frame as the player lands.
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Added realtime shader reloading in debug mode by pressing F9 key.
|
||||
* Added load, save, stopwatch and compass as a functional pick-up items with ability to add or remove them from inventory.
|
||||
* Increased particle limit from 1024 to 4096.
|
||||
|
@ -132,7 +162,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
* Fixed spotlight shadows.
|
||||
* Fixed Skeleton and Mummy not reacting to shotgun hits.
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Added classic mirror effect with ability to reflect moveables and static meshes.
|
||||
* Added ability to customize many hardcoded parameters, such as flare, weapon, and hair settings.
|
||||
* Added dynamic shadow casting on objects and static meshes.
|
||||
|
@ -208,7 +238,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
* Fixed display sprites and display strings rendering in the inventory background.
|
||||
* Fixed young Lara hair drawing. https://tombengine.com/docs/level-settings/#young_lara
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Added high framerate mode (also known as 60 FPS mode).
|
||||
* Added a customisable global lensflare effect. https://tombengine.com/docs/level-settings/#lensflare
|
||||
* Added a customisable starry sky and meteor effect. https://tombengine.com/docs/level-settings/#stars
|
||||
|
@ -268,7 +298,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
* Fixed bottom collision for solid static meshes.
|
||||
* Fixed T-Rex's head rotation.
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Auto-switch to a crawl state if player start position is in a crawlspace.
|
||||
* Allow directional flame emitter (negative OCBs) to be rotated at any angle.
|
||||
* Revise wall spikes:
|
||||
|
@ -315,7 +345,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
* Fixed incorrect light collection in some cases.
|
||||
* Fixed normal mapping for rooms, items, and statics.'
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Added ambient occlusion (SSAO).
|
||||
* Added new post-process workflow (monochrome, negative, exclusion) with tinting.
|
||||
* Added SMAA antialiasing instead of MSAA.
|
||||
|
@ -374,7 +404,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
* Fix camera snap when disengaging the look-around mode.
|
||||
* Fix TR4 mapper not being visible.
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Improve head-on wall collision.
|
||||
* Overhaul pushables:
|
||||
- Separate climbable and non-climbable pushable object slots.
|
||||
|
@ -457,7 +487,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
* Fix incorrect culling for scaled static meshes.
|
||||
* Fix normal mapping.
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Add ability to save screenshot in the "Screenshots" subfolder by pressing the "Print screen" key.
|
||||
* Implement separate audio track channel for playing voiceovers with subtitles in .srt format.
|
||||
* Don't stop ambience when Lara dies.
|
||||
|
@ -505,7 +535,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
* Fix rendering for static meshes with custom blending modes and alpha transparency.
|
||||
* Fix inconsistent multiline string spacing on different display modes.
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Remove search object 4 hardcoded meshswap activated with a flipmap.
|
||||
* Add TR1 cowboy.
|
||||
* Add TR3 wall mounted blade.
|
||||
|
@ -563,7 +593,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
- Please note you must use the patched version found here: https://github.com/TombEngine/Resources/blob/main/Wad2%20Objects/tr5_Imp.wad2
|
||||
* Fix and improve wraith tails.
|
||||
|
||||
### New Features/Amedments
|
||||
### New features/Amedments
|
||||
* Add dedicated WRAITH_TRAP object with enhanced effects.
|
||||
- OCB 0: Effect disabled.
|
||||
- OCB 1: Effect enabled.
|
||||
|
@ -612,7 +642,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
* Fix TR3 big gun spawning rocket with 0 life which caused an immediate explosion.
|
||||
* Fix TR3 Tony and add boss effect for him.
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Add TR3 civvy.
|
||||
* Add TR3 electric cleaner.
|
||||
* Add TR3 Sophia Leigh with following OCBs:
|
||||
|
@ -664,7 +694,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
* Fix grenade and rocket launcher lighting.
|
||||
* Fix ceiling trapdoor and floor trapdoor that Lara couldn't open manually.
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Make enemies drop pickups at first available bounding box corner point, not centerpoint.
|
||||
* Restore original volumetric explosion effects.
|
||||
* Add TR3 lizard and Puna.
|
||||
|
@ -716,7 +746,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
* Fix bone rotations of some entities.
|
||||
* Fix Lara's animation for cog switch release.
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Added new OCB to cog switch object:
|
||||
- Use OCB 0 to have the traditional behaviour.
|
||||
- Use any other OCB to can use the Cog Switch without need of any door linked.
|
||||
|
@ -730,7 +760,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
|
||||
## [Version 1.0.4](https://github.com/TombEngine/TombEditorReleases/releases/tag/v1.6.2) - 2022-12-16
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Add generic assignable effects for moveables - fire, sparks, smoke and laser / electric ignite.
|
||||
* Add ability to burn enemies with FLAME_EMITTER_1 and death blocks.
|
||||
* Add wireframe mode and other visual debug information (switch by F10/F11 debug page scroll hotkeys).
|
||||
|
@ -802,7 +832,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
|
||||
## [Version 1.0.3](https://github.com/TombEngine/TombEditorReleases/releases/tag/v1.6.1) - 2022-11-18
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Add ledge jumps (Lara object must be updated with new animations to make it work).
|
||||
* Allow any object slot to be used as a meshswap.
|
||||
* Add OCB 1 for rollingball to make it silent.
|
||||
|
@ -870,7 +900,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
|
||||
## [Version 1.0.2](https://github.com/TombEngine/TombEditorReleases/releases/tag/v1.6) - 2022-09-16
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Fix removing Pistols with TakeItem and SetItemCount.
|
||||
* Allow saving and loading of Vec3s in LevelVars and GameVars.
|
||||
* Support volume triggers made with node editor.
|
||||
|
@ -925,7 +955,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
|
||||
## [Version 1.0.1](https://github.com/TombEngine/TombEditorReleases/releases/tag/v1.5.2) - 2022-08-16
|
||||
|
||||
### New Features
|
||||
### New features
|
||||
* Added antialiasing support.
|
||||
* Added static mesh scaling support.
|
||||
* Added free rotation for teeth spikes instead of using OCB codes.
|
||||
|
|
|
@ -846,7 +846,7 @@ end
|
|||
function build_arg_list (names,pmods)
|
||||
-- build up the string representation of the argument list,
|
||||
-- using any opt and optchain modifiers if present.
|
||||
-- For instance, '(a [, b])' if b is marked as optional
|
||||
-- For instance, '(a, [b])' if b is marked as optional
|
||||
-- with @param[opt] b
|
||||
local buffer, npending = { }, 0
|
||||
local function acc(x) table.insert(buffer, x) end
|
||||
|
@ -868,20 +868,17 @@ function build_arg_list (names,pmods)
|
|||
local opt
|
||||
if m then
|
||||
if not m.optchain then
|
||||
acc ((']'):rep(npending))
|
||||
npending=0
|
||||
end
|
||||
opt = m.optchain or m.opt
|
||||
if opt then
|
||||
acc('[')
|
||||
npending=npending+1
|
||||
end
|
||||
end
|
||||
if i>1 then acc (', ') end
|
||||
acc(names[i])
|
||||
if opt and opt ~= true then acc('='..opt) end
|
||||
if opt then
|
||||
acc('[' .. names[i] .. ']')
|
||||
else
|
||||
acc(names[i])
|
||||
end
|
||||
end
|
||||
acc ((']'):rep(npending))
|
||||
return '('..table.concat(buffer)..')'
|
||||
end
|
||||
|
||||
|
|
|
@ -215,12 +215,12 @@ return [==[
|
|||
# end
|
||||
$(M(item.params.map[p],item))
|
||||
# if def == true then
|
||||
(<em>optional</em>)
|
||||
(<em>Optional.</em>)
|
||||
# elseif def then
|
||||
(<em>default</em> $(def))
|
||||
(<em>Default.</em> $(def))
|
||||
# end
|
||||
# if item:readonly(p) then
|
||||
<em>readonly</em>
|
||||
<em>Read-only.</em>
|
||||
# end
|
||||
</li>
|
||||
# end
|
||||
|
|
|
@ -12,7 +12,7 @@ new_type("luautil", "5 Lua utility modules", true)
|
|||
|
||||
not_luadoc = true
|
||||
|
||||
local version = "1.8"
|
||||
local version = "1.8.1"
|
||||
project = " TombEngine"
|
||||
title = "TombEngine " .. version .. " Lua API"
|
||||
description = "TombEngine " .. version .. " scripting interface"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -140,11 +140,11 @@
|
|||
<td class="summary">Emit a shockwave, similar to that seen when a harpy projectile hits something.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#EmitLight">EmitLight(pos[, color][, radius][, shadows][, name])</a></td>
|
||||
<td class="name" ><a href="#EmitLight">EmitLight(pos, [color], [radius], [shadows], [name])</a></td>
|
||||
<td class="summary">Emit dynamic light that lasts for a single frame.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#EmitSpotLight">EmitSpotLight(pos, dir[, color][, radius][, falloff][, distance][, shadows][, name])</a></td>
|
||||
<td class="name" ><a href="#EmitSpotLight">EmitSpotLight(pos, dir, [color], [radius], [falloff], [distance], [shadows], [name])</a></td>
|
||||
<td class="summary">Emit dynamic directional spotlight that lasts for a single frame.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -152,7 +152,7 @@
|
|||
<td class="summary">Emit blood.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#EmitAirBubble">EmitAirBubble(pos[, size][, amp])</a></td>
|
||||
<td class="name" ><a href="#EmitAirBubble">EmitAirBubble(pos, [size], [amp])</a></td>
|
||||
<td class="summary">Emit an air bubble in a water room.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -172,7 +172,7 @@
|
|||
<td class="summary">Get the wind vector for the current game frame.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#EmitStreamer">EmitStreamer(mov, tag, pos, dir[, rot][, startColor][, endColor][, width][, life][, vel][, expRate][, rotRate][, edgeFeatherMode][, lengthFeatherMode][, blendID])</a></td>
|
||||
<td class="name" ><a href="#EmitStreamer">EmitStreamer(mov, tag, pos, dir, [rot], [startColor], [endColor], [width], [life], [vel], [expRate], [rotRate], [edgeFeatherMode], [lengthFeatherMode], [blendID])</a></td>
|
||||
<td class="summary">Emit an extending streamer effect.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -454,7 +454,7 @@ EmitAdvancedParticle(particle)</pre>
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "EmitLight"></a>
|
||||
<strong>EmitLight(pos[, color][, radius][, shadows][, name])</strong>
|
||||
<strong>EmitLight(pos, [color], [radius], [shadows], [name])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Emit dynamic light that lasts for a single frame.
|
||||
|
@ -471,22 +471,22 @@ EmitAdvancedParticle(particle)</pre>
|
|||
<li><span class="parameter">color</span>
|
||||
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
|
||||
light color (default Color(255, 255, 255))
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">radius</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
measured in "clicks" or 256 world units (default 20)
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">shadows</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
determines whether light should generate dynamic shadows for applicable moveables (default is false)
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">name</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
|
||||
if provided, engine will interpolate this light for high framerate mode (be careful not to use same name for different lights)
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -497,7 +497,7 @@ EmitAdvancedParticle(particle)</pre>
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "EmitSpotLight"></a>
|
||||
<strong>EmitSpotLight(pos, dir[, color][, radius][, falloff][, distance][, shadows][, name])</strong>
|
||||
<strong>EmitSpotLight(pos, dir, [color], [radius], [falloff], [distance], [shadows], [name])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Emit dynamic directional spotlight that lasts for a single frame.
|
||||
|
@ -518,32 +518,32 @@ EmitAdvancedParticle(particle)</pre>
|
|||
<li><span class="parameter">color</span>
|
||||
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
|
||||
(default Color(255, 255, 255))
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">radius</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
overall radius at the endpoint of a light cone, measured in "clicks" or 256 world units (default 10)
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">falloff</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
radius, at which light starts to fade out, measured in "clicks" (default 5)
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">distance</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
distance, at which light cone fades out, measured in "clicks" (default 20)
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">shadows</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
determines whether light should generate dynamic shadows for applicable moveables (default is false)
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">name</span>
|
||||
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
|
||||
if provided, engine will interpolate this light for high framerate mode (be careful not to use same name for different lights)
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -582,7 +582,7 @@ EmitAdvancedParticle(particle)</pre>
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "EmitAirBubble"></a>
|
||||
<strong>EmitAirBubble(pos[, size][, amp])</strong>
|
||||
<strong>EmitAirBubble(pos, [size], [amp])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Emit an air bubble in a water room.
|
||||
|
@ -598,12 +598,12 @@ EmitAdvancedParticle(particle)</pre>
|
|||
<li><span class="parameter">size</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Sprite size. <strong>Default: 32</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">amp</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Oscillation amplitude. <strong>Default: 32</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -718,7 +718,7 @@ EmitAdvancedParticle(particle)</pre>
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "EmitStreamer"></a>
|
||||
<strong>EmitStreamer(mov, tag, pos, dir[, rot][, startColor][, endColor][, width][, life][, vel][, expRate][, rotRate][, edgeFeatherMode][, lengthFeatherMode][, blendID])</strong>
|
||||
<strong>EmitStreamer(mov, tag, pos, dir, [rot], [startColor], [endColor], [width], [life], [vel], [expRate], [rotRate], [edgeFeatherMode], [lengthFeatherMode], [blendID])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Emit an extending streamer effect.
|
||||
|
@ -746,57 +746,57 @@ EmitAdvancedParticle(particle)</pre>
|
|||
<li><span class="parameter">rot</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Start rotation in degrees. <strong>Default: 0</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">startColor</span>
|
||||
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
|
||||
Color at the start of life. <strong>Default: Color(255, 255, 255, 255))</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">endColor</span>
|
||||
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
|
||||
Color at the end of life. <strong>Default: Color(0, 0, 0, 0))</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">width</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Width in world units. <strong>Default: 0</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">life</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Lifetime in seconds. <strong>Default: 1</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">vel</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Movement velocity in world units per second. <strong>Default: 0</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">expRate</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Width expansion rate in world units per second. <strong>Default: 0</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">rotRate</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Rotation rate in degrees per second. <strong>Default: 0</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">edgeFeatherMode</span>
|
||||
<span class="types"><a class="type" href="../4 enums/Effects.StreamerFeatherMode.html#">StreamerFeatherMode</a></span>
|
||||
Edge feather mode. <strong>Default: Effects.StreamerFeatherMode.NONE</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">lengthFeatherMode</span>
|
||||
<span class="types"><a class="type" href="../4 enums/Effects.StreamerFeatherMode.html#">StreamerFeatherMode</a></span>
|
||||
Length feather mode. <strong>UNIMPLEMENTED, currently will always leave a fading tail</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">blendID</span>
|
||||
<span class="types"><a class="type" href="../4 enums/Effects.BlendID.html#">BlendID</a></span>
|
||||
Renderer blend ID. <strong>Default: Effects.BlendID.ALPHA_BLEND</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -831,127 +831,127 @@ EmitAdvancedParticle(particle)</pre>
|
|||
<li><span class="parameter">spriteSeqID</span>
|
||||
<span class="types"><a class="type" href="../4 enums/Objects.ObjID.html#SpriteConstants">SpriteConstants</a></span>
|
||||
Sprite sequence slot ID. <strong>default: Objects.ObjID.DEFAULT_SPRITES</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">spriteID</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Sprite ID in the sprite sequence slot. <strong>default: 0</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">life</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Lifespan in seconds. <strong>default: 2</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">maxYVel</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Maximum vertical velocity in world units per second. <strong>default: 0</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">gravity</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Effect of gravity in world units per second. Positive value ascend, negative value descend. <strong>default: 0</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">friction</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Friction affecting velocity over time in world units per second. <strong>default: 0</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">startRot</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Rotation at start of life. <strong>default: random</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">rotVel</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Rotational velocity in degrees per second. <strong>default: 0</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">startSize</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Size at start of life. <strong>default: 10</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">endSize</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Size at end of life. <strong>default: 0</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">startColor</span>
|
||||
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
|
||||
Color at start of life. <strong>default: Color(255, 255, 255)</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">endColor</span>
|
||||
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
|
||||
Color at end of life. Note that this will finish long before the end of life due to internal math. <strong>default: Color(255, 255, 255)</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">blendMode</span>
|
||||
<span class="types"><a class="type" href="../4 enums/Effects.BlendID.html#">BlendID</a></span>
|
||||
Render blend mode. <strong>default: TEN.Effects.BlendID.ALPHA_BLEND</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">damage</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Harm the player on collision. <strong>default: false</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">poison</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Poison the player on collision. <strong>default: false</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">burn</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Burn the player on collision. <strong>default: false</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">wind</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Affect position by wind in outside rooms. <strong>default: false</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">damageHit</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Player damage amount on collision. <strong>default: 2</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">light</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Emit a colored light. CAUTION: Recommended only for a single particle. Too many particles with lights can overwhelm the lighting system. <strong>default: false</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">lightRadius</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Light radius in 1/4 blocks. <strong>default: 0</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">lightFlicker</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Interval at which the light should flicker. <strong>default: 0</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">soundID</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Sound ID to play. CAUTION: Recommended only for a single particle. Too many particles with sounds can overwhelm the sound system. <strong>default: none</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">animated</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Play animates sprite sequence. <strong>default: false</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">animType</span>
|
||||
<span class="types"><a class="type" href="../4 enums/Effects.ParticleAnimationType.html#">ParticleAnimationType</a></span>
|
||||
Animation type of the sprite sequence. <strong>default: TEN.Effects.ParticleAnimationType.LOOP</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">frameRate</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Sprite sequence animation framerate. <strong>default: 1</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -175,7 +175,7 @@ scripts too.</p>
|
|||
<td class="summary">Returns the level that the game control is running in that moment.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#EndLevel">EndLevel([index][, startPos])</a></td>
|
||||
<td class="name" ><a href="#EndLevel">EndLevel([index], [startPos])</a></td>
|
||||
<td class="summary">Finishes the current level, with optional level index and start position index provided.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -570,7 +570,7 @@ have an ID of 0, the second an ID of 1, and so on.
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "EndLevel"></a>
|
||||
<strong>EndLevel([index][, startPos])</strong>
|
||||
<strong>EndLevel([index], [startPos])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Finishes the current level, with optional level index and start position index provided.
|
||||
|
@ -585,12 +585,12 @@ teleported to such object with OCB similar to provided second argument.
|
|||
<li><span class="parameter">index</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
level index (default 0)
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">startPos</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
player start position (default 0)
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -959,7 +959,7 @@ Must be an integer value (0 means no secrets).
|
|||
<li><span class="parameter">index</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Flipmap group ID to check. If no group specified or group is -1, function returns overall flipmap status (on or off).
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -124,7 +124,7 @@
|
|||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" ><a href="#Vibrate">Vibrate(strength, time)</a></td>
|
||||
<td class="name" ><a href="#Vibrate">Vibrate(strength, [time])</a></td>
|
||||
<td class="summary">Vibrate the game controller if the function is available and the setting is on.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -162,7 +162,7 @@
|
|||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "Vibrate"></a>
|
||||
<strong>Vibrate(strength, time)</strong>
|
||||
<strong>Vibrate(strength, [time])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Vibrate the game controller if the function is available and the setting is on.
|
||||
|
@ -177,7 +177,8 @@
|
|||
</li>
|
||||
<li><span class="parameter">time</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
<strong>(default 0.3)</strong> Vibration time in seconds.
|
||||
Vibration time in seconds.
|
||||
<em>Default: 0.3.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -124,11 +124,11 @@
|
|||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" ><a href="#GiveItem">GiveItem(objectID[, count][, addToPickupSummary])</a></td>
|
||||
<td class="name" ><a href="#GiveItem">GiveItem(objectID, [count], [addToPickupSummary])</a></td>
|
||||
<td class="summary">Add an item to the player's inventory.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#TakeItem">TakeItem(Object[, count])</a></td>
|
||||
<td class="name" ><a href="#TakeItem">TakeItem(Object, [count])</a></td>
|
||||
<td class="summary">Remove an item from the player's inventory.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -162,7 +162,7 @@
|
|||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "GiveItem"></a>
|
||||
<strong>GiveItem(objectID[, count][, addToPickupSummary])</strong>
|
||||
<strong>GiveItem(objectID, [count], [addToPickupSummary])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Add an item to the player's inventory.
|
||||
|
@ -178,12 +178,12 @@
|
|||
<li><span class="parameter">count</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
The amount of items to add. Default is the yield from a single pickup, e.g. 1 from a medipack, 12 from a flare pack.
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">addToPickupSummary</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
If true, display the item in the pickup summary. Default is false.
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -194,7 +194,7 @@
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "TakeItem"></a>
|
||||
<strong>TakeItem(Object[, count])</strong>
|
||||
<strong>TakeItem(Object, [count])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Remove an item from the player's inventory.
|
||||
|
@ -210,7 +210,7 @@
|
|||
<li><span class="parameter">count</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
The amount of items to remove. Default is the yield from a single pickup, e.g. 1 from a medipack, 12 from a flare pack.
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -144,7 +144,7 @@
|
|||
<td class="summary">Get current loudness level for specified track type.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#PlaySound">PlaySound(soundID[, position])</a></td>
|
||||
<td class="name" ><a href="#PlaySound">PlaySound(soundID, [position])</a></td>
|
||||
<td class="summary">Play sound effect.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -291,7 +291,7 @@
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "PlaySound"></a>
|
||||
<strong>PlaySound(soundID[, position])</strong>
|
||||
<strong>PlaySound(soundID, [position])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Play sound effect.
|
||||
|
@ -307,7 +307,7 @@
|
|||
<li><span class="parameter">position</span>
|
||||
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
|
||||
The 3D position of the sound, i.e. where the sound "comes from". If not given, the sound will not be positional.
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -152,7 +152,7 @@
|
|||
<td class="summary">Pick a static mesh by the given display position.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#PrintLog">PrintLog(message, logLevel[, allowSpam])</a></td>
|
||||
<td class="name" ><a href="#PrintLog">PrintLog(message, logLevel, [allowSpam])</a></td>
|
||||
<td class="summary">Write messages within the Log file</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -414,7 +414,7 @@ To be used with <a href="../2 classes/Strings.DisplayString.html#DisplayString:G
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "PrintLog"></a>
|
||||
<strong>PrintLog(message, logLevel[, allowSpam])</strong>
|
||||
<strong>PrintLog(message, logLevel, [allowSpam])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Write messages within the Log file
|
||||
|
@ -439,7 +439,7 @@ To be used with <a href="../2 classes/Strings.DisplayString.html#DisplayString:G
|
|||
<li><span class="parameter">allowSpam</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
true allows spamming of the message
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -176,11 +176,11 @@
|
|||
<td class="summary">Play a flyby sequence.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#GetFlybyPosition">GetFlybyPosition(seqID, progress)</a></td>
|
||||
<td class="name" ><a href="#GetFlybyPosition">GetFlybyPosition(seqID, progress, [loop])</a></td>
|
||||
<td class="summary">Get a flyby sequence's position at a specified progress point in percent.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#GetFlybyRotation">GetFlybyRotation(seqID, progress)</a></td>
|
||||
<td class="name" ><a href="#GetFlybyRotation">GetFlybyRotation(seqID, progress, [loop])</a></td>
|
||||
<td class="summary">Get a flyby sequence's rotation at a specified progress point in percent.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -499,7 +499,7 @@
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "GetFlybyPosition"></a>
|
||||
<strong>GetFlybyPosition(seqID, progress)</strong>
|
||||
<strong>GetFlybyPosition(seqID, progress, [loop])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Get a flyby sequence's position at a specified progress point in percent.
|
||||
|
@ -516,6 +516,11 @@
|
|||
<span class="types"><span class="type">float</span></span>
|
||||
Progress point in percent. Clamped to [0, 100].
|
||||
</li>
|
||||
<li><span class="parameter">loop</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Smooth the position near start and end points, as if the sequence is looped.
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
|
@ -531,7 +536,7 @@
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "GetFlybyRotation"></a>
|
||||
<strong>GetFlybyRotation(seqID, progress)</strong>
|
||||
<strong>GetFlybyRotation(seqID, progress, [loop])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Get a flyby sequence's rotation at a specified progress point in percent.
|
||||
|
@ -548,6 +553,11 @@
|
|||
<span class="types"><span class="type">float</span></span>
|
||||
Progress point in percent. Clamped to [0, 100].
|
||||
</li>
|
||||
<li><span class="parameter">loop</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Smooth the position near start and end points, as if the sequence is looped.
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Returns:</h3>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -122,7 +122,7 @@
|
|||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" ><a href="#Probe">Probe(pos[, roomNumber])</a></td>
|
||||
<td class="name" ><a href="#Probe">Probe(pos, [roomNumber])</a></td>
|
||||
<td class="summary">Create a Probe at a specified world position in a room.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -220,7 +220,7 @@
|
|||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "Probe"></a>
|
||||
<strong>Probe(pos[, roomNumber])</strong>
|
||||
<strong>Probe(pos, [roomNumber])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Create a Probe at a specified world position in a room.
|
||||
|
@ -236,7 +236,7 @@
|
|||
<li><span class="parameter">roomNumber</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Room number. Must be used if probing a position in an overlapping room.
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -300,9 +300,17 @@
|
|||
<td class="summary">Display muzzle flash.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#muzzleGlow">muzzleGlow</a></td>
|
||||
<td class="summary">Display muzzle glow.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#colorizeMuzzleFlash">colorizeMuzzleFlash</a></td>
|
||||
<td class="summary">Colorize muzzle flash.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#muzzleOffset">muzzleOffset</a></td>
|
||||
<td class="summary">Muzzle offset.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2><a href="#System">System </a></h2>
|
||||
<table class="function_list">
|
||||
|
@ -1214,6 +1222,27 @@
|
|||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "muzzleGlow"></a>
|
||||
<strong>muzzleGlow</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Display muzzle glow.
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">muzzleGlow</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
specifies whether muzzle glow should be displayed or not. Applicable only for firearms.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "colorizeMuzzleFlash"></a>
|
||||
|
@ -1235,6 +1264,27 @@
|
|||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "muzzleOffset"></a>
|
||||
<strong>muzzleOffset</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Muzzle offset.
|
||||
|
||||
|
||||
|
||||
<ul>
|
||||
<li><span class="parameter">muzzleOffset</span>
|
||||
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
|
||||
specifies offset for spawning muzzle gunflash effects. Applicable only for firearms.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<h2 class="section-header has-description"><a name="System"></a>System </h2>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -330,7 +330,7 @@
|
|||
<li><span class="parameter">Target</span>
|
||||
<span class="types"><span class="type">Moveable</span></span>
|
||||
If you put a moveable, the camera will look at it. Otherwise, it will look at Lara.
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -229,7 +229,7 @@
|
|||
<li><span class="parameter">poison</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Poison strength. Maximum value is 128 (default 0)
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -166,13 +166,13 @@
|
|||
<td class="summary">Get the moveable's position</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#Moveable:SetPosition">Moveable:SetPosition(position[, updateRoom])</a></td>
|
||||
<td class="name" ><a href="#Moveable:SetPosition">Moveable:SetPosition(position, [updateRoom])</a></td>
|
||||
<td class="summary">Set the moveable's position
|
||||
If you are moving a moveable whose behaviour involves knowledge of room geometry,
|
||||
(e.g.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#Moveable:GetJointPosition">Moveable:GetJointPosition(jointID[, offset])</a></td>
|
||||
<td class="name" ><a href="#Moveable:GetJointPosition">Moveable:GetJointPosition(jointIndex, [offset])</a></td>
|
||||
<td class="summary">Get the moveable's joint position with an optional relative offset.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -217,11 +217,11 @@
|
|||
<td class="summary">Set OCB (object code bit) of the moveable</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#Moveable:SetEffect">Moveable:SetEffect(effect[, timeout])</a></td>
|
||||
<td class="name" ><a href="#Moveable:SetEffect">Moveable:SetEffect(effect, [timeout])</a></td>
|
||||
<td class="summary">Set the effect for this moveable.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#Moveable:SetCustomEffect">Moveable:SetCustomEffect(color1, color2[, timeout])</a></td>
|
||||
<td class="name" ><a href="#Moveable:SetCustomEffect">Moveable:SetCustomEffect(color1, color2, [timeout])</a></td>
|
||||
<td class="summary">Set custom colored burn effect to moveable</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -285,7 +285,7 @@
|
|||
<td class="summary">Retrieve the index of the current animation.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#Moveable:SetAnim">Moveable:SetAnim(index[, slot])</a></td>
|
||||
<td class="name" ><a href="#Moveable:SetAnim">Moveable:SetAnim(index, [slot])</a></td>
|
||||
<td class="summary">Set the object's animation to the one specified by the given index.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -364,7 +364,7 @@
|
|||
if it is not swapped.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#Moveable:SwapMesh">Moveable:SwapMesh(index, slotIndex[, swapIndex])</a></td>
|
||||
<td class="name" ><a href="#Moveable:SwapMesh">Moveable:SwapMesh(index, slotIndex, [swapIndex])</a></td>
|
||||
<td class="summary">Set state of specified mesh swap of object
|
||||
Use this to swap specified mesh of an object.</td>
|
||||
</tr>
|
||||
|
@ -741,7 +741,7 @@ baddy:SetOnCollidedWithRoom(LevelFuncs.roomCollided)</pre>
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "Moveable:SetPosition"></a>
|
||||
<strong>Moveable:SetPosition(position[, updateRoom])</strong>
|
||||
<strong>Moveable:SetPosition(position, [updateRoom])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set the moveable's position
|
||||
|
@ -760,7 +760,7 @@ baddy:SetOnCollidedWithRoom(LevelFuncs.roomCollided)</pre>
|
|||
<li><span class="parameter">updateRoom</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
Will room changes be automatically detected? Set to false if you are using overlapping rooms (default: true)
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -771,7 +771,7 @@ baddy:SetOnCollidedWithRoom(LevelFuncs.roomCollided)</pre>
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "Moveable:GetJointPosition"></a>
|
||||
<strong>Moveable:GetJointPosition(jointID[, offset])</strong>
|
||||
<strong>Moveable:GetJointPosition(jointIndex, [offset])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Get the moveable's joint position with an optional relative offset.
|
||||
|
@ -780,14 +780,14 @@ baddy:SetOnCollidedWithRoom(LevelFuncs.roomCollided)</pre>
|
|||
|
||||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">jointID</span>
|
||||
<li><span class="parameter">jointIndex</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Joint ID.
|
||||
Index of a joint to get position.
|
||||
</li>
|
||||
<li><span class="parameter">offset</span>
|
||||
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
|
||||
Offset relative to the joint.
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -1026,7 +1026,7 @@ baddy:SetOnCollidedWithRoom(LevelFuncs.roomCollided)</pre>
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "Moveable:SetEffect"></a>
|
||||
<strong>Moveable:SetEffect(effect[, timeout])</strong>
|
||||
<strong>Moveable:SetEffect(effect, [timeout])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set the effect for this moveable.
|
||||
|
@ -1042,7 +1042,7 @@ baddy:SetOnCollidedWithRoom(LevelFuncs.roomCollided)</pre>
|
|||
<li><span class="parameter">timeout</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
time (in seconds) after which effect turns off.
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -1053,7 +1053,7 @@ baddy:SetOnCollidedWithRoom(LevelFuncs.roomCollided)</pre>
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "Moveable:SetCustomEffect"></a>
|
||||
<strong>Moveable:SetCustomEffect(color1, color2[, timeout])</strong>
|
||||
<strong>Moveable:SetCustomEffect(color1, color2, [timeout])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set custom colored burn effect to moveable
|
||||
|
@ -1073,7 +1073,7 @@ baddy:SetOnCollidedWithRoom(LevelFuncs.roomCollided)</pre>
|
|||
<li><span class="parameter">timeout</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Time (in seconds) after which effect turns off.
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -1423,7 +1423,7 @@ sas:SetAIBits({<span class="number">1</span>, <span class="number">0</span>, <sp
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "Moveable:SetAnim"></a>
|
||||
<strong>Moveable:SetAnim(index[, slot])</strong>
|
||||
<strong>Moveable:SetAnim(index, [slot])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set the object's animation to the one specified by the given index.
|
||||
|
@ -1441,7 +1441,7 @@ sas:SetAIBits({<span class="number">1</span>, <span class="number">0</span>, <sp
|
|||
<li><span class="parameter">slot</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
slot ID of the desired anim (if omitted, moveable's own slot ID is used)
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -1857,7 +1857,7 @@ sas:SetPosition(newPos, <span class="keyword">false</span>)</pre>
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "Moveable:SwapMesh"></a>
|
||||
<strong>Moveable:SwapMesh(index, slotIndex[, swapIndex])</strong>
|
||||
<strong>Moveable:SwapMesh(index, slotIndex, [swapIndex])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Set state of specified mesh swap of object
|
||||
|
@ -1878,7 +1878,7 @@ sas:SetPosition(newPos, <span class="keyword">false</span>)</pre>
|
|||
<li><span class="parameter">swapIndex</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
index of a mesh from meshswap slot to use
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -129,7 +129,7 @@ when you need to use screen-space coordinates.</p>
|
|||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" ><a href="#DisplayString">DisplayString(string, Position[, scale][, color][, translated], table)</a></td>
|
||||
<td class="name" ><a href="#DisplayString">DisplayString(string, Position, [scale], [color], [translated], table)</a></td>
|
||||
<td class="summary">Create a DisplayString.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -183,7 +183,7 @@ when you need to use screen-space coordinates.</p>
|
|||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "DisplayString"></a>
|
||||
<strong>DisplayString(string, Position[, scale][, color][, translated], table)</strong>
|
||||
<strong>DisplayString(string, Position, [scale], [color], [translated], table)</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Create a DisplayString.
|
||||
|
@ -204,18 +204,18 @@ For use in <a href="../1 modules/Strings.html#ShowString">ShowString</a> and <a
|
|||
<li><span class="parameter">scale</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
size of the string, relative to the default size. <strong>Default: 1.0</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">color</span>
|
||||
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
|
||||
the color of the text. <strong>Default: white</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">translated</span>
|
||||
<span class="types"><span class="type">bool</span></span>
|
||||
If false or omitted, the input string argument will be displayed.
|
||||
If true, the string argument will be the key of a translated string specified in strings.lua. <strong>Default: false</strong>.
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">table</span>
|
||||
<span class="types"><a class="type" href="../4 enums/Strings.DisplayStringOption.html#">DisplayStringOption</a></span>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -124,7 +124,7 @@
|
|||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" ><a href="#DisplaySprite">DisplaySprite(ID, int, pos, rot, scale[, color])</a></td>
|
||||
<td class="name" ><a href="#DisplaySprite">DisplaySprite(ID, int, pos, rot, scale, [color])</a></td>
|
||||
<td class="summary">Create a DisplaySprite object.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -176,7 +176,7 @@
|
|||
<td class="summary">Set the color of the display sprite.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#DisplaySprite:Draw">DisplaySprite:Draw([priority][, alignMode][, scaleMode][, blendMode])</a></td>
|
||||
<td class="name" ><a href="#DisplaySprite:Draw">DisplaySprite:Draw([priority], [alignMode], [scaleMode], [blendMode])</a></td>
|
||||
<td class="summary">Draw the display sprite in display space for the current frame.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -190,7 +190,7 @@
|
|||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "DisplaySprite"></a>
|
||||
<strong>DisplaySprite(ID, int, pos, rot, scale[, color])</strong>
|
||||
<strong>DisplaySprite(ID, int, pos, rot, scale, [color])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Create a DisplaySprite object. ()
|
||||
|
@ -222,7 +222,7 @@
|
|||
<li><span class="parameter">color</span>
|
||||
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>
|
||||
Color. <strong>Default: Color(255, 255, 255, 255)</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -497,7 +497,7 @@
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "DisplaySprite:Draw"></a>
|
||||
<strong>DisplaySprite:Draw([priority][, alignMode][, scaleMode][, blendMode])</strong>
|
||||
<strong>DisplaySprite:Draw([priority], [alignMode], [scaleMode], [blendMode])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Draw the display sprite in display space for the current frame.
|
||||
|
@ -509,22 +509,22 @@
|
|||
<li><span class="parameter">priority</span>
|
||||
<span class="types"><span class="type">int</span></span>
|
||||
Draw priority. Can be thought of as a layer, with higher values having precedence. <strong>Default: 0</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">alignMode</span>
|
||||
<span class="types"><a class="type" href="../4 enums/View.AlignMode.html#">AlignMode</a></span>
|
||||
Align mode interpreting an offset from the sprite's position. <strong>Default: View.AlignMode.CENTER</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">scaleMode</span>
|
||||
<span class="types"><a class="type" href="../4 enums/View.ScaleMode.html#">ScaleMode</a></span>
|
||||
Scale mode interpreting the display sprite's horizontal and vertical scale. <strong>Default: View.ScaleMode.FIT</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
<li><span class="parameter">blendMode</span>
|
||||
<span class="types"><a class="type" href="../4 enums/Effects.BlendID.html#">BlendID</a></span>
|
||||
Blend mode. <strong>Default: Effects.BlendID.ALPHABLEND</strong>
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -127,7 +127,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#spriteID">spriteID</a></td>
|
||||
<td class="summary">(<a href="../4 enums/Objects.ObjID.html#SpriteConstants">Objects.ObjID.SpriteConstants</a>) Lens flare's sun sprite object ID.</td>
|
||||
<td class="summary">(int) Lens flare's sun sprite ID in DEFAULT_SPRITES sequence.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#pitch">pitch</a></td>
|
||||
|
@ -178,7 +178,7 @@
|
|||
<strong>spriteID</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
(<a href="../4 enums/Objects.ObjID.html#SpriteConstants">Objects.ObjID.SpriteConstants</a>) Lens flare's sun sprite object ID.
|
||||
(int) Lens flare's sun sprite ID in DEFAULT_SPRITES sequence.
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -354,7 +354,7 @@
|
|||
<h3>Parameters:</h3>
|
||||
<ul>
|
||||
<li><span class="parameter">rot</span>
|
||||
<span class="types"><a class="type" href="../3 primitive classes/Rotation.html#">Rotation</a></span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
Rotation in degrees defining the direction.
|
||||
</li>
|
||||
<li><span class="parameter">dist</span>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -952,6 +952,7 @@ DOPPELGANGER_ORIGIN
|
|||
CORPSE
|
||||
WRAITH_TRAP
|
||||
WATERFALL_EMITTER
|
||||
FIREFLY_EMITTER
|
||||
MESHSWAP1
|
||||
MESHSWAP2
|
||||
MESHSWAP3
|
||||
|
@ -1132,6 +1133,7 @@ AIR_BAR_TEXTURE
|
|||
DASH_BAR_TEXTURE
|
||||
SFX_BAR_TEXTURE
|
||||
WATERFALL_SPRITES
|
||||
FIREFLY_SPRITES
|
||||
CROSSHAIR_GRAPHICS
|
||||
SPEEDOMETER_GRAPHICS
|
||||
CUSTOM_BAR_GRAPHICS
|
||||
|
@ -1410,6 +1412,7 @@ AIR_BAR_TEXTURE
|
|||
DASH_BAR_TEXTURE
|
||||
SFX_BAR_TEXTURE
|
||||
WATERFALL_SPRITES
|
||||
FIREFLY_SPRITES
|
||||
CROSSHAIR_GRAPHICS
|
||||
SPEEDOMETER_GRAPHICS
|
||||
CUSTOM_BAR_GRAPHICS
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -294,7 +294,7 @@
|
|||
</li>
|
||||
<li><span class="parameter">pos</span>
|
||||
<span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span>
|
||||
X,Y position of the bar's background in screen percent (0-100).
|
||||
X,Y position of the diary background sprite in screen percent (0-100).
|
||||
</li>
|
||||
<li><span class="parameter">rot</span>
|
||||
<span class="types"><span class="type">float</span></span>
|
||||
|
@ -302,7 +302,7 @@
|
|||
</li>
|
||||
<li><span class="parameter">scale</span>
|
||||
<span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span>
|
||||
X,Y Scaling factor for the bar's background sprite.
|
||||
X,Y Scaling factor for the diary background sprite.
|
||||
</li>
|
||||
<li><span class="parameter">alignMode</span>
|
||||
<span class="types"><a class="type" href="../4 enums/View.AlignMode.html#">AlignMode</a></span>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -168,7 +168,7 @@ LevelFuncs.SpawnBaddy = <span class="keyword">function</span>(baddy, name, pos)
|
|||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" ><a href="#Create">Create(name, loop, timerFormat[, ...])</a></td>
|
||||
<td class="name" ><a href="#Create">Create(name, loop, timerFormat, [...])</a></td>
|
||||
<td class="summary">Create (but do not start) a new event sequence.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -206,7 +206,7 @@ LevelFuncs.SpawnBaddy = <span class="keyword">function</span>(baddy, name, pos)
|
|||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "Create"></a>
|
||||
<strong>Create(name, loop, timerFormat[, ...])</strong>
|
||||
<strong>Create(name, loop, timerFormat, [...])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Create (but do not start) a new event sequence.
|
||||
|
@ -229,7 +229,7 @@ LevelFuncs.SpawnBaddy = <span class="keyword">function</span>(baddy, name, pos)
|
|||
</li>
|
||||
<li><span class="parameter">...</span>
|
||||
a variable number of pairs of arguments - a time in seconds, followed by the function (must be defined in the LevelFuncs table) to call once the time has elapsed, followed by another duration in seconds, another function name, etc. You can specify a function either by its name as a string, or by a table with the function name as the first member, followed by its arguments (see above example).
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -152,7 +152,7 @@ LevelFuncs.TriggerTimer = <span class="keyword">function</span>(obj)
|
|||
<h2><a href="#Functions">Functions</a></h2>
|
||||
<table class="function_list">
|
||||
<tr>
|
||||
<td class="name" ><a href="#Create">Create(name, totalTime, loop, timerFormat, func[, ...])</a></td>
|
||||
<td class="name" ><a href="#Create">Create(name, totalTime, loop, timerFormat, func, [...])</a></td>
|
||||
<td class="summary">Create (but do not start) a new timer.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -160,7 +160,7 @@ LevelFuncs.TriggerTimer = <span class="keyword">function</span>(obj)
|
|||
<td class="summary">Get a timer by its name.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#myTimer:SetFunction">myTimer:SetFunction(func[, ...])</a></td>
|
||||
<td class="name" ><a href="#myTimer:SetFunction">myTimer:SetFunction(func, [...])</a></td>
|
||||
<td class="summary">Give the timer a new function and args</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -214,7 +214,7 @@ LevelFuncs.TriggerTimer = <span class="keyword">function</span>(obj)
|
|||
<dl class="function">
|
||||
<dt>
|
||||
<a name = "Create"></a>
|
||||
<strong>Create(name, totalTime, loop, timerFormat, func[, ...])</strong>
|
||||
<strong>Create(name, totalTime, loop, timerFormat, func, [...])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Create (but do not start) a new timer. </p>
|
||||
|
@ -267,7 +267,7 @@ LevelFuncs.TriggerTimer = <span class="keyword">function</span>(obj)
|
|||
</li>
|
||||
<li><span class="parameter">...</span>
|
||||
a variable number of arguments with which the above function will be called
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -312,7 +312,7 @@ LevelFuncs.TriggerTimer = <span class="keyword">function</span>(obj)
|
|||
</dd>
|
||||
<dt>
|
||||
<a name = "myTimer:SetFunction"></a>
|
||||
<strong>myTimer:SetFunction(func[, ...])</strong>
|
||||
<strong>myTimer:SetFunction(func, [...])</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Give the timer a new function and args
|
||||
|
@ -327,7 +327,7 @@ LevelFuncs.TriggerTimer = <span class="keyword">function</span>(obj)
|
|||
</li>
|
||||
<li><span class="parameter">...</span>
|
||||
a variable number of arguments with which the above function will be called
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<head>
|
||||
<title>TombEngine 1.8 Lua API</title>
|
||||
<title>TombEngine 1.8.1 Lua API</title>
|
||||
<link rel="stylesheet" href="ldoc.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
@ -115,7 +115,7 @@
|
|||
<div id="content">
|
||||
|
||||
|
||||
<h2>TombEngine 1.8 scripting interface</h2>
|
||||
<h2>TombEngine 1.8.1 scripting interface</h2>
|
||||
<p>Welcome to the TombEngine scripting API.</p>
|
||||
|
||||
<p>Note that this is primarily a reference document, not a tutorial, so expect descriptions to be fairly sparse.
|
||||
|
|
|
@ -216,12 +216,12 @@
|
|||
# end
|
||||
$(M(item.params.map[p],item))
|
||||
# if def == true then
|
||||
(<em>optional</em>)
|
||||
<em>Optional.</em>
|
||||
# elseif def then
|
||||
(<em>default</em> $(def))
|
||||
<em>Default: $(def).</em>
|
||||
# end
|
||||
# if item:readonly(p) then
|
||||
<em>readonly</em>
|
||||
<em>Read-only.</em>
|
||||
# end
|
||||
</li>
|
||||
# end
|
||||
|
|
56
README.md
56
README.md
|
@ -1,41 +1,41 @@
|
|||
# TombEngine
|
||||
# Tomb Engine
|
||||
|
||||

|
||||
|
||||
TombEngine (TEN) is an open-source, custom level engine which aims to abolish limits and fix bugs of the classic Tomb Raider games, introduce new features while refining old ones, and provide user-friendly level creation process. Current support includes:
|
||||
- Lua (as the native scripting language)
|
||||
- Many objects from the original series (1-5)
|
||||
- Support for high framerate, antialiasing, mipmapping and SSAO
|
||||
- Full diagonal geometry support
|
||||
- Uncapped map size
|
||||
- A streamlined player control scheme.
|
||||
*Tomb Engine* (*TEN*) is an open-source custom level engine which aims to abolish limits and fix bugs of the classic Tomb Raider games. It aims to introduce new features, refine old ones, and provide a user-friendly level creation process. Current support includes:
|
||||
- *Lua* as the native scripting language.
|
||||
- Many objects from the original series (1-5).
|
||||
- Support for high framerate, antialiasing, mipmapping, and SSAO.
|
||||
- Full diagonal geometry support.
|
||||
- Uncapped map size.
|
||||
- A streamlined player control scheme..
|
||||
|
||||
If you would like to participate in TEN discussion with other TEN devs whether it is contributing, bugs or general discussion, then join this discord server: https://discord.gg/h5tUYFmres
|
||||
Contributions are welcome. If you would like to participate in development to any degree, whether that be through suggestions, bug reports, or code, join our [Discord server](https://discord.gg/h5tUYFmres).
|
||||
|
||||
Tomb Engine should be used in conjuction with Tomb Editor. Tomb Editor is also open source written in C#, you can find the repository here: https://github.com/MontyTRC89/Tomb-Editor
|
||||
*Tomb Engine* is used in conjunction with *Tomb Editor*. The repository can be found [here](https://github.com/MontyTRC89/Tomb-Editor).
|
||||
|
||||
# Compiling TombEngine
|
||||
To compile TEN, ensure you have installed:
|
||||
- Microsoft Visual Studio
|
||||
- Tomb Editor (if you would like to create and test levels)
|
||||
# Compiling *Tomb Engine*
|
||||
To compile *TEN*, ensure you have installed:
|
||||
- *Microsoft Visual Studio*
|
||||
- *Tomb Editor* (for level creation and testing)
|
||||
|
||||
Steps:
|
||||
1) Clone the repository to your GitHub Desktop
|
||||
2) Open TombEngine.sln
|
||||
4) Compile the solution
|
||||
5) Once compiled, create a separate folder to serve as your main TEN directory (or create test TEN project using TombIDE)
|
||||
6) Copy everything inside the Build folder to the main TEN directory
|
||||
7) Ensure you have the necessary level data and texture files as well
|
||||
8) In the case Windows warns about missing DLLs, (bass.dll, etc.) copy the missing DLL files found inside the Libs folder to your main TEN directory.
|
||||
1) Clone the repository to your GitHub Desktop.
|
||||
2) Open `TombEngine.sln`.
|
||||
4) Compile the solution.
|
||||
5) Once compiled, create a separate folder to serve as your main *TEN* directory (or create a test *TEN* project using *TombIDE*)
|
||||
6) Copy everything inside the `Build` folder to the main *TEN* directory.
|
||||
7) Ensure you have the necessary level data and texture files.
|
||||
8) In case Windows warns about missing DLLs (bass.dll, etc.), copy the missing DLL files found inside the `Libs` folder to your main `TEN` directory.
|
||||
|
||||
Visual Studio may also warn about NuGet packages. To fix:
|
||||
1) Delete the Packages folder
|
||||
2) Go back to Microsoft Visual Studio
|
||||
3) Right-click on the TombEngine solution in the Solution Explorer tab and select "Restore NuGet Packages"
|
||||
4) If it doesn't help, manually install `directxtk_desktop_2019` and `Microsoft.XAudio2.Redist` packages via NuGet Package Manager
|
||||
*Visual Studio* may warn about NuGet packages. To fix:
|
||||
1) Delete the `Packages` folder.
|
||||
2) Go back to *Microsoft Visual Studio*.
|
||||
3) Right-click on the *TEN* solution in the *Solution Explorer* tab and select "Restore NuGet Packages".
|
||||
4) If it doesn't help, manually install `directxtk_desktop_2019` and `Microsoft.XAudio2.Redist` packages via NuGet Package Manager.
|
||||
|
||||
Once done, you should be able to build a level with TombEditor and run it in TEN.
|
||||
Once done, you should be able to build a level with *Tomb Editor* and run it in *TEN*.
|
||||
|
||||
# Disclaimer
|
||||
This is a community project which is not affiliated with Core Design, Eidos Interactive, or Embracer Group AB. Tomb Raider is a registered trademark of Embracer Group AB. TombEngine is not be sold. The code is open-source to encourage contributions and to be used for study purposes. We are not responsible for illegal uses of this source code. This source code is released as-is and continues to be maintained by non-paid contributors in their free time.
|
||||
This community project is unaffiliated with Core Design, Eidos Interactive, or Embracer Group AB. *Tomb Raider* is a registered trademark of Embracer Group AB. *Tomb Engine* is not for sale. The code is open-source to encourage contributions and for study purposes. We are not responsible for illegal uses of this source code. This source code is released as-is and continues to be maintained by non-paid contributors in their free time.
|
||||
|
||||
|
|
|
@ -531,9 +531,9 @@ end
|
|||
-- @tparam Objects.ObjID objectIdBg Object ID for the diary's sprite.
|
||||
-- @tparam int spriteIdBg SpriteID from the specified object for the diary's sprite.
|
||||
-- @tparam Color colorBg Color of diary's sprite.
|
||||
-- @tparam Vec2 pos X,Y position of the bar's background in screen percent (0-100).
|
||||
-- @tparam Vec2 pos X,Y position of the diary background sprite in screen percent (0-100).
|
||||
-- @tparam float rot rotation of the diary's sprite (0-360).
|
||||
-- @tparam Vec2 scale X,Y Scaling factor for the bar's background sprite.
|
||||
-- @tparam Vec2 scale X,Y Scaling factor for the diary background sprite.
|
||||
-- @tparam View.AlignMode alignMode Alignment for the diary's sprite.
|
||||
-- @tparam View.ScaleMode scaleMode Scaling for the diary's sprite.
|
||||
-- @tparam Effects.BlendID blendMode Blending modes for the diary's sprite.
|
||||
|
|
|
@ -19,7 +19,7 @@ local settings = Flow.Settings.new()
|
|||
settings.Flare.offset = Vec3(0, 0, 41)
|
||||
settings.Flare.range = 9
|
||||
settings.Flare.timeout = 60
|
||||
settings.Flare.lensflareBrightness = 0.5
|
||||
settings.Flare.lensflareBrightness = 1.0
|
||||
settings.Flare.sparks = true
|
||||
settings.Flare.smoke = true
|
||||
settings.Flare.flicker = true
|
||||
|
@ -35,6 +35,7 @@ local settings = Flow.Settings.new()
|
|||
|
||||
settings.System.errorMode = Flow.ErrorMode.WARN
|
||||
settings.System.fastReload = true
|
||||
settings.System.multithreaded = true
|
||||
|
||||
-- Hair[1] is normal player hair. Types [2] and [3] are for left and right young Lara hair.
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "Specific/clock.h"
|
||||
#include "Specific/Input/Input.h"
|
||||
#include "Specific/level.h"
|
||||
#include "Specific/trutils.h"
|
||||
|
||||
using namespace TEN::Animation;
|
||||
using namespace TEN::Collision::Point;
|
||||
|
@ -68,27 +69,6 @@ constexpr auto HK_RAPID_MODE_SHOT_INTERVAL = 3.0f;
|
|||
|
||||
constexpr auto SHOTGUN_PELLET_COUNT = 6;
|
||||
|
||||
static Vector3i GetWeaponSmokeRelOffset(LaraWeaponType weaponType)
|
||||
{
|
||||
switch (weaponType)
|
||||
{
|
||||
case LaraWeaponType::HK:
|
||||
return Vector3i(0, 228, 96);
|
||||
|
||||
case LaraWeaponType::Shotgun:
|
||||
return Vector3i(0, 228, 0);
|
||||
|
||||
case LaraWeaponType::GrenadeLauncher:
|
||||
return Vector3i(0, 180, 80);
|
||||
|
||||
case LaraWeaponType::RocketLauncher:
|
||||
return Vector3i(0, 84, 72);;
|
||||
|
||||
default:
|
||||
return Vector3i::Zero;
|
||||
}
|
||||
}
|
||||
|
||||
void AnimateShotgun(ItemInfo& laraItem, LaraWeaponType weaponType)
|
||||
{
|
||||
auto& player = *GetLaraInfo(&laraItem);
|
||||
|
@ -96,7 +76,7 @@ void AnimateShotgun(ItemInfo& laraItem, LaraWeaponType weaponType)
|
|||
|
||||
if (player.LeftArm.GunSmoke > 0)
|
||||
{
|
||||
auto relOffset = GetWeaponSmokeRelOffset(weaponType);
|
||||
auto relOffset = g_GameFlow->GetSettings()->Weapons[(int)weaponType - 1].MuzzleOffset.ToVector3();
|
||||
auto pos = GetJointPosition(&laraItem, LM_RHAND, relOffset);
|
||||
|
||||
if (laraItem.MeshBits.TestAny())
|
||||
|
@ -254,9 +234,8 @@ void AnimateShotgun(ItemInfo& laraItem, LaraWeaponType weaponType)
|
|||
player.Control.Weapon.Timer = 0.0f;
|
||||
}
|
||||
}
|
||||
else if (player.Control.Weapon.Timer != 0.0f)
|
||||
else if (weaponType == LaraWeaponType::HK && player.Control.Weapon.Timer != 0.0f)
|
||||
{
|
||||
SoundEffect(SFX_TR4_EXPLOSION1, &laraItem.Pose, SoundEnvironment::Land, 1.0f, 0.4f);
|
||||
SoundEffect(SFX_TR4_HK_FIRE, &laraItem.Pose);
|
||||
}
|
||||
else if (weaponType == LaraWeaponType::Shotgun && !IsHeld(In::Action) && !player.LeftArm.Locked)
|
||||
|
@ -335,9 +314,8 @@ void AnimateShotgun(ItemInfo& laraItem, LaraWeaponType weaponType)
|
|||
player.Control.Weapon.Timer = 0.0f;
|
||||
}
|
||||
}
|
||||
else if (player.Control.Weapon.Timer != 0.0f)
|
||||
else if (weaponType == LaraWeaponType::HK && player.Control.Weapon.Timer != 0.0f)
|
||||
{
|
||||
SoundEffect(SFX_TR4_EXPLOSION1, &laraItem.Pose, SoundEnvironment::Land, 1.0f, 0.4f);
|
||||
SoundEffect(SFX_TR4_HK_FIRE, &laraItem.Pose);
|
||||
}
|
||||
|
||||
|
@ -418,8 +396,10 @@ void FireShotgun(ItemInfo& laraItem)
|
|||
if (!ammo.HasInfinite())
|
||||
ammo--;
|
||||
|
||||
auto pos = GetJointPosition(&laraItem, LM_RHAND, Vector3i(0, 1508, 32));
|
||||
auto pos2 = GetJointPosition(&laraItem, LM_RHAND, Vector3i(0, 228, 32));
|
||||
auto offset = g_GameFlow->GetSettings()->Weapons[(int)LaraWeaponType::Shotgun].MuzzleOffset.ToVector3i();
|
||||
|
||||
auto pos = GetJointPosition(&laraItem, LM_RHAND, offset + Vector3::UnitY * CLICK(2));
|
||||
auto pos2 = GetJointPosition(&laraItem, LM_RHAND, offset);
|
||||
|
||||
player.LeftArm.GunSmoke = 32;
|
||||
|
||||
|
@ -1280,7 +1260,6 @@ void LasersightWeaponHandler(ItemInfo& item, LaraWeaponType weaponType)
|
|||
|
||||
if (playSound)
|
||||
{
|
||||
SoundEffect(SFX_TR4_EXPLOSION1, nullptr, SoundEnvironment::Land, 1.0f, 0.4f);
|
||||
SoundEffect(SFX_TR4_HK_FIRE, nullptr);
|
||||
Camera.bounce = -16 - (GetRandomControl() & 0x1F);
|
||||
}
|
||||
|
@ -1623,7 +1602,7 @@ void HandleProjectile(ItemInfo& projectile, ItemInfo& emitter, const Vector3i& p
|
|||
for (auto* itemPtr : collObjects.Items)
|
||||
{
|
||||
// Object was already affected by collision, skip it.
|
||||
if (std::find(affectedObjects.begin(), affectedObjects.end(), itemPtr->Index) != affectedObjects.end())
|
||||
if (TEN::Utils::Contains(affectedObjects, itemPtr->Index))
|
||||
continue;
|
||||
|
||||
const auto& currentObject = Objects[itemPtr->ObjectNumber];
|
||||
|
|
|
@ -46,24 +46,6 @@ static WeaponAnimData GetWeaponAnimData(LaraWeaponType weaponType)
|
|||
return ((it != ANIM_DATA_MAP.end()) ? it->second : ANIM_DATA_MAP.at(LaraWeaponType::None));
|
||||
}
|
||||
|
||||
static Vector3i GetWeaponSmokeRelOffset(LaraWeaponType weaponType, bool isRightWeapon)
|
||||
{
|
||||
switch (weaponType)
|
||||
{
|
||||
case LaraWeaponType::Pistol:
|
||||
return Vector3i(isRightWeapon ? -16 : 4, 128, 40);
|
||||
|
||||
case LaraWeaponType::Revolver:
|
||||
return Vector3i(isRightWeapon ? -32 : 16, 160, 56);
|
||||
|
||||
case LaraWeaponType::Uzi:
|
||||
return Vector3i(isRightWeapon ? -16 : 8, 140, 48);
|
||||
|
||||
default:
|
||||
return Vector3i::Zero;
|
||||
}
|
||||
}
|
||||
|
||||
static void SetArmInfo(const ItemInfo& laraItem, ArmInfo& arm, int frame)
|
||||
{
|
||||
const auto& player = GetLaraInfo(laraItem);
|
||||
|
@ -116,8 +98,9 @@ static void AnimateWeapon(ItemInfo& laraItem, LaraWeaponType weaponType, bool& h
|
|||
// Spawn weapon smoke.
|
||||
if (laraItem.MeshBits.TestAny() && arm.GunSmoke)
|
||||
{
|
||||
auto relOffset = GetWeaponSmokeRelOffset(weaponType, isRightWeapon);
|
||||
auto relOffset = g_GameFlow->GetSettings()->Weapons[(int)weaponType - 1].MuzzleOffset.ToVector3();
|
||||
auto pos = GetJointPosition(&laraItem, isRightWeapon ? LM_RHAND : LM_LHAND, relOffset);
|
||||
|
||||
TriggerGunSmoke(pos.x, pos.y, pos.z, 0, 0, 0, 0, weaponType, arm.GunSmoke);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "Objects/TR4/Entity/tr4_beetle_swarm.h"
|
||||
#include "Objects/Utils/object_helper.h"
|
||||
#include "Specific/level.h"
|
||||
#include "Objects/Effects/Fireflies.h"
|
||||
|
||||
using namespace TEN::Animation;
|
||||
using namespace TEN::Effects::Hair;
|
||||
|
@ -201,6 +202,7 @@ void InitializeSpecialEffects()
|
|||
|
||||
TEN::Entities::TR4::ClearBeetleSwarm();
|
||||
TEN::Entities::Creatures::TR3::ClearFishSwarm();
|
||||
TEN::Effects::Fireflies::ClearFireflySwarm();
|
||||
}
|
||||
|
||||
void CustomObjects()
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "Sound/sound.h"
|
||||
#include "Specific/Input/Input.h"
|
||||
#include "Specific/level.h"
|
||||
#include "Specific/trutils.h"
|
||||
#include "Specific/winmain.h"
|
||||
|
||||
using namespace TEN::Animation;
|
||||
|
@ -1393,7 +1394,7 @@ static std::vector<int> FillCollideableItemList()
|
|||
{
|
||||
const auto& item = g_Level.Items[i];
|
||||
|
||||
if (std::find(roomList.begin(), roomList.end(), item.RoomNumber) == roomList.end())
|
||||
if (!TEN::Utils::Contains(roomList, (int)item.RoomNumber))
|
||||
continue;
|
||||
|
||||
if (!g_Level.Rooms[item.RoomNumber].Active())
|
||||
|
|
|
@ -1151,6 +1151,7 @@ bool StalkBox(ItemInfo* item, ItemInfo* enemy, int boxNumber)
|
|||
{
|
||||
if (enemy == nullptr || boxNumber == NO_VALUE)
|
||||
return false;
|
||||
|
||||
auto* box = &g_Level.PathfindingBoxes[boxNumber];
|
||||
|
||||
int xRange = STALK_DIST + ((box->bottom - box->top) * BLOCK(1));
|
||||
|
@ -1636,8 +1637,11 @@ void CreatureMood(ItemInfo* item, AI_INFO* AI, bool isViolent)
|
|||
auto* LOT = &creature->LOT;
|
||||
|
||||
auto* enemy = creature->Enemy;
|
||||
if (enemy == nullptr)
|
||||
return;
|
||||
|
||||
// HACK: Fallback to bored mood from attack mood if enemy was cleared.
|
||||
// Replaces previous "fix" with early exit, because it was breaking friendly NPC pathfinding. -- Lwmte, 24.03.25
|
||||
if (enemy == nullptr && creature->Mood == MoodType::Attack)
|
||||
creature->Mood = MoodType::Bored;
|
||||
|
||||
int boxNumber;
|
||||
switch (creature->Mood)
|
||||
|
@ -1646,7 +1650,7 @@ void CreatureMood(ItemInfo* item, AI_INFO* AI, bool isViolent)
|
|||
boxNumber = LOT->Node[GetRandomControl() * LOT->ZoneCount >> 15].boxNumber;
|
||||
if (ValidBox(item, AI->zoneNumber, boxNumber))
|
||||
{
|
||||
if (StalkBox(item, enemy, boxNumber) && enemy->HitPoints > 0 && creature->Enemy)
|
||||
if (StalkBox(item, enemy, boxNumber) && creature->Enemy && enemy->HitPoints > 0)
|
||||
{
|
||||
TargetBox(LOT, boxNumber);
|
||||
creature->Mood = MoodType::Bored;
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
#include "Specific/Input/Input.h"
|
||||
#include "Specific/level.h"
|
||||
#include "Specific/winmain.h"
|
||||
#include "Objects/Effects/Fireflies.h"
|
||||
|
||||
using namespace std::chrono;
|
||||
using namespace TEN::Effects;
|
||||
|
@ -89,6 +90,7 @@ using namespace TEN::Math;
|
|||
using namespace TEN::Renderer;
|
||||
using namespace TEN::Entities::Creatures::TR3;
|
||||
using namespace TEN::Entities::Effects;
|
||||
using namespace TEN::Effects::Fireflies;
|
||||
|
||||
constexpr auto DEATH_NO_INPUT_TIMEOUT = 10 * FPS;
|
||||
constexpr auto DEATH_INPUT_TIMEOUT = 3 * FPS;
|
||||
|
@ -192,6 +194,7 @@ GameStatus GamePhase(bool insideMenu)
|
|||
UpdateBlood();
|
||||
UpdateBubbles();
|
||||
UpdateDebris();
|
||||
UpdateGunFlashes();
|
||||
UpdateGunShells();
|
||||
UpdateFootprints();
|
||||
UpdateSplashes();
|
||||
|
@ -211,6 +214,7 @@ GameStatus GamePhase(bool insideMenu)
|
|||
UpdateLocusts();
|
||||
UpdateUnderwaterBloodParticles();
|
||||
UpdateFishSwarm();
|
||||
UpdateFireflySwarm();
|
||||
UpdateGlobalLensFlare();
|
||||
|
||||
// Update HUD.
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include "Game/Setup.h"
|
||||
#include "Sound/sound.h"
|
||||
#include "Specific/level.h"
|
||||
#include "Objects/Effects/Fireflies.h"
|
||||
#include "Objects/Generic/puzzles_keys.h"
|
||||
#include "Objects/TR3/Entity/FishSwarm.h"
|
||||
#include "Objects/TR4/Entity/tr4_beetle_swarm.h"
|
||||
|
@ -29,6 +30,7 @@ using namespace TEN::Effects::Environment;
|
|||
using namespace TEN::Effects::Footprint;
|
||||
using namespace TEN::Effects::Hair;
|
||||
using namespace TEN::Entities::Creatures::TR3;
|
||||
using namespace TEN::Effects::Fireflies;
|
||||
|
||||
int FlipEffect;
|
||||
|
||||
|
@ -90,6 +92,7 @@ void ClearSwarmEnemies(ItemInfo* item)
|
|||
ClearBeetleSwarm();
|
||||
ClearLocusts();
|
||||
ClearFishSwarm();
|
||||
ClearFireflySwarm();
|
||||
}
|
||||
|
||||
void FlashOrange(ItemInfo* item)
|
||||
|
|
|
@ -942,6 +942,55 @@ void TriggerGunShell(short hand, short objNum, LaraWeaponType weaponType)
|
|||
}
|
||||
}
|
||||
|
||||
void UpdateGunFlashes()
|
||||
{
|
||||
if (Lara.Control.Weapon.GunType == LaraWeaponType::None)
|
||||
return;
|
||||
|
||||
const auto& settings = g_GameFlow->GetSettings()->Weapons[(int)Lara.Control.Weapon.GunType - 1];
|
||||
|
||||
if (!settings.MuzzleGlow)
|
||||
return;
|
||||
|
||||
for (int hand = 0; hand < 2; hand++)
|
||||
{
|
||||
if ((hand ? Lara.RightArm.GunFlash : Lara.LeftArm.GunFlash) == 0)
|
||||
continue;
|
||||
|
||||
auto& part = *GetFreeParticle();
|
||||
|
||||
part.on = true;
|
||||
part.SpriteSeqID = ID_DEFAULT_SPRITES;
|
||||
part.SpriteID = 11;
|
||||
part.blendMode = BlendMode::Additive;
|
||||
|
||||
auto pos = GetJointPosition(LaraItem, hand ? LM_RHAND : LM_LHAND, settings.MuzzleOffset.ToVector3i());
|
||||
part.x = pos.x;
|
||||
part.y = pos.y;
|
||||
part.z = pos.z;
|
||||
part.roomNumber = LaraItem->RoomNumber;
|
||||
|
||||
part.rotAng = ANGLE(TO_DEGREES(Random::GenerateAngle())) >> 4;
|
||||
part.rotAdd = 0;
|
||||
|
||||
part.sSize = part.size = part.dSize = 192;
|
||||
part.scalar = 2;
|
||||
|
||||
part.xVel = part.yVel = part.zVel = 0;
|
||||
part.gravity = part.friction = part.maxYvel = 0;
|
||||
|
||||
part.sR = part.dR = settings.FlashColor.GetR() / 2;
|
||||
part.sG = part.dG = settings.FlashColor.GetG() / 2;
|
||||
part.sB = part.dB = settings.FlashColor.GetB() / 2;
|
||||
|
||||
part.life = part.sLife = 2;
|
||||
part.colFadeSpeed = 1;
|
||||
part.fadeToBlack = 1;
|
||||
|
||||
part.flags = SP_SCALE | SP_DEF | SP_EXPDEF;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateGunShells()
|
||||
{
|
||||
for (int i = 0; i < MAX_GUNSHELL; i++)
|
||||
|
|
|
@ -323,6 +323,7 @@ void TriggerBlood(int x, int y, int z, int unk, int num);
|
|||
void UpdateBlood();
|
||||
int GetFreeGunshell();
|
||||
void TriggerGunShell(short hand, short objNum, LaraWeaponType weaponType);
|
||||
void UpdateGunFlashes();
|
||||
void UpdateGunShells();
|
||||
void AddWaterSparks(int x, int y, int z, int num);
|
||||
void ExplodingDeath(short itemNumber, short flags); // BODY_ flags
|
||||
|
|
|
@ -691,7 +691,7 @@ namespace TEN::Gui
|
|||
CurrentSettings.IgnoreInput = true;
|
||||
}
|
||||
|
||||
if (CurrentSettings.NewKeyWaitTimer > 0.0f)
|
||||
if (CurrentSettings.NewKeyWaitTimer > 0)
|
||||
{
|
||||
ClearAllActions();
|
||||
|
||||
|
@ -700,15 +700,15 @@ namespace TEN::Gui
|
|||
bool legacy30FpsDoneDraw = false;
|
||||
bool decreaseCounter = false;
|
||||
|
||||
while (CurrentSettings.NewKeyWaitTimer > 0.0f)
|
||||
while (CurrentSettings.NewKeyWaitTimer > 0)
|
||||
{
|
||||
g_Synchronizer.Sync();
|
||||
|
||||
while (g_Synchronizer.Synced())
|
||||
{
|
||||
CurrentSettings.NewKeyWaitTimer -= 1.0f;
|
||||
if (CurrentSettings.NewKeyWaitTimer <= 0.0f)
|
||||
CurrentSettings.NewKeyWaitTimer = 0.0f;
|
||||
CurrentSettings.NewKeyWaitTimer--;
|
||||
if (CurrentSettings.NewKeyWaitTimer <= 0)
|
||||
CurrentSettings.NewKeyWaitTimer = 0;
|
||||
|
||||
if (!fromPauseMenu)
|
||||
{
|
||||
|
@ -761,7 +761,7 @@ namespace TEN::Gui
|
|||
g_Bindings.SetKeyBinding(InputDeviceID::Custom, InputActionID(baseIndex + SelectedOption), selectedKeyID);
|
||||
DefaultConflict();
|
||||
|
||||
CurrentSettings.NewKeyWaitTimer = 0.0f;
|
||||
CurrentSettings.NewKeyWaitTimer = 0;
|
||||
CurrentSettings.IgnoreInput = true;
|
||||
return;
|
||||
}
|
||||
|
@ -851,6 +851,7 @@ namespace TEN::Gui
|
|||
if (SelectedOption == (OptionCount - 2))
|
||||
{
|
||||
SoundEffect(SFX_TR4_MENU_SELECT, nullptr, SoundEnvironment::Always);
|
||||
|
||||
ApplyDefaultBindings();
|
||||
return;
|
||||
}
|
||||
|
@ -859,9 +860,11 @@ namespace TEN::Gui
|
|||
if (SelectedOption == (OptionCount - 1))
|
||||
{
|
||||
SoundEffect(SFX_TR4_MENU_SELECT, nullptr, SoundEnvironment::Always);
|
||||
|
||||
CurrentSettings.Configuration.Bindings = g_Bindings.GetBindingProfile(InputDeviceID::Custom);
|
||||
g_Configuration.Bindings = g_Bindings.GetBindingProfile(InputDeviceID::Custom);
|
||||
SaveConfiguration();
|
||||
|
||||
MenuToDisplay = fromPauseMenu ? Menu::Pause : Menu::Options;
|
||||
SelectedOption = 2;
|
||||
return;
|
||||
|
@ -871,7 +874,9 @@ namespace TEN::Gui
|
|||
if (SelectedOption == OptionCount)
|
||||
{
|
||||
SoundEffect(SFX_TR4_MENU_SELECT, nullptr, SoundEnvironment::Always);
|
||||
|
||||
g_Bindings.SetBindingProfile(InputDeviceID::Custom, CurrentSettings.Configuration.Bindings);
|
||||
|
||||
MenuToDisplay = fromPauseMenu ? Menu::Pause : Menu::Options;
|
||||
SelectedOption = 2;
|
||||
return;
|
||||
|
@ -882,6 +887,8 @@ namespace TEN::Gui
|
|||
{
|
||||
SoundEffect(SFX_TR4_MENU_SELECT, nullptr, SoundEnvironment::Always);
|
||||
|
||||
g_Bindings.SetBindingProfile(InputDeviceID::Custom, CurrentSettings.Configuration.Bindings);
|
||||
|
||||
MenuToDisplay = Menu::Options;
|
||||
SelectedOption = 2;
|
||||
}
|
||||
|
|
|
@ -111,9 +111,9 @@ namespace TEN::Gui
|
|||
|
||||
GameConfiguration Configuration = {};
|
||||
|
||||
int SelectedScreenResolution = 0;
|
||||
bool IgnoreInput = false; // Ignore input until all actions are inactive.
|
||||
float NewKeyWaitTimer = 0.0f;
|
||||
int SelectedScreenResolution = 0;
|
||||
bool IgnoreInput = false; // Ignore input until all actions are inactive.
|
||||
int NewKeyWaitTimer = 0;
|
||||
};
|
||||
|
||||
class GuiController
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "Game/control/flipeffect.h"
|
||||
#include "Game/control/lot.h"
|
||||
#include "Game/control/volume.h"
|
||||
#include "Objects/Effects/Fireflies.h"
|
||||
#include "Game/effects/item_fx.h"
|
||||
#include "Game/effects/effects.h"
|
||||
#include "Game/effects/weather.h"
|
||||
|
@ -43,8 +44,9 @@
|
|||
using namespace flatbuffers;
|
||||
using namespace TEN::Collision::Floordata;
|
||||
using namespace TEN::Control::Volumes;
|
||||
using namespace TEN::Effects::Items;
|
||||
using namespace TEN::Effects::Environment;
|
||||
using namespace TEN::Effects::Fireflies;
|
||||
using namespace TEN::Effects::Items;
|
||||
using namespace TEN::Entities::Creatures::TR3;
|
||||
using namespace TEN::Entities::Generic;
|
||||
using namespace TEN::Entities::Switches;
|
||||
|
@ -923,6 +925,38 @@ const std::vector<byte> SaveGame::Build()
|
|||
}
|
||||
auto fishSwarmOffset = fbb.CreateVector(fishSwarm);
|
||||
|
||||
std::vector<flatbuffers::Offset<Save::FireflyData>> fireflySwarm;
|
||||
for (const auto& firefly : FireflySwarm)
|
||||
{
|
||||
Save::FireflyDataBuilder fireflySave{ fbb };
|
||||
fireflySave.add_sprite_index(firefly.SpriteSeqID);
|
||||
fireflySave.add_sprite_id(firefly.SpriteID);
|
||||
fireflySave.add_blend_mode((int)firefly.blendMode);
|
||||
fireflySave.add_scalar(firefly.scalar);
|
||||
fireflySave.add_position(&FromVector3(firefly.Position));
|
||||
fireflySave.add_room_number(firefly.RoomNumber);
|
||||
fireflySave.add_position_target(&FromVector3(firefly.PositionTarget));
|
||||
fireflySave.add_orientation(&FromEulerAngles(firefly.Orientation));
|
||||
fireflySave.add_velocity(firefly.Velocity);
|
||||
fireflySave.add_target_item_number((firefly.TargetItemPtr == nullptr) ? -1 : firefly.TargetItemPtr->Index);
|
||||
fireflySave.add_z_vel(firefly.zVel);
|
||||
fireflySave.add_life(firefly.Life);
|
||||
fireflySave.add_number(firefly.Number);
|
||||
fireflySave.add_d_r(firefly.rB);
|
||||
fireflySave.add_d_g(firefly.gB);
|
||||
fireflySave.add_d_b(firefly.bB);
|
||||
fireflySave.add_r(firefly.r);
|
||||
fireflySave.add_g(firefly.g);
|
||||
fireflySave.add_b(firefly.b);
|
||||
fireflySave.add_on(firefly.on);
|
||||
fireflySave.add_size(firefly.size);
|
||||
fireflySave.add_rot_Ang(firefly.rotAng);
|
||||
|
||||
auto fireflySaveOffset = fireflySave.Finish();
|
||||
fireflySwarm.push_back(fireflySaveOffset);
|
||||
}
|
||||
auto fireflySwarmOffset = fbb.CreateVector(fireflySwarm);
|
||||
|
||||
// TODO: In future, we should save only active FX, not whole array.
|
||||
// This may come together with Monty's branch merge -- Lwmte, 10.07.22
|
||||
|
||||
|
@ -1108,6 +1142,7 @@ const std::vector<byte> SaveGame::Build()
|
|||
levelData.add_sky_layer_2_color(level->GetSkyLayerColor(1));
|
||||
levelData.add_sky_layer_2_speed(level->GetSkyLayerSpeed(1));
|
||||
|
||||
levelData.add_lensflare_enabled(level->LensFlare.GetEnabled());
|
||||
levelData.add_lensflare_color(level->LensFlare.GetColor());
|
||||
levelData.add_lensflare_pitch(level->LensFlare.GetPitch());
|
||||
levelData.add_lensflare_yaw(level->LensFlare.GetYaw());
|
||||
|
@ -1544,6 +1579,7 @@ const std::vector<byte> SaveGame::Build()
|
|||
sgb.add_next_item_active(NextItemActive);
|
||||
sgb.add_items(serializedItemsOffset);
|
||||
sgb.add_fish_swarm(fishSwarmOffset);
|
||||
sgb.add_firefly_swarm(fireflySwarmOffset);
|
||||
sgb.add_fxinfos(serializedEffectsOffset);
|
||||
sgb.add_next_fx_free(NextFxFree);
|
||||
sgb.add_next_fx_active(NextFxActive);
|
||||
|
@ -1808,6 +1844,7 @@ static void ParseLua(const Save::SaveGame* s, bool hubMode)
|
|||
level->Layer2.CloudSpeed = s->level_data()->sky_layer_2_speed();
|
||||
level->Layer2.SetColor(s->level_data()->sky_layer_2_color());
|
||||
|
||||
level->LensFlare.SetEnabled(s->level_data()->lensflare_enabled());
|
||||
level->LensFlare.SetSunSpriteID(s->level_data()->lensflare_sprite_id());
|
||||
level->LensFlare.SetPitch(s->level_data()->lensflare_pitch());
|
||||
level->LensFlare.SetYaw(s->level_data()->lensflare_yaw());
|
||||
|
@ -2286,6 +2323,38 @@ static void ParseEffects(const Save::SaveGame* s)
|
|||
FishSwarm.push_back(fish);
|
||||
}
|
||||
|
||||
// Load firefly swarm.
|
||||
for (int i = 0; i < s->firefly_swarm()->size(); i++)
|
||||
{
|
||||
const auto& fireflySave = s->firefly_swarm()->Get(i);
|
||||
auto firefly = FireflyData{};
|
||||
|
||||
firefly.SpriteSeqID = fireflySave->sprite_index();
|
||||
firefly.SpriteID = fireflySave->sprite_id();
|
||||
firefly.blendMode = (BlendMode)fireflySave->blend_mode();
|
||||
firefly.scalar = fireflySave->scalar();
|
||||
firefly.Position = ToVector3(fireflySave->position());
|
||||
firefly.RoomNumber = fireflySave->room_number();
|
||||
firefly.PositionTarget = ToVector3(fireflySave->position_target());
|
||||
firefly.Orientation = ToEulerAngles(fireflySave->orientation());
|
||||
firefly.Velocity = fireflySave->velocity();
|
||||
firefly.TargetItemPtr = (fireflySave->target_item_number() == -1) ? nullptr : &g_Level.Items[fireflySave->target_item_number()];
|
||||
firefly.zVel = fireflySave->z_vel();
|
||||
firefly.Life = fireflySave->life();
|
||||
firefly.Number = fireflySave->number();
|
||||
firefly.rB = fireflySave->d_r();
|
||||
firefly.gB = fireflySave->d_g();
|
||||
firefly.bB = fireflySave->d_b();
|
||||
firefly.r = fireflySave->r();
|
||||
firefly.g = fireflySave->g();
|
||||
firefly.b = fireflySave->b();
|
||||
firefly.on = fireflySave->on();
|
||||
firefly.size = fireflySave->size();
|
||||
firefly.rotAng = fireflySave->rot_Ang();
|
||||
|
||||
FireflySwarm.push_back(firefly);
|
||||
}
|
||||
|
||||
// Load particles.
|
||||
for (int i = 0; i < s->particles()->size(); i++)
|
||||
{
|
||||
|
|
|
@ -840,14 +840,27 @@ int Spline(int x, int* knots, int nk)
|
|||
return ((__int64)x * (((__int64)x * (((__int64)x * c1 >> 16) + c2) >> 16) + (k[2] >> 1) + ((-k[0] - 1) >> 1)) >> 16) + k[1];
|
||||
}
|
||||
|
||||
Pose GetCameraTransform(int sequence, float alpha)
|
||||
Pose GetCameraTransform(int sequence, float alpha, bool loop)
|
||||
{
|
||||
constexpr auto BLEND_RANGE = 0.1f;
|
||||
constexpr auto BLEND_START = BLEND_RANGE;
|
||||
constexpr auto BLEND_END = 1.0f - BLEND_RANGE;
|
||||
|
||||
alpha = std::clamp(alpha, 0.0f, 1.0f);
|
||||
|
||||
if (sequence < 0 || sequence >= MAX_SPOTCAMS)
|
||||
{
|
||||
TENLog("Wrong flyby sequence number provided for getting camera coordinates.", LogLevel::Warning);
|
||||
return Pose::Zero;
|
||||
}
|
||||
|
||||
// Retrieve camera count in sequence.
|
||||
int cameraCount = CameraCnt[SpotCamRemap[sequence]];
|
||||
if (cameraCount < 2)
|
||||
return Pose::Zero; // Not enough cameras to interpolate.
|
||||
{
|
||||
TENLog("Not enough cameras in flyby sequence to calculate the coordinates.", LogLevel::Warning);
|
||||
return Pose::Zero;
|
||||
}
|
||||
|
||||
// Find first ID for sequence.
|
||||
int firstSeqID = 0;
|
||||
|
@ -874,15 +887,39 @@ Pose GetCameraTransform(int sequence, float alpha)
|
|||
}
|
||||
|
||||
// Compute spline interpolation of main flyby camera parameters.
|
||||
auto origin = Vector3(Spline(splineAlpha, xOrigins.data(), splinePoints),
|
||||
Spline(splineAlpha, yOrigins.data(), splinePoints),
|
||||
Spline(splineAlpha, zOrigins.data(), splinePoints));
|
||||
auto getInterpolatedPoint = [&](float t, std::vector<int>& x, std::vector<int>& y, std::vector<int>& z)
|
||||
{
|
||||
int tAlpha = int(t * (float)USHRT_MAX);
|
||||
return Vector3(Spline(tAlpha, x.data(), splinePoints),
|
||||
Spline(tAlpha, y.data(), splinePoints),
|
||||
Spline(tAlpha, z.data(), splinePoints));
|
||||
};
|
||||
|
||||
auto target = Vector3(Spline(splineAlpha, xTargets.data(), splinePoints),
|
||||
Spline(splineAlpha, yTargets.data(), splinePoints),
|
||||
Spline(splineAlpha, zTargets.data(), splinePoints));
|
||||
auto getInterpolatedRoll = [&](float t)
|
||||
{
|
||||
int tAlpha = int(t * (float)USHRT_MAX);
|
||||
return Spline(tAlpha, rolls.data(), splinePoints);
|
||||
};
|
||||
|
||||
short orientZ = Spline(splineAlpha, rolls.data(), splinePoints);
|
||||
auto origin = Vector3::Zero;
|
||||
auto target = Vector3::Zero;
|
||||
short orientZ = 0;
|
||||
|
||||
// If loop is enabled and alpha is at sequence start or end, blend between last and first cameras.
|
||||
if (loop && (alpha < BLEND_START || alpha >= BLEND_END))
|
||||
{
|
||||
float blendFactor = (alpha < BLEND_START) ? (0.5f + ((alpha / BLEND_RANGE) * 0.5f)) : (((alpha - BLEND_END) / BLEND_START) * 0.5f);
|
||||
|
||||
origin = Vector3::Lerp(getInterpolatedPoint(BLEND_END, xOrigins, yOrigins, zOrigins), getInterpolatedPoint(BLEND_START, xOrigins, yOrigins, zOrigins), blendFactor);
|
||||
target = Vector3::Lerp(getInterpolatedPoint(BLEND_END, xTargets, yTargets, zTargets), getInterpolatedPoint(BLEND_START, xTargets, yTargets, zTargets), blendFactor);
|
||||
orientZ = Lerp(getInterpolatedRoll(BLEND_END), getInterpolatedRoll(BLEND_START), blendFactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
origin = getInterpolatedPoint(alpha, xOrigins, yOrigins, zOrigins);
|
||||
target = getInterpolatedPoint(alpha, xTargets, yTargets, zTargets);
|
||||
orientZ = getInterpolatedRoll(alpha);
|
||||
}
|
||||
|
||||
auto pose = Pose(origin, EulerAngles(target - origin));
|
||||
pose.Orientation.z = orientZ;
|
||||
|
|
|
@ -64,4 +64,4 @@ void InitializeSpotCam(short sequence);
|
|||
void CalculateSpotCameras();
|
||||
int Spline(int x, int* knots, int nk);
|
||||
|
||||
Pose GetCameraTransform(int sequence, float alpha);
|
||||
Pose GetCameraTransform(int sequence, float alpha, bool loop);
|
||||
|
|
445
TombEngine/Objects/Effects/Fireflies.cpp
Normal file
445
TombEngine/Objects/Effects/Fireflies.cpp
Normal file
|
@ -0,0 +1,445 @@
|
|||
#include "framework.h"
|
||||
#include "Objects/Effects/Fireflies.h"
|
||||
|
||||
#include "Game/collision/collide_item.h"
|
||||
#include "Game/collision/collide_room.h"
|
||||
#include "Game/collision/Point.h"
|
||||
#include "Game/control/box.h"
|
||||
#include "Game/control/flipeffect.h"
|
||||
#include "Game/effects/effects.h"
|
||||
#include "Game/effects/Streamer.h"
|
||||
#include "Game/effects/tomb4fx.h"
|
||||
#include "Game/items.h"
|
||||
#include "Game/Lara/lara.h"
|
||||
#include "Game/Lara/lara_helpers.h"
|
||||
#include "Game/misc.h"
|
||||
#include "Game/Setup.h"
|
||||
#include "Math/Math.h"
|
||||
#include "Renderer/Renderer.h"
|
||||
#include "Specific/clock.h"
|
||||
#include "Specific/level.h"
|
||||
|
||||
using namespace TEN::Collision::Point;
|
||||
using namespace TEN::Math;
|
||||
using namespace TEN::Renderer;
|
||||
using namespace TEN::Effects::Streamer;
|
||||
|
||||
namespace TEN::Effects::Fireflies
|
||||
{
|
||||
constexpr auto FIREFLY_COHESION_FACTOR = 600.1f;
|
||||
constexpr auto FIREFLY_SPACING_FACTOR = 600.0f;
|
||||
constexpr auto FIREFLY_CATCH_UP_FACTOR = 0.2f;
|
||||
constexpr auto FIREFLY_TARGET_DISTANCE_MAX = SQUARE(BLOCK(1.0f));
|
||||
constexpr auto FIREFLY_BASE_SEPARATION_DISTANCE = 10.0f;
|
||||
constexpr auto FIREFLY_FLEE_DISTANCE = BLOCK(0.7);
|
||||
constexpr auto MAX_FIREFLIES = 92;
|
||||
constexpr auto DEFAULT_FIREFLY_COUNT = 20;
|
||||
constexpr auto FIREFLY_RISE_UP_FACTOR = 200;
|
||||
constexpr auto MAX_AREA_RANGE = 8;
|
||||
constexpr auto LIGHT_ALPHA_CYCLE_DURATION = 120.0f;
|
||||
|
||||
std::vector<FireflyData> FireflySwarm = {};
|
||||
std::unordered_map<int, int> nextFireflyNumberMap; // Numbering the Fireflies for Streamer effect.
|
||||
|
||||
void InitializeFireflySwarm(short itemNumber)
|
||||
{
|
||||
auto& item = g_Level.Items[itemNumber];
|
||||
|
||||
item.Animation.Velocity.z = Random::GenerateFloat(32.0f, 160.0f);
|
||||
|
||||
item.HitPoints = DEFAULT_FIREFLY_COUNT;
|
||||
item.ItemFlags[FirefliesItemFlags::TargetItemPtr] = item.Index;
|
||||
item.ItemFlags[FirefliesItemFlags::Light] = 1; // 0 = Turn off light effect, 1 = turn on light (DEFAULT).
|
||||
|
||||
item.ItemFlags[FirefliesItemFlags::TriggerFlags] = std::clamp((int)item.TriggerFlags, -MAX_AREA_RANGE, MAX_AREA_RANGE);
|
||||
|
||||
item.ItemFlags[FirefliesItemFlags::Spawncounter] = 0;
|
||||
item.ItemFlags[FirefliesItemFlags::RemoveFliesEffect] = 0;
|
||||
|
||||
// Firefly numbers that has the light.
|
||||
item.ItemFlags[FirefliesItemFlags::LightIndex1] = NO_VALUE;
|
||||
item.ItemFlags[FirefliesItemFlags::LightIndex2] = NO_VALUE;
|
||||
}
|
||||
|
||||
void SpawnFireflySwarm(ItemInfo& item, int triggerFlags)
|
||||
{
|
||||
constexpr auto VEL_MAX = 34.0f;
|
||||
constexpr auto VEL_MIN = 6.0f;
|
||||
|
||||
// Create new firefly.
|
||||
auto& firefly = GetNewEffect(FireflySwarm, MAX_FIREFLIES);
|
||||
|
||||
unsigned char r = 255;
|
||||
unsigned char g = 255;
|
||||
unsigned char b = 255;
|
||||
|
||||
if (triggerFlags >= 0)
|
||||
{
|
||||
float brightnessShift = Random::GenerateFloat(-0.1f, 0.1f);
|
||||
r = std::clamp(item.Model.Color.x / 2.0f + brightnessShift, 0.0f, 1.0f) * UCHAR_MAX;
|
||||
g = std::clamp(item.Model.Color.y / 2.0f + brightnessShift, 0.0f, 1.0f) * UCHAR_MAX;
|
||||
b = std::clamp(item.Model.Color.z / 2.0f + brightnessShift, 0.0f, 1.0f) * UCHAR_MAX;
|
||||
|
||||
firefly.SpriteSeqID = ID_FIREFLY_SPRITES;
|
||||
firefly.SpriteID = 0;
|
||||
firefly.blendMode = BlendMode::Additive;
|
||||
firefly.scalar = 3.0f;
|
||||
firefly.size = 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
firefly.SpriteSeqID = ID_FIREFLY_SPRITES;
|
||||
firefly.SpriteID = 1;
|
||||
firefly.blendMode = BlendMode::Subtractive;
|
||||
firefly.scalar = 1.2f;
|
||||
firefly.size = 1.2f;
|
||||
}
|
||||
|
||||
firefly.r = firefly.rB = r;
|
||||
firefly.g = firefly.gB = g;
|
||||
firefly.b = firefly.bB = b;
|
||||
|
||||
firefly.rotAng = ANGLE(0.0f);
|
||||
|
||||
if (item.TriggerFlags > 8)
|
||||
firefly.rotAng = ANGLE(90.0f);
|
||||
|
||||
firefly.on = true;
|
||||
|
||||
firefly.Position = item.Pose.Position.ToVector3();
|
||||
firefly.RoomNumber = item.RoomNumber;
|
||||
firefly.Orientation = item.Pose.Orientation;
|
||||
firefly.Velocity = Random::GenerateFloat(VEL_MIN, VEL_MAX);
|
||||
firefly.zVel = 0.3f;
|
||||
|
||||
firefly.Life = Random::GenerateInt(1, 400);
|
||||
firefly.TargetItemPtr = &g_Level.Items[item.ItemFlags[FirefliesItemFlags::TargetItemPtr]];
|
||||
|
||||
int& nextFireflyNumber = nextFireflyNumberMap[item.Index];
|
||||
firefly.Number = nextFireflyNumber++;
|
||||
}
|
||||
|
||||
void ControlFireflySwarm(short itemNumber)
|
||||
{
|
||||
auto& item = g_Level.Items[itemNumber];
|
||||
|
||||
if (!TriggerActive(&item))
|
||||
{
|
||||
// Remove all fireflies associated with this item.
|
||||
RemoveFireflies(item);
|
||||
|
||||
// Reset ItemFlags.
|
||||
if (item.HitPoints == NOT_TARGETABLE)
|
||||
item.HitPoints = item.ItemFlags[FirefliesItemFlags::Spawncounter];
|
||||
|
||||
item.ItemFlags[FirefliesItemFlags::Spawncounter] = 0;
|
||||
item.ItemFlags[FirefliesItemFlags::LightIndex1] = NO_VALUE;
|
||||
item.ItemFlags[FirefliesItemFlags::LightIndex2] = NO_VALUE;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
constexpr auto ALPHA_PAUSE_DURATION = 2.0f;
|
||||
static float frameCounter = 0.0f;
|
||||
|
||||
// Increment the counter variable in each frame.
|
||||
frameCounter += 1.0f;
|
||||
|
||||
if (item.HitPoints != NOT_TARGETABLE)
|
||||
{
|
||||
int fireflyCount = item.HitPoints - item.ItemFlags[FirefliesItemFlags::Spawncounter];
|
||||
|
||||
if (fireflyCount < 0)
|
||||
{
|
||||
int firefliesToTurnOff = -fireflyCount;
|
||||
for (auto& firefly : FireflySwarm)
|
||||
{
|
||||
if (firefly.TargetItemPtr == &item && firefly.Life > 0.0f)
|
||||
{
|
||||
firefly.Life = 0.0f;
|
||||
firefly.on = false;
|
||||
firefliesToTurnOff--;
|
||||
|
||||
if (firefliesToTurnOff == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (fireflyCount > 0)
|
||||
{
|
||||
for (int i = 0; i < fireflyCount; i++)
|
||||
{
|
||||
SpawnFireflySwarm(item, item.TriggerFlags);
|
||||
}
|
||||
}
|
||||
|
||||
item.ItemFlags[FirefliesItemFlags::Spawncounter] = item.HitPoints;
|
||||
item.HitPoints = NOT_TARGETABLE;
|
||||
}
|
||||
|
||||
// Update color values for blinking effect.
|
||||
float alphaFactor;
|
||||
|
||||
for (auto& firefly : FireflySwarm)
|
||||
{
|
||||
auto targetItem = firefly.TargetItemPtr;
|
||||
|
||||
if (targetItem == &item)
|
||||
{
|
||||
// Choose one of the available firefly number that has the light.
|
||||
if (targetItem->ItemFlags[FirefliesItemFlags::LightIndex1] == NO_VALUE && targetItem->ItemFlags[FirefliesItemFlags::TriggerFlags] >= 0)
|
||||
{
|
||||
targetItem->ItemFlags[FirefliesItemFlags::LightIndex1] = Random::GenerateInt(0, targetItem->TriggerFlags);
|
||||
}
|
||||
// Two lights max for each cluster.
|
||||
if (targetItem->ItemFlags[FirefliesItemFlags::LightIndex2] == NO_VALUE && targetItem->ItemFlags[FirefliesItemFlags::TriggerFlags] >= 0)
|
||||
{
|
||||
targetItem->ItemFlags[FirefliesItemFlags::LightIndex2] = Random::GenerateInt(0, targetItem->TriggerFlags);
|
||||
}
|
||||
|
||||
auto posBase = firefly.Position;
|
||||
auto rotMatrix = firefly.Orientation.ToRotationMatrix();
|
||||
auto pos = posBase + Vector3::Transform(Vector3(0, 0, 30), rotMatrix);
|
||||
auto direction0 = Geometry::RotatePoint(posBase, EulerAngles::Identity);
|
||||
short orient2D = firefly.Orientation.z;
|
||||
|
||||
if (targetItem->ItemFlags[FirefliesItemFlags::TriggerFlags] >= 0)
|
||||
{
|
||||
StreamerEffect.Spawn(targetItem->Index, firefly.Number, pos, direction0, orient2D,
|
||||
Vector4(firefly.r / (float)UCHAR_MAX, firefly.g / (float)UCHAR_MAX, firefly.b / (float)UCHAR_MAX, 1.0f),
|
||||
Vector4::Zero,
|
||||
6.3f - (firefly.zVel / 12), ((firefly.Velocity / 8) + firefly.zVel * 3) / (float)UCHAR_MAX, 0.0f, -0.1f, 90.0f, StreamerFeatherMode::None, BlendMode::Additive);
|
||||
}
|
||||
else if (targetItem->ItemFlags[FirefliesItemFlags::TriggerFlags] < 0)
|
||||
{
|
||||
StreamerEffect.Spawn(targetItem->Index, firefly.Number, pos, direction0, orient2D,
|
||||
Vector4((firefly.r / 2) / (float)UCHAR_MAX, (firefly.g / 2) / (float)UCHAR_MAX, (firefly.b / 2) / (float)UCHAR_MAX, 0.2f),
|
||||
Vector4((firefly.r / 3) / (float)UCHAR_MAX, (firefly.g / 3) / (float)UCHAR_MAX, (firefly.b / 3) / (float)UCHAR_MAX, 0.2f),
|
||||
0.0f, 0.4f, 0.0f, 0.2f, 0.0f, StreamerFeatherMode::None, BlendMode::Subtractive);
|
||||
}
|
||||
|
||||
if ((targetItem->ItemFlags[FirefliesItemFlags::LightIndex1] == firefly.Number || targetItem->ItemFlags[FirefliesItemFlags::LightIndex2] == firefly.Number) &&
|
||||
targetItem->ItemFlags[FirefliesItemFlags::Light] == 1)
|
||||
{
|
||||
float totalCycleDuration = 2 * (LIGHT_ALPHA_CYCLE_DURATION + ALPHA_PAUSE_DURATION);
|
||||
float alphaTime = fmod(frameCounter, totalCycleDuration);
|
||||
|
||||
if (alphaTime < ALPHA_PAUSE_DURATION)
|
||||
{
|
||||
alphaFactor = 1.0f; // Pause on Alpha 1.
|
||||
}
|
||||
else if (alphaTime < ALPHA_PAUSE_DURATION + LIGHT_ALPHA_CYCLE_DURATION)
|
||||
{
|
||||
alphaFactor = 1.0f - ((alphaTime - ALPHA_PAUSE_DURATION) / LIGHT_ALPHA_CYCLE_DURATION);
|
||||
}
|
||||
else if (alphaTime < 2 * ALPHA_PAUSE_DURATION + LIGHT_ALPHA_CYCLE_DURATION)
|
||||
{
|
||||
alphaFactor = 0.0f; // Pause on Alpha 0.
|
||||
targetItem->ItemFlags[FirefliesItemFlags::LightIndex1] = NO_VALUE;
|
||||
targetItem->ItemFlags[FirefliesItemFlags::LightIndex2] = NO_VALUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
alphaFactor = (alphaTime - 2 * ALPHA_PAUSE_DURATION - LIGHT_ALPHA_CYCLE_DURATION) / LIGHT_ALPHA_CYCLE_DURATION;
|
||||
}
|
||||
|
||||
SpawnDynamicLight(firefly.Position.x, firefly.Position.y, firefly.Position.z, 3,
|
||||
static_cast<unsigned char>(std::clamp(firefly.r * alphaFactor, 0.0f, (float)firefly.r)),
|
||||
static_cast<unsigned char>(std::clamp(firefly.g * alphaFactor, 0.0f, (float)firefly.g)),
|
||||
static_cast<unsigned char>(std::clamp(firefly.b * alphaFactor, 0.0f, (float)firefly.b)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateFireflySwarm()
|
||||
{
|
||||
constexpr auto FLEE_VEL = 1.5f;
|
||||
constexpr auto ALPHA_PAUSE_DURATION = 100.0f;
|
||||
|
||||
static const auto SPHERE = BoundingSphere(Vector3::Zero, BLOCK(1 / 8.0f));
|
||||
|
||||
if (FireflySwarm.empty())
|
||||
return;
|
||||
|
||||
const auto& playerItem = *LaraItem;
|
||||
static float frameCounter = 0.0f;
|
||||
|
||||
// Increment the counter variable in each frame.
|
||||
frameCounter += 1.0f;
|
||||
|
||||
for (auto& firefly : FireflySwarm)
|
||||
{
|
||||
if (firefly.Life <= 0.0f || !firefly.on)
|
||||
continue;
|
||||
|
||||
auto targetItem = firefly.TargetItemPtr;
|
||||
|
||||
if (targetItem->ItemFlags[FirefliesItemFlags::RemoveFliesEffect])
|
||||
{
|
||||
firefly.r = 0;
|
||||
firefly.g = 0;
|
||||
firefly.b = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
firefly.StoreInterpolationData();
|
||||
|
||||
firefly.PositionTarget = Random::GeneratePointInSphere(SPHERE);
|
||||
|
||||
int multiplierX = CLICK(targetItem->ItemFlags[FirefliesItemFlags::TriggerFlags] * 2);
|
||||
int multiplierY = CLICK(targetItem->ItemFlags[FirefliesItemFlags::TriggerFlags] * 4);
|
||||
int multiplierZ = CLICK(targetItem->ItemFlags[FirefliesItemFlags::TriggerFlags] * 2);
|
||||
|
||||
auto spheroidAxis = Vector3(multiplierX, multiplierY, multiplierZ);
|
||||
auto itemPos = Vector3i(targetItem->Pose.Position.x, targetItem->Pose.Position.y - FIREFLY_RISE_UP_FACTOR, targetItem->Pose.Position.z);
|
||||
|
||||
// Calculate desired position based on target object and random offsets.
|
||||
auto desiredPos = itemPos + Random::GeneratePointInSpheroid(firefly.PositionTarget, EulerAngles::Identity, spheroidAxis);
|
||||
auto dir = desiredPos - firefly.Position;
|
||||
|
||||
auto dirs = dir.ToVector3();
|
||||
dirs.Normalize();
|
||||
auto dirNorm = dirs;
|
||||
|
||||
// Define cohesion factor to keep fireflies close together.
|
||||
float distToTarget = dirs.Length();
|
||||
|
||||
float targetVel = (distToTarget * FIREFLY_COHESION_FACTOR) + Random::GenerateFloat(3.0f, 5.0f);
|
||||
firefly.Velocity = std::min(targetVel, targetItem->Animation.Velocity.z - 21.0f);
|
||||
|
||||
// If firefly is too far from target, increase velocity to catch up.
|
||||
if (distToTarget > FIREFLY_TARGET_DISTANCE_MAX)
|
||||
firefly.Velocity += FIREFLY_CATCH_UP_FACTOR;
|
||||
|
||||
// Translate.
|
||||
auto moveDir = firefly.Orientation.ToDirection();
|
||||
moveDir.Normalize();
|
||||
firefly.Position += (moveDir * firefly.Velocity) / 26.0f;
|
||||
firefly.Position += (moveDir * FIREFLY_SPACING_FACTOR) / 26.0f;
|
||||
|
||||
auto orientTo = Geometry::GetOrientToPoint(firefly.Position, desiredPos.ToVector3());
|
||||
firefly.Orientation.Lerp(orientTo, 0.1f);
|
||||
|
||||
// Update color values for blinking effect.
|
||||
float totalCycleDuration = 2 * (LIGHT_ALPHA_CYCLE_DURATION + ALPHA_PAUSE_DURATION);
|
||||
float alphaTime = fmod(frameCounter + firefly.Life, totalCycleDuration);
|
||||
float alphaFactor;
|
||||
|
||||
if (alphaTime < ALPHA_PAUSE_DURATION)
|
||||
{
|
||||
alphaFactor = 1.0f;
|
||||
}
|
||||
else if (alphaTime < ALPHA_PAUSE_DURATION + LIGHT_ALPHA_CYCLE_DURATION)
|
||||
{
|
||||
alphaFactor = 1.0f - ((alphaTime - ALPHA_PAUSE_DURATION) / LIGHT_ALPHA_CYCLE_DURATION);
|
||||
}
|
||||
else if (alphaTime < 2 * ALPHA_PAUSE_DURATION + LIGHT_ALPHA_CYCLE_DURATION)
|
||||
{
|
||||
alphaFactor = 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
alphaFactor = (alphaTime - 2 * ALPHA_PAUSE_DURATION - LIGHT_ALPHA_CYCLE_DURATION) / LIGHT_ALPHA_CYCLE_DURATION;
|
||||
}
|
||||
|
||||
firefly.r = static_cast<unsigned char>(firefly.rB * alphaFactor);
|
||||
firefly.g = static_cast<unsigned char>(firefly.gB * alphaFactor);
|
||||
firefly.b = static_cast<unsigned char>(firefly.bB * alphaFactor);
|
||||
|
||||
for (const auto& otherFirefly : FireflySwarm)
|
||||
{
|
||||
if (&firefly == &otherFirefly)
|
||||
continue;
|
||||
|
||||
float distToOtherFirefly = Vector3i::Distance(firefly.Position, otherFirefly.Position);
|
||||
float distToPlayer = Vector3i::Distance(firefly.Position, playerItem.Pose.Position);
|
||||
|
||||
// If player is too close, flee.
|
||||
if (distToPlayer < FIREFLY_FLEE_DISTANCE && playerItem.Animation.ActiveState != 2)
|
||||
{
|
||||
auto separationDir = firefly.Position - playerItem.Pose.Position.ToVector3();
|
||||
separationDir.Normalize();
|
||||
|
||||
// Reduce the Y component of the escape direction.
|
||||
separationDir.y *= Random::GenerateFloat(0.0f, 0.4f);
|
||||
|
||||
// Normalize the direction again to get the length of the vector.
|
||||
separationDir.Normalize();
|
||||
|
||||
firefly.Position += separationDir * FLEE_VEL;
|
||||
|
||||
auto orientTo = Geometry::GetOrientToPoint(firefly.Position, separationDir);
|
||||
firefly.Orientation.Lerp(orientTo, 0.05f);
|
||||
|
||||
firefly.Velocity -= std::min(FLEE_VEL, firefly.TargetItemPtr->Animation.Velocity.z - 1.0f);
|
||||
|
||||
if (Random::TestProbability(1.0f / 700.0f) &&
|
||||
targetItem->ItemFlags[FirefliesItemFlags::Light] == 1 &&
|
||||
targetItem->ItemFlags[FirefliesItemFlags::TriggerFlags] >= 0)
|
||||
{
|
||||
if (firefly.zVel == 0.3f)
|
||||
{
|
||||
firefly.zVel = 50.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (firefly.zVel > 50.0f)
|
||||
firefly.zVel = 0.3f;
|
||||
}
|
||||
|
||||
if (distToOtherFirefly < FIREFLY_BASE_SEPARATION_DISTANCE)
|
||||
{
|
||||
auto separationDir = firefly.Position - otherFirefly.Position;
|
||||
separationDir.Normalize();
|
||||
|
||||
firefly.Position += separationDir * (FIREFLY_BASE_SEPARATION_DISTANCE - distToOtherFirefly);
|
||||
}
|
||||
}
|
||||
|
||||
auto pointColl = GetPointCollision(firefly.Position, firefly.RoomNumber);
|
||||
|
||||
// Update firefly room number.
|
||||
if (pointColl.GetRoomNumber() != firefly.RoomNumber &&
|
||||
pointColl.GetRoomNumber() != NO_VALUE)
|
||||
{
|
||||
firefly.RoomNumber = pointColl.GetRoomNumber();
|
||||
}
|
||||
|
||||
if (targetItem->ItemFlags[FirefliesItemFlags::Light] == 1 && targetItem->ItemFlags[FirefliesItemFlags::TriggerFlags] >= 0)
|
||||
{
|
||||
if (Random::TestProbability(1.0f / (700.0f - (float)(targetItem->ItemFlags[FirefliesItemFlags::Spawncounter] * 2))))
|
||||
firefly.zVel = 100.0f;
|
||||
|
||||
if (firefly.zVel > 1.0f)
|
||||
firefly.zVel -= 2.0f;
|
||||
if (firefly.zVel <= 1.0f)
|
||||
firefly.zVel = 0.3f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveFireflies(ItemInfo& item)
|
||||
{
|
||||
FireflySwarm.erase(std::remove_if(FireflySwarm.begin(), FireflySwarm.end(),
|
||||
[&item](FireflyData& firefly)
|
||||
{
|
||||
if (firefly.TargetItemPtr == &item)
|
||||
{
|
||||
firefly.Life = 0.0f;
|
||||
firefly.on = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}), FireflySwarm.end());
|
||||
nextFireflyNumberMap.erase(item.Index);
|
||||
}
|
||||
|
||||
void ClearFireflySwarm()
|
||||
{
|
||||
FireflySwarm.clear();
|
||||
nextFireflyNumberMap.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
76
TombEngine/Objects/Effects/Fireflies.h
Normal file
76
TombEngine/Objects/Effects/Fireflies.h
Normal file
|
@ -0,0 +1,76 @@
|
|||
#pragma once
|
||||
#include "Game/items.h"
|
||||
#include "Math/Math.h"
|
||||
|
||||
using namespace TEN::Math;
|
||||
|
||||
namespace TEN::Effects::Fireflies
|
||||
{
|
||||
enum FirefliesItemFlags
|
||||
{
|
||||
TargetItemPtr,
|
||||
Light,
|
||||
TriggerFlags,
|
||||
Spawncounter,
|
||||
RemoveFliesEffect,
|
||||
LightIndex1,
|
||||
LightIndex2
|
||||
};
|
||||
|
||||
struct FireflyData
|
||||
{
|
||||
int SpriteSeqID = ID_DEFAULT_SPRITES;
|
||||
int SpriteID = SPR_UNDERWATERDUST;
|
||||
BlendMode blendMode;
|
||||
unsigned int scalar;
|
||||
|
||||
Vector3 Position = Vector3::Zero;
|
||||
int RoomNumber = 0;
|
||||
Vector3 PositionTarget = Vector3::Zero;
|
||||
EulerAngles Orientation = EulerAngles::Identity;
|
||||
float Velocity = 0.0f;
|
||||
|
||||
ItemInfo* TargetItemPtr = nullptr;
|
||||
|
||||
float zVel;
|
||||
float Life = 0.0f;
|
||||
int Number = 0;
|
||||
|
||||
unsigned char rB;
|
||||
unsigned char gB;
|
||||
unsigned char bB;
|
||||
unsigned char r;
|
||||
unsigned char g;
|
||||
unsigned char b;
|
||||
|
||||
bool on;
|
||||
float size;
|
||||
short rotAng;
|
||||
|
||||
int PrevX;
|
||||
int PrevY;
|
||||
int PrevZ;
|
||||
byte PrevR;
|
||||
byte PrevG;
|
||||
byte PrevB;
|
||||
|
||||
void StoreInterpolationData()
|
||||
{
|
||||
PrevX = Position.x;
|
||||
PrevY = Position.y;
|
||||
PrevZ = Position.z;
|
||||
PrevR = r;
|
||||
PrevG = g;
|
||||
PrevB = b;
|
||||
}
|
||||
};
|
||||
|
||||
extern std::vector<FireflyData> FireflySwarm;
|
||||
|
||||
void InitializeFireflySwarm(short itemNumber);
|
||||
void ControlFireflySwarm(short itemNumber);
|
||||
void UpdateFireflySwarm();
|
||||
void ClearFireflySwarm();
|
||||
void SpawnFireflySwarm(ItemInfo& item, int triggerFlags);
|
||||
void RemoveFireflies(ItemInfo& item);
|
||||
}
|
|
@ -17,6 +17,7 @@
|
|||
#include "Game/Lara/lara_helpers.h"
|
||||
#include "Game/Setup.h"
|
||||
#include "Math/Math.h"
|
||||
#include "Objects/Effects/Fireflies.h"
|
||||
#include "Scripting/Include/Flow/ScriptInterfaceFlowHandler.h"
|
||||
#include "Sound/sound.h"
|
||||
#include "Specific/level.h"
|
||||
|
@ -26,9 +27,13 @@ using namespace TEN::Collision::Point;
|
|||
using namespace TEN::Effects::Ripple;
|
||||
using namespace TEN::Effects::Splash;
|
||||
using namespace TEN::Math;
|
||||
using namespace TEN::Effects::Fireflies;
|
||||
|
||||
namespace TEN::Entities::TR3
|
||||
{
|
||||
constexpr auto FLY_EFFECT_MAX_WIDTH = -1;
|
||||
constexpr auto FLY_AMOUNT = 16;
|
||||
|
||||
enum CorpseState
|
||||
{
|
||||
CORPSE_STATE_GROUNDED = 0,
|
||||
|
@ -52,19 +57,25 @@ namespace TEN::Entities::TR3
|
|||
|
||||
if (item.TriggerFlags == 1)
|
||||
{
|
||||
item.ItemFlags[1] = (int)CorpseFlag::Hang;
|
||||
item.ItemFlags[7] = (int)CorpseFlag::Hang;
|
||||
item.Animation.AnimNumber = CORPSE_ANIM_HANG;
|
||||
item.Animation.ActiveState = CORPSE_STATE_HANG;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.ItemFlags[1] = (int)CorpseFlag::Grounded;
|
||||
item.ItemFlags[7] = (int)CorpseFlag::Grounded;
|
||||
item.Animation.AnimNumber = CORPSE_ANIM_GROUNDED;
|
||||
item.Animation.ActiveState = CORPSE_STATE_GROUNDED;
|
||||
}
|
||||
|
||||
item.ItemFlags[FirefliesItemFlags::RemoveFliesEffect] = 0;
|
||||
|
||||
AddActiveItem(itemNumber);
|
||||
item.Status = ITEM_ACTIVE;
|
||||
|
||||
item.ItemFlags[FirefliesItemFlags::TargetItemPtr] = item.Index;
|
||||
item.ItemFlags[FirefliesItemFlags::TriggerFlags] = -1;
|
||||
item.HitPoints = FLY_AMOUNT;
|
||||
}
|
||||
|
||||
void ControlCorpse(short itemNumber)
|
||||
|
@ -72,9 +83,11 @@ namespace TEN::Entities::TR3
|
|||
auto& item = g_Level.Items[itemNumber];
|
||||
const auto& object = Objects[item.ObjectNumber];
|
||||
|
||||
if (item.ItemFlags[1] == (int)CorpseFlag::Fall)
|
||||
if (item.ItemFlags[7] == (int)CorpseFlag::Fall)
|
||||
{
|
||||
bool isWater = TestEnvironment(RoomEnvFlags::ENV_FLAG_WATER, item.RoomNumber);
|
||||
bool isSwamp = TestEnvironment(RoomEnvFlags::ENV_FLAG_SWAMP, item.RoomNumber);
|
||||
|
||||
float verticalVelCoeff = isWater ? 81.0f : 1.0f;
|
||||
|
||||
auto pointColl = GetPointCollision(item);
|
||||
|
@ -95,31 +108,37 @@ namespace TEN::Entities::TR3
|
|||
ItemNewRoom(itemNumber, pointColl.GetRoomNumber());
|
||||
}
|
||||
|
||||
pointColl = GetPointCollision(item);
|
||||
// Remove fly effect when in water.
|
||||
if (isWater || isSwamp)
|
||||
{
|
||||
item.ItemFlags[FirefliesItemFlags::RemoveFliesEffect] = 1;
|
||||
}
|
||||
|
||||
auto bounds = GameBoundingBox(&item);
|
||||
|
||||
item.Animation.IsAirborne = true;
|
||||
|
||||
if (pointColl.GetFloorHeight() < item.Pose.Position.y)
|
||||
if (pointColl.GetFloorHeight() <= item.Pose.Position.y - bounds.Y2)
|
||||
{
|
||||
if (!isWater)
|
||||
{
|
||||
item.Pose.Position.y = item.Pose.Position.y - item.Animation.Velocity.y;
|
||||
item.Pose.Position.y = pointColl.GetFloorHeight();
|
||||
SoundEffect(SFX_TR4_CROCGOD_LAND, &item.Pose);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
item.Pose.Position.y = item.Pose.Position.y;
|
||||
item.Pose.Position.y = pointColl.GetFloorHeight();
|
||||
}
|
||||
|
||||
item.Animation.IsAirborne = false;
|
||||
item.Animation.Velocity = Vector3::Zero;
|
||||
item.Animation.TargetState = CORPSE_STATE_LAND;
|
||||
item.Animation.AnimNumber = CORPSE_ANIM_LAND;
|
||||
AlignEntityToSurface(&item, Vector2(Objects[item.ObjectNumber].radius));
|
||||
|
||||
item.ItemFlags[1] = (int)CorpseFlag::Grounded;
|
||||
item.ItemFlags[7] = (int)CorpseFlag::Grounded;
|
||||
return;
|
||||
}
|
||||
else
|
||||
else if (item.Animation.ActiveState == CORPSE_STATE_FALL)
|
||||
{
|
||||
if (isWater)
|
||||
{
|
||||
|
@ -134,17 +153,56 @@ namespace TEN::Entities::TR3
|
|||
|
||||
AnimateItem(item);
|
||||
|
||||
if (!TriggerActive(&item))
|
||||
return;
|
||||
|
||||
int meshCount = object.nmeshes;
|
||||
for (int i = 0; i < meshCount; i++)
|
||||
if (!TriggerActive(&item) || item.ItemFlags[FirefliesItemFlags::RemoveFliesEffect] == 1)
|
||||
{
|
||||
if (Random::TestProbability(1 / 72.0f))
|
||||
// Remove all fireflies associated with this item.
|
||||
RemoveFireflies(item);
|
||||
|
||||
// Reset ItemFlags.
|
||||
if (item.HitPoints == NOT_TARGETABLE)
|
||||
item.HitPoints = FLY_AMOUNT;
|
||||
|
||||
item.ItemFlags[FirefliesItemFlags::Spawncounter] = 0;
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
AddActiveItem(itemNumber);
|
||||
item.Status = ITEM_ACTIVE;
|
||||
}
|
||||
|
||||
// Spawn fly effect.
|
||||
if (item.HitPoints != NOT_TARGETABLE)
|
||||
{
|
||||
int fireflyCount = item.HitPoints - item.ItemFlags[FirefliesItemFlags::Spawncounter];
|
||||
|
||||
if (fireflyCount < 0)
|
||||
{
|
||||
auto pos = GetJointPosition(&item, i).ToVector3();
|
||||
SpawnCorpseEffect(pos);
|
||||
int firefliesToTurnOff = -fireflyCount;
|
||||
for (auto& firefly : FireflySwarm)
|
||||
{
|
||||
if (firefly.TargetItemPtr == &item && firefly.Life > 0.0f)
|
||||
{
|
||||
firefly.Life = 0.0f;
|
||||
firefly.on = false;
|
||||
firefliesToTurnOff--;
|
||||
|
||||
if (firefliesToTurnOff == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (fireflyCount > 0)
|
||||
{
|
||||
for (int i = 0; i < fireflyCount; i++)
|
||||
{
|
||||
SpawnFireflySwarm(item, FLY_EFFECT_MAX_WIDTH);
|
||||
}
|
||||
}
|
||||
|
||||
item.ItemFlags[FirefliesItemFlags::Spawncounter] = item.HitPoints;
|
||||
item.HitPoints = NOT_TARGETABLE;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -161,9 +219,9 @@ namespace TEN::Entities::TR3
|
|||
{
|
||||
DoBloodSplat(pos->x, pos->y, pos->z, Random::GenerateInt(4, 8), source.Pose.Orientation.y, pos->RoomNumber);
|
||||
|
||||
if (target.ItemFlags[1] == (int)CorpseFlag::Hang)
|
||||
if (target.ItemFlags[7] == (int)CorpseFlag::Hang)
|
||||
{
|
||||
target.ItemFlags[1] = (int)CorpseFlag::Fall;
|
||||
target.ItemFlags[7] = (int)CorpseFlag::Fall;
|
||||
target.Animation.AnimNumber = CORPSE_ANIM_FALL;
|
||||
target.Animation.ActiveState = CORPSE_STATE_FALL;
|
||||
}
|
||||
|
|
|
@ -308,6 +308,11 @@ namespace TEN::Entities::TR4
|
|||
item.Pose.Orientation.x += angleV;
|
||||
}
|
||||
|
||||
// Translate wraith.
|
||||
item.Pose.Position.x += item.Animation.Velocity.z * phd_sin(item.Pose.Orientation.y);
|
||||
item.Pose.Position.y += item.Animation.Velocity.z * phd_sin(item.Pose.Orientation.x);
|
||||
item.Pose.Position.z += item.Animation.Velocity.z * phd_cos(item.Pose.Orientation.y);
|
||||
|
||||
auto pointColl = GetPointCollision(item);
|
||||
|
||||
bool hasHitWall = false;
|
||||
|
@ -317,13 +322,8 @@ namespace TEN::Entities::TR4
|
|||
hasHitWall = true;
|
||||
}
|
||||
|
||||
// Translate wraith.
|
||||
item.Pose.Position.x += item.Animation.Velocity.z * phd_sin(item.Pose.Orientation.y);
|
||||
item.Pose.Position.y += item.Animation.Velocity.z * phd_sin(item.Pose.Orientation.x);
|
||||
item.Pose.Position.z += item.Animation.Velocity.z * phd_cos(item.Pose.Orientation.y);
|
||||
|
||||
if (pointColl.GetRoomNumber() != item.RoomNumber)
|
||||
ItemNewRoom(itemNumber, pointColl.GetRoomNumber());
|
||||
ItemNewRoom(itemNumber, FindRoomNumber(item.Pose.Position, item.RoomNumber));
|
||||
|
||||
for (int linkItemNumber = g_Level.Rooms[item.RoomNumber].itemNumber; linkItemNumber != NO_VALUE; linkItemNumber = g_Level.Items[linkItemNumber].NextItem)
|
||||
{
|
||||
|
|
|
@ -1,28 +1,18 @@
|
|||
#include "framework.h"
|
||||
#include "tr5_teleporter.h"
|
||||
#include "Game/items.h"
|
||||
#include "Specific/level.h"
|
||||
#include "Game/collision/collide_room.h"
|
||||
#include "Sound/sound.h"
|
||||
#include "Game/effects/weather.h"
|
||||
#include "Game/Lara/lara.h"
|
||||
#include "Objects/TR5/Object/tr5_teleporter.h"
|
||||
|
||||
#include "Game/camera.h"
|
||||
#include "Game/collision/collide_room.h"
|
||||
#include "Game/collision/Point.h"
|
||||
#include "Game/effects/weather.h"
|
||||
#include "Game/items.h"
|
||||
#include "Game/Lara/lara.h"
|
||||
#include "Sound/sound.h"
|
||||
#include "Specific/level.h"
|
||||
|
||||
using namespace TEN::Collision::Point;
|
||||
using namespace TEN::Effects::Environment;
|
||||
|
||||
void InitializeTeleporter(short itemNumber)
|
||||
{
|
||||
/*ItemInfo* item = &g_Level.Items[itemNumber];
|
||||
|
||||
if (item->triggerFlags == 512)
|
||||
{
|
||||
ItemInfo* puzzleHoleItem = FindItem(ID_PUZZLE_HOLE2);
|
||||
v4 = (signed int)((unsigned __int64)(391146079i64 * ((char*)v3 - (char*)items)) >> 32) >> 9;
|
||||
result = (unsigned int)((unsigned __int64)(391146079i64 * ((char*)v3 - (char*)items)) >> 32) >> 31;
|
||||
item->itemFlags[1] = result + v4;
|
||||
}*/
|
||||
}
|
||||
|
||||
void ControlTeleporter(short itemNumber)
|
||||
{
|
||||
ItemInfo* item = &g_Level.Items[itemNumber];
|
||||
|
@ -30,149 +20,6 @@ void ControlTeleporter(short itemNumber)
|
|||
if (!TriggerActive(item))
|
||||
return;
|
||||
|
||||
/*if (item->triggerFlags == 512)
|
||||
{
|
||||
if (item->itemFlags[2])
|
||||
{
|
||||
Lara.Puzzles[1] = 1;
|
||||
RemoveActiveItem(itemNumber);
|
||||
item->flags &= 0xC1FF;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->itemFlags[0] += 2;
|
||||
|
||||
if (item->itemFlags[0] <= 255)
|
||||
{
|
||||
int flags = item->itemFlags[0] >> 3;
|
||||
if (flags >= 4)
|
||||
{
|
||||
if (flags > 31)
|
||||
flags = 31;
|
||||
}
|
||||
else
|
||||
{
|
||||
flags = 4;
|
||||
}
|
||||
|
||||
ItemInfo* targetItem = &g_Level.Items[item->itemFlags[1]];
|
||||
SoundEffect(SFX_TR5_TELEPORT, &targetItem->pos, SoundEnvironment::Land);
|
||||
|
||||
if (GlobalCounter & 1)
|
||||
{
|
||||
Vector3i src;
|
||||
pos.x = targetItem->pos.Position.x;
|
||||
pos.y = targetItem->pos.Position.y - 496;
|
||||
pos.z = targetItem->pos.Position.z + 472;
|
||||
|
||||
int dl = 4 * item->itemFlags[0] + 256;
|
||||
|
||||
Vector3i dest;
|
||||
dest.x = src.x + GetRandomControl() % dl - (dl >> 1);
|
||||
dest.y = src.y + GetRandomControl() % dl - (dl >> 1);
|
||||
dest.z = src.z + GetRandomControl() % dl - (dl >> 1);
|
||||
|
||||
int color = (item->itemFlags[0] >> 2) | (((item->itemFlags[0] - (GetRandomControl() % (item->itemFlags[0] >> 1))) | (item->itemFlags[0] << 8)) << 8);
|
||||
color |= 0x18; // BYTE1
|
||||
|
||||
//TriggerEnergyArc(&src, &dest, (GetRandomControl() & 0x1F) + 16, color, 15, 40, 5);
|
||||
|
||||
v20 = v16;
|
||||
v21 = v12 & 0xFFFFFFFE;
|
||||
LOBYTE(v20) = v16 & 0xFE;
|
||||
BYTE1(v21) |= 0x80u;
|
||||
TriggerLightningGlow(src.x, src.y, src.z, (item->itemFlags[0] >> 3) | ((v20 | (v21 << 8)) << 7));
|
||||
v22 = GetRandomControl();
|
||||
SpawnDynamicLight(src.x, src.y, src.z, (v22 & 3) + (item->itemFlags[0] >> 5) + 8, v12, v16, v13);
|
||||
}
|
||||
LOBYTE(v3) = GetRandomControl();
|
||||
if (v3 & 1)
|
||||
{
|
||||
v23 = item->itemFlags[0];
|
||||
v24 = item->itemFlags[0];
|
||||
v25 = GetRandomControl();
|
||||
|
||||
auto R = v23;
|
||||
auto G = v24 - v25 % (v24 >> 1);
|
||||
auto B = v24 >> 2;
|
||||
Weather.Flash(R, G, B, 0.03f);
|
||||
|
||||
LOBYTE(v3) = SoundEffect(SFX_TR5_TELEPORT_CRACKLES, nullptr);
|
||||
}
|
||||
if (!(GlobalCounter & 3))
|
||||
{
|
||||
v26 = GetRandomControl();
|
||||
v27 = 0;
|
||||
v28 = v26 & 3;
|
||||
v29 = 0;
|
||||
if (v28)
|
||||
{
|
||||
if (v28 == 1)
|
||||
v29 = 512;
|
||||
else
|
||||
v27 = v28 != 2 ? 512 : -512;
|
||||
}
|
||||
else
|
||||
{
|
||||
v29 = -512;
|
||||
}
|
||||
v30 = item->itemFlags[0];
|
||||
v31 = &g_Level.Items[item->itemFlags[1]];
|
||||
src.Position.x = v29 + v31->pos.Position.x;
|
||||
src.Position.y = v31->pos.Position.y - 2328;
|
||||
src.zPos = v27 + v31->pos.Position.z;
|
||||
*(_DWORD*)& src.xRot = v31->pos.Position.x;
|
||||
v32 = item->itemFlags[0];
|
||||
*(_DWORD*)& src.zRot = v31->pos.Position.y - 496;
|
||||
v45 = v31->pos.Position.z + 472;
|
||||
v33 = (v30 >> 2) | (((v30 - GetRandomControl() % (v30 >> 1)) | ((v32 | 0x2400) << 8)) << 8);
|
||||
v34 = GetRandomControl();
|
||||
TriggerEnergyArc((Vector3i*)& src, (Vector3i*)& src.xRot, (v34 & 0xF) + 16, v33, 13, 56, 5);
|
||||
v35* = GetFreeParticle();
|
||||
v35->On = 1;
|
||||
v36 = item->itemFlags[0];
|
||||
v35->dR = v36;
|
||||
v35->sR = v36;
|
||||
v37 = item->itemFlags[0] >> 1;
|
||||
v35->dG = v37;
|
||||
v35->sG = v37;
|
||||
v38 = item->itemFlags[0];
|
||||
v35->ColFadeSpeed = 20;
|
||||
v38 >>= 2;
|
||||
v35->dB = v38;
|
||||
v35->sB = v38;
|
||||
v35->FadeToBlack = 4;
|
||||
v35->Life = 24;
|
||||
v35->sLife = 24;
|
||||
v35->blendMode = BlendMode::Additive;
|
||||
v35->x = src.Position.x;
|
||||
v35->y = src.Position.y;
|
||||
v35->z = src.zPos;
|
||||
v35->Zvel = 0;
|
||||
v35->Yvel = 0;
|
||||
v35->Xvel = 0;
|
||||
v35->Flags = 10;
|
||||
v39 = objects[458].mesh_index;
|
||||
v35->Scalar = 3;
|
||||
v35->MaxYvel = 0;
|
||||
v35->Def = v39 + 11;
|
||||
v35->Gravity = 0;
|
||||
v3 = (GetRandomControl() & 3) + 24;
|
||||
v35->dSize = v3;
|
||||
v35->sSize = v3;
|
||||
v35->Size = v3;
|
||||
}
|
||||
return v3;
|
||||
}
|
||||
FlashFadeR = 255;
|
||||
FlashFadeG = 255;
|
||||
FlashFadeB = 64;
|
||||
FlashFader = 32;
|
||||
item->itemFlags[2] = 1;
|
||||
SoundEffect(SFX_TR5_TELEPORT_FLASH, nullptr, SoundEnvironment::Land);
|
||||
}
|
||||
}*/
|
||||
|
||||
Lara.Control.IsLocked = false;
|
||||
|
||||
if (item->TriggerFlags == 666)
|
||||
|
@ -192,16 +39,19 @@ void ControlTeleporter(short itemNumber)
|
|||
else
|
||||
{
|
||||
Camera.fixedCamera = true;
|
||||
LaraItem->DisableInterpolation = true;
|
||||
LaraItem->Pose.Position.x = item->Pose.Position.x;
|
||||
LaraItem->Pose.Position.z = item->Pose.Position.z;
|
||||
LaraItem->Pose.Orientation.y = item->Pose.Orientation.y - ANGLE(180.0f);
|
||||
|
||||
short roomNumber = item->RoomNumber;
|
||||
FloorInfo* floor = GetFloor(item->Pose.Position.x, item->Pose.Position.y, item->Pose.Position.z, &roomNumber);
|
||||
LaraItem->Pose.Position.y = GetFloorHeight(floor, item->Pose.Position.x, item->Pose.Position.y, item->Pose.Position.z);
|
||||
auto& pointColl = GetPointCollision(*item);
|
||||
LaraItem->Pose.Position.y = pointColl.GetPosition().y;
|
||||
|
||||
if (LaraItem->RoomNumber != roomNumber)
|
||||
ItemNewRoom(LaraItem->Index, roomNumber);
|
||||
if (LaraItem->RoomNumber != pointColl.GetRoomNumber())
|
||||
{
|
||||
ItemNewRoom(LaraItem->Index, pointColl.GetRoomNumber());
|
||||
LaraItem->Location.RoomNumber = pointColl.GetRoomNumber();
|
||||
}
|
||||
|
||||
if (item->Flags & IFLAG_INVISIBLE)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
void InitializeTeleporter(short itemNumber);
|
||||
void ControlTeleporter(short itemNumber);
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace TEN::Entities::Traps
|
|||
constexpr auto MOVING_LASER_ACCEL = 1.0f;
|
||||
constexpr auto MOVING_LASER_PAUSE_FRAME_COUNT = 30;
|
||||
|
||||
enum class MovingLaserProperty
|
||||
enum class MovingLaserFlags
|
||||
{
|
||||
Velocity,
|
||||
PauseTimer,
|
||||
|
@ -35,8 +35,8 @@ namespace TEN::Entities::Traps
|
|||
void InitializeMovingLaser(short itemNumber)
|
||||
{
|
||||
auto& item = g_Level.Items[itemNumber];
|
||||
item.ItemFlags[(int)MovingLaserProperty::DirectionSign] = 1;
|
||||
item.ItemFlags[(int)MovingLaserProperty::Velocity] = 10;
|
||||
item.ItemFlags[(int)MovingLaserFlags::DirectionSign] = 1;
|
||||
item.ItemFlags[(int)MovingLaserFlags::Velocity] = 10;
|
||||
|
||||
// Offset by 1/4 block to make it dangerous at sector edges.
|
||||
item.Pose.Translate(item.Pose.Orientation, -BLOCK(0.25f));
|
||||
|
@ -51,7 +51,7 @@ namespace TEN::Entities::Traps
|
|||
|
||||
// Calculate distances.
|
||||
float moveDist = BLOCK(item.TriggerFlags) + BLOCK(0.5f);
|
||||
float distPerFrame = (BLOCK(item.ItemFlags[(int)MovingLaserProperty::Velocity]) * 0.25f) / (float)FPS;
|
||||
float distPerFrame = (BLOCK(item.ItemFlags[(int)MovingLaserFlags::Velocity]) * 0.25f) / (float)FPS;
|
||||
|
||||
item.Animation.ActiveState = 0;
|
||||
|
||||
|
@ -74,38 +74,38 @@ namespace TEN::Entities::Traps
|
|||
return;
|
||||
}
|
||||
|
||||
if (item.ItemFlags[(int)MovingLaserProperty::PauseTimer] > 0)
|
||||
if (item.ItemFlags[(int)MovingLaserFlags::PauseTimer] > 0)
|
||||
{
|
||||
item.ItemFlags[(int)MovingLaserProperty::PauseTimer]--;
|
||||
if (item.ItemFlags[(int)MovingLaserProperty::PauseTimer] == 0)
|
||||
item.ItemFlags[(int)MovingLaserFlags::PauseTimer]--;
|
||||
if (item.ItemFlags[(int)MovingLaserFlags::PauseTimer] == 0)
|
||||
{
|
||||
item.ItemFlags[(int)MovingLaserProperty::DirectionSign] *= -1;
|
||||
item.ItemFlags[(int)MovingLaserProperty::DistanceTraveled] = 0;
|
||||
item.ItemFlags[(int)MovingLaserFlags::DirectionSign] *= -1;
|
||||
item.ItemFlags[(int)MovingLaserFlags::DistanceTraveled] = 0;
|
||||
}
|
||||
|
||||
AnimateItem(item);
|
||||
return;
|
||||
}
|
||||
|
||||
item.Pose.Translate(item.Pose.Orientation, (item.ItemFlags[(int)MovingLaserProperty::DirectionSign] * item.ItemFlags[(int)MovingLaserProperty::VelocityCalc]));
|
||||
item.Pose.Translate(item.Pose.Orientation, (item.ItemFlags[(int)MovingLaserFlags::DirectionSign] * item.ItemFlags[(int)MovingLaserFlags::VelocityCalc]));
|
||||
|
||||
item.ItemFlags[(int)MovingLaserProperty::DistanceTraveled] += item.ItemFlags[(int)MovingLaserProperty::VelocityCalc];
|
||||
item.ItemFlags[(int)MovingLaserFlags::DistanceTraveled] += item.ItemFlags[(int)MovingLaserFlags::VelocityCalc];
|
||||
|
||||
if (item.ItemFlags[(int)MovingLaserProperty::DistanceTraveled] < (moveDist - BLOCK(0.5f)))
|
||||
if (item.ItemFlags[(int)MovingLaserFlags::DistanceTraveled] < (moveDist - BLOCK(0.5f)))
|
||||
{
|
||||
item.ItemFlags[(int)MovingLaserProperty::VelocityCalc] = std::min(distPerFrame, item.ItemFlags[(int)MovingLaserProperty::VelocityCalc] + MOVING_LASER_ACCEL);
|
||||
item.ItemFlags[(int)MovingLaserFlags::VelocityCalc] = std::min(distPerFrame, item.ItemFlags[(int)MovingLaserFlags::VelocityCalc] + MOVING_LASER_ACCEL);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.ItemFlags[(int)MovingLaserProperty::VelocityCalc] = std::max(MOVING_LASER_VELOCITY_MIN, item.ItemFlags[(int)MovingLaserProperty::VelocityCalc] - MOVING_LASER_ACCEL);
|
||||
item.ItemFlags[(int)MovingLaserFlags::VelocityCalc] = std::max(MOVING_LASER_VELOCITY_MIN, item.ItemFlags[(int)MovingLaserFlags::VelocityCalc] - MOVING_LASER_ACCEL);
|
||||
}
|
||||
|
||||
if (item.ItemFlags[(int)MovingLaserProperty::DistanceTraveled] >= moveDist)
|
||||
if (item.ItemFlags[(int)MovingLaserFlags::DistanceTraveled] >= moveDist)
|
||||
{
|
||||
item.ItemFlags[(int)MovingLaserProperty::PauseTimer] = MOVING_LASER_PAUSE_FRAME_COUNT;
|
||||
item.ItemFlags[(int)MovingLaserFlags::PauseTimer] = MOVING_LASER_PAUSE_FRAME_COUNT;
|
||||
}
|
||||
|
||||
if (item.ItemFlags[(int)MovingLaserProperty::PauseTimer] == 0)
|
||||
if (item.ItemFlags[(int)MovingLaserFlags::PauseTimer] == 0)
|
||||
{
|
||||
SoundEffect(SFX_TR5_MOVING_LASER_LOOP, &item.Pose, SoundEnvironment::Always);
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "Objects/TR5/Emitter/tr5_spider_emitter.h"
|
||||
#include "Objects/TR5/Emitter/tr5_smoke_emitter.h"
|
||||
#include "Objects/TR5/Emitter/Waterfall.h"
|
||||
#include "Objects/Effects/Fireflies.h"
|
||||
|
||||
// Objects
|
||||
#include "Objects/TR5/Light/tr5_light.h"
|
||||
|
@ -81,6 +82,7 @@ using namespace TEN::Effects::WaterfallEmitter;
|
|||
using namespace TEN::Entities::Creatures::TR5;
|
||||
using namespace TEN::Entities::Switches;
|
||||
using namespace TEN::Entities::Traps;
|
||||
using namespace TEN::Effects::Fireflies;
|
||||
|
||||
static void StartEntity(ObjectInfo *obj)
|
||||
{
|
||||
|
@ -772,7 +774,6 @@ static void StartObject(ObjectInfo *obj)
|
|||
obj = &Objects[ID_TELEPORTER];
|
||||
if (obj->loaded)
|
||||
{
|
||||
obj->Initialize = InitializeTeleporter;
|
||||
obj->control = ControlTeleporter;
|
||||
obj->drawRoutine = nullptr;
|
||||
}
|
||||
|
@ -796,6 +797,14 @@ static void StartObject(ObjectInfo *obj)
|
|||
obj->control = ControlEmberEmitter;
|
||||
}
|
||||
|
||||
obj = &Objects[ID_FIREFLY_EMITTER];
|
||||
if (obj->loaded)
|
||||
{
|
||||
obj->Initialize = InitializeFireflySwarm;
|
||||
obj->control = ControlFireflySwarm;
|
||||
obj->drawRoutine = NULL;
|
||||
}
|
||||
|
||||
obj = &Objects[ID_GEN_SLOT1];
|
||||
if (obj->loaded)
|
||||
{
|
||||
|
|
|
@ -817,6 +817,7 @@ enum GAME_OBJECT_ID : short
|
|||
ID_CORPSE,
|
||||
ID_WRAITH_TRAP,
|
||||
ID_WATERFALL_EMITTER,
|
||||
ID_FIREFLY_EMITTER,
|
||||
|
||||
ID_MESHSWAP1 = 1100,
|
||||
ID_MESHSWAP2,
|
||||
|
@ -1006,8 +1007,8 @@ enum GAME_OBJECT_ID : short
|
|||
ID_DASH_BAR_TEXTURE,
|
||||
ID_SFX_BAR_TEXTURE,
|
||||
ID_WATERFALL_SPRITES,
|
||||
// 1379
|
||||
ID_CROSSHAIR_GRAPHICS = 1380,
|
||||
ID_FIREFLY_SPRITES,
|
||||
ID_CROSSHAIR_GRAPHICS,
|
||||
ID_SPEEDOMETER_GRAPHICS,
|
||||
ID_CUSTOM_BAR_GRAPHICS,
|
||||
ID_CUSTOM_AMMO_GRAPHICS,
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace TEN::Renderer::ConstantBuffers
|
|||
int Padding;
|
||||
//--
|
||||
Vector2 CausticsStartUV;
|
||||
Vector2 CausticsScale;
|
||||
Vector2 CausticsSize;
|
||||
//--
|
||||
Vector4 AmbientColor;
|
||||
//--
|
||||
|
|
|
@ -144,48 +144,6 @@ namespace TEN::Renderer::Graphics
|
|||
Height = desc.Height;
|
||||
}
|
||||
|
||||
Texture2D(ID3D11Device* device, ID3D11DeviceContext* context, ID3D11Texture2D* texture, int x, int y, int width, int height)
|
||||
{
|
||||
Width = width;
|
||||
Height = height;
|
||||
|
||||
D3D11_TEXTURE2D_DESC fromDesc = {};
|
||||
texture->GetDesc(&fromDesc);
|
||||
|
||||
auto desc = D3D11_TEXTURE2D_DESC{};
|
||||
desc.Width = width;
|
||||
desc.Height = height;
|
||||
desc.Format = fromDesc.Format;
|
||||
desc.CPUAccessFlags = 0;
|
||||
desc.MiscFlags = 0;
|
||||
desc.MipLevels = 1;
|
||||
desc.ArraySize = 1;
|
||||
desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
|
||||
desc.SampleDesc.Count = 1;
|
||||
desc.SampleDesc.Quality = 0;
|
||||
desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
|
||||
throwIfFailed(device->CreateTexture2D(&desc, nullptr, &Texture));
|
||||
|
||||
D3D11_BOX sourceRegion;
|
||||
sourceRegion.left = x;
|
||||
sourceRegion.right = x + width;
|
||||
sourceRegion.top = y;
|
||||
sourceRegion.bottom = y + height;
|
||||
sourceRegion.front = 0;
|
||||
sourceRegion.back = 1;
|
||||
|
||||
context->CopySubresourceRegion(Texture.Get(), 0, 0, 0, 0, texture, 0, &sourceRegion);
|
||||
|
||||
auto shaderDesc = D3D11_SHADER_RESOURCE_VIEW_DESC{};
|
||||
shaderDesc.Format = desc.Format;
|
||||
shaderDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
|
||||
shaderDesc.Texture2D.MostDetailedMip = 0;
|
||||
shaderDesc.Texture2D.MipLevels = 1;
|
||||
|
||||
throwIfFailed(device->CreateShaderResourceView(Texture.Get(), &shaderDesc, ShaderResourceView.GetAddressOf()));
|
||||
}
|
||||
|
||||
~Texture2D() = default;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -342,7 +342,7 @@ namespace TEN::Renderer
|
|||
|
||||
// Special effects
|
||||
|
||||
std::vector<Texture2D> _causticTextures;
|
||||
//std::vector<Texture2D> _causticTextures;
|
||||
RendererMirror* _currentMirror = nullptr;
|
||||
|
||||
// Transparency
|
||||
|
@ -411,6 +411,7 @@ namespace TEN::Renderer
|
|||
void PrepareFires(RenderView& view);
|
||||
void PrepareParticles(RenderView& view);
|
||||
void PrepareSmokes(RenderView& view);
|
||||
void PrepareFireflies(RenderView& view);
|
||||
void PrepareElectricity(RenderView& view);
|
||||
void PrepareHelicalLasers(RenderView& view);
|
||||
void PrepareBlood(RenderView& view);
|
||||
|
|
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