isaacscript-common 7.17.3 → 7.18.0
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/players.lua +1 -1
- package/dist/functions/run.d.ts +5 -0
- package/dist/functions/run.d.ts.map +1 -1
- package/dist/functions/run.lua +13 -0
- package/dist/index.d.ts +11441 -175
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +144 -122
- package/package.json +1 -1
- package/src/functions/players.ts +2 -2
- package/src/functions/run.ts +23 -1
- package/src/index.ts +24 -61
|
@@ -304,7 +304,7 @@ function ____exports.getAzazelBrimstoneDistance(self, playerOrTearHeight)
|
|
|
304
304
|
return 32 - 2.5 * tearHeight
|
|
305
305
|
end
|
|
306
306
|
function ____exports.getClosestPlayer(self, position)
|
|
307
|
-
local closestPlayer
|
|
307
|
+
local closestPlayer
|
|
308
308
|
local closestDistance = math.huge
|
|
309
309
|
for ____, player in ipairs(getPlayers(nil)) do
|
|
310
310
|
local distance = position:Distance(player.Position)
|
package/dist/functions/run.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { PlayerType } from "isaac-typescript-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to see if the current run can unlock achievements. For example, if playing on a
|
|
4
|
+
* set seed or in a victory lap, achievements are disabled.
|
|
5
|
+
*/
|
|
6
|
+
export declare function canRunUnlockAchievements(): boolean;
|
|
2
7
|
/**
|
|
3
8
|
* Whether or not the player is playing on a set seed (i.e. that they entered in a specific seed by
|
|
4
9
|
* pressing tab on the character selection screen). When the player resets the game on a set seed,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAQtC;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAUlD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAiBpD;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAInE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAUlC"}
|
package/dist/functions/run.lua
CHANGED
|
@@ -2,14 +2,27 @@ local ____exports = {}
|
|
|
2
2
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
3
|
local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
|
|
4
4
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
5
|
+
local SlotVariant = ____isaac_2Dtypescript_2Ddefinitions.SlotVariant
|
|
5
6
|
local ____cachedClasses = require("core.cachedClasses")
|
|
6
7
|
local game = ____cachedClasses.game
|
|
8
|
+
local ____constants = require("core.constants")
|
|
9
|
+
local VectorZero = ____constants.VectorZero
|
|
7
10
|
local ____constantsFirstLast = require("core.constantsFirstLast")
|
|
8
11
|
local FIRST_CHARACTER = ____constantsFirstLast.FIRST_CHARACTER
|
|
9
12
|
local ____runInNFrames = require("features.runInNFrames")
|
|
10
13
|
local runNextRenderFrame = ____runInNFrames.runNextRenderFrame
|
|
14
|
+
local ____entitiesSpecific = require("functions.entitiesSpecific")
|
|
15
|
+
local spawnSlot = ____entitiesSpecific.spawnSlot
|
|
11
16
|
local ____log = require("functions.log")
|
|
12
17
|
local log = ____log.log
|
|
18
|
+
--- Helper function to see if the current run can unlock achievements. For example, if playing on a
|
|
19
|
+
-- set seed or in a victory lap, achievements are disabled.
|
|
20
|
+
function ____exports.canRunUnlockAchievements(self)
|
|
21
|
+
local greedDonationMachine = spawnSlot(nil, SlotVariant.GREED_DONATION_MACHINE, 0, VectorZero)
|
|
22
|
+
local canUnlockAchievements = greedDonationMachine:Exists()
|
|
23
|
+
greedDonationMachine:Remove()
|
|
24
|
+
return canUnlockAchievements
|
|
25
|
+
end
|
|
13
26
|
--- Whether or not the player is playing on a set seed (i.e. that they entered in a specific seed by
|
|
14
27
|
-- pressing tab on the character selection screen). When the player resets the game on a set seed,
|
|
15
28
|
-- the game will not switch to a different seed.
|