isaacscript-common 1.2.253 → 1.2.256
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/functions/entitySpecific.d.ts +2 -1
- package/dist/functions/pickups.d.ts +5 -0
- package/dist/functions/pickups.lua +7 -0
- package/dist/functions/utils.d.ts +1 -1
- package/dist/functions/utils.lua +6 -4
- package/dist/objects/coinSubTypeToValue.d.ts +5 -0
- package/dist/objects/coinSubTypeToValue.lua +13 -0
- package/dist/types/EntityTypeNonNPC.d.ts +2 -0
- package/dist/types/EntityTypeNonNPC.lua +3 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
import { EntityTypeNonNPC } from "../types/EntityTypeNonNPC";
|
|
2
3
|
/**
|
|
3
4
|
* Helper function to get all of the `EntityType.ENTITY_BOMB` in the room.
|
|
4
5
|
*
|
|
@@ -218,7 +219,7 @@ export declare function spawnLaser(variant: LaserVariant | int, subType: int, po
|
|
|
218
219
|
/** Helper function to spawn a `EntityType.ENTITY_LASER` (7) with a specific seed. */
|
|
219
220
|
export declare function spawnLaserWithSeed(variant: LaserVariant | int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityLaser;
|
|
220
221
|
/** Helper function to spawn an NPC. */
|
|
221
|
-
export declare function spawnNPC(entityType:
|
|
222
|
+
export declare function spawnNPC<T extends number>(entityType: T extends EntityTypeNonNPC ? never : T, variant: int, subType: int, position: Vector, velocity?: Readonly<Vector>, spawner?: Entity | undefined, seed?: Seed | undefined): EntityNPC;
|
|
222
223
|
/** Helper function to spawn an NPC with a specific seed. */
|
|
223
224
|
export declare function spawnNPCWithSeed(entityType: EntityType | int, variant: int, subType: int, position: Vector, seed: Seed, velocity?: Readonly<Vector>, spawner?: Entity | undefined): EntityNPC;
|
|
224
225
|
/** Helper function to spawn a `EntityType.ENTITY_PICKUP` (5). */
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
export declare function getBatteries(matchingSubType?: number): EntityPickup[];
|
|
4
4
|
/** Helper function to get all of the card entities in the room. */
|
|
5
5
|
export declare function getCards(matchingSubType?: number): EntityPickup[];
|
|
6
|
+
/**
|
|
7
|
+
* Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
|
|
8
|
+
* sub-types.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getCoinValue(coinSubType: CoinSubType): int;
|
|
6
11
|
/** Helper function to get all of the coin pickup entities in the room. */
|
|
7
12
|
export declare function getCoins(matchingSubType?: number): EntityPickup[];
|
|
8
13
|
/** Helper function to get all of the collectible entities in the room. */
|
|
@@ -3,6 +3,9 @@ local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local ____constants = require("constants")
|
|
5
5
|
local VectorZero = ____constants.VectorZero
|
|
6
|
+
local ____coinSubTypeToValue = require("objects.coinSubTypeToValue")
|
|
7
|
+
local COIN_SUBTYPE_TO_VALUE = ____coinSubTypeToValue.COIN_SUBTYPE_TO_VALUE
|
|
8
|
+
local DEFAULT_COIN_VALUE = ____coinSubTypeToValue.DEFAULT_COIN_VALUE
|
|
6
9
|
local ____chestPickupVariantsSet = require("sets.chestPickupVariantsSet")
|
|
7
10
|
local CHEST_PICKUP_VARIANTS = ____chestPickupVariantsSet.CHEST_PICKUP_VARIANTS
|
|
8
11
|
local ____redHeartSubTypesSet = require("sets.redHeartSubTypesSet")
|
|
@@ -23,6 +26,10 @@ function ____exports.getCards(self, matchingSubType)
|
|
|
23
26
|
end
|
|
24
27
|
return getPickups(nil, 300, matchingSubType)
|
|
25
28
|
end
|
|
29
|
+
function ____exports.getCoinValue(self, coinSubType)
|
|
30
|
+
local value = COIN_SUBTYPE_TO_VALUE[coinSubType]
|
|
31
|
+
return value == nil and DEFAULT_COIN_VALUE or value
|
|
32
|
+
end
|
|
26
33
|
function ____exports.getCoins(self, matchingSubType)
|
|
27
34
|
if matchingSubType == nil then
|
|
28
35
|
matchingSubType = -1
|
|
@@ -96,7 +96,7 @@ export declare function isLuaDebugEnabled(): boolean;
|
|
|
96
96
|
* Since this is a UI element, we do not want to draw it in water reflections. `renderOffset` will
|
|
97
97
|
* be a non-zero value in reflections.
|
|
98
98
|
*/
|
|
99
|
-
export declare function isReflectionRender(
|
|
99
|
+
export declare function isReflectionRender(): boolean;
|
|
100
100
|
/**
|
|
101
101
|
* Helper function to print something to the in-game console. Use this instead of invoking the
|
|
102
102
|
* `Isaac.ConsoleOutput` method directly because it will automatically insert a newline at the end
|
package/dist/functions/utils.lua
CHANGED
|
@@ -6,6 +6,8 @@ local __TS__StringSubstr = ____lualib.__TS__StringSubstr
|
|
|
6
6
|
local __TS__ObjectKeys = ____lualib.__TS__ObjectKeys
|
|
7
7
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
8
8
|
local ____exports = {}
|
|
9
|
+
local ____cachedClasses = require("cachedClasses")
|
|
10
|
+
local game = ____cachedClasses.game
|
|
9
11
|
local ____directionNames = require("objects.directionNames")
|
|
10
12
|
local DIRECTION_NAMES = ____directionNames.DIRECTION_NAMES
|
|
11
13
|
local HEX_STRING_LENGTH = 6
|
|
@@ -66,10 +68,10 @@ end
|
|
|
66
68
|
function ____exports.isLuaDebugEnabled(self)
|
|
67
69
|
return package ~= nil
|
|
68
70
|
end
|
|
69
|
-
function ____exports.isReflectionRender(self
|
|
70
|
-
local
|
|
71
|
-
local
|
|
72
|
-
return
|
|
71
|
+
function ____exports.isReflectionRender(self)
|
|
72
|
+
local room = game:GetRoom()
|
|
73
|
+
local renderMode = room:GetRenderMode()
|
|
74
|
+
return renderMode == RenderMode.RENDER_WATER_REFLECT
|
|
73
75
|
end
|
|
74
76
|
function ____exports.printConsole(self, msg)
|
|
75
77
|
Isaac.ConsoleOutput(msg .. "\n")
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
____exports.DEFAULT_COIN_VALUE = 1
|
|
4
|
+
____exports.COIN_SUBTYPE_TO_VALUE = {
|
|
5
|
+
[CoinSubType.COIN_PENNY] = 1,
|
|
6
|
+
[CoinSubType.COIN_NICKEL] = 5,
|
|
7
|
+
[CoinSubType.COIN_DIME] = 10,
|
|
8
|
+
[CoinSubType.COIN_DOUBLEPACK] = 2,
|
|
9
|
+
[CoinSubType.COIN_LUCKYPENNY] = 1,
|
|
10
|
+
[CoinSubType.COIN_STICKYNICKEL] = 5,
|
|
11
|
+
[CoinSubType.COIN_GOLDEN] = 1
|
|
12
|
+
}
|
|
13
|
+
return ____exports
|