isaacscript-common 1.2.11 → 1.2.12
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/player.lua +39 -14
- package/dist/functions/util.d.ts +1 -0
- package/dist/functions/util.lua +3 -0
- package/package.json +1 -1
|
@@ -30,6 +30,7 @@ local ____collectibleSet = require("functions.collectibleSet")
|
|
|
30
30
|
local getCollectibleSet = ____collectibleSet.getCollectibleSet
|
|
31
31
|
local ____util = require("functions.util")
|
|
32
32
|
local ensureAllCases = ____util.ensureAllCases
|
|
33
|
+
local stringContains = ____util.stringContains
|
|
33
34
|
local trimPrefix = ____util.trimPrefix
|
|
34
35
|
function ____exports.getCharacterMaxHeartContainers(self, character)
|
|
35
36
|
if character == PlayerType.PLAYER_KEEPER then
|
|
@@ -83,6 +84,30 @@ function getAdjustedPlayerName(self, player)
|
|
|
83
84
|
return "Lazarus II"
|
|
84
85
|
end
|
|
85
86
|
end
|
|
87
|
+
____cond71 = ____cond71 or ____switch71 == PlayerType.PLAYER_BLACKJUDAS
|
|
88
|
+
if ____cond71 then
|
|
89
|
+
do
|
|
90
|
+
return "Dark Judas"
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
____cond71 = ____cond71 or ____switch71 == PlayerType.PLAYER_JACOB
|
|
94
|
+
if ____cond71 then
|
|
95
|
+
do
|
|
96
|
+
return "Jacob & Esau"
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
____cond71 = ____cond71 or ____switch71 == PlayerType.PLAYER_LAZARUS2_B
|
|
100
|
+
if ____cond71 then
|
|
101
|
+
do
|
|
102
|
+
return "Dead Tainted Lazarus"
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
____cond71 = ____cond71 or ____switch71 == PlayerType.PLAYER_JACOB2_B
|
|
106
|
+
if ____cond71 then
|
|
107
|
+
do
|
|
108
|
+
return "Dead Tainted Jacob"
|
|
109
|
+
end
|
|
110
|
+
end
|
|
86
111
|
do
|
|
87
112
|
do
|
|
88
113
|
return player:GetName()
|
|
@@ -102,18 +127,18 @@ function ____exports.getPlayers(self, performExclusions)
|
|
|
102
127
|
do
|
|
103
128
|
local player = Isaac.GetPlayer(i)
|
|
104
129
|
if player == nil then
|
|
105
|
-
goto
|
|
130
|
+
goto __continue81
|
|
106
131
|
end
|
|
107
132
|
if ____exports.isChildPlayer(nil, player) then
|
|
108
|
-
goto
|
|
133
|
+
goto __continue81
|
|
109
134
|
end
|
|
110
135
|
local character = player:GetPlayerType()
|
|
111
136
|
if performExclusions and EXCLUDED_CHARACTERS:has(character) then
|
|
112
|
-
goto
|
|
137
|
+
goto __continue81
|
|
113
138
|
end
|
|
114
139
|
__TS__ArrayPush(players, player)
|
|
115
140
|
end
|
|
116
|
-
::
|
|
141
|
+
::__continue81::
|
|
117
142
|
i = i + 1
|
|
118
143
|
end
|
|
119
144
|
end
|
|
@@ -341,7 +366,7 @@ function ____exports.getPlayerName(self, player)
|
|
|
341
366
|
return adjustedName
|
|
342
367
|
end
|
|
343
368
|
local baseName = trimPrefix(nil, adjustedName, "The ")
|
|
344
|
-
return "Tainted " .. baseName
|
|
369
|
+
return stringContains(nil, baseName, "Tainted") and baseName or "Tainted " .. baseName
|
|
345
370
|
end
|
|
346
371
|
function ____exports.getPlayerNumHitsRemaining(self, player)
|
|
347
372
|
local hearts = player:GetHearts()
|
|
@@ -499,9 +524,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
499
524
|
itemPool:RemoveCollectible(collectibleType)
|
|
500
525
|
end
|
|
501
526
|
repeat
|
|
502
|
-
local
|
|
503
|
-
local
|
|
504
|
-
if
|
|
527
|
+
local ____switch121 = activeSlot
|
|
528
|
+
local ____cond121 = ____switch121 == ActiveSlot.SLOT_PRIMARY
|
|
529
|
+
if ____cond121 then
|
|
505
530
|
do
|
|
506
531
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
507
532
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -510,8 +535,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
510
535
|
break
|
|
511
536
|
end
|
|
512
537
|
end
|
|
513
|
-
|
|
514
|
-
if
|
|
538
|
+
____cond121 = ____cond121 or ____switch121 == ActiveSlot.SLOT_SECONDARY
|
|
539
|
+
if ____cond121 then
|
|
515
540
|
do
|
|
516
541
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
517
542
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -526,16 +551,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
526
551
|
break
|
|
527
552
|
end
|
|
528
553
|
end
|
|
529
|
-
|
|
530
|
-
if
|
|
554
|
+
____cond121 = ____cond121 or ____switch121 == ActiveSlot.SLOT_POCKET
|
|
555
|
+
if ____cond121 then
|
|
531
556
|
do
|
|
532
557
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
533
558
|
player:SetActiveCharge(charge, activeSlot)
|
|
534
559
|
break
|
|
535
560
|
end
|
|
536
561
|
end
|
|
537
|
-
|
|
538
|
-
if
|
|
562
|
+
____cond121 = ____cond121 or ____switch121 == ActiveSlot.SLOT_POCKET2
|
|
563
|
+
if ____cond121 then
|
|
539
564
|
do
|
|
540
565
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
541
566
|
break
|
package/dist/functions/util.d.ts
CHANGED
|
@@ -80,6 +80,7 @@ export declare function onSetSeed(): boolean;
|
|
|
80
80
|
* message (which `Isaac.ConsoleOutput()` does not do by default).
|
|
81
81
|
*/
|
|
82
82
|
export declare function printConsole(msg: string): void;
|
|
83
|
+
export declare function stringContains(string: string, searchString: string): boolean;
|
|
83
84
|
/**
|
|
84
85
|
* In a Map, you can use the `clear` method to delete every element. However, in a LuaTable, the
|
|
85
86
|
* `clear` method does not exist. Use this helper function as a drop-in replacement for this.
|
package/dist/functions/util.lua
CHANGED
|
@@ -67,6 +67,9 @@ end
|
|
|
67
67
|
function ____exports.printConsole(self, msg)
|
|
68
68
|
Isaac.ConsoleOutput(msg .. "\n")
|
|
69
69
|
end
|
|
70
|
+
function ____exports.stringContains(self, ____string, searchString)
|
|
71
|
+
return (string.find(____string, searchString, nil, true) or 0) - 1 ~= -1
|
|
72
|
+
end
|
|
70
73
|
function ____exports.tableClear(self, ____table)
|
|
71
74
|
for key in pairs(____table) do
|
|
72
75
|
____table[key] = nil
|