Skip to content

Commit

Permalink
Merge branch 'main' into SafeIO
Browse files Browse the repository at this point in the history
  • Loading branch information
Dregu committed Sep 27, 2023
2 parents 4bf2c0a + 1c49a77 commit a29288a
Show file tree
Hide file tree
Showing 16 changed files with 309 additions and 73 deletions.
16 changes: 15 additions & 1 deletion docs/game_data/spel2.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 83 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1663,6 +1663,9 @@
<li>
<a href="#HudPlayer" class="toc-h3 toc-link" data-title="HudPlayer">HudPlayer</a>
</li>
<li>
<a href="#ItemOwnerDetails" class="toc-h3 toc-link" data-title="ItemOwnerDetails">ItemOwnerDetails</a>
</li>
<li>
<a href="#Letter" class="toc-h3 toc-link" data-title="Letter">Letter</a>
</li>
Expand All @@ -1678,6 +1681,12 @@
<li>
<a href="#RenderInfo" class="toc-h3 toc-link" data-title="RenderInfo">RenderInfo</a>
</li>
<li>
<a href="#RoomOwnerDetails" class="toc-h3 toc-link" data-title="RoomOwnerDetails">RoomOwnerDetails</a>
</li>
<li>
<a href="#RoomOwnersInfo" class="toc-h3 toc-link" data-title="RoomOwnersInfo">RoomOwnersInfo</a>
</li>
<li>
<a href="#ShortTileCodeDef" class="toc-h3 toc-link" data-title="ShortTileCodeDef">ShortTileCodeDef</a>
</li>
Expand Down Expand Up @@ -8732,6 +8741,27 @@ <h3 id='HudPlayer'>HudPlayer</h3>
<td></td>
</tr>
</tbody></table>
<h3 id='ItemOwnerDetails'>ItemOwnerDetails</h3>
<p>Used in <a href="#RoomOwnersInfo">RoomOwnersInfo</a></p>

<table><thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><a href="#ENT_TYPE">ENT_TYPE</a></td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=owner_type">owner_type</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=owner_uid">owner_uid</a></td>
<td></td>
</tr>
</tbody></table>
<h3 id='Letter'>Letter</h3>
<table><thead>
<tr>
Expand Down Expand Up @@ -9109,6 +9139,53 @@ <h3 id='RenderInfo'>RenderInfo</h3>
<td>Hooks after the virtual function.<br/>The callback signature is <code>nil render(RenderInfo self, float float, VanillaRenderContext vanilla_render_context)</code></td>
</tr>
</tbody></table>
<h3 id='RoomOwnerDetails'>RoomOwnerDetails</h3>
<p>Used in <a href="#RoomOwnersInfo">RoomOwnersInfo</a></p>

<table><thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=layer">layer</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=room_index">room_index</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=owner_uid">owner_uid</a></td>
<td></td>
</tr>
</tbody></table>
<h3 id='RoomOwnersInfo'>RoomOwnersInfo</h3>
<p>Used in <a href="#StateMemory">StateMemory</a></p>

<table><thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>custom_map&lt;int, <a href="#ItemOwnerDetails">ItemOwnerDetails</a>&gt;</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=owned_items">owned_items</a></td>
<td>key/index is the uid of an item</td>
</tr>
<tr>
<td>array&lt;<a href="#RoomOwnerDetails">RoomOwnerDetails</a>&gt;</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=owned_rooms">owned_rooms</a></td>
<td></td>
</tr>
</tbody></table>
<h3 id='ShortTileCodeDef'>ShortTileCodeDef</h3>
<p>Used in <a href="#get_short_tile_code">get_short_tile_code</a>, <a href="#get_short_tile_code_definition">get_short_tile_code_definition</a> and <a href="#PostRoomGenerationContext">PostRoomGenerationContext</a></p>

Expand Down Expand Up @@ -10188,7 +10265,7 @@ <h3 id='LevelGenSystem'>LevelGenSystem</h3>
<td></td>
</tr>
<tr>
<td>array&lt;<a href="#Vec2">Vec2</a>&gt;</td>
<td>custom_array&lt;<a href="#Vec2">Vec2</a>&gt;</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=exit_doors">exit_doors</a></td>
<td></td>
</tr>
Expand Down Expand Up @@ -15475,6 +15552,11 @@ <h3 id='StateMemory'>StateMemory</h3>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=next_entity_uid">next_entity_uid</a></td>
<td>Next entity spawned will have this uid</td>
</tr>
<tr>
<td><a href="#RoomOwnersInfo">RoomOwnersInfo</a></td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=room_owners">room_owners</a></td>
<td>Holds info about owned rooms and items (shops, challenge rooms, vault etc.)</td>
</tr>
</tbody></table>
<h2 id='Texture-types'>Texture types</h2><h3 id='TextRenderingInfo'>TextRenderingInfo</h3>
<table><thead>
Expand Down
84 changes: 83 additions & 1 deletion docs/light.html
Original file line number Diff line number Diff line change
Expand Up @@ -1663,6 +1663,9 @@
<li>
<a href="#HudPlayer" class="toc-h3 toc-link" data-title="HudPlayer">HudPlayer</a>
</li>
<li>
<a href="#ItemOwnerDetails" class="toc-h3 toc-link" data-title="ItemOwnerDetails">ItemOwnerDetails</a>
</li>
<li>
<a href="#Letter" class="toc-h3 toc-link" data-title="Letter">Letter</a>
</li>
Expand All @@ -1678,6 +1681,12 @@
<li>
<a href="#RenderInfo" class="toc-h3 toc-link" data-title="RenderInfo">RenderInfo</a>
</li>
<li>
<a href="#RoomOwnerDetails" class="toc-h3 toc-link" data-title="RoomOwnerDetails">RoomOwnerDetails</a>
</li>
<li>
<a href="#RoomOwnersInfo" class="toc-h3 toc-link" data-title="RoomOwnersInfo">RoomOwnersInfo</a>
</li>
<li>
<a href="#ShortTileCodeDef" class="toc-h3 toc-link" data-title="ShortTileCodeDef">ShortTileCodeDef</a>
</li>
Expand Down Expand Up @@ -8732,6 +8741,27 @@ <h3 id='HudPlayer'>HudPlayer</h3>
<td></td>
</tr>
</tbody></table>
<h3 id='ItemOwnerDetails'>ItemOwnerDetails</h3>
<p>Used in <a href="#RoomOwnersInfo">RoomOwnersInfo</a></p>

<table><thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><a href="#ENT_TYPE">ENT_TYPE</a></td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=owner_type">owner_type</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=owner_uid">owner_uid</a></td>
<td></td>
</tr>
</tbody></table>
<h3 id='Letter'>Letter</h3>
<table><thead>
<tr>
Expand Down Expand Up @@ -9109,6 +9139,53 @@ <h3 id='RenderInfo'>RenderInfo</h3>
<td>Hooks after the virtual function.<br/>The callback signature is <code>nil render(RenderInfo self, float float, VanillaRenderContext vanilla_render_context)</code></td>
</tr>
</tbody></table>
<h3 id='RoomOwnerDetails'>RoomOwnerDetails</h3>
<p>Used in <a href="#RoomOwnersInfo">RoomOwnersInfo</a></p>

<table><thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=layer">layer</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=room_index">room_index</a></td>
<td></td>
</tr>
<tr>
<td>int</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=owner_uid">owner_uid</a></td>
<td></td>
</tr>
</tbody></table>
<h3 id='RoomOwnersInfo'>RoomOwnersInfo</h3>
<p>Used in <a href="#StateMemory">StateMemory</a></p>

<table><thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>custom_map&lt;int, <a href="#ItemOwnerDetails">ItemOwnerDetails</a>&gt;</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=owned_items">owned_items</a></td>
<td>key/index is the uid of an item</td>
</tr>
<tr>
<td>array&lt;<a href="#RoomOwnerDetails">RoomOwnerDetails</a>&gt;</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=owned_rooms">owned_rooms</a></td>
<td></td>
</tr>
</tbody></table>
<h3 id='ShortTileCodeDef'>ShortTileCodeDef</h3>
<p>Used in <a href="#get_short_tile_code">get_short_tile_code</a>, <a href="#get_short_tile_code_definition">get_short_tile_code_definition</a> and <a href="#PostRoomGenerationContext">PostRoomGenerationContext</a></p>

Expand Down Expand Up @@ -10188,7 +10265,7 @@ <h3 id='LevelGenSystem'>LevelGenSystem</h3>
<td></td>
</tr>
<tr>
<td>array&lt;<a href="#Vec2">Vec2</a>&gt;</td>
<td>custom_array&lt;<a href="#Vec2">Vec2</a>&gt;</td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=exit_doors">exit_doors</a></td>
<td></td>
</tr>
Expand Down Expand Up @@ -15475,6 +15552,11 @@ <h3 id='StateMemory'>StateMemory</h3>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=next_entity_uid">next_entity_uid</a></td>
<td>Next entity spawned will have this uid</td>
</tr>
<tr>
<td><a href="#RoomOwnersInfo">RoomOwnersInfo</a></td>
<td><a href="https://github.com/spelunky-fyi/overlunky/search?l=Lua&amp;q=room_owners">room_owners</a></td>
<td>Holds info about owned rooms and items (shops, challenge rooms, vault etc.)</td>
</tr>
</tbody></table>
<h2 id='Texture-types'>Texture types</h2><h3 id='TextRenderingInfo'>TextRenderingInfo</h3>
<table><thead>
Expand Down
31 changes: 30 additions & 1 deletion docs/src/includes/_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,15 @@ int | [health](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=health)
int | [bombs](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=bombs) |
int | [ropes](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=ropes) |

### ItemOwnerDetails

Used in [RoomOwnersInfo](#RoomOwnersInfo)

Type | Name | Description
---- | ---- | -----------
[ENT_TYPE](#ENT_TYPE) | [owner_type](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=owner_type) |
int | [owner_uid](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=owner_uid) |

### Letter


Expand Down Expand Up @@ -799,6 +808,25 @@ nil | [clear_virtual(CallbackId callback_id)](https://github.com/spelunky-fyi/ov
[CallbackId](#Aliases) | [set_pre_render(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_pre_render) | Hooks before the virtual function.<br/>The callback signature is `bool render(RenderInfo self, float float, VanillaRenderContext vanilla_render_context)`
[CallbackId](#Aliases) | [set_post_render(function fun)](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=set_post_render) | Hooks after the virtual function.<br/>The callback signature is `nil render(RenderInfo self, float float, VanillaRenderContext vanilla_render_context)`

### RoomOwnerDetails

Used in [RoomOwnersInfo](#RoomOwnersInfo)

Type | Name | Description
---- | ---- | -----------
int | [layer](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=layer) |
int | [room_index](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=room_index) |
int | [owner_uid](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=owner_uid) |

### RoomOwnersInfo

Used in [StateMemory](#StateMemory)

Type | Name | Description
---- | ---- | -----------
custom_map&lt;int, [ItemOwnerDetails](#ItemOwnerDetails)&gt; | [owned_items](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=owned_items) | key/index is the uid of an item
array&lt;[RoomOwnerDetails](#RoomOwnerDetails)&gt; | [owned_rooms](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=owned_rooms) |

### ShortTileCodeDef

Used in [get_short_tile_code](#get_short_tile_code), [get_short_tile_code_definition](#get_short_tile_code_definition) and [PostRoomGenerationContext](#PostRoomGenerationContext)
Expand Down Expand Up @@ -1158,7 +1186,7 @@ float | [spawn_x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=spawn
float | [spawn_y](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=spawn_y) |
int | [spawn_room_x](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=spawn_room_x) |
int | [spawn_room_y](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=spawn_room_y) |
array&lt;[Vec2](#Vec2)&gt; | [exit_doors](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=exit_doors) |
custom_array&lt;[Vec2](#Vec2)&gt; | [exit_doors](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=exit_doors) |
[ThemeInfo](#ThemeInfo) | [themes[18]](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=themes) |

## Lighting types
Expand Down Expand Up @@ -2630,6 +2658,7 @@ array&lt;int, 9&gt; | [journal_progress_theme_slots](https://github.com/spelunky
[LogicList](#LogicList) | [logic](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=logic) | Level logic like dice game and cutscenes
[LiquidPhysics](#LiquidPhysics) | [liquid](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=liquid) |
int | [next_entity_uid](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=next_entity_uid) | Next entity spawned will have this uid
[RoomOwnersInfo](#RoomOwnersInfo) | [room_owners](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=room_owners) | Holds info about owned rooms and items (shops, challenge rooms, vault etc.)

## Texture types

Expand Down
16 changes: 12 additions & 4 deletions examples/randomizer2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ local function spawn_boss(boss)

duat_spawn_x = state.level_gen.spawn_x
duat_spawn_y = state.level_gen.spawn_y
state.level_gen.spawn_x = 17
state.level_gen.spawn_y = 106
--state.level_gen.spawn_x = 17
--state.level_gen.spawn_y = 106
if state.level_gen.spawn_y < 47 then return end
local box = AABB:new()
box.top = duat_spawn_y - 2
Expand Down Expand Up @@ -782,9 +782,16 @@ local function random_bosses(enable)
boss_cbs[#boss_cbs + 1] = set_post_entity_spawn(function(e)
e:set_post_update_state_machine(function(e)
local box = get_hitbox(e.uid)
for _,v in pairs(get_entities_overlapping_hitbox({ENT_TYPE.ACTIVEFLOOR_BONEBLOCK, ENT_TYPE.ACTIVEFLOOR_REGENERATINGBLOCK}, MASK.ACTIVEFLOOR, box, e.layer)) do
for _, v in pairs(get_entities_overlapping_hitbox({ ENT_TYPE.ACTIVEFLOOR_BONEBLOCK, ENT_TYPE
.ACTIVEFLOOR_REGENERATINGBLOCK, ENT_TYPE.ACTIVEFLOOR_SLIDINGWALL }, MASK.ACTIVEFLOOR, box, e.layer)) do
kill_entity(v, true)
end
if #state.level_gen.exit_doors > 0 then
for _,_ in pairs(get_entities_overlapping_hitbox(ENT_TYPE.FLOOR_DOOR_ENTRANCE, MASK.FLOOR, box, e.layer)) do
state.level_gen.spawn_x = state.level_gen.exit_doors[1].x
state.level_gen.spawn_y = state.level_gen.exit_doors[1].y
end
end
end)
end, SPAWN_TYPE.ANY, MASK.ACTIVEFLOOR, ENT_TYPE.ACTIVEFLOOR_CRUSHING_ELEVATOR)

Expand Down Expand Up @@ -2605,7 +2612,8 @@ end
local function duat_door()
if not options.door then return end
-- spawn duat skip door
spawn_door(17, 106, 0, level_order[state.level_count+1].w, level_order[state.level_count+1].l, level_order[state.level_count+1].t)
spawn_door(17, 106, 0, level_order[state.level_count + 1].w, level_order[state.level_count + 1].l, level_order[state.level_count + 1].t)
state.level_gen.exit_doors[1] = Vec2:new(17, 106)
spawn_entity(ENT_TYPE.BG_DOOR_BACK_LAYER, 17, 106, 0, 0, 0)
end

Expand Down
4 changes: 3 additions & 1 deletion src/game_api/entities_fx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ class FxSpringtrapRing : public Movable
class FxWitchdoctorHint : public Movable
{
public:
std::set<int32_t> unknown; // uid of the witchdoctor, why the map/set?
/// There can be only one Hint above the player, so it has list of witchdoctors
/// in case there are more then one attacking you the same time
std::set<int32_t> witchdoctor;
};

class FxNecromancerANKH : public Movable
Expand Down
Loading

0 comments on commit a29288a

Please sign in to comment.