isaacscript-common 1.2.224 → 1.2.225
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/deepCopy.lua +1 -4
- package/dist/functions/flying.lua +1 -1
- package/dist/functions/math.d.ts +1 -0
- package/dist/functions/math.lua +5 -0
- package/dist/functions/player.lua +3 -3
- package/dist/functions/revive.lua +2 -2
- package/dist/objects/directionToDegrees.d.ts +4 -0
- package/dist/objects/directionToDegrees.lua +10 -0
- package/package.json +2 -2
|
@@ -236,10 +236,7 @@ function validateValue(self, value, valueType, traversalDescription)
|
|
|
236
236
|
end
|
|
237
237
|
end
|
|
238
238
|
function getNewValue(self, key, value, traversalDescription, serializationType)
|
|
239
|
-
if isSerializableIsaacAPIClass(nil, value) then
|
|
240
|
-
return copySerializableIsaacAPIClass(nil, value, serializationType)
|
|
241
|
-
end
|
|
242
|
-
if isSerializedIsaacAPIClass(nil, value) and serializationType == SerializationType.DESERIALIZE then
|
|
239
|
+
if isSerializableIsaacAPIClass(nil, value) or isSerializedIsaacAPIClass(nil, value) and serializationType == SerializationType.DESERIALIZE then
|
|
243
240
|
return copySerializableIsaacAPIClass(nil, value, serializationType)
|
|
244
241
|
end
|
|
245
242
|
if type(value) == "table" then
|
|
@@ -17,7 +17,7 @@ local FLYING_CHARACTERS = __TS__New(Set, {
|
|
|
17
17
|
PlayerType.PLAYER_THESOUL_B
|
|
18
18
|
})
|
|
19
19
|
local FLYING_TRINKETS = __TS__New(Set, {TrinketType.TRINKET_BAT_WING, TrinketType.TRINKET_AZAZELS_STUMP})
|
|
20
|
-
local FLYING_NULL_ITEMS = {
|
|
20
|
+
local FLYING_NULL_ITEMS = {NullItemID.ID_REVERSE_SUN, NullItemID.ID_SPIRIT_SHACKLES_SOUL, NullItemID.ID_LOST_CURSE}
|
|
21
21
|
function ____exports.getFlyingCollectibles(self, pruneConditionalItems)
|
|
22
22
|
local collectiblesWithFlyingCacheFlag = getCollectiblesForCacheFlag(nil, CacheFlag.CACHE_FLYING)
|
|
23
23
|
local collectiblesWithAllCacheFlag = getCollectiblesForCacheFlag(nil, CacheFlag.CACHE_ALL)
|
package/dist/functions/math.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
export declare function directionToDegrees(direction: Direction): int;
|
|
2
3
|
export declare function getAngleDifference(angle1: float, angle2: float): float;
|
|
3
4
|
/**
|
|
4
5
|
* Helper function to get an array of equidistant points on the circumference around a circle.
|
package/dist/functions/math.lua
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__ArrayPush = ____lualib.__TS__ArrayPush
|
|
3
3
|
local ____exports = {}
|
|
4
|
+
local ____directionToDegrees = require("objects.directionToDegrees")
|
|
5
|
+
local DIRECTION_TO_DEGREES = ____directionToDegrees.DIRECTION_TO_DEGREES
|
|
4
6
|
local ____vector = require("functions.vector")
|
|
5
7
|
local directionToVector = ____vector.directionToVector
|
|
8
|
+
function ____exports.directionToDegrees(self, direction)
|
|
9
|
+
return DIRECTION_TO_DEGREES[direction]
|
|
10
|
+
end
|
|
6
11
|
function ____exports.getAngleDifference(self, angle1, angle2)
|
|
7
12
|
local subtractedAngle = angle1 - angle2
|
|
8
13
|
return (subtractedAngle + 180) % 360 - 180
|
|
@@ -394,7 +394,7 @@ function ____exports.getTotalPlayerCollectibles(self, collectibleType)
|
|
|
394
394
|
end
|
|
395
395
|
function ____exports.hasLostCurse(self, player)
|
|
396
396
|
local effects = player:GetEffects()
|
|
397
|
-
return effects:HasNullEffect(
|
|
397
|
+
return effects:HasNullEffect(NullItemID.ID_LOST_CURSE)
|
|
398
398
|
end
|
|
399
399
|
function ____exports.hasOpenActiveItemSlot(self, player)
|
|
400
400
|
if ____exports.isCharacter(nil, player, PlayerType.PLAYER_THESOUL_B) then
|
|
@@ -543,14 +543,14 @@ function ____exports.setBlindfold(self, player, enabled, modifyCostume)
|
|
|
543
543
|
player:ChangePlayerType(character)
|
|
544
544
|
game.Challenge = challenge
|
|
545
545
|
if not modifyCostume then
|
|
546
|
-
player:TryRemoveNullCostume(
|
|
546
|
+
player:TryRemoveNullCostume(NullItemID.ID_BLINDFOLD)
|
|
547
547
|
end
|
|
548
548
|
else
|
|
549
549
|
game.Challenge = Challenge.CHALLENGE_NULL
|
|
550
550
|
player:ChangePlayerType(character)
|
|
551
551
|
game.Challenge = challenge
|
|
552
552
|
if modifyCostume then
|
|
553
|
-
player:TryRemoveNullCostume(
|
|
553
|
+
player:TryRemoveNullCostume(NullItemID.ID_BLINDFOLD)
|
|
554
554
|
end
|
|
555
555
|
end
|
|
556
556
|
end
|
|
@@ -32,8 +32,8 @@ function ____exports.willReviveFromSpiritShackles(self, player)
|
|
|
32
32
|
return false
|
|
33
33
|
end
|
|
34
34
|
local effects = player:GetEffects()
|
|
35
|
-
local spiritShacklesEnabled = not effects:HasNullEffect(
|
|
36
|
-
local playerInSoulForm = effects:HasNullEffect(
|
|
35
|
+
local spiritShacklesEnabled = not effects:HasNullEffect(NullItemID.ID_SPIRIT_SHACKLES_DISABLED)
|
|
36
|
+
local playerInSoulForm = effects:HasNullEffect(NullItemID.ID_SPIRIT_SHACKLES_SOUL)
|
|
37
37
|
return spiritShacklesEnabled and not playerInSoulForm
|
|
38
38
|
end
|
|
39
39
|
function ____exports.isDamageToPlayerFatal(self, player, damageAmount, damageSource, lastDamageGameFrame)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
____exports.DIRECTION_TO_DEGREES = {
|
|
4
|
+
[Direction.NO_DIRECTION] = 0,
|
|
5
|
+
[Direction.LEFT] = 180,
|
|
6
|
+
[Direction.UP] = 270,
|
|
7
|
+
[Direction.RIGHT] = 0,
|
|
8
|
+
[Direction.DOWN] = 90
|
|
9
|
+
}
|
|
10
|
+
return ____exports
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.225",
|
|
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.384",
|
|
29
29
|
"isaacscript-lint": "^1.0.95",
|
|
30
30
|
"isaacscript-tsconfig": "^1.1.8",
|
|
31
31
|
"typedoc": "^0.22.13",
|