Curation round 14: console and Lua API, effects, lasers, enemies, eleven bosses, the Depths and Mom, status effects, the playable characters
This commit is contained in:
1 parent
8ae02a8422
commit
6e3da161fc
138 files changed
+16754
-6825
No files matched your search
+49
-2
@@ -1,4 +1,5 @@
|
||||
#include "classes.h"
|
||||
#include "boss_ai.h"
|
||||
#include "entity_npc.h"
|
||||
#include "entity_player.h"
|
||||
#include "game.h"
|
||||
@@ -7,11 +8,17 @@
|
||||
#include "lua_api.h"
|
||||
#include "manager.h"
|
||||
#include "music_manager.h"
|
||||
#include "npc_basement.h"
|
||||
#include "room_transition.h"
|
||||
#include "seeds.h"
|
||||
#include "sfx_manager.h"
|
||||
#include <algorithm>
|
||||
|
||||
// Registers Lua's Game: the run's level, room, players, pools, seeds and HUD, spawning, and its state flags and
|
||||
// counters. Game is also the Level it derives from.
|
||||
// The reach of a Fart a script leaves out.
|
||||
constexpr float FART_RADIUS = 85;
|
||||
|
||||
// (00703510, 00703570) Registers Lua's Game: the run's level, room, players, pools, seeds and HUD, spawning, room
|
||||
// transitions and farts, and its state flags and counters. Game is also the Level it derives from.
|
||||
static void game_register(lua_State* state)
|
||||
{
|
||||
lua_class_begin(state, "Game", LUA_CLASS_GAME);
|
||||
@@ -35,6 +42,29 @@ static void game_register(lua_State* state)
|
||||
int subType, uint32_t seed) {
|
||||
return game.Spawn({position, velocity, spawner, subType, type, variant, seed});
|
||||
});
|
||||
lua_method(state, "StartRoomTransition",
|
||||
[](Game& game, int roomIndex, Direction direction, LuaDefault<int, TRANSITION_FADE> animation,
|
||||
Entity_Player* player, LuaDefault<int, -1> dimension) {
|
||||
game.StartRoomTransition({.player = player, .animation = (RoomTransitionAnim)animation.value,
|
||||
.direction = direction, .dimension = dimension.value,
|
||||
.roomIndex = roomIndex});
|
||||
});
|
||||
lua_method(state, "HasEncounteredBoss", [](Game& game, int type, int variant) {
|
||||
return std::ranges::any_of(game.encounteredBosses,
|
||||
[&](BossId& boss) { return boss.type == type && boss.variant == variant; });
|
||||
});
|
||||
lua_method(state, "GetGreedBossWaveNum",
|
||||
[](Game& game) { return GREED_BOSS_WAVE + (game.difficulty == DIFFICULTY_GREEDIER); });
|
||||
lua_method(state, "Fart", [](Game&, Vector position, LuaDefault<float, FART_RADIUS> radius, Entity* source,
|
||||
LuaDefault<float, 1.0f> scale, LuaDefault<int, 0> subType, ColorMod* color) {
|
||||
game_fart({.position = position, .source = source, .color = color ? *color : COLOR_DEFAULT,
|
||||
.radius = radius.value, .scale = scale.value, .subType = subType.value});
|
||||
});
|
||||
lua_method(state, "ButterBeanFart", [](Game&, Vector position, float radius, Entity* source,
|
||||
LuaDefault<bool, true> isShowEffect, bool isSuperKnockback) {
|
||||
game_butter_bean_fart({.position = position, .source = source, .radius = radius,
|
||||
.isShowEffect = isShowEffect.value, .isSuperKnockback = isSuperKnockback});
|
||||
});
|
||||
lua_method(state, "GetVictoryLap", [](Game& game) { return game.victoryLap; });
|
||||
lua_method(state, "GetDevilRoomDeals", [](Game& game) { return game.devilRoomDeals; });
|
||||
lua_method(state, "GetLastDevilRoomStage", [](Game& game) { return game.lastDevilRoomStage; });
|
||||
@@ -67,6 +97,10 @@ static void game_parts_register(lua_State* state)
|
||||
lua_method(state, "ShowItemText", [](HUD& hud, Entity_Player* player, ItemConfig_Item* item) {
|
||||
hud.ShowItemText(player, item);
|
||||
});
|
||||
lua_method(state, "AssignPlayerHUDs", [](HUD& hud) { hud.AssignPlayerHUDs(); });
|
||||
lua_method(state, "Update", [](HUD& hud) { hud.Update(); });
|
||||
lua_method(state, "PostUpdate", [](HUD& hud) { hud.PostUpdate(); });
|
||||
lua_method(state, "Render", [](HUD& hud) { hud.Render(); });
|
||||
lua_class_end(state);
|
||||
|
||||
lua_class_begin(state, "ItemPool", LUA_CLASS_ITEM_POOL);
|
||||
@@ -110,6 +144,19 @@ static void game_parts_register(lua_State* state)
|
||||
lua_method(state, "AddSeedEffect", [](Seeds& seeds, int effect) { seeds.AddSeedEffect(effect); });
|
||||
lua_method(state, "RemoveSeedEffect", [](Seeds& seeds, int effect) { seeds.RemoveSeedEffect(effect); });
|
||||
lua_method(state, "CanAddSeedEffect", [](Seeds& seeds, uint32_t effect) { return seeds.CanAddSeedEffect(effect); });
|
||||
lua_method(state, "SetStartSeed", [](Seeds& seeds, std::string_view seed) { seeds.SetStartSeed(seed); });
|
||||
lua_method(state, "ClearStartSeed", [](Seeds& seeds) { seeds.ClearStartSeed(); });
|
||||
lua_method(state, "Reset", [](Seeds& seeds) { seeds.Reset(); });
|
||||
lua_method(state, "Restart", [](Seeds& seeds, int challenge) { seeds.Restart(challenge); });
|
||||
lua_method(state, "ForgetStageSeed", [](Seeds& seeds, int stage) { seeds.ForgetStageSeed(stage); });
|
||||
lua_method(state, "RemoveBlockingSeedEffects", [](Seeds& seeds, int effect) { seeds.RemoveBlockingSeedEffects(effect); });
|
||||
lua_method(state, "ClearSeedEffects", [](Seeds& seeds) { seeds.ClearSeedEffects(); });
|
||||
lua_method(state, "CountSeedEffects", [](Seeds& seeds) { return seeds.CountSeedEffects(); });
|
||||
lua_static(state, "GetSeedEffect", [](std::string_view seed) { return Seeds::GetSeedEffect(seed); });
|
||||
lua_static(state, "IsSpecialSeed", [](std::string_view seed) { return Seeds::IsSpecialSeed(seed); });
|
||||
lua_static(state, "IsSeedComboBanned", [](int effectA, int effectB) { return Seeds::IsSeedComboBanned(effectA, effectB); });
|
||||
lua_static(state, "InitSeedInfo", []() { Seeds::InitSeedInfo(); });
|
||||
lua_static(state, "CountUnlockedSeedEffects", []() { return Seeds::CountUnlockedSeedEffects(); });
|
||||
lua_static(state, "Seed2String", [](uint32_t seed) { return Seeds::Seed2String(seed); });
|
||||
lua_static(state, "String2Seed", [](std::string_view seed) { return Seeds::String2Seed(seed); });
|
||||
lua_static(state, "IsStringValidSeed", [](std::string_view seed) { return Seeds::IsStringValidSeed(seed); });
|
||||
|
||||
Reference in new issue
Block a user