From 881a82b3257e17ccfc1bf40b56f18cb634108129 Mon Sep 17 00:00:00 2001 From: shweet Date: Tue, 24 Nov 2026 07:22:07 -0500 Subject: [PATCH] REPENTOGON phase 2: about 1,880 of its Lua functions, properties and constructors ported onto the rebuild's classes (new classes CostumeSpriteDesc, History, PocketItem, LevelGenerator and others), REPENTOGON's changes to vanilla functions behind the parity switch; 72 goldens identical from converted resources and the install --- analysis/repentogon_coverage.tsv | 3770 ++++++++++++------------- analysis/repentogon_overrides.tsv | 95 + assets/repentogon/scripts/main_ex.lua | 2 - generated-src/classes.h | 10 +- generated-src/stubs.cpp | 1 - scripts/repentogon_coverage.py | 46 +- src/engine/anm2.cpp | 12 +- src/engine/anm2.h | 21 + src/engine/platform.cpp | 4 + src/engine/platform.h | 4 +- src/entity/boss/delirium.cpp | 7 + src/entity/config.cpp | 14 + src/entity/config.h | 12 + src/entity/entity.cpp | 3 + src/entity/entity.h | 6 + src/entity/familiar/evaluate.cpp | 1 + src/entity/familiar/familiar.h | 4 +- src/entity/npc/boss.cpp | 6 + src/entity/npc/npc.cpp | 21 +- src/entity/npc/npc.h | 2 + src/entity/npc/polty.cpp | 24 +- src/entity/pickup/item_config.cpp | 15 + src/entity/pickup/item_config.h | 14 + src/entity/pickup/item_pool.cpp | 4 + src/entity/pickup/loot_list.h | 4 +- src/entity/pickup/pickup.cpp | 3 + src/entity/pickup/pickup.h | 5 + src/entity/pickup/slot.cpp | 2 +- src/entity/player/effects.cpp | 3 + src/entity/player/health.cpp | 7 +- src/entity/player/player.h | 4 + src/entity/player/weapons.cpp | 1 - src/entity/water.cpp | 13 +- src/entity/weapon/knife.h | 4 + src/entity/weapon/knife_hits.cpp | 3 + src/entity/weapon/laser.cpp | 10 + src/entity/weapon/laser.h | 5 + src/entity/weapon/tear.cpp | 3 + src/entity/weapon/tear.h | 4 + src/game/debug_renderer.cpp | 10 + src/game/debug_renderer.h | 1 + src/game/manager.cpp | 3 + src/game/music_manager.cpp | 1 + src/game/music_manager.h | 4 + src/level/ambush.cpp | 4 +- src/level/ambush.h | 5 + src/level/generator.cpp | 3 +- src/level/grid/grid_entity.cpp | 10 + src/level/grid/grid_entity.h | 5 + src/level/grid/rock.cpp | 12 +- src/level/grid/rock.h | 11 + src/level/level.cpp | 10 + src/level/room.cpp | 7 +- src/level/room_render.cpp | 4 +- src/lua/api.h | 50 + src/lua/api_color.cpp | 6 + src/lua/api_entities.cpp | 36 + src/lua/api_entity.cpp | 6 + src/lua/api_entity_player.cpp | 14 + src/lua/api_game.cpp | 21 + src/lua/api_grid_entity.cpp | 11 + src/lua/api_isaac.cpp | 28 + src/lua/api_item_config.cpp | 18 + src/lua/api_rng.cpp | 6 + src/lua/api_room.cpp | 15 + src/lua/api_sprite.cpp | 13 + src/lua/api_vector.cpp | 6 + src/lua/callbacks.cpp | 7 +- src/lua/engine.cpp | 17 + src/lua/engine.h | 79 + src/repentogon/api.h | 160 ++ src/repentogon/api_console.cpp | 439 +++ src/repentogon/api_entities.cpp | 1059 +++++++ src/repentogon/api_game.cpp | 742 +++++ src/repentogon/api_game.h | 19 + src/repentogon/api_input.cpp | 56 + src/repentogon/api_items.cpp | 664 +++++ src/repentogon/api_items.h | 32 + src/repentogon/api_level.cpp | 907 ++++++ src/repentogon/api_level.h | 60 + src/repentogon/api_misc.cpp | 527 ++++ src/repentogon/api_npc.cpp | 592 ++++ src/repentogon/api_pickup.cpp | 298 ++ src/repentogon/api_room.cpp | 545 ++++ src/repentogon/api_saves.cpp | 451 +++ src/repentogon/api_weapons.cpp | 616 ++++ src/repentogon/audio.cpp | 65 + src/repentogon/audio.h | 2 + src/repentogon/entities.h | 16 + src/repentogon/hud.cpp | 468 ++- src/repentogon/hud.h | 22 + src/repentogon/items.cpp | 14 + src/repentogon/items.h | 8 + src/repentogon/level.cpp | 6 +- src/repentogon/level.h | 8 + src/repentogon/lua_render.cpp | 1077 +++++++ src/repentogon/lua_render.h | 36 + src/repentogon/lua_sprite.cpp | 644 +++++ src/repentogon/menus.cpp | 573 ++++ src/repentogon/menus.h | 9 + src/repentogon/npc.cpp | 19 + src/repentogon/npc.h | 21 + src/repentogon/player.h | 3 + src/repentogon/player_api.cpp | 1248 ++++++++ src/repentogon/render.h | 9 + src/repentogon/repentogon.cpp | 45 +- src/repentogon/repentogon.h | 6 + src/repentogon/saves.h | 3 + src/repentogon/weapons.h | 50 +- src/ui/console_commands.cpp | 22 +- src/ui/hud.cpp | 71 +- src/ui/hud.h | 12 +- src/ui/menu/character.cpp | 6 + src/ui/menu/character.h | 1 + src/ui/menu/save.cpp | 7 + 115 files changed, 14243 insertions(+), 1987 deletions(-) create mode 100644 analysis/repentogon_overrides.tsv create mode 100644 src/repentogon/api.h create mode 100644 src/repentogon/api_console.cpp create mode 100644 src/repentogon/api_entities.cpp create mode 100644 src/repentogon/api_game.cpp create mode 100644 src/repentogon/api_game.h create mode 100644 src/repentogon/api_input.cpp create mode 100644 src/repentogon/api_items.cpp create mode 100644 src/repentogon/api_items.h create mode 100644 src/repentogon/api_level.cpp create mode 100644 src/repentogon/api_level.h create mode 100644 src/repentogon/api_misc.cpp create mode 100644 src/repentogon/api_npc.cpp create mode 100644 src/repentogon/api_pickup.cpp create mode 100644 src/repentogon/api_room.cpp create mode 100644 src/repentogon/api_saves.cpp create mode 100644 src/repentogon/api_weapons.cpp create mode 100644 src/repentogon/lua_render.cpp create mode 100644 src/repentogon/lua_render.h create mode 100644 src/repentogon/lua_sprite.cpp create mode 100644 src/repentogon/menus.cpp create mode 100644 src/repentogon/menus.h create mode 100644 src/repentogon/player_api.cpp diff --git a/analysis/repentogon_coverage.tsv b/analysis/repentogon_coverage.tsv index ae3bc5b..608f564 100644 --- a/analysis/repentogon_coverage.tsv +++ b/analysis/repentogon_coverage.tsv @@ -3,991 +3,991 @@ function ASMPatchTest AddBytes repentogon/LuaInterfaces/LuaASM.cpp:172 misc tod function ASMPatchTest AddCJump repentogon/LuaInterfaces/LuaASM.cpp:174 misc todo debug builds only function ASMPatchTest AddJump repentogon/LuaInterfaces/LuaASM.cpp:173 misc todo debug builds only function ASMPatchTest ToASM repentogon/LuaInterfaces/LuaASM.cpp:175 misc todo debug builds only -function Ambush GetCurrentWave repentogon/LuaInterfaces/LuaAmbush.cpp:258 Ambush.md game todo -function Ambush GetMaxBossChallengeWaves repentogon/LuaInterfaces/LuaAmbush.cpp:256 Ambush.md game todo -function Ambush GetMaxBossrushWaves repentogon/LuaInterfaces/LuaAmbush.cpp:252 Ambush.md game todo -function Ambush GetMaxChallengeWaves repentogon/LuaInterfaces/LuaAmbush.cpp:254 Ambush.md game todo -function Ambush GetNextWave repentogon/LuaInterfaces/LuaAmbush.cpp:260 Ambush.md game todo -function Ambush GetNextWaves repentogon/LuaInterfaces/LuaAmbush.cpp:261 Ambush.md game todo -function Ambush SetMaxBossChallengeWaves repentogon/LuaInterfaces/LuaAmbush.cpp:257 Ambush.md game todo -function Ambush SetMaxBossrushWaves repentogon/LuaInterfaces/LuaAmbush.cpp:253 Ambush.md game todo -function Ambush SetMaxChallengeWaves repentogon/LuaInterfaces/LuaAmbush.cpp:255 Ambush.md game todo -function Ambush SpawnBossrushWave repentogon/LuaInterfaces/LuaAmbush.cpp:248 Ambush.md game todo -function Ambush SpawnWave repentogon/LuaInterfaces/LuaAmbush.cpp:249 Ambush.md game todo -function Ambush StartChallenge repentogon/LuaInterfaces/LuaAmbush.cpp:247 Ambush.md game todo -function AnimationData GetAllLayers repentogon/LuaInterfaces/LuaAnimationData.cpp:148 AnimationData.md render and sprites todo -function AnimationData GetLayer repentogon/LuaInterfaces/LuaAnimationData.cpp:149 AnimationData.md render and sprites todo -function AnimationData GetLength repentogon/LuaInterfaces/LuaAnimationData.cpp:151 AnimationData.md render and sprites todo -function AnimationData GetName repentogon/LuaInterfaces/LuaAnimationData.cpp:150 AnimationData.md render and sprites todo -function AnimationData IsLoopingAnimation repentogon/LuaInterfaces/LuaAnimationData.cpp:152 AnimationData.md render and sprites todo -function AnimationFrame GetColor repentogon/LuaInterfaces/LuaAnimationFrame.cpp:100 AnimationFrame.md render and sprites todo -function AnimationFrame GetCrop repentogon/LuaInterfaces/LuaAnimationFrame.cpp:91 AnimationFrame.md render and sprites todo -function AnimationFrame GetEndFrame repentogon/LuaInterfaces/LuaAnimationFrame.cpp:102 AnimationFrame.md render and sprites todo -function AnimationFrame GetHeight repentogon/LuaInterfaces/LuaAnimationFrame.cpp:93 AnimationFrame.md render and sprites todo -function AnimationFrame GetPivot repentogon/LuaInterfaces/LuaAnimationFrame.cpp:96 AnimationFrame.md render and sprites todo -function AnimationFrame GetPos repentogon/LuaInterfaces/LuaAnimationFrame.cpp:94 AnimationFrame.md render and sprites todo -function AnimationFrame GetRotation repentogon/LuaInterfaces/LuaAnimationFrame.cpp:98 AnimationFrame.md render and sprites todo -function AnimationFrame GetScale repentogon/LuaInterfaces/LuaAnimationFrame.cpp:95 AnimationFrame.md render and sprites todo -function AnimationFrame GetStartFrame repentogon/LuaInterfaces/LuaAnimationFrame.cpp:101 AnimationFrame.md render and sprites todo -function AnimationFrame GetWidth repentogon/LuaInterfaces/LuaAnimationFrame.cpp:92 AnimationFrame.md render and sprites todo -function AnimationFrame IsInterpolated repentogon/LuaInterfaces/LuaAnimationFrame.cpp:99 AnimationFrame.md render and sprites todo -function AnimationFrame IsVisible repentogon/LuaInterfaces/LuaAnimationFrame.cpp:97 AnimationFrame.md render and sprites todo -function AnimationLayer GetFrame repentogon/LuaInterfaces/LuaAnimationLayer.cpp:69 AnimationLayer.md render and sprites todo -function AnimationLayer GetLayerID repentogon/LuaInterfaces/LuaAnimationLayer.cpp:70 AnimationLayer.md render and sprites todo -function AnimationLayer IsVisible repentogon/LuaInterfaces/LuaAnimationLayer.cpp:71 AnimationLayer.md render and sprites todo -function Backdrop GetControlsANM2 repentogon/LuaInterfaces/LuaBackdrop.cpp:106 Backdrop.md level and room todo -function Backdrop GetControlsButtonsANM2 repentogon/LuaInterfaces/LuaBackdrop.cpp:107 Backdrop.md level and room todo -function Backdrop GetDetailANM2 repentogon/LuaInterfaces/LuaBackdrop.cpp:105 Backdrop.md level and room todo -function Backdrop GetFloorANM2 repentogon/LuaInterfaces/LuaBackdrop.cpp:104 Backdrop.md level and room todo -function Backdrop GetFloorImage repentogon/LuaInterfaces/LuaBackdrop.cpp:103 Backdrop.md level and room todo -function Backdrop GetWallImage repentogon/LuaInterfaces/LuaBackdrop.cpp:102 Backdrop.md level and room todo -function Beam Add repentogon/LuaInterfaces/LuaBeamRenderer.cpp:389 render and sprites todo -function Beam GetLayer repentogon/LuaInterfaces/LuaBeamRenderer.cpp:393 render and sprites todo -function Beam GetPoints repentogon/LuaInterfaces/LuaBeamRenderer.cpp:399 render and sprites todo -function Beam GetSprite repentogon/LuaInterfaces/LuaBeamRenderer.cpp:391 render and sprites todo -function Beam GetUnkBool repentogon/LuaInterfaces/LuaBeamRenderer.cpp:397 render and sprites todo -function Beam GetUseOverlay repentogon/LuaInterfaces/LuaBeamRenderer.cpp:395 render and sprites todo -function Beam Render repentogon/LuaInterfaces/LuaBeamRenderer.cpp:390 render and sprites todo -function Beam SetLayer repentogon/LuaInterfaces/LuaBeamRenderer.cpp:394 render and sprites todo -function Beam SetPoints repentogon/LuaInterfaces/LuaBeamRenderer.cpp:400 render and sprites todo -function Beam SetSprite repentogon/LuaInterfaces/LuaBeamRenderer.cpp:392 render and sprites todo -function Beam SetUnkBool repentogon/LuaInterfaces/LuaBeamRenderer.cpp:398 render and sprites todo -function Beam SetUseOverlay repentogon/LuaInterfaces/LuaBeamRenderer.cpp:396 render and sprites todo -function BestiaryMenu GetBestiaryMenuSprite repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:104 hud and menus todo -function BestiaryMenu GetDeathScreenSprite repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:105 hud and menus todo -function BestiaryMenu GetEnemySprite repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:106 hud and menus todo -function BestiaryMenu GetNumBossPages repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:112 hud and menus todo -function BestiaryMenu GetNumMonsterPages repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:111 hud and menus todo -function BestiaryMenu GetNumPages repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:113 hud and menus todo -function BestiaryMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:109 hud and menus todo -function BestiaryMenu GetSelectedPage repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:107 hud and menus todo -function BestiaryMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:110 hud and menus todo -function BestiaryMenu SetSelectedPage repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:108 hud and menus todo -function BlendMode New repentogon/LuaInterfaces/LuaBlendMode.cpp:321 render and sprites todo -function BlendMode NewFromType repentogon/LuaInterfaces/LuaBlendMode.cpp:324 render and sprites todo -function BlendMode SetMode repentogon/LuaInterfaces/LuaBlendMode.cpp:308 render and sprites todo -function BossPool GetDoubleTroubleRoomID repentogon/LuaInterfaces/LuaBossPool.cpp:90 BossPool.md npc todo -function BossPool GetDoubleTroubleRoomVariantStart repentogon/LuaInterfaces/LuaBossPool.cpp:89 npc todo -function BossPool GetEntries repentogon/LuaInterfaces/LuaBossPool.cpp:86 BossPool.md npc todo -function BossPool GetName repentogon/LuaInterfaces/LuaBossPool.cpp:85 BossPool.md npc todo -function BossPool GetRNG repentogon/LuaInterfaces/LuaBossPool.cpp:88 BossPool.md npc todo -function BossPool GetWeight repentogon/LuaInterfaces/LuaBossPool.cpp:87 BossPool.md npc todo -function BossPoolManager GetLevelBlacklist repentogon/LuaInterfaces/LuaBossPool.cpp:130 npc todo -function BossPoolManager GetPool repentogon/LuaInterfaces/LuaBossPool.cpp:128 BossPoolManager.md npc todo -function BossPoolManager GetRemovedBosses repentogon/LuaInterfaces/LuaBossPool.cpp:129 BossPoolManager.md npc todo -function BossPoolManager GetRemovedSpecialBosses repentogon/LuaInterfaces/LuaBossPool.cpp:131 BossPoolManager.md npc todo -function Camera IsClampEnabled repentogon/LuaInterfaces/LuaCamera.cpp:72 Camera.md level and room todo -function Camera IsPosVisible repentogon/LuaInterfaces/LuaCamera.cpp:70 Camera.md level and room todo -function Camera SetClampEnabled repentogon/LuaInterfaces/LuaCamera.cpp:73 Camera.md level and room todo -function Camera SetFocusPosition repentogon/LuaInterfaces/LuaCamera.cpp:68 Camera.md level and room todo -function Camera SnapToPosition repentogon/LuaInterfaces/LuaCamera.cpp:69 Camera.md level and room todo -function Camera Update repentogon/LuaInterfaces/LuaCamera.cpp:71 Camera.md level and room todo -function Capsule Collide repentogon/LuaInterfaces/LuaCapsule.cpp:127 Capsule.md entities todo -function Capsule GetDirection repentogon/LuaInterfaces/LuaCapsule.cpp:124 Capsule.md entities todo -function Capsule GetEndPoint repentogon/LuaInterfaces/LuaCapsule.cpp:123 entities todo -function Capsule GetF1 repentogon/LuaInterfaces/LuaCapsule.cpp:132 Capsule.md entities todo -function Capsule GetF2 repentogon/LuaInterfaces/LuaCapsule.cpp:133 Capsule.md entities todo -function Capsule GetPosition repentogon/LuaInterfaces/LuaCapsule.cpp:121 Capsule.md entities todo -function Capsule GetSize repentogon/LuaInterfaces/LuaCapsule.cpp:125 entities todo -function Capsule GetSizeDifference repentogon/LuaInterfaces/LuaCapsule.cpp:126 entities todo -function Capsule GetStartPoint repentogon/LuaInterfaces/LuaCapsule.cpp:122 entities todo -function Capsule GetVec2 repentogon/LuaInterfaces/LuaCapsule.cpp:130 Capsule.md entities todo -function Capsule GetVec3 repentogon/LuaInterfaces/LuaCapsule.cpp:131 Capsule.md entities todo -function Card ClearAvailabilityCondition repentogon/LuaInterfaces/LuaItemConfig.cpp:210 ItemConfig_Card.md items and pools todo -function Card GetAvailabilityCondition repentogon/LuaInterfaces/LuaItemConfig.cpp:205 ItemConfig_Card.md items and pools todo -function Card SetAvailabilityCondition repentogon/LuaInterfaces/LuaItemConfig.cpp:209 ItemConfig_Card.md items and pools todo -function ChallengeMenu GetSelectedChallengeID repentogon/LuaInterfaces/Menus/LuaChallengeMenu.cpp:37 hud and menus todo -function ChallengeMenu GetSprite repentogon/LuaInterfaces/Menus/LuaChallengeMenu.cpp:36 hud and menus todo -function ChallengeMenu SetSelectedChallengeID repentogon/LuaInterfaces/Menus/LuaChallengeMenu.cpp:38 hud and menus todo -function ChallengeParam CanShoot repentogon/LuaInterfaces/LuaChallengeParam.cpp:306 ChallengeParam.md game todo -function ChallengeParam GetAchievementList repentogon/LuaInterfaces/LuaChallengeParam.cpp:299 ChallengeParam.md game todo -function ChallengeParam GetAddDamage repentogon/LuaInterfaces/LuaChallengeParam.cpp:305 ChallengeParam.md game todo -function ChallengeParam GetBlackHearts repentogon/LuaInterfaces/LuaChallengeParam.cpp:301 ChallengeParam.md game todo -function ChallengeParam GetCoins repentogon/LuaInterfaces/LuaChallengeParam.cpp:304 ChallengeParam.md game todo -function ChallengeParam GetCollectibleList repentogon/LuaInterfaces/LuaChallengeParam.cpp:293 ChallengeParam.md game todo -function ChallengeParam GetCollectibleTwinList repentogon/LuaInterfaces/LuaChallengeParam.cpp:317 ChallengeParam.md game todo -function ChallengeParam GetCurse repentogon/LuaInterfaces/LuaChallengeParam.cpp:314 ChallengeParam.md game todo -function ChallengeParam GetCurseFilter repentogon/LuaInterfaces/LuaChallengeParam.cpp:315 ChallengeParam.md game todo -function ChallengeParam GetDifficulty repentogon/LuaInterfaces/LuaChallengeParam.cpp:308 ChallengeParam.md game todo -function ChallengeParam GetEndStage repentogon/LuaInterfaces/LuaChallengeParam.cpp:297 ChallengeParam.md game todo -function ChallengeParam GetHearts repentogon/LuaInterfaces/LuaChallengeParam.cpp:302 ChallengeParam.md game todo -function ChallengeParam GetMaxHearts repentogon/LuaInterfaces/LuaChallengeParam.cpp:303 ChallengeParam.md game todo -function ChallengeParam GetMinFireRate repentogon/LuaInterfaces/LuaChallengeParam.cpp:310 ChallengeParam.md game todo -function ChallengeParam GetName repentogon/LuaInterfaces/LuaChallengeParam.cpp:291 ChallengeParam.md game todo -function ChallengeParam GetPlayerType repentogon/LuaInterfaces/LuaChallengeParam.cpp:298 ChallengeParam.md game todo -function ChallengeParam GetRoomFilter repentogon/LuaInterfaces/LuaChallengeParam.cpp:292 ChallengeParam.md game todo -function ChallengeParam GetSoulHearts repentogon/LuaInterfaces/LuaChallengeParam.cpp:300 ChallengeParam.md game todo -function ChallengeParam GetStartingCard repentogon/LuaInterfaces/LuaChallengeParam.cpp:296 ChallengeParam.md game todo -function ChallengeParam GetStartingPill repentogon/LuaInterfaces/LuaChallengeParam.cpp:295 ChallengeParam.md game todo -function ChallengeParam GetTrinketList repentogon/LuaInterfaces/LuaChallengeParam.cpp:294 ChallengeParam.md game todo -function ChallengeParam IsAltPath repentogon/LuaInterfaces/LuaChallengeParam.cpp:307 ChallengeParam.md game todo -function ChallengeParam IsBeastPath repentogon/LuaInterfaces/LuaChallengeParam.cpp:318 ChallengeParam.md game todo -function ChallengeParam IsBigRangeEnabled repentogon/LuaInterfaces/LuaChallengeParam.cpp:313 ChallengeParam.md game todo -function ChallengeParam IsMaxDamageEnabled repentogon/LuaInterfaces/LuaChallengeParam.cpp:311 ChallengeParam.md game todo -function ChallengeParam IsMegaSatanRun repentogon/LuaInterfaces/LuaChallengeParam.cpp:309 ChallengeParam.md game todo -function ChallengeParam IsMinShotSpeedEnabled repentogon/LuaInterfaces/LuaChallengeParam.cpp:312 ChallengeParam.md game todo -function ChallengeParam IsSecretPath repentogon/LuaInterfaces/LuaChallengeParam.cpp:316 ChallengeParam.md game todo -function CharacterMenu GetActiveStatus repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:478 hud and menus todo -function CharacterMenu GetBGSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:446 hud and menus todo -function CharacterMenu GetBigCharPageSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:443 hud and menus todo -function CharacterMenu GetCharacterMenuIDFromPlayerType repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:471 hud and menus todo -function CharacterMenu GetCharacterPortraitSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:454 hud and menus todo -function CharacterMenu GetCharacterWheelDepth repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:472 hud and menus todo -function CharacterMenu GetCharacterWheelWidth repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:476 hud and menus todo -function CharacterMenu GetCompletionMarksSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:458 hud and menus todo -function CharacterMenu GetDifficulty repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:465 hud and menus todo -function CharacterMenu GetDifficultyOverlaySprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:444 hud and menus todo -function CharacterMenu GetDifficultyPageSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:447 hud and menus todo -function CharacterMenu GetEasterEggPageSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:450 hud and menus todo -function CharacterMenu GetEastereggPageSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:451 hud and menus todo -function CharacterMenu GetGreedDecoSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:445 hud and menus todo -function CharacterMenu GetIsCharacterUnlocked repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:463 hud and menus todo -function CharacterMenu GetNumCharacters repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:459 hud and menus todo -function CharacterMenu GetPageSwapWidgetSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:456 hud and menus todo -function CharacterMenu GetPlayerTypeFromCharacterMenuID repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:470 hud and menus todo -function CharacterMenu GetScrollSpeed repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:474 hud and menus todo -function CharacterMenu GetSeedEntrySprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:455 hud and menus todo -function CharacterMenu GetSeedPageSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:448 hud and menus todo -function CharacterMenu GetSeedUnlockPageSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:452 hud and menus todo -function CharacterMenu GetSelectedCharacterID repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:467 hud and menus todo -function CharacterMenu GetSelectedCharacterMenu repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:460 hud and menus todo -function CharacterMenu GetSelectedCharacterPlayerType repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:469 hud and menus todo -function CharacterMenu GetTaintedBGDecoSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:457 hud and menus todo -function CharacterMenu GetWinStreakPageSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:449 hud and menus todo -function CharacterMenu SetActiveStatus repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:479 hud and menus todo -function CharacterMenu SetCharacterWheelDepth repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:473 hud and menus todo -function CharacterMenu SetCharacterWheelWidth repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:477 hud and menus todo -function CharacterMenu SetDifficulty repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:466 hud and menus todo -function CharacterMenu SetIsCharacterUnlocked repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:464 hud and menus todo -function CharacterMenu SetScrollSpeed repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:475 hud and menus todo -function CharacterMenu SetSelectedCharacterID repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:468 hud and menus todo -function CharacterMenu SetSelectedCharacterMenu repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:461 hud and menus todo -function CharacterMenu SwapCharacterMenu repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:462 hud and menus todo -function CollectionMenu GetCollectionMenuSprite repentogon/LuaInterfaces/Menus/LuaCollectionMenu.cpp:64 hud and menus todo -function CollectionMenu GetDeathScreenSprite repentogon/LuaInterfaces/Menus/LuaCollectionMenu.cpp:65 hud and menus todo -function CollectionMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaCollectionMenu.cpp:66 hud and menus todo -function CollectionMenu GetSelectedPage repentogon/LuaInterfaces/Menus/LuaCollectionMenu.cpp:68 hud and menus todo -function CollectionMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaCollectionMenu.cpp:67 hud and menus todo -function CollectionMenu SetSelectedPage repentogon/LuaInterfaces/Menus/LuaCollectionMenu.cpp:69 hud and menus todo -function Color GetColorize repentogon/LuaInterfaces/LuaColor.cpp:167 Color.md render and sprites todo -function Color GetOffset repentogon/LuaInterfaces/LuaColor.cpp:168 Color.md render and sprites todo -function Color GetTint repentogon/LuaInterfaces/LuaColor.cpp:166 Color.md render and sprites todo -function Color Print repentogon/LuaInterfaces/LuaColor.cpp:170 Color.md render and sprites todo -function Color __tostring repentogon/LuaInterfaces/LuaColor.cpp:169 Color.md render and sprites todo -function ColorModifier __add repentogon/LuaInterfaces/LuaColorModifier.cpp:291 ColorModifier.md render and sprites todo -function ColorModifier __div repentogon/LuaInterfaces/LuaColorModifier.cpp:294 ColorModifier.md render and sprites todo -function ColorModifier __eq repentogon/LuaInterfaces/LuaColorModifier.cpp:290 ColorModifier.md render and sprites todo -function ColorModifier __mul repentogon/LuaInterfaces/LuaColorModifier.cpp:293 ColorModifier.md render and sprites todo -function ColorModifier __sub repentogon/LuaInterfaces/LuaColorModifier.cpp:292 ColorModifier.md render and sprites todo -function ColorParams GetColor repentogon/LuaInterfaces/LuaColorParams.cpp:118 ColorParams.md render and sprites todo -function ColorParams GetDuration repentogon/LuaInterfaces/LuaColorParams.cpp:122 ColorParams.md render and sprites todo -function ColorParams GetFadeout repentogon/LuaInterfaces/LuaColorParams.cpp:126 ColorParams.md render and sprites todo -function ColorParams GetLifespan repentogon/LuaInterfaces/LuaColorParams.cpp:124 ColorParams.md render and sprites todo -function ColorParams GetPriority repentogon/LuaInterfaces/LuaColorParams.cpp:120 ColorParams.md render and sprites todo -function ColorParams GetShared repentogon/LuaInterfaces/LuaColorParams.cpp:128 ColorParams.md render and sprites todo -function ColorParams SetColor repentogon/LuaInterfaces/LuaColorParams.cpp:119 ColorParams.md render and sprites todo -function ColorParams SetDuration repentogon/LuaInterfaces/LuaColorParams.cpp:123 ColorParams.md render and sprites todo -function ColorParams SetFadeout repentogon/LuaInterfaces/LuaColorParams.cpp:127 ColorParams.md render and sprites todo -function ColorParams SetLifespan repentogon/LuaInterfaces/LuaColorParams.cpp:125 ColorParams.md render and sprites todo -function ColorParams SetPriority repentogon/LuaInterfaces/LuaColorParams.cpp:121 ColorParams.md render and sprites todo -function ColorParams SetShared repentogon/LuaInterfaces/LuaColorParams.cpp:129 ColorParams.md render and sprites todo -function Config CanRerollCollectible repentogon/LuaInterfaces/LuaItemConfig.cpp:317 ItemConfig.md items and pools todo -function Config GetItemsWithCustomTag repentogon/LuaInterfaces/LuaItemConfig.cpp:316 ItemConfig.md items and pools todo -function Config GetTaggedItems repentogon/LuaInterfaces/LuaItemConfig.cpp:315 ItemConfig.md items and pools todo +function Ambush GetCurrentWave repentogon/LuaInterfaces/LuaAmbush.cpp:258 Ambush.md game done +function Ambush GetMaxBossChallengeWaves repentogon/LuaInterfaces/LuaAmbush.cpp:256 Ambush.md game done +function Ambush GetMaxBossrushWaves repentogon/LuaInterfaces/LuaAmbush.cpp:252 Ambush.md game done +function Ambush GetMaxChallengeWaves repentogon/LuaInterfaces/LuaAmbush.cpp:254 Ambush.md game done +function Ambush GetNextWave repentogon/LuaInterfaces/LuaAmbush.cpp:260 Ambush.md game done +function Ambush GetNextWaves repentogon/LuaInterfaces/LuaAmbush.cpp:261 Ambush.md game done +function Ambush SetMaxBossChallengeWaves repentogon/LuaInterfaces/LuaAmbush.cpp:257 Ambush.md game done +function Ambush SetMaxBossrushWaves repentogon/LuaInterfaces/LuaAmbush.cpp:253 Ambush.md game done +function Ambush SetMaxChallengeWaves repentogon/LuaInterfaces/LuaAmbush.cpp:255 Ambush.md game done +function Ambush SpawnBossrushWave repentogon/LuaInterfaces/LuaAmbush.cpp:248 Ambush.md game done +function Ambush SpawnWave repentogon/LuaInterfaces/LuaAmbush.cpp:249 Ambush.md game done +function Ambush StartChallenge repentogon/LuaInterfaces/LuaAmbush.cpp:247 Ambush.md game done +function AnimationData GetAllLayers repentogon/LuaInterfaces/LuaAnimationData.cpp:148 AnimationData.md render and sprites done +function AnimationData GetLayer repentogon/LuaInterfaces/LuaAnimationData.cpp:149 AnimationData.md render and sprites done +function AnimationData GetLength repentogon/LuaInterfaces/LuaAnimationData.cpp:151 AnimationData.md render and sprites done +function AnimationData GetName repentogon/LuaInterfaces/LuaAnimationData.cpp:150 AnimationData.md render and sprites done +function AnimationData IsLoopingAnimation repentogon/LuaInterfaces/LuaAnimationData.cpp:152 AnimationData.md render and sprites done +function AnimationFrame GetColor repentogon/LuaInterfaces/LuaAnimationFrame.cpp:100 AnimationFrame.md render and sprites done +function AnimationFrame GetCrop repentogon/LuaInterfaces/LuaAnimationFrame.cpp:91 AnimationFrame.md render and sprites done +function AnimationFrame GetEndFrame repentogon/LuaInterfaces/LuaAnimationFrame.cpp:102 AnimationFrame.md render and sprites done +function AnimationFrame GetHeight repentogon/LuaInterfaces/LuaAnimationFrame.cpp:93 AnimationFrame.md render and sprites done +function AnimationFrame GetPivot repentogon/LuaInterfaces/LuaAnimationFrame.cpp:96 AnimationFrame.md render and sprites done +function AnimationFrame GetPos repentogon/LuaInterfaces/LuaAnimationFrame.cpp:94 AnimationFrame.md render and sprites done +function AnimationFrame GetRotation repentogon/LuaInterfaces/LuaAnimationFrame.cpp:98 AnimationFrame.md render and sprites done +function AnimationFrame GetScale repentogon/LuaInterfaces/LuaAnimationFrame.cpp:95 AnimationFrame.md render and sprites done +function AnimationFrame GetStartFrame repentogon/LuaInterfaces/LuaAnimationFrame.cpp:101 AnimationFrame.md render and sprites done +function AnimationFrame GetWidth repentogon/LuaInterfaces/LuaAnimationFrame.cpp:92 AnimationFrame.md render and sprites done +function AnimationFrame IsInterpolated repentogon/LuaInterfaces/LuaAnimationFrame.cpp:99 AnimationFrame.md render and sprites done +function AnimationFrame IsVisible repentogon/LuaInterfaces/LuaAnimationFrame.cpp:97 AnimationFrame.md render and sprites done +function AnimationLayer GetFrame repentogon/LuaInterfaces/LuaAnimationLayer.cpp:69 AnimationLayer.md render and sprites done +function AnimationLayer GetLayerID repentogon/LuaInterfaces/LuaAnimationLayer.cpp:70 AnimationLayer.md render and sprites done +function AnimationLayer IsVisible repentogon/LuaInterfaces/LuaAnimationLayer.cpp:71 AnimationLayer.md render and sprites done +function Backdrop GetControlsANM2 repentogon/LuaInterfaces/LuaBackdrop.cpp:106 Backdrop.md level and room done +function Backdrop GetControlsButtonsANM2 repentogon/LuaInterfaces/LuaBackdrop.cpp:107 Backdrop.md level and room done +function Backdrop GetDetailANM2 repentogon/LuaInterfaces/LuaBackdrop.cpp:105 Backdrop.md level and room done +function Backdrop GetFloorANM2 repentogon/LuaInterfaces/LuaBackdrop.cpp:104 Backdrop.md level and room done +function Backdrop GetFloorImage repentogon/LuaInterfaces/LuaBackdrop.cpp:103 Backdrop.md level and room done +function Backdrop GetWallImage repentogon/LuaInterfaces/LuaBackdrop.cpp:102 Backdrop.md level and room done +function Beam Add repentogon/LuaInterfaces/LuaBeamRenderer.cpp:389 render and sprites done +function Beam GetLayer repentogon/LuaInterfaces/LuaBeamRenderer.cpp:393 render and sprites done +function Beam GetPoints repentogon/LuaInterfaces/LuaBeamRenderer.cpp:399 render and sprites done +function Beam GetSprite repentogon/LuaInterfaces/LuaBeamRenderer.cpp:391 render and sprites done +function Beam GetUnkBool repentogon/LuaInterfaces/LuaBeamRenderer.cpp:397 render and sprites done +function Beam GetUseOverlay repentogon/LuaInterfaces/LuaBeamRenderer.cpp:395 render and sprites done +function Beam Render repentogon/LuaInterfaces/LuaBeamRenderer.cpp:390 render and sprites done +function Beam SetLayer repentogon/LuaInterfaces/LuaBeamRenderer.cpp:394 render and sprites done +function Beam SetPoints repentogon/LuaInterfaces/LuaBeamRenderer.cpp:400 render and sprites done +function Beam SetSprite repentogon/LuaInterfaces/LuaBeamRenderer.cpp:392 render and sprites done +function Beam SetUnkBool repentogon/LuaInterfaces/LuaBeamRenderer.cpp:398 render and sprites done +function Beam SetUseOverlay repentogon/LuaInterfaces/LuaBeamRenderer.cpp:396 render and sprites done +function BestiaryMenu GetBestiaryMenuSprite repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:104 hud and menus done +function BestiaryMenu GetDeathScreenSprite repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:105 hud and menus done +function BestiaryMenu GetEnemySprite repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:106 hud and menus done +function BestiaryMenu GetNumBossPages repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:112 hud and menus done +function BestiaryMenu GetNumMonsterPages repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:111 hud and menus done +function BestiaryMenu GetNumPages repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:113 hud and menus done +function BestiaryMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:109 hud and menus done +function BestiaryMenu GetSelectedPage repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:107 hud and menus done +function BestiaryMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:110 hud and menus done +function BestiaryMenu SetSelectedPage repentogon/LuaInterfaces/Menus/LuaBestiaryMenu.cpp:108 hud and menus done +function BlendMode New repentogon/LuaInterfaces/LuaBlendMode.cpp:321 render and sprites done +function BlendMode NewFromType repentogon/LuaInterfaces/LuaBlendMode.cpp:324 render and sprites done +function BlendMode SetMode repentogon/LuaInterfaces/LuaBlendMode.cpp:308 render and sprites done +function BossPool GetDoubleTroubleRoomID repentogon/LuaInterfaces/LuaBossPool.cpp:90 BossPool.md npc done +function BossPool GetDoubleTroubleRoomVariantStart repentogon/LuaInterfaces/LuaBossPool.cpp:89 npc done +function BossPool GetEntries repentogon/LuaInterfaces/LuaBossPool.cpp:86 BossPool.md npc done +function BossPool GetName repentogon/LuaInterfaces/LuaBossPool.cpp:85 BossPool.md npc done +function BossPool GetRNG repentogon/LuaInterfaces/LuaBossPool.cpp:88 BossPool.md npc done +function BossPool GetWeight repentogon/LuaInterfaces/LuaBossPool.cpp:87 BossPool.md npc done +function BossPoolManager GetLevelBlacklist repentogon/LuaInterfaces/LuaBossPool.cpp:130 npc done +function BossPoolManager GetPool repentogon/LuaInterfaces/LuaBossPool.cpp:128 BossPoolManager.md npc done +function BossPoolManager GetRemovedBosses repentogon/LuaInterfaces/LuaBossPool.cpp:129 BossPoolManager.md npc done +function BossPoolManager GetRemovedSpecialBosses repentogon/LuaInterfaces/LuaBossPool.cpp:131 BossPoolManager.md npc done +function Camera IsClampEnabled repentogon/LuaInterfaces/LuaCamera.cpp:72 Camera.md level and room done +function Camera IsPosVisible repentogon/LuaInterfaces/LuaCamera.cpp:70 Camera.md level and room done +function Camera SetClampEnabled repentogon/LuaInterfaces/LuaCamera.cpp:73 Camera.md level and room done +function Camera SetFocusPosition repentogon/LuaInterfaces/LuaCamera.cpp:68 Camera.md level and room done +function Camera SnapToPosition repentogon/LuaInterfaces/LuaCamera.cpp:69 Camera.md level and room done +function Camera Update repentogon/LuaInterfaces/LuaCamera.cpp:71 Camera.md level and room done +function Capsule Collide repentogon/LuaInterfaces/LuaCapsule.cpp:127 Capsule.md entities done +function Capsule GetDirection repentogon/LuaInterfaces/LuaCapsule.cpp:124 Capsule.md entities done +function Capsule GetEndPoint repentogon/LuaInterfaces/LuaCapsule.cpp:123 entities done +function Capsule GetF1 repentogon/LuaInterfaces/LuaCapsule.cpp:132 Capsule.md entities done +function Capsule GetF2 repentogon/LuaInterfaces/LuaCapsule.cpp:133 Capsule.md entities done +function Capsule GetPosition repentogon/LuaInterfaces/LuaCapsule.cpp:121 Capsule.md entities done +function Capsule GetSize repentogon/LuaInterfaces/LuaCapsule.cpp:125 entities done +function Capsule GetSizeDifference repentogon/LuaInterfaces/LuaCapsule.cpp:126 entities done +function Capsule GetStartPoint repentogon/LuaInterfaces/LuaCapsule.cpp:122 entities done +function Capsule GetVec2 repentogon/LuaInterfaces/LuaCapsule.cpp:130 Capsule.md entities done +function Capsule GetVec3 repentogon/LuaInterfaces/LuaCapsule.cpp:131 Capsule.md entities done +function Card ClearAvailabilityCondition repentogon/LuaInterfaces/LuaItemConfig.cpp:210 ItemConfig_Card.md items and pools done +function Card GetAvailabilityCondition repentogon/LuaInterfaces/LuaItemConfig.cpp:205 ItemConfig_Card.md items and pools done +function Card SetAvailabilityCondition repentogon/LuaInterfaces/LuaItemConfig.cpp:209 ItemConfig_Card.md items and pools done +function ChallengeMenu GetSelectedChallengeID repentogon/LuaInterfaces/Menus/LuaChallengeMenu.cpp:37 hud and menus done +function ChallengeMenu GetSprite repentogon/LuaInterfaces/Menus/LuaChallengeMenu.cpp:36 hud and menus done +function ChallengeMenu SetSelectedChallengeID repentogon/LuaInterfaces/Menus/LuaChallengeMenu.cpp:38 hud and menus done +function ChallengeParam CanShoot repentogon/LuaInterfaces/LuaChallengeParam.cpp:306 ChallengeParam.md game done +function ChallengeParam GetAchievementList repentogon/LuaInterfaces/LuaChallengeParam.cpp:299 ChallengeParam.md game done +function ChallengeParam GetAddDamage repentogon/LuaInterfaces/LuaChallengeParam.cpp:305 ChallengeParam.md game done +function ChallengeParam GetBlackHearts repentogon/LuaInterfaces/LuaChallengeParam.cpp:301 ChallengeParam.md game done +function ChallengeParam GetCoins repentogon/LuaInterfaces/LuaChallengeParam.cpp:304 ChallengeParam.md game done +function ChallengeParam GetCollectibleList repentogon/LuaInterfaces/LuaChallengeParam.cpp:293 ChallengeParam.md game done +function ChallengeParam GetCollectibleTwinList repentogon/LuaInterfaces/LuaChallengeParam.cpp:317 ChallengeParam.md game done +function ChallengeParam GetCurse repentogon/LuaInterfaces/LuaChallengeParam.cpp:314 ChallengeParam.md game done +function ChallengeParam GetCurseFilter repentogon/LuaInterfaces/LuaChallengeParam.cpp:315 ChallengeParam.md game done +function ChallengeParam GetDifficulty repentogon/LuaInterfaces/LuaChallengeParam.cpp:308 ChallengeParam.md game done +function ChallengeParam GetEndStage repentogon/LuaInterfaces/LuaChallengeParam.cpp:297 ChallengeParam.md game done +function ChallengeParam GetHearts repentogon/LuaInterfaces/LuaChallengeParam.cpp:302 ChallengeParam.md game done +function ChallengeParam GetMaxHearts repentogon/LuaInterfaces/LuaChallengeParam.cpp:303 ChallengeParam.md game done +function ChallengeParam GetMinFireRate repentogon/LuaInterfaces/LuaChallengeParam.cpp:310 ChallengeParam.md game done +function ChallengeParam GetName repentogon/LuaInterfaces/LuaChallengeParam.cpp:291 ChallengeParam.md game done +function ChallengeParam GetPlayerType repentogon/LuaInterfaces/LuaChallengeParam.cpp:298 ChallengeParam.md game done +function ChallengeParam GetRoomFilter repentogon/LuaInterfaces/LuaChallengeParam.cpp:292 ChallengeParam.md game done +function ChallengeParam GetSoulHearts repentogon/LuaInterfaces/LuaChallengeParam.cpp:300 ChallengeParam.md game done +function ChallengeParam GetStartingCard repentogon/LuaInterfaces/LuaChallengeParam.cpp:296 ChallengeParam.md game done +function ChallengeParam GetStartingPill repentogon/LuaInterfaces/LuaChallengeParam.cpp:295 ChallengeParam.md game done +function ChallengeParam GetTrinketList repentogon/LuaInterfaces/LuaChallengeParam.cpp:294 ChallengeParam.md game done +function ChallengeParam IsAltPath repentogon/LuaInterfaces/LuaChallengeParam.cpp:307 ChallengeParam.md game done +function ChallengeParam IsBeastPath repentogon/LuaInterfaces/LuaChallengeParam.cpp:318 ChallengeParam.md game done +function ChallengeParam IsBigRangeEnabled repentogon/LuaInterfaces/LuaChallengeParam.cpp:313 ChallengeParam.md game done +function ChallengeParam IsMaxDamageEnabled repentogon/LuaInterfaces/LuaChallengeParam.cpp:311 ChallengeParam.md game done +function ChallengeParam IsMegaSatanRun repentogon/LuaInterfaces/LuaChallengeParam.cpp:309 ChallengeParam.md game done +function ChallengeParam IsMinShotSpeedEnabled repentogon/LuaInterfaces/LuaChallengeParam.cpp:312 ChallengeParam.md game done +function ChallengeParam IsSecretPath repentogon/LuaInterfaces/LuaChallengeParam.cpp:316 ChallengeParam.md game done +function CharacterMenu GetActiveStatus repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:478 hud and menus done +function CharacterMenu GetBGSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:446 hud and menus done +function CharacterMenu GetBigCharPageSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:443 hud and menus done +function CharacterMenu GetCharacterMenuIDFromPlayerType repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:471 hud and menus done +function CharacterMenu GetCharacterPortraitSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:454 hud and menus done +function CharacterMenu GetCharacterWheelDepth repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:472 hud and menus done +function CharacterMenu GetCharacterWheelWidth repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:476 hud and menus done +function CharacterMenu GetCompletionMarksSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:458 hud and menus done +function CharacterMenu GetDifficulty repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:465 hud and menus done +function CharacterMenu GetDifficultyOverlaySprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:444 hud and menus done +function CharacterMenu GetDifficultyPageSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:447 hud and menus done +function CharacterMenu GetEasterEggPageSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:450 hud and menus done +function CharacterMenu GetEastereggPageSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:451 hud and menus done +function CharacterMenu GetGreedDecoSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:445 hud and menus done +function CharacterMenu GetIsCharacterUnlocked repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:463 hud and menus done +function CharacterMenu GetNumCharacters repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:459 hud and menus done +function CharacterMenu GetPageSwapWidgetSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:456 hud and menus done +function CharacterMenu GetPlayerTypeFromCharacterMenuID repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:470 hud and menus done +function CharacterMenu GetScrollSpeed repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:474 hud and menus done +function CharacterMenu GetSeedEntrySprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:455 hud and menus done +function CharacterMenu GetSeedPageSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:448 hud and menus done +function CharacterMenu GetSeedUnlockPageSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:452 hud and menus done +function CharacterMenu GetSelectedCharacterID repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:467 hud and menus done +function CharacterMenu GetSelectedCharacterMenu repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:460 hud and menus done +function CharacterMenu GetSelectedCharacterPlayerType repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:469 hud and menus done +function CharacterMenu GetTaintedBGDecoSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:457 hud and menus done +function CharacterMenu GetWinStreakPageSprite repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:449 hud and menus done +function CharacterMenu SetActiveStatus repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:479 hud and menus done +function CharacterMenu SetCharacterWheelDepth repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:473 hud and menus done +function CharacterMenu SetCharacterWheelWidth repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:477 hud and menus done +function CharacterMenu SetDifficulty repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:466 hud and menus done +function CharacterMenu SetIsCharacterUnlocked repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:464 hud and menus done +function CharacterMenu SetScrollSpeed repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:475 hud and menus done +function CharacterMenu SetSelectedCharacterID repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:468 hud and menus done +function CharacterMenu SetSelectedCharacterMenu repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:461 hud and menus done +function CharacterMenu SwapCharacterMenu repentogon/LuaInterfaces/Menus/LuaCharacterMenu.cpp:462 hud and menus done +function CollectionMenu GetCollectionMenuSprite repentogon/LuaInterfaces/Menus/LuaCollectionMenu.cpp:64 hud and menus done +function CollectionMenu GetDeathScreenSprite repentogon/LuaInterfaces/Menus/LuaCollectionMenu.cpp:65 hud and menus done +function CollectionMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaCollectionMenu.cpp:66 hud and menus done +function CollectionMenu GetSelectedPage repentogon/LuaInterfaces/Menus/LuaCollectionMenu.cpp:68 hud and menus done +function CollectionMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaCollectionMenu.cpp:67 hud and menus done +function CollectionMenu SetSelectedPage repentogon/LuaInterfaces/Menus/LuaCollectionMenu.cpp:69 hud and menus done +function Color GetColorize repentogon/LuaInterfaces/LuaColor.cpp:167 Color.md render and sprites done +function Color GetOffset repentogon/LuaInterfaces/LuaColor.cpp:168 Color.md render and sprites done +function Color GetTint repentogon/LuaInterfaces/LuaColor.cpp:166 Color.md render and sprites done +function Color Print repentogon/LuaInterfaces/LuaColor.cpp:170 Color.md render and sprites done +function Color __tostring repentogon/LuaInterfaces/LuaColor.cpp:169 Color.md render and sprites done +function ColorModifier __add repentogon/LuaInterfaces/LuaColorModifier.cpp:291 ColorModifier.md render and sprites done +function ColorModifier __div repentogon/LuaInterfaces/LuaColorModifier.cpp:294 ColorModifier.md render and sprites done +function ColorModifier __eq repentogon/LuaInterfaces/LuaColorModifier.cpp:290 ColorModifier.md render and sprites done +function ColorModifier __mul repentogon/LuaInterfaces/LuaColorModifier.cpp:293 ColorModifier.md render and sprites done +function ColorModifier __sub repentogon/LuaInterfaces/LuaColorModifier.cpp:292 ColorModifier.md render and sprites done +function ColorParams GetColor repentogon/LuaInterfaces/LuaColorParams.cpp:118 ColorParams.md render and sprites done +function ColorParams GetDuration repentogon/LuaInterfaces/LuaColorParams.cpp:122 ColorParams.md render and sprites done +function ColorParams GetFadeout repentogon/LuaInterfaces/LuaColorParams.cpp:126 ColorParams.md render and sprites done +function ColorParams GetLifespan repentogon/LuaInterfaces/LuaColorParams.cpp:124 ColorParams.md render and sprites done +function ColorParams GetPriority repentogon/LuaInterfaces/LuaColorParams.cpp:120 ColorParams.md render and sprites done +function ColorParams GetShared repentogon/LuaInterfaces/LuaColorParams.cpp:128 ColorParams.md render and sprites done +function ColorParams SetColor repentogon/LuaInterfaces/LuaColorParams.cpp:119 ColorParams.md render and sprites done +function ColorParams SetDuration repentogon/LuaInterfaces/LuaColorParams.cpp:123 ColorParams.md render and sprites done +function ColorParams SetFadeout repentogon/LuaInterfaces/LuaColorParams.cpp:127 ColorParams.md render and sprites done +function ColorParams SetLifespan repentogon/LuaInterfaces/LuaColorParams.cpp:125 ColorParams.md render and sprites done +function ColorParams SetPriority repentogon/LuaInterfaces/LuaColorParams.cpp:121 ColorParams.md render and sprites done +function ColorParams SetShared repentogon/LuaInterfaces/LuaColorParams.cpp:129 ColorParams.md render and sprites done +function Config CanRerollCollectible repentogon/LuaInterfaces/LuaItemConfig.cpp:317 ItemConfig.md items and pools done +function Config GetItemsWithCustomTag repentogon/LuaInterfaces/LuaItemConfig.cpp:316 ItemConfig.md items and pools done +function Config GetTaggedItems repentogon/LuaInterfaces/LuaItemConfig.cpp:315 ItemConfig.md items and pools done function Config IsValidTrinket ItemConfig.md items and pools todo docs only: no registration found -function Console GetCommandHistory repentogon/LuaInterfaces/LuaConsole.cpp:127 Console.md console and debug todo -function Console GetHistory repentogon/LuaInterfaces/LuaConsole.cpp:128 Console.md console and debug todo -function Console PopHistory repentogon/LuaInterfaces/LuaConsole.cpp:129 Console.md console and debug todo -function Console PrintError repentogon/LuaInterfaces/LuaConsole.cpp:126 Console.md console and debug todo -function Console PrintWarning repentogon/LuaInterfaces/LuaConsole.cpp:130 Console.md console and debug todo -function Console RegisterCommand repentogon/LuaInterfaces/LuaConsole.cpp:131 Console.md console and debug todo -function Console RegisterMacro repentogon/LuaInterfaces/LuaConsole.cpp:132 Console.md console and debug todo +function Console GetCommandHistory repentogon/LuaInterfaces/LuaConsole.cpp:127 Console.md console and debug done +function Console GetHistory repentogon/LuaInterfaces/LuaConsole.cpp:128 Console.md console and debug done +function Console PopHistory repentogon/LuaInterfaces/LuaConsole.cpp:129 Console.md console and debug done +function Console PrintError repentogon/LuaInterfaces/LuaConsole.cpp:126 Console.md console and debug done +function Console PrintWarning repentogon/LuaInterfaces/LuaConsole.cpp:130 Console.md console and debug done +function Console RegisterCommand repentogon/LuaInterfaces/LuaConsole.cpp:131 Console.md console and debug done +function Console RegisterMacro repentogon/LuaInterfaces/LuaConsole.cpp:132 Console.md console and debug done function Context __pairs repentogon/LuaInterfaces/LuaRender.cpp:2402 misc todo -function ControllerSelectMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaControllerSelectMenu.cpp:37 hud and menus todo -function ControllerSelectMenu GetSprite repentogon/LuaInterfaces/Menus/LuaControllerSelectMenu.cpp:36 hud and menus todo -function ControllerSelectMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaControllerSelectMenu.cpp:38 hud and menus todo -function CostumeSpriteDesc CanOverwriteColor repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:110 CostumeSpriteDesc.md player todo -function CostumeSpriteDesc GetBodyColor repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:109 player todo -function CostumeSpriteDesc GetDefaultSkinColor repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:106 CostumeSpriteDesc.md player todo -function CostumeSpriteDesc GetHeadColor repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:108 player todo -function CostumeSpriteDesc GetItemConfig repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:100 CostumeSpriteDesc.md player todo -function CostumeSpriteDesc GetPlayerType repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:112 CostumeSpriteDesc.md player todo -function CostumeSpriteDesc GetPriority repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:101 CostumeSpriteDesc.md player todo -function CostumeSpriteDesc GetSkinColor repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:107 CostumeSpriteDesc.md player todo -function CostumeSpriteDesc GetSprite repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:99 CostumeSpriteDesc.md player todo -function CostumeSpriteDesc HasOverlay repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:104 CostumeSpriteDesc.md player todo -function CostumeSpriteDesc HasSkinAlt repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:105 CostumeSpriteDesc.md player todo -function CostumeSpriteDesc IsFlying repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:103 CostumeSpriteDesc.md player todo -function CostumeSpriteDesc IsItemAnimPlaying repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:102 CostumeSpriteDesc.md player todo -function CostumeSpriteDesc IsItemStateOnly repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:111 CostumeSpriteDesc.md player todo -function CustomChallengeMenu GetSelectedChallengeID repentogon/LuaInterfaces/Menus/LuaCustomChallengeMenu.cpp:37 hud and menus todo -function CustomChallengeMenu GetSprite repentogon/LuaInterfaces/Menus/LuaCustomChallengeMenu.cpp:36 hud and menus todo -function CustomChallengeMenu SetSelectedChallengeID repentogon/LuaInterfaces/Menus/LuaCustomChallengeMenu.cpp:38 hud and menus todo -function CutscenesMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaCutscenesMenu.cpp:37 hud and menus todo -function CutscenesMenu GetSprite repentogon/LuaInterfaces/Menus/LuaCutscenesMenu.cpp:36 hud and menus todo -function CutscenesMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaCutscenesMenu.cpp:38 hud and menus todo -function DailyChallenge GetChallengeParams repentogon/LuaInterfaces/LuaDailyChallenge.cpp:28 DailyChallenge.md game todo -function DailyChallengeMenu GetLeaderboardScoreMenuSprite repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:112 hud and menus todo -function DailyChallengeMenu GetLeaderboardSprite repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:111 hud and menus todo -function DailyChallengeMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:113 hud and menus todo -function DailyChallengeMenu GetSprite repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:110 hud and menus todo -function DailyChallengeMenu GetState repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:119 hud and menus todo -function DailyChallengeMenu GetTimeLeftHours repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:116 hud and menus todo -function DailyChallengeMenu GetTimeLeftMinutes repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:117 hud and menus todo -function DailyChallengeMenu GetTimeLeftSeconds repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:118 hud and menus todo -function DailyChallengeMenu IsLeaderboardVisible repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:115 hud and menus todo -function DailyChallengeMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:114 hud and menus todo -function DailyChallengeMenu SetState repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:120 hud and menus todo -function Debug ForceUnload repentogon/LuaInterfaces/LuaDebug.cpp:106 Debug.md console and debug todo -function Debug GetSignature repentogon/LuaInterfaces/LuaDebug.cpp:104 Debug.md console and debug todo -function Debug ListLoadedFiles repentogon/LuaInterfaces/LuaDebug.cpp:105 Debug.md console and debug todo -function DebugRenderer Get repentogon/LuaInterfaces/LuaDebugRenderer.cpp:30 DebugRenderer.md render and sprites todo -function DestinationQuad ApplyMatrix repentogon/LuaInterfaces/LuaRender.cpp:772 render and sprites todo -function DestinationQuad Copy repentogon/LuaInterfaces/LuaRender.cpp:759 render and sprites todo -function DestinationQuad Flip repentogon/LuaInterfaces/LuaRender.cpp:773 render and sprites todo -function DestinationQuad GetBottomLeft repentogon/LuaInterfaces/LuaRender.cpp:762 render and sprites todo -function DestinationQuad GetBottomRight repentogon/LuaInterfaces/LuaRender.cpp:763 render and sprites todo -function DestinationQuad GetTopLeft repentogon/LuaInterfaces/LuaRender.cpp:760 render and sprites todo -function DestinationQuad GetTopRight repentogon/LuaInterfaces/LuaRender.cpp:761 render and sprites todo -function DestinationQuad NewFromBounds repentogon/LuaInterfaces/LuaRender.cpp:3236 render and sprites todo -function DestinationQuad NewFromRectangle repentogon/LuaInterfaces/LuaRender.cpp:3239 render and sprites todo -function DestinationQuad Rotate repentogon/LuaInterfaces/LuaRender.cpp:770 render and sprites todo -function DestinationQuad Scale repentogon/LuaInterfaces/LuaRender.cpp:769 render and sprites todo -function DestinationQuad SetBottomLeft repentogon/LuaInterfaces/LuaRender.cpp:766 render and sprites todo -function DestinationQuad SetBottomRight repentogon/LuaInterfaces/LuaRender.cpp:767 render and sprites todo -function DestinationQuad SetTopLeft repentogon/LuaInterfaces/LuaRender.cpp:764 render and sprites todo -function DestinationQuad SetTopRight repentogon/LuaInterfaces/LuaRender.cpp:765 render and sprites todo -function DestinationQuad Shear repentogon/LuaInterfaces/LuaRender.cpp:771 render and sprites todo -function DestinationQuad Translate repentogon/LuaInterfaces/LuaRender.cpp:768 render and sprites todo -function DestinationQuad __tostring repentogon/LuaInterfaces/LuaRender.cpp:774 render and sprites todo +function ControllerSelectMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaControllerSelectMenu.cpp:37 hud and menus done +function ControllerSelectMenu GetSprite repentogon/LuaInterfaces/Menus/LuaControllerSelectMenu.cpp:36 hud and menus done +function ControllerSelectMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaControllerSelectMenu.cpp:38 hud and menus done +function CostumeSpriteDesc CanOverwriteColor repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:110 CostumeSpriteDesc.md player done +function CostumeSpriteDesc GetBodyColor repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:109 player done +function CostumeSpriteDesc GetDefaultSkinColor repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:106 CostumeSpriteDesc.md player done +function CostumeSpriteDesc GetHeadColor repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:108 player done +function CostumeSpriteDesc GetItemConfig repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:100 CostumeSpriteDesc.md player done +function CostumeSpriteDesc GetPlayerType repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:112 CostumeSpriteDesc.md player done +function CostumeSpriteDesc GetPriority repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:101 CostumeSpriteDesc.md player done +function CostumeSpriteDesc GetSkinColor repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:107 CostumeSpriteDesc.md player done +function CostumeSpriteDesc GetSprite repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:99 CostumeSpriteDesc.md player done +function CostumeSpriteDesc HasOverlay repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:104 CostumeSpriteDesc.md player done +function CostumeSpriteDesc HasSkinAlt repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:105 CostumeSpriteDesc.md player done +function CostumeSpriteDesc IsFlying repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:103 CostumeSpriteDesc.md player done +function CostumeSpriteDesc IsItemAnimPlaying repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:102 CostumeSpriteDesc.md player done +function CostumeSpriteDesc IsItemStateOnly repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:111 CostumeSpriteDesc.md player done +function CustomChallengeMenu GetSelectedChallengeID repentogon/LuaInterfaces/Menus/LuaCustomChallengeMenu.cpp:37 hud and menus done +function CustomChallengeMenu GetSprite repentogon/LuaInterfaces/Menus/LuaCustomChallengeMenu.cpp:36 hud and menus done +function CustomChallengeMenu SetSelectedChallengeID repentogon/LuaInterfaces/Menus/LuaCustomChallengeMenu.cpp:38 hud and menus done +function CutscenesMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaCutscenesMenu.cpp:37 hud and menus done +function CutscenesMenu GetSprite repentogon/LuaInterfaces/Menus/LuaCutscenesMenu.cpp:36 hud and menus done +function CutscenesMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaCutscenesMenu.cpp:38 hud and menus done +function DailyChallenge GetChallengeParams repentogon/LuaInterfaces/LuaDailyChallenge.cpp:28 DailyChallenge.md game done +function DailyChallengeMenu GetLeaderboardScoreMenuSprite repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:112 hud and menus done +function DailyChallengeMenu GetLeaderboardSprite repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:111 hud and menus done +function DailyChallengeMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:113 hud and menus done +function DailyChallengeMenu GetSprite repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:110 hud and menus done +function DailyChallengeMenu GetState repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:119 hud and menus done +function DailyChallengeMenu GetTimeLeftHours repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:116 hud and menus done +function DailyChallengeMenu GetTimeLeftMinutes repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:117 hud and menus done +function DailyChallengeMenu GetTimeLeftSeconds repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:118 hud and menus done +function DailyChallengeMenu IsLeaderboardVisible repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:115 hud and menus done +function DailyChallengeMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:114 hud and menus done +function DailyChallengeMenu SetState repentogon/LuaInterfaces/Menus/LuaDailyChallengeMenu.cpp:120 hud and menus done +function Debug ForceUnload repentogon/LuaInterfaces/LuaDebug.cpp:106 Debug.md console and debug done +function Debug GetSignature repentogon/LuaInterfaces/LuaDebug.cpp:104 Debug.md console and debug done +function Debug ListLoadedFiles repentogon/LuaInterfaces/LuaDebug.cpp:105 Debug.md console and debug done +function DebugRenderer Get repentogon/LuaInterfaces/LuaDebugRenderer.cpp:30 DebugRenderer.md render and sprites done +function DestinationQuad ApplyMatrix repentogon/LuaInterfaces/LuaRender.cpp:772 render and sprites done +function DestinationQuad Copy repentogon/LuaInterfaces/LuaRender.cpp:759 render and sprites done +function DestinationQuad Flip repentogon/LuaInterfaces/LuaRender.cpp:773 render and sprites done +function DestinationQuad GetBottomLeft repentogon/LuaInterfaces/LuaRender.cpp:762 render and sprites done +function DestinationQuad GetBottomRight repentogon/LuaInterfaces/LuaRender.cpp:763 render and sprites done +function DestinationQuad GetTopLeft repentogon/LuaInterfaces/LuaRender.cpp:760 render and sprites done +function DestinationQuad GetTopRight repentogon/LuaInterfaces/LuaRender.cpp:761 render and sprites done +function DestinationQuad NewFromBounds repentogon/LuaInterfaces/LuaRender.cpp:3236 render and sprites done +function DestinationQuad NewFromRectangle repentogon/LuaInterfaces/LuaRender.cpp:3239 render and sprites done +function DestinationQuad Rotate repentogon/LuaInterfaces/LuaRender.cpp:770 render and sprites done +function DestinationQuad Scale repentogon/LuaInterfaces/LuaRender.cpp:769 render and sprites done +function DestinationQuad SetBottomLeft repentogon/LuaInterfaces/LuaRender.cpp:766 render and sprites done +function DestinationQuad SetBottomRight repentogon/LuaInterfaces/LuaRender.cpp:767 render and sprites done +function DestinationQuad SetTopLeft repentogon/LuaInterfaces/LuaRender.cpp:764 render and sprites done +function DestinationQuad SetTopRight repentogon/LuaInterfaces/LuaRender.cpp:765 render and sprites done +function DestinationQuad Shear repentogon/LuaInterfaces/LuaRender.cpp:771 render and sprites done +function DestinationQuad Translate repentogon/LuaInterfaces/LuaRender.cpp:768 render and sprites done +function DestinationQuad __tostring repentogon/LuaInterfaces/LuaRender.cpp:774 render and sprites done function ElementsArray __len repentogon/LuaInterfaces/LuaRender.cpp:1807 misc todo -function EntitiesSaveStateVector Clear repentogon/LuaInterfaces/LuaEntitySaveState.cpp:480 EntitiesSaveStateVector.md entities todo -function EntitiesSaveStateVector Get repentogon/LuaInterfaces/LuaEntitySaveState.cpp:478 EntitiesSaveStateVector.md entities todo -function EntitiesSaveStateVector GetByType repentogon/LuaInterfaces/LuaEntitySaveState.cpp:479 EntitiesSaveStateVector.md entities todo -function EntitiesSaveStateVector __len repentogon/LuaInterfaces/LuaEntitySaveState.cpp:481 EntitiesSaveStateVector.md entities todo -function Entity AddBaited repentogon/LuaInterfaces/Entities/LuaEntity.cpp:873 Entity.md entities todo -function Entity AddBleeding repentogon/LuaInterfaces/Entities/LuaEntity.cpp:871 Entity.md entities todo -function Entity AddBrimstoneMark repentogon/LuaInterfaces/Entities/LuaEntity.cpp:875 Entity.md entities todo -function Entity AddIce repentogon/LuaInterfaces/Entities/LuaEntity.cpp:876 Entity.md entities todo -function Entity AddKnockback repentogon/LuaInterfaces/Entities/LuaEntity.cpp:877 Entity.md entities todo -function Entity AddMagnetized repentogon/LuaInterfaces/Entities/LuaEntity.cpp:872 Entity.md entities todo -function Entity AddWeakness repentogon/LuaInterfaces/Entities/LuaEntity.cpp:874 Entity.md entities todo -function Entity CanDevolve repentogon/LuaInterfaces/Entities/LuaEntity.cpp:957 Entity.md entities todo -function Entity ComputeStatusEffectDuration repentogon/LuaInterfaces/Entities/LuaEntity.cpp:881 Entity.md entities todo -function Entity CopyStatusEffects repentogon/LuaInterfaces/Entities/LuaEntity.cpp:882 Entity.md entities todo -function Entity ForceCollide repentogon/LuaInterfaces/Entities/LuaEntity.cpp:890 Entity.md entities todo -function Entity GetBaitedCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:934 Entity.md entities todo -function Entity GetBleedingCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:930 Entity.md entities todo -function Entity GetBossStatusEffectCooldown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:888 Entity.md entities todo -function Entity GetBrimstoneMarkCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:942 Entity.md entities todo -function Entity GetBurnCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:926 Entity.md entities todo -function Entity GetBurnDamage repentogon/LuaInterfaces/Entities/LuaEntity.cpp:950 entities todo -function Entity GetBurnDamageTimer repentogon/LuaInterfaces/Entities/LuaEntity.cpp:946 Entity.md entities todo -function Entity GetCharmedCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:918 Entity.md entities todo -function Entity GetCollisionCapsule repentogon/LuaInterfaces/LuaCapsule.cpp:118 Entity.md entities todo -function Entity GetColorParams repentogon/LuaInterfaces/Entities/LuaEntity.cpp:906 Entity.md entities todo -function Entity GetConfusionCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:920 Entity.md entities todo -function Entity GetDamageCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:908 Entity.md entities todo -function Entity GetDebugShape repentogon/LuaInterfaces/LuaShape.cpp:43 Entity.md entities todo -function Entity GetEntityConfigEntity repentogon/LuaInterfaces/LuaEntityConfig.cpp:920 Entity.md entities todo -function Entity GetFearCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:924 Entity.md entities todo -function Entity GetFireDamageCooldown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:910 Entity.md entities todo -function Entity GetFreezeCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:912 Entity.md entities todo -function Entity GetHitListIndex repentogon/LuaInterfaces/Entities/LuaEntity.cpp:897 Entity.md entities todo -function Entity GetIceCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:940 Entity.md entities todo -function Entity GetKnockbackCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:936 Entity.md entities todo -function Entity GetKnockbackDirection repentogon/LuaInterfaces/Entities/LuaEntity.cpp:952 Entity.md entities todo -function Entity GetMagnetizedCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:932 Entity.md entities todo -function Entity GetMidasFreezeCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:922 Entity.md entities todo -function Entity GetMinecart repentogon/LuaInterfaces/Entities/LuaEntity.cpp:894 Entity.md entities todo -function Entity GetNullCapsule repentogon/LuaInterfaces/LuaCapsule.cpp:117 Entity.md entities todo -function Entity GetNullOffset repentogon/LuaInterfaces/Entities/LuaEntity.cpp:884 Entity.md entities todo -function Entity GetPauseTime repentogon/LuaInterfaces/Entities/LuaEntity.cpp:898 Entity.md entities todo -function Entity GetPoisonCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:914 Entity.md entities todo -function Entity GetPoisonDamage repentogon/LuaInterfaces/Entities/LuaEntity.cpp:948 entities todo -function Entity GetPoisonDamageTimer repentogon/LuaInterfaces/Entities/LuaEntity.cpp:944 Entity.md entities todo -function Entity GetPosVel repentogon/LuaInterfaces/Entities/LuaEntity.cpp:887 Entity.md entities todo -function Entity GetPredictedTargetPosition repentogon/LuaInterfaces/Entities/LuaEntity.cpp:885 Entity.md entities todo -function Entity GetShadowSize repentogon/LuaInterfaces/Entities/LuaEntity.cpp:878 Entity.md entities todo -function Entity GetShrinkCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:928 Entity.md entities todo -function Entity GetSlowingCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:916 Entity.md entities todo -function Entity GetSpeedMultiplier repentogon/LuaInterfaces/Entities/LuaEntity.cpp:900 Entity.md entities todo -function Entity GetType repentogon/LuaInterfaces/Entities/LuaEntity.cpp:886 Entity.md entities todo -function Entity GetWaterClipFlags repentogon/LuaInterfaces/Entities/LuaEntity.cpp:954 Entity.md entities todo -function Entity GetWeaknessCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:938 Entity.md entities todo -function Entity GiveMinecart repentogon/LuaInterfaces/Entities/LuaEntity.cpp:893 Entity.md entities todo -function Entity IgnoreEffectFromFriendly repentogon/LuaInterfaces/Entities/LuaEntity.cpp:883 Entity.md entities todo -function Entity MakeBloodPoof repentogon/LuaInterfaces/Entities/LuaEntity.cpp:895 Entity.md entities todo -function Entity MakeGroundPoof repentogon/LuaInterfaces/Entities/LuaEntity.cpp:896 Entity.md entities todo -function Entity ResetWaterClipFlags repentogon/LuaInterfaces/Entities/LuaEntity.cpp:956 Entity.md entities todo -function Entity SetBaitedCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:935 Entity.md entities todo -function Entity SetBleedingCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:931 Entity.md entities todo -function Entity SetBossStatusEffectCooldown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:889 Entity.md entities todo -function Entity SetBrimstoneMarkCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:943 Entity.md entities todo -function Entity SetBurnCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:927 Entity.md entities todo -function Entity SetBurnDamage repentogon/LuaInterfaces/Entities/LuaEntity.cpp:951 entities todo -function Entity SetBurnDamageTimer repentogon/LuaInterfaces/Entities/LuaEntity.cpp:947 Entity.md entities todo -function Entity SetCharmedCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:919 Entity.md entities todo -function Entity SetColorParams repentogon/LuaInterfaces/Entities/LuaEntity.cpp:907 Entity.md entities todo -function Entity SetConfusionCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:921 Entity.md entities todo -function Entity SetDamageCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:909 Entity.md entities todo -function Entity SetDead repentogon/LuaInterfaces/Entities/LuaEntity.cpp:891 Entity.md entities todo -function Entity SetFearCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:925 Entity.md entities todo -function Entity SetFireDamageCooldown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:911 Entity.md entities todo -function Entity SetFreezeCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:913 Entity.md entities todo -function Entity SetIceCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:941 Entity.md entities todo -function Entity SetInvincible repentogon/LuaInterfaces/Entities/LuaEntity.cpp:892 Entity.md entities todo -function Entity SetKnockbackCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:937 Entity.md entities todo -function Entity SetKnockbackDirection repentogon/LuaInterfaces/Entities/LuaEntity.cpp:953 Entity.md entities todo -function Entity SetMagnetizedCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:933 Entity.md entities todo -function Entity SetMidasFreezeCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:923 Entity.md entities todo -function Entity SetPauseTime repentogon/LuaInterfaces/Entities/LuaEntity.cpp:899 Entity.md entities todo -function Entity SetPoisonCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:915 Entity.md entities todo -function Entity SetPoisonDamage repentogon/LuaInterfaces/Entities/LuaEntity.cpp:949 entities todo -function Entity SetPoisonDamageTimer repentogon/LuaInterfaces/Entities/LuaEntity.cpp:945 Entity.md entities todo -function Entity SetShadowSize repentogon/LuaInterfaces/Entities/LuaEntity.cpp:879 Entity.md entities todo -function Entity SetShrinkCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:929 Entity.md entities todo -function Entity SetSlowingCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:917 Entity.md entities todo -function Entity SetSpeedMultiplier repentogon/LuaInterfaces/Entities/LuaEntity.cpp:901 Entity.md entities todo -function Entity SetWaterClipFlags repentogon/LuaInterfaces/Entities/LuaEntity.cpp:955 Entity.md entities todo -function Entity SetWeaknessCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:939 Entity.md entities todo -function Entity SpawnBloodEffect repentogon/LuaInterfaces/Entities/LuaEntity.cpp:902 Entity.md entities todo -function Entity SpawnWaterImpactEffects repentogon/LuaInterfaces/Entities/LuaEntity.cpp:903 Entity.md entities todo +function EntitiesSaveStateVector Clear repentogon/LuaInterfaces/LuaEntitySaveState.cpp:480 EntitiesSaveStateVector.md entities done +function EntitiesSaveStateVector Get repentogon/LuaInterfaces/LuaEntitySaveState.cpp:478 EntitiesSaveStateVector.md entities done +function EntitiesSaveStateVector GetByType repentogon/LuaInterfaces/LuaEntitySaveState.cpp:479 EntitiesSaveStateVector.md entities done +function EntitiesSaveStateVector __len repentogon/LuaInterfaces/LuaEntitySaveState.cpp:481 EntitiesSaveStateVector.md entities done +function Entity AddBaited repentogon/LuaInterfaces/Entities/LuaEntity.cpp:873 Entity.md entities done +function Entity AddBleeding repentogon/LuaInterfaces/Entities/LuaEntity.cpp:871 Entity.md entities done +function Entity AddBrimstoneMark repentogon/LuaInterfaces/Entities/LuaEntity.cpp:875 Entity.md entities done +function Entity AddIce repentogon/LuaInterfaces/Entities/LuaEntity.cpp:876 Entity.md entities done +function Entity AddKnockback repentogon/LuaInterfaces/Entities/LuaEntity.cpp:877 Entity.md entities done +function Entity AddMagnetized repentogon/LuaInterfaces/Entities/LuaEntity.cpp:872 Entity.md entities done +function Entity AddWeakness repentogon/LuaInterfaces/Entities/LuaEntity.cpp:874 Entity.md entities done +function Entity CanDevolve repentogon/LuaInterfaces/Entities/LuaEntity.cpp:957 Entity.md entities done +function Entity ComputeStatusEffectDuration repentogon/LuaInterfaces/Entities/LuaEntity.cpp:881 Entity.md entities done +function Entity CopyStatusEffects repentogon/LuaInterfaces/Entities/LuaEntity.cpp:882 Entity.md entities done +function Entity ForceCollide repentogon/LuaInterfaces/Entities/LuaEntity.cpp:890 Entity.md entities done +function Entity GetBaitedCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:934 Entity.md entities done +function Entity GetBleedingCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:930 Entity.md entities done +function Entity GetBossStatusEffectCooldown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:888 Entity.md entities done +function Entity GetBrimstoneMarkCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:942 Entity.md entities done +function Entity GetBurnCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:926 Entity.md entities done +function Entity GetBurnDamage repentogon/LuaInterfaces/Entities/LuaEntity.cpp:950 entities done +function Entity GetBurnDamageTimer repentogon/LuaInterfaces/Entities/LuaEntity.cpp:946 Entity.md entities done +function Entity GetCharmedCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:918 Entity.md entities done +function Entity GetCollisionCapsule repentogon/LuaInterfaces/LuaCapsule.cpp:118 Entity.md entities done +function Entity GetColorParams repentogon/LuaInterfaces/Entities/LuaEntity.cpp:906 Entity.md entities done +function Entity GetConfusionCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:920 Entity.md entities done +function Entity GetDamageCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:908 Entity.md entities done +function Entity GetDebugShape repentogon/LuaInterfaces/LuaShape.cpp:43 Entity.md entities done +function Entity GetEntityConfigEntity repentogon/LuaInterfaces/LuaEntityConfig.cpp:920 Entity.md entities done +function Entity GetFearCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:924 Entity.md entities done +function Entity GetFireDamageCooldown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:910 Entity.md entities done +function Entity GetFreezeCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:912 Entity.md entities done +function Entity GetHitListIndex repentogon/LuaInterfaces/Entities/LuaEntity.cpp:897 Entity.md entities done +function Entity GetIceCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:940 Entity.md entities done +function Entity GetKnockbackCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:936 Entity.md entities done +function Entity GetKnockbackDirection repentogon/LuaInterfaces/Entities/LuaEntity.cpp:952 Entity.md entities done +function Entity GetMagnetizedCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:932 Entity.md entities done +function Entity GetMidasFreezeCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:922 Entity.md entities done +function Entity GetMinecart repentogon/LuaInterfaces/Entities/LuaEntity.cpp:894 Entity.md entities done +function Entity GetNullCapsule repentogon/LuaInterfaces/LuaCapsule.cpp:117 Entity.md entities done +function Entity GetNullOffset repentogon/LuaInterfaces/Entities/LuaEntity.cpp:884 Entity.md entities done +function Entity GetPauseTime repentogon/LuaInterfaces/Entities/LuaEntity.cpp:898 Entity.md entities done +function Entity GetPoisonCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:914 Entity.md entities done +function Entity GetPoisonDamage repentogon/LuaInterfaces/Entities/LuaEntity.cpp:948 entities done +function Entity GetPoisonDamageTimer repentogon/LuaInterfaces/Entities/LuaEntity.cpp:944 Entity.md entities done +function Entity GetPosVel repentogon/LuaInterfaces/Entities/LuaEntity.cpp:887 Entity.md entities done +function Entity GetPredictedTargetPosition repentogon/LuaInterfaces/Entities/LuaEntity.cpp:885 Entity.md entities done +function Entity GetShadowSize repentogon/LuaInterfaces/Entities/LuaEntity.cpp:878 Entity.md entities done +function Entity GetShrinkCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:928 Entity.md entities done +function Entity GetSlowingCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:916 Entity.md entities done +function Entity GetSpeedMultiplier repentogon/LuaInterfaces/Entities/LuaEntity.cpp:900 Entity.md entities done +function Entity GetType repentogon/LuaInterfaces/Entities/LuaEntity.cpp:886 Entity.md entities done +function Entity GetWaterClipFlags repentogon/LuaInterfaces/Entities/LuaEntity.cpp:954 Entity.md entities done +function Entity GetWeaknessCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:938 Entity.md entities done +function Entity GiveMinecart repentogon/LuaInterfaces/Entities/LuaEntity.cpp:893 Entity.md entities done +function Entity IgnoreEffectFromFriendly repentogon/LuaInterfaces/Entities/LuaEntity.cpp:883 Entity.md entities done +function Entity MakeBloodPoof repentogon/LuaInterfaces/Entities/LuaEntity.cpp:895 Entity.md entities done +function Entity MakeGroundPoof repentogon/LuaInterfaces/Entities/LuaEntity.cpp:896 Entity.md entities done +function Entity ResetWaterClipFlags repentogon/LuaInterfaces/Entities/LuaEntity.cpp:956 Entity.md entities done +function Entity SetBaitedCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:935 Entity.md entities done +function Entity SetBleedingCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:931 Entity.md entities done +function Entity SetBossStatusEffectCooldown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:889 Entity.md entities done +function Entity SetBrimstoneMarkCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:943 Entity.md entities done +function Entity SetBurnCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:927 Entity.md entities done +function Entity SetBurnDamage repentogon/LuaInterfaces/Entities/LuaEntity.cpp:951 entities done +function Entity SetBurnDamageTimer repentogon/LuaInterfaces/Entities/LuaEntity.cpp:947 Entity.md entities done +function Entity SetCharmedCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:919 Entity.md entities done +function Entity SetColorParams repentogon/LuaInterfaces/Entities/LuaEntity.cpp:907 Entity.md entities done +function Entity SetConfusionCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:921 Entity.md entities done +function Entity SetDamageCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:909 Entity.md entities done +function Entity SetDead repentogon/LuaInterfaces/Entities/LuaEntity.cpp:891 Entity.md entities done +function Entity SetFearCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:925 Entity.md entities done +function Entity SetFireDamageCooldown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:911 Entity.md entities done +function Entity SetFreezeCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:913 Entity.md entities done +function Entity SetIceCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:941 Entity.md entities done +function Entity SetInvincible repentogon/LuaInterfaces/Entities/LuaEntity.cpp:892 Entity.md entities done +function Entity SetKnockbackCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:937 Entity.md entities done +function Entity SetKnockbackDirection repentogon/LuaInterfaces/Entities/LuaEntity.cpp:953 Entity.md entities done +function Entity SetMagnetizedCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:933 Entity.md entities done +function Entity SetMidasFreezeCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:923 Entity.md entities done +function Entity SetPauseTime repentogon/LuaInterfaces/Entities/LuaEntity.cpp:899 Entity.md entities done +function Entity SetPoisonCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:915 Entity.md entities done +function Entity SetPoisonDamage repentogon/LuaInterfaces/Entities/LuaEntity.cpp:949 entities done +function Entity SetPoisonDamageTimer repentogon/LuaInterfaces/Entities/LuaEntity.cpp:945 Entity.md entities done +function Entity SetShadowSize repentogon/LuaInterfaces/Entities/LuaEntity.cpp:879 Entity.md entities done +function Entity SetShrinkCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:929 Entity.md entities done +function Entity SetSlowingCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:917 Entity.md entities done +function Entity SetSpeedMultiplier repentogon/LuaInterfaces/Entities/LuaEntity.cpp:901 Entity.md entities done +function Entity SetWaterClipFlags repentogon/LuaInterfaces/Entities/LuaEntity.cpp:955 Entity.md entities done +function Entity SetWeaknessCountdown repentogon/LuaInterfaces/Entities/LuaEntity.cpp:939 Entity.md entities done +function Entity SpawnBloodEffect repentogon/LuaInterfaces/Entities/LuaEntity.cpp:902 Entity.md entities done +function Entity SpawnWaterImpactEffects repentogon/LuaInterfaces/Entities/LuaEntity.cpp:903 Entity.md entities done function Entity TeleportToRandomPosition repentogon/LuaInterfaces/Entities/LuaEntity.cpp:904 Entity.md entities todo -function Entity ToDelirium repentogon/LuaInterfaces/LuaDelirium.cpp:242 Entity.md entities todo -function Entity ToSlot repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:167 Entity.md entities todo -function Entity TryThrow repentogon/LuaInterfaces/Entities/LuaEntity.cpp:905 Entity.md entities todo -function EntityBomb GetCostumeLayerSprite repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:206 EntityBomb.md tear and weapons todo -function EntityBomb GetExplosionCountdown repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:199 EntityBomb.md tear and weapons todo -function EntityBomb GetFallAcceleration repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:202 EntityBomb.md tear and weapons todo -function EntityBomb GetFallSpeed repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:200 EntityBomb.md tear and weapons todo -function EntityBomb GetFallingSpeed repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:216 tear and weapons todo -function EntityBomb GetHeight repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:214 tear and weapons todo -function EntityBomb GetHitList repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:195 EntityBomb.md tear and weapons todo -function EntityBomb GetRocketAngle repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:207 EntityBomb.md tear and weapons todo -function EntityBomb GetRocketSpeed repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:209 EntityBomb.md tear and weapons todo -function EntityBomb GetScale repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:197 EntityBomb.md tear and weapons todo -function EntityBomb IsLoadingCostumes repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:204 EntityBomb.md tear and weapons todo -function EntityBomb IsPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:211 EntityBomb.md tear and weapons todo -function EntityBomb SetFallAcceleration repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:203 EntityBomb.md tear and weapons todo -function EntityBomb SetFallSpeed repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:201 EntityBomb.md tear and weapons todo -function EntityBomb SetFallingSpeed repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:217 tear and weapons todo -function EntityBomb SetHeight repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:215 tear and weapons todo -function EntityBomb SetLoadCostumes repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:205 EntityBomb.md tear and weapons todo -function EntityBomb SetPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:212 EntityBomb.md tear and weapons todo -function EntityBomb SetRocketAngle repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:208 EntityBomb.md tear and weapons todo -function EntityBomb SetRocketSpeed repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:210 EntityBomb.md tear and weapons todo -function EntityBomb SetScale repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:198 EntityBomb.md tear and weapons todo -function EntityBomb UpdateDirtColor repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:196 EntityBomb.md tear and weapons todo -function EntityConfig GetBaby repentogon/LuaInterfaces/LuaEntityConfig.cpp:815 EntityConfig.md entities todo -function EntityConfig GetEntity repentogon/LuaInterfaces/LuaEntityConfig.cpp:812 EntityConfig.md entities todo -function EntityConfig GetMaxBabyID repentogon/LuaInterfaces/LuaEntityConfig.cpp:816 EntityConfig.md entities todo -function EntityConfig GetMaxPlayerType repentogon/LuaInterfaces/LuaEntityConfig.cpp:814 EntityConfig.md entities todo -function EntityConfig GetPlayer repentogon/LuaInterfaces/LuaEntityConfig.cpp:813 EntityConfig.md entities todo -function EntityConfigBaby GetAchievementID repentogon/LuaInterfaces/LuaEntityConfig.cpp:909 EntityConfigBaby.md player todo -function EntityConfigBaby GetID repentogon/LuaInterfaces/LuaEntityConfig.cpp:906 EntityConfigBaby.md player todo -function EntityConfigBaby GetName repentogon/LuaInterfaces/LuaEntityConfig.cpp:907 EntityConfigBaby.md player todo -function EntityConfigBaby GetSpritesheetPath repentogon/LuaInterfaces/LuaEntityConfig.cpp:908 EntityConfigBaby.md player todo -function EntityConfigEntity CanBeChampion repentogon/LuaInterfaces/LuaEntityConfig.cpp:841 EntityConfigEntity.md entities todo -function EntityConfigEntity CanBeRerolledInto repentogon/LuaInterfaces/LuaEntityConfig.cpp:847 EntityConfigEntity.md entities todo -function EntityConfigEntity CanShutDoors repentogon/LuaInterfaces/LuaEntityConfig.cpp:842 EntityConfigEntity.md entities todo -function EntityConfigEntity GetAnm2Path repentogon/LuaInterfaces/LuaEntityConfig.cpp:835 EntityConfigEntity.md entities todo -function EntityConfigEntity GetBaseHP repentogon/LuaInterfaces/LuaEntityConfig.cpp:833 EntityConfigEntity.md entities todo -function EntityConfigEntity GetBestiaryAnimation repentogon/LuaInterfaces/LuaEntityConfig.cpp:851 EntityConfigEntity.md entities todo -function EntityConfigEntity GetBestiaryAnm2Path repentogon/LuaInterfaces/LuaEntityConfig.cpp:850 EntityConfigEntity.md entities todo -function EntityConfigEntity GetBestiaryFloorAlt repentogon/LuaInterfaces/LuaEntityConfig.cpp:855 EntityConfigEntity.md entities todo -function EntityConfigEntity GetBestiaryOffset repentogon/LuaInterfaces/LuaEntityConfig.cpp:853 EntityConfigEntity.md entities todo -function EntityConfigEntity GetBestiaryOverlay repentogon/LuaInterfaces/LuaEntityConfig.cpp:852 EntityConfigEntity.md entities todo -function EntityConfigEntity GetBestiaryScale repentogon/LuaInterfaces/LuaEntityConfig.cpp:854 EntityConfigEntity.md entities todo -function EntityConfigEntity GetBossID repentogon/LuaInterfaces/LuaEntityConfig.cpp:827 EntityConfigEntity.md entities todo -function EntityConfigEntity GetCollisionDamage repentogon/LuaInterfaces/LuaEntityConfig.cpp:826 EntityConfigEntity.md entities todo -function EntityConfigEntity GetCollisionInterval repentogon/LuaInterfaces/LuaEntityConfig.cpp:848 EntityConfigEntity.md entities todo -function EntityConfigEntity GetCollisionRadius repentogon/LuaInterfaces/LuaEntityConfig.cpp:828 EntityConfigEntity.md entities todo -function EntityConfigEntity GetCollisionRadiusMultiplier repentogon/LuaInterfaces/LuaEntityConfig.cpp:829 EntityConfigEntity.md entities todo -function EntityConfigEntity GetCustomTags repentogon/LuaInterfaces/LuaEntityConfig.cpp:857 EntityConfigEntity.md entities todo -function EntityConfigEntity GetDevolvedEntity repentogon/LuaInterfaces/LuaEntityConfig.cpp:859 EntityConfigEntity.md entities todo -function EntityConfigEntity GetEntityTags repentogon/LuaInterfaces/LuaEntityConfig.cpp:837 EntityConfigEntity.md entities todo -function EntityConfigEntity GetFriction repentogon/LuaInterfaces/LuaEntityConfig.cpp:832 EntityConfigEntity.md entities todo -function EntityConfigEntity GetGibFlags repentogon/LuaInterfaces/LuaEntityConfig.cpp:844 EntityConfigEntity.md entities todo -function EntityConfigEntity GetGibsAmount repentogon/LuaInterfaces/LuaEntityConfig.cpp:843 EntityConfigEntity.md entities todo -function EntityConfigEntity GetGridCollisionPoints repentogon/LuaInterfaces/LuaEntityConfig.cpp:831 EntityConfigEntity.md entities todo -function EntityConfigEntity GetMass repentogon/LuaInterfaces/LuaEntityConfig.cpp:830 EntityConfigEntity.md entities todo -function EntityConfigEntity GetModName repentogon/LuaInterfaces/LuaEntityConfig.cpp:836 EntityConfigEntity.md entities todo -function EntityConfigEntity GetName repentogon/LuaInterfaces/LuaEntityConfig.cpp:825 EntityConfigEntity.md entities todo -function EntityConfigEntity GetPortraitID repentogon/LuaInterfaces/LuaEntityConfig.cpp:846 EntityConfigEntity.md entities todo -function EntityConfigEntity GetShadowSize repentogon/LuaInterfaces/LuaEntityConfig.cpp:839 EntityConfigEntity.md entities todo -function EntityConfigEntity GetShieldStrength repentogon/LuaInterfaces/LuaEntityConfig.cpp:849 EntityConfigEntity.md entities todo -function EntityConfigEntity GetStageHP repentogon/LuaInterfaces/LuaEntityConfig.cpp:834 EntityConfigEntity.md entities todo -function EntityConfigEntity GetSubType repentogon/LuaInterfaces/LuaEntityConfig.cpp:824 EntityConfigEntity.md entities todo -function EntityConfigEntity GetType repentogon/LuaInterfaces/LuaEntityConfig.cpp:822 EntityConfigEntity.md entities todo -function EntityConfigEntity GetVariant repentogon/LuaInterfaces/LuaEntityConfig.cpp:823 EntityConfigEntity.md entities todo -function EntityConfigEntity HasCustomTag repentogon/LuaInterfaces/LuaEntityConfig.cpp:858 EntityConfigEntity.md entities todo -function EntityConfigEntity HasEntityTags repentogon/LuaInterfaces/LuaEntityConfig.cpp:838 EntityConfigEntity.md entities todo -function EntityConfigEntity HasFloorAlts repentogon/LuaInterfaces/LuaEntityConfig.cpp:856 EntityConfigEntity.md entities todo -function EntityConfigEntity HasGibFlags repentogon/LuaInterfaces/LuaEntityConfig.cpp:845 EntityConfigEntity.md entities todo -function EntityConfigEntity IsBoss repentogon/LuaInterfaces/LuaEntityConfig.cpp:840 EntityConfigEntity.md entities todo -function EntityConfigPlayer CanShoot repentogon/LuaInterfaces/LuaEntityConfig.cpp:888 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetAchievementID repentogon/LuaInterfaces/LuaEntityConfig.cpp:889 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetBirthrightDescription repentogon/LuaInterfaces/LuaEntityConfig.cpp:890 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetBlackHearts repentogon/LuaInterfaces/LuaEntityConfig.cpp:878 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetBombs repentogon/LuaInterfaces/LuaEntityConfig.cpp:881 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetBrokenHearts repentogon/LuaInterfaces/LuaEntityConfig.cpp:879 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetCard repentogon/LuaInterfaces/LuaEntityConfig.cpp:883 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetCoins repentogon/LuaInterfaces/LuaEntityConfig.cpp:880 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetCollectibles repentogon/LuaInterfaces/LuaEntityConfig.cpp:886 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetCostumeID repentogon/LuaInterfaces/LuaEntityConfig.cpp:874 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetCostumeSuffix repentogon/LuaInterfaces/LuaEntityConfig.cpp:873 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetExtraPortraitPath repentogon/LuaInterfaces/LuaEntityConfig.cpp:872 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetKeys repentogon/LuaInterfaces/LuaEntityConfig.cpp:882 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetModdedControlsSprite repentogon/LuaInterfaces/LuaEntityConfig.cpp:895 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetModdedCoopMenuSprite repentogon/LuaInterfaces/LuaEntityConfig.cpp:894 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetModdedGameOverSprite repentogon/LuaInterfaces/LuaEntityConfig.cpp:893 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetModdedMenuBackgroundSprite repentogon/LuaInterfaces/LuaEntityConfig.cpp:891 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetModdedMenuPortraitSprite repentogon/LuaInterfaces/LuaEntityConfig.cpp:892 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetName repentogon/LuaInterfaces/LuaEntityConfig.cpp:868 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetNameImagePath repentogon/LuaInterfaces/LuaEntityConfig.cpp:870 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetPill repentogon/LuaInterfaces/LuaEntityConfig.cpp:884 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetPlayerType repentogon/LuaInterfaces/LuaEntityConfig.cpp:867 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetPocketActive repentogon/LuaInterfaces/LuaEntityConfig.cpp:887 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetPortraitPath repentogon/LuaInterfaces/LuaEntityConfig.cpp:871 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetRedHearts repentogon/LuaInterfaces/LuaEntityConfig.cpp:876 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetSkinColor repentogon/LuaInterfaces/LuaEntityConfig.cpp:875 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetSkinPath repentogon/LuaInterfaces/LuaEntityConfig.cpp:869 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetSoulHearts repentogon/LuaInterfaces/LuaEntityConfig.cpp:877 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetTaintedCounterpart repentogon/LuaInterfaces/LuaEntityConfig.cpp:897 EntityConfigPlayer.md player todo -function EntityConfigPlayer GetTrinket repentogon/LuaInterfaces/LuaEntityConfig.cpp:885 EntityConfigPlayer.md player todo -function EntityConfigPlayer IsHidden repentogon/LuaInterfaces/LuaEntityConfig.cpp:898 EntityConfigPlayer.md player todo -function EntityConfigPlayer IsTainted repentogon/LuaInterfaces/LuaEntityConfig.cpp:896 EntityConfigPlayer.md player todo -function EntityDelirium GetTeleportationTimer repentogon/LuaInterfaces/LuaDelirium.cpp:283 EntityDelirium.md npc todo -function EntityDelirium IsRedMode repentogon/LuaInterfaces/LuaDelirium.cpp:281 EntityDelirium.md npc todo -function EntityDelirium SetRedMode repentogon/LuaInterfaces/LuaDelirium.cpp:282 EntityDelirium.md npc todo -function EntityDelirium SetTeleportationTimer repentogon/LuaInterfaces/LuaDelirium.cpp:284 EntityDelirium.md npc todo -function EntityDelirium Transform repentogon/LuaInterfaces/LuaDelirium.cpp:280 EntityDelirium.md npc todo -function EntityDesc GetChampionId repentogon/LuaInterfaces/LuaEntityDesc.cpp:131 EntityDesc.md entities todo -function EntityDesc GetHealth repentogon/LuaInterfaces/LuaEntityDesc.cpp:133 EntityDesc.md entities todo -function EntityDesc GetMaxHealth repentogon/LuaInterfaces/LuaEntityDesc.cpp:135 EntityDesc.md entities todo -function EntityDesc GetSubtype repentogon/LuaInterfaces/LuaEntityDesc.cpp:129 EntityDesc.md entities todo -function EntityDesc GetType repentogon/LuaInterfaces/LuaEntityDesc.cpp:125 EntityDesc.md entities todo -function EntityDesc GetVariant repentogon/LuaInterfaces/LuaEntityDesc.cpp:127 EntityDesc.md entities todo -function EntityDesc IsPlayerControlled repentogon/LuaInterfaces/LuaEntityDesc.cpp:137 EntityDesc.md entities todo -function EntityDesc SetChampionId repentogon/LuaInterfaces/LuaEntityDesc.cpp:132 EntityDesc.md entities todo -function EntityDesc SetHealth repentogon/LuaInterfaces/LuaEntityDesc.cpp:134 EntityDesc.md entities todo -function EntityDesc SetMaxHealth repentogon/LuaInterfaces/LuaEntityDesc.cpp:136 EntityDesc.md entities todo -function EntityDesc SetPlayerControlled repentogon/LuaInterfaces/LuaEntityDesc.cpp:138 EntityDesc.md entities todo -function EntityDesc SetSubtype repentogon/LuaInterfaces/LuaEntityDesc.cpp:130 EntityDesc.md entities todo -function EntityDesc SetType repentogon/LuaInterfaces/LuaEntityDesc.cpp:126 EntityDesc.md entities todo -function EntityDesc SetVariant repentogon/LuaInterfaces/LuaEntityDesc.cpp:128 EntityDesc.md entities todo -function EntityEffect AddAquariusTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:137 entities todo -function EntityEffect AddTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:131 EntityEffect.md entities todo -function EntityEffect ClearAquariusTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:138 entities todo -function EntityEffect ClearTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:132 EntityEffect.md entities todo -function EntityEffect CreateLight repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:144 EntityEffect.md entities todo -function EntityEffect CreateLootPreview repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:145 EntityEffect.md entities todo -function EntityEffect GetAquariusTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:135 entities todo -function EntityEffect GetGridEntityDesc repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:128 EntityEffect.md entities todo -function EntityEffect GetTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:129 EntityEffect.md entities todo -function EntityEffect HasAquariusTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:139 entities todo -function EntityEffect HasTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:133 EntityEffect.md entities todo -function EntityEffect SetAquariusTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:136 entities todo -function EntityEffect SetTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:130 EntityEffect.md entities todo -function EntityFamiliar CanBeDamagedByEnemies repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:281 EntityFamiliar.md familiar todo -function EntityFamiliar CanBeDamagedByLasers repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:283 EntityFamiliar.md familiar todo -function EntityFamiliar CanBeDamagedByProjectiles repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:282 EntityFamiliar.md familiar todo -function EntityFamiliar CanBlockProjectiles repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:284 EntityFamiliar.md familiar todo -function EntityFamiliar CanCharm repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:279 EntityFamiliar.md familiar todo -function EntityFamiliar GetActiveWeaponEntity repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:293 EntityFamiliar.md familiar todo -function EntityFamiliar GetActiveWeaponNumFired repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:294 EntityFamiliar.md familiar todo -function EntityFamiliar GetDirtColor repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:277 EntityFamiliar.md familiar todo -function EntityFamiliar GetFollowerPriority repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:271 EntityFamiliar.md familiar todo -function EntityFamiliar GetItemConfig repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:287 EntityFamiliar.md familiar todo -function EntityFamiliar GetMoveDelayNum repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:285 EntityFamiliar.md familiar todo -function EntityFamiliar GetMultiplier repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:289 EntityFamiliar.md familiar todo -function EntityFamiliar GetPathFinder repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:272 familiar todo -function EntityFamiliar GetPathfinder repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:273 EntityFamiliar.md familiar todo -function EntityFamiliar GetRandomWisp repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:292 EntityFamiliar.md familiar todo -function EntityFamiliar GetWeapon repentogon/LuaInterfaces/LuaWeapon.cpp:203 EntityFamiliar.md familiar todo -function EntityFamiliar InvalidateCachedMultiplier repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:288 EntityFamiliar.md familiar todo -function EntityFamiliar IsCharmed repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:280 EntityFamiliar.md familiar todo -function EntityFamiliar IsLilDelirium repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:290 EntityFamiliar.md familiar todo -function EntityFamiliar RemoveFromPlayer repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:278 EntityFamiliar.md familiar todo -function EntityFamiliar SetLilDelirium repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:291 EntityFamiliar.md familiar todo -function EntityFamiliar SetMoveDelayNum repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:286 EntityFamiliar.md familiar todo -function EntityFamiliar TriggerRoomClear repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:275 EntityFamiliar.md familiar todo -function EntityFamiliar TryAimAtMarkedTarget repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:274 EntityFamiliar.md familiar todo -function EntityFamiliar UpdateDirtColor repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:276 EntityFamiliar.md familiar todo -function EntityKnife AddToHitList repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:180 tear and weapons todo -function EntityKnife FireSplitTear repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:176 EntityKnife.md tear and weapons todo -function EntityKnife GetHitList repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:167 EntityKnife.md tear and weapons todo -function EntityKnife GetHitboxParentKnife repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:177 EntityKnife.md tear and weapons todo -function EntityKnife GetIsSpinAttack repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:170 EntityKnife.md tear and weapons todo -function EntityKnife GetIsSwinging repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:168 EntityKnife.md tear and weapons todo -function EntityKnife InHitList repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:181 tear and weapons todo -function EntityKnife InitHomingPath repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:184 EntityKnife.md tear and weapons todo -function EntityKnife IsMultidimensionalTouched repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:172 EntityKnife.md tear and weapons todo -function EntityKnife IsPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:174 EntityKnife.md tear and weapons todo -function EntityKnife RemoveFromHitList repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:179 tear and weapons todo -function EntityKnife SetHitboxParentKnife repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:178 EntityKnife.md tear and weapons todo -function EntityKnife SetIsSpinAttack repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:171 EntityKnife.md tear and weapons todo -function EntityKnife SetIsSwinging repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:169 EntityKnife.md tear and weapons todo -function EntityKnife SetKnifeDistance repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:182 EntityKnife.md tear and weapons todo -function EntityKnife SetKnifeVelocity repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:183 EntityKnife.md tear and weapons todo -function EntityKnife SetMultidimensionalTouched repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:173 EntityKnife.md tear and weapons todo -function EntityKnife SetPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:175 EntityKnife.md tear and weapons todo -function EntityLaser AddToHitList repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:262 tear and weapons todo -function EntityLaser FireSplitTear repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:260 EntityLaser.md tear and weapons todo -function EntityLaser GetDamageMultiplier repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:249 EntityLaser.md tear and weapons todo -function EntityLaser GetDisableFollowParent repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:243 EntityLaser.md tear and weapons todo -function EntityLaser GetHitList repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:245 EntityLaser.md tear and weapons todo -function EntityLaser GetNumChainedLasers repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:264 EntityLaser.md tear and weapons todo -function EntityLaser GetOneHit repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:246 EntityLaser.md tear and weapons todo -function EntityLaser GetScale repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:247 EntityLaser.md tear and weapons todo -function EntityLaser GetShrink repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:251 EntityLaser.md tear and weapons todo -function EntityLaser GetTimeout repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:253 EntityLaser.md tear and weapons todo -function EntityLaser InHitList repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:263 tear and weapons todo -function EntityLaser IsMultidimensionalTouched repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:257 EntityLaser.md tear and weapons todo -function EntityLaser IsPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:258 EntityLaser.md tear and weapons todo -function EntityLaser RecalculateSamplesNextUpdate repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:256 EntityLaser.md tear and weapons todo -function EntityLaser RemoveFromHitList repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:261 tear and weapons todo -function EntityLaser ResetSpriteScale repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:254 EntityLaser.md tear and weapons todo -function EntityLaser RotateToAngle repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:255 EntityLaser.md tear and weapons todo -function EntityLaser SetDamageMultiplier repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:250 EntityLaser.md tear and weapons todo -function EntityLaser SetDisableFollowParent repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:244 EntityLaser.md tear and weapons todo -function EntityLaser SetInitSound repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:266 EntityLaser.md tear and weapons todo -function EntityLaser SetNumChainedLasers repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:265 EntityLaser.md tear and weapons todo -function EntityLaser SetPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:259 EntityLaser.md tear and weapons todo -function EntityLaser SetScale repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:248 EntityLaser.md tear and weapons todo -function EntityLaser SetShrink repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:252 EntityLaser.md tear and weapons todo -function EntityLaser SetTimeout EntityLaser.md tear and weapons review docs only: no registration found -function EntityNPC ApplyTearflagEffects repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:458 EntityNPC.md npc todo -function EntityNPC ClearFlyingOverride repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:457 EntityNPC.md npc todo -function EntityNPC FireBossProjectilesEx repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:448 EntityNPC.md npc todo -function EntityNPC FireGridEntity repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:446 EntityNPC.md npc todo -function EntityNPC FireProjectilesEx repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:447 EntityNPC.md npc todo -function EntityNPC GetBossColorIdx EntityNPC.md npc review docs only: no registration found -function EntityNPC GetControllerId repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:443 EntityNPC.md npc todo -function EntityNPC GetDarkRedChampionRegenTimer repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:460 EntityNPC.md npc todo -function EntityNPC GetDirtColor repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:442 EntityNPC.md npc todo -function EntityNPC GetFireplaceLoot repentogon/LuaInterfaces/LuaLootList.cpp:111 EntityNPC.md npc todo -function EntityNPC GetFlyingOverride repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:455 EntityNPC.md npc todo -function EntityNPC GetHitList repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:449 EntityNPC.md npc todo -function EntityNPC GetLootList repentogon/LuaInterfaces/LuaLootList.cpp:108 npc todo -function EntityNPC GetPathfinder repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:464 EntityNPC.md npc todo -function EntityNPC GetShieldStrength repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:450 EntityNPC.md npc todo -function EntityNPC GetShopkeeperLoot repentogon/LuaInterfaces/LuaLootList.cpp:112 EntityNPC.md npc todo -function EntityNPC GetSirenPlayerEntity repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:461 EntityNPC.md npc todo -function EntityNPC IsBossColor repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:459 EntityNPC.md npc todo -function EntityNPC PlaySound repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:438 EntityNPC.md npc review -function EntityNPC ReplaceSpritesheet repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:463 EntityNPC.md npc todo -function EntityNPC SetControllerId repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:444 EntityNPC.md npc todo -function EntityNPC SetFlyingOverride repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:456 EntityNPC.md npc todo -function EntityNPC SetShieldStrength repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:451 EntityNPC.md npc todo -function EntityNPC ShootMaggotProjectile repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:482 EntityNPC.md npc todo -function EntityNPC SpawnBloodCloud repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:439 EntityNPC.md npc todo +function Entity ToDelirium repentogon/LuaInterfaces/LuaDelirium.cpp:242 Entity.md entities done +function Entity ToSlot repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:167 Entity.md entities done +function Entity TryThrow repentogon/LuaInterfaces/Entities/LuaEntity.cpp:905 Entity.md entities done +function EntityBomb GetCostumeLayerSprite repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:206 EntityBomb.md tear and weapons done +function EntityBomb GetExplosionCountdown repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:199 EntityBomb.md tear and weapons done +function EntityBomb GetFallAcceleration repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:202 EntityBomb.md tear and weapons done +function EntityBomb GetFallSpeed repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:200 EntityBomb.md tear and weapons done +function EntityBomb GetFallingSpeed repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:216 tear and weapons done +function EntityBomb GetHeight repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:214 tear and weapons done +function EntityBomb GetHitList repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:195 EntityBomb.md tear and weapons done +function EntityBomb GetRocketAngle repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:207 EntityBomb.md tear and weapons done +function EntityBomb GetRocketSpeed repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:209 EntityBomb.md tear and weapons done +function EntityBomb GetScale repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:197 EntityBomb.md tear and weapons done +function EntityBomb IsLoadingCostumes repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:204 EntityBomb.md tear and weapons done +function EntityBomb IsPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:211 EntityBomb.md tear and weapons done +function EntityBomb SetFallAcceleration repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:203 EntityBomb.md tear and weapons done +function EntityBomb SetFallSpeed repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:201 EntityBomb.md tear and weapons done +function EntityBomb SetFallingSpeed repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:217 tear and weapons done +function EntityBomb SetHeight repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:215 tear and weapons done +function EntityBomb SetLoadCostumes repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:205 EntityBomb.md tear and weapons done +function EntityBomb SetPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:212 EntityBomb.md tear and weapons done +function EntityBomb SetRocketAngle repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:208 EntityBomb.md tear and weapons done +function EntityBomb SetRocketSpeed repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:210 EntityBomb.md tear and weapons done +function EntityBomb SetScale repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:198 EntityBomb.md tear and weapons done +function EntityBomb UpdateDirtColor repentogon/LuaInterfaces/Entities/LuaEntityBomb.cpp:196 EntityBomb.md tear and weapons done +function EntityConfig GetBaby repentogon/LuaInterfaces/LuaEntityConfig.cpp:815 EntityConfig.md entities done +function EntityConfig GetEntity repentogon/LuaInterfaces/LuaEntityConfig.cpp:812 EntityConfig.md entities done +function EntityConfig GetMaxBabyID repentogon/LuaInterfaces/LuaEntityConfig.cpp:816 EntityConfig.md entities done +function EntityConfig GetMaxPlayerType repentogon/LuaInterfaces/LuaEntityConfig.cpp:814 EntityConfig.md entities done +function EntityConfig GetPlayer repentogon/LuaInterfaces/LuaEntityConfig.cpp:813 EntityConfig.md entities done +function EntityConfigBaby GetAchievementID repentogon/LuaInterfaces/LuaEntityConfig.cpp:909 EntityConfigBaby.md player done +function EntityConfigBaby GetID repentogon/LuaInterfaces/LuaEntityConfig.cpp:906 EntityConfigBaby.md player done +function EntityConfigBaby GetName repentogon/LuaInterfaces/LuaEntityConfig.cpp:907 EntityConfigBaby.md player done +function EntityConfigBaby GetSpritesheetPath repentogon/LuaInterfaces/LuaEntityConfig.cpp:908 EntityConfigBaby.md player done +function EntityConfigEntity CanBeChampion repentogon/LuaInterfaces/LuaEntityConfig.cpp:841 EntityConfigEntity.md entities done +function EntityConfigEntity CanBeRerolledInto repentogon/LuaInterfaces/LuaEntityConfig.cpp:847 EntityConfigEntity.md entities done +function EntityConfigEntity CanShutDoors repentogon/LuaInterfaces/LuaEntityConfig.cpp:842 EntityConfigEntity.md entities done +function EntityConfigEntity GetAnm2Path repentogon/LuaInterfaces/LuaEntityConfig.cpp:835 EntityConfigEntity.md entities done +function EntityConfigEntity GetBaseHP repentogon/LuaInterfaces/LuaEntityConfig.cpp:833 EntityConfigEntity.md entities done +function EntityConfigEntity GetBestiaryAnimation repentogon/LuaInterfaces/LuaEntityConfig.cpp:851 EntityConfigEntity.md entities done +function EntityConfigEntity GetBestiaryAnm2Path repentogon/LuaInterfaces/LuaEntityConfig.cpp:850 EntityConfigEntity.md entities done +function EntityConfigEntity GetBestiaryFloorAlt repentogon/LuaInterfaces/LuaEntityConfig.cpp:855 EntityConfigEntity.md entities done +function EntityConfigEntity GetBestiaryOffset repentogon/LuaInterfaces/LuaEntityConfig.cpp:853 EntityConfigEntity.md entities done +function EntityConfigEntity GetBestiaryOverlay repentogon/LuaInterfaces/LuaEntityConfig.cpp:852 EntityConfigEntity.md entities done +function EntityConfigEntity GetBestiaryScale repentogon/LuaInterfaces/LuaEntityConfig.cpp:854 EntityConfigEntity.md entities done +function EntityConfigEntity GetBossID repentogon/LuaInterfaces/LuaEntityConfig.cpp:827 EntityConfigEntity.md entities done +function EntityConfigEntity GetCollisionDamage repentogon/LuaInterfaces/LuaEntityConfig.cpp:826 EntityConfigEntity.md entities done +function EntityConfigEntity GetCollisionInterval repentogon/LuaInterfaces/LuaEntityConfig.cpp:848 EntityConfigEntity.md entities done +function EntityConfigEntity GetCollisionRadius repentogon/LuaInterfaces/LuaEntityConfig.cpp:828 EntityConfigEntity.md entities done +function EntityConfigEntity GetCollisionRadiusMultiplier repentogon/LuaInterfaces/LuaEntityConfig.cpp:829 EntityConfigEntity.md entities done +function EntityConfigEntity GetCustomTags repentogon/LuaInterfaces/LuaEntityConfig.cpp:857 EntityConfigEntity.md entities done +function EntityConfigEntity GetDevolvedEntity repentogon/LuaInterfaces/LuaEntityConfig.cpp:859 EntityConfigEntity.md entities done +function EntityConfigEntity GetEntityTags repentogon/LuaInterfaces/LuaEntityConfig.cpp:837 EntityConfigEntity.md entities done +function EntityConfigEntity GetFriction repentogon/LuaInterfaces/LuaEntityConfig.cpp:832 EntityConfigEntity.md entities done +function EntityConfigEntity GetGibFlags repentogon/LuaInterfaces/LuaEntityConfig.cpp:844 EntityConfigEntity.md entities done +function EntityConfigEntity GetGibsAmount repentogon/LuaInterfaces/LuaEntityConfig.cpp:843 EntityConfigEntity.md entities done +function EntityConfigEntity GetGridCollisionPoints repentogon/LuaInterfaces/LuaEntityConfig.cpp:831 EntityConfigEntity.md entities done +function EntityConfigEntity GetMass repentogon/LuaInterfaces/LuaEntityConfig.cpp:830 EntityConfigEntity.md entities done +function EntityConfigEntity GetModName repentogon/LuaInterfaces/LuaEntityConfig.cpp:836 EntityConfigEntity.md entities done +function EntityConfigEntity GetName repentogon/LuaInterfaces/LuaEntityConfig.cpp:825 EntityConfigEntity.md entities done +function EntityConfigEntity GetPortraitID repentogon/LuaInterfaces/LuaEntityConfig.cpp:846 EntityConfigEntity.md entities done +function EntityConfigEntity GetShadowSize repentogon/LuaInterfaces/LuaEntityConfig.cpp:839 EntityConfigEntity.md entities done +function EntityConfigEntity GetShieldStrength repentogon/LuaInterfaces/LuaEntityConfig.cpp:849 EntityConfigEntity.md entities done +function EntityConfigEntity GetStageHP repentogon/LuaInterfaces/LuaEntityConfig.cpp:834 EntityConfigEntity.md entities done +function EntityConfigEntity GetSubType repentogon/LuaInterfaces/LuaEntityConfig.cpp:824 EntityConfigEntity.md entities done +function EntityConfigEntity GetType repentogon/LuaInterfaces/LuaEntityConfig.cpp:822 EntityConfigEntity.md entities done +function EntityConfigEntity GetVariant repentogon/LuaInterfaces/LuaEntityConfig.cpp:823 EntityConfigEntity.md entities done +function EntityConfigEntity HasCustomTag repentogon/LuaInterfaces/LuaEntityConfig.cpp:858 EntityConfigEntity.md entities done +function EntityConfigEntity HasEntityTags repentogon/LuaInterfaces/LuaEntityConfig.cpp:838 EntityConfigEntity.md entities done +function EntityConfigEntity HasFloorAlts repentogon/LuaInterfaces/LuaEntityConfig.cpp:856 EntityConfigEntity.md entities done +function EntityConfigEntity HasGibFlags repentogon/LuaInterfaces/LuaEntityConfig.cpp:845 EntityConfigEntity.md entities done +function EntityConfigEntity IsBoss repentogon/LuaInterfaces/LuaEntityConfig.cpp:840 EntityConfigEntity.md entities done +function EntityConfigPlayer CanShoot repentogon/LuaInterfaces/LuaEntityConfig.cpp:888 EntityConfigPlayer.md player done +function EntityConfigPlayer GetAchievementID repentogon/LuaInterfaces/LuaEntityConfig.cpp:889 EntityConfigPlayer.md player done +function EntityConfigPlayer GetBirthrightDescription repentogon/LuaInterfaces/LuaEntityConfig.cpp:890 EntityConfigPlayer.md player done +function EntityConfigPlayer GetBlackHearts repentogon/LuaInterfaces/LuaEntityConfig.cpp:878 EntityConfigPlayer.md player done +function EntityConfigPlayer GetBombs repentogon/LuaInterfaces/LuaEntityConfig.cpp:881 EntityConfigPlayer.md player done +function EntityConfigPlayer GetBrokenHearts repentogon/LuaInterfaces/LuaEntityConfig.cpp:879 EntityConfigPlayer.md player done +function EntityConfigPlayer GetCard repentogon/LuaInterfaces/LuaEntityConfig.cpp:883 EntityConfigPlayer.md player done +function EntityConfigPlayer GetCoins repentogon/LuaInterfaces/LuaEntityConfig.cpp:880 EntityConfigPlayer.md player done +function EntityConfigPlayer GetCollectibles repentogon/LuaInterfaces/LuaEntityConfig.cpp:886 EntityConfigPlayer.md player done +function EntityConfigPlayer GetCostumeID repentogon/LuaInterfaces/LuaEntityConfig.cpp:874 EntityConfigPlayer.md player done +function EntityConfigPlayer GetCostumeSuffix repentogon/LuaInterfaces/LuaEntityConfig.cpp:873 EntityConfigPlayer.md player done +function EntityConfigPlayer GetExtraPortraitPath repentogon/LuaInterfaces/LuaEntityConfig.cpp:872 EntityConfigPlayer.md player done +function EntityConfigPlayer GetKeys repentogon/LuaInterfaces/LuaEntityConfig.cpp:882 EntityConfigPlayer.md player done +function EntityConfigPlayer GetModdedControlsSprite repentogon/LuaInterfaces/LuaEntityConfig.cpp:895 EntityConfigPlayer.md player done +function EntityConfigPlayer GetModdedCoopMenuSprite repentogon/LuaInterfaces/LuaEntityConfig.cpp:894 EntityConfigPlayer.md player done +function EntityConfigPlayer GetModdedGameOverSprite repentogon/LuaInterfaces/LuaEntityConfig.cpp:893 EntityConfigPlayer.md player done +function EntityConfigPlayer GetModdedMenuBackgroundSprite repentogon/LuaInterfaces/LuaEntityConfig.cpp:891 EntityConfigPlayer.md player done +function EntityConfigPlayer GetModdedMenuPortraitSprite repentogon/LuaInterfaces/LuaEntityConfig.cpp:892 EntityConfigPlayer.md player done +function EntityConfigPlayer GetName repentogon/LuaInterfaces/LuaEntityConfig.cpp:868 EntityConfigPlayer.md player done +function EntityConfigPlayer GetNameImagePath repentogon/LuaInterfaces/LuaEntityConfig.cpp:870 EntityConfigPlayer.md player done +function EntityConfigPlayer GetPill repentogon/LuaInterfaces/LuaEntityConfig.cpp:884 EntityConfigPlayer.md player done +function EntityConfigPlayer GetPlayerType repentogon/LuaInterfaces/LuaEntityConfig.cpp:867 EntityConfigPlayer.md player done +function EntityConfigPlayer GetPocketActive repentogon/LuaInterfaces/LuaEntityConfig.cpp:887 EntityConfigPlayer.md player done +function EntityConfigPlayer GetPortraitPath repentogon/LuaInterfaces/LuaEntityConfig.cpp:871 EntityConfigPlayer.md player done +function EntityConfigPlayer GetRedHearts repentogon/LuaInterfaces/LuaEntityConfig.cpp:876 EntityConfigPlayer.md player done +function EntityConfigPlayer GetSkinColor repentogon/LuaInterfaces/LuaEntityConfig.cpp:875 EntityConfigPlayer.md player done +function EntityConfigPlayer GetSkinPath repentogon/LuaInterfaces/LuaEntityConfig.cpp:869 EntityConfigPlayer.md player done +function EntityConfigPlayer GetSoulHearts repentogon/LuaInterfaces/LuaEntityConfig.cpp:877 EntityConfigPlayer.md player done +function EntityConfigPlayer GetTaintedCounterpart repentogon/LuaInterfaces/LuaEntityConfig.cpp:897 EntityConfigPlayer.md player done +function EntityConfigPlayer GetTrinket repentogon/LuaInterfaces/LuaEntityConfig.cpp:885 EntityConfigPlayer.md player done +function EntityConfigPlayer IsHidden repentogon/LuaInterfaces/LuaEntityConfig.cpp:898 EntityConfigPlayer.md player done +function EntityConfigPlayer IsTainted repentogon/LuaInterfaces/LuaEntityConfig.cpp:896 EntityConfigPlayer.md player done +function EntityDelirium GetTeleportationTimer repentogon/LuaInterfaces/LuaDelirium.cpp:283 EntityDelirium.md npc done +function EntityDelirium IsRedMode repentogon/LuaInterfaces/LuaDelirium.cpp:281 EntityDelirium.md npc done +function EntityDelirium SetRedMode repentogon/LuaInterfaces/LuaDelirium.cpp:282 EntityDelirium.md npc done +function EntityDelirium SetTeleportationTimer repentogon/LuaInterfaces/LuaDelirium.cpp:284 EntityDelirium.md npc done +function EntityDelirium Transform repentogon/LuaInterfaces/LuaDelirium.cpp:280 EntityDelirium.md npc done +function EntityDesc GetChampionId repentogon/LuaInterfaces/LuaEntityDesc.cpp:131 EntityDesc.md entities done +function EntityDesc GetHealth repentogon/LuaInterfaces/LuaEntityDesc.cpp:133 EntityDesc.md entities done +function EntityDesc GetMaxHealth repentogon/LuaInterfaces/LuaEntityDesc.cpp:135 EntityDesc.md entities done +function EntityDesc GetSubtype repentogon/LuaInterfaces/LuaEntityDesc.cpp:129 EntityDesc.md entities done +function EntityDesc GetType repentogon/LuaInterfaces/LuaEntityDesc.cpp:125 EntityDesc.md entities done +function EntityDesc GetVariant repentogon/LuaInterfaces/LuaEntityDesc.cpp:127 EntityDesc.md entities done +function EntityDesc IsPlayerControlled repentogon/LuaInterfaces/LuaEntityDesc.cpp:137 EntityDesc.md entities done +function EntityDesc SetChampionId repentogon/LuaInterfaces/LuaEntityDesc.cpp:132 EntityDesc.md entities done +function EntityDesc SetHealth repentogon/LuaInterfaces/LuaEntityDesc.cpp:134 EntityDesc.md entities done +function EntityDesc SetMaxHealth repentogon/LuaInterfaces/LuaEntityDesc.cpp:136 EntityDesc.md entities done +function EntityDesc SetPlayerControlled repentogon/LuaInterfaces/LuaEntityDesc.cpp:138 EntityDesc.md entities done +function EntityDesc SetSubtype repentogon/LuaInterfaces/LuaEntityDesc.cpp:130 EntityDesc.md entities done +function EntityDesc SetType repentogon/LuaInterfaces/LuaEntityDesc.cpp:126 EntityDesc.md entities done +function EntityDesc SetVariant repentogon/LuaInterfaces/LuaEntityDesc.cpp:128 EntityDesc.md entities done +function EntityEffect AddAquariusTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:137 entities done +function EntityEffect AddTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:131 EntityEffect.md entities done +function EntityEffect ClearAquariusTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:138 entities done +function EntityEffect ClearTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:132 EntityEffect.md entities done +function EntityEffect CreateLight repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:144 EntityEffect.md entities done +function EntityEffect CreateLootPreview repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:145 EntityEffect.md entities done +function EntityEffect GetAquariusTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:135 entities done +function EntityEffect GetGridEntityDesc repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:128 EntityEffect.md entities done +function EntityEffect GetTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:129 EntityEffect.md entities done +function EntityEffect HasAquariusTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:139 entities done +function EntityEffect HasTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:133 EntityEffect.md entities done +function EntityEffect SetAquariusTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:136 entities done +function EntityEffect SetTearFlags repentogon/LuaInterfaces/Entities/LuaEntityEffect.cpp:130 EntityEffect.md entities done +function EntityFamiliar CanBeDamagedByEnemies repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:281 EntityFamiliar.md familiar done +function EntityFamiliar CanBeDamagedByLasers repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:283 EntityFamiliar.md familiar done +function EntityFamiliar CanBeDamagedByProjectiles repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:282 EntityFamiliar.md familiar done +function EntityFamiliar CanBlockProjectiles repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:284 EntityFamiliar.md familiar done +function EntityFamiliar CanCharm repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:279 EntityFamiliar.md familiar done +function EntityFamiliar GetActiveWeaponEntity repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:293 EntityFamiliar.md familiar done +function EntityFamiliar GetActiveWeaponNumFired repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:294 EntityFamiliar.md familiar done +function EntityFamiliar GetDirtColor repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:277 EntityFamiliar.md familiar done +function EntityFamiliar GetFollowerPriority repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:271 EntityFamiliar.md familiar done +function EntityFamiliar GetItemConfig repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:287 EntityFamiliar.md familiar done +function EntityFamiliar GetMoveDelayNum repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:285 EntityFamiliar.md familiar done +function EntityFamiliar GetMultiplier repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:289 EntityFamiliar.md familiar done +function EntityFamiliar GetPathFinder repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:272 familiar done +function EntityFamiliar GetPathfinder repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:273 EntityFamiliar.md familiar done +function EntityFamiliar GetRandomWisp repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:292 EntityFamiliar.md familiar done +function EntityFamiliar GetWeapon repentogon/LuaInterfaces/LuaWeapon.cpp:203 EntityFamiliar.md familiar done +function EntityFamiliar InvalidateCachedMultiplier repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:288 EntityFamiliar.md familiar done +function EntityFamiliar IsCharmed repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:280 EntityFamiliar.md familiar done +function EntityFamiliar IsLilDelirium repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:290 EntityFamiliar.md familiar done +function EntityFamiliar RemoveFromPlayer repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:278 EntityFamiliar.md familiar done +function EntityFamiliar SetLilDelirium repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:291 EntityFamiliar.md familiar done +function EntityFamiliar SetMoveDelayNum repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:286 EntityFamiliar.md familiar done +function EntityFamiliar TriggerRoomClear repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:275 EntityFamiliar.md familiar done +function EntityFamiliar TryAimAtMarkedTarget repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:274 EntityFamiliar.md familiar done +function EntityFamiliar UpdateDirtColor repentogon/LuaInterfaces/Entities/LuaEntityFamiliar.cpp:276 EntityFamiliar.md familiar done +function EntityKnife AddToHitList repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:180 tear and weapons done +function EntityKnife FireSplitTear repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:176 EntityKnife.md tear and weapons done +function EntityKnife GetHitList repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:167 EntityKnife.md tear and weapons done +function EntityKnife GetHitboxParentKnife repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:177 EntityKnife.md tear and weapons done +function EntityKnife GetIsSpinAttack repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:170 EntityKnife.md tear and weapons done +function EntityKnife GetIsSwinging repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:168 EntityKnife.md tear and weapons done +function EntityKnife InHitList repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:181 tear and weapons done +function EntityKnife InitHomingPath repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:184 EntityKnife.md tear and weapons done +function EntityKnife IsMultidimensionalTouched repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:172 EntityKnife.md tear and weapons done +function EntityKnife IsPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:174 EntityKnife.md tear and weapons done +function EntityKnife RemoveFromHitList repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:179 tear and weapons done +function EntityKnife SetHitboxParentKnife repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:178 EntityKnife.md tear and weapons done +function EntityKnife SetIsSpinAttack repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:171 EntityKnife.md tear and weapons done +function EntityKnife SetIsSwinging repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:169 EntityKnife.md tear and weapons done +function EntityKnife SetKnifeDistance repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:182 EntityKnife.md tear and weapons done +function EntityKnife SetKnifeVelocity repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:183 EntityKnife.md tear and weapons done +function EntityKnife SetMultidimensionalTouched repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:173 EntityKnife.md tear and weapons done +function EntityKnife SetPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityKnife.cpp:175 EntityKnife.md tear and weapons done +function EntityLaser AddToHitList repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:262 tear and weapons done +function EntityLaser FireSplitTear repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:260 EntityLaser.md tear and weapons done +function EntityLaser GetDamageMultiplier repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:249 EntityLaser.md tear and weapons done +function EntityLaser GetDisableFollowParent repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:243 EntityLaser.md tear and weapons done +function EntityLaser GetHitList repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:245 EntityLaser.md tear and weapons done +function EntityLaser GetNumChainedLasers repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:264 EntityLaser.md tear and weapons done +function EntityLaser GetOneHit repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:246 EntityLaser.md tear and weapons done +function EntityLaser GetScale repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:247 EntityLaser.md tear and weapons done +function EntityLaser GetShrink repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:251 EntityLaser.md tear and weapons done +function EntityLaser GetTimeout repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:253 EntityLaser.md tear and weapons done +function EntityLaser InHitList repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:263 tear and weapons done +function EntityLaser IsMultidimensionalTouched repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:257 EntityLaser.md tear and weapons done +function EntityLaser IsPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:258 EntityLaser.md tear and weapons done +function EntityLaser RecalculateSamplesNextUpdate repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:256 EntityLaser.md tear and weapons done +function EntityLaser RemoveFromHitList repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:261 tear and weapons done +function EntityLaser ResetSpriteScale repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:254 EntityLaser.md tear and weapons done +function EntityLaser RotateToAngle repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:255 EntityLaser.md tear and weapons done +function EntityLaser SetDamageMultiplier repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:250 EntityLaser.md tear and weapons done +function EntityLaser SetDisableFollowParent repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:244 EntityLaser.md tear and weapons done +function EntityLaser SetInitSound repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:266 EntityLaser.md tear and weapons done +function EntityLaser SetNumChainedLasers repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:265 EntityLaser.md tear and weapons done +function EntityLaser SetPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:259 EntityLaser.md tear and weapons done +function EntityLaser SetScale repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:248 EntityLaser.md tear and weapons done +function EntityLaser SetShrink repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:252 EntityLaser.md tear and weapons done +function EntityLaser SetTimeout EntityLaser.md tear and weapons done docs only: no registration found +function EntityNPC ApplyTearflagEffects repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:458 EntityNPC.md npc done +function EntityNPC ClearFlyingOverride repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:457 EntityNPC.md npc done +function EntityNPC FireBossProjectilesEx repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:448 EntityNPC.md npc done +function EntityNPC FireGridEntity repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:446 EntityNPC.md npc done +function EntityNPC FireProjectilesEx repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:447 EntityNPC.md npc done +function EntityNPC GetBossColorIdx EntityNPC.md npc done docs only: no registration found +function EntityNPC GetControllerId repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:443 EntityNPC.md npc done +function EntityNPC GetDarkRedChampionRegenTimer repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:460 EntityNPC.md npc done +function EntityNPC GetDirtColor repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:442 EntityNPC.md npc done +function EntityNPC GetFireplaceLoot repentogon/LuaInterfaces/LuaLootList.cpp:111 EntityNPC.md npc done +function EntityNPC GetFlyingOverride repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:455 EntityNPC.md npc done +function EntityNPC GetHitList repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:449 EntityNPC.md npc done +function EntityNPC GetLootList repentogon/LuaInterfaces/LuaLootList.cpp:108 npc done +function EntityNPC GetPathfinder repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:464 EntityNPC.md npc done +function EntityNPC GetShieldStrength repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:450 EntityNPC.md npc done +function EntityNPC GetShopkeeperLoot repentogon/LuaInterfaces/LuaLootList.cpp:112 EntityNPC.md npc done +function EntityNPC GetSirenPlayerEntity repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:461 EntityNPC.md npc done +function EntityNPC IsBossColor repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:459 EntityNPC.md npc done +function EntityNPC PlaySound repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:438 EntityNPC.md npc done +function EntityNPC ReplaceSpritesheet repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:463 EntityNPC.md npc done +function EntityNPC SetControllerId repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:444 EntityNPC.md npc done +function EntityNPC SetFlyingOverride repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:456 EntityNPC.md npc done +function EntityNPC SetShieldStrength repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:451 EntityNPC.md npc done +function EntityNPC ShootMaggotProjectile repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:482 EntityNPC.md npc done +function EntityNPC SpawnBloodCloud repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:439 EntityNPC.md npc done function EntityNPC SpawnBloodSplash repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:440 EntityNPC.md npc todo -function EntityNPC ThrowLeech repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:485 EntityNPC.md npc todo -function EntityNPC ThrowMaggot repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:480 EntityNPC.md npc todo -function EntityNPC ThrowMaggotAtPos repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:481 EntityNPC.md npc todo -function EntityNPC ThrowRockSpider repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:484 EntityNPC.md npc todo -function EntityNPC ThrowStrider repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:483 EntityNPC.md npc todo -function EntityNPC TryForceTarget repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:445 EntityNPC.md npc todo -function EntityNPC TrySplit repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:462 EntityNPC.md npc todo -function EntityNPC TryThrow repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:454 EntityNPC.md npc todo -function EntityNPC UpdateDirtColor repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:441 EntityNPC.md npc todo -function EntityNPC UpdatePickupGhosts repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:465 npc todo -function EntityPickup AddCollectibleCycle repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:364 EntityPickup.md pickup todo -function EntityPickup CanJeraDuplicate repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:398 EntityPickup.md pickup todo -function EntityPickup CanReroll repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:365 EntityPickup.md pickup review -function EntityPickup ClearCanRerollOverride repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:397 EntityPickup.md pickup todo -function EntityPickup GetAlternatePedestal repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:381 EntityPickup.md pickup todo -function EntityPickup GetCanRerollOverride repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:395 EntityPickup.md pickup todo -function EntityPickup GetCollectibleCycle repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:382 EntityPickup.md pickup todo -function EntityPickup GetDropDelay repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:374 EntityPickup.md pickup todo -function EntityPickup GetFlipCollectible repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:391 EntityPickup.md pickup todo -function EntityPickup GetLootList repentogon/LuaInterfaces/LuaLootList.cpp:107 EntityPickup.md pickup todo -function EntityPickup GetMegaChestLeftCollectible repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:388 EntityPickup.md pickup todo -function EntityPickup GetMegaChestOtherCollectible repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:390 EntityPickup.md pickup todo -function EntityPickup GetMegaChestRightCollectible repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:389 EntityPickup.md pickup todo -function EntityPickup GetPickupGhost repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:385 EntityPickup.md pickup todo -function EntityPickup GetPriceSprite repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:380 EntityPickup.md pickup todo -function EntityPickup GetRandomPickupVelocity repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:376 EntityPickup.md pickup todo -function EntityPickup GetVarData repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:370 EntityPickup.md pickup todo -function EntityPickup HasFlipData repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:393 EntityPickup.md pickup todo -function EntityPickup InitFlipState repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:392 EntityPickup.md pickup todo -function EntityPickup IsBlind repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:366 EntityPickup.md pickup todo -function EntityPickup MakeShopItem repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:377 EntityPickup.md pickup todo -function EntityPickup ReloadGraphics repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:394 EntityPickup.md pickup todo -function EntityPickup RemoveCollectibleCycle repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:383 EntityPickup.md pickup todo -function EntityPickup SetAlternatePedestal repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:367 EntityPickup.md pickup todo -function EntityPickup SetCanRerollOverride repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:396 EntityPickup.md pickup todo -function EntityPickup SetDropDelay repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:375 EntityPickup.md pickup todo -function EntityPickup SetForceBlind repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:369 EntityPickup.md pickup todo -function EntityPickup SetNewOptionsPickupIndex repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:372 EntityPickup.md pickup todo -function EntityPickup SetVarData repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:371 EntityPickup.md pickup todo -function EntityPickup SetupCollectibleGraphics repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:405 EntityPickup.md pickup todo -function EntityPickup ShouldIgnoreModifiers repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:406 pickup todo -function EntityPickup TriggerTheresOptionsPickup repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:387 EntityPickup.md pickup todo -function EntityPickup TryFlip repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:379 EntityPickup.md pickup todo -function EntityPickup TryInitOptionCycle repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:373 EntityPickup.md pickup todo -function EntityPickup TryRemoveCollectible repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:368 EntityPickup.md pickup todo -function EntityPickup UpdatePickupGhosts repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:386 EntityPickup.md pickup todo -function EntityPlayer AddActiveCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3572 EntityPlayer.md player todo -function EntityPlayer AddBoneOrbital repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3713 EntityPlayer.md player todo -function EntityPlayer AddCacheFlags repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3559 EntityPlayer.md player review -function EntityPlayer AddCandyHeartBonus repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3822 EntityPlayer.md player todo -function EntityPlayer AddCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3554 player review -function EntityPlayer AddCollectibleEffect repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3776 EntityPlayer.md player todo +function EntityNPC ThrowLeech repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:485 EntityNPC.md npc done +function EntityNPC ThrowMaggot repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:480 EntityNPC.md npc done +function EntityNPC ThrowMaggotAtPos repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:481 EntityNPC.md npc done +function EntityNPC ThrowRockSpider repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:484 EntityNPC.md npc done +function EntityNPC ThrowStrider repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:483 EntityNPC.md npc done +function EntityNPC TryForceTarget repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:445 EntityNPC.md npc done +function EntityNPC TrySplit repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:462 EntityNPC.md npc done +function EntityNPC TryThrow repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:454 EntityNPC.md npc done +function EntityNPC UpdateDirtColor repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:441 EntityNPC.md npc done +function EntityNPC UpdatePickupGhosts repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:465 npc done +function EntityPickup AddCollectibleCycle repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:364 EntityPickup.md pickup done +function EntityPickup CanJeraDuplicate repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:398 EntityPickup.md pickup done +function EntityPickup CanReroll repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:365 EntityPickup.md pickup done +function EntityPickup ClearCanRerollOverride repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:397 EntityPickup.md pickup done +function EntityPickup GetAlternatePedestal repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:381 EntityPickup.md pickup done +function EntityPickup GetCanRerollOverride repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:395 EntityPickup.md pickup done +function EntityPickup GetCollectibleCycle repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:382 EntityPickup.md pickup done +function EntityPickup GetDropDelay repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:374 EntityPickup.md pickup done +function EntityPickup GetFlipCollectible repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:391 EntityPickup.md pickup done +function EntityPickup GetLootList repentogon/LuaInterfaces/LuaLootList.cpp:107 EntityPickup.md pickup done +function EntityPickup GetMegaChestLeftCollectible repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:388 EntityPickup.md pickup done +function EntityPickup GetMegaChestOtherCollectible repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:390 EntityPickup.md pickup done +function EntityPickup GetMegaChestRightCollectible repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:389 EntityPickup.md pickup done +function EntityPickup GetPickupGhost repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:385 EntityPickup.md pickup done +function EntityPickup GetPriceSprite repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:380 EntityPickup.md pickup done +function EntityPickup GetRandomPickupVelocity repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:376 EntityPickup.md pickup done +function EntityPickup GetVarData repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:370 EntityPickup.md pickup done +function EntityPickup HasFlipData repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:393 EntityPickup.md pickup done +function EntityPickup InitFlipState repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:392 EntityPickup.md pickup done +function EntityPickup IsBlind repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:366 EntityPickup.md pickup done +function EntityPickup MakeShopItem repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:377 EntityPickup.md pickup done +function EntityPickup ReloadGraphics repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:394 EntityPickup.md pickup done +function EntityPickup RemoveCollectibleCycle repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:383 EntityPickup.md pickup done +function EntityPickup SetAlternatePedestal repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:367 EntityPickup.md pickup done +function EntityPickup SetCanRerollOverride repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:396 EntityPickup.md pickup done +function EntityPickup SetDropDelay repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:375 EntityPickup.md pickup done +function EntityPickup SetForceBlind repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:369 EntityPickup.md pickup done +function EntityPickup SetNewOptionsPickupIndex repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:372 EntityPickup.md pickup done +function EntityPickup SetVarData repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:371 EntityPickup.md pickup done +function EntityPickup SetupCollectibleGraphics repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:405 EntityPickup.md pickup done +function EntityPickup ShouldIgnoreModifiers repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:406 pickup done +function EntityPickup TriggerTheresOptionsPickup repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:387 EntityPickup.md pickup done +function EntityPickup TryFlip repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:379 EntityPickup.md pickup done +function EntityPickup TryInitOptionCycle repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:373 EntityPickup.md pickup done +function EntityPickup TryRemoveCollectible repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:368 EntityPickup.md pickup done +function EntityPickup UpdatePickupGhosts repentogon/LuaInterfaces/Entities/LuaEntityPickup.cpp:386 EntityPickup.md pickup done +function EntityPlayer AddActiveCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3572 EntityPlayer.md player done +function EntityPlayer AddBoneOrbital repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3713 EntityPlayer.md player done +function EntityPlayer AddCacheFlags repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3559 EntityPlayer.md player done +function EntityPlayer AddCandyHeartBonus repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3822 EntityPlayer.md player done +function EntityPlayer AddCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3554 player done +function EntityPlayer AddCollectibleEffect repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3776 EntityPlayer.md player done function EntityPlayer AddCustomCacheTag repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3796 EntityPlayer.md player todo function EntityPlayer AddInnateCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3651 EntityPlayer.md player todo function EntityPlayer AddInnateTrinket repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3657 EntityPlayer.md player todo -function EntityPlayer AddLeprosy repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3715 EntityPlayer.md player todo -function EntityPlayer AddLocust repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3629 EntityPlayer.md player todo -function EntityPlayer AddNullCostume repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3794 player review -function EntityPlayer AddNullItemEffect repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3777 EntityPlayer.md player todo -function EntityPlayer AddSmeltedTrinket repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3697 EntityPlayer.md player todo -function EntityPlayer AddSoulLocketBonus repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3824 EntityPlayer.md player todo -function EntityPlayer AddTrinketEffect repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3784 EntityPlayer.md player todo -function EntityPlayer AddUrnSouls repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3717 EntityPlayer.md player todo +function EntityPlayer AddLeprosy repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3715 EntityPlayer.md player done +function EntityPlayer AddLocust repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3629 EntityPlayer.md player done +function EntityPlayer AddNullCostume repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3794 player done +function EntityPlayer AddNullItemEffect repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3777 EntityPlayer.md player done +function EntityPlayer AddSmeltedTrinket repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3697 EntityPlayer.md player done +function EntityPlayer AddSoulLocketBonus repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3824 EntityPlayer.md player done +function EntityPlayer AddTrinketEffect repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3784 EntityPlayer.md player done +function EntityPlayer AddUrnSouls repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3717 EntityPlayer.md player done function EntityPlayer BlockCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3778 EntityPlayer.md player todo function EntityPlayer BlockTrinket repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3781 EntityPlayer.md player todo -function EntityPlayer CalculateBagOfCraftingOutput repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3878 EntityPlayer.md player todo -function EntityPlayer CanAddCollectibleToInventory repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3718 EntityPlayer.md player todo -function EntityPlayer CanCrushRocks repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3719 EntityPlayer.md player todo -function EntityPlayer CanOverrideActiveItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3720 EntityPlayer.md player todo -function EntityPlayer CanUsePill repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3696 EntityPlayer.md player todo -function EntityPlayer CheckFamiliarEx repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3708 EntityPlayer.md player todo -function EntityPlayer ClearCollectibleAnim repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3706 EntityPlayer.md player todo -function EntityPlayer ClearDeadEyeCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3677 EntityPlayer.md player review +function EntityPlayer CalculateBagOfCraftingOutput repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3878 EntityPlayer.md player done +function EntityPlayer CanAddCollectibleToInventory repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3718 EntityPlayer.md player done +function EntityPlayer CanCrushRocks repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3719 EntityPlayer.md player done +function EntityPlayer CanOverrideActiveItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3720 EntityPlayer.md player done +function EntityPlayer CanUsePill repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3696 EntityPlayer.md player done +function EntityPlayer CheckFamiliarEx repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3708 EntityPlayer.md player done +function EntityPlayer ClearCollectibleAnim repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3706 EntityPlayer.md player done +function EntityPlayer ClearDeadEyeCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3677 EntityPlayer.md player done function EntityPlayer ClearInnateItemGroup repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3663 EntityPlayer.md player todo -function EntityPlayer ClearItemAnimCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3707 player todo -function EntityPlayer ClearQueueItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3772 EntityPlayer.md player todo -function EntityPlayer CreateAfterimage repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3834 EntityPlayer.md player todo -function EntityPlayer DischargeActiveItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3574 player review -function EntityPlayer DropCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3576 EntityPlayer.md player todo -function EntityPlayer DropCollectibleByHistoryIndex repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3577 EntityPlayer.md player todo -function EntityPlayer EnableWeaponType repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3611 EntityPlayer.md player todo -function EntityPlayer FireBrimstoneBall repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3722 EntityPlayer.md player todo -function EntityPlayer FullCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3573 player review -function EntityPlayer GetActionHoldDrop repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3805 EntityPlayer.md player todo -function EntityPlayer GetActiveCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3567 player review -function EntityPlayer GetActiveItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3566 player review -function EntityPlayer GetActiveItemDesc repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3586 EntityPlayer.md player todo -function EntityPlayer GetActiveItemSlot repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3587 EntityPlayer.md player todo -function EntityPlayer GetActiveMaxCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3563 EntityPlayer.md player todo -function EntityPlayer GetActiveMinUsableCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3564 EntityPlayer.md player todo -function EntityPlayer GetActiveSubCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3568 player review -function EntityPlayer GetActiveWeaponNumFired repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3685 EntityPlayer.md player todo -function EntityPlayer GetBagOfCraftingContent repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3589 EntityPlayer.md player todo -function EntityPlayer GetBagOfCraftingOutput repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3593 EntityPlayer.md player todo -function EntityPlayer GetBagOfCraftingOutputItemPool repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3594 player todo -function EntityPlayer GetBagOfCraftingSlot repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3592 EntityPlayer.md player todo -function EntityPlayer GetBatteryCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3569 player review -function EntityPlayer GetBladderCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3673 EntityPlayer.md player todo -function EntityPlayer GetBlinkLockTime repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3855 EntityPlayer.md player todo -function EntityPlayer GetBloodGushSprite repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3683 EntityPlayer.md player todo -function EntityPlayer GetBloodLustCounter repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3768 EntityPlayer.md player todo -function EntityPlayer GetBodyMoveDirection repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3723 EntityPlayer.md player todo -function EntityPlayer GetBodySprite repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3853 EntityPlayer.md player todo -function EntityPlayer GetBombPlaceDelay repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3770 EntityPlayer.md player todo -function EntityPlayer GetBombVariant repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3795 player review -function EntityPlayer GetCambionConceptionState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3667 EntityPlayer.md player todo -function EntityPlayer GetCambionPregnancyLevel repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3670 EntityPlayer.md player todo -function EntityPlayer GetCandyHeartBonus repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3821 EntityPlayer.md player todo -function EntityPlayer GetCharmOfTheVampireKills repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3836 EntityPlayer.md player todo -function EntityPlayer GetCollectibleNum repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3553 EntityPlayer.md player review -function EntityPlayer GetCollectiblesList repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3645 EntityPlayer.md player todo -function EntityPlayer GetConceptionFamiliarFlags repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3671 EntityPlayer.md player todo -function EntityPlayer GetCostumeLayerMap repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3700 EntityPlayer.md player todo -function EntityPlayer GetCostumeSpriteDescs repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:96 EntityPlayer.md player todo +function EntityPlayer ClearItemAnimCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3707 player done +function EntityPlayer ClearQueueItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3772 EntityPlayer.md player done +function EntityPlayer CreateAfterimage repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3834 EntityPlayer.md player done +function EntityPlayer DischargeActiveItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3574 player done +function EntityPlayer DropCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3576 EntityPlayer.md player done +function EntityPlayer DropCollectibleByHistoryIndex repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3577 EntityPlayer.md player done +function EntityPlayer EnableWeaponType repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3611 EntityPlayer.md player done +function EntityPlayer FireBrimstoneBall repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3722 EntityPlayer.md player done +function EntityPlayer FullCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3573 player done +function EntityPlayer GetActionHoldDrop repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3805 EntityPlayer.md player done +function EntityPlayer GetActiveCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3567 player done +function EntityPlayer GetActiveItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3566 player done +function EntityPlayer GetActiveItemDesc repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3586 EntityPlayer.md player done +function EntityPlayer GetActiveItemSlot repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3587 EntityPlayer.md player done +function EntityPlayer GetActiveMaxCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3563 EntityPlayer.md player done +function EntityPlayer GetActiveMinUsableCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3564 EntityPlayer.md player done +function EntityPlayer GetActiveSubCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3568 player done +function EntityPlayer GetActiveWeaponNumFired repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3685 EntityPlayer.md player done +function EntityPlayer GetBagOfCraftingContent repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3589 EntityPlayer.md player done +function EntityPlayer GetBagOfCraftingOutput repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3593 EntityPlayer.md player done +function EntityPlayer GetBagOfCraftingOutputItemPool repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3594 player done +function EntityPlayer GetBagOfCraftingSlot repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3592 EntityPlayer.md player done +function EntityPlayer GetBatteryCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3569 player done +function EntityPlayer GetBladderCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3673 EntityPlayer.md player done +function EntityPlayer GetBlinkLockTime repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3855 EntityPlayer.md player done +function EntityPlayer GetBloodGushSprite repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3683 EntityPlayer.md player done +function EntityPlayer GetBloodLustCounter repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3768 EntityPlayer.md player done +function EntityPlayer GetBodyMoveDirection repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3723 EntityPlayer.md player done +function EntityPlayer GetBodySprite repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3853 EntityPlayer.md player done +function EntityPlayer GetBombPlaceDelay repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3770 EntityPlayer.md player done +function EntityPlayer GetBombVariant repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3795 player done +function EntityPlayer GetCambionConceptionState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3667 EntityPlayer.md player done +function EntityPlayer GetCambionPregnancyLevel repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3670 EntityPlayer.md player done +function EntityPlayer GetCandyHeartBonus repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3821 EntityPlayer.md player done +function EntityPlayer GetCharmOfTheVampireKills repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3836 EntityPlayer.md player done +function EntityPlayer GetCollectibleNum repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3553 EntityPlayer.md player done +function EntityPlayer GetCollectiblesList repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3645 EntityPlayer.md player done +function EntityPlayer GetConceptionFamiliarFlags repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3671 EntityPlayer.md player done +function EntityPlayer GetCostumeLayerMap repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3700 EntityPlayer.md player done +function EntityPlayer GetCostumeSpriteDescs repentogon/LuaInterfaces/LuaCostumeSpriteDesc.cpp:96 EntityPlayer.md player done function EntityPlayer GetCustomCacheValue repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3797 EntityPlayer.md player todo -function EntityPlayer GetD8DamageModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3612 EntityPlayer.md player todo -function EntityPlayer GetD8FireDelayModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3618 EntityPlayer.md player todo -function EntityPlayer GetD8RangeModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3616 EntityPlayer.md player todo -function EntityPlayer GetD8SpeedModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3614 EntityPlayer.md player todo -function EntityPlayer GetDamageModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3601 EntityPlayer.md player todo -function EntityPlayer GetDeadEyeCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3581 EntityPlayer.md player todo -function EntityPlayer GetDeathAnimName repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3724 EntityPlayer.md player todo -function EntityPlayer GetDonateLuck repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3861 EntityPlayer.md player todo -function EntityPlayer GetEdenDamage repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3636 EntityPlayer.md player todo -function EntityPlayer GetEdenFireDelay repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3634 EntityPlayer.md player todo -function EntityPlayer GetEdenLuck repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3642 EntityPlayer.md player todo -function EntityPlayer GetEdenRange repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3638 EntityPlayer.md player todo -function EntityPlayer GetEdenShotSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3640 EntityPlayer.md player todo -function EntityPlayer GetEdenSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3632 EntityPlayer.md player todo -function EntityPlayer GetEnterPosition repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3725 EntityPlayer.md player todo -function EntityPlayer GetEntityConfigPlayer repentogon/LuaInterfaces/LuaEntityConfig.cpp:921 EntityPlayer.md player todo -function EntityPlayer GetEpiphoraCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3620 EntityPlayer.md player todo -function EntityPlayer GetErrorTrinketEffect repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3865 EntityPlayer.md player todo -function EntityPlayer GetEveSumptoriumCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3709 EntityPlayer.md player todo -function EntityPlayer GetFireDelayModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3599 EntityPlayer.md player todo -function EntityPlayer GetFlippedForm repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3688 EntityPlayer.md player todo -function EntityPlayer GetFocusEntity repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3727 EntityPlayer.md player todo -function EntityPlayer GetFootprintColor repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3728 EntityPlayer.md player todo -function EntityPlayer GetForgottenSwapFormCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3807 EntityPlayer.md player todo -function EntityPlayer GetGlitchBabySubType repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3730 EntityPlayer.md player todo -function EntityPlayer GetGlyphOfBalanceDrop repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3731 EntityPlayer.md player todo -function EntityPlayer GetGnawedLeafTimer repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3766 EntityPlayer.md player todo -function EntityPlayer GetGreedsGulletHearts repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3732 EntityPlayer.md player todo -function EntityPlayer GetHallowedGroundCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3790 EntityPlayer.md player todo -function EntityPlayer GetHeadDirectionLockTime repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3773 EntityPlayer.md player todo -function EntityPlayer GetHealthType repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3561 EntityPlayer.md player todo -function EntityPlayer GetHeldEntity repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3684 EntityPlayer.md player todo -function EntityPlayer GetHeldSprite repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3682 EntityPlayer.md player todo +function EntityPlayer GetD8DamageModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3612 EntityPlayer.md player done +function EntityPlayer GetD8FireDelayModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3618 EntityPlayer.md player done +function EntityPlayer GetD8RangeModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3616 EntityPlayer.md player done +function EntityPlayer GetD8SpeedModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3614 EntityPlayer.md player done +function EntityPlayer GetDamageModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3601 EntityPlayer.md player done +function EntityPlayer GetDeadEyeCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3581 EntityPlayer.md player done +function EntityPlayer GetDeathAnimName repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3724 EntityPlayer.md player done +function EntityPlayer GetDonateLuck repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3861 EntityPlayer.md player done +function EntityPlayer GetEdenDamage repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3636 EntityPlayer.md player done +function EntityPlayer GetEdenFireDelay repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3634 EntityPlayer.md player done +function EntityPlayer GetEdenLuck repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3642 EntityPlayer.md player done +function EntityPlayer GetEdenRange repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3638 EntityPlayer.md player done +function EntityPlayer GetEdenShotSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3640 EntityPlayer.md player done +function EntityPlayer GetEdenSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3632 EntityPlayer.md player done +function EntityPlayer GetEnterPosition repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3725 EntityPlayer.md player done +function EntityPlayer GetEntityConfigPlayer repentogon/LuaInterfaces/LuaEntityConfig.cpp:921 EntityPlayer.md player done +function EntityPlayer GetEpiphoraCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3620 EntityPlayer.md player done +function EntityPlayer GetErrorTrinketEffect repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3865 EntityPlayer.md player done +function EntityPlayer GetEveSumptoriumCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3709 EntityPlayer.md player done +function EntityPlayer GetFireDelayModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3599 EntityPlayer.md player done +function EntityPlayer GetFlippedForm repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3688 EntityPlayer.md player done +function EntityPlayer GetFocusEntity repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3727 EntityPlayer.md player done +function EntityPlayer GetFootprintColor repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3728 EntityPlayer.md player done +function EntityPlayer GetForgottenSwapFormCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3807 EntityPlayer.md player done +function EntityPlayer GetGlitchBabySubType repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3730 EntityPlayer.md player done +function EntityPlayer GetGlyphOfBalanceDrop repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3731 EntityPlayer.md player done +function EntityPlayer GetGnawedLeafTimer repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3766 EntityPlayer.md player done +function EntityPlayer GetGreedsGulletHearts repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3732 EntityPlayer.md player done +function EntityPlayer GetHallowedGroundCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3790 EntityPlayer.md player done +function EntityPlayer GetHeadDirectionLockTime repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3773 EntityPlayer.md player done +function EntityPlayer GetHealthType repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3561 EntityPlayer.md player done +function EntityPlayer GetHeldEntity repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3684 EntityPlayer.md player done +function EntityPlayer GetHeldSprite repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3682 EntityPlayer.md player done function EntityPlayer GetHistory repentogon/LuaInterfaces/LuaHistory.cpp:89 EntityPlayer.md player todo -function EntityPlayer GetImExcitedSpeedupCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3859 EntityPlayer.md player todo -function EntityPlayer GetImmaculateConceptionState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3665 EntityPlayer.md player todo +function EntityPlayer GetImExcitedSpeedupCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3859 EntityPlayer.md player done +function EntityPlayer GetImmaculateConceptionState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3665 EntityPlayer.md player done function EntityPlayer GetInnateCollectibleCount repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3653 EntityPlayer.md player todo function EntityPlayer GetInnateCollectibleGroup repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3655 EntityPlayer.md player todo function EntityPlayer GetInnateTrinketCount repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3659 EntityPlayer.md player todo function EntityPlayer GetInnateTrinketGroup repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3661 EntityPlayer.md player todo -function EntityPlayer GetInventoryCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3868 EntityPlayer.md player todo -function EntityPlayer GetInventoryHistoryIndex repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3867 EntityPlayer.md player todo -function EntityPlayer GetItemStateCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3857 EntityPlayer.md player todo -function EntityPlayer GetKeepersSackBonus repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3764 EntityPlayer.md player todo -function EntityPlayer GetLaserColor repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3733 EntityPlayer.md player todo -function EntityPlayer GetLuckModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3606 EntityPlayer.md player todo -function EntityPlayer GetMaggyHealthDrainCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3838 EntityPlayer.md player todo -function EntityPlayer GetMaggySwingCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3693 EntityPlayer.md player todo -function EntityPlayer GetMarkedTarget repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3624 EntityPlayer.md player todo -function EntityPlayer GetMawOfTheVoidCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3849 EntityPlayer.md player todo -function EntityPlayer GetMaxBladderCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3675 EntityPlayer.md player todo -function EntityPlayer GetMaxBombs repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3802 EntityPlayer.md player todo -function EntityPlayer GetMaxCoins repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3800 EntityPlayer.md player todo -function EntityPlayer GetMaxInventorySize repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3866 EntityPlayer.md player todo -function EntityPlayer GetMaxKeys repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3801 EntityPlayer.md player todo -function EntityPlayer GetMaxPeeBurstCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3622 EntityPlayer.md player todo -function EntityPlayer GetMaxPocketItems repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3712 EntityPlayer.md player review -function EntityPlayer GetMegaBlastDuration repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3584 EntityPlayer.md player todo -function EntityPlayer GetMetronomeCollectibleID repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3623 EntityPlayer.md player todo -function EntityPlayer GetMontezumaRevengeCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3851 EntityPlayer.md player todo -function EntityPlayer GetMovingBoxContents repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3596 EntityPlayer.md player todo +function EntityPlayer GetInventoryCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3868 EntityPlayer.md player done +function EntityPlayer GetInventoryHistoryIndex repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3867 EntityPlayer.md player done +function EntityPlayer GetItemStateCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3857 EntityPlayer.md player done +function EntityPlayer GetKeepersSackBonus repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3764 EntityPlayer.md player done +function EntityPlayer GetLaserColor repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3733 EntityPlayer.md player done +function EntityPlayer GetLuckModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3606 EntityPlayer.md player done +function EntityPlayer GetMaggyHealthDrainCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3838 EntityPlayer.md player done +function EntityPlayer GetMaggySwingCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3693 EntityPlayer.md player done +function EntityPlayer GetMarkedTarget repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3624 EntityPlayer.md player done +function EntityPlayer GetMawOfTheVoidCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3849 EntityPlayer.md player done +function EntityPlayer GetMaxBladderCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3675 EntityPlayer.md player done +function EntityPlayer GetMaxBombs repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3802 EntityPlayer.md player done +function EntityPlayer GetMaxCoins repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3800 EntityPlayer.md player done +function EntityPlayer GetMaxInventorySize repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3866 EntityPlayer.md player done +function EntityPlayer GetMaxKeys repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3801 EntityPlayer.md player done +function EntityPlayer GetMaxPeeBurstCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3622 EntityPlayer.md player done +function EntityPlayer GetMaxPocketItems repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3712 EntityPlayer.md player done +function EntityPlayer GetMegaBlastDuration repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3584 EntityPlayer.md player done +function EntityPlayer GetMetronomeCollectibleID repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3623 EntityPlayer.md player done +function EntityPlayer GetMontezumaRevengeCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3851 EntityPlayer.md player done +function EntityPlayer GetMovingBoxContents repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3596 EntityPlayer.md player done function EntityPlayer GetMultiShotParams repentogon/LuaInterfaces/LuaMultiShotParams.cpp:211 EntityPlayer.md player review function EntityPlayer GetMultiShotPositionVelocity repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3555 EntityPlayer.md player review -function EntityPlayer GetNextUrethraBlockFrame repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3680 EntityPlayer.md player todo -function EntityPlayer GetPeeBurstCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3621 EntityPlayer.md player todo -function EntityPlayer GetPlanCKillCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3845 EntityPlayer.md player todo -function EntityPlayer GetPlayerFormCounter repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3711 EntityPlayer.md player todo -function EntityPlayer GetPlayerHUD repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3825 EntityPlayer.md player todo -function EntityPlayer GetPlayerIndex repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3785 EntityPlayer.md player todo +function EntityPlayer GetNextUrethraBlockFrame repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3680 EntityPlayer.md player done +function EntityPlayer GetPeeBurstCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3621 EntityPlayer.md player done +function EntityPlayer GetPlanCKillCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3845 EntityPlayer.md player done +function EntityPlayer GetPlayerFormCounter repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3711 EntityPlayer.md player done +function EntityPlayer GetPlayerHUD repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3825 EntityPlayer.md player done +function EntityPlayer GetPlayerIndex repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3785 EntityPlayer.md player done function EntityPlayer GetPocketItem repentogon/LuaInterfaces/LuaPocketItem.cpp:27 EntityPlayer.md player review -function EntityPlayer GetPonyCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3630 EntityPlayer.md player todo -function EntityPlayer GetPotatoPeelerUses repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3847 EntityPlayer.md player todo -function EntityPlayer GetPurityState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3647 EntityPlayer.md player todo -function EntityPlayer GetRUAWizardTimer repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3863 EntityPlayer.md player todo -function EntityPlayer GetRedStewBonusDuration repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3608 EntityPlayer.md player todo -function EntityPlayer GetRevelationCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3691 EntityPlayer.md player todo -function EntityPlayer GetRockBottomDamage repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3813 EntityPlayer.md player todo -function EntityPlayer GetRockBottomLuck repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3819 EntityPlayer.md player todo -function EntityPlayer GetRockBottomMaxFireDelay repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3811 EntityPlayer.md player todo -function EntityPlayer GetRockBottomMoveSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3809 EntityPlayer.md player todo -function EntityPlayer GetRockBottomShotSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3817 EntityPlayer.md player todo -function EntityPlayer GetRockBottomTearRange repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3815 EntityPlayer.md player todo -function EntityPlayer GetShotSpeedModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3604 EntityPlayer.md player todo -function EntityPlayer GetSmeltedTrinketDesc repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3699 EntityPlayer.md player todo -function EntityPlayer GetSmeltedTrinkets repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3698 EntityPlayer.md player todo -function EntityPlayer GetSoulLocketBonus repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3823 EntityPlayer.md player todo -function EntityPlayer GetSpecialGridCollision repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3737 EntityPlayer.md player todo -function EntityPlayer GetSpeedModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3597 EntityPlayer.md player todo +function EntityPlayer GetPonyCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3630 EntityPlayer.md player done +function EntityPlayer GetPotatoPeelerUses repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3847 EntityPlayer.md player done +function EntityPlayer GetPurityState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3647 EntityPlayer.md player done +function EntityPlayer GetRUAWizardTimer repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3863 EntityPlayer.md player done +function EntityPlayer GetRedStewBonusDuration repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3608 EntityPlayer.md player done +function EntityPlayer GetRevelationCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3691 EntityPlayer.md player done +function EntityPlayer GetRockBottomDamage repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3813 EntityPlayer.md player done +function EntityPlayer GetRockBottomLuck repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3819 EntityPlayer.md player done +function EntityPlayer GetRockBottomMaxFireDelay repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3811 EntityPlayer.md player done +function EntityPlayer GetRockBottomMoveSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3809 EntityPlayer.md player done +function EntityPlayer GetRockBottomShotSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3817 EntityPlayer.md player done +function EntityPlayer GetRockBottomTearRange repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3815 EntityPlayer.md player done +function EntityPlayer GetShotSpeedModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3604 EntityPlayer.md player done +function EntityPlayer GetSmeltedTrinketDesc repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3699 EntityPlayer.md player done +function EntityPlayer GetSmeltedTrinkets repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3698 EntityPlayer.md player done +function EntityPlayer GetSoulLocketBonus repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3823 EntityPlayer.md player done +function EntityPlayer GetSpecialGridCollision repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3737 EntityPlayer.md player done +function EntityPlayer GetSpeedModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3597 EntityPlayer.md player done function EntityPlayer GetSpoofedCollectiblesList repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3786 EntityPlayer.md player todo function EntityPlayer GetStatMultiplier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3799 EntityPlayer.md player todo -function EntityPlayer GetSuplexAimCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3828 EntityPlayer.md player todo -function EntityPlayer GetSuplexLandPosition repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3832 EntityPlayer.md player todo -function EntityPlayer GetSuplexState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3826 EntityPlayer.md player todo -function EntityPlayer GetSuplexTargetPosition repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3830 EntityPlayer.md player todo -function EntityPlayer GetTearDisplacement repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3803 EntityPlayer.md player todo -function EntityPlayer GetTearRangeModifier EntityPlayer.md player review docs only: no registration found +function EntityPlayer GetSuplexAimCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3828 EntityPlayer.md player done +function EntityPlayer GetSuplexLandPosition repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3832 EntityPlayer.md player done +function EntityPlayer GetSuplexState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3826 EntityPlayer.md player done +function EntityPlayer GetSuplexTargetPosition repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3830 EntityPlayer.md player done +function EntityPlayer GetTearDisplacement repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3803 EntityPlayer.md player done +function EntityPlayer GetTearRangeModifier EntityPlayer.md player done docs only: no registration found function EntityPlayer GetTearsCap repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3798 EntityPlayer.md player todo -function EntityPlayer GetTotalActiveCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3562 EntityPlayer.md player todo -function EntityPlayer GetTrinketMultiplier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3789 player review -function EntityPlayer GetUrnSouls repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3716 EntityPlayer.md player todo -function EntityPlayer GetVoidedCollectiblesList repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3650 EntityPlayer.md player todo -function EntityPlayer GetWeapon repentogon/LuaInterfaces/LuaWeapon.cpp:202 EntityPlayer.md player todo -function EntityPlayer GetWeaponModifiers repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3610 EntityPlayer.md player todo -function EntityPlayer GetWildCardItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3626 EntityPlayer.md player todo -function EntityPlayer GetWildCardItemType repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3627 EntityPlayer.md player todo -function EntityPlayer GetWispCollectiblesList repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3664 EntityPlayer.md player todo -function EntityPlayer HasCamoEffect repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3844 EntityPlayer.md player todo -function EntityPlayer HasChanceRevive repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3792 EntityPlayer.md player todo -function EntityPlayer HasCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3552 EntityPlayer.md player review -function EntityPlayer HasForcedCamoEffect repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3842 EntityPlayer.md player todo -function EntityPlayer HasGoldenTrinket repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3787 EntityPlayer.md player todo -function EntityPlayer HasInstantDeathCurse repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3738 EntityPlayer.md player todo -function EntityPlayer HasInvincibility repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3835 player review -function EntityPlayer HasPoisonImmunity repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3739 EntityPlayer.md player todo -function EntityPlayer HasTrinket repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3788 player review -function EntityPlayer IncrementPlayerFormCounter repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3578 EntityPlayer.md player todo -function EntityPlayer InitPostLevelInitStats repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3557 EntityPlayer.md player todo -function EntityPlayer InitTwin repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3556 EntityPlayer.md player todo -function EntityPlayer IsCollectibleAnimFinished repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3705 EntityPlayer.md player todo +function EntityPlayer GetTotalActiveCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3562 EntityPlayer.md player done +function EntityPlayer GetTrinketMultiplier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3789 player done +function EntityPlayer GetUrnSouls repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3716 EntityPlayer.md player done +function EntityPlayer GetVoidedCollectiblesList repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3650 EntityPlayer.md player done +function EntityPlayer GetWeapon repentogon/LuaInterfaces/LuaWeapon.cpp:202 EntityPlayer.md player done +function EntityPlayer GetWeaponModifiers repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3610 EntityPlayer.md player done +function EntityPlayer GetWildCardItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3626 EntityPlayer.md player done +function EntityPlayer GetWildCardItemType repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3627 EntityPlayer.md player done +function EntityPlayer GetWispCollectiblesList repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3664 EntityPlayer.md player done +function EntityPlayer HasCamoEffect repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3844 EntityPlayer.md player done +function EntityPlayer HasChanceRevive repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3792 EntityPlayer.md player done +function EntityPlayer HasCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3552 EntityPlayer.md player done +function EntityPlayer HasForcedCamoEffect repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3842 EntityPlayer.md player done +function EntityPlayer HasGoldenTrinket repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3787 EntityPlayer.md player done +function EntityPlayer HasInstantDeathCurse repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3738 EntityPlayer.md player done +function EntityPlayer HasInvincibility repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3835 player done +function EntityPlayer HasPoisonImmunity repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3739 EntityPlayer.md player done +function EntityPlayer HasTrinket repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3788 player done +function EntityPlayer IncrementPlayerFormCounter repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3578 EntityPlayer.md player done +function EntityPlayer InitPostLevelInitStats repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3557 EntityPlayer.md player done +function EntityPlayer InitTwin repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3556 EntityPlayer.md player done +function EntityPlayer IsCollectibleAnimFinished repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3705 EntityPlayer.md player done function EntityPlayer IsCollectibleBlocked repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3780 EntityPlayer.md player todo -function EntityPlayer IsCollectibleCostumeVisible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3702 EntityPlayer.md player todo -function EntityPlayer IsEntityValidTarget repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3740 EntityPlayer.md player todo -function EntityPlayer IsFootstepFrame repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3741 EntityPlayer.md player todo -function EntityPlayer IsHeadless repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3742 EntityPlayer.md player todo -function EntityPlayer IsHologram repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3743 EntityPlayer.md player todo -function EntityPlayer IsInvisible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3744 EntityPlayer.md player todo -function EntityPlayer IsItemCostumeVisible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3701 EntityPlayer.md player todo -function EntityPlayer IsLocalPlayer repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3625 EntityPlayer.md player todo -function EntityPlayer IsNullItemCostumeVisible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3703 EntityPlayer.md player todo -function EntityPlayer IsPacifist repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3745 player todo -function EntityPlayer IsPostLevelInitFinished repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3840 EntityPlayer.md player todo +function EntityPlayer IsCollectibleCostumeVisible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3702 EntityPlayer.md player done +function EntityPlayer IsEntityValidTarget repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3740 EntityPlayer.md player done +function EntityPlayer IsFootstepFrame repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3741 EntityPlayer.md player done +function EntityPlayer IsHeadless repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3742 EntityPlayer.md player done +function EntityPlayer IsHologram repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3743 EntityPlayer.md player done +function EntityPlayer IsInvisible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3744 EntityPlayer.md player done +function EntityPlayer IsItemCostumeVisible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3701 EntityPlayer.md player done +function EntityPlayer IsLocalPlayer repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3625 EntityPlayer.md player done +function EntityPlayer IsNullItemCostumeVisible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3703 EntityPlayer.md player done +function EntityPlayer IsPacifist repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3745 player done +function EntityPlayer IsPostLevelInitFinished repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3840 EntityPlayer.md player done function EntityPlayer IsTrinketBlocked repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3783 EntityPlayer.md player todo -function EntityPlayer IsUrethraBlocked repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3678 EntityPlayer.md player todo -function EntityPlayer MorphToCoopGhost repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3746 EntityPlayer.md player todo -function EntityPlayer NeedsCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3570 player review -function EntityPlayer PlayCollectibleAnim repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3704 EntityPlayer.md player todo -function EntityPlayer PlayDelayedSFX repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3695 EntityPlayer.md player todo +function EntityPlayer IsUrethraBlocked repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3678 EntityPlayer.md player done +function EntityPlayer MorphToCoopGhost repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3746 EntityPlayer.md player done +function EntityPlayer NeedsCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3570 player done +function EntityPlayer PlayCollectibleAnim repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3704 EntityPlayer.md player done +function EntityPlayer PlayDelayedSFX repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3695 EntityPlayer.md player done function EntityPlayer PlayItemNullAnimation repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3854 EntityPlayer.md player todo -function EntityPlayer RemoveCollectibleByHistoryIndex repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3582 EntityPlayer.md player todo +function EntityPlayer RemoveCollectibleByHistoryIndex repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3582 EntityPlayer.md player done function EntityPlayer RemoveInnateCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3652 EntityPlayer.md player todo function EntityPlayer RemoveInnateTrinket repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3658 EntityPlayer.md player todo -function EntityPlayer RemovePocketItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3747 EntityPlayer.md player todo -function EntityPlayer RemovePoopSpell repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3687 EntityPlayer.md player todo -function EntityPlayer RerollAllCollectibles repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3748 EntityPlayer.md player todo -function EntityPlayer ResetPlayer repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3749 EntityPlayer.md player todo -function EntityPlayer ReviveCoopGhost repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3750 EntityPlayer.md player todo -function EntityPlayer SalvageCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3751 EntityPlayer.md player todo -function EntityPlayer SetActionHoldDrop repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3806 EntityPlayer.md player todo -function EntityPlayer SetActiveCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3571 player review -function EntityPlayer SetActiveVarData repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3565 EntityPlayer.md player todo -function EntityPlayer SetBagOfCraftingContent repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3590 EntityPlayer.md player todo -function EntityPlayer SetBagOfCraftingOutput repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3595 EntityPlayer.md player todo -function EntityPlayer SetBagOfCraftingSlot repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3591 EntityPlayer.md player todo -function EntityPlayer SetBlackHeart repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3793 EntityPlayer.md player todo -function EntityPlayer SetBladderCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3674 EntityPlayer.md player todo -function EntityPlayer SetBlinkLockTime repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3856 EntityPlayer.md player todo -function EntityPlayer SetBloodLustCounter repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3769 EntityPlayer.md player todo -function EntityPlayer SetBombPlaceDelay repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3771 EntityPlayer.md player todo -function EntityPlayer SetCambionConceptionState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3668 EntityPlayer.md player todo -function EntityPlayer SetCanShoot repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3580 EntityPlayer.md player todo -function EntityPlayer SetCharmOfTheVampireKills repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3837 EntityPlayer.md player todo -function EntityPlayer SetConceptionFamiliarFlags repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3672 EntityPlayer.md player todo -function EntityPlayer SetControllerIndex repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3752 EntityPlayer.md player todo -function EntityPlayer SetD8DamageModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3613 EntityPlayer.md player todo -function EntityPlayer SetD8FireDelayModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3619 EntityPlayer.md player todo -function EntityPlayer SetD8RangeModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3617 EntityPlayer.md player todo -function EntityPlayer SetD8SpeedModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3615 EntityPlayer.md player todo -function EntityPlayer SetDamageModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3602 EntityPlayer.md player todo -function EntityPlayer SetDonateLuck repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3862 EntityPlayer.md player todo -function EntityPlayer SetEdenDamage repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3637 EntityPlayer.md player todo -function EntityPlayer SetEdenFireDelay repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3635 EntityPlayer.md player todo -function EntityPlayer SetEdenLuck repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3643 EntityPlayer.md player todo -function EntityPlayer SetEdenRange repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3639 EntityPlayer.md player todo -function EntityPlayer SetEdenShotSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3641 EntityPlayer.md player todo -function EntityPlayer SetEdenSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3633 EntityPlayer.md player todo -function EntityPlayer SetEveSumptoriumCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3710 EntityPlayer.md player todo -function EntityPlayer SetFireDelayModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3600 EntityPlayer.md player todo -function EntityPlayer SetFootprintColor repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3729 EntityPlayer.md player todo -function EntityPlayer SetForceCamoEffect repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3843 EntityPlayer.md player todo -function EntityPlayer SetForgottenSwapFormCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3808 EntityPlayer.md player todo -function EntityPlayer SetGnawedLeafTimer repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3767 EntityPlayer.md player todo -function EntityPlayer SetHallowedGroundCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3791 EntityPlayer.md player todo -function EntityPlayer SetHeadDirection repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3775 EntityPlayer.md player todo -function EntityPlayer SetHeadDirectionLockTime repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3774 EntityPlayer.md player todo -function EntityPlayer SetImExcitedSpeedupCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3860 EntityPlayer.md player todo -function EntityPlayer SetImmaculateConceptionState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3666 EntityPlayer.md player todo +function EntityPlayer RemovePocketItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3747 EntityPlayer.md player done +function EntityPlayer RemovePoopSpell repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3687 EntityPlayer.md player done +function EntityPlayer RerollAllCollectibles repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3748 EntityPlayer.md player done +function EntityPlayer ResetPlayer repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3749 EntityPlayer.md player done +function EntityPlayer ReviveCoopGhost repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3750 EntityPlayer.md player done +function EntityPlayer SalvageCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3751 EntityPlayer.md player done +function EntityPlayer SetActionHoldDrop repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3806 EntityPlayer.md player done +function EntityPlayer SetActiveCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3571 player done +function EntityPlayer SetActiveVarData repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3565 EntityPlayer.md player done +function EntityPlayer SetBagOfCraftingContent repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3590 EntityPlayer.md player done +function EntityPlayer SetBagOfCraftingOutput repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3595 EntityPlayer.md player done +function EntityPlayer SetBagOfCraftingSlot repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3591 EntityPlayer.md player done +function EntityPlayer SetBlackHeart repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3793 EntityPlayer.md player done +function EntityPlayer SetBladderCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3674 EntityPlayer.md player done +function EntityPlayer SetBlinkLockTime repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3856 EntityPlayer.md player done +function EntityPlayer SetBloodLustCounter repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3769 EntityPlayer.md player done +function EntityPlayer SetBombPlaceDelay repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3771 EntityPlayer.md player done +function EntityPlayer SetCambionConceptionState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3668 EntityPlayer.md player done +function EntityPlayer SetCanShoot repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3580 EntityPlayer.md player done +function EntityPlayer SetCharmOfTheVampireKills repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3837 EntityPlayer.md player done +function EntityPlayer SetConceptionFamiliarFlags repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3672 EntityPlayer.md player done +function EntityPlayer SetControllerIndex repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3752 EntityPlayer.md player done +function EntityPlayer SetD8DamageModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3613 EntityPlayer.md player done +function EntityPlayer SetD8FireDelayModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3619 EntityPlayer.md player done +function EntityPlayer SetD8RangeModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3617 EntityPlayer.md player done +function EntityPlayer SetD8SpeedModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3615 EntityPlayer.md player done +function EntityPlayer SetDamageModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3602 EntityPlayer.md player done +function EntityPlayer SetDonateLuck repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3862 EntityPlayer.md player done +function EntityPlayer SetEdenDamage repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3637 EntityPlayer.md player done +function EntityPlayer SetEdenFireDelay repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3635 EntityPlayer.md player done +function EntityPlayer SetEdenLuck repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3643 EntityPlayer.md player done +function EntityPlayer SetEdenRange repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3639 EntityPlayer.md player done +function EntityPlayer SetEdenShotSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3641 EntityPlayer.md player done +function EntityPlayer SetEdenSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3633 EntityPlayer.md player done +function EntityPlayer SetEveSumptoriumCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3710 EntityPlayer.md player done +function EntityPlayer SetFireDelayModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3600 EntityPlayer.md player done +function EntityPlayer SetFootprintColor repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3729 EntityPlayer.md player done +function EntityPlayer SetForceCamoEffect repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3843 EntityPlayer.md player done +function EntityPlayer SetForgottenSwapFormCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3808 EntityPlayer.md player done +function EntityPlayer SetGnawedLeafTimer repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3767 EntityPlayer.md player done +function EntityPlayer SetHallowedGroundCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3791 EntityPlayer.md player done +function EntityPlayer SetHeadDirection repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3775 EntityPlayer.md player done +function EntityPlayer SetHeadDirectionLockTime repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3774 EntityPlayer.md player done +function EntityPlayer SetImExcitedSpeedupCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3860 EntityPlayer.md player done +function EntityPlayer SetImmaculateConceptionState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3666 EntityPlayer.md player done function EntityPlayer SetInnateCollectibleCount repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3654 EntityPlayer.md player todo function EntityPlayer SetInnateCollectibleGroup repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3656 EntityPlayer.md player todo function EntityPlayer SetInnateTrinketCount repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3660 EntityPlayer.md player todo function EntityPlayer SetInnateTrinketGroup repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3662 EntityPlayer.md player todo -function EntityPlayer SetItemState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3558 EntityPlayer.md player todo -function EntityPlayer SetItemStateCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3858 EntityPlayer.md player todo -function EntityPlayer SetKeepersSackBonus repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3765 EntityPlayer.md player todo -function EntityPlayer SetLaserColor repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3734 EntityPlayer.md player todo -function EntityPlayer SetLuckModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3607 EntityPlayer.md player todo -function EntityPlayer SetMaggyHealthDrainCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3839 EntityPlayer.md player todo -function EntityPlayer SetMaggySwingCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3694 EntityPlayer.md player todo -function EntityPlayer SetMawOfTheVoidCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3850 EntityPlayer.md player todo -function EntityPlayer SetMaxBladderCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3676 EntityPlayer.md player todo -function EntityPlayer SetMegaBlastDuration repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3585 EntityPlayer.md player todo -function EntityPlayer SetMontezumaRevengeCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3852 EntityPlayer.md player todo -function EntityPlayer SetNextUrethraBlockFrame repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3681 EntityPlayer.md player todo -function EntityPlayer SetPlanCKillCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3846 EntityPlayer.md player todo -function EntityPlayer SetPocketActiveItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3575 player review -function EntityPlayer SetPonyCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3631 EntityPlayer.md player todo -function EntityPlayer SetPoopSpell repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3686 EntityPlayer.md player todo -function EntityPlayer SetPotatoPeelerUses repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3848 EntityPlayer.md player todo -function EntityPlayer SetPurityState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3648 EntityPlayer.md player todo -function EntityPlayer SetRUAWizardTimer repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3864 EntityPlayer.md player todo -function EntityPlayer SetRedStewBonusDuration repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3609 EntityPlayer.md player todo -function EntityPlayer SetRevelationCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3692 EntityPlayer.md player todo -function EntityPlayer SetRockBottomDamage repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3814 EntityPlayer.md player todo -function EntityPlayer SetRockBottomLuck repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3820 EntityPlayer.md player todo -function EntityPlayer SetRockBottomMaxFireDelay repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3812 EntityPlayer.md player todo -function EntityPlayer SetRockBottomMoveSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3810 EntityPlayer.md player todo -function EntityPlayer SetRockBottomShotSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3818 EntityPlayer.md player todo -function EntityPlayer SetRockBottomTearRange repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3816 EntityPlayer.md player todo -function EntityPlayer SetShotSpeedModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3605 EntityPlayer.md player todo -function EntityPlayer SetSpeedModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3598 EntityPlayer.md player todo -function EntityPlayer SetSuplexAimCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3829 EntityPlayer.md player todo -function EntityPlayer SetSuplexLandPosition repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3833 EntityPlayer.md player todo -function EntityPlayer SetSuplexState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3827 EntityPlayer.md player todo -function EntityPlayer SetSuplexTargetPosition repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3831 EntityPlayer.md player todo -function EntityPlayer SetTearDisplacement repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3804 EntityPlayer.md player todo -function EntityPlayer SetTearPoisonDamage repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3649 EntityPlayer.md player todo -function EntityPlayer SetTearRangeModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3603 EntityPlayer.md player todo -function EntityPlayer SetUrethraBlock repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3679 EntityPlayer.md player todo +function EntityPlayer SetItemState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3558 EntityPlayer.md player done +function EntityPlayer SetItemStateCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3858 EntityPlayer.md player done +function EntityPlayer SetKeepersSackBonus repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3765 EntityPlayer.md player done +function EntityPlayer SetLaserColor repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3734 EntityPlayer.md player done +function EntityPlayer SetLuckModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3607 EntityPlayer.md player done +function EntityPlayer SetMaggyHealthDrainCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3839 EntityPlayer.md player done +function EntityPlayer SetMaggySwingCooldown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3694 EntityPlayer.md player done +function EntityPlayer SetMawOfTheVoidCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3850 EntityPlayer.md player done +function EntityPlayer SetMaxBladderCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3676 EntityPlayer.md player done +function EntityPlayer SetMegaBlastDuration repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3585 EntityPlayer.md player done +function EntityPlayer SetMontezumaRevengeCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3852 EntityPlayer.md player done +function EntityPlayer SetNextUrethraBlockFrame repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3681 EntityPlayer.md player done +function EntityPlayer SetPlanCKillCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3846 EntityPlayer.md player done +function EntityPlayer SetPocketActiveItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3575 player done +function EntityPlayer SetPonyCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3631 EntityPlayer.md player done +function EntityPlayer SetPoopSpell repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3686 EntityPlayer.md player done +function EntityPlayer SetPotatoPeelerUses repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3848 EntityPlayer.md player done +function EntityPlayer SetPurityState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3648 EntityPlayer.md player done +function EntityPlayer SetRUAWizardTimer repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3864 EntityPlayer.md player done +function EntityPlayer SetRedStewBonusDuration repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3609 EntityPlayer.md player done +function EntityPlayer SetRevelationCharge repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3692 EntityPlayer.md player done +function EntityPlayer SetRockBottomDamage repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3814 EntityPlayer.md player done +function EntityPlayer SetRockBottomLuck repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3820 EntityPlayer.md player done +function EntityPlayer SetRockBottomMaxFireDelay repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3812 EntityPlayer.md player done +function EntityPlayer SetRockBottomMoveSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3810 EntityPlayer.md player done +function EntityPlayer SetRockBottomShotSpeed repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3818 EntityPlayer.md player done +function EntityPlayer SetRockBottomTearRange repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3816 EntityPlayer.md player done +function EntityPlayer SetShotSpeedModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3605 EntityPlayer.md player done +function EntityPlayer SetSpeedModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3598 EntityPlayer.md player done +function EntityPlayer SetSuplexAimCountdown repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3829 EntityPlayer.md player done +function EntityPlayer SetSuplexLandPosition repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3833 EntityPlayer.md player done +function EntityPlayer SetSuplexState repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3827 EntityPlayer.md player done +function EntityPlayer SetSuplexTargetPosition repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3831 EntityPlayer.md player done +function EntityPlayer SetTearDisplacement repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3804 EntityPlayer.md player done +function EntityPlayer SetTearPoisonDamage repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3649 EntityPlayer.md player done +function EntityPlayer SetTearRangeModifier repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3603 EntityPlayer.md player done +function EntityPlayer SetUrethraBlock repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3679 EntityPlayer.md player done function EntityPlayer SetWeapon repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3628 EntityPlayer.md player todo -function EntityPlayer ShootBlueCandle repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3753 EntityPlayer.md player todo -function EntityPlayer ShootRedCandle repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3560 EntityPlayer.md player review -function EntityPlayer ShuffleCostumes repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3646 EntityPlayer.md player todo -function EntityPlayer SpawnAquariusCreep repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3690 EntityPlayer.md player todo -function EntityPlayer SpawnClot repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3754 EntityPlayer.md player todo -function EntityPlayer SpawnSaturnusTears repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3755 EntityPlayer.md player todo -function EntityPlayer SwapForgottenForm repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3689 EntityPlayer.md player todo -function EntityPlayer SyncConsumableCounts repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3756 EntityPlayer.md player todo -function EntityPlayer Teleport repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3583 EntityPlayer.md player todo -function EntityPlayer TriggerRoomClear repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3644 EntityPlayer.md player todo -function EntityPlayer TryAddToBagOfCrafting repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3757 EntityPlayer.md player todo -function EntityPlayer TryDecreaseGlowingHourglassUses repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3758 EntityPlayer.md player todo +function EntityPlayer ShootBlueCandle repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3753 EntityPlayer.md player done +function EntityPlayer ShootRedCandle repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3560 EntityPlayer.md player done +function EntityPlayer ShuffleCostumes repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3646 EntityPlayer.md player done +function EntityPlayer SpawnAquariusCreep repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3690 EntityPlayer.md player done +function EntityPlayer SpawnClot repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3754 EntityPlayer.md player done +function EntityPlayer SpawnSaturnusTears repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3755 EntityPlayer.md player done +function EntityPlayer SwapForgottenForm repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3689 EntityPlayer.md player done +function EntityPlayer SyncConsumableCounts repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3756 EntityPlayer.md player done +function EntityPlayer Teleport repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3583 EntityPlayer.md player done +function EntityPlayer TriggerRoomClear repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3644 EntityPlayer.md player done +function EntityPlayer TryAddToBagOfCrafting repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3757 EntityPlayer.md player done +function EntityPlayer TryDecreaseGlowingHourglassUses repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3758 EntityPlayer.md player done function EntityPlayer TryFakeDeath repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3588 EntityPlayer.md player todo -function EntityPlayer TryForgottenThrow repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3759 EntityPlayer.md player todo -function EntityPlayer TryPreventDeath repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3579 EntityPlayer.md player todo -function EntityPlayer TryRemoveSmeltedTrinket repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3760 EntityPlayer.md player todo +function EntityPlayer TryForgottenThrow repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3759 EntityPlayer.md player done +function EntityPlayer TryPreventDeath repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3579 EntityPlayer.md player done +function EntityPlayer TryRemoveSmeltedTrinket repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3760 EntityPlayer.md player done function EntityPlayer UnblockCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3779 EntityPlayer.md player todo function EntityPlayer UnblockTrinket repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3782 EntityPlayer.md player todo -function EntityPlayer UpdateIsaacPregnancy repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3669 EntityPlayer.md player todo -function EntityPlayer UseActiveItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3841 EntityPlayer.md player review -function EntityPlayer VoidHasCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3762 EntityPlayer.md player todo -function EntityProjectile Deflect repentogon/LuaInterfaces/Entities/LuaEntityProjectile.cpp:19 EntityProjectile.md tear and weapons todo -function EntitySaveState GetB1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:389 EntitiesSaveState.md entities todo -function EntitySaveState GetB2 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:391 EntitiesSaveState.md entities todo -function EntitySaveState GetDropSeed repentogon/LuaInterfaces/LuaEntitySaveState.cpp:400 EntitiesSaveState.md entities todo -function EntitySaveState GetF1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:403 EntitiesSaveState.md entities todo -function EntitySaveState GetF2 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:405 EntitiesSaveState.md entities todo -function EntitySaveState GetGridSpawnIdx repentogon/LuaInterfaces/LuaEntitySaveState.cpp:387 EntitiesSaveState.md entities todo -function EntitySaveState GetI1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:377 EntitiesSaveState.md entities todo -function EntitySaveState GetI2 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:379 EntitiesSaveState.md entities todo -function EntitySaveState GetI3 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:381 EntitiesSaveState.md entities todo -function EntitySaveState GetI4 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:383 EntitiesSaveState.md entities todo -function EntitySaveState GetI5 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:385 EntitiesSaveState.md entities todo -function EntitySaveState GetI6 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:393 EntitiesSaveState.md entities todo -function EntitySaveState GetI7 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:397 EntitiesSaveState.md entities todo -function EntitySaveState GetI8 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:407 EntitiesSaveState.md entities todo -function EntitySaveState GetInitSeed repentogon/LuaInterfaces/LuaEntitySaveState.cpp:399 EntitiesSaveState.md entities todo -function EntitySaveState GetPos repentogon/LuaInterfaces/LuaEntitySaveState.cpp:395 EntitiesSaveState.md entities todo -function EntitySaveState GetSpawnerType repentogon/LuaInterfaces/LuaEntitySaveState.cpp:401 EntitiesSaveState.md entities todo -function EntitySaveState GetSpawnerVariant repentogon/LuaInterfaces/LuaEntitySaveState.cpp:402 EntitiesSaveState.md entities todo -function EntitySaveState GetSubType repentogon/LuaInterfaces/LuaEntitySaveState.cpp:375 EntitiesSaveState.md entities todo -function EntitySaveState GetType repentogon/LuaInterfaces/LuaEntitySaveState.cpp:371 EntitiesSaveState.md entities todo -function EntitySaveState GetU1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:409 EntitiesSaveState.md entities todo -function EntitySaveState GetVariant repentogon/LuaInterfaces/LuaEntitySaveState.cpp:373 EntitiesSaveState.md entities todo -function EntitySaveState SetB1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:390 EntitiesSaveState.md entities todo -function EntitySaveState SetB2 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:392 EntitiesSaveState.md entities todo -function EntitySaveState SetF1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:404 EntitiesSaveState.md entities todo -function EntitySaveState SetF2 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:406 EntitiesSaveState.md entities todo -function EntitySaveState SetI1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:378 EntitiesSaveState.md entities todo -function EntitySaveState SetI2 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:380 EntitiesSaveState.md entities todo -function EntitySaveState SetI3 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:382 EntitiesSaveState.md entities todo -function EntitySaveState SetI4 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:384 EntitiesSaveState.md entities todo -function EntitySaveState SetI5 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:386 EntitiesSaveState.md entities todo -function EntitySaveState SetI6 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:394 EntitiesSaveState.md entities todo -function EntitySaveState SetI7 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:398 EntitiesSaveState.md entities todo -function EntitySaveState SetI8 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:408 EntitiesSaveState.md entities todo -function EntitySaveState SetPos repentogon/LuaInterfaces/LuaEntitySaveState.cpp:396 EntitiesSaveState.md entities todo -function EntitySaveState SetSubType repentogon/LuaInterfaces/LuaEntitySaveState.cpp:376 EntitiesSaveState.md entities todo -function EntitySaveState SetType repentogon/LuaInterfaces/LuaEntitySaveState.cpp:372 EntitiesSaveState.md entities todo -function EntitySaveState SetU1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:410 EntitiesSaveState.md entities todo -function EntitySaveState SetVariant repentogon/LuaInterfaces/LuaEntitySaveState.cpp:374 EntitiesSaveState.md entities todo +function EntityPlayer UpdateIsaacPregnancy repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3669 EntityPlayer.md player done +function EntityPlayer UseActiveItem repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3841 EntityPlayer.md player done +function EntityPlayer VoidHasCollectible repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3762 EntityPlayer.md player done +function EntityProjectile Deflect repentogon/LuaInterfaces/Entities/LuaEntityProjectile.cpp:19 EntityProjectile.md tear and weapons done +function EntitySaveState GetB1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:389 EntitiesSaveState.md entities done +function EntitySaveState GetB2 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:391 EntitiesSaveState.md entities done +function EntitySaveState GetDropSeed repentogon/LuaInterfaces/LuaEntitySaveState.cpp:400 EntitiesSaveState.md entities done +function EntitySaveState GetF1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:403 EntitiesSaveState.md entities done +function EntitySaveState GetF2 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:405 EntitiesSaveState.md entities done +function EntitySaveState GetGridSpawnIdx repentogon/LuaInterfaces/LuaEntitySaveState.cpp:387 EntitiesSaveState.md entities done +function EntitySaveState GetI1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:377 EntitiesSaveState.md entities done +function EntitySaveState GetI2 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:379 EntitiesSaveState.md entities done +function EntitySaveState GetI3 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:381 EntitiesSaveState.md entities done +function EntitySaveState GetI4 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:383 EntitiesSaveState.md entities done +function EntitySaveState GetI5 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:385 EntitiesSaveState.md entities done +function EntitySaveState GetI6 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:393 EntitiesSaveState.md entities done +function EntitySaveState GetI7 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:397 EntitiesSaveState.md entities done +function EntitySaveState GetI8 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:407 EntitiesSaveState.md entities done +function EntitySaveState GetInitSeed repentogon/LuaInterfaces/LuaEntitySaveState.cpp:399 EntitiesSaveState.md entities done +function EntitySaveState GetPos repentogon/LuaInterfaces/LuaEntitySaveState.cpp:395 EntitiesSaveState.md entities done +function EntitySaveState GetSpawnerType repentogon/LuaInterfaces/LuaEntitySaveState.cpp:401 EntitiesSaveState.md entities done +function EntitySaveState GetSpawnerVariant repentogon/LuaInterfaces/LuaEntitySaveState.cpp:402 EntitiesSaveState.md entities done +function EntitySaveState GetSubType repentogon/LuaInterfaces/LuaEntitySaveState.cpp:375 EntitiesSaveState.md entities done +function EntitySaveState GetType repentogon/LuaInterfaces/LuaEntitySaveState.cpp:371 EntitiesSaveState.md entities done +function EntitySaveState GetU1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:409 EntitiesSaveState.md entities done +function EntitySaveState GetVariant repentogon/LuaInterfaces/LuaEntitySaveState.cpp:373 EntitiesSaveState.md entities done +function EntitySaveState SetB1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:390 EntitiesSaveState.md entities done +function EntitySaveState SetB2 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:392 EntitiesSaveState.md entities done +function EntitySaveState SetF1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:404 EntitiesSaveState.md entities done +function EntitySaveState SetF2 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:406 EntitiesSaveState.md entities done +function EntitySaveState SetI1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:378 EntitiesSaveState.md entities done +function EntitySaveState SetI2 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:380 EntitiesSaveState.md entities done +function EntitySaveState SetI3 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:382 EntitiesSaveState.md entities done +function EntitySaveState SetI4 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:384 EntitiesSaveState.md entities done +function EntitySaveState SetI5 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:386 EntitiesSaveState.md entities done +function EntitySaveState SetI6 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:394 EntitiesSaveState.md entities done +function EntitySaveState SetI7 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:398 EntitiesSaveState.md entities done +function EntitySaveState SetI8 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:408 EntitiesSaveState.md entities done +function EntitySaveState SetPos repentogon/LuaInterfaces/LuaEntitySaveState.cpp:396 EntitiesSaveState.md entities done +function EntitySaveState SetSubType repentogon/LuaInterfaces/LuaEntitySaveState.cpp:376 EntitiesSaveState.md entities done +function EntitySaveState SetType repentogon/LuaInterfaces/LuaEntitySaveState.cpp:372 EntitiesSaveState.md entities done +function EntitySaveState SetU1 repentogon/LuaInterfaces/LuaEntitySaveState.cpp:410 EntitiesSaveState.md entities done +function EntitySaveState SetVariant repentogon/LuaInterfaces/LuaEntitySaveState.cpp:374 EntitiesSaveState.md entities done function EntitySaveStateManagement DeleteData repentogon/SaveStateManagement/EntitySaveStateManagement.cpp:3479 misc todo function EntitySaveStateManagement GetEntitySaveStateId repentogon/SaveStateManagement/EntitySaveStateManagement.cpp:3476 persistent data and saves todo function EntitySaveStateManagement LoadData repentogon/SaveStateManagement/EntitySaveStateManagement.cpp:3478 misc todo @@ -996,49 +996,49 @@ function EntitySaveStateManager GetEntityData repentogon/resources/scripts/main_ function EntitySaveStateManager GetEntitySaveStateData repentogon/resources/scripts/main_ex.lua:2345 EntitySaveStateManager.md entities done defined in Lua function EntitySaveStateManager TryGetEntityData repentogon/resources/scripts/main_ex.lua:2346 EntitySaveStateManager.md entities done defined in Lua function EntitySaveStateManager TryGetEntitySaveStateData repentogon/resources/scripts/main_ex.lua:2347 EntitySaveStateManager.md entities done defined in Lua -function EntitySlot CreateDropsFromExplosion repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:207 EntitySlot.md pickup todo -function EntitySlot GetDonationValue repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:218 EntitySlot.md pickup todo -function EntitySlot GetPrizeCollectible repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:208 EntitySlot.md pickup todo -function EntitySlot GetPrizeSprite repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:226 EntitySlot.md pickup todo -function EntitySlot GetPrizeType repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:214 EntitySlot.md pickup todo -function EntitySlot GetShellGameAnimationIndex repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:216 EntitySlot.md pickup todo -function EntitySlot GetState repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:212 EntitySlot.md pickup todo -function EntitySlot GetTimeout repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:222 EntitySlot.md pickup todo -function EntitySlot GetTouch repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:224 EntitySlot.md pickup todo -function EntitySlot GetTriggerTimerNum repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:220 EntitySlot.md pickup todo -function EntitySlot RandomCoinJamAnim repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:210 EntitySlot.md pickup todo -function EntitySlot SetDonationValue repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:219 EntitySlot.md pickup todo -function EntitySlot SetPrizeCollectible repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:209 EntitySlot.md pickup todo -function EntitySlot SetPrizeType repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:215 EntitySlot.md pickup todo -function EntitySlot SetShellGameAnimationIndex repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:217 EntitySlot.md pickup todo -function EntitySlot SetState repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:213 EntitySlot.md pickup todo -function EntitySlot SetTimeout repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:223 EntitySlot.md pickup todo -function EntitySlot SetTouch repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:225 EntitySlot.md pickup todo -function EntitySlot SetTriggerTimerNum repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:221 EntitySlot.md pickup todo -function EntityTear AddToHitList repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:176 tear and weapons todo -function EntityTear ClearHitList repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:173 EntityTear.md tear and weapons todo -function EntityTear FireSplitTear repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:174 EntityTear.md tear and weapons todo -function EntityTear GetDeadEyeIntensity repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:162 EntityTear.md tear and weapons todo -function EntityTear GetDeadEyeSprite repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:166 EntityTear.md tear and weapons todo -function EntityTear GetHitList repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:172 EntityTear.md tear and weapons todo -function EntityTear GetTearEffectSprite repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:165 EntityTear.md tear and weapons todo -function EntityTear GetTearHaloSprite repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:164 EntityTear.md tear and weapons todo -function EntityTear InHitList repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:177 tear and weapons todo -function EntityTear IsMultidimensionalTouched repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:168 EntityTear.md tear and weapons todo -function EntityTear IsPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:170 EntityTear.md tear and weapons todo -function EntityTear MakeMultidimensionalCopy repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:163 EntityTear.md tear and weapons todo -function EntityTear RemoveFromHitList repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:175 tear and weapons todo -function EntityTear ResetSpriteScale repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:167 EntityTear.md tear and weapons review -function EntityTear SetInitSound repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:178 EntityTear.md tear and weapons todo -function EntityTear SetMultidimensionalTouched repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:169 EntityTear.md tear and weapons todo -function EntityTear SetPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:171 EntityTear.md tear and weapons todo -function FXLayers AddPoopFx repentogon/LuaInterfaces/LuaFXLayers.cpp:28 FXLayers.md level and room todo -function Font DrawString Font.md render and sprites review docs only: vanilla changed through a hook -function Font DrawStringScaled Font.md render and sprites todo docs only: vanilla changed through a hook -function Font DrawStringScaledUTF8 Font.md render and sprites todo docs only: vanilla changed through a hook -function Font DrawStringUTF8 Font.md render and sprites todo docs only: vanilla changed through a hook -function Font GetStringWidth Font.md render and sprites review docs only: vanilla changed through a hook -function Font GetStringWidthUTF8 Font.md render and sprites todo docs only: vanilla changed through a hook +function EntitySlot CreateDropsFromExplosion repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:207 EntitySlot.md pickup done +function EntitySlot GetDonationValue repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:218 EntitySlot.md pickup done +function EntitySlot GetPrizeCollectible repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:208 EntitySlot.md pickup done +function EntitySlot GetPrizeSprite repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:226 EntitySlot.md pickup done +function EntitySlot GetPrizeType repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:214 EntitySlot.md pickup done +function EntitySlot GetShellGameAnimationIndex repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:216 EntitySlot.md pickup done +function EntitySlot GetState repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:212 EntitySlot.md pickup done +function EntitySlot GetTimeout repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:222 EntitySlot.md pickup done +function EntitySlot GetTouch repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:224 EntitySlot.md pickup done +function EntitySlot GetTriggerTimerNum repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:220 EntitySlot.md pickup done +function EntitySlot RandomCoinJamAnim repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:210 EntitySlot.md pickup done +function EntitySlot SetDonationValue repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:219 EntitySlot.md pickup done +function EntitySlot SetPrizeCollectible repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:209 EntitySlot.md pickup done +function EntitySlot SetPrizeType repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:215 EntitySlot.md pickup done +function EntitySlot SetShellGameAnimationIndex repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:217 EntitySlot.md pickup done +function EntitySlot SetState repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:213 EntitySlot.md pickup done +function EntitySlot SetTimeout repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:223 EntitySlot.md pickup done +function EntitySlot SetTouch repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:225 EntitySlot.md pickup done +function EntitySlot SetTriggerTimerNum repentogon/LuaInterfaces/Entities/LuaEntitySlot.cpp:221 EntitySlot.md pickup done +function EntityTear AddToHitList repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:176 tear and weapons done +function EntityTear ClearHitList repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:173 EntityTear.md tear and weapons done +function EntityTear FireSplitTear repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:174 EntityTear.md tear and weapons done +function EntityTear GetDeadEyeIntensity repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:162 EntityTear.md tear and weapons done +function EntityTear GetDeadEyeSprite repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:166 EntityTear.md tear and weapons done +function EntityTear GetHitList repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:172 EntityTear.md tear and weapons done +function EntityTear GetTearEffectSprite repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:165 EntityTear.md tear and weapons done +function EntityTear GetTearHaloSprite repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:164 EntityTear.md tear and weapons done +function EntityTear InHitList repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:177 tear and weapons done +function EntityTear IsMultidimensionalTouched repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:168 EntityTear.md tear and weapons done +function EntityTear IsPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:170 EntityTear.md tear and weapons done +function EntityTear MakeMultidimensionalCopy repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:163 EntityTear.md tear and weapons done +function EntityTear RemoveFromHitList repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:175 tear and weapons done +function EntityTear ResetSpriteScale repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:167 EntityTear.md tear and weapons done +function EntityTear SetInitSound repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:178 EntityTear.md tear and weapons done +function EntityTear SetMultidimensionalTouched repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:169 EntityTear.md tear and weapons done +function EntityTear SetPrismTouched repentogon/LuaInterfaces/Entities/LuaEntityTear.cpp:171 EntityTear.md tear and weapons done +function FXLayers AddPoopFx repentogon/LuaInterfaces/LuaFXLayers.cpp:28 FXLayers.md level and room done +function Font DrawString Font.md render and sprites done docs only: vanilla changed through a hook +function Font DrawStringScaled Font.md render and sprites done docs only: vanilla changed through a hook +function Font DrawStringScaledUTF8 Font.md render and sprites done docs only: vanilla changed through a hook +function Font DrawStringUTF8 Font.md render and sprites done docs only: vanilla changed through a hook +function Font GetStringWidth Font.md render and sprites done docs only: vanilla changed through a hook +function Font GetStringWidthUTF8 Font.md render and sprites done docs only: vanilla changed through a hook function GLShader BindFloat repentogon/LuaInterfaces/LuaRender.cpp:2141 misc todo function GLShader BindMat2 repentogon/LuaInterfaces/LuaRender.cpp:2145 misc todo function GLShader BindMat3 repentogon/LuaInterfaces/LuaRender.cpp:2146 misc todo @@ -1046,142 +1046,142 @@ function GLShader BindMat4 repentogon/LuaInterfaces/LuaRender.cpp:2147 misc tod function GLShader BindVec2 repentogon/LuaInterfaces/LuaRender.cpp:2142 misc todo function GLShader BindVec3 repentogon/LuaInterfaces/LuaRender.cpp:2143 misc todo function GLShader BindVec4 repentogon/LuaInterfaces/LuaRender.cpp:2144 misc todo -function Game AchievementUnlocksDisallowed repentogon/LuaInterfaces/LuaGame.cpp:410 Game.md game todo -function Game AddDebugFlags repentogon/LuaInterfaces/LuaGame.cpp:419 Game.md game todo -function Game AddErasedEnemy repentogon/LuaInterfaces/LuaGame.cpp:425 Game.md game todo -function Game AddShopVisits repentogon/LuaInterfaces/LuaGame.cpp:408 Game.md game todo -function Game ChainLightning repentogon/LuaInterfaces/LuaGame.cpp:443 Game.md game todo -function Game ClearErasedEnemies repentogon/LuaInterfaces/LuaGame.cpp:407 Game.md game todo -function Game DevolveEnemy repentogon/LuaInterfaces/LuaGame.cpp:421 Game.md game todo -function Game GetChallengeParams repentogon/LuaInterfaces/LuaChallengeParam.cpp:288 Game.md game todo -function Game GetCurrentColorModifier repentogon/LuaInterfaces/LuaGame.cpp:428 Game.md game todo -function Game GetDebugFlags repentogon/LuaInterfaces/LuaGame.cpp:418 Game.md game todo -function Game GetDizzyAmount repentogon/LuaInterfaces/LuaGame.cpp:439 Game.md game todo -function Game GetGenericPrompt repentogon/LuaInterfaces/LuaGame.cpp:442 Game.md game todo -function Game GetLastDevilRoomStage repentogon/LuaInterfaces/LuaGame.cpp:415 Game.md game review -function Game GetLastLevelWithDamage repentogon/LuaInterfaces/LuaGame.cpp:416 Game.md game review -function Game GetLastLevelWithoutHalfHp repentogon/LuaInterfaces/LuaGame.cpp:417 Game.md game review -function Game GetLerpColorModifier repentogon/LuaInterfaces/LuaGame.cpp:430 Game.md game todo -function Game GetPauseMenuState repentogon/LuaInterfaces/LuaGame.cpp:412 Game.md game todo -function Game GetPlanetariumsVisited repentogon/LuaInterfaces/LuaGame.cpp:413 Game.md game todo -function Game GetPlayer repentogon/LuaInterfaces/LuaGame.cpp:433 Game.md game review -function Game GetShopVisits repentogon/LuaInterfaces/LuaGame.cpp:409 Game.md game todo -function Game GetTargetColorModifier repentogon/LuaInterfaces/LuaGame.cpp:429 Game.md game todo -function Game IsErased repentogon/LuaInterfaces/LuaGame.cpp:427 Game.md game todo -function Game IsGreedBoss repentogon/LuaInterfaces/LuaGame.cpp:422 Game.md game todo -function Game IsGreedFinalBoss repentogon/LuaInterfaces/LuaGame.cpp:423 Game.md game todo -function Game IsHardMode repentogon/LuaInterfaces/LuaGame.cpp:414 Game.md game todo -function Game IsPauseMenuOpen repentogon/LuaInterfaces/LuaGame.cpp:411 Game.md game todo -function Game IsRerun repentogon/LuaInterfaces/LuaGame.cpp:432 Game.md game todo -function Game IsStartingFromState repentogon/LuaInterfaces/LuaGame.cpp:444 Game.md game todo -function Game Move Game.md game todo docs only: vanilla changed through a hook -function Game MoveToRandomRoom repentogon/LuaInterfaces/LuaGame.cpp:435 game review -function Game RecordPlayerCompletion repentogon/LuaInterfaces/LuaGame.cpp:441 Game.md game todo -function Game RemoveErasedEnemy repentogon/LuaInterfaces/LuaGame.cpp:426 Game.md game todo -function Game SetBloom repentogon/LuaInterfaces/LuaGame.cpp:438 Game.md game todo -function Game SetColorModifier repentogon/LuaInterfaces/LuaGame.cpp:431 Game.md game todo -function Game SetDizzyAmount repentogon/LuaInterfaces/LuaGame.cpp:440 Game.md game todo -function Game SetDonationModAngel repentogon/LuaInterfaces/LuaGame.cpp:436 Game.md game todo -function Game SetDonationModGreed repentogon/LuaInterfaces/LuaGame.cpp:437 Game.md game todo -function Game ShowGenericLeaderboard repentogon/LuaInterfaces/LuaGame.cpp:434 Game.md game todo -function Game SpawnBombCrater repentogon/LuaInterfaces/LuaGame.cpp:420 Game.md game todo -function Game StartStageTransition repentogon/LuaInterfaces/LuaGame.cpp:424 Game.md game review -function GenericPrompt GetCurrentSelection repentogon/LuaInterfaces/LuaGenericPrompt.cpp:97 GenericPrompt.md game todo -function GenericPrompt GetSprite repentogon/LuaInterfaces/LuaGenericPrompt.cpp:96 GenericPrompt.md game todo -function GenericPrompt GetSubmittedSelection repentogon/LuaInterfaces/LuaGenericPrompt.cpp:98 GenericPrompt.md game todo -function GenericPrompt Initialize repentogon/LuaInterfaces/LuaGenericPrompt.cpp:88 GenericPrompt.md game todo -function GenericPrompt IsActive repentogon/LuaInterfaces/LuaGenericPrompt.cpp:90 GenericPrompt.md game todo -function GenericPrompt Render repentogon/LuaInterfaces/LuaGenericPrompt.cpp:93 GenericPrompt.md game todo -function GenericPrompt SetImageToVictoryRun repentogon/LuaInterfaces/LuaGenericPrompt.cpp:91 GenericPrompt.md game todo -function GenericPrompt SetText repentogon/LuaInterfaces/LuaGenericPrompt.cpp:94 GenericPrompt.md game todo -function GenericPrompt Show repentogon/LuaInterfaces/LuaGenericPrompt.cpp:89 GenericPrompt.md game todo -function GenericPrompt Update repentogon/LuaInterfaces/LuaGenericPrompt.cpp:92 GenericPrompt.md game todo -function GridEntitiesSaveStateVector Clear repentogon/LuaInterfaces/LuaEntitySaveState.cpp:547 entities todo -function GridEntitiesSaveStateVector Get repentogon/LuaInterfaces/LuaEntitySaveState.cpp:545 GridEntitiesSaveStateVector.md entities todo -function GridEntitiesSaveStateVector GetByType repentogon/LuaInterfaces/LuaEntitySaveState.cpp:546 GridEntitiesSaveStateVector.md entities todo -function GridEntitiesSaveStateVector __len repentogon/LuaInterfaces/LuaEntitySaveState.cpp:548 GridEntitiesSaveStateVector.md entities todo -function GridEntity GetRenderPosition repentogon/LuaInterfaces/GridEntities/LuaGridEntity.cpp:86 GridEntity.md entities todo -function GridEntity GetWaterClipFlags repentogon/LuaInterfaces/GridEntities/LuaGridEntity.cpp:88 GridEntity.md entities todo -function GridEntity HurtDamage repentogon/LuaInterfaces/GridEntities/LuaGridEntity.cpp:84 GridEntity.md entities todo -function GridEntity HurtSurroundings repentogon/LuaInterfaces/GridEntities/LuaGridEntity.cpp:85 entities todo -function GridEntity IsBreakableRock repentogon/LuaInterfaces/GridEntities/LuaGridEntity.cpp:87 GridEntity.md entities todo -function GridEntity ResetWaterClipFlags repentogon/LuaInterfaces/GridEntities/LuaGridEntity.cpp:90 GridEntity.md entities todo -function GridEntity SetWaterClipFlags repentogon/LuaInterfaces/GridEntities/LuaGridEntity.cpp:89 GridEntity.md entities todo -function GridEntity ToDecoration repentogon/LuaInterfaces/GridEntities/LuaGridEntityDecoration.cpp:18 GridEntity.md entities todo -function GridEntity ToFire repentogon/LuaInterfaces/GridEntities/LuaGridEntityFire.cpp:18 GridEntity.md entities todo -function GridEntity ToGravity repentogon/LuaInterfaces/GridEntities/LuaGridEntityGravity.cpp:18 GridEntity.md entities todo -function GridEntity ToLock repentogon/LuaInterfaces/GridEntities/LuaGridEntityLock.cpp:27 GridEntity.md entities todo -function GridEntity ToStairs repentogon/LuaInterfaces/GridEntities/LuaGridEntityStairs.cpp:18 GridEntity.md entities todo -function GridEntity ToStatue repentogon/LuaInterfaces/GridEntities/LuaGridEntityStatue.cpp:18 GridEntity.md entities todo -function GridEntity ToTNT GridEntity.md entities todo docs only: vanilla changed through a hook -function GridEntity ToTeleporter repentogon/LuaInterfaces/GridEntities/LuaGridEntityTeleporter.cpp:18 GridEntity.md entities todo -function GridEntity ToTrapDoor repentogon/LuaInterfaces/GridEntities/LuaGridEntityTrapDoor.cpp:18 GridEntity.md entities todo -function GridEntity ToWall repentogon/LuaInterfaces/GridEntities/LuaGridEntityWall.cpp:18 GridEntity.md entities todo -function GridEntity ToWeb repentogon/LuaInterfaces/GridEntities/LuaGridEntityWeb.cpp:18 GridEntity.md entities todo -function GridEntityDoor GetExtraSprite repentogon/LuaInterfaces/GridEntities/LuaGridEntityDoor.cpp:52 GridEntityDoor.md level and room todo -function GridEntityDoor PlayAnimation repentogon/LuaInterfaces/GridEntities/LuaGridEntityDoor.cpp:53 GridEntityDoor.md level and room todo -function GridEntityLock TryUnlock repentogon/LuaInterfaces/GridEntities/LuaGridEntityLock.cpp:67 GridEntityLock.md level and room todo -function GridEntityRock GetAltRockType repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:94 GridEntityRock.md level and room todo -function GridEntityRock PlayBreakSound repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:93 GridEntityRock.md level and room todo -function GridEntityRock RegisterRockDestroyed repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:95 GridEntityRock.md level and room todo -function GridEntityRock RenderTop repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:89 GridEntityRock.md level and room todo -function GridEntityRock SpawnDrops repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:101 GridEntityRock.md level and room todo -function GridEntityRock TrySpawnLadder repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:91 GridEntityRock.md level and room todo -function GridEntityRock TrySpawnWorms repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:90 GridEntityRock.md level and room todo -function GridEntityRock UpdateCollision repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:96 GridEntityRock.md level and room todo -function GridEntityRock UpdateNeighbors repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:92 GridEntityRock.md level and room todo -function HUD FlashRedHearts repentogon/LuaInterfaces/HUD/LuaHUD.cpp:258 HUD.md hud and menus todo -function HUD GetBossHPBarFill repentogon/LuaInterfaces/HUD/LuaHUD.cpp:272 HUD.md hud and menus todo -function HUD GetCardsPillsSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:262 HUD.md hud and menus todo -function HUD GetChargeBarSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:259 HUD.md hud and menus todo -function HUD GetCoopMenuSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:268 HUD.md hud and menus todo -function HUD GetCoopPlayerMessage repentogon/LuaInterfaces/HUD/LuaHUD.cpp:266 hud and menus todo -function HUD GetCraftingSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:270 HUD.md hud and menus todo -function HUD GetFortuneSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:267 HUD.md hud and menus todo -function HUD GetHeartsSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:260 HUD.md hud and menus todo -function HUD GetHistoryHUD repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:195 HUD.md hud and menus todo -function HUD GetInventorySprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:269 HUD.md hud and menus todo -function HUD GetMainMessage repentogon/LuaInterfaces/HUD/LuaHUD.cpp:264 hud and menus todo -function HUD GetPickupsHUDSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:261 HUD.md hud and menus todo -function HUD GetPlayerHUD repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:127 HUD.md hud and menus todo -function HUD GetPlayerStreakSprite HUD.md hud and menus todo docs only: no registration found -function HUD GetPoopSpellSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:271 HUD.md hud and menus todo -function HUD GetStackedMessage repentogon/LuaInterfaces/HUD/LuaHUD.cpp:265 hud and menus todo -function HUD GetStackedStreakSprite HUD.md hud and menus todo docs only: no registration found -function HUD GetStreakSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:263 HUD.md hud and menus todo -function HUD SetBossHPBarFill repentogon/LuaInterfaces/HUD/LuaHUD.cpp:273 HUD.md hud and menus todo -function HUDMessage GetMainText repentogon/LuaInterfaces/HUD/LuaHUD.cpp:243 hud and menus todo -function HUDMessage GetSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:239 hud and menus todo -function HUDMessage GetSubText repentogon/LuaInterfaces/HUD/LuaHUD.cpp:245 hud and menus todo -function HUDMessage Hide repentogon/LuaInterfaces/HUD/LuaHUD.cpp:241 hud and menus todo -function HUDMessage IsShowing repentogon/LuaInterfaces/HUD/LuaHUD.cpp:240 hud and menus todo -function HUDMessage SetMainText repentogon/LuaInterfaces/HUD/LuaHUD.cpp:244 hud and menus todo -function HUDMessage SetSubText repentogon/LuaInterfaces/HUD/LuaHUD.cpp:246 hud and menus todo -function HUDMessage Show repentogon/LuaInterfaces/HUD/LuaHUD.cpp:242 hud and menus todo -function History GetCollectiblesHistory repentogon/LuaInterfaces/LuaHistory.cpp:93 History.md player todo -function History RemoveHistoryItemByIndex repentogon/LuaInterfaces/LuaHistory.cpp:92 History.md player todo -function History SearchCollectibles repentogon/LuaInterfaces/LuaHistory.cpp:94 History.md player todo -function History SearchTrinkets repentogon/LuaInterfaces/LuaHistory.cpp:95 History.md player todo -function HistoryHUD GetCollectibleOffsets repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:202 HistoryHUD.md hud and menus todo -function HistoryHUD GetCollectibles repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:201 HistoryHUD.md hud and menus todo -function HistoryHUD GetItems repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:200 HistoryHUD.md hud and menus todo -function HistoryHUD GetPlayer repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:198 HistoryHUD.md hud and menus todo -function HistoryHUD GetPosition repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:199 HistoryHUD.md hud and menus todo -function HistoryHUD GetTrinketOffsets repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:204 HistoryHUD.md hud and menus todo -function HistoryHUD GetTrinkets repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:203 HistoryHUD.md hud and menus todo -function HistoryHUDItem GetHistoryItem repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:215 HistoryHUDItem.md hud and menus todo -function HistoryHUDItem GetItemID repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:212 HistoryHUDItem.md hud and menus todo -function HistoryHUDItem GetRenderOffset repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:216 HistoryHUDItem.md hud and menus todo -function HistoryHUDItem GetTime repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:214 HistoryHUDItem.md hud and menus todo -function HistoryHUDItem IsTrinket repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:213 HistoryHUDItem.md hud and menus todo -function HistoryHUDItem IsVisible repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:217 HistoryHUDItem.md hud and menus todo -function HistoryItem GetItemID repentogon/LuaInterfaces/LuaHistoryItem.cpp:64 HistoryItem.md player todo -function HistoryItem GetItemPoolType repentogon/LuaInterfaces/LuaHistoryItem.cpp:68 HistoryItem.md player todo -function HistoryItem GetLevelStage repentogon/LuaInterfaces/LuaHistoryItem.cpp:65 HistoryItem.md player todo -function HistoryItem GetRoomType repentogon/LuaInterfaces/LuaHistoryItem.cpp:67 HistoryItem.md player todo -function HistoryItem GetStageType repentogon/LuaInterfaces/LuaHistoryItem.cpp:66 HistoryItem.md player todo -function HistoryItem GetTime repentogon/LuaInterfaces/LuaHistoryItem.cpp:63 HistoryItem.md player todo -function HistoryItem IsTrinket repentogon/LuaInterfaces/LuaHistoryItem.cpp:69 HistoryItem.md player todo +function Game AchievementUnlocksDisallowed repentogon/LuaInterfaces/LuaGame.cpp:410 Game.md game done +function Game AddDebugFlags repentogon/LuaInterfaces/LuaGame.cpp:419 Game.md game done +function Game AddErasedEnemy repentogon/LuaInterfaces/LuaGame.cpp:425 Game.md game done +function Game AddShopVisits repentogon/LuaInterfaces/LuaGame.cpp:408 Game.md game done +function Game ChainLightning repentogon/LuaInterfaces/LuaGame.cpp:443 Game.md game done +function Game ClearErasedEnemies repentogon/LuaInterfaces/LuaGame.cpp:407 Game.md game done +function Game DevolveEnemy repentogon/LuaInterfaces/LuaGame.cpp:421 Game.md game done +function Game GetChallengeParams repentogon/LuaInterfaces/LuaChallengeParam.cpp:288 Game.md game done +function Game GetCurrentColorModifier repentogon/LuaInterfaces/LuaGame.cpp:428 Game.md game done +function Game GetDebugFlags repentogon/LuaInterfaces/LuaGame.cpp:418 Game.md game done +function Game GetDizzyAmount repentogon/LuaInterfaces/LuaGame.cpp:439 Game.md game done +function Game GetGenericPrompt repentogon/LuaInterfaces/LuaGame.cpp:442 Game.md game done +function Game GetLastDevilRoomStage repentogon/LuaInterfaces/LuaGame.cpp:415 Game.md game done +function Game GetLastLevelWithDamage repentogon/LuaInterfaces/LuaGame.cpp:416 Game.md game done +function Game GetLastLevelWithoutHalfHp repentogon/LuaInterfaces/LuaGame.cpp:417 Game.md game done +function Game GetLerpColorModifier repentogon/LuaInterfaces/LuaGame.cpp:430 Game.md game done +function Game GetPauseMenuState repentogon/LuaInterfaces/LuaGame.cpp:412 Game.md game done +function Game GetPlanetariumsVisited repentogon/LuaInterfaces/LuaGame.cpp:413 Game.md game done +function Game GetPlayer repentogon/LuaInterfaces/LuaGame.cpp:433 Game.md game done +function Game GetShopVisits repentogon/LuaInterfaces/LuaGame.cpp:409 Game.md game done +function Game GetTargetColorModifier repentogon/LuaInterfaces/LuaGame.cpp:429 Game.md game done +function Game IsErased repentogon/LuaInterfaces/LuaGame.cpp:427 Game.md game done +function Game IsGreedBoss repentogon/LuaInterfaces/LuaGame.cpp:422 Game.md game done +function Game IsGreedFinalBoss repentogon/LuaInterfaces/LuaGame.cpp:423 Game.md game done +function Game IsHardMode repentogon/LuaInterfaces/LuaGame.cpp:414 Game.md game done +function Game IsPauseMenuOpen repentogon/LuaInterfaces/LuaGame.cpp:411 Game.md game done +function Game IsRerun repentogon/LuaInterfaces/LuaGame.cpp:432 Game.md game done +function Game IsStartingFromState repentogon/LuaInterfaces/LuaGame.cpp:444 Game.md game done +function Game Move Game.md game done docs only: vanilla changed through a hook +function Game MoveToRandomRoom repentogon/LuaInterfaces/LuaGame.cpp:435 game done +function Game RecordPlayerCompletion repentogon/LuaInterfaces/LuaGame.cpp:441 Game.md game done +function Game RemoveErasedEnemy repentogon/LuaInterfaces/LuaGame.cpp:426 Game.md game done +function Game SetBloom repentogon/LuaInterfaces/LuaGame.cpp:438 Game.md game done +function Game SetColorModifier repentogon/LuaInterfaces/LuaGame.cpp:431 Game.md game done +function Game SetDizzyAmount repentogon/LuaInterfaces/LuaGame.cpp:440 Game.md game done +function Game SetDonationModAngel repentogon/LuaInterfaces/LuaGame.cpp:436 Game.md game done +function Game SetDonationModGreed repentogon/LuaInterfaces/LuaGame.cpp:437 Game.md game done +function Game ShowGenericLeaderboard repentogon/LuaInterfaces/LuaGame.cpp:434 Game.md game done +function Game SpawnBombCrater repentogon/LuaInterfaces/LuaGame.cpp:420 Game.md game done +function Game StartStageTransition repentogon/LuaInterfaces/LuaGame.cpp:424 Game.md game done +function GenericPrompt GetCurrentSelection repentogon/LuaInterfaces/LuaGenericPrompt.cpp:97 GenericPrompt.md game done +function GenericPrompt GetSprite repentogon/LuaInterfaces/LuaGenericPrompt.cpp:96 GenericPrompt.md game done +function GenericPrompt GetSubmittedSelection repentogon/LuaInterfaces/LuaGenericPrompt.cpp:98 GenericPrompt.md game done +function GenericPrompt Initialize repentogon/LuaInterfaces/LuaGenericPrompt.cpp:88 GenericPrompt.md game done +function GenericPrompt IsActive repentogon/LuaInterfaces/LuaGenericPrompt.cpp:90 GenericPrompt.md game done +function GenericPrompt Render repentogon/LuaInterfaces/LuaGenericPrompt.cpp:93 GenericPrompt.md game done +function GenericPrompt SetImageToVictoryRun repentogon/LuaInterfaces/LuaGenericPrompt.cpp:91 GenericPrompt.md game done +function GenericPrompt SetText repentogon/LuaInterfaces/LuaGenericPrompt.cpp:94 GenericPrompt.md game done +function GenericPrompt Show repentogon/LuaInterfaces/LuaGenericPrompt.cpp:89 GenericPrompt.md game done +function GenericPrompt Update repentogon/LuaInterfaces/LuaGenericPrompt.cpp:92 GenericPrompt.md game done +function GridEntitiesSaveStateVector Clear repentogon/LuaInterfaces/LuaEntitySaveState.cpp:547 entities done +function GridEntitiesSaveStateVector Get repentogon/LuaInterfaces/LuaEntitySaveState.cpp:545 GridEntitiesSaveStateVector.md entities done +function GridEntitiesSaveStateVector GetByType repentogon/LuaInterfaces/LuaEntitySaveState.cpp:546 GridEntitiesSaveStateVector.md entities done +function GridEntitiesSaveStateVector __len repentogon/LuaInterfaces/LuaEntitySaveState.cpp:548 GridEntitiesSaveStateVector.md entities done +function GridEntity GetRenderPosition repentogon/LuaInterfaces/GridEntities/LuaGridEntity.cpp:86 GridEntity.md entities done +function GridEntity GetWaterClipFlags repentogon/LuaInterfaces/GridEntities/LuaGridEntity.cpp:88 GridEntity.md entities done +function GridEntity HurtDamage repentogon/LuaInterfaces/GridEntities/LuaGridEntity.cpp:84 GridEntity.md entities done +function GridEntity HurtSurroundings repentogon/LuaInterfaces/GridEntities/LuaGridEntity.cpp:85 entities done +function GridEntity IsBreakableRock repentogon/LuaInterfaces/GridEntities/LuaGridEntity.cpp:87 GridEntity.md entities done +function GridEntity ResetWaterClipFlags repentogon/LuaInterfaces/GridEntities/LuaGridEntity.cpp:90 GridEntity.md entities done +function GridEntity SetWaterClipFlags repentogon/LuaInterfaces/GridEntities/LuaGridEntity.cpp:89 GridEntity.md entities done +function GridEntity ToDecoration repentogon/LuaInterfaces/GridEntities/LuaGridEntityDecoration.cpp:18 GridEntity.md entities done +function GridEntity ToFire repentogon/LuaInterfaces/GridEntities/LuaGridEntityFire.cpp:18 GridEntity.md entities done +function GridEntity ToGravity repentogon/LuaInterfaces/GridEntities/LuaGridEntityGravity.cpp:18 GridEntity.md entities done +function GridEntity ToLock repentogon/LuaInterfaces/GridEntities/LuaGridEntityLock.cpp:27 GridEntity.md entities done +function GridEntity ToStairs repentogon/LuaInterfaces/GridEntities/LuaGridEntityStairs.cpp:18 GridEntity.md entities done +function GridEntity ToStatue repentogon/LuaInterfaces/GridEntities/LuaGridEntityStatue.cpp:18 GridEntity.md entities done +function GridEntity ToTNT GridEntity.md entities done docs only: vanilla changed through a hook +function GridEntity ToTeleporter repentogon/LuaInterfaces/GridEntities/LuaGridEntityTeleporter.cpp:18 GridEntity.md entities done +function GridEntity ToTrapDoor repentogon/LuaInterfaces/GridEntities/LuaGridEntityTrapDoor.cpp:18 GridEntity.md entities done +function GridEntity ToWall repentogon/LuaInterfaces/GridEntities/LuaGridEntityWall.cpp:18 GridEntity.md entities done +function GridEntity ToWeb repentogon/LuaInterfaces/GridEntities/LuaGridEntityWeb.cpp:18 GridEntity.md entities done +function GridEntityDoor GetExtraSprite repentogon/LuaInterfaces/GridEntities/LuaGridEntityDoor.cpp:52 GridEntityDoor.md level and room done +function GridEntityDoor PlayAnimation repentogon/LuaInterfaces/GridEntities/LuaGridEntityDoor.cpp:53 GridEntityDoor.md level and room done +function GridEntityLock TryUnlock repentogon/LuaInterfaces/GridEntities/LuaGridEntityLock.cpp:67 GridEntityLock.md level and room done +function GridEntityRock GetAltRockType repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:94 GridEntityRock.md level and room done +function GridEntityRock PlayBreakSound repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:93 GridEntityRock.md level and room done +function GridEntityRock RegisterRockDestroyed repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:95 GridEntityRock.md level and room done +function GridEntityRock RenderTop repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:89 GridEntityRock.md level and room done +function GridEntityRock SpawnDrops repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:101 GridEntityRock.md level and room done +function GridEntityRock TrySpawnLadder repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:91 GridEntityRock.md level and room done +function GridEntityRock TrySpawnWorms repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:90 GridEntityRock.md level and room done +function GridEntityRock UpdateCollision repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:96 GridEntityRock.md level and room done +function GridEntityRock UpdateNeighbors repentogon/LuaInterfaces/GridEntities/LuaGridEntityRock.cpp:92 GridEntityRock.md level and room done +function HUD FlashRedHearts repentogon/LuaInterfaces/HUD/LuaHUD.cpp:258 HUD.md hud and menus done +function HUD GetBossHPBarFill repentogon/LuaInterfaces/HUD/LuaHUD.cpp:272 HUD.md hud and menus done +function HUD GetCardsPillsSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:262 HUD.md hud and menus done +function HUD GetChargeBarSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:259 HUD.md hud and menus done +function HUD GetCoopMenuSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:268 HUD.md hud and menus done +function HUD GetCoopPlayerMessage repentogon/LuaInterfaces/HUD/LuaHUD.cpp:266 hud and menus done +function HUD GetCraftingSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:270 HUD.md hud and menus done +function HUD GetFortuneSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:267 HUD.md hud and menus done +function HUD GetHeartsSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:260 HUD.md hud and menus done +function HUD GetHistoryHUD repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:195 HUD.md hud and menus done +function HUD GetInventorySprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:269 HUD.md hud and menus done +function HUD GetMainMessage repentogon/LuaInterfaces/HUD/LuaHUD.cpp:264 hud and menus done +function HUD GetPickupsHUDSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:261 HUD.md hud and menus done +function HUD GetPlayerHUD repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:127 HUD.md hud and menus done +function HUD GetPlayerStreakSprite HUD.md hud and menus done docs only: no registration found +function HUD GetPoopSpellSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:271 HUD.md hud and menus done +function HUD GetStackedMessage repentogon/LuaInterfaces/HUD/LuaHUD.cpp:265 hud and menus done +function HUD GetStackedStreakSprite HUD.md hud and menus done docs only: no registration found +function HUD GetStreakSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:263 HUD.md hud and menus done +function HUD SetBossHPBarFill repentogon/LuaInterfaces/HUD/LuaHUD.cpp:273 HUD.md hud and menus done +function HUDMessage GetMainText repentogon/LuaInterfaces/HUD/LuaHUD.cpp:243 hud and menus done +function HUDMessage GetSprite repentogon/LuaInterfaces/HUD/LuaHUD.cpp:239 hud and menus done +function HUDMessage GetSubText repentogon/LuaInterfaces/HUD/LuaHUD.cpp:245 hud and menus done +function HUDMessage Hide repentogon/LuaInterfaces/HUD/LuaHUD.cpp:241 hud and menus done +function HUDMessage IsShowing repentogon/LuaInterfaces/HUD/LuaHUD.cpp:240 hud and menus done +function HUDMessage SetMainText repentogon/LuaInterfaces/HUD/LuaHUD.cpp:244 hud and menus done +function HUDMessage SetSubText repentogon/LuaInterfaces/HUD/LuaHUD.cpp:246 hud and menus done +function HUDMessage Show repentogon/LuaInterfaces/HUD/LuaHUD.cpp:242 hud and menus done +function History GetCollectiblesHistory repentogon/LuaInterfaces/LuaHistory.cpp:93 History.md player done +function History RemoveHistoryItemByIndex repentogon/LuaInterfaces/LuaHistory.cpp:92 History.md player done +function History SearchCollectibles repentogon/LuaInterfaces/LuaHistory.cpp:94 History.md player done +function History SearchTrinkets repentogon/LuaInterfaces/LuaHistory.cpp:95 History.md player done +function HistoryHUD GetCollectibleOffsets repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:202 HistoryHUD.md hud and menus done +function HistoryHUD GetCollectibles repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:201 HistoryHUD.md hud and menus done +function HistoryHUD GetItems repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:200 HistoryHUD.md hud and menus done +function HistoryHUD GetPlayer repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:198 HistoryHUD.md hud and menus done +function HistoryHUD GetPosition repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:199 HistoryHUD.md hud and menus done +function HistoryHUD GetTrinketOffsets repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:204 HistoryHUD.md hud and menus done +function HistoryHUD GetTrinkets repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:203 HistoryHUD.md hud and menus done +function HistoryHUDItem GetHistoryItem repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:215 HistoryHUDItem.md hud and menus done +function HistoryHUDItem GetItemID repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:212 HistoryHUDItem.md hud and menus done +function HistoryHUDItem GetRenderOffset repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:216 HistoryHUDItem.md hud and menus done +function HistoryHUDItem GetTime repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:214 HistoryHUDItem.md hud and menus done +function HistoryHUDItem IsTrinket repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:213 HistoryHUDItem.md hud and menus done +function HistoryHUDItem IsVisible repentogon/LuaInterfaces/HUD/LuaHistoryHUD.cpp:217 HistoryHUDItem.md hud and menus done +function HistoryItem GetItemID repentogon/LuaInterfaces/LuaHistoryItem.cpp:64 HistoryItem.md player done +function HistoryItem GetItemPoolType repentogon/LuaInterfaces/LuaHistoryItem.cpp:68 HistoryItem.md player done +function HistoryItem GetLevelStage repentogon/LuaInterfaces/LuaHistoryItem.cpp:65 HistoryItem.md player done +function HistoryItem GetRoomType repentogon/LuaInterfaces/LuaHistoryItem.cpp:67 HistoryItem.md player done +function HistoryItem GetStageType repentogon/LuaInterfaces/LuaHistoryItem.cpp:66 HistoryItem.md player done +function HistoryItem GetTime repentogon/LuaInterfaces/LuaHistoryItem.cpp:63 HistoryItem.md player done +function HistoryItem IsTrinket repentogon/LuaInterfaces/LuaHistoryItem.cpp:69 HistoryItem.md player done function ImGui AddButton repentogon/ImGuiFeatures/LuaImGui.cpp:1081 ImGui.md console and debug todo function ImGui AddCallback repentogon/ImGuiFeatures/LuaImGui.cpp:1069 ImGui.md console and debug todo function ImGui AddCheckbox repentogon/ImGuiFeatures/LuaImGui.cpp:1090 ImGui.md console and debug todo @@ -1240,86 +1240,86 @@ function ImGui Show repentogon/ImGuiFeatures/LuaImGui.cpp:1122 ImGui.md console function ImGui UpdateData repentogon/ImGuiFeatures/LuaImGui.cpp:1080 ImGui.md console and debug todo function ImGui UpdateText repentogon/ImGuiFeatures/LuaImGui.cpp:1079 ImGui.md console and debug todo function ImGui WorldToImGui repentogon/resources/scripts/main_ex.lua:2050 ImGui.md console and debug done defined in Lua -function Image GetHeight repentogon/LuaInterfaces/LuaRender.cpp:363 render and sprites todo -function Image GetName repentogon/LuaInterfaces/LuaRender.cpp:366 render and sprites todo -function Image GetPaddedHeight repentogon/LuaInterfaces/LuaRender.cpp:365 render and sprites todo -function Image GetPaddedWidth repentogon/LuaInterfaces/LuaRender.cpp:364 render and sprites todo -function Image GetTexelRegion repentogon/LuaInterfaces/LuaRender.cpp:367 render and sprites todo -function Image GetWidth repentogon/LuaInterfaces/LuaRender.cpp:362 render and sprites todo -function Image Render repentogon/LuaInterfaces/LuaRender.cpp:368 render and sprites todo -function Image RenderWithShader repentogon/LuaInterfaces/LuaRender.cpp:369 render and sprites todo -function Input GetActionButtons repentogon/LuaInterfaces/LuaInput.cpp:57 input todo -function Input GetButtonFrame repentogon/LuaInterfaces/LuaInput.cpp:58 input todo -function Input GetDeviceNameByIdx repentogon/LuaInterfaces/LuaInput.cpp:55 Input.md input todo -function Input GetMouseWheel repentogon/LuaInterfaces/LuaInput.cpp:56 Input.md input todo +function Image GetHeight repentogon/LuaInterfaces/LuaRender.cpp:363 render and sprites done +function Image GetName repentogon/LuaInterfaces/LuaRender.cpp:366 render and sprites done +function Image GetPaddedHeight repentogon/LuaInterfaces/LuaRender.cpp:365 render and sprites done +function Image GetPaddedWidth repentogon/LuaInterfaces/LuaRender.cpp:364 render and sprites done +function Image GetTexelRegion repentogon/LuaInterfaces/LuaRender.cpp:367 render and sprites done +function Image GetWidth repentogon/LuaInterfaces/LuaRender.cpp:362 render and sprites done +function Image Render repentogon/LuaInterfaces/LuaRender.cpp:368 render and sprites done +function Image RenderWithShader repentogon/LuaInterfaces/LuaRender.cpp:369 render and sprites done +function Input GetActionButtons repentogon/LuaInterfaces/LuaInput.cpp:57 input done +function Input GetButtonFrame repentogon/LuaInterfaces/LuaInput.cpp:58 input done +function Input GetDeviceNameByIdx repentogon/LuaInterfaces/LuaInput.cpp:55 Input.md input done +function Input GetMouseWheel repentogon/LuaInterfaces/LuaInput.cpp:56 Input.md input done function Isaac AddCallback repentogon/resources/scripts/main_ex.lua:1238 misc done defined in Lua function Isaac AddPriorityCallback repentogon/resources/scripts/main_ex.lua:1196 misc done defined in Lua -function Isaac AllMarksFilled repentogon/Patches/CompletionTracker.cpp:1381 Isaac.md persistent data and saves todo -function Isaac AllTaintedCompletion repentogon/Patches/CompletionTracker.cpp:1382 Isaac.md persistent data and saves todo -function Isaac CanStartTrueCoop repentogon/LuaInterfaces/LuaIsaac.cpp:1053 Isaac.md game todo -function Isaac CenterCursor repentogon/LuaInterfaces/LuaIsaac.cpp:1072 Isaac.md input todo -function Isaac ClearBossHazards repentogon/LuaInterfaces/LuaIsaac.cpp:1108 npc todo -function Isaac ClearChallenge repentogon/LuaInterfaces/LuaIsaac.cpp:1082 Isaac.md game todo -function Isaac ClearCompletionMarks repentogon/Patches/CompletionTracker.cpp:1384 Isaac.md persistent data and saves todo -function Isaac CreateTimer repentogon/LuaInterfaces/LuaIsaac.cpp:1054 Isaac.md misc todo -function Isaac CreateWeapon repentogon/LuaInterfaces/LuaWeapon.cpp:199 Isaac.md tear and weapons todo -function Isaac DestroyWeapon repentogon/LuaInterfaces/LuaWeapon.cpp:200 Isaac.md tear and weapons todo -function Isaac DrawLine repentogon/LuaInterfaces/LuaIsaac.cpp:1057 Isaac.md render and sprites todo -function Isaac DrawQuad repentogon/LuaInterfaces/LuaIsaac.cpp:1056 Isaac.md render and sprites todo -function Isaac FillCompletionMarks repentogon/Patches/CompletionTracker.cpp:1383 Isaac.md persistent data and saves todo -function Isaac FindByType repentogon/LuaInterfaces/LuaIsaac.cpp:1049 Isaac.md misc review -function Isaac FindInCapsule repentogon/LuaInterfaces/LuaIsaac.cpp:1070 Isaac.md misc todo -function Isaac FindInRadius repentogon/LuaInterfaces/LuaIsaac.cpp:1050 Isaac.md misc review -function Isaac FindTargetPit repentogon/LuaInterfaces/LuaIsaac.cpp:1093 Isaac.md misc todo +function Isaac AllMarksFilled repentogon/Patches/CompletionTracker.cpp:1381 Isaac.md persistent data and saves done +function Isaac AllTaintedCompletion repentogon/Patches/CompletionTracker.cpp:1382 Isaac.md persistent data and saves done +function Isaac CanStartTrueCoop repentogon/LuaInterfaces/LuaIsaac.cpp:1053 Isaac.md game done +function Isaac CenterCursor repentogon/LuaInterfaces/LuaIsaac.cpp:1072 Isaac.md input done +function Isaac ClearBossHazards repentogon/LuaInterfaces/LuaIsaac.cpp:1108 npc done +function Isaac ClearChallenge repentogon/LuaInterfaces/LuaIsaac.cpp:1082 Isaac.md game done +function Isaac ClearCompletionMarks repentogon/Patches/CompletionTracker.cpp:1384 Isaac.md persistent data and saves done +function Isaac CreateTimer repentogon/LuaInterfaces/LuaIsaac.cpp:1054 Isaac.md misc done +function Isaac CreateWeapon repentogon/LuaInterfaces/LuaWeapon.cpp:199 Isaac.md tear and weapons done +function Isaac DestroyWeapon repentogon/LuaInterfaces/LuaWeapon.cpp:200 Isaac.md tear and weapons done +function Isaac DrawLine repentogon/LuaInterfaces/LuaIsaac.cpp:1057 Isaac.md render and sprites done +function Isaac DrawQuad repentogon/LuaInterfaces/LuaIsaac.cpp:1056 Isaac.md render and sprites done +function Isaac FillCompletionMarks repentogon/Patches/CompletionTracker.cpp:1383 Isaac.md persistent data and saves done +function Isaac FindByType repentogon/LuaInterfaces/LuaIsaac.cpp:1049 Isaac.md misc done +function Isaac FindInCapsule repentogon/LuaInterfaces/LuaIsaac.cpp:1070 Isaac.md misc done +function Isaac FindInRadius repentogon/LuaInterfaces/LuaIsaac.cpp:1050 Isaac.md misc done +function Isaac FindTargetPit repentogon/LuaInterfaces/LuaIsaac.cpp:1093 Isaac.md misc done function Isaac GetAchievementIdByName repentogon/Patches/AchievementsStuff.cpp:319 Isaac.md persistent data and saves todo function Isaac GetAllowedDoorsMaskForRoomShape repentogon/resources/scripts/main_ex.lua:2160 Isaac.md level and room done defined in Lua -function Isaac GetAxisAlignedUnitVectorFromDir repentogon/LuaInterfaces/LuaIsaac.cpp:1094 Isaac.md misc todo -function Isaac GetBabyIdByName repentogon/LuaInterfaces/LuaIsaac.cpp:1105 Isaac.md misc todo +function Isaac GetAxisAlignedUnitVectorFromDir repentogon/LuaInterfaces/LuaIsaac.cpp:1094 Isaac.md misc done +function Isaac GetBabyIdByName repentogon/LuaInterfaces/LuaIsaac.cpp:1105 Isaac.md misc done function Isaac GetBackdropIdByName repentogon/LuaInterfaces/LuaIsaac.cpp:1090 Isaac.md level and room todo -function Isaac GetBossColorIdByName repentogon/LuaInterfaces/LuaIsaac.cpp:1089 npc todo -function Isaac GetBossColorIdxByName repentogon/LuaInterfaces/LuaIsaac.cpp:1088 Isaac.md npc todo -function Isaac GetButtonsSprite repentogon/LuaInterfaces/LuaIsaac.cpp:1103 Isaac.md render and sprites todo +function Isaac GetBossColorIdByName repentogon/LuaInterfaces/LuaIsaac.cpp:1089 npc done +function Isaac GetBossColorIdxByName repentogon/LuaInterfaces/LuaIsaac.cpp:1088 Isaac.md npc done +function Isaac GetButtonsSprite repentogon/LuaInterfaces/LuaIsaac.cpp:1103 Isaac.md render and sprites done function Isaac GetCallbackIterator repentogon/resources/scripts/main_ex.lua:1120 misc done defined in Lua function Isaac GetCallbacks repentogon/resources/scripts/main_ex.lua:1126 misc done defined in Lua -function Isaac GetClipboard repentogon/LuaInterfaces/LuaIsaac.cpp:1058 Isaac.md misc todo -function Isaac GetCollectibleSpawnPosition repentogon/LuaInterfaces/LuaIsaac.cpp:1067 Isaac.md items and pools todo -function Isaac GetCompletionMark repentogon/Patches/CompletionTracker.cpp:1378 Isaac.md persistent data and saves todo -function Isaac GetCompletionMarkData repentogon/Patches/CompletionTracker.cpp:1377 Isaac.md persistent data and saves todo -function Isaac GetCompletionMarks repentogon/Patches/CompletionTracker.cpp:1376 Isaac.md persistent data and saves todo -function Isaac GetCurrentStageConfigId repentogon/Patches/StagesStuff.cpp:318 Isaac.md level and room todo -function Isaac GetCursorSprite repentogon/LuaInterfaces/LuaIsaac.cpp:1060 Isaac.md render and sprites todo -function Isaac GetCutsceneIdByName repentogon/LuaInterfaces/LuaIsaac.cpp:1063 Isaac.md hud and menus todo -function Isaac GetDwmWindowAttribute repentogon/LuaInterfaces/LuaIsaac.cpp:1074 Isaac.md misc todo +function Isaac GetClipboard repentogon/LuaInterfaces/LuaIsaac.cpp:1058 Isaac.md misc done +function Isaac GetCollectibleSpawnPosition repentogon/LuaInterfaces/LuaIsaac.cpp:1067 Isaac.md items and pools done +function Isaac GetCompletionMark repentogon/Patches/CompletionTracker.cpp:1378 Isaac.md persistent data and saves done +function Isaac GetCompletionMarkData repentogon/Patches/CompletionTracker.cpp:1377 Isaac.md persistent data and saves done +function Isaac GetCompletionMarks repentogon/Patches/CompletionTracker.cpp:1376 Isaac.md persistent data and saves done +function Isaac GetCurrentStageConfigId repentogon/Patches/StagesStuff.cpp:318 Isaac.md level and room done +function Isaac GetCursorSprite repentogon/LuaInterfaces/LuaIsaac.cpp:1060 Isaac.md render and sprites done +function Isaac GetCutsceneIdByName repentogon/LuaInterfaces/LuaIsaac.cpp:1063 Isaac.md hud and menus done +function Isaac GetDwmWindowAttribute repentogon/LuaInterfaces/LuaIsaac.cpp:1074 Isaac.md misc done function Isaac GetEntityConfig repentogon/resources/scripts/main_ex.lua:2098 entities done defined in Lua -function Isaac GetEntitySubTypeByName repentogon/LuaInterfaces/LuaIsaac.cpp:1062 Isaac.md entities todo +function Isaac GetEntitySubTypeByName repentogon/LuaInterfaces/LuaIsaac.cpp:1062 Isaac.md entities done function Isaac GetGiantBookIdByName repentogon/LuaInterfaces/LuaIsaac.cpp:1064 Isaac.md misc todo -function Isaac GetLoadedModules repentogon/LuaInterfaces/LuaIsaac.cpp:1061 Isaac.md misc todo -function Isaac GetLocalizedString repentogon/LuaInterfaces/LuaLocalizationStuff.cpp:78 Isaac.md misc todo -function Isaac GetModChallengeClearCount repentogon/LuaInterfaces/LuaIsaac.cpp:1085 Isaac.md game todo -function Isaac GetModChallengeCompletionData repentogon/LuaInterfaces/LuaIsaac.cpp:1087 Isaac.md persistent data and saves todo -function Isaac GetNanoTime repentogon/LuaInterfaces/LuaIsaac.cpp:1097 Isaac.md misc todo -function Isaac GetNullItemIdByName repentogon/LuaInterfaces/LuaIsaac.cpp:1065 Isaac.md items and pools todo -function Isaac GetPersistentGameData repentogon/LuaInterfaces/LuaPersistentGameData.cpp:185 Isaac.md persistent data and saves todo -function Isaac GetPoolIdByName repentogon/Patches/ItemPoolManager.cpp:2398 Isaac.md items and pools todo -function Isaac GetRenderPosition repentogon/LuaInterfaces/LuaIsaac.cpp:1066 Isaac.md render and sprites todo -function Isaac GetRoomEntities repentogon/LuaInterfaces/LuaIsaac.cpp:1048 Isaac.md level and room review -function Isaac GetString repentogon/LuaInterfaces/LuaLocalizationStuff.cpp:77 Isaac.md misc todo -function Isaac GetWindowTitle repentogon/LuaInterfaces/LuaIsaac.cpp:1076 Isaac.md misc todo +function Isaac GetLoadedModules repentogon/LuaInterfaces/LuaIsaac.cpp:1061 Isaac.md misc done +function Isaac GetLocalizedString repentogon/LuaInterfaces/LuaLocalizationStuff.cpp:78 Isaac.md misc done +function Isaac GetModChallengeClearCount repentogon/LuaInterfaces/LuaIsaac.cpp:1085 Isaac.md game done +function Isaac GetModChallengeCompletionData repentogon/LuaInterfaces/LuaIsaac.cpp:1087 Isaac.md persistent data and saves done +function Isaac GetNanoTime repentogon/LuaInterfaces/LuaIsaac.cpp:1097 Isaac.md misc done +function Isaac GetNullItemIdByName repentogon/LuaInterfaces/LuaIsaac.cpp:1065 Isaac.md items and pools done +function Isaac GetPersistentGameData repentogon/LuaInterfaces/LuaPersistentGameData.cpp:185 Isaac.md persistent data and saves done +function Isaac GetPoolIdByName repentogon/Patches/ItemPoolManager.cpp:2398 Isaac.md items and pools done +function Isaac GetRenderPosition repentogon/LuaInterfaces/LuaIsaac.cpp:1066 Isaac.md render and sprites done +function Isaac GetRoomEntities repentogon/LuaInterfaces/LuaIsaac.cpp:1048 Isaac.md level and room done +function Isaac GetString repentogon/LuaInterfaces/LuaLocalizationStuff.cpp:77 Isaac.md misc done +function Isaac GetWindowTitle repentogon/LuaInterfaces/LuaIsaac.cpp:1076 Isaac.md misc done function Isaac HasModData repentogon/resources/scripts/main_ex.lua:2011 misc done defined in Lua -function Isaac IsChallengeDone repentogon/LuaInterfaces/LuaIsaac.cpp:1081 Isaac.md game todo -function Isaac IsInGame repentogon/LuaInterfaces/LuaIsaac.cpp:1078 Isaac.md game todo -function Isaac IsShuttingDown repentogon/LuaInterfaces/LuaIsaac.cpp:1096 misc todo -function Isaac LevelGeneratorEntry repentogon/LuaInterfaces/LuaLevelGeneratorEntry.cpp:53 Isaac.md level and room todo +function Isaac IsChallengeDone repentogon/LuaInterfaces/LuaIsaac.cpp:1081 Isaac.md game done +function Isaac IsInGame repentogon/LuaInterfaces/LuaIsaac.cpp:1078 Isaac.md game done +function Isaac IsShuttingDown repentogon/LuaInterfaces/LuaIsaac.cpp:1096 misc done +function Isaac LevelGeneratorEntry repentogon/LuaInterfaces/LuaLevelGeneratorEntry.cpp:53 Isaac.md level and room done function Isaac LoadModData repentogon/resources/scripts/main_ex.lua:2027 misc done defined in Lua -function Isaac LoadModDataFromFolder repentogon/LuaInterfaces/LuaIsaac.cpp:1101 Isaac.md misc todo -function Isaac MarkChallengeAsNotDone repentogon/LuaInterfaces/LuaIsaac.cpp:1084 persistent data and saves todo -function Isaac OpenConsole repentogon/ImGuiFeatures/LuaImGui.cpp:1129 Isaac.md console and debug todo -function Isaac PlayCutscene repentogon/LuaInterfaces/LuaIsaac.cpp:1068 Isaac.md hud and menus todo -function Isaac RGON_GetChangelog repentogon/LuaInterfaces/LuaIsaac.cpp:1092 console and debug todo +function Isaac LoadModDataFromFolder repentogon/LuaInterfaces/LuaIsaac.cpp:1101 Isaac.md misc done +function Isaac MarkChallengeAsNotDone repentogon/LuaInterfaces/LuaIsaac.cpp:1084 persistent data and saves done +function Isaac OpenConsole repentogon/ImGuiFeatures/LuaImGui.cpp:1129 Isaac.md console and debug done +function Isaac PlayCutscene repentogon/LuaInterfaces/LuaIsaac.cpp:1068 Isaac.md hud and menus done +function Isaac RGON_GetChangelog repentogon/LuaInterfaces/LuaIsaac.cpp:1092 console and debug done function Isaac RemoveCallback repentogon/resources/scripts/main_ex.lua:1288 misc done defined in Lua function Isaac RemoveModData repentogon/resources/scripts/main_ex.lua:2035 misc done defined in Lua -function Isaac RenderCollectionItem repentogon/LuaInterfaces/LuaIsaac.cpp:1104 Isaac.md render and sprites todo -function Isaac RenderToWorld repentogon/LuaInterfaces/LuaIsaac.cpp:1055 Isaac.md render and sprites todo +function Isaac RenderCollectionItem repentogon/LuaInterfaces/LuaIsaac.cpp:1104 Isaac.md render and sprites done +function Isaac RenderToWorld repentogon/LuaInterfaces/LuaIsaac.cpp:1055 Isaac.md render and sprites done function Isaac ReworkBirthright repentogon/LuaInterfaces/LuaIsaac.cpp:1099 Isaac.md player todo function Isaac ReworkCollectible repentogon/LuaInterfaces/LuaIsaac.cpp:1098 Isaac.md items and pools todo function Isaac ReworkTrinket repentogon/LuaInterfaces/LuaIsaac.cpp:1100 Isaac.md items and pools todo @@ -1333,576 +1333,576 @@ function Isaac RunPreRenderCallback repentogon/resources/scripts/main_ex.lua:188 function Isaac RunTriggerPlayerDeathCallback repentogon/resources/scripts/main_ex.lua:1890 player done defined in Lua function Isaac SaveModData repentogon/resources/scripts/main_ex.lua:2019 persistent data and saves done defined in Lua function Isaac SetCallbackTypeCheck repentogon/resources/scripts/main_ex.lua:728 misc done defined in Lua -function Isaac SetChallengeCompletion repentogon/LuaInterfaces/LuaIsaac.cpp:1086 Isaac.md persistent data and saves todo -function Isaac SetClipboard repentogon/LuaInterfaces/LuaIsaac.cpp:1059 Isaac.md misc todo -function Isaac SetCompletionMark repentogon/Patches/CompletionTracker.cpp:1380 Isaac.md persistent data and saves todo -function Isaac SetCompletionMarks repentogon/Patches/CompletionTracker.cpp:1379 Isaac.md persistent data and saves todo -function Isaac SetCurrentFloorBackdrop repentogon/Patches/StagesStuff.cpp:316 Isaac.md level and room todo -function Isaac SetCurrentFloorMusic repentogon/Patches/StagesStuff.cpp:315 Isaac.md level and room todo -function Isaac SetCurrentFloorName repentogon/Patches/StagesStuff.cpp:317 Isaac.md level and room todo -function Isaac SetDwmWindowAttribute repentogon/LuaInterfaces/LuaIsaac.cpp:1073 Isaac.md misc todo +function Isaac SetChallengeCompletion repentogon/LuaInterfaces/LuaIsaac.cpp:1086 Isaac.md persistent data and saves done +function Isaac SetClipboard repentogon/LuaInterfaces/LuaIsaac.cpp:1059 Isaac.md misc done +function Isaac SetCompletionMark repentogon/Patches/CompletionTracker.cpp:1380 Isaac.md persistent data and saves done +function Isaac SetCompletionMarks repentogon/Patches/CompletionTracker.cpp:1379 Isaac.md persistent data and saves done +function Isaac SetCurrentFloorBackdrop repentogon/Patches/StagesStuff.cpp:316 Isaac.md level and room done +function Isaac SetCurrentFloorMusic repentogon/Patches/StagesStuff.cpp:315 Isaac.md level and room done +function Isaac SetCurrentFloorName repentogon/Patches/StagesStuff.cpp:317 Isaac.md level and room done +function Isaac SetDwmWindowAttribute repentogon/LuaInterfaces/LuaIsaac.cpp:1073 Isaac.md misc done function Isaac SetIcon repentogon/LuaInterfaces/LuaIsaac.cpp:1077 Isaac.md misc todo -function Isaac SetWindowTitle repentogon/LuaInterfaces/LuaIsaac.cpp:1075 Isaac.md misc todo -function Isaac ShowErrorDialog repentogon/LuaInterfaces/LuaIsaac.cpp:1069 Isaac.md console and debug todo -function Isaac SpawnBoss repentogon/LuaInterfaces/LuaIsaac.cpp:1102 Isaac.md npc todo -function Isaac StartDailyGame repentogon/LuaInterfaces/LuaIsaac.cpp:1095 game todo -function Isaac StartNewGame repentogon/LuaInterfaces/LuaIsaac.cpp:1091 Isaac.md game todo -function Isaac TriggerWindowResize repentogon/LuaInterfaces/LuaIsaac.cpp:1071 Isaac.md misc todo -function Isaac UnClearChallenge repentogon/LuaInterfaces/LuaIsaac.cpp:1083 game todo -function Isaac WorldToMenuPosition repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:242 Isaac.md hud and menus todo -function Item AddCustomCacheTag repentogon/LuaInterfaces/LuaItemConfig.cpp:112 ItemConfig_Item.md items and pools todo -function Item AddCustomTag repentogon/LuaInterfaces/LuaItemConfig.cpp:108 ItemConfig_Item.md items and pools todo -function Item GetCustomCacheTags repentogon/LuaInterfaces/LuaItemConfig.cpp:110 ItemConfig_Item.md items and pools todo -function Item GetCustomTags repentogon/LuaInterfaces/LuaItemConfig.cpp:106 ItemConfig_Item.md items and pools todo -function Item HasCustomCacheTag repentogon/LuaInterfaces/LuaItemConfig.cpp:111 ItemConfig_Item.md items and pools todo -function Item HasCustomTag repentogon/LuaInterfaces/LuaItemConfig.cpp:107 ItemConfig_Item.md items and pools todo -function Item RemoveCustomCacheTag repentogon/LuaInterfaces/LuaItemConfig.cpp:113 ItemConfig_Item.md items and pools todo -function Item RemoveCustomTag repentogon/LuaInterfaces/LuaItemConfig.cpp:109 ItemConfig_Item.md items and pools todo -function ItemOverlay GetDelay repentogon/LuaInterfaces/LuaItemOverlay.cpp:82 ItemOverlay.md hud and menus todo -function ItemOverlay GetMegaMushPlayerSprite repentogon/LuaInterfaces/LuaItemOverlay.cpp:84 ItemOverlay.md hud and menus todo -function ItemOverlay GetOverlayID repentogon/LuaInterfaces/LuaItemOverlay.cpp:79 ItemOverlay.md hud and menus todo -function ItemOverlay GetPlayer repentogon/LuaInterfaces/LuaItemOverlay.cpp:83 ItemOverlay.md hud and menus todo -function ItemOverlay GetSprite repentogon/LuaInterfaces/LuaItemOverlay.cpp:81 ItemOverlay.md hud and menus todo -function ItemOverlay Show repentogon/LuaInterfaces/LuaItemOverlay.cpp:80 ItemOverlay.md hud and menus todo -function ItemPool AddBibleUpgrade repentogon/LuaInterfaces/LuaItemPool.cpp:775 ItemPool.md items and pools review +function Isaac SetWindowTitle repentogon/LuaInterfaces/LuaIsaac.cpp:1075 Isaac.md misc done +function Isaac ShowErrorDialog repentogon/LuaInterfaces/LuaIsaac.cpp:1069 Isaac.md console and debug done +function Isaac SpawnBoss repentogon/LuaInterfaces/LuaIsaac.cpp:1102 Isaac.md npc done +function Isaac StartDailyGame repentogon/LuaInterfaces/LuaIsaac.cpp:1095 game done +function Isaac StartNewGame repentogon/LuaInterfaces/LuaIsaac.cpp:1091 Isaac.md game done +function Isaac TriggerWindowResize repentogon/LuaInterfaces/LuaIsaac.cpp:1071 Isaac.md misc done +function Isaac UnClearChallenge repentogon/LuaInterfaces/LuaIsaac.cpp:1083 game done +function Isaac WorldToMenuPosition repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:242 Isaac.md hud and menus done +function Item AddCustomCacheTag repentogon/LuaInterfaces/LuaItemConfig.cpp:112 ItemConfig_Item.md items and pools done +function Item AddCustomTag repentogon/LuaInterfaces/LuaItemConfig.cpp:108 ItemConfig_Item.md items and pools done +function Item GetCustomCacheTags repentogon/LuaInterfaces/LuaItemConfig.cpp:110 ItemConfig_Item.md items and pools done +function Item GetCustomTags repentogon/LuaInterfaces/LuaItemConfig.cpp:106 ItemConfig_Item.md items and pools done +function Item HasCustomCacheTag repentogon/LuaInterfaces/LuaItemConfig.cpp:111 ItemConfig_Item.md items and pools done +function Item HasCustomTag repentogon/LuaInterfaces/LuaItemConfig.cpp:107 ItemConfig_Item.md items and pools done +function Item RemoveCustomCacheTag repentogon/LuaInterfaces/LuaItemConfig.cpp:113 ItemConfig_Item.md items and pools done +function Item RemoveCustomTag repentogon/LuaInterfaces/LuaItemConfig.cpp:109 ItemConfig_Item.md items and pools done +function ItemOverlay GetDelay repentogon/LuaInterfaces/LuaItemOverlay.cpp:82 ItemOverlay.md hud and menus done +function ItemOverlay GetMegaMushPlayerSprite repentogon/LuaInterfaces/LuaItemOverlay.cpp:84 ItemOverlay.md hud and menus done +function ItemOverlay GetOverlayID repentogon/LuaInterfaces/LuaItemOverlay.cpp:79 ItemOverlay.md hud and menus done +function ItemOverlay GetPlayer repentogon/LuaInterfaces/LuaItemOverlay.cpp:83 ItemOverlay.md hud and menus done +function ItemOverlay GetSprite repentogon/LuaInterfaces/LuaItemOverlay.cpp:81 ItemOverlay.md hud and menus done +function ItemOverlay Show repentogon/LuaInterfaces/LuaItemOverlay.cpp:80 ItemOverlay.md hud and menus done +function ItemPool AddBibleUpgrade repentogon/LuaInterfaces/LuaItemPool.cpp:775 ItemPool.md items and pools done function ItemPool AddCollectible repentogon/LuaInterfaces/LuaItemPool.cpp:799 ItemPool.md items and pools todo -function ItemPool AddRoomBlacklist repentogon/LuaInterfaces/LuaItemPool.cpp:776 items and pools review +function ItemPool AddRoomBlacklist repentogon/LuaInterfaces/LuaItemPool.cpp:776 items and pools done function ItemPool AddTemporaryCollectible repentogon/LuaInterfaces/LuaItemPool.cpp:800 ItemPool.md items and pools todo -function ItemPool CanSpawnCollectible repentogon/LuaInterfaces/LuaItemPool.cpp:791 ItemPool.md items and pools todo -function ItemPool GetBibleUpgrades repentogon/LuaInterfaces/LuaItemPool.cpp:796 ItemPool.md items and pools todo -function ItemPool GetCardEx repentogon/LuaInterfaces/LuaItemPool.cpp:779 ItemPool.md items and pools todo -function ItemPool GetCollectible repentogon/LuaInterfaces/LuaItemPool.cpp:774 ItemPool.md items and pools review -function ItemPool GetCollectibleFromList repentogon/LuaInterfaces/LuaItemPool.cpp:782 ItemPool.md items and pools todo -function ItemPool GetCollectiblesFromPool repentogon/LuaInterfaces/LuaItemPool.cpp:789 ItemPool.md items and pools todo -function ItemPool GetNumAvailableTrinkets repentogon/LuaInterfaces/LuaItemPool.cpp:793 ItemPool.md items and pools todo -function ItemPool GetNumItemPools repentogon/LuaInterfaces/LuaItemPool.cpp:798 ItemPool.md items and pools todo -function ItemPool GetPillColor repentogon/LuaInterfaces/LuaItemPool.cpp:795 ItemPool.md items and pools todo -function ItemPool GetRandomPool repentogon/LuaInterfaces/LuaItemPool.cpp:780 ItemPool.md items and pools todo -function ItemPool GetRemovedCollectibles repentogon/LuaInterfaces/LuaItemPool.cpp:787 ItemPool.md items and pools todo -function ItemPool GetRoomBlacklistedCollectibles repentogon/LuaInterfaces/LuaItemPool.cpp:788 ItemPool.md items and pools todo -function ItemPool GetTrinket repentogon/LuaInterfaces/LuaItemPool.cpp:777 items and pools review -function ItemPool HasCollectible repentogon/LuaInterfaces/LuaItemPool.cpp:786 ItemPool.md items and pools todo -function ItemPool HasTrinket repentogon/LuaInterfaces/LuaItemPool.cpp:792 ItemPool.md items and pools todo -function ItemPool PickCollectible repentogon/LuaInterfaces/LuaItemPool.cpp:781 ItemPool.md items and pools todo +function ItemPool CanSpawnCollectible repentogon/LuaInterfaces/LuaItemPool.cpp:791 ItemPool.md items and pools done +function ItemPool GetBibleUpgrades repentogon/LuaInterfaces/LuaItemPool.cpp:796 ItemPool.md items and pools done +function ItemPool GetCardEx repentogon/LuaInterfaces/LuaItemPool.cpp:779 ItemPool.md items and pools done +function ItemPool GetCollectible repentogon/LuaInterfaces/LuaItemPool.cpp:774 ItemPool.md items and pools done +function ItemPool GetCollectibleFromList repentogon/LuaInterfaces/LuaItemPool.cpp:782 ItemPool.md items and pools done +function ItemPool GetCollectiblesFromPool repentogon/LuaInterfaces/LuaItemPool.cpp:789 ItemPool.md items and pools done +function ItemPool GetNumAvailableTrinkets repentogon/LuaInterfaces/LuaItemPool.cpp:793 ItemPool.md items and pools done +function ItemPool GetNumItemPools repentogon/LuaInterfaces/LuaItemPool.cpp:798 ItemPool.md items and pools done +function ItemPool GetPillColor repentogon/LuaInterfaces/LuaItemPool.cpp:795 ItemPool.md items and pools done +function ItemPool GetRandomPool repentogon/LuaInterfaces/LuaItemPool.cpp:780 ItemPool.md items and pools done +function ItemPool GetRemovedCollectibles repentogon/LuaInterfaces/LuaItemPool.cpp:787 ItemPool.md items and pools done +function ItemPool GetRoomBlacklistedCollectibles repentogon/LuaInterfaces/LuaItemPool.cpp:788 ItemPool.md items and pools done +function ItemPool GetTrinket repentogon/LuaInterfaces/LuaItemPool.cpp:777 items and pools done +function ItemPool HasCollectible repentogon/LuaInterfaces/LuaItemPool.cpp:786 ItemPool.md items and pools done +function ItemPool HasTrinket repentogon/LuaInterfaces/LuaItemPool.cpp:792 ItemPool.md items and pools done +function ItemPool PickCollectible repentogon/LuaInterfaces/LuaItemPool.cpp:781 ItemPool.md items and pools done function ItemPool RemoveTemporaryCollectible repentogon/LuaInterfaces/LuaItemPool.cpp:801 ItemPool.md items and pools todo -function ItemPool ResetCollectible repentogon/LuaInterfaces/LuaItemPool.cpp:797 ItemPool.md items and pools todo -function ItemPool SetLastPool repentogon/LuaInterfaces/LuaItemPool.cpp:790 ItemPool.md items and pools todo -function ItemPool UnidentifyPill repentogon/LuaInterfaces/LuaItemPool.cpp:794 ItemPool.md items and pools todo -function KeyConfigMenu GetSelectedColumn repentogon/LuaInterfaces/Menus/LuaKeyConfigMenu.cpp:66 hud and menus todo -function KeyConfigMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaKeyConfigMenu.cpp:64 hud and menus todo -function KeyConfigMenu GetSprite repentogon/LuaInterfaces/Menus/LuaKeyConfigMenu.cpp:63 hud and menus todo -function KeyConfigMenu IsEditActive repentogon/LuaInterfaces/Menus/LuaKeyConfigMenu.cpp:68 hud and menus todo -function KeyConfigMenu SetSelectedColumn repentogon/LuaInterfaces/Menus/LuaKeyConfigMenu.cpp:67 hud and menus todo -function KeyConfigMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaKeyConfigMenu.cpp:65 hud and menus todo -function LRoomAreaDesc GetHighBottomRight repentogon/LuaInterfaces/Room/LuaLRoomAreaDesc.cpp:56 LRoomAreaDesc.md level and room todo -function LRoomAreaDesc GetHighTopLeft repentogon/LuaInterfaces/Room/LuaLRoomAreaDesc.cpp:55 LRoomAreaDesc.md level and room todo -function LRoomAreaDesc GetLowBottomRight repentogon/LuaInterfaces/Room/LuaLRoomAreaDesc.cpp:58 LRoomAreaDesc.md level and room todo -function LRoomAreaDesc GetLowTopLeft repentogon/LuaInterfaces/Room/LuaLRoomAreaDesc.cpp:57 LRoomAreaDesc.md level and room todo -function LRoomTileDesc GetHighBottomRight repentogon/LuaInterfaces/Room/LuaLRoomTileDesc.cpp:76 LRoomTileDesc.md level and room todo -function LRoomTileDesc GetHighTopLeft repentogon/LuaInterfaces/Room/LuaLRoomTileDesc.cpp:75 LRoomTileDesc.md level and room todo -function LRoomTileDesc GetLowBottomRight repentogon/LuaInterfaces/Room/LuaLRoomTileDesc.cpp:78 LRoomTileDesc.md level and room todo -function LRoomTileDesc GetLowTopLeft repentogon/LuaInterfaces/Room/LuaLRoomTileDesc.cpp:77 LRoomTileDesc.md level and room todo -function LRoomTileDesc GetRandomTile repentogon/LuaInterfaces/Room/LuaLRoomTileDesc.cpp:74 LRoomTileDesc.md level and room todo -function LayerState ClearCustomChampionShader repentogon/LuaInterfaces/LuaSprite.cpp:761 LayerState.md render and sprites todo -function LayerState ClearCustomShader repentogon/LuaInterfaces/LuaSprite.cpp:758 LayerState.md render and sprites todo -function LayerState GetBlendMode repentogon/LuaInterfaces/LuaSprite.cpp:748 LayerState.md render and sprites todo -function LayerState GetColor repentogon/LuaInterfaces/LuaSprite.cpp:742 LayerState.md render and sprites todo -function LayerState GetCropOffset repentogon/LuaInterfaces/LuaSprite.cpp:744 LayerState.md render and sprites todo -function LayerState GetDefaultSpritesheetPath repentogon/LuaInterfaces/LuaSprite.cpp:733 LayerState.md render and sprites todo -function LayerState GetFlipX repentogon/LuaInterfaces/LuaSprite.cpp:753 LayerState.md render and sprites todo -function LayerState GetFlipY repentogon/LuaInterfaces/LuaSprite.cpp:755 LayerState.md render and sprites todo -function LayerState GetLayerID repentogon/LuaInterfaces/LuaSprite.cpp:728 LayerState.md render and sprites todo -function LayerState GetName repentogon/LuaInterfaces/LuaSprite.cpp:729 LayerState.md render and sprites todo -function LayerState GetPos repentogon/LuaInterfaces/LuaSprite.cpp:740 LayerState.md render and sprites todo -function LayerState GetRenderFlags repentogon/LuaInterfaces/LuaSprite.cpp:746 LayerState.md render and sprites todo -function LayerState GetRotation repentogon/LuaInterfaces/LuaSprite.cpp:738 LayerState.md render and sprites todo -function LayerState GetSize repentogon/LuaInterfaces/LuaSprite.cpp:736 LayerState.md render and sprites todo -function LayerState GetSpritesheet repentogon/LuaInterfaces/LuaSprite.cpp:731 LayerState.md render and sprites todo -function LayerState GetSpritesheetPath repentogon/LuaInterfaces/LuaSprite.cpp:732 LayerState.md render and sprites todo -function LayerState GetWrapSMode repentogon/LuaInterfaces/LuaSprite.cpp:749 LayerState.md render and sprites todo -function LayerState GetWrapTMode repentogon/LuaInterfaces/LuaSprite.cpp:751 LayerState.md render and sprites todo -function LayerState HasCustomChampionShader repentogon/LuaInterfaces/LuaSprite.cpp:762 LayerState.md render and sprites todo -function LayerState HasCustomShader repentogon/LuaInterfaces/LuaSprite.cpp:759 LayerState.md render and sprites todo -function LayerState IsVisible repentogon/LuaInterfaces/LuaSprite.cpp:734 LayerState.md render and sprites todo -function LayerState SetColor repentogon/LuaInterfaces/LuaSprite.cpp:743 LayerState.md render and sprites todo -function LayerState SetCropOffset repentogon/LuaInterfaces/LuaSprite.cpp:745 LayerState.md render and sprites todo -function LayerState SetCustomChampionShader repentogon/LuaInterfaces/LuaSprite.cpp:760 LayerState.md render and sprites todo -function LayerState SetCustomShader repentogon/LuaInterfaces/LuaSprite.cpp:757 LayerState.md render and sprites todo -function LayerState SetFlipX repentogon/LuaInterfaces/LuaSprite.cpp:754 LayerState.md render and sprites todo -function LayerState SetFlipY repentogon/LuaInterfaces/LuaSprite.cpp:756 LayerState.md render and sprites todo -function LayerState SetPos repentogon/LuaInterfaces/LuaSprite.cpp:741 LayerState.md render and sprites todo -function LayerState SetRenderFlags repentogon/LuaInterfaces/LuaSprite.cpp:747 LayerState.md render and sprites todo -function LayerState SetRotation repentogon/LuaInterfaces/LuaSprite.cpp:739 LayerState.md render and sprites todo -function LayerState SetSize repentogon/LuaInterfaces/LuaSprite.cpp:737 LayerState.md render and sprites todo -function LayerState SetSpritesheet repentogon/LuaInterfaces/LuaSprite.cpp:730 LayerState.md render and sprites todo -function LayerState SetVisible repentogon/LuaInterfaces/LuaSprite.cpp:735 LayerState.md render and sprites todo -function LayerState SetWrapSMode repentogon/LuaInterfaces/LuaSprite.cpp:750 LayerState.md render and sprites todo -function LayerState SetWrapTMode repentogon/LuaInterfaces/LuaSprite.cpp:752 LayerState.md render and sprites todo -function Level CanPlaceRoom repentogon/LuaInterfaces/LuaLevel.cpp:362 Level.md level and room todo -function Level CanPlaceRoomAtDoor repentogon/LuaInterfaces/LuaLevel.cpp:364 Level.md level and room todo -function Level CanSpawnDoorOutline repentogon/LuaInterfaces/LuaLevel.cpp:348 Level.md level and room todo -function Level FindValidRoomPlacementLocations repentogon/LuaInterfaces/LuaLevel.cpp:366 Level.md level and room todo -function Level GetDimension repentogon/LuaInterfaces/LuaLevel.cpp:354 Level.md level and room todo -function Level GetForceSpecialQuest repentogon/LuaInterfaces/LuaLevel.cpp:355 Level.md level and room todo -function Level GetGenerationRNG repentogon/LuaInterfaces/LuaLevel.cpp:368 Level.md level and room todo -function Level GetGreedWavesClearedWithoutRedHeartDamage repentogon/LuaInterfaces/LuaLevel.cpp:360 Level.md level and room todo -function Level GetMyosotisPickups repentogon/LuaInterfaces/LuaLevel.cpp:357 Level.md level and room todo -function Level GetNeighboringRooms repentogon/LuaInterfaces/LuaLevel.cpp:367 Level.md level and room todo -function Level HasAbandonedMineshaft repentogon/LuaInterfaces/LuaLevel.cpp:349 Level.md level and room todo -function Level HasMirrorDimension repentogon/LuaInterfaces/LuaLevel.cpp:350 Level.md level and room todo -function Level HasPhotoDoor repentogon/LuaInterfaces/LuaLevel.cpp:351 Level.md level and room todo +function ItemPool ResetCollectible repentogon/LuaInterfaces/LuaItemPool.cpp:797 ItemPool.md items and pools done +function ItemPool SetLastPool repentogon/LuaInterfaces/LuaItemPool.cpp:790 ItemPool.md items and pools done +function ItemPool UnidentifyPill repentogon/LuaInterfaces/LuaItemPool.cpp:794 ItemPool.md items and pools done +function KeyConfigMenu GetSelectedColumn repentogon/LuaInterfaces/Menus/LuaKeyConfigMenu.cpp:66 hud and menus done +function KeyConfigMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaKeyConfigMenu.cpp:64 hud and menus done +function KeyConfigMenu GetSprite repentogon/LuaInterfaces/Menus/LuaKeyConfigMenu.cpp:63 hud and menus done +function KeyConfigMenu IsEditActive repentogon/LuaInterfaces/Menus/LuaKeyConfigMenu.cpp:68 hud and menus done +function KeyConfigMenu SetSelectedColumn repentogon/LuaInterfaces/Menus/LuaKeyConfigMenu.cpp:67 hud and menus done +function KeyConfigMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaKeyConfigMenu.cpp:65 hud and menus done +function LRoomAreaDesc GetHighBottomRight repentogon/LuaInterfaces/Room/LuaLRoomAreaDesc.cpp:56 LRoomAreaDesc.md level and room done +function LRoomAreaDesc GetHighTopLeft repentogon/LuaInterfaces/Room/LuaLRoomAreaDesc.cpp:55 LRoomAreaDesc.md level and room done +function LRoomAreaDesc GetLowBottomRight repentogon/LuaInterfaces/Room/LuaLRoomAreaDesc.cpp:58 LRoomAreaDesc.md level and room done +function LRoomAreaDesc GetLowTopLeft repentogon/LuaInterfaces/Room/LuaLRoomAreaDesc.cpp:57 LRoomAreaDesc.md level and room done +function LRoomTileDesc GetHighBottomRight repentogon/LuaInterfaces/Room/LuaLRoomTileDesc.cpp:76 LRoomTileDesc.md level and room done +function LRoomTileDesc GetHighTopLeft repentogon/LuaInterfaces/Room/LuaLRoomTileDesc.cpp:75 LRoomTileDesc.md level and room done +function LRoomTileDesc GetLowBottomRight repentogon/LuaInterfaces/Room/LuaLRoomTileDesc.cpp:78 LRoomTileDesc.md level and room done +function LRoomTileDesc GetLowTopLeft repentogon/LuaInterfaces/Room/LuaLRoomTileDesc.cpp:77 LRoomTileDesc.md level and room done +function LRoomTileDesc GetRandomTile repentogon/LuaInterfaces/Room/LuaLRoomTileDesc.cpp:74 LRoomTileDesc.md level and room done +function LayerState ClearCustomChampionShader repentogon/LuaInterfaces/LuaSprite.cpp:761 LayerState.md render and sprites done +function LayerState ClearCustomShader repentogon/LuaInterfaces/LuaSprite.cpp:758 LayerState.md render and sprites done +function LayerState GetBlendMode repentogon/LuaInterfaces/LuaSprite.cpp:748 LayerState.md render and sprites done +function LayerState GetColor repentogon/LuaInterfaces/LuaSprite.cpp:742 LayerState.md render and sprites done +function LayerState GetCropOffset repentogon/LuaInterfaces/LuaSprite.cpp:744 LayerState.md render and sprites done +function LayerState GetDefaultSpritesheetPath repentogon/LuaInterfaces/LuaSprite.cpp:733 LayerState.md render and sprites done +function LayerState GetFlipX repentogon/LuaInterfaces/LuaSprite.cpp:753 LayerState.md render and sprites done +function LayerState GetFlipY repentogon/LuaInterfaces/LuaSprite.cpp:755 LayerState.md render and sprites done +function LayerState GetLayerID repentogon/LuaInterfaces/LuaSprite.cpp:728 LayerState.md render and sprites done +function LayerState GetName repentogon/LuaInterfaces/LuaSprite.cpp:729 LayerState.md render and sprites done +function LayerState GetPos repentogon/LuaInterfaces/LuaSprite.cpp:740 LayerState.md render and sprites done +function LayerState GetRenderFlags repentogon/LuaInterfaces/LuaSprite.cpp:746 LayerState.md render and sprites done +function LayerState GetRotation repentogon/LuaInterfaces/LuaSprite.cpp:738 LayerState.md render and sprites done +function LayerState GetSize repentogon/LuaInterfaces/LuaSprite.cpp:736 LayerState.md render and sprites done +function LayerState GetSpritesheet repentogon/LuaInterfaces/LuaSprite.cpp:731 LayerState.md render and sprites done +function LayerState GetSpritesheetPath repentogon/LuaInterfaces/LuaSprite.cpp:732 LayerState.md render and sprites done +function LayerState GetWrapSMode repentogon/LuaInterfaces/LuaSprite.cpp:749 LayerState.md render and sprites done +function LayerState GetWrapTMode repentogon/LuaInterfaces/LuaSprite.cpp:751 LayerState.md render and sprites done +function LayerState HasCustomChampionShader repentogon/LuaInterfaces/LuaSprite.cpp:762 LayerState.md render and sprites done +function LayerState HasCustomShader repentogon/LuaInterfaces/LuaSprite.cpp:759 LayerState.md render and sprites done +function LayerState IsVisible repentogon/LuaInterfaces/LuaSprite.cpp:734 LayerState.md render and sprites done +function LayerState SetColor repentogon/LuaInterfaces/LuaSprite.cpp:743 LayerState.md render and sprites done +function LayerState SetCropOffset repentogon/LuaInterfaces/LuaSprite.cpp:745 LayerState.md render and sprites done +function LayerState SetCustomChampionShader repentogon/LuaInterfaces/LuaSprite.cpp:760 LayerState.md render and sprites done +function LayerState SetCustomShader repentogon/LuaInterfaces/LuaSprite.cpp:757 LayerState.md render and sprites done +function LayerState SetFlipX repentogon/LuaInterfaces/LuaSprite.cpp:754 LayerState.md render and sprites done +function LayerState SetFlipY repentogon/LuaInterfaces/LuaSprite.cpp:756 LayerState.md render and sprites done +function LayerState SetPos repentogon/LuaInterfaces/LuaSprite.cpp:741 LayerState.md render and sprites done +function LayerState SetRenderFlags repentogon/LuaInterfaces/LuaSprite.cpp:747 LayerState.md render and sprites done +function LayerState SetRotation repentogon/LuaInterfaces/LuaSprite.cpp:739 LayerState.md render and sprites done +function LayerState SetSize repentogon/LuaInterfaces/LuaSprite.cpp:737 LayerState.md render and sprites done +function LayerState SetSpritesheet repentogon/LuaInterfaces/LuaSprite.cpp:730 LayerState.md render and sprites done +function LayerState SetVisible repentogon/LuaInterfaces/LuaSprite.cpp:735 LayerState.md render and sprites done +function LayerState SetWrapSMode repentogon/LuaInterfaces/LuaSprite.cpp:750 LayerState.md render and sprites done +function LayerState SetWrapTMode repentogon/LuaInterfaces/LuaSprite.cpp:752 LayerState.md render and sprites done +function Level CanPlaceRoom repentogon/LuaInterfaces/LuaLevel.cpp:362 Level.md level and room done +function Level CanPlaceRoomAtDoor repentogon/LuaInterfaces/LuaLevel.cpp:364 Level.md level and room done +function Level CanSpawnDoorOutline repentogon/LuaInterfaces/LuaLevel.cpp:348 Level.md level and room done +function Level FindValidRoomPlacementLocations repentogon/LuaInterfaces/LuaLevel.cpp:366 Level.md level and room done +function Level GetDimension repentogon/LuaInterfaces/LuaLevel.cpp:354 Level.md level and room done +function Level GetForceSpecialQuest repentogon/LuaInterfaces/LuaLevel.cpp:355 Level.md level and room done +function Level GetGenerationRNG repentogon/LuaInterfaces/LuaLevel.cpp:368 Level.md level and room done +function Level GetGreedWavesClearedWithoutRedHeartDamage repentogon/LuaInterfaces/LuaLevel.cpp:360 Level.md level and room done +function Level GetMyosotisPickups repentogon/LuaInterfaces/LuaLevel.cpp:357 Level.md level and room done +function Level GetNeighboringRooms repentogon/LuaInterfaces/LuaLevel.cpp:367 Level.md level and room done +function Level HasAbandonedMineshaft repentogon/LuaInterfaces/LuaLevel.cpp:349 Level.md level and room done +function Level HasMirrorDimension repentogon/LuaInterfaces/LuaLevel.cpp:350 Level.md level and room done +function Level HasPhotoDoor repentogon/LuaInterfaces/LuaLevel.cpp:351 Level.md level and room done function Level IsStageAvailable repentogon/LuaInterfaces/LuaLevel.cpp:353 Level.md level and room todo -function Level PlaceRoom repentogon/LuaInterfaces/LuaLevelGeneratorEntry.cpp:54 Level.md level and room todo -function Level SetForceSpecialQuest repentogon/LuaInterfaces/LuaLevel.cpp:356 Level.md level and room todo -function Level SetGreedWavesClearedWithoutRedHeartDamage repentogon/LuaInterfaces/LuaLevel.cpp:359 Level.md level and room todo -function Level SetName repentogon/LuaInterfaces/LuaLevel.cpp:352 Level.md level and room todo -function Level TryPlaceRoom repentogon/LuaInterfaces/LuaLevel.cpp:363 Level.md level and room todo -function Level TryPlaceRoomAtDoor repentogon/LuaInterfaces/LuaLevel.cpp:365 Level.md level and room todo -function LevelGenerator GetAllRooms repentogon/LuaInterfaces/LuaLevelGenerator.cpp:794 LevelGenerator.md level and room todo -function LevelGenerator GetDeadEnds repentogon/LuaInterfaces/LuaLevelGenerator.cpp:795 LevelGenerator.md level and room todo -function LevelGenerator GetNonDeadEnds repentogon/LuaInterfaces/LuaLevelGenerator.cpp:796 LevelGenerator.md level and room todo +function Level PlaceRoom repentogon/LuaInterfaces/LuaLevelGeneratorEntry.cpp:54 Level.md level and room done +function Level SetForceSpecialQuest repentogon/LuaInterfaces/LuaLevel.cpp:356 Level.md level and room done +function Level SetGreedWavesClearedWithoutRedHeartDamage repentogon/LuaInterfaces/LuaLevel.cpp:359 Level.md level and room done +function Level SetName repentogon/LuaInterfaces/LuaLevel.cpp:352 Level.md level and room done +function Level TryPlaceRoom repentogon/LuaInterfaces/LuaLevel.cpp:363 Level.md level and room done +function Level TryPlaceRoomAtDoor repentogon/LuaInterfaces/LuaLevel.cpp:365 Level.md level and room done +function LevelGenerator GetAllRooms repentogon/LuaInterfaces/LuaLevelGenerator.cpp:794 LevelGenerator.md level and room done +function LevelGenerator GetDeadEnds repentogon/LuaInterfaces/LuaLevelGenerator.cpp:795 LevelGenerator.md level and room done +function LevelGenerator GetNonDeadEnds repentogon/LuaInterfaces/LuaLevelGenerator.cpp:796 LevelGenerator.md level and room done function LevelGenerator PlaceRoom repentogon/LuaInterfaces/LuaLevelGenerator.cpp:797 LevelGenerator.md level and room todo -function LevelGeneratorEntry SetAllowedDoors repentogon/LuaInterfaces/LuaLevelGeneratorEntry.cpp:59 LevelGeneratorEntry.md level and room todo -function LevelGeneratorEntry SetColIdx repentogon/LuaInterfaces/LuaLevelGeneratorEntry.cpp:57 LevelGeneratorEntry.md level and room todo -function LevelGeneratorEntry SetLineIdx repentogon/LuaInterfaces/LuaLevelGeneratorEntry.cpp:58 LevelGeneratorEntry.md level and room todo -function LevelGeneratorRoom Column repentogon/LuaInterfaces/LuaLevelGenerator.cpp:808 LevelGeneratorRoom.md level and room todo -function LevelGeneratorRoom DoorMask repentogon/LuaInterfaces/LuaLevelGenerator.cpp:807 LevelGeneratorRoom.md level and room todo -function LevelGeneratorRoom GenerationIndex repentogon/LuaInterfaces/LuaLevelGenerator.cpp:806 LevelGeneratorRoom.md level and room todo -function LevelGeneratorRoom IsDeadEnd repentogon/LuaInterfaces/LuaLevelGenerator.cpp:812 LevelGeneratorRoom.md level and room todo -function LevelGeneratorRoom Neighbors repentogon/LuaInterfaces/LuaLevelGenerator.cpp:811 LevelGeneratorRoom.md level and room todo -function LevelGeneratorRoom Row repentogon/LuaInterfaces/LuaLevelGenerator.cpp:809 LevelGeneratorRoom.md level and room todo -function LevelGeneratorRoom Shape repentogon/LuaInterfaces/LuaLevelGenerator.cpp:810 LevelGeneratorRoom.md level and room todo -function LootList GetEntries repentogon/LuaInterfaces/LuaLootList.cpp:115 LootList.md items and pools todo -function LootList PushEntry repentogon/LuaInterfaces/LuaLootList.cpp:116 LootList.md items and pools todo -function LootListEntry GetRNG repentogon/LuaInterfaces/LuaLootListEntry.cpp:51 LootListEntry.md items and pools todo -function LootListEntry GetSeed repentogon/LuaInterfaces/LuaLootListEntry.cpp:50 LootListEntry.md items and pools todo -function LootListEntry GetSubType repentogon/LuaInterfaces/LuaLootListEntry.cpp:49 LootListEntry.md items and pools todo -function LootListEntry GetType repentogon/LuaInterfaces/LuaLootListEntry.cpp:47 LootListEntry.md items and pools todo -function LootListEntry GetVariant repentogon/LuaInterfaces/LuaLootListEntry.cpp:48 LootListEntry.md items and pools todo -function MainMenu GetContinueWidgetSprite repentogon/LuaInterfaces/Menus/LuaMainMenu.cpp:47 hud and menus todo -function MainMenu GetGameMenuSprite repentogon/LuaInterfaces/Menus/LuaMainMenu.cpp:46 hud and menus todo -function MainMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaMainMenu.cpp:48 hud and menus todo -function MainMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaMainMenu.cpp:49 hud and menus todo -function MenuManager GetActiveMenu repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:250 hud and menus todo -function MenuManager GetColorModifierLerpAmount repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:254 hud and menus todo -function MenuManager GetCurrentColorModifier repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:252 hud and menus todo -function MenuManager GetInputMask repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:259 hud and menus todo -function MenuManager GetSeeds repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:262 hud and menus todo -function MenuManager GetShadowSprite repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:245 hud and menus todo -function MenuManager GetTargetColorModifier repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:253 hud and menus todo -function MenuManager GetViewPosition repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:257 hud and menus todo -function MenuManager IsActive repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:261 hud and menus todo -function MenuManager SetActiveMenu repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:249 hud and menus todo -function MenuManager SetColorModifier repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:255 hud and menus todo -function MenuManager SetInputMask repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:260 hud and menus todo -function MenuManager SetViewPosition repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:258 hud and menus todo -function Minimap GetDisplayedSize repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:110 Minimap.md hud and menus todo -function Minimap GetHoldTime repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:108 Minimap.md hud and menus todo -function Minimap GetIconsSprite repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:112 Minimap.md hud and menus todo -function Minimap GetItemIconsSprite repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:111 Minimap.md hud and menus todo -function Minimap GetShakeDuration repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:113 Minimap.md hud and menus todo -function Minimap GetShakeOffset repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:115 Minimap.md hud and menus todo -function Minimap GetState repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:106 Minimap.md hud and menus todo -function Minimap Refresh repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:117 Minimap.md hud and menus todo -function Minimap SetHoldTime repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:109 Minimap.md hud and menus todo -function Minimap SetShakeDuration repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:114 Minimap.md hud and menus todo -function Minimap SetShakeOffset repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:116 Minimap.md hud and menus todo -function Minimap SetState repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:107 Minimap.md hud and menus todo -function MinimapConfig GetBorderPadding repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:112 hud and menus todo -function MinimapConfig GetBorderScale repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:116 hud and menus todo -function MinimapConfig GetI1 repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:118 hud and menus todo -function MinimapConfig GetI2 repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:120 hud and menus todo -function MinimapConfig GetIconNum repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:122 hud and menus todo -function MinimapConfig GetPosOffsetX repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:114 hud and menus todo -function MinimapConfig GetSprite repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:109 hud and menus todo -function MinimapConfig GetVec1 repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:110 hud and menus todo -function MinimapConfig SetBorderPadding repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:113 hud and menus todo -function MinimapConfig SetBorderScale repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:117 hud and menus todo -function MinimapConfig SetI1 repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:119 hud and menus todo -function MinimapConfig SetI2 repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:121 hud and menus todo -function MinimapConfig SetIconNum repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:123 hud and menus todo -function MinimapConfig SetPosOffsetX repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:115 hud and menus todo -function MinimapConfig SetVec1 repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:111 hud and menus todo -function ModsMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaModsMenu.cpp:56 hud and menus todo -function ModsMenu GetSprite repentogon/LuaInterfaces/Menus/LuaModsMenu.cpp:55 hud and menus todo -function ModsMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaModsMenu.cpp:57 hud and menus todo -function ModsMenu WasListEdited repentogon/LuaInterfaces/Menus/LuaModsMenu.cpp:58 hud and menus todo -function MultiShotParams GetMultiEyeAngle repentogon/LuaInterfaces/LuaMultiShotParams.cpp:219 MultiShotParams.md tear and weapons todo -function MultiShotParams GetNumEyesActive repentogon/LuaInterfaces/LuaMultiShotParams.cpp:217 MultiShotParams.md tear and weapons todo -function MultiShotParams GetNumLanesPerEye repentogon/LuaInterfaces/LuaMultiShotParams.cpp:215 MultiShotParams.md tear and weapons todo -function MultiShotParams GetNumRandomDirTears repentogon/LuaInterfaces/LuaMultiShotParams.cpp:218 MultiShotParams.md tear and weapons todo -function MultiShotParams GetNumTears repentogon/LuaInterfaces/LuaMultiShotParams.cpp:214 MultiShotParams.md tear and weapons todo -function MultiShotParams GetSpreadAngle repentogon/LuaInterfaces/LuaMultiShotParams.cpp:216 MultiShotParams.md tear and weapons todo -function MultiShotParams IsCrossEyed repentogon/LuaInterfaces/LuaMultiShotParams.cpp:220 MultiShotParams.md tear and weapons todo -function MultiShotParams IsShootingBackwards repentogon/LuaInterfaces/LuaMultiShotParams.cpp:221 MultiShotParams.md tear and weapons todo -function MultiShotParams IsShootingSideways repentogon/LuaInterfaces/LuaMultiShotParams.cpp:222 MultiShotParams.md tear and weapons todo -function MultiShotParams SetIsCrossEyed repentogon/LuaInterfaces/LuaMultiShotParams.cpp:228 MultiShotParams.md tear and weapons todo -function MultiShotParams SetIsShootingBackwards repentogon/LuaInterfaces/LuaMultiShotParams.cpp:229 MultiShotParams.md tear and weapons todo -function MultiShotParams SetIsShootingSideways repentogon/LuaInterfaces/LuaMultiShotParams.cpp:230 MultiShotParams.md tear and weapons todo -function MultiShotParams SetMultiEyeAngle repentogon/LuaInterfaces/LuaMultiShotParams.cpp:227 MultiShotParams.md tear and weapons todo -function MultiShotParams SetNumEyesActive repentogon/LuaInterfaces/LuaMultiShotParams.cpp:226 MultiShotParams.md tear and weapons todo -function MultiShotParams SetNumLanesPerEye repentogon/LuaInterfaces/LuaMultiShotParams.cpp:224 MultiShotParams.md tear and weapons todo -function MultiShotParams SetNumRandomDirTears repentogon/LuaInterfaces/LuaMultiShotParams.cpp:231 MultiShotParams.md tear and weapons todo -function MultiShotParams SetNumTears repentogon/LuaInterfaces/LuaMultiShotParams.cpp:223 MultiShotParams.md tear and weapons todo -function MultiShotParams SetSpreadAngle repentogon/LuaInterfaces/LuaMultiShotParams.cpp:225 MultiShotParams.md tear and weapons todo -function MusicManager Crossfade repentogon/LuaInterfaces/LuaMusicManager.cpp:107 MusicManager.md audio review -function MusicManager Fadein repentogon/LuaInterfaces/LuaMusicManager.cpp:108 MusicManager.md audio review -function MusicManager GetCurrentJingleID repentogon/LuaInterfaces/LuaMusicManager.cpp:113 MusicManager.md audio todo -function MusicManager GetCurrentPitch repentogon/LuaInterfaces/LuaMusicManager.cpp:114 MusicManager.md audio todo -function MusicManager Play repentogon/LuaInterfaces/LuaMusicManager.cpp:106 MusicManager.md audio review -function MusicManager PlayJingle repentogon/LuaInterfaces/LuaMusicManager.cpp:111 MusicManager.md audio todo -function MusicManager SetCurrentPitch repentogon/LuaInterfaces/LuaMusicManager.cpp:115 MusicManager.md audio todo -function MusicManager StopJingle repentogon/LuaInterfaces/LuaMusicManager.cpp:112 MusicManager.md audio todo -function NightmareScene GetBackgroundSprite repentogon/LuaInterfaces/LuaNightmareScene.cpp:82 NightmareScene.md hud and menus todo -function NightmareScene GetBubbleSprite repentogon/LuaInterfaces/LuaNightmareScene.cpp:83 NightmareScene.md hud and menus todo -function NightmareScene GetPlayerExtraPortraitSprite repentogon/LuaInterfaces/LuaNightmareScene.cpp:87 NightmareScene.md hud and menus todo -function NightmareScene GetProgressBarMap repentogon/LuaInterfaces/LuaNightmareScene.cpp:85 NightmareScene.md hud and menus todo -function NightmareScene GetProgressBarSprite repentogon/LuaInterfaces/LuaNightmareScene.cpp:84 NightmareScene.md hud and menus todo -function NightmareScene IsDogmaNightmare repentogon/LuaInterfaces/LuaNightmareScene.cpp:86 NightmareScene.md hud and menus todo -function NullFrame GetColor repentogon/LuaInterfaces/LuaNullFrame.cpp:88 NullFrame.md render and sprites todo -function NullFrame GetPos repentogon/LuaInterfaces/LuaNullFrame.cpp:84 NullFrame.md render and sprites todo -function NullFrame GetRotation repentogon/LuaInterfaces/LuaNullFrame.cpp:85 NullFrame.md render and sprites todo -function NullFrame GetScale repentogon/LuaInterfaces/LuaNullFrame.cpp:87 NullFrame.md render and sprites todo -function NullFrame IsVisible repentogon/LuaInterfaces/LuaNullFrame.cpp:86 NullFrame.md render and sprites todo -function OptionsMenu GetGammaWidgetSprite repentogon/LuaInterfaces/Menus/LuaOptionsMenu.cpp:52 hud and menus todo -function OptionsMenu GetOptionsMenuSprite repentogon/LuaInterfaces/Menus/LuaOptionsMenu.cpp:51 hud and menus todo -function OptionsMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaOptionsMenu.cpp:53 hud and menus todo -function OptionsMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaOptionsMenu.cpp:54 hud and menus todo -function PathFinder Find Pathfinder.md npc todo docs only: vanilla changed through a hook -function PathFinder Move Pathfinder.md npc todo docs only: vanilla changed through a hook -function PauseMenu GetCompletionMarksSprite repentogon/LuaInterfaces/LuaPauseMenu.cpp:83 hud and menus todo -function PauseMenu GetMyStuffSprite repentogon/LuaInterfaces/LuaPauseMenu.cpp:82 hud and menus todo -function PauseMenu GetSelectedElement repentogon/LuaInterfaces/LuaPauseMenu.cpp:84 hud and menus todo -function PauseMenu GetSprite repentogon/LuaInterfaces/LuaPauseMenu.cpp:80 hud and menus todo -function PauseMenu GetState repentogon/LuaInterfaces/LuaPauseMenu.cpp:86 hud and menus todo -function PauseMenu GetStatsSprite repentogon/LuaInterfaces/LuaPauseMenu.cpp:81 hud and menus todo -function PauseMenu SetSelectedElement repentogon/LuaInterfaces/LuaPauseMenu.cpp:85 hud and menus todo -function PauseMenu SetState repentogon/LuaInterfaces/LuaPauseMenu.cpp:87 hud and menus todo -function PersistentGameData AddBestiaryKill repentogon/LuaInterfaces/LuaPersistentGameData.cpp:198 PersistentGameData.md persistent data and saves todo -function PersistentGameData AddBossKilled repentogon/LuaInterfaces/LuaPersistentGameData.cpp:199 PersistentGameData.md persistent data and saves todo -function PersistentGameData GetBestiaryDeathCount repentogon/LuaInterfaces/LuaPersistentGameData.cpp:196 PersistentGameData.md persistent data and saves todo -function PersistentGameData GetBestiaryEncounterCount repentogon/LuaInterfaces/LuaPersistentGameData.cpp:197 PersistentGameData.md persistent data and saves todo -function PersistentGameData GetBestiaryKillCount repentogon/LuaInterfaces/LuaPersistentGameData.cpp:195 PersistentGameData.md persistent data and saves todo -function PersistentGameData GetEventCounter repentogon/LuaInterfaces/LuaPersistentGameData.cpp:192 PersistentGameData.md persistent data and saves todo -function PersistentGameData IncreaseEventCounter repentogon/LuaInterfaces/LuaPersistentGameData.cpp:191 PersistentGameData.md persistent data and saves todo -function PersistentGameData IsBossKilled repentogon/LuaInterfaces/LuaPersistentGameData.cpp:200 PersistentGameData.md persistent data and saves todo -function PersistentGameData IsChallengeCompleted repentogon/LuaInterfaces/LuaPersistentGameData.cpp:194 PersistentGameData.md persistent data and saves todo -function PersistentGameData IsItemInCollection repentogon/LuaInterfaces/LuaPersistentGameData.cpp:193 PersistentGameData.md persistent data and saves todo -function PersistentGameData TryUnlock repentogon/LuaInterfaces/LuaPersistentGameData.cpp:189 PersistentGameData.md persistent data and saves todo -function PersistentGameData Unlock repentogon/LuaInterfaces/LuaPersistentGameData.cpp:188 PersistentGameData.md persistent data and saves todo -function PersistentGameData Unlocked repentogon/LuaInterfaces/LuaPersistentGameData.cpp:190 PersistentGameData.md persistent data and saves todo +function LevelGeneratorEntry SetAllowedDoors repentogon/LuaInterfaces/LuaLevelGeneratorEntry.cpp:59 LevelGeneratorEntry.md level and room done +function LevelGeneratorEntry SetColIdx repentogon/LuaInterfaces/LuaLevelGeneratorEntry.cpp:57 LevelGeneratorEntry.md level and room done +function LevelGeneratorEntry SetLineIdx repentogon/LuaInterfaces/LuaLevelGeneratorEntry.cpp:58 LevelGeneratorEntry.md level and room done +function LevelGeneratorRoom Column repentogon/LuaInterfaces/LuaLevelGenerator.cpp:808 LevelGeneratorRoom.md level and room done +function LevelGeneratorRoom DoorMask repentogon/LuaInterfaces/LuaLevelGenerator.cpp:807 LevelGeneratorRoom.md level and room done +function LevelGeneratorRoom GenerationIndex repentogon/LuaInterfaces/LuaLevelGenerator.cpp:806 LevelGeneratorRoom.md level and room done +function LevelGeneratorRoom IsDeadEnd repentogon/LuaInterfaces/LuaLevelGenerator.cpp:812 LevelGeneratorRoom.md level and room done +function LevelGeneratorRoom Neighbors repentogon/LuaInterfaces/LuaLevelGenerator.cpp:811 LevelGeneratorRoom.md level and room done +function LevelGeneratorRoom Row repentogon/LuaInterfaces/LuaLevelGenerator.cpp:809 LevelGeneratorRoom.md level and room done +function LevelGeneratorRoom Shape repentogon/LuaInterfaces/LuaLevelGenerator.cpp:810 LevelGeneratorRoom.md level and room done +function LootList GetEntries repentogon/LuaInterfaces/LuaLootList.cpp:115 LootList.md items and pools done +function LootList PushEntry repentogon/LuaInterfaces/LuaLootList.cpp:116 LootList.md items and pools done +function LootListEntry GetRNG repentogon/LuaInterfaces/LuaLootListEntry.cpp:51 LootListEntry.md items and pools done +function LootListEntry GetSeed repentogon/LuaInterfaces/LuaLootListEntry.cpp:50 LootListEntry.md items and pools done +function LootListEntry GetSubType repentogon/LuaInterfaces/LuaLootListEntry.cpp:49 LootListEntry.md items and pools done +function LootListEntry GetType repentogon/LuaInterfaces/LuaLootListEntry.cpp:47 LootListEntry.md items and pools done +function LootListEntry GetVariant repentogon/LuaInterfaces/LuaLootListEntry.cpp:48 LootListEntry.md items and pools done +function MainMenu GetContinueWidgetSprite repentogon/LuaInterfaces/Menus/LuaMainMenu.cpp:47 hud and menus done +function MainMenu GetGameMenuSprite repentogon/LuaInterfaces/Menus/LuaMainMenu.cpp:46 hud and menus done +function MainMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaMainMenu.cpp:48 hud and menus done +function MainMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaMainMenu.cpp:49 hud and menus done +function MenuManager GetActiveMenu repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:250 hud and menus done +function MenuManager GetColorModifierLerpAmount repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:254 hud and menus done +function MenuManager GetCurrentColorModifier repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:252 hud and menus done +function MenuManager GetInputMask repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:259 hud and menus done +function MenuManager GetSeeds repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:262 hud and menus done +function MenuManager GetShadowSprite repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:245 hud and menus done +function MenuManager GetTargetColorModifier repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:253 hud and menus done +function MenuManager GetViewPosition repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:257 hud and menus done +function MenuManager IsActive repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:261 hud and menus done +function MenuManager SetActiveMenu repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:249 hud and menus done +function MenuManager SetColorModifier repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:255 hud and menus done +function MenuManager SetInputMask repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:260 hud and menus done +function MenuManager SetViewPosition repentogon/LuaInterfaces/Menus/LuaMenuManager.cpp:258 hud and menus done +function Minimap GetDisplayedSize repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:110 Minimap.md hud and menus done +function Minimap GetHoldTime repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:108 Minimap.md hud and menus done +function Minimap GetIconsSprite repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:112 Minimap.md hud and menus done +function Minimap GetItemIconsSprite repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:111 Minimap.md hud and menus done +function Minimap GetShakeDuration repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:113 Minimap.md hud and menus done +function Minimap GetShakeOffset repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:115 Minimap.md hud and menus done +function Minimap GetState repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:106 Minimap.md hud and menus done +function Minimap Refresh repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:117 Minimap.md hud and menus done +function Minimap SetHoldTime repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:109 Minimap.md hud and menus done +function Minimap SetShakeDuration repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:114 Minimap.md hud and menus done +function Minimap SetShakeOffset repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:116 Minimap.md hud and menus done +function Minimap SetState repentogon/LuaInterfaces/HUD/LuaMinimap.cpp:107 Minimap.md hud and menus done +function MinimapConfig GetBorderPadding repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:112 hud and menus done +function MinimapConfig GetBorderScale repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:116 hud and menus done +function MinimapConfig GetI1 repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:118 hud and menus done +function MinimapConfig GetI2 repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:120 hud and menus done +function MinimapConfig GetIconNum repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:122 hud and menus done +function MinimapConfig GetPosOffsetX repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:114 hud and menus done +function MinimapConfig GetSprite repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:109 hud and menus done +function MinimapConfig GetVec1 repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:110 hud and menus done +function MinimapConfig SetBorderPadding repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:113 hud and menus done +function MinimapConfig SetBorderScale repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:117 hud and menus done +function MinimapConfig SetI1 repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:119 hud and menus done +function MinimapConfig SetI2 repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:121 hud and menus done +function MinimapConfig SetIconNum repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:123 hud and menus done +function MinimapConfig SetPosOffsetX repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:115 hud and menus done +function MinimapConfig SetVec1 repentogon/LuaInterfaces/HUD/LuaMinimapConfig.cpp:111 hud and menus done +function ModsMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaModsMenu.cpp:56 hud and menus done +function ModsMenu GetSprite repentogon/LuaInterfaces/Menus/LuaModsMenu.cpp:55 hud and menus done +function ModsMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaModsMenu.cpp:57 hud and menus done +function ModsMenu WasListEdited repentogon/LuaInterfaces/Menus/LuaModsMenu.cpp:58 hud and menus done +function MultiShotParams GetMultiEyeAngle repentogon/LuaInterfaces/LuaMultiShotParams.cpp:219 MultiShotParams.md tear and weapons done +function MultiShotParams GetNumEyesActive repentogon/LuaInterfaces/LuaMultiShotParams.cpp:217 MultiShotParams.md tear and weapons done +function MultiShotParams GetNumLanesPerEye repentogon/LuaInterfaces/LuaMultiShotParams.cpp:215 MultiShotParams.md tear and weapons done +function MultiShotParams GetNumRandomDirTears repentogon/LuaInterfaces/LuaMultiShotParams.cpp:218 MultiShotParams.md tear and weapons done +function MultiShotParams GetNumTears repentogon/LuaInterfaces/LuaMultiShotParams.cpp:214 MultiShotParams.md tear and weapons done +function MultiShotParams GetSpreadAngle repentogon/LuaInterfaces/LuaMultiShotParams.cpp:216 MultiShotParams.md tear and weapons done +function MultiShotParams IsCrossEyed repentogon/LuaInterfaces/LuaMultiShotParams.cpp:220 MultiShotParams.md tear and weapons done +function MultiShotParams IsShootingBackwards repentogon/LuaInterfaces/LuaMultiShotParams.cpp:221 MultiShotParams.md tear and weapons done +function MultiShotParams IsShootingSideways repentogon/LuaInterfaces/LuaMultiShotParams.cpp:222 MultiShotParams.md tear and weapons done +function MultiShotParams SetIsCrossEyed repentogon/LuaInterfaces/LuaMultiShotParams.cpp:228 MultiShotParams.md tear and weapons done +function MultiShotParams SetIsShootingBackwards repentogon/LuaInterfaces/LuaMultiShotParams.cpp:229 MultiShotParams.md tear and weapons done +function MultiShotParams SetIsShootingSideways repentogon/LuaInterfaces/LuaMultiShotParams.cpp:230 MultiShotParams.md tear and weapons done +function MultiShotParams SetMultiEyeAngle repentogon/LuaInterfaces/LuaMultiShotParams.cpp:227 MultiShotParams.md tear and weapons done +function MultiShotParams SetNumEyesActive repentogon/LuaInterfaces/LuaMultiShotParams.cpp:226 MultiShotParams.md tear and weapons done +function MultiShotParams SetNumLanesPerEye repentogon/LuaInterfaces/LuaMultiShotParams.cpp:224 MultiShotParams.md tear and weapons done +function MultiShotParams SetNumRandomDirTears repentogon/LuaInterfaces/LuaMultiShotParams.cpp:231 MultiShotParams.md tear and weapons done +function MultiShotParams SetNumTears repentogon/LuaInterfaces/LuaMultiShotParams.cpp:223 MultiShotParams.md tear and weapons done +function MultiShotParams SetSpreadAngle repentogon/LuaInterfaces/LuaMultiShotParams.cpp:225 MultiShotParams.md tear and weapons done +function MusicManager Crossfade repentogon/LuaInterfaces/LuaMusicManager.cpp:107 MusicManager.md audio done +function MusicManager Fadein repentogon/LuaInterfaces/LuaMusicManager.cpp:108 MusicManager.md audio done +function MusicManager GetCurrentJingleID repentogon/LuaInterfaces/LuaMusicManager.cpp:113 MusicManager.md audio done +function MusicManager GetCurrentPitch repentogon/LuaInterfaces/LuaMusicManager.cpp:114 MusicManager.md audio done +function MusicManager Play repentogon/LuaInterfaces/LuaMusicManager.cpp:106 MusicManager.md audio done +function MusicManager PlayJingle repentogon/LuaInterfaces/LuaMusicManager.cpp:111 MusicManager.md audio done +function MusicManager SetCurrentPitch repentogon/LuaInterfaces/LuaMusicManager.cpp:115 MusicManager.md audio done +function MusicManager StopJingle repentogon/LuaInterfaces/LuaMusicManager.cpp:112 MusicManager.md audio done +function NightmareScene GetBackgroundSprite repentogon/LuaInterfaces/LuaNightmareScene.cpp:82 NightmareScene.md hud and menus done +function NightmareScene GetBubbleSprite repentogon/LuaInterfaces/LuaNightmareScene.cpp:83 NightmareScene.md hud and menus done +function NightmareScene GetPlayerExtraPortraitSprite repentogon/LuaInterfaces/LuaNightmareScene.cpp:87 NightmareScene.md hud and menus done +function NightmareScene GetProgressBarMap repentogon/LuaInterfaces/LuaNightmareScene.cpp:85 NightmareScene.md hud and menus done +function NightmareScene GetProgressBarSprite repentogon/LuaInterfaces/LuaNightmareScene.cpp:84 NightmareScene.md hud and menus done +function NightmareScene IsDogmaNightmare repentogon/LuaInterfaces/LuaNightmareScene.cpp:86 NightmareScene.md hud and menus done +function NullFrame GetColor repentogon/LuaInterfaces/LuaNullFrame.cpp:88 NullFrame.md render and sprites done +function NullFrame GetPos repentogon/LuaInterfaces/LuaNullFrame.cpp:84 NullFrame.md render and sprites done +function NullFrame GetRotation repentogon/LuaInterfaces/LuaNullFrame.cpp:85 NullFrame.md render and sprites done +function NullFrame GetScale repentogon/LuaInterfaces/LuaNullFrame.cpp:87 NullFrame.md render and sprites done +function NullFrame IsVisible repentogon/LuaInterfaces/LuaNullFrame.cpp:86 NullFrame.md render and sprites done +function OptionsMenu GetGammaWidgetSprite repentogon/LuaInterfaces/Menus/LuaOptionsMenu.cpp:52 hud and menus done +function OptionsMenu GetOptionsMenuSprite repentogon/LuaInterfaces/Menus/LuaOptionsMenu.cpp:51 hud and menus done +function OptionsMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaOptionsMenu.cpp:53 hud and menus done +function OptionsMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaOptionsMenu.cpp:54 hud and menus done +function PathFinder Find Pathfinder.md npc done docs only: vanilla changed through a hook +function PathFinder Move Pathfinder.md npc done docs only: vanilla changed through a hook +function PauseMenu GetCompletionMarksSprite repentogon/LuaInterfaces/LuaPauseMenu.cpp:83 hud and menus done +function PauseMenu GetMyStuffSprite repentogon/LuaInterfaces/LuaPauseMenu.cpp:82 hud and menus done +function PauseMenu GetSelectedElement repentogon/LuaInterfaces/LuaPauseMenu.cpp:84 hud and menus done +function PauseMenu GetSprite repentogon/LuaInterfaces/LuaPauseMenu.cpp:80 hud and menus done +function PauseMenu GetState repentogon/LuaInterfaces/LuaPauseMenu.cpp:86 hud and menus done +function PauseMenu GetStatsSprite repentogon/LuaInterfaces/LuaPauseMenu.cpp:81 hud and menus done +function PauseMenu SetSelectedElement repentogon/LuaInterfaces/LuaPauseMenu.cpp:85 hud and menus done +function PauseMenu SetState repentogon/LuaInterfaces/LuaPauseMenu.cpp:87 hud and menus done +function PersistentGameData AddBestiaryKill repentogon/LuaInterfaces/LuaPersistentGameData.cpp:198 PersistentGameData.md persistent data and saves done +function PersistentGameData AddBossKilled repentogon/LuaInterfaces/LuaPersistentGameData.cpp:199 PersistentGameData.md persistent data and saves done +function PersistentGameData GetBestiaryDeathCount repentogon/LuaInterfaces/LuaPersistentGameData.cpp:196 PersistentGameData.md persistent data and saves done +function PersistentGameData GetBestiaryEncounterCount repentogon/LuaInterfaces/LuaPersistentGameData.cpp:197 PersistentGameData.md persistent data and saves done +function PersistentGameData GetBestiaryKillCount repentogon/LuaInterfaces/LuaPersistentGameData.cpp:195 PersistentGameData.md persistent data and saves done +function PersistentGameData GetEventCounter repentogon/LuaInterfaces/LuaPersistentGameData.cpp:192 PersistentGameData.md persistent data and saves done +function PersistentGameData IncreaseEventCounter repentogon/LuaInterfaces/LuaPersistentGameData.cpp:191 PersistentGameData.md persistent data and saves done +function PersistentGameData IsBossKilled repentogon/LuaInterfaces/LuaPersistentGameData.cpp:200 PersistentGameData.md persistent data and saves done +function PersistentGameData IsChallengeCompleted repentogon/LuaInterfaces/LuaPersistentGameData.cpp:194 PersistentGameData.md persistent data and saves done +function PersistentGameData IsItemInCollection repentogon/LuaInterfaces/LuaPersistentGameData.cpp:193 PersistentGameData.md persistent data and saves done +function PersistentGameData TryUnlock repentogon/LuaInterfaces/LuaPersistentGameData.cpp:189 PersistentGameData.md persistent data and saves done +function PersistentGameData Unlock repentogon/LuaInterfaces/LuaPersistentGameData.cpp:188 PersistentGameData.md persistent data and saves done +function PersistentGameData Unlocked repentogon/LuaInterfaces/LuaPersistentGameData.cpp:190 PersistentGameData.md persistent data and saves done function Pipeline NewPass repentogon/LuaInterfaces/LuaRender.cpp:2236 misc todo -function PlayerHUD GetFlashGoldHearts repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:142 PlayerHUD.md hud and menus todo -function PlayerHUD GetFlashRedHearts repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:138 PlayerHUD.md hud and menus todo -function PlayerHUD GetFlashSoulHearts repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:140 PlayerHUD.md hud and menus todo -function PlayerHUD GetHUD repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:131 PlayerHUD.md hud and menus todo -function PlayerHUD GetHeartByIndex repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:134 PlayerHUD.md hud and menus todo -function PlayerHUD GetHearts repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:133 PlayerHUD.md hud and menus todo -function PlayerHUD GetIndex repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:135 PlayerHUD.md hud and menus todo -function PlayerHUD GetLayout repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:136 PlayerHUD.md hud and menus todo -function PlayerHUD GetPlayer repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:130 PlayerHUD.md hud and menus todo -function PlayerHUD RenderActiveItem repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:132 PlayerHUD.md hud and menus todo -function PlayerHUD SetFlashGoldHearts repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:141 PlayerHUD.md hud and menus todo -function PlayerHUD SetFlashRedHearts repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:137 PlayerHUD.md hud and menus todo -function PlayerHUD SetFlashSoulHearts repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:139 PlayerHUD.md hud and menus todo -function PlayerHUDHeart GetFlashType repentogon/LuaInterfaces/HUD/LuaPlayerHUDHeart.cpp:53 PlayerHUDHeart.md hud and menus todo -function PlayerHUDHeart GetHeartAnim repentogon/LuaInterfaces/HUD/LuaPlayerHUDHeart.cpp:54 PlayerHUDHeart.md hud and menus todo -function PlayerHUDHeart GetHeartOverlayAnim repentogon/LuaInterfaces/HUD/LuaPlayerHUDHeart.cpp:55 PlayerHUDHeart.md hud and menus todo -function PlayerHUDHeart IsEternalHeartOverlayVisible repentogon/LuaInterfaces/HUD/LuaPlayerHUDHeart.cpp:50 PlayerHUDHeart.md hud and menus todo -function PlayerHUDHeart IsFadingHeart repentogon/LuaInterfaces/HUD/LuaPlayerHUDHeart.cpp:52 PlayerHUDHeart.md hud and menus todo -function PlayerHUDHeart IsGoldenHeartOverlayVisible repentogon/LuaInterfaces/HUD/LuaPlayerHUDHeart.cpp:51 PlayerHUDHeart.md hud and menus todo -function PlayerHUDHeart IsVisible repentogon/LuaInterfaces/HUD/LuaPlayerHUDHeart.cpp:49 PlayerHUDHeart.md hud and menus todo -function PlayerManager AnyPlayerTypeHasBirthright repentogon/LuaInterfaces/LuaPlayerManager.cpp:409 PlayerManager.md player todo -function PlayerManager AnyPlayerTypeHasCollectible repentogon/LuaInterfaces/LuaPlayerManager.cpp:411 PlayerManager.md player todo -function PlayerManager AnyPlayerTypeHasTrinket repentogon/LuaInterfaces/LuaPlayerManager.cpp:410 PlayerManager.md player todo -function PlayerManager AnyoneHasCollectible repentogon/LuaInterfaces/LuaPlayerManager.cpp:396 PlayerManager.md player todo -function PlayerManager AnyoneHasTrinket repentogon/LuaInterfaces/LuaPlayerManager.cpp:403 PlayerManager.md player todo -function PlayerManager AnyoneIsPlayerType repentogon/LuaInterfaces/LuaPlayerManager.cpp:407 PlayerManager.md player todo -function PlayerManager FirstBirthrightOwner repentogon/LuaInterfaces/LuaPlayerManager.cpp:408 PlayerManager.md player todo -function PlayerManager FirstCollectibleOwner repentogon/LuaInterfaces/LuaPlayerManager.cpp:395 PlayerManager.md player todo -function PlayerManager FirstPlayerByType repentogon/LuaInterfaces/LuaPlayerManager.cpp:406 PlayerManager.md player todo -function PlayerManager FirstTrinketOwner repentogon/LuaInterfaces/LuaPlayerManager.cpp:401 PlayerManager.md player todo -function PlayerManager GetEsauJrState repentogon/LuaInterfaces/LuaPlayerManager.cpp:405 PlayerManager.md player todo -function PlayerManager GetNumCollectibles repentogon/LuaInterfaces/LuaPlayerManager.cpp:399 PlayerManager.md player todo -function PlayerManager GetPlayers repentogon/LuaInterfaces/LuaPlayerManager.cpp:404 PlayerManager.md player todo -function PlayerManager GetRandomCollectibleOwner repentogon/LuaInterfaces/LuaPlayerManager.cpp:414 PlayerManager.md player todo -function PlayerManager GetRandomTrinketOwner repentogon/LuaInterfaces/LuaPlayerManager.cpp:415 PlayerManager.md player todo -function PlayerManager GetTotalTrinketMultiplier repentogon/LuaInterfaces/LuaPlayerManager.cpp:400 PlayerManager.md player todo -function PlayerManager IsCoopPlay repentogon/LuaInterfaces/LuaPlayerManager.cpp:398 PlayerManager.md player todo -function PlayerManager RemoveCoPlayer repentogon/LuaInterfaces/LuaPlayerManager.cpp:413 PlayerManager.md player todo -function PlayerManager SpawnCoPlayer2 repentogon/LuaInterfaces/LuaPlayerManager.cpp:397 PlayerManager.md player todo -function PlayerManager SpawnSelectedBaby repentogon/LuaInterfaces/LuaPlayerManager.cpp:412 PlayerManager.md player todo -function PlayerManager TriggerRoomClear repentogon/LuaInterfaces/LuaPlayerManager.cpp:402 PlayerManager.md player todo -function PocketItem GetSlot repentogon/LuaInterfaces/LuaPocketItem.cpp:30 PocketItem.md player todo -function PocketItem GetType repentogon/LuaInterfaces/LuaPocketItem.cpp:31 PocketItem.md player todo -function Point GetColor repentogon/LuaInterfaces/LuaBeamRenderer.cpp:415 render and sprites todo -function Point GetHeight repentogon/LuaInterfaces/LuaBeamRenderer.cpp:409 render and sprites todo -function Point GetIsWorldSpace repentogon/LuaInterfaces/LuaBeamRenderer.cpp:417 render and sprites todo -function Point GetPosition repentogon/LuaInterfaces/LuaBeamRenderer.cpp:413 render and sprites todo -function Point GetSpritesheetCoordinate repentogon/LuaInterfaces/LuaBeamRenderer.cpp:407 render and sprites todo -function Point GetWidth repentogon/LuaInterfaces/LuaBeamRenderer.cpp:411 render and sprites todo -function Point SetColor repentogon/LuaInterfaces/LuaBeamRenderer.cpp:416 render and sprites todo -function Point SetHeight repentogon/LuaInterfaces/LuaBeamRenderer.cpp:410 render and sprites todo -function Point SetIsWorldSpace repentogon/LuaInterfaces/LuaBeamRenderer.cpp:418 render and sprites todo -function Point SetPosition repentogon/LuaInterfaces/LuaBeamRenderer.cpp:414 render and sprites todo -function Point SetSpritesheetCoordinate repentogon/LuaInterfaces/LuaBeamRenderer.cpp:408 render and sprites todo -function Point SetWidth repentogon/LuaInterfaces/LuaBeamRenderer.cpp:412 render and sprites todo -function ProceduralEffect GetActionProperty repentogon/LuaInterfaces/ProcedualItems/LuaProceduralEffect.cpp:119 ProceduralEffect.md items and pools todo -function ProceduralEffect GetActionType repentogon/LuaInterfaces/ProcedualItems/LuaProceduralEffect.cpp:117 ProceduralEffect.md items and pools todo -function ProceduralEffect GetConditionProperty repentogon/LuaInterfaces/ProcedualItems/LuaProceduralEffect.cpp:118 ProceduralEffect.md items and pools todo -function ProceduralEffect GetConditionType repentogon/LuaInterfaces/ProcedualItems/LuaProceduralEffect.cpp:116 ProceduralEffect.md items and pools todo -function ProceduralEffect GetScore repentogon/LuaInterfaces/ProcedualItems/LuaProceduralEffect.cpp:122 ProceduralEffect.md items and pools todo -function ProceduralEffect GetTriggerChance repentogon/LuaInterfaces/ProcedualItems/LuaProceduralEffect.cpp:120 ProceduralEffect.md items and pools todo -function ProceduralEffect GetTriggerChanceScale repentogon/LuaInterfaces/ProcedualItems/LuaProceduralEffect.cpp:121 ProceduralEffect.md items and pools todo -function ProceduralItem GetDamage repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:88 ProceduralItem.md items and pools todo -function ProceduralItem GetEffect repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:86 ProceduralItem.md items and pools todo -function ProceduralItem GetEffectCount repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:85 ProceduralItem.md items and pools todo -function ProceduralItem GetFireDelay repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:89 ProceduralItem.md items and pools todo -function ProceduralItem GetID repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:87 ProceduralItem.md items and pools todo -function ProceduralItem GetItem repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:83 ProceduralItem.md items and pools todo -function ProceduralItem GetLuck repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:93 ProceduralItem.md items and pools todo -function ProceduralItem GetRange repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:91 ProceduralItem.md items and pools todo -function ProceduralItem GetShotSpeed repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:92 ProceduralItem.md items and pools todo -function ProceduralItem GetSpeed repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:90 ProceduralItem.md items and pools todo -function ProceduralItem GetTargetItem repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:84 ProceduralItem.md items and pools todo -function ProceduralItemManager CreateProceduralItem repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItemManager.cpp:50 ProceduralItemManager.md items and pools todo -function ProceduralItemManager GetProceduralItem repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItemManager.cpp:52 ProceduralItemManager.md items and pools todo -function ProceduralItemManager GetProceduralItemCount repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItemManager.cpp:51 ProceduralItemManager.md items and pools todo +function PlayerHUD GetFlashGoldHearts repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:142 PlayerHUD.md hud and menus done +function PlayerHUD GetFlashRedHearts repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:138 PlayerHUD.md hud and menus done +function PlayerHUD GetFlashSoulHearts repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:140 PlayerHUD.md hud and menus done +function PlayerHUD GetHUD repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:131 PlayerHUD.md hud and menus done +function PlayerHUD GetHeartByIndex repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:134 PlayerHUD.md hud and menus done +function PlayerHUD GetHearts repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:133 PlayerHUD.md hud and menus done +function PlayerHUD GetIndex repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:135 PlayerHUD.md hud and menus done +function PlayerHUD GetLayout repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:136 PlayerHUD.md hud and menus done +function PlayerHUD GetPlayer repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:130 PlayerHUD.md hud and menus done +function PlayerHUD RenderActiveItem repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:132 PlayerHUD.md hud and menus done +function PlayerHUD SetFlashGoldHearts repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:141 PlayerHUD.md hud and menus done +function PlayerHUD SetFlashRedHearts repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:137 PlayerHUD.md hud and menus done +function PlayerHUD SetFlashSoulHearts repentogon/LuaInterfaces/HUD/LuaPlayerHUD.cpp:139 PlayerHUD.md hud and menus done +function PlayerHUDHeart GetFlashType repentogon/LuaInterfaces/HUD/LuaPlayerHUDHeart.cpp:53 PlayerHUDHeart.md hud and menus done +function PlayerHUDHeart GetHeartAnim repentogon/LuaInterfaces/HUD/LuaPlayerHUDHeart.cpp:54 PlayerHUDHeart.md hud and menus done +function PlayerHUDHeart GetHeartOverlayAnim repentogon/LuaInterfaces/HUD/LuaPlayerHUDHeart.cpp:55 PlayerHUDHeart.md hud and menus done +function PlayerHUDHeart IsEternalHeartOverlayVisible repentogon/LuaInterfaces/HUD/LuaPlayerHUDHeart.cpp:50 PlayerHUDHeart.md hud and menus done +function PlayerHUDHeart IsFadingHeart repentogon/LuaInterfaces/HUD/LuaPlayerHUDHeart.cpp:52 PlayerHUDHeart.md hud and menus done +function PlayerHUDHeart IsGoldenHeartOverlayVisible repentogon/LuaInterfaces/HUD/LuaPlayerHUDHeart.cpp:51 PlayerHUDHeart.md hud and menus done +function PlayerHUDHeart IsVisible repentogon/LuaInterfaces/HUD/LuaPlayerHUDHeart.cpp:49 PlayerHUDHeart.md hud and menus done +function PlayerManager AnyPlayerTypeHasBirthright repentogon/LuaInterfaces/LuaPlayerManager.cpp:409 PlayerManager.md player done +function PlayerManager AnyPlayerTypeHasCollectible repentogon/LuaInterfaces/LuaPlayerManager.cpp:411 PlayerManager.md player done +function PlayerManager AnyPlayerTypeHasTrinket repentogon/LuaInterfaces/LuaPlayerManager.cpp:410 PlayerManager.md player done +function PlayerManager AnyoneHasCollectible repentogon/LuaInterfaces/LuaPlayerManager.cpp:396 PlayerManager.md player done +function PlayerManager AnyoneHasTrinket repentogon/LuaInterfaces/LuaPlayerManager.cpp:403 PlayerManager.md player done +function PlayerManager AnyoneIsPlayerType repentogon/LuaInterfaces/LuaPlayerManager.cpp:407 PlayerManager.md player done +function PlayerManager FirstBirthrightOwner repentogon/LuaInterfaces/LuaPlayerManager.cpp:408 PlayerManager.md player done +function PlayerManager FirstCollectibleOwner repentogon/LuaInterfaces/LuaPlayerManager.cpp:395 PlayerManager.md player done +function PlayerManager FirstPlayerByType repentogon/LuaInterfaces/LuaPlayerManager.cpp:406 PlayerManager.md player done +function PlayerManager FirstTrinketOwner repentogon/LuaInterfaces/LuaPlayerManager.cpp:401 PlayerManager.md player done +function PlayerManager GetEsauJrState repentogon/LuaInterfaces/LuaPlayerManager.cpp:405 PlayerManager.md player done +function PlayerManager GetNumCollectibles repentogon/LuaInterfaces/LuaPlayerManager.cpp:399 PlayerManager.md player done +function PlayerManager GetPlayers repentogon/LuaInterfaces/LuaPlayerManager.cpp:404 PlayerManager.md player done +function PlayerManager GetRandomCollectibleOwner repentogon/LuaInterfaces/LuaPlayerManager.cpp:414 PlayerManager.md player done +function PlayerManager GetRandomTrinketOwner repentogon/LuaInterfaces/LuaPlayerManager.cpp:415 PlayerManager.md player done +function PlayerManager GetTotalTrinketMultiplier repentogon/LuaInterfaces/LuaPlayerManager.cpp:400 PlayerManager.md player done +function PlayerManager IsCoopPlay repentogon/LuaInterfaces/LuaPlayerManager.cpp:398 PlayerManager.md player done +function PlayerManager RemoveCoPlayer repentogon/LuaInterfaces/LuaPlayerManager.cpp:413 PlayerManager.md player done +function PlayerManager SpawnCoPlayer2 repentogon/LuaInterfaces/LuaPlayerManager.cpp:397 PlayerManager.md player done +function PlayerManager SpawnSelectedBaby repentogon/LuaInterfaces/LuaPlayerManager.cpp:412 PlayerManager.md player done +function PlayerManager TriggerRoomClear repentogon/LuaInterfaces/LuaPlayerManager.cpp:402 PlayerManager.md player done +function PocketItem GetSlot repentogon/LuaInterfaces/LuaPocketItem.cpp:30 PocketItem.md player done +function PocketItem GetType repentogon/LuaInterfaces/LuaPocketItem.cpp:31 PocketItem.md player done +function Point GetColor repentogon/LuaInterfaces/LuaBeamRenderer.cpp:415 render and sprites done +function Point GetHeight repentogon/LuaInterfaces/LuaBeamRenderer.cpp:409 render and sprites done +function Point GetIsWorldSpace repentogon/LuaInterfaces/LuaBeamRenderer.cpp:417 render and sprites done +function Point GetPosition repentogon/LuaInterfaces/LuaBeamRenderer.cpp:413 render and sprites done +function Point GetSpritesheetCoordinate repentogon/LuaInterfaces/LuaBeamRenderer.cpp:407 render and sprites done +function Point GetWidth repentogon/LuaInterfaces/LuaBeamRenderer.cpp:411 render and sprites done +function Point SetColor repentogon/LuaInterfaces/LuaBeamRenderer.cpp:416 render and sprites done +function Point SetHeight repentogon/LuaInterfaces/LuaBeamRenderer.cpp:410 render and sprites done +function Point SetIsWorldSpace repentogon/LuaInterfaces/LuaBeamRenderer.cpp:418 render and sprites done +function Point SetPosition repentogon/LuaInterfaces/LuaBeamRenderer.cpp:414 render and sprites done +function Point SetSpritesheetCoordinate repentogon/LuaInterfaces/LuaBeamRenderer.cpp:408 render and sprites done +function Point SetWidth repentogon/LuaInterfaces/LuaBeamRenderer.cpp:412 render and sprites done +function ProceduralEffect GetActionProperty repentogon/LuaInterfaces/ProcedualItems/LuaProceduralEffect.cpp:119 ProceduralEffect.md items and pools done +function ProceduralEffect GetActionType repentogon/LuaInterfaces/ProcedualItems/LuaProceduralEffect.cpp:117 ProceduralEffect.md items and pools done +function ProceduralEffect GetConditionProperty repentogon/LuaInterfaces/ProcedualItems/LuaProceduralEffect.cpp:118 ProceduralEffect.md items and pools done +function ProceduralEffect GetConditionType repentogon/LuaInterfaces/ProcedualItems/LuaProceduralEffect.cpp:116 ProceduralEffect.md items and pools done +function ProceduralEffect GetScore repentogon/LuaInterfaces/ProcedualItems/LuaProceduralEffect.cpp:122 ProceduralEffect.md items and pools done +function ProceduralEffect GetTriggerChance repentogon/LuaInterfaces/ProcedualItems/LuaProceduralEffect.cpp:120 ProceduralEffect.md items and pools done +function ProceduralEffect GetTriggerChanceScale repentogon/LuaInterfaces/ProcedualItems/LuaProceduralEffect.cpp:121 ProceduralEffect.md items and pools done +function ProceduralItem GetDamage repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:88 ProceduralItem.md items and pools done +function ProceduralItem GetEffect repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:86 ProceduralItem.md items and pools done +function ProceduralItem GetEffectCount repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:85 ProceduralItem.md items and pools done +function ProceduralItem GetFireDelay repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:89 ProceduralItem.md items and pools done +function ProceduralItem GetID repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:87 ProceduralItem.md items and pools done +function ProceduralItem GetItem repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:83 ProceduralItem.md items and pools done +function ProceduralItem GetLuck repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:93 ProceduralItem.md items and pools done +function ProceduralItem GetRange repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:91 ProceduralItem.md items and pools done +function ProceduralItem GetShotSpeed repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:92 ProceduralItem.md items and pools done +function ProceduralItem GetSpeed repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:90 ProceduralItem.md items and pools done +function ProceduralItem GetTargetItem repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItem.cpp:84 ProceduralItem.md items and pools done +function ProceduralItemManager CreateProceduralItem repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItemManager.cpp:50 ProceduralItemManager.md items and pools done +function ProceduralItemManager GetProceduralItem repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItemManager.cpp:52 ProceduralItemManager.md items and pools done +function ProceduralItemManager GetProceduralItemCount repentogon/LuaInterfaces/ProcedualItems/LuaProceduralItemManager.cpp:51 ProceduralItemManager.md items and pools done function REPENTOGON MeetsVersion repentogon/resources/scripts/main_ex.lua:107 Repentogon.md game done defined in Lua -function RNG GetShiftIdx repentogon/LuaInterfaces/LuaRNG.cpp:250 RNG.md misc todo -function RNG PhantomFloat repentogon/LuaInterfaces/LuaRNG.cpp:256 RNG.md misc todo -function RNG PhantomInt repentogon/LuaInterfaces/LuaRNG.cpp:255 RNG.md misc todo -function RNG PhantomNext repentogon/LuaInterfaces/LuaRNG.cpp:251 RNG.md misc todo -function RNG PhantomPrevious repentogon/LuaInterfaces/LuaRNG.cpp:253 RNG.md misc todo -function RNG PhantomVector repentogon/LuaInterfaces/LuaRNG.cpp:258 RNG.md misc todo -function RNG Previous repentogon/LuaInterfaces/LuaRNG.cpp:252 RNG.md misc todo -function RNG RandomInt repentogon/LuaInterfaces/LuaRNG.cpp:254 RNG.md misc review -function RNG RandomVector repentogon/LuaInterfaces/LuaRNG.cpp:257 RNG.md misc todo -function RNG SetSeed repentogon/LuaInterfaces/LuaRNG.cpp:249 RNG.md misc review -function RailManager GetRailsSprite repentogon/LuaInterfaces/Room/LuaRailManager.cpp:27 RailManager.md level and room todo +function RNG GetShiftIdx repentogon/LuaInterfaces/LuaRNG.cpp:250 RNG.md misc done +function RNG PhantomFloat repentogon/LuaInterfaces/LuaRNG.cpp:256 RNG.md misc done +function RNG PhantomInt repentogon/LuaInterfaces/LuaRNG.cpp:255 RNG.md misc done +function RNG PhantomNext repentogon/LuaInterfaces/LuaRNG.cpp:251 RNG.md misc done +function RNG PhantomPrevious repentogon/LuaInterfaces/LuaRNG.cpp:253 RNG.md misc done +function RNG PhantomVector repentogon/LuaInterfaces/LuaRNG.cpp:258 RNG.md misc done +function RNG Previous repentogon/LuaInterfaces/LuaRNG.cpp:252 RNG.md misc done +function RNG RandomInt repentogon/LuaInterfaces/LuaRNG.cpp:254 RNG.md misc done +function RNG RandomVector repentogon/LuaInterfaces/LuaRNG.cpp:257 RNG.md misc done +function RNG SetSeed repentogon/LuaInterfaces/LuaRNG.cpp:249 RNG.md misc done +function RailManager GetRailsSprite repentogon/LuaInterfaces/Room/LuaRailManager.cpp:27 RailManager.md level and room done function RenderSet SlicePipeline repentogon/LuaInterfaces/LuaRender.cpp:2437 misc todo function RenderSet SliceSingle repentogon/LuaInterfaces/LuaRender.cpp:2436 misc todo -function Renderer CreateImage repentogon/LuaInterfaces/LuaRender.cpp:3247 render and sprites todo -function Renderer GetClipPaneNormal repentogon/LuaInterfaces/LuaRender.cpp:3261 render and sprites todo -function Renderer GetClipPaneThreshold repentogon/LuaInterfaces/LuaRender.cpp:3262 render and sprites todo -function Renderer GetPixelationAmount repentogon/LuaInterfaces/LuaRender.cpp:3260 render and sprites todo -function Renderer GetShaderByType repentogon/LuaInterfaces/LuaRender.cpp:3251 render and sprites todo -function Renderer LoadImage repentogon/LuaInterfaces/LuaRender.cpp:3246 render and sprites todo -function Renderer LoadShader repentogon/LuaInterfaces/LuaRender.cpp:3252 render and sprites todo -function Renderer RenderToImage repentogon/LuaInterfaces/LuaRender.cpp:3248 render and sprites todo -function Renderer StartTransformation repentogon/LuaInterfaces/LuaRender.cpp:3249 render and sprites todo -function Room CanPickupGridEntity repentogon/LuaInterfaces/Room/LuaRoom.cpp:550 Room.md level and room todo -function Room CanSpawnObstacleAtPosition repentogon/LuaInterfaces/Room/LuaRoom.cpp:536 Room.md level and room todo +function Renderer CreateImage repentogon/LuaInterfaces/LuaRender.cpp:3247 render and sprites done +function Renderer GetClipPaneNormal repentogon/LuaInterfaces/LuaRender.cpp:3261 render and sprites done +function Renderer GetClipPaneThreshold repentogon/LuaInterfaces/LuaRender.cpp:3262 render and sprites done +function Renderer GetPixelationAmount repentogon/LuaInterfaces/LuaRender.cpp:3260 render and sprites done +function Renderer GetShaderByType repentogon/LuaInterfaces/LuaRender.cpp:3251 render and sprites done +function Renderer LoadImage repentogon/LuaInterfaces/LuaRender.cpp:3246 render and sprites done +function Renderer LoadShader repentogon/LuaInterfaces/LuaRender.cpp:3252 render and sprites done +function Renderer RenderToImage repentogon/LuaInterfaces/LuaRender.cpp:3248 render and sprites done +function Renderer StartTransformation repentogon/LuaInterfaces/LuaRender.cpp:3249 render and sprites done +function Room CanPickupGridEntity repentogon/LuaInterfaces/Room/LuaRoom.cpp:550 Room.md level and room done +function Room CanSpawnObstacleAtPosition repentogon/LuaInterfaces/Room/LuaRoom.cpp:536 Room.md level and room done function Room ClearBossHazards repentogon/LuaInterfaces/Room/LuaRoom.cpp:577 Room.md level and room todo -function Room DoLightningStrike repentogon/LuaInterfaces/Room/LuaRoom.cpp:567 Room.md level and room todo -function Room GetBackdrop repentogon/LuaInterfaces/LuaBackdrop.cpp:99 Room.md level and room todo -function Room GetBackdropType repentogon/LuaInterfaces/Room/LuaRoom.cpp:571 Room.md level and room review -function Room GetBossVictoryJingle repentogon/LuaInterfaces/Room/LuaRoom.cpp:573 Room.md level and room todo -function Room GetCamera repentogon/LuaInterfaces/LuaCamera.cpp:65 Room.md level and room todo -function Room GetChampionBossChance repentogon/LuaInterfaces/Room/LuaRoom.cpp:554 Room.md level and room todo -function Room GetEffects repentogon/LuaInterfaces/Room/LuaRoom.cpp:547 Room.md level and room todo -function Room GetFXLayers repentogon/LuaInterfaces/LuaFXLayers.cpp:25 Room.md level and room todo -function Room GetFXParams repentogon/LuaInterfaces/LuaFXParams.cpp:161 Room.md level and room todo -function Room GetFloorColor repentogon/LuaInterfaces/Room/LuaRoom.cpp:539 Room.md level and room todo -function Room GetGreedWaveTimer repentogon/LuaInterfaces/Room/LuaRoom.cpp:560 Room.md level and room todo -function Room GetGridIndexByTile repentogon/LuaInterfaces/Room/LuaRoom.cpp:552 Room.md level and room todo -function Room GetItemPool repentogon/LuaInterfaces/Room/LuaRoom.cpp:575 Room.md level and room todo -function Room GetLRoomAreaDesc repentogon/LuaInterfaces/Room/LuaLRoomAreaDesc.cpp:52 Room.md level and room review -function Room GetLRoomTileDesc repentogon/LuaInterfaces/Room/LuaLRoomTileDesc.cpp:71 Room.md level and room review -function Room GetLightningIntensity repentogon/LuaInterfaces/Room/LuaRoom.cpp:565 Room.md level and room todo -function Room GetNumRainSpawners repentogon/LuaInterfaces/Room/LuaRoom.cpp:570 Room.md level and room todo -function Room GetRail repentogon/LuaInterfaces/Room/LuaRoom.cpp:548 Room.md level and room todo -function Room GetRailManager repentogon/LuaInterfaces/Room/LuaRailManager.cpp:24 Room.md level and room todo -function Room GetRainIntensity repentogon/LuaInterfaces/Room/LuaRoom.cpp:568 Room.md level and room todo -function Room GetRoomClearDelay repentogon/LuaInterfaces/Room/LuaRoom.cpp:558 Room.md level and room todo -function Room GetShopItemPrice repentogon/LuaInterfaces/Room/LuaRoom.cpp:533 Room.md level and room todo -function Room GetWallColor repentogon/LuaInterfaces/Room/LuaRoom.cpp:540 Room.md level and room todo -function Room GetWaterAmount repentogon/LuaInterfaces/Room/LuaRoom.cpp:537 Room.md level and room todo -function Room GetWaterColor repentogon/LuaInterfaces/Room/LuaRoom.cpp:541 Room.md level and room todo -function Room GetWaterColorMultiplier repentogon/LuaInterfaces/Room/LuaRoom.cpp:544 Room.md level and room todo -function Room IsChampionBossSeed repentogon/LuaInterfaces/Room/LuaRoom.cpp:555 Room.md level and room todo -function Room IsPersistentRoomEntity repentogon/LuaInterfaces/Room/LuaRoom.cpp:562 Room.md level and room todo -function Room PickupGridEntity repentogon/LuaInterfaces/Room/LuaRoom.cpp:551 Room.md level and room todo -function Room RemoveGridEntityImmediate repentogon/LuaInterfaces/Room/LuaRoom.cpp:535 Room.md level and room todo -function Room SaveState repentogon/LuaInterfaces/Room/LuaRoom.cpp:572 Room.md level and room todo -function Room SetBackdropType repentogon/LuaInterfaces/Room/LuaRoom.cpp:546 Room.md level and room todo -function Room SetGreedWaveTimer repentogon/LuaInterfaces/Room/LuaRoom.cpp:561 Room.md level and room todo -function Room SetItemPool repentogon/LuaInterfaces/Room/LuaRoom.cpp:574 Room.md level and room todo -function Room SetLavaIntensity repentogon/LuaInterfaces/Room/LuaRoom.cpp:564 Room.md level and room todo -function Room SetLightningIntensity repentogon/LuaInterfaces/Room/LuaRoom.cpp:566 Room.md level and room todo -function Room SetPauseTimer repentogon/LuaInterfaces/Room/LuaRoom.cpp:553 Room.md level and room todo -function Room SetRail repentogon/LuaInterfaces/Room/LuaRoom.cpp:549 Room.md level and room todo -function Room SetRainIntensity repentogon/LuaInterfaces/Room/LuaRoom.cpp:569 Room.md level and room todo -function Room SetRedHeartDamage repentogon/LuaInterfaces/Room/LuaRoom.cpp:531 Room.md level and room review -function Room SetRoomClearDelay repentogon/LuaInterfaces/Room/LuaRoom.cpp:559 Room.md level and room todo -function Room SetWaterAmount repentogon/LuaInterfaces/Room/LuaRoom.cpp:538 Room.md level and room todo -function Room SetWaterColor repentogon/LuaInterfaces/Room/LuaRoom.cpp:542 Room.md level and room todo -function Room SetWaterColorMultiplier repentogon/LuaInterfaces/Room/LuaRoom.cpp:545 Room.md level and room todo -function Room SetWaterCurrent repentogon/LuaInterfaces/Room/LuaRoom.cpp:543 Room.md level and room todo -function Room SpawnGridEntity repentogon/LuaInterfaces/Room/LuaRoom.cpp:534 Room.md level and room review -function Room TriggerOutput repentogon/LuaInterfaces/Room/LuaRoom.cpp:576 Room.md level and room todo -function Room TriggerRestock repentogon/LuaInterfaces/Room/LuaRoom.cpp:578 Room.md level and room todo -function Room TryGetShopDiscount repentogon/LuaInterfaces/Room/LuaRoom.cpp:557 Room.md level and room todo -function Room TrySpawnSpecialQuestDoor repentogon/LuaInterfaces/Room/LuaRoom.cpp:563 Room.md level and room review -function Room UpdateColorModifier repentogon/LuaInterfaces/Room/LuaRoom.cpp:556 Room.md level and room todo +function Room DoLightningStrike repentogon/LuaInterfaces/Room/LuaRoom.cpp:567 Room.md level and room done +function Room GetBackdrop repentogon/LuaInterfaces/LuaBackdrop.cpp:99 Room.md level and room done +function Room GetBackdropType repentogon/LuaInterfaces/Room/LuaRoom.cpp:571 Room.md level and room done +function Room GetBossVictoryJingle repentogon/LuaInterfaces/Room/LuaRoom.cpp:573 Room.md level and room done +function Room GetCamera repentogon/LuaInterfaces/LuaCamera.cpp:65 Room.md level and room done +function Room GetChampionBossChance repentogon/LuaInterfaces/Room/LuaRoom.cpp:554 Room.md level and room done +function Room GetEffects repentogon/LuaInterfaces/Room/LuaRoom.cpp:547 Room.md level and room done +function Room GetFXLayers repentogon/LuaInterfaces/LuaFXLayers.cpp:25 Room.md level and room done +function Room GetFXParams repentogon/LuaInterfaces/LuaFXParams.cpp:161 Room.md level and room done +function Room GetFloorColor repentogon/LuaInterfaces/Room/LuaRoom.cpp:539 Room.md level and room done +function Room GetGreedWaveTimer repentogon/LuaInterfaces/Room/LuaRoom.cpp:560 Room.md level and room done +function Room GetGridIndexByTile repentogon/LuaInterfaces/Room/LuaRoom.cpp:552 Room.md level and room done +function Room GetItemPool repentogon/LuaInterfaces/Room/LuaRoom.cpp:575 Room.md level and room done +function Room GetLRoomAreaDesc repentogon/LuaInterfaces/Room/LuaLRoomAreaDesc.cpp:52 Room.md level and room done +function Room GetLRoomTileDesc repentogon/LuaInterfaces/Room/LuaLRoomTileDesc.cpp:71 Room.md level and room done +function Room GetLightningIntensity repentogon/LuaInterfaces/Room/LuaRoom.cpp:565 Room.md level and room done +function Room GetNumRainSpawners repentogon/LuaInterfaces/Room/LuaRoom.cpp:570 Room.md level and room done +function Room GetRail repentogon/LuaInterfaces/Room/LuaRoom.cpp:548 Room.md level and room done +function Room GetRailManager repentogon/LuaInterfaces/Room/LuaRailManager.cpp:24 Room.md level and room done +function Room GetRainIntensity repentogon/LuaInterfaces/Room/LuaRoom.cpp:568 Room.md level and room done +function Room GetRoomClearDelay repentogon/LuaInterfaces/Room/LuaRoom.cpp:558 Room.md level and room done +function Room GetShopItemPrice repentogon/LuaInterfaces/Room/LuaRoom.cpp:533 Room.md level and room done +function Room GetWallColor repentogon/LuaInterfaces/Room/LuaRoom.cpp:540 Room.md level and room done +function Room GetWaterAmount repentogon/LuaInterfaces/Room/LuaRoom.cpp:537 Room.md level and room done +function Room GetWaterColor repentogon/LuaInterfaces/Room/LuaRoom.cpp:541 Room.md level and room done +function Room GetWaterColorMultiplier repentogon/LuaInterfaces/Room/LuaRoom.cpp:544 Room.md level and room done +function Room IsChampionBossSeed repentogon/LuaInterfaces/Room/LuaRoom.cpp:555 Room.md level and room done +function Room IsPersistentRoomEntity repentogon/LuaInterfaces/Room/LuaRoom.cpp:562 Room.md level and room done +function Room PickupGridEntity repentogon/LuaInterfaces/Room/LuaRoom.cpp:551 Room.md level and room done +function Room RemoveGridEntityImmediate repentogon/LuaInterfaces/Room/LuaRoom.cpp:535 Room.md level and room done +function Room SaveState repentogon/LuaInterfaces/Room/LuaRoom.cpp:572 Room.md level and room done +function Room SetBackdropType repentogon/LuaInterfaces/Room/LuaRoom.cpp:546 Room.md level and room done +function Room SetGreedWaveTimer repentogon/LuaInterfaces/Room/LuaRoom.cpp:561 Room.md level and room done +function Room SetItemPool repentogon/LuaInterfaces/Room/LuaRoom.cpp:574 Room.md level and room done +function Room SetLavaIntensity repentogon/LuaInterfaces/Room/LuaRoom.cpp:564 Room.md level and room done +function Room SetLightningIntensity repentogon/LuaInterfaces/Room/LuaRoom.cpp:566 Room.md level and room done +function Room SetPauseTimer repentogon/LuaInterfaces/Room/LuaRoom.cpp:553 Room.md level and room done +function Room SetRail repentogon/LuaInterfaces/Room/LuaRoom.cpp:549 Room.md level and room done +function Room SetRainIntensity repentogon/LuaInterfaces/Room/LuaRoom.cpp:569 Room.md level and room done +function Room SetRedHeartDamage repentogon/LuaInterfaces/Room/LuaRoom.cpp:531 Room.md level and room done +function Room SetRoomClearDelay repentogon/LuaInterfaces/Room/LuaRoom.cpp:559 Room.md level and room done +function Room SetWaterAmount repentogon/LuaInterfaces/Room/LuaRoom.cpp:538 Room.md level and room done +function Room SetWaterColor repentogon/LuaInterfaces/Room/LuaRoom.cpp:542 Room.md level and room done +function Room SetWaterColorMultiplier repentogon/LuaInterfaces/Room/LuaRoom.cpp:545 Room.md level and room done +function Room SetWaterCurrent repentogon/LuaInterfaces/Room/LuaRoom.cpp:543 Room.md level and room done +function Room SpawnGridEntity repentogon/LuaInterfaces/Room/LuaRoom.cpp:534 Room.md level and room done +function Room TriggerOutput repentogon/LuaInterfaces/Room/LuaRoom.cpp:576 Room.md level and room done +function Room TriggerRestock repentogon/LuaInterfaces/Room/LuaRoom.cpp:578 Room.md level and room done +function Room TryGetShopDiscount repentogon/LuaInterfaces/Room/LuaRoom.cpp:557 Room.md level and room done +function Room TrySpawnSpecialQuestDoor repentogon/LuaInterfaces/Room/LuaRoom.cpp:563 Room.md level and room done +function Room UpdateColorModifier repentogon/LuaInterfaces/Room/LuaRoom.cpp:556 Room.md level and room done function RoomConfig AddRooms repentogon/LuaInterfaces/Room/LuaRoomConfig.cpp:181 RoomConfig.md level and room todo -function RoomConfig GetRandomRoom repentogon/LuaInterfaces/Room/LuaRoomConfig.cpp:179 RoomConfig.md level and room todo -function RoomConfig GetRoomByStageTypeAndVariant repentogon/LuaInterfaces/Room/LuaRoomConfig.cpp:178 RoomConfig.md level and room todo -function RoomConfig GetStage repentogon/LuaInterfaces/Room/LuaRoomConfig.cpp:180 RoomConfig.md level and room todo +function RoomConfig GetRandomRoom repentogon/LuaInterfaces/Room/LuaRoomConfig.cpp:179 RoomConfig.md level and room done +function RoomConfig GetRoomByStageTypeAndVariant repentogon/LuaInterfaces/Room/LuaRoomConfig.cpp:178 RoomConfig.md level and room done +function RoomConfig GetStage repentogon/LuaInterfaces/Room/LuaRoomConfig.cpp:180 RoomConfig.md level and room done function RoomConfig LoadStb repentogon/LuaInterfaces/Room/LuaRoomConfig.cpp:182 RoomConfig.md level and room todo function RoomConfigSet AddRooms repentogon/LuaInterfaces/Room/LuaRoomConfigSet.cpp:98 CcpContainer_RoomConfigSet.md level and room todo -function RoomConfigSet Get repentogon/LuaInterfaces/Room/LuaRoomConfigSet.cpp:96 CcpContainer_RoomConfigSet.md level and room todo +function RoomConfigSet Get repentogon/LuaInterfaces/Room/LuaRoomConfigSet.cpp:96 CcpContainer_RoomConfigSet.md level and room done function RoomConfigSet LoadStb repentogon/LuaInterfaces/Room/LuaRoomConfigSet.cpp:99 CcpContainer_RoomConfigSet.md level and room todo -function RoomConfigSet __len repentogon/LuaInterfaces/Room/LuaRoomConfigSet.cpp:97 CcpContainer_RoomConfigSet.md level and room todo -function RoomConfigStage GetBackdrop repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:168 RoomConfigStage.md level and room todo -function RoomConfigStage GetBossSpot repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:177 RoomConfigStage.md level and room todo -function RoomConfigStage GetDisplayName repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:173 RoomConfigStage.md level and room todo -function RoomConfigStage GetID repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:172 RoomConfigStage.md level and room todo -function RoomConfigStage GetMusic repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:170 RoomConfigStage.md level and room todo -function RoomConfigStage GetPlayerSpot repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:175 RoomConfigStage.md level and room todo -function RoomConfigStage GetRoomSet repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:181 RoomConfigStage.md level and room todo -function RoomConfigStage GetSuffix repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:179 RoomConfigStage.md level and room todo -function RoomConfigStage GetXMLName repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:182 RoomConfigStage.md level and room todo -function RoomConfigStage IsLoaded repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:184 RoomConfigStage.md level and room todo -function RoomConfigStage SetBackdrop repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:169 RoomConfigStage.md level and room todo -function RoomConfigStage SetBossSpot repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:178 RoomConfigStage.md level and room todo -function RoomConfigStage SetDisplayName repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:174 RoomConfigStage.md level and room todo -function RoomConfigStage SetMusic repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:171 RoomConfigStage.md level and room todo -function RoomConfigStage SetPlayerSpot repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:176 RoomConfigStage.md level and room todo -function RoomConfigStage SetSuffix repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:180 RoomConfigStage.md level and room todo -function RoomConfigStage SetXMLName repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:183 RoomConfigStage.md level and room todo -function RoomDescriptor AddRestrictedGridIndex repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:325 RoomDescriptor.md level and room todo -function RoomDescriptor AllowedDoors repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:109 RoomDescriptor.md level and room review +function RoomConfigSet __len repentogon/LuaInterfaces/Room/LuaRoomConfigSet.cpp:97 CcpContainer_RoomConfigSet.md level and room done +function RoomConfigStage GetBackdrop repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:168 RoomConfigStage.md level and room done +function RoomConfigStage GetBossSpot repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:177 RoomConfigStage.md level and room done +function RoomConfigStage GetDisplayName repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:173 RoomConfigStage.md level and room done +function RoomConfigStage GetID repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:172 RoomConfigStage.md level and room done +function RoomConfigStage GetMusic repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:170 RoomConfigStage.md level and room done +function RoomConfigStage GetPlayerSpot repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:175 RoomConfigStage.md level and room done +function RoomConfigStage GetRoomSet repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:181 RoomConfigStage.md level and room done +function RoomConfigStage GetSuffix repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:179 RoomConfigStage.md level and room done +function RoomConfigStage GetXMLName repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:182 RoomConfigStage.md level and room done +function RoomConfigStage IsLoaded repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:184 RoomConfigStage.md level and room done +function RoomConfigStage SetBackdrop repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:169 RoomConfigStage.md level and room done +function RoomConfigStage SetBossSpot repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:178 RoomConfigStage.md level and room done +function RoomConfigStage SetDisplayName repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:174 RoomConfigStage.md level and room done +function RoomConfigStage SetMusic repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:171 RoomConfigStage.md level and room done +function RoomConfigStage SetPlayerSpot repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:176 RoomConfigStage.md level and room done +function RoomConfigStage SetSuffix repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:180 RoomConfigStage.md level and room done +function RoomConfigStage SetXMLName repentogon/LuaInterfaces/Room/LuaRoomConfigStage.cpp:183 RoomConfigStage.md level and room done +function RoomDescriptor AddRestrictedGridIndex repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:325 RoomDescriptor.md level and room done +function RoomDescriptor AllowedDoors repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:109 RoomDescriptor.md level and room done function RoomDescriptor CreateGroup repentogon/resources/scripts/repentogon_api/room_descriptor.lua:48 RoomDescriptor.md level and room done defined in Lua -function RoomDescriptor Doors repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:113 RoomDescriptor.md level and room todo -function RoomDescriptor GetDecoSaveState repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:323 RoomDescriptor.md level and room todo -function RoomDescriptor GetDimension repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:328 RoomDescriptor.md level and room todo -function RoomDescriptor GetEntitiesSaveState repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:322 RoomDescriptor.md level and room todo -function RoomDescriptor GetErrorTrinketEffect repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:335 RoomDescriptor.md level and room todo -function RoomDescriptor GetGridEntitiesSaveState repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:326 RoomDescriptor.md level and room todo -function RoomDescriptor GetGroup repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:333 RoomDescriptor.md level and room todo +function RoomDescriptor Doors repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:113 RoomDescriptor.md level and room done +function RoomDescriptor GetDecoSaveState repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:323 RoomDescriptor.md level and room done +function RoomDescriptor GetDimension repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:328 RoomDescriptor.md level and room done +function RoomDescriptor GetEntitiesSaveState repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:322 RoomDescriptor.md level and room done +function RoomDescriptor GetErrorTrinketEffect repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:335 RoomDescriptor.md level and room done +function RoomDescriptor GetGridEntitiesSaveState repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:326 RoomDescriptor.md level and room done +function RoomDescriptor GetGroup repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:333 RoomDescriptor.md level and room done function RoomDescriptor GetGroupByName repentogon/resources/scripts/repentogon_api/room_descriptor.lua:49 RoomDescriptor.md level and room done defined in Lua -function RoomDescriptor GetNeighboringRooms repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:329 RoomDescriptor.md level and room todo -function RoomDescriptor GetRestrictedGridIndexes repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:324 RoomDescriptor.md level and room todo -function RoomDescriptor GetTaintedKeeperCoinSpawns repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:331 RoomDescriptor.md level and room todo -function RoomDescriptor GetValidNeighborPlacementLocations repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:330 RoomDescriptor.md level and room todo -function RoomDescriptor InitSeeds repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:327 RoomDescriptor.md level and room todo -function RoomDescriptor SetGroup repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:334 RoomDescriptor.md level and room todo -function RoomDescriptor SetTaintedKeeperCoinSpawns repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:332 RoomDescriptor.md level and room todo -function RoomTransition GetPlayerExtraPortraitSprite repentogon/LuaInterfaces/Room/LuaRoomTransition.cpp:88 RoomTransition.md level and room todo -function RoomTransition GetTransitionMode repentogon/LuaInterfaces/Room/LuaRoomTransition.cpp:86 RoomTransition.md level and room todo -function RoomTransition GetVersusScreenSprite repentogon/LuaInterfaces/Room/LuaRoomTransition.cpp:84 RoomTransition.md level and room todo -function RoomTransition IsRenderingBossIntro repentogon/LuaInterfaces/Room/LuaRoomTransition.cpp:87 RoomTransition.md level and room todo -function RoomTransition StartBossIntro repentogon/LuaInterfaces/Room/LuaRoomTransition.cpp:85 RoomTransition.md level and room todo -function SaveMenu GetDeleteButtonSprite repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:154 hud and menus todo -function SaveMenu GetDeletePopupSprite repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:155 hud and menus todo -function SaveMenu GetSave1DrawingSprite repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:156 hud and menus todo -function SaveMenu GetSave2DrawingSprite repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:157 hud and menus todo -function SaveMenu GetSave3DrawingSprite repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:158 hud and menus todo -function SaveMenu GetSaveSelectMenuSprite repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:153 hud and menus todo -function SaveMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:159 hud and menus todo -function SaveMenu IsDeleteActive repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:161 hud and menus todo -function SaveMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:160 hud and menus todo -function SaveMenu SetSlotSpritesheet repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:162 hud and menus todo +function RoomDescriptor GetNeighboringRooms repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:329 RoomDescriptor.md level and room done +function RoomDescriptor GetRestrictedGridIndexes repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:324 RoomDescriptor.md level and room done +function RoomDescriptor GetTaintedKeeperCoinSpawns repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:331 RoomDescriptor.md level and room done +function RoomDescriptor GetValidNeighborPlacementLocations repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:330 RoomDescriptor.md level and room done +function RoomDescriptor InitSeeds repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:327 RoomDescriptor.md level and room done +function RoomDescriptor SetGroup repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:334 RoomDescriptor.md level and room done +function RoomDescriptor SetTaintedKeeperCoinSpawns repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:332 RoomDescriptor.md level and room done +function RoomTransition GetPlayerExtraPortraitSprite repentogon/LuaInterfaces/Room/LuaRoomTransition.cpp:88 RoomTransition.md level and room done +function RoomTransition GetTransitionMode repentogon/LuaInterfaces/Room/LuaRoomTransition.cpp:86 RoomTransition.md level and room done +function RoomTransition GetVersusScreenSprite repentogon/LuaInterfaces/Room/LuaRoomTransition.cpp:84 RoomTransition.md level and room done +function RoomTransition IsRenderingBossIntro repentogon/LuaInterfaces/Room/LuaRoomTransition.cpp:87 RoomTransition.md level and room done +function RoomTransition StartBossIntro repentogon/LuaInterfaces/Room/LuaRoomTransition.cpp:85 RoomTransition.md level and room done +function SaveMenu GetDeleteButtonSprite repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:154 hud and menus done +function SaveMenu GetDeletePopupSprite repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:155 hud and menus done +function SaveMenu GetSave1DrawingSprite repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:156 hud and menus done +function SaveMenu GetSave2DrawingSprite repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:157 hud and menus done +function SaveMenu GetSave3DrawingSprite repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:158 hud and menus done +function SaveMenu GetSaveSelectMenuSprite repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:153 hud and menus done +function SaveMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:159 hud and menus done +function SaveMenu IsDeleteActive repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:161 hud and menus done +function SaveMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:160 hud and menus done +function SaveMenu SetSlotSpritesheet repentogon/LuaInterfaces/Menus/LuaSaveMenu.cpp:162 hud and menus done function SaveStateManager ClearGameData repentogon/resources/scripts/main_ex.lua:2335 game done defined in Lua function SaveStateManager GetEntityData repentogon/resources/scripts/main_ex.lua:2336 entities done defined in Lua function SaveStateManager GetEntitySaveStateData repentogon/resources/scripts/main_ex.lua:2337 persistent data and saves done defined in Lua function SaveStateManager GetGameData repentogon/resources/scripts/main_ex.lua:2334 game done defined in Lua function SaveStateManager TryGetEntityData repentogon/resources/scripts/main_ex.lua:2338 entities done defined in Lua function SaveStateManager TryGetEntitySaveStateData repentogon/resources/scripts/main_ex.lua:2339 persistent data and saves done defined in Lua -function ScoreSheet AddFinishedStage repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:203 ScoreSheet.md hud and menus todo -function ScoreSheet Calculate repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:186 ScoreSheet.md hud and menus todo -function ScoreSheet GetBeastBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:206 ScoreSheet.md hud and menus todo -function ScoreSheet GetBlueBabyBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:189 ScoreSheet.md hud and menus todo -function ScoreSheet GetDamagePenalty repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:194 ScoreSheet.md hud and menus todo -function ScoreSheet GetDeliriumBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:205 ScoreSheet.md hud and menus todo -function ScoreSheet GetExplorationBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:193 ScoreSheet.md hud and menus todo -function ScoreSheet GetItemPenalty repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:196 ScoreSheet.md hud and menus todo -function ScoreSheet GetLambBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:190 ScoreSheet.md hud and menus todo -function ScoreSheet GetMegaSatanBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:191 ScoreSheet.md hud and menus todo -function ScoreSheet GetMotherBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:204 ScoreSheet.md hud and menus todo -function ScoreSheet GetRunEnding repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:201 ScoreSheet.md hud and menus todo -function ScoreSheet GetRunTime repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:200 ScoreSheet.md hud and menus todo -function ScoreSheet GetRunTimeLevel repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:198 ScoreSheet.md hud and menus todo -function ScoreSheet GetRunTimeLevelType repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:199 ScoreSheet.md hud and menus todo -function ScoreSheet GetRushBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:192 ScoreSheet.md hud and menus todo -function ScoreSheet GetSchwagBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:188 ScoreSheet.md hud and menus todo -function ScoreSheet GetStageBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:187 ScoreSheet.md hud and menus todo -function ScoreSheet GetTimePenalty repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:195 ScoreSheet.md hud and menus todo -function ScoreSheet GetTotalScore repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:197 ScoreSheet.md hud and menus todo -function ScoreSheet SetRunEnding repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:202 ScoreSheet.md hud and menus todo -function Seeds SetStageSeed repentogon/LuaInterfaces/LuaSeeds.cpp:29 Seeds.md game todo -function Shader Clear repentogon/LuaInterfaces/LuaRender.cpp:426 render and sprites todo -function Shader SetBlendMode repentogon/LuaInterfaces/LuaRender.cpp:427 render and sprites todo -function Shape Capsule repentogon/LuaInterfaces/LuaShape.cpp:48 entities todo -function Shape Circle repentogon/LuaInterfaces/LuaShape.cpp:49 entities todo -function Shape GetTimeout repentogon/LuaInterfaces/LuaShape.cpp:46 entities todo -function Shape SetTimeout repentogon/LuaInterfaces/LuaShape.cpp:47 entities todo -function SourceQuad ConvertToPixelSpace repentogon/LuaInterfaces/LuaRender.cpp:781 render and sprites todo -function SourceQuad ConvertToUVSpace repentogon/LuaInterfaces/LuaRender.cpp:782 render and sprites todo -function SourceQuad Copy repentogon/LuaInterfaces/LuaRender.cpp:779 render and sprites todo -function SourceQuad IsUVSpace repentogon/LuaInterfaces/LuaRender.cpp:780 render and sprites todo -function SourceQuad NewFromBounds repentogon/LuaInterfaces/LuaRender.cpp:3218 render and sprites todo -function SourceQuad NewFromRectangle repentogon/LuaInterfaces/LuaRender.cpp:3221 render and sprites todo -function SourceQuad __tostring repentogon/LuaInterfaces/LuaRender.cpp:783 render and sprites todo -function SpecialSeedsMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaSpecialSeedsMenu.cpp:37 hud and menus todo -function SpecialSeedsMenu GetSprite repentogon/LuaInterfaces/Menus/LuaSpecialSeedsMenu.cpp:36 hud and menus todo -function SpecialSeedsMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaSpecialSeedsMenu.cpp:38 hud and menus todo -function Sprite ClearCustomChampionShader repentogon/LuaInterfaces/LuaSprite.cpp:718 Sprite.md render and sprites todo -function Sprite ClearCustomShader repentogon/LuaInterfaces/LuaSprite.cpp:715 Sprite.md render and sprites todo -function Sprite Continue repentogon/LuaInterfaces/LuaSprite.cpp:709 Sprite.md render and sprites todo -function Sprite ContinueOverlay repentogon/LuaInterfaces/LuaSprite.cpp:710 Sprite.md render and sprites todo -function Sprite Copy repentogon/LuaInterfaces/LuaSprite.cpp:695 Sprite.md render and sprites todo -function Sprite GetAllAnimationData repentogon/LuaInterfaces/LuaAnimationData.cpp:142 Sprite.md render and sprites todo -function Sprite GetAllLayers repentogon/LuaInterfaces/LuaSprite.cpp:697 Sprite.md render and sprites todo -function Sprite GetAnimationData repentogon/LuaInterfaces/LuaAnimationData.cpp:141 Sprite.md render and sprites todo -function Sprite GetCurrentAnimationData repentogon/LuaInterfaces/LuaAnimationData.cpp:139 Sprite.md render and sprites todo -function Sprite GetEventTriggerFrames repentogon/LuaInterfaces/LuaSprite.cpp:720 Sprite.md render and sprites todo -function Sprite GetLayer repentogon/LuaInterfaces/LuaSprite.cpp:696 Sprite.md render and sprites todo -function Sprite GetLayerFrameData repentogon/LuaInterfaces/LuaSprite.cpp:705 Sprite.md render and sprites todo -function Sprite GetNullFrame repentogon/LuaInterfaces/LuaNullFrame.cpp:80 Sprite.md render and sprites todo -function Sprite GetOverlayAnimationData repentogon/LuaInterfaces/LuaAnimationData.cpp:140 Sprite.md render and sprites todo -function Sprite GetOverlayLayerFrameData repentogon/LuaInterfaces/LuaSprite.cpp:706 Sprite.md render and sprites todo -function Sprite GetOverlayNullFrame repentogon/LuaInterfaces/LuaNullFrame.cpp:81 Sprite.md render and sprites todo -function Sprite GetRenderFlags repentogon/LuaInterfaces/LuaSprite.cpp:711 Sprite.md render and sprites todo -function Sprite GetSpritesheet repentogon/LuaInterfaces/LuaSprite.cpp:700 Sprite.md render and sprites todo -function Sprite HasCustomChampionShader repentogon/LuaInterfaces/LuaSprite.cpp:719 Sprite.md render and sprites todo -function Sprite HasCustomShader repentogon/LuaInterfaces/LuaSprite.cpp:716 Sprite.md render and sprites todo -function Sprite IsOverlayEventTriggered repentogon/LuaInterfaces/LuaSprite.cpp:701 Sprite.md render and sprites todo -function Sprite LoadRGON repentogon/LuaInterfaces/LuaSprite.cpp:713 render and sprites todo -function Sprite ReplaceSpritesheet repentogon/LuaInterfaces/LuaSprite.cpp:698 Sprite.md render and sprites review -function Sprite SetCustomChampionShader repentogon/LuaInterfaces/LuaSprite.cpp:717 Sprite.md render and sprites todo -function Sprite SetCustomShader repentogon/LuaInterfaces/LuaSprite.cpp:714 Sprite.md render and sprites todo -function Sprite SetOverlayFrame repentogon/LuaInterfaces/LuaSprite.cpp:703 Sprite.md render and sprites review -function Sprite SetOverlayLayerFrame repentogon/LuaInterfaces/LuaSprite.cpp:704 Sprite.md render and sprites todo -function Sprite SetRenderFlags repentogon/LuaInterfaces/LuaSprite.cpp:712 Sprite.md render and sprites todo -function Sprite SetSpritesheet repentogon/LuaInterfaces/LuaSprite.cpp:699 Sprite.md render and sprites todo -function Sprite Stop repentogon/LuaInterfaces/LuaSprite.cpp:707 Sprite.md render and sprites review -function Sprite StopOverlay repentogon/LuaInterfaces/LuaSprite.cpp:708 Sprite.md render and sprites todo -function Sprite WasOverlayEventTriggered repentogon/LuaInterfaces/LuaSprite.cpp:702 Sprite.md render and sprites todo -function StageTransition GetSameStage repentogon/LuaInterfaces/LuaStageTransition.cpp:35 StageTransition.md game todo -function StageTransition SetSameStage repentogon/LuaInterfaces/LuaStageTransition.cpp:34 StageTransition.md game todo -function StatsMenu GetSecretsMenuCursorLeftSprite repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:176 hud and menus todo -function StatsMenu GetSecretsMenuCursorRightSprite repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:177 hud and menus todo -function StatsMenu GetSecretsMenuMiniSprite1 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:167 hud and menus todo -function StatsMenu GetSecretsMenuMiniSprite2 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:168 hud and menus todo -function StatsMenu GetSecretsMenuMiniSprite3 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:169 hud and menus todo -function StatsMenu GetSecretsMenuMiniSprite4 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:170 hud and menus todo -function StatsMenu GetSecretsMenuMiniSprite5 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:171 hud and menus todo -function StatsMenu GetSecretsMenuMiniSprite6 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:172 hud and menus todo -function StatsMenu GetSecretsMenuMiniSprite7 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:173 hud and menus todo -function StatsMenu GetSecretsMenuMiniSprite8 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:174 hud and menus todo -function StatsMenu GetSecretsMenuMiniSprite9 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:175 hud and menus todo -function StatsMenu GetSecretsMenuSprite repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:166 hud and menus todo -function StatsMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:179 hud and menus todo -function StatsMenu GetStatsMenuSprite repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:165 hud and menus todo -function StatsMenu IsSecretsMenuVisible repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:178 hud and menus todo -function StatsMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:180 hud and menus todo -function TitleMenu GetSprite repentogon/LuaInterfaces/Menus/LuaTitleMenu.cpp:17 hud and menus todo -function Transformer Apply repentogon/LuaInterfaces/LuaRender.cpp:525 render and sprites todo -function Transformer IsValid repentogon/LuaInterfaces/LuaRender.cpp:526 render and sprites todo -function Transformer Render repentogon/LuaInterfaces/LuaRender.cpp:523 render and sprites todo -function Transformer RenderEx repentogon/LuaInterfaces/LuaRender.cpp:524 render and sprites todo +function ScoreSheet AddFinishedStage repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:203 ScoreSheet.md hud and menus done +function ScoreSheet Calculate repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:186 ScoreSheet.md hud and menus done +function ScoreSheet GetBeastBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:206 ScoreSheet.md hud and menus done +function ScoreSheet GetBlueBabyBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:189 ScoreSheet.md hud and menus done +function ScoreSheet GetDamagePenalty repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:194 ScoreSheet.md hud and menus done +function ScoreSheet GetDeliriumBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:205 ScoreSheet.md hud and menus done +function ScoreSheet GetExplorationBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:193 ScoreSheet.md hud and menus done +function ScoreSheet GetItemPenalty repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:196 ScoreSheet.md hud and menus done +function ScoreSheet GetLambBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:190 ScoreSheet.md hud and menus done +function ScoreSheet GetMegaSatanBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:191 ScoreSheet.md hud and menus done +function ScoreSheet GetMotherBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:204 ScoreSheet.md hud and menus done +function ScoreSheet GetRunEnding repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:201 ScoreSheet.md hud and menus done +function ScoreSheet GetRunTime repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:200 ScoreSheet.md hud and menus done +function ScoreSheet GetRunTimeLevel repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:198 ScoreSheet.md hud and menus done +function ScoreSheet GetRunTimeLevelType repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:199 ScoreSheet.md hud and menus done +function ScoreSheet GetRushBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:192 ScoreSheet.md hud and menus done +function ScoreSheet GetSchwagBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:188 ScoreSheet.md hud and menus done +function ScoreSheet GetStageBonus repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:187 ScoreSheet.md hud and menus done +function ScoreSheet GetTimePenalty repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:195 ScoreSheet.md hud and menus done +function ScoreSheet GetTotalScore repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:197 ScoreSheet.md hud and menus done +function ScoreSheet SetRunEnding repentogon/LuaInterfaces/HUD/LuaScoreSheet.cpp:202 ScoreSheet.md hud and menus done +function Seeds SetStageSeed repentogon/LuaInterfaces/LuaSeeds.cpp:29 Seeds.md game done +function Shader Clear repentogon/LuaInterfaces/LuaRender.cpp:426 render and sprites done +function Shader SetBlendMode repentogon/LuaInterfaces/LuaRender.cpp:427 render and sprites done +function Shape Capsule repentogon/LuaInterfaces/LuaShape.cpp:48 entities done +function Shape Circle repentogon/LuaInterfaces/LuaShape.cpp:49 entities done +function Shape GetTimeout repentogon/LuaInterfaces/LuaShape.cpp:46 entities done +function Shape SetTimeout repentogon/LuaInterfaces/LuaShape.cpp:47 entities done +function SourceQuad ConvertToPixelSpace repentogon/LuaInterfaces/LuaRender.cpp:781 render and sprites done +function SourceQuad ConvertToUVSpace repentogon/LuaInterfaces/LuaRender.cpp:782 render and sprites done +function SourceQuad Copy repentogon/LuaInterfaces/LuaRender.cpp:779 render and sprites done +function SourceQuad IsUVSpace repentogon/LuaInterfaces/LuaRender.cpp:780 render and sprites done +function SourceQuad NewFromBounds repentogon/LuaInterfaces/LuaRender.cpp:3218 render and sprites done +function SourceQuad NewFromRectangle repentogon/LuaInterfaces/LuaRender.cpp:3221 render and sprites done +function SourceQuad __tostring repentogon/LuaInterfaces/LuaRender.cpp:783 render and sprites done +function SpecialSeedsMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaSpecialSeedsMenu.cpp:37 hud and menus done +function SpecialSeedsMenu GetSprite repentogon/LuaInterfaces/Menus/LuaSpecialSeedsMenu.cpp:36 hud and menus done +function SpecialSeedsMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaSpecialSeedsMenu.cpp:38 hud and menus done +function Sprite ClearCustomChampionShader repentogon/LuaInterfaces/LuaSprite.cpp:718 Sprite.md render and sprites done +function Sprite ClearCustomShader repentogon/LuaInterfaces/LuaSprite.cpp:715 Sprite.md render and sprites done +function Sprite Continue repentogon/LuaInterfaces/LuaSprite.cpp:709 Sprite.md render and sprites done +function Sprite ContinueOverlay repentogon/LuaInterfaces/LuaSprite.cpp:710 Sprite.md render and sprites done +function Sprite Copy repentogon/LuaInterfaces/LuaSprite.cpp:695 Sprite.md render and sprites done +function Sprite GetAllAnimationData repentogon/LuaInterfaces/LuaAnimationData.cpp:142 Sprite.md render and sprites done +function Sprite GetAllLayers repentogon/LuaInterfaces/LuaSprite.cpp:697 Sprite.md render and sprites done +function Sprite GetAnimationData repentogon/LuaInterfaces/LuaAnimationData.cpp:141 Sprite.md render and sprites done +function Sprite GetCurrentAnimationData repentogon/LuaInterfaces/LuaAnimationData.cpp:139 Sprite.md render and sprites done +function Sprite GetEventTriggerFrames repentogon/LuaInterfaces/LuaSprite.cpp:720 Sprite.md render and sprites done +function Sprite GetLayer repentogon/LuaInterfaces/LuaSprite.cpp:696 Sprite.md render and sprites done +function Sprite GetLayerFrameData repentogon/LuaInterfaces/LuaSprite.cpp:705 Sprite.md render and sprites done +function Sprite GetNullFrame repentogon/LuaInterfaces/LuaNullFrame.cpp:80 Sprite.md render and sprites done +function Sprite GetOverlayAnimationData repentogon/LuaInterfaces/LuaAnimationData.cpp:140 Sprite.md render and sprites done +function Sprite GetOverlayLayerFrameData repentogon/LuaInterfaces/LuaSprite.cpp:706 Sprite.md render and sprites done +function Sprite GetOverlayNullFrame repentogon/LuaInterfaces/LuaNullFrame.cpp:81 Sprite.md render and sprites done +function Sprite GetRenderFlags repentogon/LuaInterfaces/LuaSprite.cpp:711 Sprite.md render and sprites done +function Sprite GetSpritesheet repentogon/LuaInterfaces/LuaSprite.cpp:700 Sprite.md render and sprites done +function Sprite HasCustomChampionShader repentogon/LuaInterfaces/LuaSprite.cpp:719 Sprite.md render and sprites done +function Sprite HasCustomShader repentogon/LuaInterfaces/LuaSprite.cpp:716 Sprite.md render and sprites done +function Sprite IsOverlayEventTriggered repentogon/LuaInterfaces/LuaSprite.cpp:701 Sprite.md render and sprites done +function Sprite LoadRGON repentogon/LuaInterfaces/LuaSprite.cpp:713 render and sprites done +function Sprite ReplaceSpritesheet repentogon/LuaInterfaces/LuaSprite.cpp:698 Sprite.md render and sprites done +function Sprite SetCustomChampionShader repentogon/LuaInterfaces/LuaSprite.cpp:717 Sprite.md render and sprites done +function Sprite SetCustomShader repentogon/LuaInterfaces/LuaSprite.cpp:714 Sprite.md render and sprites done +function Sprite SetOverlayFrame repentogon/LuaInterfaces/LuaSprite.cpp:703 Sprite.md render and sprites done +function Sprite SetOverlayLayerFrame repentogon/LuaInterfaces/LuaSprite.cpp:704 Sprite.md render and sprites done +function Sprite SetRenderFlags repentogon/LuaInterfaces/LuaSprite.cpp:712 Sprite.md render and sprites done +function Sprite SetSpritesheet repentogon/LuaInterfaces/LuaSprite.cpp:699 Sprite.md render and sprites done +function Sprite Stop repentogon/LuaInterfaces/LuaSprite.cpp:707 Sprite.md render and sprites done +function Sprite StopOverlay repentogon/LuaInterfaces/LuaSprite.cpp:708 Sprite.md render and sprites done +function Sprite WasOverlayEventTriggered repentogon/LuaInterfaces/LuaSprite.cpp:702 Sprite.md render and sprites done +function StageTransition GetSameStage repentogon/LuaInterfaces/LuaStageTransition.cpp:35 StageTransition.md game done +function StageTransition SetSameStage repentogon/LuaInterfaces/LuaStageTransition.cpp:34 StageTransition.md game done +function StatsMenu GetSecretsMenuCursorLeftSprite repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:176 hud and menus done +function StatsMenu GetSecretsMenuCursorRightSprite repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:177 hud and menus done +function StatsMenu GetSecretsMenuMiniSprite1 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:167 hud and menus done +function StatsMenu GetSecretsMenuMiniSprite2 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:168 hud and menus done +function StatsMenu GetSecretsMenuMiniSprite3 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:169 hud and menus done +function StatsMenu GetSecretsMenuMiniSprite4 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:170 hud and menus done +function StatsMenu GetSecretsMenuMiniSprite5 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:171 hud and menus done +function StatsMenu GetSecretsMenuMiniSprite6 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:172 hud and menus done +function StatsMenu GetSecretsMenuMiniSprite7 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:173 hud and menus done +function StatsMenu GetSecretsMenuMiniSprite8 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:174 hud and menus done +function StatsMenu GetSecretsMenuMiniSprite9 repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:175 hud and menus done +function StatsMenu GetSecretsMenuSprite repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:166 hud and menus done +function StatsMenu GetSelectedElement repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:179 hud and menus done +function StatsMenu GetStatsMenuSprite repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:165 hud and menus done +function StatsMenu IsSecretsMenuVisible repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:178 hud and menus done +function StatsMenu SetSelectedElement repentogon/LuaInterfaces/Menus/LuaStatsMenu.cpp:180 hud and menus done +function TitleMenu GetSprite repentogon/LuaInterfaces/Menus/LuaTitleMenu.cpp:17 hud and menus done +function Transformer Apply repentogon/LuaInterfaces/LuaRender.cpp:525 render and sprites done +function Transformer IsValid repentogon/LuaInterfaces/LuaRender.cpp:526 render and sprites done +function Transformer Render repentogon/LuaInterfaces/LuaRender.cpp:523 render and sprites done +function Transformer RenderEx repentogon/LuaInterfaces/LuaRender.cpp:524 render and sprites done function UnitTests Build repentogon/RoomConfigUtility.cpp:1009 misc todo debug builds only function UnitTests CompareSaves repentogon/SaveSyncing/SaveSyncing.cpp:865 persistent data and saves todo debug builds only function UnitTests Deserialize repentogon/RoomConfigUtility.cpp:1011 misc todo debug builds only @@ -1912,41 +1912,41 @@ function UnitTests TestSync repentogon/SaveSyncing/SaveSyncing.cpp:864 misc tod function UnitTests ValidateCloudSave repentogon/SaveSyncing/SaveSyncing.cpp:862 persistent data and saves todo debug builds only function UnitTests ValidateLocalSave repentogon/SaveSyncing/SaveSyncing.cpp:861 persistent data and saves todo debug builds only function Vector FromAngle repentogon/LuaInterfaces/LuaVector.cpp:159 Vector.md misc done -function Vector Lerp repentogon/LuaInterfaces/LuaVector.cpp:182 misc review -function Vector __add repentogon/LuaInterfaces/LuaVector.cpp:176 Vector.md misc review -function Vector __div repentogon/LuaInterfaces/LuaVector.cpp:173 Vector.md misc review -function Vector __mul repentogon/LuaInterfaces/LuaVector.cpp:170 Vector.md misc review -function Vector __sub repentogon/LuaInterfaces/LuaVector.cpp:179 Vector.md misc review +function Vector Lerp repentogon/LuaInterfaces/LuaVector.cpp:182 misc done +function Vector __add repentogon/LuaInterfaces/LuaVector.cpp:176 Vector.md misc done +function Vector __div repentogon/LuaInterfaces/LuaVector.cpp:173 Vector.md misc done +function Vector __mul repentogon/LuaInterfaces/LuaVector.cpp:170 Vector.md misc done +function Vector __sub repentogon/LuaInterfaces/LuaVector.cpp:179 Vector.md misc done function Vertex Dump repentogon/LuaInterfaces/LuaRender.cpp:1941 misc todo function VertexBuffer GetElements repentogon/LuaInterfaces/LuaRender.cpp:2029 misc todo function VertexBuffer GetVertex repentogon/LuaInterfaces/LuaRender.cpp:2028 misc todo function VertexBuffer __len repentogon/LuaInterfaces/LuaRender.cpp:2030 misc todo function VertexDescriptor AddAttribute repentogon/LuaInterfaces/LuaRender.cpp:1670 misc todo -function Weapon ClearItemAnim repentogon/LuaInterfaces/LuaWeapon.cpp:220 Weapon.md tear and weapons todo -function Weapon GetCharge repentogon/LuaInterfaces/LuaWeapon.cpp:210 Weapon.md tear and weapons todo -function Weapon GetDirection repentogon/LuaInterfaces/LuaWeapon.cpp:212 Weapon.md tear and weapons todo -function Weapon GetFireDelay repentogon/LuaInterfaces/LuaWeapon.cpp:207 Weapon.md tear and weapons todo -function Weapon GetMainEntity repentogon/LuaInterfaces/LuaWeapon.cpp:222 Weapon.md tear and weapons todo -function Weapon GetMaxCharge repentogon/LuaInterfaces/LuaWeapon.cpp:223 Weapon.md tear and weapons todo -function Weapon GetMaxFireDelay repentogon/LuaInterfaces/LuaWeapon.cpp:209 Weapon.md tear and weapons todo -function Weapon GetModifiers repentogon/LuaInterfaces/LuaWeapon.cpp:214 Weapon.md tear and weapons todo -function Weapon GetNumFired repentogon/LuaInterfaces/LuaWeapon.cpp:216 Weapon.md tear and weapons todo -function Weapon GetOwner repentogon/LuaInterfaces/LuaWeapon.cpp:206 Weapon.md tear and weapons todo -function Weapon GetWeaponType repentogon/LuaInterfaces/LuaWeapon.cpp:213 Weapon.md tear and weapons todo -function Weapon IsAxisAligned repentogon/LuaInterfaces/LuaWeapon.cpp:218 Weapon.md tear and weapons todo -function Weapon IsItemAnimFinished repentogon/LuaInterfaces/LuaWeapon.cpp:219 Weapon.md tear and weapons todo -function Weapon PlayItemAnim repentogon/LuaInterfaces/LuaWeapon.cpp:217 Weapon.md tear and weapons todo -function Weapon SetCharge repentogon/LuaInterfaces/LuaWeapon.cpp:211 Weapon.md tear and weapons todo -function Weapon SetFireDelay repentogon/LuaInterfaces/LuaWeapon.cpp:208 Weapon.md tear and weapons todo -function Weapon SetHeadLockTime repentogon/LuaInterfaces/LuaWeapon.cpp:221 Weapon.md tear and weapons todo -function Weapon SetModifiers repentogon/LuaInterfaces/LuaWeapon.cpp:215 Weapon.md tear and weapons todo -function WeightedOutcomePicker AddOutcomeFloat repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:111 WeightedOutcomePicker.md items and pools todo -function WeightedOutcomePicker AddOutcomeWeight repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:112 WeightedOutcomePicker.md items and pools todo -function WeightedOutcomePicker ClearOutcomes repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:113 WeightedOutcomePicker.md items and pools todo -function WeightedOutcomePicker GetNumOutcomes repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:114 WeightedOutcomePicker.md items and pools todo -function WeightedOutcomePicker GetOutcomes repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:115 WeightedOutcomePicker.md items and pools todo -function WeightedOutcomePicker PickOutcome repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:116 WeightedOutcomePicker.md items and pools todo -function WeightedOutcomePicker RemoveOutcome repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:117 WeightedOutcomePicker.md items and pools todo +function Weapon ClearItemAnim repentogon/LuaInterfaces/LuaWeapon.cpp:220 Weapon.md tear and weapons done +function Weapon GetCharge repentogon/LuaInterfaces/LuaWeapon.cpp:210 Weapon.md tear and weapons done +function Weapon GetDirection repentogon/LuaInterfaces/LuaWeapon.cpp:212 Weapon.md tear and weapons done +function Weapon GetFireDelay repentogon/LuaInterfaces/LuaWeapon.cpp:207 Weapon.md tear and weapons done +function Weapon GetMainEntity repentogon/LuaInterfaces/LuaWeapon.cpp:222 Weapon.md tear and weapons done +function Weapon GetMaxCharge repentogon/LuaInterfaces/LuaWeapon.cpp:223 Weapon.md tear and weapons done +function Weapon GetMaxFireDelay repentogon/LuaInterfaces/LuaWeapon.cpp:209 Weapon.md tear and weapons done +function Weapon GetModifiers repentogon/LuaInterfaces/LuaWeapon.cpp:214 Weapon.md tear and weapons done +function Weapon GetNumFired repentogon/LuaInterfaces/LuaWeapon.cpp:216 Weapon.md tear and weapons done +function Weapon GetOwner repentogon/LuaInterfaces/LuaWeapon.cpp:206 Weapon.md tear and weapons done +function Weapon GetWeaponType repentogon/LuaInterfaces/LuaWeapon.cpp:213 Weapon.md tear and weapons done +function Weapon IsAxisAligned repentogon/LuaInterfaces/LuaWeapon.cpp:218 Weapon.md tear and weapons done +function Weapon IsItemAnimFinished repentogon/LuaInterfaces/LuaWeapon.cpp:219 Weapon.md tear and weapons done +function Weapon PlayItemAnim repentogon/LuaInterfaces/LuaWeapon.cpp:217 Weapon.md tear and weapons done +function Weapon SetCharge repentogon/LuaInterfaces/LuaWeapon.cpp:211 Weapon.md tear and weapons done +function Weapon SetFireDelay repentogon/LuaInterfaces/LuaWeapon.cpp:208 Weapon.md tear and weapons done +function Weapon SetHeadLockTime repentogon/LuaInterfaces/LuaWeapon.cpp:221 Weapon.md tear and weapons done +function Weapon SetModifiers repentogon/LuaInterfaces/LuaWeapon.cpp:215 Weapon.md tear and weapons done +function WeightedOutcomePicker AddOutcomeFloat repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:111 WeightedOutcomePicker.md items and pools done +function WeightedOutcomePicker AddOutcomeWeight repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:112 WeightedOutcomePicker.md items and pools done +function WeightedOutcomePicker ClearOutcomes repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:113 WeightedOutcomePicker.md items and pools done +function WeightedOutcomePicker GetNumOutcomes repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:114 WeightedOutcomePicker.md items and pools done +function WeightedOutcomePicker GetOutcomes repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:115 WeightedOutcomePicker.md items and pools done +function WeightedOutcomePicker PickOutcome repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:116 WeightedOutcomePicker.md items and pools done +function WeightedOutcomePicker RemoveOutcome repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:117 WeightedOutcomePicker.md items and pools done function XMLData GetBossColorByTypeVarSub repentogon/Patches/XMLData.cpp:2489 XMLData.md items and pools todo function XMLData GetCurrentMod repentogon/Patches/XMLData.cpp:2492 XMLData.md items and pools todo function XMLData GetEntityByTypeVarSub repentogon/Patches/XMLData.cpp:2488 XMLData.md items and pools todo @@ -1958,35 +1958,35 @@ function XMLData GetModById repentogon/Patches/XMLData.cpp:2491 XMLData.md items function XMLData GetNumEntries repentogon/Patches/XMLData.cpp:2487 XMLData.md items and pools todo function _G ASMPatch repentogon/LuaInterfaces/LuaASM.cpp:276 console and debug todo debug builds only function _G Benchmark repentogon/LuaInit.cpp:366 persistent data and saves todo -function _G DumpRegistry repentogon/LuaInit.cpp:362 console and debug todo -function _G ExtractFunctions repentogon/LuaInit.cpp:365 console and debug todo -function _G RandomFloat repentogon/LuaInit.cpp:367 console and debug todo -function _G ToDegrees repentogon/LuaInit.cpp:369 console and debug todo -function _G ToRadians repentogon/LuaInit.cpp:368 console and debug todo -function _Internals GetModId repentogon/LuaInterfaces/_Internals.cpp:309 console and debug todo -function _Internals HasModData repentogon/LuaInterfaces/_Internals.cpp:310 console and debug todo -function _Internals LoadModData repentogon/LuaInterfaces/_Internals.cpp:312 console and debug todo -function _Internals ModReference_HasModFile repentogon/LuaInterfaces/_Internals.cpp:315 console and debug todo -function _Internals ModReference_LoadModFile repentogon/LuaInterfaces/_Internals.cpp:317 console and debug todo -function _Internals ModReference_RemoveModFile repentogon/LuaInterfaces/_Internals.cpp:318 console and debug todo -function _Internals ModReference_SaveModFile repentogon/LuaInterfaces/_Internals.cpp:316 console and debug todo -function _Internals RaiseModError repentogon/LuaInterfaces/_Internals.cpp:308 console and debug todo -function _Internals RemoveAllData repentogon/LuaInterfaces/_Internals.cpp:314 console and debug todo -function _Internals RemoveModData repentogon/LuaInterfaces/_Internals.cpp:313 console and debug todo -function _Internals SaveModData repentogon/LuaInterfaces/_Internals.cpp:311 console and debug todo -property BlendMode AlphaDestinationFactor repentogon/LuaInterfaces/LuaBlendMode.cpp:237 render and sprites todo -property BlendMode AlphaSourceFactor repentogon/LuaInterfaces/LuaBlendMode.cpp:233 render and sprites todo -property BlendMode Equation repentogon/LuaInterfaces/LuaBlendMode.cpp:241 render and sprites todo -property BlendMode Flag1 repentogon/LuaInterfaces/LuaBlendMode.cpp:246 render and sprites todo -property BlendMode Flag2 repentogon/LuaInterfaces/LuaBlendMode.cpp:250 render and sprites todo -property BlendMode Flag3 repentogon/LuaInterfaces/LuaBlendMode.cpp:254 render and sprites todo -property BlendMode Flag4 repentogon/LuaInterfaces/LuaBlendMode.cpp:258 render and sprites todo -property BlendMode RGBDestinationFactor repentogon/LuaInterfaces/LuaBlendMode.cpp:229 render and sprites todo -property BlendMode RGBSourceFactor repentogon/LuaInterfaces/LuaBlendMode.cpp:225 render and sprites todo -property Card Hidden repentogon/LuaInterfaces/LuaItemConfig.cpp:196 ItemConfig_Card.md items and pools todo -property Card InitialWeight repentogon/LuaInterfaces/LuaItemConfig.cpp:197 ItemConfig_Card.md items and pools todo -property Card ModdedCardFront repentogon/LuaInterfaces/LuaItemConfig.cpp:195 ItemConfig_Card.md items and pools todo -property Card Weight repentogon/LuaInterfaces/LuaItemConfig.cpp:198 ItemConfig_Card.md items and pools todo +function _G DumpRegistry repentogon/LuaInit.cpp:362 console and debug done +function _G ExtractFunctions repentogon/LuaInit.cpp:365 console and debug done +function _G RandomFloat repentogon/LuaInit.cpp:367 console and debug done +function _G ToDegrees repentogon/LuaInit.cpp:369 console and debug done +function _G ToRadians repentogon/LuaInit.cpp:368 console and debug done +function _Internals GetModId repentogon/LuaInterfaces/_Internals.cpp:309 console and debug done +function _Internals HasModData repentogon/LuaInterfaces/_Internals.cpp:310 console and debug done +function _Internals LoadModData repentogon/LuaInterfaces/_Internals.cpp:312 console and debug done +function _Internals ModReference_HasModFile repentogon/LuaInterfaces/_Internals.cpp:315 console and debug done +function _Internals ModReference_LoadModFile repentogon/LuaInterfaces/_Internals.cpp:317 console and debug done +function _Internals ModReference_RemoveModFile repentogon/LuaInterfaces/_Internals.cpp:318 console and debug done +function _Internals ModReference_SaveModFile repentogon/LuaInterfaces/_Internals.cpp:316 console and debug done +function _Internals RaiseModError repentogon/LuaInterfaces/_Internals.cpp:308 console and debug done +function _Internals RemoveAllData repentogon/LuaInterfaces/_Internals.cpp:314 console and debug done +function _Internals RemoveModData repentogon/LuaInterfaces/_Internals.cpp:313 console and debug done +function _Internals SaveModData repentogon/LuaInterfaces/_Internals.cpp:311 console and debug done +property BlendMode AlphaDestinationFactor repentogon/LuaInterfaces/LuaBlendMode.cpp:237 render and sprites done +property BlendMode AlphaSourceFactor repentogon/LuaInterfaces/LuaBlendMode.cpp:233 render and sprites done +property BlendMode Equation repentogon/LuaInterfaces/LuaBlendMode.cpp:241 render and sprites done +property BlendMode Flag1 repentogon/LuaInterfaces/LuaBlendMode.cpp:246 render and sprites done +property BlendMode Flag2 repentogon/LuaInterfaces/LuaBlendMode.cpp:250 render and sprites done +property BlendMode Flag3 repentogon/LuaInterfaces/LuaBlendMode.cpp:254 render and sprites done +property BlendMode Flag4 repentogon/LuaInterfaces/LuaBlendMode.cpp:258 render and sprites done +property BlendMode RGBDestinationFactor repentogon/LuaInterfaces/LuaBlendMode.cpp:229 render and sprites done +property BlendMode RGBSourceFactor repentogon/LuaInterfaces/LuaBlendMode.cpp:225 render and sprites done +property Card Hidden repentogon/LuaInterfaces/LuaItemConfig.cpp:196 ItemConfig_Card.md items and pools done +property Card InitialWeight repentogon/LuaInterfaces/LuaItemConfig.cpp:197 ItemConfig_Card.md items and pools done +property Card ModdedCardFront repentogon/LuaInterfaces/LuaItemConfig.cpp:195 ItemConfig_Card.md items and pools done +property Card Weight repentogon/LuaInterfaces/LuaItemConfig.cpp:198 ItemConfig_Card.md items and pools done property Color EmberFade repentogon/resources/scripts/main_ex.lua:128 Color.md render and sprites done defined in Lua property Color LaserAlmond repentogon/resources/scripts/main_ex.lua:168 Color.md render and sprites done defined in Lua property Color LaserChocolate repentogon/resources/scripts/main_ex.lua:167 Color.md render and sprites done defined in Lua @@ -2026,90 +2026,90 @@ property Color TearScorpio repentogon/resources/scripts/main_ex.lua:145 Color.md property Color TearSerpentsKiss repentogon/resources/scripts/main_ex.lua:146 Color.md render and sprites done defined in Lua property Color TearSoy repentogon/resources/scripts/main_ex.lua:142 Color.md render and sprites done defined in Lua property Color TearTar repentogon/resources/scripts/main_ex.lua:141 Color.md render and sprites done defined in Lua -property ColorModifier A repentogon/LuaInterfaces/LuaColorModifier.cpp:243 ColorModifier.md render and sprites todo -property ColorModifier B repentogon/LuaInterfaces/LuaColorModifier.cpp:239 ColorModifier.md render and sprites todo -property ColorModifier Brightness repentogon/LuaInterfaces/LuaColorModifier.cpp:247 ColorModifier.md render and sprites todo -property ColorModifier Contrast repentogon/LuaInterfaces/LuaColorModifier.cpp:251 ColorModifier.md render and sprites todo -property ColorModifier G repentogon/LuaInterfaces/LuaColorModifier.cpp:235 ColorModifier.md render and sprites todo -property ColorModifier R repentogon/LuaInterfaces/LuaColorModifier.cpp:231 ColorModifier.md render and sprites todo -property Costume SkinColor repentogon/LuaInterfaces/LuaItemConfig.cpp:330 ItemConfig_Costume.md items and pools review -property Entity Variant repentogon/LuaInterfaces/Entities/LuaEntity.cpp:962 entities review -property EntityDelirium Angle repentogon/LuaInterfaces/LuaDelirium.cpp:145 EntityDelirium.md npc todo -property EntityDelirium AttackID repentogon/LuaInterfaces/LuaDelirium.cpp:142 EntityDelirium.md npc todo -property EntityDelirium BossType repentogon/LuaInterfaces/LuaDelirium.cpp:138 EntityDelirium.md npc todo -property EntityDelirium BossVariant repentogon/LuaInterfaces/LuaDelirium.cpp:139 EntityDelirium.md npc todo -property EntityDelirium Cycle repentogon/LuaInterfaces/LuaDelirium.cpp:143 EntityDelirium.md npc todo -property EntityDelirium RemainingAttacks repentogon/LuaInterfaces/LuaDelirium.cpp:141 EntityDelirium.md npc todo -property EntityDelirium StateD repentogon/LuaInterfaces/LuaDelirium.cpp:144 EntityDelirium.md npc todo -property EntityDelirium TransformationTimer repentogon/LuaInterfaces/LuaDelirium.cpp:140 EntityDelirium.md npc todo -property EntityLaser HomingType repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:272 EntityLaser.md tear and weapons review -property EntityNPC V1 repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:473 EntityNPC.md npc review -property EntityNPC V2 repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:474 EntityNPC.md npc review -property EntityPlayer BabySkin repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3875 EntityPlayer.md player review -property EntityPlayer FriendBallEnemy repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3876 EntityPlayer.md player review -property FXParams ColorModifier repentogon/LuaInterfaces/LuaFXParams.cpp:176 FXParams.md level and room todo -property FXParams LightColor repentogon/LuaInterfaces/LuaFXParams.cpp:200 FXParams.md level and room todo -property FXParams ShadowAlpha repentogon/LuaInterfaces/LuaFXParams.cpp:192 FXParams.md level and room todo -property FXParams ShadowColor repentogon/LuaInterfaces/LuaFXParams.cpp:196 FXParams.md level and room todo -property FXParams UseWaterV2 repentogon/LuaInterfaces/LuaFXParams.cpp:180 FXParams.md level and room todo -property FXParams WaterColor repentogon/LuaInterfaces/LuaFXParams.cpp:184 FXParams.md level and room todo -property FXParams WaterColorMultiplier repentogon/LuaInterfaces/LuaFXParams.cpp:188 FXParams.md level and room todo -property FXParams WaterEffectColor repentogon/LuaInterfaces/LuaFXParams.cpp:204 FXParams.md level and room todo -property Game Difficulty repentogon/LuaInterfaces/LuaGame.cpp:449 game review -property GridEntityDoor PreviousState repentogon/LuaInterfaces/GridEntities/LuaGridEntityDoor.cpp:59 GridEntityDoor.md level and room review -property GridEntityDoor PreviousVariant repentogon/LuaInterfaces/GridEntities/LuaGridEntityDoor.cpp:60 GridEntityDoor.md level and room review -property Options AimLockEnabled repentogon/LuaInterfaces/LuaOptions.cpp:394 Options.md misc todo -property Options AscentVoiceOver repentogon/LuaInterfaces/LuaOptions.cpp:395 Options.md misc todo -property Options BetterVoidGeneration repentogon/LuaInterfaces/LuaOptions.cpp:405 Options.md misc todo -property Options BossHPOnBottom repentogon/LuaInterfaces/LuaOptions.cpp:391 Options.md misc todo -property Options Brightness repentogon/LuaInterfaces/LuaOptions.cpp:387 Options.md misc todo -property Options Contrast repentogon/LuaInterfaces/LuaOptions.cpp:388 Options.md misc todo -property Options Exposure repentogon/LuaInterfaces/LuaOptions.cpp:386 Options.md misc todo -property Options HushPanicStateFix repentogon/LuaInterfaces/LuaOptions.cpp:406 Options.md misc todo +property ColorModifier A repentogon/LuaInterfaces/LuaColorModifier.cpp:243 ColorModifier.md render and sprites done +property ColorModifier B repentogon/LuaInterfaces/LuaColorModifier.cpp:239 ColorModifier.md render and sprites done +property ColorModifier Brightness repentogon/LuaInterfaces/LuaColorModifier.cpp:247 ColorModifier.md render and sprites done +property ColorModifier Contrast repentogon/LuaInterfaces/LuaColorModifier.cpp:251 ColorModifier.md render and sprites done +property ColorModifier G repentogon/LuaInterfaces/LuaColorModifier.cpp:235 ColorModifier.md render and sprites done +property ColorModifier R repentogon/LuaInterfaces/LuaColorModifier.cpp:231 ColorModifier.md render and sprites done +property Costume SkinColor repentogon/LuaInterfaces/LuaItemConfig.cpp:330 ItemConfig_Costume.md items and pools done +property Entity Variant repentogon/LuaInterfaces/Entities/LuaEntity.cpp:962 entities done +property EntityDelirium Angle repentogon/LuaInterfaces/LuaDelirium.cpp:145 EntityDelirium.md npc done +property EntityDelirium AttackID repentogon/LuaInterfaces/LuaDelirium.cpp:142 EntityDelirium.md npc done +property EntityDelirium BossType repentogon/LuaInterfaces/LuaDelirium.cpp:138 EntityDelirium.md npc done +property EntityDelirium BossVariant repentogon/LuaInterfaces/LuaDelirium.cpp:139 EntityDelirium.md npc done +property EntityDelirium Cycle repentogon/LuaInterfaces/LuaDelirium.cpp:143 EntityDelirium.md npc done +property EntityDelirium RemainingAttacks repentogon/LuaInterfaces/LuaDelirium.cpp:141 EntityDelirium.md npc done +property EntityDelirium StateD repentogon/LuaInterfaces/LuaDelirium.cpp:144 EntityDelirium.md npc done +property EntityDelirium TransformationTimer repentogon/LuaInterfaces/LuaDelirium.cpp:140 EntityDelirium.md npc done +property EntityLaser HomingType repentogon/LuaInterfaces/Entities/LuaEntityLaser.cpp:272 EntityLaser.md tear and weapons done +property EntityNPC V1 repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:473 EntityNPC.md npc done +property EntityNPC V2 repentogon/LuaInterfaces/Entities/LuaEntityNPC.cpp:474 EntityNPC.md npc done +property EntityPlayer BabySkin repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3875 EntityPlayer.md player done +property EntityPlayer FriendBallEnemy repentogon/LuaInterfaces/Entities/LuaEntityPlayer.cpp:3876 EntityPlayer.md player done +property FXParams ColorModifier repentogon/LuaInterfaces/LuaFXParams.cpp:176 FXParams.md level and room done +property FXParams LightColor repentogon/LuaInterfaces/LuaFXParams.cpp:200 FXParams.md level and room done +property FXParams ShadowAlpha repentogon/LuaInterfaces/LuaFXParams.cpp:192 FXParams.md level and room done +property FXParams ShadowColor repentogon/LuaInterfaces/LuaFXParams.cpp:196 FXParams.md level and room done +property FXParams UseWaterV2 repentogon/LuaInterfaces/LuaFXParams.cpp:180 FXParams.md level and room done +property FXParams WaterColor repentogon/LuaInterfaces/LuaFXParams.cpp:184 FXParams.md level and room done +property FXParams WaterColorMultiplier repentogon/LuaInterfaces/LuaFXParams.cpp:188 FXParams.md level and room done +property FXParams WaterEffectColor repentogon/LuaInterfaces/LuaFXParams.cpp:204 FXParams.md level and room done +property Game Difficulty repentogon/LuaInterfaces/LuaGame.cpp:449 game done +property GridEntityDoor PreviousState repentogon/LuaInterfaces/GridEntities/LuaGridEntityDoor.cpp:59 GridEntityDoor.md level and room done +property GridEntityDoor PreviousVariant repentogon/LuaInterfaces/GridEntities/LuaGridEntityDoor.cpp:60 GridEntityDoor.md level and room done +property Options AimLockEnabled repentogon/LuaInterfaces/LuaOptions.cpp:394 Options.md misc done +property Options AscentVoiceOver repentogon/LuaInterfaces/LuaOptions.cpp:395 Options.md misc done +property Options BetterVoidGeneration repentogon/LuaInterfaces/LuaOptions.cpp:405 Options.md misc done +property Options BossHPOnBottom repentogon/LuaInterfaces/LuaOptions.cpp:391 Options.md misc done +property Options Brightness repentogon/LuaInterfaces/LuaOptions.cpp:387 Options.md misc done +property Options Contrast repentogon/LuaInterfaces/LuaOptions.cpp:388 Options.md misc done +property Options Exposure repentogon/LuaInterfaces/LuaOptions.cpp:386 Options.md misc done +property Options HushPanicStateFix repentogon/LuaInterfaces/LuaOptions.cpp:406 Options.md misc done property Options KeyMasterDealChance Options.md misc todo docs only: no registration found -property Options OnlineChatEnabled repentogon/LuaInterfaces/LuaOptions.cpp:381 Options.md misc todo -property Options OnlineChatFilterEnabled repentogon/LuaInterfaces/LuaOptions.cpp:396 Options.md misc todo -property Options OnlineColorSet repentogon/LuaInterfaces/LuaOptions.cpp:384 Options.md misc todo -property Options OnlineHUD repentogon/LuaInterfaces/LuaOptions.cpp:379 Options.md misc todo -property Options OnlineInputDelay repentogon/LuaInterfaces/LuaOptions.cpp:385 Options.md misc todo -property Options OnlinePlayerOpacity repentogon/LuaInterfaces/LuaOptions.cpp:383 Options.md misc todo -property Options OnlinePlayerVolume repentogon/LuaInterfaces/LuaOptions.cpp:382 Options.md misc todo -property Options PreventModUpdates repentogon/LuaInterfaces/LuaOptions.cpp:409 Options.md misc todo -property Options QuickRoomClear repentogon/LuaInterfaces/LuaOptions.cpp:408 Options.md misc todo -property Options SFXVolume repentogon/LuaInterfaces/LuaOptions.cpp:410 Options.md misc review -property Options StatHUDPlanetarium repentogon/LuaInterfaces/LuaOptions.cpp:407 Options.md misc todo -property Options StreamerMode repentogon/LuaInterfaces/LuaOptions.cpp:380 Options.md misc todo -property Options TouchMode repentogon/LuaInterfaces/LuaOptions.cpp:393 Options.md misc todo -property Options WindowHeight repentogon/LuaInterfaces/LuaOptions.cpp:402 Options.md misc todo -property Options WindowPosX repentogon/LuaInterfaces/LuaOptions.cpp:403 Options.md misc todo -property Options WindowPosY repentogon/LuaInterfaces/LuaOptions.cpp:404 Options.md misc todo -property Options WindowWidth repentogon/LuaInterfaces/LuaOptions.cpp:401 Options.md misc todo -property PillEffect EffectClass repentogon/LuaInterfaces/LuaItemConfig.cpp:288 ItemConfig_PillEffect.md items and pools review -property PillEffect EffectSubClass repentogon/LuaInterfaces/LuaItemConfig.cpp:289 ItemConfig_PillEffect.md items and pools review -property ProjectileParams Damage repentogon/LuaInterfaces/LuaProjectileParams.cpp:27 ProjectileParams.md tear and weapons todo -property RoomConfigSet Size repentogon/LuaInterfaces/Room/LuaRoomConfigSet.cpp:89 CcpContainer_RoomConfigSet.md level and room todo -property RoomConfig_Room Mode repentogon/LuaInterfaces/Room/LuaRoomConfigRoom.cpp:14 RoomConfigRoom.md level and room review -property RoomDescriptor BossDeathSeed repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:339 RoomDescriptor.md level and room todo -property TearParams KnockbackMultiplier repentogon/LuaInterfaces/LuaTearParams.cpp:74 TearParams.md tear and weapons todo -property TearParams MassMultiplier repentogon/LuaInterfaces/LuaTearParams.cpp:73 TearParams.md tear and weapons todo -property TearParams SpeedMultiplier repentogon/LuaInterfaces/LuaTearParams.cpp:75 TearParams.md tear and weapons todo -property TearParams TearDisplacement repentogon/LuaInterfaces/LuaTearParams.cpp:76 TearParams.md tear and weapons todo -constructor Beam Beam repentogon/LuaInterfaces/LuaBeamRenderer.cpp:404 render and sprites todo -constructor Capsule Capsule repentogon/LuaInterfaces/LuaCapsule.cpp:138 Capsule.md entities todo -constructor Color Color repentogon/LuaInterfaces/LuaColor.cpp:185 Color.md render and sprites review -constructor ColorModifier ColorModifier repentogon/LuaInterfaces/LuaColorModifier.cpp:287 ColorModifier.md render and sprites todo -constructor ColorParams ColorParams repentogon/LuaInterfaces/LuaColorParams.cpp:133 ColorParams.md render and sprites todo -constructor DestinationQuad DestinationQuad repentogon/LuaInterfaces/LuaRender.cpp:3231 render and sprites todo -constructor EntityDesc EntityDesc repentogon/LuaInterfaces/LuaEntityDesc.cpp:143 EntityDesc.md entities todo +property Options OnlineChatEnabled repentogon/LuaInterfaces/LuaOptions.cpp:381 Options.md misc done +property Options OnlineChatFilterEnabled repentogon/LuaInterfaces/LuaOptions.cpp:396 Options.md misc done +property Options OnlineColorSet repentogon/LuaInterfaces/LuaOptions.cpp:384 Options.md misc done +property Options OnlineHUD repentogon/LuaInterfaces/LuaOptions.cpp:379 Options.md misc done +property Options OnlineInputDelay repentogon/LuaInterfaces/LuaOptions.cpp:385 Options.md misc done +property Options OnlinePlayerOpacity repentogon/LuaInterfaces/LuaOptions.cpp:383 Options.md misc done +property Options OnlinePlayerVolume repentogon/LuaInterfaces/LuaOptions.cpp:382 Options.md misc done +property Options PreventModUpdates repentogon/LuaInterfaces/LuaOptions.cpp:409 Options.md misc done +property Options QuickRoomClear repentogon/LuaInterfaces/LuaOptions.cpp:408 Options.md misc done +property Options SFXVolume repentogon/LuaInterfaces/LuaOptions.cpp:410 Options.md misc done +property Options StatHUDPlanetarium repentogon/LuaInterfaces/LuaOptions.cpp:407 Options.md misc done +property Options StreamerMode repentogon/LuaInterfaces/LuaOptions.cpp:380 Options.md misc done +property Options TouchMode repentogon/LuaInterfaces/LuaOptions.cpp:393 Options.md misc done +property Options WindowHeight repentogon/LuaInterfaces/LuaOptions.cpp:402 Options.md misc done +property Options WindowPosX repentogon/LuaInterfaces/LuaOptions.cpp:403 Options.md misc done +property Options WindowPosY repentogon/LuaInterfaces/LuaOptions.cpp:404 Options.md misc done +property Options WindowWidth repentogon/LuaInterfaces/LuaOptions.cpp:401 Options.md misc done +property PillEffect EffectClass repentogon/LuaInterfaces/LuaItemConfig.cpp:288 ItemConfig_PillEffect.md items and pools done +property PillEffect EffectSubClass repentogon/LuaInterfaces/LuaItemConfig.cpp:289 ItemConfig_PillEffect.md items and pools done +property ProjectileParams Damage repentogon/LuaInterfaces/LuaProjectileParams.cpp:27 ProjectileParams.md tear and weapons done +property RoomConfigSet Size repentogon/LuaInterfaces/Room/LuaRoomConfigSet.cpp:89 CcpContainer_RoomConfigSet.md level and room done +property RoomConfig_Room Mode repentogon/LuaInterfaces/Room/LuaRoomConfigRoom.cpp:14 RoomConfigRoom.md level and room done +property RoomDescriptor BossDeathSeed repentogon/LuaInterfaces/Room/LuaRoomDescriptor.cpp:339 RoomDescriptor.md level and room done +property TearParams KnockbackMultiplier repentogon/LuaInterfaces/LuaTearParams.cpp:74 TearParams.md tear and weapons done +property TearParams MassMultiplier repentogon/LuaInterfaces/LuaTearParams.cpp:73 TearParams.md tear and weapons done +property TearParams SpeedMultiplier repentogon/LuaInterfaces/LuaTearParams.cpp:75 TearParams.md tear and weapons done +property TearParams TearDisplacement repentogon/LuaInterfaces/LuaTearParams.cpp:76 TearParams.md tear and weapons done +constructor Beam Beam repentogon/LuaInterfaces/LuaBeamRenderer.cpp:404 render and sprites done +constructor Capsule Capsule repentogon/LuaInterfaces/LuaCapsule.cpp:138 Capsule.md entities done +constructor Color Color repentogon/LuaInterfaces/LuaColor.cpp:185 Color.md render and sprites done +constructor ColorModifier ColorModifier repentogon/LuaInterfaces/LuaColorModifier.cpp:287 ColorModifier.md render and sprites done +constructor ColorParams ColorParams repentogon/LuaInterfaces/LuaColorParams.cpp:133 ColorParams.md render and sprites done +constructor DestinationQuad DestinationQuad repentogon/LuaInterfaces/LuaRender.cpp:3231 render and sprites done +constructor EntityDesc EntityDesc repentogon/LuaInterfaces/LuaEntityDesc.cpp:143 EntityDesc.md entities done constructor Font Font repentogon/resources/scripts/main_ex.lua:2184 Font.md render and sprites done defined in Lua -constructor GenericPrompt GenericPrompt repentogon/LuaInterfaces/LuaGenericPrompt.cpp:102 GenericPrompt.md game todo -constructor LootList LootList repentogon/LuaInterfaces/LuaLootList.cpp:120 LootList.md items and pools todo -constructor Point Point repentogon/LuaInterfaces/LuaBeamRenderer.cpp:422 render and sprites todo -constructor RNG RNG repentogon/LuaInterfaces/LuaRNG.cpp:238 RNG.md misc review -constructor SourceQuad SourceQuad repentogon/LuaInterfaces/LuaRender.cpp:3213 render and sprites todo +constructor GenericPrompt GenericPrompt repentogon/LuaInterfaces/LuaGenericPrompt.cpp:102 GenericPrompt.md game done +constructor LootList LootList repentogon/LuaInterfaces/LuaLootList.cpp:120 LootList.md items and pools done +constructor Point Point repentogon/LuaInterfaces/LuaBeamRenderer.cpp:422 render and sprites done +constructor RNG RNG repentogon/LuaInterfaces/LuaRNG.cpp:238 RNG.md misc done +constructor SourceQuad SourceQuad repentogon/LuaInterfaces/LuaRender.cpp:3213 render and sprites done constructor Sprite Sprite repentogon/resources/scripts/main_ex.lua:2168 Sprite.md render and sprites done defined in Lua -constructor Vector Vector repentogon/LuaInterfaces/LuaVector.cpp:152 misc review -constructor WeightedOutcomePicker WeightedOutcomePicker repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:108 WeightedOutcomePicker.md items and pools todo +constructor Vector Vector repentogon/LuaInterfaces/LuaVector.cpp:152 misc done +constructor WeightedOutcomePicker WeightedOutcomePicker repentogon/LuaInterfaces/LuaWeightedOutcomePicker.cpp:108 WeightedOutcomePicker.md items and pools done callback ModCallbacks MC_BOMB_GRID_COLLISION repentogon/resources/scripts/enums_ex.lua:170 enums/ModCallbacks.md tear and weapons done id 1178 callback ModCallbacks MC_CAN_SELECT_CHARACTER repentogon/resources/scripts/enums_ex.lua:291 enums/ModCallbacks.md misc done id 1328 callback ModCallbacks MC_COMPLETION_MARK_GET repentogon/resources/scripts/enums_ex.lua:49 enums/ModCallbacks.md persistent data and saves done id 1047 @@ -2181,7 +2181,7 @@ callback ModCallbacks MC_POST_FIRE_BONE_CLUB repentogon/resources/scripts/enums_ callback ModCallbacks MC_POST_FIRE_BRIMSTONE repentogon/resources/scripts/enums_ex.lua:229 enums/ModCallbacks.md tear and weapons done id 1255 callback ModCallbacks MC_POST_FIRE_BRIMSTONE_BALL repentogon/resources/scripts/enums_ex.lua:230 enums/ModCallbacks.md tear and weapons done id 1256 callback ModCallbacks MC_POST_FIRE_KNIFE repentogon/resources/scripts/enums_ex.lua:231 enums/ModCallbacks.md tear and weapons done id 1257 -callback ModCallbacks MC_POST_FIRE_SPLIT_TEAR repentogon/resources/scripts/enums_ex.lua:27 enums/ModCallbacks.md tear and weapons todo id 1025 +callback ModCallbacks MC_POST_FIRE_SPLIT_TEAR repentogon/resources/scripts/enums_ex.lua:27 enums/ModCallbacks.md tear and weapons done id 1025 callback ModCallbacks MC_POST_FIRE_SWORD repentogon/resources/scripts/enums_ex.lua:232 enums/ModCallbacks.md tear and weapons done id 1258 callback ModCallbacks MC_POST_FIRE_TECH_LASER repentogon/resources/scripts/enums_ex.lua:233 enums/ModCallbacks.md tear and weapons done id 1259 callback ModCallbacks MC_POST_FIRE_TECH_X_LASER repentogon/resources/scripts/enums_ex.lua:234 enums/ModCallbacks.md tear and weapons done id 1260 @@ -2777,7 +2777,7 @@ behaviour_patch Patches ASMPatches/ASMGridEntityCollision.cpp repentogon/Patches behaviour_patch Patches ASMPatches/ASMGridEntitySpawn.cpp repentogon/Patches/ASMPatches/ASMGridEntitySpawn.cpp:1 level and room todo Routes inlined grid spawns through MC_PRE/POST_GRID_ENTITY_SPAWN behaviour_patch Patches ASMPatches/ASMGridEntitySpawn_Definitions.cpp repentogon/Patches/ASMPatches/ASMGridEntitySpawn_Definitions.cpp:1 level and room todo Signature table of the inlined grid spawn sites behaviour_patch Patches ASMPatches/ASMHud.cpp repentogon/Patches/ASMPatches/ASMHud.cpp:1 hud and menus todo HistoryHUD render and recompute callbacks, smelted item images -behaviour_patch Patches ASMPatches/ASMLevel.cpp repentogon/Patches/ASMPatches/ASMLevel.cpp:1 level and room todo Custom stage ids, level generation and room placement callbacks, stage binaries +behaviour_patch Patches ASMPatches/ASMLevel.cpp repentogon/Patches/ASMPatches/ASMLevel.cpp:1 level and room started Custom stage ids, level generation and room placement callbacks, stage binaries behaviour_patch Patches ASMPatches/ASMLocalization.cpp repentogon/Patches/ASMPatches/ASMLocalization.cpp:1 hud and menus todo Localised resource lookup in archives with an English fallback behaviour_patch Patches ASMPatches/ASMMenu.cpp repentogon/Patches/ASMPatches/ASMMenu.cpp:1 hud and menus todo Mods menu font, language change from options, online and daily menu selection behaviour_patch Patches ASMPatches/ASMPlayer.cpp repentogon/Patches/ASMPatches/ASMPlayer.cpp:1 player todo Familiar checks, Mars double tap window, active charge, custom hurt and death sounds, Lost Soul puddle @@ -2822,7 +2822,7 @@ behaviour_patch Patches MiscFixes.cpp repentogon/Patches/MiscFixes.cpp:1 misc t behaviour_patch Patches ModReloading.cpp repentogon/Patches/ModReloading.cpp:1 misc todo Mod reloading and workshop updates behaviour_patch Patches ModsMenuStuff.cpp repentogon/Patches/ModsMenuStuff.cpp:1 hud and menus todo Mods menu search bar and input behaviour_patch Patches NullItemsAndCostumes.cpp repentogon/Patches/NullItemsAndCostumes.cpp:1 player todo Custom null items and their costumes -behaviour_patch Patches PlayerFeatures.cpp repentogon/Patches/PlayerFeatures.cpp:1 player todo Modded character trinket handling, Greed donations, per save state +behaviour_patch Patches PlayerFeatures.cpp repentogon/Patches/PlayerFeatures.cpp:1 player started Modded character trinket handling, Greed donations, per save state behaviour_patch Patches PlayerTags.cpp repentogon/Patches/PlayerTags.cpp:1 player todo players.xml tags: no shake, no Metronome, no expansion pack, nightmare portraits behaviour_patch Patches PocketItems.cpp repentogon/Patches/PocketItems.cpp:1 player started Pocket item adds and removals with callbacks behaviour_patch Patches Quickstart.cpp repentogon/Patches/Quickstart.cpp:1 hud and menus todo Quickstart into the last save slot diff --git a/analysis/repentogon_overrides.tsv b/analysis/repentogon_overrides.tsv new file mode 100644 index 0000000..f218b52 --- /dev/null +++ b/analysis/repentogon_overrides.tsv @@ -0,0 +1,95 @@ +kind class name status note +function Isaac GetRoomEntities done the vanilla binding already builds the array REPENTOGON's fix does +function Room GetBackdropType done reads the backdrop's id, as REPENTOGON does without a custom backdrop +function Room GetLRoomAreaDesc done pushed as LRoomAreaDesc +function Room GetLRoomTileDesc done pushed as LRoomTileDesc +function Room SetRedHeartDamage done optional boolean, true when left out +function Room SpawnGridEntity done optional variant, seed and var data, or a GridEntityDesc +function Room TrySpawnSpecialQuestDoor done optional force argument, with Level:SetForceSpecialQuest +function RoomDescriptor AllowedDoors done read and written as an integer +property GridEntityDoor PreviousState done the field is read and written as an integer +property GridEntityDoor PreviousVariant done the field is read and written as an integer +property RoomConfig_Room Mode done the field is read as an integer +function EntityPlayer AddCacheFlags done +function EntityPlayer AddCollectible done +function EntityPlayer AddCollectibleEffect done +function EntityPlayer AddNullCostume done +function EntityPlayer AddNullItemEffect done +function EntityPlayer AddTrinketEffect done +function EntityPlayer ClearDeadEyeCharge done +function EntityPlayer DischargeActiveItem done +function EntityPlayer FullCharge done +function EntityPlayer GetActiveCharge done +function EntityPlayer GetActiveItem done +function EntityPlayer GetActiveSubCharge done +function EntityPlayer GetBatteryCharge done +function EntityPlayer GetBombVariant done +function EntityPlayer GetCollectibleNum done +function EntityPlayer GetMaxPocketItems done +function EntityPlayer GetTearRangeModifier done +function EntityPlayer GetTrinketMultiplier done +function EntityPlayer HasCollectible done +function EntityPlayer HasInvincibility done +function EntityPlayer HasTrinket done +function EntityPlayer NeedsCharge done +function EntityPlayer SetActiveCharge done +function EntityPlayer SetPocketActiveItem done +function EntityPlayer ShootRedCandle done +function EntityPlayer UseActiveItem done +property EntityPlayer BabySkin done +property EntityPlayer FriendBallEnemy done +constructor Color Color done REPENTOGON's constructor replaces main.lua's wrapper after it runs: every argument optional, colorize after the offset, vanilla calls unchanged +function Font DrawString done a nil string draws nothing without vanilla parity (MiscFixes.cpp), else the game's argument error +function Font DrawStringScaled done main.lua's own, through DrawString +function Font DrawStringScaledUTF8 done main.lua's own, through DrawString +function Font DrawStringUTF8 done main.lua's own, through DrawString +function Font GetStringWidth done REPENTOGON hooks nothing here: the binding's string check already refuses nil +function Font GetStringWidthUTF8 done main.lua's own, through GetStringWidth +function Shader Clear done SurfaceRenderController's, which the scan puts on Shader +function Shader SetBlendMode done SurfaceRenderController's, which the scan puts on Shader +function Sprite ReplaceSpritesheet done returns whether the layer took the path, LoadGraphics after it when asked +function Sprite SetOverlayFrame done also takes a frame alone +function Sprite Stop done stops the overlay too by default only without vanilla parity +property Entity Variant done REPENTOGON setter clears an effect varData, unless vanilla parity +function GridEntity ToTNT done vanilla cast, REPENTOGON hook changes no behaviour +function Game GetLastDevilRoomStage done read as an integer +function Game GetLastLevelWithDamage done read as an integer where vanilla pushes an unregistered class +function Game GetLastLevelWithoutHalfHp done read as an integer where vanilla pushes an unregistered class +function Game GetPlayer done optional index, nil without players, a negative index reading as 0 +function Game MoveToRandomRoom done a zero seed is an error, optional player +function Game StartStageTransition done strict boolean, the transition checked, optional player +property Game Difficulty done writable within 0-3 +function Game Move done not a member: the docs heading of MoveToRandomRoom split at its dots +function EntityLaser SetTimeout done documented only: the vanilla setter is unchanged +property EntityLaser HomingType done read and written as an integer, as the rebuild's vanilla field already is +function EntityNPC GetBossColorIdx done documented only: the vanilla getter is unchanged +function EntityNPC PlaySound done arguments past the sound optional (1, 2, false, 1), which changes no call vanilla accepts +property EntityNPC V1 done the NPC's own vector, so writing its fields changes the NPC, a copy under vanilla parity +property EntityNPC V2 done the NPC's own vector, so writing its fields changes the NPC, a copy under vanilla parity +function EntityTear ResetSpriteScale done an optional force recomputes the scale animation, no change without it +function MusicManager Play done an invalid id raises an error, the volume is optional (-1 keeps it) +function MusicManager Crossfade done an invalid id raises an error, the fade rate is optional (0.08) +function MusicManager Fadein done an invalid id raises an error, the volume (1) and fade rate (0.08) are optional +function PathFinder Find done FindGridPath: the vanilla binding already calls the real function, and EntityNPC:GetPathfinder hands out the NPC's own pathfinder +function PathFinder Move done MoveRandomly and its kin: the vanilla bindings already call the real functions on the pathfinder EntityNPC:GetPathfinder hands out +function ItemPool AddBibleUpgrade done the pool type is checked against the pool count, which adds to every pool +function ItemPool AddRoomBlacklist done ignored before the pools are loaded +function ItemPool GetCollectible done optional decrease, seed, default item and flags shifted past the decrease bit +function ItemPool GetTrinket done 0 before the pools are loaded +property Costume SkinColor done the field is read and written as an integer +property PillEffect EffectClass done the field is read as an integer +property PillEffect EffectSubClass done the field is read as an integer +constructor RNG RNG done optional seed and shift index, checked +constructor Vector Vector done the global table also gives Zero and One and is read-only +function Isaac FindByType done the vanilla binding already builds the array REPENTOGON's fix does +function Isaac FindInRadius done every partition by default, the position checked +function RNG RandomInt done a maximum, or an inclusive interval for two arguments +function RNG SetSeed done the seed and shift index checked, shift index 35 by default +function Vector Lerp done unclamped, returning the vector itself +function Vector __add done +function Vector __div done by a number or a vector, raising on a zero divisor +function Vector __mul done by a number on either side or a vector +function Vector __sub done +property Options SFXVolume done the setter rounds to a tenth +function EntityPickup CanReroll done answers a mod's SetCanRerollOverride +function EntityNPC GetPathfinder done the NPC's own pathfinder, the vanilla Pathfinder property left handing out a copy diff --git a/assets/repentogon/scripts/main_ex.lua b/assets/repentogon/scripts/main_ex.lua index 13c4585..3836638 100644 --- a/assets/repentogon/scripts/main_ex.lua +++ b/assets/repentogon/scripts/main_ex.lua @@ -2080,11 +2080,9 @@ end) end --Menuman Hub -if MenuManager then -- rebuild: until MenuManager is ported MenuManager.MainMenu = MainMenu MenuManager.CharacterMenu = CharacterMenu MenuManager.StatsMenu = StatsMenu -end -- ImGui alias functions --local ImGui = Isaac.GetImGui() diff --git a/generated-src/classes.h b/generated-src/classes.h index 1d1fb24..3add0ee 100644 --- a/generated-src/classes.h +++ b/generated-src/classes.h @@ -203,6 +203,7 @@ struct CostumeItem; struct CostumeSpriteDesc; struct CostumeWalk; struct CraftingRecipe; +struct CustomShaders; struct Cutscene; struct CutsceneEntry; struct CutscenePart; @@ -258,6 +259,7 @@ struct EntityPool; struct EntityPtr; struct EntityRef; struct EntitySaveState; +struct EntitySaveStateHandle; struct EntitySaveStateRef; struct EntitySpawn; struct EntitySpawner; @@ -365,6 +367,7 @@ struct HeartGain; struct HeartsAdd; struct History; struct HistoryHUD; +struct HistoryHUDEntry; struct HistoryHUDItem; struct HistoryHUDPlayer; struct HistoryItem; @@ -449,6 +452,7 @@ struct LocustEffect; struct LootEntry; struct LootList; struct LuaCardDraw; +struct LuaCheckedBool; struct LuaCollectibleDraw; struct LuaEngine; struct LuaIgnored; @@ -609,12 +613,14 @@ struct RoomConfig; struct RoomConfigMode; struct RoomConfigRef; struct RoomConfigRoom; +struct RoomConfigSetRef; struct RoomConfigStage; struct RoomConfig_Curse; struct RoomConfig_Room; struct RoomConfig_Stage; struct RoomConfig_VariantSet; struct RoomDescriptor; +struct RoomDescriptorDoors; struct RoomEntry; struct RoomEntrySpawn; struct RoomGridPath; @@ -658,6 +664,8 @@ struct SourceQuad; struct Spawn; struct SpawnFlags; struct SpecialSeed; +struct SplitShot; +struct SplitTear; struct Sprite; struct SpriteDraw; struct SpriteShaderParams; @@ -710,6 +718,7 @@ struct WaterClipInfo; struct WaveChain; struct WaveChainData; struct Weapon; +struct WeaponData; struct WeaponDelete; struct Weapon_Bombs; struct Weapon_Bone; @@ -5455,7 +5464,6 @@ int FUN_0042c810(int param_1); // 0042c810 void FUN_0042c820(uint32_t param_1); // 0042c820 int FUN_0042d040(); // 0042d040 void FUN_0042edb0(); // 0042edb0 -void FUN_0042ede0(uint32_t *param_1); // 0042ede0 void FUN_0042f050(uint32_t param_1); // 0042f050 void FUN_0042f060(); // 0042f060 void FUN_0042f0c0(); // 0042f0c0 diff --git a/generated-src/stubs.cpp b/generated-src/stubs.cpp index 3b57236..3b5f74b 100644 --- a/generated-src/stubs.cpp +++ b/generated-src/stubs.cpp @@ -9513,7 +9513,6 @@ void FUN_0042c820(uint32_t param_1) { generated_stub("FUN_0042c820 0042c820"); } ItemConfig * Isaac::GetItemConfig() { generated_stub("Isaac::GetItemConfig 0042ca00"); } int FUN_0042d040() { generated_stub("FUN_0042d040 0042d040"); } void FUN_0042edb0() { generated_stub("FUN_0042edb0 0042edb0"); } -void FUN_0042ede0(uint32_t *param_1) { generated_stub("FUN_0042ede0 0042ede0"); } void FUN_0042f050(uint32_t param_1) { generated_stub("FUN_0042f050 0042f050"); } void FUN_0042f060() { generated_stub("FUN_0042f060 0042f060"); } void FUN_0042f0c0() { generated_stub("FUN_0042f0c0 0042f0c0"); } diff --git a/scripts/repentogon_coverage.py b/scripts/repentogon_coverage.py index a62e380..8ba225a 100644 --- a/scripts/repentogon_coverage.py +++ b/scripts/repentogon_coverage.py @@ -29,9 +29,9 @@ Status rules (against this repository) function, property, constructor the rebuild registers a name on a class when src/ (src/lua, src/repentogon and helpers they call) passes it to lua_method, lua_static, lua_field, lua_field_get or lua_property, or as {"Name", function} or lua_table_set, - inside lua_class_begin(state, "Class") or lua_namespace_begin(state, "Class"). A helper with no class of its own - takes the class at its call site. Class names are compared after REPENTOGON's aliases (RoomConfig.Room is - RoomConfig_Room). A constructor is registered when the class registers "__call", and is vanilla when its class is. + inside lua_class_begin(state, "Class") or lua_namespace_begin(state, "Class"), or after lua_pushglobaltable for + _G. A helper with no class of its own takes the class at its call site. Class names are compared after + REPENTOGON's aliases (RoomConfig.Room is RoomConfig_Room, the _CBindings namespace is _Internals). A constructor is registered when the class registers "__call", and is vanilla when its class is. done registered, and neither vanilla (dump/lua_bindings.tsv, analysis/lua_all.tsv) nor under a docs "Modified" section review registered, but vanilla or documented as modified: the vanilla behaviour exists, REPENTOGON's change @@ -93,7 +93,7 @@ DOC_CLASS_ALIASES = {"ItemConfig_Item": "Item", "ItemConfig_Costume": "Costume", DOC_SKIPPED = {"docs", "index", "install", "install_zh"} # The rebuild's names for REPENTOGON's classes, by namespace. -REBUILD_CLASS_ALIASES = {("RoomConfig", "Room"): "RoomConfig_Room"} +REBUILD_CLASS_ALIASES = {("RoomConfig", "Room"): "RoomConfig_Room", ("_CBindings", "_CBindings"): "_Internals"} CLASS_AREAS = { "entities": "Entity EntityRef EntityPtr EntityList EntityConfig EntityConfigEntity EntityDesc EntitySaveState " @@ -939,7 +939,7 @@ def rebuild_registrations(): continue stripped, masked = text_strip(text) files[path] = (stripped, functions_find(masked, braces_match(masked))) - contextRe = re.compile(r'lua_(class|namespace)_begin\(\s*\w+\s*,\s*"(\w+)"') + contextRe = re.compile(r'lua_(class|namespace)_begin\(\s*\w+\s*,\s*"(\w+)"|lua_push(global)table\(') nameRe = re.compile(r'lua_(?:method|static|field|field_get|property)\s*(?:<[^;]*?>)?\s*\(\s*\w+\s*,\s*"(\w+)"' r'|\{\s*"(\w+)"\s*,|lua_table_set\(\s*\w+\s*,\s*-?\d+\s*,\s*"(\w+)"\)') bodies = {} @@ -954,6 +954,9 @@ def rebuild_registrations(): events = [] namespace = None for match in contextRe.finditer(body): + if match.group(3): + events.append((match.start(), "_G")) + continue if match.group(1) == "namespace": namespace = match.group(2) events.append((match.start(), class_name(namespace, match.group(2)))) @@ -977,7 +980,7 @@ def rebuild_registrations(): registered = defaultdict(set) for (path, functionName, start), body in bodies.items(): events = contexts(body) - if not events and not re.search(r"\blua_(method|static|field|field_get|property|table_set)\b", body): + if not events and not re.search(r"\blua_(method|static|field|field_get|property|table_set|functions_add)\b", body): continue for match in nameRe.finditer(body): name = match.group(1) or match.group(2) or match.group(3) @@ -1160,6 +1163,28 @@ local OBJECTS = { EntityPlayer = function() return Isaac.GetPlayer(0) end, Entity = function() return Isaac.GetPlayer(0) end, TemporaryEffects = function() return Isaac.GetPlayer(0):GetEffects() end, + CostumeSpriteDesc = function() return Isaac.GetPlayer(0):GetCostumeSpriteDescs()[1] end, + EntityConfigPlayer = function() return Isaac.GetPlayer(0):GetEntityConfigPlayer() end, + EntityConfigBaby = function() return EntityConfig.GetBaby(0) end, + Backdrop = function() return game:GetRoom():GetBackdrop() end, + Camera = function() return game:GetRoom():GetCamera() end, + FXLayers = function() return game:GetRoom():GetFXLayers() end, + FXParams = function() return game:GetRoom():GetFXParams() end, + RailManager = function() return game:GetRoom():GetRailManager() end, + LRoomAreaDesc = function() return game:GetRoom():GetLRoomAreaDesc() end, + LRoomTileDesc = function() return game:GetRoom():GetLRoomTileDesc() end, + RoomConfigStage = function() return RoomConfig.GetStage(1) end, + RoomConfigSet = function() return RoomConfig.GetStage(1):GetRoomSet(0) end, + RoomConfig_Room = function() return game:GetLevel():GetCurrentRoomDesc().Data end, + LevelGeneratorEntry = function() return Isaac.LevelGeneratorEntry() end, + PersistentGameData = function() return Isaac.GetPersistentGameData() end, + History = function() return Isaac.GetPlayer(0):GetHistory() end, + HistoryItem = function() return Isaac.GetPlayer(0):GetHistory():GetCollectiblesHistory()[1] end, + PocketItem = function() return Isaac.GetPlayer(0):GetPocketItem(0) end, + ChallengeParam = function() return game:GetChallengeParams() end, + GenericPrompt = function() return GenericPrompt() end, + GridEntityDoor = function() for i = 0, 7 do local d = game:GetRoom():GetDoor(i) if d then return d end end end, + GridEntityRock = function() local r = game:GetRoom() for i = 0, r:GetGridSize() - 1 do local g = r:GetGridEntity(i) if g and g:ToRock() then return g:ToRock() end end end, Sprite = function() return Sprite() end, RNG = function() return RNG() end, Vector = function() return Vector(0, 0) end, @@ -1168,6 +1193,15 @@ local OBJECTS = { MusicManager = function() return MusicManager() end, SFXManager = function() return SFXManager() end, Font = function() return Font() end, + Capsule = function() return Capsule(Vector(0, 0), Vector(10, 0), 5) end, + Shape = function() return Isaac.GetPlayer(0):GetDebugShape(false) end, + EntityDesc = function() return EntityDesc() end, + EntityConfigEntity = function() return EntityConfig.GetEntity(10) end, + EntityEffect = function() return Isaac.Spawn(1000, 54, 0, Vector(0, 0), Vector(0, 0), nil):ToEffect() end, + GridEntity = function() local r = game:GetRoom() for i = 0, r:GetGridSize() - 1 do if r:GetGridEntity(i) then return r:GetGridEntity(i) end end end, + EntitiesSaveStateVector = function() return game:GetLevel():GetCurrentRoomDesc():GetEntitiesSaveState() end, + GridEntitiesSaveStateVector = function() return game:GetLevel():GetCurrentRoomDesc():GetGridEntitiesSaveState() end, + EntitySaveState = function() return game:GetLevel():GetCurrentRoomDesc():GetEntitiesSaveState():Get(0) end, } local function object_get(class) diff --git a/src/engine/anm2.cpp b/src/engine/anm2.cpp index 5f88fb4..2fca017 100644 --- a/src/engine/anm2.cpp +++ b/src/engine/anm2.cpp @@ -1475,7 +1475,13 @@ void AnimationLayer::RenderFrame(const SpriteDraw& draw, int frameIndex, const A tint._blue = color._tint[2]; tint._alpha = color._tint[3]; tint._unk = 0; - if (render_flags_shader_select(flags)) apply_sprite_shader_params(color, SPRITE_SHADER_COLOR_APPLY, *layer.spriteSheet); + if (render_flags_shader_select(flags)) + { +#ifdef ISAAC_REPENTOGON + if (!isShimmering) custom_shader_select(animation, layer, isChampion ? CUSTOM_SHADER_CHAMPION : CUSTOM_SHADER_NORMAL); +#endif + apply_sprite_shader_params(color, SPRITE_SHADER_COLOR_APPLY, *layer.spriteSheet); + } if (isChampion) KAGE::Graphics::manager.currentShader->set_uniform(CHAMPION_COLOR_UNIFORM, KAGE::Graphics::UNIFORM_VEC4, &animation.championColor); @@ -1497,6 +1503,10 @@ ANM2& ANM2::operator=(const ANM2& other) ANM2Base::operator=(other); offset = Vector{}; bitflags = 0; +#ifdef ISAAC_REPENTOGON + customShaders.reset(); + for (LayerState& layer : layerStates) layer.customShaders.reset(); +#endif return *this; } diff --git a/src/engine/anm2.h b/src/engine/anm2.h index e7ddc09..6209970 100644 --- a/src/engine/anm2.h +++ b/src/engine/anm2.h @@ -319,6 +319,21 @@ struct SpriteDraw struct ANM2; struct LayerState; +#ifdef ISAAC_REPENTOGON +namespace KAGE::Graphics +{ +class Shader; +} + +// REPENTOGON's custom shaders of a sprite or a layer, drawn in place of the color offset shader (and of the +// champion one), each with the normalized path it was loaded from. A copied sprite keeps none. +struct CustomShaders +{ + std::array paths; + std::array shaders{}; +}; +#endif + // 0040c1e0 One layer's track in an animation, its keyframes in time order. struct AnimationLayer { @@ -449,6 +464,9 @@ struct LayerState bool isSpriteSheetLoaded = false; bool isUnknown31 = false; bool isVisible = true; +#ifdef ISAAC_REPENTOGON + std::shared_ptr customShaders; +#endif LayerState(); void Init(const LayerData* data); @@ -475,6 +493,9 @@ struct ANM2Base bool isLoaded = false; bool isOverlayRenderFirst = false; bool isUnknown108 = false; +#ifdef ISAAC_REPENTOGON + std::shared_ptr customShaders; +#endif }; // What GetTexel samples: a screen position, where the sprite draws, the alpha a texel must reach and the layer it looks diff --git a/src/engine/platform.cpp b/src/engine/platform.cpp index 586669f..060b456 100644 --- a/src/engine/platform.cpp +++ b/src/engine/platform.cpp @@ -489,6 +489,7 @@ void Platform::events_poll() { SDL_Event event; + mouseWheel = {}; while (SDL_PollEvent(&event)) { #ifdef ISAAC_OVERLAY @@ -529,6 +530,9 @@ void Platform::events_poll() } break; } + case SDL_EVENT_MOUSE_WHEEL: + mouseWheel = {event.wheel.x, event.wheel.y}; + break; case SDL_EVENT_KEY_DOWN: case SDL_EVENT_KEY_UP: KAGE::Input::manager.key_set(event.key.scancode, event.key.down); diff --git a/src/engine/platform.h b/src/engine/platform.h index b286fb1..5bd77c6 100644 --- a/src/engine/platform.h +++ b/src/engine/platform.h @@ -64,7 +64,8 @@ enum RenderbufferMode // under them, with the folders the game saves into and the 60 Hz frame pacing. // Listeners get the window's new size, position or focus, as the game registers them in IsaacStartup, and each // character typed while text input is on, as GLFW's char callback did. -// While isInputCaptured (the developer overlay shows), the game reads no key, button or mouse button. +// While isInputCaptured (the developer overlay shows), the game reads no key, button or mouse button. mouseWheel holds +// the wheel's scroll of the last events taken, as REPENTOGON's WndProc hook keeps it. class Platform { public: @@ -76,6 +77,7 @@ public: std::vector> positionListeners; std::vector> sizeListeners; std::vector> textListeners; + SDL_FPoint mouseWheel = {}; SDL_FPoint viewportOffset = {}; SDL_Point windowPosition = {}; Size drawingSize = {-1, -1}; diff --git a/src/entity/boss/delirium.cpp b/src/entity/boss/delirium.cpp index 7f364fe..6c611c3 100644 --- a/src/entity/boss/delirium.cpp +++ b/src/entity/boss/delirium.cpp @@ -10,6 +10,9 @@ #include #include #include +#ifdef ISAAC_REPENTOGON +#include "repentogon/npc.h" +#endif // Delirium's own phases (deliriumState): starting, in a form, about to change form, the hallucinations of his death and // his last scream. @@ -994,6 +997,10 @@ static void delirium_morph(Entity_NPC& npc, FormSeconds seconds) BossId form = form_pick(npc); npc.deliriumBossType = form.type; npc.deliriumBossVariant = form.variant; +#ifdef ISAAC_REPENTOGON + delirium_form_force(npc, npc.deliriumBossType, npc.deliriumBossVariant); + form = {(int)npc.deliriumBossType, (int)npc.deliriumBossVariant}; +#endif if (form.type == 0) log_printf(LOG_ASSERT, "No form for Delirium"); rage_roll(npc); if (form.type == ENTITY_MAMA_GURDY) npc.deliriumBossVariant = 0; diff --git a/src/entity/config.cpp b/src/entity/config.cpp index b63ab62..48161ba 100644 --- a/src/entity/config.cpp +++ b/src/entity/config.cpp @@ -5,6 +5,7 @@ #include "game/manager.h" #include "engine/texture_cache.h" #include +#include #include #include #include @@ -234,6 +235,16 @@ static void entity_attr_read(EntityConfig_Entity& entity, std::string_view name, else if (name == "bestiaryOverlay") entity.bestiaryOverlay = value; else if (name == "gibAmount") entity.gibsAmount = text_int(value); else if (name == "gibFlags") entity.gibFlags |= flags_parse(value, GIB_FLAG_NAMES, "invalid gibflag entry: %s\n"); +#ifdef ISAAC_REPENTOGON + else if (name == "customtags") + { + std::string tags(value); + std::ranges::transform(tags, tags.begin(), [](unsigned char c) { return (char)std::tolower(c); }); + for (std::string& tag : text_split(tags, ' ')) + if (!tag.empty()) entity.customTags.insert(tag); + } + else if (name == "familiarignorebffs" && value == "true") entity.customTags.insert(CUSTOM_TAG_IGNORE_BFFS); +#endif } // One attribute of an entity's . @@ -601,6 +612,9 @@ bool EntityConfig::boss_colors_load(std::string_view path) else if (name == "portrait" && version > 0) bossColor.portraitPath = portraitRoot + std::string(value); else if (name == "scale") bossColor.scale = text_float(value); else if (name == "hp") bossColor.hpMultiplier = text_float(value); +#ifdef ISAAC_REPENTOGON + else if (name == "name") bossColor.name = value; +#endif }); entity->bossColors.push_back(bossColor); }); diff --git a/src/entity/config.h b/src/entity/config.h index 02f4cf2..e2a2449 100644 --- a/src/entity/config.h +++ b/src/entity/config.h @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -20,6 +21,9 @@ constexpr int NAME_LANGUAGE_CURRENT = 20; constexpr int PLAYER_TYPE_COUNT = 41; constexpr int BOSS_PORTRAIT_COUNT = 104; +// The custom tag the legacy familiarignorebffs="true" stands for (REPENTOGON's CustomTags::FAMILIAR_IGNORE_BFFS). +constexpr const char* CUSTOM_TAG_IGNORE_BFFS = "familiarignorebffs"; + // The tags entities2.xml gives an entity, as REPENTOGON's EntityTag. Each is bit n for the nth name tags reads. enum EntityTag : uint32_t { @@ -73,6 +77,10 @@ struct EntityConfig_BossColor std::string anm2Path; std::string portraitPath; std::string suffix; +#ifdef ISAAC_REPENTOGON + // The name REPENTOGON's Isaac.GetBossColorIdxByName finds it by. + std::string name; +#endif float hpMultiplier = 1; float scale = 1; }; @@ -182,6 +190,10 @@ struct EntityConfig_Entity bool isPreloaded = false; bool isReroll = false; bool isShutDoors = true; +#ifdef ISAAC_REPENTOGON + // REPENTOGON's EntityConfigEx: the lowercase customtags a mod's entities2.xml gives the entity. + std::set customTags; +#endif std::string GetName(int language); }; diff --git a/src/entity/entity.cpp b/src/entity/entity.cpp index 07f4806..b5d21b9 100644 --- a/src/entity/entity.cpp +++ b/src/entity/entity.cpp @@ -527,6 +527,9 @@ bool Entity::IsEnemy() // 006ac6c0 Whether its grid collision ignores everything but walls. bool Entity::IsFlying() { +#ifdef ISAAC_REPENTOGON + if (flyingOverride) return *flyingOverride; +#endif return entityGridCollisionClass == GRIDCOLL_NONE || entityGridCollisionClass == GRIDCOLL_WALLS || entityGridCollisionClass == GRIDCOLL_WALLS_X || entityGridCollisionClass == GRIDCOLL_WALLS_Y; } diff --git a/src/entity/entity.h b/src/entity/entity.h index 2e45648..5ec65f6 100644 --- a/src/entity/entity.h +++ b/src/entity/entity.h @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -777,6 +778,11 @@ struct Entity bool isUnknown176 = false; bool isValid = false; bool isVisible = false; +#ifdef ISAAC_REPENTOGON + // REPENTOGON's EntityPlus: the water clip flags and flying a mod set in place of the game's. + std::optional waterClipFlagsOverride; + std::optional flyingOverride; +#endif Entity() = default; Entity(const Entity&) = delete; diff --git a/src/entity/familiar/evaluate.cpp b/src/entity/familiar/evaluate.cpp index 0bbd88c..af712ff 100644 --- a/src/entity/familiar/evaluate.cpp +++ b/src/entity/familiar/evaluate.cpp @@ -126,6 +126,7 @@ void familiar_check(Entity_Player& player, const FamiliarCount& familiars) familiar->pos = familiar->GetFollowTargetPosition(FOLLOW_SCATTERED); familiar->item = familiars.item; familiar->Update(); + if (familiars.spawned) familiars.spawned->push_back(familiar); } } diff --git a/src/entity/familiar/familiar.h b/src/entity/familiar/familiar.h index d77ed44..41c252e 100644 --- a/src/entity/familiar/familiar.h +++ b/src/entity/familiar/familiar.h @@ -543,11 +543,13 @@ struct AbyssLocustData : Entity_Familiar::ExtraData }; // How many of a familiar a player should have (Entity_Player::CheckFamiliar's arguments): the item behind them and the -// generator their spawns draw from, a subtype of -1 counting every subtype. +// generator their spawns draw from, a subtype of -1 counting every subtype. REPENTOGON's CheckFamiliarEx collects the +// familiars spawned in spawned. struct FamiliarCount { ItemConfig_Item* item = nullptr; RNG* rng = nullptr; + std::vector* spawned = nullptr; int count = 0; int subtype = -1; int variant = 0; diff --git a/src/entity/npc/boss.cpp b/src/entity/npc/boss.cpp index 59a514d..7aa4e89 100644 --- a/src/entity/npc/boss.cpp +++ b/src/entity/npc/boss.cpp @@ -11,6 +11,9 @@ #include "level/room_config.h" #include "level/room_descriptor.h" #include +#ifdef ISAAC_REPENTOGON +#include "repentogon/npc.h" +#endif // Colostomia's landing as it appears: a shake, and in a flooded room water thrown from a 100 by 60 ellipse. constexpr int COLOSTOMIA_LAND_SHAKE = 8; @@ -155,6 +158,9 @@ Entity_Projectile* Entity_NPC::FireBossProjectiles(int count, const Vector& targ fire_projectile_from_params(projectile); projectile->parent = this; projectile->spawnerType = type; +#ifdef ISAAC_REPENTOGON + if (projectileCapture) projectileCapture->push_back(projectile); +#endif } return projectile; } diff --git a/src/entity/npc/npc.cpp b/src/entity/npc/npc.cpp index 56eaae5..bdfa84d 100644 --- a/src/entity/npc/npc.cpp +++ b/src/entity/npc/npc.cpp @@ -886,6 +886,18 @@ std::string sheet_path_resolve(const std::string& path, std::string_view floorSu return !floorSuffix.empty() && isFound(floor) ? floor : path; } +// Part of 006baf40 (REPENTOGON's Entity_NPC::translate_gfx_path): a sheet's version for its boss color or floor and +// its champion look, and whether the one found has the champion suffix. +std::string Entity_NPC::translate_gfx_path(const std::string& path, bool& isChampionSheet) +{ + bool isBossColor = bosscoloridx >= 0 && bosscoloridx < (int)config->bossColors.size(); + std::string floorSuffix; + if (isBossColor) floorSuffix = config->bossColors[bosscoloridx].suffix; + else if (config->isHasFloorAlts) floorSuffix = g_game->roomConfig.stages[Level::GetStageID()].suffix; + bool isChampionLook = isChampion && champion_color_get(championColorIdx); + return sheet_path_resolve(path, floorSuffix, isChampionLook ? CHAMPION_SUFFIX : "", isChampionSheet); +} + // 006baf40 Reloads its sprite (with isReloadAnm2, from the config or its boss color's .anm2) and swaps each layer's // sheet for its champion and floor versions, marking the layers drawn in the floor's dirt color. void Entity_NPC::load_graphics(bool isReloadAnm2) @@ -899,11 +911,7 @@ void Entity_NPC::load_graphics(bool isReloadAnm2) sprite.Load(GFUEL_ISAAC_ANM2, GRAPHICS_LOAD); } - std::string floorSuffix; - if (isBossColor) floorSuffix = config->bossColors[bosscoloridx].suffix; - else if (config->isHasFloorAlts) floorSuffix = g_game->roomConfig.stages[Level::GetStageID()].suffix; const ColorMod* championLook = isChampion ? champion_color_get(championColorIdx) : nullptr; - std::string_view championSuffix = championLook ? CHAMPION_SUFFIX : ""; bool isChampionSheetUsed = false; bool isDirtUsed = false; @@ -920,7 +928,7 @@ void Entity_NPC::load_graphics(bool isReloadAnm2) bool isChampionSheet = false; std::string sheet = layer.layerData ? layer.layerData->spriteSheetPath : ""; - sprite.ReplaceSpritesheet(i, sheet_path_resolve(sheet, floorSuffix, championSuffix, isChampionSheet)); + sprite.ReplaceSpritesheet(i, translate_gfx_path(sheet, isChampionSheet)); LayerState& replaced = sprite.layerStates[i]; replaced.bitflags &= ~ANIM_RENDER_COLOROFFSET_CHAMPION; if (isChampionSheet) replaced.bitflags |= ANIM_RENDER_COLOROFFSET_CHAMPION; @@ -2676,6 +2684,9 @@ Entity_Projectile* Entity_NPC::fire_projectiles(const Vector& position, const Ve } for (Entity_Projectile* projectile : projectiles) projectile_params_apply(*projectile, params); for (Entity_Projectile* projectile : projectiles) fire_projectile_from_params(projectile); +#ifdef ISAAC_REPENTOGON + if (projectileCapture) projectileCapture->insert(projectileCapture->end(), projectiles.begin(), projectiles.end()); +#endif return projectiles.empty() ? nullptr : projectiles.front(); } diff --git a/src/entity/npc/npc.h b/src/entity/npc/npc.h index 2f546ba..dd87bb6 100644 --- a/src/entity/npc/npc.h +++ b/src/entity/npc/npc.h @@ -290,6 +290,7 @@ struct Entity_NPC : Entity void LoadEntityConfig() override; void load_graphics(bool isReloadAnm2); + std::string translate_gfx_path(const std::string& path, bool& isChampionSheet); void boss_color_roll(); static bool Redirect(int* entityType, int* variant); void Morph(int entityType, int variant, int subType, int championId); @@ -360,6 +361,7 @@ struct Entity_NPC : Entity void projectile_params_apply(Entity_Projectile& projectile, const ProjectileParams& params); void fire_projectile_from_params(Entity_Projectile* projectile); Entity_Effect* MakeSplat(float size); + Entity_Projectile* FireGridEntity(ANM2& gridSprite, const GridEntityDesc& desc, const Vector& velocity, int backdrop); Entity_Effect* MakeBloodCloud(const Vector& pos, const ColorMod& color, float scale); static Entity_NPC* ThrowSpider(const Vector& position, Entity* spawner, Vector targetPos, bool isBig, float yOffset); diff --git a/src/entity/npc/polty.cpp b/src/entity/npc/polty.cpp index bca0134..ec86e9c 100644 --- a/src/entity/npc/polty.cpp +++ b/src/entity/npc/polty.cpp @@ -145,14 +145,14 @@ static bool polty_is_pot_cell(Entity_NPC& npc, int gridIndex) return true; } -// 006d9550 Throws a lifted grid entity as a rock projectile wearing its look, from 30 up: it keeps a poop's health +// 006d9550 Throws a grid entity as a rock projectile wearing a lifted one's look, from 30 up: it keeps a poop's health // (a giant one four times as big) and a rock's death trigger. A charmed Polty's rock hits enemies, a friendly one's // spares players. -static Entity_Projectile* polty_rock_throw(Entity_NPC& npc, Entity_Effect& lifted, const Vector& velocity, int backdrop) +Entity_Projectile* Entity_NPC::FireGridEntity(ANM2& gridSprite, const GridEntityDesc& desc, const Vector& velocity, + int backdrop) { - const GridEntityDesc& desc = lifted.gridDesc; int subType = (int)((uint32_t)desc._type << GRID_TYPE_SHIFT | (uint16_t)desc._variant); - auto* rock = static_cast(g_game->Spawn({.position = npc.pos, .velocity = velocity, .spawner = &npc, + auto* rock = static_cast(g_game->Spawn({.position = pos, .velocity = velocity, .spawner = this, .subType = subType, .type = ENTITY_PROJECTILE, .variant = PROJECTILE_GRID, .seed = desc._spawnSeed})); if (desc._type == GRID_POOP) @@ -170,18 +170,18 @@ static Entity_Projectile* polty_rock_throw(Entity_NPC& npc, Entity_Effect& lifte rock->fallingAccel = POLTY_ROCK_FALL; rock->fallingSpeed = POLTY_ROCK_RISE; - rock->sprite = lifted.sprite; + rock->sprite = gridSprite; for (LayerState& layer : rock->sprite.layerStates) { layer.pos = {}; layer.size = vector_make(1, 1); } - if (npc.HasEntityFlags(FLAG_CHARM)) + if (HasEntityFlags(FLAG_CHARM)) { rock->projectileFlags |= PROJECTILE_HIT_ENEMIES; - rock->parent = &npc; + rock->parent = this; } - if (npc.HasEntityFlags(FLAG_FRIENDLY)) rock->projectileFlags |= PROJECTILE_CANT_HIT_PLAYER; + if (HasEntityFlags(FLAG_FRIENDLY)) rock->projectileFlags |= PROJECTILE_CANT_HIT_PLAYER; rock->Update(); return rock; } @@ -421,7 +421,8 @@ static void polty_throw(Entity_NPC& npc, Entity*& held) if (held->type == ENTITY_EFFECT && held->variant == EFFECT_GRID_ENTITY_PROJECTILE_HELPER) { - polty_rock_throw(npc, *static_cast(held), throwVelocity, 0); + auto* heldEffect = static_cast(held); + npc.FireGridEntity(heldEffect->sprite, heldEffect->gridDesc, throwVelocity, 0); held->Remove(); } else if (!isPickup) held->Remove(); @@ -507,7 +508,7 @@ static void kineti_telekinesis(Entity_NPC& npc, Entity*& held, int ticks) // The original crashes when the cell has nothing to lift. Here it waits. Entity_Effect* lifted = room.PickupGridEntity(npc.i2); if (!lifted) return; - Entity_Projectile* thrown = polty_rock_throw(npc, *lifted, rise, lifted->state); + Entity_Projectile* thrown = npc.FireGridEntity(lifted->sprite, lifted->gridDesc, rise, lifted->state); thrown->pos = cell; thrown->fallingAccel = POLTY_RISE_FALL; thrown->fallingSpeed = 0; @@ -700,7 +701,8 @@ static void polty_death(Entity_NPC& npc, Entity* held) if (held->type == ENTITY_EFFECT) { auto& lifted = *static_cast(held); - polty_rock_throw(npc, lifted, vector_scale(npc.velocity, POLTY_DROP_SHARE), lifted.state); + Vector drop = vector_scale(npc.velocity, POLTY_DROP_SHARE); + npc.FireGridEntity(lifted.sprite, lifted.gridDesc, drop, lifted.state); } held->Remove(); } diff --git a/src/entity/pickup/item_config.cpp b/src/entity/pickup/item_config.cpp index 6a661fa..50050b4 100644 --- a/src/entity/pickup/item_config.cpp +++ b/src/entity/pickup/item_config.cpp @@ -5,6 +5,9 @@ #include "engine/log.h" #include "game/manager.h" #include "game/mod_manager.h" +#ifdef ISAAC_REPENTOGON +#include "repentogon/items.h" +#endif #include #include #include @@ -638,6 +641,12 @@ static std::unique_ptr item_parse(DataNode node, std::string_vi attr_read(node, "achievement", item->achievementId); if (auto cache = node_attr_find(node, "cache")) item->cacheFlags |= cache_flags_parse(*cache); if (auto tags = node_attr_find(node, "tags")) item->tags = tags_parse(*tags); +#ifdef ISAAC_REPENTOGON + if (auto tags = node_attr_find(node, "customtags")) custom_tags_parse(*tags, item->customTags); + if (auto caches = node_attr_find(node, "customcache")) custom_tags_parse(*caches, item->customCaches); + if (item->customTags.contains(CUSTOM_TAG_FLYING) || item->customTags.contains(CUSTOM_TAG_FLYING_EFFECT)) + item->cacheFlags |= CACHE_FLYING; +#endif attr_read(node, "maxhearts", item->addMaxHearts); attr_read(node, "hearts", item->addHearts); @@ -933,6 +942,12 @@ bool ItemConfig::LoadPocketItems(std::string_view path, ModEntry* mod) attr_read(node, "hud", card->hudAnim); attr_read(node, "pickup", card->pickupSubtype); card->cardType = cardType; +#ifdef ISAAC_REPENTOGON + attr_read(node, "weight", card->initialWeight); + card->initialWeight = std::max(card->initialWeight, 0.0f); + card->weight = card->initialWeight; + card->isHidden = node_attr_find(node, "hidden") == "true"; +#endif if (card->id < 0) { log_print(LOG_INFO, "[warn] %s: Card ID %d out of range!\n", pathText.c_str(), card->id); diff --git a/src/entity/pickup/item_config.h b/src/entity/pickup/item_config.h index e778d88..4ef57da 100644 --- a/src/entity/pickup/item_config.h +++ b/src/entity/pickup/item_config.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -451,6 +452,11 @@ struct ItemConfig_Item bool isPassiveCache = false; bool isPersistentEffect = false; bool isSpecial = false; +#ifdef ISAAC_REPENTOGON + // REPENTOGON's ItemConfigEx: the lowercase customcache and customtags words its XML gives the item. + std::set customCaches; + std::set customTags; +#endif std::string GetLocalizedName(int language = LANGUAGE_CURRENT); std::string description_get(); @@ -487,6 +493,14 @@ struct ItemConfig_Card : PocketItemConfig ANM2* moddedCardFront = nullptr; CardType cardType = CARD_SPECIAL; int pickupSubtype = 2; +#ifdef ISAAC_REPENTOGON + // REPENTOGON's ItemConfig_Card_EX: the weight its XML gives (initialWeight) and the one a mod set, whether it is + // hidden, and the registry reference of the Lua function a mod set to decide its availability. + std::optional availabilityRef; + float initialWeight = 1; + float weight = 1; + bool isHidden = false; +#endif std::string description_get(); bool IsAvailable(); diff --git a/src/entity/pickup/item_pool.cpp b/src/entity/pickup/item_pool.cpp index 7eaefe3..c572e8f 100644 --- a/src/entity/pickup/item_pool.cpp +++ b/src/entity/pickup/item_pool.cpp @@ -17,6 +17,7 @@ #ifdef ISAAC_REPENTOGON #include "repentogon/callbacks.h" #include "repentogon/items.h" +#include "repentogon/level.h" #endif // An outcome of a weighted draw and its weight, as WeightedOutcomePicker holds them. @@ -384,6 +385,9 @@ int ItemPool::GetPoolForRoom(int roomType, uint32_t roomSeed) // The original reads before a spawn whose entries all weigh nothing. Here such a spawn is passed over. int ItemPool::get_pool_from_room_entities(uint32_t roomSeed, RoomDescriptor& room, int bossId) { +#ifdef ISAAC_REPENTOGON + if (room_item_pool_forced_get() != POOL_NONE) return room_item_pool_forced_get(); +#endif RoomConfig_Room& data = *room.data; int roomType = data.type; diff --git a/src/entity/pickup/loot_list.h b/src/entity/pickup/loot_list.h index 71bf8e2..99ee28c 100644 --- a/src/entity/pickup/loot_list.h +++ b/src/entity/pickup/loot_list.h @@ -3,13 +3,15 @@ #include "classes.h" #include -// One thing a chest gives (LootList's entries): what to spawn and the seed it spawns from. +// One thing a chest gives (LootList's entries): what to spawn, the seed it spawns from and the RNG a mod's entry +// carries (REPENTOGON's LootListEntry). struct LootEntry { int subType = 0; int type = 0; int variant = 0; uint32_t seed = 0; + RNG* rng = nullptr; }; // Copies and destruction (006c20e0) are the defaults. diff --git a/src/entity/pickup/pickup.cpp b/src/entity/pickup/pickup.cpp index 231929d..d2eef31 100644 --- a/src/entity/pickup/pickup.cpp +++ b/src/entity/pickup/pickup.cpp @@ -2728,6 +2728,9 @@ bool Entity_Pickup::CanBePickedUp(bool isIgnorePrice) // 006ee200 Whether rerolls may change it: alive, of a rerollable kind, and not an opened chest. bool Entity_Pickup::CanReroll() { +#ifdef ISAAC_REPENTOGON + if (!isDead && canRerollOverride) return *canRerollOverride; +#endif return !isDead && CanRerollVariant(variant, subtype) && (!IsChest(variant) || subtype != 0); } diff --git a/src/entity/pickup/pickup.h b/src/entity/pickup/pickup.h index cbd2c60..6fbbf5d 100644 --- a/src/entity/pickup/pickup.h +++ b/src/entity/pickup/pickup.h @@ -5,6 +5,7 @@ #include "entity/pickup/loot_list.h" #include #include +#include // Lua's PickupVariant: the kinds of pickup. enum PickupVariant : int @@ -201,6 +202,10 @@ struct Entity_Pickup : Entity bool isPayToPlay = false; bool isTouched = false; bool isUnknown52d = false; +#ifdef ISAAC_REPENTOGON + // REPENTOGON's EntityPickupPlus: what CanReroll answers in place of the game, as a mod set it. + std::optional canRerollOverride; +#endif void Init(int type, int variant, int subType, uint32_t initSeed) override; void Update() override; diff --git a/src/entity/pickup/slot.cpp b/src/entity/pickup/slot.cpp index 6c6f35c..ed144b3 100644 --- a/src/entity/pickup/slot.cpp +++ b/src/entity/pickup/slot.cpp @@ -2130,7 +2130,7 @@ static void beths_essence_wisp_add(Entity_Player& player, const Vector& position // 0075d9f0 Mom's dresser shuffles the player's costumes: each costume, from the first, swaps with a random later one, a // head and its body (the same item's costumes side by side) moving as a pair. A lone costume before a pair first moves // behind the pair when it is to swap with another pair. The costumes are then rebuilt. -static void costumes_shuffle(Entity_Player& player, uint32_t seed) +void costumes_shuffle(Entity_Player& player, uint32_t seed) { #ifdef ISAAC_REPENTOGON if (costumes_shuffle_is_cancelled(player, seed)) return; diff --git a/src/entity/player/effects.cpp b/src/entity/player/effects.cpp index ed15849..03aa3bb 100644 --- a/src/entity/player/effects.cpp +++ b/src/entity/player/effects.cpp @@ -1302,6 +1302,9 @@ static void camo_fade_update(Entity_Player& player) float fade = 1; bool isCamo = game.seedEffects.HasSeedEffect(SEED_CAMO_ISAAC) || game.seedEffects.HasSeedEffect(SEED_CAMO_EVERYTHING) || player.temporaryEffects.HasCollectibleEffect(COLLECTIBLE_CAMO_UNDIES); +#ifdef ISAAC_REPENTOGON + isCamo = isCamo || player.isCamoForced; +#endif if (!isCamo) { TemporaryEffect* polaroid = player.temporaryEffects.GetTrinketEffect(TRINKET_FADED_POLAROID); diff --git a/src/entity/player/health.cpp b/src/entity/player/health.cpp index b94149a..15aa60e 100644 --- a/src/entity/player/health.cpp +++ b/src/entity/player/health.cpp @@ -368,12 +368,7 @@ void Entity_Player::soul_hearts_add(int amount, bool isUnknown) // Flashes the player's red hearts on the HUD after healing. void Entity_Player::hud_heart_flash() { - for (PlayerHUD& hud : g_game->hud.playerHUD) - if (hud.player == this) - { - hud.redHeartFlashCountdown = HUD_HEART_FLASH_FRAMES; - return; - } + g_game->hud.FlashRedHearts(this); } // 007791f0 Fills the red hearts (The Soul fills The Forgotten's), the bone hearts too unless the character keeps diff --git a/src/entity/player/player.h b/src/entity/player/player.h index e249bae..04eda31 100644 --- a/src/entity/player/player.h +++ b/src/entity/player/player.h @@ -56,6 +56,7 @@ constexpr int INVENTORY_SIZE = 16; constexpr int POCKET_SLOT_COUNT = 4; constexpr int POOP_SPELL_QUEUE_SIZE = 6; constexpr int POOP_SPELL_BAG_SIZE = 20; +constexpr int SATURNUS_TEARS = 7; constexpr int TRINKET_SLOT_COUNT = 2; constexpr int WEAPON_SLOT_COUNT = 5; constexpr uint32_t QUEUED_TOUCHED = 0x1; @@ -1421,6 +1422,7 @@ Direction vector_to_direction(const Vector& v); int scale_for_hard_difficulty(int value); std::string costume_path_apply_skin_color(const std::string& path, int skinColor, int playerType, bool* isSkinColorFound, bool* isCharacterFound); +void costumes_shuffle(Entity_Player& player, uint32_t seed); void sound_play(int sound); // Destruction (00754ed0, 00754d60) unlinks the twin and frees a sub player the room does not hold. @@ -1836,6 +1838,8 @@ public: // REPENTOGON's health type tracking (EntityPlayerPlus): the last evaluated one, -1 before any change. int previousHealthType = -1; bool isEvaluatingHealthType = false; + // REPENTOGON's camoOverride (EntityPlayerPlus): a mod's SetForceCamoEffect fades the player as Camo Undies does. + bool isCamoForced = false; #endif // Set while EvaluateItems spawns the players Found Soul and Strawman give, who start without pickups. static inline bool isSpawningHelperPlayers = false; diff --git a/src/entity/player/weapons.cpp b/src/entity/player/weapons.cpp index 231a76f..7e2547b 100644 --- a/src/entity/player/weapons.cpp +++ b/src/entity/player/weapons.cpp @@ -709,7 +709,6 @@ constexpr float DELAYED_BRIMSTONE_DEPTH_FRONT = 3000; constexpr float AZAZEL_BEAM_RANGE_SCALE = 0.25f; constexpr float AZAZEL_BEAM_RANGE_BASE = 32; constexpr float AZAZEL_BEAM_MIN_DISTANCE = 60; -constexpr int SATURNUS_TEARS = 7; constexpr float SATURNUS_SPREAD = 4; constexpr float SATURNUS_SPEED = 10; constexpr float SATURNUS_DAMAGE_BONUS = 5; diff --git a/src/entity/water.cpp b/src/entity/water.cpp index d1cc4b5..8fe2379 100644 --- a/src/entity/water.cpp +++ b/src/entity/water.cpp @@ -8,6 +8,7 @@ #include "level/room.h" #include #include +#include // The entities the water clips its own way: the Gemini familiar, Wormwood and the Mullighoul. constexpr int FAMILIAR_GEMINI = 79; @@ -61,10 +62,20 @@ static WaterClipInfo effect_clip_get(Entity& effect, bool& isClipped) // 006b6ed0 How the water clips the entity: surface effects and shop items on the surface, background entities flat // and door ones like doors, tears, projectiles, lasers and effects raised with their reflection above, creeps raised, // a leech or fissure sunk until it surfaces, Wormwood by its dive, Charm of the Vampire's players solid, flying players -// raised, a pedestal by its overlay, and anything else raised with its reflection below. +// raised, a pedestal by its overlay, and anything else raised with its reflection below. With REPENTOGON the flags a +// mod set replace its own. WaterClipInfo Entity::GetWaterClipInfo() { bool isClipped = false; +#ifdef ISAAC_REPENTOGON + if (waterClipFlagsOverride) + { + std::optional flags = std::exchange(waterClipFlagsOverride, std::nullopt); + WaterClipInfo clip = GetWaterClipInfo(); + waterClipFlagsOverride = flags; + return {*flags, clip.value}; + } +#endif if (type == ENTITY_EFFECT) { diff --git a/src/entity/weapon/knife.h b/src/entity/weapon/knife.h index 8ac13fa..c02cec8 100644 --- a/src/entity/weapon/knife.h +++ b/src/entity/weapon/knife.h @@ -61,6 +61,10 @@ struct Entity_Knife : Entity TearFlags tearFlags; TearFlags usedTearFlags; EntityPtr brimstoneLaser; +#ifdef ISAAC_REPENTOGON + // REPENTOGON's EntityKnifePlus: the weapon knife a melee swing's hitbox comes from. + EntityPtr hitboxSource; +#endif EntityPtr linkedKnife; EntityPtr spinEffect; EntityPtr techLaser; diff --git a/src/entity/weapon/knife_hits.cpp b/src/entity/weapon/knife_hits.cpp index df9ff2d..fb380f9 100644 --- a/src/entity/weapon/knife_hits.cpp +++ b/src/entity/weapon/knife_hits.cpp @@ -660,6 +660,9 @@ static bool swing_effect_spawn(Entity_Knife& knife, Entity_Player* player, const Entity_Knife& swing = *static_cast(spawned); swing.parent = owner; +#ifdef ISAAC_REPENTOGON + swing.hitboxSource = &knife; +#endif swing.targetPosition.y = 0; if (knife.swingTick == 0) { diff --git a/src/entity/weapon/laser.cpp b/src/entity/weapon/laser.cpp index 6101671..389b68c 100644 --- a/src/entity/weapon/laser.cpp +++ b/src/entity/weapon/laser.cpp @@ -21,6 +21,7 @@ #include #ifdef ISAAC_REPENTOGON #include "repentogon/callbacks.h" +#include "repentogon/weapons.h" #endif constexpr float THIN_SCALE_THRESHOLDS[] = {1.15f, 2.2f, 4.2f}; @@ -475,6 +476,9 @@ void Entity_Laser::Init(int initType, int initVariant, int initSubType, uint32_t // sound grows with its scale, and some bosses' beams have their own. void Entity_Laser::PlayInitSound() { +#ifdef ISAAC_REPENTOGON + if (init_sound_play(initSound)) return; +#endif if (isDisableInitSound || (parent && parent->type == ENTITY_LASER) || !isVisible) return; int spawner = spawnerEntity ? spawnerEntity->type : 0; @@ -1017,6 +1021,12 @@ void Entity_Laser::Update() { #ifdef ISAAC_REPENTOGON if (boolean_run({"PreLaserUpdate", MC_PRE_LASER_UPDATE, (int)variant}, false, this)) return Entity::Update(); + if (std::exchange(isRecalculateSamplesNextUpdate, false)) + { + homingLaser.bezier.clear(); + for (auto* samples : {&homingLaser.nonOptimizedSamples, &homingLaser.samples, &homingLaser.smoothedSamples}) + samples->clear(); + } #endif if (tearFlags[TEAR_WAIT] && !IsCircleLaser() && timeout > 0) tear_wait_start(); Entity* swirl = tearWaitEffect; diff --git a/src/entity/weapon/laser.h b/src/entity/weapon/laser.h index b2843ed..8de6bf2 100644 --- a/src/entity/weapon/laser.h +++ b/src/entity/weapon/laser.h @@ -148,6 +148,11 @@ struct Entity_Laser : Entity bool isPrismTouched = false; bool isSampleLaser = false; bool isShrink = false; +#ifdef ISAAC_REPENTOGON + // REPENTOGON's EntityLaserPlus: the sound a mod plays in place of its init sound, and a pending sample reset. + std::optional initSound; + bool isRecalculateSamplesNextUpdate = false; +#endif Entity_Laser(); diff --git a/src/entity/weapon/tear.cpp b/src/entity/weapon/tear.cpp index 9d1123e..ab8933b 100644 --- a/src/entity/weapon/tear.cpp +++ b/src/entity/weapon/tear.cpp @@ -1518,6 +1518,9 @@ void Entity_Tear::play_fire_sound() isFireSoundPending = false; bool isSilent = variant == TEAR_CHAOS_CARD || variant == TEAR_FIRE || variant == TEAR_GRIDENT || isFireSoundMuted; bool isFetus = variant == TEAR_FETUS; +#ifdef ISAAC_REPENTOGON + if (init_sound_play(initSound)) isSilent = true; +#endif if (!isSilent && !is_gfuel_nail(variant)) npc_sound_play(isFetus ? SOUND_PLOP : SOUND_TEARS_FIRE, 1, TEAR_SOUND_DELAY, isFetus ? FETUS_FIRE_PITCH : 1); if (tearFlags[TEAR_HORN]) npc_sound_play(SOUND_LITTLEHORN_SHOOT, 1, TEAR_SOUND_DELAY, 1); diff --git a/src/entity/weapon/tear.h b/src/entity/weapon/tear.h index 4a9f73c..c949ce4 100644 --- a/src/entity/weapon/tear.h +++ b/src/entity/weapon/tear.h @@ -328,6 +328,10 @@ struct Entity_Tear : Entity bool isHovering = false; bool isMultidimensionalTouched = false; bool isPrismTouched = false; +#ifdef ISAAC_REPENTOGON + // REPENTOGON's EntityTearPlus: the sound a mod plays in place of its fire sound. + std::optional initSound; +#endif void Init(int type, int variant, int subType, uint32_t initSeed) override; void Update() override; diff --git a/src/game/debug_renderer.cpp b/src/game/debug_renderer.cpp index 7d44ffa..f70121e 100644 --- a/src/game/debug_renderer.cpp +++ b/src/game/debug_renderer.cpp @@ -61,6 +61,16 @@ void Shape::Capsula(const Capsule& capsule) commands.insert(commands.end(), {SHAPE_DRAW_CAPSULE, (uint16_t)(last - 3), (uint16_t)(last - 2), (uint16_t)(last - 1)}); } +// 0042ede0 Adds a circle: its center, then its radius as a point. +void Shape::Circle(const Vector& position, float radius) +{ + points.push_back(position); + points.push_back(vector_make(radius, 0)); + + uint16_t last = (uint16_t)points.size(); + commands.insert(commands.end(), {SHAPE_DRAW_CIRCLE, (uint16_t)(last - 2), (uint16_t)(last - 1)}); +} + // 0042eb10 The shape of an index, cleared and given a new timeout on a reset, or a new one at the end when none has // it. Index -1 always adds one. Shape& DebugRenderer::Get(int index, bool isReset) diff --git a/src/game/debug_renderer.h b/src/game/debug_renderer.h index cae21df..1f63133 100644 --- a/src/game/debug_renderer.h +++ b/src/game/debug_renderer.h @@ -40,6 +40,7 @@ struct Shape int timeout = SHAPE_TIMEOUT; void Capsula(const Capsule& capsule); + void Circle(const Vector& position, float radius); }; // The debug renderer (DebugRenderer): the shapes the hitspheres debug view adds, found by their owner's index. diff --git a/src/game/manager.cpp b/src/game/manager.cpp index 3f75962..63789d4 100644 --- a/src/game/manager.cpp +++ b/src/game/manager.cpp @@ -592,6 +592,9 @@ void IsaacStartup(int argc, uint8_t** argv) // only free memory. void isaac_shutdown() { +#ifdef ISAAC_REPENTOGON + isShuttingDown = true; +#endif Manager& manager = *g_manager; PersistentGameData& data = manager.persistentGameData; log_printf(LOG_INFO, "Isaac is shutting down...\n"); diff --git a/src/game/music_manager.cpp b/src/game/music_manager.cpp index b7c95f7..afec667 100644 --- a/src/game/music_manager.cpp +++ b/src/game/music_manager.cpp @@ -539,6 +539,7 @@ void MusicManager::PlayJingle(int musicId) { #ifdef ISAAC_REPENTOGON if (!music_jingle_pre(musicId)) return; + jingleId = (uint16_t)musicId; #endif if (!is_music_id_valid(musicId) || currentMusicId == MUSIC_BOSS_OVER_TWISTED) return; if (currentMusicId == MUSIC_REVERSE_GENESIS || tracks[musicId].path.empty()) return; diff --git a/src/game/music_manager.h b/src/game/music_manager.h index 50113c1..665ce48 100644 --- a/src/game/music_manager.h +++ b/src/game/music_manager.h @@ -189,6 +189,10 @@ public: int currentMusicId = 0; int jingleTimer = 0; int queuedMusicId = 0; +#ifdef ISAAC_REPENTOGON + // The jingle played last, which REPENTOGON keeps in unused bytes. + uint16_t jingleId = 0; +#endif bool isEnabled = true; void LoadConfig(std::string_view path, ModEntry* mod); diff --git a/src/level/ambush.cpp b/src/level/ambush.cpp index 1d8ee73..66c5243 100644 --- a/src/level/ambush.cpp +++ b/src/level/ambush.cpp @@ -39,6 +39,8 @@ constexpr int AMBUSH_HOME_DIMENSION = 2; // entrance open. constexpr int WAVES_NORMAL = 3; constexpr int WAVES_BOSS = 2; +int ambushWaves = WAVES_NORMAL; +int bossAmbushWaves = WAVES_BOSS; constexpr int WAVE_COUNTDOWN = 30; constexpr int DOOR_STOP_BOSSRUSH = 2; constexpr int DOOR_STOP_CHALLENGE = 3; @@ -305,7 +307,7 @@ void Ambush::Update() bool isBossRush = room.roomType == ROOM_BOSSRUSH; int waves = maxWaves; if (isBossRush && wavesLeft.empty()) maxWaves = currentWave; - if (!isBossRush) waves = descriptor.data->subtype == CHALLENGE_SUBTYPE_BOSS ? WAVES_BOSS : WAVES_NORMAL; + if (!isBossRush) waves = descriptor.data->subtype == CHALLENGE_SUBTYPE_BOSS ? bossAmbushWaves : ambushWaves; if (countdown > 0) { diff --git a/src/level/ambush.h b/src/level/ambush.h index f2eaff2..171b587 100644 --- a/src/level/ambush.h +++ b/src/level/ambush.h @@ -17,6 +17,11 @@ struct BossRushEntry // A spawn slot's bosses, all of which rise together when a wave takes the slot. using BossRushWave = std::vector; +// A challenge's waves, two for a boss challenge. REPENTOGON's Ambush.SetMaxChallengeWaves and SetMaxBossChallengeWaves +// change them (ASMRoom.cpp's patch of the counts). +extern int ambushWaves; +extern int bossAmbushWaves; + // The original's copies, assignment and destruction are the defaults. // A challenge room's or the boss rush's fight (Game::ambush, REPENTOGON's Ambush): StartChallenge shuts the doors and // shuffles the boss rush's waves, then Update calls a wave 30 frames after the last one is beaten until all are, and diff --git a/src/level/generator.cpp b/src/level/generator.cpp index 5b7c99b..0fb3a08 100644 --- a/src/level/generator.cpp +++ b/src/level/generator.cpp @@ -5,6 +5,7 @@ #include #include #ifdef ISAAC_REPENTOGON +#include "repentogon/api_level.h" #include "repentogon/callbacks.h" #endif @@ -163,7 +164,7 @@ void LevelGenerator::Generate(const GenerationSettings& settings, const LevelGen #ifdef ISAAC_REPENTOGON constexpr int LAYOUT_GENERATED_PARAM = 12; CallbackRun run = {"PostLevelLayoutGenerated", MC_POST_LEVEL_LAYOUT_GENERATED, LAYOUT_GENERATED_PARAM}; - callback_notify(lua_engine_get(), run, LuaOpaque{}); + callback_notify(lua_engine_get(), run, this); #endif } diff --git a/src/level/grid/grid_entity.cpp b/src/level/grid/grid_entity.cpp index 4fb3747..11dcbeb 100644 --- a/src/level/grid/grid_entity.cpp +++ b/src/level/grid/grid_entity.cpp @@ -236,6 +236,16 @@ WaterClipInfo GridEntity::GetWaterClipInfo() return {WATER_CLIP_SOLID, 0}; } +// How the water clips the grid entity: its type's clip, with REPENTOGON the flags a mod set in their place. +WaterClipInfo GridEntity::water_clip_get() +{ + WaterClipInfo clip = GetWaterClipInfo(); +#ifdef ISAAC_REPENTOGON + if (waterClipFlagsOverride) clip.flags = *waterClipFlagsOverride; +#endif + return clip; +} + // 00709c30 Tear effects can damage it. bool GridEntity::CanTakeDamageFromTearEffects() { diff --git a/src/level/grid/grid_entity.h b/src/level/grid/grid_entity.h index 062b8ca..87d53bd 100644 --- a/src/level/grid/grid_entity.h +++ b/src/level/grid/grid_entity.h @@ -103,6 +103,10 @@ struct GridEntity uint32_t spawnSeed = GRID_SEED_DEFAULT; uint32_t variableSeed = GRID_SEED_DEFAULT; bool isInitialized = false; +#ifdef ISAAC_REPENTOGON + // REPENTOGON's GridEntityPlus: the water clip flags a mod set in place of the game's. + std::optional waterClipFlagsOverride; +#endif virtual ~GridEntity() = default; virtual void PostInit() @@ -121,6 +125,7 @@ struct GridEntity void desc_load(const GridEntityDesc& desc); Vector Position(); Vector get_render_position(); + WaterClipInfo water_clip_get(); void sprite_render(const Vector& offset); void path_set(int value); bool IsBreakableRock(); diff --git a/src/level/grid/rock.cpp b/src/level/grid/rock.cpp index 8fce67a..b9ec3a1 100644 --- a/src/level/grid/rock.cpp +++ b/src/level/grid/rock.cpp @@ -193,21 +193,11 @@ constexpr int EVENT_SS_ROCKS_DESTROYED = 4; constexpr int ALT_ROCK_SOUNDS[] = {0, 78, 79, 137, 77, 138}; constexpr int FLESHY_BACKDROPS[] = {10, 11, 12, 13, 34, 43, 44, 48}; -// The alternate rock a backdrop shows, also the index of its break sound. -enum AltRock -{ - ALT_ROCK_URN = 1, - ALT_ROCK_MUSHROOM, - ALT_ROCK_SKULL, - ALT_ROCK_POLYP, - ALT_ROCK_BUCKET -}; - // The Corpse's backdrops, whose polyps hold rotten things. constexpr int CORPSE_BACKDROPS[] = {BACKDROP_CORPSE, BACKDROP_CORPSE2, BACKDROP_CORPSE3, BACKDROP_MORTIS}; // 00718ee0 Which alternate rock a backdrop shows (the room's for none given). -static AltRock alt_rock_type_get(int backdropType) +AltRock alt_rock_type_get(int backdropType) { if (backdropType == 0) backdropType = g_game->room->backdropType; diff --git a/src/level/grid/rock.h b/src/level/grid/rock.h index 4cec111..e7d4da7 100644 --- a/src/level/grid/rock.h +++ b/src/level/grid/rock.h @@ -26,6 +26,16 @@ enum RockState : int ROCK_STATE_CRACKED }; +// The alternate rock a backdrop shows, also the index of its break sound. +enum AltRock +{ + ALT_ROCK_URN = 1, + ALT_ROCK_MUSHROOM, + ALT_ROCK_SKULL, + ALT_ROCK_POLYP, + ALT_ROCK_BUCKET +}; + // Which break a rock's drops come from: the rock's own Destroy (a Notched Axe swing's wisps roll there) or one landed // elsewhere (a thrown rock, a Siren). enum RockDropOrigin @@ -81,3 +91,4 @@ struct GridEntity_Rock : GridEntity }; void grid_mark_neighbors_dirty(int gridIndex); +AltRock alt_rock_type_get(int backdropType); diff --git a/src/level/level.cpp b/src/level/level.cpp index 31a49c5..5a9132e 100644 --- a/src/level/level.cpp +++ b/src/level/level.cpp @@ -505,6 +505,7 @@ static void ascent_voiceover_start(uint32_t voiceStage) void Level::Init(bool isResetLilPortalRoom) { #ifdef ISAAC_REPENTOGON + level_init_pre(); callback_notify(lua_engine_get(), {"PreLevelInit", MC_PRE_LEVEL_INIT, std::nullopt}); #endif Game& game = *g_game; @@ -1241,12 +1242,18 @@ bool Level::IsMausoleumHeartStage() // 0074ef70 Whether the floor has Dross or Downpour II's mirror world (or an XL first one). bool Level::HasMirrorDimension() { +#ifdef ISAAC_REPENTOGON + if (special_quest_force_get() != 0) return special_quest_check(STAGE_BASEMENT_II, 1); +#endif return is_path_stage(*this, true) && is_chapter_second_floor(*this, STAGE_BASEMENT_I); } // 0074efd0 Whether the floor has the Mines or Ashpit II's abandoned mineshaft (or an XL first one). bool Level::HasAbandonedMineshaft() { +#ifdef ISAAC_REPENTOGON + if (special_quest_force_get() != 0) return special_quest_check(STAGE_CAVES_II, 2); +#endif return is_path_stage(*this, true) && is_chapter_second_floor(*this, STAGE_CAVES_I); } @@ -4533,6 +4540,9 @@ RoomDescriptor* Level::get_secret_exit_room(int kind) // Redemption add no floor number. Empty for no stage. std::string Level::get_stage_display_name(const StageNameQuery& query) { +#ifdef ISAAC_REPENTOGON + if (!level_name_override_get().empty()) return level_name_override_get(); +#endif if (query.stage == 0) return ""; Game& game = *g_game; diff --git a/src/level/room.cpp b/src/level/room.cpp index 7855d83..962afb2 100644 --- a/src/level/room.cpp +++ b/src/level/room.cpp @@ -402,6 +402,7 @@ static void boss_fireplaces_bind(Room& room, bool isHeretic) void Room::Init(RoomConfig_Room& config, RoomDescriptor& roomDescriptor) { #ifdef ISAAC_REPENTOGON + room_item_pool_reset(); callback_notify(lua_engine_get(), {"PreNewRoom", MC_PRE_NEW_ROOM, std::nullopt}, this, &roomDescriptor); #endif temporaryEffects.ClearEffects(false); @@ -2588,7 +2589,11 @@ bool Room::TrySpawnMegaSatanRoomDoor(bool isForce) bool Room::TrySpawnSpecialQuestDoor() { Game& game = *g_game; - if (game.stageType != STAGETYPE_REPENTANCE && game.stageType != STAGETYPE_REPENTANCE_B) return false; + bool isAltPath = game.stageType == STAGETYPE_REPENTANCE || game.stageType == STAGETYPE_REPENTANCE_B; +#ifdef ISAAC_REPENTOGON + isAltPath = special_quest_stage_type_check(isAltPath); +#endif + if (!isAltPath) return false; bool isLabyrinth = is_curse_active(CURSE_OF_LABYRINTH); bool isDownpourTwo = game.stage == 2 || (game.stage == 1 && isLabyrinth); diff --git a/src/level/room_render.cpp b/src/level/room_render.cpp index a0728b6..c60cb84 100644 --- a/src/level/room_render.cpp +++ b/src/level/room_render.cpp @@ -972,7 +972,7 @@ static void floor_water_render(Room& room) room.backdrop.RenderWalls(Vector{}, room.floorColor); room.railManager.Render(offset); - grids_render(room, offset, [](GridEntity& grid) { return !(grid.GetWaterClipInfo().flags & WATER_CLIP_ABOVE); }); + grids_render(room, offset, [](GridEntity& grid) { return !(grid.water_clip_get().flags & WATER_CLIP_ABOVE); }); if (room.backdropType == BACKDROP_MINES && room.descriptor->flags & ROOM_DESCRIPTOR_FLAG_HAS_WATER) { water_overlay_render(room, Vector{}); @@ -1105,7 +1105,7 @@ static void depth_render(Room& room, bool isWaterShown) [&](GridEntity& grid) { if (grid.type == GRID_DECORATION || grid.type == GRID_DOOR || is_flat_grid(grid)) return false; - return !isWaterShown || !(grid.GetWaterClipInfo().flags & WATER_CLIP_UNDER); + return !isWaterShown || !(grid.water_clip_get().flags & WATER_CLIP_UNDER); }); for (int row = 0; row < room.gridHeight; row++) { diff --git a/src/lua/api.h b/src/lua/api.h index 182fdbc..dc9c06a 100644 --- a/src/lua/api.h +++ b/src/lua/api.h @@ -232,6 +232,54 @@ template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_VECTOR; template <> inline constexpr LuaClass LUA_CLASS_OF> = LUA_CLASS_VECTOR_LIST; +// REPENTOGON's entity classes. +struct Capsule; +struct EntityConfig_Entity; +struct EntityDesc; +struct EntitySaveState; +struct EntitySaveStateHandle; +struct Entity_Slot; +struct GridEntity_Decoration; +struct GridEntity_Fire; +struct GridEntity_Gravity; +struct GridEntity_Lock; +struct GridEntity_Stairs; +struct GridEntity_Statue; +struct GridEntity_Teleporter; +struct GridEntity_TrapDoor; +struct GridEntity_Wall; +struct GridEntity_Web; +struct LootList; +struct Shape; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_CAPSULE; +template <> inline constexpr LuaClass LUA_CLASS_OF> = LUA_CLASS_ENTITIES_SAVE_STATE_VECTOR; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_ENTITY_CONFIG_ENTITY; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_ENTITY_DESC; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_ENTITY_SAVE_STATE; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_ENTITY_SLOT; +template <> +inline constexpr LuaClass LUA_CLASS_OF> = LUA_CLASS_GRID_ENTITIES_SAVE_STATE_VECTOR; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_GRID_ENTITY_DECORATION; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_GRID_ENTITY_FIRE; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_GRID_ENTITY_GRAVITY; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_GRID_ENTITY_LOCK; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_GRID_ENTITY_STAIRS; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_GRID_ENTITY_STATUE; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_GRID_ENTITY_TELEPORTER; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_GRID_ENTITY_TRAP_DOOR; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_GRID_ENTITY_WALL; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_GRID_ENTITY_WEB; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_LOOT_LIST; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_SHAPE; + +// REPENTOGON's weapon and boss classes. WeaponData is what Lua holds of a weapon (repentogon/weapons.h). +struct BossPool_Pool; +struct WeaponData; +struct Weapon_MultiShotParams; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_BOSS_POOL; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_MULTI_SHOT_PARAMS; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_WEAPON; + // The class and member type of a pointer to a data member, for decltype only. template C lua_member_class(T C::*); @@ -307,11 +355,13 @@ void lua_push(lua_State* state, const T& value) // Reads argument index as a T: numbers are checked, booleans are truthiness, objects are checked against their class // (nil only for a pointer), a class value is copied unless T is a reference, and a LuaDefault may be left out. +// A type with its own lua_read reads itself. template T lua_get(lua_State* state, int index) { using V = std::remove_cvref_t; if constexpr (std::is_same_v) return {}; + else if constexpr (requires { V::lua_read(state, index); }) return V::lua_read(state, index); else if constexpr (IS_LUA_DEFAULT) return lua_isnoneornil(state, index) ? V{} : V{lua_get(state, index)}; else if constexpr (std::is_same_v) return lua_toboolean(state, index); diff --git a/src/lua/api_color.cpp b/src/lua/api_color.cpp index 8d005fc..972f83c 100644 --- a/src/lua/api_color.cpp +++ b/src/lua/api_color.cpp @@ -2,6 +2,9 @@ #include "engine/anm2.h" #include "engine/fx_layers.h" #include "lua/api.h" +#ifdef ISAAC_REPENTOGON +#include "repentogon/lua_render.h" +#endif #include // A Color property: a channel of the tint or the offset. @@ -44,6 +47,9 @@ void lua_api_color_register(lua_State* state) color_multiply(color, other); return color; }); +#ifdef ISAAC_REPENTOGON + color_repentogon_register(state); +#endif lua_class_end(state); lua_class_begin(state, "KColor", LUA_CLASS_KCOLOR); diff --git a/src/lua/api_entities.cpp b/src/lua/api_entities.cpp index c3f9218..d93548a 100644 --- a/src/lua/api_entities.cpp +++ b/src/lua/api_entities.cpp @@ -14,6 +14,12 @@ #include "lua/api.h" #include "level/path_finder.h" #include "entity/weapon/weapon.h" +#ifdef ISAAC_REPENTOGON +#include "repentogon/api_items.h" +#include "repentogon/entities.h" +#include "repentogon/npc.h" +#include "repentogon/weapons.h" +#endif #include // The range Lua's EntityPickup.ShopItemId keeps a written id in: anything below -1 becomes -2. @@ -76,6 +82,9 @@ static void shots_register(lua_State* state) lua_method(state, "SetKnockbackMultiplier", [](Entity_Tear& tear, float multiplier) { tear.knockbackMultiplier = multiplier; }); lua_method(state, "SetParentOffset", [](Entity_Tear& tear, Vector offset) { tear.parentOffset = offset; }); +#ifdef ISAAC_REPENTOGON + tear_api_register(state); +#endif lua_class_end(state); lua_class_begin(state, "EntityProjectile", LUA_CLASS_PROJECTILE, LUA_CLASS_ENTITY); @@ -99,6 +108,9 @@ static void shots_register(lua_State* state) lua_method(state, "AddProjectileFlags", [](Entity_Projectile& shot, uint64_t flags) { shot.AddProjectileFlags(flags); }); lua_method(state, "AddChangeFlags", [](Entity_Projectile& shot, uint64_t flags) { shot.changeFlags |= flags; }); +#ifdef ISAAC_REPENTOGON + projectile_api_register(state); +#endif lua_class_end(state); } @@ -112,6 +124,9 @@ static void weapons_register(lua_State* state) lua_field<&Entity_Bomb::radiusMultiplier>(state, "RadiusMultiplier"); lua_method(state, "SetExplosionCountdown", [](Entity_Bomb& bomb, int countdown) { bomb.SetExplosionCountdown(countdown); }); +#ifdef ISAAC_REPENTOGON + bomb_api_register(state); +#endif lua_class_end(state); lua_class_begin(state, "EntityKnife", LUA_CLASS_KNIFE, LUA_CLASS_ENTITY); @@ -130,6 +145,9 @@ static void weapons_register(lua_State* state) lua_method(state, "SetPathFollowSpeed", [](Entity_Knife& knife, float speed) { knife.pathFollowSpeed = speed; }); lua_method(state, "GetRenderZ", [](Entity_Knife& knife) { return knife.GetRenderZ(); }); weapon_lua_knife_register(state); +#ifdef ISAAC_REPENTOGON + knife_api_register(state); +#endif lua_class_end(state); lua_class_begin(state, "EntityLaser", LUA_CLASS_LASER, LUA_CLASS_ENTITY); @@ -178,6 +196,9 @@ static void weapons_register(lua_State* state) lua_method(state, "SetMultidimensionalTouched", [](Entity_Laser& laser, bool isTouched) { laser.isMultidimensionalTouched = isTouched; }); weapon_lua_laser_register(state); +#ifdef ISAAC_REPENTOGON + laser_api_register(state); +#endif lua_class_end(state); } @@ -243,6 +264,9 @@ static void companions_register(lua_State* state) lua_method(state, "RemoveFromDelayed", [](Entity_Familiar& familiar) { familiar.RemoveFromDelayed(); }); lua_method(state, "AddToOrbit", [](Entity_Familiar& familiar, int layer) { familiar.AddToOrbit(layer); }); lua_method(state, "RemoveFromOrbit", [](Entity_Familiar& familiar) { familiar.RemoveFromOrbit(); }); +#ifdef ISAAC_REPENTOGON + familiar_api_register(state); +#endif lua_class_end(state); lua_class_begin(state, "EntityEffect", LUA_CLASS_EFFECT, LUA_CLASS_ENTITY); @@ -266,6 +290,9 @@ static void companions_register(lua_State* state) }); lua_method(state, "FollowParent", [](Entity_Effect& effect, Entity* parent) { effect.FollowParent(parent); }); lua_method(state, "SetDamageSource", [](Entity_Effect& effect, int type) { effect.damageSource = type; }); +#ifdef ISAAC_REPENTOGON + effect_api_register(state); +#endif lua_class_end(state); } @@ -343,6 +370,9 @@ static void npc_pickup_register(lua_State* state) lua_static(state, "ThrowSpider", [](Vector position, Entity* spawner, Vector target, bool isBig, float yOffset) { return Entity_NPC::ThrowSpider(position, spawner, target, isBig, yOffset); }); +#ifdef ISAAC_REPENTOGON + npc_api_register(state); +#endif lua_class_end(state); lua_class_begin(state, "EntityPickup", LUA_CLASS_PICKUP, LUA_CLASS_ENTITY); @@ -373,6 +403,9 @@ static void npc_pickup_register(lua_State* state) lua_method(state, "PlayPickupSound", [](Entity_Pickup& pickup) { pickup.PlayPickupSound(); }); lua_method(state, "GetCoinValue", [](Entity_Pickup& pickup) { return pickup.GetCoinValue(); }); lua_method(state, "CanReroll", [](Entity_Pickup& pickup) { return pickup.CanReroll(); }); +#ifdef ISAAC_REPENTOGON + pickup_api_register(state); +#endif lua_class_end(state); } @@ -442,6 +475,9 @@ static void projectile_params_register(lua_State* state) lua_field<&ProjectileParams::changeTimeout>(state, "ChangeTimeout"); lua_field<&ProjectileParams::depthOffset>(state, "DepthOffset"); lua_field<&ProjectileParams::variant>(state, "Variant"); +#ifdef ISAAC_REPENTOGON + projectile_params_api_register(state); +#endif lua_class_end(state); } diff --git a/src/lua/api_entity.cpp b/src/lua/api_entity.cpp index d738e30..0e861f6 100644 --- a/src/lua/api_entity.cpp +++ b/src/lua/api_entity.cpp @@ -11,6 +11,9 @@ #include "entity/weapon/projectile.h" #include "entity/weapon/tear.h" #include "lua/api.h" +#ifdef ISAAC_REPENTOGON +#include "repentogon/entities.h" +#endif // The color Entity.Color reads for no entity. constexpr ColorMod COLOR_NO_ENTITY = {{0, 0, 0, 1}, {0, 0, 0, 0}, {0, 0, 0}}; @@ -255,6 +258,9 @@ static void entity_class_register(lua_State* state) entity_cast_add(state, "ToLaser"); entity_cast_add(state, "ToTear"); entity_cast_add(state, "ToProjectile"); +#ifdef ISAAC_REPENTOGON + entity_api_register(state); +#endif lua_class_end(state); } diff --git a/src/lua/api_entity_player.cpp b/src/lua/api_entity_player.cpp index c37dbfc..79be799 100644 --- a/src/lua/api_entity_player.cpp +++ b/src/lua/api_entity_player.cpp @@ -11,6 +11,10 @@ #include "lua/api.h" #include "entity/player/temporary_effects.h" #include "entity/weapon/weapon.h" +#ifdef ISAAC_REPENTOGON +#include "repentogon/player.h" +#include "repentogon/weapons.h" +#endif // 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; @@ -507,7 +511,14 @@ void lua_api_entity_player_register(lua_State* state) player_state_register(state); player_actions_register(state); weapon_lua_player_register(state); +#ifdef ISAAC_REPENTOGON + player_api_register(state); + player_weapon_api_register(state); +#endif lua_class_end(state); +#ifdef ISAAC_REPENTOGON + player_classes_api_register(state); +#endif lua_class_begin(state, "QueueItemData", LUA_CLASS_QUEUE_ITEM_DATA); lua_field<&QueueItemData::item>(state, "Item"); @@ -571,5 +582,8 @@ void lua_api_entity_player_register(lua_State* state) lua_field<&TearParams::tearDamage>(state, "TearDamage"); lua_field<&TearParams::tearScale>(state, "TearScale"); lua_field<&TearParams::tearHeight>(state, "TearHeight"); +#ifdef ISAAC_REPENTOGON + tear_params_api_register(state); +#endif lua_class_end(state); } diff --git a/src/lua/api_game.cpp b/src/lua/api_game.cpp index 56dce22..db24487 100644 --- a/src/lua/api_game.cpp +++ b/src/lua/api_game.cpp @@ -22,6 +22,12 @@ #include "engine/seeds.h" #include "game/sfx_manager.h" #include "level/stage_transition.h" +#ifdef ISAAC_REPENTOGON +#include "repentogon/api_game.h" +#include "repentogon/api_items.h" +#include "repentogon/audio.h" +#include "repentogon/hud.h" +#endif #include // The last stage the run's stage counters keep. @@ -306,6 +312,9 @@ static void game_register(lua_State* state) game_counters_register(state); game_effects_register(state); game_flow_register(state); +#ifdef ISAAC_REPENTOGON + game_repentogon_register(state); +#endif lua_class_end(state); } @@ -380,6 +389,9 @@ static void game_parts_register(lua_State* state) lua_table_set(state, -2, "ShowFortuneText"); lua_pushcfunction(state, hud_item_text_show); lua_table_set(state, -2, "ShowItemText"); +#ifdef ISAAC_REPENTOGON + hud_methods_register(state); +#endif lua_class_end(state); lua_class_begin(state, "ItemPool", LUA_CLASS_ITEM_POOL); @@ -411,6 +423,9 @@ static void game_parts_register(lua_State* state) lua_method(state, "ResetRoomBlacklist", [](ItemPool& pool) { pool.ResetRoomBlacklist(); }); lua_method(state, "AddBibleUpgrade", [](ItemPool& pool, int add, int poolType) { pool.AddBibleUpgrade(add, poolType); }); +#ifdef ISAAC_REPENTOGON + item_pool_api_register(state); +#endif lua_class_end(state); lua_class_begin(state, "Seeds", LUA_CLASS_SEEDS); @@ -442,6 +457,9 @@ static void game_parts_register(lua_State* state) 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); }); +#ifdef ISAAC_REPENTOGON + seeds_repentogon_register(state); +#endif lua_class_end(state); } @@ -492,6 +510,9 @@ static void sound_register(lua_State* state) lua_method(state, "UpdateVolume", [](MusicManager& music) { music.UpdateVolume(); }); lua_method(state, "GetCurrentMusicID", [](MusicManager& music) { return music.GetCurrentMusicID(); }); lua_method(state, "GetQueuedMusicID", [](MusicManager& music) { return music.GetQueuedMusicID(); }); +#ifdef ISAAC_REPENTOGON + music_api_register(state); +#endif lua_class_end(state); } diff --git a/src/lua/api_grid_entity.cpp b/src/lua/api_grid_entity.cpp index aceddbf..85fada3 100644 --- a/src/lua/api_grid_entity.cpp +++ b/src/lua/api_grid_entity.cpp @@ -9,6 +9,8 @@ #include "level/grid/tnt.h" #include "lua/api.h" #ifdef ISAAC_REPENTOGON +#include "repentogon/api_level.h" +#include "repentogon/entities.h" #include "repentogon/render.h" #endif @@ -77,6 +79,9 @@ static void grid_entity_base_register(lua_State* state) grid_cast_add(state, "ToRock"); grid_cast_add(state, "ToSpikes"); grid_cast_add(state, "ToTNT"); +#ifdef ISAAC_REPENTOGON + grid_entity_api_register(state); +#endif lua_class_end(state); } @@ -130,6 +135,9 @@ static void grid_entity_door_register(lua_State* state) lua_field<&GridEntity_Door::closeAnimation>(state, "CloseAnimation"); lua_field<&GridEntity_Door::lockedAnimation>(state, "LockedAnimation"); lua_field<&GridEntity_Door::openLockedAnimation>(state, "OpenLockedAnimation"); +#ifdef ISAAC_REPENTOGON + repentogon_grid_door_register(state); +#endif lua_class_end(state); } @@ -169,6 +177,9 @@ static void grid_entity_kinds_register(lua_State* state) lua_field<&GridEntity_Rock::anim>(state, "Anim"); lua_field<&GridEntity_Rock::rubbleAnim>(state, "RubbleAnim"); lua_field<&GridEntity_Rock::fuseFrames>(state, "FrameCnt"); +#ifdef ISAAC_REPENTOGON + repentogon_grid_rock_register(state); +#endif lua_class_end(state); lua_class_begin(state, "GridEntitySpikes", LUA_CLASS_GRID_ENTITY_SPIKES, LUA_CLASS_GRID_ENTITY); diff --git a/src/lua/api_isaac.cpp b/src/lua/api_isaac.cpp index 9a55004..e15f11b 100644 --- a/src/lua/api_isaac.cpp +++ b/src/lua/api_isaac.cpp @@ -19,7 +19,15 @@ #include "level/room.h" #include "level/room_grid.h" #ifdef ISAAC_REPENTOGON +#include "repentogon/api_game.h" +#include "repentogon/api_items.h" +#include "repentogon/entities.h" +#include "repentogon/api_level.h" +#include "repentogon/lua_render.h" +#include "repentogon/menus.h" +#include "repentogon/npc.h" #include "repentogon/repentogon.h" +#include "repentogon/weapons.h" #endif #include #include @@ -591,6 +599,20 @@ static void isaac_register(lua_State* state) [](auto& sound) -> const std::string& { return sound.name; }, [](auto& sound) { return sound.id; }, -1); }); +#ifdef ISAAC_REPENTOGON + isaac_entities_register(state); + isaac_weapons_register(state); + isaac_bosses_register(state); + isaac_menus_register(state); + isaac_render_register(state); + repentogon_isaac_level_register(state); + repentogon_isaac_saves_register(state); + repentogon_isaac_input_register(state); + isaac_game_register(state); + isaac_console_register(state); + isaac_items_register(state); + isaac_misc_register(state); +#endif lua_class_end(state); } @@ -639,6 +661,9 @@ static void input_register(lua_State* state) }); lua_method(state, "GetMousePosition", mouse_position_get); lua_method(state, "IsMouseBtnPressed", is_mouse_button_pressed); +#ifdef ISAAC_REPENTOGON + repentogon_input_register(state); +#endif lua_class_end(state); } @@ -724,6 +749,9 @@ static void options_register(lua_State* state) }); option_clamped_add<&OptionsConfig::jacobEsauControls, 0, 1>(state, "JacobEsauControls"); lua_property(state, "Language", [](LuaIgnored) { return std::string(Manager::GetLanguage()); }); +#ifdef ISAAC_REPENTOGON + options_api_register(state); +#endif lua_class_end(state); } diff --git a/src/lua/api_item_config.cpp b/src/lua/api_item_config.cpp index 43ed927..cd0d9db 100644 --- a/src/lua/api_item_config.cpp +++ b/src/lua/api_item_config.cpp @@ -1,6 +1,9 @@ #include "classes.h" #include "entity/pickup/item_config.h" #include "lua/api.h" +#ifdef ISAAC_REPENTOGON +#include "repentogon/api_items.h" +#endif // Registers ItemConfig.Item, a collectible, trinket or null item, and ItemConfig.Costume. static void item_register(lua_State* state) @@ -43,6 +46,9 @@ static void item_register(lua_State* state) lua_field<&ItemConfig_Item::quality>(state, "Quality"); lua_field<&ItemConfig_Item::craftingQuality>(state, "CraftingQuality"); lua_property(state, "Costume", [](ItemConfig_Item& item) -> ItemConfig_Costume& { return item.costume; }); +#ifdef ISAAC_REPENTOGON + item_api_register(state); +#endif lua_class_end(state, LUA_SCOPE_NAMESPACE); lua_class_begin(state, "Costume", LUA_CLASS_ITEM_CONFIG_COSTUME); @@ -54,6 +60,9 @@ static void item_register(lua_State* state) lua_field<&ItemConfig_Costume::isHasSkinAlt>(state, "HasSkinAlt"); lua_field<&ItemConfig_Costume::skinColor>(state, "SkinColor"); lua_field<&ItemConfig_Costume::isOverwriteColor>(state, "OverwriteColor"); +#ifdef ISAAC_REPENTOGON + costume_api_register(state); +#endif lua_class_end(state, LUA_SCOPE_NAMESPACE); } @@ -75,6 +84,9 @@ static void pocket_items_register(lua_State* state) lua_method(state, "IsCard", [](ItemConfig_Card& card) { return card.IsCard(); }); lua_method(state, "IsRune", [](ItemConfig_Card& card) { return card.IsRune(); }); lua_method(state, "IsAvailable", [](ItemConfig_Card& card) { return card.IsAvailable(); }); +#ifdef ISAAC_REPENTOGON + card_api_register(state); +#endif lua_class_end(state, LUA_SCOPE_NAMESPACE); lua_class_begin(state, "PillEffect", LUA_CLASS_ITEM_CONFIG_PILL); @@ -89,6 +101,9 @@ static void pocket_items_register(lua_State* state) lua_field<&ItemConfig_Pill::effectClass>(state, "EffectClass"); lua_field<&ItemConfig_Pill::effectSubClass>(state, "EffectSubClass"); lua_method(state, "IsAvailable", [](ItemConfig_Pill& pill) { return pill.IsAvailable(); }); +#ifdef ISAAC_REPENTOGON + pill_effect_api_register(state); +#endif lua_class_end(state, LUA_SCOPE_NAMESPACE); } @@ -116,6 +131,9 @@ void lua_api_item_config_register(lua_State* state) lua_static(state, "IsValidCollectible", [](int id) { return ItemConfig::IsValidCollectible(id); }); lua_static(state, "ShouldAddCostumeOnPickup", [](ItemConfig_Item* item) { return ItemConfig::ShouldAddCostumeOnPickup(item); }); +#ifdef ISAAC_REPENTOGON + item_config_api_register(state); +#endif lua_class_end(state, LUA_SCOPE_NAMESPACE); lua_class_end(state); } diff --git a/src/lua/api_rng.cpp b/src/lua/api_rng.cpp index dd125bc..e797d9c 100644 --- a/src/lua/api_rng.cpp +++ b/src/lua/api_rng.cpp @@ -1,5 +1,8 @@ #include "classes.h" #include "lua/api.h" +#ifdef ISAAC_REPENTOGON +#include "repentogon/api_items.h" +#endif #include "engine/seeds.h" // (008bbcf0) Registers Lua's RNG: a default seeded constructor and the game's RNG methods. @@ -12,5 +15,8 @@ void lua_api_rng_register(lua_State* state) lua_method(state, "RandomInt", [](RNG& rng, uint32_t max) { return rng.RandomInt(max); }); lua_method(state, "RandomFloat", [](RNG& rng) { return rng.RandomFloat(); }); lua_method(state, "Next", [](RNG& rng) { return rng.Next(); }); +#ifdef ISAAC_REPENTOGON + rng_api_register(state); +#endif lua_class_end(state); } diff --git a/src/lua/api_room.cpp b/src/lua/api_room.cpp index 9920210..9dd169f 100644 --- a/src/lua/api_room.cpp +++ b/src/lua/api_room.cpp @@ -16,6 +16,9 @@ #include "level/room_grid.h" #include "level/room_special.h" #include +#ifdef ISAAC_REPENTOGON +#include "repentogon/api_level.h" +#endif // The frames KeepDoorsClosed holds the room uncleared for. constexpr int ROOM_CLEAR_DELAY_KEPT = 10; @@ -152,6 +155,9 @@ static void level_register(lua_State* state) lua_method(state, "GetPlanetariumChance", [](Level& level) { return level.GetPlanetariumChance(); }); lua_method(state, "SetRedHeartDamage", [](Level& level) { level.SetRedHeartDamage(); }); lua_method(state, "ForceHorsemanBoss", [](Level& level, uint32_t seed) { return level.ForceHorsemanBoss(seed); }); +#ifdef ISAAC_REPENTOGON + repentogon_level_register(state); +#endif lua_class_end(state); lua_class_begin(state, "RoomList", LUA_CLASS_ROOM_LIST); @@ -164,6 +170,9 @@ static void level_register(lua_State* state) // (00872020, 00872040) The RoomConfig namespace: a room layout, with its doors and spawns, then its cells. lua_namespace_begin(state, "RoomConfig"); +#ifdef ISAAC_REPENTOGON + repentogon_room_config_register(state); +#endif lua_class_begin(state, "Room", LUA_CLASS_ROOM_CONFIG_ROOM); lua_field_get<&RoomConfig_Room::stageId>(state, "StageID"); lua_field_get<&RoomConfig_Room::type>(state, "Type"); @@ -211,6 +220,9 @@ static void level_register(lua_State* state) descriptor_flag_add(state, "SurpriseMiniboss"); descriptor_flag_add(state, "HasWater"); descriptor_flag_add(state, "NoReward"); +#ifdef ISAAC_REPENTOGON + repentogon_room_descriptor_register(state); +#endif lua_class_end(state); } @@ -433,6 +445,9 @@ static void room_register(lua_State* state) lua_method(state, "TrySpawnSpecialQuestDoor", [](Room& room) { return room.TrySpawnSpecialQuestDoor(); }); room_grid_register(state); room_state_register(state); +#ifdef ISAAC_REPENTOGON + repentogon_room_register(state); +#endif lua_class_end(state); } diff --git a/src/lua/api_sprite.cpp b/src/lua/api_sprite.cpp index 8a412cc..393fb2d 100644 --- a/src/lua/api_sprite.cpp +++ b/src/lua/api_sprite.cpp @@ -2,6 +2,9 @@ #include "engine/anm2.h" #include "engine/font.h" #include "lua/api.h" +#ifdef ISAAC_REPENTOGON +#include "repentogon/lua_render.h" +#endif // Registers Lua's Sprite, the game's ANM2: loading, playing and rendering an animation and its overlay, and its // offset, scale, rotation, color, flips and speed. Sprites scripts construct are destroyed with their userdata. @@ -89,6 +92,9 @@ static void sprite_register(lua_State* state) lua_field<&ANM2::isFlipX, ANM2>(state, "FlipX"); lua_field<&ANM2::isFlipY, ANM2>(state, "FlipY"); lua_field<&ANM2::playbackSpeed, ANM2>(state, "PlaybackSpeed"); +#ifdef ISAAC_REPENTOGON + sprite_repentogon_register(state); +#endif lua_class_end(state); } @@ -146,6 +152,9 @@ static void font_register(lua_State* state) KColor color, FontSettings& settings) { font.DrawString(text, vector_make(x, y), vector_make(scaleX, scaleY), color, settings); }); +#ifdef ISAAC_REPENTOGON + font_repentogon_register(state); +#endif lua_class_end(state); } @@ -153,4 +162,8 @@ void lua_api_sprite_register(lua_State* state) { sprite_register(state); font_register(state); +#ifdef ISAAC_REPENTOGON + sprite_classes_register(state); + render_classes_register(state); +#endif } diff --git a/src/lua/api_vector.cpp b/src/lua/api_vector.cpp index 6710dbf..046ba08 100644 --- a/src/lua/api_vector.cpp +++ b/src/lua/api_vector.cpp @@ -1,5 +1,8 @@ #include "classes.h" #include "lua/api.h" +#ifdef ISAAC_REPENTOGON +#include "repentogon/api_items.h" +#endif #include "entity/npc/ai.h" // The vector with each axis clamped between the corners. @@ -58,5 +61,8 @@ void lua_api_vector_register(lua_State* state) std::snprintf(text, sizeof(text), "%g %g", vector.x, vector.y); return std::string(text); }); +#ifdef ISAAC_REPENTOGON + vector_api_register(state); +#endif lua_class_end(state); } diff --git a/src/lua/callbacks.cpp b/src/lua/callbacks.cpp index 4fe06ea..573f038 100644 --- a/src/lua/callbacks.cpp +++ b/src/lua/callbacks.cpp @@ -15,6 +15,7 @@ #include "game/manager.h" #ifdef ISAAC_REPENTOGON #include "repentogon/callbacks.h" +#include "repentogon/menus.h" #endif constexpr int PILL_EFFECT_UNCHANGED = -1; @@ -386,9 +387,13 @@ void LuaEngine::PostGameEnd(bool isGameOver) callback_notify(*this, {"PostGameEnd", MC_POST_GAME_END}, isGameOver); } -// 00864ee0 Runs MC_POST_GAME_STARTED with whether the run continues a saved one. +// 00864ee0 Runs MC_POST_GAME_STARTED with whether the run continues a saved one. REPENTOGON clears the main menu's +// input mask first. void LuaEngine::PostGameStart(bool isContinued) { +#ifdef ISAAC_REPENTOGON + menu_input_mask_clear(); +#endif callback_notify(*this, {"PostGameStart", MC_POST_GAME_STARTED}, isContinued); } diff --git a/src/lua/engine.cpp b/src/lua/engine.cpp index 30aac36..78960d0 100644 --- a/src/lua/engine.cpp +++ b/src/lua/engine.cpp @@ -6,6 +6,13 @@ #include "game/manager.h" #include "engine/platform.h" #ifdef ISAAC_REPENTOGON +#include "repentogon/api_game.h" +#include "repentogon/api_items.h" +#include "repentogon/entities.h" +#include "repentogon/npc.h" +#include "repentogon/weapons.h" +#include "repentogon/hud.h" +#include "repentogon/menus.h" #include "repentogon/repentogon.h" #endif #include @@ -191,6 +198,16 @@ void LuaEngine::RegisterAPI() lua_api_entity_player_register, lua_api_game_register, lua_api_room_register, lua_api_item_config_register, lua_api_isaac_register}) registerPart(state); +#ifdef ISAAC_REPENTOGON + entity_classes_register(state); + items_classes_register(state); + weapon_classes_register(state); + npc_classes_register(state); + hud_classes_register(state); + menus_register(state); + game_classes_register(state); + console_classes_register(state); +#endif } // 0086e520 Unloads every registered mod, releases the engine's references and closes the state. diff --git a/src/lua/engine.h b/src/lua/engine.h index c73914a..de36d47 100644 --- a/src/lua/engine.h +++ b/src/lua/engine.h @@ -113,6 +113,85 @@ enum LuaClass LUA_CLASS_TEMPORARY_EFFECTS, LUA_CLASS_VECTOR, LUA_CLASS_VECTOR_LIST, + // REPENTOGON's entity classes. + LUA_CLASS_CAPSULE, + LUA_CLASS_ENTITIES_SAVE_STATE_VECTOR, + LUA_CLASS_ENTITY_CONFIG_ENTITY, + LUA_CLASS_ENTITY_DELIRIUM, + LUA_CLASS_ENTITY_DESC, + LUA_CLASS_ENTITY_SAVE_STATE, + LUA_CLASS_ENTITY_SLOT, + LUA_CLASS_GRID_ENTITIES_SAVE_STATE_VECTOR, + LUA_CLASS_GRID_ENTITY_DECORATION, + LUA_CLASS_GRID_ENTITY_FIRE, + LUA_CLASS_GRID_ENTITY_GRAVITY, + LUA_CLASS_GRID_ENTITY_LOCK, + LUA_CLASS_GRID_ENTITY_STAIRS, + LUA_CLASS_GRID_ENTITY_STATUE, + LUA_CLASS_GRID_ENTITY_TELEPORTER, + LUA_CLASS_GRID_ENTITY_TRAP_DOOR, + LUA_CLASS_GRID_ENTITY_WALL, + LUA_CLASS_GRID_ENTITY_WEB, + LUA_CLASS_LOOT_LIST, + LUA_CLASS_SHAPE, + // REPENTOGON's render and sprite classes. + LUA_CLASS_ANIMATION_DATA, + LUA_CLASS_ANIMATION_FRAME, + LUA_CLASS_ANIMATION_LAYER, + LUA_CLASS_BEAM, + LUA_CLASS_BEAM_POINT, + LUA_CLASS_BLEND_MODE, + LUA_CLASS_COLOR_MODIFIER, + LUA_CLASS_COLOR_PARAMS, + LUA_CLASS_DESTINATION_QUAD, + LUA_CLASS_IMAGE, + LUA_CLASS_LAYER_STATE, + LUA_CLASS_NULL_FRAME, + LUA_CLASS_SHADER, + LUA_CLASS_SOURCE_QUAD, + LUA_CLASS_SURFACE_RENDER_CONTROLLER, + LUA_CLASS_TRANSFORMER, + // REPENTOGON's level, room and save classes. + LUA_CLASS_BACKDROP, + LUA_CLASS_CAMERA, + LUA_CLASS_FX_LAYERS, + LUA_CLASS_FX_PARAMS, + LUA_CLASS_LEVEL_GENERATOR, + LUA_CLASS_LEVEL_GENERATOR_ENTRY, + LUA_CLASS_LEVEL_GENERATOR_ROOM, + LUA_CLASS_L_ROOM_AREA_DESC, + LUA_CLASS_L_ROOM_TILE_DESC, + LUA_CLASS_PERSISTENT_GAME_DATA, + LUA_CLASS_RAIL_MANAGER, + LUA_CLASS_ROOM_CONFIG_SET, + LUA_CLASS_ROOM_CONFIG_STAGE, + LUA_CLASS_ROOM_DESCRIPTOR_DOORS, + // REPENTOGON's HUD and menu classes. + LUA_CLASS_HISTORY_HUD, + LUA_CLASS_HISTORY_HUD_ITEM, + LUA_CLASS_HISTORY_ITEM, + LUA_CLASS_HUD_MESSAGE, + LUA_CLASS_MINIMAP_CONFIG, + LUA_CLASS_PLAYER_HUD, + LUA_CLASS_PLAYER_HUD_HEART, + // REPENTOGON's player classes. + LUA_CLASS_COSTUME_SPRITE_DESC, + LUA_CLASS_ENTITY_CONFIG_BABY, + LUA_CLASS_ENTITY_CONFIG_PLAYER, + LUA_CLASS_HISTORY, + LUA_CLASS_POCKET_ITEM, + // REPENTOGON's game classes. + LUA_CLASS_CHALLENGE_PARAM, + LUA_CLASS_GENERIC_PROMPT, + // REPENTOGON's weapon and boss classes. + LUA_CLASS_BOSS_POOL, + LUA_CLASS_MULTI_SHOT_PARAMS, + LUA_CLASS_WEAPON, + // REPENTOGON's item and pickup classes. + LUA_CLASS_LOOT_LIST_ENTRY, + LUA_CLASS_PROCEDURAL_EFFECT, + LUA_CLASS_PROCEDURAL_ITEM, + LUA_CLASS_WEIGHTED_OUTCOME_PICKER, LUA_CLASS_COUNT }; diff --git a/src/repentogon/api.h b/src/repentogon/api.h new file mode 100644 index 0000000..08748b9 --- /dev/null +++ b/src/repentogon/api.h @@ -0,0 +1,160 @@ +#pragma once + +#include "lua/api.h" +#include + +// Helpers REPENTOGON's Lua bindings share: its argument readers (LuaCore's luaL_optboolean, luaL_checkboolean and +// LuaEntityPlayer.cpp's LuaCheckActiveSlot), raw member accessors and its new classes' registration. + +struct ColorParams; +struct CostumeSpriteDesc; +struct EntityConfig_Baby; +struct EntityConfig_Player; +struct History; +struct PocketItem; + +// The Lua classes of REPENTOGON's types other areas hand out too. +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_COLOR_PARAMS; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_COSTUME_SPRITE_DESC; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_ENTITY_CONFIG_BABY; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_ENTITY_CONFIG_PLAYER; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_HISTORY; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_POCKET_ITEM; + +// Calls a constructor REPENTOGON registers as a global function through the __call of its class table, which passes +// the table first, so its arguments keep their indexes. +template +int lua_constructor_call(lua_State* state) +{ + lua_remove(state, 1); + return Constructor(state); +} + +// Whether a negative active slot is allowed, which some functions read as every slot. +enum ActiveSlotRange +{ + ACTIVE_SLOT_RANGE_POSITIVE, + ACTIVE_SLOT_RANGE_ANY +}; + +// A boolean luaL_optboolean reads: Default only past the last argument, else its truthiness (nil is false). +template +struct LuaOptionalBool +{ + bool value = Default; + + static LuaOptionalBool lua_read(lua_State* state, int index) + { + return {lua_gettop(state) < index ? Default : (bool)lua_toboolean(state, index)}; + } +}; + +// A boolean luaL_checkboolean reads: its truthiness, an error for nil. +struct LuaCheckedBool +{ + bool value = false; + + static LuaCheckedBool lua_read(lua_State* state, int index) + { + if (lua_isnil(state, index)) luaL_error(state, "Expected non nil boolean as parameter #%d\n", index); + return {(bool)lua_toboolean(state, index)}; + } +}; + +// An active slot, 0 when left out. An argument error above 3, or below 0 unless the range allows any. +template +struct LuaActiveSlot +{ + int value = 0; + + static LuaActiveSlot lua_read(lua_State* state, int index) + { + constexpr lua_Integer SLOT_LAST = 3; + lua_Integer slot = luaL_optinteger(state, index, 0); + if ((Range == ACTIVE_SLOT_RANGE_POSITIVE && slot < 0) || slot > SLOT_LAST) + luaL_argerror(state, index, ("Invalid ActiveSlot " + std::to_string(slot)).c_str()); + return {(int)slot}; + } +}; + +// An object argument read only when a userdata is passed, as REPENTOGON checks with lua_type, else nullptr. +template +struct LuaOptionalObject +{ + T* value = nullptr; + + static LuaOptionalObject lua_read(lua_State* state, int index) + { + return {lua_type(state, index) == LUA_TUSERDATA ? &lua_get(state, index) : nullptr}; + } +}; + +// Pushes values as an array from 1, each as lua_push pushes it, and returns its one result. +template +int lua_array_push(lua_State* state, const Range& values) +{ + lua_createtable(state, (int)std::size(values), 0); + int index = 1; + for (const auto& value : values) + { + lua_push(state, value); + lua_rawseti(state, -2, index++); + } + return 1; +} + +// A raw C function pushing a member of the object argument 1 holds. +template +int lua_member_get(lua_State* state) +{ + using C = decltype(lua_member_class(Member)); + lua_push(state, lua_get(state, 1).*Member); + return 1; +} + +// A raw C function setting a member of the object argument 1 holds to argument 2, checked as its type. +template +int lua_member_set(lua_State* state) +{ + using C = decltype(lua_member_class(Member)); + using T = decltype(lua_member_type(Member)); + C& object = lua_get(state, 1); + if constexpr (std::is_floating_point_v) object.*Member = (T)luaL_checknumber(state, 2); + else if constexpr (std::is_integral_v && !std::is_same_v) object.*Member = (T)luaL_checkinteger(state, 2); + else object.*Member = lua_get(state, 2); + return 0; +} + +// Adds raw C functions to the class begun last, by name. +template +void lua_functions_add(lua_State* state, const luaL_Reg (&functions)[N]) +{ + for (const luaL_Reg& function : functions) + { + lua_pushcfunction(state, function.func); + lua_table_set(state, -2, function.name); + } +} + +// Ends a class REPENTOGON adds through RegisterNewClass: a metatable its objects get, with no global. +inline void lua_class_hidden_end(lua_State* state) +{ + lua_pop(state, 2); +} + +// Ends a namespace REPENTOGON makes as a plain global table (lua_newtable, then lua_setglobal): its functions stay, the +// class fields and metatable go, so scripts may add to it. +inline void lua_namespace_plain_end(lua_State* state) +{ + lua_getfield(state, -1, "__name"); + std::string name = lua_tostring(state, -1); + lua_pop(state, 2); + for (const char* field : {"__index", "__newindex", "__propget", "__propset", "__name"}) + { + lua_pushnil(state); + lua_table_set(state, -2, field); + } + lua_pushnil(state); + lua_setmetatable(state, -2); + lua_setglobal(state, name.c_str()); +} diff --git a/src/repentogon/api_console.cpp b/src/repentogon/api_console.cpp new file mode 100644 index 0000000..99f503d --- /dev/null +++ b/src/repentogon/api_console.cpp @@ -0,0 +1,439 @@ +#include "repentogon/api_game.h" +#include "engine/platform.h" +#include "game/game.h" +#include "repentogon/api.h" +#include "repentogon/repentogon.h" +#include "ui/console.h" +#ifdef ISAAC_OVERLAY +#include "ui/overlay/overlay.h" +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include + +constexpr const char* CHANGELOG_FILE = "rgon_changelog.txt"; +constexpr const char* CHANGELOG_MISSING = "Changelog unavailable :(\n"; +constexpr const char* MOD_DATA_EXTENSION = ".dat"; +constexpr float DEGREES_HALF_TURN = 180; +// Isaac.ShowErrorDialog's Windows flags: the icon and button masks, and the error icon and OK button it defaults to. +constexpr int DIALOG_ICON_MASK = 0xf0; +constexpr int DIALOG_BUTTONS_MASK = 0xf; +constexpr int DIALOG_ICON_ERROR = 0x10; +constexpr int DIALOG_ICON_WARNING = 0x30; +constexpr int DIALOG_BUTTONS_OK = 0; + +// A button a dialog offers, by the Windows answer it returns (DialogReturn). +struct DialogButton +{ + const char* text; + int answer; +}; + +// The buttons of each DialogButtons set, the escape answer first. +const std::vector DIALOG_BUTTONS[] = {{{"OK", 1}}, + {{"Cancel", 2}, {"OK", 1}}, + {{"Ignore", 5}, {"Abort", 3}, {"Retry", 4}}, + {{"Cancel", 2}, {"Yes", 6}, {"No", 7}}, + {{"No", 7}, {"Yes", 6}}, + {{"Cancel", 2}, {"Retry", 4}}, + {{"Cancel", 2}, {"Try Again", 10}, {"Continue", 11}}}; + +// A console command a mod registered (ConsoleMega's ConsoleCommand): its name, short description and help text, +// whether it shows outside a run, and what its argument completes from. +struct ModConsoleCommand +{ + std::string description; + std::string helpText; + std::string name; + int autocompleteType = 0; + bool isShownOnMenu = false; +}; + +// A macro a mod registered: its name and the commands it runs in order. +struct ModConsoleMacro +{ + std::string name; + std::vector commands; +}; + +static std::deque modCommands; +static std::deque modMacros; + +// Adds the mods' commands to the console's command names. +void console_command_names_add(std::vector& names) +{ + for (ModConsoleCommand& command : modCommands) names.push_back(command.name); +} + +// Adds the mods' macros to the console's macro names. +void console_macro_names_add(std::vector& names) +{ + for (ModConsoleMacro& macro : modMacros) names.push_back(macro.name); +} + +// The commands of the first macro a mod registered by a name, null for none. +const std::vector* console_macro_find(std::string_view name) +{ + auto macro = std::ranges::find(modMacros, name, &ModConsoleMacro::name); + return macro == modMacros.end() ? nullptr : ¯o->commands; +} + +// Console.RegisterMacro(name, commands): the table's strings up to its first nil. +static int console_macro_register(lua_State* state) +{ + ModConsoleMacro macro = {.name = luaL_checkstring(state, 1)}; + if (!lua_istable(state, 2)) + { + std::string error = std::string("Expected a table of strings, got ") + lua_typename(state, lua_type(state, 2)); + return luaL_argerror(state, 2, error.c_str()); + } + lua_Integer length = (lua_Integer)lua_rawlen(state, 2); + for (lua_Integer index = 1; index <= length; index++) + { + lua_geti(state, 2, index); + if (lua_isnil(state, -1)) break; + macro.commands.push_back(luaL_checkstring(state, -1)); + lua_pop(state, 1); + } + modMacros.push_back(std::move(macro)); + return 0; +} + +// (LuaConsole.cpp) Registers REPENTOGON's Console: printing warnings and errors, the output and the commands run, +// and the mods' commands and macros. +static void console_register(lua_State* state) +{ + lua_namespace_begin(state, "Console"); + lua_method(state, "PrintError", [](std::string_view error) { g_game->console.PrintError(error); }); + lua_functions_add(state, {{"GetCommandHistory", + [](lua_State* s) { + std::deque& commands = g_game->console.commandHistory; + return lua_array_push(s, std::vector(commands.rbegin(), commands.rend())); + }}, + {"GetHistory", + [](lua_State* s) { + std::vector lines; + for (ConsoleLine& line : g_game->console.history) lines.push_back(line.text); + return lua_array_push(s, lines); + }}, + {"RegisterMacro", console_macro_register}}); + lua_method(state, "PopHistory", [](LuaDefault amount) { + std::deque& history = g_game->console.history; + for (int line = 0; line < amount.value + 1 && !history.empty(); line++) history.pop_front(); + }); + lua_method(state, "PrintWarning", [](std::string_view warning) { + g_game->console.Print(std::string(warning) + "\n", CONSOLE_WARNING, CONSOLE_FADE_FRAMES); + }); + lua_functions_add(state, {{"RegisterCommand", [](lua_State* s) { + std::string name = luaL_checkstring(s, 1); + std::string description = luaL_checkstring(s, 2); + std::string helpText = luaL_checkstring(s, 3); + bool isShownOnMenu = lua_get>(s, 4).value; + modCommands.push_back({description, helpText, name, (int)luaL_optnumber(s, 5, 0), + isShownOnMenu}); + return 0; + }}}); + lua_namespace_plain_end(state); +} + +// Debug.GetSignature(address): the original's code a signature would be made from. The rebuild maps none of it, so +// every valid address reads as unmapped. +static int signature_get(lua_State* state) +{ + lua_Integer address = luaL_checkinteger(state, 1); + if (address < 0) return luaL_error(state, "GetSignature: Invalid address %d\n", address); + return luaL_error(state, "GetSignature: address %d is not mapped in memory\n", address); +} + +// Debug.ListLoadedFiles: the names of package.loaded. +static int loaded_files_list(lua_State* state) +{ + lua_settop(state, 0); + lua_newtable(state); + lua_getfield(state, LUA_REGISTRYINDEX, LUA_LOADED_TABLE); + int index = 1; + lua_pushnil(state); + while (lua_next(state, 2)) + { + lua_pushvalue(state, -2); + lua_rawseti(state, 1, index++); + lua_pop(state, 1); + } + lua_pop(state, 1); + return 1; +} + +// Debug.ForceUnload(prefix): drops every loaded module whose name, slashes read as dots, starts with the prefix, and +// lists them. +static int modules_force_unload(lua_State* state) +{ + std::string prefix = luaL_checkstring(state, 1); + std::vector modules; + lua_settop(state, 0); + lua_newtable(state); + lua_getfield(state, LUA_REGISTRYINDEX, LUA_LOADED_TABLE); + lua_pushnil(state); + while (lua_next(state, 2)) + { + std::string name = lua_type(state, -2) == LUA_TSTRING ? lua_tostring(state, -2) : ""; + std::ranges::replace(name, '/', '.'); + modules.push_back(name); + lua_pop(state, 1); + } + + int index = 1; + for (std::string& module : modules) + { + if (!module.starts_with(prefix)) continue; + lua_pushnil(state); + lua_setfield(state, 2, module.c_str()); + lua_pushstring(state, module.c_str()); + lua_rawseti(state, 1, index++); + } + lua_pop(state, 1); + return 1; +} + +// DumpRegistry: a copy of the registry. +static int registry_dump(lua_State* state) +{ + lua_newtable(state); + lua_pushnil(state); + while (lua_next(state, LUA_REGISTRYINDEX)) + { + lua_pushvalue(state, -2); + lua_pushvalue(state, -2); + lua_rawset(state, -5); + lua_pop(state, 1); + } + return 1; +} + +// ExtractFunctions: each class's C functions from 0, as {type = name, functions = {name = address}}, read off the +// metatables in the registry. +static int functions_extract(lua_State* state) +{ + lua_newtable(state); + int index = 0; + lua_pushnil(state); + while (lua_next(state, LUA_REGISTRYINDEX)) + { + if (lua_type(state, -2) != LUA_TLIGHTUSERDATA || !lua_istable(state, -1)) + { + lua_pop(state, 1); + continue; + } + lua_pushliteral(state, "__name"); + if (lua_rawget(state, -2) != LUA_TSTRING) + { + lua_pop(state, 2); + continue; + } + + lua_newtable(state); + lua_insert(state, -2); + lua_setfield(state, -2, "type"); + lua_newtable(state); + lua_pushnil(state); + while (lua_next(state, -4)) + { + bool isNamed = lua_type(state, -2) == LUA_TSTRING && lua_tostring(state, -2)[0] != '_'; + if (isNamed && lua_iscfunction(state, -1) && lua_getupvalue(state, -1, 1)) + { + if (lua_type(state, -1) == LUA_TUSERDATA) + { + lua_pushvalue(state, -3); + lua_pushlightuserdata(state, *(void**)lua_touserdata(state, -2)); + lua_rawset(state, -6); + } + lua_pop(state, 1); + } + lua_pop(state, 1); + } + lua_setfield(state, -2, "functions"); + lua_rawseti(state, -4, index++); + lua_pop(state, 1); + } + return 1; +} + +// RandomFloat: a float between -1 and 1 from a generator of its own. +static int random_float_get(lua_State* state) +{ + static std::mt19937 generator(std::random_device{}()); + lua_pushnumber(state, std::uniform_real_distribution(-1, 1)(generator)); + return 1; +} + +// The file a mod's data of a name is in: its folder in the mods' save folder. +static std::filesystem::path mod_data_path(LuaMod& mod, std::string_view fileName) +{ + return std::filesystem::path(mod.directory) / fileName; +} + +// _CBindings' mod data functions: the mod table at argument 1, the file name at 2, a .dat name with no characters +// a file name cannot hold when IsNameChecked. +template +static std::filesystem::path mod_data_argument_path(lua_State* state) +{ + if (!lua_istable(state, 1)) luaL_argerror(state, 1, "Expected a table."); + LuaMod* mod = repentogon_mod_find(state, 1); + if (!mod) luaL_argerror(state, 1, "Invalid ModReference."); + std::string_view fileName = lua_get(state, 2); + + static const std::regex VALID_NAME(R"re([^\x00-\x1F"*/:<>?\\|]+)re"); + if (IsNameChecked && !std::regex_match(fileName.begin(), fileName.end(), VALID_NAME)) + luaL_argerror(state, 2, "invalid filename"); + if (IsNameChecked && std::filesystem::path(fileName).extension() != MOD_DATA_EXTENSION) + luaL_argerror(state, 2, "filename must be a .dat file"); + return mod_data_path(*mod, fileName); +} + +// Whether a mod's data file exists. +template +static int mod_data_has(lua_State* state) +{ + std::error_code error; + lua_pushboolean(state, std::filesystem::exists(mod_data_argument_path(state), error)); + return 1; +} + +// Writes a mod's data file, its folder made first. Whether it was written. +template +static int mod_data_save(lua_State* state) +{ + std::filesystem::path path = mod_data_argument_path(state); + std::string_view data = lua_get(state, 3); + std::error_code error; + std::filesystem::create_directories(path.parent_path(), error); + std::ofstream file(path, std::ios::binary); + if (!file) log_printf(LOG_INFO, "[ERROR] [ModManager] - unable to open file for writing at \"%s\"\n", path.c_str()); + file.write(data.data(), (std::streamsize)data.size()); + lua_pushboolean(state, (bool)file); + return 1; +} + +// A mod's data file whole, nil when it does not exist. +template +static int mod_data_load(lua_State* state) +{ + std::filesystem::path path = mod_data_argument_path(state); + std::error_code error; + std::ifstream file(path, std::ios::binary); + std::stringstream data; + data << file.rdbuf(); + if (std::filesystem::exists(path, error) && file.is_open()) lua_push(state, data.str()); + else lua_pushnil(state); + return 1; +} + +// Deletes a mod's data file. +template +static int mod_data_remove(lua_State* state) +{ + std::error_code error; + std::filesystem::remove(mod_data_argument_path(state), error); + return 0; +} + +// RemoveAllData(file name): deletes the file from every mod's save folder. +static int mod_data_remove_all(lua_State* state) +{ + std::string_view fileName = lua_get(state, 1); + std::error_code error; + for (auto& entry : std::filesystem::directory_iterator(platform.modsSaveDirectory, error)) + { + std::error_code entryError; + if (entry.is_directory(entryError)) std::filesystem::remove(entry.path() / fileName, entryError); + } + return 0; +} + +// (_Internals.cpp) Adds the internals REPENTOGON's main_ex.lua takes from _CBindings over the mods' data files: with the +// file names Lua may pass checked (ModReference_*), and without. +void internals_mod_data_register(lua_State* state) +{ + lua_functions_add(state, {{"HasModData", mod_data_has}, + {"SaveModData", mod_data_save}, + {"LoadModData", mod_data_load}, + {"RemoveModData", mod_data_remove}, + {"RemoveAllData", mod_data_remove_all}, + {"ModReference_HasModFile", mod_data_has}, + {"ModReference_SaveModFile", mod_data_save}, + {"ModReference_LoadModFile", mod_data_load}, + {"ModReference_RemoveModFile", mod_data_remove}}); +} + +// Isaac.ShowErrorDialog(title, text, icon = error, buttons = OK): a message box with Windows' icon and button flags, +// answering as Windows does (DialogReturn), the escape button's answer when closed. +static int error_dialog_show(lua_State* state) +{ + const char* title = luaL_checkstring(state, 1); + const char* text = luaL_checkstring(state, 2); + int icon = (int)luaL_optinteger(state, 3, DIALOG_ICON_ERROR) & DIALOG_ICON_MASK; + int buttonSet = (int)luaL_optinteger(state, 4, DIALOG_BUTTONS_OK) & DIALOG_BUTTONS_MASK; + const std::vector& buttons = DIALOG_BUTTONS[std::min(buttonSet, (int)std::size(DIALOG_BUTTONS) - 1)]; + + std::vector data; + for (const DialogButton& button : buttons) + data.push_back({.flags = &button == &buttons.front() ? SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT : 0u, + .buttonID = button.answer, + .text = button.text}); + SDL_MessageBoxFlags flags = icon == DIALOG_ICON_ERROR ? SDL_MESSAGEBOX_ERROR + : icon == DIALOG_ICON_WARNING ? SDL_MESSAGEBOX_WARNING + : SDL_MESSAGEBOX_INFORMATION; + SDL_MessageBoxData box = {.flags = flags | SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT, + .window = platform.window, + .title = title, + .message = text, + .numbuttons = (int)data.size(), + .buttons = data.data()}; + int answer = -1; + SDL_ShowMessageBox(&box, &answer); + lua_pushinteger(state, answer >= 0 ? answer : buttons.front().answer); + return 1; +} + +// (LuaIsaac.cpp, LuaImGui.cpp) Adds REPENTOGON's Isaac functions over the console and the user: an error dialog, +// REPENTOGON's changelog from the game's folder, and opening the overlay. +void isaac_console_register(lua_State* state) +{ + lua_functions_add(state, {{"ShowErrorDialog", error_dialog_show}}); + lua_method(state, "RGON_GetChangelog", []() { + std::ifstream file(CHANGELOG_FILE); + std::stringstream text; + text << file.rdbuf(); + return file.is_open() ? text.str() : std::string(CHANGELOG_MISSING); + }); + lua_method(state, "OpenConsole", []() { +#ifdef ISAAC_OVERLAY + if (overlay.is_ready()) overlay.visible_set(true); +#endif + }); +} + +// (LuaConsole.cpp, LuaDebug.cpp, LuaInit.cpp) Registers REPENTOGON's Console and Debug, and its global functions. +void console_classes_register(lua_State* state) +{ + console_register(state); + + lua_namespace_begin(state, "Debug"); + lua_functions_add(state, {{"GetSignature", signature_get}, + {"ListLoadedFiles", loaded_files_list}, + {"ForceUnload", modules_force_unload}}); + lua_namespace_plain_end(state); + + lua_pushglobaltable(state); + lua_functions_add(state, {{"DumpRegistry", registry_dump}, + {"ExtractFunctions", functions_extract}, + {"RandomFloat", random_float_get}}); + lua_method(state, "ToRadians", [](float angle) { return angle * std::numbers::pi / DEGREES_HALF_TURN; }); + lua_method(state, "ToDegrees", [](float angle) { return angle * DEGREES_HALF_TURN / std::numbers::pi; }); + lua_pop(state, 1); +} diff --git a/src/repentogon/api_entities.cpp b/src/repentogon/api_entities.cpp new file mode 100644 index 0000000..3d73501 --- /dev/null +++ b/src/repentogon/api_entities.cpp @@ -0,0 +1,1059 @@ +#include "entity/boss/ai.h" +#include "entity/config.h" +#include "entity/effect/effect.h" +#include "entity/npc/npc.h" +#include "entity/pickup/loot_list.h" +#include "entity/pickup/pickup.h" +#include "entity/player/player.h" +#include "entity/save_state.h" +#include "entity/weapon/laser.h" +#include "entity/weapon/weapon.h" +#include "game/debug_renderer.h" +#include "game/game.h" +#include "game/manager.h" +#include "level/grid/decoration.h" +#include "level/grid/fire.h" +#include "level/grid/gravity.h" +#include "level/grid/lock.h" +#include "level/grid/stairs.h" +#include "level/grid/statue.h" +#include "level/grid/teleporter.h" +#include "level/grid/trap_door.h" +#include "level/grid/wall.h" +#include "level/grid/web.h" +#include "repentogon/api.h" +#include "repentogon/api_items.h" +#include "repentogon/callbacks.h" +#include "repentogon/entities.h" +#include "repentogon/npc.h" +#include "repentogon/options.h" +#include +#include + +// REPENTOGON's entity classes and functions (LuaInterfaces/Entities/LuaEntity.cpp, LuaEntityEffect.cpp, +// GridEntities/LuaGridEntity*.cpp, LuaCapsule.cpp, LuaShape.cpp, LuaEntityConfig.cpp, LuaEntityDesc.cpp, +// LuaEntitySaveState.cpp and LuaIsaac.cpp's GetEntitySubTypeByName). + +// The entity types an EntityDesc rejects: the ones below the first enemy, and effects and above. +constexpr unsigned int DESC_TYPE_FIRST_REJECTED = 1; +constexpr unsigned int DESC_TYPE_LAST_REJECTED = 9; +constexpr unsigned int DESC_TYPE_END = 1000; +constexpr int CHAMPION_ID_MIN = -1; +constexpr int CHAMPION_ID_MAX = 25; +// The entity types CopyStatusEffects counts as enemies, for the boss cooldown. +constexpr int NPC_TYPE_FIRST = 10; +constexpr int NPC_TYPE_END = 1000; +constexpr float BLOOD_EFFECT_DEPTH = -10; +constexpr int LIGHT_STATE_DEFAULT = 6; +// The saved entities whose first storage holds a float's bits: bombs, fireplaces and movable TNT. +constexpr std::array SAVE_STATE_FLOAT_TYPES = {ENTITY_BOMB, ENTITY_FIREPLACE, ENTITY_MOVABLE_TNT}; +// The effects whose varData holds tear flags: Aquarius creep, Brimstone balls, Technology dots and chain lightning. +constexpr std::array TEAR_FLAG_EFFECTS = {EFFECT_PLAYER_CREEP_HOLYWATER_TRAIL, EFFECT_BRIMSTONE_BALL, EFFECT_TECH_DOT, + EFFECT_CHAIN_LIGHTNING}; +constexpr uint64_t STATUS_EFFECT_FLAGS = FLAG_FREEZE | FLAG_POISON | FLAG_SLOW | FLAG_CHARM | FLAG_CONFUSION | + FLAG_MIDAS_FREEZE | FLAG_FEAR | FLAG_BURN | FLAG_SHRINK | FLAG_FRIENDLY | + FLAG_BLEED_OUT | FLAG_ICE_FROZEN | FLAG_ICE | FLAG_MAGNETIZED | FLAG_BAITED | + FLAG_WEAKNESS | FLAG_BRIMSTONE_MARKED; +// The flags an overwriting status copy keeps on its target: REPENTOGON's FLAG_NON_STATUS_EFFECTS, the first 60 others. +constexpr int ENTITY_FLAG_COUNT = 60; +constexpr uint64_t NON_STATUS_EFFECT_FLAGS = ((1ull << ENTITY_FLAG_COUNT) - 1) & ~STATUS_EFFECT_FLAGS; +constexpr int VAR_DATA_WORD_BITS = 32; + +// The countdowns a status copy carries over, and its amounts: the poison and burn damage and the shrink. +constexpr std::array STATUS_COUNTDOWNS = { + &Entity::freezeCountdown, &Entity::poisonCountdown, &Entity::slowingCountdown, + &Entity::charmedCountdown, &Entity::confusionCountdown, &Entity::midasFreezeCountdown, + &Entity::fearCountdown, &Entity::burnCountdown, &Entity::bleedingCountdown, + &Entity::shrinkCountdown, &Entity::magnetizedCountdown, &Entity::baitedCountdown, + &Entity::knockbackCountdown, &Entity::iceCountdown, &Entity::weaknessCountdown, + &Entity::brimstoneMarkCountdown}; +constexpr std::array STATUS_AMOUNTS = {&Entity::poisonTickDamage, &Entity::burnTickDamage, &Entity::shrinkStatus1, + &Entity::shrinkStatus2}; + +// The tear flags an effect's varData holds, low word first. +static TearFlags var_data_flags_get(const Entity_Effect& effect) +{ + TearFlags flags; + for (int word = (int)effect.varData.size() - 1; word >= 0; word--) + flags = flags << VAR_DATA_WORD_BITS | TearFlags(effect.varData[word]); + return flags; +} + +static void var_data_flags_set(Entity_Effect& effect, TearFlags flags) +{ + for (uint32_t& word : effect.varData) + { + word = (uint32_t)(flags & TearFlags(UINT32_MAX)).to_ulong(); + flags >>= VAR_DATA_WORD_BITS; + } +} + +// Whether an effect's varData holds tear flags. +static bool is_tear_flag_effect(const Entity_Effect& effect) +{ + return std::ranges::find(TEAR_FLAG_EFFECTS, effect.variant) != TEAR_FLAG_EFFECTS.end(); +} + +// A timed color the status copy shares: one at the top priority that does not fade. +static bool is_shared_color(const ColorParams& params) +{ + return params.priority == COLOR_PRIORITY_DEFAULT && !params.isFadeout && params.isShared; +} + +// (LuaEntity.cpp's CopyStatusEffects) Copies one entity's status effects onto another. An overwrite replaces the +// target's statuses and shared colors, else the source's non-zero countdowns win and the flags that differ are added. +// The boss cooldown follows when the source is an enemy and the target a boss, and the source's shared colors are +// added either way. +static void status_effects_copy(Entity& source, Entity& target, bool isOverwrite) +{ + auto pick = [&](auto value, auto kept) { return isOverwrite || value != 0 ? value : kept; }; + if (isOverwrite) target.flags = (target.flags & NON_STATUS_EFFECT_FLAGS) | (source.flags & STATUS_EFFECT_FLAGS); + else target.flags |= source.flags ^ target.flags; + + for (auto countdown : STATUS_COUNTDOWNS) target.*countdown = pick(source.*countdown, target.*countdown); + for (auto amount : STATUS_AMOUNTS) target.*amount = pick(source.*amount, target.*amount); + bool isPushed = source.knockbackDirection.x != 0 || source.knockbackDirection.y != 0; + if (isOverwrite || isPushed) target.knockbackDirection = source.knockbackDirection; + + Entity_NPC* npc = dynamic_cast(&target); + int cooldown = std::max(source.bossStatusEffectCooldown, target.bossStatusEffectCooldown); + if (source.type >= NPC_TYPE_FIRST && source.type < NPC_TYPE_END && npc && npc->isBoss) + target.bossStatusEffectCooldown = isOverwrite ? source.bossStatusEffectCooldown : cooldown; + + if (isOverwrite) + for (ColorParams& params : target.colorParams) + if (is_shared_color(params)) params.remaining = 1; + for (ColorParams& params : source.colorParams) + if (is_shared_color(params)) target.colorParams.push_back(params); +} + +// Entity:CopyStatusEffects: onto an entity, or onto every child down the chain for nil. +static int status_effects_copy_run(lua_State* state) +{ + Entity& source = lua_get(state, 1); + bool isOverwrite = lua_get>(state, 3).value; + if (!lua_isnil(state, 2)) status_effects_copy(source, lua_get(state, 2), isOverwrite); + else + for (Entity* child = source.child; child; child = child->child) + status_effects_copy(source, *child, isOverwrite); + return 0; +} + +// Entity:GetMinecart: an NPC, or a plain Entity for anything else. +static int minecart_get(lua_State* state) +{ + Entity* minecart = lua_get(state, 1).minecart; + if (Entity_NPC* npc = dynamic_cast(minecart)) lua_push(state, npc); + else lua_push(state, minecart); + return 1; +} + +// Entity:GiveMinecart, which takes exactly a position and a velocity. +static int minecart_give(lua_State* state) +{ + if (int count = lua_gettop(state); count != 3) + return luaL_error(state, "Expected two parameters, got %d\n", count - 1); + + Entity& entity = lua_get(state, 1); + lua_push(state, entity.GiveMinecart(lua_get(state, 2), lua_get(state, 3))); + return 1; +} + +// A Vector argument that may be left out or be anything else, read only when it is a userdata. +static Vector vector_optional_get(lua_State* state, int index, Vector fallback) +{ + return lua_type(state, index) == LUA_TUSERDATA ? lua_get(state, index) : fallback; +} + +static ColorMod color_optional_get(lua_State* state, int index) +{ + return lua_type(state, index) == LUA_TUSERDATA ? lua_get(state, index) : COLOR_DEFAULT; +} + +// Entity:SpawnBloodEffect: a blood explosion of a subtype at a position, with an offset, color and velocity. +static int blood_effect_spawn(lua_State* state) +{ + Entity& entity = lua_get(state, 1); + int subtype = (int)luaL_optinteger(state, 2, 0); + Vector position = vector_optional_get(state, 3, entity.pos); + Vector offset = vector_optional_get(state, 4, {}); + ColorMod color = color_optional_get(state, 5); + Vector velocity = vector_optional_get(state, 6, {}); + + Entity* effect = g_game->Spawn({.position = position, + .velocity = velocity, + .subType = subtype, + .type = ENTITY_EFFECT, + .variant = EFFECT_BLOOD_EXPLOSION, + .seed = Random()}); + effect->SetColor(color, -1, COLOR_PRIORITY_DEFAULT, false, true); + effect->sprite.offset = offset; + effect->renderDepthOffset = BLOOD_EFFECT_DEPTH; + lua_push(state, static_cast(effect)); + return 1; +} + +// Entity:MakeBloodPoof and MakeGroundPoof: at a position (its own by default), a color and a scale. +template +static int poof_make(lua_State* state) +{ + Entity& entity = lua_get(state, 1); + Vector position = vector_optional_get(state, 2, entity.pos); + ColorMod color = color_optional_get(state, 3); + float scale = (float)luaL_optnumber(state, 4, 1); + lua_push(state, (entity.*Poof)(position, color, scale)); + return 1; +} + +// Entity:SpawnWaterImpactEffects: water drops thrown from a spot in a flooded room. +static int water_impact_spawn(lua_State* state) +{ + lua_get(state, 1); + Vector position = lua_get(state, 2); + Vector velocity = vector_optional_get(state, 3, {}); + water_drops_spawn(position, velocity, (float)luaL_checknumber(state, 4)); + return 0; +} + +// Entity:ForceCollide: a laser among the two deals its damage first, unless PRE_LASER_COLLISION skips it. +static bool entities_force_collide(Entity& first, Entity& second, LuaCheckedBool isLow) +{ + for (auto [laser, other] : {std::pair{&first, &second}, {&second, &first}}) + { + if (laser->type != ENTITY_LASER) continue; + + Entity_Laser& shot = *static_cast(laser); + if (shot.CanDamageEntity(other) && + !boolean_run({"PreLaserCollision", MC_PRE_LASER_COLLISION, shot.variant}, false, &shot, other)) + shot.DoDamage(other, shot.collisionDamage); + } + return Entity::ForceCollide(&first, &second, isLow.value); +} + +// Entity:GetColorParams, copies of its timed colors. +static int color_params_get(lua_State* state) +{ + Entity& entity = lua_get(state, 1); + lua_newtable(state); + for (size_t i = 0; i < entity.colorParams.size(); i++) + { + lua_push(state, entity.colorParams[i]); + lua_rawseti(state, -2, (lua_Integer)i + 1); + } + return 1; +} + +// Entity:SetColorParams, its timed colors replaced by a table's. +static int color_params_set(lua_State* state) +{ + Entity& entity = lua_get(state, 1); + if (!lua_istable(state, 2)) return luaL_argerror(state, 2, "Expected a table as second argument"); + + std::vector list; + for (lua_Integer i = 1; i <= (lua_Integer)lua_rawlen(state, 2); i++) + { + lua_rawgeti(state, 2, i); + list.push_back(lua_get(state, -1)); + lua_pop(state, 1); + } + entity.colorParams = std::move(list); + return 0; +} + +// Returns argument 1 as REPENTOGON's casts do: the same object, its class changed in place. +static int object_class_set(lua_State* state, LuaClass luaClass) +{ + lua_rawgetp(state, LUA_REGISTRYINDEX, lua_class_key(luaClass)); + lua_setmetatable(state, 1); + lua_settop(state, 1); + return 1; +} + +// Entity:ToSlot, nil for anything but a slot. +static int slot_cast(lua_State* state) +{ + if (lua_get(state, 1).type != ENTITY_SLOT) return lua_pushnil(state), 1; + return object_class_set(state, LUA_CLASS_ENTITY_SLOT); +} + +// Entity:ToDelirium: Delirium, or an enemy that is one of his forms, else nil. +static int delirium_cast(lua_State* state) +{ + auto* entity = (Entity*)lua_object_test(state, 1, LUA_CLASS_ENTITY); + if (!entity) + return luaL_argerror(state, 1, (std::string("EntityNPC expected, got ") + luaL_typename(state, 1)).c_str()); + + Entity_NPC* npc = dynamic_cast(entity); + bool isForm = + npc && npc->deliriumBossType == (uint32_t)npc->type && npc->deliriumBossVariant == (uint32_t)npc->variant; + if (entity->type != ENTITY_DELIRIUM && !isForm) return lua_pushnil(state), 1; + return object_class_set(state, LUA_CLASS_ENTITY_DELIRIUM); +} + +// Entity:GetCollisionCapsule, moved by an offset when one is given. +static int collision_capsule_get(lua_State* state) +{ + Entity& entity = lua_get(state, 1); + lua_push(state, entity.GetCollisionCapsule(vector_optional_get(state, 2, {}))); + return 1; +} + +// Adds REPENTOGON's functions to Entity, begun last. Its status effect sources are checked EntityRefs, its own +// Variant setter clears an effect's varData unless vanilla parity is on, and IgnoreEffectFromFriendly returns +// nothing, as REPENTOGON's does. +void entity_api_register(lua_State* state) +{ + lua_functions_add(state, { + {"GetCollisionCapsule", collision_capsule_get}, + {"GetColorParams", color_params_get}, + {"SetColorParams", color_params_set}, + {"ToSlot", slot_cast}, + {"ToDelirium", delirium_cast}, + {"GetShadowSize", lua_member_get<&Entity::shadowSize>}, + {"SetShadowSize", lua_member_set<&Entity::shadowSize>}, + {"CopyStatusEffects", status_effects_copy_run}, + {"GetBossStatusEffectCooldown", lua_member_get<&Entity::bossStatusEffectCooldown>}, + {"SetBossStatusEffectCooldown", lua_member_set<&Entity::bossStatusEffectCooldown>}, + {"GiveMinecart", minecart_give}, + {"GetMinecart", minecart_get}, + {"MakeBloodPoof", poof_make<&Entity::MakeBloodPoof>}, + {"MakeGroundPoof", poof_make<&Entity::MakeGroundPoof>}, + {"GetPauseTime", lua_member_get<&Entity::pauseTimer>}, + {"SetPauseTime", lua_member_set<&Entity::pauseTimer>}, + {"GetSpeedMultiplier", lua_member_get<&Entity::speedMultiplier>}, + {"SetSpeedMultiplier", lua_member_set<&Entity::speedMultiplier>}, + {"SpawnBloodEffect", blood_effect_spawn}, + {"SpawnWaterImpactEffects", water_impact_spawn}, + {"GetDamageCountdown", lua_member_get<&Entity::damageCountdown>}, + {"GetFireDamageCooldown", lua_member_get<&Entity::fireDamageCountdown>}, + {"SetFireDamageCooldown", lua_member_set<&Entity::fireDamageCountdown>}, + {"GetFreezeCountdown", lua_member_get<&Entity::freezeCountdown>}, + {"SetFreezeCountdown", lua_member_set<&Entity::freezeCountdown>}, + {"GetPoisonCountdown", lua_member_get<&Entity::poisonCountdown>}, + {"SetPoisonCountdown", lua_member_set<&Entity::poisonCountdown>}, + {"GetSlowingCountdown", lua_member_get<&Entity::slowingCountdown>}, + {"SetSlowingCountdown", lua_member_set<&Entity::slowingCountdown>}, + {"GetCharmedCountdown", lua_member_get<&Entity::charmedCountdown>}, + {"SetCharmedCountdown", lua_member_set<&Entity::charmedCountdown>}, + {"GetConfusionCountdown", lua_member_get<&Entity::confusionCountdown>}, + {"SetConfusionCountdown", lua_member_set<&Entity::confusionCountdown>}, + {"GetMidasFreezeCountdown", lua_member_get<&Entity::midasFreezeCountdown>}, + {"SetMidasFreezeCountdown", lua_member_set<&Entity::midasFreezeCountdown>}, + {"GetFearCountdown", lua_member_get<&Entity::fearCountdown>}, + {"SetFearCountdown", lua_member_set<&Entity::fearCountdown>}, + {"GetBurnCountdown", lua_member_get<&Entity::burnCountdown>}, + {"SetBurnCountdown", lua_member_set<&Entity::burnCountdown>}, + {"GetShrinkCountdown", lua_member_get<&Entity::shrinkCountdown>}, + {"SetShrinkCountdown", lua_member_set<&Entity::shrinkCountdown>}, + {"GetBleedingCountdown", lua_member_get<&Entity::bleedingCountdown>}, + {"SetBleedingCountdown", lua_member_set<&Entity::bleedingCountdown>}, + {"GetMagnetizedCountdown", lua_member_get<&Entity::magnetizedCountdown>}, + {"SetMagnetizedCountdown", lua_member_set<&Entity::magnetizedCountdown>}, + {"GetBaitedCountdown", lua_member_get<&Entity::baitedCountdown>}, + {"SetBaitedCountdown", lua_member_set<&Entity::baitedCountdown>}, + {"GetKnockbackCountdown", lua_member_get<&Entity::knockbackCountdown>}, + {"SetKnockbackCountdown", lua_member_set<&Entity::knockbackCountdown>}, + {"GetWeaknessCountdown", lua_member_get<&Entity::weaknessCountdown>}, + {"SetWeaknessCountdown", lua_member_set<&Entity::weaknessCountdown>}, + {"GetIceCountdown", lua_member_get<&Entity::iceCountdown>}, + {"SetIceCountdown", lua_member_set<&Entity::iceCountdown>}, + {"GetBrimstoneMarkCountdown", lua_member_get<&Entity::brimstoneMarkCountdown>}, + {"SetBrimstoneMarkCountdown", lua_member_set<&Entity::brimstoneMarkCountdown>}, + {"GetPoisonDamageTimer", lua_member_get<&Entity::poisonDamageTimer>}, + {"SetPoisonDamageTimer", lua_member_set<&Entity::poisonDamageTimer>}, + {"GetBurnDamageTimer", lua_member_get<&Entity::burnDamageTimer>}, + {"SetBurnDamageTimer", lua_member_set<&Entity::burnDamageTimer>}, + {"GetPoisonDamage", lua_member_get<&Entity::poisonTickDamage>}, + {"SetPoisonDamage", lua_member_set<&Entity::poisonTickDamage>}, + {"GetBurnDamage", lua_member_get<&Entity::burnTickDamage>}, + {"SetBurnDamage", lua_member_set<&Entity::burnTickDamage>}, + {"GetKnockbackDirection", lua_member_get<&Entity::knockbackDirection>}, + {"SetKnockbackDirection", lua_member_set<&Entity::knockbackDirection>}, + }); + lua_method(state, "AddBleeding", [](Entity& entity, const EntityRef& source, int duration) { + entity.AddBleeding(source, duration); + }); + lua_method(state, "AddMagnetized", [](Entity& entity, const EntityRef& source, int duration) { + entity.AddMagnetized(source, duration); + }); + lua_method(state, "AddBaited", + [](Entity& entity, const EntityRef& source, int duration) { entity.AddBaited(source, duration); }); + lua_method(state, "AddWeakness", + [](Entity& entity, const EntityRef& source, int duration) { entity.AddWeakness(source, duration); }); + lua_method(state, "AddBrimstoneMark", [](Entity& entity, const EntityRef& source, int duration) { + entity.AddBrimstoneMark(source, duration); + }); + lua_method(state, "AddIce", + [](Entity& entity, const EntityRef& source, int duration) { entity.AddIce(source, duration); }); + lua_method(state, "AddKnockback", + [](Entity& entity, const EntityRef& source, Vector& push, int duration, LuaCheckedBool isImpact) { + entity.AddKnockback(source, push, duration, isImpact.value); + }); + lua_method(state, "ComputeStatusEffectDuration", [](Entity& entity, int initial, const EntityRef& source) { + return (uint32_t)entity.apply_second_hand_duration(std::max(initial, 0), source); + }); + lua_method(state, "IgnoreEffectFromFriendly", + [](Entity& entity, const EntityRef& source) { entity.IsDamageSourceFriendly(source); }); + lua_method(state, "GetNullOffset", + [](Entity& entity, std::string_view layer) { return entity.GetNullOffset(layer); }); + lua_method(state, "GetPredictedTargetPosition", [](Entity& entity, Entity& target, float delay) { + float distance = vector_length(vector_sub(target.pos, entity.pos)) * delay; + return vector_add(target.pos, vector_scale(target.velocity, distance)); + }); + lua_method(state, "GetType", [](Entity& entity) { return entity.type; }); + lua_method(state, "GetPosVel", [](Entity& entity) { return PosVel{entity.pos, entity.velocity}; }); + lua_method(state, "ForceCollide", entities_force_collide); + lua_method(state, "SetDead", [](Entity& entity, LuaCheckedBool isDead) { entity.isDead = isDead.value; }); + lua_method(state, "SetInvincible", + [](Entity& entity, LuaCheckedBool isInvincible) { entity.isInvincible = isInvincible.value; }); + lua_method(state, "GetHitListIndex", [](Entity& entity) { return entity.GetHitListIndex(); }); + lua_method(state, "TryThrow", [](Entity& entity, const EntityRef& source, Vector& direction, float force) { + return entity.TryThrow(source, direction, force); + }); + lua_method(state, "SetDamageCountdown", + [](Entity& entity, int countdown) { entity.damageCountdown = std::max(countdown, 0); }); + lua_method(state, "GetWaterClipFlags", [](Entity& entity) { return entity.GetWaterClipInfo().flags; }); + lua_method(state, "SetWaterClipFlags", + [](Entity& entity, uint32_t flags) { entity.waterClipFlagsOverride = flags; }); + lua_method(state, "ResetWaterClipFlags", [](Entity& entity) { entity.waterClipFlagsOverride.reset(); }); + lua_method(state, "CanDevolve", [](Entity& entity) { return entity.CanDevolve(); }); + lua_property( + state, "Variant", [](Entity& entity) { return entity.variant; }, + [](Entity& entity, int variant) { + Entity_Effect* effect = dynamic_cast(&entity); + if (effect && !repentogonOptions.isVanillaParity) effect->varData = {}; + entity.variant = variant; + }); + + lua_method(state, "GetNullCapsule", [](Entity& entity, std::string_view layer) { + Capsule capsule; + entity.GetNullCapsule(capsule, layer); + return capsule; + }); + lua_method(state, "GetDebugShape", + [](Entity& entity, LuaCheckedBool isReset) -> Shape& { return entity.GetDebugShape(isReset.value); }); + lua_method(state, "GetEntityConfigEntity", [](Entity& entity) { + return g_manager->entityConfig.GetEntity(entity.type, entity.variant, entity.subtype); + }); +} + +// EntityEffect:GetTearFlags, nil for an effect without them. +static int effect_tear_flags_get(lua_State* state) +{ + Entity_Effect& effect = lua_get(state, 1); + if (is_tear_flag_effect(effect)) lua_push(state, var_data_flags_get(effect)); + else lua_pushnil(state); + return 1; +} + +// EntityEffect.CreateLight: a light at a position, of a scale (random by default), a lifespan (none below 1) and a +// state (6 below 1), with a color. +static int light_create(lua_State* state) +{ + Vector position = lua_get(state, 1); + float scale = (float)luaL_optnumber(state, 2, (float)std::rand() / (float)RAND_MAX); + int lifespan = (int)luaL_optinteger(state, 3, -1); + int lightState = (int)luaL_optinteger(state, 4, LIGHT_STATE_DEFAULT); + ColorMod color = color_optional_get(state, 5); + if (lifespan < 1) lifespan = -1; + if (lightState < 1) lightState = LIGHT_STATE_DEFAULT; + + auto* light = static_cast( + g_game->Spawn({.position = position, .type = ENTITY_EFFECT, .variant = EFFECT_LIGHT, .seed = Random()})); + if (!light) return lua_pushnil(state), 1; + + light->state = lightState; + light->timeout = lifespan; + light->lifespan = lifespan; + light->SetColor(color, -1, COLOR_PRIORITY_DEFAULT, false, false); + light->sprite.scale = vector_scale(light->sprite.scale, scale); + lua_push(state, light); + return 1; +} + +// Adds REPENTOGON's functions to EntityEffect, begun last: the tear flags of the effects that keep them, under their +// new names and the old Aquarius ones, the grid entity a thrown rock carries, and the light and loot preview makers. +void effect_api_register(lua_State* state) +{ + auto flags_set = [](Entity_Effect& effect, TearFlags& flags) { + if (is_tear_flag_effect(effect)) var_data_flags_set(effect, flags); + }; + auto flags_add = [](Entity_Effect& effect, TearFlags& flags) { + if (is_tear_flag_effect(effect)) var_data_flags_set(effect, var_data_flags_get(effect) | flags); + }; + auto flags_clear = [](Entity_Effect& effect, TearFlags& flags) { + if (is_tear_flag_effect(effect)) var_data_flags_set(effect, var_data_flags_get(effect) & ~flags); + }; + auto flags_has = [](Entity_Effect& effect, TearFlags& flags) { + return is_tear_flag_effect(effect) && (var_data_flags_get(effect) & flags).any(); + }; + lua_functions_add(state, { + {"GetTearFlags", effect_tear_flags_get}, + {"GetAquariusTearFlags", effect_tear_flags_get}, + }); + lua_method(state, "SetTearFlags", flags_set); + lua_method(state, "AddTearFlags", flags_add); + lua_method(state, "ClearTearFlags", flags_clear); + lua_method(state, "HasTearFlags", flags_has); + lua_method(state, "SetAquariusTearFlags", flags_set); + lua_method(state, "AddAquariusTearFlags", flags_add); + lua_method(state, "ClearAquariusTearFlags", flags_clear); + lua_method(state, "HasAquariusTearFlags", flags_has); + lua_method(state, "GetGridEntityDesc", [](Entity_Effect& effect) { + return effect.variant == EFFECT_GRID_ENTITY_PROJECTILE_HELPER ? &effect.gridDesc : nullptr; + }); + + lua_pushcfunction(state, light_create); + lua_table_set(state, -3, "CreateLight"); + lua_static(state, "CreateLootPreview", [](LootList& loot, Vector& position, Entity_Pickup& owner, + Entity_Effect& effect) { + return Entity_Effect::CreateLootPreview(&loot, position, &owner, &effect); + }); +} + +// GridEntity:To: the grid entity itself, its class changed in place, when it is of the type, else nil. +template +static int grid_cast(lua_State* state) +{ + if (lua_get(state, 1).type != Type) return lua_pushnil(state), 1; + return object_class_set(state, LUA_CLASS_OF); +} + +// GridEntity:HurtDamage, one entity hurt as the grid entity hurts what touches it. +static void grid_hurt_damage(GridEntity& grid, Entity& entity, int playerDamage, uint64_t damageFlags, + float damage, LuaCheckedBool isIgnoreGridCollision) +{ + grid.hurt_func(entity, {.damageFlags = damageFlags, + .damage = damage, + .playerDamage = playerDamage, + .isIgnoreGridCollisionClass = isIgnoreGridCollision.value}); +} + +// GridEntity:HurtSurroundings, everything near the grid entity hurt. +static void grid_hurt_surroundings(GridEntity& grid, float distance, float playerDistance, float damage, + int playerDamage, uint64_t damageFlags, LuaCheckedBool isIgnoreGridCollision) +{ + grid.hurt_surroundings({.damageFlags = damageFlags, + .damage = damage, + .distance = distance, + .playerDistance = playerDistance, + .playerDamage = playerDamage, + .isIgnoreGridCollisionClass = isIgnoreGridCollision.value}); +} + +// Adds REPENTOGON's functions to GridEntity, begun last. +void grid_entity_api_register(lua_State* state) +{ + lua_functions_add(state, { + {"ToDecoration", grid_cast}, + {"ToFire", grid_cast}, + {"ToGravity", grid_cast}, + {"ToLock", grid_cast}, + {"ToStairs", grid_cast}, + {"ToStatue", grid_cast}, + {"ToTeleporter", grid_cast}, + {"ToTrapDoor", grid_cast}, + {"ToWall", grid_cast}, + {"ToWeb", grid_cast}, + }); + lua_method(state, "HurtDamage", grid_hurt_damage); + lua_method(state, "HurtSurroundings", grid_hurt_surroundings); + lua_method(state, "GetRenderPosition", [](GridEntity& grid) { return grid.get_render_position(); }); + lua_method(state, "IsBreakableRock", [](GridEntity& grid) { return grid.IsBreakableRock(); }); + lua_method(state, "GetWaterClipFlags", [](GridEntity& grid) { return grid.water_clip_get().flags; }); + lua_method(state, "SetWaterClipFlags", + [](GridEntity& grid, uint32_t flags) { grid.waterClipFlagsOverride = flags; }); + lua_method(state, "ResetWaterClipFlags", [](GridEntity& grid) { grid.waterClipFlagsOverride.reset(); }); +} + +// Isaac.GetEntitySubTypeByName: the subtype of the last entity of that name, 0 for none. +void isaac_entities_register(lua_State* state) +{ + lua_method(state, "GetEntitySubTypeByName", [](std::string_view name) { + auto& entities = g_manager->entityConfig.entities; + auto found = std::ranges::find(entities.rbegin(), entities.rend(), name, + [](auto& entry) -> const std::string& { return entry.second.name; }); + return found == entities.rend() ? 0 : found->second.subtype; + }); +} + +// Capsule(Position, Multiplier, Rotation, Size) around a position, or Capsule(From, To, Size) along a segment. +static int capsule_construct(lua_State* state) +{ + Vector& position = lua_get(state, 1); + Vector& second = lua_get(state, 2); + float first = (float)luaL_checknumber(state, 3); + if (lua_type(state, 4) == LUA_TNUMBER) + lua_push(state, Capsule(position, second, first, (float)luaL_checknumber(state, 4))); + else lua_push(state, Capsule(position, second, first)); + return 1; +} + +// Registers Capsule, a value with its old accessor names kept, and Shape, a debug drawing Entity:GetDebugShape hands +// out. +static void capsule_shape_register(lua_State* state) +{ + auto start_get = [](Capsule& capsule) { return capsule.start; }; + auto end_get = [](Capsule& capsule) { return capsule.end; }; + auto size_get = [](Capsule& capsule) { return capsule.radius; }; + auto size_difference_get = [](Capsule& capsule) { return capsule.halfLength; }; + lua_class_begin(state, "Capsule", LUA_CLASS_CAPSULE); + lua_pushcfunction(state, lua_constructor_call); + lua_table_set(state, -3, "__call"); + lua_method(state, "GetPosition", [](Capsule& capsule) { return capsule.center; }); + lua_method(state, "GetStartPoint", start_get); + lua_method(state, "GetEndPoint", end_get); + lua_method(state, "GetDirection", [](Capsule& capsule) { return capsule.direction; }); + lua_method(state, "GetSize", size_get); + lua_method(state, "GetSizeDifference", size_difference_get); + lua_method(state, "Collide", + [](Capsule& capsule, Capsule& other, Vector& hit) { return Capsule::Collide(capsule, other, &hit); }); + lua_method(state, "GetVec2", start_get); + lua_method(state, "GetVec3", end_get); + lua_method(state, "GetF1", size_get); + lua_method(state, "GetF2", size_difference_get); + lua_class_end(state); + + lua_class_begin(state, "Shape", LUA_CLASS_SHAPE); + lua_method(state, "GetTimeout", [](Shape& shape) { return shape.timeout; }); + lua_method(state, "SetTimeout", [](Shape& shape, int timeout) { shape.timeout = timeout; }); + lua_method(state, "Capsule", [](Shape& shape, Capsule& capsule) { shape.Capsula(capsule); }); + lua_method(state, "Circle", [](Shape& shape, Vector& position, float size) { shape.Circle(position, size); }); + lua_class_hidden_end(state); +} + +// EntityConfigEntity:GetCustomTags, the entity's custom tags in order. +static int custom_tags_get(lua_State* state) +{ + EntityConfig_Entity& entity = lua_get(state, 1); + lua_newtable(state); + int index = 0; + for (const std::string& tag : entity.customTags) + { + lua_push(state, tag); + lua_rawseti(state, -2, ++index); + } + return 1; +} + +// Whether every bit of a mask is set, false for an empty or negative mask. +static bool is_mask_set(uint32_t flags, int mask) +{ + return mask > 0 && (mask & flags) == (uint32_t)mask; +} + +// Registers the EntityConfig namespace and EntityConfigEntity, an entity's entities2.xml config. +static void entity_config_register(lua_State* state) +{ + lua_namespace_begin(state, "EntityConfig"); + lua_method(state, "GetEntity", [](int type, LuaDefault variant, LuaDefault subtype) { + return g_manager->entityConfig.GetEntity(type, variant.value, subtype.value); + }); + lua_method(state, "GetPlayer", [](int type) { return g_manager->entityConfig.GetPlayer(type); }); + lua_method(state, "GetBaby", [](int id) { + auto& babies = g_manager->entityConfig.babies; + return id >= 0 && id < (int)babies.size() ? &babies[id] : nullptr; + }); + lua_method(state, "GetMaxPlayerType", []() { return (int)g_manager->entityConfig.players.size() - 1; }); + lua_method(state, "GetMaxBabyID", []() { return (int)g_manager->entityConfig.babies.size() - 1; }); + lua_class_end(state); + + using Config = EntityConfig_Entity; + lua_class_begin(state, "EntityConfigEntity", LUA_CLASS_ENTITY_CONFIG_ENTITY); + lua_method(state, "GetType", [](Config& entity) { return entity.id; }); + lua_method(state, "GetVariant", [](Config& entity) { return entity.variant; }); + lua_method(state, "GetSubType", [](Config& entity) { return entity.subtype; }); + lua_method(state, "GetName", [](Config& entity) { return entity.name; }); + lua_method(state, "GetCollisionDamage", [](Config& entity) { return entity.collisionDamage; }); + lua_method(state, "GetBossID", [](Config& entity) { return entity.bossID; }); + lua_method(state, "GetCollisionRadius", [](Config& entity) { return entity.collisionRadius; }); + lua_method(state, "GetCollisionRadiusMultiplier", [](Config& entity) { return entity.collisionRadiusMulti; }); + lua_method(state, "GetMass", [](Config& entity) { return entity.mass; }); + lua_method(state, "GetGridCollisionPoints", [](Config& entity) { return entity.gridCollisionPoints; }); + lua_method(state, "GetFriction", [](Config& entity) { return entity.friction; }); + lua_method(state, "GetBaseHP", [](Config& entity) { return entity.baseHP; }); + lua_method(state, "GetStageHP", [](Config& entity) { return entity.stageHP; }); + lua_method(state, "GetAnm2Path", [](Config& entity) { return entity.anm2Path; }); + lua_method(state, "GetModName", + [](Config& entity) { return entity.modEntry ? entity.modEntry->name.c_str() : nullptr; }); + lua_method(state, "GetEntityTags", [](Config& entity) { return entity.tags; }); + lua_method(state, "HasEntityTags", [](Config& entity, int tags) { return is_mask_set(entity.tags, tags); }); + lua_method(state, "GetShadowSize", [](Config& entity) { return entity.shadowSize; }); + lua_method(state, "IsBoss", [](Config& entity) { return entity.isBoss; }); + lua_method(state, "CanBeChampion", [](Config& entity) { return entity.isCanBeChampion; }); + lua_method(state, "CanShutDoors", [](Config& entity) { return entity.isShutDoors; }); + lua_method(state, "GetGibsAmount", [](Config& entity) { return entity.gibsAmount; }); + lua_method(state, "GetGibFlags", [](Config& entity) { return entity.gibFlags; }); + lua_method(state, "HasGibFlags", [](Config& entity, int flags) { return is_mask_set(entity.gibFlags, flags); }); + lua_method(state, "GetPortraitID", [](Config& entity) { return entity.portrait; }); + lua_method(state, "CanBeRerolledInto", [](Config& entity) { return entity.isReroll; }); + lua_method(state, "GetCollisionInterval", [](Config& entity) { return entity.collisionInterval; }); + lua_method(state, "GetShieldStrength", [](Config& entity) { return entity.shieldStrength; }); + lua_method(state, "GetBestiaryAnm2Path", [](Config& entity) { return entity.bestiaryAnm2Path; }); + lua_method(state, "GetBestiaryAnimation", [](Config& entity) { return entity.bestiaryAnim; }); + lua_method(state, "GetBestiaryOverlay", [](Config& entity) { return entity.bestiaryOverlay; }); + lua_method(state, "GetBestiaryOffset", [](Config& entity) { return entity.bestiaryOffset; }); + lua_method(state, "GetBestiaryScale", [](Config& entity) { return entity.bestiaryScale; }); + lua_method(state, "GetBestiaryFloorAlt", [](Config& entity) { return entity.bestiaryFloorAlt; }); + lua_method(state, "HasFloorAlts", [](Config& entity) { return entity.isHasFloorAlts; }); + lua_pushcfunction(state, custom_tags_get); + lua_table_set(state, -2, "GetCustomTags"); + lua_method(state, "HasCustomTag", + [](Config& entity, std::string tag) { return entity.customTags.contains(tag); }); + lua_method(state, "GetDevolvedEntity", [](Config& entity) -> Config* { + if (entity.devolve.empty()) return nullptr; + const Devolve& devolve = entity.devolve.front(); + return g_manager->entityConfig.GetEntity(devolve.type, devolve.variant, devolve.subtype); + }); + lua_class_hidden_end(state); +} + +// (LuaEntityDesc.cpp's LuaCheckEntityType) An EntityDesc's type, 0 when left out: an argument error for the types +// below the first enemy and for effects and above. +static unsigned int desc_type_check(lua_State* state, int index) +{ + unsigned int type = (unsigned int)luaL_optinteger(state, index, 0); + if ((type >= DESC_TYPE_FIRST_REJECTED && type <= DESC_TYPE_LAST_REJECTED) || type >= DESC_TYPE_END) + luaL_argerror(state, index, ("Invalid Entity Type " + std::to_string(type)).c_str()); + return type; +} + +// (LuaCheckChampionId) An EntityDesc's champion, -1 when left out. +static int desc_champion_check(lua_State* state, int index) +{ + int id = (int)luaL_optinteger(state, index, -1); + if (id < CHAMPION_ID_MIN || id > CHAMPION_ID_MAX) + luaL_argerror(state, index, "ChampionId must be between -1 and 25"); + return id; +} + +// EntityDesc(Type, Variant, SubType, ChampionId, Health, MaxHealth, PlayerControlled), every argument optional. +static int desc_construct(lua_State* state) +{ + EntityDesc desc; + desc.type = desc_type_check(state, 1); + desc.variant = (uint32_t)luaL_optinteger(state, 2, 0); + desc.subtype = (uint32_t)luaL_optinteger(state, 3, 0); + desc.championId = desc_champion_check(state, 4); + desc.health = (float)luaL_optnumber(state, 5, 0); + desc.maxHealth = (float)luaL_optnumber(state, 6, 0); + desc.isPlayerControlled = lua_get>(state, 7).value; + lua_push(state, desc); + return 1; +} + +static int desc_type_set(lua_State* state) +{ + lua_get(state, 1).type = desc_type_check(state, 2); + return 0; +} + +static int desc_champion_set(lua_State* state) +{ + lua_get(state, 1).championId = desc_champion_check(state, 2); + return 0; +} + +// Registers EntityDesc, the description of a charmed enemy Lua can build. +static void entity_desc_register(lua_State* state) +{ + lua_class_begin(state, "EntityDesc", LUA_CLASS_ENTITY_DESC); + lua_pushcfunction(state, lua_constructor_call); + lua_table_set(state, -3, "__call"); + lua_functions_add(state, { + {"GetType", lua_member_get<&EntityDesc::type>}, + {"SetType", desc_type_set}, + {"GetVariant", lua_member_get<&EntityDesc::variant>}, + {"SetVariant", lua_member_set<&EntityDesc::variant>}, + {"GetSubtype", lua_member_get<&EntityDesc::subtype>}, + {"SetSubtype", lua_member_set<&EntityDesc::subtype>}, + {"GetChampionId", lua_member_get<&EntityDesc::championId>}, + {"SetChampionId", desc_champion_set}, + {"GetHealth", lua_member_get<&EntityDesc::health>}, + {"SetHealth", lua_member_set<&EntityDesc::health>}, + {"GetMaxHealth", lua_member_get<&EntityDesc::maxHealth>}, + {"SetMaxHealth", lua_member_set<&EntityDesc::maxHealth>}, + {"IsPlayerControlled", lua_member_get<&EntityDesc::isPlayerControlled>}, + {"SetPlayerControlled", lua_member_set<&EntityDesc::isPlayerControlled>}, + }); + lua_class_end(state); +} + +// The saved entity argument 1 points at. +static EntitySaveState& save_state_check(lua_State* state) +{ + EntitySaveStateHandle& ref = lua_get(state, 1); + return (*ref.states)[ref.index]; +} + +template +static int save_state_get(lua_State* state) +{ + lua_push(state, save_state_check(state).*Member); + return 1; +} + +template +static int save_state_set(lua_State* state) +{ + using T = decltype(lua_member_type(Member)); + if constexpr (std::is_floating_point_v) save_state_check(state).*Member = (T)luaL_checknumber(state, 2); + else save_state_check(state).*Member = (T)luaL_checkinteger(state, 2); + return 0; +} + +// Whether a saved entity keeps a float in its first storage. +static bool is_float_storage(const EntitySaveState& saved) +{ + return std::ranges::find(SAVE_STATE_FLOAT_TYPES, saved.type) != SAVE_STATE_FLOAT_TYPES.end(); +} + +// EntitySaveState:GetI1, a float for the types that keep one there. +static int save_state_i1_get(lua_State* state) +{ + EntitySaveState& saved = save_state_check(state); + if (is_float_storage(saved)) lua_push(state, std::bit_cast(saved.intStorage1)); + else lua_push(state, saved.intStorage1); + return 1; +} + +static int save_state_i1_set(lua_State* state) +{ + EntitySaveState& saved = save_state_check(state); + if (is_float_storage(saved)) saved.intStorage1 = std::bit_cast((float)luaL_checknumber(state, 2)); + else saved.intStorage1 = (uint32_t)luaL_checkinteger(state, 2); + return 0; +} + +// EntitySaveState:GetU1, a boolean for a pickup. +static int save_state_u1_get(lua_State* state) +{ + EntitySaveState& saved = save_state_check(state); + if (saved.type == ENTITY_PICKUP) lua_push(state, (bool)saved.byteStorage); + else lua_push(state, saved.byteStorage); + return 1; +} + +static int save_state_u1_set(lua_State* state) +{ + EntitySaveState& saved = save_state_check(state); + if (saved.type == ENTITY_PICKUP) saved.byteStorage = lua_get(state, 2).value; + else saved.byteStorage = (uint8_t)(int8_t)luaL_checkinteger(state, 2); + return 0; +} + +static int save_state_b1_set(lua_State* state) +{ + save_state_check(state).boolStorage1 = lua_get(state, 2).value; + return 0; +} + +static int save_state_b2_set(lua_State* state) +{ + save_state_check(state).boolStorage2 = lua_get(state, 2).value; + return 0; +} + +static int save_state_position_set(lua_State* state) +{ + save_state_check(state).targetPosition = lua_get(state, 2); + return 0; +} + +// A saved list's Get index, an error past its end. +template +static uint32_t save_list_index_check(lua_State* state, List& list) +{ + size_t index = (size_t)luaL_checkinteger(state, 2); + if (index >= list.size()) luaL_error(state, "Invalid index for Get(): %d\n", (int)index); + return (uint32_t)index; +} + +// The entries of a saved list a filter keeps, as a table from 1, each pushed by push. +template +static int save_list_filter(lua_State* state, List& list, Keep is_kept, Push push) +{ + lua_newtable(state); + int found = 0; + for (size_t i = 0; i < list.size(); i++) + { + if (!is_kept(list[i])) continue; + push(i); + lua_rawseti(state, -2, ++found); + } + return 1; +} + +// EntitiesSaveStateVector:GetByType: the saved entities of a type, variant and subtype (0 when left out, -1 any). +static int saved_entities_by_type(lua_State* state) +{ + auto& list = lua_get&>(state, 1); + int type = (int)luaL_checkinteger(state, 2); + int variant = (int)luaL_optinteger(state, 3, 0); + int subtype = (int)luaL_optinteger(state, 4, 0); + auto is_kept = [&](EntitySaveState& saved) { + return saved.type == type && (variant == -1 || saved.variant == variant) && + (subtype == -1 || saved.subtype == subtype); + }; + auto push = [&](size_t i) { lua_push(state, EntitySaveStateHandle{&list, (int)i}); }; + return save_list_filter(state, list, is_kept, push); +} + +static int saved_grids_by_type(lua_State* state) +{ + auto& list = lua_get&>(state, 1); + int type = (int)luaL_checkinteger(state, 2); + auto is_kept = [&](GridEntityDesc& desc) { return desc._type == type; }; + return save_list_filter(state, list, is_kept, [&](size_t i) { lua_push(state, &list[i]); }); +} + +static int saved_entity_get(lua_State* state) +{ + auto& list = lua_get&>(state, 1); + lua_push(state, EntitySaveStateHandle{&list, (int)save_list_index_check(state, list)}); + return 1; +} + +static int saved_grid_get(lua_State* state) +{ + auto& list = lua_get&>(state, 1); + lua_push(state, &list[save_list_index_check(state, list)]); + return 1; +} + +template +static int save_list_length(lua_State* state) +{ + lua_push(state, lua_get(state, 1).size()); + return 1; +} + +static int saved_entities_clear(lua_State* state) +{ + lua_get&>(state, 1).clear(); + return 0; +} + +static int saved_grids_clear(lua_State* state) +{ + for (GridEntityDesc& desc : lua_get&>(state, 1)) desc._type = 0; + return 0; +} + +// Registers EntitySaveState, a pointer into a saved entity list that RoomDescriptor and the save managers hand out, +// and the two saved lists, entities and grid entities. Clearing the grid list keeps its entries, emptied. +static void save_states_register(lua_State* state) +{ + lua_class_begin(state, "EntitySaveState", LUA_CLASS_ENTITY_SAVE_STATE); + lua_functions_add(state, { + {"GetType", save_state_get<&EntitySaveState::type>}, + {"SetType", save_state_set<&EntitySaveState::type>}, + {"GetVariant", save_state_get<&EntitySaveState::variant>}, + {"SetVariant", save_state_set<&EntitySaveState::variant>}, + {"GetSubType", save_state_get<&EntitySaveState::subtype>}, + {"SetSubType", save_state_set<&EntitySaveState::subtype>}, + {"GetI1", save_state_i1_get}, + {"SetI1", save_state_i1_set}, + {"GetI2", save_state_get<&EntitySaveState::intStorage2>}, + {"SetI2", save_state_set<&EntitySaveState::intStorage2>}, + {"GetI3", save_state_get<&EntitySaveState::intStorage3>}, + {"SetI3", save_state_set<&EntitySaveState::intStorage3>}, + {"GetI4", save_state_get<&EntitySaveState::intStorage4>}, + {"SetI4", save_state_set<&EntitySaveState::intStorage4>}, + {"GetI5", save_state_get<&EntitySaveState::intStorage5>}, + {"SetI5", save_state_set<&EntitySaveState::intStorage5>}, + {"GetGridSpawnIdx", save_state_get<&EntitySaveState::gridSpawnIdx>}, + {"GetB1", save_state_get<&EntitySaveState::boolStorage1>}, + {"SetB1", save_state_b1_set}, + {"GetB2", save_state_get<&EntitySaveState::boolStorage2>}, + {"SetB2", save_state_b2_set}, + {"GetI6", save_state_get<&EntitySaveState::intStorage6>}, + {"SetI6", save_state_set<&EntitySaveState::intStorage6>}, + {"GetPos", save_state_get<&EntitySaveState::targetPosition>}, + {"SetPos", save_state_position_set}, + {"GetI7", save_state_get<&EntitySaveState::intStorage7>}, + {"SetI7", save_state_set<&EntitySaveState::intStorage7>}, + {"GetInitSeed", save_state_get<&EntitySaveState::initSeed>}, + {"GetDropSeed", save_state_get<&EntitySaveState::dropSeed>}, + {"GetSpawnerType", save_state_get<&EntitySaveState::spawnerType>}, + {"GetSpawnerVariant", save_state_get<&EntitySaveState::spawnerVariant>}, + {"GetF1", save_state_get<&EntitySaveState::floatStorage1>}, + {"SetF1", save_state_set<&EntitySaveState::floatStorage1>}, + {"GetF2", save_state_get<&EntitySaveState::floatStorage2>}, + {"SetF2", save_state_set<&EntitySaveState::floatStorage2>}, + {"GetI8", save_state_get<&EntitySaveState::intStorage8>}, + {"SetI8", save_state_set<&EntitySaveState::intStorage8>}, + {"GetU1", save_state_u1_get}, + {"SetU1", save_state_u1_set}, + }); + lua_class_hidden_end(state); + + lua_class_begin(state, "EntitiesSaveStateVector", LUA_CLASS_ENTITIES_SAVE_STATE_VECTOR); + lua_functions_add(state, { + {"Get", saved_entity_get}, + {"GetByType", saved_entities_by_type}, + {"Clear", saved_entities_clear}, + {"__len", save_list_length>}, + }); + lua_class_hidden_end(state); + + lua_class_begin(state, "GridEntitiesSaveStateVector", LUA_CLASS_GRID_ENTITIES_SAVE_STATE_VECTOR); + lua_functions_add(state, { + {"Get", saved_grid_get}, + {"GetByType", saved_grids_by_type}, + {"Clear", saved_grids_clear}, + {"__len", save_list_length>}, + }); + lua_class_hidden_end(state); +} + +// Registers the grid entity classes REPENTOGON's casts hand out, which add nothing to GridEntity yet. +static void grid_classes_register(lua_State* state) +{ + for (auto [name, luaClass] : {std::pair{"GridEntityDecoration", LUA_CLASS_GRID_ENTITY_DECORATION}, + {"GridEntityFire", LUA_CLASS_GRID_ENTITY_FIRE}, + {"GridEntityGravity", LUA_CLASS_GRID_ENTITY_GRAVITY}, + {"GridEntityStairs", LUA_CLASS_GRID_ENTITY_STAIRS}, + {"GridEntityStatue", LUA_CLASS_GRID_ENTITY_STATUE}, + {"GridEntityTeleporter", LUA_CLASS_GRID_ENTITY_TELEPORTER}, + {"GridEntityTrapDoor", LUA_CLASS_GRID_ENTITY_TRAP_DOOR}, + {"GridEntityWall", LUA_CLASS_GRID_ENTITY_WALL}, + {"GridEntityWeb", LUA_CLASS_GRID_ENTITY_WEB}}) + { + lua_class_begin(state, name, luaClass, LUA_CLASS_GRID_ENTITY); + lua_class_hidden_end(state); + } + + // (LuaGridEntityLock.cpp) A key block, which a player may unlock. + lua_class_begin(state, "GridEntityLock", LUA_CLASS_GRID_ENTITY_LOCK, LUA_CLASS_GRID_ENTITY); + lua_method(state, "TryUnlock", [](GridEntity_Lock& lock, Entity_Player& player, LuaCheckedBool isForced) { + lock.try_unlock(player, isForced.value); + }); + lua_class_hidden_end(state); +} + +// Registers the classes REPENTOGON's casts and EntityEffect.CreateLootPreview take or hand out, which the npc and +// pickup areas give their functions: EntityDelirium, EntitySlot and LootList. +static void cast_classes_register(lua_State* state) +{ + lua_class_begin(state, "EntityDelirium", LUA_CLASS_ENTITY_DELIRIUM, LUA_CLASS_NPC); + delirium_api_register(state); + lua_class_hidden_end(state); + lua_class_begin(state, "EntitySlot", LUA_CLASS_ENTITY_SLOT, LUA_CLASS_ENTITY); + slot_api_register(state); + lua_class_hidden_end(state); + lua_class_begin(state, "LootList", LUA_CLASS_LOOT_LIST); + loot_list_api_register(state); + lua_class_end(state); +} + +// Registers REPENTOGON's entity classes, after the game's own. +void entity_classes_register(lua_State* state) +{ + capsule_shape_register(state); + entity_config_register(state); + entity_desc_register(state); + save_states_register(state); + grid_classes_register(state); + cast_classes_register(state); +} diff --git a/src/repentogon/api_game.cpp b/src/repentogon/api_game.cpp new file mode 100644 index 0000000..6df1f07 --- /dev/null +++ b/src/repentogon/api_game.cpp @@ -0,0 +1,742 @@ +#include "repentogon/api_game.h" +#include "entity/effect/effect.h" +#include "entity/factory.h" +#include "entity/familiar/wisp.h" +#include "entity/player/manager.h" +#include "entity/player/player.h" +#include "entity/player/pocket_items.h" +#include "entity/weapon/bomb.h" +#include "game/challenge_params.h" +#include "game/daily_challenge.h" +#include "game/game.h" +#include "game/manager.h" +#include "game/persistent_game_data.h" +#include "level/ambush.h" +#include "level/room.h" +#include "level/room_config.h" +#include "level/room_special.h" +#include "online/leaderboard.h" +#include "repentogon/api.h" +#include "repentogon/hud.h" +#include "repentogon/lua_render.h" +#include "repentogon/saves.h" +#include "ui/generic_prompt.h" +#include "ui/victory_run_prompt.h" +#include +#include +#include +#include +#include + +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_CHALLENGE_PARAM; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_GENERIC_PROMPT; + +constexpr int DIFFICULTY_LAST = DIFFICULTY_GREEDIER; +constexpr int COMPLETION_LAST = COMPLETION_TYPE_COUNT - 1; +constexpr int STAGE_SEED_LAST = STAGE_SEED_COUNT - 1; +constexpr int ESAU_JR_SLOT_LAST = ESAU_JR_SLOT_COUNT - 1; +constexpr int BOSS_RUSH_WAVES_MAX = 25; +constexpr int GREED_FINAL_BOSS_WAVE = 11; +constexpr int SHOP_VISITS_STORE_KEY = 6; +constexpr int ACHIEVEMENT_STORE_KEY = 379; +constexpr float BOMB_CRATER_SCALE = 1; +constexpr float CHAIN_LIGHTNING_DAMAGE = 3.5f; +constexpr float COLOR_MODIFIER_RATE = 0.015f; +constexpr uint32_t OWNER_RNG_SHIFT = 35; +// Ambush's wave preview: the difficulty of each next wave, the boss challenge's wave subtype, the draws a wave tries, +// and the draws each of its spawns takes from the RNG (its entry, the entry's fix and the spawn). +constexpr std::array WAVE_DIFFICULTY = {1, 5, 10, 15}; +constexpr int WAVE_SUBTYPE_NORMAL = 10; +constexpr int WAVE_TRIES = 10; +constexpr int WAVE_SPAWN_DRAWS = 3; + +// The players PlayerManager's item queries find (LuaPlayerManager.cpp's PlayerManagerQuery): of a collectible or a +// trinket, of one player type or any, with modifiers or only what they own, and Lazarus's dead twin for items tagged +// as shared globally. +struct ItemOwnerQuery +{ + std::optional playerType; + int id = 0; + bool isIgnoreModifiers = false; + bool isLazarusShared = true; + bool isTrinket = false; + + bool is_backup_checked() + { + ItemConfig& config = g_manager->itemConfig; + ItemConfig_Item* item = isTrinket ? config.GetTrinket(id) : config.GetCollectible(id); + return isLazarusShared && item && (item->tags & TAG_LAZ_SHARED_GLOBAL); + } + + bool is_owner(Entity_Player& player) + { + if (player.variant != PLAYER_VARIANT_PLAYER || (playerType && player.playerType != *playerType)) return false; + if (!isTrinket) return player.HasCollectible(id, isIgnoreModifiers ? ITEM_CHECK_OWNED : ITEM_CHECK_MODIFIED); + return isIgnoreModifiers ? player.HasTrinket(id, ITEM_CHECK_OWNED) : player.GetTrinketMultiplier(id) > 0; + } + + int count_get(Entity_Player& player) + { + if (playerType && player.playerType != *playerType) return 0; + if (isTrinket) return player.GetTrinketMultiplier(id); + return player.GetCollectibleNum(id, isIgnoreModifiers ? ITEM_CHECK_OWNED : ITEM_CHECK_MODIFIED); + } + + std::vector owners_get() + { + std::vector owners; + bool isBackupChecked = is_backup_checked(); + for (Entity_Player* player : g_game->playerManager.playerList) + { + if (is_owner(*player)) owners.push_back(player); + if (player->backupPlayer && isBackupChecked && is_owner(*player->backupPlayer)) + owners.push_back(player->backupPlayer); + } + return owners; + } + + Entity_Player* first_owner_get() + { + std::vector owners = owners_get(); + return owners.empty() ? nullptr : owners.front(); + } + + Entity_Player* random_owner_get(uint32_t seed) + { + std::vector owners = owners_get(); + if (owners.empty()) return nullptr; + + RNG rng{}; + rng.SetSeed(seed > 0 ? seed : 1, OWNER_RNG_SHIFT); + return owners[rng.RandomInt((uint32_t)owners.size())]; + } + + int total_count_get() + { + int count = 0; + bool isBackupChecked = is_backup_checked(); + for (Entity_Player* player : g_game->playerManager.playerList) + { + count += count_get(*player); + if (player->backupPlayer && isBackupChecked) count += count_get(*player->backupPlayer); + } + return count; + } +}; + +// Whether the run cannot unlock achievements: a custom run, a seed effect, the game's rules or a rerun. +static bool is_achievement_unlock_disallowed(Game& game) +{ + return game.seedEffects.isCustomRun || game.seedEffects.AchievementUnlocksDisallowed() || + Manager::AchievementUnlocksDisallowed() || game.isRerun; +} + +// Game:GetPlayer(index = 0): nil without players, a negative index reading as the first. +static int game_player_get(lua_State* state) +{ + lua_get(state, 1); + int index = (int)luaL_optinteger(state, 2, 0); + bool isEmpty = !g_game || g_game->playerManager.playerList.empty(); + lua_push(state, isEmpty ? nullptr : g_game->GetPlayer(std::max(index, 0))); + return 1; +} + +// Game:MoveToRandomRoom: a zero seed is an error, where the original would crash. +static int game_random_room_move_run(lua_State* state) +{ + Game& game = lua_get(state, 1); + bool isErrorRoom = lua_toboolean(state, 2); + int seed = (int)luaL_checkinteger(state, 3); + if (seed == 0) return luaL_error(state, "The given seed is not valid"); + + game_random_room_move(game, isErrorRoom, seed, lua_get>(state, 4).value); + return 0; +} + +// Game:AddErasedEnemy(entity) or (type, variant): the subtype is always 0, as the game ignores it. +static int game_erased_enemy_add(lua_State* state) +{ + Game& game = lua_get(state, 1); + if (lua_type(state, 2) == LUA_TUSERDATA) + { + erased_enemy_add(lua_get(state, 2)); + return 0; + } + + ErasedEnemy erased{.type = (int)luaL_checkinteger(state, 2), .variant = (int)luaL_checkinteger(state, 3)}; + erased_enemy_id_fix(erased.type, erased.variant, erased.subtype); + bool isKnown = std::ranges::any_of(game.erasedEntities, [&](const ErasedEnemy& other) { + return other.type == erased.type && other.variant == erased.variant && other.subtype == erased.subtype; + }); + if (!isKnown) game.erasedEntities.push_back(erased); + return 0; +} + +// Game:RemoveErasedEnemy(type, variant = -1): -1 removes every variant. +static int game_erased_enemy_remove(lua_State* state) +{ + Game& game = lua_get(state, 1); + int type = (int)luaL_checkinteger(state, 2); + int variant = (int)luaL_optinteger(state, 3, -1); + int subType = 0; + erased_enemy_id_fix(type, variant, subType); + std::erase_if(game.erasedEntities, [&](const ErasedEnemy& erased) { + return erased.type == type && (variant == -1 || erased.variant == variant); + }); + return 0; +} + +// Game:IsErased(entity) or (type, variant = -1, subtype = -1): whether an erased kind matches, -1 matching any. +static int game_erased_check(lua_State* state) +{ + Game& game = lua_get(state, 1); + int type = 0; + int variant = 0; + int subType = 0; + if (lua_type(state, 2) == LUA_TUSERDATA) + { + Entity& entity = lua_get(state, 2); + type = entity.type; + variant = entity.variant; + subType = entity.subtype; + } + else + { + type = (int)luaL_checkinteger(state, 2); + variant = (int)luaL_optinteger(state, 3, -1); + subType = (int)luaL_optinteger(state, 4, -1); + } + erased_enemy_id_fix(type, variant, subType); + + bool isErased = std::ranges::any_of(game.erasedEntities, [&](const ErasedEnemy& erased) { + bool isSubTypeMatch = subType == -1 || erased.subtype == subType; + return erased.type == type && (variant == -1 || (erased.variant == variant && isSubTypeMatch)); + }); + lua_pushboolean(state, isErased); + return 1; +} + +// Game:ChainLightning(position, damage = 3.5, tear flags, spawner): the lightning's effect. +static int game_chain_lightning(lua_State* state) +{ + lua_get(state, 1); + ChainLightning chain = {.position = lua_get(state, 2)}; + chain.damage = (float)luaL_optnumber(state, 3, CHAIN_LIGHTNING_DAMAGE); + if (auto* flags = lua_get>>(state, 4).value) chain.tearFlags = *flags; + chain.spawner = lua_get>(state, 5).value; + lua_push(state, chain_lightning_spawn(chain)); + return 1; +} + +// (LuaGame.cpp, LuaChallengeParam.cpp) Adds REPENTOGON's Game functions: its counters and state, the erased enemies, +// the color modifiers, bloom and dizziness, and the fixed GetPlayer, MoveToRandomRoom, StartStageTransition and stage +// getters. Difficulty becomes writable within the four difficulties. +void game_repentogon_register(lua_State* state) +{ + lua_method(state, "ClearErasedEnemies", [](Game& game) { game.erasedEntities.clear(); }); + lua_method(state, "AddShopVisits", [](Game& game, int count) { + game.shopVisits += count; + if (game.shopVisits >= SHOP_VISITS_STORE_KEY && !game.IsGreedMode()) + g_manager->persistentGameData.TryUnlock(ACHIEVEMENT_STORE_KEY); + }); + lua_method(state, "GetShopVisits", [](Game& game) { return game.shopVisits; }); + lua_method(state, "AchievementUnlocksDisallowed", is_achievement_unlock_disallowed); + lua_method(state, "IsPauseMenuOpen", [](Game& game) { return game.pauseScreen.state > PAUSE_HIDDEN; }); + lua_method(state, "GetPauseMenuState", [](Game& game) { return game.pauseScreen.state; }); + lua_method(state, "GetPlanetariumsVisited", [](Game& game) { return game.planetariumsVisited; }); + // 006f8100 + lua_method(state, "IsHardMode", [](Game& game) { + return game.difficulty == DIFFICULTY_HARD || game.difficulty == DIFFICULTY_GREEDIER; + }); + lua_method(state, "GetLastDevilRoomStage", [](Game& game) { return game.lastDevilRoomStage; }); + lua_method(state, "GetLastLevelWithDamage", [](Game& game) { return game.lastLevelWithDamage; }); + lua_method(state, "GetLastLevelWithoutHalfHp", [](Game& game) { return game.lastLevelWithoutHalfHp; }); + lua_method(state, "GetDebugFlags", [](Game& game) { return game.debugFlags; }); + lua_method(state, "AddDebugFlags", [](Game& game, uint32_t flags) { game.debugFlags |= flags; }); + lua_method(state, "SpawnBombCrater", [](Game&, Vector& position, LuaDefault scale) { + return bomb_crater_spawn(position, nullptr, scale.value); + }); + lua_method(state, "DevolveEnemy", [](Game&, Entity& entity) { game_enemy_devolve(entity, nullptr); }); + // 00983970, 009839b0 Whether the Greed wave about to come is the boss's, or the final boss's. + lua_method(state, "IsGreedBoss", [](Game& game) { + bool isGreed = game.difficulty == DIFFICULTY_GREED || game.difficulty == DIFFICULTY_GREEDIER; + return isGreed && game.greedModeWave + 1 >= GREED_BOSS_WAVE + (game.difficulty == DIFFICULTY_GREEDIER); + }); + lua_method(state, "IsGreedFinalBoss", [](Game& game) { + bool isGreed = game.difficulty == DIFFICULTY_GREED || game.difficulty == DIFFICULTY_GREEDIER; + return isGreed && game.greedModeWave + 1 >= GREED_FINAL_BOSS_WAVE + (game.difficulty == DIFFICULTY_GREEDIER); + }); + lua_method(state, "StartStageTransition", [](Game& game, LuaCheckedBool isSameStage, int type, + LuaOptionalObject player) { + game.stageTransition.start( + {.player = player.value, .type = (StageTransitionType)type, .isSameStage = isSameStage.value}); + }); + lua_functions_add(state, {{"AddErasedEnemy", game_erased_enemy_add}, + {"RemoveErasedEnemy", game_erased_enemy_remove}, + {"IsErased", game_erased_check}, + {"GetPlayer", game_player_get}, + {"MoveToRandomRoom", game_random_room_move_run}, + {"ChainLightning", game_chain_lightning}}); + lua_method(state, "GetCurrentColorModifier", [](Game& game) { return game.currentColorModifier; }); + lua_method(state, "GetTargetColorModifier", [](Game& game) { return game.targetColorModifier; }); + lua_method(state, "GetLerpColorModifier", [](Game& game) { return game.lerpColorModifier; }); + lua_method(state, "SetColorModifier", [](Game& game, ColorModState& color, LuaOptionalBool isLerp, + LuaDefault rate) { + game.SetColorModifier(color, isLerp.value, rate.value); + }); + lua_method(state, "IsRerun", [](Game& game) { return game.isRerun; }); + lua_method(state, "ShowGenericLeaderboard", + [](Game& game) { game.leaderboard.Show(1, game.scoreSheet, false, false); }); + lua_method(state, "SetDonationModAngel", [](Game& game, int amount) { game.donationModAngel = amount; }); + lua_method(state, "SetDonationModGreed", [](Game& game, int amount) { game.donationModGreed = amount; }); + // 00703830 + lua_method(state, "SetBloom", [](Game& game, int duration, float strength) { + game.bloomDuration = duration; + game.bloomTimer = duration; + game.bloomStrength = strength; + }); + lua_method(state, "GetDizzyAmount", [](Game& game) { return game.dizzyIntensity; }); + lua_functions_add(state, {{"SetDizzyAmount", [](lua_State* s) { + Game& game = lua_get(s, 1); + float target = (float)luaL_checknumber(s, 2); + game.dizzyIntensity = (float)luaL_optnumber(s, 3, game.dizzyIntensity); + game.dizzyTargetIntensity = target; + return 0; + }}, + {"RecordPlayerCompletion", [](lua_State* s) { + lua_get(s, 1); + int completion = (int)luaL_checkinteger(s, 2); + if (completion < 0 || completion > COMPLETION_LAST) + return luaL_error(s, "Bad CompletionType %d (valid range is 0-17)", completion); + PlayerManager::unlock_completion_mark(completion); + return 0; + }}}); + lua_method(state, "GetGenericPrompt", [](Game& game) { return game.genericPrompt; }); + lua_method(state, "IsStartingFromState", [](Game& game) { return game.isStartingFromState; }); + lua_method(state, "GetChallengeParams", [](Game& game) { return &game.GetChallengeParams(); }); + lua_property( + state, "Difficulty", [](Game& game) { return game.difficulty; }, + [](Game& game, int difficulty) { + if (difficulty >= DIFFICULTY_NORMAL && difficulty <= DIFFICULTY_LAST) game.difficulty = (Difficulty)difficulty; + }); +} + +// (LuaSeeds.cpp) Adds Seeds:SetStageSeed, a zero seed reading as 1. +void seeds_repentogon_register(lua_State* state) +{ + lua_functions_add(state, {{"SetStageSeed", [](lua_State* s) { + Seeds& seeds = lua_get(s, 1); + int stage = (int)luaL_checkinteger(s, 2); + uint32_t seed = (uint32_t)luaL_checkinteger(s, 3); + if (stage < 0 || stage > STAGE_SEED_LAST) + return luaL_argerror(s, 2, "Invalid LevelStage (must be between 0 and 13)"); + seeds.stageSeeds[stage] = std::max(seed, 1u); + return 0; + }}}); +} + +// A challenge id REPENTOGON's challenge functions take: an error below 1. +static int challenge_check(lua_State* state) +{ + int challenge = (int)luaL_checkinteger(state, 1); + if (challenge < 1) luaL_error(state, "Invalid Challenge ID (expected > 0, got %d)", challenge); + return challenge; +} + +// Isaac.StartNewGame(player type = 0, challenge = 0, difficulty = 0, seeds or seed = 0, custom run = false). +static int new_game_start(lua_State* state) +{ + int playerType = (int)luaL_optinteger(state, 1, 0); + int challenge = (int)luaL_optinteger(state, 2, 0); + int difficulty = (int)luaL_optinteger(state, 3, 0); + Seeds seeds; + if (lua_type(state, 4) == LUA_TUSERDATA) seeds = lua_get(state, 4); + else + { + uint32_t seed = (uint32_t)luaL_optinteger(state, 4, 0); + bool isCustomRun = lua_get>(state, 5).value; + seeds.set_start_seed(seed); + seeds.isCustomRun = isCustomRun; + } + g_manager->StartNewGame(playerType, challenge, seeds, difficulty); + return 0; +} + +// (LuaIsaac.cpp) Adds REPENTOGON's Isaac functions over runs: whether one is on or true co-op may start, starting a +// new run or a practice daily, and the challenges' completion. The rebuild keeps no modded challenge's clears, so +// GetModChallengeClearCount counts none. +void isaac_game_register(lua_State* state) +{ + lua_method(state, "CanStartTrueCoop", []() { return !PlayerManager::CoopBabiesOnly(); }); + lua_method(state, "IsInGame", []() { return g_manager->state == MANAGER_STATE_GAME && g_game; }); + lua_functions_add(state, {{"IsChallengeDone", + [](lua_State* s) { + lua_pushboolean(s, challenge_is_completed(challenge_check(s))); + return 1; + }}, + {"ClearChallenge", + [](lua_State* s) { + challenge_completed_mark(challenge_check(s)); + return 0; + }}, + {"StartNewGame", new_game_start}}); + lua_method(state, "UnClearChallenge", [](int challenge) { challenge_completion_reset(challenge); }); + lua_method(state, "GetModChallengeClearCount", [](int) { return 0; }); + lua_method(state, "StartDailyGame", [](uint32_t date) { + g_manager->StartNewGame(PLAYER_ISAAC, 0, Seeds(), 0); + g_manager->dailyChallenge.Init(date); + g_manager->dailyChallenge.isPractice = true; + }); +} + +// The copy of the ambush's wave RNG the next wave would draw from, the room's spawn seed before the first, and the +// next wave's difficulty slot and wave subtype. An error outside a challenge room. +static std::tuple ambush_preview_begin(lua_State* state) +{ + Game& game = *g_game; + Ambush& ambush = game.ambush; + RoomDescriptor& descriptor = *game.room->descriptor; + if (descriptor.data->type != ROOM_CHALLENGE) + luaL_error(state, "Cannot get Ambush wave information outside of a (boss) challenge room"); + + RNG rng = ambush.waveRng; + if (ambush.currentWave == 0) rng._seed = descriptor.spawnSeed; + int index = std::min(ambush.currentWave + (game.difficulty == DIFFICULTY_HARD), (int)WAVE_DIFFICULTY.size() - 1); + int subtype = WAVE_SUBTYPE_NORMAL + (descriptor.data->subtype == CHALLENGE_SUBTYPE_BOSS); + return {rng, index, subtype}; +} + +// A draw of a challenge wave as the ambush would make it, lowering its weight or not. +static RoomConfig_Room* ambush_wave_draw(uint32_t seed, WeightReduction reduction, int index, int subtype) +{ + Game& game = *g_game; + RoomQuery query = {.shape = game.room->descriptor->data->shape, + .maxDifficulty = WAVE_DIFFICULTY[index], + .minDifficulty = WAVE_DIFFICULTY[index], + .stageId = RoomConfig::GetStageID(game.stage, game.stageType, ROOM_MODE_CURRENT), + .subtype = subtype, + .type = ROOM_CHALLENGE}; + return game.roomConfig.GetRandomRoom(seed, reduction, query); +} + +// Ambush.GetNextWave: the layout the next challenge wave would draw, nil if none has spawns in ten draws. +static int ambush_next_wave_get(lua_State* state) +{ + auto [rng, index, subtype] = ambush_preview_begin(state); + RoomConfig_Room* wave = nullptr; + int tries = 0; + do + { + rng.Next(); + wave = ambush_wave_draw(rng._seed, WEIGHT_KEEP, index, subtype); + if (!wave) break; + tries++; + } while (wave->spawns.empty() && tries < WAVE_TRIES); + lua_push(state, wave && tries != WAVE_TRIES ? wave : nullptr); + return 1; +} + +// Ambush.GetNextWaves: the layouts the challenge's waves left would draw, each weight lowered while drawing and put +// back after, and the RNG drawn on for each spawn as the waves spawn. None at all once a draw finds no layout. +static int ambush_next_waves_get(lua_State* state) +{ + auto [rng, index, subtype] = ambush_preview_begin(state); + std::vector> drawn; + std::vector waves; + bool isMissing = false; + for (int wave = g_game->ambush.currentWave; wave < ambushWaves && !isMissing; wave++) + { + bool isSpawning = false; + for (int tries = 0; !isSpawning && !isMissing && tries < WAVE_TRIES; tries++) + { + rng.Next(); + RoomConfig_Room* layout = ambush_wave_draw(rng._seed, WEIGHT_KEEP, index, subtype); + isMissing = !layout; + if (isMissing) continue; + + drawn.emplace_back(layout, layout->initialWeight, layout->weight); + layout = ambush_wave_draw(rng._seed, WEIGHT_REDUCE, index, subtype); + isSpawning = layout && !layout->spawns.empty(); + if (!isSpawning) continue; + + waves.push_back(layout); + for (size_t draw = 0; draw < WAVE_SPAWN_DRAWS * layout->spawns.size(); draw++) rng.Next(); + } + index = std::min(index + 1, (int)WAVE_DIFFICULTY.size() - 1); + } + for (auto& [layout, initialWeight, weight] : drawn) + { + layout->initialWeight = initialWeight; + layout->weight = weight; + } + if (isMissing) waves.clear(); + return lua_array_push(state, waves); +} + +// (LuaAmbush.cpp) Registers REPENTOGON's Ambush: the challenge and boss rush fights, their wave counts and a preview +// of the next waves. +static void ambush_register(lua_State* state) +{ + lua_namespace_begin(state, "Ambush"); + lua_method(state, "StartChallenge", []() { g_game->ambush.StartChallenge(); }); + lua_method(state, "SpawnBossrushWave", []() { g_game->ambush.SpawnBossrushWave(); }); + lua_method(state, "SpawnWave", []() { g_game->ambush.SpawnWave(); }); + lua_method(state, "GetMaxBossrushWaves", []() { return g_game->ambush.maxWaves; }); + lua_method(state, "SetMaxBossrushWaves", + [](int count) { g_game->ambush.maxWaves = std::min(count, BOSS_RUSH_WAVES_MAX); }); + lua_method(state, "GetMaxChallengeWaves", []() { return ambushWaves; }); + lua_method(state, "SetMaxChallengeWaves", [](int count) { ambushWaves = count; }); + lua_method(state, "GetMaxBossChallengeWaves", []() { return bossAmbushWaves; }); + lua_method(state, "SetMaxBossChallengeWaves", [](int count) { bossAmbushWaves = count; }); + lua_method(state, "GetCurrentWave", []() { return g_game->ambush.currentWave; }); + lua_functions_add(state, {{"GetNextWave", ambush_next_wave_get}, {"GetNextWaves", ambush_next_waves_get}}); + lua_namespace_plain_end(state); +} + +// (LuaChallengeParam.cpp) Registers REPENTOGON's ChallengeParam, a challenge's rules read only. +static void challenge_param_register(lua_State* state) +{ + using P = ChallengeParam; + lua_class_begin(state, "ChallengeParam", LUA_CLASS_CHALLENGE_PARAM); + lua_method(state, "GetName", [](P& params) { return params.name; }); + lua_functions_add(state, {{"GetRoomFilter", [](lua_State* s) { return lua_array_push(s, lua_get(s, 1).roomset); }}, + {"GetCollectibleList", + [](lua_State* s) { return lua_array_push(s, lua_get(s, 1).collectibleList); }}, + {"GetTrinketList", [](lua_State* s) { return lua_array_push(s, lua_get(s, 1).trinketList); }}, + {"GetAchievementList", + [](lua_State* s) { return lua_array_push(s, lua_get(s, 1).achievementList); }}, + {"GetCollectibleTwinList", + [](lua_State* s) { return lua_array_push(s, lua_get(s, 1).collectibleTwinList); }}}); + lua_method(state, "GetStartingPill", [](P& params) { return params.startingPill; }); + lua_method(state, "GetStartingCard", [](P& params) { return params.startingCard; }); + lua_method(state, "GetEndStage", [](P& params) { return params.endStage; }); + lua_method(state, "GetPlayerType", [](P& params) { return params.playerType; }); + lua_method(state, "GetSoulHearts", [](P& params) { return params.soulHearts; }); + lua_method(state, "GetBlackHearts", [](P& params) { return params.blackHearts; }); + lua_method(state, "GetHearts", [](P& params) { return params.hearts; }); + lua_method(state, "GetMaxHearts", [](P& params) { return params.maxHearts; }); + lua_method(state, "GetCoins", [](P& params) { return params.coins; }); + lua_method(state, "GetAddDamage", [](P& params) { return params.addDamage; }); + lua_method(state, "CanShoot", [](P& params) { return params.isCanShoot; }); + lua_method(state, "IsAltPath", [](P& params) { return params.pathType == PATH_TYPE_CATHEDRAL; }); + lua_method(state, "IsSecretPath", [](P& params) { return params.pathType == PATH_TYPE_REPENTANCE; }); + lua_method(state, "IsBeastPath", [](P& params) { return params.pathType == PATH_TYPE_HOME; }); + lua_method(state, "GetDifficulty", [](P& params) { return params.difficulty; }); + lua_method(state, "IsMegaSatanRun", [](P& params) { return params.isMegaSatan; }); + lua_method(state, "GetMinFireRate", [](P& params) { return params.minFireRate; }); + lua_method(state, "IsMaxDamageEnabled", [](P& params) { return params.isMaxDamage; }); + lua_method(state, "IsMinShotSpeedEnabled", [](P& params) { return params.isMinShotSpeed; }); + lua_method(state, "IsBigRangeEnabled", [](P& params) { return params.isBigRange; }); + lua_method(state, "GetCurse", [](P& params) { return params.getCurse; }); + lua_method(state, "GetCurseFilter", [](P& params) { return params.curseFilter; }); + lua_class_hidden_end(state); + + lua_namespace_begin(state, "DailyChallenge"); + lua_method(state, "GetChallengeParams", []() { return &g_manager->dailyChallenge.params; }); + lua_namespace_plain_end(state); +} + +// GenericPrompt:SetText(lines...): up to five lines, the two title lines then three of body, empty when left out. +static int prompt_text_set(lua_State* state) +{ + GenericPrompt& prompt = lua_get(state, 1); + std::array lines; + for (int line = 0; line < PROMPT_LINES; line++) lines[line] = luaL_optstring(state, line + 2, ""); + prompt.SetText(lines); + return 0; +} + +// (LuaGenericPrompt.cpp) Registers REPENTOGON's GenericPrompt, a yes or no prompt scripts make and draw themselves. +static void generic_prompt_register(lua_State* state) +{ + lua_class_begin(state, "GenericPrompt", LUA_CLASS_GENERIC_PROMPT); + lua_static(state, "__call", [](LuaIgnored) { return GenericPrompt{}; }); + lua_gc_set(state); + lua_method(state, "Initialize", [](GenericPrompt& prompt, LuaOptionalBool isSmall) { + prompt.Initialize(isSmall.value ? PROMPT_SMALL : PROMPT_LARGE); + }); + lua_method(state, "Show", [](GenericPrompt& prompt) { prompt.Show(PROMPT_LOCAL); }); + lua_method(state, "IsActive", [](GenericPrompt& prompt) { return prompt.IsActive(); }); + lua_method(state, "SetImageToVictoryRun", victory_run_prompt_load); + lua_method(state, "Update", [](GenericPrompt& prompt, bool isInputRead) { + prompt.Update(isInputRead ? PROMPT_INPUT_READ : PROMPT_INPUT_SKIP); + }); + lua_method(state, "Render", [](GenericPrompt& prompt) { prompt.Render(); }); + lua_functions_add(state, {{"SetText", prompt_text_set}}); + lua_method(state, "GetSprite", [](GenericPrompt& prompt) { return &prompt.sprite; }); + lua_method(state, "GetCurrentSelection", [](GenericPrompt& prompt) { return prompt.currentSelection; }); + lua_method(state, "GetSubmittedSelection", [](GenericPrompt& prompt) { return prompt.submittedSelection; }); + lua_class_end(state); + + lua_namespace_begin(state, "StageTransition"); + lua_method(state, "SetSameStage", + [](LuaCheckedBool isSameStage) { g_game->stageTransition.isSameStage = isSameStage.value; }); + lua_method(state, "GetSameStage", []() { return g_game->stageTransition.isSameStage; }); + lua_namespace_plain_end(state); +} + +// PlayerManager.FirstTrinketOwner(trinket, lazarus shared = true): an RNG or nil second argument is the old form, +// whose shared flag comes third. +static int trinket_first_owner_get(lua_State* state) +{ + ItemOwnerQuery query = {.id = (int)luaL_checkinteger(state, 1), .isTrinket = true}; + bool isLegacyRng = lua_type(state, 2) == LUA_TUSERDATA && lua_object_test(state, 2, LUA_CLASS_RNG); + if (!isLegacyRng && lua_type(state, 2) != LUA_TNIL) query.isLazarusShared = lua_get>(state, 2).value; + else if (lua_gettop(state) > 2 && lua_type(state, 3) == LUA_TBOOLEAN) query.isLazarusShared = lua_toboolean(state, 3); + lua_push(state, query.first_owner_get()); + return 1; +} + +// PlayerManager.GetRandomCollectibleOwner and GetRandomTrinketOwner(id, seed): an owner drawn by the seed with its RNG +// for the item, or nil twice. +template +static int item_random_owner_get(lua_State* state) +{ + ItemOwnerQuery query = {.id = (int)luaL_checkinteger(state, 1), .isLazarusShared = false, .isTrinket = IsTrinket}; + Entity_Player* owner = query.random_owner_get((uint32_t)luaL_checkinteger(state, 2)); + lua_push(state, owner); + if (!owner) lua_pushnil(state); + else lua_push(state, IsTrinket ? &owner->GetTrinketRNG(query.id) : &owner->GetCollectibleRNG(query.id)); + return 2; +} + +// (LuaPlayerManager.cpp) Registers REPENTOGON's PlayerManager: the run's players, who owns an item (counting Lazarus's +// dead twin for items shared globally), and co-op players joining and leaving. FirstBirthrightOwner, as REPENTOGON's, +// takes a player type and ignores it. +static void player_manager_register(lua_State* state) +{ + lua_namespace_begin(state, "PlayerManager"); + lua_method(state, "FirstCollectibleOwner", [](int id, LuaOptionalBool isLazarusShared) { + return ItemOwnerQuery{.id = id, .isLazarusShared = isLazarusShared.value}.first_owner_get(); + }); + lua_method(state, "AnyoneHasCollectible", [](int id, LuaOptionalBool isIgnoreModifiers) { + return ItemOwnerQuery{.id = id, .isIgnoreModifiers = isIgnoreModifiers.value}.first_owner_get() != nullptr; + }); + lua_method(state, "SpawnCoPlayer2", + [](int playerType) { return g_game->playerManager.SpawnCoPlayer2(playerType); }); + lua_method(state, "IsCoopPlay", []() { return g_game->playerManager.IsCoopPlay(); }); + lua_method(state, "GetNumCollectibles", [](int id, LuaOptionalBool isIgnoreModifiers) { + return ItemOwnerQuery{.id = id, .isIgnoreModifiers = isIgnoreModifiers.value}.total_count_get(); + }); + lua_method(state, "GetTotalTrinketMultiplier", + [](int id) { return ItemOwnerQuery{.id = id, .isTrinket = true}.total_count_get(); }); + lua_functions_add(state, {{"FirstTrinketOwner", trinket_first_owner_get}, + {"GetRandomCollectibleOwner", item_random_owner_get}, + {"GetRandomTrinketOwner", item_random_owner_get}, + {"GetEsauJrState", [](lua_State* s) { + int index = (int)luaL_optinteger(s, 1, 0); + if (index < 0 || index > ESAU_JR_SLOT_LAST) + return luaL_error(s, "Invalid index %d", index); + lua_push(s, g_game->playerManager.esauJrState[index]); + return 1; + }}}); + lua_method(state, "TriggerRoomClear", []() { g_game->playerManager.trigger_room_clear(); }); + lua_method(state, "AnyoneHasTrinket", [](int id, LuaOptionalBool isIgnoreModifiers) { + ItemOwnerQuery query = {.id = id, .isIgnoreModifiers = isIgnoreModifiers.value, .isTrinket = true}; + return query.first_owner_get() != nullptr; + }); + lua_functions_add(state, {{"GetPlayers", + [](lua_State* s) { return lua_array_push(s, g_game->playerManager.playerList); }}}); + lua_method(state, "FirstPlayerByType", + [](uint32_t playerType) { return g_game->playerManager.FirstPlayerByType(playerType); }); + lua_method(state, "AnyoneIsPlayerType", + [](uint32_t playerType) { return g_game->playerManager.FirstPlayerByType(playerType) != nullptr; }); + lua_method(state, "FirstBirthrightOwner", [](uint32_t) { + return ItemOwnerQuery{.id = COLLECTIBLE_BIRTHRIGHT, .isLazarusShared = false}.first_owner_get(); + }); + lua_method(state, "AnyPlayerTypeHasBirthright", [](uint32_t playerType) { + ItemOwnerQuery query = {.playerType = playerType, .id = COLLECTIBLE_BIRTHRIGHT, .isLazarusShared = false}; + return query.first_owner_get() != nullptr; + }); + lua_method(state, "AnyPlayerTypeHasTrinket", [](uint32_t playerType, int id, LuaOptionalBool isIgnore) { + ItemOwnerQuery query = {.playerType = playerType, .id = id, .isIgnoreModifiers = isIgnore.value, + .isLazarusShared = false, .isTrinket = true}; + return query.first_owner_get() != nullptr; + }); + lua_method(state, "AnyPlayerTypeHasCollectible", [](uint32_t playerType, int id, LuaOptionalBool isIgnore) { + ItemOwnerQuery query = {.playerType = playerType, .id = id, .isIgnoreModifiers = isIgnore.value, + .isLazarusShared = false}; + return query.first_owner_get() != nullptr; + }); + // 009bd3b0 takes a baby type it never reads. + lua_method(state, "SpawnSelectedBaby", + [](int, int controllerIndex) { g_game->playerManager.spawn_coop_baby_for_join(controllerIndex); }); + lua_method(state, "RemoveCoPlayer", [](Entity_Player& player) { g_game->playerManager.RemoveCoPlayer(&player); }); + lua_namespace_plain_end(state); +} + +// (LuaHistory.cpp) History:SearchCollectibles and SearchTrinkets(id or table of ids): the history's items of that kind, +// all of them without a filter, a trinket's golden flag ignored. +template +static int history_search(lua_State* state) +{ + History& history = lua_get(state, 1); + std::set ids; + auto id_add = [&](int id) { ids.insert(IsTrinket ? id & TRINKET_ID_MASK : id); }; + if (lua_type(state, 2) == LUA_TTABLE) + { + lua_pushnil(state); + while (lua_next(state, 2)) + { + if (lua_isinteger(state, -1)) id_add((int)lua_tointeger(state, -1)); + lua_pop(state, 1); + } + } + else if (!lua_isnoneornil(state, 2)) id_add((int)luaL_checkinteger(state, 2)); + + std::vector found; + for (const HistoryItem& item : history.historyItems) + { + int id = item.isTrinket ? item.id & TRINKET_ID_MASK : item.id; + if (item.isTrinket == IsTrinket && (ids.empty() || ids.contains(id))) found.push_back(item); + } + return lua_array_push(state, found); +} + +// (LuaHistory.cpp, LuaHistoryItem.cpp, LuaPocketItem.cpp) Registers REPENTOGON's History, HistoryItem and PocketItem. +static void player_classes_register(lua_State* state) +{ + lua_class_begin(state, "History", LUA_CLASS_HISTORY); + lua_method(state, "RemoveHistoryItemByIndex", + [](History& history, int index) { return history.RemoveHistoryItemByIndex(index); }); + lua_functions_add(state, {{"GetCollectiblesHistory", + [](lua_State* s) { return lua_array_push(s, lua_get(s, 1).historyItems); }}, + {"SearchCollectibles", history_search}, + {"SearchTrinkets", history_search}}); + lua_class_hidden_end(state); + + lua_class_begin(state, "HistoryItem", LUA_CLASS_HISTORY_ITEM); + lua_method(state, "GetTime", [](HistoryItem& item) { return item.time; }); + lua_method(state, "GetItemID", [](HistoryItem& item) { return item.id; }); + lua_method(state, "GetLevelStage", [](HistoryItem& item) { return item.levelStage; }); + lua_method(state, "GetStageType", [](HistoryItem& item) { return item.stageType; }); + lua_method(state, "GetRoomType", [](HistoryItem& item) { return item.roomType; }); + lua_method(state, "GetItemPoolType", [](HistoryItem& item) { return item.itemPoolType; }); + lua_method(state, "IsTrinket", [](HistoryItem& item) { return item.isTrinket; }); + lua_class_hidden_end(state); + + lua_class_begin(state, "PocketItem", LUA_CLASS_POCKET_ITEM); + lua_method(state, "GetSlot", [](PocketItem& item) { return item.id; }); + lua_method(state, "GetType", [](PocketItem& item) { return item.type; }); + lua_class_hidden_end(state); +} + +// Adds EntityPlayer:GetHistory and GetPocketItem, which hand out History and PocketItem. +static void player_getters_register(lua_State* state) +{ + lua_rawgetp(state, LUA_REGISTRYINDEX, lua_class_key(LUA_CLASS_PLAYER)); + lua_method(state, "GetHistory", [](Entity_Player& player) { return &player.history; }); + lua_method(state, "GetPocketItem", [](Entity_Player& player, int slot) { return &player.GetPocketItem(slot); }); + lua_pop(state, 1); +} + +// Registers REPENTOGON's game classes and namespaces, after the vanilla API. +void game_classes_register(lua_State* state) +{ + ambush_register(state); + challenge_param_register(state); + generic_prompt_register(state); + player_manager_register(state); + player_classes_register(state); + player_getters_register(state); +} diff --git a/src/repentogon/api_game.h b/src/repentogon/api_game.h new file mode 100644 index 0000000..c2242a9 --- /dev/null +++ b/src/repentogon/api_game.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include +#include + +struct lua_State; + +void game_repentogon_register(lua_State* state); +void seeds_repentogon_register(lua_State* state); +void isaac_game_register(lua_State* state); +void isaac_console_register(lua_State* state); +void game_classes_register(lua_State* state); +void console_classes_register(lua_State* state); +void internals_mod_data_register(lua_State* state); + +void console_command_names_add(std::vector& names); +void console_macro_names_add(std::vector& names); +const std::vector* console_macro_find(std::string_view name); diff --git a/src/repentogon/api_input.cpp b/src/repentogon/api_input.cpp new file mode 100644 index 0000000..8b0d160 --- /dev/null +++ b/src/repentogon/api_input.cpp @@ -0,0 +1,56 @@ +#include "engine/platform.h" +#include "game/game.h" +#include "game/manager.h" +#include "level/backdrop.h" +#include "repentogon/api.h" +#include "repentogon/api_level.h" +#include +#include + +// The controller index Input:GetButtonFrame reads as the keyboard, whose button is its own frame. +constexpr int KEYBOARD_CONTROLLER_INDEX = 0; + +// (LuaInput.cpp) Input.GetActionButtons: the first two buttons a controller has an action on, -1 for none. +static int action_buttons_get(lua_State* state) +{ + int action = (int)luaL_checkinteger(state, 1); + int controller = (int)luaL_checkinteger(state, 2); + ActionBinding buttons = {KAGE::Input::BUTTON_NONE, KAGE::Input::BUTTON_NONE}; + if (auto device = KAGE::Input::manager.device_find(controller)) + buttons = g_manager->keyConfigs.binding_get(*device, action); + lua_pushinteger(state, buttons[0]); + lua_pushinteger(state, buttons[1]); + return 2; +} + +// (LuaInput.cpp) Input.GetDeviceNameByIdx: a controller's name, nil for none. +static int device_name_get(lua_State* state) +{ + auto device = KAGE::Input::manager.device_find((int)luaL_checkinteger(state, 1)); + if (device) lua_pushstring(state, device->name.c_str()); + else lua_pushnil(state); + return 1; +} + +// (LuaInput.cpp) Adds REPENTOGON's Input functions: a controller's name and action buttons, a button's glyph frame and +// the mouse wheel. +void repentogon_input_register(lua_State* state) +{ + lua_functions_add(state, {{"GetActionButtons", action_buttons_get}, {"GetDeviceNameByIdx", device_name_get}}); + lua_method(state, "GetMouseWheel", []() { return vector_make(platform.mouseWheel.x, platform.mouseWheel.y); }); + lua_method(state, "GetButtonFrame", [](int button, int controller) { + return controller == KEYBOARD_CONTROLLER_INDEX ? button : controller_button_to_glyph_frame(button); + }); +} + +// (LuaIsaac.cpp) Adds Isaac.CenterCursor: the mouse moved to the middle of the window while it has the focus. +void repentogon_isaac_input_register(lua_State* state) +{ + lua_method(state, "CenterCursor", []() { + if (!platform.window || SDL_GetKeyboardFocus() != platform.window) return; + int width = 0; + int height = 0; + SDL_GetWindowSize(platform.window, &width, &height); + SDL_WarpMouseInWindow(platform.window, (float)(width / 2), (float)(height / 2)); + }); +} diff --git a/src/repentogon/api_items.cpp b/src/repentogon/api_items.cpp new file mode 100644 index 0000000..16e9a8f --- /dev/null +++ b/src/repentogon/api_items.cpp @@ -0,0 +1,664 @@ +#include "entity/pickup/item_config.h" +#include "entity/pickup/item_pool.h" +#include "entity/pickup/loot_list.h" +#include "entity/pickup/procedural_item_manager.h" +#include "entity/pickup/slot.h" +#include "entity/player/player.h" +#include "game/game.h" +#include "game/manager.h" +#include "repentogon/api.h" +#include "repentogon/api_items.h" +#include "repentogon/items.h" +#include +#include +#include +#include + +// REPENTOGON's item and pool bindings (LuaInterfaces/LuaItemPool.cpp, LuaItemConfig.cpp, LuaWeightedOutcomePicker.cpp, +// ProcedualItems/*.cpp, LuaIsaac.cpp's GetNullItemIdByName and GetCollectibleSpawnPosition and ItemPoolManager.cpp's +// GetPoolIdByName). Without REPENTOGON's custom pools every pool is the game's. + +constexpr int POOL_NULL = -1; +constexpr int DEFAULT_LIST_ITEM = 25; +constexpr uint32_t RANDOM_POOL_WEIGHT_SCALE = 100; +constexpr uint32_t RANDOM_POOL_SHIFT = 35; +constexpr uint32_t PICK_ROLL_SHIFT = 4; +constexpr uint32_t OUTCOME_FLOAT_SCALE = 100; +// The checks CanSpawnCollectible asks IsAvailableEx for: every one, or every one but the unlock. +constexpr uint32_t AVAILABLE_CHECKS_ALL = 0xffffffff; +constexpr uint32_t AVAILABLE_CHECKS_UNLOCKED = 0xfffffffd; +// The chance of the conditions REPENTOGON's GetTriggerChance knows the game scales: often fired, and kills. +constexpr float TRIGGER_CHANCE_FREQUENT = 0.05f; +constexpr float TRIGGER_CHANCE_KILL = 0.2f; +// A fart effect's scale and radius as REPENTOGON reads them. +constexpr float FART_PROPERTY_SCALE = 6; +constexpr float FART_PROPERTY_RADIUS = 85; +constexpr int PROCEDURAL_TARGET_SHIFT = 16; +constexpr int TEAR_FLAG_WORD_BITS = 64; + +// A seed the game can draw from: 0 becomes 1. +static uint32_t seed_valid(uint32_t seed) +{ + return seed == 0 ? 1 : seed; +} + +// ItemPoolManager::IsItemPoolInitialized: whether the pools were loaded for a run. +static bool is_pool_ready(ItemPool& pool) +{ + return !pool.removedCollectibles.empty(); +} + +// ItemPoolManager::GetItemPool: a pool by type, raising "Invalid ItemPoolType" at argument index for none. +static ItemPool_Item& pool_check(lua_State* state, ItemPool& itemPool, int index) +{ + lua_Integer poolType = luaL_checkinteger(state, index); + if (poolType < 0 || poolType >= POOL_COUNT) luaL_argerror(state, index, "Invalid ItemPoolType"); + return itemPool.pools[poolType]; +} + +static bool is_marked(const std::vector& marks, lua_Integer id) +{ + return id >= 0 && (size_t)id < marks.size() && marks[id]; +} + +// Pushes a pool item as REPENTOGON's table of its fields. +static void pool_item_push(lua_State* state, const PoolItem& item) +{ + lua_newtable(state); + lua_pushinteger(state, item.itemId); + lua_setfield(state, -2, "itemID"); + lua_pushnumber(state, item.initialWeight); + lua_setfield(state, -2, "initialWeight"); + lua_pushnumber(state, item.weight); + lua_setfield(state, -2, "weight"); + lua_pushnumber(state, item.decreaseBy); + lua_setfield(state, -2, "decreaseBy"); + lua_pushnumber(state, item.removeOn); + lua_setfield(state, -2, "removeOn"); + lua_pushboolean(state, item.isUnlocked); + lua_setfield(state, -2, "isUnlocked"); +} + +// Pushes the marks of every collectible but the null one, by id. +static int marks_push(lua_State* state, const std::vector& marks) +{ + lua_newtable(state); + for (size_t i = 1; i < marks.size(); i++) + { + lua_pushboolean(state, marks[i]); + lua_rawseti(state, -2, (lua_Integer)i); + } + return 1; +} + +// Reads the pool flags REPENTOGON's draws take: its own shifted past the decrease bit, which the decrease clears. +static uint32_t draw_flags_get(lua_State* state, int index, bool isDecrease) +{ + uint32_t flags = (uint32_t)luaL_optinteger(state, index, 0) << 1; + return isDecrease ? flags : flags | POOL_FLAG_NO_DECREASE; +} + +// ItemPool:GetCollectible: a collectible from a pool, decreasing its weight when asked. +static int pool_collectible_get(lua_State* state) +{ + ItemPool& itemPool = lua_get(state, 1); + lua_Integer poolType = luaL_checkinteger(state, 2); + bool isDecrease = lua_get>(state, 3).value; + uint32_t seed = seed_valid((uint32_t)luaL_optinteger(state, 4, Random())); + int defaultItem = (int)luaL_optinteger(state, 5, 0); + uint32_t flags = draw_flags_get(state, 6, isDecrease); + + if (poolType == POOL_NULL) lua_pushinteger(state, 0); + else + { + pool_check(state, itemPool, 2); + lua_pushinteger(state, itemPool.GetCollectible((ItemPoolType)poolType, seed, flags, defaultItem, POOL_TREASURE)); + } + return 1; +} + +// ItemPool:GetRandomPool: a pool for Chaos, or with an advanced search one drawn by weight among the pools a filter +// lists (a whitelist) or does not. +static int random_pool_get(lua_State* state) +{ + ItemPool& itemPool = lua_get(state, 1); + RNG& rng = lua_get(state, 2); + rng._seed = seed_valid(rng._seed); + if (!lua_get>(state, 3).value) + { + lua_pushinteger(state, itemPool.get_chaos_pool(rng)); + return 1; + } + if (!lua_isnoneornil(state, 4) && !lua_istable(state, 4)) return luaL_argerror(state, 4, "Invalid Filter"); + + bool isWhitelist = lua_get>(state, 5).value; + std::set filter; + if (lua_istable(state, 4)) + for (lua_Integer i = 1; i <= (lua_Integer)lua_rawlen(state, 4); i++) + { + lua_rawgeti(state, 4, i); + filter.insert(luaL_checkinteger(state, -1)); + lua_pop(state, 1); + } + + WeightedOutcomePicker picker; + for (int poolType = 0; poolType < POOL_COUNT; poolType++) + if (isWhitelist == filter.contains(poolType)) + picker.AddOutcomeWeight(poolType, (int)(uint32_t)(itemPool.pools[poolType].totalWeight * RANDOM_POOL_WEIGHT_SCALE)); + rng.Next(); + + RNG pickerRng; + pickerRng.SetSeed(rng._seed, RANDOM_POOL_SHIFT); + lua_pushinteger(state, picker.outcomes.empty() ? POOL_NULL : picker.PickOutcome(pickerRng)); + return 1; +} + +// ItemPool:PickCollectible: the pool item a weighted roll lands on, as a table, or nil. +static int collectible_pick(lua_State* state) +{ + ItemPool& itemPool = lua_get(state, 1); + luaL_checkinteger(state, 2); + bool isDecrease = lua_get>(state, 3).value; + RNG* rng = lua_isnoneornil(state, 4) ? nullptr : &lua_get(state, 4); + uint32_t flags = draw_flags_get(state, 5, isDecrease); + ItemPool_Item& pool = pool_check(state, itemPool, 2); + + RNG roll; + if (rng) rng->_seed = seed_valid(rng->_seed); + else roll.SetSeed(seed_valid(Random()), PICK_ROLL_SHIFT); + float target = (rng ? *rng : roll).RandomFloat() * pool.totalWeight; + + if (PoolItem* item = itemPool.pick_weighted(pool, flags, target)) pool_item_push(state, *item); + else lua_pushnil(state); + return 1; +} + +// ItemPool:GetCollectibleFromList: a collectible from a list, the default when the list is empty. +static int list_collectible_get(lua_State* state) +{ + ItemPool& itemPool = lua_get(state, 1); + if (!lua_istable(state, 2)) return luaL_error(state, "Expected a table as second argument"); + + std::vector list((size_t)lua_rawlen(state, 2)); + if (list.empty()) + { + lua_pushinteger(state, (uint32_t)luaL_optinteger(state, 4, DEFAULT_LIST_ITEM)); + return 1; + } + for (size_t i = 0; i < list.size(); i++) + { + lua_rawgeti(state, 2, (lua_Integer)i + 1); + list[i] = (int)luaL_checkinteger(state, -1); + lua_pop(state, 1); + } + + uint32_t seed = seed_valid((uint32_t)luaL_optinteger(state, 3, Random())); + int defaultItem = (int)(uint32_t)luaL_optinteger(state, 4, DEFAULT_LIST_ITEM); + uint32_t flags = (lua_get>(state, 5).value ? LIST_PICK_BLACKLIST : 0) | + (lua_get>(state, 6).value ? LIST_PICK_BAN_ACTIVES : 0); + lua_pushinteger(state, itemPool.GetCollectibleFromList(list, seed, defaultItem, flags)); + return 1; +} + +// ItemPool:GetCollectiblesFromPool: a pool's items as tables, in its order. +static int pool_collectibles_get(lua_State* state) +{ + ItemPool_Item& pool = pool_check(state, lua_get(state, 1), 2); + lua_newtable(state); + for (size_t i = 0; i < pool.poolList.size(); i++) + { + pool_item_push(state, pool.poolList[i]); + lua_rawseti(state, -2, (lua_Integer)i + 1); + } + return 1; +} + +// ItemPool:CanSpawnCollectible: whether a collectible may be drawn now, its unlock checked unless asked otherwise. +static int collectible_spawn_check(lua_State* state) +{ + ItemPool& itemPool = lua_get(state, 1); + lua_Integer id = luaL_checkinteger(state, 2); + bool isUnlockIgnored = lua_get(state, 3).value; + if (!is_pool_ready(itemPool)) + { + lua_pushboolean(state, false); + return 1; + } + + ItemConfig_Item* item = g_manager->itemConfig.GetCollectible((int)id); + if (!item) return luaL_argerror(state, 2, "Invalid collectible ID"); + bool isBanned = g_game->playerManager.AnyoneHasTrinket(TRINKET_NO) && item->type == ITEM_ACTIVE; + lua_pushboolean(state, !is_marked(itemPool.removedCollectibles, id) && + !is_marked(itemPool.roomBlacklistedCollectibles, id) && + item->IsAvailableEx(isUnlockIgnored ? AVAILABLE_CHECKS_UNLOCKED : AVAILABLE_CHECKS_ALL) && + !isBanned); + return 1; +} + +// ItemPool:AddBibleUpgrade: raises the Bible's chance in a pool, or in every one for the pool count. +static int bible_upgrade_add(lua_State* state) +{ + ItemPool& itemPool = lua_get(state, 1); + int add = (int)luaL_checkinteger(state, 2); + int poolType = (int)luaL_checkinteger(state, 3); + if ((uint32_t)poolType > POOL_COUNT) return luaL_argerror(state, 3, "Invalid ItemPoolType"); + itemPool.AddBibleUpgrade(add, poolType); + return 0; +} + +// ItemPool:ResetCollectible: puts a collectible back in the pools. +static int collectible_reset(lua_State* state) +{ + ItemPool& itemPool = lua_get(state, 1); + lua_Integer id = luaL_checkinteger(state, 2); + if (!is_pool_ready(itemPool)) return 0; + if (id < 0 || id >= (lua_Integer)g_manager->itemConfig.collectibles.size()) + return luaL_argerror(state, 2, "Invalid Collectible"); + itemPool.ResetCollectible((int)id); + return 0; +} + +static int removed_collectibles_get(lua_State* state) +{ + return marks_push(state, lua_get(state, 1).removedCollectibles); +} + +static int blacklisted_collectibles_get(lua_State* state) +{ + return marks_push(state, lua_get(state, 1).roomBlacklistedCollectibles); +} + +static int last_pool_set(lua_State* state) +{ + ItemPool& itemPool = lua_get(state, 1); + pool_check(state, itemPool, 2); + itemPool.lastPool = (int)luaL_checkinteger(state, 2); + return 0; +} + +static int bible_upgrades_get(lua_State* state) +{ + lua_pushinteger(state, pool_check(state, lua_get(state, 1), 2).bibleUpgrade); + return 1; +} + +// Adds REPENTOGON's functions to ItemPool, GetCollectible, GetTrinket, AddRoomBlacklist and AddBibleUpgrade in place of +// the game's. Its virtual and temporary pool items (AddCollectible and the like) need its custom pools. +void item_pool_api_register(lua_State* state) +{ + lua_functions_add(state, {{"GetCollectible", pool_collectible_get}, + {"AddBibleUpgrade", bible_upgrade_add}, + {"GetRandomPool", random_pool_get}, + {"PickCollectible", collectible_pick}, + {"GetCollectibleFromList", list_collectible_get}, + {"GetCollectiblesFromPool", pool_collectibles_get}, + {"CanSpawnCollectible", collectible_spawn_check}, + {"ResetCollectible", collectible_reset}, + {"GetRemovedCollectibles", removed_collectibles_get}, + {"GetRoomBlacklistedCollectibles", blacklisted_collectibles_get}, + {"SetLastPool", last_pool_set}, + {"GetBibleUpgrades", bible_upgrades_get}}); + lua_method(state, "AddRoomBlacklist", [](ItemPool& pool, uint32_t item) { + if (is_pool_ready(pool)) pool.AddRoomBlacklist((int)item); + }); + lua_method(state, "GetTrinket", [](ItemPool& pool, bool isPeek) { + if (!is_pool_ready(pool)) return 0u; + return pool.GetTrinket(isPeek ? TRINKET_DRAW_PEEK : TRINKET_DRAW_TAKE); + }); + lua_method(state, "GetCardEx", [](ItemPool&, uint32_t seed, int special, int rune, int suit, LuaCheckedBool isAny) { + return ItemPool::GetCardEx((int)seed_valid(seed), special, rune, suit, isAny.value); + }); + lua_method(state, "HasCollectible", [](ItemPool& pool, int id) { + return is_pool_ready(pool) && id >= 0 && (size_t)id < g_manager->itemConfig.collectibles.size() && + !is_marked(pool.removedCollectibles, id); + }); + lua_method(state, "HasTrinket", [](ItemPool& pool, int id) { + return is_pool_ready(pool) && (uint32_t)id < g_manager->itemConfig.trinkets.size() && + (uint32_t)id < pool.trinketPoolItems.size() && pool.trinketPoolItems[id].isInPool; + }); + lua_method(state, "GetNumAvailableTrinkets", [](ItemPool& pool) { return pool.numAvailableTrinkets; }); + lua_method(state, "UnidentifyPill", [](ItemPool& pool, int pillColor) { + int color = pillColor & PILL_COLOR_MASK; + if (color < PILL_COLOR_SLOTS) pool.identifiedPillEffects[color] = false; + }); + lua_method(state, "GetPillColor", [](ItemPool& pool, int pillEffect) { + auto color = std::ranges::find(pool.pillEffects, pillEffect); + return color == pool.pillEffects.end() ? -1 : (int)(color - pool.pillEffects.begin()); + }); + lua_method(state, "GetNumItemPools", [](ItemPool&) { return (int)POOL_COUNT; }); +} + +// Pushes words as a Lua array, in order. +static int words_push(lua_State* state, const std::set& words) +{ + lua_newtable(state); + lua_Integer index = 0; + for (const std::string& word : words) + { + lua_pushstring(state, word.c_str()); + lua_rawseti(state, -2, ++index); + } + return 1; +} + +static int custom_tags_get(lua_State* state) +{ + return words_push(state, lua_get(state, 1).customTags); +} + +static int custom_caches_get(lua_State* state) +{ + return words_push(state, lua_get(state, 1).customCaches); +} + +// Adds REPENTOGON's custom tags and caches to ItemConfig.Item. A flying tag makes the item evaluate flight. +void item_api_register(lua_State* state) +{ + lua_functions_add(state, {{"GetCustomTags", custom_tags_get}, {"GetCustomCacheTags", custom_caches_get}}); + lua_method(state, "HasCustomTag", + [](ItemConfig_Item& item, std::string tag) { return item.customTags.contains(tag); }); + lua_method(state, "AddCustomTag", [](ItemConfig_Item& item, std::string tag) { + item.customTags.insert(tag); + if (tag == CUSTOM_TAG_FLYING || tag == CUSTOM_TAG_FLYING_EFFECT) item.cacheFlags |= CACHE_FLYING; + }); + lua_method(state, "RemoveCustomTag", [](ItemConfig_Item& item, std::string tag) { item.customTags.erase(tag); }); + lua_method(state, "HasCustomCacheTag", + [](ItemConfig_Item& item, std::string tag) { return item.customCaches.contains(tag); }); + lua_method(state, "AddCustomCacheTag", + [](ItemConfig_Item& item, std::string tag) { item.customCaches.insert(tag); }); + lua_method(state, "RemoveCustomCacheTag", + [](ItemConfig_Item& item, std::string tag) { item.customCaches.erase(tag); }); +} + +// Costume.SkinColor is the game's field, read and written as an integer as REPENTOGON's is. +void costume_api_register(lua_State* state) +{ + lua_field<&ItemConfig_Costume::skinColor>(state, "SkinColor"); +} + +// Card:GetAvailabilityCondition: the function a mod set to decide whether the card is available, or nil. +static int availability_get(lua_State* state) +{ + ItemConfig_Card& card = lua_get(state, 1); + lua_rawgeti(state, LUA_REGISTRYINDEX, card.availabilityRef.value_or(LUA_NOREF)); + return 1; +} + +static void availability_clear(lua_State* state, ItemConfig_Card& card) +{ + if (card.availabilityRef) luaL_unref(state, LUA_REGISTRYINDEX, *card.availabilityRef); + card.availabilityRef.reset(); +} + +static int availability_set(lua_State* state) +{ + ItemConfig_Card& card = lua_get(state, 1); + luaL_checktype(state, 2, LUA_TFUNCTION); + lua_pushvalue(state, 2); + int ref = luaL_ref(state, LUA_REGISTRYINDEX); + availability_clear(state, card); + card.availabilityRef = ref; + return 0; +} + +static int availability_remove(lua_State* state) +{ + availability_clear(state, lua_get(state, 1)); + return 0; +} + +// Adds REPENTOGON's card weights, hidden flag, modded card front and availability condition to ItemConfig.Card. +void card_api_register(lua_State* state) +{ + lua_property(state, "ModdedCardFront", [](ItemConfig_Card& card) { return card.moddedCardFront; }); + lua_property(state, "Hidden", [](ItemConfig_Card& card) { return card.isHidden; }); + lua_property(state, "InitialWeight", [](ItemConfig_Card& card) { return card.initialWeight; }); + lua_property( + state, "Weight", [](ItemConfig_Card& card) { return card.weight; }, + [](ItemConfig_Card& card, float weight) { card.weight = std::max(weight, 0.0f); }); + lua_functions_add(state, {{"GetAvailabilityCondition", availability_get}, + {"SetAvailabilityCondition", availability_set}, + {"ClearAvailabilityCondition", availability_remove}}); +} + +// PillEffect's EffectClass and EffectSubClass read as integers, as REPENTOGON's getters do. +void pill_effect_api_register(lua_State* state) +{ + lua_field<&ItemConfig_Pill::effectClass>(state, "EffectClass"); + lua_field<&ItemConfig_Pill::effectSubClass>(state, "EffectSubClass"); +} + +// Pushes items as a Lua array. +static void items_push(lua_State* state, const std::vector& items) +{ + lua_newtable(state); + for (size_t i = 0; i < items.size(); i++) + { + lua_push(state, items[i]); + lua_rawseti(state, -2, (lua_Integer)i + 1); + } +} + +static int tagged_items_get(lua_State* state) +{ + ItemConfig& config = lua_get(state, 1); + items_push(state, config.GetTaggedItems((uint32_t)luaL_checkinteger(state, 2))); + return 1; +} + +// Config:GetItemsWithCustomTag: the collectibles, then the trinkets, then the null items with a custom tag, by id. +static int custom_tag_items_get(lua_State* state) +{ + ItemConfig& config = lua_get(state, 1); + std::string tag = luaL_checkstring(state, 2); + std::vector items; + for (auto* list : {&config.collectibles, &config.trinkets, &config.nullItems}) + for (std::unique_ptr& item : *list) + if (item && item->customTags.contains(tag)) items.push_back(item.get()); + items_push(state, items); + return 1; +} + +// Config.CanRerollCollectible: whether the first player may reroll a collectible, else whether it is no quest item. +// It reads its first argument, so it is called with a dot. +static int collectible_reroll_check(lua_State* state) +{ + int id = (int)luaL_checkinteger(state, 1); + std::vector& players = g_game->playerManager.playerList; + bool isPlayer = !players.empty() && players[0] && players[0]->isExists; + lua_pushboolean(state, isPlayer ? players[0]->CanRerollCollectible(id, false) : !ItemConfig::IsQuestItem(id)); + return 1; +} + +// Adds REPENTOGON's functions to ItemConfig.Config. +void item_config_api_register(lua_State* state) +{ + lua_functions_add(state, {{"GetTaggedItems", tagged_items_get}, + {"GetItemsWithCustomTag", custom_tag_items_get}, + {"CanRerollCollectible", collectible_reroll_check}}); +} + +// Adds REPENTOGON's item functions to the Isaac namespace. +void isaac_items_register(lua_State* state) +{ + lua_method(state, "GetCollectibleSpawnPosition", [](Vector& position) { return collectible_spawn_position(position); }); + lua_method(state, "GetNullItemIdByName", [](std::string name) { + for (std::unique_ptr& item : g_manager->itemConfig.nullItems) + if (item && item->name == name) return item->id; + return -1; + }); + lua_method(state, "GetPoolIdByName", [](std::string name) { + auto pool = std::ranges::find(POOL_NAMES, name); + return pool == std::end(POOL_NAMES) ? POOL_NULL : (int)(pool - std::begin(POOL_NAMES)); + }); +} + +// WeightedOutcomePicker:GetOutcomes: each outcome as a table of its Value and Weight. +static int outcomes_get(lua_State* state) +{ + WeightedOutcomePicker& picker = lua_get(state, 1); + lua_newtable(state); + for (size_t i = 0; i < picker.outcomes.size(); i++) + { + lua_newtable(state); + lua_pushinteger(state, (uint32_t)picker.outcomes[i].id); + lua_setfield(state, -2, "Value"); + lua_pushinteger(state, (uint32_t)picker.outcomes[i].weight); + lua_setfield(state, -2, "Weight"); + lua_rawseti(state, -2, (lua_Integer)i + 1); + } + return 1; +} + +// Registers WeightedOutcomePicker, a draw among outcomes by weight that scripts build, with its global constructor. +static void outcome_picker_register(lua_State* state) +{ + lua_class_begin(state, "WeightedOutcomePicker", LUA_CLASS_WEIGHTED_OUTCOME_PICKER); + lua_gc_set(state); + lua_static(state, "__call", [](LuaIgnored) { return WeightedOutcomePicker{}; }); + lua_method(state, "AddOutcomeWeight", [](WeightedOutcomePicker& picker, uint32_t value, uint32_t weight) { + picker.AddOutcomeWeight((int)value, (int)weight); + }); + lua_method(state, "AddOutcomeFloat", + [](WeightedOutcomePicker& picker, uint32_t value, float weight, + LuaDefault scale) { + picker.AddOutcomeWeight((int)value, (int)(uint32_t)(weight * (float)scale.value)); + }); + lua_method(state, "PickOutcome", [](WeightedOutcomePicker& picker, RNG& rng) { + uint32_t outcome = (uint32_t)picker.PickOutcome(rng); + rng.Next(); + return outcome; + }); + lua_method(state, "RemoveOutcome", [](WeightedOutcomePicker& picker, uint32_t value) { + std::erase_if(picker.outcomes, [&](auto& outcome) { return (uint32_t)outcome.id == value; }); + }); + lua_functions_add(state, {{"GetOutcomes", outcomes_get}}); + lua_method(state, "ClearOutcomes", [](WeightedOutcomePicker& picker) { picker.outcomes.clear(); }); + lua_method(state, "GetNumOutcomes", [](WeightedOutcomePicker& picker) { return (int)picker.outcomes.size(); }); + lua_class_end(state); +} + +// ProceduralEffect:GetConditionProperty: the entity a spawn condition waits for. +static int condition_property_get(lua_State* state) +{ + ProceduralEffect& effect = lua_get(state, 1); + lua_newtable(state); + if (effect.condition != CONDITION_ENTITY_SPAWN) return 1; + + lua_pushnumber(state, (int16_t)(effect.spawnTarget >> PROCEDURAL_TARGET_SHIFT)); + lua_setfield(state, -2, "type"); + lua_pushnumber(state, (int16_t)effect.spawnTarget); + lua_setfield(state, -2, "variant"); + return 1; +} + +static void field_set(lua_State* state, const char* name, lua_Integer value) +{ + lua_pushinteger(state, value); + lua_setfield(state, -2, name); +} + +static void field_set(lua_State* state, const char* name, float value) +{ + lua_pushnumber(state, value); + lua_setfield(state, -2, name); +} + +// ProceduralEffect:GetActionProperty: what an action targets, as REPENTOGON reads the effect's action data. A fart's +// scale reads its subtype's bits as a float, as REPENTOGON's does. +static int action_property_get(lua_State* state) +{ + ProceduralEffect& effect = lua_get(state, 1); + lua_newtable(state); + switch (effect.action) + { + case ACTION_USE_ACTIVE_ITEM: + case ACTION_ADD_TEMPORARY_EFFECT: + field_set(state, "id", (lua_Integer)(int)effect.target); + break; + case ACTION_SPAWN_ENTITY: + field_set(state, "type", (lua_Integer)(int16_t)(effect.target >> PROCEDURAL_TARGET_SHIFT)); + field_set(state, "variant", (lua_Integer)(int16_t)effect.target); + break; + case ACTION_CONVERT_ENTITIES: + field_set(state, "fromType", (lua_Integer)(int16_t)(effect.target >> PROCEDURAL_TARGET_SHIFT)); + field_set(state, "fromVariant", (lua_Integer)(int16_t)effect.target); + field_set(state, "toType", (lua_Integer)(int16_t)(effect.convertTarget >> PROCEDURAL_TARGET_SHIFT)); + field_set(state, "toVariant", (lua_Integer)(int16_t)effect.convertTarget); + break; + case ACTION_AREA_DAMAGE: + field_set(state, "radius", effect.radius); + field_set(state, "damage", effect.strength); + field_set(state, "flags1", (lua_Integer)(effect.tearFlags & TearFlags(UINT64_MAX)).to_ullong()); + field_set(state, "flags2", (lua_Integer)(effect.tearFlags >> TEAR_FLAG_WORD_BITS).to_ullong()); + break; + case ACTION_FART: + field_set(state, "scale", std::bit_cast(effect.target) * FART_PROPERTY_SCALE); + field_set(state, "radius", effect.strength * FART_PROPERTY_SCALE / FART_PROPERTY_RADIUS); + break; + } + return 1; +} + +// ProceduralEffect:GetTriggerChance: the effect's chance scale times the chance the game gives its condition. +static float trigger_chance_get(ProceduralEffect& effect) +{ + switch (effect.condition) + { + case CONDITION_TEAR_FIRE: + case CONDITION_ENEMY_HIT: + case CONDITION_ENTITY_SPAWN: return effect.chanceScale * TRIGGER_CHANCE_FREQUENT; + case CONDITION_ENEMY_KILL: return effect.chanceScale * TRIGGER_CHANCE_KILL; + default: return effect.chanceScale; + } +} + +// Registers ProceduralItem, ProceduralEffect and the ProceduralItemManager table, TMTRAINER's glitched items. +static void procedural_register(lua_State* state) +{ + lua_class_begin(state, "ProceduralEffect", LUA_CLASS_PROCEDURAL_EFFECT); + lua_method(state, "GetConditionType", [](ProceduralEffect& effect) { return (int)effect.condition; }); + lua_method(state, "GetActionType", [](ProceduralEffect& effect) { return (int)effect.action; }); + lua_functions_add(state, {{"GetConditionProperty", condition_property_get}, + {"GetActionProperty", action_property_get}}); + lua_method(state, "GetTriggerChance", trigger_chance_get); + lua_method(state, "GetTriggerChanceScale", [](ProceduralEffect& effect) { return effect.chanceScale; }); + lua_method(state, "GetScore", [](ProceduralEffect& effect) { return effect.score; }); + lua_class_hidden_end(state); + + lua_class_begin(state, "ProceduralItem", LUA_CLASS_PROCEDURAL_ITEM); + lua_method(state, "GetItem", [](ProceduralItem& item) { return item.item.get(); }); + lua_method(state, "GetTargetItem", [](ProceduralItem& item) { return item.targetItem; }); + lua_method(state, "GetEffectCount", [](ProceduralItem& item) { return (int)item.effects.size(); }); + lua_method(state, "GetEffect", [](ProceduralItem& item, int index) { + return index >= 0 && (size_t)index < item.effects.size() ? item.effects[index].get() : nullptr; + }); + lua_method(state, "GetID", [](ProceduralItem& item) { return item.index; }); + lua_method(state, "GetDamage", [](ProceduralItem& item) { return item.stats[GLITCHED_DAMAGE]; }); + lua_method(state, "GetFireDelay", [](ProceduralItem& item) { return item.stats[GLITCHED_TEARS]; }); + lua_method(state, "GetSpeed", [](ProceduralItem& item) { return item.stats[GLITCHED_SPEED]; }); + lua_method(state, "GetRange", [](ProceduralItem& item) { return item.stats[GLITCHED_RANGE]; }); + lua_method(state, "GetShotSpeed", [](ProceduralItem& item) { return item.stats[GLITCHED_SHOT_SPEED]; }); + lua_method(state, "GetLuck", [](ProceduralItem& item) { return item.stats[GLITCHED_LUCK]; }); + lua_class_hidden_end(state); + + lua_namespace_begin(state, "ProceduralItemManager"); + lua_method(state, "CreateProceduralItem", [](uint32_t seed, uint32_t flags) { + return g_game->proceduralItemManager.CreateProceduralItem(seed, flags); + }); + lua_method(state, "GetProceduralItemCount", + []() { return (int)g_game->proceduralItemManager.proceduralItems.size(); }); + lua_method(state, "GetProceduralItem", [](int index) { + auto& items = g_game->proceduralItemManager.proceduralItems; + return index >= 0 && (size_t)index < items.size() ? items[index].get() : nullptr; + }); + lua_namespace_plain_end(state); +} + +// Registers REPENTOGON's item classes: LootListEntry, WeightedOutcomePicker and the glitched items'. +void items_classes_register(lua_State* state) +{ + loot_list_entry_register(state); + outcome_picker_register(state); + procedural_register(state); +} diff --git a/src/repentogon/api_items.h b/src/repentogon/api_items.h new file mode 100644 index 0000000..4d9ed55 --- /dev/null +++ b/src/repentogon/api_items.h @@ -0,0 +1,32 @@ +#pragma once + +#include "lua/api.h" + +// REPENTOGON's item, pool, pickup and misc bindings: each register function adds to the class or namespace its caller +// began, the classes_register ones register REPENTOGON's own classes. + +struct LootEntry; +struct ProceduralEffect; +struct ProceduralItem; +struct WeightedOutcomePicker; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_LOOT_LIST_ENTRY; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_PROCEDURAL_EFFECT; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_PROCEDURAL_ITEM; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_WEIGHTED_OUTCOME_PICKER; + +void pickup_api_register(lua_State* state); +void slot_api_register(lua_State* state); +void loot_list_api_register(lua_State* state); +void loot_list_entry_register(lua_State* state); +void item_pool_api_register(lua_State* state); +void item_api_register(lua_State* state); +void costume_api_register(lua_State* state); +void card_api_register(lua_State* state); +void pill_effect_api_register(lua_State* state); +void item_config_api_register(lua_State* state); +void isaac_items_register(lua_State* state); +void items_classes_register(lua_State* state); +void rng_api_register(lua_State* state); +void vector_api_register(lua_State* state); +void options_api_register(lua_State* state); +void isaac_misc_register(lua_State* state); diff --git a/src/repentogon/api_level.cpp b/src/repentogon/api_level.cpp new file mode 100644 index 0000000..eb1153b --- /dev/null +++ b/src/repentogon/api_level.cpp @@ -0,0 +1,907 @@ +#include "repentogon/api_level.h" +#include "classes.h" +#include "game/game.h" +#include "game/manager.h" +#include "level/generator.h" +#include "level/grid/door.h" +#include "level/level.h" +#include "level/room.h" +#include "level/room_config.h" +#include "repentogon/api.h" +#include "repentogon/level.h" +#include +#include +#include + +constexpr int ROOM_TYPE_LAST = 29; +constexpr int STAGE_ID_LAST = STAGE_SLOTS - 1; +constexpr int ROOM_SHAPE_LAST = ROOMSHAPE_ANY; +constexpr int DIFFICULTY_MAX_DEFAULT = 10; +constexpr int DIMENSION_LAST = DIMENSION_COUNT - 1; +constexpr int LEVEL_STATE_FULL_MAP_EFFECT = 10; +constexpr int VANILLA_TRINKET_COUNT = 190; +constexpr int TRINKET_ERROR_ID = 75; +// The seed RoomDescriptor:GetErrorTrinketEffect rolls from the spawn seed with, and its placement seeds' multipliers. +constexpr RNG ERROR_TRINKET_RNG = {0, 2, 7, 25}; +constexpr uint32_t PLACEMENT_SHIFT_INDEX = 35; +constexpr uint32_t PLACEMENT_ROW_FACTOR = 929; +// The prefix GetXMLName drops from a stage's room file, and the folders its two room sets live in. +constexpr std::string_view ROOMS_FOLDER = "rooms/"; +constexpr std::string_view GREED_ROOMS_FOLDER = "rooms/greed/"; + +// A layout slot a script built, which Level:PlaceRoom places. +struct LevelGeneratorEntry +{ + LevelGenerator_Room room; +}; + +// REPENTOGON's floor state: the name Level:SetName gives every floor, Level:SetForceSpecialQuest's choice (-1 none, +// 0 the game's, else the quest of that number), and the stage values Isaac.SetCurrentFloor* replaced, restored when a +// floor starts. +static std::string levelNameOverride; +static int specialQuestForce = 0; +static int musicStage = -1; +static int musicBackup = -1; +static int backdropStage = -1; +static int backdropBackup = -1; +static int nameStage = -1; +static std::string nameBackup; + +// Two door cells across a door: the room's side and the neighbour's (RoomPlacement.h's DoorSourceTarget). +struct DoorLink +{ + XY source{}; + XY target{}; + + bool is_valid() const + { + auto isOnGrid = [](XY cell) { + return cell.x >= 0 && cell.x < LEVEL_GRID_WIDTH && cell.y >= 0 && cell.y < LEVEL_GRID_WIDTH; + }; + return isOnGrid(source) && isOnGrid(target) && (source.x == target.x || source.y == target.y) && + (std::abs(source.x - target.x) == 1 || std::abs(source.y - target.y) == 1); + } + + bool is_linked(const DoorLink& other) const + { + return is_valid() && other.is_valid() && source == other.target && target == other.source; + } +}; + +// The door slots across from a door slot, on the near and far half of a side. +static std::array return_slots_get(int doorSlot) +{ + int slot = (doorSlot + 2) % DIRECTION_COUNT; + return {slot, slot + DIRECTION_COUNT}; +} + +// The cells a door of a room at a grid index joins, thin shapes counted as their full ones when normalized. +static DoorLink door_link_get(int gridIndex, int shape, int doorSlot, bool isNormalized) +{ + if (isNormalized && (shape == ROOMSHAPE_IH || shape == ROOMSHAPE_IV)) shape = ROOMSHAPE_1x1; + else if (isNormalized && shape == ROOMSHAPE_IIV) shape = ROOMSHAPE_1x2; + else if (isNormalized && shape == ROOMSHAPE_IIH) shape = ROOMSHAPE_2x1; + + XY position = XY::NewFromGridIdx(gridIndex); + return {LevelGenerator::get_door_source_position(position, (RoomShape)shape, doorSlot), + LevelGenerator::get_door_target_position(position, (RoomShape)shape, doorSlot, THIN_SHAPES_RESTRICTED)}; +} + +// The rooms around a room of a shape at a grid index, by the door slot they lie beyond. +static std::map neighboring_rooms_get(int gridIndex, int shape, int dimension) +{ + std::map neighbors; + for (int doorSlot = 0; doorSlot < DOOR_SLOT_COUNT; doorSlot++) + { + DoorLink link = door_link_get(gridIndex, shape, doorSlot, true); + if (!link.is_valid()) continue; + + RoomDescriptor* desc = g_game->GetRoomByIdx(link.target.ToGridIdx(), dimension); + if (desc && desc->data) neighbors[doorSlot] = desc; + } + return neighbors; +} + +// What a placement allows: rooms with more than one door, special rooms beside it, and no neighbours at all. +struct PlacementRules +{ + int dimension = -1; + bool isMultipleDoors = true; + bool isSpecialNeighbors = false; + bool isNoNeighbors = false; +}; + +// (RoomPlacement.cpp) Whether a room of a shape and doors fits at a cell: on free cells, its doors joining each +// neighbour's (a boss room never, special rooms only when allowed), within the rules. +static bool room_can_place(int shape, int doorMask, XY cell, const PlacementRules& rules) +{ + if (cell.x < 0 || cell.x >= LEVEL_GRID_WIDTH || cell.y < 0 || cell.y >= LEVEL_GRID_WIDTH) return false; + if (shape < ROOMSHAPE_1x1 || shape >= ROOMSHAPE_ANY) return false; + + for (XY offset : LevelGenerator::get_room_placement_offsets((RoomShape)shape)) + { + XY part = cell + offset; + if (part.x >= LEVEL_GRID_WIDTH || part.y >= LEVEL_GRID_WIDTH) return false; + RoomDescriptor* desc = g_game->GetRoomByIdx(part.ToGridIdx(), rules.dimension); + if (desc && desc->data) return false; + } + + int gridIndex = cell.ToGridIdx(); + std::map neighbors = neighboring_rooms_get(gridIndex, shape, rules.dimension); + if (!rules.isNoNeighbors && neighbors.empty()) return false; + if (doorMask < 0) + { + doorMask = 0; + for (int doorSlot = 0; doorSlot < DOOR_SLOT_COUNT; doorSlot++) + if (LevelGenerator::has_shape_slot((RoomShape)shape, doorSlot, THIN_SHAPES_RESTRICTED)) + doorMask |= 1 << doorSlot; + } + + int doors = 0; + bool isSecretNeighbor = false; + bool isOtherNeighbor = false; + for (auto [doorSlot, neighbor] : neighbors) + { + RoomConfig_Room& data = *neighbor->data; + if (!(doorMask & 1 << doorSlot) || data.type == ROOM_BOSS) return false; + if (!rules.isSpecialNeighbors && data.type > ROOM_DEFAULT && data.type != ROOM_SECRET) return false; + + DoorLink link = door_link_get(gridIndex, shape, doorSlot, true); + bool isJoined = false; + for (int returnSlot : return_slots_get(doorSlot)) + { + if (!(data.doors & 1 << returnSlot)) continue; + if (!link.is_linked(door_link_get(neighbor->gridIndex, data.shape, returnSlot, true))) continue; + + bool isStartDown = returnSlot == DOOR_UP0 && neighbor->gridIndex == g_game->startingRoomIdx && + (g_game->HasPhotoDoor() || g_game->stage == STAGE_DARK_ROOM); + isJoined = !isStartDown; + break; + } + if (!isJoined) return false; + + bool isSecret = data.type == ROOM_SECRET || data.type == ROOM_SUPERSECRET; + isSecretNeighbor |= isSecret; + isOtherNeighbor |= !isSecret; + doors += isSecret ? 0 : 1; + } + if (!rules.isMultipleDoors && doors > 1) return false; + return !isSecretNeighbor || isOtherNeighbor || rules.isSpecialNeighbors; +} + +// (RoomPlacement.cpp) Places a room at a cell when it fits, joins its doors to its neighbours' (the players' room +// gets its door at once), and shows it as the map effects would. Nullptr when it does not fit. +static RoomDescriptor* room_try_place(RoomConfig_Room* config, XY cell, uint32_t seed, const PlacementRules& rules) +{ + if (!config || !room_can_place(config->shape, (int)config->doors, cell, rules)) return nullptr; + + Game& game = *g_game; + LevelGenerator_Room slot; + slot.position = cell; + slot.shape = config->shape; + int dimension = game.currentDimensionIdx; + if (rules.dimension > -1) game.currentDimensionIdx = rules.dimension; + bool isPlaced = game.place_room(slot, config, seed, nullptr); + game.currentDimensionIdx = dimension; + if (!isPlaced) return nullptr; + + RoomDescriptor& desc = game.roomList[game.nbRooms - 1]; + if (!desc.data) return nullptr; + + Room& room = *game.room; + desc.allowedDoors = 0; + for (auto [doorSlot, neighbor] : neighboring_rooms_get(desc.gridIndex, desc.data->shape, rules.dimension)) + { + DoorLink link = door_link_get(desc.gridIndex, desc.data->shape, doorSlot, false); + if (!(desc.data->doors & 1 << doorSlot) || !link.is_valid()) continue; + + for (int returnSlot : return_slots_get(doorSlot)) + { + DoorLink back = door_link_get(neighbor->gridIndex, neighbor->data->shape, returnSlot, false); + if (!back.is_linked(link)) continue; + + desc.doors[doorSlot] = link.target.ToGridIdx(); + desc.allowedDoors |= 1 << doorSlot; + neighbor->doors[returnSlot] = back.target.ToGridIdx(); + neighbor->allowedDoors |= 1 << returnSlot; + if (neighbor != game.GetCurrentRoomDesc() || room.GetDoor(returnSlot)) continue; + + room.MakeDoor(returnSlot); + GridEntity_Door* door = room.GetDoor(returnSlot); + if (!door) continue; + door->targetRoomIdx = desc.safeGridIndex; + door->SetRoomTypes(neighbor->data->type, desc.data->type); + if (room.GetFrameCount() > 0) door->UpdateAnimation(); + if (EntityPtr& outline = room.redDoorOutlines[returnSlot]) + { + outline->Remove(); + outline = nullptr; + } + } + } + + Level& level = game; + int type = desc.data->type; + bool isSecret = type == ROOM_SECRET || type == ROOM_SUPERSECRET; + bool isCompassShown = level.GetStateFlag(LEVEL_STATE_COMPASS_EFFECT) && type > ROOM_DEFAULT && !isSecret && + type != ROOM_ULTRASECRET; + if (level.GetStateFlag(LEVEL_STATE_FULL_MAP_EFFECT) || + (level.GetStateFlag(LEVEL_STATE_BLUE_MAP_EFFECT) && isSecret) || isCompassShown) + desc.displayFlags |= ROOM_DISPLAY_BOX | ROOM_DISPLAY_ICON; + else if (level.GetStateFlag(LEVEL_STATE_MAP_EFFECT)) desc.displayFlags |= ROOM_DISPLAY_BOX; + game.UpdateVisibility(); + return &desc; +} + +// The cells a room of a shape could take to join a room's door. +static std::vector door_placements_get(int shape, RoomDescriptor* room, int doorSlot) +{ + std::vector placements; + if (!room || !room->data || !(room->data->doors & 1 << doorSlot)) return placements; + + DoorLink link = door_link_get(room->gridIndex, room->data->shape, doorSlot, false); + if (!link.is_valid()) return placements; + for (int returnSlot : return_slots_get(doorSlot)) + { + DoorLink back = door_link_get(link.target.ToGridIdx(), shape, returnSlot, false); + if (back.is_valid()) placements.push_back(link.target + (link.target - back.source)); + } + return placements; +} + +// The grid indexes a room of a shape could take beside a room. +static std::set neighbor_placements_find(RoomDescriptor* room, int shape, int doorMask, PlacementRules rules) +{ + std::set found; + if (!room || !room->data) return found; + + rules.dimension = room->dimension; + rules.isNoNeighbors = false; + for (int doorSlot = 0; doorSlot < DOOR_SLOT_COUNT; doorSlot++) + for (XY cell : door_placements_get(shape, room, doorSlot)) + if (room_can_place(shape, doorMask, cell, rules)) found.insert(cell.ToGridIdx()); + return found; +} + +// Pushes a set of integers as an array. +static void integers_push(lua_State* state, const std::set& values) +{ + lua_createtable(state, (int)values.size(), 0); + int i = 1; + for (int value : values) + { + lua_pushinteger(state, value); + lua_rawseti(state, -2, i++); + } +} + +// Pushes rooms by door slot as a table. +static void neighbors_push(lua_State* state, const std::map& neighbors) +{ + lua_newtable(state); + for (auto [doorSlot, desc] : neighbors) + { + lua_push(state, desc); + lua_rawseti(state, -2, doorSlot); + } +} + +// LuaCheckDimension: an optional dimension, -1 for the current one. +static int dimension_check(lua_State* state, int index) +{ + lua_Integer dimension = luaL_optinteger(state, index, -1); + if (dimension < -1 || dimension > DIMENSION_LAST) return luaL_argerror(state, index, "Invalid Dimension"); + return (int)dimension; +} + +// LuaCheckRoomPlacementSeed: an optional seed, a seed from the floor's placement seed and the cell for 0 or none. +static uint32_t placement_seed_check(lua_State* state, int index, int shape, XY cell) +{ + lua_Integer seed = luaL_optinteger(state, index, 0); + if (seed < 0) luaL_argerror(state, index, "Invalid Seed"); + if (seed != 0) return (uint32_t)seed; + + RNG rng{}; + rng.SetSeed((g_game->dungeonPlacementSeed + cell.y * PLACEMENT_ROW_FACTOR) * (cell.x + shape), + PLACEMENT_SHIFT_INDEX); + return std::max(rng.Next(), 1u); +} + +// Reads a room's shape and doors from a RoomConfig.Room argument, or from a shape and optional door mask. Advances +// index past them. +static void shape_doors_read(lua_State* state, int& index, int& shape, int& doorMask, int defaultShape) +{ + if (lua_type(state, index) == LUA_TUSERDATA) + { + RoomConfig_Room* config = lua_get(state, index++); + if (!config) return; + shape = config->shape; + doorMask = (int)config->doors; + return; + } + shape = defaultShape < 0 ? (int)luaL_checkinteger(state, index) : (int)luaL_optinteger(state, index, defaultShape); + doorMask = (int)luaL_optinteger(state, index + 1, -1); + index += 2; +} + +// Level:CanPlaceRoom(config or shape and doors, grid index, dimension, multiple doors, special neighbours, none). +static int room_can_place_check(lua_State* state) +{ + int index = 2; + int shape = 0; + int doorMask = 0; + shape_doors_read(state, index, shape, doorMask, -1); + int gridIndex = (int)luaL_checkinteger(state, index++); + if (gridIndex < 0 || gridIndex >= LEVEL_GRID_CELLS) + { + lua_pushboolean(state, false); + return 1; + } + PlacementRules rules = {.dimension = dimension_check(state, index)}; + rules.isMultipleDoors = lua_get>(state, index + 1).value; + rules.isSpecialNeighbors = lua_get>(state, index + 2).value; + rules.isNoNeighbors = lua_get>(state, index + 3).value; + lua_pushboolean(state, room_can_place(shape, doorMask, XY::NewFromGridIdx(gridIndex), rules)); + return 1; +} + +// Level:TryPlaceRoom(config, grid index, dimension, seed, multiple doors, special neighbours, none). +static int room_place_try(lua_State* state) +{ + RoomConfig_Room& config = lua_get(state, 2); + int gridIndex = (int)luaL_checkinteger(state, 3); + if (gridIndex < 0 || gridIndex >= LEVEL_GRID_CELLS) + { + lua_pushboolean(state, false); + return 1; + } + XY cell = XY::NewFromGridIdx(gridIndex); + PlacementRules rules = {.dimension = dimension_check(state, 4)}; + uint32_t seed = placement_seed_check(state, 5, config.shape, cell); + rules.isMultipleDoors = lua_get>(state, 6).value; + rules.isSpecialNeighbors = lua_get>(state, 7).value; + rules.isNoNeighbors = lua_get>(state, 8).value; + lua_push(state, room_try_place(&config, cell, seed, rules)); + return 1; +} + +// Level:CanPlaceRoomAtDoor(config or shape and doors, room, door slot, multiple doors, special neighbours). +static int room_at_door_can_place_check(lua_State* state) +{ + int index = 2; + int shape = 0; + int doorMask = 0; + shape_doors_read(state, index, shape, doorMask, -1); + RoomDescriptor& room = lua_get(state, index++); + int doorSlot = (int)luaL_checkinteger(state, index++); + PlacementRules rules = {.dimension = room.dimension}; + rules.isMultipleDoors = lua_get>(state, index).value; + rules.isSpecialNeighbors = lua_get>(state, index + 1).value; + std::vector placements = door_placements_get(shape, &room, doorSlot); + lua_pushboolean(state, std::ranges::any_of(placements, [&](XY cell) { + return room_can_place(shape, doorMask, cell, rules); + })); + return 1; +} + +// Level:TryPlaceRoomAtDoor(config, room, door slot, seed, multiple doors, special neighbours): an even seed tries +// the second placement first. +static int room_at_door_place_try(lua_State* state) +{ + RoomConfig_Room& config = lua_get(state, 2); + RoomDescriptor& room = lua_get(state, 3); + if (!room.data) + { + lua_pushboolean(state, false); + return 1; + } + int doorSlot = (int)luaL_checkinteger(state, 4); + DoorLink link = door_link_get(room.gridIndex, room.data->shape, doorSlot, false); + if (!link.is_valid()) + { + lua_pushboolean(state, false); + return 1; + } + uint32_t seed = placement_seed_check(state, 5, config.shape, link.target); + PlacementRules rules = {.dimension = room.dimension}; + rules.isMultipleDoors = lua_get>(state, 6).value; + rules.isSpecialNeighbors = lua_get>(state, 7).value; + + std::vector placements = door_placements_get(config.shape, &room, doorSlot); + if (seed % 2 == 0 && placements.size() > 1) std::swap(placements[0], placements[1]); + RoomDescriptor* placed = nullptr; + for (XY cell : placements) + if ((placed = room_try_place(&config, cell, seed, rules))) break; + lua_push(state, placed); + return 1; +} + +// Level:FindValidRoomPlacementLocations(config or shape and doors, dimension, multiple doors, special neighbours). +static int room_placements_find(lua_State* state) +{ + int index = 2; + int shape = ROOMSHAPE_1x1; + int doorMask = -1; + shape_doors_read(state, index, shape, doorMask, ROOMSHAPE_1x1); + int dimension = dimension_check(state, index); + PlacementRules rules = {.isMultipleDoors = lua_get>(state, index + 1).value, + .isSpecialNeighbors = lua_get>(state, index + 2).value}; + if (dimension < 0) dimension = g_game->currentDimensionIdx; + + std::set found; + for (int i = 0; i < g_game->nbRooms; i++) + { + RoomDescriptor& desc = g_game->roomList[i]; + if (desc.data && desc.dimension == dimension) + found.merge(neighbor_placements_find(&desc, shape, doorMask, rules)); + } + integers_push(state, found); + return 1; +} + +// Level:GetNeighboringRooms(grid index, shape, dimension). +static int level_neighbors_get(lua_State* state) +{ + int gridIndex = (int)luaL_checkinteger(state, 2); + int shape = (int)luaL_checkinteger(state, 3); + neighbors_push(state, neighboring_rooms_get(gridIndex, shape, dimension_check(state, 4))); + return 1; +} + +// RoomDescriptor:GetValidNeighborPlacementLocations(config or shape and doors, multiple doors, special neighbours). +static int descriptor_placements_find(lua_State* state) +{ + RoomDescriptor& desc = lua_get(state, 1); + int index = 2; + int shape = ROOMSHAPE_1x1; + int doorMask = -1; + shape_doors_read(state, index, shape, doorMask, ROOMSHAPE_1x1); + PlacementRules rules = {.isMultipleDoors = lua_get>(state, index).value, + .isSpecialNeighbors = lua_get>(state, index + 1).value}; + integers_push(state, neighbor_placements_find(&desc, shape, doorMask, rules)); + return 1; +} + +// RoomDescriptor.Doors[slot], and its writing. +static int descriptor_door_get(lua_State* state) +{ + RoomDescriptorDoors& doors = lua_get(state, 1); + int slot = (int)luaL_checkinteger(state, 2); + if (slot < 0 || slot >= DOOR_SLOT_COUNT) luaL_error(state, "Invalid door slot %d\n", slot); + lua_pushinteger(state, doors.descriptor->doors[slot]); + return 1; +} + +static int descriptor_door_set(lua_State* state) +{ + RoomDescriptorDoors& doors = lua_get(state, 1); + int slot = (int)luaL_checkinteger(state, 2); + if (slot < 0 || slot >= DOOR_SLOT_COUNT) return luaL_error(state, "Invalid door slot %d\n", slot); + doors.descriptor->doors[slot] = (int)luaL_checkinteger(state, 3); + return 0; +} + +// RoomConfig.GetRoomByStageTypeAndVariant(stage, type, variant, mode). +static int room_by_stage_type_variant_get(lua_State* state) +{ + int count = lua_gettop(state); + if (count < 3) return luaL_error(state, "Expected three parameters, got %d\n", count); + int stage = (int)luaL_checkinteger(state, 1); + if (stage < 0 || stage > STAGE_ID_LAST) + return luaL_error(state, "StageID must be between 0 and 36 (both inclusive), got %d\n", stage); + int type = (int)luaL_checkinteger(state, 2); + if (type < ROOM_DEFAULT || type > ROOM_TYPE_LAST) + return luaL_error(state, "Type must be between 1 and 29 (both inclusive), got %d\n", type); + int variant = (int)luaL_checkinteger(state, 3); + int mode = (int)luaL_optinteger(state, 4, ROOM_MODE_CURRENT); + if (mode < ROOM_MODE_CURRENT - 1 || mode > ROOM_MODE_GREED) mode = ROOM_MODE_CURRENT; + lua_push(state, g_game->roomConfig.GetRoomByStageTypeAndVariant(stage, type, variant, (RoomMode)mode)); + return 1; +} + +// RoomConfig.GetRandomRoom(seed, reduce weight, stage, type, shape, variants, difficulties, doors, subtype, mode). +static int random_room_get(lua_State* state) +{ + auto seed = (uint32_t)(int)luaL_checkinteger(state, 1); + bool isReduced = lua_get(state, 2).value; + int stage = (int)luaL_checkinteger(state, 3); + bool isUnused = stage >= STAGE_ID_GREED_SPECIAL && stage <= STAGE_ID_ULTRA_GREED; + if (stage < 0 || isUnused || stage == STAGE_ID_VOID || stage > STAGE_ID_LAST) + return luaL_error(state, "Invalid stage %d\n", stage); + int type = (int)luaL_checkinteger(state, 4); + if (type < ROOM_DEFAULT || type > ROOM_TYPE_LAST) return luaL_error(state, "Invalid type %d\n", type); + int shape = (int)luaL_optinteger(state, 5, ROOM_SHAPE_LAST); + if (shape < ROOMSHAPE_1x1 || shape > ROOM_SHAPE_LAST) return luaL_error(state, "Invalid shape %d\n", shape); + int minVariant = std::max((int)luaL_optinteger(state, 6, 0), 0); + int maxVariant = (int)luaL_optinteger(state, 7, -1); + if (maxVariant < minVariant && maxVariant >= 0) + return luaL_error(state, "maxVariant is lower than minVariant (min = %d, max = %d)\n", minVariant, maxVariant); + maxVariant = std::max(maxVariant, -1); + int minDifficulty = std::max((int)luaL_optinteger(state, 8, 0), 0); + int maxDifficulty = (int)luaL_optinteger(state, 9, DIFFICULTY_MAX_DEFAULT); + if (maxDifficulty < minDifficulty) + return luaL_error(state, "maxDifficulty is lower than minDifficulty (min = %d, max = %d)\n", minDifficulty, + maxDifficulty); + int doors = (int)luaL_optinteger(state, 10, 0); + if (doors < 0) return luaL_error(state, "Invalid door mask %d\n", doors); + int subtype = (int)luaL_optinteger(state, 11, -1); + if (subtype < -1) return luaL_error(state, "Invalid subtype %d\n", subtype); + int mode = (int)luaL_optinteger(state, 12, ROOM_MODE_CURRENT); + if (mode < ROOM_MODE_CURRENT || mode > ROOM_MODE_GREED) return luaL_error(state, "Invalid mode %d\n", mode); + + RoomQuery query = {.requiredDoors = (uint32_t)doors, + .maxVariant = (uint32_t)maxVariant, + .minVariant = (uint32_t)minVariant, + .mode = (RoomMode)mode, + .shape = (RoomShape)shape, + .maxDifficulty = maxDifficulty, + .minDifficulty = minDifficulty, + .stageId = stage, + .subtype = subtype, + .type = type}; + lua_push(state, g_game->roomConfig.GetRandomRoom(seed, isReduced ? WEIGHT_REDUCE : WEIGHT_KEEP, query)); + return 1; +} + +// RoomConfig.GetStage(stage id): a stage of stages.xml. +static int stage_get(lua_State* state) +{ + int stage = (int)luaL_checkinteger(state, 1); + if (stage < 0 || stage > STAGE_ID_LAST) + return luaL_error(state, "StageID must be between 0 and 36 (both inclusive), got %d\n", stage); + lua_push(state, &g_game->roomConfig.stages[stage]); + return 1; +} + +// RoomConfigStage:SetBackdrop and SetMusic, which read any value as an integer, the music checked against music.xml. +static int stage_backdrop_set(lua_State* state) +{ + lua_get(state, 1).backdrop = (int)lua_tointeger(state, 2); + return 0; +} + +static int stage_music_set(lua_State* state) +{ + RoomConfig_Stage& stage = lua_get(state, 1); + int musicId = (int)lua_tointeger(state, 2); + MusicManager& music = g_manager->musicManager; + if (!music.is_music_id_valid(musicId)) + return luaL_error(state, "Invalid music ID %d. Min = 0, Max = %d", musicId, (int)music.tracks.size() - 1); + stage.musicId = musicId; + return 0; +} + +// The room set mode argument of RoomConfigStage's functions, 0 when left out. +static int room_set_mode_check(lua_State* state) +{ + int mode = (int)luaL_optinteger(state, 2, ROOM_MODE_NORMAL); + if (mode < ROOM_MODE_NORMAL || mode > ROOM_MODE_GREED) luaL_error(state, "Invalid RoomSet mode %d", mode); + return mode; +} + +static int stage_room_set_get(lua_State* state) +{ + RoomConfig_Stage& stage = lua_get(state, 1); + int mode = room_set_mode_check(state); + if (!stage.rooms[mode].isLoaded) g_game->roomConfig.LoadStageBinary(stage.id, (RoomMode)mode); + lua_push(state, RoomConfigSetRef{&stage.rooms[mode]}); + return 1; +} + +static int stage_is_loaded(lua_State* state) +{ + RoomConfig_Stage& stage = lua_get(state, 1); + lua_pushboolean(state, stage.rooms[room_set_mode_check(state)].isLoaded); + return 1; +} + +// RoomConfigSet:Get(index): a room of the set, nil past it or below 0. +static int room_set_get(lua_State* state) +{ + RoomSet& set = *lua_get(state, 1).set; + auto index = (lua_Integer)lua_tointeger(state, 2); + lua_push(state, index >= 0 && index < (lua_Integer)set.configs.size() ? &set.configs[index] : nullptr); + return 1; +} + +// (LuaRoomConfigStage.cpp, LuaRoomConfigSet.cpp) Registers RoomConfigStage, a stage of stages.xml, and +// RoomConfigSet, one of its room sets. +static void room_config_classes_register(lua_State* state) +{ + lua_class_begin(state, "RoomConfigStage", LUA_CLASS_ROOM_CONFIG_STAGE); + lua_functions_add(state, {{"SetBackdrop", stage_backdrop_set}, + {"SetMusic", stage_music_set}, + {"GetRoomSet", stage_room_set_get}, + {"IsLoaded", stage_is_loaded}}); + lua_method(state, "GetBackdrop", [](RoomConfig_Stage& stage) { return stage.backdrop; }); + lua_method(state, "GetMusic", [](RoomConfig_Stage& stage) { return stage.musicId; }); + lua_method(state, "GetID", [](RoomConfig_Stage& stage) { return stage.id; }); + lua_method(state, "GetDisplayName", [](RoomConfig_Stage& stage) { return stage.displayName; }); + lua_method(state, "SetDisplayName", [](RoomConfig_Stage& stage, std::string name) { stage.displayName = name; }); + lua_method(state, "GetPlayerSpot", [](RoomConfig_Stage& stage) { return stage.playerSpot; }); + lua_method(state, "SetPlayerSpot", [](RoomConfig_Stage& stage, std::string spot) { stage.playerSpot = spot; }); + lua_method(state, "GetBossSpot", [](RoomConfig_Stage& stage) { return stage.bossSpot; }); + lua_method(state, "SetBossSpot", [](RoomConfig_Stage& stage, std::string spot) { stage.bossSpot = spot; }); + lua_method(state, "GetSuffix", [](RoomConfig_Stage& stage) { return stage.suffix; }); + lua_method(state, "SetSuffix", [](RoomConfig_Stage& stage, std::string suffix) { stage.suffix = suffix; }); + lua_method(state, "GetXMLName", [](RoomConfig_Stage& stage) { + return stage.rooms[ROOM_MODE_NORMAL].filePath.substr(ROOMS_FOLDER.size()); + }); + lua_method(state, "SetXMLName", [](RoomConfig_Stage& stage, std::string name) { + stage.rooms[ROOM_MODE_NORMAL].filePath = std::string(ROOMS_FOLDER) + name; + stage.rooms[ROOM_MODE_GREED].filePath = std::string(GREED_ROOMS_FOLDER) + name; + }); + lua_class_hidden_end(state); + + lua_class_begin(state, "RoomConfigSet", LUA_CLASS_ROOM_CONFIG_SET); + lua_property(state, "Size", [](RoomConfigSetRef& ref) { return (int)ref.set->configs.size(); }); + lua_functions_add(state, {{"Get", room_set_get}}); + lua_method(state, "__len", [](RoomConfigSetRef& ref) { return (int)ref.set->configs.size(); }); + lua_class_hidden_end(state); +} + +// Pushes a generator's rooms by their indexes as an array of LevelGeneratorRoom. +static void generator_rooms_push(lua_State* state, LevelGenerator& generator, const std::vector& indexes) +{ + lua_newtable(state); + int i = 1; + for (int index : indexes) + { + lua_push(state, &generator.rooms[index]); + lua_rawseti(state, -2, i++); + } +} + +// (LuaLevelGenerator.cpp, LuaLevelGeneratorEntry.cpp) Registers LevelGenerator, a layout as it grows, its rooms as +// LevelGeneratorRoom, and LevelGeneratorEntry, a slot a script builds. +static void level_generator_register(lua_State* state) +{ + lua_class_begin(state, "LevelGenerator", LUA_CLASS_LEVEL_GENERATOR); + lua_functions_add(state, {{"GetAllRooms", + [](lua_State* L) { + LevelGenerator& generator = lua_get(L, 1); + std::vector indexes(generator.rooms.size()); + for (size_t i = 0; i < indexes.size(); i++) indexes[i] = (int)i; + generator_rooms_push(L, generator, indexes); + return 1; + }}, + {"GetDeadEnds", + [](lua_State* L) { + LevelGenerator& generator = lua_get(L, 1); + generator_rooms_push(L, generator, generator.deadEnds); + return 1; + }}, + {"GetNonDeadEnds", [](lua_State* L) { + LevelGenerator& generator = lua_get(L, 1); + generator_rooms_push(L, generator, generator.nonDeadEnds); + return 1; + }}}); + lua_class_hidden_end(state); + + lua_class_begin(state, "LevelGeneratorRoom", LUA_CLASS_LEVEL_GENERATOR_ROOM); + lua_method(state, "GenerationIndex", [](LevelGenerator_Room& room) { return room.generationIndex; }); + lua_method(state, "DoorMask", [](LevelGenerator_Room& room) { return room.doors; }); + lua_method(state, "Column", [](LevelGenerator_Room& room) { return room.position.x; }); + lua_method(state, "Row", [](LevelGenerator_Room& room) { return room.position.y; }); + lua_method(state, "Shape", [](LevelGenerator_Room& room) { return room.shape; }); + lua_functions_add(state, {{"Neighbors", [](lua_State* L) { + integers_push(L, lua_get(L, 1).neighbors); + return 1; + }}}); + lua_method(state, "IsDeadEnd", [](LevelGenerator_Room& room) { return room.isDeadEnd; }); + lua_class_hidden_end(state); + + lua_class_begin(state, "LevelGeneratorEntry", LUA_CLASS_LEVEL_GENERATOR_ENTRY); + lua_gc_set(state); + lua_method(state, "SetColIdx", + [](LevelGeneratorEntry& entry, uint32_t column) { entry.room.position.x = (int)column; }); + lua_method(state, "SetLineIdx", + [](LevelGeneratorEntry& entry, uint32_t line) { entry.room.position.y = (int)line; }); + lua_method(state, "SetAllowedDoors", [](LevelGeneratorEntry& entry, uint32_t doors) { entry.room.doors = doors; }); + lua_class_hidden_end(state); +} + +// (LuaLevel.cpp, LuaLevelGeneratorEntry.cpp) Adds REPENTOGON's Level functions. +void repentogon_level_register(lua_State* state) +{ + lua_functions_add(state, {{"CanPlaceRoom", room_can_place_check}, + {"TryPlaceRoom", room_place_try}, + {"CanPlaceRoomAtDoor", room_at_door_can_place_check}, + {"TryPlaceRoomAtDoor", room_at_door_place_try}, + {"FindValidRoomPlacementLocations", room_placements_find}, + {"GetNeighboringRooms", level_neighbors_get}}); + lua_method(state, "CanSpawnDoorOutline", [](Level& level, int roomIdx, uint32_t doorSlot) { + return level.CanSpawnDoorOutline(roomIdx, (int)doorSlot); + }); + lua_method(state, "HasAbandonedMineshaft", [](Level& level) { return level.HasAbandonedMineshaft(); }); + lua_method(state, "HasMirrorDimension", [](Level& level) { return level.HasMirrorDimension(); }); + lua_method(state, "HasPhotoDoor", [](Level& level) { return level.HasPhotoDoor(); }); + lua_method(state, "SetName", [](Level&, std::string name) { levelNameOverride = name; }); + lua_method(state, "GetDimension", [](Level& level) { return level.currentDimensionIdx; }); + lua_method(state, "GetForceSpecialQuest", [](LuaIgnored) { return specialQuestForce; }); + lua_method(state, "SetForceSpecialQuest", [](LuaIgnored, int quest) { specialQuestForce = quest; }); + lua_method(state, "GetMyosotisPickups", + [](Level& level) -> std::vector& { return level.myosotisPickups; }); + lua_method(state, "GetGreedWavesClearedWithoutRedHeartDamage", + [](Level& level) { return level.greedWavesClearedWithoutRedHeartDamage; }); + lua_method(state, "SetGreedWavesClearedWithoutRedHeartDamage", + [](Level& level, uint32_t waves) { level.greedWavesClearedWithoutRedHeartDamage = (int)waves; }); + lua_method(state, "GetGenerationRNG", [](LuaIgnored) -> RNG& { return g_game->generationRNG; }); + lua_method(state, "PlaceRoom", + [](Level& level, LevelGeneratorEntry& entry, RoomConfig_Room& config, uint32_t seed) { + return level.place_room(entry.room, &config, seed, nullptr); + }); + level_generator_register(state); +} + +// (LuaRoomDescriptor.cpp, LuaRoomConfigRoom.cpp) Adds REPENTOGON's RoomDescriptor functions, AllowedDoors and Doors. +void repentogon_room_descriptor_register(lua_State* state) +{ + lua_property( + state, "AllowedDoors", [](RoomDescriptor& desc) { return (int)desc.allowedDoors; }, + [](RoomDescriptor& desc, int doors) { desc.allowedDoors = (uint32_t)doors; }); + lua_property(state, "Doors", [](RoomDescriptor& desc) { return RoomDescriptorDoors{&desc}; }); + lua_property(state, "BossDeathSeed", [](RoomDescriptor& desc) { return desc.bossDeathSeed; }); + lua_functions_add(state, {{"GetValidNeighborPlacementLocations", descriptor_placements_find}, + {"GetRestrictedGridIndexes", [](lua_State* L) { + integers_push(L, lua_get(L, 1).restrictedGridIndexes); + return 1; + }}}); + lua_method(state, "GetEntitiesSaveState", + [](RoomDescriptor& desc) -> std::vector& { return desc.savedEntities; }); + lua_method(state, "GetDecoSaveState", + [](RoomDescriptor& desc) -> std::vector& { return desc.savedEffects; }); + lua_method(state, "GetGridEntitiesSaveState", + [](RoomDescriptor& desc) -> std::vector& { return desc.savedGridEntities; }); + lua_method(state, "AddRestrictedGridIndex", + [](RoomDescriptor& desc, int gridIndex) { desc.restrictedGridIndexes.insert(gridIndex); }); + lua_method(state, "InitSeeds", [](RoomDescriptor& desc, RNG& rng) { desc.InitSeeds(rng); }); + lua_method(state, "GetDimension", [](RoomDescriptor& desc) { return desc.dimension; }); + lua_functions_add(state, {{"GetNeighboringRooms", [](lua_State* L) { + RoomDescriptor& desc = lua_get(L, 1); + neighbors_push( + L, neighboring_rooms_get(desc.gridIndex, desc.data->shape, desc.dimension)); + return 1; + }}}); + lua_method(state, "GetTaintedKeeperCoinSpawns", [](RoomDescriptor& desc) { return desc.tKeeperCoinSpawns; }); + lua_method(state, "SetTaintedKeeperCoinSpawns", + [](RoomDescriptor& desc, int spawns) { desc.tKeeperCoinSpawns = (int16_t)spawns; }); + lua_method(state, "GetGroup", [](RoomDescriptor& desc) { return desc.group; }); + lua_method(state, "SetGroup", [](RoomDescriptor& desc, int group) { desc.group = group; }); + lua_method(state, "GetErrorTrinketEffect", [](RoomDescriptor& desc) { + if (desc.spawnSeed == 0) return TRINKET_ERROR_ID; + RNG rng = ERROR_TRINKET_RNG; + rng._seed = desc.spawnSeed; + return (int)(rng.Next() % (VANILLA_TRINKET_COUNT - 1)) + 1; + }); + + lua_class_begin(state, "RoomDescriptorDoors", LUA_CLASS_ROOM_DESCRIPTOR_DOORS); + lua_functions_add(state, {{"__index", descriptor_door_get}, {"__newindex", descriptor_door_set}}); + lua_class_hidden_end(state); +} + +// (LuaRoomConfigRoom.cpp) RoomConfig.Room's Mode as an integer, and REPENTOGON's RoomConfig functions with the +// classes they hand out. +void repentogon_room_config_register(lua_State* state) +{ + lua_pushcfunction(state, room_by_stage_type_variant_get); + lua_table_set(state, -2, "GetRoomByStageTypeAndVariant"); + lua_pushcfunction(state, random_room_get); + lua_table_set(state, -2, "GetRandomRoom"); + lua_pushcfunction(state, stage_get); + lua_table_set(state, -2, "GetStage"); + room_config_classes_register(state); +} + +// The stage config the floor plays, from its stage and type. +static RoomConfig_Stage& current_stage_get() +{ + return g_game->roomConfig + .stages[RoomConfig::GetStageID((int)g_game->stage, (int)g_game->stageType, ROOM_MODE_CURRENT)]; +} + +// (StagesStuff.cpp) Isaac.SetCurrentFloorMusic, SetCurrentFloorBackdrop and SetCurrentFloorName: the floor's stage +// config changed until the next floor starts, the playing music or backdrop swapped when it was the stage's. +static int floor_music_set(lua_State* state) +{ + if (!lua_isnumber(state, 1)) + return luaL_error(state, "Expected MusicId as parameter #1, got %s", lua_typename(state, lua_type(state, 1))); + auto musicId = (int)luaL_checknumber(state, 1); + RoomConfig_Stage& stage = current_stage_get(); + MusicManager& music = g_manager->musicManager; + if (musicBackup == -1) + { + musicStage = stage.id; + musicBackup = stage.musicId; + } + if (music.currentMusicId == stage.musicId) + { + constexpr float FLOOR_MUSIC_VOLUME = 0.1f; + music.Play(musicId, FLOOR_MUSIC_VOLUME); + music.UpdateVolume(); + } + stage.musicId = musicId; + return 0; +} + +static int floor_backdrop_set(lua_State* state) +{ + if (!lua_isnumber(state, 1)) + return luaL_error(state, "Expected BackdropId as parameter #1, got %s", + lua_typename(state, lua_type(state, 1))); + auto backdropId = (int)luaL_checknumber(state, 1); + RoomConfig_Stage& stage = current_stage_get(); + if (backdropBackup == -1) + { + backdropStage = stage.id; + backdropBackup = stage.backdrop; + } + Backdrop& backdrop = g_game->room->backdrop; + if ((int)backdrop.backdropId == stage.backdrop) backdrop.Init((uint32_t)backdropId, true); + stage.backdrop = backdropId; + return 0; +} + +static int floor_name_set(lua_State* state) +{ + if (!lua_isstring(state, 1)) + return luaL_error(state, "Expected floorname as parameter #1, got %s", lua_typename(state, lua_type(state, 1))); + RoomConfig_Stage& stage = current_stage_get(); + if (nameStage == -1) + { + nameStage = stage.id; + nameBackup = stage.displayName; + } + stage.displayName = luaL_checkstring(state, 1); + return 0; +} + +// (StagesStuff.cpp, LuaLevelGeneratorEntry.cpp) Adds REPENTOGON's Isaac functions over the floor's stage and layout. +void repentogon_isaac_level_register(lua_State* state) +{ + lua_functions_add(state, {{"SetCurrentFloorMusic", floor_music_set}, + {"SetCurrentFloorBackdrop", floor_backdrop_set}, + {"SetCurrentFloorName", floor_name_set}}); + lua_method(state, "GetCurrentStageConfigId", []() { + return RoomConfig::GetStageID((int)g_game->stage, (int)g_game->stageType, ROOM_MODE_CURRENT); + }); + lua_method(state, "LevelGeneratorEntry", []() { return LevelGeneratorEntry{}; }); +} + +// (CustomCallbacks.cpp, StagesStuff.cpp) Before a floor starts: Level:SetForceSpecialQuest's choice is dropped and the +// stage values Isaac.SetCurrentFloor* replaced come back. +void level_init_pre() +{ + RoomConfig& config = g_game->roomConfig; + specialQuestForce = 0; + if (musicBackup > -1) config.stages[musicStage].musicId = std::exchange(musicBackup, -1); + if (backdropBackup > -1) config.stages[backdropStage].backdrop = std::exchange(backdropBackup, -1); + if (nameStage > -1) config.stages[std::exchange(nameStage, -1)].displayName = nameBackup; +} + +// (LuaLevel.cpp) The name Level:SetName gave every floor, empty for none. +const std::string& level_name_override_get() +{ + return levelNameOverride; +} + +int special_quest_force_get() +{ + return specialQuestForce; +} + +// (LuaLevel.cpp CheckQuest) Whether a floor has a quest, as Level:SetForceSpecialQuest forces it: off the Greed modes, +// past the first three chapters or on the alternate path, the quest forced or its stage (or the one before on an XL +// floor). +bool special_quest_check(int expectedStage, int quest) +{ + constexpr uint32_t QUEST_CHAPTERS_STAGES = 6; + Game& game = *g_game; + if (game.difficulty >= DIFFICULTY_GREED || specialQuestForce < 0) return false; + + bool isPath = game.stage - 1 >= QUEST_CHAPTERS_STAGES || + (!game.Level::GetStateFlag(LEVEL_STATE_SHOVEL_QUEST_TRIGGERED) && game.IsAltPath()); + if (!isPath) return false; + return specialQuestForce == quest || (int)game.stage == expectedStage || + ((int)game.stage == expectedStage - 1 && (game.curses & CURSE_OF_LABYRINTH)); +} diff --git a/src/repentogon/api_level.h b/src/repentogon/api_level.h new file mode 100644 index 0000000..64d9a76 --- /dev/null +++ b/src/repentogon/api_level.h @@ -0,0 +1,60 @@ +#pragma once + +#include "lua/api.h" + +struct Backdrop; +class Camera; +class LevelGenerator; +class PersistentGameData; +struct FXLayers; +struct FXParams; +struct LevelGenerator_Room; +struct LRoomAreaDesc; +struct LRoomTileDesc; +struct RailManager; +struct RoomConfig_Stage; +struct RoomSet; + +// A layout slot a script builds with Isaac.LevelGeneratorEntry and places with Level:PlaceRoom (REPENTOGON's +// LevelGeneratorEntry), kept apart from the generator's own slots, which Lua sees as LevelGeneratorRoom. +struct LevelGeneratorEntry; + +// A stage's room set as RoomConfigStage:GetRoomSet hands it out. +struct RoomConfigSetRef +{ + RoomSet* set = nullptr; +}; + +// The door slots of a room descriptor, as RoomDescriptor.Doors indexes them. +struct RoomDescriptorDoors +{ + RoomDescriptor* descriptor = nullptr; +}; + +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_BACKDROP; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_CAMERA; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_FX_LAYERS; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_FX_PARAMS; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_LEVEL_GENERATOR; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_LEVEL_GENERATOR_ENTRY; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_LEVEL_GENERATOR_ROOM; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_L_ROOM_AREA_DESC; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_L_ROOM_TILE_DESC; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_PERSISTENT_GAME_DATA; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_RAIL_MANAGER; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_ROOM_CONFIG_SET; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_ROOM_CONFIG_STAGE; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_ROOM_DESCRIPTOR_DOORS; + +// Each adds REPENTOGON's functions to the vanilla class or namespace begun last, and registers the classes they +// hand out. +void repentogon_room_register(lua_State* state); +void repentogon_grid_door_register(lua_State* state); +void repentogon_grid_rock_register(lua_State* state); +void repentogon_level_register(lua_State* state); +void repentogon_room_descriptor_register(lua_State* state); +void repentogon_room_config_register(lua_State* state); +void repentogon_isaac_level_register(lua_State* state); +void repentogon_isaac_saves_register(lua_State* state); +void repentogon_input_register(lua_State* state); +void repentogon_isaac_input_register(lua_State* state); diff --git a/src/repentogon/api_misc.cpp b/src/repentogon/api_misc.cpp new file mode 100644 index 0000000..00ee594 --- /dev/null +++ b/src/repentogon/api_misc.cpp @@ -0,0 +1,527 @@ +#include "engine/capsule.h" +#include "engine/platform.h" +#include "engine/seeds.h" +#include "entity/config.h" +#include "entity/effect/effect.h" +#include "entity/npc/basement.h" +#include "entity/npc/npc.h" +#include "game/game.h" +#include "game/manager.h" +#include "game/options_config.h" +#include "level/room.h" +#include "level/room_grid.h" +#include "level/room_render.h" +#include "repentogon/api.h" +#include "repentogon/api_items.h" +#include "repentogon/options.h" +#include "repentogon/repentogon.h" +#include +#include +#include +#include +#include +#include +#include +#include + +// REPENTOGON's RNG, Vector, Options and misc Isaac bindings (LuaInterfaces/LuaRNG.cpp, LuaVector.cpp, LuaOptions.cpp, +// LuaLocalizationStuff.cpp and LuaIsaac.cpp). + +constexpr uint32_t RNG_SHIFT_COUNT = 81; +constexpr int RNG_SHIFT_LAST = 80; +constexpr int RNG_INT_BITS = 32; +constexpr uint32_t CAPSULE_PARTITIONS_ALL = 0xffffffff; +constexpr int SAVE_SLOT_LAST = 3; +constexpr float SFX_VOLUME_STEPS = 10; +// The DWM attributes REPENTOGON refuses: DWMWA_CLOAK and DWMWA_CLOAKED. +constexpr lua_Integer DWM_ATTRIBUTE_CLOAK = 13; +constexpr lua_Integer DWM_ATTRIBUTE_CLOAKED = 14; +constexpr const char* MOD_SAVE_FILE_FORMAT = "/save%d.dat"; + +// The language ids of REPENTOGON's language codes, 0 for an unknown one. +static std::map LANGUAGE_IDS = { + {"en", 0}, {"jp", 2}, {"fr", 3}, {"es", 4}, {"de", 5}, {"it", 6}, {"nl", 7}, {"pt", 8}, {"ru", 10}, + {"kr", 11}, {"zh", 13}, {"fi", 14}, {"sv", 15}, {"da", 16}, {"nn", 17}, {"pl", 18}, {"tr", 19}}; + +// The registry table of Isaac.CreateTimer's functions, by the timer effect running them. +static int timerFunctionsRef = LUA_REF_NONE; +// The title Isaac.SetWindowTitle last added after the game's own. +static std::string moddedWindowTitle; + +// The shift index whose triple an RNG uses, or nil for none. +static int shift_index_get(lua_State* state) +{ + RNG& rng = lua_get(state, 1); + for (uint32_t index = 0; index < RNG_SHIFT_COUNT; index++) + { + RNG shifts; + shifts.SetSeed(1, index); + if (rng._shift1 == shifts._shift1 && rng._shift2 == shifts._shift2 && rng._shift3 == shifts._shift3) + { + lua_pushinteger(state, index); + return 1; + } + } + lua_pushnil(state); + return 1; +} + +// Undoes a right shift and xor of a xorshift step. +static uint32_t shift_right_xor_undo(uint32_t result, uint32_t shift) +{ + uint32_t value = 0; + for (uint32_t i = 0; i < (RNG_INT_BITS + shift - 1) / shift; i++) value = (value >> shift) ^ result; + return value; +} + +static uint32_t shift_left_xor_undo(uint32_t result, uint32_t shift) +{ + uint32_t value = 0; + for (uint32_t i = 0; i < (RNG_INT_BITS + shift - 1) / shift; i++) value = (value << shift) ^ result; + return value; +} + +// The seed before an RNG's current one. +static uint32_t seed_previous(const RNG& rng) +{ + return shift_right_xor_undo(shift_left_xor_undo(shift_right_xor_undo(rng._seed, rng._shift3), rng._shift2), + rng._shift1); +} + +// RNG:RandomInt's draw: below a maximum, or within an inclusive interval for two arguments. +static int random_int_push(lua_State* state, RNG& rng) +{ + int low = (int)luaL_checkinteger(state, 2); + if (lua_gettop(state) != 3) + { + lua_pushinteger(state, rng.RandomInt((uint32_t)low)); + return 1; + } + + int high = (int)luaL_checkinteger(state, 3); + if (low > high) return luaL_argerror(state, 1, "interval is empty"); + lua_pushinteger(state, (int)(rng.RandomInt((uint32_t)(high - low) + 1) + (uint32_t)low)); + return 1; +} + +static int random_int_get(lua_State* state) +{ + return random_int_push(state, lua_get(state, 1)); +} + +static int phantom_int_get(lua_State* state) +{ + RNG copy = lua_get(state, 1); + return random_int_push(state, copy); +} + +// The RNG constructor: a seed and shift index, the game's default ones when left out. +static int rng_construct(lua_State* state) +{ + int seed = (int)luaL_optinteger(state, 2, RNG_SEED_DEFAULT); + int shiftIndex = (int)luaL_optinteger(state, 3, DEFAULT_SHIFT_INDEX); + if (seed == 0) return luaL_error(state, "Invalid seed 0 for RNG object\n"); + if (shiftIndex < 0 || shiftIndex > RNG_SHIFT_LAST) + return luaL_error(state, "Invalid shift index %d for RNG object\n", shiftIndex); + + RNG rng; + rng.SetSeed((uint32_t)seed, (uint32_t)shiftIndex); + lua_push(state, rng); + return 1; +} + +// RNG:SetSeed: a seed above 0 and a shift index up to 80. +static int seed_set(lua_State* state) +{ + RNG& rng = lua_get(state, 1); + uint32_t seed = (uint32_t)luaL_checkinteger(state, 2); + uint32_t shiftIndex = (uint32_t)luaL_optinteger(state, 3, DEFAULT_SHIFT_INDEX); + if (seed == 0) luaL_argerror(state, 2, "RNG seed must be an integer above 0"); + if (shiftIndex > RNG_SHIFT_LAST) luaL_argerror(state, 3, "RNG shift index must be between 0 and 80 (inclusive)"); + rng.SetSeed(seed, shiftIndex); + return 0; +} + +// Adds REPENTOGON's functions and constructor to RNG. +void rng_api_register(lua_State* state) +{ + lua_pushcfunction(state, rng_construct); + lua_table_set(state, -3, "__call"); + lua_functions_add(state, {{"SetSeed", seed_set}, + {"GetShiftIdx", shift_index_get}, + {"RandomInt", random_int_get}, + {"PhantomInt", phantom_int_get}}); + lua_method(state, "PhantomNext", [](RNG& rng) { + RNG copy = rng; + return copy.Next(); + }); + lua_method(state, "Previous", [](RNG& rng) { return rng._seed = seed_previous(rng); }); + lua_method(state, "PhantomPrevious", [](RNG& rng) { return seed_previous(rng); }); + lua_method(state, "PhantomFloat", [](RNG& rng) { + RNG copy = rng; + return copy.RandomFloat(); + }); + lua_method(state, "RandomVector", [](RNG& rng) { + Vector direction = RandomVector(rng._seed); + rng.Next(); + return direction; + }); + lua_method(state, "PhantomVector", [](RNG& rng) { return RandomVector(rng._seed); }); +} + +// Vector's global table: its Zero and One, read-only. +static int vector_globals_get(lua_State* state) +{ + std::string_view name = luaL_checkstring(state, 2); + if (name == "Zero") lua_push(state, vector_make(0, 0)); + else if (name == "One") lua_push(state, vector_make(1, 1)); + else lua_pushnil(state); + return 1; +} + +static int vector_globals_set(lua_State* state) +{ + return luaL_error(state, "Vector table content's is read only"); +} + +static int vector_construct(lua_State* state) +{ + lua_push(state, vector_make((float)luaL_checknumber(state, 2), (float)luaL_checknumber(state, 3))); + return 1; +} + +// Vector's * and /: by a number on either side of a product, or axis by axis between two vectors. +static int vector_multiply(lua_State* state) +{ + int typeA = lua_type(state, 1); + int typeB = lua_type(state, 2); + if (typeA == LUA_TNUMBER) lua_push(state, vector_scale(lua_get(state, 2), (float)luaL_checknumber(state, 1))); + else if (typeB == LUA_TNUMBER) + lua_push(state, vector_scale(lua_get(state, 1), (float)luaL_checknumber(state, 2))); + else if (typeA == typeB && typeA == LUA_TUSERDATA) + { + Vector& a = lua_get(state, 1); + Vector& b = lua_get(state, 2); + lua_push(state, vector_make(a.x * b.x, a.y * b.y)); + } + else + luaL_error(state, "Invalid types for multiplication: %s * %s\n", lua_typename(state, typeA), + lua_typename(state, typeB)); + return 1; +} + +static int vector_divide(lua_State* state) +{ + int typeA = lua_type(state, 1); + int typeB = lua_type(state, 2); + if (typeA == LUA_TNUMBER) return luaL_error(state, "Cannot left multiply a Vector with a number"); + if (typeB == LUA_TNUMBER) + { + float divisor = (float)luaL_checknumber(state, 2); + if (divisor == 0) return luaL_error(state, "Divide by zero"); + Vector& vector = lua_get(state, 1); + lua_push(state, vector_make(vector.x / divisor, vector.y / divisor)); + } + else if (typeA == typeB && typeA == LUA_TUSERDATA) + { + Vector& a = lua_get(state, 1); + Vector& b = lua_get(state, 2); + if (b.x == 0 || b.y == 0) return luaL_error(state, "Divide by zero"); + lua_push(state, vector_make(a.x / b.x, a.y / b.y)); + } + else + luaL_error(state, "Invalid types for division: %s / %s\n", lua_typename(state, typeA), lua_typename(state, typeB)); + return 1; +} + +// Vector:Lerp: moves the vector toward another by t, returning the vector itself. +static int vector_lerp(lua_State* state) +{ + Vector& vector = lua_get(state, 1); + Vector& target = lua_get(state, 2); + float t = (float)luaL_checknumber(state, 3); + vector = vector_add(vector_scale(vector_sub(target, vector), t), vector); + lua_pushvalue(state, 1); + return 1; +} + +// Adds REPENTOGON's constructor, arithmetic and Lerp to Vector, and Zero and One to its global table. +void vector_api_register(lua_State* state) +{ + lua_functions_add(state, {{"__mul", vector_multiply}, {"__div", vector_divide}, {"Lerp", vector_lerp}}); + lua_method(state, "__add", [](Vector& a, Vector& b) { return vector_add(a, b); }); + lua_method(state, "__sub", [](Vector& a, Vector& b) { return vector_sub(a, b); }); + for (auto [name, function] : {std::pair{"__call", vector_construct}, + {"__index", vector_globals_get}, + {"__newindex", vector_globals_set}}) + { + lua_pushcfunction(state, function); + lua_table_set(state, -3, name); + } +} + +// The getters and setters of REPENTOGON's options: the game's, as read, clamped between Low and High or a checked +// boolean, and its own. +template +static auto option_get(LuaIgnored) +{ + return g_manager->optionsConfig.*Member; +} + +template +static void option_set(LuaIgnored, decltype(lua_member_type(Member)) value) +{ + g_manager->optionsConfig.*Member = value; +} + +template +static void option_clamp_set(LuaIgnored, int value) +{ + g_manager->optionsConfig.*Member = std::clamp(value, Low, High); +} + +template +static void option_flag_set(LuaIgnored, LuaCheckedBool value) +{ + g_manager->optionsConfig.*Member = value.value; +} + +template +static bool repentogon_option_get(LuaIgnored) +{ + return repentogonOptions.*Member; +} + +template +static void repentogon_option_set(LuaIgnored, LuaCheckedBool value) +{ + repentogonOptions.*Member = value.value; +} + +// Adds REPENTOGON's options to the Options namespace, and its SFXVolume setter, which rounds to a tenth. +void options_api_register(lua_State* state) +{ + using O = OptionsConfig; + using R = RepentogonOptions; + lua_property(state, "OnlineHUD", option_get<&O::onlineHud>); + lua_property(state, "StreamerMode", option_get<&O::isStreamerMode>); + lua_property(state, "OnlineChatEnabled", option_get<&O::isOnlineChatEnabled>); + lua_property(state, "OnlinePlayerVolume", option_get<&O::onlinePlayerVolume>); + lua_property(state, "OnlinePlayerOpacity", option_get<&O::onlinePlayerOpacity>); + lua_property(state, "OnlineColorSet", option_get<&O::onlineColorSet>); + lua_property(state, "OnlineInputDelay", option_get<&O::onlineInputDelay>); + lua_property(state, "OnlineChatFilterEnabled", option_get<&O::isOnlineFilterEnabled>); + lua_property(state, "Exposure", option_get<&O::exposure>, option_set<&O::exposure>); + lua_property(state, "Brightness", option_get<&O::brightness>, option_set<&O::brightness>); + lua_property(state, "Contrast", option_get<&O::contrast>, option_set<&O::contrast>); + lua_property(state, "BossHPOnBottom", option_get<&O::isBossHpOnBottom>, option_flag_set<&O::isBossHpOnBottom>); + lua_property(state, "TouchMode", option_get<&O::touchMode>, option_set<&O::touchMode>); + lua_property(state, "AimLockEnabled", option_get<&O::isAimLockEnabled>, option_flag_set<&O::isAimLockEnabled>); + lua_property(state, "AscentVoiceOver", option_get<&O::isAscentVoiceover>, option_flag_set<&O::isAscentVoiceover>); + lua_property(state, "WindowWidth", option_get<&O::windowWidth>, option_set<&O::windowWidth>); + lua_property(state, "WindowHeight", option_get<&O::windowHeight>, option_set<&O::windowHeight>); + lua_property(state, "WindowPosX", option_get<&O::windowPosX>, + option_clamp_set<&O::windowPosX, DEFAULT_WINDOW_X, UINT16_MAX>); + lua_property(state, "WindowPosY", option_get<&O::windowPosY>, + option_clamp_set<&O::windowPosY, DEFAULT_WINDOW_Y, UINT16_MAX>); + lua_property(state, "BetterVoidGeneration", repentogon_option_get<&R::isBetterVoidGeneration>, + repentogon_option_set<&R::isBetterVoidGeneration>); + lua_property(state, "HushPanicStateFix", repentogon_option_get<&R::isHushLaserSpeedFix>, + repentogon_option_set<&R::isHushLaserSpeedFix>); + lua_property(state, "StatHUDPlanetarium", repentogon_option_get<&R::isStatHudPlanetarium>, + repentogon_option_set<&R::isStatHudPlanetarium>); + lua_property(state, "QuickRoomClear", repentogon_option_get<&R::isQuickRoomClear>, + repentogon_option_set<&R::isQuickRoomClear>); + lua_property(state, "PreventModUpdates", repentogon_option_get<&R::isPreventModUpdates>); + lua_property( + state, "SFXVolume", [](LuaIgnored) { return g_manager->optionsConfig.sfxVolume; }, + [](LuaIgnored, float volume) { + g_manager->optionsConfig.sfxVolume = std::round(std::clamp(volume, 0.0f, 1.0f) * SFX_VOLUME_STEPS) / SFX_VOLUME_STEPS; + g_manager->sfxManager.ClearVolumeModifier(); + }); +} + +// Pushes entities as a Lua array. +static void entity_list_push(lua_State* state, const std::vector& entities) +{ + lua_newtable(state); + for (size_t i = 0; i < entities.size(); i++) + { + lua_push(state, entities[i]); + lua_rawseti(state, -2, (lua_Integer)i + 1); + } +} + +// Isaac.FindInRadius: the entities within a radius of a position, in the partitions asked for (every one by default). +static int radius_entities_find(lua_State* state) +{ + Vector& position = lua_get(state, 1); + float radius = (float)luaL_checknumber(state, 2); + uint32_t partitions = (uint32_t)luaL_optinteger(state, 3, CAPSULE_PARTITIONS_ALL); + entity_list_push(state, entity_query_radius(position, radius, partitions)); + return 1; +} + +static int capsule_entities_find(lua_State* state) +{ + Capsule& capsule = lua_get(state, 1); + uint32_t partitions = (uint32_t)luaL_optinteger(state, 2, CAPSULE_PARTITIONS_ALL); + entity_list_push(state, entity_query_capsule(capsule, partitions)); + return 1; +} + +// The timer effects' callback: runs the Lua function Isaac.CreateTimer kept for the timer, with it. +static void timer_function_run(Entity_Effect* timer) +{ + lua_State* state = lua_engine_get().state; + lua_rawgeti(state, LUA_REGISTRYINDEX, timerFunctionsRef); + lua_rawgetp(state, -1, timer); + lua_push(state, timer); + lua_pcall(state, 1, 0, 0); + lua_pop(state, 1); +} + +// Isaac.CreateTimer: a timer effect calling a function every delay frames, times more times (0 for once). +static int timer_create(lua_State* state) +{ + if (!lua_isfunction(state, 1)) + return luaL_error(state, "Expected function, got %s", lua_typename(state, lua_type(state, 1))); + + int delay = std::max((int)luaL_checkinteger(state, 2), 1); + int times = (int)luaL_optinteger(state, 3, 0); + if (times < 0) times = 1; + bool isPersistent = lua_get>(state, 4).value; + + Entity_Effect* timer = Entity_Effect::CreateTimer((void*)timer_function_run, (uint32_t)delay, (uint32_t)times, isPersistent); + lua_rawgeti(state, LUA_REGISTRYINDEX, timerFunctionsRef); + lua_pushvalue(state, 1); + lua_rawsetp(state, -2, timer); + lua_pop(state, 1); + lua_push(state, timer); + return 1; +} + +static int clipboard_set(lua_State* state) +{ + const char* text = luaL_checkstring(state, 1); + lua_pushboolean(state, SDL_SetClipboardText(text)); + return lua_toboolean(state, -1) ? 1 : 2; +} + +static int clipboard_get(lua_State* state) +{ + if (!SDL_HasClipboardText()) lua_pushnil(state); + else + { + char* text = SDL_GetClipboardText(); + lua_pushstring(state, text); + SDL_free(text); + } + return 1; +} + +static int loaded_modules_get(lua_State* state) +{ + return lua_getfield(state, LUA_REGISTRYINDEX, LUA_LOADED_TABLE) != LUA_TNIL ? 1 : 0; +} + +// Isaac.SetDwmWindowAttribute: Windows' window attributes, which this build has none of, refusing the cloaking ones. +static int dwm_attribute_set(lua_State* state) +{ + lua_Integer attribute = luaL_optinteger(state, 1, 0); + if (attribute == DWM_ATTRIBUTE_CLOAK) return luaL_error(state, "Usage of DWMWA_CLOAK attribute is prohibited!"); + if (attribute == DWM_ATTRIBUTE_CLOAKED) return luaL_error(state, "Usage of DWMWA_CLOAKED attribute is prohibited!"); + return 0; +} + +// Isaac.SetWindowTitle: the game's title followed by a mod's, or the game's alone for no text. +static int window_title_set(lua_State* state) +{ + static std::string stockTitle = SDL_GetWindowTitle(platform.window); + if (!lua_isstring(state, 1)) + { + SDL_SetWindowTitle(platform.window, stockTitle.c_str()); + return 0; + } + moddedWindowTitle = std::string(luaL_checkstring(state, 1)).substr(0, UINT8_MAX); + SDL_SetWindowTitle(platform.window, (stockTitle + moddedWindowTitle).c_str()); + return 0; +} + +// Isaac.GetLocalizedString: a string of the string table in a language, by id or REPENTOGON's language code. +static int localized_string_get(lua_State* state) +{ + std::string_view category = luaL_checkstring(state, 1); + std::string_view key = luaL_checkstring(state, 2); + if (key.starts_with('#')) key.remove_prefix(1); + int language = lua_type(state, 3) == LUA_TSTRING ? LANGUAGE_IDS[luaL_checkstring(state, 3)] + : (int)luaL_checkinteger(state, 3); + lua_pushstring(state, g_manager->stringTable.get_string(category, language, key).data()); + return 1; +} + +// Isaac.LoadModDataFromFolder: the save data of the current slot a mod folder holds, or nil. +static int folder_mod_data_load(lua_State* state) +{ + std::string_view folder = luaL_checkstring(state, 1); + int slot = (int)g_manager->currentSaveSlot; + bool isSafe = !folder.empty() && folder != "." && folder != ".." && folder.find_first_of("/\\") == folder.npos; + if (slot < 0 || slot > SAVE_SLOT_LAST || !isSafe) + { + lua_pushnil(state); + return 1; + } + + char file[32]; + std::snprintf(file, sizeof(file), MOD_SAVE_FILE_FORMAT, std::max(slot, 1)); + std::ifstream stream(platform.modsSaveDirectory + std::string(folder) + file, std::ios::binary); + if (!stream) + { + lua_pushnil(state); + return 1; + } + std::stringstream data; + data << stream.rdbuf(); + lua_pushstring(state, data.str().c_str()); + return 1; +} + +// Adds REPENTOGON's misc functions to the Isaac namespace, FindInRadius in place of the game's. +void isaac_misc_register(lua_State* state) +{ + lua_newtable(state); + timerFunctionsRef = luaL_ref(state, LUA_REGISTRYINDEX); + lua_functions_add(state, {{"FindInRadius", radius_entities_find}, + {"FindInCapsule", capsule_entities_find}, + {"CreateTimer", timer_create}, + {"SetClipboard", clipboard_set}, + {"GetClipboard", clipboard_get}, + {"GetLoadedModules", loaded_modules_get}, + {"SetDwmWindowAttribute", dwm_attribute_set}, + {"SetWindowTitle", window_title_set}, + {"GetLocalizedString", localized_string_get}, + {"LoadModDataFromFolder", folder_mod_data_load}}); + lua_method(state, "GetDwmWindowAttribute", [](LuaDefault) { return 0; }); + lua_method(state, "GetWindowTitle", []() { return moddedWindowTitle; }); + lua_method(state, "TriggerWindowResize", []() { Manager::ResizeWindowCallback(platform.windowSize); }); + lua_method(state, "FindTargetPit", [](Vector& position, Vector& target, LuaDefault pitIndex) { + return Entity_NPC::FindTargetPit(position, target, (uint32_t)pitIndex.value); + }); + lua_method(state, "GetAxisAlignedUnitVectorFromDir", + [](LuaDefault direction) { return vector_from_direction(direction.value); }); + lua_method(state, "GetBabyIdByName", [](std::string name) { + for (EntityConfig_Baby& baby : g_manager->entityConfig.babies) + if (baby.name == name) return baby.id; + return -1; + }); + lua_method(state, "IsShuttingDown", []() { return isShuttingDown; }); + lua_method(state, "GetNanoTime", []() { + auto now = std::chrono::high_resolution_clock::now().time_since_epoch(); + return (lua_Integer)std::chrono::duration_cast(now).count(); + }); + lua_method(state, "GetString", [](std::string_view category, std::string_view key) { + if (key.starts_with('#')) key.remove_prefix(1); + StringTable& table = g_manager->stringTable; + return std::string(table.get_string(category, table.language, key)); + }); +} diff --git a/src/repentogon/api_npc.cpp b/src/repentogon/api_npc.cpp new file mode 100644 index 0000000..115ccdf --- /dev/null +++ b/src/repentogon/api_npc.cpp @@ -0,0 +1,592 @@ +#include "entity/boss/ai.h" +#include "entity/boss/pool.h" +#include "entity/config.h" +#include "entity/effect/effect.h" +#include "entity/familiar/familiar.h" +#include "entity/npc/alt.h" +#include "entity/npc/basement.h" +#include "entity/npc/npc.h" +#include "entity/pickup/loot_list.h" +#include "entity/player/player.h" +#include "entity/weapon/projectile.h" +#include "entity/weapon/tear.h" +#include "game/game.h" +#include "game/manager.h" +#include "repentogon/api.h" +#include "repentogon/npc.h" +#include "repentogon/options.h" +#include "repentogon/weapons.h" +#include "ui/console.h" +#include + +// REPENTOGON's NPC, Delirium, boss pool and familiar bindings (LuaInterfaces/Entities/LuaEntityNPC.cpp, +// LuaDelirium.cpp, LuaBossPool.cpp, LuaEntityFamiliar.cpp and LuaIsaac.cpp's boss functions). + +constexpr int PROJECTILE_MODE_LAST = 9; +constexpr int SIREN_TYPE = 904; +constexpr int SPAWN_BOSS_TYPE_FIRST = 10; +constexpr int SPAWN_BOSS_TYPE_END = 990; +constexpr int SPAWN_BOSS_SEED_ARG = 7; +constexpr int SPAWN_BOSS_SPAWNER_ARG = 6; +constexpr int DELIRIUM_TYPE_FIRST = 10; +constexpr int DELIRIUM_RAGE_FULL = 0xff; +constexpr int DELIRIUM_TELEPORT_MAX = 0x3ff; +constexpr int DELIRIUM_RAGE_SHIFT = 7; +constexpr int DELIRIUM_TELEPORT_SHIFT = 15; +constexpr int DELIRIUM_AGE_SHIFT = 25; +constexpr int BYTE_BITS = 8; +constexpr int BYTE_MASK = 0xff; +constexpr float BOSS_THROW_Y_OFFSET = -10; +constexpr float MAGGOT_THROW_FALL = -8; +constexpr float MAGGOT_POS_Y_OFFSET = -8; +constexpr float MAGGOT_SHOT_Y_OFFSET = -24; +constexpr float TEAR_EFFECT_DAMAGE = 3.5f; +constexpr float BLOOD_CLOUD_SCALE = 1; +// The familiars hurt by enemies and projectiles though the game says otherwise, and the few the game lets enemy +// shots and lasers hurt. +using FV = Entity_Familiar::Variant; +constexpr std::array ALWAYS_HURT_FAMILIARS = {FV::DIP, FV::TINYTOMA, FV::TINYTOMA_2, FV::MINISAAC, FV::ITEM_WISP, + FV::BLOOD_BABY}; +constexpr std::array PROJECTILE_HURT_FAMILIARS = {FV::DIP, FV::TINYTOMA, FV::TINYTOMA_2, FV::MINISAAC, FV::BLOOD_BABY}; +constexpr std::array HURTABLE_FAMILIARS = {FV::ISAACS_HEART, FV::PUNCHING_BAG, FV::MILK, FV::LOST_SOUL}; +constexpr int VENGEFUL_SPIRIT_WISP = 702; +constexpr int LASER_HURT_WISP = 427; +constexpr const char* TAG_CAN_TAKE_DAMAGE = "familiarcantakedamage"; +constexpr const char* TAG_BLOCK_PROJECTILES = "familiarblockprojectiles"; + +// The forms Delirium:Transform sets for his next change. +static std::map> forcedForms; + +// (ASMDelirium.cpp) Delirium's next form, when Transform forced one. +void delirium_form_force(Entity_NPC& npc, unsigned int& type, unsigned int& variant) +{ + auto forced = forcedForms.find(&npc); + if (forced == forcedForms.end()) return; + std::tie(type, variant) = forced->second; + forcedForms.erase(forced); +} + +// Whether a familiar's custom tags hold a tag. +static bool is_tagged(Entity_Familiar& familiar, const char* tag) +{ + EntityConfig_Entity* config = g_manager->entityConfig.GetEntity(familiar.type, familiar.variant, familiar.subtype); + return config && config->customTags.contains(tag); +} + +template +static bool is_listed(const std::array& variants, int variant) +{ + return std::ranges::find(variants, variant) != variants.end(); +} + +// (FamiliarTags.cpp) Whether enemy shots hurt a familiar: with both damage tags, else the game's own few. +static bool familiar_projectile_hurt_check(Entity_Familiar& familiar) +{ + if (is_tagged(familiar, TAG_CAN_TAKE_DAMAGE) && is_tagged(familiar, TAG_BLOCK_PROJECTILES)) return true; + int variant = familiar.variant; + return is_listed(HURTABLE_FAMILIARS, variant) || variant == FV::ITEM_WISP || + (variant == FV::WISP && familiar.subtype != VENGEFUL_SPIRIT_WISP); +} + +// (FamiliarTags.cpp) Whether enemy lasers hurt a familiar: with the damage tag, else the game's own few. +static bool familiar_laser_hurt_check(Entity_Familiar& familiar) +{ + if (is_tagged(familiar, TAG_CAN_TAKE_DAMAGE)) return true; + int variant = familiar.variant; + return is_listed(HURTABLE_FAMILIARS, variant) || (variant == FV::WISP && familiar.subtype == LASER_HURT_WISP); +} + +// EntityFamiliar:TryAimAtMarkedTarget. With three arguments its target position or nil, else whether it aimed and a +// table of the aim, the direction and the target position. +static int marked_target_aim(lua_State* state) +{ + Entity_Familiar& familiar = lua_get(state, 1); + Vector aim = lua_type(state, 2) == LUA_TUSERDATA ? lua_get(state, 2) : Vector{}; + int direction = (int)luaL_optinteger(state, 3, -1); + Vector target = lua_type(state, 4) == LUA_TUSERDATA ? lua_get(state, 4) : Vector{}; + bool isAimed = familiar.TryAimAtMarkedTarget(aim, direction, &target); + if (lua_gettop(state) == 3) + { + if (isAimed) lua_push(state, target); + else lua_pushnil(state); + return 1; + } + + lua_pushboolean(state, isAimed); + lua_createtable(state, 3, 0); + lua_push(state, aim); + lua_rawseti(state, -2, 1); + lua_pushinteger(state, direction); + lua_rawseti(state, -2, 2); + lua_push(state, target); + lua_rawseti(state, -2, 3); + return 2; +} + +// EntityFamiliar.GetRandomWisp, as a method too, where its RNG is still argument 1. +static int random_wisp_get(lua_State* state) +{ + lua_pushinteger(state, Entity_Familiar::GetRandomWisp(&lua_get(state, 1))); + return 1; +} + +// Adds REPENTOGON's functions to EntityFamiliar, begun last. Its multiplier is asked for each time, so there is no +// cache to invalidate. +void familiar_api_register(lua_State* state) +{ + using F = Entity_Familiar; + lua_method(state, "GetFollowerPriority", [](F& familiar) { return familiar.GetFollowerPriority(); }); + lua_method(state, "GetPathFinder", [](F& familiar) -> PathFinder& { return familiar.pathfinder; }); + lua_method(state, "GetPathfinder", [](F& familiar) -> PathFinder& { return familiar.pathfinder; }); + lua_method(state, "TriggerRoomClear", [](F& familiar) { familiar.TriggerRoomClear(); }); + lua_method(state, "UpdateDirtColor", [](F& familiar) { familiar.UpdateDirtColor(); }); + lua_method(state, "GetDirtColor", [](F& familiar) { return familiar.dirtColor; }); + lua_method(state, "RemoveFromPlayer", [](F& familiar) { familiar.RemoveFromPlayer(true); }); + lua_method(state, "CanCharm", [](F& familiar) { return is_familiar_charmable(familiar); }); + lua_method(state, "IsCharmed", [](F& familiar) { + Entity_Player* player = familiar.player; + return player && player->spawnerType == SIREN_TYPE && player->spawnerVariant == 0; + }); + lua_method(state, "CanBeDamagedByEnemies", [](F& familiar) { + if (familiar.variant == FV::WISP) return familiar.subtype != VENGEFUL_SPIRIT_WISP; + return is_listed(ALWAYS_HURT_FAMILIARS, familiar.variant) || familiar.CanBeDamagedByEnemy(); + }); + lua_method(state, "CanBeDamagedByProjectiles", [](F& familiar) { + return is_listed(PROJECTILE_HURT_FAMILIARS, familiar.variant) || familiar_projectile_hurt_check(familiar); + }); + lua_method(state, "CanBeDamagedByLasers", familiar_laser_hurt_check); + lua_method(state, "CanBlockProjectiles", [](F& familiar) { return familiar.CanBlockProjectiles(); }); + lua_method(state, "GetMoveDelayNum", [](F& familiar) { return familiar.moveDelayNum; }); + lua_method(state, "SetMoveDelayNum", [](F& familiar, int count) { familiar.moveDelayNum = count; }); + lua_method(state, "GetItemConfig", [](F& familiar) { return familiar.item; }); + lua_method(state, "InvalidateCachedMultiplier", [](F&) {}); + lua_method(state, "GetMultiplier", [](F& familiar) { return familiar.GetMultiplier(); }); + lua_method(state, "IsLilDelirium", [](F& familiar) { return familiar.isLilDelirium; }); + lua_method(state, "SetLilDelirium", [](F& familiar, bool isLilDelirium) { + familiar.isLilDelirium = isLilDelirium; + if (isLilDelirium) familiar.delirium_morph(); + }); + lua_functions_add(state, {{"GetRandomWisp", random_wisp_get}, + {"GetWeapon", familiar_weapon_get}, + {"TryAimAtMarkedTarget", marked_target_aim}}); + lua_pushcfunction(state, random_wisp_get); + lua_table_set(state, -3, "GetRandomWisp"); + lua_functions_add(state, {{"GetActiveWeaponEntity", [](lua_State* L) { + Entity_Familiar& familiar = lua_get(L, 1); + if (familiar.weapon) lua_push(L, familiar.weapon->GetMainEntity()); + else lua_pushnil(L); + return 1; + }}, + {"GetActiveWeaponNumFired", [](lua_State* L) { + Entity_Familiar& familiar = lua_get(L, 1); + if (familiar.weapon) lua_pushinteger(L, familiar.weapon->numFired); + else lua_pushnil(L); + return 1; + }}}); +} + +// The shots FireProjectilesEx and FireBossProjectilesEx collect while firing, as a table from 1. +template +static int projectiles_collect(lua_State* state, Fire fire) +{ + std::vector fired; + projectileCapture = &fired; + fire(); + projectileCapture = nullptr; + lua_createtable(state, (int)fired.size(), 0); + for (size_t i = 0; i < fired.size(); i++) + { + lua_push(state, fired[i]); + lua_rawseti(state, -2, (lua_Integer)i + 1); + } + return 1; +} + +static int projectiles_fire(lua_State* state) +{ + Entity_NPC& npc = lua_get(state, 1); + Vector position = lua_get(state, 2); + Vector velocity = lua_get(state, 3); + uint32_t mode = (uint32_t)luaL_checkinteger(state, 4); + if (mode > PROJECTILE_MODE_LAST) return luaL_error(state, "Invalid projectile mode %d\n", (int)mode); + ProjectileParams& params = lua_get(state, 5); + return projectiles_collect(state, [&] { npc.FireProjectiles(position, velocity, (ProjectilesMode)mode, params); }); +} + +static int boss_projectiles_fire(lua_State* state) +{ + Entity_NPC& npc = lua_get(state, 1); + int count = (int)luaL_checkinteger(state, 2); + if (count <= 0) return luaL_error(state, "Invalid amount of projectiles %d\n", count); + Vector target = lua_get(state, 3); + float trajectory = (float)luaL_checknumber(state, 4); + ProjectileParams& params = lua_get(state, 5); + return projectiles_collect(state, [&] { npc.FireBossProjectiles(count, target, trajectory, params); }); +} + +// EntityNPC:FireGridEntity, its backdrop the room's unless given, never above 1. +static int grid_entity_fire(lua_State* state) +{ + Entity_NPC& npc = lua_get(state, 1); + ANM2& sprite = lua_get(state, 2); + GridEntityDesc& desc = lua_get(state, 3); + Vector velocity = lua_get(state, 4); + int backdrop = std::min((int)luaL_optinteger(state, 5, g_game->room->backdropType), 1); + lua_push(state, npc.FireGridEntity(sprite, desc, velocity, backdrop)); + return 1; +} + +// EntityNPC.V1 and V2: the NPC's own vector, which writes reach, or a copy as vanilla's under vanilla parity. +template +static int npc_vector_get(lua_State* state) +{ + Entity_NPC& npc = lua_get(state, 1); + if (repentogonOptions.isVanillaParity) lua_push(state, npc.*Member); + else lua_push(state, &(npc.*Member)); + return 1; +} + +// What a fireplace or shopkeeper drops, drawn for good when asked, and nothing for other NPCs (REPENTOGON's loot +// callbacks, which would fill it, are not run). +static LootList npc_loot_get(Entity_NPC& npc, bool isAdvance) +{ + if (npc.type == ENTITY_FIREPLACE) return npc.fireplace_get_loot(isAdvance); + if (npc.type == ENTITY_SHOPKEEPER) return {shopkeeper_loot_get(npc, isAdvance)}; + return {}; +} + +// EntityNPC:IsBossColor, whether its subtype picks one of its bosscolors.xml colors. +static bool is_boss_color(Entity_NPC& npc) +{ + EntityConfig_Entity* config = g_manager->entityConfig.GetEntity(npc.type, npc.variant, 0); + return config && config->variant == npc.variant && npc.subtype > 0 && + (int)config->bossColors.size() > npc.subtype - 1; +} + +// Adds REPENTOGON's functions to EntityNPC, begun last, V1 and V2 as the vectors themselves, and its static throws. +// PlaySound's arguments past the sound are optional. +void npc_api_register(lua_State* state) +{ + using N = Entity_NPC; + lua_method(state, "PlaySound", + [](N& npc, int id, LuaDefault volume, LuaDefault delay, + LuaOptionalBool isLoop, LuaDefault pitch) { + npc.PlaySound(id, volume.value, delay.value, isLoop.value, pitch.value); + }); + lua_method(state, "SpawnBloodCloud", + [](N& npc, LuaOptionalObject position, LuaOptionalObject color) { + return npc.MakeBloodCloud(position.value ? *position.value : npc.pos, + color.value ? *color.value : COLOR_DEFAULT, BLOOD_CLOUD_SCALE); + }); + lua_method(state, "UpdateDirtColor", + [](N& npc, LuaCheckedBool isImmediate) { npc.UpdateDirtColor(isImmediate.value); }); + lua_method(state, "GetDirtColor", [](N& npc) { return npc.dirtColor; }); + lua_method(state, "GetControllerId", [](N& npc) { return (lua_Number)npc.controllerID; }); + lua_method(state, "SetControllerId", [](N& npc, lua_Number id) { npc.controllerID = (int)id; }); + lua_method(state, "TryForceTarget", [](N& npc, Entity& target, int duration) { + return npc.TryForceTarget(&target, duration); + }); + lua_functions_add(state, {{"FireGridEntity", grid_entity_fire}, + {"FireProjectilesEx", projectiles_fire}, + {"FireBossProjectilesEx", boss_projectiles_fire}}); + lua_pushcfunction(state, [](lua_State* L) { + std::vector& hitList = lua_get(L, 1).hitList; + lua_createtable(L, (int)hitList.size(), 0); + for (size_t i = 0; i < hitList.size(); i++) + { + lua_pushinteger(L, hitList[i]); + lua_rawseti(L, -2, (lua_Integer)i + 1); + } + return 1; + }); + lua_table_set(state, -2, "GetHitList"); + lua_method(state, "GetShieldStrength", [](N& npc) { return npc.shieldStrength; }); + lua_method(state, "SetShieldStrength", [](N& npc, float strength) { npc.shieldStrength = strength; }); + lua_method(state, "TryThrow", [](N& npc, EntityRef& source, Vector direction, float force) { + return npc.TryThrow(source, direction, force); + }); + lua_functions_add(state, {{"GetFlyingOverride", [](lua_State* L) { + Entity_NPC& npc = lua_get(L, 1); + if (npc.flyingOverride) lua_pushboolean(L, *npc.flyingOverride); + else lua_pushnil(L); + return 1; + }}}); + lua_method(state, "SetFlyingOverride", + [](N& npc, LuaCheckedBool isFlying) { npc.flyingOverride = isFlying.value; }); + lua_method(state, "ClearFlyingOverride", [](N& npc) { npc.flyingOverride.reset(); }); + lua_method(state, "ApplyTearflagEffects", + [](N& npc, Vector position, TearFlags& flags, Entity* source, + LuaDefault damage) { + Entity_Tear::ApplyTearFlagEffects(&npc, position, flags, source, std::max(damage.value, 0.0f)); + }); + lua_method(state, "IsBossColor", is_boss_color); + lua_method(state, "GetDarkRedChampionRegenTimer", [](N& npc) { return npc.championRegenTimer; }); + lua_method(state, "GetSirenPlayerEntity", + [](N& npc) { return npc.type == SIREN_TYPE ? npc.sirenPlayerEntity : nullptr; }); + lua_method(state, "TrySplit", [](N& npc, float damage, EntityRef& source, LuaOptionalBool isScreenEffects) { + return npc.split(damage, source, isScreenEffects.value); + }); + lua_method(state, "ReplaceSpritesheet", + [](N& npc, int layerId, std::string sheet, LuaOptionalBool isLoadGraphics) { + bool isChampionSheet = false; + std::string path = npc.translate_gfx_path(sheet, isChampionSheet); + bool isReplaced = npc.sprite.ReplaceSpritesheet(layerId, path); + if (isReplaced && isLoadGraphics.value) npc.sprite.LoadGraphics(); + return isReplaced; + }); + lua_method(state, "GetPathfinder", [](N& npc) -> PathFinder& { return npc.pathfinder; }); + lua_method(state, "UpdatePickupGhosts", [](N& npc) { npc.UpdatePickupGhosts(); }); + lua_method(state, "GetLootList", + [](N& npc, LuaOptionalBool isAdvance) { return npc_loot_get(npc, isAdvance.value); }); + lua_method(state, "GetFireplaceLoot", + [](N& npc, LuaOptionalBool isAdvance) { return npc.fireplace_get_loot(isAdvance.value); }); + lua_method(state, "GetShopkeeperLoot", [](N& npc, LuaOptionalBool isAdvance) { + return LootList{shopkeeper_loot_get(npc, isAdvance.value)}; + }); + for (auto [name, getter] : + {std::pair{"V1", npc_vector_get<&Entity_NPC::v1>}, {"V2", npc_vector_get<&Entity_NPC::v2>}}) + { + lua_pushcfunction(state, getter); + lua_property_set(state, "__propget", name); + } + + lua_static(state, "ThrowMaggot", + [](Vector origin, Vector velocity, LuaDefault yOffset, + LuaDefault fallSpeed) { + return small_maggot_spawn(origin, yOffset.value, velocity, fallSpeed.value); + }); + lua_static(state, "ThrowMaggotAtPos", + [](Vector origin, Vector target, LuaDefault yOffset) { + return small_maggot_jump_spawn(origin, yOffset.value, target); + }); + lua_static(state, "ShootMaggotProjectile", + [](Vector origin, Vector direction, LuaDefault fallSpeed, + LuaDefault yOffset) { + return small_maggot_fling(origin, yOffset.value, direction, fallSpeed.value); + }); + lua_static(state, "ThrowStrider", [](Vector origin, LuaOptionalObject spawner, Vector target) { + return Entity_NPC::ThrowStrider(origin, spawner.value, target); + }); + lua_static(state, "ThrowRockSpider", + [](Vector origin, LuaOptionalObject spawner, Vector target, LuaDefault variant, + LuaDefault yOffset) { + auto kind = (RockSpiderKind)variant.value; + return rock_spider_throw(origin, target, spawner.value, kind, yOffset.value); + }); + lua_static(state, "ThrowLeech", + [](Vector origin, LuaOptionalObject spawner, Vector target, + LuaDefault yOffset, LuaOptionalBool isBig) { + return leech_throw({.position = origin, + .target = target, + .spawner = spawner.value, + .height = yOffset.value, + .isBig = isBig.value}); + }); +} + +// Delirium's clock as REPENTOGON's DeliriumCycleID packs it: his rage odds, rage, teleport timer and form age. +static uint32_t delirium_cycle_get(Entity_NPC& npc) +{ + return npc.deliriumRageChance | npc.deliriumRageTimer << DELIRIUM_RAGE_SHIFT | + npc.deliriumTeleportTimer << DELIRIUM_TELEPORT_SHIFT | npc.deliriumFormAge << DELIRIUM_AGE_SHIFT; +} + +static void delirium_cycle_set(Entity_NPC& npc, uint32_t cycle) +{ + npc.deliriumRageChance = cycle; + npc.deliriumRageTimer = cycle >> DELIRIUM_RAGE_SHIFT; + npc.deliriumTeleportTimer = cycle >> DELIRIUM_TELEPORT_SHIFT; + npc.deliriumFormAge = cycle >> DELIRIUM_AGE_SHIFT; +} + +// Delirium's shots as REPENTOGON's DeliriumAttackID packs them: the pattern, the volleys left, the odds of keeping +// the pattern and the frame, from the low byte. +static uint32_t delirium_attack_get(Entity_NPC& npc) +{ + return npc.deliriumAttackPattern | npc.deliriumAttackRepeats << BYTE_BITS | + npc.deliriumAttackKeepChance << 2 * BYTE_BITS | (uint32_t)npc.deliriumAttackFrame << 3 * BYTE_BITS; +} + +static void delirium_attack_set(Entity_NPC& npc, uint32_t attack) +{ + npc.deliriumAttackPattern = attack & BYTE_MASK; + npc.deliriumAttackRepeats = attack >> BYTE_BITS & BYTE_MASK; + npc.deliriumAttackKeepChance = attack >> 2 * BYTE_BITS & BYTE_MASK; + npc.deliriumAttackFrame = attack >> 3 * BYTE_BITS & BYTE_MASK; +} + +// Delirium:Transform, into a type from the first enemy on at his next change. +static int delirium_transform(lua_State* state) +{ + Entity_NPC& npc = lua_get(state, 1); + int type = (int)luaL_checkinteger(state, 2); + if (type < DELIRIUM_TYPE_FIRST) return luaL_error(state, "Invalid EntityType %d for Delirium\n", type); + forcedForms[&npc] = {(uint32_t)type, (uint32_t)luaL_optinteger(state, 3, 0)}; + npc.deliriumTransformationTimer = 1; + return 0; +} + +// Delirium:SetTeleportationTimer, from 0 to 1023. +static int delirium_teleport_set(lua_State* state) +{ + Entity_NPC& npc = lua_get(state, 1); + lua_Integer timer = luaL_checkinteger(state, 2); + if (timer < 0) return luaL_error(state, "Invalid transformation timer %I (positive number required)\n", timer); + if (timer > DELIRIUM_TELEPORT_MAX) + return luaL_error(state, "Invalid transformation timer %I (max value %I)\n", timer, + (lua_Integer)DELIRIUM_TELEPORT_MAX); + npc.deliriumTeleportTimer = (uint32_t)timer; + return 0; +} + +// Adds REPENTOGON's functions and properties to EntityDelirium, begun last. +void delirium_api_register(lua_State* state) +{ + using N = Entity_NPC; + lua_functions_add(state, {{"Transform", delirium_transform}, {"SetTeleportationTimer", delirium_teleport_set}}); + lua_method(state, "IsRedMode", [](N& npc) { return npc.deliriumRageTimer != 0; }); + lua_method(state, "SetRedMode", [](N& npc, bool isOn) { npc.deliriumRageTimer = isOn ? DELIRIUM_RAGE_FULL : 0; }); + lua_method(state, "GetTeleportationTimer", [](N& npc) { return (uint32_t)npc.deliriumTeleportTimer; }); + lua_property(state, "BossType", [](N& npc) { return npc.deliriumBossType; }); + lua_property(state, "BossVariant", [](N& npc) { return npc.deliriumBossVariant; }); + lua_property( + state, "TransformationTimer", [](N& npc) { return npc.deliriumTransformationTimer; }, + [](N& npc, lua_Integer timer) { npc.deliriumTransformationTimer = (uint16_t)timer; }); + lua_property( + state, "RemainingAttacks", [](N& npc) { return npc.deliriumRemainingAttacks; }, + [](N& npc, lua_Integer count) { npc.deliriumRemainingAttacks = (uint8_t)count; }); + lua_property(state, "AttackID", delirium_attack_get, + [](N& npc, lua_Integer attack) { delirium_attack_set(npc, (uint32_t)attack); }); + lua_property(state, "Cycle", delirium_cycle_get, + [](N& npc, lua_Integer cycle) { delirium_cycle_set(npc, (uint32_t)cycle); }); + lua_property( + state, "StateD", [](N& npc) { return npc.deliriumState; }, + [](N& npc, lua_Integer deliriumState) { npc.deliriumState = (uint8_t)deliriumState; }); + lua_property( + state, "Angle", [](N& npc) { return npc.deliriumAttackAngle; }, + [](N& npc, lua_Integer angle) { npc.deliriumAttackAngle = (uint8_t)angle; }); +} + +// BossPoolManager.GetPool, for a stage id from 0 to 36. +static int boss_pool_get(lua_State* state) +{ + int stage = (int)luaL_checkinteger(state, 1); + if (stage < 0 || stage >= BOSS_POOL_COUNT) + return luaL_error(state, "[BossPoolManager.GetPool] : Invalid STB type!"); + lua_push(state, &g_game->bossPool.pools[stage]); + return 1; +} + +// A boss set as a table from boss id 1. +template BossPool::*Bosses> +static int boss_set_get(lua_State* state) +{ + std::bitset& bosses = g_game->bossPool.*Bosses; + lua_createtable(state, BOSS_ID_COUNT - 1, 0); + for (int i = 1; i < BOSS_ID_COUNT; i++) + { + lua_pushboolean(state, bosses[i]); + lua_rawseti(state, -2, i); + } + return 1; +} + +// BossPool:GetEntries: each boss's id, weights and achievement. weightAlt repeats the weight, as REPENTOGON's does. +static int boss_pool_entries_get(lua_State* state) +{ + BossPool_Pool& pool = lua_get(state, 1); + lua_createtable(state, (int)pool.entries.size(), 0); + for (size_t i = 0; i < pool.entries.size(); i++) + { + BossPool_Entry& entry = pool.entries[i]; + lua_createtable(state, 0, 5); + lua_pushinteger(state, entry.id); + lua_setfield(state, -2, "bossID"); + lua_pushnumber(state, entry.initialWeight); + lua_setfield(state, -2, "initialWeight"); + lua_pushnumber(state, entry.weight); + lua_setfield(state, -2, "weight"); + lua_pushnumber(state, entry.weight); + lua_setfield(state, -2, "weightAlt"); + lua_pushinteger(state, entry.achievementID); + lua_setfield(state, -2, "achievementID"); + lua_rawseti(state, -2, (lua_Integer)i + 1); + } + return 1; +} + +// Isaac.SpawnBoss: an enemy spawned as a boss, from the room's spawn seed unless given. +static int boss_spawn(lua_State* state) +{ + uint32_t type = (uint32_t)luaL_checkinteger(state, 1); + uint32_t variant = (uint32_t)luaL_checkinteger(state, 2); + uint32_t subType = (uint32_t)luaL_checkinteger(state, 3); + Vector position = lua_get(state, 4); + Vector velocity = lua_get(state, 5); + uint32_t seed = (uint32_t)luaL_optinteger(state, SPAWN_BOSS_SEED_ARG, g_game->GetCurrentRoomDesc()->spawnSeed); + if (type < SPAWN_BOSS_TYPE_FIRST || type >= SPAWN_BOSS_TYPE_END) + return luaL_error(state, "SpawnBoss only works with NPC-able entity types"); + + bool isSpawned = !lua_isnil(state, SPAWN_BOSS_SPAWNER_ARG); + Entity* spawner = isSpawned ? &lua_get(state, SPAWN_BOSS_SPAWNER_ARG) : nullptr; + auto* boss = static_cast(g_game->Spawn({.position = position, + .velocity = velocity, + .spawner = spawner, + .subType = (int)subType, + .type = (int)type, + .variant = (int)variant, + .seed = seed})); + boss->isBoss = true; + lua_push(state, boss); + return 1; +} + +// Isaac.GetBossColorIdxByName: the index of the boss color of that name among its boss's, -1 for none. +static int boss_color_index_get(std::string name) +{ + int index = -1; + for (auto& [key, entity] : g_manager->entityConfig.entities) + for (size_t i = 0; i < entity.bossColors.size(); i++) + if (entity.bossColors[i].name == name) index = (int)i; + return index; +} + +// Registers BossPool and the BossPoolManager table. +void npc_classes_register(lua_State* state) +{ + using P = BossPool_Pool; + lua_class_begin(state, "BossPool", LUA_CLASS_BOSS_POOL); + lua_method(state, "GetName", [](P& pool) { return pool.name; }); + lua_functions_add(state, {{"GetEntries", boss_pool_entries_get}}); + lua_method(state, "GetWeight", [](P& pool) { return pool.totalWeight; }); + lua_method(state, "GetRNG", [](P& pool) -> RNG& { return pool.rng; }); + lua_method(state, "GetDoubleTroubleRoomVariantStart", [](P& pool) { return pool.doubleTroubleRoomVariantStart; }); + lua_method(state, "GetDoubleTroubleRoomID", [](P& pool) { return pool.doubleTroubleRoomVariantStart; }); + lua_class_hidden_end(state); + + lua_namespace_begin(state, "BossPoolManager"); + lua_functions_add(state, {{"GetPool", boss_pool_get}, + {"GetRemovedBosses", boss_set_get<&BossPool::removedBosses>}, + {"GetLevelBlacklist", boss_set_get<&BossPool::levelBlacklist>}, + {"GetRemovedSpecialBosses", boss_set_get<&BossPool::levelBlacklist>}}); + lua_namespace_plain_end(state); +} + +// Isaac.ClearBossHazards, the enemies cleared too unless asked to ignore them, which warns that Room's replaces it. +static int boss_hazards_clear_lua(lua_State* state) +{ + if (!g_game || !g_game->room) return luaL_error(state, "Must be in a room to use this!"); + bool isIgnoreNpcs = lua_get>(state, 1).value; + boss_hazards_clear(isIgnoreNpcs ? BOSS_HAZARDS_SHOTS : BOSS_HAZARDS_ALL, nullptr); + g_game->console.Print("[WARN] Isaac.ClearBossHazards is deprecated. Use Room:ClearBossHazards instead", + CONSOLE_WARNING); + return 0; +} + +// Adds Isaac.SpawnBoss, ClearBossHazards and the boss color lookups to the Isaac namespace, begun last. +void isaac_bosses_register(lua_State* state) +{ + lua_functions_add(state, {{"SpawnBoss", boss_spawn}, {"ClearBossHazards", boss_hazards_clear_lua}}); + lua_method(state, "GetBossColorIdxByName", boss_color_index_get); + lua_method(state, "GetBossColorIdByName", boss_color_index_get); +} diff --git a/src/repentogon/api_pickup.cpp b/src/repentogon/api_pickup.cpp new file mode 100644 index 0000000..e64c3e7 --- /dev/null +++ b/src/repentogon/api_pickup.cpp @@ -0,0 +1,298 @@ +#include "entity/effect/effect.h" +#include "entity/pickup/item_config.h" +#include "entity/pickup/item_pool.h" +#include "entity/pickup/pickup.h" +#include "entity/pickup/slot.h" +#include "entity/save_state.h" +#include "game/game.h" +#include "game/manager.h" +#include "level/room.h" +#include "repentogon/api.h" +#include "repentogon/api_items.h" +#include +#include + +// REPENTOGON's pickup bindings (LuaInterfaces/Entities/LuaEntityPickup.cpp, LuaEntitySlot.cpp, LuaLootList.cpp, +// LuaLootListEntry.cpp and Utils/Entity/PickupUtils.cpp). + +// The pedestal layer the flip state's item is drawn on, and the shift its seed is drawn with. +constexpr int FLIP_ITEM_LAYER = 1; +constexpr uint32_t FLIP_SEED_SHIFT = 39; +constexpr std::array COIN_JAM_ANIMATIONS = {"CoinJam", "CoinJam2", "CoinJam3", "CoinJam4"}; + +// An argument error naming the bad value after its message. +static int argument_error(lua_State* state, int index, const char* message, lua_Integer value) +{ + return luaL_argerror(state, index, (message + std::to_string(value)).c_str()); +} + +// PickupUtils::InitFlipState: gives a collectible pedestal the other item Flip shows behind it, a chosen one or one +// drawn for the room, and its sprite when asked. +static void flip_state_init(Entity_Pickup& pickup, int collectible, bool isGraphicsSetup) +{ + if (pickup.variant != PICKUP_COLLECTIBLE || !pickup.CanReroll() || pickup.isDead) return; + + auto flipState = std::make_shared(); + pickup.flipSaveState = flipState; + flipState->type = pickup.type; + flipState->variant = pickup.variant; + + RNG rng; + rng.SetSeed(pickup.initSeed, FLIP_SEED_SHIFT); + flipState->initSeed = rng.Next(); + flipState->subtype = collectible != 0 + ? collectible + : g_game->itemPool.GetSeededCollectible(flipState->initSeed, POOL_FLAG_NO_DECREASE, + *g_game->room->descriptor); + + pickup.altPedestalANM2.Reset(); + if (!isGraphicsSetup) return; + + pickup.altPedestalANM2 = pickup.sprite; + Entity_Pickup::load_collectible_gfx(pickup.altPedestalANM2, FLIP_ITEM_LAYER, flipState->subtype, + flipState->initSeed, false); + pickup.altPedestalANM2.LoadGraphics(); + if (pickup.sprite.file && !pickup.sprite.file->animations.empty()) + pickup.altPedestalANM2.Play(pickup.sprite.file->animations[0].name, PLAY_FORCED); + pickup.altPedestalANM2.Update(); +} + +// EntityPickup.GetRandomPickupVelocity: a pickup's launch from a position. The RNG argument is checked, never used. +static int random_velocity_get(lua_State* state) +{ + Vector& position = lua_get(state, 1); + if (lua_type(state, 2) == LUA_TUSERDATA) lua_get(state, 2); + uint32_t velocityType = (uint32_t)luaL_optinteger(state, 3, 0); + lua_push(state, Entity_Pickup::GetRandomPickupVelocity(position, nullptr, velocityType)); + return 1; +} + +// EntityPickup.SetupCollectibleGraphics: draws a collectible on a sprite's layer, loading its graphics when asked. +static int collectible_graphics_setup(lua_State* state) +{ + ANM2& sprite = lua_get(state, 1); + lua_Integer layerId = luaL_checkinteger(state, 2); + if (layerId < 0 || (lua_Integer)sprite.layerStates.size() <= layerId) + return argument_error(state, 2, "No Layed with Id ", layerId); + + lua_Integer collectible = luaL_checkinteger(state, 3); + if (!g_manager->itemConfig.GetCollectible((int)collectible)) + return argument_error(state, 3, "Invalid collectible with ID ", collectible); + + bool isBlind = lua_get(state, 4).value; + uint32_t seed = (uint32_t)luaL_optinteger(state, 5, Random()); + if (seed == 0) seed = 1; + bool isGraphicsLoaded = lua_get(state, 6).value; + + Entity_Pickup::load_collectible_gfx(sprite, (int)layerId, (int)collectible, seed, isBlind); + if (isGraphicsLoaded) sprite.LoadGraphics(); + return 0; +} + +// EntityPickup:AddCollectibleCycle: adds an item to a glitched pedestal's cycle while it has room. +static int cycle_collectible_add(lua_State* state) +{ + Entity_Pickup& pickup = lua_get(state, 1); + lua_Integer id = luaL_checkinteger(state, 2); + if (!g_manager->itemConfig.GetCollectible((int)id)) return argument_error(state, 2, "Invalid collectible ID ", id); + + bool isAdded = pickup.cycleCollectibleCount < CYCLE_COLLECTIBLE_LIMIT; + if (isAdded) pickup.cycleCollectibleList[pickup.cycleCollectibleCount++] = (uint32_t)id; + lua_pushboolean(state, isAdded); + return 1; +} + +// EntityPickup:GetCollectibleCycle: the items a glitched pedestal cycles through. +static int cycle_collectibles_get(lua_State* state) +{ + Entity_Pickup& pickup = lua_get(state, 1); + lua_newtable(state); + for (uint32_t i = 0; i < pickup.cycleCollectibleCount; i++) + { + lua_pushinteger(state, pickup.cycleCollectibleList[i]); + lua_rawseti(state, -2, i + 1); + } + return 1; +} + +// EntityPickup:GetMegaChestOtherCollectible: the item of a Mega Chest's pair still there, and whether it is the right. +static int mega_chest_other_get(lua_State* state) +{ + Entity_Pickup& pickup = lua_get(state, 1); + for (size_t side = 0; side < pickup.megaChestCollectible.size(); side++) + if (Entity* collectible = pickup.megaChestCollectible[side].get()) + { + lua_push(state, static_cast(collectible)); + lua_pushboolean(state, side != 0); + return 2; + } + lua_pushnil(state); + lua_pushnil(state); + return 2; +} + +// EntityPickup:GetCanRerollOverride: what CanReroll answers in place of the game, nil for none. +static int reroll_override_get(lua_State* state) +{ + Entity_Pickup& pickup = lua_get(state, 1); + if (pickup.canRerollOverride) lua_pushboolean(state, *pickup.canRerollOverride); + else lua_pushnil(state); + return 1; +} + +// EntityPickup:GetFlipCollectible: the item Flip shows behind a pedestal's, nil for none. +static int flip_collectible_get(lua_State* state) +{ + Entity_Pickup& pickup = lua_get(state, 1); + if (pickup.variant == PICKUP_COLLECTIBLE && pickup.flipSaveState) lua_pushinteger(state, pickup.flipSaveState->subtype); + else lua_pushnil(state); + return 1; +} + +// EntityPickup:GetLootList: what the chest or sack gives, drawn for good when asked. +static int loot_list_get(lua_State* state) +{ + Entity_Pickup& pickup = lua_get(state, 1); + PoolDraw draw = lua_get>(state, 2).value ? POOL_DRAW_TAKE : POOL_DRAW_PEEK; + lua_push(state, pickup.GetChestLoot(draw, nullptr)); + return 1; +} + +// Adds REPENTOGON's functions to EntityPickup. +void pickup_api_register(lua_State* state) +{ + lua_functions_add(state, {{"AddCollectibleCycle", cycle_collectible_add}, + {"GetCollectibleCycle", cycle_collectibles_get}, + {"GetMegaChestOtherCollectible", mega_chest_other_get}, + {"GetCanRerollOverride", reroll_override_get}, + {"GetFlipCollectible", flip_collectible_get}, + {"GetLootList", loot_list_get}, + {"GetRandomPickupVelocity", random_velocity_get}}); + lua_method(state, "CanReroll", [](Entity_Pickup& pickup) { return pickup.CanReroll(); }); + lua_method(state, "IsBlind", [](Entity_Pickup& pickup, LuaOptionalBool isForcedOnly) { + if (pickup.variant != PICKUP_COLLECTIBLE) return false; + bool isQuestionMark = + pickup.sprite.layerStates.size() > 1 && pickup.sprite.layerStates[1].spriteSheetPath == QUESTION_MARK_GFX; + return pickup.isForceBlind || (!isForcedOnly.value && isQuestionMark); + }); + lua_method(state, "SetAlternatePedestal", + [](Entity_Pickup& pickup, int pedestalType) { pickup.SetAlternatePedestal(pedestalType); }); + lua_method(state, "TryRemoveCollectible", [](Entity_Pickup& pickup) { return (bool)pickup.empty_pedestal(); }); + lua_method(state, "SetForceBlind", + [](Entity_Pickup& pickup, LuaCheckedBool isBlind) { pickup.SetForceBlind(isBlind.value); }); + lua_method(state, "GetVarData", [](Entity_Pickup& pickup) { return pickup.varData; }); + lua_method(state, "SetVarData", [](Entity_Pickup& pickup, int varData) { pickup.varData = varData; }); + lua_method(state, "SetNewOptionsPickupIndex", [](Entity_Pickup& pickup) { return pickup.AssignOptionsIndex(); }); + lua_method(state, "TryInitOptionCycle", + [](Entity_Pickup& pickup, int count) { return pickup.TryInitOptionCycle((uint32_t)count); }); + lua_method(state, "GetDropDelay", [](Entity_Pickup& pickup) { return pickup.dropDelay; }); + lua_method(state, "SetDropDelay", [](Entity_Pickup& pickup, int delay) { pickup.dropDelay = delay; }); + lua_method(state, "MakeShopItem", [](Entity_Pickup& pickup, int shopId) { pickup.MakeShopItem(shopId); }); + lua_method(state, "TryFlip", [](Entity_Pickup& pickup) { return pickup.TryFlip(nullptr, 0); }); + lua_method(state, "GetPriceSprite", [](Entity_Pickup& pickup) { return &pickup.priceANM2; }); + lua_method(state, "GetAlternatePedestal", [](Entity_Pickup& pickup) { return pickup.GetAlternatePedestal(); }); + lua_method(state, "RemoveCollectibleCycle", [](Entity_Pickup& pickup) { + pickup.cycleCollectibleList.fill(0); + pickup.cycleCollectibleCount = 0; + }); + lua_method(state, "GetPickupGhost", + [](Entity_Pickup& pickup) { return static_cast(pickup.pickupGhost.get()); }); + lua_method(state, "UpdatePickupGhosts", [](Entity_Pickup& pickup) { pickup.UpdateLootPreview(); }); + lua_method(state, "TriggerTheresOptionsPickup", [](Entity_Pickup& pickup) { pickup.RemoveOtherOptions(); }); + lua_method(state, "GetMegaChestLeftCollectible", + [](Entity_Pickup& pickup) { return static_cast(pickup.megaChestCollectible[0].get()); }); + lua_method(state, "GetMegaChestRightCollectible", + [](Entity_Pickup& pickup) { return static_cast(pickup.megaChestCollectible[1].get()); }); + lua_method(state, "InitFlipState", + [](Entity_Pickup& pickup, LuaDefault collectible, LuaOptionalBool isSetup) { + flip_state_init(pickup, collectible.value, isSetup.value); + }); + lua_method(state, "HasFlipData", [](Entity_Pickup& pickup) { + return pickup.variant == PICKUP_COLLECTIBLE && pickup.flipSaveState != nullptr; + }); + lua_method(state, "ReloadGraphics", + [](Entity_Pickup& pickup, LuaCheckedBool isIgnoreBlind) { pickup.UpdateSprite(isIgnoreBlind.value); }); + lua_method(state, "SetCanRerollOverride", + [](Entity_Pickup& pickup, LuaCheckedBool isRerollable) { pickup.canRerollOverride = isRerollable.value; }); + lua_method(state, "ClearCanRerollOverride", [](Entity_Pickup& pickup) { pickup.canRerollOverride.reset(); }); + lua_method(state, "CanJeraDuplicate", [](Entity_Pickup& pickup) { return pickup.CanJeraDuplicate(); }); + + lua_pushcfunction(state, random_velocity_get); + lua_table_set(state, -3, "GetRandomPickupVelocity"); + lua_pushcfunction(state, collectible_graphics_setup); + lua_table_set(state, -3, "SetupCollectibleGraphics"); + lua_static(state, "ShouldIgnoreModifiers", []() { return g_pickupIgnoreModifiers != 0; }); +} + +// Adds REPENTOGON's functions to EntitySlot, its beggars, machines and the like. +void slot_api_register(lua_State* state) +{ + lua_method(state, "CreateDropsFromExplosion", [](Entity_Slot& slot) { slot.spawn_break_drops(); }); + lua_method(state, "GetPrizeCollectible", [](Entity_Slot& slot) { return slot.prizeCollectible; }); + lua_method(state, "SetPrizeCollectible", [](Entity_Slot& slot, int collectible) { slot.SetPrizeType(collectible); }); + lua_method(state, "RandomCoinJamAnim", + []() { return std::string(COIN_JAM_ANIMATIONS[Random() % COIN_JAM_ANIMATIONS.size()]); }); + lua_method(state, "GetState", [](Entity_Slot& slot) { return slot.state; }); + lua_method(state, "SetState", [](Entity_Slot& slot, int slotState) { slot.state = slotState; }); + lua_method(state, "GetPrizeType", [](Entity_Slot& slot) { return slot.prizeType; }); + lua_method(state, "SetPrizeType", [](Entity_Slot& slot, int prizeType) { slot.prizeType = prizeType; }); + lua_method(state, "GetShellGameAnimationIndex", [](Entity_Slot& slot) { return slot.shellGameAnimationIndex; }); + lua_method(state, "SetShellGameAnimationIndex", + [](Entity_Slot& slot, int16_t index) { slot.shellGameAnimationIndex = index; }); + lua_method(state, "GetDonationValue", [](Entity_Slot& slot) { return slot.donationValue; }); + lua_method(state, "SetDonationValue", [](Entity_Slot& slot, int value) { slot.donationValue = value; }); + lua_method(state, "GetTriggerTimerNum", [](Entity_Slot& slot) { return slot.triggerTimer; }); + lua_method(state, "SetTriggerTimerNum", [](Entity_Slot& slot, uint32_t timer) { slot.triggerTimer = timer; }); + lua_method(state, "GetTimeout", [](Entity_Slot& slot) { return slot.timeout; }); + lua_method(state, "SetTimeout", [](Entity_Slot& slot, int16_t timeout) { slot.timeout = timeout; }); + lua_method(state, "GetTouch", [](Entity_Slot& slot) { return slot.touch; }); + lua_method(state, "SetTouch", [](Entity_Slot& slot, uint16_t touch) { slot.touch = touch; }); + lua_method(state, "GetPrizeSprite", [](Entity_Slot& slot) { return &slot.prizeAnm2; }); +} + +// LootList:PushEntry: adds an entity to the loot, with its seed (a random one when left out) and an RNG. +static int loot_entry_push(lua_State* state) +{ + LootList& loot = lua_get(state, 1); + LootEntry entry; + entry.type = (int)luaL_checkinteger(state, 2); + entry.variant = (int)luaL_checkinteger(state, 3); + entry.subType = (int)luaL_checkinteger(state, 4); + entry.seed = (uint32_t)luaL_optinteger(state, 5, Random()); + entry.rng = lua_get>(state, 6).value; + loot.entries.push_back(entry); + return 0; +} + +// LootList:GetEntries: the loot's entries in spawn order. +static int loot_entries_get(lua_State* state) +{ + LootList& loot = lua_get(state, 1); + lua_newtable(state); + for (size_t i = 0; i < loot.entries.size(); i++) + { + lua_push(state, loot.entries[i]); + lua_rawseti(state, -2, (lua_Integer)i + 1); + } + return 1; +} + +// Adds REPENTOGON's functions and constructor to LootList, and registers LootListEntry. +void loot_list_api_register(lua_State* state) +{ + lua_gc_set(state); + lua_static(state, "__call", [](LuaIgnored) { return LootList{}; }); + lua_functions_add(state, {{"PushEntry", loot_entry_push}, {"GetEntries", loot_entries_get}}); +} + +// Registers LootListEntry, one entry of a LootList. +void loot_list_entry_register(lua_State* state) +{ + lua_class_begin(state, "LootListEntry", LUA_CLASS_LOOT_LIST_ENTRY); + lua_method(state, "GetType", [](LootEntry& entry) { return entry.type; }); + lua_method(state, "GetVariant", [](LootEntry& entry) { return entry.variant; }); + lua_method(state, "GetSubType", [](LootEntry& entry) { return entry.subType; }); + lua_method(state, "GetSeed", [](LootEntry& entry) { return entry.seed; }); + lua_method(state, "GetRNG", [](LootEntry& entry) { return entry.rng; }); + lua_class_hidden_end(state); +} diff --git a/src/repentogon/api_room.cpp b/src/repentogon/api_room.cpp new file mode 100644 index 0000000..617e0c4 --- /dev/null +++ b/src/repentogon/api_room.cpp @@ -0,0 +1,545 @@ +#include "classes.h" +#include "engine/seeds.h" +#include "entity/pickup/item_pool.h" +#include "game/game.h" +#include "game/manager.h" +#include "level/grid/door.h" +#include "level/grid/rock.h" +#include "level/room.h" +#include "level/room_special.h" +#include "repentogon/api.h" +#include "repentogon/api_level.h" +#include "repentogon/level.h" +#include "repentogon/lua_render.h" +#include + +// The last pressure plate output group TriggerOutput takes. +constexpr unsigned OUTPUT_GROUP_LAST = OUTPUT_GROUP_COUNT - 1; +// DoLightningStrike's flash and thunder: the intensity's base and spread, the sound and its delay, and the pitch's. +constexpr uint32_t LIGHTNING_SHIFT_INDEX = 35; +constexpr float LIGHTNING_INTENSITY_BASE = 1.3f; +constexpr float LIGHTNING_INTENSITY_SPREAD = 0.6f; +constexpr int THUNDER_FRAME_DELAY = 90; +constexpr float THUNDER_PITCH_BASE = 0.9f; +constexpr float THUNDER_PITCH_SPREAD = 0.2f; +// The rail pieces Room:SetRail accepts (REPENTOGON's Room::IsValidRailType), RAIL_NONE among them. +constexpr uint8_t RAIL_TYPES_VALID[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 17, 32, + 33, 80, 81, 82, 83, 84, 85, 96, 97, 98, 99, 100, 101, 112, + 113, 144, 145, 160, 161, RAIL_NONE}; +// The highest grid index a layout's shape allows (REPENTOGON's RoomConfig_Room::IsAllowedGridIndex). +constexpr int GRID_INDEX_LAST_1X1 = 134; +constexpr int GRID_INDEX_LAST_TALL = 239; +constexpr int GRID_INDEX_LAST_WIDE = 251; +// REPENTOGON's champion boss odds: the achievements that raise them and their steps. +constexpr int ACHIEVEMENT_CHAMPION_FIRST = 3; +constexpr int ACHIEVEMENT_CHAMPION_SECOND = 33; +constexpr float CHAMPION_CHANCE_FIRST = 0.1f; +constexpr float CHAMPION_CHANCE_SECOND = 0.3f; +constexpr float CHAMPION_CHANCE_GREEDIER = 0.6f; +constexpr RNG CHAMPION_RNG = {0, 1, 11, 16}; +// The versus screen layers of each player's extra portrait: shaking, then still. +constexpr int EXTRA_PORTRAIT_LAYERS[4][2] = {{5, 12}, {18, 21}, {19, 22}, {20, 23}}; +constexpr float COLOR_MODIFIER_RATE = 0.015f; + +// REPENTOGON's room state its patches read: the item pool Room:SetItemPool forces, and whether +// Room:TrySpawnSpecialQuestDoor forces the door. +static int forcedItemPool = POOL_NONE; +static bool isSpecialQuestDoorForced = false; +// Whether the camera keeps within the room (REPENTOGON's roomCameraData.Clamped). +static bool isCameraClamped = true; + +// Raises luaL_typeerror's argument error. +static int type_error(lua_State* state, int index, const char* expected) +{ + return luaL_argerror(state, index, + lua_pushfstring(state, "%s expected, got %s", expected, luaL_typename(state, index))); +} + +// Pushes an XY as a table of two integers. +static void xy_push(lua_State* state, int x, int y) +{ + lua_createtable(state, 2, 0); + lua_pushinteger(state, x); + lua_rawseti(state, -2, 1); + lua_pushinteger(state, y); + lua_rawseti(state, -2, 2); +} + +// Whether a layout allows a grid index (REPENTOGON's RoomConfig_Room::IsAllowedGridIndex). +static bool is_grid_index_allowed(const RoomConfig_Room& config, int index) +{ + int last = ROOM_GRID_CELLS - 1; + if (config.shape <= ROOMSHAPE_IV) last = GRID_INDEX_LAST_1X1; + else if (config.shape <= ROOMSHAPE_IIV) last = GRID_INDEX_LAST_TALL; + else if (config.shape <= ROOMSHAPE_IIH) last = GRID_INDEX_LAST_WIDE; + return index >= 0 && index <= last; +} + +// REPENTOGON's Room::GetChampionBossChance. +static float champion_boss_chance_get() +{ + Game& game = *g_game; + PersistentGameData& data = g_manager->persistentGameData; + bool isAll = g_manager->state == MANAGER_STATE_GAME && (game.dailyChallenge.id != 0 || game.isDebug); + if (!data.achievements[ACHIEVEMENT_CHAMPION_FIRST] && !isAll) return 0; + + float chance = CHAMPION_CHANCE_FIRST; + if (data.achievements[ACHIEVEMENT_CHAMPION_SECOND] || isAll) chance = CHAMPION_CHANCE_SECOND; + if (game.difficulty == DIFFICULTY_GREEDIER) chance = CHAMPION_CHANCE_GREEDIER; + if (game.playerManager.AnyoneHasTrinket(TRINKET_PURPLE_HEART)) + chance *= (float)(game.playerManager.GetTrinketMultiplier(TRINKET_PURPLE_HEART) * 2); + if (game.challenge == CHALLENGE_ULTRA_HARD) chance = 1; + return chance; +} + +// Room:SetRedHeartDamage: true when left out, else a boolean. +static int red_heart_damage_set(lua_State* state) +{ + Room& room = lua_get(state, 1); + bool isDamaged = true; + if (lua_isboolean(state, 2)) isDamaged = lua_toboolean(state, 2); + else if (!lua_isnoneornil(state, 2)) type_error(state, 2, "boolean"); + room.isRedHeartDamaged = isDamaged; + return 0; +} + +// Room:SpawnGridEntity from a GridEntityDesc, or from a type with an optional variant, seed and var data. +static int grid_entity_spawn(lua_State* state) +{ + Room& room = lua_get(state, 1); + int gridIndex = (int)luaL_checkinteger(state, 2); + if (gridIndex < 0 || gridIndex >= ROOM_GRID_CELLS) return luaL_error(state, "Grid index %d invalid", gridIndex); + + bool isSpawned = false; + if (lua_type(state, 3) == LUA_TUSERDATA) + isSpawned = room_grid_desc_spawn(room, gridIndex, lua_get(state, 3)); + else + { + auto type = (GridEntityType)luaL_checkinteger(state, 3); + int variant = (int)luaL_optinteger(state, 4, 0); + auto seed = (uint32_t)luaL_optinteger(state, 5, gridIndex + g_game->frameCount + 1); + int varData = (int)luaL_optinteger(state, 6, 0); + isSpawned = room.SpawnGridEntity(gridIndex, type, variant, seed, varData); + } + lua_pushboolean(state, isSpawned); + return 1; +} + +// Room:SetBackdropType: a backdrop id and whether the decorations change. +static int backdrop_type_set(lua_State* state) +{ + Room& room = lua_get(state, 1); + lua_Integer id = luaL_checkinteger(state, 2); + if (id < 0) luaL_error(state, "Invalid backdrop id %d", (int)id); + lua_Integer isDecorationChanged = luaL_checkinteger(state, 3); + room.backdrop.Init((uint32_t)id, isDecorationChanged != 0); + return 0; +} + +// Room:GetRail: a cell's rail piece, nil for none or a cell its layout does not allow. +static int rail_get(lua_State* state) +{ + Room& room = lua_get(state, 1); + int index = (int)luaL_checkinteger(state, 2); + uint8_t rail = is_grid_index_allowed(*room.descriptor->data, index) ? room.railManager.rails[index] : RAIL_NONE; + if (rail == RAIL_NONE) lua_pushnil(state); + else lua_pushinteger(state, rail); + return 1; +} + +// Room:SetRail: a cell of the grid and a rail piece. +static int rail_set(lua_State* state) +{ + Room& room = lua_get(state, 1); + int index = (int)luaL_checkinteger(state, 2); + if (index < 0 || index >= room.gridHeight * room.gridWidth) + return luaL_error(state, "Invalid grid index %d\n", index); + + int rail = (int)luaL_checkinteger(state, 3); + if (std::ranges::find(RAIL_TYPES_VALID, rail) == std::end(RAIL_TYPES_VALID)) + return luaL_error(state, "Invalid rail type %d\n", rail); + room.railManager.rails[index] = (uint8_t)rail; + return 0; +} + +// Room:GetGridIndexByTile: a cell by two integers, or by a table of them. +static int grid_index_by_tile_get(lua_State* state) +{ + Room& room = lua_get(state, 1); + int first = 0; + int second = 0; + if (lua_type(state, 2) == LUA_TTABLE) + { + if (lua_rawlen(state, 2) != 2) return luaL_argerror(state, 2, "expected table length of 2!"); + lua_rawgeti(state, 2, 1); + first = (int)luaL_checkinteger(state, -1); + lua_rawgeti(state, 2, 2); + second = (int)luaL_checkinteger(state, -1); + lua_pop(state, 2); + } + else + { + first = (int)luaL_checkinteger(state, 2); + second = (int)luaL_checkinteger(state, 3); + } + lua_pushinteger(state, room.GetGridIndexByTile(first, second)); + return 1; +} + +// Room:UpdateColorModifier: the room's color grading (or its stage's, unprocessed) faded in at a rate. +static int color_modifier_update(lua_State* state) +{ + Room& room = lua_get(state, 1); + bool isProcessed = lua_get>(state, 2).value; + bool isLerp = lua_get>(state, 3).value; + auto rate = (float)luaL_optnumber(state, 4, COLOR_MODIFIER_RATE); + + ColorModState color = room.get_color_modifier(); + if (!isProcessed) + { + FXParams& fx = room.fxLayers.fxParams; + color = {fx.roomColor._red, fx.roomColor._green, fx.roomColor._blue, fx.roomColor._alpha, fx.brightness, + fx.contrast}; + } + g_game->SetColorModifier(color, isLerp, rate); + return 0; +} + +// Room:DoLightningStrike: a flash and its thunder, from a seed or a random one. +static int lightning_strike(lua_State* state) +{ + auto seed = (uint32_t)luaL_optinteger(state, 2, Random()); + RNG rng{}; + rng.game_constructor(seed, LIGHTNING_SHIFT_INDEX); + g_game->lightningIntensity = LIGHTNING_INTENSITY_BASE + rng.RandomFloat() * LIGHTNING_INTENSITY_SPREAD; + float pitch = THUNDER_PITCH_BASE + rng.RandomFloat() * THUNDER_PITCH_SPREAD; + g_manager->sfxManager.Play(SOUND_THUNDER, {.frameDelay = THUNDER_FRAME_DELAY, .pitch = pitch}); + return 0; +} + +// Room:SetItemPool: the pool the room's collectibles come from, POOL_NULL for its own. +static int item_pool_set(lua_State* state) +{ + int pool = (int)luaL_checkinteger(state, 2); + if (pool < POOL_NONE || pool >= POOL_COUNT) return luaL_argerror(state, 2, "Invalid ItemPoolType"); + forcedItemPool = pool; + return 0; +} + +// Room:GetItemPool: the pool the room's collectibles come from, or with raw the pool SetItemPool forced. +static int item_pool_get(lua_State* state) +{ + Room& room = lua_get(state, 1); + auto seed = (uint32_t)luaL_optinteger(state, 2, Random()); + if (lua_get>(state, 3).value) + { + lua_pushinteger(state, forcedItemPool); + return 1; + } + lua_pushinteger(state, g_game->itemPool.get_pool_from_room_entities(seed != 0 ? seed : 1, *room.descriptor, 0)); + return 1; +} + +// Room:TriggerOutput: fires one of the pressure plates' output groups. +static int output_trigger(lua_State* state) +{ + Room& room = lua_get(state, 1); + auto group = (unsigned)luaL_checkinteger(state, 2); + if (group > OUTPUT_GROUP_LAST) return luaL_argerror(state, 2, "Invalid output index"); + room.TriggerOutput((int)group); + return 0; +} + +// Room:TrySpawnSpecialQuestDoor, which may force the door past the stage's type. +static int special_quest_door_spawn(lua_State* state) +{ + Room& room = lua_get(state, 1); + isSpecialQuestDoorForced = lua_get>(state, 2).value; + lua_pushboolean(state, room.TrySpawnSpecialQuestDoor()); + return 1; +} + +// 0081fb70 A random cell of a shape's floor from a seed: one of its two rectangles weighed by their areas, then a +// column and row in it, its far ones never picked. +static XY lroom_tile_random(const LRoomTileDesc& desc, uint32_t seed) +{ + RNG rng = {seed, 1, 9, 29}; + int widthA = desc.bottomRightAX - desc.topLeftAX; + int heightA = desc.bottomRightAY - desc.topLeftAY; + int widthB = desc.bottomRightBX - desc.topLeftBX; + int heightB = desc.bottomRightBY - desc.topLeftBY; + auto areaA = (uint32_t)std::abs(widthA * heightA); + + if (rng.RandomInt(areaA + (uint32_t)std::abs(widthB * heightB)) < areaA) + { + int column = (int)rng.RandomInt(widthA); + return {desc.topLeftAX + column, desc.topLeftAY + (int)rng.RandomInt(heightA)}; + } + int column = (int)rng.RandomInt(widthB); + return {desc.topLeftBX + column, desc.topLeftBY + (int)rng.RandomInt(heightB)}; +} + +// A raw C function pushing a corner of an LRoomTileDesc as a table of two integers. +template +static int lua_tile_corner_get(lua_State* state) +{ + LRoomTileDesc& desc = lua_get(state, 1); + xy_push(state, desc.*X, desc.*Y); + return 1; +} + +// (LuaLRoomTileDesc.cpp) LRoomTileDesc:GetRandomTile: a random cell of the shape from a seed, as a table of two. +static int random_tile_get(lua_State* state) +{ + LRoomTileDesc& desc = lua_get(state, 1); + auto seed = (uint32_t)luaL_checkinteger(state, 2); + if (seed == 0) return luaL_argerror(state, 2, "Seed must be non-zero!"); + + XY tile = lroom_tile_random(desc, seed); + xy_push(state, tile.x, tile.y); + return 1; +} + +// Registers the plain classes the room hands out: its backdrop, camera, effect layers and parameters, rails and the L +// shapes' descriptions. +static void room_parts_register(lua_State* state) +{ + lua_class_begin(state, "Backdrop", LUA_CLASS_BACKDROP); + lua_method(state, "GetWallImage", [](Backdrop& backdrop) { return backdrop.wallsBuffer; }); + lua_method(state, "GetFloorImage", [](Backdrop& backdrop) { return backdrop.floorBuffer; }); + lua_method(state, "GetFloorANM2", [](Backdrop& backdrop) -> ANM2& { return backdrop.floorSprite; }); + lua_method(state, "GetDetailANM2", [](Backdrop& backdrop) -> ANM2& { return backdrop.wallDetailSprite; }); + lua_method(state, "GetControlsANM2", [](Backdrop& backdrop) -> ANM2& { return backdrop.controlsSprite; }); + lua_method(state, "GetControlsButtonsANM2", + [](Backdrop& backdrop) -> ANM2& { return backdrop.controlsButtonsSprite; }); + lua_class_hidden_end(state); + + lua_class_begin(state, "Camera", LUA_CLASS_CAMERA); + lua_method(state, "SetFocusPosition", [](Camera& camera, Vector& position) { camera.SetFocusPosition(position); }); + lua_method(state, "SnapToPosition", [](Camera& camera, Vector& position) { + camera.SnapToPosition(position); + camera.isShouldOverride = true; + }); + lua_method(state, "IsPosVisible", [](Camera& camera, Vector& position) { return camera.IsPosVisible(position); }); + lua_method(state, "Update", + [](Camera& camera, LuaOptionalBool isSkipped) { camera.DoUpdate(isSkipped.value); }); + lua_method(state, "IsClampEnabled", [](Camera&) { return isCameraClamped; }); + lua_method(state, "SetClampEnabled", [](Camera&, LuaCheckedBool isClamped) { isCameraClamped = isClamped.value; }); + lua_class_hidden_end(state); + + lua_class_begin(state, "FXLayers", LUA_CLASS_FX_LAYERS); + lua_method(state, "AddPoopFx", [](FXLayers& layers, ColorMod& color) { layers.AddPoopFx(color); }); + lua_class_hidden_end(state); + + lua_class_begin(state, "FXParams", LUA_CLASS_FX_PARAMS); + lua_property( + state, "ColorModifier", + [](FXParams& params) { + KColor& color = params.roomColor; + return ColorModState{color._red, color._green, color._blue, + color._alpha, params.brightness, params.contrast}; + }, + [](FXParams& params, ColorModState color) { + params.roomColor = kcolor_rgba(color._red, color._green, color._blue, color._amount); + params.brightness = color._brightness; + params.contrast = color._contrast; + }); + lua_property( + state, "UseWaterV2", [](FXParams& params) { return params.isWaterV2; }, + [](FXParams& params, LuaCheckedBool isOn) { params.isWaterV2 = isOn.value; }); + lua_field<&FXParams::waterColor>(state, "WaterColor"); + lua_field<&FXParams::waterColorMultiplier>(state, "WaterColorMultiplier"); + lua_field<&FXParams::shadowAlpha>(state, "ShadowAlpha"); + lua_field<&FXParams::shadowColor>(state, "ShadowColor"); + lua_field<&FXParams::lightColor>(state, "LightColor"); + lua_field<&FXParams::waterEffectColor>(state, "WaterEffectColor"); + lua_class_hidden_end(state); + + lua_class_begin(state, "RailManager", LUA_CLASS_RAIL_MANAGER); + lua_method(state, "GetRailsSprite", [](RailManager& rails) -> ANM2& { return rails.sprite; }); + lua_class_hidden_end(state); + + lua_class_begin(state, "LRoomAreaDesc", LUA_CLASS_L_ROOM_AREA_DESC); + lua_method(state, "GetHighTopLeft", [](LRoomAreaDesc& desc) { return desc.topLeftA; }); + lua_method(state, "GetHighBottomRight", [](LRoomAreaDesc& desc) { return desc.bottomRightA; }); + lua_method(state, "GetLowTopLeft", [](LRoomAreaDesc& desc) { return desc.topLeftB; }); + lua_method(state, "GetLowBottomRight", [](LRoomAreaDesc& desc) { return desc.bottomRightB; }); + lua_class_hidden_end(state); + + lua_class_begin(state, "LRoomTileDesc", LUA_CLASS_L_ROOM_TILE_DESC); + lua_functions_add( + state, + {{"GetRandomTile", random_tile_get}, + {"GetHighTopLeft", lua_tile_corner_get<&LRoomTileDesc::topLeftAX, &LRoomTileDesc::topLeftAY>}, + {"GetHighBottomRight", lua_tile_corner_get<&LRoomTileDesc::bottomRightAX, &LRoomTileDesc::bottomRightAY>}, + {"GetLowTopLeft", lua_tile_corner_get<&LRoomTileDesc::topLeftBX, &LRoomTileDesc::topLeftBY>}, + {"GetLowBottomRight", lua_tile_corner_get<&LRoomTileDesc::bottomRightBX, &LRoomTileDesc::bottomRightBY>}}); + lua_class_hidden_end(state); +} + +// Registers RoomTransition, a table of functions over the game's room transition. +static void room_transition_register(lua_State* state) +{ + lua_namespace_begin(state, "RoomTransition"); + lua_method(state, "GetVersusScreenSprite", []() -> ANM2& { return g_game->roomTransition.versusScreenANM2; }); + lua_method(state, "StartBossIntro", [](int bossId1, LuaDefault bossId2) { + g_game->roomTransition.roomIndex = g_game->startingRoomIdx; + g_game->roomTransition.StartBossIntro(bossId1, bossId2.value); + }); + lua_method(state, "GetTransitionMode", []() { return g_game->roomTransition.mode; }); + lua_method(state, "IsRenderingBossIntro", []() { + RoomTransition& transition = g_game->roomTransition; + return transition.mode == TRANSITION_OUT && transition.bossIntroBossId != 0; + }); + lua_method(state, "GetPlayerExtraPortraitSprite", [](LuaDefault player) -> ANM2* { + if (player.value < 0 || player.value > 3) return nullptr; + std::map& sprites = g_game->roomTransition.extraLayerANM2s; + for (int layer : {EXTRA_PORTRAIT_LAYERS[player.value][1], EXTRA_PORTRAIT_LAYERS[player.value][0]}) + if (auto found = sprites.find(layer); found != sprites.end()) return &found->second; + return nullptr; + }); + lua_class_end(state); +} + +// (LuaRoom.cpp, LuaBackdrop.cpp, LuaCamera.cpp, LuaFXLayers.cpp, LuaFXParams.cpp, LuaRailManager.cpp, +// LuaLRoomAreaDesc.cpp, LuaLRoomTileDesc.cpp, LuaRoomTransition.cpp) Adds REPENTOGON's Room functions, replacing +// SetRedHeartDamage, SpawnGridEntity, GetBackdropType, TrySpawnSpecialQuestDoor and the L room descriptions. +void repentogon_room_register(lua_State* state) +{ + lua_functions_add(state, {{"SetRedHeartDamage", red_heart_damage_set}, + {"SpawnGridEntity", grid_entity_spawn}, + {"SetBackdropType", backdrop_type_set}, + {"GetRail", rail_get}, + {"SetRail", rail_set}, + {"GetGridIndexByTile", grid_index_by_tile_get}, + {"UpdateColorModifier", color_modifier_update}, + {"DoLightningStrike", lightning_strike}, + {"SetItemPool", item_pool_set}, + {"GetItemPool", item_pool_get}, + {"TriggerOutput", output_trigger}, + {"TrySpawnSpecialQuestDoor", special_quest_door_spawn}}); + lua_method(state, "GetShopItemPrice", [](Room& room, uint32_t variant, uint32_t subType, int shopItemId) { + return room_shop_item_price(room, {.shopItemId = shopItemId, .subType = (int)subType, .variant = (int)variant}, + nullptr); + }); + lua_method(state, "TryGetShopDiscount", [](Room& room, int shopItemId, int price) { + return room_shop_discount(room, shopItemId, price, nullptr); + }); + lua_method(state, "TriggerRestock", + [](Room& room, int gridIndex, int shopItemId) { room_restock_trigger(room, gridIndex, shopItemId); }); + lua_method(state, "RemoveGridEntityImmediate", [](Room& room, int gridIndex, int pathTrail, bool isKept) { + room.RemoveGridEntityImmediate(gridIndex, pathTrail, isKept ? DECORATION_KEPT : DECORATION_REMOVED); + }); + lua_method(state, "CanSpawnObstacleAtPosition", [](Room& room, int gridIndex, bool isForced) { + return room.CanSpawnObstacleAtPosition(gridIndex, isForced); + }); + lua_method(state, "CanPickupGridEntity", + [](Room& room, int gridIndex) { return room.CanPickupGridEntity(gridIndex); }); + lua_method(state, "PickupGridEntity", [](Room& room, int gridIndex) { return room.PickupGridEntity(gridIndex); }); + lua_method(state, "SetPauseTimer", [](Room& room, int duration) { room.SetPauseTimer(duration); }); + lua_method(state, "GetChampionBossChance", [](Room&) { return champion_boss_chance_get(); }); + lua_method(state, "IsChampionBossSeed", [](Room& room) { + RNG rng = CHAMPION_RNG; + rng._seed = room.descriptor->spawnSeed; + return rng.RandomFloat() <= champion_boss_chance_get(); + }); + lua_method(state, "IsPersistentRoomEntity", [](Room&, int type, LuaDefault variant) { + return room_entity_is_persistent(type, variant.value); + }); + lua_method(state, "GetBackdropType", [](Room& room) { return room.backdrop.backdropId; }); + lua_method(state, "SaveState", [](Room& room) { room.on_leave(); }); + lua_method(state, "GetBossVictoryJingle", [](Room& room) { return room.GetBossVictoryJingle(); }); + + lua_method(state, "GetWaterAmount", [](Room& room) { return room.waterAmount; }); + lua_method(state, "SetWaterAmount", [](Room& room, float amount) { room.waterAmount = amount; }); + lua_method(state, "GetFloorColor", [](Room& room) { return room.floorColor; }); + lua_method(state, "GetWallColor", [](Room& room) -> ColorMod& { return room.wallColor; }); + lua_method(state, "GetWaterColor", [](Room& room) { return room.waterColor; }); + lua_method(state, "SetWaterColor", [](Room& room, KColor& color) { + room.waterLerpColorDuration = 1; + room.waterLerpTargetColor = color; + }); + lua_method(state, "GetWaterColorMultiplier", [](Room& room) { return room.waterColorMultiplier; }); + lua_method(state, "SetWaterColorMultiplier", [](Room& room, KColor& color) { + room.waterLerpColorDuration = 1; + room.waterLerpTargetColorMult = color; + }); + lua_method(state, "SetWaterCurrent", [](Room& room, Vector& current) { room.waterCurrent = current; }); + lua_method(state, "GetEffects", [](Room& room) -> TemporaryEffects& { return room.temporaryEffects; }); + lua_method(state, "GetRoomClearDelay", [](Room& room) { return room.roomClearDelay; }); + lua_method(state, "SetRoomClearDelay", [](Room& room, int delay) { room.roomClearDelay = delay; }); + lua_method(state, "GetGreedWaveTimer", [](Room& room) { return room.greedWaveTimer; }); + lua_method(state, "SetGreedWaveTimer", [](Room& room, int timer) { room.greedWaveTimer = timer; }); + lua_method(state, "SetLavaIntensity", [](Room& room, float intensity) { room.lavaIntensity = intensity; }); + lua_method(state, "GetLightningIntensity", [](Room&) { return g_game->lightningIntensity; }); + lua_method(state, "SetLightningIntensity", [](Room&, float intensity) { g_game->lightningIntensity = intensity; }); + lua_method(state, "GetRainIntensity", [](Room& room) { return room.rainIntensity; }); + lua_method(state, "SetRainIntensity", [](Room& room, float intensity) { room.rainIntensity = intensity; }); + lua_method(state, "GetNumRainSpawners", [](Room& room) { return room.numRainSpawners; }); + + lua_method(state, "GetBackdrop", [](Room& room) -> Backdrop& { return room.backdrop; }); + lua_method(state, "GetCamera", [](Room& room) { return room.camera.get(); }); + lua_method(state, "GetFXLayers", [](Room& room) -> FXLayers& { return room.fxLayers; }); + lua_method(state, "GetFXParams", [](Room& room) -> FXParams& { return room.fxLayers.fxParams; }); + lua_method(state, "GetRailManager", [](Room& room) -> RailManager& { return room.railManager; }); + lua_method(state, "GetLRoomAreaDesc", [](Room& room) { return room.GetLRoomAreaDesc(); }); + lua_method(state, "GetLRoomTileDesc", [](Room& room) { return room.GetLRoomTileDesc(); }); + room_parts_register(state); + room_transition_register(state); +} + +// (LuaGridEntityDoor.cpp) Adds GridEntityDoor's extra sprite and animation. PreviousState and PreviousVariant are +// already its fields. +void repentogon_grid_door_register(lua_State* state) +{ + lua_method(state, "GetExtraSprite", [](GridEntity_Door& door) -> ANM2& { return door.extraSprite; }); + lua_method(state, "PlayAnimation", [](GridEntity_Door& door) { door.UpdateAnimation(); }); +} + +// (LuaGridEntityRock.cpp) Adds GridEntityRock's break helpers, and its SpawnDrops and GetAltRockType on the class. +void repentogon_grid_rock_register(lua_State* state) +{ + lua_method(state, "RenderTop", [](GridEntity_Rock& rock, Vector& offset) { rock.RenderTop(offset); }); + lua_method(state, "TrySpawnWorms", [](GridEntity_Rock& rock) { rock.TrySpawnWorms(); }); + lua_method(state, "TrySpawnLadder", [](GridEntity_Rock& rock) { rock.TrySpawnLadder(); }); + lua_method(state, "UpdateNeighbors", [](GridEntity_Rock& rock) { rock.UpdateNeighbors(); }); + lua_method(state, "PlayBreakSound", [](GridEntity_Rock&, GridEntityType type, LuaDefault backdrop) { + GridEntity_Rock::PlayBreakSound(type, backdrop.value); + }); + lua_method(state, "GetAltRockType", + [](GridEntity_Rock&, LuaDefault backdrop) { return (int)alt_rock_type_get(backdrop.value); }); + lua_method(state, "RegisterRockDestroyed", + [](GridEntity_Rock&, GridEntityType type) { GridEntity_Rock::RegisterRockDestroyed(type); }); + lua_method(state, "UpdateCollision", [](GridEntity_Rock& rock) { rock.update_collision(); }); + lua_static(state, "GetAltRockType", + [](LuaDefault backdrop) { return (int)alt_rock_type_get(backdrop.value); }); + lua_static(state, "SpawnDrops", [](Vector& position, GridEntityType type, int variant, uint32_t seed, + LuaCheckedBool isLanded, LuaDefault backdrop) { + GridEntity_Rock::SpawnDrops({.position = position, + .type = type, + .origin = isLanded.value ? ROCK_DROP_LANDED : ROCK_DROP_BROKEN, + .backdropType = backdrop.value, + .variant = variant, + .seed = seed}); + }); +} + +// (Patches/ASMPatches/ASMLevel.cpp) Whether Room:TrySpawnSpecialQuestDoor opens a quest door on this stage type: when +// forced by the call or by Level:SetForceSpecialQuest, never when that is -1, else on the alternate path. +bool special_quest_stage_type_check(bool isAltPath) +{ + bool isOpen = std::exchange(isSpecialQuestDoorForced, false); + if (!isOpen && special_quest_force_get() > -1) isOpen = special_quest_force_get() > 0 || isAltPath; + return isOpen; +} + +// (LuaRoom.cpp) The item pool Room:SetItemPool forced on the room, POOL_NONE for none. A new room drops it. +int room_item_pool_forced_get() +{ + return forcedItemPool; +} + +void room_item_pool_reset() +{ + forcedItemPool = POOL_NONE; +} diff --git a/src/repentogon/api_saves.cpp b/src/repentogon/api_saves.cpp new file mode 100644 index 0000000..e595db9 --- /dev/null +++ b/src/repentogon/api_saves.cpp @@ -0,0 +1,451 @@ +#include "game/game.h" +#include "game/manager.h" +#include "game/persistent_game_data.h" +#include "repentogon/api.h" +#include "repentogon/api_level.h" +#include "repentogon/callbacks.h" +#include "repentogon/saves.h" +#include +#include +#include + +// The highest event counter, collectible and boss the PersistentGameData functions take. +constexpr int EVENT_COUNTER_LAST = EVENT_COUNTER_COUNT - 1; +constexpr int COLLECTIBLE_LAST = COLLECTIBLE_SEEN_COUNT - 1; +constexpr int BOSS_LAST = BOSS_COUNT - 1; +constexpr int CHALLENGE_LAST = CHALLENGE_COUNT - 1; +// The marks a completion holds: none, normal and hard, in a counter's low bits. +constexpr int MARK_NONE = 0; +constexpr int MARK_HARD = 2; +constexpr int MARK_BITS = 0b11; +constexpr int MARK_SLOTS = 15; +// The marks AllMarksFilled and ClearCompletionMarks pass over for the game's characters: the scrapped slots and +// Ultra Greedier, which shares Ultra Greed's counter. A modded character's pass over only the scrapped slots. +constexpr int MARK_SCRAPPED_FIRST = COMPLETION_GREED_DONATION; +constexpr int MARK_SCRAPPED_SECOND = COMPLETION_HARD; +// AllTaintedCompletion's groups: every tainted unlock's mark, the duet's and the quartet's. +constexpr std::array, 3> TAINTED_GROUPS = {{ + {COMPLETION_ISAAC, COMPLETION_SATAN, COMPLETION_LAMB, COMPLETION_BLUE_BABY, COMPLETION_HUSH, COMPLETION_BOSS_RUSH}, + {COMPLETION_HUSH, COMPLETION_BOSS_RUSH, COMPLETION_BOSS_RUSH, COMPLETION_BOSS_RUSH, COMPLETION_BOSS_RUSH, + COMPLETION_BOSS_RUSH}, + {COMPLETION_ISAAC, COMPLETION_SATAN, COMPLETION_LAMB, COMPLETION_BLUE_BABY, COMPLETION_BLUE_BABY, + COMPLETION_BLUE_BABY}, +}}; +// The completion marks' names in their tables, by slot (nullptr for the scrapped ones). +constexpr const char* MARK_NAMES[MARK_SLOTS] = {"MomsHeart", "Isaac", "Satan", "BossRush", "BlueBaby", + "Lamb", "MegaSatan", "UltraGreed", nullptr, "Hush", + nullptr, "UltraGreedier", "Delirium", "Mother", "Beast"}; + +// The game characters' marks SetCompletionMarks sets, in its order. +constexpr int MARKS_SET_ORDER[] = {COMPLETION_MOMS_HEART, COMPLETION_SATAN, COMPLETION_MEGA_SATAN, + COMPLETION_HUSH, COMPLETION_ISAAC, COMPLETION_BLUE_BABY, + COMPLETION_MOTHER, COMPLETION_DELIRIUM, COMPLETION_BEAST, + COMPLETION_ULTRA_GREED, COMPLETION_BOSS_RUSH, COMPLETION_LAMB}; + +using Marks = std::array; + +// The completion marks of modded characters, and the completions of modded challenges by name and mod, which only +// REPENTOGON's XML data fills. +static std::map moddedMarks; +static std::map moddedChallenges; + +// The event counter holding a game character's mark, 0 for none (REPENTOGON's MarksToEvents). +static int mark_counter_get(int playerType, int completion) +{ + bool isKnown = playerType >= 0 && playerType < COMPLETION_PLAYER_TYPE_COUNT && completion >= 0 && + completion < MARK_SLOTS && completion != COMPLETION_GREED_DONATION; + return isKnown ? COMPLETION_MARKS[playerType][completion].counter : 0; +} + +static bool is_modded_character(int playerType) +{ + return playerType >= COMPLETION_PLAYER_TYPE_COUNT; +} + +static int event_counter_get(int counter) +{ + return g_manager->persistentGameData.eventCounters[counter]; +} + +// A game character's mark from its counter's low bits. +static int mark_get(int playerType, int completion) +{ + return event_counter_get(mark_counter_get(playerType, completion)) & MARK_BITS; +} + +// Sets a game character's mark into its counter's low bits, through the counter's rise so its callbacks run. +static void mark_set(int playerType, int completion, int value) +{ + PersistentGameData& data = g_manager->persistentGameData; + int counter = mark_counter_get(playerType, completion); + int current = event_counter_get(counter); + data.IncreaseEventCounter(counter, -event_counter_get(counter)); + data.IncreaseEventCounter(counter, (current & ~MARK_BITS) | (value & MARK_BITS)); +} + +// MC_COMPLETION_MARK_GET before a mark a script sets, false refusing it, and MC_POST_COMPLETION_MARK_GET after. +static bool mark_pre(int completion, int playerType) +{ + return boolean_run({"CompletionMarkGet", MC_COMPLETION_MARK_GET, playerType}, true, completion, playerType); +} + +static void mark_post(int completion, int playerType) +{ + callback_notify(lua_engine_get(), {"PostCompletionMarkGet", MC_POST_COMPLETION_MARK_GET, playerType}, completion, + playerType); +} + +// Every mark of a character. +static Marks marks_get(int playerType) +{ + if (is_modded_character(playerType)) return moddedMarks[playerType]; + Marks marks{}; + for (int i = 0; i < MARK_SLOTS; i++) marks[i] = mark_get(playerType, i); + return marks; +} + +// Pushes a character's marks as REPENTOGON's table, with its player type unless -1. +static void marks_push(lua_State* state, int playerType, const Marks& marks) +{ + lua_newtable(state); + if (playerType > -1) + { + lua_pushinteger(state, playerType); + lua_setfield(state, -2, "PlayerType"); + } + for (int i = 0; i < MARK_SLOTS; i++) + { + if (!MARK_NAMES[i]) continue; + lua_pushinteger(state, marks[i]); + lua_setfield(state, -2, MARK_NAMES[i]); + } +} + +// (CompletionTracker.cpp) Isaac.GetCompletionMarks(player type): a table of every mark. A game character's Ultra +// Greedier mark reads 0. +static int marks_table_get(lua_State* state) +{ + int playerType = (int)luaL_checkinteger(state, 1); + Marks marks = marks_get(playerType); + if (!is_modded_character(playerType)) marks[COMPLETION_ULTRA_GREEDIER] = MARK_NONE; + marks_push(state, playerType, marks); + return 1; +} + +// Isaac.SetCompletionMarks(table): the marks a table names for its PlayerType. A hard Ultra Greed mark gives Ultra +// Greedier's, and any Ultra Greedier mark both hard. +static int marks_table_set(lua_State* state) +{ + if (!lua_istable(state, -1)) + return luaL_error(state, "Expected table as parameter #2, got %s", lua_typename(state, lua_type(state, 1))); + + Marks marks{}; + int playerType = 0; + lua_pushnil(state); + while (lua_next(state, -2) != 0) + { + if (lua_isstring(state, -2)) + { + const char* key = lua_tostring(state, -2); + int value = (int)lua_tointeger(state, -1); + auto slot = std::ranges::find_if(MARK_NAMES, [&](const char* name) { return name && !strcmp(name, key); }); + if (slot != std::end(MARK_NAMES)) + { + if (value < MARK_NONE || value > MARK_HARD) + return luaL_error(state, "Invalid Completion Marks value for %s is invalid(%d)", key, value); + marks[slot - std::begin(MARK_NAMES)] = value; + } + else if (!strcmp(key, "PlayerType")) playerType = value; + else return luaL_error(state, "Invalid Completion Marks table index: %s", key); + } + lua_pop(state, 1); + } + if (playerType < 0) return luaL_error(state, "Invalid Player Type"); + + if (marks[COMPLETION_ULTRA_GREED] == MARK_HARD) marks[COMPLETION_ULTRA_GREEDIER] = MARK_HARD; + if (marks[COMPLETION_ULTRA_GREEDIER] > MARK_NONE) + marks[COMPLETION_ULTRA_GREED] = marks[COMPLETION_ULTRA_GREEDIER] = MARK_HARD; + if (is_modded_character(playerType)) + { + Marks& kept = moddedMarks[playerType]; + for (int i = 0; i < MARK_SLOTS; i++) + { + if (marks[i] <= MARK_NONE) continue; + if (mark_pre(i, playerType)) mark_post(i, playerType); + else marks[i] = kept[i]; + } + kept = marks; + return 1; + } + for (int i : MARKS_SET_ORDER) + { + if (marks[i] != MARK_NONE && !mark_pre(i, playerType)) continue; + mark_set(playerType, i, marks[i]); + if (marks[i] > MARK_NONE) mark_post(i, playerType); + } + return 1; +} + +// Isaac.SetCompletionMark(player type, completion, value): one mark, its callbacks run for a mark given. +static int mark_value_set(lua_State* state) +{ + int completion = (int)luaL_checkinteger(state, 2); + int playerType = (int)luaL_checkinteger(state, 1); + int value = (int)luaL_checkinteger(state, 3); + if (value < MARK_NONE || value > MARK_HARD) return luaL_error(state, "Invalid Completion Marks value!(%d)", value); + if (value != MARK_NONE && !mark_pre(completion, playerType)) return 1; + + if (is_modded_character(playerType)) moddedMarks[playerType][completion] = value; + else mark_set(playerType, completion, value); + if (value > MARK_NONE) mark_post(completion, playerType); + return 1; +} + +// Isaac.FillCompletionMarks(player type): every mark hard, those a callback allows. Returns 2. +static int marks_fill(lua_State* state) +{ + int playerType = (int)luaL_checkinteger(state, 1); + for (int i = 0; i < MARK_SLOTS; i++) + { + bool isModded = is_modded_character(playerType); + bool isSkipped = + !isModded && (i == MARK_SCRAPPED_FIRST || i == MARK_SCRAPPED_SECOND || i == COMPLETION_ULTRA_GREEDIER || + event_counter_get(mark_counter_get(playerType, i)) >= MARK_HARD); + if (isSkipped || !mark_pre(i, playerType)) continue; + if (isModded) moddedMarks[playerType][i] = MARK_HARD; + else g_manager->persistentGameData.IncreaseEventCounter(mark_counter_get(playerType, i), MARK_HARD); + mark_post(i, playerType); + } + lua_pushinteger(state, MARK_HARD); + return 1; +} + +// Isaac.ClearCompletionMarks(player type): every mark gone. +static int marks_clear(lua_State* state) +{ + int playerType = (int)luaL_checkinteger(state, 1); + if (is_modded_character(playerType)) + { + moddedMarks[playerType] = {}; + return 1; + } + PersistentGameData& data = g_manager->persistentGameData; + for (int i = 0; i < MARK_SLOTS; i++) + { + if (i == MARK_SCRAPPED_FIRST || i == MARK_SCRAPPED_SECOND || i == COMPLETION_ULTRA_GREEDIER) continue; + int counter = mark_counter_get(playerType, i); + data.IncreaseEventCounter(counter, -event_counter_get(counter)); + } + return 1; +} + +// Isaac.AllMarksFilled(player type): the lowest of a character's marks, 2 when all are hard. +static int marks_filled_get(lua_State* state) +{ + int playerType = (int)luaL_checkinteger(state, 1); + bool isModded = is_modded_character(playerType); + Marks marks = isModded ? moddedMarks[playerType] : Marks{}; + int lowest = MARK_HARD; + for (int i = 0; i < MARK_SLOTS; i++) + { + bool isSkipped = + i == MARK_SCRAPPED_FIRST || i == MARK_SCRAPPED_SECOND || (!isModded && i == COMPLETION_ULTRA_GREEDIER); + if (isSkipped) continue; + lowest = std::min(lowest, isModded ? marks[i] : event_counter_get(mark_counter_get(playerType, i))); + } + lua_pushinteger(state, lowest); + return 1; +} + +// Isaac.AllTaintedCompletion(player type, group): the lowest mark of a tainted unlock group, 2 when all are hard. +static int marks_tainted_get(lua_State* state) +{ + int playerType = (int)luaL_checkinteger(state, 1); + int group = (int)luaL_checkinteger(state, 2); + const std::array& marks = group >= 0 && group < (int)TAINTED_GROUPS.size() ? TAINTED_GROUPS[group] + : TAINTED_GROUPS[0]; + bool isModded = is_modded_character(playerType); + int lowest = MARK_HARD; + for (int completion : marks) + lowest = std::min(lowest, isModded ? moddedMarks[playerType][completion] + : event_counter_get(mark_counter_get(playerType, completion))); + lua_pushinteger(state, lowest); + return 1; +} + +// Isaac.GetCompletionMark(player type, completion). +static int mark_value_get(lua_State* state) +{ + int completion = (int)luaL_checkinteger(state, 2); + int playerType = (int)luaL_checkinteger(state, 1); + bool isModded = is_modded_character(playerType); + lua_pushinteger(state, isModded ? moddedMarks[playerType][completion] : mark_get(playerType, completion)); + return 1; +} + +// Isaac.GetCompletionMarkData(mod, player name, tainted): a modded character's marks, nil for none. +static int marks_data_get(lua_State* state) +{ + luaL_checkstring(state, 1); + luaL_checkstring(state, 2); + lua_get(state, 3); + lua_pushnil(state); + return 1; +} + +// Whether a challenge was completed, a modded one by its name and mod. +bool challenge_is_completed(int challenge) +{ + if (challenge <= 0) return false; + if (challenge <= CHALLENGE_LAST) return g_manager->persistentGameData.challenges[challenge]; + return false; +} + +// (ChallengesStuff.cpp MarkChallengeCompleted) Counts a challenge completed, saving at once. +void challenge_completed_mark(int challenge) +{ + if (challenge < 1) return; + PersistentGameData& data = g_manager->persistentGameData; + data.AddChallenge(challenge); + if (challenge <= CHALLENGE_LAST) data.Save(); +} + +// (ChallengesStuff.cpp ResetChallengeCompletion) Counts a challenge not completed, saving at once. +void challenge_completion_reset(int challenge) +{ + if (challenge < 0 || challenge > CHALLENGE_LAST) return; + PersistentGameData& data = g_manager->persistentGameData; + data.challenges[challenge] = false; + data.Save(); +} + +// Isaac.SetChallengeCompletion(challenge, strictly a boolean). +static int challenge_completion_set(lua_State* state) +{ + int challenge = (int)luaL_checkinteger(state, 1); + if (challenge < 1) return luaL_error(state, "Invalid Challenge ID (expected > 0, got %d)", challenge); + if (lua_type(state, 2) != LUA_TBOOLEAN) return luaL_error(state, "Stricly expected boolean as parameter #%d\n", 2); + if (lua_toboolean(state, 2)) challenge_completed_mark(challenge); + else challenge_completion_reset(challenge); + return 0; +} + +// Isaac.GetModChallengeCompletionData(mod, challenge name): whether a modded challenge was completed, nil if unknown. +static int mod_challenge_completion_get(lua_State* state) +{ + std::string mod = luaL_checkstring(state, 1); + std::string name = luaL_checkstring(state, 2); + auto found = moddedChallenges.find(name + mod); + if (found == moddedChallenges.end()) lua_pushnil(state); + else lua_pushboolean(state, found->second > 0); + return 1; +} + +// PersistentGameData:Unlock and TryUnlock: an achievement unlocked, Unlock even while the save is read only. +template +static int achievement_unlock(lua_State* state) +{ + PersistentGameData& data = lua_get(state, 1); + int achievement = (int)luaL_checkinteger(state, 2); + bool isReadOnly = std::exchange(data.isReadOnly, data.isReadOnly && !IsForced); + bool isUnlocked = data.TryUnlock(achievement); + data.isReadOnly = isReadOnly; + lua_pushboolean(state, isUnlocked); + return 1; +} + +// A counter, collectible or boss argument, an error past the last. +static int index_check(lua_State* state, const char* function, const char* kind, int last) +{ + int index = (int)luaL_checkinteger(state, 2); + if (index > last) + luaL_error(state, "bad argument #2 to '%s' (%s cannot be higher than %d)", function, kind, last); + return index; +} + +static int boss_check(lua_State* state, const char* function) +{ + int boss = (int)luaL_checkinteger(state, 2); + if (boss > BOSS_LAST || boss < 1) + luaL_error(state, "bad argument #2 to '%s' (expected BossType between 1 and 103 inclusive, got %d)", function, + boss); + return boss; +} + +// (LuaPersistentGameData.cpp) Registers PersistentGameData, the save file's progress. +static void persistent_game_data_register(lua_State* state) +{ + lua_class_begin(state, "PersistentGameData", LUA_CLASS_PERSISTENT_GAME_DATA); + lua_functions_add(state, {{"Unlock", achievement_unlock}, {"TryUnlock", achievement_unlock}}); + lua_method(state, "Unlocked", [](PersistentGameData& data, int achievement) { return data.Unlocked(achievement); }); + lua_functions_add( + state, + {{"IncreaseEventCounter", + [](lua_State* L) { + PersistentGameData& data = lua_get(L, 1); + int counter = index_check(L, "IncreaseEventCounter", "EventCounter", EVENT_COUNTER_LAST); + data.IncreaseEventCounter(counter, (int)luaL_checkinteger(L, 3)); + return 0; + }}, + {"GetEventCounter", + [](lua_State* L) { + PersistentGameData& data = lua_get(L, 1); + int counter = index_check(L, "GetEventCounter", "EventCounter", EVENT_COUNTER_LAST); + lua_pushinteger(L, counter >= 0 ? data.eventCounters[counter] : 0); + return 1; + }}, + {"IsItemInCollection", + [](lua_State* L) { + PersistentGameData& data = lua_get(L, 1); + int collectible = index_check(L, "IsItemInCollection", "CollectibleType", COLLECTIBLE_LAST); + lua_pushboolean(L, collectible >= 0 && data.itemsCollection[collectible]); + return 1; + }}, + {"AddBossKilled", + [](lua_State* L) { + lua_get(L, 1).AddBoss(boss_check(L, "AddBossKilled")); + return 0; + }}, + {"IsBossKilled", [](lua_State* L) { + PersistentGameData& data = lua_get(L, 1); + lua_pushboolean(L, data.bosses[boss_check(L, "IsBossKilled")]); + return 1; + }}}); + lua_method(state, "IsChallengeCompleted", [](PersistentGameData& data, int challenge) { + return challenge <= CHALLENGE_LAST ? challenge >= 0 && data.challenges[challenge] + : challenge_is_completed(challenge); + }); + lua_method(state, "GetBestiaryKillCount", [](PersistentGameData& data, int type, int variant) { + return data.GetBestiaryKillCount(type, variant); + }); + lua_method(state, "GetBestiaryDeathCount", [](PersistentGameData& data, int type, int variant) { + return data.GetBestiaryDeathCount(type, variant); + }); + lua_method(state, "GetBestiaryEncounterCount", [](PersistentGameData& data, int type, int variant) { + return data.GetBestiaryEncounterCount(type, variant); + }); + lua_method(state, "AddBestiaryKill", [](PersistentGameData& data, int type, LuaDefault variant) { + return data.AddBestiaryKill(type, variant.value); + }); + lua_class_hidden_end(state); +} + +// (LuaPersistentGameData.cpp, CompletionTracker.cpp, ChallengesStuff.cpp, LuaIsaac.cpp) Adds REPENTOGON's Isaac +// functions over the save file: its progress, the completion marks and the challenges. +void repentogon_isaac_saves_register(lua_State* state) +{ + lua_method(state, "GetPersistentGameData", []() -> PersistentGameData& { return g_manager->persistentGameData; }); + lua_functions_add(state, {{"GetCompletionMarks", marks_table_get}, + {"GetCompletionMarkData", marks_data_get}, + {"GetCompletionMark", mark_value_get}, + {"SetCompletionMarks", marks_table_set}, + {"SetCompletionMark", mark_value_set}, + {"AllMarksFilled", marks_filled_get}, + {"AllTaintedCompletion", marks_tainted_get}, + {"FillCompletionMarks", marks_fill}, + {"ClearCompletionMarks", marks_clear}, + {"SetChallengeCompletion", challenge_completion_set}, + {"GetModChallengeCompletionData", mod_challenge_completion_get}}); + lua_method(state, "MarkChallengeAsNotDone", [](int challenge) { challenge_completion_reset(challenge); }); + persistent_game_data_register(state); +} diff --git a/src/repentogon/api_weapons.cpp b/src/repentogon/api_weapons.cpp new file mode 100644 index 0000000..7e624f3 --- /dev/null +++ b/src/repentogon/api_weapons.cpp @@ -0,0 +1,616 @@ +#include "entity/familiar/familiar.h" +#include "entity/npc/npc.h" +#include "entity/player/player.h" +#include "entity/weapon/bomb.h" +#include "entity/weapon/knife.h" +#include "entity/weapon/laser.h" +#include "entity/weapon/projectile.h" +#include "entity/weapon/tear.h" +#include "entity/weapon/weapon.h" +#include "game/game.h" +#include "game/manager.h" +#include "repentogon/api.h" +#include "repentogon/callbacks.h" +#include "repentogon/weapons.h" +#include "ui/console.h" +#include + +// REPENTOGON's tear and weapon bindings (LuaInterfaces/Entities/LuaEntityTear.cpp, LuaEntityLaser.cpp, +// LuaEntityKnife.cpp, LuaEntityBomb.cpp, LuaEntityProjectile.cpp, LuaTearParams.cpp, LuaProjectileParams.cpp, +// LuaWeapon.cpp, LuaMultiShotParams.cpp and ASMSplitTears.cpp's FireSplitTear). + +constexpr int BOMB_COSTUME_LAST = 4; +constexpr int SPLIT_TEAR_ARG_TYPE = 7; +constexpr int SPLIT_TEAR_VARIANT_FETUS = 50; +constexpr int SPLIT_RNG_SHIFT = 35; +constexpr float SPLIT_DAMAGE_DEFAULT = 3.5f; +constexpr float SPLIT_DAMAGE_MULTIPLIER = 0.5f; +constexpr float SPLIT_SIZE_MULTIPLIER = 0.6f; +constexpr float SPLIT_FALL_RANGE = 0.2f; +constexpr float SPLIT_FALL_SPEED_SHARE = 0.3f; +constexpr float SPLIT_HEIGHT_SHARE = 0.5f; +constexpr float SPLIT_HEIGHT_DEFAULT = -11.875f; +constexpr float SPLIT_FALL_SPEED_DEFAULT = 0.185f; +constexpr float LASER_TURN_SPEED_DEFAULT = 8; +constexpr int WEAPON_SLOT_LAST = 4; +constexpr int WEAPON_TYPE_SPREAD_LAST = 15; +constexpr int SPREAD_LANES_MIN = 2; +constexpr float CLUB_SPREAD_SCALE = 3; +constexpr int SOUND_NONE = 0; + +// The weapon types whose spread MultiShotParams keeps in one field. +enum SpreadKind +{ + SPREAD_TEARS, + SPREAD_LASER, + SPREAD_KNIFE, + SPREAD_TECH_X, + SPREAD_CLUB, + SPREAD_NONE +}; + +// The spread field a weapon type reads. +static SpreadKind spread_kind_get(int weaponType) +{ + switch (weaponType) + { + case WEAPON_TEARS: + case WEAPON_BOMBS: return SPREAD_TEARS; + case WEAPON_BRIMSTONE: + case WEAPON_LASER: return SPREAD_LASER; + case WEAPON_KNIFE: return SPREAD_KNIFE; + case WEAPON_TECH_X: + case WEAPON_FETUS: return SPREAD_TECH_X; + case WEAPON_BONE: + case WEAPON_NOTCHED_AXE: return SPREAD_CLUB; + default: return SPREAD_NONE; + } +} + +// MultiShotParams:GetSpreadAngle, 0 for the weapons that never spread. +static int spread_angle_get(lua_State* state) +{ + Weapon_MultiShotParams& params = lua_get(state, 1); + int weaponType = (int)luaL_checkinteger(state, 2); + if (weaponType < WEAPON_TEARS || weaponType > WEAPON_TYPE_SPREAD_LAST) + return luaL_error(state, "WeaponTypes bigger 15 are not supported!"); + + float angles[] = {params.spreadAngleTears, params.spreadAngleLaser, params.spreadAngleKnife, + params.spreadAngleTechX, params.spreadAngleKnife * CLUB_SPREAD_SCALE, 0}; + lua_pushnumber(state, angles[spread_kind_get(weaponType)]); + return 1; +} + +// MultiShotParams:SetSpreadAngle, which needs two lanes an eye to show. +static int spread_angle_set(lua_State* state) +{ + Weapon_MultiShotParams& params = lua_get(state, 1); + int weaponType = (int)luaL_checkinteger(state, 2); + float angle = (float)luaL_checknumber(state, 3); + if (weaponType < WEAPON_TEARS || weaponType > WEAPON_TYPE_SPREAD_LAST) + return luaL_error(state, "A WeaponType bigger 15 is not supported!"); + + switch (spread_kind_get(weaponType)) + { + case SPREAD_TEARS: params.spreadAngleTears = angle; break; + case SPREAD_LASER: params.spreadAngleLaser = angle; break; + case SPREAD_KNIFE: params.spreadAngleKnife = angle; break; + case SPREAD_TECH_X: params.spreadAngleTechX = angle; break; + case SPREAD_CLUB: params.spreadAngleKnife = angle / CLUB_SPREAD_SCALE; break; + case SPREAD_NONE: return luaL_error(state, "The given WeaponType cant change its spread angle!"); + } + params.numLanesPerEye = std::max(params.numLanesPerEye, SPREAD_LANES_MIN); + return 0; +} + +// The entity indexes a hit list holds, as a table from 1. +template +static int hit_list_get(lua_State* state) +{ + std::vector& hitList = lua_get(state, 1).hitList; + lua_createtable(state, (int)hitList.size(), 0); + for (size_t i = 0; i < hitList.size(); i++) + { + lua_pushinteger(state, hitList[i]); + lua_rawseti(state, -2, (lua_Integer)i + 1); + } + return 1; +} + +// Adds GetHitList, and the functions that read and change the list, to the class begun last. +template +static void hit_list_register(lua_State* state, std::vector T::*) +{ + lua_pushcfunction(state, hit_list_get); + lua_table_set(state, -2, "GetHitList"); + lua_method(state, "RemoveFromHitList", [](T& shot, Entity& entity) { + auto found = std::ranges::find(shot.hitList, entity.GetHitListIndex()); + if (found == shot.hitList.end()) return; + std::swap(*found, shot.hitList.back()); + shot.hitList.pop_back(); + }); + lua_method(state, "AddToHitList", [](T& shot, Entity& entity) { + if (std::ranges::find(shot.hitList, entity.GetHitListIndex()) == shot.hitList.end()) + shot.hitList.push_back(entity.GetHitListIndex()); + }); + lua_method(state, "InHitList", [](T& shot, Entity& entity) { + return std::ranges::find(shot.hitList, entity.GetHitListIndex()) != shot.hitList.end(); + }); +} + +// MC_POST_FIRE_SPLIT_TEAR for a tear split from a tear, laser or knife, filtered by the split type (its name for a +// custom one). +static void split_tear_notify(Entity_Tear& tear, Entity& source, const SplitTear& split) +{ + if (source.type != ENTITY_TEAR && source.type != ENTITY_LASER && source.type != ENTITY_KNIFE) return; + + LuaEngine& engine = lua_engine_get(); + CallbackRun run = {"PostFireSplitTear", MC_POST_FIRE_SPLIT_TEAR, split.type}; + if (!split.name.empty()) run.stringParam = split.name.c_str(); + auto notify = [&](auto* typed, auto parameter) { callback_notify(engine, run, &tear, typed, parameter); }; + auto notifyAs = [&](auto parameter) { + if (source.type == ENTITY_TEAR) notify(static_cast(&source), parameter); + else if (source.type == ENTITY_LASER) notify(static_cast(&source), parameter); + else notify(static_cast(&source), parameter); + }; + if (split.name.empty()) notifyAs(split.type); + else notifyAs(split.name.c_str()); +} + +// (ASMSplitTears.cpp's FireSplitTear) A tear split off a tear, laser or knife: its damage, size, flags and color +// scaled from the source's (never Ludovico's, Dr. Fetus's only for fetus tears), falling as Cricket's Body's do, with +// the source's player as its parent. +Entity_Tear* split_tear_fire(Entity& source, const SplitShot& shot, const SplitTear& split) +{ + float damage = SPLIT_DAMAGE_DEFAULT; + float scale = 1; + TearFlags flags; + ColorMod color = COLOR_DEFAULT; + Entity_Player* player = nullptr; + if (auto* tear = dynamic_cast(&source)) + { + damage = tear->collisionDamage; + scale = tear->fScale; + flags = tear->tearFlags; + color = tear->sprite.color; + } + else if (auto* laser = dynamic_cast(&source)) + { + damage = laser->collisionDamage; + scale = laser->scale; + flags = laser->tearFlags; + color = laser->CalculateTearColor(); + } + else if (auto* knife = dynamic_cast(&source)) + { + damage = knife->collisionDamage; + scale = knife->sprite.scale.y; + flags = knife->tearFlags; + color = knife->sprite.color; + player = knife->GetPlayer(); + } + + flags.reset(TEAR_LUDOVICO); + if (shot.variant != SPLIT_TEAR_VARIANT_FETUS) flags.reset(TEAR_FETUS_FLAG); + auto* tear = static_cast(g_game->Spawn({.position = shot.position, + .velocity = shot.velocity, + .spawner = source.spawnerEntity.get(), + .type = ENTITY_TEAR, + .variant = shot.variant, + .seed = std::max(Random(), 1u)})); + if (!tear) return nullptr; + + Entity* spawner = source.spawnerEntity.get(); + Entity* parent = source.parent.get(); + if (source.type != ENTITY_KNIFE && spawner && spawner->is_player()) player = spawner->ToPlayer(); + else if (source.type != ENTITY_KNIFE && parent && parent->is_player()) player = parent->ToPlayer(); + + RNG fall; + fall.SetSeed(tear->initSeed, SPLIT_RNG_SHIFT); + float fallOffset = SPLIT_FALL_RANGE * fall.RandomFloat(); + if (player) + { + tear->SetHeight(player->tearHeight * SPLIT_HEIGHT_SHARE); + tear->fallingAccel = player->tearFallingAcceleration; + float fallSpeed = player->tearFallingSpeed; + if (fallSpeed > 0) fallSpeed *= SPLIT_FALL_SPEED_SHARE; + tear->fallingSpeed = fallOffset - fallSpeed; + } + else + { + tear->SetHeight(SPLIT_HEIGHT_DEFAULT); + tear->fallingSpeed = fallOffset + SPLIT_FALL_SPEED_DEFAULT; + } + + tear->baseDamage = std::max(damage * shot.damageMultiplier, 0.0f); + tear->collisionDamage = tear->baseDamage; + tear->SetScale(scale * shot.sizeMultiplier); + tear->SetTearFlags(flags); + tear->SetColor(color, -1, COLOR_PRIORITY_DEFAULT, true, false); + if (player) tear->parent = player; + tear->Update(); + split_tear_notify(*tear, source, split); + return tear; +} + +// :FireSplitTear of tears, lasers and knives: a split type is a SplitTearType or a custom name. +static int split_tear_fire_lua(lua_State* state) +{ + Entity& source = lua_get(state, 1); + SplitShot shot = {.position = lua_get(state, 2), + .velocity = lua_get(state, 3), + .damageMultiplier = (float)luaL_optnumber(state, 4, SPLIT_DAMAGE_MULTIPLIER), + .sizeMultiplier = (float)luaL_optnumber(state, 5, SPLIT_SIZE_MULTIPLIER), + .variant = (int)luaL_optinteger(state, 6, 0)}; + SplitTear split; + if (!lua_isnoneornil(state, SPLIT_TEAR_ARG_TYPE)) + { + bool isNamed = lua_type(state, SPLIT_TEAR_ARG_TYPE) != LUA_TNUMBER; + if (isNamed) split.name = luaL_checkstring(state, SPLIT_TEAR_ARG_TYPE); + else split.type = (int)luaL_checkinteger(state, SPLIT_TEAR_ARG_TYPE); + } + lua_push(state, split_tear_fire(source, shot, split)); + return 1; +} + +// A sound id SetInitSound takes: one sounds.xml has. +static uint32_t init_sound_check(lua_State* state) +{ + uint32_t soundId = (uint32_t)luaL_checkinteger(state, 2); + if (soundId >= g_manager->sfxManager.sounds.size()) luaL_argerror(state, 2, "Invalid SoundEffect"); + return soundId; +} + +// Plays a custom init sound set by SetInitSound, none for 0. Whether one was set. +bool init_sound_play(const std::optional& initSound) +{ + if (!initSound) return false; + if (*initSound != SOUND_NONE) g_manager->sfxManager.Play((int)*initSound); + return true; +} + +// Adds REPENTOGON's functions to EntityTear, begun last. ResetSpriteScale's optional force recomputes the scale's +// animation even when it has not changed. +void tear_api_register(lua_State* state) +{ + using T = Entity_Tear; + lua_method(state, "GetDeadEyeIntensity", [](T& tear) { return tear.deadEyeIntensity; }); + lua_method(state, "MakeMultidimensionalCopy", [](T& tear) { return tear.MakeMultidimensionalCopy(nullptr); }); + lua_method(state, "GetTearHaloSprite", [](T& tear) -> ANM2& { return tear.tearHaloANM2; }); + lua_method(state, "GetTearEffectSprite", [](T& tear) -> ANM2& { return tear.tearEffectANM2; }); + lua_method(state, "GetDeadEyeSprite", [](T& tear) -> ANM2& { return tear.deadEyeANM2; }); + lua_method(state, "ResetSpriteScale", [](T& tear, LuaOptionalBool isForced) { + if (isForced.value) tear.scaleAnimNum = -1; + tear.ResetSpriteScale(); + }); + lua_method(state, "IsMultidimensionalTouched", [](T& tear) { return tear.isMultidimensionalTouched; }); + lua_method(state, "SetMultidimensionalTouched", + [](T& tear, LuaCheckedBool isTouched) { tear.isMultidimensionalTouched = isTouched.value; }); + lua_method(state, "IsPrismTouched", [](T& tear) { return tear.isPrismTouched; }); + lua_method(state, "SetPrismTouched", + [](T& tear, LuaCheckedBool isTouched) { tear.isPrismTouched = isTouched.value; }); + hit_list_register(state, &Entity_Tear::hitList); + lua_method(state, "ClearHitList", [](T& tear) { tear.hitList.clear(); }); + lua_functions_add(state, {{"FireSplitTear", split_tear_fire_lua}, {"SetInitSound", [](lua_State* L) { + lua_get(L, 1).initSound = init_sound_check(L); + return 0; + }}}); +} + +// Adds REPENTOGON's functions to EntityLaser, begun last, and HomingType read as an integer. +void laser_api_register(lua_State* state) +{ + using L = Entity_Laser; + lua_method(state, "GetDisableFollowParent", [](L& laser) { return laser.isDisableFollowParent; }); + lua_method(state, "SetDisableFollowParent", + [](L& laser, LuaCheckedBool isDisabled) { laser.isDisableFollowParent = isDisabled.value; }); + lua_method(state, "GetOneHit", [](L& laser) { return laser.isOneHit; }); + lua_method(state, "GetScale", [](L& laser) { return laser.scale; }); + lua_method(state, "SetScale", [](L& laser, float scale) { + laser.scale = scale; + laser.ResetSpriteScale(); + }); + lua_method(state, "GetDamageMultiplier", [](L& laser) { return laser.damageMultiplier; }); + lua_method(state, "SetDamageMultiplier", [](L& laser, float multiplier) { laser.damageMultiplier = multiplier; }); + lua_method(state, "GetShrink", [](L& laser) { return laser.isShrink; }); + lua_method(state, "SetShrink", [](L& laser, LuaCheckedBool isShrink) { laser.isShrink = isShrink.value; }); + lua_method(state, "GetTimeout", [](L& laser) { return laser.timeout; }); + lua_method(state, "ResetSpriteScale", [](L& laser) { laser.ResetSpriteScale(); }); + lua_method(state, "RotateToAngle", [](L& laser, float angle, LuaDefault speed) { + laser.RotateToAngle(angle, speed.value); + }); + lua_method(state, "RecalculateSamplesNextUpdate", [](L& laser) { laser.isRecalculateSamplesNextUpdate = true; }); + lua_method(state, "IsMultidimensionalTouched", [](L& laser) { return laser.isMultidimensionalTouched; }); + lua_method(state, "IsPrismTouched", [](L& laser) { return laser.isPrismTouched; }); + lua_method(state, "SetPrismTouched", + [](L& laser, LuaCheckedBool isTouched) { laser.isPrismTouched = isTouched.value; }); + hit_list_register(state, &Entity_Laser::hitList); + lua_method(state, "GetNumChainedLasers", [](L& laser) { return laser.chainedLasers; }); + lua_method(state, "SetNumChainedLasers", [](L& laser, int count) { laser.chainedLasers = count; }); + lua_functions_add(state, {{"FireSplitTear", split_tear_fire_lua}, {"SetInitSound", [](lua_State* state) { + lua_get(state, 1).initSound = init_sound_check(state); + return 0; + }}}); + lua_property( + state, "HomingType", [](L& laser) { return laser.homingType; }, + [](L& laser, uint32_t type) { laser.homingType = type; }); +} + +// The "hitbox" knife's weapon knife, nil for anything else. +static Entity_Knife* hitbox_parent_get(Entity_Knife& knife) +{ + Entity* parent = knife.hitboxSource.get(); + return parent && parent->type == ENTITY_KNIFE ? static_cast(parent) : nullptr; +} + +// Adds REPENTOGON's functions to EntityKnife, begun last. InitHomingPath follows from the given source, else the +// knife's parent, else the knife. +void knife_api_register(lua_State* state) +{ + using K = Entity_Knife; + lua_method(state, "GetIsSwinging", [](K& knife) { return knife.isSwinging; }); + lua_method(state, "SetIsSwinging", + [](K& knife, LuaCheckedBool isSwinging) { knife.isSwinging = isSwinging.value; }); + lua_method(state, "GetIsSpinAttack", [](K& knife) { return knife.isSpinAttack; }); + lua_method(state, "SetIsSpinAttack", [](K& knife, LuaCheckedBool isSpin) { knife.isSpinAttack = isSpin.value; }); + lua_method(state, "IsMultidimensionalTouched", [](K& knife) { return knife.isMultidimensionalApplied; }); + lua_method(state, "SetMultidimensionalTouched", + [](K& knife, LuaCheckedBool isTouched) { knife.isMultidimensionalApplied = isTouched.value; }); + lua_method(state, "IsPrismTouched", [](K& knife) { return knife.isPrismApplied; }); + lua_method(state, "SetPrismTouched", + [](K& knife, LuaCheckedBool isTouched) { knife.isPrismApplied = isTouched.value; }); + lua_method(state, "GetHitboxParentKnife", hitbox_parent_get); + lua_method(state, "SetHitboxParentKnife", [](K& knife, K* parent) { knife.hitboxSource = parent; }); + hit_list_register(state, &Entity_Knife::hitList); + lua_method(state, "SetKnifeDistance", [](K& knife, float distance) { knife.knifeDistance = distance; }); + lua_method(state, "SetKnifeVelocity", [](K& knife, float velocity) { knife.knifeVelocity = velocity; }); + lua_method(state, "InitHomingPath", [](K& knife, Vector direction, Entity* source) { + Entity* parent = knife.parent.get(); + knife.InitHomingPath(direction, source ? source : parent ? parent : &knife, knife.pathOffset); + }); + lua_functions_add(state, {{"FireSplitTear", split_tear_fire_lua}}); +} + +// Logs a deprecation warning to the console once. +static void deprecation_warn(bool& isWarned, const char* message) +{ + if (isWarned) return; + g_game->console.Print(message, CONSOLE_WARNING); + isWarned = true; +} + +// EntityBomb's deprecated GetHeight and SetHeight, which reach its fall speed. +static float& bomb_height_get(Entity_Bomb& bomb) +{ + static bool isWarned = false; + deprecation_warn(isWarned, "[WARN] EntityBomb:Get/SetHeight is deprecated - It was mislabeled and actually " + "accesses the FallSpeed. For bomb \"height\", use `PositionOffset.Y`. " + "For falling speed, use EntityBomb:Get/SetFallSpeed.\n"); + return bomb.fallSpeed; +} + +// EntityBomb's deprecated GetFallingSpeed and SetFallingSpeed, which reach its fall acceleration. +static float& bomb_falling_speed_get(Entity_Bomb& bomb) +{ + static bool isWarned = false; + deprecation_warn(isWarned, "[WARN] EntityBomb:Get/SetFallingSpeed is deprecated - It was mislabeled and actually " + "accesses the FallAcceleration. Please use EntityBomb:Get/SetFallSpeed or " + "EntityBomb:Get/SetFallAcceleration instead.\n"); + return bomb.fallAcceleration; +} + +// EntityBomb:GetCostumeLayerSprite, an error past the five layers. +static int costume_layer_sprite_get(lua_State* state) +{ + Entity_Bomb& bomb = lua_get(state, 1); + int index = (int)luaL_checkinteger(state, 2); + if (index < 0 || index > BOMB_COSTUME_LAST) + return luaL_error(state, "Invalid index %d, value must be between 0 and 4", index); + lua_push(state, &bomb.bombCostumesSprites[index]); + return 1; +} + +// Adds REPENTOGON's functions to EntityBomb, begun last. UpdateDirtColor does nothing: REPENTOGON finds no such +// function in this version of the game. +void bomb_api_register(lua_State* state) +{ + using B = Entity_Bomb; + lua_pushcfunction(state, hit_list_get); + lua_table_set(state, -2, "GetHitList"); + lua_method(state, "UpdateDirtColor", [](B&) {}); + lua_method(state, "GetScale", [](B& bomb) { return bomb.scale; }); + lua_method(state, "SetScale", [](B& bomb, float scale) { bomb.scale = scale; }); + lua_method(state, "GetExplosionCountdown", [](B& bomb) { return bomb.explosionCountdown; }); + lua_method(state, "GetFallSpeed", [](B& bomb) { return bomb.fallSpeed; }); + lua_method(state, "SetFallSpeed", [](B& bomb, float speed) { bomb.fallSpeed = speed; }); + lua_method(state, "GetFallAcceleration", [](B& bomb) { return bomb.fallAcceleration; }); + lua_method(state, "SetFallAcceleration", [](B& bomb, float acceleration) { bomb.fallAcceleration = acceleration; }); + lua_method(state, "IsLoadingCostumes", [](B& bomb) { return bomb.isLoadCostumes; }); + lua_method(state, "SetLoadCostumes", + [](B& bomb, LuaOptionalBool isLoad) { bomb.isLoadCostumes = isLoad.value; }); + lua_functions_add(state, {{"GetCostumeLayerSprite", costume_layer_sprite_get}}); + lua_method(state, "GetRocketAngle", [](B& bomb) { return bomb.rocketAngle; }); + lua_method(state, "SetRocketAngle", [](B& bomb, float angle) { bomb.rocketAngle = angle; }); + lua_method(state, "GetRocketSpeed", [](B& bomb) { return bomb.rocketSpeed; }); + lua_method(state, "SetRocketSpeed", [](B& bomb, float speed) { bomb.rocketSpeed = speed; }); + lua_method(state, "IsPrismTouched", [](B& bomb) { return bomb.isPrismTouched; }); + lua_method(state, "SetPrismTouched", + [](B& bomb, LuaCheckedBool isTouched) { bomb.isPrismTouched = isTouched.value; }); + lua_method(state, "GetHeight", [](B& bomb) { return bomb_height_get(bomb); }); + lua_method(state, "SetHeight", [](B& bomb, float speed) { bomb_height_get(bomb) = speed; }); + lua_method(state, "GetFallingSpeed", [](B& bomb) { return bomb_falling_speed_get(bomb); }); + lua_method(state, "SetFallingSpeed", + [](B& bomb, float acceleration) { bomb_falling_speed_get(bomb) = acceleration; }); +} + +// Adds REPENTOGON's EntityProjectile:Deflect to the class begun last. +void projectile_api_register(lua_State* state) +{ + lua_method(state, "Deflect", [](Entity_Projectile& projectile, Vector velocity) { projectile.Reflect(velocity); }); +} + +// ProjectileParams.Damage's setter: any negative damage is -1, the default. +void projectile_params_api_register(lua_State* state) +{ + lua_property( + state, "Damage", [](ProjectileParams& params) { return params.damage; }, + [](ProjectileParams& params, float damage) { params.damage = damage < 0 ? -1 : damage; }); +} + +// A TearParams multiplier setter that refuses anything but a positive value. +template +static int positive_multiplier_set(lua_State* state) +{ + TearParams& params = lua_get(state, 1); + float value = (float)luaL_checknumber(state, 2); + constexpr const char* MESSAGE = Member == &TearParams::massMultiplier ? "MassMultiplier must be positive!" + : "KnockbackMultiplier must be positive!"; + if (value <= 0) return luaL_argerror(state, 2, MESSAGE); + params.*Member = value; + return 0; +} + +// TearDisplacement's setter, -1 or 1, though GetTearHitParams may leave 0. +static int tear_displacement_set(lua_State* state) +{ + TearParams& params = lua_get(state, 1); + int value = (int)luaL_checkinteger(state, 2); + if (value < -1 || value > 1) return luaL_argerror(state, 2, "TearDisplacement may only be set to -1 or 1"); + params.tearDisplacement = value; + return 0; +} + +// Adds REPENTOGON's properties to TearParams, begun last. +void tear_params_api_register(lua_State* state) +{ + for (auto [name, getter, setter] : + {std::tuple{"MassMultiplier", lua_member_get<&TearParams::massMultiplier>, + positive_multiplier_set<&TearParams::massMultiplier>}, + {"KnockbackMultiplier", lua_member_get<&TearParams::knockbackMultiplier>, + positive_multiplier_set<&TearParams::knockbackMultiplier>}, + {"TearDisplacement", lua_member_get<&TearParams::tearDisplacement>, tear_displacement_set}}) + { + lua_pushcfunction(state, getter); + lua_property_set(state, "__propget", name); + lua_pushcfunction(state, setter); + lua_property_set(state, "__propset", name); + } + lua_property( + state, "SpeedMultiplier", [](TearParams& params) { return params.speedMultiplier; }, + [](TearParams& params, float multiplier) { params.speedMultiplier = multiplier; }); +} + +// Isaac.CreateWeapon: a weapon of a type for an owner, which Lua holds with no slot. +static int weapon_create_lua(lua_State* state) +{ + int type = (int)luaL_checkinteger(state, 1); + Entity& owner = lua_get(state, 2); + if (type < WEAPON_NULL || type > WEAPON_UMBILICAL_WHIP) return luaL_argerror(state, 1, "Invalid WeaponType"); + lua_push(state, WeaponData{.weapon = weapon_create((WeaponType)type, &owner).release()}); + return 1; +} + +// Isaac.DestroyWeapon: frees a weapon taken from a player slot or a familiar, and empties its place. +static void weapon_destroy(WeaponData& data) +{ + if (data.player) data.player->weapons[data.slot].reset(); + else if (data.familiar) data.familiar->weapon.reset(); +} + +// EntityFamiliar:GetWeapon, nil without one. +int familiar_weapon_get(lua_State* state) +{ + Entity_Familiar& familiar = lua_get(state, 1); + if (familiar.weapon) lua_push(state, WeaponData{.weapon = familiar.weapon.get(), .familiar = &familiar}); + else lua_pushnil(state); + return 1; +} + +// EntityPlayer:GetWeapon, a slot from 0 to 4, nil when it is empty. +static int player_weapon_get(lua_State* state) +{ + Entity_Player& player = lua_get(state, 1); + int slot = (int)luaL_checkinteger(state, 2); + if (slot < 0 || slot > WEAPON_SLOT_LAST) return luaL_argerror(state, 2, "Index must be between 0 and 4"); + Weapon* weapon = player.weapons[slot].get(); + if (weapon) lua_push(state, WeaponData{.weapon = weapon, .player = &player, .slot = slot}); + else lua_pushnil(state); + return 1; +} + +// Weapon:SetModifiers adds the modifiers, and hands back its argument as REPENTOGON's does. +static int weapon_modifiers_add(lua_State* state) +{ + WeaponData& data = lua_get(state, 1); + data.weapon->modifiers |= (uint32_t)luaL_checkinteger(state, 2); + return 1; +} + +// Registers Weapon and MultiShotParams, which Lua holds by value. +void weapon_classes_register(lua_State* state) +{ + using W = WeaponData; + lua_class_begin(state, "Weapon", LUA_CLASS_WEAPON); + lua_method(state, "GetOwner", [](W& data) { return data.weapon->owner; }); + lua_method(state, "GetFireDelay", [](W& data) { return data.weapon->fireDelay; }); + lua_method(state, "SetFireDelay", [](W& data, float delay) { data.weapon->fireDelay = delay; }); + lua_method(state, "GetMaxFireDelay", [](W& data) { return data.weapon->maxFireDelay; }); + lua_method(state, "GetCharge", [](W& data) { return data.weapon->charge; }); + lua_method(state, "SetCharge", [](W& data, float charge) { data.weapon->charge = charge; }); + lua_method(state, "GetDirection", [](W& data) { return data.weapon->direction; }); + lua_method(state, "GetWeaponType", [](W& data) { return data.weapon->weaponType; }); + lua_method(state, "GetModifiers", [](W& data) { return data.weapon->modifiers; }); + lua_functions_add(state, {{"SetModifiers", weapon_modifiers_add}}); + lua_method(state, "GetNumFired", [](W& data) { return data.weapon->numFired; }); + lua_method(state, "PlayItemAnim", [](W& data, uint32_t item, int anim, Vector& position, float charge) { + data.weapon->UpdateHeadChargeAnimation((int)item, (HeadCharge)anim, position, charge); + }); + lua_method(state, "IsAxisAligned", [](W& data) { return data.weapon->IsAxisAligned(); }); + lua_method(state, "IsItemAnimFinished", + [](W& data, uint32_t item) { return data.weapon->IsItemAnimFinished((int)item); }); + lua_method(state, "ClearItemAnim", [](W& data, uint32_t item) { data.weapon->stop_costume_item_anim((int)item); }); + lua_method(state, "SetHeadLockTime", [](W& data, uint32_t time) { data.weapon->SetHeadLockTime((int)time); }); + lua_method(state, "GetMainEntity", [](W& data) { return data.weapon->GetMainEntity(); }); + lua_method(state, "GetMaxCharge", [](W& data) { return data.weapon->GetMaxCharge(); }); + lua_class_hidden_end(state); + + using M = Weapon_MultiShotParams; + lua_class_begin(state, "MultiShotParams", LUA_CLASS_MULTI_SHOT_PARAMS); + lua_method(state, "GetNumTears", [](M& params) { return params.numTears; }); + lua_method(state, "GetNumLanesPerEye", [](M& params) { return params.numLanesPerEye; }); + lua_method(state, "GetNumEyesActive", [](M& params) { return params.numEyesActive; }); + lua_method(state, "GetNumRandomDirTears", [](M& params) { return params.numRandomDirTears; }); + lua_method(state, "GetMultiEyeAngle", [](M& params) { return params.multiEyeAngle; }); + lua_method(state, "IsCrossEyed", [](M& params) { return params.isCrossEyed; }); + lua_method(state, "IsShootingBackwards", [](M& params) { return params.isShootingBackwards; }); + lua_method(state, "IsShootingSideways", [](M& params) { return params.isShootingSideways; }); + lua_method(state, "SetNumTears", [](M& params, int count) { params.numTears = (short)count; }); + lua_method(state, "SetNumLanesPerEye", [](M& params, uint32_t count) { params.numLanesPerEye = (short)count; }); + lua_method(state, "SetNumEyesActive", [](M& params, int count) { params.numEyesActive = count; }); + lua_method(state, "SetMultiEyeAngle", [](M& params, float angle) { params.multiEyeAngle = angle; }); + lua_method(state, "SetIsCrossEyed", [](M& params, LuaCheckedBool isOn) { params.isCrossEyed = isOn.value; }); + lua_method(state, "SetIsShootingBackwards", + [](M& params, LuaCheckedBool isOn) { params.isShootingBackwards = isOn.value; }); + lua_method(state, "SetIsShootingSideways", + [](M& params, LuaCheckedBool isOn) { params.isShootingSideways = isOn.value; }); + lua_method(state, "SetNumRandomDirTears", [](M& params, int count) { params.numRandomDirTears = (short)count; }); + lua_functions_add(state, {{"GetSpreadAngle", spread_angle_get}, {"SetSpreadAngle", spread_angle_set}}); + lua_class_hidden_end(state); +} + +// Adds Isaac.CreateWeapon and DestroyWeapon to the Isaac namespace, begun last. +void isaac_weapons_register(lua_State* state) +{ + lua_functions_add(state, {{"CreateWeapon", weapon_create_lua}}); + lua_method(state, "DestroyWeapon", weapon_destroy); +} + +// Adds EntityPlayer:GetWeapon and GetMultiShotParams (from LuaWeapon.cpp and LuaMultiShotParams.cpp) to the class +// begun last. +void player_weapon_api_register(lua_State* state) +{ + lua_functions_add(state, {{"GetWeapon", player_weapon_get}}); + lua_method(state, "GetMultiShotParams", [](Entity_Player& player, LuaDefault weaponType) { + return player.GetMultiShotParams((WeaponType)weaponType.value); + }); +} diff --git a/src/repentogon/audio.cpp b/src/repentogon/audio.cpp index 22c2fd2..554f9b7 100644 --- a/src/repentogon/audio.cpp +++ b/src/repentogon/audio.cpp @@ -1,10 +1,14 @@ #include "repentogon/audio.h" #include "game/music_manager.h" #include "game/sfx_manager.h" +#include "repentogon/api.h" #include "repentogon/callbacks.h" constexpr int SFX_PLAY_ARGUMENTS = 6; constexpr int MUSIC_PLAY_ARGUMENTS = 2; +constexpr float MUSIC_VOLUME_KEEP = -1; +constexpr float MUSIC_FADE_RATE_DEFAULT = 0.08f; +constexpr int JINGLE_DURATION_DEFAULT = 140; // Runs MC_PRE_SFX_PLAY and MC_POST_SFX_PLAY around SFXManager::Play, filtered by the sound. A PRE table of all six // arguments replaces them, false keeps the sound silent and skips POST. Whether it ran Play itself. @@ -93,3 +97,64 @@ bool music_jingle_pre(int& musicId) lua_pop(state, 1); return isPlayed; } + +// A music id REPENTOGON's MusicManager functions take: one music.xml has, else an error. +static int music_id_check(lua_State* state, MusicManager& music) +{ + int musicId = (int)luaL_checkinteger(state, 2); + if (!music.is_music_id_valid(musicId)) + luaL_error(state, "Invalid music ID %d. Min = 0, Max = %d", musicId, (int)music.tracks.size() - 1); + return musicId; +} + +// MusicManager:PlayJingle, which ducks the music for its duration. +static int jingle_play(lua_State* state) +{ + MusicManager& music = lua_get(state, 1); + int musicId = (int)luaL_checkinteger(state, 2); + int duration = (int)luaL_optinteger(state, 3, JINGLE_DURATION_DEFAULT); + if (duration <= 0) return luaL_argerror(state, 3, "Duration must be greater than zero!"); + music.PlayJingle(musicId); + music.jingleTimer = duration; + return 0; +} + +// Adds REPENTOGON's functions to MusicManager, begun last: Play, Crossfade and Fadein check the music id and take +// their volume and fade rate as optional. +void music_api_register(lua_State* state) +{ + lua_functions_add(state, {{"Play", + [](lua_State* L) { + MusicManager& music = lua_get(L, 1); + music.Play(music_id_check(L, music), (float)luaL_optnumber(L, 3, MUSIC_VOLUME_KEEP)); + return 0; + }}, + {"Crossfade", + [](lua_State* L) { + MusicManager& music = lua_get(L, 1); + int musicId = music_id_check(L, music); + music.Crossfade(musicId, (float)luaL_optnumber(L, 3, MUSIC_FADE_RATE_DEFAULT)); + return 0; + }}, + {"Fadein", + [](lua_State* L) { + MusicManager& music = lua_get(L, 1); + int musicId = music_id_check(L, music); + float volume = (float)luaL_optnumber(L, 3, 1); + music.Fadein(musicId, volume, (float)luaL_optnumber(L, 4, MUSIC_FADE_RATE_DEFAULT)); + return 0; + }}, + {"PlayJingle", jingle_play}}); + lua_method(state, "StopJingle", [](MusicManager& music) { + if (music.jingleTimer <= 0 && !music.jingle.isActive) return; + music.jingle.volume = 0; + music.jingle.targetVolume = 0; + music.jingle.isActive = false; + music.jingleDuck = 0; + music.jingleTimer = 0; + }); + lua_method(state, "GetCurrentJingleID", + [](MusicManager& music) { return music.jingleTimer < 1 ? 0 : (int)music.jingleId; }); + lua_method(state, "GetCurrentPitch", [](MusicManager& music) { return music.pitch; }); + lua_method(state, "SetCurrentPitch", [](MusicManager& music, float pitch) { music.pitch = pitch; }); +} diff --git a/src/repentogon/audio.h b/src/repentogon/audio.h index 88bd4e1..b9954b6 100644 --- a/src/repentogon/audio.h +++ b/src/repentogon/audio.h @@ -3,6 +3,7 @@ class MusicManager; class SFXManager; struct SoundPlay; +struct lua_State; // How a track starts, which MC_PRE_MUSIC_PLAY passes as whether it fades in. enum MusicStart @@ -22,3 +23,4 @@ bool sfx_play_hook(SFXManager& sfx, int soundId, SoundPlay play); bool music_play_pre(MusicManager& music, int& musicId, float& value, MusicStart start); bool music_layer_pre(int& layerId, LayerToggle toggle); bool music_jingle_pre(int& musicId); +void music_api_register(lua_State* state); diff --git a/src/repentogon/entities.h b/src/repentogon/entities.h index 6b6d95f..2725bbc 100644 --- a/src/repentogon/entities.h +++ b/src/repentogon/entities.h @@ -2,12 +2,15 @@ #include #include +#include struct Entity; struct Entity_Player; struct ColorParams; struct EntityRef; +struct EntitySaveState; struct Vector; +struct lua_State; // A hit as Entity::TakeDamage and Entity_Player::TakeDamage hold it where MC_ENTITY_TAKE_DMG runs, which mods may // change: its source, damage, the hearts it costs a player (none for others), countdown and flags. @@ -26,3 +29,16 @@ std::optional player_damage_hook(Entity_Player& player, DamageHit hit); void entity_kill_post(Entity& entity, const EntityRef& source); std::optional entity_throw_hook(Entity_Player& player, Vector velocity); bool entity_color_hook(Entity& entity, const ColorParams& params); + +// An entry of a saved entity list as Lua holds it (REPENTOGON's Lua_EntitySaveState): the list and its index. +struct EntitySaveStateHandle +{ + std::vector* states = nullptr; + int index = 0; +}; + +void entity_api_register(lua_State* state); +void effect_api_register(lua_State* state); +void grid_entity_api_register(lua_State* state); +void isaac_entities_register(lua_State* state); +void entity_classes_register(lua_State* state); diff --git a/src/repentogon/hud.cpp b/src/repentogon/hud.cpp index 3ef91e1..b8f4d44 100644 --- a/src/repentogon/hud.cpp +++ b/src/repentogon/hud.cpp @@ -1,6 +1,12 @@ #include "repentogon/hud.h" #include "entity/player/player.h" +#include "game/game.h" +#include "game/manager.h" +#include "repentogon/api.h" #include "repentogon/callbacks.h" +#include "ui/nightmare_scene.h" +#include +#include #include // The recent items MC_PRE_HISTORYHUD_RENDER hides this render, by id without the golden trinket flag. @@ -25,8 +31,8 @@ bool history_render_pre(Vector at, bool isMini) lua_State* state = engine.state; hiddenCollectibles.clear(); hiddenTrinkets.clear(); - if (!callback_run(engine, {"PreHistoryHudRender", MC_PRE_HISTORYHUD_RENDER, std::nullopt}, LuaOpaque{}, at, isMini)) - return true; + CallbackRun run = {"PreHistoryHudRender", MC_PRE_HISTORYHUD_RENDER, std::nullopt}; + if (!callback_run(engine, run, &g_game->hud.historyHUD, at, isMini)) return true; bool isDrawn = !is_result_false(state); if (lua_istable(state, -1)) @@ -41,13 +47,14 @@ bool history_render_pre(Vector at, bool isMini) // Runs MC_POST_HISTORYHUD_RENDER after the recent items drew. void history_render_post(Vector at, bool isMini) { - unfiltered_notify("PostHistoryHudRender", MC_POST_HISTORYHUD_RENDER, LuaOpaque{}, at, isMini); + unfiltered_notify("PostHistoryHudRender", MC_POST_HISTORYHUD_RENDER, &g_game->hud.historyHUD, at, isMini); } // Whether MC_PRE_HISTORYHUD_RENDER hid a recent item this render. bool is_history_icon_hidden(const HistoryHUDItem& icon) { - return (icon.isTrinket ? hiddenTrinkets : hiddenCollectibles).contains(icon.historyId & TRINKET_ID_MASK); + const HistoryItem& item = icon.historyItem; + return (item.isTrinket ? hiddenTrinkets : hiddenCollectibles).contains(item.id & TRINKET_ID_MASK); } // Runs MC_POST_HISTORYHUD_RECOMPUTE, filtered by the slot, after a slot's items were rebuilt at once. @@ -55,5 +62,456 @@ void history_recompute_post(int playerIndex, HistoryRebuild rebuild) { if (rebuild != HISTORY_REBUILD_ICONS || playerIndex < 0 || playerIndex >= HISTORY_PLAYER_COUNT) return; callback_notify(lua_engine_get(), {"PostHistoryHudRecompute", MC_POST_HISTORYHUD_RECOMPUTE, playerIndex}, - LuaOpaque{}, playerIndex); + &g_game->hud.historyHUD, playerIndex); +} + +// The flash a PlayerHUD's heart flash setters give when left out, and the longest they take. +constexpr int HEART_FLASH_LIMIT = std::numeric_limits::max(); +constexpr int NIGHTMARE_PROGRESS_FIRST = 1; +constexpr const char* PAUSE_FULL_ANM2 = "gfx/ui/PauseScreen.anm2"; +constexpr const char* PAUSE_STATS_ANM2 = "gfx/ui/PauseScreenStats.anm2"; +constexpr const char* PAUSE_MY_STUFF_ANM2 = "gfx/ui/Death Screen.anm2"; +constexpr const char* ANIMATION_DIARY = "Diary"; +constexpr int DIARY_LAYER_COUNT = 7; +constexpr int DIARY_ITEMS_LAYER = 6; + +// The pause screen's sprites REPENTOGON hands out that Rep+ loads but never draws. +enum PauseSprite +{ + PAUSE_SPRITE_FULL, + PAUSE_SPRITE_STATS, + PAUSE_SPRITE_MY_STUFF, + PAUSE_SPRITE_COUNT +}; + +// Which recent items HistoryHUD's getters list: of which player slot, collectibles, trinkets or both, those past the +// bottom of the screen too, by the ids asked for (any when none), as items or as their offsets. +struct HistoryQuery +{ + std::set ids; + int playerSlot = 0; + bool isCollectibleListed = false; + bool isHiddenListed = false; + bool isOffsetListed = false; + bool isTrinketListed = false; +}; + +// UTF-16 text as UTF-8, as REPENTOGON's WideCharToMultiByte reads a banner's lines. +static std::string utf8_from(std::u16string_view text) +{ + constexpr char16_t SURROGATE_HIGH = 0xd800; + constexpr char16_t SURROGATE_LOW = 0xdc00; + constexpr char16_t SURROGATE_END = 0xe000; + constexpr uint32_t SURROGATE_BASE = 0x10000; + constexpr int SURROGATE_SHIFT = 10; + constexpr int CONTINUATION_BITS = 6; + constexpr uint32_t CONTINUATION_MASK = 0x3f; + constexpr uint32_t CONTINUATION_MARK = 0x80; + // The first code point each length cannot hold, and the lead byte marks of two, three and four byte sequences. + constexpr std::array LENGTH_LIMITS = {0x80, 0x800, SURROGATE_BASE}; + constexpr std::array LEAD_MARKS = {0xc0, 0xe0, 0xf0}; + std::string result; + + for (size_t i = 0; i < text.size(); i++) + { + uint32_t code = text[i]; + bool isPair = code >= SURROGATE_HIGH && code < SURROGATE_LOW && i + 1 < text.size() && + text[i + 1] >= SURROGATE_LOW && text[i + 1] < SURROGATE_END; + if (isPair) code = SURROGATE_BASE + ((code - SURROGATE_HIGH) << SURROGATE_SHIFT) + (text[++i] - SURROGATE_LOW); + + int extra = (int)std::ranges::count_if(LENGTH_LIMITS, [&](uint32_t limit) { return code >= limit; }); + result += (char)(extra ? LEAD_MARKS[extra - 1] | code >> (CONTINUATION_BITS * extra) : code); + for (int shift = extra - 1; shift >= 0; shift--) + result += (char)(CONTINUATION_MARK | (code >> (CONTINUATION_BITS * shift) & CONTINUATION_MASK)); + } + return result; +} + +// Sets a banner's title (line 0) or subtitle (line 1), each byte a character as mbstowcs reads it, and redraws it. +static void message_text_set(HUD_Message& message, std::string_view text, int line) +{ + message.set_text_line(std::u16string(text.begin(), text.end()), line); + message.UpdateTextImage(); +} + +// Sets a heart flash countdown of a PlayerHUD, clamped to what it holds. +static void flash_set(int8_t& countdown, int duration) +{ + countdown = (int8_t)std::clamp(duration, 0, HEART_FLASH_LIMIT); +} + +// HUD:GetStackedMessage, GetCoopPlayerMessage, GetPlayerHUD and the banners' streak sprite getters: an element of one +// of the HUD's lists (or a member of it), by argument 2 (0 when left out), else the error naming the index. +template +static int hud_element_push(lua_State* state, const char* error) +{ + HUD& hud = lua_get(state, 1); + int index = (int)luaL_optinteger(state, 2, 0); + if (index < 0 || index >= (int)(hud.*List).size()) return luaL_error(state, error, index); + + auto& element = (hud.*List)[index]; + if constexpr (std::is_null_pointer_v) lua_push(state, &element); + else lua_push(state, &(element.*Member)); + return 1; +} + +// HUDMessage:Show: a title, an optional subtitle, sticky (staying until hidden) and curse display. +static int message_show(lua_State* state) +{ + HUD_Message& message = lua_get(state, 1); + std::string text = luaL_checkstring(state, 2); + std::string subtext = luaL_optstring(state, 3, ""); + bool isSticky = lua_get>(state, 4).value; + bool isCurse = lua_get>(state, 5).value; + message.Show(text.c_str(), subtext.c_str(), !isSticky, isCurse); + return 0; +} + +// The recent items player slot argument 2 names, raising REPENTOGON's error past the two. +static int history_slot_check(lua_State* state) +{ + int slot = (int)luaL_checkinteger(state, 2); + if (slot < 0 || slot >= HISTORY_PLAYER_COUNT) + luaL_error(state, "Invalid HistoryHUDPlayer index %d, must be 0 or 1", slot); + return slot; +} + +// Pushes a table of a player's recent items, newest first, as HistoryHUDItems or render offsets. +static int history_items_push(lua_State* state, const HistoryQuery& query) +{ + HistoryHUD& history = g_game->hud.historyHUD; + HistoryHUDPlayer& slot = history.players[query.playerSlot]; + int visibleCount = history.visible_items_get(); + lua_newtable(state); + if (!slot.player) return 1; + + int tableIndex = 1; + for (int i = 0; i < (int)slot.items.size(); i++) + { + if (!query.isHiddenListed && i >= visibleCount) break; + + const HistoryItem& item = slot.items[i].historyItem; + if (item.isTrinket ? !query.isTrinketListed : !query.isCollectibleListed) continue; + int id = item.isTrinket ? item.id & TRINKET_ID_MASK : item.id; + if (!query.ids.empty() && !query.ids.contains(id)) continue; + + if (query.isOffsetListed) lua_push(state, history.item_offset_get(query.playerSlot, i)); + else lua_push(state, HistoryHUDEntry{item, i, query.playerSlot}); + lua_rawseti(state, -2, tableIndex++); + } + return 1; +} + +// HistoryHUD:GetCollectibles, GetTrinkets and their offsets: a player's recent items of a kind, by an id or a table of +// ids at argument 3, those past the screen too when argument 4 is true. +template +static int history_kind_push(lua_State* state) +{ + HistoryQuery query = {.playerSlot = history_slot_check(state), .isCollectibleListed = !IsTrinket, + .isOffsetListed = IsOffset, .isTrinketListed = IsTrinket}; + auto id_add = [&](lua_Integer id) { query.ids.insert(IsTrinket ? (int)id & TRINKET_ID_MASK : (int)id); }; + if (lua_type(state, 3) == LUA_TTABLE) + for (lua_pushnil(state); lua_next(state, 3); lua_pop(state, 1)) + { + if (lua_isinteger(state, -1)) id_add(lua_tointeger(state, -1)); + } + else if (!lua_isnoneornil(state, 3)) id_add(luaL_checkinteger(state, 3)); + query.isHiddenListed = lua_get>(state, 4).value; + return history_items_push(state, query); +} + +// The pause screen sprite REPENTOGON hands out, loaded the first time as the game's Init loads it: the full paper, the +// stats paper and the My Stuff diary showing only its items layer. They live as long as the game. +static ANM2& pause_sprite_get(PauseSprite sprite) +{ + static std::array* sprites = nullptr; + if (!sprites) + { + sprites = new std::array; + (*sprites)[PAUSE_SPRITE_FULL].Load(PAUSE_FULL_ANM2, GRAPHICS_LOAD); + (*sprites)[PAUSE_SPRITE_STATS].Load(PAUSE_STATS_ANM2, GRAPHICS_LOAD); + ANM2& diary = (*sprites)[PAUSE_SPRITE_MY_STUFF]; + diary.Load(PAUSE_MY_STUFF_ANM2, GRAPHICS_LOAD); + diary.Play(ANIMATION_DIARY); + for (int layer = 0; layer < DIARY_LAYER_COUNT; layer++) + diary.GetLayer(layer)->isVisible = layer == DIARY_ITEMS_LAYER; + } + return (*sprites)[sprite]; +} + +// (LuaHUD.cpp, LuaHistoryHUD.cpp, LuaPlayerHUD.cpp) Adds REPENTOGON's functions to Lua's HUD begun last: its sprites, +// banners, boss bar fill, recent items and player HUDs. GetStackedStreakSprite and GetPlayerStreakSprite are only in +// its docs, here as they describe them. +void hud_methods_register(lua_State* state) +{ + lua_method(state, "FlashRedHearts", [](HUD& hud, Entity_Player& player) { hud.FlashRedHearts(&player); }); + lua_method(state, "GetChargeBarSprite", [](HUD& hud) { return &hud.chargeBarSprite; }); + lua_method(state, "GetHeartsSprite", [](HUD& hud) { return &hud.heartsSprite; }); + lua_method(state, "GetPickupsHUDSprite", [](HUD& hud) { return &hud.pickupHUDSprite; }); + lua_method(state, "GetCardsPillsSprite", [](HUD& hud) { return &hud.cardsPillsSprite; }); + lua_method(state, "GetStreakSprite", [](HUD& hud) { return &hud.messageMain.streakSprite; }); + lua_method(state, "GetMainMessage", [](HUD& hud) { return &hud.messageMain; }); + lua_method(state, "GetFortuneSprite", [](HUD& hud) { return &hud.fortuneSprite; }); + lua_method(state, "GetCoopMenuSprite", [](HUD& hud) { return &hud.coopMenuSprite; }); + lua_method(state, "GetInventorySprite", [](HUD& hud) { return &hud.inventorySprite; }); + lua_method(state, "GetCraftingSprite", [](HUD& hud) { return &hud.craftingTableSprite; }); + lua_method(state, "GetPoopSpellSprite", [](HUD& hud) { return &hud.poopSpellsSprite; }); + lua_method(state, "GetBossHPBarFill", [](HUD& hud) { return hud.bossHPBarFill; }); + lua_method(state, "SetBossHPBarFill", [](HUD& hud, float fill) { hud.bossHPBarFill = fill; }); + lua_method(state, "GetHistoryHUD", [](LuaIgnored) { return &g_game->hud.historyHUD; }); + lua_functions_add(state, {{"GetStackedMessage", + [](lua_State* s) { + return hud_element_push<&HUD::messageStack>(s, "Invalid HUD message index %d"); + }}, + {"GetCoopPlayerMessage", + [](lua_State* s) { + return hud_element_push<&HUD::messagePlayerHUD>( + s, "Invalid player HUD message index %d"); + }}, + {"GetPlayerHUD", + [](lua_State* s) { + return hud_element_push<&HUD::playerHUD>( + s, "Invalid index %d, value must be between 0 and 7"); + }}, + {"GetStackedStreakSprite", + [](lua_State* s) { + return hud_element_push<&HUD::messageStack, &HUD_Message::streakSprite>( + s, "Invalid HUD message index %d"); + }}, + {"GetPlayerStreakSprite", [](lua_State* s) { + return hud_element_push<&HUD::messagePlayerHUD, &HUD_Message::streakSprite>( + s, "Invalid player HUD message index %d"); + }}}); +} + +// Registers REPENTOGON's banner, recent items and player HUD classes. +static void hud_parts_register(lua_State* state) +{ + lua_class_begin(state, "HUDMessage", LUA_CLASS_HUD_MESSAGE); + lua_method(state, "GetSprite", [](HUD_Message& message) { return &message.streakSprite; }); + lua_method(state, "IsShowing", [](HUD_Message& message) { return message.isShowing; }); + lua_method(state, "Hide", [](HUD_Message& message) { message.isShowing = false; }); + lua_functions_add(state, {{"Show", message_show}}); + lua_method(state, "GetMainText", [](HUD_Message& message) { return utf8_from(message.text); }); + lua_method(state, "SetMainText", + [](HUD_Message& message, std::string_view text) { message_text_set(message, text, 0); }); + lua_method(state, "GetSubText", [](HUD_Message& message) { return utf8_from(message.subtext); }); + lua_method(state, "SetSubText", + [](HUD_Message& message, std::string_view text) { message_text_set(message, text, 1); }); + lua_class_hidden_end(state); + + lua_class_begin(state, "HistoryHUD", LUA_CLASS_HISTORY_HUD); + lua_method(state, "GetPosition", [](LuaIgnored) { return g_game->hud.historyHUD.position_get(); }); + lua_functions_add(state, {{"GetPlayer", + [](lua_State* s) { + lua_push(s, g_game->hud.historyHUD.players[history_slot_check(s)].player); + return 1; + }}, + {"GetItems", + [](lua_State* s) { + HistoryQuery query = {.playerSlot = history_slot_check(s), + .isCollectibleListed = true, + .isHiddenListed = lua_get>(s, 3).value, + .isTrinketListed = true}; + return history_items_push(s, query); + }}, + {"GetCollectibles", history_kind_push}, + {"GetCollectibleOffsets", history_kind_push}, + {"GetTrinkets", history_kind_push}, + {"GetTrinketOffsets", history_kind_push}}); + lua_class_hidden_end(state); + + lua_class_begin(state, "HistoryHUDItem", LUA_CLASS_HISTORY_HUD_ITEM); + lua_method(state, "GetItemID", [](HistoryHUDEntry& entry) { return entry.historyItem.id; }); + lua_method(state, "IsTrinket", [](HistoryHUDEntry& entry) { return entry.historyItem.isTrinket; }); + lua_method(state, "GetTime", [](HistoryHUDEntry& entry) { return entry.historyItem.time; }); + lua_method(state, "GetHistoryItem", [](HistoryHUDEntry& entry) { return entry.historyItem; }); + lua_method(state, "GetRenderOffset", [](HistoryHUDEntry& entry) { + return g_game->hud.historyHUD.item_offset_get(entry.playerSlot, entry.index); + }); + lua_method(state, "IsVisible", + [](HistoryHUDEntry& entry) { return entry.index < g_game->hud.historyHUD.visible_items_get(); }); + lua_class_hidden_end(state); + + lua_class_begin(state, "PlayerHUD", LUA_CLASS_PLAYER_HUD); + lua_method(state, "GetPlayer", [](PlayerHUD& hud) { return hud.player; }); + lua_method(state, "GetHUD", [](PlayerHUD& hud) { return hud.hud; }); + lua_method(state, "RenderActiveItem", [](PlayerHUD& hud, uint32_t slot, Vector at, LuaDefault alpha, + LuaDefault size) { + PlayerHudLayout layout = g_game->hud.GetPlayerHUDLayout(hud.playerHudIndex, hud.player); + hud.RenderActiveItem((int)slot, at, layout, size.value, alpha.value); + }); + lua_functions_add(state, {{"GetHearts", + [](lua_State* s) { + lua_newtable(s); + int key = 1; + for (PlayerHUDHeart& heart : lua_get(s, 1).hearts) + { + lua_push(s, heart); + lua_rawseti(s, -2, key++); + } + return 1; + }}, + {"GetHeartByIndex", [](lua_State* s) { + PlayerHUD& hud = lua_get(s, 1); + int index = (int)luaL_checkinteger(s, 2); + if (index < 0 || index >= PLAYER_HUD_HEART_COUNT) + return luaL_error(s, "Invalid index: %d", index); + lua_push(s, hud.hearts[index]); + return 1; + }}}); + lua_method(state, "GetIndex", [](PlayerHUD& hud) { return (int)hud.playerHudIndex; }); + lua_method(state, "GetLayout", + [](PlayerHUD& hud) { return g_game->hud.GetPlayerHUDLayout(hud.playerHudIndex, hud.player); }); + lua_method(state, "SetFlashRedHearts", [](PlayerHUD& hud, LuaDefault duration) { + flash_set(hud.redHeartFlashCountdown, duration.value); + }); + lua_method(state, "GetFlashRedHearts", [](PlayerHUD& hud) { return (int)hud.redHeartFlashCountdown; }); + lua_method(state, "SetFlashSoulHearts", [](PlayerHUD& hud, LuaDefault duration) { + flash_set(hud.soulHeartFlashCountdown, duration.value); + }); + lua_method(state, "GetFlashSoulHearts", [](PlayerHUD& hud) { return (int)hud.soulHeartFlashCountdown; }); + lua_method(state, "SetFlashGoldHearts", [](PlayerHUD& hud, LuaDefault duration) { + flash_set(hud.goldHeartFlashCountdown, duration.value); + }); + lua_method(state, "GetFlashGoldHearts", [](PlayerHUD& hud) { return (int)hud.goldHeartFlashCountdown; }); + lua_class_hidden_end(state); + + lua_class_begin(state, "PlayerHUDHeart", LUA_CLASS_PLAYER_HUD_HEART); + lua_method(state, "IsVisible", [](PlayerHUDHeart& heart) { return heart.isVisible; }); + lua_method(state, "IsEternalHeartOverlayVisible", + [](PlayerHUDHeart& heart) { return heart.isEternalHeartVisible; }); + lua_method(state, "IsGoldenHeartOverlayVisible", [](PlayerHUDHeart& heart) { return heart.isGoldenHeartVisible; }); + lua_method(state, "IsFadingHeart", [](PlayerHUDHeart& heart) { return heart.isFadeHeart; }); + lua_method(state, "GetFlashType", [](PlayerHUDHeart& heart) { return heart.flashType; }); + lua_method(state, "GetHeartAnim", [](PlayerHUDHeart& heart) { return heart.spriteAnim; }); + lua_method(state, "GetHeartOverlayAnim", [](PlayerHUDHeart& heart) { return heart.spriteOverlayAnim; }); + lua_class_hidden_end(state); +} + +// (LuaMinimap.cpp, LuaMinimapConfig.cpp) Registers REPENTOGON's Minimap namespace on the run's map, and the class of +// its two map configs (MinimapConfig), which nothing hands out. +static void minimap_register(lua_State* state) +{ + lua_namespace_begin(state, "Minimap"); + lua_method(state, "GetState", [] { return g_game->minimap.state; }); + lua_method(state, "SetState", [](int mapState) { g_game->minimap.state = (MinimapState)mapState; }); + lua_method(state, "GetHoldTime", [] { return g_game->minimap.holdTime; }); + lua_method(state, "SetHoldTime", [](int time) { g_game->minimap.holdTime = time; }); + lua_method(state, "GetDisplayedSize", [] { return g_game->minimap.GetDisplayedSize(); }); + lua_method(state, "GetItemIconsSprite", [] { return &g_game->minimap.itemIconsSprite; }); + lua_method(state, "GetIconsSprite", [] { return &g_game->minimap.iconsSprite; }); + lua_method(state, "GetShakeDuration", [] { return g_game->minimap.shakeDuration; }); + lua_method(state, "SetShakeDuration", [](int duration) { g_game->minimap.shakeDuration = duration; }); + lua_method(state, "GetShakeOffset", [] { return g_game->minimap.shakeOffset; }); + lua_method(state, "SetShakeOffset", [](Vector offset) { g_game->minimap.shakeOffset = offset; }); + lua_method(state, "Refresh", [] { g_game->minimap.Refresh(); }); + lua_namespace_plain_end(state); + + lua_class_begin(state, "MinimapConfig", LUA_CLASS_MINIMAP_CONFIG); + lua_functions_add(state, {{"GetSprite", + [](lua_State* s) { + lua_push(s, lua_get(s, 1).mapSprite); + return 1; + }}, + {"GetVec1", lua_member_get<&MinimapConfig::iconSize>}, + {"SetVec1", lua_member_set<&MinimapConfig::iconSize>}, + {"GetBorderPadding", lua_member_get<&MinimapConfig::cellSize>}, + {"SetBorderPadding", lua_member_set<&MinimapConfig::cellSize>}, + {"GetPosOffsetX", lua_member_get<&MinimapConfig::margin>}, + {"SetPosOffsetX", lua_member_set<&MinimapConfig::margin>}, + {"GetBorderScale", lua_member_get<&MinimapConfig::gap>}, + {"SetBorderScale", lua_member_set<&MinimapConfig::gap>}, + {"GetI1", lua_member_get<&MinimapConfig::columns>}, + {"SetI1", lua_member_set<&MinimapConfig::columns>}, + {"GetI2", lua_member_get<&MinimapConfig::rows>}, + {"SetI2", lua_member_set<&MinimapConfig::rows>}, + {"GetIconNum", lua_member_get<&MinimapConfig::iconLimit>}, + {"SetIconNum", lua_member_set<&MinimapConfig::iconLimit>}}); + lua_class_hidden_end(state); +} + +// (LuaScoreSheet.cpp, LuaItemOverlay.cpp, LuaNightmareScene.cpp, LuaPauseMenu.cpp) Registers REPENTOGON's namespaces +// on the run's score sheet, giant item overlay, pause screen and the nightmare between floors. +static void screens_register(lua_State* state) +{ + lua_namespace_begin(state, "ScoreSheet"); + lua_method(state, "Calculate", [] { g_game->scoreSheet.Calculate(); }); + lua_method(state, "GetStageBonus", [] { return g_game->scoreSheet.stageBonus; }); + lua_method(state, "GetSchwagBonus", [] { return g_game->scoreSheet.schwagBonus; }); + lua_method(state, "GetBlueBabyBonus", [] { return g_game->scoreSheet.blueBabyBonus; }); + lua_method(state, "GetLambBonus", [] { return g_game->scoreSheet.lambBonus; }); + lua_method(state, "GetMegaSatanBonus", [] { return g_game->scoreSheet.megaSatanBonus; }); + lua_method(state, "GetRushBonus", [] { return g_game->scoreSheet.rushBonus; }); + lua_method(state, "GetExplorationBonus", [] { return g_game->scoreSheet.explorationBonus; }); + lua_method(state, "GetDamagePenalty", [] { return g_game->scoreSheet.damagePenalty; }); + lua_method(state, "GetTimePenalty", [] { return g_game->scoreSheet.timePenalty; }); + lua_method(state, "GetItemPenalty", [] { return g_game->scoreSheet.itemPenalty; }); + lua_method(state, "GetTotalScore", [] { return g_game->scoreSheet.totalScore; }); + lua_method(state, "GetRunTimeLevel", [] { return g_game->scoreSheet.runTimeLevel; }); + lua_method(state, "GetRunTimeLevelType", [] { return g_game->scoreSheet.runTimeLevelType; }); + lua_method(state, "GetRunTime", [] { return g_game->scoreSheet.runTime; }); + lua_method(state, "GetRunEnding", [] { return g_game->scoreSheet.runEnding; }); + lua_method(state, "SetRunEnding", [](int ending) { g_game->scoreSheet.runEnding = (GameEnding)ending; }); + lua_method(state, "AddFinishedStage", [](int stage, int stageType, uint32_t time) { + g_game->scoreSheet.AddFinishedStage({stage, stageType, false}, (int)time); + }); + lua_method(state, "GetMotherBonus", [] { return g_game->scoreSheet.motherBonus; }); + lua_method(state, "GetDeliriumBonus", [] { return g_game->scoreSheet.deliriumBonus; }); + lua_method(state, "GetBeastBonus", [] { return g_game->scoreSheet.beastBonus; }); + lua_namespace_plain_end(state); + + lua_namespace_begin(state, "ItemOverlay"); + lua_method(state, "GetOverlayID", [] { return g_game->itemOverlay.overlayID; }); + lua_functions_add(state, {{"Show", [](lua_State* s) { + int overlay = (int)luaL_checkinteger(s, 1); + int delay = (int)luaL_optinteger(s, 2, 0); + bool isPlayerGiven = lua_gettop(s) == 4 && !lua_isnil(s, 3); + g_game->itemOverlay.Show(overlay, delay, + isPlayerGiven ? &lua_get(s, 3) : nullptr); + return 0; + }}}); + lua_method(state, "GetSprite", [] { return &g_game->itemOverlay.sprite; }); + lua_method(state, "GetDelay", [] { return g_game->itemOverlay.delay; }); + lua_method(state, "GetPlayer", [] { return (Entity_Player*)g_game->itemOverlay.player.get(); }); + lua_method(state, "GetMegaMushPlayerSprite", [] { return &g_game->itemOverlay.megaMushPlayerSprite; }); + lua_namespace_plain_end(state); + + lua_namespace_begin(state, "NightmareScene"); + lua_method(state, "GetBackgroundSprite", [] { return &g_manager->nightmareScene.backgroundSprite; }); + lua_method(state, "GetBubbleSprite", [] { return &g_manager->nightmareScene.bubbleSprite; }); + lua_method(state, "GetProgressBarSprite", [] { return &g_manager->nightmareScene.progressBarSprite; }); + lua_functions_add(state, {{"GetProgressBarMap", [](lua_State* s) { + lua_newtable(s); + int key = NIGHTMARE_PROGRESS_FIRST; + for (int icon : g_manager->nightmareScene.stageIcons) + { + lua_pushinteger(s, icon); + lua_rawseti(s, -2, key++); + } + return 1; + }}}); + lua_method(state, "IsDogmaNightmare", [] { return g_manager->nightmareScene.isDogma; }); + lua_method(state, "GetPlayerExtraPortraitSprite", + [] { return &g_manager->nightmareScene.playerExtraPortraitSprite; }); + lua_namespace_plain_end(state); + + lua_namespace_begin(state, "PauseMenu"); + lua_method(state, "GetSprite", [] { return &pause_sprite_get(PAUSE_SPRITE_FULL); }); + lua_method(state, "GetStatsSprite", [] { return &pause_sprite_get(PAUSE_SPRITE_STATS); }); + lua_method(state, "GetMyStuffSprite", [] { return &pause_sprite_get(PAUSE_SPRITE_MY_STUFF); }); + lua_method(state, "GetCompletionMarksSprite", [] { return &g_game->pauseScreen.completionWidget.anm2; }); + lua_method(state, "GetSelectedElement", [] { return g_game->pauseScreen.selectedElement; }); + lua_method(state, "SetSelectedElement", [](int element) { g_game->pauseScreen.selectedElement = element; }); + lua_method(state, "GetState", [] { return g_game->pauseScreen.state; }); + lua_method(state, "SetState", [](int pauseState) { g_game->pauseScreen.state = (PauseState)pauseState; }); + lua_namespace_plain_end(state); +} + +// Registers REPENTOGON's HUD classes and namespaces. +void hud_classes_register(lua_State* state) +{ + hud_parts_register(state); + minimap_register(state); + screens_register(state); } diff --git a/src/repentogon/hud.h b/src/repentogon/hud.h index ef8266a..fe5e30d 100644 --- a/src/repentogon/hud.h +++ b/src/repentogon/hud.h @@ -1,8 +1,30 @@ #pragma once +#include "lua/api.h" #include "ui/hud.h" +struct MinimapConfig; + +// A recent item as REPENTOGON's HistoryHUDItem holds it (HistoryHUD_Item_Ex): a copy of its history entry, its place +// in its player's list and the player's slot. +struct HistoryHUDEntry +{ + HistoryItem historyItem; + int index = 0; + int playerSlot = 0; +}; + +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_HISTORY_HUD; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_HISTORY_HUD_ITEM; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_HISTORY_ITEM; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_HUD_MESSAGE; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_MINIMAP_CONFIG; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_PLAYER_HUD; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_PLAYER_HUD_HEART; + bool history_render_pre(Vector at, bool isMini); void history_render_post(Vector at, bool isMini); bool is_history_icon_hidden(const HistoryHUDItem& icon); void history_recompute_post(int playerIndex, HistoryRebuild rebuild); +void hud_methods_register(lua_State* state); +void hud_classes_register(lua_State* state); diff --git a/src/repentogon/items.cpp b/src/repentogon/items.cpp index d5aa2d4..bcdcc49 100644 --- a/src/repentogon/items.cpp +++ b/src/repentogon/items.cpp @@ -9,6 +9,7 @@ #include "repentogon/callbacks.h" #include #include +#include constexpr int MORPH_KIND_SIZE = 3; constexpr int MORPH_FULL_SIZE = 6; @@ -494,3 +495,16 @@ void bag_add_post(Entity_Player& player, Entity_Pickup& pickup) CallbackRun run = {"PostAddToBagOfCrafting", MC_POST_ADD_TO_BAG_OF_CRAFTING, pickup.variant}; callback_notify(lua_engine_get(), run, &player, &pickup); } + +// XMLData::ParseTagsString: the space-separated words of a customtags or customcache attribute, lowercased. +void custom_tags_parse(std::string_view text, std::set& tags) +{ + std::string lower(text); + std::ranges::transform(lower, lower.begin(), [](unsigned char c) { return (char)std::tolower(c); }); + for (size_t start = 0; start < lower.size();) + { + size_t end = std::min(lower.find(' ', start), lower.size()); + if (end > start) tags.insert(lower.substr(start, end - start)); + start = end + 1; + } +} diff --git a/src/repentogon/items.h b/src/repentogon/items.h index 9b4eb62..8135d3f 100644 --- a/src/repentogon/items.h +++ b/src/repentogon/items.h @@ -3,6 +3,9 @@ #include #include #include +#include +#include +#include struct Entity_Pickup; struct Entity_Player; @@ -12,6 +15,10 @@ struct UseResult; class Level; class Room; +// The custom tags that make an item's holder fly (REPENTOGON's CustomTags::FLYING and FLYING_EFFECT). +constexpr const char* CUSTOM_TAG_FLYING = "flying"; +constexpr const char* CUSTOM_TAG_FLYING_EFFECT = "flyingeffect"; + // How a collectible left for MC_POST_TRIGGER_COLLECTIBLE_REMOVED: taken counting towards its form or not (Entity_Player:: // RemoveCollectible's choice), or its item wisp gone. enum CollectibleRemoval @@ -101,3 +108,4 @@ void pickup_morph_post(const PickupMorphed& morphed); bool shop_restock_pre(RestockKind kind); void shop_restock_post(RestockKind kind); void pickup_selection_post(Entity_Pickup& pickup, PickupChoice& choice, const PickupChoice& requested); +void custom_tags_parse(std::string_view text, std::set& tags); diff --git a/src/repentogon/level.cpp b/src/repentogon/level.cpp index 1a34a49..a3710fc 100644 --- a/src/repentogon/level.cpp +++ b/src/repentogon/level.cpp @@ -6,6 +6,7 @@ #include "level/grid/grid_entity.h" #include "level/room.h" #include "level/room_config.h" +#include "repentogon/api_level.h" #include "repentogon/callbacks.h" constexpr int LEVEL_STAGE_LAST = 14; @@ -123,14 +124,13 @@ void level_select_pre(int& stage, int& stageType) } // Runs MC_PRE_LEVEL_PLACE_ROOM for a layout slot about to get a room. A room config a mod returned replaces the room -// when its shape matches and it has every door the slot needs. The API has no LevelGeneratorRoom yet, so the slot is -// passed as an opaque userdata. +// when its shape matches and it has every door the slot needs. RoomConfig_Room* place_room_pre(const LevelGenerator_Room& slot, RoomConfig_Room* config, uint32_t seed) { LuaEngine& engine = lua_engine_get(); lua_State* state = engine.state; CallbackRun run = {"PreLevelPlaceRoom", MC_PRE_LEVEL_PLACE_ROOM, std::nullopt}; - if (!callback_run(engine, run, LuaOpaque{}, config, seed)) return config; + if (!callback_run(engine, run, &slot, config, seed)) return config; auto* other = (RoomConfig_Room*)lua_object_test(state, -1, LUA_CLASS_ROOM_CONFIG_ROOM); if (lua_isuserdata(state, -1) && !other) diff --git a/src/repentogon/level.h b/src/repentogon/level.h index 4b5a37a..c3ae395 100644 --- a/src/repentogon/level.h +++ b/src/repentogon/level.h @@ -2,6 +2,7 @@ #include #include +#include class Room; struct BackwardsStageDesc; @@ -30,6 +31,13 @@ std::optional grid_desc_spawn_pre(Room& room, int gridIndex, GridEntityDes bool room_grid_spawn_pre(GridEntityType& type, int& variant, int& varData, int gridIndex, uint32_t& seed); bool grid_hurt_pre(GridEntity& grid, int& damage, const EntityRef& source); void grid_hurt_post(GridEntity& grid, int damage, const EntityRef& source); +void level_init_pre(); +const std::string& level_name_override_get(); +int special_quest_force_get(); +bool special_quest_check(int expectedStage, int quest); +bool special_quest_stage_type_check(bool isAltPath); +int room_item_pool_forced_get(); +void room_item_pool_reset(); // Runs MC_PRE_GRID_HURT, which may change the damage or cancel the hurt, then hurt, then MC_POST_GRID_HURT once it // hurt. Only a grid entity that can still be hurt runs them. diff --git a/src/repentogon/lua_render.cpp b/src/repentogon/lua_render.cpp new file mode 100644 index 0000000..ca16575 --- /dev/null +++ b/src/repentogon/lua_render.cpp @@ -0,0 +1,1077 @@ +#include "engine/beam_renderer.h" +#include "engine/gl.h" +#include "engine/render_passes.h" +#include "game/debug_renderer.h" +#include "game/game.h" +#include "game/manager.h" +#include "level/room.h" +#include "repentogon/lua_render.h" +#include "ui/menu/collection.h" +#include +#include +#include +#include +#include +#include +#include + +constexpr const char* PROCEDURAL_SUFFIX = ".procedural"; +constexpr const char* VERTEX_EXTENSION = ".vs"; +constexpr const char* FRAGMENT_EXTENSION = ".fs"; +constexpr int TEXEL_BYTES = 4; +constexpr int SHADER_FORMAT_FIRST = KAGE::Graphics::VERTEX_FLOAT; +constexpr int SHADER_FORMAT_LAST = KAGE::Graphics::VERTEX_FLOAT_OTHER; +// Lua_RenderToWorld's mapping of the HUD's view onto the world's. +constexpr float WORLD_VIEWPORT_WIDTH = 338; +constexpr float WORLD_VIEWPORT_HEIGHT = 182; +constexpr float WORLD_RENDER_ORIGIN_X = 60; +constexpr float WORLD_RENDER_ORIGIN_Y = 140; +constexpr float WORLD_TO_SCREEN_SCALE = 0.65f; + +// The game's shaders by REPENTOGON's ShaderType. +constexpr const char* SHADER_TYPE_NAMES[] = { + "ColorOffset", "Pixelation", "Bloom", "ColorCorrection", "HQ4X", + "Shockwave", "OldTV", "WaterSurface", "Hallucination", "ColorMod", + "ColorOffsetChampion", "WaterSurfaceV2", "Background", "WaterOverlay", "ColorOffsetAttr", + "ColorOffsetDogma", "ColorOffsetGold", "Dizzy", "HeatWave", "Mirror"}; +constexpr int SHADER_TYPE_COUNT = (int)std::size(SHADER_TYPE_NAMES); + +// A quad corner REPENTOGON's RenderMatrix moves: x' = a x + b y + tx and y' = c x + d y + ty. +struct RenderMatrix +{ + float a = 1; + float b = 0; + float tx = 0; + float c = 0; + float d = 1; + float ty = 0; +}; + +// One draw a Transformer queues: an image's source quad onto a destination with a color at each corner. +struct Transformation +{ + std::array colors; + KAGE::Graphics::ImagePtr input; + DestinationQuad dest; + SourceQuad source; +}; + +// REPENTOGON's Transformer: draws queued onto a procedural image, all at once by Apply, after which it takes none. +struct LuaTransformer +{ + std::vector transformations; + KAGE::Graphics::ImagePtr output; + bool isValid = true; +}; + +// What a RenderToImage function draws with: valid only while it runs. +struct SurfaceRenderController +{ + bool isValid = true; +}; + +// A point of a Beam: where, its spritesheet coordinate and width, its color, and whether it is a world position. +struct LuaBeamPoint +{ + ColorMod color = COLOR_DEFAULT; + Vector pos{}; + float coordinate = 0; + float width = 1; + bool isWorldSpace = true; +}; + +// REPENTOGON's Beam: a copy of a sprite drawn along points through the game's strip renderer, from one layer of its +// main or overlay animation. +struct LuaBeam +{ + std::deque points; + ANM2 sprite; + int layerId = 0; + bool isOverlay = false; + bool isHeightCoordinate = false; +}; + +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_BEAM; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_BEAM_POINT; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_TRANSFORMER; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_SURFACE_RENDER_CONTROLLER; + +// The mods' shaders ShaderLoader loaded, by normalized path, failed ones left out. +static std::unordered_map> modShaders; + +// ShaderLoader::LoadShader: a shader of a loaded mod's resources, its .vs and .fs at path, built once with its vertex +// attributes. Null with the reason when it fails. +KAGE::Graphics::Shader* shader_mod_load(std::string_view path, + std::span attributes, std::string& error) +{ + std::string slashed = std::regex_replace(std::string(path), std::regex(R"([\/\\]+)"), "/"); + std::string key = slashed; + std::ranges::transform(key, key.begin(), [](unsigned char c) { return (char)std::tolower(c); }); + auto found = modShaders.find(key); + if (found != modShaders.end()) return found->second.get(); + + std::string vertex; + std::string fragment; + for (const std::unique_ptr& mod : g_manager->modManager.mods) + { + std::filesystem::path base = std::filesystem::path(mod->resourcesDirectory) / slashed; + std::ifstream vertexFile(base.string() + VERTEX_EXTENSION); + std::ifstream fragmentFile(base.string() + FRAGMENT_EXTENSION); + if (!mod->isLoaded || !vertexFile || !fragmentFile) continue; + + vertex.assign(std::istreambuf_iterator(vertexFile), {}); + fragment.assign(std::istreambuf_iterator(fragmentFile), {}); + break; + } + if (vertex.empty() || fragment.empty()) + { + error = "No shader exists for the specified path"; + return nullptr; + } + + auto shader = std::make_unique(); + if (!KAGE::Graphics::manager.isInitialized || !shader->load(key, attributes, {vertex, fragment})) + { + error = "Shader failed to compile"; + return nullptr; + } + return (modShaders[key] = std::move(shader)).get(); +} + +// The DestinationQuad argument index holds, an argument error for a SourceQuad. +static DestinationQuad& dest_quad_get(lua_State* state, int index) +{ + if (lua_object_test(state, index, LUA_CLASS_SOURCE_QUAD)) + luaL_argerror(state, index, "DestinationQuad expected, got SourceQuad"); + return lua_get(state, index); +} + +// Moves a quad's corners by a matrix about an anchor. +static void quad_transform(DestinationQuad& quad, Vector anchor, const RenderMatrix& matrix) +{ + for (Vector* corner : {&quad._topLeft, &quad._topRight, &quad._bottomLeft, &quad._bottomRight}) + { + float x = corner->x - anchor.x; + float y = corner->y - anchor.y; + corner->x = matrix.a * x + matrix.b * y + matrix.tx + anchor.x; + corner->y = matrix.c * x + matrix.d * y + matrix.ty + anchor.y; + } +} + +// get_render_matrix: a matrix from a table of two rows of three numbers. +static RenderMatrix matrix_read(lua_State* state, int index) +{ + if (!lua_istable(state, index)) luaL_argerror(state, index, "render matrix is not a table"); + + RenderMatrix matrix; + float* rows[][3] = {{&matrix.a, &matrix.b, &matrix.tx}, {&matrix.c, &matrix.d, &matrix.ty}}; + for (int row = 0; row < 2; row++) + { + lua_rawgeti(state, index, row + 1); + if (!lua_istable(state, -1)) luaL_argerror(state, index, "render matrix row is not a table"); + for (int column = 0; column < 3; column++) + { + lua_rawgeti(state, -1, column + 1); + if (!lua_isnumber(state, -1)) luaL_argerror(state, index, "render matrix element is not a number!"); + *rows[row][column] = (float)lua_tonumber(state, -1); + lua_pop(state, 1); + } + lua_pop(state, 1); + } + return matrix; +} + +// init_from_bounds and init_from_aa_rect: a quad from its top left and bottom right, or its top left and size. +static void quad_bounds_read(lua_State* state, DestinationQuad& quad) +{ + quad._topLeft = lua_get(state, 1); + quad._bottomRight = lua_get(state, 2); + quad._topRight = vector_make(quad._bottomRight.x, quad._topLeft.y); + quad._bottomLeft = vector_make(quad._topLeft.x, quad._bottomRight.y); +} + +static void quad_rectangle_read(lua_State* state, DestinationQuad& quad) +{ + Vector pos = quad._topLeft = lua_get(state, 1); + float width = (float)luaL_checknumber(state, 2); + float height = (float)luaL_checknumber(state, 3); + quad._topRight = vector_make(pos.x + width, pos.y); + quad._bottomLeft = vector_make(pos.x, pos.y + height); + quad._bottomRight = vector_make(pos.x + width, pos.y + height); +} + +static void quad_corners_read(lua_State* state, DestinationQuad& quad, int first) +{ + quad._topLeft = lua_get(state, first); + quad._topRight = lua_get(state, first + 1); + quad._bottomLeft = lua_get(state, first + 2); + quad._bottomRight = lua_get(state, first + 3); +} + +static int source_quad_push(lua_State* state, SourceQuad quad, int uvIndex) +{ + quad._coordinateSpace = lua_toboolean(state, uvIndex) ? KAGE::Graphics::COORDINATES_NORMALIZED + : KAGE::Graphics::COORDINATES_PIXEL; + lua_push(state, quad); + return 1; +} + +// Converts a source quad between texels and fractions of an image. +static void source_space_set(SourceQuad& quad, const KAGE::Graphics::ImageBase& image, + KAGE::Graphics::CoordinateSpace space) +{ + if (quad._coordinateSpace == space) return; + + bool isToPixels = space == KAGE::Graphics::COORDINATES_PIXEL; + for (Vector* corner : {&quad._topLeft, &quad._topRight, &quad._bottomLeft, &quad._bottomRight}) + { + corner->x = isToPixels ? corner->x * (float)image.width : corner->x / (float)image.width; + corner->y = isToPixels ? corner->y * (float)image.height : corner->y / (float)image.height; + } + quad._coordinateSpace = space; +} + +// (LuaRender.cpp) DestinationQuad and SourceQuad: four corners, a source quad's in texels or fractions of its image, +// with their transforms. SourceQuad takes DestinationQuad's functions too. +static void quads_register(lua_State* state) +{ + lua_class_begin(state, "DestinationQuad", LUA_CLASS_DESTINATION_QUAD); + lua_cfunction_push(state, [](lua_State* state) { + DestinationQuad quad; + quad_corners_read(state, quad, 2); + lua_push(state, quad); + return 1; + }); + lua_table_set(state, -3, "__call"); + lua_cfunction_push(state, [](lua_State* state) { + DestinationQuad quad; + quad_bounds_read(state, quad); + lua_push(state, quad); + return 1; + }); + lua_table_set(state, -3, "NewFromBounds"); + lua_cfunction_push(state, [](lua_State* state) { + DestinationQuad quad; + quad_rectangle_read(state, quad); + lua_push(state, quad); + return 1; + }); + lua_table_set(state, -3, "NewFromRectangle"); + lua_method(state, "GetTopLeft", [](DestinationQuad& quad) { return quad._topLeft; }); + lua_method(state, "GetTopRight", [](DestinationQuad& quad) { return quad._topRight; }); + lua_method(state, "GetBottomLeft", [](DestinationQuad& quad) { return quad._bottomLeft; }); + lua_method(state, "GetBottomRight", [](DestinationQuad& quad) { return quad._bottomRight; }); + lua_method(state, "SetTopLeft", [](DestinationQuad& quad, Vector corner) { quad._topLeft = corner; }); + lua_method(state, "SetTopRight", [](DestinationQuad& quad, Vector corner) { quad._topRight = corner; }); + lua_method(state, "SetBottomLeft", [](DestinationQuad& quad, Vector corner) { quad._bottomLeft = corner; }); + lua_method(state, "SetBottomRight", [](DestinationQuad& quad, Vector corner) { quad._bottomRight = corner; }); + lua_method(state, "Translate", [](DestinationQuad& quad, Vector offset) { + quad_transform(quad, {}, {.tx = offset.x, .ty = offset.y}); + }); + lua_method(state, "Scale", [](DestinationQuad& quad, Vector scale, Vector anchor) { + quad_transform(quad, anchor, {.a = scale.x, .d = scale.y}); + }); + lua_method(state, "Rotate", [](DestinationQuad& quad, float degrees, Vector anchor) { + float sine = std::sin(degrees * DEGREES_TO_RADIANS); + float cosine = std::cos(degrees * DEGREES_TO_RADIANS); + quad_transform(quad, anchor, {.a = cosine, .b = -sine, .c = sine, .d = cosine}); + }); + lua_method(state, "Shear", [](DestinationQuad& quad, Vector shear, Vector anchor) { + quad_transform(quad, anchor, {.b = shear.x, .c = shear.y}); + }); + const luaL_Reg FUNCTIONS[] = { + {"Copy", + [](lua_State* state) { + lua_push(state, dest_quad_get(state, 1)); + return 1; + }}, + {"ApplyMatrix", + [](lua_State* state) { + DestinationQuad& quad = lua_get(state, 1); + if (!lua_istable(state, 2)) + luaL_argerror(state, 2, lua_pushfstring(state, "table expected, got %s", luaL_typename(state, 2))); + RenderMatrix matrix = matrix_read(state, 2); + quad_transform(quad, lua_get(state, 3), matrix); + return 0; + }}, + {"Flip", + [](lua_State* state) { + DestinationQuad& quad = lua_get(state, 1); + if (lua_isnoneornil(state, 2) || lua_toboolean(state, 2)) + { + std::swap(quad._topLeft, quad._topRight); + std::swap(quad._bottomLeft, quad._bottomRight); + } + if (lua_isnoneornil(state, 3) || lua_toboolean(state, 3)) + { + std::swap(quad._topLeft, quad._bottomLeft); + std::swap(quad._topRight, quad._bottomRight); + } + return 0; + }}, + {"__tostring", [](lua_State* state) { + DestinationQuad& quad = dest_quad_get(state, 1); + lua_pushfstring(state, "[DestQuad: TopLeft %f %f | TopRight %f %f | BottomLeft %f %f | BottomRight %f %f]", + quad._topLeft.x, quad._topLeft.y, quad._topRight.x, quad._topRight.y, quad._bottomLeft.x, + quad._bottomLeft.y, quad._bottomRight.x, quad._bottomRight.y); + return 1; + }}}; + lua_functions_add(state, FUNCTIONS); + lua_class_end(state); + + lua_class_begin(state, "SourceQuad", LUA_CLASS_SOURCE_QUAD, LUA_CLASS_DESTINATION_QUAD); + lua_cfunction_push(state, [](lua_State* state) { + SourceQuad quad; + quad_corners_read(state, quad, 2); + return source_quad_push(state, quad, 6); + }); + lua_table_set(state, -3, "__call"); + lua_cfunction_push(state, [](lua_State* state) { + SourceQuad quad; + quad_bounds_read(state, quad); + return source_quad_push(state, quad, 3); + }); + lua_table_set(state, -3, "NewFromBounds"); + lua_cfunction_push(state, [](lua_State* state) { + SourceQuad quad; + quad_rectangle_read(state, quad); + return source_quad_push(state, quad, 4); + }); + lua_table_set(state, -3, "NewFromRectangle"); + lua_method(state, "Copy", [](SourceQuad& quad) { return quad; }); + lua_method(state, "IsUVSpace", + [](SourceQuad& quad) { return quad._coordinateSpace == KAGE::Graphics::COORDINATES_NORMALIZED; }); + lua_method(state, "ConvertToPixelSpace", [](SourceQuad& quad, KAGE::Graphics::ImagePtr& image) { + source_space_set(quad, *image, KAGE::Graphics::COORDINATES_PIXEL); + }); + lua_method(state, "ConvertToUVSpace", [](SourceQuad& quad, KAGE::Graphics::ImagePtr& image) { + source_space_set(quad, *image, KAGE::Graphics::COORDINATES_NORMALIZED); + }); + const luaL_Reg SOURCE_FUNCTIONS[] = {{"__tostring", [](lua_State* state) { + SourceQuad& quad = lua_get(state, 1); + lua_pushfstring(state, + "[SourceQuad: TopLeft %f %f | TopRight %f %f | BottomLeft " + "%f %f | BottomRight %f %f | UV %s]", + quad._topLeft.x, quad._topLeft.y, quad._topRight.x, + quad._topRight.y, quad._bottomLeft.x, quad._bottomLeft.y, + quad._bottomRight.x, quad._bottomRight.y, + quad._coordinateSpace == + KAGE::Graphics::COORDINATES_NORMALIZED + ? "true" + : "false"); + return 1; + }}}; + lua_functions_add(state, SOURCE_FUNCTIONS); + lua_class_end(state); +} + +// A vertex attribute format's float count. +static int format_size_get(int format) +{ + switch (format) + { + case KAGE::Graphics::VERTEX_FLOAT: + case KAGE::Graphics::VERTEX_FLOAT_OTHER: return 1; + case KAGE::Graphics::VERTEX_VEC2: + case KAGE::Graphics::VERTEX_TEXCOORD: return 2; + case KAGE::Graphics::VERTEX_VEC3: + case KAGE::Graphics::VERTEX_POSITION: return 3; + case KAGE::Graphics::VERTEX_VEC4: + case KAGE::Graphics::VERTEX_COLOR: return 4; + default: return 0; + } +} + +// fill_shader_vertices: each float and vector attribute of a shader, the same at the quad's four corners, from the +// field of its name in the table at argument 6. The names of fields missing or of the wrong type, comma separated. +static std::string shader_vertices_fill(lua_State* state, float* vertices, const KAGE::Graphics::Shader& shader) +{ + std::string missing; + int vertexSize = shader.vertex_size_get() / (int)sizeof(float); + int offset = 0; + for (const KAGE::Graphics::VertexAttribute& attribute : shader.attributes) + { + int size = format_size_get(attribute.format); + bool isFilled = attribute.format >= KAGE::Graphics::VERTEX_FLOAT && attribute.format <= KAGE::Graphics::VERTEX_VEC4; + std::array values = {}; + lua_getfield(state, 6, attribute.name.c_str()); + bool isRead = size == 1 ? lua_isnumber(state, -1) : lua_istable(state, -1); + for (int i = 0; isFilled && isRead && i < size; i++) + { + if (size > 1) lua_rawgeti(state, -1, i + 1); + isRead = lua_isnumber(state, -1); + values[i] = (float)lua_tonumber(state, -1); + if (size > 1) lua_pop(state, 1); + } + lua_pop(state, 1); + + if (isFilled && !isRead) missing += (missing.empty() ? " " : ", ") + attribute.name; + for (int corner = 0; isFilled && isRead && corner < KAGE::Graphics::QUAD_CORNERS; corner++) + std::copy_n(values.data(), size, vertices + corner * vertexSize + offset); + offset += size; + } + return missing; +} + +// An image's quad drawn with a shader made current only for it. The vertices it reserved, null when culled. +static float* image_shader_render(KAGE::Graphics::ImageBase& image, KAGE::Graphics::Shader& shader, + const SourceQuad& source, const DestinationQuad& dest, KColor color) +{ + KAGE::Graphics::Shader* saved = KAGE::Graphics::manager.currentShader; + KAGE::Graphics::manager.currentShader = &shader; + float* vertices = image.Render(source, KAGE::Graphics::ColorQuad(dest, color), color); + KAGE::Graphics::manager.currentShader = saved; + return vertices; +} + +// RenderToSurface: draws into a render target, then back to the one before. +template +static void surface_render(KAGE::Graphics::ImageBase& surface, Draw draw) +{ + KAGE::Graphics::manager.render_target_push(&surface, KAGE::Graphics::TARGET_OWN_SIZE, + KAGE::Graphics::PRESENT_FLUSH); + draw(); + KAGE::Graphics::manager.render_target_pop(KAGE::Graphics::PRESENT_FLUSH); +} + +static KAGE::Graphics::ImagePtr& procedural_image_get(lua_State* state) +{ + KAGE::Graphics::ImagePtr& image = lua_get(state, 1); + if (!image->isRenderTarget) luaL_error(state, "Cannot use a non procedural image as the render target"); + return image; +} + +static void image_push(lua_State* state, KAGE::Graphics::ImagePtr image, const char* error, const char* name) +{ + if (!image) luaL_error(state, error, name); + lua_push(state, image); +} + +// (LuaRender.cpp) Image, a texture scripts hold: its size and name, its texels, and drawing it plainly, through the +// color offset shader, or through any shader with its vertex inputs from a table. +static void image_register(lua_State* state) +{ + using KAGE::Graphics::ImagePtr; + lua_class_begin(state, "Image", LUA_CLASS_IMAGE); + lua_gc_set(state); + lua_method(state, "GetWidth", [](ImagePtr& image) { return image->width; }); + lua_method(state, "GetHeight", [](ImagePtr& image) { return image->height; }); + lua_method(state, "GetPaddedWidth", [](ImagePtr& image) { return image->textureWidth; }); + lua_method(state, "GetPaddedHeight", [](ImagePtr& image) { return image->textureHeight; }); + lua_method(state, "GetName", + [](ImagePtr& image) -> const std::string& { return image->name.empty() ? image->path : image->name; }); + // The texels of a rectangle, four bytes each (RGBA), read back from the texture. + lua_method(state, "GetTexelRegion", [](ImagePtr& image, int x, int y, uint32_t width, uint32_t height) { + std::string texels((size_t)width * height * TEXEL_BYTES, '\0'); + KAGE::Graphics::manager.render_target_push(image.get(), KAGE::Graphics::TARGET_OWN_SIZE, + KAGE::Graphics::PRESENT_FLUSH); + gl.ReadPixels(x, y, (GLsizei)width, (GLsizei)height, GL_RGBA, GL_UNSIGNED_BYTE, texels.data()); + KAGE::Graphics::manager.render_target_pop(KAGE::Graphics::PRESENT_FLUSH); + return texels; + }); + const luaL_Reg FUNCTIONS[] = { + {"Render", + [](lua_State* state) { + ImagePtr& image = lua_get(state, 1); + SourceQuad& source = lua_get(state, 2); + DestinationQuad& dest = dest_quad_get(state, 3); + KColor color = lua_get(state, 4); + ColorMod colorMod = lua_isnoneornil(state, 5) ? COLOR_DEFAULT : lua_get(state, 5); + render_flags_shader_select(0); + apply_sprite_shader_params(colorMod, SPRITE_SHADER_COLOR_APPLY, *image); + image->Render(source, KAGE::Graphics::ColorQuad(dest, color), color); + KAGE::Graphics::manager.shader_default_set(); + return 0; + }}, + {"RenderWithShader", [](lua_State* state) { + ImagePtr& image = lua_get(state, 1); + SourceQuad& source = lua_get(state, 2); + DestinationQuad& dest = dest_quad_get(state, 3); + KColor color = lua_get(state, 4); + KAGE::Graphics::Shader& shader = lua_get(state, 5); + if (!lua_istable(state, 6)) + return luaL_argerror(state, 6, lua_pushfstring(state, "table expected, got %s", luaL_typename(state, 6))); + if (!shader.isLoaded) return luaL_argerror(state, 5, "invalid shader used"); + + float* vertices = image_shader_render(*image, shader, source, dest, color); + if (!vertices) return 0; + std::string missing = shader_vertices_fill(state, vertices, shader); + if (!missing.empty()) + return luaL_argerror(state, 6, ("some fields were not properly set :" + missing).c_str()); + return 0; + }}}; + lua_functions_add(state, FUNCTIONS); + lua_class_hidden_end(state); + + lua_class_begin(state, "Shader", LUA_CLASS_SHADER); + lua_class_hidden_end(state); +} + +// lua_Transformer_Render and RenderEx, which reads all four colors from argument 5 too: queues an image's draw, +// an error once the transformer was applied. +static int transformation_add(lua_State* state, const char* appliedError) +{ + LuaTransformer& transformer = lua_get(state, 1); + if (!transformer.isValid) return luaL_error(state, appliedError); + + Transformation transformation; + transformation.input = lua_get(state, 2); + transformation.source = lua_get(state, 3); + transformation.dest = dest_quad_get(state, 4); + transformation.colors.fill(lua_get(state, 5)); + transformer.transformations.push_back(transformation); + return 0; +} + +// (LuaRender.cpp) Transformer, draws queued onto a procedural image by Apply, and the controller a RenderToImage +// function draws with: clearing the image and the blend mode of what it draws. +static void transformer_register(lua_State* state) +{ + lua_class_begin(state, "Transformer", LUA_CLASS_TRANSFORMER); + lua_gc_set(state); + const luaL_Reg FUNCTIONS[] = { + {"Render", + [](lua_State* state) { + return transformation_add(state, "No operations allowed after a transformer has been applied"); + }}, + {"RenderEx", + [](lua_State* state) { + return transformation_add(state, "No operations allowed after a transformed has been applied"); + }}, + {"Apply", [](lua_State* state) { + LuaTransformer& transformer = lua_get(state, 1); + if (!transformer.isValid) return luaL_error(state, "No operations allowed after a transformer had been applied"); + surface_render(*transformer.output, [&] { + for (Transformation& each : transformer.transformations) + { + KAGE::Graphics::ColorQuad quad(each.dest, each.colors[0]); + quad.colors = each.colors; + each.input->Render({&each.source, 1}, {&quad, 1}); + } + }); + transformer.isValid = false; + return 0; + }}}; + lua_functions_add(state, FUNCTIONS); + lua_method(state, "IsValid", [](LuaTransformer& transformer) { return transformer.isValid; }); + lua_class_hidden_end(state); + + lua_class_begin(state, "SurfaceRenderController", LUA_CLASS_SURFACE_RENDER_CONTROLLER); + const luaL_Reg CONTROLLER_FUNCTIONS[] = { + {"Clear", + [](lua_State* state) { + if (!lua_get(state, 1).isValid) + luaL_argerror(state, 1, "This surface render controller has already been applied and cannot be used again"); + KAGE::Graphics::manager.Clear(); + KAGE::Graphics::manager.blendMode = KAGE::Graphics::BlendMode(); + return 0; + }}, + {"SetBlendMode", [](lua_State* state) { + if (!lua_get(state, 1).isValid) + luaL_argerror(state, 1, "This surface render controller has already been applied and cannot be used again"); + BlendParts& mode = lua_get(state, 2); + KAGE::Graphics::manager.blendMode = {(KAGE::Graphics::BlendEquation)mode[BLEND_EQUATION], + (KAGE::Graphics::BlendFactor)mode[BLEND_RGB_SOURCE], + (KAGE::Graphics::BlendFactor)mode[BLEND_RGB_DEST], + (KAGE::Graphics::BlendFactor)mode[BLEND_ALPHA_SOURCE], + (KAGE::Graphics::BlendFactor)mode[BLEND_ALPHA_DEST]}; + return 0; + }}}; + lua_functions_add(state, CONTROLLER_FUNCTIONS); + lua_class_hidden_end(state); +} + +// Lua_RenderToImage_ErrorHandler: the error with a traceback. +static int surface_error_handle(lua_State* state) +{ + luaL_traceback(state, state, lua_tostring(state, -1), 2); + return 1; +} + +// (LuaRender.cpp) The Renderer global: loading and creating images, drawing into procedural ones, the game's and +// mods' shaders, the sprite shaders' pixelation and clip plane, and the ShaderType, GLSLType and +// VertexAttributeFormat tables. +static void renderer_register(lua_State* state) +{ + lua_namespace_begin(state, "Renderer"); + const luaL_Reg FUNCTIONS[] = { + {"LoadImage", + [](lua_State* state) { + const char* path = luaL_checkstring(state, 1); + if (!std::filesystem::path(path).is_relative()) return luaL_error(state, "Image %s does not exist", path); + image_push(state, Manager::LoadImage(path), "Image %s does not exist", path); + return 1; + }}, + {"CreateImage", + [](lua_State* state) { + KAGE::Graphics::RenderTargetDesc desc = {.width = (int)(uint32_t)luaL_checkinteger(state, 1)}; + desc.height = (int)(uint32_t)luaL_checkinteger(state, 2); + desc.name = std::string(luaL_checkstring(state, 3)) + PROCEDURAL_SUFFIX; + image_push(state, KAGE::Graphics::manager.render_target_create(desc), "Unable to create Image", ""); + return 1; + }}, + // Runs a function drawing into a procedural image with a controller, restoring the blend mode after. Its + // error is raised again naming the image. + {"RenderToImage", + [](lua_State* state) { + KAGE::Graphics::ImagePtr image = procedural_image_get(state); + luaL_checktype(state, 2, LUA_TFUNCTION); + lua_push(state, SurfaceRenderController()); + int controllerIndex = lua_gettop(state); + SurfaceRenderController& controller = lua_get(state, controllerIndex); + std::string error; + surface_render(*image, [&] { + KAGE::Graphics::BlendMode saved = KAGE::Graphics::manager.blendMode; + lua_pushcfunction(state, surface_error_handle); + lua_pushvalue(state, 2); + lua_pushvalue(state, controllerIndex); + if (lua_pcall(state, 1, 0, -3) != LUA_OK) + { + error = "An error occurred while Rendering to Surface \"" + image->name + "\""; + if (lua_isstring(state, -1)) error += ": (" + std::string(lua_tostring(state, -1)) + ")"; + lua_pop(state, 1); + } + lua_pop(state, 1); + controller.isValid = false; + KAGE::Graphics::manager.blendMode = saved; + }); + lua_pop(state, 1); + if (!error.empty()) luaL_error(state, "%s", error.c_str()); + return 0; + }}, + {"StartTransformation", + [](lua_State* state) { + LuaTransformer transformer = {.output = procedural_image_get(state)}; + lua_push(state, transformer); + return 1; + }}, + // A mod's shader with the vertex attributes of a table of {name, format} pairs. + {"LoadShader", + [](lua_State* state) { + std::string path = luaL_checkstring(state, 1); + if (!lua_istable(state, 2)) + return luaL_argerror(state, 2, lua_pushfstring(state, "table expected, got %s", luaL_typename(state, 2))); + + std::vector attributes; + for (int i = 1; i <= (int)lua_rawlen(state, 2); i++) + { + lua_rawgeti(state, 2, i); + if (!lua_istable(state, -1)) return luaL_error(state, "Invalid vertex attribute %d (table expected)", i); + lua_rawgeti(state, -1, 1); + if (!lua_isstring(state, -1)) + return luaL_error(state, "Invalid name for vertex attribute %d (string expected)", i); + std::string name = lua_tostring(state, -1); + lua_rawgeti(state, -2, 2); + if (!lua_isinteger(state, -1)) + return luaL_error(state, "Invalid format for vertex attribute \"%s\" (integer expected)", name.c_str()); + int format = (int)lua_tointeger(state, -1); + if (format < SHADER_FORMAT_FIRST || format > SHADER_FORMAT_LAST) + return luaL_error(state, "Invalid format for vertex attribute \"%s\"", name.c_str()); + attributes.push_back({name, (KAGE::Graphics::VertexFormat)format}); + lua_pop(state, 3); + } + + std::string error; + KAGE::Graphics::Shader* shader = shader_mod_load(path, attributes, error); + if (!shader) luaL_error(state, "Unable to load shader \"%s\": %s", path.c_str(), error.c_str()); + lua_push(state, shader); + return 1; + }}, + {"GetShaderByType", [](lua_State* state) { + int type = (int)luaL_checkinteger(state, 1); + if (type < 0 || type >= SHADER_TYPE_COUNT) return luaL_argerror(state, 2, "invalid shader type"); + auto& shaders = KAGE::Graphics::manager.shaders; + auto found = shaders.find(KAGE::Graphics::path_key(SHADER_TYPE_NAMES[type])); + lua_push(state, found == shaders.end() ? nullptr : found->second.get()); + return 1; + }}}; + lua_functions_add(state, FUNCTIONS); + lua_method(state, "GetPixelationAmount", [] { return spriteShaderParams.pixelationAmount; }); + lua_method(state, "GetClipPaneNormal", + [] { return vector_make(spriteShaderParams.clipPlane[0], spriteShaderParams.clipPlane[1]); }); + lua_method(state, "GetClipPaneThreshold", [] { return spriteShaderParams.clipPlane[2]; }); + + lua_newtable(state); + constexpr const char* GLSL_TYPE_KEYS[] = {"Float", "Vec2", "Vec3", "Vec4"}; + for (int type = 0; type < (int)std::size(GLSL_TYPE_KEYS); type++) + { + lua_pushinteger(state, type); + lua_setfield(state, -2, GLSL_TYPE_KEYS[type]); + } + lua_table_set(state, -2, "GLSLType"); + lua_newtable(state); + constexpr const char* SHADER_TYPE_KEYS[] = { + "SHADER_COLOR_OFFSET", "SHADER_PIXELATION", "SHADER_BLOOM", "SHADER_COLOR_CORRECTION", + "SHADER_HQ4X", "SHADER_SHOCKWAVE", "SHADER_OLDTV", "SHADER_WATER", + "SHADER_HALLUCINATION", "SHADER_COLOR_MOD", "SHADER_COLOR_OFFSET_CHAMPION", "SHADER_WATER_V2", + "SHADER_BACKGROUND", "SHADER_WATER_OVERLAY", "SHADER_UNK", "SHADER_COLOR_OFFSET_DOGMA", + "SHADER_COLOR_OFFSET_GOLD", "SHADER_DIZZY", "SHADER_HEAT_WAVE", "SHADER_MIRROR"}; + for (int type = 0; type < SHADER_TYPE_COUNT; type++) + { + lua_pushinteger(state, type); + lua_setfield(state, -2, SHADER_TYPE_KEYS[type]); + } + lua_table_set(state, -2, "ShaderType"); + lua_newtable(state); + constexpr const char* FORMAT_KEYS[] = {"FLOAT", "VEC2", "VEC3", "VEC4", "POSITION", "COLOR", "TEX_COORD"}; + for (int format = SHADER_FORMAT_FIRST; format < SHADER_FORMAT_LAST; format++) + { + lua_pushinteger(state, format); + lua_setfield(state, -2, FORMAT_KEYS[format - SHADER_FORMAT_FIRST]); + } + lua_table_set(state, -2, "VertexAttributeFormat"); + lua_class_end(state); +} + +// IsValidLayerID: a layer the sprite has. +static bool is_beam_layer(const ANM2& sprite, lua_Integer layerId) +{ + return layerId >= 0 && layerId + 1 <= (lua_Integer)sprite.layerStates.size(); +} + +// A Beam layer argument: a layer name or id the sprite has, else an error. +static int beam_layer_read(lua_State* state, ANM2& sprite, int index) +{ + if (lua_type(state, index) == LUA_TSTRING) + { + const char* name = luaL_checkstring(state, index); + LayerState* layer = sprite.GetLayer(std::string_view(name)); + if (!layer || !layer->layerData) luaL_error(state, "Invalid layer name %s", name); + return layer->layerData->id; + } + lua_Integer layerId = luaL_checkinteger(state, index); + if (!is_beam_layer(sprite, layerId)) luaL_error(state, "Invalid layer ID %d", (int)layerId); + return (int)layerId; +} + +// A Beam's layer repeats down its spritesheet and clamps across it. +static void beam_layer_wrap(LuaBeam& beam) +{ + LayerState* layer = beam.sprite.GetLayer(beam.layerId); + layer->wrapSMode = WRAP_REPEAT; + layer->wrapTMode = WRAP_CLAMP; +} + +// Lua_BeamRender's errors. +static const char* beam_error_get(const LuaBeam& beam) +{ + if (beam.points.size() < 2) return "Must have at least two points"; + if (beam.isOverlay && !beam.sprite.overlayAnimState.animData) return "Overlay AnimState is NULL!"; + if (!beam.isOverlay && !beam.sprite.animState.animData) return "AnimState is NULL!"; + if (!is_beam_layer(beam.sprite, beam.layerId)) return "Invalid layer id"; + return nullptr; +} + +// Lua_CreatePointDummy and Lua_BeamAdd's point: a position, then its coordinate, width (1), color and whether it is in +// world space (false). +static LuaBeamPoint beam_point_read(lua_State* state, int first, lua_Number coordinate) +{ + LuaBeamPoint point = {.pos = lua_get(state, first), .coordinate = (float)coordinate}; + point.width = (float)luaL_optnumber(state, first + 2, 1); + if (lua_type(state, first + 3) == LUA_TUSERDATA) point.color = lua_get(state, first + 3); + point.isWorldSpace = lua_gettop(state) < first + 4 ? false : lua_toboolean(state, first + 4); + return point; +} + +// (LuaBeamRenderer.cpp) Beam, a sprite's layer drawn along points, and Point, one of them. Rendering draws the +// positions as they are, though a point says it is in world space. +static void beam_register(lua_State* state) +{ + lua_class_begin(state, "Beam", LUA_CLASS_BEAM); + lua_gc_set(state); + lua_cfunction_push(state, lua_constructor_call<[](lua_State* state) { + int top = lua_gettop(state); + if (top < 4) luaL_error(state, "Expected at least 4 arguments, got %d", top); + ANM2& sprite = lua_get(state, 1); + LuaBeam beam = {.layerId = beam_layer_read(state, sprite, 2)}; + beam.isOverlay = lua_get(state, 3).value; + beam.isHeightCoordinate = lua_get(state, 4).value; + beam.sprite = sprite; + beam_layer_wrap(beam); + lua_push(state, beam); + return 1; + }>); + lua_table_set(state, -3, "__call"); + const luaL_Reg FUNCTIONS[] = { + {"Add", + [](lua_State* state) { + LuaBeam& beam = lua_get(state, 1); + if (lua_gettop(state) == 2) beam.points.push_back(lua_get(state, 2)); + else beam.points.push_back(beam_point_read(state, 2, luaL_optnumber(state, 3, 0))); + return 0; + }}, + // Draws the points, clearing them unless asked not to, even when it raises an error. + {"Render", + [](lua_State* state) { + LuaBeam& beam = lua_get(state, 1); + bool isCleared = lua_gettop(state) < 2 ? true : lua_toboolean(state, 2); + const char* error = beam_error_get(beam); + if (!error) + { + g_beamRenderer.Begin(beam.sprite, beam.layerId, beam.isOverlay ? BEAM_FRAME_OVERLAY : BEAM_FRAME_MAIN, + beam.isHeightCoordinate ? BEAM_COORDINATE_HEIGHTS : BEAM_COORDINATE_PIXELS); + for (const LuaBeamPoint& point : beam.points) + g_beamRenderer.Add({.color = point.color, .pos = point.pos, .coordinate = point.coordinate, + .width = point.width}); + g_beamRenderer.End(); + } + if (isCleared) beam.points.clear(); + if (error) return luaL_error(state, error); + return 0; + }}, + {"SetSprite", + [](lua_State* state) { + LuaBeam& beam = lua_get(state, 1); + ANM2& sprite = lua_get(state, 2); + if (lua_gettop(state) > 2) + { + int layerId = lua_type(state, 3) == LUA_TSTRING || lua_isinteger(state, 3) + ? beam_layer_read(state, sprite, 3) + : beam.layerId; + beam.isOverlay = lua_get(state, 4).value; + beam.layerId = layerId; + } + beam.sprite = sprite; + return 0; + }}, + {"SetLayer", + [](lua_State* state) { + LuaBeam& beam = lua_get(state, 1); + beam.layerId = beam_layer_read(state, beam.sprite, 2); + beam_layer_wrap(beam); + return 0; + }}, + {"GetPoints", + [](lua_State* state) { + LuaBeam& beam = lua_get(state, 1); + lua_createtable(state, (int)beam.points.size(), 0); + for (size_t i = 0; i < beam.points.size(); i++) + { + lua_push(state, beam.points[i]); + lua_rawseti(state, -2, (lua_Integer)i + 1); + } + return 1; + }}, + {"SetPoints", [](lua_State* state) { + LuaBeam& beam = lua_get(state, 1); + if (!lua_istable(state, 2)) return luaL_argerror(state, 2, "Expected a table as second argument"); + size_t length = lua_rawlen(state, 2); + if (length < 2) return luaL_argerror(state, 2, "Must have at least two points"); + + std::deque points; + for (size_t i = 1; i <= length; i++) + { + lua_rawgeti(state, 2, (lua_Integer)i); + points.push_back(lua_get(state, -1)); + lua_pop(state, 1); + } + beam.points = points; + return 0; + }}}; + lua_functions_add(state, FUNCTIONS); + lua_method(state, "GetSprite", [](LuaBeam& beam) { return &beam.sprite; }); + lua_method(state, "GetLayer", [](LuaBeam& beam) { return beam.layerId; }); + lua_method(state, "GetUseOverlay", [](LuaBeam& beam) { return beam.isOverlay; }); + lua_method(state, "SetUseOverlay", [](LuaBeam& beam, LuaCheckedBool isOverlay) { beam.isOverlay = isOverlay.value; }); + lua_method(state, "GetUnkBool", [](LuaBeam& beam) { return beam.isHeightCoordinate; }); + lua_method(state, "SetUnkBool", + [](LuaBeam& beam, LuaCheckedBool isHeight) { beam.isHeightCoordinate = isHeight.value; }); + lua_class_end(state); + + lua_class_begin(state, "Point", LUA_CLASS_BEAM_POINT); + lua_cfunction_push(state, lua_constructor_call<[](lua_State* state) { + lua_get(state, 1); + lua_push(state, beam_point_read(state, 1, luaL_checknumber(state, 2))); + return 1; + }>); + lua_table_set(state, -3, "__call"); + const luaL_Reg POINT_FUNCTIONS[] = { + {"SetSpritesheetCoordinate", + [](lua_State* state) { + lua_get(state, 1).coordinate = (float)lua_tonumber(state, 2); + return 0; + }}, + {"SetHeight", + [](lua_State* state) { + lua_get(state, 1).coordinate = (float)lua_tonumber(state, 2); + return 0; + }}, + {"SetWidth", [](lua_State* state) { + lua_get(state, 1).width = (float)lua_tonumber(state, 2); + return 0; + }}}; + lua_functions_add(state, POINT_FUNCTIONS); + lua_method(state, "GetSpritesheetCoordinate", [](LuaBeamPoint& point) { return point.coordinate; }); + lua_method(state, "GetHeight", [](LuaBeamPoint& point) { return point.coordinate; }); + lua_method(state, "GetWidth", [](LuaBeamPoint& point) { return point.width; }); + lua_method(state, "GetPosition", [](LuaBeamPoint& point) { return point.pos; }); + lua_method(state, "SetPosition", [](LuaBeamPoint& point, Vector pos) { point.pos = pos; }); + lua_method(state, "GetColor", [](LuaBeamPoint& point) { return point.color; }); + lua_method(state, "SetColor", [](LuaBeamPoint& point, ColorMod color) { point.color = color; }); + lua_method(state, "GetIsWorldSpace", [](LuaBeamPoint& point) { return point.isWorldSpace; }); + lua_method(state, "SetIsWorldSpace", + [](LuaBeamPoint& point, LuaCheckedBool isWorldSpace) { point.isWorldSpace = isWorldSpace.value; }); + lua_class_end(state); +} + +// A ColorModifier arithmetic result, channel by channel. +template +static ColorModState color_modifier_apply(const ColorModState& left, const ColorModState& right, Operation operation) +{ + return {operation(left._red, right._red), operation(left._green, right._green), + operation(left._blue, right._blue), operation(left._amount, right._amount), + operation(left._brightness, right._brightness), operation(left._contrast, right._contrast)}; +} + +// ColorModifier times or over a number on its right, an error for a number on its left or a zero the zero error +// names. Anything else on its right gives itself back. +template +static int color_modifier_scale(lua_State* state, const char* leftError, const char* zeroError, Operation operation) +{ + if (lua_type(state, 1) == LUA_TNUMBER) return luaL_error(state, leftError); + if (lua_type(state, 2) != LUA_TNUMBER) return 1; + + float amount = (float)luaL_checknumber(state, 2); + if (zeroError && amount == 0) return luaL_error(state, zeroError); + ColorModState& color = lua_get(state, 1); + lua_push(state, color_modifier_apply(color, color, [&](float channel, float) { return operation(channel, amount); })); + return 1; +} + +// (LuaColorModifier.cpp, LuaColorParams.cpp) ColorModifier, the game's color correction, with its arithmetic, and +// ColorParams, a timed color laid over an entity. +static void color_classes_register(lua_State* state) +{ + lua_class_begin(state, "ColorModifier", LUA_CLASS_COLOR_MODIFIER); + lua_cfunction_push(state, lua_constructor_call<[](lua_State* state) { + lua_push(state, ColorModState{(float)luaL_optnumber(state, 1, 1), (float)luaL_optnumber(state, 2, 1), + (float)luaL_optnumber(state, 3, 1), (float)luaL_optnumber(state, 4, 0), + (float)luaL_optnumber(state, 5, 0), (float)luaL_optnumber(state, 6, 1)}); + return 1; + }>); + lua_table_set(state, -3, "__call"); + lua_field<&ColorModState::_red>(state, "R"); + lua_field<&ColorModState::_green>(state, "G"); + lua_field<&ColorModState::_blue>(state, "B"); + lua_field<&ColorModState::_amount>(state, "A"); + lua_field<&ColorModState::_brightness>(state, "Brightness"); + lua_field<&ColorModState::_contrast>(state, "Contrast"); + lua_method(state, "__eq", [](ColorModState& color, ColorModState& other) { + return color._red == other._red && color._green == other._green && color._blue == other._blue && + color._amount == other._amount && color._brightness == other._brightness && + color._contrast == other._contrast; + }); + lua_method(state, "__add", [](ColorModState& color, ColorModState& other) { + return color_modifier_apply(color, other, [](float a, float b) { return a + b; }); + }); + lua_method(state, "__sub", [](ColorModState& color, ColorModState& other) { + return color_modifier_apply(color, other, [](float a, float b) { return a - b; }); + }); + const luaL_Reg FUNCTIONS[] = { + {"__mul", + [](lua_State* state) { + return color_modifier_scale(state, "Cannot left multiply a ColorModifier with a number", nullptr, + [](float a, float b) { return a * b; }); + }}, + {"__div", [](lua_State* state) { + return color_modifier_scale(state, "Cannot left divide a ColorModifier with a number", "Divide by zero", + [](float a, float b) { return a / b; }); + }}}; + lua_functions_add(state, FUNCTIONS); + lua_class_end(state); + + lua_class_begin(state, "ColorParams", LUA_CLASS_COLOR_PARAMS); + lua_cfunction_push(state, lua_constructor_call<[](lua_State* state) { + ColorParams params = {.color = lua_get(state, 1), .priority = (int)luaL_checkinteger(state, 2)}; + params.duration = params.remaining = (int)luaL_checkinteger(state, 3); + params.isFadeout = lua_get(state, 4).value; + params.isShared = lua_get(state, 5).value; + lua_push(state, params); + return 1; + }>); + lua_table_set(state, -3, "__call"); + lua_method(state, "GetColor", [](ColorParams& params) { return params.color; }); + lua_method(state, "SetColor", [](ColorParams& params, ColorMod color) { params.color = color; }); + lua_method(state, "GetPriority", [](ColorParams& params) { return params.priority; }); + lua_method(state, "SetPriority", [](ColorParams& params, int priority) { params.priority = priority; }); + lua_method(state, "GetDuration", [](ColorParams& params) { return params.duration; }); + lua_method(state, "SetDuration", [](ColorParams& params, int duration) { params.duration = duration; }); + lua_method(state, "GetLifespan", [](ColorParams& params) { return params.remaining; }); + lua_method(state, "SetLifespan", [](ColorParams& params, int remaining) { params.remaining = remaining; }); + lua_method(state, "GetFadeout", [](ColorParams& params) { return params.isFadeout; }); + lua_method(state, "SetFadeout", [](ColorParams& params, LuaCheckedBool isFadeout) { params.isFadeout = isFadeout.value; }); + lua_method(state, "GetShared", [](ColorParams& params) { return params.isShared; }); + lua_method(state, "SetShared", [](ColorParams& params, LuaCheckedBool isShared) { params.isShared = isShared.value; }); + lua_class_end(state); +} + +// (LuaDebugRenderer.cpp) The DebugRenderer global: Get, the debug shape of an index (a new one for -1). +static void debug_renderer_register(lua_State* state) +{ + lua_namespace_begin(state, "DebugRenderer"); + const luaL_Reg FUNCTIONS[] = {{"Get", [](lua_State* state) { + int index = (int)luaL_optinteger(state, 1, -1); + bool isReset = lua_gettop(state) < 2 ? false : lua_toboolean(state, 2); + lua_object_push(state, g_game ? &g_game->debugRenderer.Get(index, isReset) : nullptr, + LUA_CLASS_SHAPE); + return 1; + }}}; + lua_functions_add(state, FUNCTIONS); + lua_class_end(state); +} + +void render_classes_register(lua_State* state) +{ + quads_register(state); + image_register(state); + transformer_register(state); + renderer_register(state); + beam_register(state); + color_classes_register(state); + debug_renderer_register(state); +} + +// (LuaIsaac.cpp) REPENTOGON's drawing functions of Isaac: a HUD position in the world, lines and quad outlines, +// world positions on screen, the cursor and buttons sprites, and a collectible's collection page icon. +void isaac_render_register(lua_State* state) +{ + lua_method(state, "RenderToWorld", [](Vector position) { + Vector offset = vector_add(g_game->screenShakeOffset, g_game->room->renderScrollOffset); + Vector viewportTopLeft = vector_scale( + vector_make(g_screenWidth - WORLD_VIEWPORT_WIDTH, g_screenHeight - WORLD_VIEWPORT_HEIGHT), HALF); + Vector local = vector_sub(vector_sub(position, offset), viewportTopLeft); + return vector_make(local.x / WORLD_TO_SCREEN_SCALE + WORLD_RENDER_ORIGIN_X, + local.y / WORLD_TO_SCREEN_SCALE + WORLD_RENDER_ORIGIN_Y); + }); + lua_method(state, "DrawLine", [](Vector from, Vector to, KColor fromColor, KColor toColor, + LuaDefault thickness) { + render_color_quad(from, to, fromColor, toColor, thickness.value); + }); + lua_method(state, "DrawQuad", [](Vector topLeft, Vector topRight, Vector bottomLeft, Vector bottomRight, + KColor color, LuaDefault thickness) { + DestinationQuad quad = {topLeft, topRight, bottomLeft, bottomRight}; + quad_outline_render(KAGE::Graphics::ColorQuad(quad, color), thickness.value); + }); + lua_method(state, "GetCursorSprite", [] { return &g_manager->cursorSprite; }); + lua_method(state, "GetButtonsSprite", [] { return &g_manager->buttonsSprite; }); + lua_method(state, "GetRenderPosition", [](Vector position, LuaOptionalBool isSnapped) { + return render_position_get(position, isSnapped.value ? RENDER_SNAPPED : RENDER_UNSNAPPED); + }); + // Draws an icon as the collection page does, in normal blending, at a scale (1) and in a color. + const luaL_Reg FUNCTIONS[] = {{"RenderCollectionItem", [](lua_State* state) { + int itemId = (int)luaL_checkinteger(state, 1); + if (!g_manager->itemConfig.GetCollectible(itemId)) + return luaL_argerror(state, 1, "Invalid collectible ID"); + + ModSpriteDraw draw = {.position = lua_get(state, 2)}; + if (lua_type(state, 3) == LUA_TUSERDATA) draw.scale = lua_get(state, 3); + if (lua_type(state, 4) == LUA_TUSERDATA) draw.color = lua_get(state, 4); + KAGE::Graphics::BlendMode mode; + mode.SetMode(KAGE::Graphics::BLEND_NORMAL); + draw.blendMode = {mode.equation, mode.rgbSource, mode.rgbDest, mode.alphaSource, + mode.alphaDest}; + g_game->gameOver.render_collectible_icon(itemId, draw); + return 0; + }}}; + lua_functions_add(state, FUNCTIONS); +} diff --git a/src/repentogon/lua_render.h b/src/repentogon/lua_render.h new file mode 100644 index 0000000..8b41574 --- /dev/null +++ b/src/repentogon/lua_render.h @@ -0,0 +1,36 @@ +#pragma once + +#include "engine/anm2.h" +#include "engine/kage_graphics.h" +#include "repentogon/api.h" + +// A blend mode as LayerState keeps it, which REPENTOGON's BlendMode also holds by value. +using BlendParts = std::array; + +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_ANIMATION_DATA; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_ANIMATION_FRAME; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_ANIMATION_LAYER; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_BLEND_MODE; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_COLOR_MODIFIER; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_DESTINATION_QUAD; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_IMAGE; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_SHADER; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_LAYER_STATE; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_NULL_FRAME; +template <> inline constexpr LuaClass LUA_CLASS_OF = LUA_CLASS_SOURCE_QUAD; + +// lua_pushcfunction as a function, so a lambda's commas reach it whole. +inline void lua_cfunction_push(lua_State* state, lua_CFunction function) +{ + lua_pushcfunction(state, function); +} + +void sprite_repentogon_register(lua_State* state); +void sprite_classes_register(lua_State* state); +void color_repentogon_register(lua_State* state); +void color_constructor_set(lua_State* state); +void font_repentogon_register(lua_State* state); +void render_classes_register(lua_State* state); +void isaac_render_register(lua_State* state); +KAGE::Graphics::Shader* shader_mod_load(std::string_view path, + std::span attributes, std::string& error); diff --git a/src/repentogon/lua_sprite.cpp b/src/repentogon/lua_sprite.cpp new file mode 100644 index 0000000..093fc36 --- /dev/null +++ b/src/repentogon/lua_sprite.cpp @@ -0,0 +1,644 @@ +#include "engine/filesys.h" +#include "repentogon/lua_render.h" +#include "repentogon/options.h" +#include "repentogon/render.h" +#include +#include +#include +#include + +constexpr const char* RGON_RESOURCES_FOLDER = "repentogon/resources/"; +constexpr int COLOR_CHANNELS = 4; +constexpr int OFFSET_CHANNELS = 3; +constexpr int BLEND_FACTOR_COUNT = BLEND_FACTOR_ONE_MINUS_DST_ALPHA + 1; +constexpr int BLEND_EQUATION_COUNT = BLEND_EQUATION_MAX + 1; +constexpr const char* CHANNEL_KEYS[] = {"R", "G", "B", "A"}; +// Where the Color constructor's tint, offset and colorize start among its arguments, after the class table. +constexpr int COLOR_TINT_ARGUMENT = 2; +constexpr int COLOR_OFFSET_ARGUMENT = 6; +constexpr int COLOR_COLORIZE_ARGUMENT = 9; + +// LuaBlendMode.cpp's modes: replace, normal and additive (premultiplied), multiplicative and overlay. +constexpr BlendParts BLEND_PRESETS[] = { + {BLEND_EQUATION_ADD, BLEND_FACTOR_ONE, BLEND_FACTOR_ZERO, BLEND_FACTOR_ONE, BLEND_FACTOR_ZERO}, + {BLEND_EQUATION_ADD, BLEND_FACTOR_ONE, BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, BLEND_FACTOR_ONE, + BLEND_FACTOR_ONE_MINUS_SRC_ALPHA}, + {BLEND_EQUATION_ADD, BLEND_FACTOR_ONE, BLEND_FACTOR_ONE, BLEND_FACTOR_ONE, BLEND_FACTOR_ONE}, + {BLEND_EQUATION_ADD, BLEND_FACTOR_ZERO, BLEND_FACTOR_SRC_COLOR, BLEND_FACTOR_ZERO, BLEND_FACTOR_SRC_COLOR}, + {BLEND_EQUATION_ADD, BLEND_FACTOR_DST_COLOR, BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, BLEND_FACTOR_DST_COLOR, + BLEND_FACTOR_ONE_MINUS_SRC_ALPHA}}; +constexpr int BLEND_PRESET_COUNT = (int)std::size(BLEND_PRESETS); + +// The vertex inputs a custom shader takes: the game's color offset shader's. +constexpr KAGE::Graphics::VertexAttribute CUSTOM_SHADER_ATTRIBUTES[] = { + {"Position", KAGE::Graphics::VERTEX_POSITION}, + {"Color", KAGE::Graphics::VERTEX_COLOR}, + {"TexCoord", KAGE::Graphics::VERTEX_TEXCOORD}}; + +// A blend factor or equation argument, an argument error outside its range. +template +struct BlendArg +{ + int value = 0; + + static void check(lua_State* state, int index, int value) + { + if (value < 0 || value >= Count) + luaL_argerror(state, index, Count == BLEND_FACTOR_COUNT ? "Invalid blend factor" : "Invalid equation"); + } + + static BlendArg lua_read(lua_State* state, int index) + { + int value = (int)luaL_checkinteger(state, index); + check(state, index, value); + return {value}; + } +}; + +using BlendFactorArg = BlendArg; +using BlendEquationArg = BlendArg; + +template +static int blend_part_get(BlendParts& mode) +{ + return mode[Part]; +} + +template +static void blend_part_set(BlendParts& mode, Arg value) +{ + mode[Part] = value.value; +} + +// ANM2Utils' path key: lowercase with single forward slashes. +static std::string shader_path_normalize(std::string_view path) +{ + std::string normalized = std::regex_replace(std::string(path), std::regex(R"([\/\\]+)"), "/"); + std::ranges::transform(normalized, normalized.begin(), [](unsigned char c) { return (char)std::tolower(c); }); + return normalized; +} + +// Anm2Extras' SetCustomShader: loads a mod's shader for a sprite or layer. An error names the path when it fails. +static void custom_shader_set(lua_State* state, std::shared_ptr& shaders, CustomShaderSlot slot) +{ + std::string path = luaL_checkstring(state, 2); + std::string error; + KAGE::Graphics::Shader* shader = shader_mod_load(path, CUSTOM_SHADER_ATTRIBUTES, error); + if (!shader) luaL_error(state, "Failed to load shader: %s", path.c_str()); + + if (!shaders) shaders = std::make_shared(); + shaders->paths[slot] = shader_path_normalize(path); + shaders->shaders[slot] = shader; +} + +static void custom_shader_clear(std::shared_ptr& shaders, CustomShaderSlot slot) +{ + if (!shaders) return; + shaders->paths[slot].clear(); + shaders->shaders[slot] = nullptr; +} + +// Anm2Extras' HasCustomShader: any custom shader in the slot, or the one of the path argument 2 gives. +static bool is_custom_shader(lua_State* state, const std::shared_ptr& shaders, CustomShaderSlot slot) +{ + std::string path = luaL_optstring(state, 2, ""); + if (!shaders || !shaders->shaders[slot]) return false; + return path.empty() || shaders->paths[slot] == shader_path_normalize(path); +} + +// Anm2Extras' GetCustomShaderForLayer: makes the layer's custom shader current, else the sprite's. +void custom_shader_select(const ANM2& sprite, const LayerState& layer, CustomShaderSlot slot) +{ + for (const std::shared_ptr& shaders : {layer.customShaders, sprite.customShaders}) + if (shaders && shaders->shaders[slot] && shaders->shaders[slot]->isLoaded) + { + KAGE::Graphics::manager.currentShader = shaders->shaders[slot]; + return; + } +} + +// LayerState::SetSpriteSheet: the image with its filter and wrap modes. +static void layer_sheet_set(LayerState& layer, const KAGE::Graphics::ImagePtr& image) +{ + layer.spriteSheet = image; + if (image) + { + layer.minFilterMode = image->minFilter; + layer.magFilterMode = image->magFilter; + layer.wrapSMode = image->wrapS; + layer.wrapTMode = image->wrapT; + } + layer.isSpriteSheetLoaded = image != nullptr; +} + +// Pushes a layer's spritesheet as an Image, nil for none. +static int layer_sheet_push(lua_State* state, LayerState* layer) +{ + if (layer && layer->spriteSheet) lua_push(state, layer->spriteSheet); + else lua_pushnil(state); + return 1; +} + +// A layer of a sprite by id, null outside its layers. +static LayerState* layer_find(ANM2& sprite, lua_Integer layerId) +{ + return layerId >= 0 && layerId < (lua_Integer)sprite.layerStates.size() ? &sprite.layerStates[layerId] : nullptr; +} + +// AnimationData::GetLayerOrder and GetLayerById: a layer id's track, -1 for none. +static int layer_track_find(const AnimationData& data, int layerId) +{ + if (layerId < 0 || layerId >= ANM2_LAYER_LIMIT) return -1; + int track = data.layerMap[layerId]; + return track >= 0 && track < (int)data.animLayers.size() ? track : -1; +} + +// LuaGetLayerFrameDataInternal: the keyframe a layer's track of an animation shows now, nil for none. +static int layer_frame_push(lua_State* state, const AnimationState& animation) +{ + int layerId = (int)luaL_checkinteger(state, 2); + int track = animation.animData ? layer_track_find(*animation.animData, layerId) : -1; + if (track < 0 || track >= (int)animation.layerFrames.size()) + { + lua_pushnil(state); + return 1; + } + + const std::vector& frames = animation.animData->animLayers[track].frames; + if (frames.empty()) lua_pushnil(state); + else lua_push(state, &frames[std::clamp(animation.layerFrames[track], 0, (int)frames.size() - 1)]); + return 1; +} + +// AnimationState::Play: plays a stopped animation on from where it is, from the start when it never began. +static void animation_continue(AnimationState& animation) +{ + if (!animation.animData) return; + if (animation.animFrame < 0) animation.Rewind(); + animation.isPlaying = true; +} + +// Pushes a list of objects as a table from 1. +template +static int objects_push(lua_State* state, std::span objects) +{ + lua_createtable(state, (int)objects.size(), 0); + for (size_t i = 0; i < objects.size(); i++) + { + lua_push(state, &objects[i]); + lua_rawseti(state, -2, (lua_Integer)i + 1); + } + return 1; +} + +// Pushes a color's channels as a table keyed R, G, B and A. +static int channels_push(lua_State* state, const float* channels, int count) +{ + lua_newtable(state); + for (int i = 0; i < count; i++) + { + lua_pushnumber(state, channels[i]); + lua_setfield(state, -2, CHANNEL_KEYS[i]); + } + return 1; +} + +// (LuaSprite.cpp, LuaAnimationData.cpp, LuaNullFrame.cpp) REPENTOGON's additions to Sprite: copies, its layers and +// their spritesheets, overlay events and frames, stopping and continuing each animation, render flags, custom shaders +// and the animations, keyframes and nulls the file holds. +void sprite_repentogon_register(lua_State* state) +{ + lua_method(state, "Copy", [](ANM2& sprite) { return ANM2(sprite); }); + lua_method(state, "ReplaceSpritesheet", [](ANM2& sprite, int layerId, std::string_view path, + LuaOptionalBool isLoadGraphics) { + bool isReplaced = sprite.ReplaceSpritesheet(layerId, path); + if (isReplaced && isLoadGraphics.value) sprite.LoadGraphics(); + return isReplaced; + }); + lua_method(state, "SetSpritesheet", [](ANM2& sprite, lua_Integer layerId, KAGE::Graphics::ImagePtr& image) { + LayerState* layer = layer_find(sprite, (uint32_t)layerId); + if (layer) layer_sheet_set(*layer, image); + return layer != nullptr; + }); + lua_method(state, "IsOverlayEventTriggered", [](ANM2& sprite, std::string_view name) { + return sprite.overlayAnimState.IsEventTriggered(name); + }); + lua_method(state, "WasOverlayEventTriggered", [](ANM2& sprite, std::string_view name) { + return sprite.overlayAnimState.WasEventTriggered(name); + }); + lua_method(state, "SetOverlayLayerFrame", [](ANM2& sprite, int layerId, int frame) { + if (sprite.overlayAnimState.animData) sprite.overlayAnimState.SetLayerFrame(layerId, frame); + }); + lua_method(state, "StopOverlay", [](ANM2& sprite) { sprite.StopOverlay(); }); + lua_method(state, "Continue", [](ANM2& sprite, LuaOptionalBool isOverlay) { + animation_continue(sprite.animState); + if (isOverlay.value) animation_continue(sprite.overlayAnimState); + }); + lua_method(state, "ContinueOverlay", [](ANM2& sprite) { animation_continue(sprite.overlayAnimState); }); + lua_method(state, "GetRenderFlags", [](ANM2& sprite) { return sprite.bitflags; }); + lua_method(state, "SetRenderFlags", [](ANM2& sprite, lua_Integer flags) { sprite.bitflags = (unsigned int)flags; }); + lua_method(state, "LoadRGON", [](ANM2& sprite, std::string_view path, LuaCheckedBool isLoadGraphics) { + sprite.Load(asset_path(RGON_RESOURCES_FOLDER + std::string(path)), + isLoadGraphics.value ? GRAPHICS_LOAD : GRAPHICS_DEFER); + }); + lua_method(state, "GetCurrentAnimationData", [](ANM2& sprite) { return sprite.animState.animData; }); + lua_method(state, "GetOverlayAnimationData", [](ANM2& sprite) { return sprite.overlayAnimState.animData; }); + lua_method(state, "GetAnimationData", + [](ANM2& sprite, std::string_view name) { return sprite.GetAnimationData(name); }); + lua_method(state, "GetNullFrame", [](ANM2& sprite, std::string_view name) { return sprite.GetNullFrame(name); }); + lua_method(state, "GetOverlayNullFrame", [](ANM2& sprite, std::string_view name) { + return sprite.overlayAnimState.animData ? sprite.overlayAnimState.GetNullFrame(name) : nullptr; + }); + + const luaL_Reg FUNCTIONS[] = { + {"GetAllLayers", + [](lua_State* state) { return objects_push(state, std::span(lua_get(state, 1).layerStates)); }}, + {"GetAllAnimationData", + [](lua_State* state) { + ANM2& sprite = lua_get(state, 1); + return objects_push(state, sprite.file ? std::span(sprite.file->animations) : std::span()); + }}, + {"GetLayer", + [](lua_State* state) { + ANM2& sprite = lua_get(state, 1); + if (lua_type(state, 2) == LUA_TSTRING) + lua_push(state, sprite.GetLayer(std::string_view(luaL_checkstring(state, 2)))); + else lua_push(state, layer_find(sprite, luaL_checkinteger(state, 2))); + return 1; + }}, + {"GetSpritesheet", + [](lua_State* state) { + ANM2& sprite = lua_get(state, 1); + return layer_sheet_push(state, layer_find(sprite, (uint32_t)luaL_checkinteger(state, 2))); + }}, + {"SetOverlayFrame", + [](lua_State* state) { + ANM2& sprite = lua_get(state, 1); + if (lua_type(state, 2) == LUA_TSTRING) + sprite.SetOverlayFrame(std::string_view(luaL_checkstring(state, 2)), (int)luaL_checkinteger(state, 3)); + else sprite.SetOverlayFrame((int)luaL_checkinteger(state, 2)); + return 0; + }}, + {"GetLayerFrameData", + [](lua_State* state) { return layer_frame_push(state, lua_get(state, 1).animState); }}, + {"GetOverlayLayerFrameData", + [](lua_State* state) { return layer_frame_push(state, lua_get(state, 1).overlayAnimState); }}, + // Stops the overlay too unless asked not to. With vanilla parity it is left playing by default, as the + // game's Stop does. + {"Stop", + [](lua_State* state) { + ANM2& sprite = lua_get(state, 1); + bool isOverlay = lua_gettop(state) < 2 ? !repentogonOptions.isVanillaParity : lua_toboolean(state, 2); + sprite.Stop(); + if (isOverlay) sprite.StopOverlay(); + return 0; + }}, + {"SetCustomShader", + [](lua_State* state) { + custom_shader_set(state, lua_get(state, 1).customShaders, CUSTOM_SHADER_NORMAL); + return 0; + }}, + {"ClearCustomShader", + [](lua_State* state) { + custom_shader_clear(lua_get(state, 1).customShaders, CUSTOM_SHADER_NORMAL); + return 0; + }}, + {"HasCustomShader", + [](lua_State* state) { + lua_pushboolean(state, is_custom_shader(state, lua_get(state, 1).customShaders, CUSTOM_SHADER_NORMAL)); + return 1; + }}, + {"SetCustomChampionShader", + [](lua_State* state) { + custom_shader_set(state, lua_get(state, 1).customShaders, CUSTOM_SHADER_CHAMPION); + return 0; + }}, + {"ClearCustomChampionShader", + [](lua_State* state) { + custom_shader_clear(lua_get(state, 1).customShaders, CUSTOM_SHADER_CHAMPION); + return 0; + }}, + {"HasCustomChampionShader", + [](lua_State* state) { + ANM2& sprite = lua_get(state, 1); + lua_pushboolean(state, is_custom_shader(state, sprite.customShaders, CUSTOM_SHADER_CHAMPION)); + return 1; + }}, + // The frames an animation fires an event on, empty when either is missing. + {"GetEventTriggerFrames", + [](lua_State* state) { + ANM2& sprite = lua_get(state, 1); + std::string_view animationName = lua_get(state, 2); + std::string_view eventName = lua_get(state, 3); + lua_newtable(state); + const AnimationData* data = sprite.GetAnimationData(animationName); + auto event = sprite.file ? std::ranges::find(sprite.file->eventNames, eventName) + : std::vector::const_iterator{}; + if (!data || event == sprite.file->eventNames.end()) return 1; + + uint32_t eventId = (uint32_t)(event - sprite.file->eventNames.begin()); + int count = 0; + for (const AnimationData_EventTrigger& trigger : data->eventTriggers) + if (trigger.eventId == eventId) + { + lua_pushinteger(state, trigger.animationFrame); + lua_rawseti(state, -2, ++count); + } + return 1; + }}}; + lua_functions_add(state, FUNCTIONS); +} + +// (LuaSprite.cpp) LayerState, one layer of a sprite: its spritesheet, transform, color, flags, blending, wrapping, +// flips and custom shaders. +static void layer_state_register(lua_State* state) +{ + lua_class_begin(state, "LayerState", LUA_CLASS_LAYER_STATE); + lua_method(state, "GetLayerID", [](LayerState& layer) { return layer.layerData ? layer.layerData->id : -1; }); + lua_method(state, "GetName", [](LayerState& layer) { + return layer.layerData ? std::string_view(layer.layerData->name) : std::string_view(); + }); + lua_method(state, "SetSpritesheet", + [](LayerState& layer, KAGE::Graphics::ImagePtr& image) { layer_sheet_set(layer, image); }); + lua_method(state, "GetSpritesheetPath", [](LayerState& layer) -> const std::string& { return layer.spriteSheetPath; }); + lua_method(state, "GetDefaultSpritesheetPath", [](LayerState& layer) { + return layer.layerData ? std::string_view(layer.layerData->spriteSheetPath) : std::string_view(); + }); + lua_method(state, "IsVisible", [](LayerState& layer) { return layer.isVisible; }); + lua_method(state, "SetVisible", [](LayerState& layer, LuaCheckedBool isVisible) { layer.isVisible = isVisible.value; }); + lua_method(state, "GetSize", [](LayerState& layer) { return layer.size; }); + lua_method(state, "SetSize", [](LayerState& layer, Vector size) { layer.size = size; }); + lua_method(state, "GetRotation", [](LayerState& layer) { return layer.rotation; }); + lua_method(state, "SetRotation", [](LayerState& layer, float rotation) { layer.rotation = rotation; }); + lua_method(state, "GetPos", [](LayerState& layer) { return layer.pos; }); + lua_method(state, "SetPos", [](LayerState& layer, Vector pos) { layer.pos = pos; }); + lua_method(state, "GetColor", [](LayerState& layer) { return layer.color; }); + lua_method(state, "SetColor", [](LayerState& layer, ColorMod color) { layer.color = color; }); + lua_method(state, "GetCropOffset", [](LayerState& layer) { return layer.cropOffset; }); + lua_method(state, "SetCropOffset", [](LayerState& layer, Vector offset) { layer.cropOffset = offset; }); + lua_method(state, "GetRenderFlags", [](LayerState& layer) { return layer.bitflags; }); + lua_method(state, "SetRenderFlags", + [](LayerState& layer, lua_Integer flags) { layer.bitflags = (unsigned int)flags; }); + lua_method(state, "GetBlendMode", [](LayerState& layer) { return &layer.blendMode; }); + lua_method(state, "GetWrapSMode", [](LayerState& layer) { return (int)layer.wrapSMode; }); + lua_method(state, "SetWrapSMode", [](LayerState& layer, int mode) { layer.wrapSMode = mode; }); + lua_method(state, "GetWrapTMode", [](LayerState& layer) { return (int)layer.wrapTMode; }); + lua_method(state, "SetWrapTMode", [](LayerState& layer, int mode) { layer.wrapTMode = mode; }); + lua_method(state, "GetFlipX", [](LayerState& layer) { return layer.isFlipX; }); + lua_method(state, "SetFlipX", [](LayerState& layer, LuaCheckedBool isFlip) { layer.isFlipX = isFlip.value; }); + lua_method(state, "GetFlipY", [](LayerState& layer) { return layer.isFlipY; }); + lua_method(state, "SetFlipY", [](LayerState& layer, LuaCheckedBool isFlip) { layer.isFlipY = isFlip.value; }); + const luaL_Reg FUNCTIONS[] = { + {"SetCustomShader", + [](lua_State* state) { + custom_shader_set(state, lua_get(state, 1).customShaders, CUSTOM_SHADER_NORMAL); + return 0; + }}, + {"ClearCustomShader", + [](lua_State* state) { + custom_shader_clear(lua_get(state, 1).customShaders, CUSTOM_SHADER_NORMAL); + return 0; + }}, + {"HasCustomShader", + [](lua_State* state) { + LayerState& layer = lua_get(state, 1); + lua_pushboolean(state, is_custom_shader(state, layer.customShaders, CUSTOM_SHADER_NORMAL)); + return 1; + }}, + {"SetCustomChampionShader", + [](lua_State* state) { + custom_shader_set(state, lua_get(state, 1).customShaders, CUSTOM_SHADER_CHAMPION); + return 0; + }}, + {"ClearCustomChampionShader", + [](lua_State* state) { + custom_shader_clear(lua_get(state, 1).customShaders, CUSTOM_SHADER_CHAMPION); + return 0; + }}, + {"HasCustomChampionShader", + [](lua_State* state) { + LayerState& layer = lua_get(state, 1); + lua_pushboolean(state, is_custom_shader(state, layer.customShaders, CUSTOM_SHADER_CHAMPION)); + return 1; + }}, + {"GetSpritesheet", [](lua_State* state) { return layer_sheet_push(state, &lua_get(state, 1)); }}}; + lua_functions_add(state, FUNCTIONS); + lua_class_hidden_end(state); +} + +// (LuaAnimationData.cpp, LuaAnimationLayer.cpp, LuaAnimationFrame.cpp, LuaNullFrame.cpp) An animation of a sprite's +// file, one layer's track in it, a keyframe of the track, and a null's keyframe. +static void animation_classes_register(lua_State* state) +{ + lua_class_begin(state, "AnimationData", LUA_CLASS_ANIMATION_DATA); + const luaL_Reg DATA_FUNCTIONS[] = { + {"GetAllLayers", + [](lua_State* state) { return objects_push(state, std::span(lua_get(state, 1).animLayers)); }}}; + lua_functions_add(state, DATA_FUNCTIONS); + lua_method(state, "GetLayer", [](AnimationData& data, int layerId) { + int track = layer_track_find(data, layerId); + return track < 0 ? nullptr : &data.animLayers[track]; + }); + lua_method(state, "GetName", [](AnimationData& data) -> const std::string& { return data.name; }); + lua_method(state, "GetLength", [](AnimationData& data) { return data.length; }); + lua_method(state, "IsLoopingAnimation", [](AnimationData& data) { return data.isLooping; }); + lua_class_hidden_end(state); + + lua_class_begin(state, "AnimationLayer", LUA_CLASS_ANIMATION_LAYER); + // The keyframe showing on a frame of the animation, the last one past its end, nil for a track without any. + const luaL_Reg FUNCTIONS[] = { + {"GetFrame", [](lua_State* state) { + AnimationLayer& layer = lua_get(state, 1); + if (layer.frames.empty()) + { + lua_pushnil(state); + return 1; + } + int frame = std::max((int)luaL_checkinteger(state, 2), 0); + auto found = std::ranges::find_if(layer.frames, [frame](const AnimationFrame& each) { + return frame >= each.startFrame && frame < each.endFrame; + }); + lua_push(state, found == layer.frames.end() ? &layer.frames.back() : &*found); + return 1; + }}}; + lua_functions_add(state, FUNCTIONS); + lua_method(state, "GetLayerID", [](AnimationLayer& layer) { return layer.layerId; }); + lua_method(state, "IsVisible", [](AnimationLayer& layer) { return layer.isVisible; }); + lua_class_hidden_end(state); + + lua_class_begin(state, "AnimationFrame", LUA_CLASS_ANIMATION_FRAME); + lua_method(state, "GetCrop", [](AnimationFrame& frame) { return frame.crop; }); + lua_method(state, "GetWidth", [](AnimationFrame& frame) { return frame.width; }); + lua_method(state, "GetHeight", [](AnimationFrame& frame) { return frame.height; }); + lua_method(state, "GetPos", [](AnimationFrame& frame) { return frame.pos; }); + lua_method(state, "GetScale", [](AnimationFrame& frame) { return frame.scale; }); + lua_method(state, "GetPivot", [](AnimationFrame& frame) { return frame.pivot; }); + lua_method(state, "IsVisible", [](AnimationFrame& frame) { return frame.isVisible; }); + lua_method(state, "GetRotation", [](AnimationFrame& frame) { return frame.rotation; }); + lua_method(state, "IsInterpolated", [](AnimationFrame& frame) { return frame.isInterpolated; }); + lua_method(state, "GetColor", [](AnimationFrame& frame) { return frame.color; }); + lua_method(state, "GetStartFrame", [](AnimationFrame& frame) { return frame.startFrame; }); + lua_method(state, "GetEndFrame", [](AnimationFrame& frame) { return frame.endFrame; }); + lua_class_hidden_end(state); + + lua_class_begin(state, "NullFrame", LUA_CLASS_NULL_FRAME); + lua_method(state, "GetPos", [](NullFrame& frame) { return frame.pos; }); + lua_method(state, "GetRotation", [](NullFrame& frame) { return frame.rotation; }); + lua_method(state, "IsVisible", [](NullFrame& frame) { return frame.isVisible; }); + lua_method(state, "GetScale", [](NullFrame& frame) { return frame.scale; }); + lua_method(state, "GetColor", [](NullFrame& frame) { return frame.color; }); + lua_class_hidden_end(state); +} + +// (LuaBlendMode.cpp) BlendMode, a layer's blending or one a script makes: its factors and equation, the deprecated +// Flag1 to Flag4 naming the factors, and SetMode, from a preset or from factors. Its global holds New and NewFromType. +static void blend_mode_register(lua_State* state) +{ + lua_class_begin(state, "BlendMode", LUA_CLASS_BLEND_MODE); + lua_property(state, "RGBSourceFactor", blend_part_get, + blend_part_set); + lua_property(state, "RGBDestinationFactor", blend_part_get, + blend_part_set); + lua_property(state, "AlphaSourceFactor", blend_part_get, + blend_part_set); + lua_property(state, "AlphaDestinationFactor", blend_part_get, + blend_part_set); + lua_property(state, "Equation", blend_part_get, blend_part_set); + lua_property(state, "Flag1", blend_part_get, blend_part_set); + lua_property(state, "Flag2", blend_part_get, blend_part_set); + lua_property(state, "Flag3", blend_part_get, + blend_part_set); + lua_property(state, "Flag4", blend_part_get, blend_part_set); + + // The factors and equation from arguments 2 to 6, each left as it is when missing, or else a preset by number, + // an unknown one ignored. + const luaL_Reg FUNCTIONS[] = { + {"SetMode", + [](lua_State* state) { + BlendParts& mode = lua_get(state, 1); + if (lua_gettop(state) <= 2) + { + int preset = (int)luaL_checknumber(state, 2); + if (preset >= 0 && preset < BLEND_PRESET_COUNT) mode = BLEND_PRESETS[preset]; + return 0; + } + constexpr int PARTS[] = {BLEND_RGB_SOURCE, BLEND_RGB_DEST, BLEND_ALPHA_SOURCE, BLEND_ALPHA_DEST, + BLEND_EQUATION}; + BlendParts result = mode; + for (int i = 0; i < BLEND_PART_COUNT; i++) + { + int index = i + 2; + result[PARTS[i]] = (int)luaL_optnumber(state, index, mode[PARTS[i]]); + if (PARTS[i] == BLEND_EQUATION) BlendEquationArg::check(state, index, result[PARTS[i]]); + else BlendFactorArg::check(state, index, result[PARTS[i]]); + } + mode = result; + return 0; + }}}; + lua_functions_add(state, FUNCTIONS); + + // New's factors and equation default to replacing. + lua_cfunction_push(state, [](lua_State* state) { + constexpr int PARTS[] = {BLEND_RGB_SOURCE, BLEND_RGB_DEST, BLEND_ALPHA_SOURCE, BLEND_ALPHA_DEST, BLEND_EQUATION}; + BlendParts mode = BLEND_PRESETS[0]; + for (int i = 0; i < BLEND_PART_COUNT; i++) + { + mode[PARTS[i]] = (int)luaL_optnumber(state, i + 1, mode[PARTS[i]]); + if (PARTS[i] == BLEND_EQUATION) BlendEquationArg::check(state, i + 1, mode[PARTS[i]]); + else BlendFactorArg::check(state, i + 1, mode[PARTS[i]]); + } + lua_push(state, mode); + return 1; + }); + lua_table_set(state, -3, "New"); + lua_cfunction_push(state, [](lua_State* state) { + int type = (int)luaL_checknumber(state, 1); + if (type < 0 || type >= BLEND_PRESET_COUNT) + return luaL_error(state, "bad argument #%d to '%s': Invalid blend type %d", 1, "NewFromType", type); + lua_push(state, BLEND_PRESETS[type]); + return 1; + }); + lua_table_set(state, -3, "NewFromType"); + lua_class_end(state); +} + +void sprite_classes_register(lua_State* state) +{ + layer_state_register(state); + animation_classes_register(state); + blend_mode_register(state); +} + +// (LuaColor.cpp) REPENTOGON's additions to Color: its tint, colorize and offset as tables, and printing it. +void color_repentogon_register(lua_State* state) +{ + const luaL_Reg FUNCTIONS[] = { + {"GetTint", [](lua_State* state) { return channels_push(state, lua_get(state, 1)._tint, COLOR_CHANNELS); }}, + {"GetColorize", + [](lua_State* state) { return channels_push(state, lua_get(state, 1)._colorize, COLOR_CHANNELS); }}, + {"GetOffset", + [](lua_State* state) { return channels_push(state, lua_get(state, 1)._offset, OFFSET_CHANNELS); }}, + {"Print", [](lua_State* state) { + ColorMod& color = lua_get(state, 1); + std::ostringstream text; + text << "Color: " << color._tint[0] << " " << color._tint[1] << " " << color._tint[2] << " " + << color._tint[3] << std::endl + << "Colorize: " << color._colorize[0] << " " << color._colorize[1] << " " << color._colorize[2] + << " " << color._colorize[3] << std::endl + << "Offset: " << color._offset[0] << " " << color._offset[1] << " " << color._offset[2]; + lua_getglobal(state, "print"); + lua_pushstring(state, text.str().c_str()); + lua_pcall(state, 1, 0, 0); + return 0; + }}}; + lua_functions_add(state, FUNCTIONS); + lua_cfunction_push(state, [](lua_State* state) { + ColorMod& color = lua_get(state, 1); + std::ostringstream text; + text << "[Color: Tint " << color._tint[0] << " " << color._tint[1] << " " << color._tint[2] << " " + << color._tint[3] << " | Colorize " << color._colorize[0] << " " << color._colorize[1] << " " + << color._colorize[2] << " " << color._colorize[3] << " | Offset " << color._offset[0] << " " + << color._offset[1] << " " << color._offset[2] << "]"; + lua_pushstring(state, text.str().c_str()); + return 1; + }); + lua_table_set(state, -2, "__tostring"); +} + +// (LuaColor.cpp's LuaEngine::Init hook) Replaces the Color constructor main.lua wraps with REPENTOGON's: every +// argument optional (tint 1, offset and colorize 0), and the colorize after the offset. +void color_constructor_set(lua_State* state) +{ + lua_getglobal(state, "Color"); + lua_getmetatable(state, -1); + lua_cfunction_push(state, [](lua_State* state) { + ColorMod color; + for (int i = 0; i < COLOR_CHANNELS; i++) + { + color._colorize[i] = (float)luaL_optnumber(state, COLOR_COLORIZE_ARGUMENT + i, 0); + color._tint[i] = (float)luaL_optnumber(state, COLOR_TINT_ARGUMENT + i, 1); + } + for (int i = 0; i < OFFSET_CHANNELS; i++) + color._offset[i] = (float)luaL_optnumber(state, COLOR_OFFSET_ARGUMENT + i, 0); + lua_push(state, color); + return 1; + }); + lua_table_set(state, -2, "__call"); + lua_pop(state, 2); +} + +// (MiscFixes.cpp's Font::DrawString hook) Without vanilla parity a nil string draws nothing, where the game's +// DrawString raises an error. +void font_repentogon_register(lua_State* state) +{ + lua_pushstring(state, "DrawString"); + lua_rawget(state, -2); + lua_pushcclosure(state, [](lua_State* state) { + if (!repentogonOptions.isVanillaParity && lua_isnil(state, 2)) return 0; + lua_pushvalue(state, lua_upvalueindex(1)); + lua_insert(state, 1); + lua_call(state, lua_gettop(state) - 1, LUA_MULTRET); + return lua_gettop(state); + }, 1); + lua_table_set(state, -2, "DrawString"); +} diff --git a/src/repentogon/menus.cpp b/src/repentogon/menus.cpp new file mode 100644 index 0000000..bff8c5c --- /dev/null +++ b/src/repentogon/menus.cpp @@ -0,0 +1,573 @@ +#include "repentogon/menus.h" +#include "entity/config.h" +#include "game/game.h" +#include "game/manager.h" +#include "repentogon/api.h" +#include "repentogon/lua_render.h" +#include "ui/menu/manager.h" +#include +#include +#include +#include + +// What WorldToMenuPosition adds to the view position: the title menu's origin on the menu sheet. +constexpr float WORLD_TO_MENU_X = 39; +constexpr float WORLD_TO_MENU_Y = 15; +constexpr int WORLD_TO_MENU_ARGUMENTS = 2; +constexpr float COLOR_MOD_DEFAULT_RATE = 0.015f; +constexpr int CHARACTER_FLAT_ENTRY_COUNT = CHARACTER_ENTRY_COUNT * CHARACTER_MENU_COUNT; +constexpr uint32_t CUTSCENE_GAME_LAST = CUTSCENE_ENTRY_COUNT - 1; +constexpr uint32_t INPUT_MASK_ALL = ~0u; +constexpr int SAVE_SLOT_FIRST = 1; +// The bosses a bestiary page shows, which REPENTOGON's page count divides by. +constexpr int BESTIARY_BOSSES_PER_PAGE = 4; + +// REPENTOGON's MainMenuInputBlock: the input mask SetInputMask keeps, which never takes effect since nothing enables +// it, and the menu GetActiveMenu reports after SetActiveMenu was given one out of range. +static uint32_t inputMask = INPUT_MASK_ALL; +static int activeMenuLie = 0; +// The sheets SaveMenu.SetSlotSpritesheet gave each save file's drawing. +static std::array slotSpritesheets; + +// The main menu, which the menu namespaces' guard has checked for. +static MenuManager& menu_manager_get() +{ + return *g_menuManager; +} + +// Runs the binding in the first upvalue on the arguments in the main menu, else raises REPENTOGON's error naming the +// menu class in the second. +static int menu_binding_call(lua_State* state) +{ + if (!g_menuManager) + return luaL_error(state, "%s functions can only be used in the main menu", + lua_tostring(state, lua_upvalueindex(2))); + + lua_pushvalue(state, lua_upvalueindex(1)); + lua_insert(state, 1); + lua_call(state, lua_gettop(state) - 1, LUA_MULTRET); + return lua_gettop(state); +} + +// Has every function of the namespace begun last run through menu_binding_call, as each of REPENTOGON's menu functions +// checks for the main menu first. +static void menu_guard_apply(lua_State* state) +{ + std::vector names; + for (lua_pushnil(state); lua_next(state, -2); lua_pop(state, 1)) + { + std::string name = lua_type(state, -2) == LUA_TSTRING ? lua_tostring(state, -2) : ""; + if (lua_isfunction(state, -1) && !name.starts_with("__")) names.push_back(name); + } + + lua_getfield(state, -1, "__name"); + std::string className = lua_tostring(state, -1); + lua_pop(state, 1); + for (const std::string& name : names) + { + lua_pushstring(state, name.c_str()); + lua_rawget(state, -2); + lua_pushstring(state, className.c_str()); + lua_pushcclosure(state, menu_binding_call, 2); + lua_table_set(state, -2, name.c_str()); + } +} + +// Ends a menu namespace whose functions only work in the main menu. +static void menu_namespace_end(lua_State* state) +{ + menu_guard_apply(state); + lua_namespace_plain_end(state); +} + +// The options menu REPENTOGON's OptionsMenu works on: the main menu's, else the pause screen's. +static Menu_Options& options_menu_get() +{ + return g_menuManager ? g_menuManager->menuOptions : g_game->pauseScreen.menuOptions; +} + +// (Patches/XMLPlayerExtras's GetCharacterMenuIndexFromID) A character's place on the wheel, 0 for the random one, +// counting the game characters the wheel shows before it. -1 when the wheel leaves it out. +static int character_wheel_index_get(Menu_Character& menu, int menuId) +{ + if (menuId == 0) return 0; + + int index = 0; + for (int i = 1; i < CHARACTER_ENTRY_COUNT; i++) + { + const Menu_Character_Entry& entry = character_entry_get(CHARACTER_MENU_NORMAL, i); + bool isShown = !entry.isHidden || entry.IsCharacterAvailable(); + index += isShown; + if (i == menuId) return isShown ? index : -1; + } + int modIndex = menuId - CHARACTER_ENTRY_COUNT; + return modIndex < (int)menu.modCharacters.size() ? index + modIndex + 1 : -1; +} + +// (Menu_Character::GetPlayerTypeFromMenuID in REPENTOGON's libzhl) The player type of a wheel slot of a menu, -1 for +// the random one and past the wheel. +static int character_player_type_get(Menu_Character& menu, int menuId, CharacterMenu characterMenu) +{ + if (menuId <= 0 || menuId >= CHARACTER_ENTRY_COUNT + (int)menu.modCharacters.size()) return -1; + return menu.GetPlayerTypeFromMenuID(menuId, characterMenu); +} + +// A player type's wheel slot, of either menu, -1 for none. +static int character_menu_id_get(Menu_Character& menu, int playerType) +{ + if (playerType >= PLAYER_TYPE_COUNT) + { + auto found = std::ranges::find_if(menu.modCharacters, [&](const ModCharacter& character) { + return character.playerType == playerType || character.taintedPlayerType == playerType; + }); + if (found == menu.modCharacters.end()) return -1; + return CHARACTER_ENTRY_COUNT + (int)(found - menu.modCharacters.begin()); + } + if (playerType < 0) return -1; + + for (int i = 1; i < CHARACTER_FLAT_ENTRY_COUNT; i++) + { + const Menu_Character_Entry& entry = character_entry_get((CharacterMenu)(i / CHARACTER_ENTRY_COUNT), + i % CHARACTER_ENTRY_COUNT); + if (i != CHARACTER_ENTRY_COUNT && entry.playerType == playerType) return i % CHARACTER_ENTRY_COUNT; + } + return -1; +} + +// Pushes a player type, nil when negative. +static int player_type_push(lua_State* state, int playerType) +{ + if (playerType < 0) lua_pushnil(state); + else lua_pushinteger(state, playerType); + return 1; +} + +// CharacterMenu.SetSelectedCharacterID: sets the selection alone, or with the wheel turned to it (at once when +// rotation is skipped) and its page shown, for a character on the wheel. +static void character_select(int menuId, bool isWheelUpdated, bool isRotationSkipped) +{ + Menu_Character& menu = menu_manager_get().menuCharacter; + if (menuId < 0 || menuId >= CHARACTER_ENTRY_COUNT + (int)menu.modCharacters.size()) return; + if (!isWheelUpdated) + { + menu.selectedCharacterID = menuId; + return; + } + + int index = character_wheel_index_get(menu, menuId); + if (index < 0) return; + + menu.selectedCharacterID = menuId; + menu.numCharactersMinusSelectedEntry = index == 0 ? 0 : menu.numCharacters - index; + if (isRotationSkipped) + menu.horizontalScrollPosition = + (float)menu.numCharactersMinusSelectedEntry * FULL_TURN_DEGREES / (float)menu.numCharacters; + if (menuId < CHARACTER_ENTRY_COUNT) + menu.bigCharPageSprite.Play(character_entry_get(menu.characterMenuShown, menuId).animationName); +} + +// (LuaCharacterMenu.cpp) Registers REPENTOGON's CharacterMenu namespace. +static void character_menu_register(lua_State* state) +{ + lua_namespace_begin(state, "CharacterMenu"); + lua_method(state, "GetBigCharPageSprite", [] { return &menu_manager_get().menuCharacter.bigCharPageSprite; }); + lua_method(state, "GetDifficultyOverlaySprite", + [] { return &menu_manager_get().menuCharacter.difficultyOverlaySprite; }); + lua_method(state, "GetGreedDecoSprite", [] { return &menu_manager_get().menuCharacter.greedDecoOverlaySprite; }); + lua_method(state, "GetBGSprite", [] { return &menu_manager_get().menuCharacter.characterMenuBGSprite; }); + lua_method(state, "GetDifficultyPageSprite", [] { return &menu_manager_get().menuCharacter.difficultyPageSprite; }); + lua_method(state, "GetSeedPageSprite", [] { return &menu_manager_get().menuCharacter.seedPageSprite; }); + lua_method(state, "GetWinStreakPageSprite", [] { return &menu_manager_get().menuCharacter.winStreakPageSprite; }); + lua_method(state, "GetEasterEggPageSprite", [] { return &menu_manager_get().menuCharacter.eastereggPageSprite; }); + lua_method(state, "GetEastereggPageSprite", [] { return &menu_manager_get().menuCharacter.eastereggPageSprite; }); + lua_method(state, "GetSeedUnlockPageSprite", [] { return &menu_manager_get().menuCharacter.seedUnlockPageSprite; }); + lua_method(state, "GetCharacterPortraitSprite", + [] { return &menu_manager_get().menuCharacter.characterPortraitsSprite; }); + lua_method(state, "GetSeedEntrySprite", [] { return &menu_manager_get().menuCharacter.seedEntrySprite; }); + lua_method(state, "GetPageSwapWidgetSprite", [] { return &menu_manager_get().menuCharacter.pageSwapWidgetSprite; }); + lua_method(state, "GetTaintedBGDecoSprite", + [] { return &menu_manager_get().menuCharacter.taintedMenuBGDecoSprite; }); + lua_method(state, "GetCompletionMarksSprite", + [] { return &menu_manager_get().menuCharacter.completionWidget.anm2; }); + lua_method(state, "GetNumCharacters", [] { return menu_manager_get().menuCharacter.numCharacters; }); + lua_method(state, "GetSelectedCharacterMenu", [] { return menu_manager_get().menuCharacter.characterMenuShown; }); + lua_method(state, "SetSelectedCharacterMenu", [](int page, LuaOptionalBool isGraphicsUpdated) { + Menu_Character& menu = menu_manager_get().menuCharacter; + if (page != CHARACTER_MENU_NORMAL && page != CHARACTER_MENU_TAINTED) return; + if (isGraphicsUpdated.value) menu.set_character_menu_shown((CharacterMenu)page); + else menu.characterMenuShown = (CharacterMenu)page; + }); + lua_method(state, "SwapCharacterMenu", [](LuaOptionalBool isForced) { + Menu_Character& menu = menu_manager_get().menuCharacter; + if (menu.pageSwapWidgetSprite.color._tint[3] != 0 || isForced.value) menu.DoPageSwap(); + }); + lua_method(state, "GetIsCharacterUnlocked", [] { return menu_manager_get().menuCharacter.isCharacterUnlocked; }); + lua_method(state, "SetIsCharacterUnlocked", + [](LuaCheckedBool isUnlocked) { + menu_manager_get().menuCharacter.isCharacterUnlocked = isUnlocked.value; + }); + lua_method(state, "GetDifficulty", [] { return menu_manager_get().menuCharacter.difficulty; }); + lua_method(state, "SetDifficulty", + [](int difficulty) { menu_manager_get().menuCharacter.difficulty = (Difficulty)difficulty; }); + lua_method(state, "GetSelectedCharacterID", [] { return menu_manager_get().menuCharacter.selectedCharacterID; }); + lua_method(state, "SetSelectedCharacterID", + [](int menuId, LuaOptionalBool isWheelUpdated, LuaOptionalBool isRotationSkipped) { + character_select(menuId, isWheelUpdated.value, isRotationSkipped.value); + }); + lua_functions_add(state, {{"GetSelectedCharacterPlayerType", + [](lua_State* s) { + Menu_Character& menu = menu_manager_get().menuCharacter; + return player_type_push(s, character_player_type_get(menu, menu.selectedCharacterID, + menu.characterMenuShown)); + }}, + {"GetPlayerTypeFromCharacterMenuID", + [](lua_State* s) { + Menu_Character& menu = menu_manager_get().menuCharacter; + int menuId = (int)luaL_checkinteger(s, 1); + bool isTainted = lua_gettop(s) < 2 + ? menu.characterMenuShown == CHARACTER_MENU_TAINTED + : (bool)lua_toboolean(s, 2); + return player_type_push( + s, character_player_type_get(menu, menuId, (CharacterMenu)isTainted)); + }}, + {"GetCharacterMenuIDFromPlayerType", [](lua_State* s) { + int menuId = character_menu_id_get(menu_manager_get().menuCharacter, + (int)luaL_checkinteger(s, 1)); + if (menuId > 0) lua_pushinteger(s, menuId); + else lua_pushnil(s); + return 1; + }}}); + lua_method(state, "GetCharacterWheelDepth", [] { return menu_manager_get().menuCharacter.characterWheelDepth; }); + lua_method(state, "SetCharacterWheelDepth", + [](float depth) { menu_manager_get().menuCharacter.characterWheelDepth = depth; }); + lua_method(state, "GetScrollSpeed", [] { return menu_manager_get().menuCharacter.scrollSpeed; }); + lua_method(state, "SetScrollSpeed", [](float speed) { menu_manager_get().menuCharacter.scrollSpeed = speed; }); + lua_method(state, "GetCharacterWheelWidth", [] { return menu_manager_get().menuCharacter.characterWheelWidth; }); + lua_method(state, "SetCharacterWheelWidth", + [](float width) { menu_manager_get().menuCharacter.characterWheelWidth = width; }); + lua_method(state, "GetActiveStatus", [] { return menu_manager_get().menuCharacter.status; }); + lua_method(state, "SetActiveStatus", + [](int status) { menu_manager_get().menuCharacter.status = (CharacterStatus)status; }); + menu_namespace_end(state); +} + +// (LuaBestiaryMenu.cpp, LuaCollectionMenu.cpp, LuaStatsMenu.cpp) Registers REPENTOGON's namespaces of the bestiary, +// the collection and the stats and secrets pages. +static void record_menus_register(lua_State* state) +{ + lua_namespace_begin(state, "BestiaryMenu"); + lua_method(state, "GetBestiaryMenuSprite", [] { return &menu_manager_get().menuBestiary.bestiaryMenuSprite; }); + lua_method(state, "GetDeathScreenSprite", [] { return &menu_manager_get().menuBestiary.deathScreenSprite; }); + lua_method(state, "GetEnemySprite", [] { return &menu_manager_get().menuBestiary.enemySprite; }); + lua_method(state, "GetSelectedPage", [] { return menu_manager_get().menuBestiary.currentPage; }); + lua_method(state, "SetSelectedPage", [](int page) { + menu_manager_get().menuBestiary.currentPage = page; + menu_manager_get().menuBestiary.LoadPreview(); + }); + lua_method(state, "GetSelectedElement", [] { return menu_manager_get().menuBestiary.selectedElement; }); + lua_method(state, "SetSelectedElement", [](int element) { + menu_manager_get().menuBestiary.selectedElement = element; + menu_manager_get().menuBestiary.LoadPreview(); + }); + lua_method(state, "GetNumMonsterPages", [] { return menu_manager_get().menuBestiary.lastEnemyPageId; }); + lua_method(state, "GetNumBossPages", + [] { return (int)menu_manager_get().menuBestiary.bossKeys.size() / BESTIARY_BOSSES_PER_PAGE; }); + lua_method(state, "GetNumPages", [] { + Menu_Bestiary& menu = menu_manager_get().menuBestiary; + return menu.lastEnemyPageId + (int)menu.bossKeys.size() / BESTIARY_BOSSES_PER_PAGE; + }); + menu_namespace_end(state); + + lua_namespace_begin(state, "CollectionMenu"); + lua_method(state, "GetCollectionMenuSprite", + [] { return &menu_manager_get().menuCollection.collectionMenuSprite; }); + lua_method(state, "GetDeathScreenSprite", [] { return &menu_manager_get().menuCollection.deathScreenSprite; }); + lua_method(state, "GetSelectedElement", [] { return menu_manager_get().menuCollection.selectedElement; }); + lua_method(state, "SetSelectedElement", + [](int element) { menu_manager_get().menuCollection.selectedElement = element; }); + lua_method(state, "GetSelectedPage", [] { return menu_manager_get().menuCollection.selectedPage; }); + lua_method(state, "SetSelectedPage", [](int page) { menu_manager_get().menuCollection.selectedPage = page; }); + menu_namespace_end(state); + + lua_namespace_begin(state, "StatsMenu"); + lua_method(state, "GetStatsMenuSprite", [] { return &menu_manager_get().menuStats.statsMenuSprite; }); + lua_method(state, "GetSecretsMenuSprite", [] { return &menu_manager_get().menuStats.achievementsSprite; }); + lua_method(state, "GetSecretsMenuMiniSprite1", + [] { return &menu_manager_get().menuStats.achievementMiniSprites[0]; }); + lua_method(state, "GetSecretsMenuMiniSprite2", + [] { return &menu_manager_get().menuStats.achievementMiniSprites[1]; }); + lua_method(state, "GetSecretsMenuMiniSprite3", + [] { return &menu_manager_get().menuStats.achievementMiniSprites[2]; }); + lua_method(state, "GetSecretsMenuMiniSprite4", + [] { return &menu_manager_get().menuStats.achievementMiniSprites[3]; }); + lua_method(state, "GetSecretsMenuMiniSprite5", + [] { return &menu_manager_get().menuStats.achievementMiniSprites[4]; }); + lua_method(state, "GetSecretsMenuMiniSprite6", + [] { return &menu_manager_get().menuStats.achievementMiniSprites[5]; }); + lua_method(state, "GetSecretsMenuMiniSprite7", + [] { return &menu_manager_get().menuStats.achievementMiniSprites[6]; }); + lua_method(state, "GetSecretsMenuMiniSprite8", + [] { return &menu_manager_get().menuStats.achievementMiniSprites[7]; }); + lua_method(state, "GetSecretsMenuMiniSprite9", + [] { return &menu_manager_get().menuStats.achievementMiniSprites[8]; }); + lua_method(state, "GetSecretsMenuCursorLeftSprite", [] { return &menu_manager_get().menuStats.cursorLeftSprite; }); + lua_method(state, "GetSecretsMenuCursorRightSprite", + [] { return &menu_manager_get().menuStats.cursorRightSprite; }); + lua_method(state, "IsSecretsMenuVisible", [] { return menu_manager_get().menuStats.isAchievementScreenVisible; }); + lua_method(state, "GetSelectedElement", [] { return menu_manager_get().menuStats.statsMenuCurrentSelection; }); + lua_method(state, "SetSelectedElement", + [](int element) { menu_manager_get().menuStats.statsMenuCurrentSelection = element; }); + menu_namespace_end(state); +} + +// (LuaChallengeMenu.cpp, LuaCustomChallengeMenu.cpp, LuaDailyChallengeMenu.cpp, LuaSpecialSeedsMenu.cpp) Registers +// REPENTOGON's namespaces of the challenge, custom challenge, daily run and special seeds menus. +static void run_menus_register(lua_State* state) +{ + lua_namespace_begin(state, "ChallengeMenu"); + lua_method(state, "GetSprite", [] { return &menu_manager_get().menuChallenge.challengeMenuSprite; }); + lua_method(state, "GetSelectedChallengeID", [] { return menu_manager_get().menuChallenge.selectedChallengeId; }); + lua_method(state, "SetSelectedChallengeID", + [](int challenge) { menu_manager_get().menuChallenge.selectedChallengeId = challenge; }); + menu_namespace_end(state); + + lua_namespace_begin(state, "CustomChallengeMenu"); + lua_method(state, "GetSprite", [] { return &menu_manager_get().menuCustomChallenge.customChallengeSprite; }); + lua_method(state, "GetSelectedChallengeID", + [] { return menu_manager_get().menuCustomChallenge.selectedChallengeId; }); + lua_method(state, "SetSelectedChallengeID", + [](int challenge) { menu_manager_get().menuCustomChallenge.selectedChallengeId = challenge; }); + menu_namespace_end(state); + + lua_namespace_begin(state, "DailyChallengeMenu"); + lua_method(state, "GetSprite", [] { return &menu_manager_get().menuDailyChallenge.dailyRunSprite; }); + lua_method(state, "GetLeaderboardSprite", + [] { return &menu_manager_get().menuDailyChallenge.leaderboard.leaderboardSprite; }); + lua_method(state, "GetLeaderboardScoreMenuSprite", + [] { return &menu_manager_get().menuDailyChallenge.leaderboard.scoreSprite; }); + lua_method(state, "GetSelectedElement", [] { return menu_manager_get().menuDailyChallenge.selectedElement; }); + lua_method(state, "SetSelectedElement", + [](int element) { menu_manager_get().menuDailyChallenge.selectedElement = element; }); + lua_method(state, "IsLeaderboardVisible", + [] { return menu_manager_get().menuDailyChallenge.leaderboard.displayState > LEADERBOARD_HIDDEN; }); + lua_method(state, "GetTimeLeftHours", [] { return menu_manager_get().menuDailyChallenge.hoursLeft; }); + lua_method(state, "GetTimeLeftMinutes", [] { return menu_manager_get().menuDailyChallenge.minutesLeft; }); + lua_method(state, "GetTimeLeftSeconds", [] { return menu_manager_get().menuDailyChallenge.secondsLeft; }); + lua_method(state, "GetState", [] { return menu_manager_get().menuDailyChallenge.state; }); + lua_method(state, "SetState", + [](int dailyState) { menu_manager_get().menuDailyChallenge.state = (DailyRunState)dailyState; }); + menu_namespace_end(state); + + lua_namespace_begin(state, "SpecialSeedsMenu"); + lua_method(state, "GetSprite", [] { return &menu_manager_get().menuSpecialSeeds.specialSeedsSprite; }); + lua_method(state, "GetSelectedElement", [] { return menu_manager_get().menuSpecialSeeds.selectedElement; }); + lua_method(state, "SetSelectedElement", + [](int element) { menu_manager_get().menuSpecialSeeds.selectedElement = element; }); + menu_namespace_end(state); +} + +// Replaces a save file drawing's sheet with a mod's, hiding the drawing's other layers, when one was given. +static void slot_sprite_try_replace(ANM2& sprite, const std::string& path) +{ + if (path.empty() || !sprite.ReplaceSpritesheet(0, path)) return; + + for (size_t i = 1; i < sprite.layerStates.size(); i++) sprite.layerStates[i].isVisible = false; + sprite.LoadGraphics(); +} + +// (LuaSaveMenu.cpp's Menu_Save::replace_slot_graphics hook) Puts the sheet a mod gave the current save file on its +// drawing. +void save_slot_sprite_replace(ANM2& sprite) +{ + int slot = (int)g_manager->currentSaveSlot - SAVE_SLOT_FIRST; + if (slot >= 0 && slot < SAVE_SLOT_COUNT) slot_sprite_try_replace(sprite, slotSpritesheets[slot]); +} + +// (LuaTitleMenu.cpp, LuaSaveMenu.cpp, LuaMainMenu.cpp, LuaModsMenu.cpp, LuaOptionsMenu.cpp, +// LuaControllerSelectMenu.cpp, LuaKeyConfigMenu.cpp, LuaCutscenesMenu.cpp) Registers REPENTOGON's namespaces of the title, save file, game, mods, +// options, controller, key config and cutscene menus. +static void setup_menus_register(lua_State* state) +{ + lua_namespace_begin(state, "TitleMenu"); + lua_method(state, "GetSprite", [] { return &menu_manager_get().menuTitle.titleScreenSprite; }); + menu_namespace_end(state); + + lua_namespace_begin(state, "SaveMenu"); + lua_method(state, "GetSaveSelectMenuSprite", [] { return &menu_manager_get().menuSave.saveSelectMenuSprite; }); + lua_method(state, "GetDeleteButtonSprite", [] { return &menu_manager_get().menuSave.deleteButtonSprite; }); + lua_method(state, "GetDeletePopupSprite", [] { return &menu_manager_get().menuSave.deletePopupSprite; }); + lua_method(state, "GetSave1DrawingSprite", [] { return &menu_manager_get().menuSave.drawingSprites[0]; }); + lua_method(state, "GetSave2DrawingSprite", [] { return &menu_manager_get().menuSave.drawingSprites[1]; }); + lua_method(state, "GetSave3DrawingSprite", [] { return &menu_manager_get().menuSave.drawingSprites[2]; }); + lua_method(state, "GetSelectedElement", [] { return menu_manager_get().menuSave.selectedSave; }); + lua_method(state, "SetSelectedElement", [](int element) { menu_manager_get().menuSave.selectedSave = element; }); + lua_method(state, "IsDeleteActive", [] { return menu_manager_get().menuSave.state == SAVE_STATE_DELETE_PICK; }); + lua_method(state, "SetSlotSpritesheet", [](int slot, std::string path) { + int index = slot - SAVE_SLOT_FIRST; + if (index < 0 || index >= SAVE_SLOT_COUNT) return; + + slotSpritesheets[index] = path; + slot_sprite_try_replace(menu_manager_get().menuSave.drawingSprites[index], path); + }); + menu_namespace_end(state); + + lua_namespace_begin(state, "MainMenu"); + lua_method(state, "GetGameMenuSprite", [] { return &menu_manager_get().menuGame.gameMenuSprite; }); + lua_method(state, "GetContinueWidgetSprite", [] { return &menu_manager_get().menuGame.continueWidgetSprite; }); + lua_method(state, "GetSelectedElement", [] { return menu_manager_get().menuGame.selectedElement; }); + lua_method(state, "SetSelectedElement", [](int element) { menu_manager_get().menuGame.selectedElement = element; }); + menu_namespace_end(state); + + lua_namespace_begin(state, "ModsMenu"); + lua_method(state, "GetSprite", [] { return &menu_manager_get().menuMods.modsMenuSprite; }); + lua_method(state, "GetSelectedElement", [] { return menu_manager_get().menuMods.selectedMod + 1; }); + lua_method(state, "SetSelectedElement", [](int element) { + int count = (int)g_manager->modManager.mods.size(); + menu_manager_get().menuMods.selectedMod = std::max(std::min(element - 1, count - 1), 0); + }); + lua_method(state, "WasListEdited", [] { return menu_manager_get().menuMods.isChanged; }); + menu_namespace_end(state); + + lua_namespace_begin(state, "OptionsMenu"); + lua_method(state, "GetOptionsMenuSprite", [] { return &options_menu_get().optionsSprite; }); + lua_method(state, "GetGammaWidgetSprite", [] { return &options_menu_get().gammaMenuSprite; }); + lua_method(state, "GetSelectedElement", [] { return options_menu_get().selectedElement; }); + lua_method(state, "SetSelectedElement", [](int element) { options_menu_get().selectedElement = element; }); + lua_namespace_plain_end(state); + + lua_namespace_begin(state, "ControllerSelectMenu"); + lua_method(state, "GetSprite", [] { return &menu_manager_get().menuControllerSelect.controllerSelectSprite; }); + lua_method(state, "GetSelectedElement", [] { return menu_manager_get().menuControllerSelect.selectedElement; }); + lua_method(state, "SetSelectedElement", + [](int element) { menu_manager_get().menuControllerSelect.selectedElement = element; }); + menu_namespace_end(state); + + lua_namespace_begin(state, "KeyConfigMenu"); + lua_method(state, "GetSprite", [] { return &menu_manager_get().menuKeyConfig.keyConfigSprite; }); + lua_method(state, "GetSelectedElement", [] { return menu_manager_get().menuKeyConfig.selectedElement; }); + lua_method(state, "SetSelectedElement", + [](int element) { menu_manager_get().menuKeyConfig.selectedElement = element; }); + lua_method(state, "GetSelectedColumn", [] { return menu_manager_get().menuKeyConfig.selectedColumn; }); + lua_method(state, "SetSelectedColumn", + [](int column) { menu_manager_get().menuKeyConfig.selectedColumn = column; }); + lua_method(state, "IsEditActive", [] { return menu_manager_get().menuKeyConfig.state == KEY_CONFIG_BINDING; }); + menu_namespace_end(state); + + lua_namespace_begin(state, "CutscenesMenu"); + lua_method(state, "GetSprite", [] { return &menu_manager_get().menuCutscenes.cutscenesMenuSprite; }); + lua_method(state, "GetSelectedElement", [] { return menu_manager_get().menuCutscenes.selectedElement; }); + lua_method(state, "SetSelectedElement", + [](int element) { menu_manager_get().menuCutscenes.selectedElement = element; }); + menu_namespace_end(state); +} + +// MenuManager.SetColorModifier: a color modifier the menus ease toward at a rate (half of it per step, each channel +// arriving together) or take at once. +static int color_modifier_set(lua_State* state) +{ + MenuManager& menus = menu_manager_get(); + ColorModState& target = lua_get(state, 1); + bool isLerped = lua_get>(state, 2).value; + float rate = (float)luaL_optnumber(state, 3, COLOR_MOD_DEFAULT_RATE); + if (isLerped) + { + menu_color_mod_lerp(target, rate / 2); + return 0; + } + + menus.targetColorModState = target; + menus.currentColorModState = target; + menus.isColorModLerping = false; + return 0; +} + +// (LuaMenuManager.cpp) Registers REPENTOGON's MenuManager namespace: the active menu, the color modifier, the view, +// the input mask and the seeds of the main menu. +static void menu_manager_register(lua_State* state) +{ + lua_namespace_begin(state, "MenuManager"); + lua_method(state, "GetShadowSprite", [] { return &menu_manager_get().menuShadowSprite; }); + lua_functions_add(state, {{"SetActiveMenu", + [](lua_State* s) { + int target = (int)luaL_checkinteger(s, 1); + bool isMenu = target >= MENU_TITLE && target <= MENU_ONLINE_AWARDS; + activeMenuLie = isMenu ? activeMenuLie : target; + menu_manager_get().selectedMenuId = isMenu ? (MenuState)target : MENU_NONE; + return 1; + }}, + {"SetColorModifier", color_modifier_set}, + {"SetInputMask", [](lua_State* s) { + inputMask = (uint32_t)(int)luaL_checkinteger(s, 1); + return 1; + }}}); + lua_method(state, "GetActiveMenu", [] { + MenuState menu = menu_manager_get().selectedMenuId; + if (menu == MENU_NONE) return activeMenuLie; + activeMenuLie = 0; + return (int)menu; + }); + lua_method(state, "GetCurrentColorModifier", [] { return menu_manager_get().currentColorModState; }); + lua_method(state, "GetTargetColorModifier", [] { return menu_manager_get().targetColorModState; }); + lua_method(state, "GetColorModifierLerpAmount", [] { return menu_manager_get().lerpColorModState; }); + lua_method(state, "GetViewPosition", [] { return menu_manager_get().viewPosition; }); + lua_method(state, "SetViewPosition", [](Vector position) { menu_manager_get().viewPosition = position; }); + lua_method(state, "GetInputMask", [] { return inputMask; }); + lua_method(state, "GetSeeds", [] { return &menu_manager_get().seedsObject; }); + menu_guard_apply(state); + lua_method(state, "IsActive", [] { return g_menuManager != nullptr; }); + lua_namespace_plain_end(state); +} + +// Registers REPENTOGON's main menu namespaces, its pause screen options menu's and its MenuManager. +void menus_register(lua_State* state) +{ + character_menu_register(state); + record_menus_register(state); + run_menus_register(state); + setup_menus_register(state); + menu_manager_register(state); +} + +// Forgets the main menu's input mask, as each run starts. +void menu_input_mask_clear() +{ + inputMask = INPUT_MASK_ALL; +} + +// Isaac.WorldToMenuPosition: a position of a menu's place on the menu sheet as the screen shows it now. +static int world_to_menu_position(lua_State* state) +{ + if (!g_menuManager) return luaL_error(state, "WorldToMenu can only be used in the main menu"); + int count = lua_gettop(state); + if (count != WORLD_TO_MENU_ARGUMENTS) + return luaL_error(state, "Expected two parameters(MenuId,WorldPosition) got %d\n", count); + + int menu = (int)luaL_checkinteger(state, 1); + Vector position = lua_get(state, 2); + if (menu < MENU_TITLE || menu > MENU_ONLINE_AWARDS) return luaL_error(state, "Invalid Menu Id %d\n", menu); + + MenuManager& menus = menu_manager_get(); + Vector origin = vector_add(menus.viewPosition, vector_make(WORLD_TO_MENU_X, WORLD_TO_MENU_Y)); + origin = vector_sub(origin, menus.viewPositionSet[menu]); + lua_push(state, vector_add(origin, position)); + return 1; +} + +// (LuaIsaac.cpp, LuaMenuManager.cpp) Adds REPENTOGON's cutscene and menu functions to Lua's Isaac begun last. +void isaac_menus_register(lua_State* state) +{ + lua_functions_add(state, {{"WorldToMenuPosition", world_to_menu_position}}); + lua_method(state, "GetCutsceneIdByName", [](std::string name) { + for (const CutsceneEntry& entry : g_manager->cutsceneManager.entries) + if (!entry.name.empty() && entry.name == name) return entry.id; + return -1; + }); + lua_method(state, "PlayCutscene", [](uint32_t cutscene, LuaOptionalBool isCleared) { + if (cutscene > CUTSCENE_GAME_LAST) + { + std::string output; + return g_game->console.RunCommand("cutscene " + std::to_string(cutscene), &output); + } + g_manager->ShowCutscene(cutscene, isCleared.value ? CUTSCENE_UNLOAD_STATE : CUTSCENE_KEEP_STATE, MENU_NONE); + }); +} diff --git a/src/repentogon/menus.h b/src/repentogon/menus.h new file mode 100644 index 0000000..d77093a --- /dev/null +++ b/src/repentogon/menus.h @@ -0,0 +1,9 @@ +#pragma once + +struct ANM2; +struct lua_State; + +void menus_register(lua_State* state); +void isaac_menus_register(lua_State* state); +void save_slot_sprite_replace(ANM2& sprite); +void menu_input_mask_clear(); diff --git a/src/repentogon/npc.cpp b/src/repentogon/npc.cpp index b2fb23f..adf646d 100644 --- a/src/repentogon/npc.cpp +++ b/src/repentogon/npc.cpp @@ -4,6 +4,7 @@ #include "entity/player/player.h" #include "game/game.h" #include "game/manager.h" +#include "level/room.h" #include "repentogon/callbacks.h" constexpr float FIREPLACE_GHOSTS_HEALTH_MIN = 1; @@ -108,3 +109,21 @@ bool boss_thematic_item_get(bool isPicked, int& item, int& trinket) lua_pop(state, 1); return isPicked && !isCancelled; } + +// (Entity::ClearBossHazards, inlined in this version as in Delirium's death) Kills the room's shots and, unless +// ignored, the hostile enemies that keep its doors shut (versus players too), as from a source. +void boss_hazards_clear(BossHazards hazards, Entity* source) +{ + Game& game = *g_game; + std::vector& updated = game.room->entityList.updateEL; + for (size_t i = 0; i < updated.size(); i++) + { + Entity& entity = *updated[i]; + bool isFoe = (game.deathmatchManager.state >= DEATHMATCH_INTRO && entity.type == ENTITY_PLAYER) || + (entity.type >= ENTITY_FIRST_ENEMY && entity.type < ENTITY_EFFECT); + bool isHostile = + entity.CanShutDoors() && entity.type != ENTITY_DARK_ESAU && !entity.HasEntityFlags(FLAG_FRIENDLY); + if (hazards == BOSS_HAZARDS_ALL && isFoe && isHostile) entity.Kill(EntityRef(source)); + if (entity.type == ENTITY_PROJECTILE) entity.isDead = true; + } +} diff --git a/src/repentogon/npc.h b/src/repentogon/npc.h index c1f0a75..f7a4ffb 100644 --- a/src/repentogon/npc.h +++ b/src/repentogon/npc.h @@ -1,9 +1,12 @@ #pragma once #include +#include struct Entity; struct Entity_NPC; +struct Entity_Projectile; +struct lua_State; // The entity an NPC turns into, as Entity_NPC::Morph takes it. struct NpcMorph @@ -18,3 +21,21 @@ std::optional npc_target_hook(Entity_NPC& npc); bool npc_morph_hook(Entity_NPC& npc, NpcMorph morph); bool npc_ghosts_is_shown(Entity_NPC& npc); bool boss_thematic_item_get(bool isPicked, int& item, int& trinket); + +// What Room:ClearBossHazards and Isaac.ClearBossHazards clear: the shots, or the enemies keeping the doors shut too. +enum BossHazards +{ + BOSS_HAZARDS_SHOTS, + BOSS_HAZARDS_ALL +}; + +// Where FireProjectilesEx and FireBossProjectilesEx collect the shots a fire spawns, null outside them. +inline std::vector* projectileCapture = nullptr; + +void delirium_form_force(Entity_NPC& npc, unsigned int& type, unsigned int& variant); +void boss_hazards_clear(BossHazards hazards, Entity* source); +void npc_api_register(lua_State* state); +void familiar_api_register(lua_State* state); +void npc_classes_register(lua_State* state); +void delirium_api_register(lua_State* state); +void isaac_bosses_register(lua_State* state); diff --git a/src/repentogon/player.h b/src/repentogon/player.h index 4f8cc9a..2fe24c2 100644 --- a/src/repentogon/player.h +++ b/src/repentogon/player.h @@ -6,6 +6,7 @@ #include struct ANM2; +struct lua_State; struct Entity; struct Entity_Bomb; struct Entity_Pickup; @@ -153,3 +154,5 @@ void hud_hearts_post_render(PlayerHUD& hud, const HudHeartsDraw& draw); bool hud_active_item_pre_render(PlayerHUD& hud, const HudActiveDraw& draw); void hud_active_item_post_render(PlayerHUD& hud, const HudActiveDraw& draw); bool hud_trinket_pre_render(PlayerHUD& hud, int slot, Vector& position, float& scale, Vector& cropOffset); +void player_api_register(lua_State* state); +void player_classes_api_register(lua_State* state); diff --git a/src/repentogon/player_api.cpp b/src/repentogon/player_api.cpp new file mode 100644 index 0000000..c9296ac --- /dev/null +++ b/src/repentogon/player_api.cpp @@ -0,0 +1,1248 @@ +#include "entity/config.h" +#include "entity/effect/effect.h" +#include "entity/familiar/familiar.h" +#include "entity/pickup/item_pool.h" +#include "entity/pickup/pickup.h" +#include "entity/player/active_items.h" +#include "entity/player/hud.h" +#include "entity/player/player.h" +#include "entity/player/tainted_characters.h" +#include "entity/weapon/laser.h" +#include "entity/weapon/weapon.h" +#include "game/game.h" +#include "game/manager.h" +#include "level/room.h" +#include "repentogon/api.h" +#include "repentogon/hud.h" +#include "repentogon/items.h" +#include "repentogon/options.h" +#include "repentogon/player.h" +#include +#include + +// REPENTOGON's EntityPlayer functions (LuaInterfaces/Entities/LuaEntityPlayer.cpp, LuaCostumeSpriteDesc.cpp, +// LuaEntityConfig.cpp) and its CostumeSpriteDesc, EntityConfigPlayer and EntityConfigBaby classes. + +constexpr int BAG_PICKUP_LAST = 29; +constexpr int BAG_PICKUP_MAX = 30; +constexpr int POOP_SPELL_LAST = 11; +constexpr int POOP_SPELL_QUEUE_LAST = POOP_SPELL_QUEUE_SIZE - 1; +constexpr int PLAYER_FORM_LAST = 14; +constexpr int POCKET_SLOT_LAST = 3; +constexpr int WEAPON_SLOT_LAST = 4; +constexpr int IMMACULATE_STATE_MAX = 14; +constexpr int TEAR_DISPLACEMENT_MAX = 1; +constexpr int FOOT_FIRST = -1; +constexpr int FOOT_LAST = 1; +constexpr int POCKET_ACTIVE_SLOT = 2; +constexpr int POCKET_ACTIVE_SLOT_SECOND = 3; +constexpr int POOL_VALID_LAST = 30; +constexpr int MAX_PICKUP_COUNT = 99; +constexpr int USE_RESULT_DISCHARGE = 1 << 0; +constexpr int USE_RESULT_REMOVE = 1 << 8; +constexpr int USE_EFFECT_COOLDOWN_NONE = -6942069; +constexpr float AQUARIUS_DAMAGE_SCALE = 0.666f; +constexpr float AQUARIUS_SCALE_RANGE = 0.5f; +constexpr float AQUARIUS_SCALE_MIN = 0.2f; +constexpr float SALVAGE_POOF_DROP = 10; +constexpr int SALVAGE_PICKUP_TIMEOUT = 2; +constexpr int VANILLA_TAINTED_FIRST = 21; +constexpr int VANILLA_TAINTED_LAST = 40; +constexpr int MODDED_PLAYER_FIRST = 41; +constexpr std::array HEAD_ANIMATIONS = {"HeadLeft", "HeadUp", "HeadRight", "HeadDown"}; +constexpr std::array HEART_STAT_CACHES = {CACHE_DAMAGE, CACHE_FIREDELAY, CACHE_RANGE, + CACHE_SHOTSPEED, CACHE_SPEED, CACHE_LUCK}; +constexpr std::array HEART_STAT_NAMES = {"Damage", "FireDelay", "TearRange", + "ShotSpeed", "MoveSpeed", "Luck"}; +const std::set HIDDEN_VANILLA_PLAYERS = {PLAYER_LAZARUS2, PLAYER_BLACKJUDAS, PLAYER_THESOUL, PLAYER_ESAU, + PLAYER_LAZARUS2_B, PLAYER_JACOB2_B, PLAYER_THESOUL_B}; + +// Which bonus Candy Heart and Soul Locket stack. +enum HeartStatBonus +{ + HEART_STAT_CANDY_HEART, + HEART_STAT_SOUL_LOCKET +}; + +// The players' tainted counterparts, the modded ones cached as GetTaintedCounterpart finds them. +static std::map taintedCounterparts = { + {0, 21}, {1, 22}, {2, 23}, {3, 24}, {4, 25}, {5, 26}, {6, 27}, {7, 28}, {8, 29}, {9, 30}, {10, 31}, + {11, 38}, {12, 24}, {13, 32}, {14, 33}, {15, 34}, {16, 35}, {17, 40}, {18, 36}, {19, 37}, {20, 37}, {21, 0}, + {22, 1}, {23, 2}, {24, 3}, {25, 4}, {26, 5}, {27, 6}, {28, 7}, {29, 8}, {30, 9}, {31, 10}, {32, 13}, + {33, 14}, {34, 15}, {35, 16}, {36, 18}, {37, 19}, {38, 11}, {39, 19}, {40, 17}}; + +static Entity_Player& player_get(lua_State* state) +{ + return lua_get(state, 1); +} + +// A table of integers from 1, from a list. +template +static void integers_push(lua_State* state, const List& list) +{ + lua_newtable(state); + int index = 1; + for (int value : list) lua_push(state, value), lua_rawseti(state, -2, index++); +} + +// RecalculateBagOfCraftingOutput: moves the bag's pickups over empty slots, then works out what a full bag crafts. +static void bag_output_update(Entity_Player& player) +{ + g_game->hud.InvalidateCraftingItem(&player); + auto& bag = player.bagOfCraftingContent; + std::stable_partition(bag.begin(), bag.end(), [](char pickup) { return pickup > 0; }); + CraftingRecipe output = {0, POOL_NONE}; + if (bag.back() != 0) output = Entity_Player::CalculateBagOfCraftingOutput(bag); + player.bagOfCraftingOutput = output.output; + player.bagOfCraftingPool = output.pool; +} + +// Reads 8 bag pickups from a table, the error naming the function as Lua names it. +static void bag_read(lua_State* state, int index, std::array& bag, const char* name) +{ + for (size_t i = 0; i < lua_rawlen(state, index); i++) + { + lua_rawgeti(state, index, (lua_Integer)i + 1); + int pickup = (int)luaL_checkinteger(state, -1); + lua_pop(state, 1); + if (pickup < 0 || pickup > BAG_PICKUP_LAST) + luaL_error(state, "%s: Invalid pickup %d at index %d", name, pickup, (int)i + 1); + bag[i] = (char)pickup; + } +} + +static int bag_content_get(lua_State* state) +{ + integers_push(state, player_get(state).bagOfCraftingContent); + return 1; +} + +static int bag_content_set(lua_State* state) +{ + Entity_Player& player = player_get(state); + if (!lua_istable(state, 2)) + return luaL_error(state, "EntityPlayer:SetBagOfCraftingContent: Expected a table as second argument"); + if (lua_rawlen(state, 2) > BAG_OF_CRAFTING_SIZE) + return luaL_error(state, "EntityPlayer:SetBagOfCraftingContent: Table cannot be larger than 8 pickups"); + + std::array bag{}; + bag_read(state, 2, bag, "EntityPlayer:SetBagOfCraftingContent"); + player.bagOfCraftingContent = bag; + bag_output_update(player); + return 0; +} + +static int bag_slot_get(lua_State* state) +{ + Entity_Player& player = player_get(state); + int slot = (int)luaL_checkinteger(state, 2); + if (slot < 0 || slot >= BAG_OF_CRAFTING_SIZE) + return luaL_error(state, "EntityPlayer:GetBagOfCraftingSlot: invalid slot id %d\n", slot); + lua_pushinteger(state, player.bagOfCraftingContent[slot]); + return 1; +} + +static int bag_slot_set(lua_State* state) +{ + Entity_Player& player = player_get(state); + int slot = (int)luaL_checkinteger(state, 2); + if (slot < 0 || slot >= BAG_OF_CRAFTING_SIZE) + return luaL_error(state, "EntityPlayer::GetBagOfCraftingSlot: invalid slot id %d\n", slot); + int8_t pickup = (int8_t)luaL_optinteger(state, 3, 0); + if (pickup < 0 || pickup >= BAG_PICKUP_MAX) + return luaL_error(state, "EntityPlayer::SetBagOfCraftingSlot: invalid pickup id %d\n", pickup); + player.bagOfCraftingContent[slot] = (char)pickup; + bag_output_update(player); + return 0; +} + +// EntityPlayer.CalculateBagOfCraftingOutput: the collectible and pool 8 pickups craft. +static int bag_output_calculate(lua_State* state) +{ + if (!lua_istable(state, 1)) luaL_argerror(state, 1, "Expected a table"); + size_t length = lua_rawlen(state, 1); + if (length != BAG_OF_CRAFTING_SIZE) + luaL_error(state, "bad argument #%d to '%s': Expected 8 pickups, got %d", 1, "CalculateBagOfCraftingOutput", + (int)length); + + std::array bag{}; + bag_read(state, 1, bag, "bad argument #1 to 'CalculateBagOfCraftingOutput'"); + CraftingRecipe output = Entity_Player::CalculateBagOfCraftingOutput(bag); + lua_pushinteger(state, output.output); + lua_pushinteger(state, output.pool); + return 2; +} + +static int collectibles_list_get(lua_State* state) +{ + std::vector& counts = player_get(state).collectibleCounts; + lua_newtable(state); + for (size_t i = 1; i < counts.size(); i++) lua_pushinteger(state, counts[i]), lua_rawseti(state, -2, (int)i); + return 1; +} + +static int wisp_collectibles_get(lua_State* state) +{ + lua_newtable(state); + for (auto [item, count] : player_get(state).itemWispsList) + lua_pushinteger(state, count), lua_rawseti(state, -2, item); + return 1; +} + +// A smelted trinket's counts, as REPENTOGON's PushSmeltedTrinketDesc. +static void smelted_push(lua_State* state, const SmeltedTrinket& smelted) +{ + lua_newtable(state); + lua_pushinteger(state, smelted.count); + lua_setfield(state, -2, "trinketAmount"); + lua_pushinteger(state, smelted.goldenCount); + lua_setfield(state, -2, "goldenTrinketAmount"); +} + +// ItemConfig::IsValidTrinket: an existing trinket, golden or not. +static bool trinket_is_valid(int id) +{ + ItemConfig& items = g_manager->itemConfig; + int plain = id & TRINKET_ID_MASK; + return id != 0 && plain < (int)items.trinkets.size() && items.GetTrinket(plain); +} + +static int smelted_trinkets_get(lua_State* state) +{ + std::vector& smelted = player_get(state).smeltedTrinkets; + if (lua_type(state, 2) != LUA_TTABLE) + { + lua_newtable(state); + for (size_t i = 1; i < smelted.size(); i++) smelted_push(state, smelted[i]), lua_rawseti(state, -2, (int)i); + return 1; + } + + std::set ids; + for (size_t i = 1; i <= lua_rawlen(state, 2); i++) + { + lua_rawgeti(state, 2, (lua_Integer)i); + if (lua_isnil(state, -1)) break; + int id = (int)luaL_checkinteger(state, -1) & TRINKET_ID_MASK; + if (trinket_is_valid(id)) ids.insert(id); + lua_pop(state, 1); + } + lua_newtable(state); + for (int id : ids) smelted_push(state, smelted[id]), lua_rawseti(state, -2, id); + return 1; +} + +static int smelted_trinket_desc_get(lua_State* state) +{ + Entity_Player& player = player_get(state); + int id = (int)luaL_checkinteger(state, 2) & TRINKET_ID_MASK; + if (!trinket_is_valid(id)) lua_pushnil(state); + else smelted_push(state, player.smeltedTrinkets[id]); + return 1; +} + +// AddSmeltedTrinketToPlayer (Patches/PlayerFeatures.cpp): smelts a trinket into the player as Gulp! does, after +// MC_PRE_ADD_TRINKET. Whether it was smelted. +static bool smelted_trinket_add(Entity_Player& player, int id, bool isFirstTime) +{ + if (!trinket_is_valid(id) || !trinket_add_pre(player, {id, isFirstTime})) return false; + + SmeltedTrinket& smelted = player.smeltedTrinkets[id & TRINKET_ID_MASK]; + if (id & TRINKET_GOLDEN_FLAG) smelted.goldenCount++; + else smelted.count++; + player.TriggerTrinketAdded((uint32_t)id, isFirstTime); + + Game& game = *g_game; + player.history.AddHistoryItem({0, true, id, (int)game.stage, (int)game.stageType, (int)game.room->roomType, 0}); + player.InvalidateCoPlayerItems(); + ItemConfig_Item* trinket = g_manager->itemConfig.GetTrinket(id & TRINKET_ID_MASK); + if (trinket && trinket->isAddCostumeOnPickup) player.AddCostume(trinket, false); + return true; +} + +static int costume_layer_map_get(lua_State* state) +{ + Entity_Player& player = player_get(state); + lua_newtable(state); + for (int i = 0; i < COSTUME_LAYER_COUNT; i++) + { + PlayerCostumeMap& map = player.playerCostumeMap[i]; + lua_newtable(state); + lua_pushinteger(state, map.index); + lua_setfield(state, -2, "costumeIndex"); + lua_pushinteger(state, map.layerId); + lua_setfield(state, -2, "layerID"); + lua_pushinteger(state, map.priority); + lua_setfield(state, -2, "priority"); + lua_pushboolean(state, map.isBodyLayer); + lua_setfield(state, -2, "isBodyLayer"); + lua_rawseti(state, -2, i + 1); + } + return 1; +} + +// Argument 3 of the costume visibility functions: a layer's name or id, an error for neither. +static int costume_layer_read(lua_State* state, Entity_Player& player) +{ + if (lua_type(state, 3) == LUA_TSTRING) + { + const char* name = luaL_checkstring(state, 3); + if (LayerState* layer = player.sprite.GetLayer(std::string_view(name))) return layer->layerData->id; + return luaL_error(state, "Invalid layer name %s", name); + } + int layerId = (int)luaL_checkinteger(state, 3); + if (layerId < 0 || layerId + 1 > (int)player.sprite.layerStates.size()) + return luaL_error(state, "Invalid layer ID %d", layerId); + return layerId; +} + +static int item_costume_visible_is(lua_State* state) +{ + Entity_Player& player = player_get(state); + ItemConfig_Item* item = &lua_get(state, 2); + lua_pushboolean(state, player.IsItemCostumeVisible(item, costume_layer_read(state, player))); + return 1; +} + +static int collectible_costume_visible_is(lua_State* state) +{ + Entity_Player& player = player_get(state); + ItemConfig_Item* item = g_manager->itemConfig.GetCollectible((int)luaL_checkinteger(state, 2)); + lua_pushboolean(state, player.IsItemCostumeVisible(item, costume_layer_read(state, player))); + return 1; +} + +static int null_costume_visible_is(lua_State* state) +{ + Entity_Player& player = player_get(state); + int nullItem = (int)luaL_checkinteger(state, 2); + lua_pushboolean(state, player.IsNullItemCostumeVisible(nullItem, costume_layer_read(state, player))); + return 1; +} + +static int familiar_check_ex(lua_State* state) +{ + Entity_Player& player = player_get(state); + FamiliarCount count = {.variant = (int)luaL_checkinteger(state, 2)}; + count.count = (int)luaL_checkinteger(state, 3); + count.rng = &lua_get(state, 4); + if (lua_type(state, 5) == LUA_TUSERDATA) count.item = &lua_get(state, 5); + count.subtype = (int)luaL_optinteger(state, 6, -1); + + std::vector spawned; + count.spawned = &spawned; + familiar_check(player, count); + lua_newtable(state); + for (size_t i = 0; i < spawned.size(); i++) lua_push(state, spawned[i]), lua_rawseti(state, -2, (int)i + 1); + return 1; +} + +static int glyph_of_balance_drop_get(lua_State* state) +{ + Entity_Player& player = player_get(state); + int variant = (int)luaL_optinteger(state, 2, -1); + int subtype = (int)luaL_optinteger(state, 3, -1); + player.GetGlyphOfBalanceDrop(&variant, &subtype); + integers_push(state, std::array{variant, subtype}); + return 1; +} + +// ValidatePool: an optional pool, -1 outside the vanilla ones. +static int pool_read(lua_State* state, int index) +{ + int pool = (int)luaL_optinteger(state, index, -1); + return pool > POOL_VALID_LAST || pool < 0 ? -1 : pool; +} + +// SalvageCollectible: a pickup's collectible bursts into pickups as Tainted Cain's touch does, emptying its pedestal, +// or a collectible bursts at a position. +static int collectible_salvage(lua_State* state) +{ + Entity_Player& player = player_get(state); + if (lua_type(state, 2) == LUA_TUSERDATA) + { + Entity_Pickup& pickup = lua_get(state, 2); + RNG* rng = lua_type(state, 3) == LUA_TUSERDATA ? &lua_get(state, 3) : &pickup.dropRNG; + player.tainted_cain_pedestal_burst(pickup.pos, rng->Next(), pool_read(state, 4)); + pickup.empty_pedestal(); + g_game->Spawn({.position = vector_add(pickup.pos, vector_make(0, SALVAGE_POOF_DROP)), + .type = ENTITY_EFFECT, + .variant = EFFECT_POOF01, + .seed = Random()}); + pickup.timeout = SALVAGE_PICKUP_TIMEOUT; + return 0; + } + luaL_checkinteger(state, 2); + Vector position = lua_type(state, 3) == LUA_TUSERDATA ? lua_get(state, 3) : player.pos; + RNG* rng = lua_type(state, 4) == LUA_TUSERDATA ? &lua_get(state, 4) : &player.dropRNG; + player.tainted_cain_pedestal_burst(position, rng->Next(), pool_read(state, 5)); + return 0; +} + +static int footprint_color_get(lua_State* state) +{ + Entity_Player& player = player_get(state); + ColorMod& color = LuaCheckedBool::lua_read(state, 2).value ? player.footprintColor2 : player.footprintColor1; + KColor footprint; + footprint._red = color._offset[0]; + footprint._green = color._offset[1]; + footprint._blue = color._offset[2]; + footprint._alpha = color._tint[3]; + lua_push(state, footprint); + return 1; +} + +// Lua_PlayerAddColEffect and its null item and trinket twins: an effect added once, its cooldown set to the one asked +// for (added to the one left unless not additive, at least 1). +template +static int effect_add(lua_State* state) +{ + TemporaryEffects& effects = player_get(state).temporaryEffects; + int id = (int)luaL_checkinteger(state, 2); + bool isCostume = LuaCheckedBool::lua_read(state, 3).value; + int cooldown = (int)luaL_optinteger(state, 4, USE_EFFECT_COOLDOWN_NONE); + bool isAdditive = LuaOptionalBool::lua_read(state, 5).value; + if (isAdditive && cooldown != USE_EFFECT_COOLDOWN_NONE) + { + TemporaryEffect* effect = (effects.*Get)(id); + if (effect && effect->count > 0) cooldown += effect->cooldown; + cooldown = std::max(cooldown, 1); + } + (effects.*Add)(id, isCostume, 1); + if (!isAdditive || cooldown != USE_EFFECT_COOLDOWN_NONE) (effects.*Get)(id)->cooldown = cooldown; + return 0; +} + +// AddCandyHeartSoulLocketBonus: raises the stats the flags name, a random one of the six for none, by an amount. +static void heart_stat_bonus_add(Entity_Player& player, HeartStatBonus bonus, uint32_t cacheFlags, int amount) +{ + cacheFlags &= CACHE_ALL; + if ((int)cacheFlags <= 0) + { + int item = bonus == HEART_STAT_SOUL_LOCKET ? COLLECTIBLE_SOUL_LOCKET : COLLECTIBLE_CANDY_HEART; + cacheFlags = HEART_STAT_CACHES[player.GetCollectibleRNG(item).RandomInt(HEART_STAT_COUNT)]; + } + auto& stats = bonus == HEART_STAT_SOUL_LOCKET ? player.soulLocketStatUps : player.candyHeartStatUps; + bool isRaised = false; + for (int i = 0; i < HEART_STAT_COUNT; i++) + { + if (!(cacheFlags & HEART_STAT_CACHES[i])) continue; + stats[i] = (uint16_t)std::clamp(stats[i] + amount, 0, (int)UINT16_MAX); + isRaised = true; + } + if (!isRaised) return; + player.AddCacheFlags(cacheFlags); + player.EvaluateItems(); +} + +template +static int heart_stat_bonus_get(lua_State* state) +{ + Entity_Player& player = player_get(state); + auto& stats = Bonus == HEART_STAT_SOUL_LOCKET ? player.soulLocketStatUps : player.candyHeartStatUps; + lua_newtable(state); + for (int i = 0; i < HEART_STAT_COUNT; i++) lua_pushinteger(state, stats[i]), lua_setfield(state, -2, HEART_STAT_NAMES[i]); + return 1; +} + +template +static int heart_stat_bonus_add(lua_State* state) +{ + Entity_Player& player = player_get(state); + uint32_t cacheFlags = (uint32_t)luaL_optinteger(state, 2, 0); + int amount = (int)luaL_optinteger(state, 3, 1); + if (amount != 0) heart_stat_bonus_add(player, Bonus, cacheFlags, amount); + return 0; +} + +static PlayerHUD* player_hud_find(Entity_Player& player) +{ + if (player.playerHUD) return player.playerHUD.get(); + for (PlayerHUD& hud : g_game->hud.playerHUD) + if (hud.player == &player) return &hud; + return nullptr; +} + +// UseActiveItem: Repentance's arguments, or Afterbirth+'s booleans for a non-number third. Its result flags. +static int active_item_use(lua_State* state) +{ + Entity_Player& player = player_get(state); + ActiveUse use = {.item = (int)luaL_checkinteger(state, 2), .slot = -1}; + if (lua_type(state, 3) == LUA_TNUMBER) + { + use.flags = (uint32_t)luaL_checkinteger(state, 3); + if (lua_toboolean(state, 4)) use.slot = (int)luaL_checkinteger(state, 4); + if (lua_toboolean(state, 5)) use.varData = (int)luaL_checkinteger(state, 5); + } + else + { + auto isFalse = [&](int index) { return lua_isboolean(state, index) && !lua_toboolean(state, index); }; + if (isFalse(3)) use.flags |= USE_NOANIM; + if (isFalse(4)) use.flags |= USE_REMOVEACTIVE; + if (lua_toboolean(state, 5)) use.flags |= USE_ALLOWNONMAIN; + if (isFalse(6)) use.flags |= USE_NOCOSTUME; + if (lua_toboolean(state, 7)) use.slot = (int)luaL_checkinteger(state, 7); + if (lua_toboolean(state, 8)) + { + use.flags |= USE_CUSTOMVARDATA; + use.varData = (int)luaL_checkinteger(state, 8); + } + } + UseResult result = player.UseActiveItem(use); + lua_pushinteger(state, (result.isDischarge ? USE_RESULT_DISCHARGE : 0) | (result.isRemove ? USE_RESULT_REMOVE : 0)); + return 1; +} + +// FullCharge: REPENTOGON's optional slot and force (on by default) and boolean result, or with vanilla parity the +// original's three arguments and integer result. +static int full_charge(lua_State* state) +{ + Entity_Player& player = player_get(state); + if (repentogonOptions.isVanillaParity) + { + int slot = (int)luaL_checkinteger(state, 2); + lua_pushinteger(state, player.FullCharge(slot, lua_toboolean(state, 3), lua_toboolean(state, 4))); + return 1; + } + int slot = LuaActiveSlot::lua_read(state, 2).value; + lua_pushboolean(state, player.FullCharge(slot, LuaOptionalBool::lua_read(state, 3).value, false)); + return 1; +} + +// DischargeActiveItem: REPENTOGON never removes the item, which vanilla parity leaves to argument 3. +static int active_item_discharge(lua_State* state) +{ + Entity_Player& player = player_get(state); + if (repentogonOptions.isVanillaParity) + player.DischargeActiveItem((uint32_t)luaL_checkinteger(state, 2), lua_toboolean(state, 3)); + else player.DischargeActiveItem(LuaActiveSlot::lua_read(state, 2).value, false); + return 0; +} + +// SetPocketActiveItem: REPENTOGON raises an error for a slot other than the pockets', which vanilla parity ignores. +static int pocket_active_set(lua_State* state) +{ + Entity_Player& player = player_get(state); + int item = (int)luaL_checkinteger(state, 2); + int slot = (int)luaL_optinteger(state, 3, POCKET_ACTIVE_SLOT); + if (slot != POCKET_ACTIVE_SLOT && slot != POCKET_ACTIVE_SLOT_SECOND && !repentogonOptions.isVanillaParity) + return luaL_argerror(state, 3, "Invalid ActiveSlot - SetPocketActiveItem can only be used for " + "ActiveSlot.SLOT_POCKET or ActiveSlot.SLOT_POCKET2"); + player.SetPocketActiveItem(item, slot, LuaOptionalBool::lua_read(state, 4).value); + return 0; +} + +static int aquarius_creep_spawn(lua_State* state) +{ + Entity_Player& player = player_get(state); + TearParams params; + if (lua_gettop(state) >= 2) params = lua_get(state, 2); + else + { + int displacement = (-(int)(Random() % 2 != 0) & 2) - 1; + params = player.GetTearHitParams(WEAPON_TEARS, player.meleeDamage * AQUARIUS_DAMAGE_SCALE / player.damage, + displacement, nullptr); + } + auto* creep = static_cast(g_game->Spawn({.position = player.pos, + .spawner = &player, + .type = ENTITY_EFFECT, + .variant = EFFECT_PLAYER_CREEP_HOLYWATER_TRAIL, + .seed = Random()})); + if (!creep) return lua_pushnil(state), 1; + + float scale = (float)std::rand() / (float)RAND_MAX * AQUARIUS_SCALE_RANGE + AQUARIUS_SCALE_MIN; + creep->sprite.scale = vector_scale(creep->sprite.scale, scale); + creep->collisionDamage = params.tearDamage; + creep->SetColor(params.tearColor, 0, -1, true, false); + effect_tear_flags_set(*creep, params.tearFlags); + creep->Update(); + lua_push(state, creep); + return 1; +} + +static int poop_spell_set(lua_State* state) +{ + Entity_Player& player = player_get(state); + int position = (int)luaL_checkinteger(state, 2); + int spell = (int)luaL_checkinteger(state, 3); + if (position < 0 || position > POOP_SPELL_QUEUE_LAST) return luaL_argerror(state, 2, "Invalid Poop Spell queue position"); + if (spell < 1 || spell > POOP_SPELL_LAST) return luaL_argerror(state, 3, "Invalid PoopSpellType"); + player.poopSpellQueue[position] = (char)spell; + return 0; +} + +static int poop_spell_remove(lua_State* state) +{ + Entity_Player& player = player_get(state); + int position = (int)luaL_optinteger(state, 2, 0); + if (position < 0 || position > POOP_SPELL_QUEUE_LAST) return luaL_argerror(state, 2, "Invalid Poop Spell queue position"); + std::shift_left(player.poopSpellQueue.begin() + position, player.poopSpellQueue.end(), 1); + player.poopSpellQueue.back() = 0; + player.poop_spell_roll(); + return 0; +} + +// The slot of Tainted Isaac's inventory argument 2 names, an error past his inventory's size (0 for others). +static int inventory_slot_read(lua_State* state, Entity_Player& player) +{ + int slot = (int)luaL_checkinteger(state, 2); + int size = player.playerType == PLAYER_ISAAC_B ? player.GetMaxInventorySize() : 0; + if (slot < 0 || slot >= size) return luaL_error(state, "Invalid slot index %d\n", slot); + return slot; +} + +static int inventory_history_index_get(lua_State* state) +{ + Entity_Player& player = player_get(state); + int index = player.inventory[inventory_slot_read(state, player)]; + if (index < 0) return 0; + lua_pushinteger(state, index); + return 1; +} + +static int inventory_collectible_get(lua_State* state) +{ + Entity_Player& player = player_get(state); + int index = player.inventory[inventory_slot_read(state, player)]; + if (index < 0) return 0; + lua_pushinteger(state, player.history.historyItems[index].id); + return 1; +} + +static int null_costume_add(lua_State* state) +{ + Entity_Player& player = player_get(state); + int id = (int)luaL_checkinteger(state, 2); + int last = (int)g_manager->itemConfig.nullItems.size() - 1; + if (id < 0 || id > last) + { + std::string error = "Invalid null item id " + std::to_string(id) + ", valid range is 0 to " + std::to_string(last); + return luaL_argerror(state, 2, error.c_str()); + } + player.AddNullCostume(id); + return 0; +} + +static int tear_displacement_set(lua_State* state) +{ + Entity_Player& player = player_get(state); + int value = (int)luaL_checkinteger(state, 2); + if (value < -TEAR_DISPLACEMENT_MAX || value > TEAR_DISPLACEMENT_MAX) + return luaL_argerror(state, 2, "TearDisplacement may only be set to -1 or 1"); + player.tearDisplacement = (int8_t)value; + return 1; +} + +static int footstep_frame_is(lua_State* state) +{ + Entity_Player& player = player_get(state); + int foot = (int)luaL_optinteger(state, 2, FOOT_FIRST); + if (foot < FOOT_FIRST || foot > FOOT_LAST) + { + std::string error = "Invalid foot ID " + std::to_string(foot) + ", valid range is -1 to 1"; + return luaL_argerror(state, 2, error.c_str()); + } + lua_pushboolean(state, player.is_footstep_triggered(foot)); + return 1; +} + +static int pocket_item_remove(lua_State* state) +{ + Entity_Player& player = player_get(state); + int slot = (int)luaL_checkinteger(state, 2); + if (slot < 0 || slot > POCKET_SLOT_LAST) return luaL_argerror(state, 2, ("Invalid slot ID " + std::to_string(slot)).c_str()); + player.RemovePocketItem(slot); + return 0; +} + +static int player_form_counter_get(lua_State* state) +{ + Entity_Player& player = player_get(state); + int form = (int)luaL_checkinteger(state, 2); + if (form < 0 || form > PLAYER_FORM_LAST) return luaL_error(state, "Invalid PlayerForm %d", form); + lua_pushinteger(state, player.playerForms[form]); + return 1; +} + +// Entity::ToEffect on a candle's flame. +static Entity_Effect* effect_cast(Entity* entity) +{ + return entity && entity->type == ENTITY_EFFECT ? static_cast(entity) : nullptr; +} + +static int costumes_shuffle_run(lua_State* state) +{ + Entity_Player& player = player_get(state); + costumes_shuffle(player, (uint32_t)luaL_optinteger(state, 2, std::max(Random(), 1u))); + return 0; +} + +static int voided_collectibles_get(lua_State* state) +{ + integers_push(state, player_get(state).voidedCollectibles); + return 1; +} + +static int weapon_fired_count_get(lua_State* state) +{ + Entity_Player& player = player_get(state); + Weapon* weapon = player.weapons[0] ? player.weapons[0].get() : player.weapons[1].get(); + if (weapon) lua_pushinteger(state, weapon->numFired); + else lua_pushnil(state); + return 1; +} + +static int costume_descs_get(lua_State* state) +{ + lua_newtable(state); + int index = 1; + for (CostumeSpriteDesc& costume : player_get(state).costumeSpriteDescs) + lua_push(state, &costume), lua_rawseti(state, -2, index++); + return 1; +} + +static int config_collectibles_get(lua_State* state) +{ + integers_push(state, lua_get(state, 1).collectibles); + return 1; +} + +static int head_direction_set(lua_State* state) +{ + Entity_Player& player = player_get(state); + int direction = (int)luaL_checkinteger(state, 2); + int time = (int)luaL_checkinteger(state, 3); + bool isForced = LuaOptionalBool::lua_read(state, 4).value; + if (direction < 0 || direction >= (int)HEAD_ANIMATIONS.size()) return luaL_argerror(state, 2, "Invalid Direction"); + if (!isForced && player.headDirectionTime >= 0) return 0; + if (player.headDirection != direction) + { + player.headDirection = (Direction)direction; + player.headAnim = HEAD_ANIMATIONS[direction]; + } + player.headDirectionTime = time; + return 0; +} + +// Registers REPENTOGON's functions on EntityPlayer, in the class begun last, over the vanilla ones it changes. +static void player_state_api_register(lua_State* state) +{ + using P = Entity_Player; + luaL_Reg fields[] = { + {"GetSpeedModifier", lua_member_get<&P::speedModifier>}, + {"SetSpeedModifier", lua_member_set<&P::speedModifier>}, + {"GetFireDelayModifier", lua_member_get<&P::fireDelayModifier>}, + {"SetFireDelayModifier", lua_member_set<&P::fireDelayModifier>}, + {"GetDamageModifier", lua_member_get<&P::damageModifier>}, + {"SetDamageModifier", lua_member_set<&P::damageModifier>}, + {"SetTearRangeModifier", lua_member_set<&P::tearRangeModifier>}, + {"GetShotSpeedModifier", lua_member_get<&P::shotSpeedModifier>}, + {"SetShotSpeedModifier", lua_member_set<&P::shotSpeedModifier>}, + {"GetLuckModifier", lua_member_get<&P::luckModifier>}, + {"SetLuckModifier", lua_member_set<&P::luckModifier>}, + {"GetRedStewBonusDuration", lua_member_get<&P::redStewBonusDuration>}, + {"SetRedStewBonusDuration", lua_member_set<&P::redStewBonusDuration>}, + {"GetD8DamageModifier", lua_member_get<&P::d8DamageModifier>}, + {"SetD8DamageModifier", lua_member_set<&P::d8DamageModifier>}, + {"GetD8SpeedModifier", lua_member_get<&P::d8SpeedModifier>}, + {"SetD8SpeedModifier", lua_member_set<&P::d8SpeedModifier>}, + {"GetD8RangeModifier", lua_member_get<&P::d8RangeModifier>}, + {"SetD8RangeModifier", lua_member_set<&P::d8RangeModifier>}, + {"GetD8FireDelayModifier", lua_member_get<&P::d8FireDelayModifier>}, + {"SetD8FireDelayModifier", lua_member_set<&P::d8FireDelayModifier>}, + {"GetEpiphoraCharge", lua_member_get<&P::epiphoraCharge>}, + {"GetPeeBurstCooldown", lua_member_get<&P::peeBurstCooldown>}, + {"GetMaxPeeBurstCooldown", lua_member_get<&P::maxPeeBurstCooldown>}, + {"GetMetronomeCollectibleID", lua_member_get<&P::metronomeCollectibleId>}, + {"GetWildCardItem", lua_member_get<&P::wildCardItem>}, + {"GetWildCardItemType", lua_member_get<&P::wildCardItemType>}, + {"GetPonyCharge", lua_member_get<&P::ponyCharge>}, + {"SetPonyCharge", lua_member_set<&P::ponyCharge>}, + {"GetEdenSpeed", lua_member_get<&P::edenSpeed>}, + {"SetEdenSpeed", lua_member_set<&P::edenSpeed>}, + {"GetEdenFireDelay", lua_member_get<&P::edenFireDelay>}, + {"SetEdenFireDelay", lua_member_set<&P::edenFireDelay>}, + {"GetEdenDamage", lua_member_get<&P::edenDamage>}, + {"SetEdenDamage", lua_member_set<&P::edenDamage>}, + {"GetEdenRange", lua_member_get<&P::edenTearRange>}, + {"SetEdenRange", lua_member_set<&P::edenTearRange>}, + {"GetEdenShotSpeed", lua_member_get<&P::edenShotSpeed>}, + {"SetEdenShotSpeed", lua_member_set<&P::edenShotSpeed>}, + {"GetEdenLuck", lua_member_get<&P::edenLuck>}, + {"SetEdenLuck", lua_member_set<&P::edenLuck>}, + {"GetPurityState", lua_member_get<&P::purityState>}, + {"SetPurityState", lua_member_set<&P::purityState>}, + {"SetTearPoisonDamage", lua_member_set<&P::meleeDamage>}, + {"GetImmaculateConceptionState", lua_member_get<&P::immaculateConceptionState>}, + {"GetCambionConceptionState", lua_member_get<&P::cambionConceptionState>}, + {"SetCambionConceptionState", lua_member_set<&P::cambionConceptionState>}, + {"GetConceptionFamiliarFlags", lua_member_get<&P::conceptionFamiliarFlags>}, + {"SetConceptionFamiliarFlags", lua_member_set<&P::conceptionFamiliarFlags>}, + {"GetBladderCharge", lua_member_get<&P::bladderCharge>}, + {"SetBladderCharge", lua_member_set<&P::bladderCharge>}, + {"GetMaxBladderCharge", lua_member_get<&P::maxBladderCharge>}, + {"SetMaxBladderCharge", lua_member_set<&P::maxBladderCharge>}, + {"IsUrethraBlocked", lua_member_get<&P::isUrethraBlocked>}, + {"GetNextUrethraBlockFrame", lua_member_get<&P::nextUrethraBlockFrame>}, + {"SetNextUrethraBlockFrame", lua_member_set<&P::nextUrethraBlockFrame>}, + {"GetRevelationCharge", lua_member_get<&P::revelationChargeTimer>}, + {"SetRevelationCharge", lua_member_set<&P::revelationChargeTimer>}, + {"GetMaggySwingCooldown", lua_member_get<&P::maggySwingCooldown>}, + {"SetMaggySwingCooldown", lua_member_set<&P::maggySwingCooldown>}, + {"GetEveSumptoriumCharge", lua_member_get<&P::eveSumptoriumCharge>}, + {"SetEveSumptoriumCharge", lua_member_set<&P::eveSumptoriumCharge>}, + {"GetUrnSouls", lua_member_get<&P::urnSouls>}, + {"GetKeepersSackBonus", lua_member_get<&P::keepersSackBonus>}, + {"SetKeepersSackBonus", lua_member_set<&P::keepersSackBonus>}, + {"GetGnawedLeafTimer", lua_member_get<&P::gnawedLeafTimer>}, + {"SetGnawedLeafTimer", lua_member_set<&P::gnawedLeafTimer>}, + {"GetBloodLustCounter", lua_member_get<&P::bloodLustCounter>}, + {"SetBloodLustCounter", lua_member_set<&P::bloodLustCounter>}, + {"GetBombPlaceDelay", lua_member_get<&P::bombPlaceDelay>}, + {"SetBombPlaceDelay", lua_member_set<&P::bombPlaceDelay>}, + {"GetHeadDirectionLockTime", lua_member_get<&P::headDirectionTime>}, + {"SetHeadDirectionLockTime", lua_member_set<&P::headDirectionTime>}, + {"GetPlayerIndex", lua_member_get<&P::playerIndex>}, + {"GetHallowedGroundCountdown", lua_member_get<&P::hallowedGroundCountdown>}, + {"SetHallowedGroundCountdown", lua_member_set<&P::hallowedGroundCountdown>}, + {"GetTearDisplacement", lua_member_get<&P::tearDisplacement>}, + {"GetActionHoldDrop", lua_member_get<&P::actionHoldDrop>}, + {"SetActionHoldDrop", lua_member_set<&P::actionHoldDrop>}, + {"GetForgottenSwapFormCooldown", lua_member_get<&P::forgottenSwapFormCooldown>}, + {"SetForgottenSwapFormCooldown", lua_member_set<&P::forgottenSwapFormCooldown>}, + {"GetRockBottomMoveSpeed", lua_member_get<&P::rockBottomMoveSpeed>}, + {"SetRockBottomMoveSpeed", lua_member_set<&P::rockBottomMoveSpeed>}, + {"GetRockBottomMaxFireDelay", lua_member_get<&P::rockBottomMaxFireDelay>}, + {"SetRockBottomMaxFireDelay", lua_member_set<&P::rockBottomMaxFireDelay>}, + {"GetRockBottomDamage", lua_member_get<&P::rockBottomDamage>}, + {"SetRockBottomDamage", lua_member_set<&P::rockBottomDamage>}, + {"GetRockBottomTearRange", lua_member_get<&P::rockBottomTearRange>}, + {"SetRockBottomTearRange", lua_member_set<&P::rockBottomTearRange>}, + {"GetRockBottomShotSpeed", lua_member_get<&P::rockBottomShotSpeed>}, + {"SetRockBottomShotSpeed", lua_member_set<&P::rockBottomShotSpeed>}, + {"GetRockBottomLuck", lua_member_get<&P::rockBottomLuck>}, + {"SetRockBottomLuck", lua_member_set<&P::rockBottomLuck>}, + {"GetSuplexState", lua_member_get<&P::suplexState>}, + {"SetSuplexState", lua_member_set<&P::suplexState>}, + {"GetSuplexAimCountdown", lua_member_get<&P::suplexAimCountdown>}, + {"SetSuplexAimCountdown", lua_member_set<&P::suplexAimCountdown>}, + {"GetSuplexTargetPosition", lua_member_get<&P::suplexTargetPos>}, + {"SetSuplexTargetPosition", lua_member_set<&P::suplexTargetPos>}, + {"GetSuplexLandPosition", lua_member_get<&P::suplexLandPos>}, + {"SetSuplexLandPosition", lua_member_set<&P::suplexLandPos>}, + {"GetCharmOfTheVampireKills", lua_member_get<&P::vampireCharmKills>}, + {"SetCharmOfTheVampireKills", lua_member_set<&P::vampireCharmKills>}, + {"GetMaggyHealthDrainCooldown", lua_member_get<&P::maggyHealthDrainCooldown>}, + {"SetMaggyHealthDrainCooldown", lua_member_set<&P::maggyHealthDrainCooldown>}, + {"IsPostLevelInitFinished", lua_member_get<&P::isPostLevelInitFinished>}, + {"GetPlanCKillCountdown", lua_member_get<&P::planCKillCountdown>}, + {"SetPlanCKillCountdown", lua_member_set<&P::planCKillCountdown>}, + {"GetPotatoPeelerUses", lua_member_get<&P::potatoPeelerCounter>}, + {"SetPotatoPeelerUses", lua_member_set<&P::potatoPeelerCounter>}, + {"GetMawOfTheVoidCharge", lua_member_get<&P::mawOfTheVoidChargeTimer>}, + {"SetMawOfTheVoidCharge", lua_member_set<&P::mawOfTheVoidChargeTimer>}, + {"GetMontezumaRevengeCharge", lua_member_get<&P::montezumaChargeTimer>}, + {"SetMontezumaRevengeCharge", lua_member_set<&P::montezumaChargeTimer>}, + {"GetBlinkLockTime", lua_member_get<&P::blinkTime>}, + {"SetBlinkLockTime", lua_member_set<&P::blinkTime>}, + {"GetItemStateCooldown", lua_member_get<&P::itemStateCooldown>}, + {"SetItemStateCooldown", lua_member_set<&P::itemStateCooldown>}, + {"GetImExcitedSpeedupCountdown", lua_member_get<&P::imExcitedSpeedupCountdown>}, + {"SetImExcitedSpeedupCountdown", lua_member_set<&P::imExcitedSpeedupCountdown>}, + {"GetDonateLuck", lua_member_get<&P::donateLuck>}, + {"SetDonateLuck", lua_member_set<&P::donateLuck>}, + {"GetRUAWizardTimer", lua_member_get<&P::rUaWizardTimer>}, + {"SetRUAWizardTimer", lua_member_set<&P::rUaWizardTimer>}, + {"GetDeadEyeCharge", lua_member_get<&P::deadEyeCharges>}, + {"GetMegaBlastDuration", lua_member_get<&P::megaBlastDuration>}, + {"GetBagOfCraftingOutput", lua_member_get<&P::bagOfCraftingOutput>}, + {"GetBagOfCraftingOutputItemPool", lua_member_get<&P::bagOfCraftingPool>}, + }; + lua_functions_add(state, fields); + lua_method(state, "SetUrethraBlock", [](P& player, LuaCheckedBool isBlocked) { player.isUrethraBlocked = isBlocked.value; }); + lua_method(state, "SetCanShoot", [](P& player, LuaCheckedBool isCanShoot) { player.canShoot = isCanShoot.value; }); + lua_method(state, "SetImmaculateConceptionState", [](P& player, int value) { + player.immaculateConceptionState = std::clamp(value, 0, IMMACULATE_STATE_MAX); + }); + lua_method(state, "SetMegaBlastDuration", [](P& player, int duration) { + player.megaBlastDuration = duration; + if (auto* laser = static_cast(player.megaBlastLaser.get())) laser->timeout = std::max(1, duration); + }); + lua_method(state, "SetBlackHeart", [](P& player, int heart) { + if (heart > player.soulHearts || heart < 0) return; + player.blackHearts |= 1 << (heart >> 1 & 0x1f); + player.ClampGoldenHearts(false); + player.update_bone_hearts(); + }); + lua_method(state, "GetLaserColor", [](P& player) -> ColorMod& { return player.laserColor; }); + lua_method(state, "SetLaserColor", [](P& player, ColorMod color) { player.laserColor = color; }); + lua_method(state, "SetFootprintColor", [](P& player, KColor color, LuaOptionalBool isUnknown) { + player.SetFootprintColor(color, isUnknown.value); + }); + lua_method(state, "CreateAfterimage", [](P& player, int duration, Vector position) { + player.afterImageFrames.push_back({position, duration}); + }); + lua_field<&P::babySkin>(state, "BabySkin"); + lua_field<&P::friendBallEnemy>(state, "FriendBallEnemy"); +} + +// Registers REPENTOGON's functions on EntityPlayer that call the game's own, over the vanilla ones it changes. +static void player_actions_api_register(lua_State* state) +{ + using P = Entity_Player; + using Slot = LuaActiveSlot; + using AnySlot = LuaActiveSlot; + luaL_Reg functions[] = { + {"GetBagOfCraftingContent", bag_content_get}, + {"SetBagOfCraftingContent", bag_content_set}, + {"GetBagOfCraftingSlot", bag_slot_get}, + {"SetBagOfCraftingSlot", bag_slot_set}, + {"GetCollectiblesList", collectibles_list_get}, + {"GetWispCollectiblesList", wisp_collectibles_get}, + {"GetSmeltedTrinkets", smelted_trinkets_get}, + {"GetSmeltedTrinketDesc", smelted_trinket_desc_get}, + {"GetCostumeLayerMap", costume_layer_map_get}, + {"IsItemCostumeVisible", item_costume_visible_is}, + {"IsCollectibleCostumeVisible", collectible_costume_visible_is}, + {"IsNullItemCostumeVisible", null_costume_visible_is}, + {"CheckFamiliarEx", familiar_check_ex}, + {"GetGlyphOfBalanceDrop", glyph_of_balance_drop_get}, + {"SalvageCollectible", collectible_salvage}, + {"GetFootprintColor", footprint_color_get}, + {"AddCollectibleEffect", effect_add<&TemporaryEffects::GetCollectibleEffect, &TemporaryEffects::AddCollectibleEffect>}, + {"AddNullItemEffect", effect_add<&TemporaryEffects::GetNullEffect, &TemporaryEffects::AddNullEffect>}, + {"AddTrinketEffect", effect_add<&TemporaryEffects::GetTrinketEffect, &TemporaryEffects::AddTrinketEffect>}, + {"GetCandyHeartBonus", heart_stat_bonus_get}, + {"AddCandyHeartBonus", heart_stat_bonus_add}, + {"GetSoulLocketBonus", heart_stat_bonus_get}, + {"AddSoulLocketBonus", heart_stat_bonus_add}, + {"UseActiveItem", active_item_use}, + {"FullCharge", full_charge}, + {"DischargeActiveItem", active_item_discharge}, + {"SetPocketActiveItem", pocket_active_set}, + {"SpawnAquariusCreep", aquarius_creep_spawn}, + {"SetPoopSpell", poop_spell_set}, + {"RemovePoopSpell", poop_spell_remove}, + {"GetInventoryHistoryIndex", inventory_history_index_get}, + {"GetInventoryCollectible", inventory_collectible_get}, + {"AddNullCostume", null_costume_add}, + {"SetTearDisplacement", tear_displacement_set}, + {"IsFootstepFrame", footstep_frame_is}, + {"RemovePocketItem", pocket_item_remove}, + {"GetPlayerFormCounter", player_form_counter_get}, + {"SetHeadDirection", head_direction_set}, + {"ShuffleCostumes", costumes_shuffle_run}, + {"GetVoidedCollectiblesList", voided_collectibles_get}, + {"GetActiveWeaponNumFired", weapon_fired_count_get}, + {"GetCostumeSpriteDescs", costume_descs_get}, + }; + lua_functions_add(state, functions); + + lua_method(state, "HasCollectible", + [](P& player, int id, LuaOptionalBool isIgnoreModifiers, LuaOptionalBool) { + return player.HasCollectible(id, isIgnoreModifiers.value ? ITEM_CHECK_OWNED : ITEM_CHECK_MODIFIED); + }); + lua_method(state, "GetCollectibleNum", + [](P& player, int id, LuaOptionalBool isOnlyTrueItems, LuaOptionalBool isIgnoreSpoof) { + ItemCheck check = isOnlyTrueItems.value ? ITEM_CHECK_OWNED : ITEM_CHECK_MODIFIED; + if (!isIgnoreSpoof.value) return player.GetCollectibleNum(id, check); + return hook_inner_call([&] { return player.GetCollectibleNum(id, check); }); + }); + lua_method(state, "AddCollectible", + [](P& player, int id, LuaDefault charge, LuaOptionalBool isFirstTime, Slot slot, + LuaDefault varData, LuaDefault pool) { + player.AddCollectible(id, charge.value, isFirstTime.value, slot.value, varData.value, pool.value); + }); + lua_method(state, "HasTrinket", [](P& player, uint32_t id, LuaOptionalBool isIgnoreModifiers, LuaOptionalBool) { + if (!isIgnoreModifiers.value) return player.GetTrinketMultiplier(id) > 0; + return player.HasTrinket(id, ITEM_CHECK_OWNED); + }); + lua_method(state, "GetTrinketMultiplier", + [](P& player, uint32_t id, LuaOptionalBool) { return player.GetTrinketMultiplier(id); }); + lua_method(state, "HasGoldenTrinket", + [](P& player, uint32_t id, LuaOptionalBool) { return player.HasGoldenTrinket(id); }); + lua_method(state, "AddCacheFlags", [](P& player, int flags, LuaOptionalBool isEvaluate) { + player.AddCacheFlags((uint32_t)flags); + if (isEvaluate.value) player.EvaluateItems(); + }); + lua_method(state, "ClearDeadEyeCharge", [](P& player, bool isForced) { + if (!isForced) return player.ClearDeadEyeCharge(); + player.deadEyeCharges = 0; + player.deadEyeMisses = 0; + player.cacheFlags |= CACHE_DAMAGE; + player.EvaluateItems(); + }); + lua_method(state, "GetBombVariant", [](P&, TearFlags, LuaCheckedBool) { return Entity_Player::GetBombVariant(); }); + lua_method(state, "HasInvincibility", + [](P& player, LuaDefault flags, LuaOptionalObject source) { + return player.HasInvincibility((uint64_t)flags.value, source.value ? *source.value : EntityRef()); + }); + lua_method(state, "ShootRedCandle", [](P& player, Vector direction) { return effect_cast(player.ShootRedCandle(direction)); }); + lua_method(state, "ShootBlueCandle", [](P& player, Vector direction) { return effect_cast(player.ShootBlueCandle(direction)); }); + + lua_method(state, "GetActiveItem", [](P& player, Slot slot) { return player.GetActiveItem(slot.value); }); + lua_method(state, "GetActiveCharge", [](P& player, Slot slot) { return player.GetActiveCharge(slot.value); }); + lua_method(state, "GetActiveSubCharge", [](P& player, Slot slot) { return player.GetActiveSubCharge(slot.value); }); + lua_method(state, "GetBatteryCharge", [](P& player, Slot slot) { return player.GetBatteryCharge(slot.value); }); + lua_method(state, "NeedsCharge", [](P& player, AnySlot slot) { return player.NeedsCharge(slot.value); }); + lua_method(state, "SetActiveCharge", [](P& player, int charge, AnySlot slot) { player.SetActiveCharge(charge, slot.value); }); + lua_method(state, "AddActiveCharge", + [](P& player, int charge, AnySlot slot, LuaOptionalBool isFlashHud, LuaOptionalBool isOvercharge, + LuaOptionalBool isForce) { + return player.AddActiveCharge(charge, slot.value, isFlashHud.value, isOvercharge.value, isForce.value); + }); + lua_method(state, "GetTotalActiveCharge", [](P& player, Slot slot) { return player.GetTotalActiveCharge(slot.value); }); + lua_method(state, "GetActiveMaxCharge", [](P& player, Slot slot) { return player.GetActiveMaxCharge(slot.value); }); + lua_method(state, "GetActiveMinUsableCharge", + [](P& player, Slot slot) { return player.GetActiveMinUsableCharge(slot.value); }); + lua_method(state, "SetActiveVarData", [](P& player, int varData, Slot slot) { player.SetActiveVarData(varData, slot.value); }); + lua_method(state, "GetActiveItemDesc", [](P& player, Slot slot) { return &player.activeItems[slot.value]; }); + lua_method(state, "GetActiveItemSlot", [](P& player, int id) { return player.GetActiveItemSlot(id); }); + lua_method(state, "CanOverrideActiveItem", [](P& player, Slot slot) { + int item = player.activeItems[slot.value].item; + return item == 0 || item == COLLECTIBLE_BOOK_OF_VIRTUES || item == COLLECTIBLE_BOOK_OF_BELIAL_PASSIVE; + }); + lua_method(state, "GetMaxPocketItems", [](P& player) { return player.GetMaxPocketItems(); }); +} + +// Registers REPENTOGON's functions on EntityPlayer reading the player's state and running its effects. +static void player_effects_api_register(lua_State* state) +{ + using P = Entity_Player; + lua_method(state, "InitTwin", [](P& player, int playerType) { return player.InitTwin(playerType); }); + lua_method(state, "InitPostLevelInitStats", [](P& player) { player.InitPostLevelInitStats(); }); + lua_method(state, "SetItemState", [](P& player, int item) { player.SetItemState(item); }); + lua_method(state, "GetHealthType", [](P& player) { return player.GetHealthType(); }); + lua_method(state, "DropCollectible", [](P& player, int id, LuaOptionalObject pickup, + LuaOptionalBool isRemoveFromForm) { + Entity_Pickup* dropped = player.DropCollectible(id, pickup.value, isRemoveFromForm.value); + return dropped ? dropped : pickup.value; + }); + lua_method(state, "DropCollectibleByHistoryIndex", [](P& player, int index, LuaOptionalObject pickup) { + player.DropCollectibleByHistoryIndex(index, pickup.value); + return pickup.value; + }); + lua_method(state, "IncrementPlayerFormCounter", + [](P& player, int form, int count) { player.IncrementPlayerFormCounter(form, count); }); + lua_method(state, "TryPreventDeath", [](P& player) { return player.TryPreventDeath(); }); + lua_method(state, "RemoveCollectibleByHistoryIndex", + [](P& player, int index) { player.RemoveCollectibleByHistoryIndex(index, true); }); + lua_method(state, "Teleport", [](P& player, Vector position, LuaOptionalBool isEffects, LuaOptionalBool isTwins) { + player.Teleport(position, isEffects.value, isTwins.value); + }); + lua_method(state, "SetBagOfCraftingOutput", [](P& player, int collectible, LuaDefault pool) { + int poolType = pool.value < 0 || pool.value >= POOL_COUNT ? g_game->itemPool.GetFirstItemPoolForCollectible(collectible) + : pool.value; + player.bagOfCraftingOutput = collectible; + player.bagOfCraftingPool = poolType; + g_game->hud.InvalidateCraftingItem(&player); + }); + lua_pushcfunction(state, bag_output_calculate); + lua_table_set(state, -3, "CalculateBagOfCraftingOutput"); + lua_method(state, "GetMovingBoxContents", [](P& player) { return &player.movingBoxContents; }); + lua_method(state, "GetWeaponModifiers", [](P& player) { return player.GetWeaponModifiers(); }); + lua_method(state, "EnableWeaponType", + [](P& player, int weapon, LuaCheckedBool isSet) { player.EnableWeaponType(weapon, isSet.value); }); + lua_method(state, "GetMarkedTarget", + [](P& player) { return static_cast(player.markedTarget.get()); }); + lua_method(state, "IsLocalPlayer", + [](P& player) { return g_manager->netplayManager.IsIdxLocalPlayer(player.controllerIndex); }); + lua_method(state, "AddLocust", [](P& player, int item, Vector position) { locust_spawn(player, item, position); }); + lua_method(state, "TriggerRoomClear", [](P& player) { player.TriggerRoomClear(); }); + lua_method(state, "UpdateIsaacPregnancy", + [](P& player, LuaCheckedBool isCambion) { player.trigger_immaculate_conception(isCambion.value); }); + lua_method(state, "GetCambionPregnancyLevel", [](P& player) { return player.GetCambionPregnancyLevel(); }); + lua_method(state, "GetHeldSprite", [](P& player) -> ANM2& { return player.heldSprite; }); + lua_method(state, "GetBloodGushSprite", [](P& player) -> ANM2& { return player.bloodGushSprite; }); + lua_method(state, "GetBodySprite", [](P& player) -> ANM2& { return player.bodySprite; }); + lua_method(state, "GetHeldEntity", [](P& player) { return player.heldEntity; }); + lua_method(state, "GetFlippedForm", [](P& player) { return player.backupPlayer; }); + lua_method(state, "SwapForgottenForm", [](P& player, LuaOptionalBool isIgnoreHealth, LuaOptionalBool isNoEffects) { + return player.SwapForgottenForm(isIgnoreHealth.value, isNoEffects.value); + }); + lua_method(state, "PlayDelayedSFX", + [](P& player, uint32_t sound, LuaDefault soundDelay, LuaDefault frameDelay, + LuaDefault volume) { + player.PlayDelayedSFX((int)sound, soundDelay.value, frameDelay.value, volume.value); + }); + lua_method(state, "CanUsePill", [](P& player, int effect) { return player.CanUsePill(effect); }); + lua_method(state, "AddSmeltedTrinket", [](P& player, int id, LuaOptionalBool isFirstTime) { + return smelted_trinket_add(player, id, isFirstTime.value); + }); + lua_method(state, "PlayCollectibleAnim", + [](P& player, int id, LuaCheckedBool isCheckBody, std::string_view animation, LuaDefault frame) { + player.PlayCollectibleAnim(id, isCheckBody.value, animation, frame.value); + }); + lua_method(state, "IsCollectibleAnimFinished", + [](P& player, int id, std::string_view animation) { return player.IsCollectibleAnimFinished(id, animation); }); + lua_method(state, "ClearCollectibleAnim", [](P& player, int id) { player.ClearCollectibleAnim(id); }); + lua_method(state, "ClearItemAnimCollectible", [](P& player, int id) { player.ClearCollectibleAnim(id); }); + lua_method(state, "AddBoneOrbital", + [](P& player, Vector position) { return static_cast(player.AddBoneOrbital(position)); }); + lua_method(state, "AddLeprosy", [](P& player) { player.AddLeprosy(); }); + lua_method(state, "AddUrnSouls", [](P& player, int count) { player.AddUrnSouls((uint32_t)count); }); + lua_method(state, "CanAddCollectibleToInventory", [](P& player, int id) { return player.CanAddCollectibleToInventory(id); }); + lua_method(state, "CanCrushRocks", [](P& player) { return player.CanCrushRocks(); }); + lua_method(state, "FireBrimstoneBall", + [](P& player, Vector position, Vector velocity, LuaOptionalObject offset) { + return player.FireBrimstoneBall({position, velocity}, offset.value ? *offset.value : Vector{}); + }); + lua_method(state, "GetBodyMoveDirection", [](P& player) { return player.GetBodyMoveDirection(); }); + lua_method(state, "GetDeathAnimName", [](P& player) { return player.GetDeathAnimName(); }); + lua_method(state, "GetEnterPosition", [](P& player) { return player.GetEnterPosition(); }); + lua_method(state, "GetFocusEntity", [](P& player) { return player.GetFocusEntity(); }); + lua_method(state, "GetGlitchBabySubType", [](P& player) { return player.GetGlitchBabySubType(); }); + lua_method(state, "GetGreedsGulletHearts", [](P& player) { return player.GetGreedsGulletHearts(); }); + lua_method(state, "GetSpecialGridCollision", [](P& player, LuaOptionalObject position) { + return player.get_grid_collision_at(position.value ? *position.value : player.pos); + }); + lua_method(state, "HasInstantDeathCurse", [](P& player) { return player.HasInstantDeathCurse(); }); + lua_method(state, "HasPoisonImmunity", [](P& player) { return player.HasPoisonImmunity(); }); + lua_method(state, "IsEntityValidTarget", [](P& player, Entity& target) { return player.IsValidTarget(&target); }); + lua_method(state, "IsHeadless", [](P& player) { return player.IsHeadless(); }); + lua_method(state, "IsHologram", [](P& player) { return player.IsHologram(); }); + lua_method(state, "IsInvisible", [](P& player) { return player.IsInvisible(); }); + lua_method(state, "IsPacifist", [](P&) { return g_game->room->isPacifist; }); + lua_method(state, "MorphToCoopGhost", [](P& player) { player.MorphToCoopGhost(); }); + lua_method(state, "RerollAllCollectibles", + [](P& player, LuaOptionalObject rng, LuaOptionalBool isIncludeActives) { + player.reroll_collectibles_on_damage(rng.value ? rng.value : &player.dropRNG, isIncludeActives.value); + }); + lua_method(state, "ResetPlayer", [](P& player) { player.ResetPlayer(); }); + lua_method(state, "ReviveCoopGhost", [](P& player) { + if (!player.isCoopGhost) return false; + player.RevivePlayerGhost(); + return true; + }); + lua_method(state, "SetControllerIndex", + [](P& player, int index, LuaCheckedBool isPlayerOwned) { player.SetControllerIndex(index, isPlayerOwned.value); }); + lua_method(state, "SpawnClot", [](P& player, Vector position, LuaOptionalBool isKillAllowed) { + player.SpawnClot(position, isKillAllowed.value); + }); + lua_method(state, "SyncConsumableCounts", + [](P& player, P& other, int flags) { player.SyncConsumables(&other, (uint32_t)flags); }); + lua_method(state, "TryAddToBagOfCrafting", + [](P& player, Entity_Pickup& pickup) { return player.bag_of_crafting_collect(&pickup); }); + lua_method(state, "TryDecreaseGlowingHourglassUses", [](P& player, int uses, LuaCheckedBool isForced) { + player.TryDecreaseGlowingHourglassUses(uses != 0, isForced.value); + }); + lua_method(state, "TryForgottenThrow", [](P& player, Vector direction) { return player.TryForgottenThrow(direction); }); + lua_method(state, "TryRemoveSmeltedTrinket", [](P& player, int id) { player.TryRemoveSmeltedTrinket((uint32_t)id); }); + lua_method(state, "VoidHasCollectible", [](P& player, int id) { return player.VoidHasCollectible(id); }); + lua_method(state, "ClearQueueItem", [](P& player) { player.ClearQueueItem(); }); + lua_method(state, "HasChanceRevive", [](P& player) { return player.HasCollectible(COLLECTIBLE_GUPPYS_COLLAR); }); + lua_method(state, "GetMaxCoins", [](LuaIgnored) { return MAX_PICKUP_COUNT; }); + lua_method(state, "GetMaxKeys", [](LuaIgnored) { return MAX_PICKUP_COUNT; }); + lua_method(state, "GetMaxBombs", [](LuaIgnored) { return MAX_PICKUP_COUNT; }); + lua_method(state, "GetPlayerHUD", [](P& player) { return player_hud_find(player); }); + lua_method(state, "HasCamoEffect", [](P& player) { + Seeds& seeds = g_game->seedEffects; + TemporaryEffects& effects = player.temporaryEffects; + return player.isCamoForced || seeds.HasSeedEffect(SEED_CAMO_ISAAC) || seeds.HasSeedEffect(SEED_CAMO_EVERYTHING) || + effects.HasCollectibleEffect(COLLECTIBLE_CAMO_UNDIES) || effects.HasTrinketEffect(TRINKET_FADED_POLAROID); + }); + lua_method(state, "HasForcedCamoEffect", [](P& player) { return player.isCamoForced; }); + lua_method(state, "SetForceCamoEffect", + [](P& player, LuaCheckedBool isForced) { player.isCamoForced = isForced.value; }); + lua_method(state, "GetErrorTrinketEffect", [](LuaIgnored) { return error_trinket_disguise_get(); }); + lua_method(state, "GetMaxInventorySize", + [](P& player) { return player.playerType == PLAYER_ISAAC_B ? player.GetMaxInventorySize() : 0; }); + lua_method(state, "SpawnSaturnusTears", [](P& player) { + player.fire_saturnus_tears(); + return SATURNUS_TEARS; + }); + lua_method(state, "GetEntityConfigPlayer", + [](P& player) { return g_manager->entityConfig.GetPlayer(player.playerType); }); +} + +// Ends EntityPlayer's REPENTOGON functions, run in its class. +void player_api_register(lua_State* state) +{ + player_state_api_register(state); + player_actions_api_register(state); + player_effects_api_register(state); +} + +// Registers REPENTOGON's CostumeSpriteDesc, EntityConfigPlayer and EntityConfigBaby. +void player_classes_api_register(lua_State* state) +{ + using C = CostumeSpriteDesc; + lua_class_begin(state, "CostumeSpriteDesc", LUA_CLASS_COSTUME_SPRITE_DESC); + lua_method(state, "GetSprite", [](C& costume) -> ANM2& { return costume.sprite; }); + lua_method(state, "GetItemConfig", [](C& costume) { return costume.item; }); + lua_method(state, "GetPriority", [](C& costume) { return costume.priority; }); + lua_method(state, "IsItemAnimPlaying", [](C& costume) { return costume.isItemAnimPlay; }); + lua_method(state, "IsFlying", [](C& costume) { return costume.isFlying; }); + lua_method(state, "HasOverlay", [](C& costume) { return costume.isHasOverlay; }); + lua_method(state, "HasSkinAlt", [](C& costume) { return costume.isHasSkinAlt; }); + lua_method(state, "GetDefaultSkinColor", [](C& costume) { return costume.defaultSkinColor; }); + lua_method(state, "GetSkinColor", [](C& costume) { return costume.skinColor; }); + lua_method(state, "GetHeadColor", [](C& costume) { return costume.defaultSkinColor; }); + lua_method(state, "GetBodyColor", [](C& costume) { return costume.skinColor; }); + lua_method(state, "CanOverwriteColor", [](C& costume) { return costume.isOverwriteColor; }); + lua_method(state, "IsItemStateOnly", [](C& costume) { return costume.isItemStateOnly; }); + lua_method(state, "GetPlayerType", [](C& costume) { return costume.playerType; }); + lua_class_hidden_end(state); + + using E = EntityConfig_Player; + lua_class_begin(state, "EntityConfigPlayer", LUA_CLASS_ENTITY_CONFIG_PLAYER); + lua_method(state, "GetPlayerType", [](E& config) { return config.id; }); + lua_method(state, "GetName", [](E& config) -> std::string& { return config.name; }); + lua_method(state, "GetSkinPath", [](E& config) -> std::string& { return config.skinPath; }); + lua_method(state, "GetNameImagePath", [](E& config) -> std::string& { return config.nameImagePath; }); + lua_method(state, "GetPortraitPath", [](E& config) -> std::string& { return config.portraitPath; }); + lua_method(state, "GetExtraPortraitPath", [](E& config) -> std::string& { return config.extraPortraitPath; }); + lua_method(state, "GetCostumeSuffix", [](E& config) -> std::string& { return config.costumeSuffixName; }); + lua_method(state, "GetCostumeID", [](E& config) { return config.costumeID; }); + lua_method(state, "GetSkinColor", [](E& config) { return config.skinColor; }); + lua_method(state, "GetRedHearts", [](E& config) { return config.heart; }); + lua_method(state, "GetSoulHearts", [](E& config) { return config.armor; }); + lua_method(state, "GetBlackHearts", [](E& config) { return config.blackHeart; }); + lua_method(state, "GetBrokenHearts", [](E& config) { return config.brokenHeart; }); + lua_method(state, "GetCoins", [](E& config) { return config.coins; }); + lua_method(state, "GetBombs", [](E& config) { return config.bombs; }); + lua_method(state, "GetKeys", [](E& config) { return config.keys; }); + lua_method(state, "GetCard", [](E& config) { return config.card; }); + lua_method(state, "GetPill", [](E& config) { return config.pill; }); + lua_method(state, "GetTrinket", [](E& config) { return config.trinket; }); + lua_pushcfunction(state, config_collectibles_get); + lua_table_set(state, -2, "GetCollectibles"); + lua_method(state, "GetPocketActive", [](E& config) { return config.pocketActiveID; }); + lua_method(state, "CanShoot", [](E& config) { return config.isCanShoot; }); + lua_method(state, "GetAchievementID", [](E& config) { return config.achievement; }); + lua_method(state, "GetBirthrightDescription", [](E& config) -> std::string& { return config.birthrightDescription; }); + lua_method(state, "GetModdedMenuBackgroundSprite", + [](E& config) { return config.moddedSprites[PLAYER_SPRITE_MENU_BACKGROUND]; }); + lua_method(state, "GetModdedMenuPortraitSprite", [](E& config) { return config.moddedSprites[PLAYER_SPRITE_MENU_PORTRAIT]; }); + lua_method(state, "GetModdedGameOverSprite", [](E& config) { return config.moddedSprites[PLAYER_SPRITE_GAME_OVER]; }); + lua_method(state, "GetModdedCoopMenuSprite", [](E& config) { return config.moddedSprites[PLAYER_SPRITE_COOP_MENU]; }); + lua_method(state, "GetModdedControlsSprite", [](E& config) { return config.moddedSprites[PLAYER_SPRITE_CONTROLS]; }); + lua_method(state, "IsTainted", [](E& config) { + return (config.id >= VANILLA_TAINTED_FIRST && config.id <= VANILLA_TAINTED_LAST) || !config.bSkinParentName.empty(); + }); + lua_method(state, "IsHidden", [](E& config) { return config.isHidden || HIDDEN_VANILLA_PLAYERS.contains(config.id); }); + lua_method(state, "GetTaintedCounterpart", [](E& config) -> EntityConfig_Player* { + std::vector& players = g_manager->entityConfig.players; + int counterpart = -1; + if (auto found = taintedCounterparts.find(config.id); found != taintedCounterparts.end()) counterpart = found->second; + else if (!config.bSkinParentName.empty()) + { + for (size_t i = MODDED_PLAYER_FIRST; i < players.size() && counterpart < 0; i++) + if (players[i].id != config.id && players[i].name == config.bSkinParentName && players[i].bSkinParentName.empty()) + counterpart = players[i].id; + taintedCounterparts[config.id] = counterpart; + } + else if (config.moddedTaintedPlayerID > VANILLA_TAINTED_LAST && config.moddedTaintedPlayerID != config.id) + counterpart = config.moddedTaintedPlayerID; + if (counterpart < 0 || counterpart >= (int)players.size()) return nullptr; + return g_manager->entityConfig.GetPlayer(counterpart); + }); + lua_class_hidden_end(state); + + using B = EntityConfig_Baby; + lua_class_begin(state, "EntityConfigBaby", LUA_CLASS_ENTITY_CONFIG_BABY); + lua_method(state, "GetID", [](B& baby) { return baby.id; }); + lua_method(state, "GetName", [](B& baby) -> std::string& { return baby.name; }); + lua_method(state, "GetSpritesheetPath", [](B& baby) -> std::string& { return baby.gfx; }); + lua_method(state, "GetAchievementID", [](B& baby) { return baby.achievementID; }); + lua_class_hidden_end(state); +} diff --git a/src/repentogon/render.h b/src/repentogon/render.h index d2fd82c..d342980 100644 --- a/src/repentogon/render.h +++ b/src/repentogon/render.h @@ -5,10 +5,18 @@ class Room; struct ANM2; +struct LayerState; struct Entity; struct GridEntity; struct Vector; +// Which of a sprite's custom shaders replaces the color offset shader: the plain one or the champion one. +enum CustomShaderSlot +{ + CUSTOM_SHADER_NORMAL, + CUSTOM_SHADER_CHAMPION +}; + // A character's page as the character menu draws it: a modded character's own sprite (none for the game's), the // game's page sprite, where, the player type, and whether the modded sprite brings its own background. struct CharacterPage @@ -29,3 +37,4 @@ bool character_portrait_hook(ANM2& sprite, Vector position, int playerType); bool character_page_pre(CharacterPage page); void character_page_post(CharacterPage page); bool character_page_render(ANM2& sprite, Vector position, int playerType); +void custom_shader_select(const ANM2& sprite, const LayerState& layer, CustomShaderSlot slot); diff --git a/src/repentogon/repentogon.cpp b/src/repentogon/repentogon.cpp index 5596722..a2caa6a 100644 --- a/src/repentogon/repentogon.cpp +++ b/src/repentogon/repentogon.cpp @@ -4,12 +4,14 @@ #include "lua/api.h" #include "lua/callbacks.h" #include "lua/engine.h" +#include "repentogon/api.h" +#include "repentogon/api_game.h" +#include "repentogon/lua_render.h" #include "repentogon/options.h" constexpr const char* SCRIPTS_FOLDER = "repentogon/scripts/"; constexpr const char* ENUMS_SCRIPT = "enums_ex.lua"; constexpr const char* MAIN_SCRIPT = "main_ex.lua"; -constexpr const char* BINDINGS = "_CBindings"; constexpr const char* GLOBAL = "REPENTOGON"; constexpr const char* RUN_CALLBACK_TWO_PARAMS = "_RunCallbackWithTwoParams"; @@ -20,21 +22,27 @@ static int mod_error_raise(lua_State* state) return 0; } -// The main.lua path of the mod a table was registered for, nil for none. -static int mod_id_get(lua_State* state) +// The mod whose table is at index (LuaEngine::GetModRefByTable), null for none. +LuaMod* repentogon_mod_find(lua_State* state, int index) { - luaL_checktype(state, 1, LUA_TTABLE); + index = lua_absindex(state, index); for (LuaMod& mod : lua_engine_get().mods) { lua_rawgeti(state, LUA_REGISTRYINDEX, mod.tableRef); - bool isMod = lua_rawequal(state, 1, -1); + bool isMod = lua_rawequal(state, index, -1); lua_pop(state, 1); - if (!isMod) continue; - - lua_pushstring(state, mod.scriptPath.c_str()); - return 1; + if (isMod) return &mod; } - lua_pushnil(state); + return nullptr; +} + +// The main.lua path of the mod a table was registered for, nil for none. +static int mod_id_get(lua_State* state) +{ + if (!lua_istable(state, 1)) return luaL_argerror(state, 1, "Expected a table."); + LuaMod* mod = repentogon_mod_find(state, 1); + if (mod) lua_pushstring(state, mod->scriptPath.c_str()); + else lua_pushnil(state); return 1; } @@ -65,21 +73,20 @@ void repentogon_scripts_run(LuaEngine& engine) lua_pop(state, 1); } - lua_newtable(state); - for (auto [name, function] : {std::pair{"RaiseModError", mod_error_raise}, {"GetModId", mod_id_get}, - {"IsVanillaParity", vanilla_parity_get}}) - { - lua_pushcfunction(state, function); - lua_table_set(state, -2, name); - } + lua_namespace_begin(state, "_CBindings"); + lua_functions_add(state, {{"RaiseModError", mod_error_raise}, + {"GetModId", mod_id_get}, + {"IsVanillaParity", vanilla_parity_get}}); + internals_mod_data_register(state); lua_pushboolean(state, IS_REPENTOGON_EXPOSED); lua_table_set(state, -2, "IsExposed"); - lua_setglobal(state, BINDINGS); + lua_namespace_plain_end(state); + color_constructor_set(state); engine.RunScript(repentogon_script_path(ENUMS_SCRIPT)); engine.RunScript(repentogon_script_path(MAIN_SCRIPT)); lua_pushnil(state); - lua_setglobal(state, BINDINGS); + lua_setglobal(state, "_CBindings"); lua_getglobal(state, RUN_CALLBACK_TWO_PARAMS); engine.runCallbackTwoParamsRef = luaL_ref(state, LUA_REGISTRYINDEX); diff --git a/src/repentogon/repentogon.h b/src/repentogon/repentogon.h index 9cd54cc..42e66da 100644 --- a/src/repentogon/repentogon.h +++ b/src/repentogon/repentogon.h @@ -4,10 +4,16 @@ #include struct LuaEngine; +struct LuaMod; +struct lua_State; // Whether mods see the REPENTOGON global and its version. It stays off until the whole API is ported, which flips it. constexpr bool IS_REPENTOGON_EXPOSED = false; +// Whether the game started shutting down (REPENTOGON's Isaac.IsShuttingDown). +inline bool isShuttingDown = false; + std::string repentogon_script_path(std::string_view path); void repentogon_scripts_run(LuaEngine& engine); void mods_shutdown_notify(LuaEngine& engine); +LuaMod* repentogon_mod_find(lua_State* state, int index); diff --git a/src/repentogon/saves.h b/src/repentogon/saves.h index 02cdde7..c6c88ba 100644 --- a/src/repentogon/saves.h +++ b/src/repentogon/saves.h @@ -13,3 +13,6 @@ void backwards_rooms_post(int stage, BackwardsStageDesc& saved); bool completion_mark_hook(PersistentGameData& data, int counter, int num); bool completion_event_pre(int& completion); void save_slot_post(uint32_t slot); +bool challenge_is_completed(int challenge); +void challenge_completed_mark(int challenge); +void challenge_completion_reset(int challenge); diff --git a/src/repentogon/weapons.h b/src/repentogon/weapons.h index 1d1d559..6172331 100644 --- a/src/repentogon/weapons.h +++ b/src/repentogon/weapons.h @@ -1,12 +1,18 @@ #pragma once +#include "classes.h" #include +#include +#include struct Entity; +struct Entity_Familiar; struct Entity_Player; +struct Entity_Tear; +struct Weapon; +struct lua_State; struct Explosion; struct TearParams; -struct Vector; // A hit's tear effects as Entity_Tear::ApplyTearFlagEffects takes them. struct TearFlagHit @@ -31,3 +37,45 @@ bool explosion_damage_hook(const Explosion& explosion); bool explosion_tear_flag_effects_hook(const Explosion& explosion); bool tear_flag_effects_hook(TearFlagHit hit); void tear_hit_params_evaluate(Entity_Player& player, TearParams& params, TearHitQuery query); + +// A weapon as Lua holds it (REPENTOGON's WeaponData): the weapon, and the player slot or familiar it was taken from, +// which DestroyWeapon frees it through. +struct WeaponData +{ + Weapon* weapon = nullptr; + Entity_Familiar* familiar = nullptr; + Entity_Player* player = nullptr; + int slot = -1; +}; + +// Where a split tear goes (FireSplitTear's arguments): its position and velocity, its damage and size against the +// source's, and its variant. +struct SplitShot +{ + Vector position; + Vector velocity; + float damageMultiplier; + float sizeMultiplier; + int variant; +}; + +// What split a tear for MC_POST_FIRE_SPLIT_TEAR: a SplitTearType, or a mod's own name for it. +struct SplitTear +{ + std::string name; + int type = 0; +}; + +Entity_Tear* split_tear_fire(Entity& source, const SplitShot& shot, const SplitTear& split); +bool init_sound_play(const std::optional& initSound); +int familiar_weapon_get(lua_State* state); +void bomb_api_register(lua_State* state); +void knife_api_register(lua_State* state); +void laser_api_register(lua_State* state); +void projectile_api_register(lua_State* state); +void projectile_params_api_register(lua_State* state); +void tear_api_register(lua_State* state); +void tear_params_api_register(lua_State* state); +void weapon_classes_register(lua_State* state); +void isaac_weapons_register(lua_State* state); +void player_weapon_api_register(lua_State* state); diff --git a/src/ui/console_commands.cpp b/src/ui/console_commands.cpp index 870c564..25c1fac 100644 --- a/src/ui/console_commands.cpp +++ b/src/ui/console_commands.cpp @@ -29,6 +29,9 @@ #include "engine/seeds.h" #include "game/sfx_manager.h" #include "engine/texture_cache.h" +#ifdef ISAAC_REPENTOGON +#include "repentogon/api_game.h" +#endif #include #include #include @@ -765,7 +768,7 @@ static void clearcache_run(ConsoleCommand&) TextureCache::Purge(); } -// macro name, or m name: runs a fixed list of commands. lp enters the Lil Portal room, sg stage room goes to a stage +// macro name, or m name: runs a fixed list of commands, or one a mod registered. lp enters the Lil Portal room, sg stage room goes to a stage // and a default room, gb variant to a boss room and g variant to a default room. static void macro_run(ConsoleCommand& command) { @@ -782,6 +785,13 @@ static void macro_run(ConsoleCommand& command) for (std::string_view line : macro.commands) console.RunCommand(line); return; } +#ifdef ISAAC_REPENTOGON + if (const std::vector* commands = console_macro_find(name)) + { + for (const std::string& line : *commands) console.RunCommand(line); + return; + } +#endif if (name == "sg" && count > 3) { console.RunCommand("stage " + command.words[2]); @@ -1051,21 +1061,27 @@ const std::pair COMMANDS[] = { {"clear", clear_run}, {"fix_rng_history_log", fix_rng_history_log_run}}; -// The commands' names, as RunCommand knows them. +// The commands' names, as RunCommand knows them, and those mods registered with REPENTOGON's Console. std::vector command_names_get() { std::vector names; for (auto [name, run] : COMMANDS) names.push_back(name); +#ifdef ISAAC_REPENTOGON + console_command_names_add(names); +#endif return names; } -// The fixed macros' names. +// The fixed macros' names, and those mods registered with REPENTOGON's Console. std::vector macro_names_get() { std::vector names; for (const ConsoleMacro& macro : MACROS) names.push_back(macro.name); +#ifdef ISAAC_REPENTOGON + console_macro_names_add(names); +#endif return names; } diff --git a/src/ui/hud.cpp b/src/ui/hud.cpp index 379eb17..beb9e79 100644 --- a/src/ui/hud.cpp +++ b/src/ui/hud.cpp @@ -109,6 +109,10 @@ constexpr float HISTORY_ALPHA = 0.5f; constexpr float HISTORY_ERROR_ALPHA = 128 / 255.0f; constexpr uint32_t HISTORY_SPLIT_ARGB = 0x80808080; constexpr int HISTORY_TRINKET_KEY = 0x80000; +constexpr float HISTORY_RIGHT = 87; +constexpr float HISTORY_SHIFT_X = 24; +constexpr float HISTORY_SHIFT_Y = -14; +constexpr float HISTORY_GAP = 32; constexpr int HISTORY_GOLDEN_KEY = HISTORY_TRINKET_KEY | TRINKET_GOLDEN_FLAG; // The pickup counter rows, the run icons and the destination icon, as frames of hudpickups.anm2. @@ -548,7 +552,7 @@ void HistoryHUD::Render(Vector at, bool isMini) if (graphics.shader_push(isGolden ? COLOR_OFFSET_GOLD_SHADER : COLOR_OFFSET_DOGMA_SHADER)) pushed++; color._colorize[3] = (float)(g_manager->framecount / 2 % GOLD_SHIMMER_STEPS) / GOLD_SHIMMER_STEPS; } - bool isMonkeyPaw = icon.isTrinket && icon.historyId == TRINKET_MONKEY_PAW; + bool isMonkeyPaw = icon.historyItem.isTrinket && icon.historyItem.id == TRINKET_MONKEY_PAW; float frameX = isMonkeyPaw ? (float)(MONKEY_PAW_FRAMES - slot.player->monkeyPawCounter) * TRINKET_SIZE : 0; SourceQuad source = KAGE::Graphics::source_quad_rect(vector_make(frameX, 0), vector_make(TRINKET_SIZE, TRINKET_SIZE)); Vector shake = g_game->screenShakeOffset; @@ -563,7 +567,7 @@ void HistoryHUD::Render(Vector at, bool isMini) } else if (icon.image) { - int trinket = icon.isTrinket ? icon.historyId & TRINKET_ID_MASK : 0; + int trinket = icon.historyItem.isTrinket ? icon.historyItem.id & TRINKET_ID_MASK : 0; if (trinket == TRINKET_ERROR) tint = kcolor_rgba(ERROR_TRINKET_TINT[0], ERROR_TRINKET_TINT[1], ERROR_TRINKET_TINT[2], HISTORY_ERROR_ALPHA); else if (trinket == TRINKET_MODELING_CLAY) @@ -620,7 +624,7 @@ void HistoryHUD::Recompute(int playerIndex, HistoryRebuild rebuild) for (const HistoryItem& entry : std::views::reverse(slot.player->history.historyItems)) { - HistoryHUDItem icon{nullptr, entry.id, entry.id, entry.isTrinket}; + HistoryHUDItem icon{nullptr, entry, entry.id}; int trinket = entry.isTrinket ? entry.id : 0; if ((trinket & TRINKET_ID_MASK) == TRINKET_ERROR) trinket = error_trinket_disguise_get() | (entry.id & TRINKET_GOLDEN_FLAG); @@ -652,6 +656,46 @@ void HistoryHUD::Recompute(int playerIndex, HistoryRebuild rebuild) slot.isDirty = false; } +// The recent items' top left corner, under the minimap with the HUD offset. +Vector HistoryHUD::position_get() +{ + float offset = 1 - g_manager->optionsConfig.hudOffset; + Vector mapSize = g_game->minimap.GetDisplayedSize(); + return at_make(g_screenWidth - HISTORY_RIGHT + offset * HISTORY_SHIFT_X, + offset * HISTORY_SHIFT_Y + (mapSize.y + HISTORY_GAP)); +} + +// The columns of each player's recent items: half when a second player has a list. +int HistoryHUD::columns_get() +{ + bool isMini = g_manager->optionsConfig.historyHudMode == EXTRA_HUD_STYLE_ON_MINI; + int columns = isMini ? HISTORY_MINI_COLUMNS : HISTORY_COLUMNS; + return players[1].player ? columns / 2 : columns; +} + +// A recent item's icon size, half in the mini style. +float HistoryHUD::icon_size_get() +{ + return g_manager->optionsConfig.historyHudMode == EXTRA_HUD_STYLE_ON_MINI ? HISTORY_MINI_ICON : HISTORY_ICON; +} + +// How many of each player's recent items fit above the bottom of the screen. +int HistoryHUD::visible_items_get() +{ + float rows = std::ceil(((1 - g_manager->optionsConfig.hudOffset) * HISTORY_BOTTOM_SHIFT + + (g_screenHeight - HISTORY_BOTTOM_MARGIN) - position_get().y) / icon_size_get()); + return (int)rows * columns_get(); +} + +// Where a player's recent item draws from the list's corner. +Vector HistoryHUD::item_offset_get(int playerIndex, int index) +{ + int columns = columns_get(); + Vector offset = vector_scale(at_make((float)(index % columns), (float)(index / columns)), icon_size_get()); + if (players[1].player) offset.x += (float)playerIndex * HISTORY_LIST_STEP - HISTORY_SPLIT_SHIFT; + return offset; +} + // 0083b850 Drops the players whose slot no longer shows them, moving the next one up, then has each player's recent // items rebuilt or marked for it. Tainted Lazarus's other form is marked too when it has a slot. void HistoryHUD::RecomputeAll(HistoryRebuild rebuild) @@ -872,6 +916,17 @@ void HUD::FlashChargeBar(Entity_Player* player, int activeSlot) } } +// Flashes a player's red hearts (REPENTOGON's HUD::FlashRedHearts, inlined in the game where healing flashes them). +void HUD::FlashRedHearts(Entity_Player* player) +{ + for (PlayerHUD& hud : playerHUD) + if (hud.player == player) + { + hud.redHeartFlashCountdown = HUD_HEART_FLASH_FRAMES; + return; + } +} + // 009a2c00 Has a player's active slot, or all of them for a negative slot, reload its item. void HUD::InvalidateActiveItem(Entity_Player* player, int activeSlot) { @@ -1120,15 +1175,7 @@ void HUD::Render() OptionsConfig& options = g_manager->optionsConfig; if (options.historyHudMode > EXTRA_HUD_STYLE_OFF && !isHomeDungeon) { - constexpr float HISTORY_RIGHT = 87; - constexpr float HISTORY_SHIFT_X = 24; - constexpr float HISTORY_SHIFT_Y = -14; - constexpr float HISTORY_GAP = 32; - float offset = 1 - options.hudOffset; - Vector mapSize = game.minimap.GetDisplayedSize(); - Vector at = at_make(g_screenWidth - HISTORY_RIGHT + offset * HISTORY_SHIFT_X, - offset * HISTORY_SHIFT_Y + (mapSize.y + HISTORY_GAP)); - historyHUD.Render(at, options.historyHudMode == EXTRA_HUD_STYLE_ON_MINI); + historyHUD.Render(historyHUD.position_get(), options.historyHudMode == EXTRA_HUD_STYLE_ON_MINI); } if (!game.deathmatchManager.is_active()) diff --git a/src/ui/hud.h b/src/ui/hud.h index 88fb83e..202abab 100644 --- a/src/ui/hud.h +++ b/src/ui/hud.h @@ -6,6 +6,7 @@ #include "ui/item_info_hud.h" #include "engine/kage_graphics.h" #include "entity/player/hud.h" +#include "entity/player/player.h" #include "ui/rich_text.h" #include "ui/stat_hud.h" #include @@ -82,13 +83,12 @@ struct HUD_Message }; // An item of the recent items list: its icon, the key the icon is kept by between rebuilds (a collectible id, a trinket -// id with HISTORY_TRINKET_KEY, or a glitched item's negative id), and the history entry's item. +// id with HISTORY_TRINKET_KEY, or a glitched item's negative id), and a copy of the history entry it shows. struct HistoryHUDItem { KAGE::Graphics::ImagePtr image; - int historyId = 0; + HistoryItem historyItem; int key = 0; - bool isTrinket = false; }; // The recent items of one player and whether they need recomputing. @@ -110,6 +110,11 @@ struct HistoryHUD void Recompute(int playerIndex, HistoryRebuild rebuild); void RecomputeAll(HistoryRebuild rebuild); int player_slot_get(Entity_Player* player); + Vector position_get(); + int columns_get(); + float icon_size_get(); + int visible_items_get(); + Vector item_offset_get(int playerIndex, int index); }; // A character's icon of the co-op menu sheet, centered on a position at a scale, outlined in a color's tint (the color @@ -190,6 +195,7 @@ public: void FlashChargeBar(Entity_Player* player, int activeSlot); void InvalidateActiveItem(Entity_Player* player, int activeSlot); void InvalidateCraftingItem(Entity_Player* player); + void FlashRedHearts(Entity_Player* player); void mark_all_slots_dirty(HistoryRebuild rebuild, HistoryClear clearing); void SetVisible(bool isShown); bool IsVisible(); diff --git a/src/ui/menu/character.cpp b/src/ui/menu/character.cpp index 1f616b8..99fc2d0 100644 --- a/src/ui/menu/character.cpp +++ b/src/ui/menu/character.cpp @@ -301,6 +301,12 @@ void menu_color_mod_lerp(const ColorModState& target, float rate) menus.isColorModLerping = true; } +// A game character of a menu's wheel, by menu id below CHARACTER_ENTRY_COUNT. +const Menu_Character_Entry& character_entry_get(CharacterMenu menu, int menuId) +{ + return CHARACTER_ENTRIES[menu][menuId]; +} + // 00946cd0 Whether the entry's character can be picked. bool Menu_Character_Entry::IsCharacterAvailable() const { diff --git a/src/ui/menu/character.h b/src/ui/menu/character.h index 2570f2b..6dd60fa 100644 --- a/src/ui/menu/character.h +++ b/src/ui/menu/character.h @@ -163,4 +163,5 @@ private: }; void menu_color_mod_lerp(const ColorModState& target, float rate); +const Menu_Character_Entry& character_entry_get(CharacterMenu menu, int menuId); void portrait_order_sort(std::vector& order, int low, int high); diff --git a/src/ui/menu/save.cpp b/src/ui/menu/save.cpp index c4180e6..0775573 100644 --- a/src/ui/menu/save.cpp +++ b/src/ui/menu/save.cpp @@ -4,6 +4,9 @@ #include "game/manager.h" #include "ui/menu/manager.h" #include "game/persistent_game_data.h" +#ifdef ISAAC_REPENTOGON +#include "repentogon/menus.h" +#endif #include #include #include @@ -520,6 +523,7 @@ void Menu_Save::Render() // 009db2d0 Puts a file's drawing on the sheet its progress earns, the current save file being that file: Dead God, // the Beast, Dogma, Mother and on down to the Basement, with the photo and negative pieces and the heart pieces shown. +// A mod's SaveMenu.SetSlotSpritesheet replaces it after. void Menu_Save::replace_slot_graphics(ANM2& sprite) { PersistentGameData& data = g_manager->persistentGameData; @@ -560,6 +564,9 @@ void Menu_Save::replace_slot_graphics(ANM2& sprite) if (negative) sprite.ReplaceSpritesheet(NEGATIVE_LAYER, std::string(DRAWING_FOLDER) + negative); sprite.GetLayer(NEGATIVE_LAYER)->isVisible = negative != nullptr; for (unsigned int i = 0; i < HEART_PIECES; i++) sprite.GetLayer(HEART_FIRST_LAYER + (int)i)->isVisible = i < heartPieces; +#ifdef ISAAC_REPENTOGON + save_slot_sprite_replace(sprite); +#endif } // 009db850 Steps the sprites every other frame, dims the delete button while a file is being picked for deletion,