isaacscript-common 9.0.0 → 9.1.1
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/postPlayerCollectible.d.ts.map +1 -1
- package/dist/callbacks/postPlayerCollectible.lua +101 -27
- package/dist/enums/ModCallbackCustom.d.ts +4 -2
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/features/playerInventory.d.ts.map +1 -1
- package/dist/features/playerInventory.lua +4 -50
- package/dist/functions/cards.d.ts.map +1 -1
- package/dist/functions/collectibleCacheFlag.d.ts +4 -1
- package/dist/functions/collectibleCacheFlag.d.ts.map +1 -1
- package/dist/functions/collectibleCacheFlag.lua +5 -2
- package/dist/functions/debug.d.ts +25 -0
- package/dist/functions/debug.d.ts.map +1 -1
- package/dist/functions/debug.lua +50 -0
- package/dist/functions/familiars.d.ts.map +1 -1
- package/dist/functions/itemPool.lua +9 -11
- package/dist/functions/log.d.ts +2 -7
- package/dist/functions/log.d.ts.map +1 -1
- package/dist/functions/log.lua +9 -31
- package/dist/functions/players.d.ts +6 -0
- package/dist/functions/players.d.ts.map +1 -1
- package/dist/functions/players.lua +7 -1
- package/dist/index.d.ts +16 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +0 -8
- package/package.json +1 -1
- package/src/callbacks/postPlayerCollectible.ts +174 -38
- package/src/enums/ModCallbackCustom.ts +4 -2
- package/src/features/playerInventory.ts +5 -65
- package/src/functions/cards.ts +4 -2
- package/src/functions/collectibleCacheFlag.ts +6 -2
- package/src/functions/debug.ts +49 -0
- package/src/functions/familiars.ts +1 -0
- package/src/functions/itemPool.ts +6 -7
- package/src/functions/log.ts +15 -35
- package/src/functions/players.ts +14 -1
- package/src/index.ts +0 -1
- package/dist/functions/dev.d.ts +0 -20
- package/dist/functions/dev.d.ts.map +0 -1
- package/dist/functions/dev.lua +0 -34
- package/src/functions/dev.ts +0 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postPlayerCollectible.d.ts","sourceRoot":"","sources":["../../src/callbacks/postPlayerCollectible.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"postPlayerCollectible.d.ts","sourceRoot":"","sources":["../../src/callbacks/postPlayerCollectible.ts"],"names":[],"mappings":";AAgDA,wBAAgB,kCAAkC,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAUjE"}
|
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
-
local Map = ____lualib.Map
|
|
3
2
|
local __TS__New = ____lualib.__TS__New
|
|
3
|
+
local Map = ____lualib.Map
|
|
4
|
+
local Set = ____lualib.Set
|
|
4
5
|
local __TS__Spread = ____lualib.__TS__Spread
|
|
5
6
|
local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
|
|
6
7
|
local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
|
|
7
8
|
local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
|
|
9
|
+
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
8
10
|
local __TS__ArraySort = ____lualib.__TS__ArraySort
|
|
9
11
|
local ____exports = {}
|
|
10
|
-
local hasSubscriptions, postPEffectUpdate,
|
|
12
|
+
local hasSubscriptions, updateCollectibleMapAndFire, useItemD4, postPEffectUpdate, checkActiveItemsChanged, entityTakeDmgPlayer, v
|
|
11
13
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
14
|
+
local ActiveSlot = ____isaac_2Dtypescript_2Ddefinitions.ActiveSlot
|
|
15
|
+
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
16
|
+
local DamageFlag = ____isaac_2Dtypescript_2Ddefinitions.DamageFlag
|
|
17
|
+
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
12
18
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
19
|
+
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
13
20
|
local ____DefaultMap = require("classes.DefaultMap")
|
|
14
21
|
local DefaultMap = ____DefaultMap.DefaultMap
|
|
22
|
+
local ____runInNFrames = require("features.runInNFrames")
|
|
23
|
+
local runNextGameFrame = ____runInNFrames.runNextGameFrame
|
|
15
24
|
local ____exports = require("features.saveDataManager.exports")
|
|
16
25
|
local saveDataManager = ____exports.saveDataManager
|
|
26
|
+
local ____array = require("functions.array")
|
|
27
|
+
local arrayEquals = ____array.arrayEquals
|
|
28
|
+
local ____enums = require("functions.enums")
|
|
29
|
+
local getEnumValues = ____enums.getEnumValues
|
|
30
|
+
local ____flag = require("functions.flag")
|
|
31
|
+
local hasFlag = ____flag.hasFlag
|
|
17
32
|
local ____playerDataStructures = require("functions.playerDataStructures")
|
|
18
33
|
local defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
|
|
19
|
-
local mapGetPlayer = ____playerDataStructures.mapGetPlayer
|
|
20
34
|
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
21
35
|
local ____players = require("functions.players")
|
|
22
36
|
local getPlayerCollectibleMap = ____players.getPlayerCollectibleMap
|
|
@@ -31,42 +45,30 @@ local postPlayerCollectibleRemovedHasSubscriptions = ____postPlayerCollectibleRe
|
|
|
31
45
|
function hasSubscriptions(self)
|
|
32
46
|
return postPlayerCollectibleAddedHasSubscriptions(nil) or postPlayerCollectibleRemovedHasSubscriptions(nil)
|
|
33
47
|
end
|
|
34
|
-
function
|
|
35
|
-
if not hasSubscriptions(nil) then
|
|
36
|
-
return
|
|
37
|
-
end
|
|
38
|
-
local oldCollectibleCount = mapGetPlayer(nil, v.run.playersCollectibleCount, player)
|
|
39
|
-
local newCollectibleCount = player:GetCollectibleCount()
|
|
40
|
-
mapSetPlayer(nil, v.run.playersCollectibleCount, player, newCollectibleCount)
|
|
41
|
-
if oldCollectibleCount == nil then
|
|
42
|
-
return
|
|
43
|
-
end
|
|
44
|
-
local difference = newCollectibleCount - oldCollectibleCount
|
|
45
|
-
if difference > 0 then
|
|
46
|
-
collectibleCountChanged(nil, player, difference, true)
|
|
47
|
-
elseif difference < 0 then
|
|
48
|
-
collectibleCountChanged(nil, player, difference * -1, false)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
function collectibleCountChanged(self, player, numCollectiblesChanged, increased)
|
|
48
|
+
function updateCollectibleMapAndFire(self, player, numCollectiblesChanged)
|
|
52
49
|
local oldCollectibleMap = defaultMapGetPlayer(nil, v.run.playersCollectibleMap, player)
|
|
53
50
|
local newCollectibleMap = getPlayerCollectibleMap(nil, player)
|
|
54
51
|
mapSetPlayer(nil, v.run.playersCollectibleMap, player, newCollectibleMap)
|
|
52
|
+
local ____Set_1 = Set
|
|
55
53
|
local ____array_0 = __TS__SparseArrayNew(__TS__Spread(oldCollectibleMap:keys()))
|
|
56
54
|
__TS__SparseArrayPush(
|
|
57
55
|
____array_0,
|
|
58
56
|
__TS__Spread(newCollectibleMap:keys())
|
|
59
57
|
)
|
|
60
|
-
local
|
|
61
|
-
|
|
58
|
+
local collectibleTypesSet = __TS__New(
|
|
59
|
+
____Set_1,
|
|
60
|
+
{__TS__SparseArraySpread(____array_0)}
|
|
61
|
+
)
|
|
62
62
|
local numFired = 0
|
|
63
|
-
for ____, collectibleType in
|
|
63
|
+
for ____, collectibleType in __TS__Iterator(collectibleTypesSet:values()) do
|
|
64
64
|
local oldNum = oldCollectibleMap:get(collectibleType) or 0
|
|
65
65
|
local newNum = newCollectibleMap:get(collectibleType) or 0
|
|
66
|
-
local difference =
|
|
66
|
+
local difference = newNum - oldNum
|
|
67
|
+
local increased = difference > 0
|
|
68
|
+
local absoluteDifference = math.abs(difference)
|
|
67
69
|
____repeat(
|
|
68
70
|
nil,
|
|
69
|
-
|
|
71
|
+
absoluteDifference,
|
|
70
72
|
function()
|
|
71
73
|
if increased then
|
|
72
74
|
postPlayerCollectibleAddedFire(nil, player, collectibleType)
|
|
@@ -81,15 +83,87 @@ function collectibleCountChanged(self, player, numCollectiblesChanged, increased
|
|
|
81
83
|
end
|
|
82
84
|
end
|
|
83
85
|
end
|
|
86
|
+
function useItemD4(self, _collectibleType, _rng, player)
|
|
87
|
+
updateCollectibleMapAndFire(nil, player, nil)
|
|
88
|
+
return nil
|
|
89
|
+
end
|
|
90
|
+
function postPEffectUpdate(self, player)
|
|
91
|
+
if not hasSubscriptions(nil) then
|
|
92
|
+
return
|
|
93
|
+
end
|
|
94
|
+
local oldCollectibleCount = defaultMapGetPlayer(nil, v.run.playersCollectibleCount, player)
|
|
95
|
+
local newCollectibleCount = player:GetCollectibleCount()
|
|
96
|
+
mapSetPlayer(nil, v.run.playersCollectibleCount, player, newCollectibleCount)
|
|
97
|
+
local difference = newCollectibleCount - oldCollectibleCount
|
|
98
|
+
if difference > 0 then
|
|
99
|
+
updateCollectibleMapAndFire(nil, player, difference)
|
|
100
|
+
elseif difference < 0 then
|
|
101
|
+
updateCollectibleMapAndFire(nil, player, difference * -1)
|
|
102
|
+
elseif difference == 0 then
|
|
103
|
+
checkActiveItemsChanged(nil, player)
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
function checkActiveItemsChanged(self, player)
|
|
107
|
+
local activeItemMap = defaultMapGetPlayer(nil, v.run.playersActiveItemMap, player)
|
|
108
|
+
local oldCollectibleTypes = {}
|
|
109
|
+
local newCollectibleTypes = {}
|
|
110
|
+
for ____, activeSlot in ipairs(getEnumValues(nil, ActiveSlot)) do
|
|
111
|
+
local oldCollectibleType = activeItemMap:get(activeSlot) or CollectibleType.NULL
|
|
112
|
+
local newCollectibleType = player:GetActiveItem(activeSlot)
|
|
113
|
+
activeItemMap:set(activeSlot, newCollectibleType)
|
|
114
|
+
oldCollectibleTypes[#oldCollectibleTypes + 1] = oldCollectibleType
|
|
115
|
+
newCollectibleTypes[#newCollectibleTypes + 1] = newCollectibleType
|
|
116
|
+
end
|
|
117
|
+
__TS__ArraySort(oldCollectibleTypes)
|
|
118
|
+
__TS__ArraySort(newCollectibleTypes)
|
|
119
|
+
if not arrayEquals(nil, oldCollectibleTypes, newCollectibleTypes) then
|
|
120
|
+
updateCollectibleMapAndFire(nil, player, nil)
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
function entityTakeDmgPlayer(self, entity, _amount, damageFlags, _source, _countdownFrames)
|
|
124
|
+
if hasFlag(nil, damageFlags, DamageFlag.FAKE) then
|
|
125
|
+
return nil
|
|
126
|
+
end
|
|
127
|
+
local player = entity:ToPlayer()
|
|
128
|
+
if player == nil then
|
|
129
|
+
return nil
|
|
130
|
+
end
|
|
131
|
+
local character = player:GetPlayerType()
|
|
132
|
+
if character ~= PlayerType.EDEN_B then
|
|
133
|
+
return nil
|
|
134
|
+
end
|
|
135
|
+
local ptr = EntityPtr(player)
|
|
136
|
+
runNextGameFrame(
|
|
137
|
+
nil,
|
|
138
|
+
function()
|
|
139
|
+
local futureEntity = ptr.Ref
|
|
140
|
+
if futureEntity == nil then
|
|
141
|
+
return
|
|
142
|
+
end
|
|
143
|
+
local futurePlayer = futureEntity:ToPlayer()
|
|
144
|
+
if futurePlayer == nil then
|
|
145
|
+
return
|
|
146
|
+
end
|
|
147
|
+
updateCollectibleMapAndFire(nil, player, nil)
|
|
148
|
+
end
|
|
149
|
+
)
|
|
150
|
+
return nil
|
|
151
|
+
end
|
|
84
152
|
v = {run = {
|
|
85
|
-
playersCollectibleCount = __TS__New(
|
|
153
|
+
playersCollectibleCount = __TS__New(DefaultMap, 0),
|
|
86
154
|
playersCollectibleMap = __TS__New(
|
|
87
155
|
DefaultMap,
|
|
88
156
|
function() return __TS__New(Map) end
|
|
157
|
+
),
|
|
158
|
+
playersActiveItemMap = __TS__New(
|
|
159
|
+
DefaultMap,
|
|
160
|
+
function() return __TS__New(Map) end
|
|
89
161
|
)
|
|
90
162
|
}}
|
|
91
163
|
function ____exports.postPlayerCollectibleCallbacksInit(self, mod)
|
|
92
164
|
saveDataManager(nil, "postPlayerCollectible", v, hasSubscriptions)
|
|
165
|
+
mod:AddCallback(ModCallback.POST_USE_ITEM, useItemD4, CollectibleType.D4)
|
|
93
166
|
mod:AddCallback(ModCallback.POST_PEFFECT_UPDATE, postPEffectUpdate)
|
|
167
|
+
mod:AddCallback(ModCallback.ENTITY_TAKE_DMG, entityTakeDmgPlayer, EntityType.PLAYER)
|
|
94
168
|
end
|
|
95
169
|
return ____exports
|
|
@@ -892,7 +892,8 @@ export declare enum ModCallbackCustom {
|
|
|
892
892
|
POST_PLAYER_CHANGE_TYPE = 57,
|
|
893
893
|
/**
|
|
894
894
|
* Fires from the `POST_PEFFECT_UPDATE` callback when a player's collectible count is higher than
|
|
895
|
-
* what it was on the previous frame or when
|
|
895
|
+
* what it was on the previous frame, or when the active items change, or when the build is
|
|
896
|
+
* rerolled.
|
|
896
897
|
*
|
|
897
898
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
898
899
|
* only fire if the collectible matches the `CollectibleType` provided.
|
|
@@ -907,7 +908,8 @@ export declare enum ModCallbackCustom {
|
|
|
907
908
|
POST_PLAYER_COLLECTIBLE_ADDED = 58,
|
|
908
909
|
/**
|
|
909
910
|
* Fires from the `POST_PEFFECT_UPDATE` callback when a player's collectible count is lower than
|
|
910
|
-
* what it was on the previous frame or when
|
|
911
|
+
* what it was on the previous frame, or when the active items change, or when the build is
|
|
912
|
+
* rerolled.
|
|
911
913
|
*
|
|
912
914
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
913
915
|
* only fire if the collectible matches the `CollectibleType` provided.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModCallbackCustom.d.ts","sourceRoot":"","sources":["../../src/enums/ModCallbackCustom.ts"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,oBAAY,iBAAiB;IAC3B;;;;;;;;;;OAUG;IACH,oBAAoB,IAAA;IAEpB;;;;;;;;;;OAUG;IACH,mBAAmB,IAAA;IAEnB;;;;;;;;;OASG;IACH,kBAAkB,IAAA;IAElB;;;;;;;;;;;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B;;;;;;;;;;;;OAYG;IACH,cAAc,KAAA;IAEd;;;;;;;;;OASG;IACH,2BAA2B,KAAA;IAE3B;;;;;;;;;;;;;;;;;OAiBG;IACH,mBAAmB,KAAA;IAEnB;;;;;;;;;;;;OAYG;IACH,mBAAmB,KAAA;IAEnB;;;;;;;;;;;;;;OAcG;IACH,cAAc,KAAA;IAEd;;;;;;;;;OASG;IACH,gBAAgB,KAAA;IAEhB;;;;;;;;;OASG;IACH,gBAAgB,KAAA;IAEhB;;;;;;;;;OASG;IACH,kBAAkB,KAAA;IAElB;;;;;;;;;OASG;IACH,kBAAkB,KAAA;IAElB;;;;;;;;;;;;;OAaG;IACH,mBAAmB,KAAA;IAEnB;;;;;;;;;;;;OAYG;IACH,wBAAwB,KAAA;IAExB;;;;;;;;;OASG;IACH,eAAe,KAAA;IAEf;;;;;;;;;OASG;IACH,eAAe,KAAA;IAEf;;;;;;;;;;;;;;;;OAgBG;IACH,mBAAmB,KAAA;IAEnB;;;;;;;;;;;;OAYG;IACH,kBAAkB,KAAA;IAElB;;;;;;;;;;;;;OAaG;IACH,iBAAiB,KAAA;IAEjB;;;;;;;;;;;;;;;;OAgBG;IACH,iBAAiB,KAAA;IAEjB;;;;;;;;;;;;;;;;;OAiBG;IACH,eAAe,KAAA;IAEf;;;;;;;;;;;;OAYG;IACH,aAAa,KAAA;CACd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerInventory.d.ts","sourceRoot":"","sources":["../../src/features/playerInventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"playerInventory.d.ts","sourceRoot":"","sources":["../../src/features/playerInventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AA2D/D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,yBAAyB,UAAO,GAC/B,eAAe,EAAE,CAYnB;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,YAAY,GACnB,eAAe,GAAG,SAAS,CAK7B"}
|
|
@@ -2,10 +2,7 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local __TS__New = ____lualib.__TS__New
|
|
3
3
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
4
4
|
local ____exports = {}
|
|
5
|
-
local
|
|
6
|
-
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
|
-
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
8
|
-
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
5
|
+
local postCollectibleAdded, postCollectibleRemoved, v
|
|
9
6
|
local ____DefaultMap = require("classes.DefaultMap")
|
|
10
7
|
local DefaultMap = ____DefaultMap.DefaultMap
|
|
11
8
|
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
|
|
@@ -18,50 +15,10 @@ local copyArray = ____array.copyArray
|
|
|
18
15
|
local getLastElement = ____array.getLastElement
|
|
19
16
|
local ____collectibles = require("functions.collectibles")
|
|
20
17
|
local isActiveCollectible = ____collectibles.isActiveCollectible
|
|
21
|
-
local ____collectibleSet = require("functions.collectibleSet")
|
|
22
|
-
local getCollectibleArray = ____collectibleSet.getCollectibleArray
|
|
23
18
|
local ____playerDataStructures = require("functions.playerDataStructures")
|
|
24
19
|
local defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
|
|
25
|
-
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
26
|
-
local ____playerIndex = require("functions.playerIndex")
|
|
27
|
-
local getAllPlayers = ____playerIndex.getAllPlayers
|
|
28
|
-
local getPlayerIndex = ____playerIndex.getPlayerIndex
|
|
29
|
-
local ____utils = require("functions.utils")
|
|
30
|
-
local ____repeat = ____utils["repeat"]
|
|
31
20
|
local ____exports = require("features.saveDataManager.exports")
|
|
32
21
|
local saveDataManager = ____exports.saveDataManager
|
|
33
|
-
function newPlayerInventory(self, player)
|
|
34
|
-
local inventory = {}
|
|
35
|
-
for ____, collectibleType in ipairs(getCollectibleArray(nil)) do
|
|
36
|
-
if player:HasCollectible(collectibleType) then
|
|
37
|
-
local numCollectibles = player:GetCollectibleNum(collectibleType, true)
|
|
38
|
-
____repeat(
|
|
39
|
-
nil,
|
|
40
|
-
numCollectibles,
|
|
41
|
-
function()
|
|
42
|
-
inventory[#inventory + 1] = collectibleType
|
|
43
|
-
end
|
|
44
|
-
)
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
return inventory
|
|
48
|
-
end
|
|
49
|
-
function resetInventory(self, player)
|
|
50
|
-
local inventory = newPlayerInventory(nil, player)
|
|
51
|
-
mapSetPlayer(nil, v.run.playersInventory, player, inventory)
|
|
52
|
-
end
|
|
53
|
-
function useItemD4(self, _collectibleType, _rng, player)
|
|
54
|
-
resetInventory(nil, player)
|
|
55
|
-
return nil
|
|
56
|
-
end
|
|
57
|
-
function postGameStarted(self)
|
|
58
|
-
for ____, player in ipairs(getAllPlayers(nil)) do
|
|
59
|
-
local playerIndex = getPlayerIndex(nil, player)
|
|
60
|
-
if not v.run.playersInventory:has(playerIndex) then
|
|
61
|
-
resetInventory(nil, player)
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
22
|
function postCollectibleAdded(self, player, collectibleType)
|
|
66
23
|
local inventory = defaultMapGetPlayer(nil, v.run.playersInventory, player, player)
|
|
67
24
|
inventory[#inventory + 1] = collectibleType
|
|
@@ -73,14 +30,12 @@ end
|
|
|
73
30
|
local FEATURE_NAME = "playerInventory"
|
|
74
31
|
v = {run = {playersInventory = __TS__New(
|
|
75
32
|
DefaultMap,
|
|
76
|
-
function(
|
|
33
|
+
function() return {} end
|
|
77
34
|
)}}
|
|
78
35
|
---
|
|
79
36
|
-- @internal
|
|
80
37
|
function ____exports.playerInventoryInit(self, mod)
|
|
81
38
|
saveDataManager(nil, FEATURE_NAME, v)
|
|
82
|
-
mod:AddCallback(ModCallback.POST_USE_ITEM, useItemD4, CollectibleType.D4)
|
|
83
|
-
mod:AddCallback(ModCallback.POST_GAME_STARTED, postGameStarted)
|
|
84
39
|
mod:AddCallbackCustom(ModCallbackCustom.POST_PLAYER_COLLECTIBLE_ADDED, postCollectibleAdded)
|
|
85
40
|
mod:AddCallbackCustom(ModCallbackCustom.POST_PLAYER_COLLECTIBLE_REMOVED, postCollectibleRemoved)
|
|
86
41
|
end
|
|
@@ -108,12 +63,11 @@ function ____exports.getPlayerInventory(self, player, includeActiveCollectibles)
|
|
|
108
63
|
end
|
|
109
64
|
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
110
65
|
local inventory = defaultMapGetPlayer(nil, v.run.playersInventory, player, player)
|
|
111
|
-
local copiedInventory = copyArray(nil, inventory)
|
|
112
66
|
if includeActiveCollectibles then
|
|
113
|
-
return
|
|
67
|
+
return copyArray(nil, inventory)
|
|
114
68
|
end
|
|
115
69
|
return __TS__ArrayFilter(
|
|
116
|
-
|
|
70
|
+
inventory,
|
|
117
71
|
function(____, collectibleType) return not isActiveCollectible(nil, collectibleType) end
|
|
118
72
|
)
|
|
119
73
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cards.d.ts","sourceRoot":"","sources":["../../src/functions/cards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAkE5E;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"cards.d.ts","sourceRoot":"","sources":["../../src/functions/cards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAkE5E;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM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AC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAElD;AAED,2DAA2D;AAC3D,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEzD;AAED,wDAAwD;AACxD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEtD;AAED,yDAAyD;AACzD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAEvD;AAED,iDAAiD;AACjD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE7D"}
|
|
@@ -11,7 +11,7 @@ export declare function collectibleHasCacheFlag(collectibleType: CollectibleType
|
|
|
11
11
|
export declare function getCollectiblesForCacheFlag(cacheFlag: CacheFlag): ReadonlySet<CollectibleType>;
|
|
12
12
|
/**
|
|
13
13
|
* Returns an array containing every collectible type that the player has that matches the provided
|
|
14
|
-
* CacheFlag
|
|
14
|
+
* `CacheFlag`.
|
|
15
15
|
*
|
|
16
16
|
* For example, if the cache flag is `CacheFlag.FLYING`, and the player has one Lord of the Pit and
|
|
17
17
|
* two Dead Doves, then this function would return:
|
|
@@ -24,6 +24,9 @@ export declare function getCollectiblesForCacheFlag(cacheFlag: CacheFlag): Reado
|
|
|
24
24
|
* ]
|
|
25
25
|
* ```
|
|
26
26
|
*
|
|
27
|
+
* Note that this array will not include collectibles that the player does not really have, like
|
|
28
|
+
* Lilith's Incubus.
|
|
29
|
+
*
|
|
27
30
|
* This function can only be called if at least one callback has been executed. This is because not
|
|
28
31
|
* all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
29
32
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectibleCacheFlag.d.ts","sourceRoot":"","sources":["../../src/functions/collectibleCacheFlag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AA+B1E,iGAAiG;AACjG,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GACnB,OAAO,CAOT;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,eAAe,CAAC,CAS9B;AAED
|
|
1
|
+
{"version":3,"file":"collectibleCacheFlag.d.ts","sourceRoot":"","sources":["../../src/functions/collectibleCacheFlag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AA+B1E,iGAAiG;AACjG,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GACnB,OAAO,CAOT;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,eAAe,CAAC,CAS9B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,GACnB,eAAe,EAAE,CAanB"}
|
|
@@ -54,7 +54,7 @@ function ____exports.getCollectiblesForCacheFlag(self, cacheFlag)
|
|
|
54
54
|
return collectiblesSet
|
|
55
55
|
end
|
|
56
56
|
--- Returns an array containing every collectible type that the player has that matches the provided
|
|
57
|
-
-- CacheFlag
|
|
57
|
+
-- `CacheFlag`.
|
|
58
58
|
--
|
|
59
59
|
-- For example, if the cache flag is `CacheFlag.FLYING`, and the player has one Lord of the Pit and
|
|
60
60
|
-- two Dead Doves, then this function would return:
|
|
@@ -67,13 +67,16 @@ end
|
|
|
67
67
|
-- ]
|
|
68
68
|
-- ```
|
|
69
69
|
--
|
|
70
|
+
-- Note that this array will not include collectibles that the player does not really have, like
|
|
71
|
+
-- Lilith's Incubus.
|
|
72
|
+
--
|
|
70
73
|
-- This function can only be called if at least one callback has been executed. This is because not
|
|
71
74
|
-- all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
72
75
|
function ____exports.getPlayerCollectiblesForCacheFlag(self, player, cacheFlag)
|
|
73
76
|
local collectiblesForCacheFlag = ____exports.getCollectiblesForCacheFlag(nil, cacheFlag)
|
|
74
77
|
local playerCollectibles = {}
|
|
75
78
|
for ____, collectibleType in ipairs(getSortedSetValues(nil, collectiblesForCacheFlag)) do
|
|
76
|
-
local numCollectibles = player:GetCollectibleNum(collectibleType)
|
|
79
|
+
local numCollectibles = player:GetCollectibleNum(collectibleType, true)
|
|
77
80
|
____repeat(
|
|
78
81
|
nil,
|
|
79
82
|
numCollectibles,
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
import { ModUpgraded } from "../classes/ModUpgraded";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to enable some IsaacScript features that are useful when developing a mod. They
|
|
4
|
+
* should not be enabled when your mod goes to production (i.e. when it is uploaded to the Steam
|
|
5
|
+
* Workshop).
|
|
6
|
+
*
|
|
7
|
+
* The list of development features that are enabled are as follows:
|
|
8
|
+
*
|
|
9
|
+
* - `saveDataManagerSetGlobal` - Sets your local variables registered with the save data manager as
|
|
10
|
+
* global variables so you can access them from the in-game console.
|
|
11
|
+
* - `setLogFunctionsGlobal` - Sets the various log functions global so that you can access them
|
|
12
|
+
* from the in-game console.
|
|
13
|
+
* - `enableExtraConsoleCommands` - Enables many extra in-game console commands that make warping
|
|
14
|
+
* around easier (like e.g. `angel` to warp to the Angel Room).
|
|
15
|
+
* - `enableFastReset` - Makes it so that the r key resets the game instantaneously.
|
|
16
|
+
* - `removeFadeIn` - Removes the slow fade in that occurs at the beginning of the run, so that you
|
|
17
|
+
* can immediately start playing or testing.
|
|
18
|
+
*/
|
|
19
|
+
export declare function enableDevFeatures(mod: ModUpgraded): void;
|
|
1
20
|
/**
|
|
2
21
|
* Helper function to get a stack trace.
|
|
3
22
|
*
|
|
@@ -17,6 +36,12 @@ export declare function getTraceback(): string;
|
|
|
17
36
|
* is enabled or not.
|
|
18
37
|
*/
|
|
19
38
|
export declare function isLuaDebugEnabled(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Converts every `isaacscript-common` function that begins with "log" to a global function.
|
|
41
|
+
*
|
|
42
|
+
* This is useful when printing out variables from the in-game debug console.
|
|
43
|
+
*/
|
|
44
|
+
export declare function setLogFunctionsGlobal(): void;
|
|
20
45
|
/**
|
|
21
46
|
* Helper function to print a stack trace to the "log.txt" file, similar to JavaScript's
|
|
22
47
|
* `console.trace` function.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/functions/debug.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/functions/debug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AASrD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAMxD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAYrC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAI3C;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAU5C;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAGhC"}
|
package/dist/functions/debug.lua
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ObjectEntries = ____lualib.__TS__ObjectEntries
|
|
1
3
|
local ____exports = {}
|
|
4
|
+
local ____exports = require("features.extraConsoleCommands.exports")
|
|
5
|
+
local enableExtraConsoleCommands = ____exports.enableExtraConsoleCommands
|
|
6
|
+
local ____fadeInRemover = require("features.fadeInRemover")
|
|
7
|
+
local removeFadeIn = ____fadeInRemover.removeFadeIn
|
|
8
|
+
local ____fastReset = require("features.fastReset")
|
|
9
|
+
local enableFastReset = ____fastReset.enableFastReset
|
|
10
|
+
local ____exports = require("features.saveDataManager.exports")
|
|
11
|
+
local saveDataManagerSetGlobal = ____exports.saveDataManagerSetGlobal
|
|
12
|
+
local logExports = require("functions.log")
|
|
2
13
|
local ____log = require("functions.log")
|
|
3
14
|
local log = ____log.log
|
|
15
|
+
local logEntitiesExports = require("functions.logEntities")
|
|
16
|
+
--- Converts every `isaacscript-common` function that begins with "log" to a global function.
|
|
17
|
+
--
|
|
18
|
+
-- This is useful when printing out variables from the in-game debug console.
|
|
19
|
+
function ____exports.setLogFunctionsGlobal(self)
|
|
20
|
+
local globals = _G
|
|
21
|
+
for ____, ____value in ipairs(__TS__ObjectEntries(logExports)) do
|
|
22
|
+
local logFuncName = ____value[1]
|
|
23
|
+
local logFunc = ____value[2]
|
|
24
|
+
globals[logFuncName] = logFunc
|
|
25
|
+
end
|
|
26
|
+
for ____, ____value in ipairs(__TS__ObjectEntries(logEntitiesExports)) do
|
|
27
|
+
local logFuncName = ____value[1]
|
|
28
|
+
local logFunc = ____value[2]
|
|
29
|
+
globals[logFuncName] = logFunc
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
--- Helper function to enable some IsaacScript features that are useful when developing a mod. They
|
|
33
|
+
-- should not be enabled when your mod goes to production (i.e. when it is uploaded to the Steam
|
|
34
|
+
-- Workshop).
|
|
35
|
+
--
|
|
36
|
+
-- The list of development features that are enabled are as follows:
|
|
37
|
+
--
|
|
38
|
+
-- - `saveDataManagerSetGlobal` - Sets your local variables registered with the save data manager as
|
|
39
|
+
-- global variables so you can access them from the in-game console.
|
|
40
|
+
-- - `setLogFunctionsGlobal` - Sets the various log functions global so that you can access them
|
|
41
|
+
-- from the in-game console.
|
|
42
|
+
-- - `enableExtraConsoleCommands` - Enables many extra in-game console commands that make warping
|
|
43
|
+
-- around easier (like e.g. `angel` to warp to the Angel Room).
|
|
44
|
+
-- - `enableFastReset` - Makes it so that the r key resets the game instantaneously.
|
|
45
|
+
-- - `removeFadeIn` - Removes the slow fade in that occurs at the beginning of the run, so that you
|
|
46
|
+
-- can immediately start playing or testing.
|
|
47
|
+
function ____exports.enableDevFeatures(self, mod)
|
|
48
|
+
saveDataManagerSetGlobal(nil)
|
|
49
|
+
____exports.setLogFunctionsGlobal(nil)
|
|
50
|
+
enableExtraConsoleCommands(nil, mod)
|
|
51
|
+
enableFastReset(nil)
|
|
52
|
+
removeFadeIn(nil)
|
|
53
|
+
end
|
|
4
54
|
--- Helper function to get a stack trace.
|
|
5
55
|
--
|
|
6
56
|
-- This will only work if the `--luadebug` launch option is enabled or the Racing+ sandbox is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"familiars.d.ts","sourceRoot":"","sources":["../../src/functions/familiars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAKhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,GAAG,EAChB,eAAe,EAAE,eAAe,EAChC,eAAe,CAAC,EAAE,GAAG,GACpB,IAAI,CASN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,eAAe,EAChC,eAAe,CAAC,EAAE,GAAG,GACpB,IAAI,
|
|
1
|
+
{"version":3,"file":"familiars.d.ts","sourceRoot":"","sources":["../../src/functions/familiars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAKhF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,GAAG,EAChB,eAAe,EAAE,eAAe,EAChC,eAAe,CAAC,EAAE,GAAG,GACpB,IAAI,CASN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,eAAe,EAChC,eAAe,CAAC,EAAE,GAAG,GACpB,IAAI,CAkBN;AAED,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,cAAc,EAAE,CAOzE;AAED,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,cAAc,GACvB,OAAO,CAET"}
|
|
@@ -71,17 +71,15 @@ function removeItemsAndTrinketsThatAffectItemPools(self)
|
|
|
71
71
|
for ____, player in ipairs(getPlayers(nil)) do
|
|
72
72
|
local removedItems = {}
|
|
73
73
|
for ____, itemToRemove in ipairs(COLLECTIBLES_THAT_AFFECT_ITEM_POOLS) do
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
)
|
|
84
|
-
end
|
|
74
|
+
local numCollectibles = player:GetCollectibleNum(itemToRemove)
|
|
75
|
+
____repeat(
|
|
76
|
+
nil,
|
|
77
|
+
numCollectibles,
|
|
78
|
+
function()
|
|
79
|
+
player:RemoveCollectible(itemToRemove)
|
|
80
|
+
removedItems[#removedItems + 1] = itemToRemove
|
|
81
|
+
end
|
|
82
|
+
)
|
|
85
83
|
end
|
|
86
84
|
mapSetPlayer(nil, removedItemsMap, player, removedItems)
|
|
87
85
|
local removedTrinkets = {}
|
package/dist/functions/log.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="typescript-to-lua/language-extensions" />
|
|
2
|
-
import { DamageFlag, EntityFlag, ProjectileFlag, TearFlag, UseFlag } from "isaac-typescript-definitions";
|
|
2
|
+
import { CollectibleType, DamageFlag, EntityFlag, ProjectileFlag, TearFlag, UseFlag } from "isaac-typescript-definitions";
|
|
3
3
|
/**
|
|
4
4
|
* Helper function to prefix the name of the function and the line number before a debug message.
|
|
5
5
|
*/
|
|
@@ -12,6 +12,7 @@ export declare function getDebugPrependString(msg: string, numParentFunctions?:
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function log(this: void, msg: string): void;
|
|
14
14
|
export declare function logArray<T>(this: void, array: T[] | readonly T[]): void;
|
|
15
|
+
export declare function logCollectibleTypes(this: void, collectibleTypes: CollectibleType[]): void;
|
|
15
16
|
export declare function logColor(this: void, color: Color): void;
|
|
16
17
|
/** Helper function for printing out every damage flag that is turned on. Useful when debugging. */
|
|
17
18
|
export declare function logDamageFlags(this: void, flags: DamageFlag | BitFlags<DamageFlag>): void;
|
|
@@ -76,10 +77,4 @@ export declare function logUseFlags(this: void, flags: UseFlag | BitFlags<UseFla
|
|
|
76
77
|
*/
|
|
77
78
|
export declare function logUserdata(this: void, userdata: unknown): void;
|
|
78
79
|
export declare function logVector(this: void, vector: Vector, round?: boolean): void;
|
|
79
|
-
/**
|
|
80
|
-
* Converts every `isaacscript-common` function that begins with "log" to a global function.
|
|
81
|
-
*
|
|
82
|
-
* This is useful when printing out variables from the in-game debug console.
|
|
83
|
-
*/
|
|
84
|
-
export declare function setLogFunctionsGlobal(): void;
|
|
85
80
|
//# sourceMappingURL=log.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/functions/log.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,UAAU,EAKV,cAAc,EAGd,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;AAkBtC;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EAKX,kBAAkB,SAAI,GACrB,MAAM,CAiBR;AAED;;;;;GAKG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,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AAc,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAiB/C;AAED,wBAAgB,MAAM,CACpB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC,SAAS,CAAC,GAC3C,IAAI,CAUN;AAED,gFAAgF;AAChF,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAQ1C;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,OAAO,EACjB,YAAY,SAAI,GACf,IAAI,CA2CN;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,CAAC,EACtC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GACnB,IAAI,CA0BN;AAED,iGAAiG;AACjG,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,GACnC,IAAI,CAEN;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CACzB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,GACjC,IAAI,CAEN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAsB/D;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,IAAI,CAGzE"}
|
package/dist/functions/log.lua
CHANGED
|
@@ -108,6 +108,15 @@ function ____exports.logArray(array)
|
|
|
108
108
|
local arrayString = arrayToString(nil, array)
|
|
109
109
|
____exports.log("Array: " .. arrayString)
|
|
110
110
|
end
|
|
111
|
+
function ____exports.logCollectibleTypes(collectibleTypes)
|
|
112
|
+
____exports.log("Collectibles:")
|
|
113
|
+
local i = 1
|
|
114
|
+
for ____, collectibleType in ipairs(collectibleTypes) do
|
|
115
|
+
local collectibleName = getCollectibleName(nil, collectibleType)
|
|
116
|
+
____exports.log(((((tostring(i) .. ") ") .. collectibleName) .. " (") .. tostring(collectibleType)) .. ")")
|
|
117
|
+
i = i + 1
|
|
118
|
+
end
|
|
119
|
+
end
|
|
111
120
|
function ____exports.logColor(color)
|
|
112
121
|
____exports.log((((((((((((("Color: R" .. tostring(color.R)) .. ", G") .. tostring(color.G)) .. ", B") .. tostring(color.B)) .. ", A") .. tostring(color.A)) .. ", RO") .. tostring(color.RO)) .. ", BO") .. tostring(color.BO)) .. ", GO") .. tostring(color.GO))
|
|
113
122
|
end
|
|
@@ -393,35 +402,4 @@ function ____exports.logVector(vector, round)
|
|
|
393
402
|
local vectorString = vectorToString(nil, vector, round)
|
|
394
403
|
____exports.log("Vector: " .. vectorString)
|
|
395
404
|
end
|
|
396
|
-
--- Converts every `isaacscript-common` function that begins with "log" to a global function.
|
|
397
|
-
--
|
|
398
|
-
-- This is useful when printing out variables from the in-game debug console.
|
|
399
|
-
function ____exports.setLogFunctionsGlobal(self)
|
|
400
|
-
local globals = _G
|
|
401
|
-
globals.log = ____exports.log
|
|
402
|
-
globals.logArray = ____exports.logArray
|
|
403
|
-
globals.logColor = ____exports.logColor
|
|
404
|
-
globals.logDamageFlags = ____exports.logDamageFlags
|
|
405
|
-
globals.logEntityID = ____exports.logEntityID
|
|
406
|
-
globals.logEntityFlags = ____exports.logEntityFlags
|
|
407
|
-
globals.logError = ____exports.logError
|
|
408
|
-
globals.logFlags = ____exports.logFlags
|
|
409
|
-
globals.logGameStateFlags = ____exports.logGameStateFlags
|
|
410
|
-
globals.logKColor = ____exports.logKColor
|
|
411
|
-
globals.logLevelStateFlags = ____exports.logLevelStateFlags
|
|
412
|
-
globals.logMap = ____exports.logMap
|
|
413
|
-
globals.logPlayerEffects = ____exports.logPlayerEffects
|
|
414
|
-
globals.logPlayerHealth = ____exports.logPlayerHealth
|
|
415
|
-
globals.logProjectileFlags = ____exports.logProjectileFlags
|
|
416
|
-
globals.logRoom = ____exports.logRoom
|
|
417
|
-
globals.logSeedEffects = ____exports.logSeedEffects
|
|
418
|
-
globals.logSet = ____exports.logSet
|
|
419
|
-
globals.logSounds = ____exports.logSounds
|
|
420
|
-
globals.logTable = ____exports.logTable
|
|
421
|
-
globals.logTableDifferences = ____exports.logTableDifferences
|
|
422
|
-
globals.logTearFlags = ____exports.logTearFlags
|
|
423
|
-
globals.logUseFlags = ____exports.logUseFlags
|
|
424
|
-
globals.logUserdata = ____exports.logUserdata
|
|
425
|
-
globals.logVector = ____exports.logVector
|
|
426
|
-
end
|
|
427
405
|
return ____exports
|
|
@@ -62,11 +62,15 @@ export declare function getPlayerCloserThan(position: Vector, distance: float):
|
|
|
62
62
|
* collectible type(s) provided.
|
|
63
63
|
*
|
|
64
64
|
* This function is variadic, meaning that you can specify N collectible types.
|
|
65
|
+
*
|
|
66
|
+
* Note that this will filter out non-real collectibles like Lilith's Incubus.
|
|
65
67
|
*/
|
|
66
68
|
export declare function getPlayerCollectibleCount(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): int;
|
|
67
69
|
/**
|
|
68
70
|
* Iterates over every item in the game and returns a map containing the number of each item that
|
|
69
71
|
* the player has.
|
|
72
|
+
*
|
|
73
|
+
* Note that this will filter out non-real collectibles like Lilith's Incubus.
|
|
70
74
|
*/
|
|
71
75
|
export declare function getPlayerCollectibleMap(player: EntityPlayer): Map<CollectibleType, int>;
|
|
72
76
|
/** Helper function to get the player from a tear, laser, bomb, etc. */
|
|
@@ -111,6 +115,8 @@ export declare function getPlayersWithTrinket(...trinketTypes: TrinketType[]): E
|
|
|
111
115
|
/**
|
|
112
116
|
* Returns the total number of collectibles amongst all players. For example, if player 1 has 1 Sad
|
|
113
117
|
* Onion and player 2 has 2 Sad Onions, then this function would return 3.
|
|
118
|
+
*
|
|
119
|
+
* Note that this will filter out non-real collectibles like Lilith's Incubus.
|
|
114
120
|
*/
|
|
115
121
|
export declare function getTotalPlayerCollectibles(collectibleType: CollectibleType): int;
|
|
116
122
|
/** After touching a white fire, a player will turn into The Lost until they clear a room. */
|