Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some random things that i can't think of single name for #342

Merged
merged 37 commits into from
Oct 17, 2023
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
623e699
small `get_proper_types` optimisation
Mr-Auto Oct 6, 2023
04a75a2
change `custom_type_names` to vector, since we only iterate thru it
Mr-Auto Oct 6, 2023
ec00a21
add `add_custom_type` function for creating CUSTOM_TYPE
Mr-Auto Oct 6, 2023
a0dfec5
move entity lookups to a separate file to deuce the rpc size a bit
Mr-Auto Oct 6, 2023
5a08dbe
add `get_entities_by_draw_depth`
Mr-Auto Oct 7, 2023
fa792bc
add `kill_recursive` and `destroy_recursive`, update doc
Mr-Auto Oct 7, 2023
241198e
add special code for the mega jellyfish
Mr-Auto Oct 7, 2023
1410ab2
test code before pushing?
Mr-Auto Oct 7, 2023
120ad5f
make `kill_recursive` and `destroy_recursive` always affect the main …
Mr-Auto Oct 7, 2023
7d8b67e
merge main
Mr-Auto Oct 7, 2023
b60a026
update doc
Mr-Auto Oct 7, 2023
2b00768
add `get_current_money` and `add_money_hud` functions
Mr-Auto Oct 8, 2023
480881f
update doc
Mr-Auto Oct 8, 2023
7d33935
expose `get_hud`
Mr-Auto Oct 8, 2023
4f5649f
change the `add_money_hud`
Mr-Auto Oct 8, 2023
099d40b
support custom types in `kill_recursive` and `destroy_recursive`
Mr-Auto Oct 8, 2023
3a98f9c
add `enter_closed_door_crash`
Mr-Auto Oct 8, 2023
fea192f
expose `main_menu_music`, fix `LevelGenSystem` in doc
Mr-Auto Oct 8, 2023
ceaf70f
so, not needed anymore
Mr-Auto Oct 8, 2023
19a3a95
add info about the return of add_money
Mr-Auto Oct 8, 2023
e0cdc3c
fix `drill:trigger()` not making any noise and add optional bool for …
Mr-Auto Oct 9, 2023
2cf2582
add helper function `get_nop`
Mr-Auto Oct 9, 2023
f6d1b33
expose `items.players` (why not), also no need for `std::ref`
Mr-Auto Oct 10, 2023
de6f8ed
merge main
Mr-Auto Oct 11, 2023
e957c11
add rpc back
Mr-Auto Oct 11, 2023
2841c05
comm
Mr-Auto Oct 11, 2023
fdc09bb
merge main, again
Mr-Auto Oct 12, 2023
ac41ad0
a little bit screen stuff
Mr-Auto Oct 14, 2023
242c30c
expose sound channels params
Mr-Auto Oct 14, 2023
3eca33e
merge main
Mr-Auto Oct 14, 2023
9cd1bdf
update doc
Mr-Auto Oct 14, 2023
3559c03
this works, for me at leats
Mr-Auto Oct 14, 2023
2b79d82
just comment
Mr-Auto Oct 15, 2023
33db1fd
fix `vlad_flying` tilecode
Mr-Auto Oct 16, 2023
ac7cc6a
empty add_custom_type
Mr-Auto Oct 16, 2023
38dc6f7
acutally fix the `vlad_flying`
Mr-Auto Oct 16, 2023
741a732
`vampire_flying` the same thing
Mr-Auto Oct 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 44 additions & 53 deletions src/game_api/level_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,16 @@ std::array g_community_tile_codes{
CommunityTileCode{"firebug", "ENT_TYPE_MONS_FIREBUG"},
CommunityTileCode{"vampire", "ENT_TYPE_MONS_VAMPIRE", g_spawn_not_snapped_to_floor},
CommunityTileCode{"vampire_flying", "ENT_TYPE_MONS_VAMPIRE"},
CommunityTileCode{"vlad_flying", "ENT_TYPE_MONS_VLAD", g_spawn_not_snapped_to_floor},
CommunityTileCode{
"vlad_flying",
"ENT_TYPE_MONS_VLAD",
[](const CommunityTileCode& self, float x, float y, Layer* layer)
{
if (Movable* vlad = (Movable*)layer->spawn_entity(self.entity_id, x, y, false, 0.0f, 0.0f, true))
{
vlad->move_state = 9;
}
}},
CommunityTileCode{"osiris", "ENT_TYPE_MONS_OSIRIS_HEAD"},
CommunityTileCode{"anubis2", "ENT_TYPE_MONS_ANUBIS2"},
CommunityTileCode{"assassin", "ENT_TYPE_MONS_FEMALE_JIANGSHI"},
Expand Down Expand Up @@ -420,20 +429,14 @@ std::array g_community_tile_codes{
},
CommunityTileCode{"boulder", "ENT_TYPE_ACTIVEFLOOR_BOULDER"},
CommunityTileCode{"apep", "ENT_TYPE_MONS_APEP_HEAD"},
CommunityTileCode{
"apep_left",
"ENT_TYPE_MONS_APEP_HEAD",
[]([[maybe_unused]] const CommunityTileCode& self, float x, float y, Layer* layer)
{
layer->spawn_apep(x, y, is_room_flipped(x, y));
}},
CommunityTileCode{
"apep_right",
"ENT_TYPE_MONS_APEP_HEAD",
[]([[maybe_unused]] const CommunityTileCode& self, float x, float y, Layer* layer)
{
layer->spawn_apep(x, y, !is_room_flipped(x, y));
}},
CommunityTileCode{"apep_left", "ENT_TYPE_MONS_APEP_HEAD", []([[maybe_unused]] const CommunityTileCode& self, float x, float y, Layer* layer)
{
layer->spawn_apep(x, y, is_room_flipped(x, y));
}},
CommunityTileCode{"apep_right", "ENT_TYPE_MONS_APEP_HEAD", []([[maybe_unused]] const CommunityTileCode& self, float x, float y, Layer* layer)
{
layer->spawn_apep(x, y, !is_room_flipped(x, y));
}},
Dregu marked this conversation as resolved.
Show resolved Hide resolved
CommunityTileCode{"olmite_naked", "ENT_TYPE_MONS_OLMITE_NAKED"},
CommunityTileCode{"olmite_helmet", "ENT_TYPE_MONS_OLMITE_HELMET"},
CommunityTileCode{
Expand Down Expand Up @@ -471,46 +474,34 @@ std::array g_community_tile_codes{
CommunityTileCode{"punishball_attach_bottom", "ENT_TYPE_ITEM_PUNISHBALL", g_spawn_punishball_attach<0, -1>},
CommunityTileCode{"critter_slime", "ENT_TYPE_MONS_CRITTERSLIME"},
CommunityTileCode{"skull", "ENT_TYPE_ITEM_SKULL"},
CommunityTileCode{
"venom",
"ENT_TYPE_ITEM_ACIDSPIT",
[](const CommunityTileCode& self, float x, float y, Layer* layer)
{
layer->spawn_entity(self.entity_id, x, y - 1, false, 0, 0, false);
}},
CommunityTileCode{"venom", "ENT_TYPE_ITEM_ACIDSPIT", [](const CommunityTileCode& self, float x, float y, Layer* layer)
{
layer->spawn_entity(self.entity_id, x, y - 1, false, 0, 0, false);
}},
CommunityTileCode{"arrow_wooden", "ENT_TYPE_ITEM_WOODEN_ARROW"},
CommunityTileCode{"arrow_metal", "ENT_TYPE_ITEM_METAL_ARROW"},
CommunityTileCode{
"arrow_wooden_poison",
"ENT_TYPE_ITEM_WOODEN_ARROW",
[](const CommunityTileCode& self, float x, float y, Layer* layer)
{
Arrow* arrow = layer->spawn_entity_snap_to_floor(self.entity_id, x, y)->as<Arrow>();
arrow->poison_arrow(true);
}},
CommunityTileCode{
"arrow_metal_poison",
"ENT_TYPE_ITEM_METAL_ARROW",
[](const CommunityTileCode& self, float x, float y, Layer* layer)
{
Arrow* arrow = layer->spawn_entity_snap_to_floor(self.entity_id, x, y)->as<Arrow>();
arrow->poison_arrow(true);
}},
CommunityTileCode{
"movable_spikes",
"ENT_TYPE_ITEM_SPIKES",
[](const CommunityTileCode& self, float x, float y, Layer* layer)
{
auto do_spawn = [=]()
{
std::vector<uint32_t> entities_neighbour = get_entities_overlapping_by_pointer({}, 0, x - 0.5f, y - 1.5f, x + 0.5f, y - 0.5f, layer);
if (!entities_neighbour.empty())
{
layer->spawn_entity_over(self.entity_id, get_entity_ptr(entities_neighbour.front()), 0.0f, 1.0f);
}
};
g_attachee_requiring_entities.push_back({{{x, y - 1}}, do_spawn});
}},
CommunityTileCode{"arrow_wooden_poison", "ENT_TYPE_ITEM_WOODEN_ARROW", [](const CommunityTileCode& self, float x, float y, Layer* layer)
{
Arrow* arrow = layer->spawn_entity_snap_to_floor(self.entity_id, x, y)->as<Arrow>();
arrow->poison_arrow(true);
}},
CommunityTileCode{"arrow_metal_poison", "ENT_TYPE_ITEM_METAL_ARROW", [](const CommunityTileCode& self, float x, float y, Layer* layer)
{
Arrow* arrow = layer->spawn_entity_snap_to_floor(self.entity_id, x, y)->as<Arrow>();
arrow->poison_arrow(true);
}},
CommunityTileCode{"movable_spikes", "ENT_TYPE_ITEM_SPIKES", [](const CommunityTileCode& self, float x, float y, Layer* layer)
{
auto do_spawn = [=]()
{
std::vector<uint32_t> entities_neighbour = get_entities_overlapping_by_pointer({}, 0, x - 0.5f, y - 1.5f, x + 0.5f, y - 0.5f, layer);
if (!entities_neighbour.empty())
{
layer->spawn_entity_over(self.entity_id, get_entity_ptr(entities_neighbour.front()), 0.0f, 1.0f);
}
};
g_attachee_requiring_entities.push_back({{{x, y - 1}}, do_spawn});
}},
CommunityTileCode{"boombox", "ENT_TYPE_ITEM_BOOMBOX"},
// CommunityTileCode{
// "lake_imposter",
Expand Down
Loading