isaacscript-common 1.0.498 → 1.0.499
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/callbacks/customRevive.lua +9 -5
- package/dist/callbacks/itemPickup.lua +9 -5
- package/dist/callbacks/postBombInitLate.lua +5 -3
- package/dist/callbacks/postCursedTeleport.lua +5 -3
- package/dist/callbacks/postEffectInitLate.lua +5 -3
- package/dist/callbacks/postEsauJr.lua +9 -5
- package/dist/callbacks/postFamiliarInitLate.lua +5 -3
- package/dist/callbacks/postFlip.lua +9 -5
- package/dist/callbacks/postGridEntity.lua +13 -7
- package/dist/callbacks/postKnifeInitLate.lua +5 -3
- package/dist/callbacks/postLaserInitLate.lua +5 -3
- package/dist/callbacks/postNPCInitLate.lua +5 -3
- package/dist/callbacks/postPickupCollect.lua +5 -3
- package/dist/callbacks/postPickupInitLate.lua +5 -3
- package/dist/callbacks/postPlayerChangeHealth.lua +5 -3
- package/dist/callbacks/postPlayerChangeType.lua +5 -3
- package/dist/callbacks/postPlayerFatalDamage.lua +5 -3
- package/dist/callbacks/postPlayerInitLate.lua +5 -3
- package/dist/callbacks/postPlayerReordered.lua +16 -10
- package/dist/callbacks/postProjectileInitLate.lua +5 -3
- package/dist/callbacks/postPurchase.lua +11 -3
- package/dist/callbacks/postSacrifice.lua +5 -3
- package/dist/callbacks/postSlotInitUpdate.lua +9 -5
- package/dist/callbacks/postSlotRenderBroken.lua +9 -5
- package/dist/callbacks/postTearInitLate.lua +5 -3
- package/dist/callbacks/postTransformation.lua +5 -3
- package/dist/callbacks/reorderedCallbacks.lua +18 -12
- package/dist/callbacks/subscriptions/postBombInitLate.d.ts +3 -3
- package/dist/callbacks/subscriptions/postBombInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postCursedTeleport.d.ts +3 -3
- package/dist/callbacks/subscriptions/postCursedTeleport.lua +3 -3
- package/dist/callbacks/subscriptions/postCustomRevive.d.ts +3 -3
- package/dist/callbacks/subscriptions/postCustomRevive.lua +3 -3
- package/dist/callbacks/subscriptions/postEffectInitLate.d.ts +3 -3
- package/dist/callbacks/subscriptions/postEffectInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postEsauJr.d.ts +3 -3
- package/dist/callbacks/subscriptions/postEsauJr.lua +3 -3
- package/dist/callbacks/subscriptions/postFamiliarInitLate.d.ts +3 -3
- package/dist/callbacks/subscriptions/postFamiliarInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postFirstEsauJr.d.ts +3 -3
- package/dist/callbacks/subscriptions/postFirstEsauJr.lua +3 -3
- package/dist/callbacks/subscriptions/postFirstFlip.d.ts +3 -3
- package/dist/callbacks/subscriptions/postFirstFlip.lua +3 -3
- package/dist/callbacks/subscriptions/postFlip.d.ts +3 -3
- package/dist/callbacks/subscriptions/postFlip.lua +3 -3
- package/dist/callbacks/subscriptions/postGameStartedReordered.d.ts +3 -3
- package/dist/callbacks/subscriptions/postGameStartedReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postGridEntityInit.d.ts +3 -3
- package/dist/callbacks/subscriptions/postGridEntityInit.lua +3 -3
- package/dist/callbacks/subscriptions/postGridEntityRemove.d.ts +3 -3
- package/dist/callbacks/subscriptions/postGridEntityRemove.lua +3 -3
- package/dist/callbacks/subscriptions/postGridEntityUpdate.d.ts +3 -3
- package/dist/callbacks/subscriptions/postGridEntityUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postItemPickup.d.ts +3 -3
- package/dist/callbacks/subscriptions/postItemPickup.lua +3 -3
- package/dist/callbacks/subscriptions/postKnifeInitLate.d.ts +3 -3
- package/dist/callbacks/subscriptions/postKnifeInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postLaserInitLate.d.ts +3 -3
- package/dist/callbacks/subscriptions/postLaserInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postNPCInitLate.d.ts +3 -3
- package/dist/callbacks/subscriptions/postNPCInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postNewLevelReordered.d.ts +3 -3
- package/dist/callbacks/subscriptions/postNewLevelReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postNewRoomReordered.d.ts +3 -3
- package/dist/callbacks/subscriptions/postNewRoomReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postPickupCollect.d.ts +3 -3
- package/dist/callbacks/subscriptions/postPickupCollect.lua +3 -3
- package/dist/callbacks/subscriptions/postPickupInitLate.d.ts +3 -3
- package/dist/callbacks/subscriptions/postPickupInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.d.ts +3 -3
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerChangeType.d.ts +3 -3
- package/dist/callbacks/subscriptions/postPlayerChangeType.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerFatalDamage.d.ts +3 -3
- package/dist/callbacks/subscriptions/postPlayerFatalDamage.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerInitLate.d.ts +3 -3
- package/dist/callbacks/subscriptions/postPlayerInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerInitReordered.d.ts +3 -3
- package/dist/callbacks/subscriptions/postPlayerInitReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerRenderReordered.d.ts +3 -3
- package/dist/callbacks/subscriptions/postPlayerRenderReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerUpdateReordered.d.ts +3 -3
- package/dist/callbacks/subscriptions/postPlayerUpdateReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postProjectileInitLate.d.ts +3 -3
- package/dist/callbacks/subscriptions/postProjectileInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postPurchase.d.ts +3 -3
- package/dist/callbacks/subscriptions/postPurchase.lua +3 -3
- package/dist/callbacks/subscriptions/postSacrifice.d.ts +3 -3
- package/dist/callbacks/subscriptions/postSacrifice.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotDestroyed.d.ts +3 -3
- package/dist/callbacks/subscriptions/postSlotDestroyed.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotInit.d.ts +3 -3
- package/dist/callbacks/subscriptions/postSlotInit.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotRender.d.ts +3 -3
- package/dist/callbacks/subscriptions/postSlotRender.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotUpdate.d.ts +3 -3
- package/dist/callbacks/subscriptions/postSlotUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postTearInitLate.d.ts +3 -3
- package/dist/callbacks/subscriptions/postTearInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postTransformation.d.ts +3 -3
- package/dist/callbacks/subscriptions/postTransformation.lua +3 -3
- package/dist/callbacks/subscriptions/preCustomRevive.d.ts +3 -3
- package/dist/callbacks/subscriptions/preCustomRevive.lua +3 -3
- package/dist/callbacks/subscriptions/preItemPickup.d.ts +3 -3
- package/dist/callbacks/subscriptions/preItemPickup.lua +3 -3
- package/dist/constants.d.ts +18 -8
- package/dist/constants.lua +10 -8
- package/dist/features/getCollectibleItemPoolType.lua +5 -22
- package/dist/functions/collectibles.d.ts +20 -1
- package/dist/functions/collectibles.lua +18 -4
- package/dist/functions/gridEntity.d.ts +2 -3
- package/dist/functions/gridEntity.lua +3 -1
- package/dist/functions/rooms.d.ts +1 -2
- package/dist/functions/rooms.lua +3 -5
- package/dist/functions/sprite.d.ts +11 -0
- package/dist/functions/sprite.lua +9 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.lua +0 -8
- package/dist/types/ModUpgraded.lua +234 -78
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
export declare type PreCustomReviveCallbackType = (player: EntityPlayer) => int | void;
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
3
|
+
export declare function preCustomReviveHasSubscriptions(): boolean;
|
|
4
|
+
export declare function preCustomReviveRegister(callback: PreCustomReviveCallbackType): void;
|
|
5
|
+
export declare function preCustomReviveFire(player: EntityPlayer): int | void;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
require("lualib_bundle");
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local subscriptions = {}
|
|
5
|
-
function ____exports.
|
|
5
|
+
function ____exports.preCustomReviveHasSubscriptions(self)
|
|
6
6
|
return #subscriptions > 0
|
|
7
7
|
end
|
|
8
|
-
function ____exports.
|
|
8
|
+
function ____exports.preCustomReviveRegister(self, callback)
|
|
9
9
|
__TS__ArrayPush(subscriptions, {callback})
|
|
10
10
|
end
|
|
11
|
-
function ____exports.
|
|
11
|
+
function ____exports.preCustomReviveFire(self, player)
|
|
12
12
|
local callback
|
|
13
13
|
for ____, ____value in ipairs(subscriptions) do
|
|
14
14
|
callback = ____value[1]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
2
|
import { PickingUpItem } from "../../types/PickingUpItem";
|
|
3
3
|
export declare type PreItemPickupCallbackType = (player: EntityPlayer, pickingUpItem: PickingUpItem) => void;
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
4
|
+
export declare function preItemPickupHasSubscriptions(): boolean;
|
|
5
|
+
export declare function preItemPickupRegister(callback: PreItemPickupCallbackType, itemType?: ItemType, itemID?: int): void;
|
|
6
|
+
export declare function preItemPickupFire(player: EntityPlayer, pickingUpItem: PickingUpItem): void;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
require("lualib_bundle");
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local subscriptions = {}
|
|
5
|
-
function ____exports.
|
|
5
|
+
function ____exports.preItemPickupHasSubscriptions(self)
|
|
6
6
|
return #subscriptions > 0
|
|
7
7
|
end
|
|
8
|
-
function ____exports.
|
|
8
|
+
function ____exports.preItemPickupRegister(self, callback, itemType, itemID)
|
|
9
9
|
__TS__ArrayPush(subscriptions, {callback, itemType, itemID})
|
|
10
10
|
end
|
|
11
|
-
function ____exports.
|
|
11
|
+
function ____exports.preItemPickupFire(self, player, pickingUpItem)
|
|
12
12
|
local itemID
|
|
13
13
|
local itemType
|
|
14
14
|
local callback
|
package/dist/constants.d.ts
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
* For more info, see the documentation for the `getAzazelBrimstoneDistance()` function.
|
|
5
5
|
*/
|
|
6
6
|
export declare const AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125;
|
|
7
|
+
/**
|
|
8
|
+
* The path to the png file for collectible items during Curse of the Blind, making them appear with
|
|
9
|
+
* a red question mark.
|
|
10
|
+
*/
|
|
11
|
+
export declare const BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png";
|
|
7
12
|
/** Bombs explode when their frame count is equal to this value. */
|
|
8
13
|
export declare const BOMB_EXPLODE_FRAME = 45;
|
|
9
14
|
export declare const CHARACTERS_WITH_AN_ACTIVE_ITEM: Set<PlayerType>;
|
|
@@ -22,14 +27,14 @@ export declare const CHARACTERS_WITH_NO_SOUL_HEARTS: Set<PlayerType>;
|
|
|
22
27
|
* colors, you should copy them first with the `copyColor` function.
|
|
23
28
|
*/
|
|
24
29
|
export declare const COLORS: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
Black: Color;
|
|
31
|
+
Red: Color;
|
|
32
|
+
Green: Color;
|
|
33
|
+
Blue: Color;
|
|
34
|
+
Yellow: Color;
|
|
35
|
+
Pink: Color;
|
|
36
|
+
Cyan: Color;
|
|
37
|
+
White: Color;
|
|
33
38
|
};
|
|
34
39
|
export declare const DEFAULT_ITEM_POOL_TYPE = ItemPoolType.POOL_TREASURE;
|
|
35
40
|
/** This is also the distance that a player spawns from the door that they enter a room from. */
|
|
@@ -41,6 +46,11 @@ export declare const DOOR_HITBOX_DISTANCE = 11;
|
|
|
41
46
|
* value.
|
|
42
47
|
*/
|
|
43
48
|
export declare const EGGY_STATE_FRAME_OF_FINAL_SPIDER = 45;
|
|
49
|
+
/**
|
|
50
|
+
* A non-existent or completely transparent PNG file for use in clearing sprites. For more
|
|
51
|
+
* information, see the documentation for the `clearSprite()` helper function.
|
|
52
|
+
*/
|
|
53
|
+
export declare const EMPTY_PNG_PATH = "gfx/none.png";
|
|
44
54
|
/** As of Repentance, the final stage is floor 13 (which is the Home floor). */
|
|
45
55
|
export declare const FINAL_STAGE: number;
|
|
46
56
|
/**
|
package/dist/constants.lua
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
require("lualib_bundle");
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
____exports.AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125
|
|
5
|
+
____exports.BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png"
|
|
5
6
|
____exports.BOMB_EXPLODE_FRAME = 45
|
|
6
7
|
____exports.CHARACTERS_WITH_AN_ACTIVE_ITEM = __TS__New(Set, {
|
|
7
8
|
PlayerType.PLAYER_ISAAC,
|
|
@@ -34,19 +35,20 @@ ____exports.CHARACTERS_WITH_NO_SOUL_HEARTS = __TS__New(Set, {
|
|
|
34
35
|
PlayerType.PLAYER_KEEPER_B
|
|
35
36
|
})
|
|
36
37
|
____exports.COLORS = {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
Black = Color(1, 1, 1),
|
|
39
|
+
Red = Color(1, 0, 0),
|
|
40
|
+
Green = Color(0, 1, 0),
|
|
41
|
+
Blue = Color(0, 0, 1),
|
|
42
|
+
Yellow = Color(1, 1, 0),
|
|
43
|
+
Pink = Color(1, 0, 1),
|
|
44
|
+
Cyan = Color(0, 1, 1),
|
|
45
|
+
White = Color(1, 1, 1)
|
|
45
46
|
}
|
|
46
47
|
____exports.DEFAULT_ITEM_POOL_TYPE = ItemPoolType.POOL_TREASURE
|
|
47
48
|
____exports.DISTANCE_OF_GRID_TILE = 40
|
|
48
49
|
____exports.DOOR_HITBOX_DISTANCE = 11
|
|
49
50
|
____exports.EGGY_STATE_FRAME_OF_FINAL_SPIDER = 45
|
|
51
|
+
____exports.EMPTY_PNG_PATH = "gfx/none.png"
|
|
50
52
|
____exports.FINAL_STAGE = LevelStage.NUM_STAGES - 1
|
|
51
53
|
____exports.FIRST_GLITCHED_COLLECTIBLE_TYPE = (1 << 32) - 1
|
|
52
54
|
____exports.GENESIS_ROOM_VARIANT = 1000
|
|
@@ -1,35 +1,19 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
require("lualib_bundle");
|
|
3
3
|
local ____exports = {}
|
|
4
|
-
local postPickupInitCollectible,
|
|
4
|
+
local postPickupInitCollectible, v
|
|
5
5
|
local ____errors = require("errors")
|
|
6
6
|
local getUpgradeErrorMsg = ____errors.getUpgradeErrorMsg
|
|
7
|
-
local ____array = require("functions.array")
|
|
8
|
-
local arrayEmpty = ____array.arrayEmpty
|
|
9
7
|
local ____rooms = require("functions.rooms")
|
|
10
|
-
local getRoomIndex = ____rooms.getRoomIndex
|
|
11
8
|
local getRoomItemPoolType = ____rooms.getRoomItemPoolType
|
|
12
|
-
local getRoomVisitedCount = ____rooms.getRoomVisitedCount
|
|
13
9
|
local ____exports = require("features.saveDataManager.exports")
|
|
14
10
|
local saveDataManager = ____exports.saveDataManager
|
|
15
11
|
function postPickupInitCollectible(self, pickup)
|
|
16
|
-
local
|
|
17
|
-
|
|
18
|
-
return
|
|
19
|
-
end
|
|
12
|
+
local game = Game()
|
|
13
|
+
local itemPool = game:GetItemPool()
|
|
20
14
|
local ptrHash = GetPtrHash(pickup)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
function preGetCollectible(self, itemPoolType, _decrease, _seed)
|
|
24
|
-
local roomIndex = getRoomIndex(nil)
|
|
25
|
-
local roomVisitedCount = getRoomVisitedCount(nil)
|
|
26
|
-
if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
|
|
27
|
-
v.run.currentRoomIndex = roomIndex
|
|
28
|
-
v.run.currentRoomVisitedCount = roomVisitedCount
|
|
29
|
-
arrayEmpty(nil, v.run.collectibleQueue)
|
|
30
|
-
v.run.collectibleItemPoolTypeMap:clear()
|
|
31
|
-
end
|
|
32
|
-
__TS__ArrayPush(v.run.collectibleQueue, itemPoolType)
|
|
15
|
+
local lastItemPoolType = itemPool:GetLastPool()
|
|
16
|
+
v.run.collectibleItemPoolTypeMap:set(ptrHash, lastItemPoolType)
|
|
33
17
|
end
|
|
34
18
|
local FEATURE_NAME = "get collectible item pool type"
|
|
35
19
|
local initialized = false
|
|
@@ -43,7 +27,6 @@ function ____exports.getCollectibleItemPoolTypeInit(self, mod)
|
|
|
43
27
|
initialized = true
|
|
44
28
|
saveDataManager(nil, "getCollectibleItemPoolType", v)
|
|
45
29
|
mod:AddCallback(ModCallbacks.MC_POST_PICKUP_INIT, postPickupInitCollectible, PickupVariant.PICKUP_COLLECTIBLE)
|
|
46
|
-
mod:AddCallback(ModCallbacks.MC_PRE_GET_COLLECTIBLE, preGetCollectible)
|
|
47
30
|
end
|
|
48
31
|
function ____exports.getCollectibleItemPoolType(self, collectible)
|
|
49
32
|
if not initialized then
|
|
@@ -84,7 +84,26 @@ export declare function removeCollectiblePickupDelay(collectible: EntityPickup):
|
|
|
84
84
|
*/
|
|
85
85
|
export declare function removeCollectibleFromItemTracker(collectibleType: CollectibleType | int): void;
|
|
86
86
|
export declare function setCollectibleBlind(collectible: EntityPickup): void;
|
|
87
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Helper function to remove the collectible from a collectible pedestal and make it appear as if a
|
|
89
|
+
* player has already taken the item. This is accomplished by setting its sprite to an empty/missing
|
|
90
|
+
* PNG file.
|
|
91
|
+
*
|
|
92
|
+
* For more information, see the documentation for the "EMPTY_PNG_FILENAME" constant.
|
|
93
|
+
*/
|
|
94
|
+
export declare function setCollectibleEmpty(collectible: EntityPickup): void;
|
|
95
|
+
/**
|
|
96
|
+
* Helper function to change the sprite of a collectible pedestal entity.
|
|
97
|
+
*
|
|
98
|
+
* For more information about removing the collectible sprite, see the documentation for the
|
|
99
|
+
* "EMPTY_PNG_FILENAME" constant.
|
|
100
|
+
*
|
|
101
|
+
* @param collectible The collectible whose sprite you want to modify.
|
|
102
|
+
* @param pngPath Optional. Equal to the spritesheet path to load (e.g.
|
|
103
|
+
* "gfx/items/collectibles/collectibles_001_thesadonion.png"). If not specified, will remove the
|
|
104
|
+
* sprite, making it appear like the collectible has already been taken by the player.
|
|
105
|
+
*/
|
|
106
|
+
export declare function setCollectibleSprite(collectible: EntityPickup, pngPath?: string): void;
|
|
88
107
|
/**
|
|
89
108
|
* Helper function to change the collectible on a pedestal. Simply updating the SubType property is
|
|
90
109
|
* not sufficient because the sprite will not change.
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
require("lualib_bundle");
|
|
3
3
|
local ____exports = {}
|
|
4
|
-
local COLLECTIBLE_SPRITE_LAYER
|
|
4
|
+
local COLLECTIBLE_SPRITE_LAYER, COLLECTIBLE_SHADOW_LAYER
|
|
5
5
|
local ____constants = require("constants")
|
|
6
|
+
local BLIND_ITEM_PNG_PATH = ____constants.BLIND_ITEM_PNG_PATH
|
|
6
7
|
local SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES = ____constants.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES
|
|
7
8
|
local ____collectibleDescriptionMap = require("maps.collectibleDescriptionMap")
|
|
8
9
|
local COLLECTIBLE_DESCRIPTION_MAP = ____collectibleDescriptionMap.COLLECTIBLE_DESCRIPTION_MAP
|
|
@@ -10,16 +11,22 @@ local ____collectibleNameMap = require("maps.collectibleNameMap")
|
|
|
10
11
|
local COLLECTIBLE_NAME_MAP = ____collectibleNameMap.COLLECTIBLE_NAME_MAP
|
|
11
12
|
local ____entity = require("functions.entity")
|
|
12
13
|
local removeAllPickups = ____entity.removeAllPickups
|
|
14
|
+
local ____sprite = require("functions.sprite")
|
|
15
|
+
local clearSprite = ____sprite.clearSprite
|
|
13
16
|
function ____exports.setCollectibleSprite(self, collectible, pngPath)
|
|
14
17
|
if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
|
|
15
18
|
error("You cannot set a collectible sprite for pickups of variant: " .. tostring(collectible.Variant))
|
|
16
19
|
end
|
|
17
20
|
local sprite = collectible:GetSprite()
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
if pngPath == nil then
|
|
22
|
+
clearSprite(nil, sprite, COLLECTIBLE_SPRITE_LAYER, COLLECTIBLE_SHADOW_LAYER)
|
|
23
|
+
else
|
|
24
|
+
sprite:ReplaceSpritesheet(COLLECTIBLE_SPRITE_LAYER, pngPath)
|
|
25
|
+
sprite:LoadGraphics()
|
|
26
|
+
end
|
|
20
27
|
end
|
|
21
28
|
COLLECTIBLE_SPRITE_LAYER = 1
|
|
22
|
-
|
|
29
|
+
COLLECTIBLE_SHADOW_LAYER = 4
|
|
23
30
|
local GLITCHED_ITEM_THRESHOLD = 4000000000
|
|
24
31
|
function ____exports.collectibleHasTag(self, collectibleType, tag)
|
|
25
32
|
local itemConfig = Isaac.GetItemConfig()
|
|
@@ -160,6 +167,13 @@ function ____exports.setCollectibleBlind(self, collectible)
|
|
|
160
167
|
end
|
|
161
168
|
____exports.setCollectibleSprite(nil, collectible, BLIND_ITEM_PNG_PATH)
|
|
162
169
|
end
|
|
170
|
+
function ____exports.setCollectibleEmpty(self, collectible)
|
|
171
|
+
if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
|
|
172
|
+
error("You cannot set a collectible to be empty for pickups of variant: " .. tostring(collectible.Variant))
|
|
173
|
+
end
|
|
174
|
+
collectible.SubType = CollectibleType.COLLECTIBLE_NULL
|
|
175
|
+
____exports.setCollectibleSprite(nil, collectible)
|
|
176
|
+
end
|
|
163
177
|
function ____exports.setCollectibleSubType(self, collectible, newCollectibleType)
|
|
164
178
|
if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
|
|
165
179
|
error("You cannot set a collectible sub type for pickups of variant: " .. tostring(collectible.Variant))
|
|
@@ -78,10 +78,9 @@ export declare function removeAllMatchingGridEntities(...gridEntityType: GridEnt
|
|
|
78
78
|
export declare function removeGridEntity(gridEntity: GridEntity, updateRoom?: boolean): void;
|
|
79
79
|
/**
|
|
80
80
|
* Helper function to make a grid entity invisible. This is accomplished by setting its sprite to
|
|
81
|
-
*
|
|
81
|
+
* an empty/missing PNG file.
|
|
82
82
|
*
|
|
83
|
-
*
|
|
84
|
-
* create a transparent 1 pixel PNG file in your resources folder at "gfx/none.png".
|
|
83
|
+
* For more information, see the documentation for the "EMPTY_PNG_FILENAME" constant.
|
|
85
84
|
*/
|
|
86
85
|
export declare function setGridEntityInvisible(gridEntity: GridEntity): void;
|
|
87
86
|
export declare function spawnGiantPoop(topLeftGridIndex: int): void;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
require("lualib_bundle");
|
|
3
3
|
local ____exports = {}
|
|
4
|
+
local ____constants = require("constants")
|
|
5
|
+
local EMPTY_PNG_PATH = ____constants.EMPTY_PNG_PATH
|
|
4
6
|
local ____gridEntityXMLMap = require("maps.gridEntityXMLMap")
|
|
5
7
|
local GRID_ENTITY_XML_MAP = ____gridEntityXMLMap.GRID_ENTITY_XML_MAP
|
|
6
8
|
local ____rooms = require("functions.rooms")
|
|
@@ -139,7 +141,7 @@ function ____exports.removeAllMatchingGridEntities(self, ...)
|
|
|
139
141
|
end
|
|
140
142
|
function ____exports.setGridEntityInvisible(self, gridEntity)
|
|
141
143
|
local sprite = gridEntity:GetSprite()
|
|
142
|
-
sprite:ReplaceSpritesheet(0,
|
|
144
|
+
sprite:ReplaceSpritesheet(0, EMPTY_PNG_PATH)
|
|
143
145
|
sprite:LoadGraphics()
|
|
144
146
|
end
|
|
145
147
|
function ____exports.spawnGiantPoop(self, topLeftGridIndex)
|
|
@@ -38,8 +38,7 @@ export declare function getRoomIndex(): int;
|
|
|
38
38
|
export declare function getRoomIndexesForType(roomType: RoomType): Set<int>;
|
|
39
39
|
/**
|
|
40
40
|
* Helper function to get the item pool type for the current room. For example, this returns
|
|
41
|
-
* `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
|
|
42
|
-
* `DEFAULT_ITEM_POOL_TYPE` if there is no particular pool associated with the current room type.
|
|
41
|
+
* `ItemPoolType.ItemPoolType.POOL_ANGEL` if you are in an Angel Room.
|
|
43
42
|
*/
|
|
44
43
|
export declare function getRoomItemPoolType(): ItemPoolType;
|
|
45
44
|
/**
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
require("lualib_bundle");
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local ____constants = require("constants")
|
|
5
|
-
local DEFAULT_ITEM_POOL_TYPE = ____constants.DEFAULT_ITEM_POOL_TYPE
|
|
6
5
|
local GENESIS_ROOM_SUBTYPE = ____constants.GENESIS_ROOM_SUBTYPE
|
|
7
6
|
local GENESIS_ROOM_VARIANT = ____constants.GENESIS_ROOM_VARIANT
|
|
8
7
|
local MAX_ROOM_INDEX = ____constants.MAX_ROOM_INDEX
|
|
9
|
-
local ____roomTypeToItemPoolMap = require("maps.roomTypeToItemPoolMap")
|
|
10
|
-
local ROOM_TYPE_TO_ITEM_POOL_TYPE_MAP = ____roomTypeToItemPoolMap.ROOM_TYPE_TO_ITEM_POOL_TYPE_MAP
|
|
11
8
|
local ____doors = require("functions.doors")
|
|
12
9
|
local closeAllDoors = ____doors.closeAllDoors
|
|
13
10
|
local getDoors = ____doors.getDoors
|
|
@@ -84,10 +81,11 @@ function ____exports.getRoomIndexesForType(self, roomType)
|
|
|
84
81
|
end
|
|
85
82
|
function ____exports.getRoomItemPoolType(self)
|
|
86
83
|
local game = Game()
|
|
84
|
+
local itemPool = game:GetItemPool()
|
|
87
85
|
local room = game:GetRoom()
|
|
88
86
|
local roomType = room:GetType()
|
|
89
|
-
local
|
|
90
|
-
return
|
|
87
|
+
local roomSeed = room:GetSpawnSeed()
|
|
88
|
+
return itemPool:GetPoolForRoom(roomType, roomSeed)
|
|
91
89
|
end
|
|
92
90
|
function ____exports.getRoomName(self)
|
|
93
91
|
local roomData = ____exports.getRoomData(nil)
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to clear a specific layer from a sprite. This function is variadic, so pass as
|
|
4
|
+
* many layer IDs as you want to clear.
|
|
5
|
+
*
|
|
6
|
+
* Since there is no official API method to "clear" a sprite, we can work around it by setting the
|
|
7
|
+
* spritesheet to a non-existent or completely transparent file. If the path to the spritesheet does
|
|
8
|
+
* not exist, then this function might cause spurious errors to appear in the "log.txt file". To
|
|
9
|
+
* silence these errors, create a transparent 1 pixel PNG file in your mod's resources folder at the
|
|
10
|
+
* path corresponding to the "EMPTY_PNG_PATH" constant.
|
|
11
|
+
*/
|
|
12
|
+
export declare function clearSprite(sprite: Sprite, ...layerIDs: int[]): void;
|
|
2
13
|
/**
|
|
3
14
|
* Helper function that returns the number of the final frame in a particular animation for a
|
|
4
15
|
* sprite. By default, it will use the currently playing animation, but you can also specify a
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
local ____exports = {}
|
|
3
|
+
local ____constants = require("constants")
|
|
4
|
+
local EMPTY_PNG_PATH = ____constants.EMPTY_PNG_PATH
|
|
5
|
+
function ____exports.clearSprite(self, sprite, ...)
|
|
6
|
+
local layerIDs = {...}
|
|
7
|
+
for ____, layerID in ipairs(layerIDs) do
|
|
8
|
+
sprite:ReplaceSpritesheet(layerID, EMPTY_PNG_PATH)
|
|
9
|
+
end
|
|
10
|
+
sprite:LoadGraphics()
|
|
11
|
+
end
|
|
3
12
|
function ____exports.getFinalFrameOfAnimation(self, sprite, animation)
|
|
4
13
|
local currentAnimation = sprite:GetAnimation()
|
|
5
14
|
local currentFrame = sprite:GetFrame()
|
package/dist/index.d.ts
CHANGED
|
@@ -52,7 +52,6 @@ export * from "./maps/cardNameMap";
|
|
|
52
52
|
export * from "./maps/collectibleNameMap";
|
|
53
53
|
export * from "./maps/gridEntityXMLMap";
|
|
54
54
|
export * from "./maps/pillEffectNameMap";
|
|
55
|
-
export * from "./maps/roomTypeToItemPoolMap";
|
|
56
55
|
export * from "./maps/transformationMap";
|
|
57
56
|
export * from "./maps/trinketNameMap";
|
|
58
57
|
export * from "./sets/cards";
|
package/dist/index.lua
CHANGED
|
@@ -422,14 +422,6 @@ do
|
|
|
422
422
|
end
|
|
423
423
|
end
|
|
424
424
|
end
|
|
425
|
-
do
|
|
426
|
-
local ____export = require("maps.roomTypeToItemPoolMap")
|
|
427
|
-
for ____exportKey, ____exportValue in pairs(____export) do
|
|
428
|
-
if ____exportKey ~= "default" then
|
|
429
|
-
____exports[____exportKey] = ____exportValue
|
|
430
|
-
end
|
|
431
|
-
end
|
|
432
|
-
end
|
|
433
425
|
do
|
|
434
426
|
local ____export = require("maps.transformationMap")
|
|
435
427
|
for ____exportKey, ____exportValue in pairs(____export) do
|