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:
shweet committed 2026-11-20 19:04:41 -05:00
1 parent 8ae02a8422
commit 6e3da161fc
138 files changed
+16754 -6825

No files matched your search

+38
View File
@@ -9,6 +9,9 @@
#include "temporary_effects.h"
#include "weapon.h"
// The QueueItemData flag Touched reads: the item was held before, so picking it up again gives no pickup effect.
constexpr uint32_t QUEUE_ITEM_TOUCHED = 0x1;
// The weapon a player's fire delay belongs to: the override in slot 0, else the first.
static Weapon* player_weapon_main(Entity_Player& player)
{
@@ -67,6 +70,12 @@ static void player_health_register(lua_State* state)
lua_method(state, "SetBloodCharge", [](Entity_Player& player, int amount) { player.SetBloodCharge(amount); });
lua_method(state, "GetEffectiveBloodCharge",
[](Entity_Player& player) { return player.GetEffectiveBloodCharge(); });
lua_method(state, "GetSoulCharge", [](Entity_Player& player) { return player.effectiveSoulCharge; });
lua_method(state, "GetBloodCharge", [](Entity_Player& player) { return player.effectiveBloodCharge; });
lua_method(state, "GetPoopMana", [](Entity_Player& player) { return player.poopMana; });
lua_method(state, "GetMaxPoopMana", [](Entity_Player&) { return Entity_Player::GetMaxPoopMana(); });
lua_method(state, "AddPoopMana", [](Entity_Player& player, int amount) { player.AddPoopMana(amount); });
lua_method(state, "GetPoopSpell", [](Entity_Player& player, int position) { return player.GetPoopSpell(position); });
lua_method(state, "HasInvincibility", [](Entity_Player& player, uint64_t flags, const EntityRef& source) {
return player.HasInvincibility(flags, source);
});
@@ -201,6 +210,18 @@ static void player_items_register(lua_State* state)
// Registers the player's animations, controls and the rest of the EntityPlayer methods.
static void player_misc_register(lua_State* state)
{
lua_field<&Entity_Player::queuedItem>(state, "QueuedItem");
lua_method(state, "GetBabySkin", [](Entity_Player& player) { return player.babySkin; });
lua_method(state, "GetModelingClayEffect", [](Entity_Player& player) { return player.modelingClayEffect; });
lua_method(state, "ClearDeadEyeCharge", [](Entity_Player& player) { player.ClearDeadEyeCharge(); });
lua_method(state, "SetShootingCooldown", [](Entity_Player& player, int cooldown) { player.SetShootingCooldown(cooldown); });
lua_method(state, "GetMovementInput", [](Entity_Player& player) { return player.GetMovementJoystick(); });
lua_method(state, "GetShootingInput", [](Entity_Player& player) { return player.GetShootingJoystick(); });
lua_method(state, "CheckFamiliar",
[](Entity_Player& player, int variant, int count, RNG& rng, ItemConfig_Item* item, int subtype) {
familiar_check(player, {.item = item, .rng = &rng, .count = count, .subtype = subtype,
.variant = variant});
});
lua_method(state, "GetName", [](Entity_Player& player) -> const std::string& { return player.name; });
lua_method(state, "GetPlayerType", [](Entity_Player& player) { return player.playerType; });
lua_method(state, "ChangePlayerType",
@@ -359,7 +380,24 @@ void lua_api_entity_player_register(lua_State* state)
player_stats_register(state);
lua_class_end(state);
lua_class_begin(state, "QueueItemData", LUA_CLASS_QUEUE_ITEM_DATA);
lua_field<&QueueItemData::item>(state, "Item");
lua_field<&QueueItemData::charge>(state, "Charge");
lua_property(state, "Touched", [](QueueItemData& queued) { return (queued.flags & QUEUE_ITEM_TOUCHED) != 0; });
lua_class_end(state);
lua_class_begin(state, "TemporaryEffect", LUA_CLASS_TEMPORARY_EFFECT);
lua_field<&TemporaryEffect::item>(state, "Item");
lua_field<&TemporaryEffect::count>(state, "Count");
lua_field<&TemporaryEffect::cooldown>(state, "Cooldown");
lua_class_end(state);
lua_class_begin(state, "TemporaryEffects", LUA_CLASS_TEMPORARY_EFFECTS);
lua_method(state, "GetCollectibleEffect",
[](TemporaryEffects& effects, int id) { return effects.GetCollectibleEffect(id); });
lua_method(state, "GetTrinketEffect",
[](TemporaryEffects& effects, int id) { return effects.GetTrinketEffect(id); });
lua_method(state, "GetNullEffect", [](TemporaryEffects& effects, int id) { return effects.GetNullEffect(id); });
lua_method(state, "AddCollectibleEffect", [](TemporaryEffects& effects, int id, bool isAddCostume, int count) {
effects.AddCollectibleEffect(id, isAddCostume, count);
});