isaacscript-common 9.0.1 → 9.2.0
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 +63 -58
- package/dist/enums/ModCallbackCustom.d.ts +4 -2
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/features/customTrapdoor/exports.d.ts +0 -6
- package/dist/features/customTrapdoor/exports.d.ts.map +1 -1
- package/dist/features/customTrapdoor/exports.lua +0 -6
- package/dist/features/playerInventory.d.ts.map +1 -1
- package/dist/features/playerInventory.lua +4 -48
- package/dist/features/saveDataManager/main.d.ts.map +1 -1
- package/dist/features/saveDataManager/main.lua +8 -0
- 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/log.d.ts +2 -7
- package/dist/functions/log.d.ts.map +1 -1
- package/dist/functions/log.lua +9 -31
- package/dist/functions/stage.d.ts +7 -0
- package/dist/functions/stage.d.ts.map +1 -1
- package/dist/functions/stage.lua +9 -0
- package/dist/index.d.ts +14 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +0 -8
- package/package.json +1 -1
- package/src/callbacks/postPlayerCollectible.ts +126 -69
- package/src/enums/ModCallbackCustom.ts +4 -2
- package/src/features/customTrapdoor/exports.ts +0 -6
- package/src/features/playerInventory.ts +5 -61
- package/src/features/saveDataManager/main.ts +15 -0
- package/src/functions/debug.ts +49 -0
- package/src/functions/log.ts +15 -35
- package/src/functions/stage.ts +13 -0
- 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,6 +1,6 @@
|
|
|
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
4
|
local Set = ____lualib.Set
|
|
5
5
|
local __TS__Spread = ____lualib.__TS__Spread
|
|
6
6
|
local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
|
|
@@ -9,22 +9,28 @@ local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
|
|
|
9
9
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
10
10
|
local __TS__ArraySort = ____lualib.__TS__ArraySort
|
|
11
11
|
local ____exports = {}
|
|
12
|
-
local hasSubscriptions,
|
|
12
|
+
local hasSubscriptions, updateCollectibleMapAndFire, useItemD4, postPEffectUpdate, checkActiveItemsChanged, entityTakeDmgPlayer, v
|
|
13
13
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
14
14
|
local ActiveSlot = ____isaac_2Dtypescript_2Ddefinitions.ActiveSlot
|
|
15
15
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
16
|
+
local DamageFlag = ____isaac_2Dtypescript_2Ddefinitions.DamageFlag
|
|
17
|
+
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
16
18
|
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
19
|
+
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
17
20
|
local ____DefaultMap = require("classes.DefaultMap")
|
|
18
21
|
local DefaultMap = ____DefaultMap.DefaultMap
|
|
22
|
+
local ____runInNFrames = require("features.runInNFrames")
|
|
23
|
+
local runNextGameFrame = ____runInNFrames.runNextGameFrame
|
|
19
24
|
local ____exports = require("features.saveDataManager.exports")
|
|
20
25
|
local saveDataManager = ____exports.saveDataManager
|
|
21
26
|
local ____array = require("functions.array")
|
|
22
27
|
local arrayEquals = ____array.arrayEquals
|
|
23
28
|
local ____enums = require("functions.enums")
|
|
24
29
|
local getEnumValues = ____enums.getEnumValues
|
|
30
|
+
local ____flag = require("functions.flag")
|
|
31
|
+
local hasFlag = ____flag.hasFlag
|
|
25
32
|
local ____playerDataStructures = require("functions.playerDataStructures")
|
|
26
33
|
local defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
|
|
27
|
-
local mapGetPlayer = ____playerDataStructures.mapGetPlayer
|
|
28
34
|
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
29
35
|
local ____players = require("functions.players")
|
|
30
36
|
local getPlayerCollectibleMap = ____players.getPlayerCollectibleMap
|
|
@@ -39,26 +45,7 @@ local postPlayerCollectibleRemovedHasSubscriptions = ____postPlayerCollectibleRe
|
|
|
39
45
|
function hasSubscriptions(self)
|
|
40
46
|
return postPlayerCollectibleAddedHasSubscriptions(nil) or postPlayerCollectibleRemovedHasSubscriptions(nil)
|
|
41
47
|
end
|
|
42
|
-
function
|
|
43
|
-
if not hasSubscriptions(nil) then
|
|
44
|
-
return
|
|
45
|
-
end
|
|
46
|
-
local oldCollectibleCount = mapGetPlayer(nil, v.run.playersCollectibleCount, player)
|
|
47
|
-
local newCollectibleCount = player:GetCollectibleCount()
|
|
48
|
-
mapSetPlayer(nil, v.run.playersCollectibleCount, player, newCollectibleCount)
|
|
49
|
-
if oldCollectibleCount == nil then
|
|
50
|
-
return
|
|
51
|
-
end
|
|
52
|
-
local difference = newCollectibleCount - oldCollectibleCount
|
|
53
|
-
if difference > 0 then
|
|
54
|
-
collectibleCountChanged(nil, player, difference)
|
|
55
|
-
elseif difference < 0 then
|
|
56
|
-
collectibleCountChanged(nil, player, difference * -1)
|
|
57
|
-
elseif difference == 0 then
|
|
58
|
-
checkActiveItemsChanged(nil, player)
|
|
59
|
-
end
|
|
60
|
-
end
|
|
61
|
-
function collectibleCountChanged(self, player, numCollectiblesChanged)
|
|
48
|
+
function updateCollectibleMapAndFire(self, player, numCollectiblesChanged)
|
|
62
49
|
local oldCollectibleMap = defaultMapGetPlayer(nil, v.run.playersCollectibleMap, player)
|
|
63
50
|
local newCollectibleMap = getPlayerCollectibleMap(nil, player)
|
|
64
51
|
mapSetPlayer(nil, v.run.playersCollectibleMap, player, newCollectibleMap)
|
|
@@ -68,12 +55,12 @@ function collectibleCountChanged(self, player, numCollectiblesChanged)
|
|
|
68
55
|
____array_0,
|
|
69
56
|
__TS__Spread(newCollectibleMap:keys())
|
|
70
57
|
)
|
|
71
|
-
local
|
|
58
|
+
local collectibleTypesSet = __TS__New(
|
|
72
59
|
____Set_1,
|
|
73
60
|
{__TS__SparseArraySpread(____array_0)}
|
|
74
61
|
)
|
|
75
62
|
local numFired = 0
|
|
76
|
-
for ____, collectibleType in __TS__Iterator(
|
|
63
|
+
for ____, collectibleType in __TS__Iterator(collectibleTypesSet:values()) do
|
|
77
64
|
local oldNum = oldCollectibleMap:get(collectibleType) or 0
|
|
78
65
|
local newNum = newCollectibleMap:get(collectibleType) or 0
|
|
79
66
|
local difference = newNum - oldNum
|
|
@@ -96,6 +83,26 @@ function collectibleCountChanged(self, player, numCollectiblesChanged)
|
|
|
96
83
|
end
|
|
97
84
|
end
|
|
98
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
|
|
99
106
|
function checkActiveItemsChanged(self, player)
|
|
100
107
|
local activeItemMap = defaultMapGetPlayer(nil, v.run.playersActiveItemMap, player)
|
|
101
108
|
local oldCollectibleTypes = {}
|
|
@@ -110,44 +117,40 @@ function checkActiveItemsChanged(self, player)
|
|
|
110
117
|
__TS__ArraySort(oldCollectibleTypes)
|
|
111
118
|
__TS__ArraySort(newCollectibleTypes)
|
|
112
119
|
if not arrayEquals(nil, oldCollectibleTypes, newCollectibleTypes) then
|
|
113
|
-
|
|
114
|
-
local ____array_2 = __TS__SparseArrayNew(table.unpack(oldCollectibleTypes))
|
|
115
|
-
__TS__SparseArrayPush(
|
|
116
|
-
____array_2,
|
|
117
|
-
table.unpack(newCollectibleTypes)
|
|
118
|
-
)
|
|
119
|
-
local collectibleTypeSet = __TS__New(
|
|
120
|
-
____Set_3,
|
|
121
|
-
{__TS__SparseArraySpread(____array_2)}
|
|
122
|
-
)
|
|
123
|
-
activeItemsChanged(nil, player, collectibleTypeSet)
|
|
120
|
+
updateCollectibleMapAndFire(nil, player, nil)
|
|
124
121
|
end
|
|
125
122
|
end
|
|
126
|
-
function
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
local difference = newNum - oldNum
|
|
134
|
-
local increased = difference > 0
|
|
135
|
-
local absoluteDifference = math.abs(difference)
|
|
136
|
-
____repeat(
|
|
137
|
-
nil,
|
|
138
|
-
absoluteDifference,
|
|
139
|
-
function()
|
|
140
|
-
if increased then
|
|
141
|
-
postPlayerCollectibleAddedFire(nil, player, collectibleType)
|
|
142
|
-
else
|
|
143
|
-
postPlayerCollectibleRemovedFire(nil, player, collectibleType)
|
|
144
|
-
end
|
|
145
|
-
end
|
|
146
|
-
)
|
|
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
|
|
147
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
|
|
148
151
|
end
|
|
149
152
|
v = {run = {
|
|
150
|
-
playersCollectibleCount = __TS__New(
|
|
153
|
+
playersCollectibleCount = __TS__New(DefaultMap, 0),
|
|
151
154
|
playersCollectibleMap = __TS__New(
|
|
152
155
|
DefaultMap,
|
|
153
156
|
function() return __TS__New(Map) end
|
|
@@ -159,6 +162,8 @@ v = {run = {
|
|
|
159
162
|
}}
|
|
160
163
|
function ____exports.postPlayerCollectibleCallbacksInit(self, mod)
|
|
161
164
|
saveDataManager(nil, "postPlayerCollectible", v, hasSubscriptions)
|
|
165
|
+
mod:AddCallback(ModCallback.POST_USE_ITEM, useItemD4, CollectibleType.D4)
|
|
162
166
|
mod:AddCallback(ModCallback.POST_PEFFECT_UPDATE, postPEffectUpdate)
|
|
167
|
+
mod:AddCallback(ModCallback.ENTITY_TAKE_DMG, entityTakeDmgPlayer, EntityType.PLAYER)
|
|
163
168
|
end
|
|
164
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"}
|
|
@@ -4,12 +4,6 @@ import { LevelStage, StageType } from "isaac-typescript-definitions";
|
|
|
4
4
|
* want to create a custom trapdoor that goes to a vanilla stage instead, use the
|
|
5
5
|
* `spawnCustomTrapdoorToVanilla` helper function.
|
|
6
6
|
*
|
|
7
|
-
* Custom trapdoors can have one or more of the following attributes:
|
|
8
|
-
*
|
|
9
|
-
* - custom destination (or custom logic for after the player enters)
|
|
10
|
-
* - custom graphics
|
|
11
|
-
* - custom logic for opening/closing
|
|
12
|
-
*
|
|
13
7
|
* Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
|
|
14
8
|
* respawned every time the player re-enters the room.
|
|
15
9
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAOrE
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAOrE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,eAAe,EAAE,MAAM,EACvB,mBAAmB,EAAE,GAAG,EACxB,QAAQ,SAAmC,EAC3C,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU,CAcZ;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,CAC1C,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,KAAK,CAAC,EAAE,UAAU,EAClB,SAAS,CAAC,EAAE,SAAS,EACrB,QAAQ,SAAmC,EAC3C,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU,CAkBZ"}
|
|
@@ -12,12 +12,6 @@ local spawnCustomTrapdoorToDestination = ____spawn.spawnCustomTrapdoorToDestinat
|
|
|
12
12
|
-- want to create a custom trapdoor that goes to a vanilla stage instead, use the
|
|
13
13
|
-- `spawnCustomTrapdoorToVanilla` helper function.
|
|
14
14
|
--
|
|
15
|
-
-- Custom trapdoors can have one or more of the following attributes:
|
|
16
|
-
--
|
|
17
|
-
-- - custom destination (or custom logic for after the player enters)
|
|
18
|
-
-- - custom graphics
|
|
19
|
-
-- - custom logic for opening/closing
|
|
20
|
-
--
|
|
21
15
|
-- Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
|
|
22
16
|
-- respawned every time the player re-enters the room.
|
|
23
17
|
--
|
|
@@ -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,48 +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
|
-
local numCollectibles = player:GetCollectibleNum(collectibleType, true)
|
|
37
|
-
____repeat(
|
|
38
|
-
nil,
|
|
39
|
-
numCollectibles,
|
|
40
|
-
function()
|
|
41
|
-
inventory[#inventory + 1] = collectibleType
|
|
42
|
-
end
|
|
43
|
-
)
|
|
44
|
-
end
|
|
45
|
-
return inventory
|
|
46
|
-
end
|
|
47
|
-
function resetInventory(self, player)
|
|
48
|
-
local inventory = newPlayerInventory(nil, player)
|
|
49
|
-
mapSetPlayer(nil, v.run.playersInventory, player, inventory)
|
|
50
|
-
end
|
|
51
|
-
function useItemD4(self, _collectibleType, _rng, player)
|
|
52
|
-
resetInventory(nil, player)
|
|
53
|
-
return nil
|
|
54
|
-
end
|
|
55
|
-
function postGameStarted(self)
|
|
56
|
-
for ____, player in ipairs(getAllPlayers(nil)) do
|
|
57
|
-
local playerIndex = getPlayerIndex(nil, player)
|
|
58
|
-
if not v.run.playersInventory:has(playerIndex) then
|
|
59
|
-
resetInventory(nil, player)
|
|
60
|
-
end
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
22
|
function postCollectibleAdded(self, player, collectibleType)
|
|
64
23
|
local inventory = defaultMapGetPlayer(nil, v.run.playersInventory, player, player)
|
|
65
24
|
inventory[#inventory + 1] = collectibleType
|
|
@@ -71,14 +30,12 @@ end
|
|
|
71
30
|
local FEATURE_NAME = "playerInventory"
|
|
72
31
|
v = {run = {playersInventory = __TS__New(
|
|
73
32
|
DefaultMap,
|
|
74
|
-
function(
|
|
33
|
+
function() return {} end
|
|
75
34
|
)}}
|
|
76
35
|
---
|
|
77
36
|
-- @internal
|
|
78
37
|
function ____exports.playerInventoryInit(self, mod)
|
|
79
38
|
saveDataManager(nil, FEATURE_NAME, v)
|
|
80
|
-
mod:AddCallback(ModCallback.POST_USE_ITEM, useItemD4, CollectibleType.D4)
|
|
81
|
-
mod:AddCallback(ModCallback.POST_GAME_STARTED, postGameStarted)
|
|
82
39
|
mod:AddCallbackCustom(ModCallbackCustom.POST_PLAYER_COLLECTIBLE_ADDED, postCollectibleAdded)
|
|
83
40
|
mod:AddCallbackCustom(ModCallbackCustom.POST_PLAYER_COLLECTIBLE_REMOVED, postCollectibleRemoved)
|
|
84
41
|
end
|
|
@@ -106,12 +63,11 @@ function ____exports.getPlayerInventory(self, player, includeActiveCollectibles)
|
|
|
106
63
|
end
|
|
107
64
|
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
108
65
|
local inventory = defaultMapGetPlayer(nil, v.run.playersInventory, player, player)
|
|
109
|
-
local copiedInventory = copyArray(nil, inventory)
|
|
110
66
|
if includeActiveCollectibles then
|
|
111
|
-
return
|
|
67
|
+
return copyArray(nil, inventory)
|
|
112
68
|
end
|
|
113
69
|
return __TS__ArrayFilter(
|
|
114
|
-
|
|
70
|
+
inventory,
|
|
115
71
|
function(____, collectibleType) return not isActiveCollectible(nil, collectibleType) end
|
|
116
72
|
)
|
|
117
73
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAMtD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAsBrD,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAUlE;AAqFD,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,GACvB,IAAI,CA4CN;AAiBD,wBAAgB,wBAAwB,IAAI,IAAI,CAM/C;AAED,wBAAgB,wBAAwB,IAAI,IAAI,CAM/C"}
|
|
@@ -17,6 +17,8 @@ local ____deepCopy = require("functions.deepCopy")
|
|
|
17
17
|
local deepCopy = ____deepCopy.deepCopy
|
|
18
18
|
local ____log = require("functions.log")
|
|
19
19
|
local logError = ____log.logError
|
|
20
|
+
local ____stage = require("functions.stage")
|
|
21
|
+
local onFirstFloor = ____stage.onFirstFloor
|
|
20
22
|
local ____table = require("functions.table")
|
|
21
23
|
local clearTable = ____table.clearTable
|
|
22
24
|
local iterateTableInOrder = ____table.iterateTableInOrder
|
|
@@ -55,7 +57,13 @@ function preGameExit(self)
|
|
|
55
57
|
loadedDataOnThisRun = false
|
|
56
58
|
end
|
|
57
59
|
function postNewLevel(self)
|
|
60
|
+
if mod == nil then
|
|
61
|
+
error(("The mod for the " .. SAVE_DATA_MANAGER_FEATURE_NAME) .. " was not initialized.")
|
|
62
|
+
end
|
|
58
63
|
restoreDefaults(nil, SaveDataKey.LEVEL)
|
|
64
|
+
if not onFirstFloor(nil) then
|
|
65
|
+
saveToDisk(nil, mod, saveDataMap, saveDataConditionalFuncMap)
|
|
66
|
+
end
|
|
59
67
|
end
|
|
60
68
|
function postNewRoomEarly(self)
|
|
61
69
|
restoreDefaults(nil, SaveDataKey.ROOM)
|
|
@@ -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
|
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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AAI,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
|
|
@@ -40,6 +40,13 @@ export declare function onDarkRoom(): boolean;
|
|
|
40
40
|
* I AM ERROR room is never entered into the list of possibilities.
|
|
41
41
|
*/
|
|
42
42
|
export declare function onFinalFloor(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Returns whether or not the player is on the first floor of the particular run.
|
|
45
|
+
*
|
|
46
|
+
* This is tricky to determine because we have to handle the cases of Downpour/Dross 1 not being the
|
|
47
|
+
* first floor and The Ascent.
|
|
48
|
+
*/
|
|
49
|
+
export declare function onFirstFloor(): boolean;
|
|
43
50
|
export declare function onRepentanceStage(): boolean;
|
|
44
51
|
export declare function onSheol(): bo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AM,UAAQ,GACb,IAAI,CAUN;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAE9D"}
|
package/dist/functions/stage.lua
CHANGED
|
@@ -125,6 +125,15 @@ function ____exports.onFinalFloor(self)
|
|
|
125
125
|
local stage = level:GetStage()
|
|
126
126
|
return stage == LevelStage.DARK_ROOM_CHEST or stage == LevelStage.THE_VOID or stage == LevelStage.HOME or stage == LevelStage.WOMB_2 and ____exports.onRepentanceStage(nil)
|
|
127
127
|
end
|
|
128
|
+
--- Returns whether or not the player is on the first floor of the particular run.
|
|
129
|
+
--
|
|
130
|
+
-- This is tricky to determine because we have to handle the cases of Downpour/Dross 1 not being the
|
|
131
|
+
-- first floor and The Ascent.
|
|
132
|
+
function ____exports.onFirstFloor(self)
|
|
133
|
+
local effectiveStage = ____exports.getEffectiveStage(nil)
|
|
134
|
+
local isOnAscent = ____exports.onAscent(nil)
|
|
135
|
+
return effectiveStage == 1 and not isOnAscent
|
|
136
|
+
end
|
|
128
137
|
function ____exports.onSheol(self)
|
|
129
138
|
local level = game:GetLevel()
|
|
130
139
|
local stage = level:GetStage()
|