Skip to content

Commit

Permalink
Merge pull request #385 from Mr-Auto/color.in.entitydb
Browse files Browse the repository at this point in the history
Color in entitydb
  • Loading branch information
Dregu authored Jul 11, 2024
2 parents 767ce21 + 441714b commit 9916af9
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 13 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
13 changes: 12 additions & 1 deletion src/game_api/entities_chars.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,18 @@ class Ai
int8_t unknown24;
int8_t unknown25;
int32_t unknown26;
// Map unknown27;
std::map<size_t, size_t> unknown27;

size_t unknown28; // probably vector?
size_t unknown29;
size_t unknown30;

std::vector<uintptr_t> unknown31; // pointers to the Ai targets in state
std::map<uint32_t, uint8_t> unknown32; // dunno what any of this is, keeps changing rapidly

size_t unknown33;
uintptr_t unknown34; // pointer to map/set ?
std::map<size_t, size_t> unknown35;
};

class PowerupCapable : public Movable
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/layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ struct Layer

EntityList unknown_entities2;
std::array<EntityList, 53> entities_by_draw_depth;
EntityList unknown_entities2a;
EntityList unknown_entities3; // debris, explosions, laserbeams etc. ?
EntityList unknown_entities4; // explosions, laserbeams, BG_LEVEL_*_SOOT ? only for short time while there are spawned?
std::vector<Entity*> unknown_vector; // add_to_layer uses this
Expand Down
3 changes: 2 additions & 1 deletion src/game_api/savedata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ struct ConstellationLine

struct Constellation
{
uint32_t star_count;
uint8_t star_count;
uint8_t unknown[3]; // possibly something?
std::array<ConstellationStar, 45> stars;
float scale;
uint8_t line_count;
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
8 changes: 6 additions & 2 deletions src/game_api/state_structs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,12 @@ struct LiquidPhysicsEngine
std::list<size_t> unk1; // seams to be empty, or have one element 0?
uint32_t resize_value; // used to resive the arrays?
uint32_t unk3b; // padding probably
std::list<int32_t> liquid_ids;
std::list<int32_t> unknown44; // all of them are -1

// this is actually a pre C++11 version of std::list, which is different from current one!
std::pair<size_t, size_t> liquid_ids; // std::list<int32_t>
// this is actually a pre C++11 version of std::list, which is different from current one!
std::pair<size_t, size_t> unknown44; // std::list<int32_t> all of them are -1

std::list<int32_t>::const_iterator* list_liquid_ids; // list of all iterators of liquid_ids?
int32_t unknown45a; // size related for the array above
int32_t unknown45b; // padding
Expand Down

0 comments on commit 9916af9

Please sign in to comment.