isaacscript-common 1.0.449 → 1.0.453
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/postFlip.lua +4 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.lua +1 -1
- package/dist/functions/collectibles.d.ts +5 -0
- package/dist/functions/collectibles.lua +4 -0
- package/dist/functions/player.d.ts +3 -0
- package/dist/functions/player.lua +4 -0
- package/dist/functions/position.d.ts +9 -0
- package/dist/functions/position.lua +35 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.lua +8 -0
- package/package.json +2 -2
|
@@ -5,6 +5,7 @@ local ____exports = require("features.saveDataManager.exports")
|
|
|
5
5
|
local saveDataManager = ____exports.saveDataManager
|
|
6
6
|
local ____player = require("functions.player")
|
|
7
7
|
local getPlayers = ____player.getPlayers
|
|
8
|
+
local isTaintedLazarus = ____player.isTaintedLazarus
|
|
8
9
|
local postFirstFlip = require("callbacks.subscriptions.postFirstFlip")
|
|
9
10
|
local postFlip = require("callbacks.subscriptions.postFlip")
|
|
10
11
|
function hasSubscriptions(self)
|
|
@@ -14,6 +15,9 @@ function useItemFlip(self, _collectibleType, _rng, player, _useFlags, _activeSlo
|
|
|
14
15
|
if not hasSubscriptions(nil) then
|
|
15
16
|
return
|
|
16
17
|
end
|
|
18
|
+
if not isTaintedLazarus(nil, player) then
|
|
19
|
+
return
|
|
20
|
+
end
|
|
17
21
|
local newLazarus = getNewLazarus(nil, player)
|
|
18
22
|
if not v.run.usedFlipAtLeastOnce then
|
|
19
23
|
v.run.usedFlipAtLeastOnce = true
|
package/dist/constants.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125;
|
|
7
7
|
/** Bombs explode when their frame count is equal to this value. */
|
|
8
|
-
export declare const BOMB_EXPLODE_FRAME =
|
|
8
|
+
export declare const BOMB_EXPLODE_FRAME = 45;
|
|
9
9
|
export declare const CHARACTERS_WITH_NO_RED_HEARTS: Set<PlayerType>;
|
|
10
10
|
/** This is also the distance that a player spawns from the door that they enter a room from. */
|
|
11
11
|
export declare const DISTANCE_OF_GRID_TILE = 40;
|
package/dist/constants.lua
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
require("lualib_bundle");
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
____exports.AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125
|
|
5
|
-
____exports.BOMB_EXPLODE_FRAME =
|
|
5
|
+
____exports.BOMB_EXPLODE_FRAME = 45
|
|
6
6
|
____exports.CHARACTERS_WITH_NO_RED_HEARTS = __TS__New(Set, {PlayerType.PLAYER_BLUEBABY, PlayerType.PLAYER_BLACKJUDAS, PlayerType.PLAYER_JUDAS_B, PlayerType.PLAYER_BLUEBABY_B, PlayerType.PLAYER_THEFORGOTTEN_B, PlayerType.PLAYER_BETHANY_B})
|
|
7
7
|
____exports.DISTANCE_OF_GRID_TILE = 40
|
|
8
8
|
____exports.DOOR_HITBOX_DISTANCE = 11
|
|
@@ -32,6 +32,11 @@ export declare function getMaxCollectibleID(): int;
|
|
|
32
32
|
* in secret rooms and I AM ERROR rooms if the "Corrupted Data" achievement is unlocked.
|
|
33
33
|
*/
|
|
34
34
|
export declare function isGlitchedCollectible(entity: Entity): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Returns true if the item type in the item config is equal to `ItemType.ITEM_PASSIVE` or
|
|
37
|
+
* `ItemType.ITEM_FAMILIAR`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function isPassiveCollectible(collectibleType: CollectibleType | int): true | ItemType.ITEM_FAMILIAR;
|
|
35
40
|
export declare function isQuestCollectible(collectibleType: CollectibleType | int): boolean;
|
|
36
41
|
export declare function removeAllCollectibles(): void;
|
|
37
42
|
/**
|
|
@@ -116,6 +116,10 @@ end
|
|
|
116
116
|
function ____exports.isGlitchedCollectible(self, entity)
|
|
117
117
|
return ((entity.Type == EntityType.ENTITY_PICKUP) and (entity.Variant == PickupVariant.PICKUP_COLLECTIBLE)) and (entity.SubType > GLITCHED_ITEM_THRESHOLD)
|
|
118
118
|
end
|
|
119
|
+
function ____exports.isPassiveCollectible(self, collectibleType)
|
|
120
|
+
local itemType = ____exports.getCollectibleItemType(nil, collectibleType)
|
|
121
|
+
return (itemType == ItemType.ITEM_PASSIVE) or ItemType.ITEM_FAMILIAR
|
|
122
|
+
end
|
|
119
123
|
function ____exports.isQuestCollectible(self, collectibleType)
|
|
120
124
|
return ____exports.collectibleHasTag(nil, collectibleType, 32768)
|
|
121
125
|
end
|
|
@@ -184,7 +184,10 @@ export declare function isJacobOrEsau(player: EntityPlayer): boolean;
|
|
|
184
184
|
* where you want to know if the health is coin hearts, for example.
|
|
185
185
|
*/
|
|
186
186
|
export declare function isKeeper(player: EntityPlayer): boolean;
|
|
187
|
+
/** Helper function for detecting when a player is The Lost or Tainted Lost. */
|
|
187
188
|
export declare function isLost(player: EntityPlayer): boolean;
|
|
189
|
+
/** Helper function for detecting when a player is Tainted Lazarus or Dead Tainted Lazarus. */
|
|
190
|
+
export declare function isTaintedLazarus(player: EntityPlayer): boolean;
|
|
188
191
|
export declare function removeCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
|
|
189
192
|
/**
|
|
190
193
|
* Helper function to remove the Dead Eye multiplier from a player.
|
|
@@ -400,6 +400,10 @@ function ____exports.isLost(self, player)
|
|
|
400
400
|
local character = player:GetPlayerType()
|
|
401
401
|
return (character == PlayerType.PLAYER_THELOST) or (character == PlayerType.PLAYER_THELOST_B)
|
|
402
402
|
end
|
|
403
|
+
function ____exports.isTaintedLazarus(self, player)
|
|
404
|
+
local character = player:GetPlayerType()
|
|
405
|
+
return (character == PlayerType.PLAYER_LAZARUS_B) or (character == PlayerType.PLAYER_LAZARUS2_B)
|
|
406
|
+
end
|
|
403
407
|
function ____exports.removeCollectibleCostume(self, player, collectibleType)
|
|
404
408
|
local itemConfig = Isaac.GetItemConfig()
|
|
405
409
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to get a room position that is not overlapping with a grid entity, a heaven door,
|
|
4
|
+
* or a player. The `Room.FindFreePickupSpawnPosition()` function will return locations that overlap
|
|
5
|
+
* with heaven doors and partially overlap with players, if the thing being spawned is bigger than a
|
|
6
|
+
* tile (like a Blood Donation Machine). Use this function instead if you want to account for those
|
|
7
|
+
* specific situations.
|
|
8
|
+
*/
|
|
9
|
+
export declare function findFreePosition(startingPosition: Vector): Vector;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local ____constants = require("constants")
|
|
4
|
+
local DISTANCE_OF_GRID_TILE = ____constants.DISTANCE_OF_GRID_TILE
|
|
5
|
+
local ____entity = require("functions.entity")
|
|
6
|
+
local anyEntityCloserThan = ____entity.anyEntityCloserThan
|
|
7
|
+
local getEffects = ____entity.getEffects
|
|
8
|
+
local ____player = require("functions.player")
|
|
9
|
+
local getPlayerCloserThan = ____player.getPlayerCloserThan
|
|
10
|
+
function ____exports.findFreePosition(self, startingPosition)
|
|
11
|
+
local game = Game()
|
|
12
|
+
local room = game:GetRoom()
|
|
13
|
+
local heavenDoors = getEffects(nil, EffectVariant.HEAVEN_LIGHT_DOOR, 0)
|
|
14
|
+
do
|
|
15
|
+
local i = 0
|
|
16
|
+
while i < 100 do
|
|
17
|
+
do
|
|
18
|
+
local position = room:FindFreePickupSpawnPosition(startingPosition, i)
|
|
19
|
+
local closePlayer = getPlayerCloserThan(nil, position, DISTANCE_OF_GRID_TILE)
|
|
20
|
+
if closePlayer ~= nil then
|
|
21
|
+
goto __continue3
|
|
22
|
+
end
|
|
23
|
+
local isCloseHeavenDoor = anyEntityCloserThan(nil, heavenDoors, position, DISTANCE_OF_GRID_TILE)
|
|
24
|
+
if isCloseHeavenDoor then
|
|
25
|
+
goto __continue3
|
|
26
|
+
end
|
|
27
|
+
return position
|
|
28
|
+
end
|
|
29
|
+
::__continue3::
|
|
30
|
+
i = i + 1
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
return room:FindFreePickupSpawnPosition(startingPosition)
|
|
34
|
+
end
|
|
35
|
+
return ____exports
|
package/dist/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export * from "./functions/pickups";
|
|
|
30
30
|
export * from "./functions/player";
|
|
31
31
|
export * from "./functions/playerHealth";
|
|
32
32
|
export * from "./functions/pocketItems";
|
|
33
|
+
export * from "./functions/position";
|
|
33
34
|
export * from "./functions/random";
|
|
34
35
|
export * from "./functions/revive";
|
|
35
36
|
export * from "./functions/rooms";
|
package/dist/index.lua
CHANGED
|
@@ -251,6 +251,14 @@ do
|
|
|
251
251
|
end
|
|
252
252
|
end
|
|
253
253
|
end
|
|
254
|
+
do
|
|
255
|
+
local ____export = require("functions.position")
|
|
256
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
257
|
+
if ____exportKey ~= "default" then
|
|
258
|
+
____exports[____exportKey] = ____exportValue
|
|
259
|
+
end
|
|
260
|
+
end
|
|
261
|
+
end
|
|
254
262
|
do
|
|
255
263
|
local ____export = require("functions.random")
|
|
256
264
|
for ____exportKey, ____exportValue in pairs(____export) do
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.453",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist/**/*.d.ts"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^1.0.
|
|
28
|
+
"isaac-typescript-definitions": "^1.0.276",
|
|
29
29
|
"isaacscript-lint": "^1.0.67",
|
|
30
30
|
"typedoc": "^0.22.9",
|
|
31
31
|
"typescript": "4.4.4",
|