isaacscript-common 1.0.460 → 1.0.464
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/features/deployJSONRoom.d.ts +38 -0
- package/dist/features/deployJSONRoom.lua +385 -0
- package/dist/features/preventCollectibleRotate.d.ts +13 -0
- package/dist/features/preventCollectibleRotate.lua +49 -0
- package/dist/functions/collectibleSet.lua +2 -2
- package/dist/functions/collectibles.d.ts +7 -7
- package/dist/functions/collectibles.lua +19 -17
- package/dist/functions/doors.d.ts +1 -0
- package/dist/functions/doors.lua +25 -16
- package/dist/functions/gridEntity.d.ts +14 -0
- package/dist/functions/gridEntity.lua +26 -2
- package/dist/functions/jsonRoom.d.ts +5 -0
- package/dist/functions/jsonRoom.lua +65 -0
- package/dist/functions/player.d.ts +7 -7
- package/dist/functions/rooms.d.ts +11 -0
- package/dist/functions/rooms.lua +36 -0
- package/dist/functions/spawnCollectible.d.ts +2 -0
- package/dist/functions/spawnCollectible.lua +41 -0
- package/dist/functions/trinketGive.d.ts +1 -1
- package/dist/functions/trinketSet.lua +2 -2
- package/dist/index.d.ts +9 -0
- package/dist/index.lua +30 -0
- package/dist/initialized.d.ts +2 -0
- package/dist/initialized.lua +10 -0
- package/dist/types/JSONDoor.d.ts +10 -0
- package/dist/types/JSONDoor.lua +3 -0
- package/dist/types/JSONEntity.d.ts +12 -0
- package/dist/types/JSONEntity.lua +3 -0
- package/dist/types/JSONRoom.d.ts +30 -0
- package/dist/types/JSONRoom.lua +3 -0
- package/dist/types/JSONRooms.d.ts +11 -0
- package/dist/types/JSONRooms.lua +3 -0
- package/dist/types/JSONSpawn.d.ts +10 -0
- package/dist/types/JSONSpawn.lua +3 -0
- package/dist/types/PersistentEntityDescription.d.ts +7 -0
- package/dist/types/PersistentEntityDescription.lua +3 -0
- package/dist/upgradeMod.lua +11 -3
- package/package.json +3 -3
|
@@ -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 GRID_ENTITY_XML_MAP = ____constants.GRID_ENTITY_XML_MAP
|
|
4
6
|
function ____exports.removeGridEntity(self, gridEntity)
|
|
5
7
|
local game = Game()
|
|
6
8
|
local room = game:GetRoom()
|
|
@@ -21,6 +23,23 @@ function ____exports.spawnGridEntityWithVariant(self, gridEntityType, variant, g
|
|
|
21
23
|
end
|
|
22
24
|
return gridEntity
|
|
23
25
|
end
|
|
26
|
+
function ____exports.convertXMLGridEntityType(self, gridEntityXMLType, gridEntityXMLVariant)
|
|
27
|
+
if gridEntityXMLType == EntityType.ENTITY_TRIGGER_OUTPUT then
|
|
28
|
+
return nil
|
|
29
|
+
end
|
|
30
|
+
local gridEntityArray = GRID_ENTITY_XML_MAP:get(gridEntityXMLType)
|
|
31
|
+
if gridEntityArray == nil then
|
|
32
|
+
error(
|
|
33
|
+
"Failed to find an entry in the grid entity map for XML entity type: " .. tostring(gridEntityXMLType)
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
local gridEntityType = gridEntityArray[1]
|
|
37
|
+
local gridEntityVariant = gridEntityArray[2]
|
|
38
|
+
if ((gridEntityType == GridEntityType.GRID_SPIKES_ONOFF) or (gridEntityType == GridEntityType.GRID_PRESSURE_PLATE)) or (gridEntityType == GridEntityType.GRID_TELEPORTER) then
|
|
39
|
+
gridEntityVariant = gridEntityXMLVariant
|
|
40
|
+
end
|
|
41
|
+
return {gridEntityType, gridEntityVariant}
|
|
42
|
+
end
|
|
24
43
|
function ____exports.getGridEntities(self, ...)
|
|
25
44
|
local gridEntityTypes = {...}
|
|
26
45
|
local game = Game()
|
|
@@ -34,7 +53,7 @@ function ____exports.getGridEntities(self, ...)
|
|
|
34
53
|
do
|
|
35
54
|
local gridEntity = room:GetGridEntity(gridIndex)
|
|
36
55
|
if gridEntity == nil then
|
|
37
|
-
goto
|
|
56
|
+
goto __continue7
|
|
38
57
|
end
|
|
39
58
|
if #gridEntityTypes == 0 then
|
|
40
59
|
__TS__ArrayPush(gridEntities, gridEntity)
|
|
@@ -45,7 +64,7 @@ function ____exports.getGridEntities(self, ...)
|
|
|
45
64
|
end
|
|
46
65
|
end
|
|
47
66
|
end
|
|
48
|
-
::
|
|
67
|
+
::__continue7::
|
|
49
68
|
gridIndex = gridIndex + 1
|
|
50
69
|
end
|
|
51
70
|
end
|
|
@@ -104,6 +123,11 @@ function ____exports.removeAllMatchingGridEntities(self, gridEntityType)
|
|
|
104
123
|
____exports.removeGridEntity(nil, gridEntity)
|
|
105
124
|
end
|
|
106
125
|
end
|
|
126
|
+
function ____exports.setGridEntityInvisible(self, gridEntity)
|
|
127
|
+
local sprite = gridEntity:GetSprite()
|
|
128
|
+
sprite:ReplaceSpritesheet(0, "gfx/none.png")
|
|
129
|
+
sprite:LoadGraphics()
|
|
130
|
+
end
|
|
107
131
|
function ____exports.spawnGiantPoop(self, topLeftGridIndex)
|
|
108
132
|
local game = Game()
|
|
109
133
|
local room = game:GetRoom()
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
import { JSONRoom } from "../types/JSONRoom";
|
|
3
|
+
export declare function getJSONRoomOfVariant(jsonRooms: JSONRoom[], variant: int): JSONRoom | null;
|
|
4
|
+
export declare function getJSONRoomsOfSubType(jsonRooms: JSONRoom[], subType: int): JSONRoom[];
|
|
5
|
+
export declare function getRandomJSONRoom(jsonRooms: JSONRoom[], seed?: number): JSONRoom;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
require("lualib_bundle");
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
local getTotalWeightOfJSONRooms, getJSONRoomWithChosenWeight
|
|
5
|
+
local ____random = require("functions.random")
|
|
6
|
+
local getRandomFloat = ____random.getRandomFloat
|
|
7
|
+
function getTotalWeightOfJSONRooms(self, jsonRooms)
|
|
8
|
+
local totalWeight = 0
|
|
9
|
+
for ____, jsonRoom in ipairs(jsonRooms) do
|
|
10
|
+
local roomWeightString = jsonRoom["$"].weight
|
|
11
|
+
local roomWeight = tonumber(roomWeightString)
|
|
12
|
+
if roomWeight == nil then
|
|
13
|
+
error(("Failed to parse the weight of a room: " .. roomWeightString) .. ".")
|
|
14
|
+
end
|
|
15
|
+
totalWeight = totalWeight + roomWeight
|
|
16
|
+
end
|
|
17
|
+
return totalWeight
|
|
18
|
+
end
|
|
19
|
+
function getJSONRoomWithChosenWeight(self, jsonRooms, chosenWeight)
|
|
20
|
+
for ____, jsonRoom in ipairs(jsonRooms) do
|
|
21
|
+
local roomWeightString = jsonRoom["$"].weight
|
|
22
|
+
local roomWeight = tonumber(roomWeightString)
|
|
23
|
+
if roomWeight == nil then
|
|
24
|
+
error("Failed to parse the weight of a room: " .. roomWeightString)
|
|
25
|
+
end
|
|
26
|
+
if chosenWeight < roomWeight then
|
|
27
|
+
return jsonRoom
|
|
28
|
+
end
|
|
29
|
+
chosenWeight = chosenWeight - roomWeight
|
|
30
|
+
end
|
|
31
|
+
error(
|
|
32
|
+
"Failed to get a room with chosen weight: " .. tostring(chosenWeight)
|
|
33
|
+
)
|
|
34
|
+
return jsonRooms[1]
|
|
35
|
+
end
|
|
36
|
+
function ____exports.getJSONRoomOfVariant(self, jsonRooms, variant)
|
|
37
|
+
for ____, jsonRoom in ipairs(jsonRooms) do
|
|
38
|
+
local roomVariantString = jsonRoom["$"].variant
|
|
39
|
+
local roomVariant = tonumber(roomVariantString)
|
|
40
|
+
if roomVariant == variant then
|
|
41
|
+
return jsonRoom
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
return nil
|
|
45
|
+
end
|
|
46
|
+
function ____exports.getJSONRoomsOfSubType(self, jsonRooms, subType)
|
|
47
|
+
local jsonRoomsOfSubType = {}
|
|
48
|
+
for ____, jsonRoom in ipairs(jsonRooms) do
|
|
49
|
+
local roomSubTypeString = jsonRoom["$"].subtype
|
|
50
|
+
local roomSubType = tonumber(roomSubTypeString)
|
|
51
|
+
if roomSubType == subType then
|
|
52
|
+
__TS__ArrayPush(jsonRoomsOfSubType, jsonRoom)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
return jsonRoomsOfSubType
|
|
56
|
+
end
|
|
57
|
+
function ____exports.getRandomJSONRoom(self, jsonRooms, seed)
|
|
58
|
+
if seed == nil then
|
|
59
|
+
seed = Random()
|
|
60
|
+
end
|
|
61
|
+
local totalWeight = getTotalWeightOfJSONRooms(nil, jsonRooms)
|
|
62
|
+
local chosenWeight = getRandomFloat(nil, 0, totalWeight, seed)
|
|
63
|
+
return getJSONRoomWithChosenWeight(nil, jsonRooms, chosenWeight)
|
|
64
|
+
end
|
|
65
|
+
return ____exports
|
|
@@ -14,12 +14,12 @@ import { PocketItemDescription } from "../types/PocketItemDescription";
|
|
|
14
14
|
export declare type PlayerIndex = int & {
|
|
15
15
|
__playerIndexBrand: unknown;
|
|
16
16
|
};
|
|
17
|
-
export declare function addCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
|
|
18
|
-
export declare function addTrinketCostume(player: EntityPlayer, trinketType: TrinketType): void;
|
|
17
|
+
export declare function addCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType | int): void;
|
|
18
|
+
export declare function addTrinketCostume(player: EntityPlayer, trinketType: TrinketType | int): void;
|
|
19
19
|
/** Iterates over all players and checks if any player is close enough to the specified position. */
|
|
20
20
|
export declare function anyPlayerCloserThan(position: Vector, distance: float): boolean;
|
|
21
|
-
export declare function anyPlayerHasCollectible(collectibleType: CollectibleType): boolean;
|
|
22
|
-
export declare function anyPlayerHasTrinket(trinketType: TrinketType): boolean;
|
|
21
|
+
export declare function anyPlayerHasCollectible(collectibleType: CollectibleType | int): boolean;
|
|
22
|
+
export declare function anyPlayerHasTrinket(trinketType: TrinketType | int): boolean;
|
|
23
23
|
export declare function anyPlayerIs(matchingCharacter: PlayerType): boolean;
|
|
24
24
|
/**
|
|
25
25
|
* Helper function to get how long Azazel's Brimstone laser should be. You can pass either an
|
|
@@ -134,7 +134,7 @@ export declare function getTotalCharge(player: EntityPlayer, activeSlot: ActiveS
|
|
|
134
134
|
* Returns the total number of collectibles amongst all players. For example, if player 1 has 1 Sad
|
|
135
135
|
* Onion and player 2 has 2 Sad Onions, then this function would return 3.
|
|
136
136
|
*/
|
|
137
|
-
export declare function getTotalPlayerCollectibles(collectibleType: CollectibleType): int;
|
|
137
|
+
export declare function getTotalPlayerCollectibles(collectibleType: CollectibleType | int): int;
|
|
138
138
|
/** After touching a white fire, a player will turn into The Lost until they clear a room. */
|
|
139
139
|
export declare function hasLostCurse(player: EntityPlayer): boolean;
|
|
140
140
|
/**
|
|
@@ -188,7 +188,7 @@ export declare function isKeeper(player: EntityPlayer): boolean;
|
|
|
188
188
|
export declare function isLost(player: EntityPlayer): boolean;
|
|
189
189
|
/** Helper function for detecting when a player is Tainted Lazarus or Dead Tainted Lazarus. */
|
|
190
190
|
export declare function isTaintedLazarus(player: EntityPlayer): boolean;
|
|
191
|
-
export declare function removeCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
|
|
191
|
+
export declare function removeCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType | int): void;
|
|
192
192
|
/**
|
|
193
193
|
* Helper function to remove the Dead Eye multiplier from a player.
|
|
194
194
|
*
|
|
@@ -196,7 +196,7 @@ export declare function removeCollectibleCostume(player: EntityPlayer, collectib
|
|
|
196
196
|
* chance of working, so this function calls it 100 times to be safe.
|
|
197
197
|
*/
|
|
198
198
|
export declare function removeDeadEyeMultiplier(player: EntityPlayer): void;
|
|
199
|
-
export declare function removeTrinketCostume(player: EntityPlayer, trinketType: TrinketType): void;
|
|
199
|
+
export declare function removeTrinketCostume(player: EntityPlayer, trinketType: TrinketType | int): void;
|
|
200
200
|
/**
|
|
201
201
|
* If you want to stop the player from shooting without the blindfold costume, then simply call
|
|
202
202
|
* `player.TryRemoveNullCostume(NullItemID.ID_BLINDFOLD)` after invoking this function.
|
|
@@ -107,3 +107,14 @@ export declare function inDimension(dimension: Dimension): boolean;
|
|
|
107
107
|
export declare function inLRoom(): boolean;
|
|
108
108
|
export declare function inGenesisRoom(): boolean;
|
|
109
109
|
export declare function inStartingRoom(): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Helper function to convert an uncleared room to a cleared room in the PostNewRoom callback. This
|
|
112
|
+
* is useful because if enemies are removed in this callback, a room drop will be awarded and the
|
|
113
|
+
* doors will start closed and then open.
|
|
114
|
+
*/
|
|
115
|
+
export declare function setRoomCleared(): void;
|
|
116
|
+
/**
|
|
117
|
+
* Helper function to emulate what happens when you bomb an Angel Statue or push a Reward Plate that
|
|
118
|
+
* spawns an NPC.
|
|
119
|
+
*/
|
|
120
|
+
export declare function setRoomUncleared(): void;
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -7,6 +7,10 @@ local GENESIS_ROOM_SUBTYPE = ____constants.GENESIS_ROOM_SUBTYPE
|
|
|
7
7
|
local GENESIS_ROOM_VARIANT = ____constants.GENESIS_ROOM_VARIANT
|
|
8
8
|
local MAX_ROOM_INDEX = ____constants.MAX_ROOM_INDEX
|
|
9
9
|
local ROOM_TYPE_TO_ITEM_POOL_TYPE_MAP = ____constants.ROOM_TYPE_TO_ITEM_POOL_TYPE_MAP
|
|
10
|
+
local ____doors = require("functions.doors")
|
|
11
|
+
local closeAllDoors = ____doors.closeAllDoors
|
|
12
|
+
local getDoors = ____doors.getDoors
|
|
13
|
+
local isHiddenSecretRoomDoor = ____doors.isHiddenSecretRoomDoor
|
|
10
14
|
function ____exports.getRoomIndex(self)
|
|
11
15
|
local game = Game()
|
|
12
16
|
local level = game:GetLevel()
|
|
@@ -184,4 +188,36 @@ function ____exports.inStartingRoom(self)
|
|
|
184
188
|
local roomIndex = ____exports.getRoomIndex(nil)
|
|
185
189
|
return roomIndex == startingRoomIndex
|
|
186
190
|
end
|
|
191
|
+
function ____exports.setRoomCleared(self)
|
|
192
|
+
local game = Game()
|
|
193
|
+
local room = game:GetRoom()
|
|
194
|
+
local roomClear = room:IsClear()
|
|
195
|
+
local sfx = SFXManager()
|
|
196
|
+
if roomClear then
|
|
197
|
+
return
|
|
198
|
+
end
|
|
199
|
+
room:SetClear(true)
|
|
200
|
+
for ____, door in ipairs(
|
|
201
|
+
getDoors(nil)
|
|
202
|
+
) do
|
|
203
|
+
do
|
|
204
|
+
if isHiddenSecretRoomDoor(nil, door) then
|
|
205
|
+
goto __continue37
|
|
206
|
+
end
|
|
207
|
+
door.State = DoorState.STATE_OPEN
|
|
208
|
+
local sprite = door:GetSprite()
|
|
209
|
+
sprite:Play("Opened", true)
|
|
210
|
+
door.ExtraVisible = false
|
|
211
|
+
end
|
|
212
|
+
::__continue37::
|
|
213
|
+
end
|
|
214
|
+
sfx:Stop(SoundEffect.SOUND_DOOR_HEAVY_OPEN)
|
|
215
|
+
game:ShakeScreen(0)
|
|
216
|
+
end
|
|
217
|
+
function ____exports.setRoomUncleared(self)
|
|
218
|
+
local game = Game()
|
|
219
|
+
local room = game:GetRoom()
|
|
220
|
+
room:SetClear(false)
|
|
221
|
+
closeAllDoors(nil)
|
|
222
|
+
end
|
|
187
223
|
return ____exports
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local ____preventCollectibleRotate = require("features.preventCollectibleRotate")
|
|
4
|
+
local preventCollectibleRotate = ____preventCollectibleRotate.preventCollectibleRotate
|
|
5
|
+
local ____initialized = require("initialized")
|
|
6
|
+
local areFeaturesInitialized = ____initialized.areFeaturesInitialized
|
|
7
|
+
local ____collectibles = require("functions.collectibles")
|
|
8
|
+
local isQuestCollectible = ____collectibles.isQuestCollectible
|
|
9
|
+
local ____player = require("functions.player")
|
|
10
|
+
local anyPlayerIs = ____player.anyPlayerIs
|
|
11
|
+
function ____exports.spawnCollectible(self, collectibleType, position, seed, options, forceFreeItem)
|
|
12
|
+
if seed == nil then
|
|
13
|
+
seed = Random()
|
|
14
|
+
end
|
|
15
|
+
if options == nil then
|
|
16
|
+
options = false
|
|
17
|
+
end
|
|
18
|
+
if forceFreeItem == nil then
|
|
19
|
+
forceFreeItem = false
|
|
20
|
+
end
|
|
21
|
+
if seed == 0 then
|
|
22
|
+
error("Failed to spawn a collectible since the provided seed was 0, which is not allowed. (It will cause the game to crash.)")
|
|
23
|
+
end
|
|
24
|
+
local game = Game()
|
|
25
|
+
local collectible = game:Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, position, Vector.Zero, nil, collectibleType, seed):ToPickup()
|
|
26
|
+
if collectible == nil then
|
|
27
|
+
error("Failed to spawn a collectible.")
|
|
28
|
+
end
|
|
29
|
+
if options then
|
|
30
|
+
collectible.OptionsPickupIndex = 1
|
|
31
|
+
end
|
|
32
|
+
if (anyPlayerIs(nil, PlayerType.PLAYER_KEEPER_B) and (not isQuestCollectible(nil, collectibleType))) and (not forceFreeItem) then
|
|
33
|
+
collectible.ShopItemId = -1
|
|
34
|
+
collectible.Price = 15
|
|
35
|
+
end
|
|
36
|
+
if isQuestCollectible(nil, collectibleType) and areFeaturesInitialized(nil) then
|
|
37
|
+
preventCollectibleRotate(nil, collectible, collectibleType)
|
|
38
|
+
end
|
|
39
|
+
return collectible
|
|
40
|
+
end
|
|
41
|
+
return ____exports
|
|
@@ -15,7 +15,7 @@ export interface TrinketSituation {
|
|
|
15
15
|
*
|
|
16
16
|
* @returns Null if the player does not have the trinket, or TrinketSituation if they do.
|
|
17
17
|
*/
|
|
18
|
-
export declare function temporarilyRemoveTrinkets(player: EntityPlayer, trinketType: TrinketType): TrinketSituation | undefined;
|
|
18
|
+
export declare function temporarilyRemoveTrinkets(player: EntityPlayer, trinketType: TrinketType | int): TrinketSituation | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* Helper function to restore the player's trinkets back to the way they were before the
|
|
21
21
|
* `temporarilyRemoveTrinket` function was used. It will re-smelt any smelted trinkets that were
|
|
@@ -6,7 +6,7 @@ local getMaxTrinketID = ____trinkets.getMaxTrinketID
|
|
|
6
6
|
local ____util = require("functions.util")
|
|
7
7
|
local copySet = ____util.copySet
|
|
8
8
|
local TRINKET_SET = __TS__New(Set)
|
|
9
|
-
local function
|
|
9
|
+
local function initTrinketSet(self)
|
|
10
10
|
local itemConfig = Isaac.GetItemConfig()
|
|
11
11
|
do
|
|
12
12
|
local trinketType = 1
|
|
@@ -21,7 +21,7 @@ local function initSet(self)
|
|
|
21
21
|
end
|
|
22
22
|
function ____exports.getTrinketSet(self)
|
|
23
23
|
if TRINKET_SET.size == 0 then
|
|
24
|
-
|
|
24
|
+
initTrinketSet(nil)
|
|
25
25
|
end
|
|
26
26
|
return copySet(nil, TRINKET_SET)
|
|
27
27
|
end
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ export { forceNewLevelCallback, forceNewRoomCallback, } from "./callbacks/reorde
|
|
|
2
2
|
export * from "./cardNameMap";
|
|
3
3
|
export * from "./collectibleNameMap";
|
|
4
4
|
export * from "./constants";
|
|
5
|
+
export { deployJSONRoom, deployRandomJSONRoom, emptyRoom, } from "./features/deployJSONRoom";
|
|
5
6
|
export { disableAllInputs, disableAllInputsExceptFor, disableMovementInputs, disableShootingInputs, enableAllInputs, enableAllInputsExceptFor, } from "./features/disableInputs";
|
|
6
7
|
export { forgottenSwitch } from "./features/forgottenSwitch";
|
|
7
8
|
export { getCollectibleItemPoolType } from "./features/getCollectibleItemPoolType";
|
|
9
|
+
export { preventCollectibleRotate } from "./features/preventCollectibleRotate";
|
|
8
10
|
export { runInNFrames, runNextFrame } from "./features/runInNFrames";
|
|
9
11
|
export * from "./features/saveDataManager/exports";
|
|
10
12
|
export { hasSirenStolenFamiliar, setFamiliarNoSirenSteal, } from "./features/sirenHelpers";
|
|
@@ -23,6 +25,7 @@ export * from "./functions/flag";
|
|
|
23
25
|
export * from "./functions/gridEntity";
|
|
24
26
|
export * from "./functions/input";
|
|
25
27
|
export * from "./functions/json";
|
|
28
|
+
export * from "./functions/jsonRoom";
|
|
26
29
|
export * from "./functions/language";
|
|
27
30
|
export * from "./functions/log";
|
|
28
31
|
export * from "./functions/math";
|
|
@@ -35,6 +38,7 @@ export * from "./functions/position";
|
|
|
35
38
|
export * from "./functions/random";
|
|
36
39
|
export * from "./functions/revive";
|
|
37
40
|
export * from "./functions/rooms";
|
|
41
|
+
export * from "./functions/spawnCollectible";
|
|
38
42
|
export * from "./functions/sprite";
|
|
39
43
|
export * from "./functions/stage";
|
|
40
44
|
export * from "./functions/tears";
|
|
@@ -50,6 +54,11 @@ export * from "./transformationMap";
|
|
|
50
54
|
export * from "./trinketNameMap";
|
|
51
55
|
export * from "./types/CallbackParametersCustom";
|
|
52
56
|
export * from "./types/HealthType";
|
|
57
|
+
export * from "./types/JSONDoor";
|
|
58
|
+
export * from "./types/JSONEntity";
|
|
59
|
+
export * from "./types/JSONRoom";
|
|
60
|
+
export * from "./types/JSONRooms";
|
|
61
|
+
export * from "./types/JSONSpawn";
|
|
53
62
|
export * from "./types/ModCallbacksCustom";
|
|
54
63
|
export * from "./types/ModUpgraded";
|
|
55
64
|
export * from "./types/PickingUpItem";
|
package/dist/index.lua
CHANGED
|
@@ -31,6 +31,15 @@ do
|
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
|
+
do
|
|
35
|
+
local ____deployJSONRoom = require("features.deployJSONRoom")
|
|
36
|
+
local deployJSONRoom = ____deployJSONRoom.deployJSONRoom
|
|
37
|
+
local deployRandomJSONRoom = ____deployJSONRoom.deployRandomJSONRoom
|
|
38
|
+
local emptyRoom = ____deployJSONRoom.emptyRoom
|
|
39
|
+
____exports.deployJSONRoom = deployJSONRoom
|
|
40
|
+
____exports.deployRandomJSONRoom = deployRandomJSONRoom
|
|
41
|
+
____exports.emptyRoom = emptyRoom
|
|
42
|
+
end
|
|
34
43
|
do
|
|
35
44
|
local ____disableInputs = require("features.disableInputs")
|
|
36
45
|
local disableAllInputs = ____disableInputs.disableAllInputs
|
|
@@ -56,6 +65,11 @@ do
|
|
|
56
65
|
local getCollectibleItemPoolType = ____getCollectibleItemPoolType.getCollectibleItemPoolType
|
|
57
66
|
____exports.getCollectibleItemPoolType = getCollectibleItemPoolType
|
|
58
67
|
end
|
|
68
|
+
do
|
|
69
|
+
local ____preventCollectibleRotate = require("features.preventCollectibleRotate")
|
|
70
|
+
local preventCollectibleRotate = ____preventCollectibleRotate.preventCollectibleRotate
|
|
71
|
+
____exports.preventCollectibleRotate = preventCollectibleRotate
|
|
72
|
+
end
|
|
59
73
|
do
|
|
60
74
|
local ____runInNFrames = require("features.runInNFrames")
|
|
61
75
|
local runInNFrames = ____runInNFrames.runInNFrames
|
|
@@ -192,6 +206,14 @@ do
|
|
|
192
206
|
end
|
|
193
207
|
end
|
|
194
208
|
end
|
|
209
|
+
do
|
|
210
|
+
local ____export = require("functions.jsonRoom")
|
|
211
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
212
|
+
if ____exportKey ~= "default" then
|
|
213
|
+
____exports[____exportKey] = ____exportValue
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
end
|
|
195
217
|
do
|
|
196
218
|
local ____export = require("functions.language")
|
|
197
219
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -288,6 +310,14 @@ do
|
|
|
288
310
|
end
|
|
289
311
|
end
|
|
290
312
|
end
|
|
313
|
+
do
|
|
314
|
+
local ____export = require("functions.spawnCollectible")
|
|
315
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
316
|
+
if ____exportKey ~= "default" then
|
|
317
|
+
____exports[____exportKey] = ____exportValue
|
|
318
|
+
end
|
|
319
|
+
end
|
|
320
|
+
end
|
|
291
321
|
do
|
|
292
322
|
local ____export = require("functions.sprite")
|
|
293
323
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local initialized = false
|
|
4
|
+
function ____exports.areFeaturesInitialized(self)
|
|
5
|
+
return initialized
|
|
6
|
+
end
|
|
7
|
+
function ____exports.setFeaturesInitialized(self)
|
|
8
|
+
initialized = true
|
|
9
|
+
end
|
|
10
|
+
return ____exports
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface JSONEntity {
|
|
2
|
+
$: {
|
|
3
|
+
/** Needs to be converted to an int. */
|
|
4
|
+
type: string;
|
|
5
|
+
/** Needs to be converted to an int. */
|
|
6
|
+
variant: string;
|
|
7
|
+
/** Needs to be converted to an int. */
|
|
8
|
+
subtype: string;
|
|
9
|
+
/** Needs to be converted to a float. */
|
|
10
|
+
weight: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { JSONDoor } from "./JSONDoor";
|
|
2
|
+
import { JSONSpawn } from "./JSONSpawn";
|
|
3
|
+
/**
|
|
4
|
+
* Custom rooms are created with the Basement Renovator program, which outputs XML files and STB
|
|
5
|
+
* files. A `JSONRoom` is simply an XML room converted to JSON. You can convert your XML files using
|
|
6
|
+
* the following command: `npx convert-xml-to-json foo.xml foo.json`
|
|
7
|
+
*/
|
|
8
|
+
export interface JSONRoom {
|
|
9
|
+
$: {
|
|
10
|
+
/** Needs to be converted to an int. */
|
|
11
|
+
difficulty: string;
|
|
12
|
+
/** Needs to be converted to an int. */
|
|
13
|
+
height: string;
|
|
14
|
+
name: string;
|
|
15
|
+
/** Needs to be converted to an int. */
|
|
16
|
+
shape: string;
|
|
17
|
+
/** Needs to be converted to an int. */
|
|
18
|
+
subtype: string;
|
|
19
|
+
/** Needs to be converted to an int. */
|
|
20
|
+
type: string;
|
|
21
|
+
/** Needs to be converted to an int. */
|
|
22
|
+
variant: string;
|
|
23
|
+
/** Needs to be converted to a float. */
|
|
24
|
+
weight: string;
|
|
25
|
+
/** Needs to be converted to an int. */
|
|
26
|
+
width: string;
|
|
27
|
+
};
|
|
28
|
+
door: JSONDoor[];
|
|
29
|
+
spawn: JSONSpawn[];
|
|
30
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSONRoom } from "./JSONRoom";
|
|
2
|
+
/**
|
|
3
|
+
* Custom rooms are created with the Basement Renovator program, which outputs XML files and STB
|
|
4
|
+
* files. A `JSONRooms` object is simply an XML file converted to JSON. You can convert your XML
|
|
5
|
+
* files using the following command: `npx convert-xml-to-json foo.xml foo.json`
|
|
6
|
+
*/
|
|
7
|
+
export interface JSONRooms {
|
|
8
|
+
rooms: {
|
|
9
|
+
room: JSONRoom[];
|
|
10
|
+
};
|
|
11
|
+
}
|
package/dist/upgradeMod.lua
CHANGED
|
@@ -56,18 +56,25 @@ local ____postTransformation = require("callbacks.postTransformation")
|
|
|
56
56
|
local postTransformationCallbackInit = ____postTransformation.postTransformationCallbackInit
|
|
57
57
|
local ____reorderedCallbacks = require("callbacks.reorderedCallbacks")
|
|
58
58
|
local reorderedCallbacksInit = ____reorderedCallbacks.reorderedCallbacksInit
|
|
59
|
+
local ____deployJSONRoom = require("features.deployJSONRoom")
|
|
60
|
+
local deployJSONRoomInit = ____deployJSONRoom.deployJSONRoomInit
|
|
59
61
|
local ____disableInputs = require("features.disableInputs")
|
|
60
62
|
local disableInputsInit = ____disableInputs.disableInputsInit
|
|
61
63
|
local ____forgottenSwitch = require("features.forgottenSwitch")
|
|
62
64
|
local forgottenSwitchInit = ____forgottenSwitch.forgottenSwitchInit
|
|
63
65
|
local ____getCollectibleItemPoolType = require("features.getCollectibleItemPoolType")
|
|
64
66
|
local getCollectibleItemPoolTypeInit = ____getCollectibleItemPoolType.getCollectibleItemPoolTypeInit
|
|
67
|
+
local ____preventCollectibleRotate = require("features.preventCollectibleRotate")
|
|
68
|
+
local preventCollectibleRotateInit = ____preventCollectibleRotate.preventCollectibleRotateInit
|
|
65
69
|
local ____runInNFrames = require("features.runInNFrames")
|
|
66
70
|
local runInNFramesInit = ____runInNFrames.runInNFramesInit
|
|
67
71
|
local ____main = require("features.saveDataManager.main")
|
|
68
72
|
local saveDataManagerInit = ____main.saveDataManagerInit
|
|
69
73
|
local ____sirenHelpers = require("features.sirenHelpers")
|
|
70
74
|
local sirenHelpersInit = ____sirenHelpers.sirenHelpersInit
|
|
75
|
+
local ____initialized = require("initialized")
|
|
76
|
+
local areFeaturesInitialized = ____initialized.areFeaturesInitialized
|
|
77
|
+
local setFeaturesInitialized = ____initialized.setFeaturesInitialized
|
|
71
78
|
local ____ModUpgraded = require("types.ModUpgraded")
|
|
72
79
|
local ModUpgraded = ____ModUpgraded.ModUpgraded
|
|
73
80
|
function initCustomCallbacks(self, mod)
|
|
@@ -100,20 +107,21 @@ function initCustomCallbacks(self, mod)
|
|
|
100
107
|
postGridEntityCallbacksInit(nil, mod)
|
|
101
108
|
end
|
|
102
109
|
function initFeatures(self, mod)
|
|
110
|
+
deployJSONRoomInit(nil, mod)
|
|
103
111
|
disableInputsInit(nil, mod)
|
|
104
112
|
forgottenSwitchInit(nil, mod)
|
|
105
113
|
getCollectibleItemPoolTypeInit(nil, mod)
|
|
114
|
+
preventCollectibleRotateInit(nil, mod)
|
|
106
115
|
runInNFramesInit(nil, mod)
|
|
107
116
|
sirenHelpersInit(nil, mod)
|
|
108
117
|
end
|
|
109
|
-
local initialized = false
|
|
110
118
|
function ____exports.upgradeMod(self, mod, verbose)
|
|
111
119
|
if verbose == nil then
|
|
112
120
|
verbose = false
|
|
113
121
|
end
|
|
114
122
|
local modUpgraded = __TS__New(ModUpgraded, mod, verbose)
|
|
115
|
-
if not
|
|
116
|
-
|
|
123
|
+
if not areFeaturesInitialized(nil) then
|
|
124
|
+
setFeaturesInitialized(nil)
|
|
117
125
|
saveDataManagerInit(nil, modUpgraded)
|
|
118
126
|
initCustomCallbacks(nil, modUpgraded)
|
|
119
127
|
initFeatures(nil, modUpgraded)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.464",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"dist/**/*.d.ts"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^1.0.
|
|
28
|
+
"isaac-typescript-definitions": "^1.0.281",
|
|
29
29
|
"isaacscript-lint": "^1.0.67",
|
|
30
|
-
"typedoc": "^0.22.
|
|
30
|
+
"typedoc": "^0.22.10",
|
|
31
31
|
"typescript": "4.4.4",
|
|
32
32
|
"typescript-to-lua": "^1.1.1"
|
|
33
33
|
}
|