Skip to content

Commit

Permalink
expose default_color in entitydb, hide the weird glow_ variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Auto committed May 27, 2024
1 parent b65022e commit 772b277
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
5 changes: 1 addition & 4 deletions docs/game_data/spel2.lua

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

5 changes: 1 addition & 4 deletions docs/src/includes/_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,7 @@ float | [acceleration](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=
float | [max_speed](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=max_speed) |
float | [sprint_factor](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=sprint_factor) |
float | [jump](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=jump) |
float | [glow_red](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=glow_red) |
float | [glow_green](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=glow_green) |
float | [glow_blue](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=glow_blue) |
float | [glow_alpha](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=glow_alpha) |
[Color](#Color) | [default_color](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=default_color) |
int | [damage](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=damage) |
int | [life](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=life) |
int | [sacrifice_value](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=sacrifice_value) | Favor for sacrificing alive. Halved when dead (health == 0).
Expand Down
6 changes: 5 additions & 1 deletion src/game_api/entity_db.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct EntityDB
};
/// MASK, will only call collision2 when colliding with entities that match this mask.
int32_t collision2_mask;
/// MASK used for collision with floors.
/// MASK used for collision with floors, walls etc.
int32_t collision_mask;
int32_t field_44;
int32_t default_flags;
Expand All @@ -77,9 +77,13 @@ struct EntityDB
Color default_color;
struct
{
/// NoDoc
float glow_red;
/// NoDoc
float glow_green;
/// NoDoc
float glow_blue;
/// NoDoc
float glow_alpha;
};
};
Expand Down
1 change: 1 addition & 0 deletions src/game_api/script/usertypes/entity_lua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ void register_usertypes(sol::state& lua)
entitydb_type["max_speed"] = &EntityDB::max_speed;
entitydb_type["sprint_factor"] = &EntityDB::sprint_factor;
entitydb_type["jump"] = &EntityDB::jump;
entitydb_type["default_color"] = &EntityDB::default_color;
entitydb_type["glow_red"] = &EntityDB::glow_red;
entitydb_type["glow_green"] = &EntityDB::glow_green;
entitydb_type["glow_blue"] = &EntityDB::glow_blue;
Expand Down

0 comments on commit 772b277

Please sign in to comment.