isaacscript-common 1.0.335 → 1.0.339
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/bitwise.d.ts +3 -0
- package/dist/functions/bitwise.lua +14 -0
- package/dist/functions/player.d.ts +2 -0
- package/dist/functions/player.lua +15 -0
- package/dist/functions/rooms.d.ts +6 -0
- package/dist/functions/rooms.lua +7 -0
- package/dist/functions/util.lua +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.lua +8 -0
- package/package.json +2 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
function ____exports.getKBitOfN(self, k, n)
|
|
4
|
+
return (n >> k) & 1
|
|
5
|
+
end
|
|
6
|
+
function ____exports.getNumBitsOfN(self, n)
|
|
7
|
+
local numBits = 0
|
|
8
|
+
while n > 0 do
|
|
9
|
+
numBits = numBits + 1
|
|
10
|
+
n = n >> 1
|
|
11
|
+
end
|
|
12
|
+
return numBits
|
|
13
|
+
end
|
|
14
|
+
return ____exports
|
|
@@ -163,3 +163,5 @@ export declare function isJacobOrEsau(player: EntityPlayer): boolean;
|
|
|
163
163
|
export declare function isKeeper(player: EntityPlayer): boolean;
|
|
164
164
|
export declare function isLost(player: EntityPlayer): boolean;
|
|
165
165
|
export declare function removeDeadEyeMultiplier(player: EntityPlayer): void;
|
|
166
|
+
/** This function was originally created by im_tem. */
|
|
167
|
+
export declare function setBlindfold(player: EntityPlayer, enabled: boolean): void;
|
|
@@ -337,4 +337,19 @@ function ____exports.removeDeadEyeMultiplier(self, player)
|
|
|
337
337
|
end
|
|
338
338
|
end
|
|
339
339
|
end
|
|
340
|
+
function ____exports.setBlindfold(self, player, enabled)
|
|
341
|
+
local game = Game()
|
|
342
|
+
local character = player:GetPlayerType()
|
|
343
|
+
local challenge = Isaac.GetChallenge()
|
|
344
|
+
if enabled then
|
|
345
|
+
game.Challenge = Challenge.CHALLENGE_NULL
|
|
346
|
+
player:ChangePlayerType(character)
|
|
347
|
+
game.Challenge = challenge
|
|
348
|
+
player:TryRemoveNullCostume(NullItemID.ID_BLINDFOLD)
|
|
349
|
+
else
|
|
350
|
+
game.Challenge = Challenge.CHALLENGE_SOLAR_SYSTEM
|
|
351
|
+
player:ChangePlayerType(character)
|
|
352
|
+
game.Challenge = challenge
|
|
353
|
+
end
|
|
354
|
+
end
|
|
340
355
|
return ____exports
|
|
@@ -36,6 +36,12 @@ export declare function getRoomIndex(): int;
|
|
|
36
36
|
* This function only searches through rooms in the current dimension.
|
|
37
37
|
*/
|
|
38
38
|
export declare function getRoomIndexesForType(roomType: RoomType): Set<int>;
|
|
39
|
+
/**
|
|
40
|
+
* Helper function to get the name of the room as it appears in the STB/XML data.
|
|
41
|
+
*
|
|
42
|
+
* @returns The room name. Returns "Unknown" if the type was not found.
|
|
43
|
+
*/
|
|
44
|
+
export declare function getRoomName(): string;
|
|
39
45
|
/**
|
|
40
46
|
* Helper function to get the stage ID for the room from the XML/STB data. The room stage ID will
|
|
41
47
|
* correspond to the first number in the filename of the XML/STB file. For example, a Depths room
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -75,6 +75,13 @@ function ____exports.getRoomIndexesForType(self, roomType)
|
|
|
75
75
|
end
|
|
76
76
|
return roomIndexes
|
|
77
77
|
end
|
|
78
|
+
function ____exports.getRoomName(self)
|
|
79
|
+
local roomData = ____exports.getRoomData(nil)
|
|
80
|
+
if roomData == nil then
|
|
81
|
+
return "Unknown"
|
|
82
|
+
end
|
|
83
|
+
return roomData.Name
|
|
84
|
+
end
|
|
78
85
|
function ____exports.getRoomStageID(self)
|
|
79
86
|
local roomData = ____exports.getRoomData(nil)
|
|
80
87
|
if roomData == nil then
|
package/dist/functions/util.lua
CHANGED
|
@@ -107,16 +107,16 @@ function ____exports.teleport(self, roomIndex, direction, roomTransitionAnim)
|
|
|
107
107
|
end
|
|
108
108
|
function ____exports.vectorToDirection(self, vector)
|
|
109
109
|
local degrees = vector:GetAngleDegrees()
|
|
110
|
-
if (degrees
|
|
110
|
+
if (degrees > -45) and (degrees < 45) then
|
|
111
111
|
return Direction.RIGHT
|
|
112
112
|
end
|
|
113
|
-
if (degrees >= 45) and (degrees
|
|
113
|
+
if (degrees >= 45) and (degrees <= 135) then
|
|
114
114
|
return Direction.DOWN
|
|
115
115
|
end
|
|
116
|
-
if (degrees
|
|
116
|
+
if (degrees <= -45) and (degrees >= -135) then
|
|
117
117
|
return Direction.UP
|
|
118
118
|
end
|
|
119
|
-
if (degrees
|
|
119
|
+
if (degrees > 135) or (degrees < -135) then
|
|
120
120
|
return Direction.LEFT
|
|
121
121
|
end
|
|
122
122
|
return Direction.NO_DIRECTION
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { forgottenSwitch } from "./features/forgottenSwitch";
|
|
|
5
5
|
export { runInNFrames, runNextFrame } from "./features/runInNFrames";
|
|
6
6
|
export { saveDataManager, saveDataManagerSave, saveDataManagerSetGlobal, } from "./features/saveDataManager/main";
|
|
7
7
|
export * from "./functions/array";
|
|
8
|
+
export * from "./functions/bitwise";
|
|
8
9
|
export * from "./functions/collectibles";
|
|
9
10
|
export { deepCopy } from "./functions/deepCopy";
|
|
10
11
|
export { deepCopyTests } from "./functions/deepCopyTests";
|
package/dist/index.lua
CHANGED
|
@@ -88,6 +88,14 @@ do
|
|
|
88
88
|
end
|
|
89
89
|
end
|
|
90
90
|
end
|
|
91
|
+
do
|
|
92
|
+
local ____export = require("functions.bitwise")
|
|
93
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
94
|
+
if ____exportKey ~= "default" then
|
|
95
|
+
____exports[____exportKey] = ____exportValue
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
91
99
|
do
|
|
92
100
|
local ____export = require("functions.collectibles")
|
|
93
101
|
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.339",
|
|
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.208",
|
|
29
29
|
"isaacscript-lint": "^1.0.61",
|
|
30
30
|
"typedoc": "^0.22.5",
|
|
31
31
|
"typescript": "4.4.3",
|