isaacscript-common 1.2.218 → 1.2.219
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/customRevive.lua +3 -2
- package/dist/features/extraConsoleCommands/commands.lua +3 -2
- package/dist/functions/log.lua +6 -4
- package/dist/functions/player.lua +7 -8
- package/dist/functions/playerHealth.lua +3 -4
- package/dist/functions/pocketItems.lua +3 -2
- package/dist/functions/trinkets.lua +2 -2
- package/package.json +1 -1
|
@@ -16,6 +16,8 @@ local removeAllFamiliars = ____familiars.removeAllFamiliars
|
|
|
16
16
|
local ____log = require("functions.log")
|
|
17
17
|
local log = ____log.log
|
|
18
18
|
local logError = ____log.logError
|
|
19
|
+
local ____player = require("functions.player")
|
|
20
|
+
local isCharacter = ____player.isCharacter
|
|
19
21
|
local ____playerIndex = require("functions.playerIndex")
|
|
20
22
|
local getPlayerFromIndex = ____playerIndex.getPlayerFromIndex
|
|
21
23
|
local getPlayerIndex = ____playerIndex.getPlayerIndex
|
|
@@ -51,13 +53,12 @@ function checkWaitingForItemAnimation(self, player)
|
|
|
51
53
|
if v.run.dyingPlayerIndex == nil then
|
|
52
54
|
return
|
|
53
55
|
end
|
|
54
|
-
local character = player:GetPlayerType()
|
|
55
56
|
local playerIndex = getPlayerIndex(nil, player)
|
|
56
57
|
if playerIndex ~= v.run.dyingPlayerIndex then
|
|
57
58
|
return
|
|
58
59
|
end
|
|
59
60
|
local playerToCheckHoldingItem = player
|
|
60
|
-
if
|
|
61
|
+
if isCharacter(nil, player, PlayerType.PLAYER_THESOUL_B) then
|
|
61
62
|
local forgottenBody = player:GetOtherTwin()
|
|
62
63
|
if forgottenBody ~= nil then
|
|
63
64
|
playerToCheckHoldingItem = forgottenBody
|
|
@@ -32,6 +32,7 @@ local getNPCs = ____npc.getNPCs
|
|
|
32
32
|
local ____pills = require("functions.pills")
|
|
33
33
|
local getPillEffectName = ____pills.getPillEffectName
|
|
34
34
|
local ____player = require("functions.player")
|
|
35
|
+
local getPlayerName = ____player.getPlayerName
|
|
35
36
|
local useActiveItemTemp = ____player.useActiveItemTemp
|
|
36
37
|
local ____playerHealth = require("functions.playerHealth")
|
|
37
38
|
local addPlayerHealthType = ____playerHealth.addPlayerHealthType
|
|
@@ -501,10 +502,10 @@ function ____exports.fool(self)
|
|
|
501
502
|
end
|
|
502
503
|
function ____exports.getPosition(self)
|
|
503
504
|
for ____, player in ipairs(getPlayers(nil)) do
|
|
504
|
-
local
|
|
505
|
+
local playerName = getPlayerName(nil, player)
|
|
505
506
|
printConsole(
|
|
506
507
|
nil,
|
|
507
|
-
((((("Player position for
|
|
508
|
+
((((("Player position for " .. playerName) .. ": (") .. tostring(player.Position.X)) .. ", ") .. tostring(player.Position.Y)) .. ")"
|
|
508
509
|
)
|
|
509
510
|
end
|
|
510
511
|
end
|
package/dist/functions/log.lua
CHANGED
|
@@ -124,17 +124,19 @@ function ____exports.logEffects(player)
|
|
|
124
124
|
__TS__ArrayForEach(
|
|
125
125
|
effects,
|
|
126
126
|
function(____, effect, i)
|
|
127
|
+
local effectDescription
|
|
127
128
|
if effect.Item:IsCollectible() then
|
|
128
129
|
local collectibleName = getCollectibleName(nil, effect.Item.ID)
|
|
129
|
-
|
|
130
|
+
effectDescription = "Collectible: " .. collectibleName
|
|
130
131
|
elseif effect.Item:IsTrinket() then
|
|
131
132
|
local trinketName = getTrinketName(nil, effect.Item.ID)
|
|
132
|
-
|
|
133
|
+
effectDescription = "Trinket: " .. trinketName
|
|
133
134
|
elseif effect.Item:IsNull() then
|
|
134
|
-
|
|
135
|
+
effectDescription = "Null item: " .. tostring(effect.Item.ID)
|
|
135
136
|
else
|
|
136
|
-
|
|
137
|
+
effectDescription = "Unknown type of effect: " .. tostring(effect.Item.ID)
|
|
137
138
|
end
|
|
139
|
+
____exports.log((((((" " .. tostring(i + 1)) .. ") ") .. effectDescription) .. " (x") .. tostring(effect.Count)) .. ")")
|
|
138
140
|
end
|
|
139
141
|
)
|
|
140
142
|
end
|
|
@@ -64,6 +64,12 @@ function ____exports.getPlayerMaxHeartContainers(self, player)
|
|
|
64
64
|
end
|
|
65
65
|
return characterMaxHeartContainers
|
|
66
66
|
end
|
|
67
|
+
function ____exports.isCharacter(self, player, ...)
|
|
68
|
+
local characters = {...}
|
|
69
|
+
local characterSet = __TS__New(Set, characters)
|
|
70
|
+
local character = player:GetPlayerType()
|
|
71
|
+
return characterSet:has(character)
|
|
72
|
+
end
|
|
67
73
|
function ____exports.isKeeper(self, player)
|
|
68
74
|
local character = player:GetPlayerType()
|
|
69
75
|
return character == PlayerType.PLAYER_KEEPER or character == PlayerType.PLAYER_KEEPER_B
|
|
@@ -391,8 +397,7 @@ function ____exports.hasLostCurse(self, player)
|
|
|
391
397
|
return effects:HasNullEffect(112)
|
|
392
398
|
end
|
|
393
399
|
function ____exports.hasOpenActiveItemSlot(self, player)
|
|
394
|
-
|
|
395
|
-
if character == PlayerType.PLAYER_THESOUL_B then
|
|
400
|
+
if ____exports.isCharacter(nil, player, PlayerType.PLAYER_THESOUL_B) then
|
|
396
401
|
return false
|
|
397
402
|
end
|
|
398
403
|
local activeItemPrimary = player:GetActiveItem(ActiveSlot.SLOT_PRIMARY)
|
|
@@ -411,12 +416,6 @@ function ____exports.isBethany(self, player)
|
|
|
411
416
|
local character = player:GetPlayerType()
|
|
412
417
|
return character == PlayerType.PLAYER_BETHANY or character == PlayerType.PLAYER_BETHANY_B
|
|
413
418
|
end
|
|
414
|
-
function ____exports.isCharacter(self, player, ...)
|
|
415
|
-
local characters = {...}
|
|
416
|
-
local characterSet = __TS__New(Set, characters)
|
|
417
|
-
local character = player:GetPlayerType()
|
|
418
|
-
return characterSet:has(character)
|
|
419
|
-
end
|
|
420
419
|
function ____exports.isEden(self, player)
|
|
421
420
|
local character = player:GetPlayerType()
|
|
422
421
|
return character == PlayerType.PLAYER_EDEN or character == PlayerType.PLAYER_EDEN_B
|
|
@@ -10,6 +10,7 @@ local ____player = require("functions.player")
|
|
|
10
10
|
local getPlayerBlackHearts = ____player.getPlayerBlackHearts
|
|
11
11
|
local getPlayerHearts = ____player.getPlayerHearts
|
|
12
12
|
local getPlayerSoulHearts = ____player.getPlayerSoulHearts
|
|
13
|
+
local isCharacter = ____player.isCharacter
|
|
13
14
|
local ____utils = require("functions.utils")
|
|
14
15
|
local ensureAllCases = ____utils.ensureAllCases
|
|
15
16
|
local ____repeat = ____utils["repeat"]
|
|
@@ -213,7 +214,6 @@ function ____exports.getPlayerHealthType(self, player, healthType)
|
|
|
213
214
|
until true
|
|
214
215
|
end
|
|
215
216
|
function ____exports.removeAllPlayerHealth(self, player)
|
|
216
|
-
local character = player:GetPlayerType()
|
|
217
217
|
local goldenHearts = player:GetGoldenHearts()
|
|
218
218
|
local eternalHearts = player:GetEternalHearts()
|
|
219
219
|
local boneHearts = player:GetBoneHearts()
|
|
@@ -224,7 +224,7 @@ function ____exports.removeAllPlayerHealth(self, player)
|
|
|
224
224
|
player:AddBrokenHearts(brokenHearts * -1)
|
|
225
225
|
player:AddMaxHearts(MAX_PLAYER_HEART_CONTAINERS * -2, true)
|
|
226
226
|
player:AddSoulHearts(MAX_PLAYER_HEART_CONTAINERS * -2)
|
|
227
|
-
if
|
|
227
|
+
if isCharacter(nil, player, PlayerType.PLAYER_THESOUL) then
|
|
228
228
|
local forgotten = player:GetSubPlayer()
|
|
229
229
|
if forgotten ~= nil then
|
|
230
230
|
local forgottenBoneHearts = forgotten:GetBoneHearts()
|
|
@@ -235,7 +235,6 @@ end
|
|
|
235
235
|
function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
236
236
|
local character = player:GetPlayerType()
|
|
237
237
|
local subPlayer = player:GetSubPlayer()
|
|
238
|
-
local isTaintedMagdalene = character == PlayerType.PLAYER_MAGDALENE_B
|
|
239
238
|
____exports.removeAllPlayerHealth(nil, player)
|
|
240
239
|
if character == PlayerType.PLAYER_THESOUL and subPlayer ~= nil then
|
|
241
240
|
subPlayer:AddMaxHearts(playerHealth.maxHearts, false)
|
|
@@ -269,7 +268,7 @@ function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
|
269
268
|
playerHealth.hearts,
|
|
270
269
|
function()
|
|
271
270
|
player:AddHearts(1)
|
|
272
|
-
if
|
|
271
|
+
if character == PlayerType.PLAYER_MAGDALENE_B then
|
|
273
272
|
player:AddHearts(-1)
|
|
274
273
|
end
|
|
275
274
|
end
|
|
@@ -9,6 +9,8 @@ local ____PocketItemType = require("enums.PocketItemType")
|
|
|
9
9
|
local PocketItemType = ____PocketItemType.PocketItemType
|
|
10
10
|
local ____math = require("functions.math")
|
|
11
11
|
local range = ____math.range
|
|
12
|
+
local ____player = require("functions.player")
|
|
13
|
+
local isCharacter = ____player.isCharacter
|
|
12
14
|
function ____exports.getPocketItems(self, player)
|
|
13
15
|
local pocketItem = player:GetActiveItem(ActiveSlot.SLOT_POCKET)
|
|
14
16
|
local hasPocketItem = pocketItem ~= CollectibleType.COLLECTIBLE_NULL
|
|
@@ -50,8 +52,7 @@ function ____exports.getFirstCardOrPill(self, player)
|
|
|
50
52
|
)
|
|
51
53
|
end
|
|
52
54
|
function ____exports.hasOpenPocketItemSlot(self, player)
|
|
53
|
-
|
|
54
|
-
if character == PlayerType.PLAYER_THESOUL_B then
|
|
55
|
+
if isCharacter(nil, player, PlayerType.PLAYER_THESOUL_B) then
|
|
55
56
|
return false
|
|
56
57
|
end
|
|
57
58
|
local pocketItems = ____exports.getPocketItems(nil, player)
|
|
@@ -15,6 +15,7 @@ local hasFlag = ____flag.hasFlag
|
|
|
15
15
|
local ____pickups = require("functions.pickups")
|
|
16
16
|
local getPickups = ____pickups.getPickups
|
|
17
17
|
local ____player = require("functions.player")
|
|
18
|
+
local isCharacter = ____player.isCharacter
|
|
18
19
|
local useActiveItemTemp = ____player.useActiveItemTemp
|
|
19
20
|
local ____sprite = require("functions.sprite")
|
|
20
21
|
local clearSprite = ____sprite.clearSprite
|
|
@@ -71,8 +72,7 @@ function ____exports.getTrinkets(self, matchingSubType)
|
|
|
71
72
|
return getPickups(nil, 350, matchingSubType)
|
|
72
73
|
end
|
|
73
74
|
function ____exports.hasOpenTrinketSlot(self, player)
|
|
74
|
-
|
|
75
|
-
if character == PlayerType.PLAYER_THESOUL_B then
|
|
75
|
+
if isCharacter(nil, player, PlayerType.PLAYER_THESOUL_B) then
|
|
76
76
|
return false
|
|
77
77
|
end
|
|
78
78
|
local openTrinketSlot = ____exports.getOpenTrinketSlot(nil, player)
|