isaacscript-common 33.15.0 → 34.0.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/index.rollup.d.ts +0 -10
- package/dist/isaacscript-common.lua +7 -11
- package/dist/src/classes/features/other/PlayerInventory.d.ts.map +1 -1
- package/dist/src/classes/features/other/PlayerInventory.lua +2 -2
- package/dist/src/classes/features/other/RoomHistory.d.ts.map +1 -1
- package/dist/src/classes/features/other/RoomHistory.lua +2 -3
- package/dist/src/functions/array.d.ts +0 -9
- package/dist/src/functions/array.d.ts.map +1 -1
- package/dist/src/functions/array.lua +0 -9
- package/dist/src/functions/players.lua +2 -2
- package/package.json +1 -1
- package/src/classes/features/other/PlayerInventory.ts +2 -6
- package/src/classes/features/other/RoomHistory.ts +1 -2
- package/src/functions/array.ts +0 -12
- package/src/functions/players.ts +2 -2
package/dist/index.rollup.d.ts
CHANGED
|
@@ -5717,16 +5717,6 @@ export declare function getLanguageName(): string;
|
|
|
5717
5717
|
*/
|
|
5718
5718
|
export declare function getLasers(laserVariant?: LaserVariant | -1, subType?: number): EntityLaser[];
|
|
5719
5719
|
|
|
5720
|
-
/**
|
|
5721
|
-
* Helper function to return the last element of an array.
|
|
5722
|
-
*
|
|
5723
|
-
* If the array is empty, this will return undefined.
|
|
5724
|
-
*
|
|
5725
|
-
* (Note that TSTL does not support `Array.at(-1)`, which would make this helper function largely
|
|
5726
|
-
* unnecessary.)
|
|
5727
|
-
*/
|
|
5728
|
-
export declare function getLastElement<T>(array: T[]): T | undefined;
|
|
5729
|
-
|
|
5730
5720
|
/**
|
|
5731
5721
|
* Helper function that returns the number of the final frame in a particular animation for a
|
|
5732
5722
|
* sprite. By default, it will use the currently playing animation, but you can also specify a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common
|
|
3
|
+
isaacscript-common 34.0.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -17090,9 +17090,6 @@ function ____exports.getHighestArrayElement(self, array)
|
|
|
17090
17090
|
end
|
|
17091
17091
|
return highestValue
|
|
17092
17092
|
end
|
|
17093
|
-
function ____exports.getLastElement(self, array)
|
|
17094
|
-
return array[#array]
|
|
17095
|
-
end
|
|
17096
17093
|
function ____exports.getLowestArrayElement(self, array)
|
|
17097
17094
|
if #array == 0 then
|
|
17098
17095
|
return nil
|
|
@@ -21835,6 +21832,7 @@ local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
|
21835
21832
|
local __TS__New = ____lualib.__TS__New
|
|
21836
21833
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
21837
21834
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
21835
|
+
local __TS__ArrayAt = ____lualib.__TS__ArrayAt
|
|
21838
21836
|
local __TS__ArrayFind = ____lualib.__TS__ArrayFind
|
|
21839
21837
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
21840
21838
|
local ____exports = {}
|
|
@@ -21857,7 +21855,6 @@ local itemConfig = ____cachedClasses.itemConfig
|
|
|
21857
21855
|
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
21858
21856
|
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
21859
21857
|
local ____array = require("src.functions.array")
|
|
21860
|
-
local getLastElement = ____array.getLastElement
|
|
21861
21858
|
local sumArray = ____array.sumArray
|
|
21862
21859
|
local ____characters = require("src.functions.characters")
|
|
21863
21860
|
local getCharacterName = ____characters.getCharacterName
|
|
@@ -22002,7 +21999,7 @@ function ____exports.getEffectsList(self, player)
|
|
|
22002
21999
|
end
|
|
22003
22000
|
function ____exports.getFinalPlayer(self)
|
|
22004
22001
|
local players = getPlayers(nil)
|
|
22005
|
-
local lastPlayer =
|
|
22002
|
+
local lastPlayer = __TS__ArrayAt(players, -1)
|
|
22006
22003
|
assertDefined(nil, lastPlayer, "Failed to get the final player since there were 0 players.")
|
|
22007
22004
|
return lastPlayer
|
|
22008
22005
|
end
|
|
@@ -34607,6 +34604,7 @@ local ____lualib = require("lualib_bundle")
|
|
|
34607
34604
|
local __TS__Class = ____lualib.__TS__Class
|
|
34608
34605
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
34609
34606
|
local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
|
|
34607
|
+
local __TS__ArrayAt = ____lualib.__TS__ArrayAt
|
|
34610
34608
|
local ____exports = {}
|
|
34611
34609
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
34612
34610
|
local game = ____cachedClasses.game
|
|
@@ -34614,8 +34612,6 @@ local ____decorators = require("src.decorators")
|
|
|
34614
34612
|
local Exported = ____decorators.Exported
|
|
34615
34613
|
local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
|
|
34616
34614
|
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
34617
|
-
local ____array = require("src.functions.array")
|
|
34618
|
-
local getLastElement = ____array.getLastElement
|
|
34619
34615
|
local ____dimensions = require("src.functions.dimensions")
|
|
34620
34616
|
local getDimension = ____dimensions.getDimension
|
|
34621
34617
|
local ____roomData = require("src.functions.roomData")
|
|
@@ -34696,7 +34692,7 @@ function RoomHistory.prototype.getPreviousRoomDescription(self)
|
|
|
34696
34692
|
end
|
|
34697
34693
|
__TS__DecorateLegacy({Exported}, RoomHistory.prototype, "getPreviousRoomDescription", true)
|
|
34698
34694
|
function RoomHistory.prototype.getLatestRoomDescription(self)
|
|
34699
|
-
return
|
|
34695
|
+
return __TS__ArrayAt(v.run.roomHistory, -1)
|
|
34700
34696
|
end
|
|
34701
34697
|
__TS__DecorateLegacy({Exported}, RoomHistory.prototype, "getLatestRoomDescription", true)
|
|
34702
34698
|
function RoomHistory.prototype.inFirstRoom(self)
|
|
@@ -51495,6 +51491,7 @@ local __TS__Class = ____lualib.__TS__Class
|
|
|
51495
51491
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
51496
51492
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
51497
51493
|
local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
|
|
51494
|
+
local __TS__ArrayAt = ____lualib.__TS__ArrayAt
|
|
51498
51495
|
local ____exports = {}
|
|
51499
51496
|
local ____decorators = require("src.decorators")
|
|
51500
51497
|
local Exported = ____decorators.Exported
|
|
@@ -51503,7 +51500,6 @@ local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
|
51503
51500
|
local ____array = require("src.functions.array")
|
|
51504
51501
|
local arrayRemoveInPlace = ____array.arrayRemoveInPlace
|
|
51505
51502
|
local copyArray = ____array.copyArray
|
|
51506
|
-
local getLastElement = ____array.getLastElement
|
|
51507
51503
|
local ____collectibles = require("src.functions.collectibles")
|
|
51508
51504
|
local isActiveCollectible = ____collectibles.isActiveCollectible
|
|
51509
51505
|
local ____playerDataStructures = require("src.functions.playerDataStructures")
|
|
@@ -51549,7 +51545,7 @@ end
|
|
|
51549
51545
|
__TS__DecorateLegacy({Exported}, PlayerInventory.prototype, "getPlayerInventory", true)
|
|
51550
51546
|
function PlayerInventory.prototype.getPlayerLastPassiveCollectible(self, player)
|
|
51551
51547
|
local inventory = self:getPlayerInventory(player, false)
|
|
51552
|
-
return
|
|
51548
|
+
return __TS__ArrayAt(inventory, -1)
|
|
51553
51549
|
end
|
|
51554
51550
|
__TS__DecorateLegacy({Exported}, PlayerInventory.prototype, "getPlayerLastPassiveCollectible", true)
|
|
51555
51551
|
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlayerInventory.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PlayerInventory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"PlayerInventory.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PlayerInventory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAQpE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAYhD,qBAAa,eAAgB,SAAQ,OAAO;IAqB1C,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAUnC;IAGF,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAUrC;IAEF;;;;;;;;;;;;;;;;;;;;;OAqBG;IAEI,kBAAkB,CACvB,MAAM,EAAE,YAAY,EACpB,yBAAyB,UAAO,GAC/B,eAAe,EAAE;IAgBpB;;;;;;;OAOG;IAEI,+BAA+B,CACpC,MAAM,EAAE,YAAY,GACnB,eAAe,GAAG,SAAS;CAI/B"}
|
|
@@ -4,6 +4,7 @@ local __TS__Class = ____lualib.__TS__Class
|
|
|
4
4
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
5
5
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
6
6
|
local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
|
|
7
|
+
local __TS__ArrayAt = ____lualib.__TS__ArrayAt
|
|
7
8
|
local ____exports = {}
|
|
8
9
|
local ____decorators = require("src.decorators")
|
|
9
10
|
local Exported = ____decorators.Exported
|
|
@@ -12,7 +13,6 @@ local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
|
12
13
|
local ____array = require("src.functions.array")
|
|
13
14
|
local arrayRemoveInPlace = ____array.arrayRemoveInPlace
|
|
14
15
|
local copyArray = ____array.copyArray
|
|
15
|
-
local getLastElement = ____array.getLastElement
|
|
16
16
|
local ____collectibles = require("src.functions.collectibles")
|
|
17
17
|
local isActiveCollectible = ____collectibles.isActiveCollectible
|
|
18
18
|
local ____playerDataStructures = require("src.functions.playerDataStructures")
|
|
@@ -58,7 +58,7 @@ end
|
|
|
58
58
|
__TS__DecorateLegacy({Exported}, PlayerInventory.prototype, "getPlayerInventory", true)
|
|
59
59
|
function PlayerInventory.prototype.getPlayerLastPassiveCollectible(self, player)
|
|
60
60
|
local inventory = self:getPlayerInventory(player, false)
|
|
61
|
-
return
|
|
61
|
+
return __TS__ArrayAt(inventory, -1)
|
|
62
62
|
end
|
|
63
63
|
__TS__DecorateLegacy({Exported}, PlayerInventory.prototype, "getPlayerLastPassiveCollectible", true)
|
|
64
64
|
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoomHistory.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/RoomHistory.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"RoomHistory.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/RoomHistory.ts"],"names":[],"mappings":";AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQhD,qBAAa,WAAY,SAAQ,OAAO;IActC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAgC/B;IAEF;;;;OAIG;IAEI,yBAAyB,IAAI,IAAI;IAIxC;;;;;OAKG;IAEI,kBAAkB,IAAI,GAAG;IAIhC;;;;;OAKG;IAEI,cAAc,IAAI,aAAa,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;IAIjE;;;;;;;OAOG;IAEI,0BAA0B,IAAI,QAAQ,CAAC,eAAe,CAAC;IAiB9D;;;;;;;;;;OAUG;IAEI,wBAAwB,IAAI,QAAQ,CAAC,eAAe,CAAC,GAAG,SAAS;IAIxE,gFAAgF;IAEzE,WAAW,IAAI,OAAO;IAI7B;;;;;;;;;;OAUG;IAEI,aAAa,IAAI,OAAO;CAwBhC"}
|
|
@@ -2,6 +2,7 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local __TS__Class = ____lualib.__TS__Class
|
|
3
3
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
4
4
|
local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
|
|
5
|
+
local __TS__ArrayAt = ____lualib.__TS__ArrayAt
|
|
5
6
|
local ____exports = {}
|
|
6
7
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
7
8
|
local game = ____cachedClasses.game
|
|
@@ -9,8 +10,6 @@ local ____decorators = require("src.decorators")
|
|
|
9
10
|
local Exported = ____decorators.Exported
|
|
10
11
|
local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
|
|
11
12
|
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
12
|
-
local ____array = require("src.functions.array")
|
|
13
|
-
local getLastElement = ____array.getLastElement
|
|
14
13
|
local ____dimensions = require("src.functions.dimensions")
|
|
15
14
|
local getDimension = ____dimensions.getDimension
|
|
16
15
|
local ____roomData = require("src.functions.roomData")
|
|
@@ -91,7 +90,7 @@ function RoomHistory.prototype.getPreviousRoomDescription(self)
|
|
|
91
90
|
end
|
|
92
91
|
__TS__DecorateLegacy({Exported}, RoomHistory.prototype, "getPreviousRoomDescription", true)
|
|
93
92
|
function RoomHistory.prototype.getLatestRoomDescription(self)
|
|
94
|
-
return
|
|
93
|
+
return __TS__ArrayAt(v.run.roomHistory, -1)
|
|
95
94
|
end
|
|
96
95
|
__TS__DecorateLegacy({Exported}, RoomHistory.prototype, "getLatestRoomDescription", true)
|
|
97
96
|
function RoomHistory.prototype.inFirstRoom(self)
|
|
@@ -141,15 +141,6 @@ export declare function getArrayIndexes<T>(array: T[] | readonly T[]): int[];
|
|
|
141
141
|
* in the array.
|
|
142
142
|
*/
|
|
143
143
|
export declare function getHighestArrayElement(array: number[]): number | undefined;
|
|
144
|
-
/**
|
|
145
|
-
* Helper function to return the last element of an array.
|
|
146
|
-
*
|
|
147
|
-
* If the array is empty, this will return undefined.
|
|
148
|
-
*
|
|
149
|
-
* (Note that TSTL does not support `Array.at(-1)`, which would make this helper function largely
|
|
150
|
-
* unnecessary.)
|
|
151
|
-
*/
|
|
152
|
-
export declare function getLastElement<T>(array: T[]): T | undefined;
|
|
153
144
|
/**
|
|
154
145
|
* Helper function to get the lowest value in an array. Returns undefined if there were no elements
|
|
155
146
|
* in the array.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src/functions/array.ts"],"names":[],"mappings":";;;AAMA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EAC1B,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,GACzB,OAAO,CAST;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,aAAa,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACjC,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,CAAC,EAAE,CAIL;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,aAAa,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACjC,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,CAAC,EAAE,CAIL;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,KAAK,EAAE,CAAC,EAAE,EACV,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,OAAO,CAcT;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,KAAK,EAAE,CAAC,EAAE,EACV,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,OAAO,CAWT;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,aAAa,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACjC,GAAG,eAAe,EAAE,GAAG,EAAE,GACxB,CAAC,EAAE,CAWL;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EACvC,KAAK,EAAE,CAAC,E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EAAE,EACjC,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,CAAC,EAAE,CAKL;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,KAAK,EAAE,CAAC,EAAE,EACV,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,IAAI,CAWN;AAED,+DAA+D;AAC/D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,GAAG,MAAM,CAEpE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAM3E"}
|
|
@@ -381,15 +381,6 @@ function ____exports.getHighestArrayElement(self, array)
|
|
|
381
381
|
end
|
|
382
382
|
return highestValue
|
|
383
383
|
end
|
|
384
|
-
--- Helper function to return the last element of an array.
|
|
385
|
-
--
|
|
386
|
-
-- If the array is empty, this will return undefined.
|
|
387
|
-
--
|
|
388
|
-
-- (Note that TSTL does not support `Array.at(-1)`, which would make this helper function largely
|
|
389
|
-
-- unnecessary.)
|
|
390
|
-
function ____exports.getLastElement(self, array)
|
|
391
|
-
return array[#array]
|
|
392
|
-
end
|
|
393
384
|
--- Helper function to get the lowest value in an array. Returns undefined if there were no elements
|
|
394
385
|
-- in the array.
|
|
395
386
|
function ____exports.getLowestArrayElement(self, array)
|
|
@@ -3,6 +3,7 @@ local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
|
3
3
|
local __TS__New = ____lualib.__TS__New
|
|
4
4
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
5
5
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
6
|
+
local __TS__ArrayAt = ____lualib.__TS__ArrayAt
|
|
6
7
|
local __TS__ArrayFind = ____lualib.__TS__ArrayFind
|
|
7
8
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
8
9
|
local ____exports = {}
|
|
@@ -25,7 +26,6 @@ local itemConfig = ____cachedClasses.itemConfig
|
|
|
25
26
|
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
26
27
|
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
27
28
|
local ____array = require("src.functions.array")
|
|
28
|
-
local getLastElement = ____array.getLastElement
|
|
29
29
|
local sumArray = ____array.sumArray
|
|
30
30
|
local ____characters = require("src.functions.characters")
|
|
31
31
|
local getCharacterName = ____characters.getCharacterName
|
|
@@ -222,7 +222,7 @@ end
|
|
|
222
222
|
-- method.
|
|
223
223
|
function ____exports.getFinalPlayer(self)
|
|
224
224
|
local players = getPlayers(nil)
|
|
225
|
-
local lastPlayer =
|
|
225
|
+
local lastPlayer = __TS__ArrayAt(players, -1)
|
|
226
226
|
assertDefined(nil, lastPlayer, "Failed to get the final player since there were 0 players.")
|
|
227
227
|
return lastPlayer
|
|
228
228
|
end
|
package/package.json
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { CollectibleType } from "isaac-typescript-definitions";
|
|
2
2
|
import { Exported } from "../../../decorators";
|
|
3
3
|
import { ModCallbackCustom } from "../../../enums/ModCallbackCustom";
|
|
4
|
-
import {
|
|
5
|
-
arrayRemoveInPlace,
|
|
6
|
-
copyArray,
|
|
7
|
-
getLastElement,
|
|
8
|
-
} from "../../../functions/array";
|
|
4
|
+
import { arrayRemoveInPlace, copyArray } from "../../../functions/array";
|
|
9
5
|
import { isActiveCollectible } from "../../../functions/collectibles";
|
|
10
6
|
import { defaultMapGetPlayer } from "../../../functions/playerDataStructures";
|
|
11
7
|
import type { PlayerIndex } from "../../../types/PlayerIndex";
|
|
@@ -123,6 +119,6 @@ export class PlayerInventory extends Feature {
|
|
|
123
119
|
player: EntityPlayer,
|
|
124
120
|
): CollectibleType | undefined {
|
|
125
121
|
const inventory = this.getPlayerInventory(player, false);
|
|
126
|
-
return
|
|
122
|
+
return inventory.at(-1);
|
|
127
123
|
}
|
|
128
124
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { game } from "../../../core/cachedClasses";
|
|
2
2
|
import { Exported } from "../../../decorators";
|
|
3
3
|
import { ModCallbackCustom } from "../../../enums/ModCallbackCustom";
|
|
4
|
-
import { getLastElement } from "../../../functions/array";
|
|
5
4
|
import { getDimension } from "../../../functions/dimensions";
|
|
6
5
|
import {
|
|
7
6
|
getRoomGridIndex,
|
|
@@ -140,7 +139,7 @@ export class RoomHistory extends Feature {
|
|
|
140
139
|
*/
|
|
141
140
|
@Exported
|
|
142
141
|
public getLatestRoomDescription(): Readonly<RoomDescription> | undefined {
|
|
143
|
-
return
|
|
142
|
+
return v.run.roomHistory.at(-1);
|
|
144
143
|
}
|
|
145
144
|
|
|
146
145
|
/** Helper function to detect if the player is on the first room of the room. */
|
package/src/functions/array.ts
CHANGED
|
@@ -360,18 +360,6 @@ export function getHighestArrayElement(array: number[]): number | undefined {
|
|
|
360
360
|
return highestValue;
|
|
361
361
|
}
|
|
362
362
|
|
|
363
|
-
/**
|
|
364
|
-
* Helper function to return the last element of an array.
|
|
365
|
-
*
|
|
366
|
-
* If the array is empty, this will return undefined.
|
|
367
|
-
*
|
|
368
|
-
* (Note that TSTL does not support `Array.at(-1)`, which would make this helper function largely
|
|
369
|
-
* unnecessary.)
|
|
370
|
-
*/
|
|
371
|
-
export function getLastElement<T>(array: T[]): T | undefined {
|
|
372
|
-
return array[array.length - 1];
|
|
373
|
-
}
|
|
374
|
-
|
|
375
363
|
/**
|
|
376
364
|
* Helper function to get the lowest value in an array. Returns undefined if there were no elements
|
|
377
365
|
* in the array.
|
package/src/functions/players.ts
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "../arrays/cachedEnumValues";
|
|
16
16
|
import { game, itemConfig } from "../core/cachedClasses";
|
|
17
17
|
import { ReadonlySet } from "../types/ReadonlySet";
|
|
18
|
-
import {
|
|
18
|
+
import { sumArray } from "./array";
|
|
19
19
|
import { getCharacterName, isVanillaCharacter } from "./characters";
|
|
20
20
|
import { getCollectibleMaxCharges } from "./collectibles";
|
|
21
21
|
import { hasFlag } from "./flag";
|
|
@@ -250,7 +250,7 @@ export function getEffectsList(player: EntityPlayer): TemporaryEffect[] {
|
|
|
250
250
|
export function getFinalPlayer(): EntityPlayer {
|
|
251
251
|
const players = getPlayers();
|
|
252
252
|
|
|
253
|
-
const lastPlayer =
|
|
253
|
+
const lastPlayer = players.at(-1);
|
|
254
254
|
assertDefined(
|
|
255
255
|
lastPlayer,
|
|
256
256
|
"Failed to get the final player since there were 0 players.",
|