isaacscript-common 9.8.0 → 9.8.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.
|
@@ -61,11 +61,11 @@ export declare function addRoomClearChargeToSlot(player: EntityPlayer, activeSlo
|
|
|
61
61
|
* - The Battery
|
|
62
62
|
* - AAA Battery
|
|
63
63
|
*
|
|
64
|
-
* @param
|
|
65
|
-
*
|
|
66
|
-
*
|
|
64
|
+
* @param bigRoomDoubleCharge Optional. If set to false, it will treat the current room as a 1x1
|
|
65
|
+
* room for the purposes of calculating how much charge to grant. Default
|
|
66
|
+
* is true.
|
|
67
67
|
*/
|
|
68
|
-
export declare function addRoomClearCharges(
|
|
68
|
+
export declare function addRoomClearCharges(bigRoomDoubleCharge?: boolean): void;
|
|
69
69
|
/**
|
|
70
70
|
* Helper function to get the combined normal charge and the battery charge for the player's active
|
|
71
71
|
* item. This is useful because you have to add these two values together when setting the active
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charge.d.ts","sourceRoot":"","sources":["../../src/functions/charge.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAIX,MAAM,8BAA8B,CAAC;AAMtC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,SAAI,EACd,eAAe,UAAO,GACrB,GAAG,CA2BL;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,mBAAmB,UAAO,EAC1B,eAAe,UAAO,GACrB,IAAI,CAaN;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,mBAAmB,UAAO,EAC1B,eAAe,UAAO,GACrB,IAAI,CAMN;AAuED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,
|
|
1
|
+
{"version":3,"file":"charge.d.ts","sourceRoot":"","sources":["../../src/functions/charge.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAIX,MAAM,8BAA8B,CAAC;AAMtC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,SAAI,EACd,eAAe,UAAO,GACrB,GAAG,CA2BL;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,mBAAmB,UAAO,EAC1B,eAAe,UAAO,GACrB,IAAI,CAaN;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,mBAAmB,UAAO,EAC1B,eAAe,UAAO,GACrB,IAAI,CAMN;AAuED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,mBAAmB,UAAO,GAAG,IAAI,CAIpE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,GACrB,GAAG,CAKL;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,GACrB,OAAO,CAMT;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,GACrB,IAAI,CAYN"}
|
|
@@ -11,7 +11,7 @@ local sfxManager = ____cachedClasses.sfxManager
|
|
|
11
11
|
local ____collectibles = require("functions.collectibles")
|
|
12
12
|
local getCollectibleMaxCharges = ____collectibles.getCollectibleMaxCharges
|
|
13
13
|
local ____playerIndex = require("functions.playerIndex")
|
|
14
|
-
local
|
|
14
|
+
local getAllPlayers = ____playerIndex.getAllPlayers
|
|
15
15
|
local ____roomShape = require("functions.roomShape")
|
|
16
16
|
local getRoomShapeCharges = ____roomShape.getRoomShapeCharges
|
|
17
17
|
--- Helper function to add a charge to the player's active item. Will flash the HUD and play the
|
|
@@ -187,15 +187,15 @@ end
|
|
|
187
187
|
-- - The Battery
|
|
188
188
|
-- - AAA Battery
|
|
189
189
|
--
|
|
190
|
-
-- @param
|
|
191
|
-
--
|
|
192
|
-
--
|
|
193
|
-
function ____exports.addRoomClearCharges(self,
|
|
194
|
-
if
|
|
195
|
-
|
|
196
|
-
end
|
|
197
|
-
for ____, player in ipairs(
|
|
198
|
-
____exports.addRoomClearCharge(nil, player,
|
|
190
|
+
-- @param bigRoomDoubleCharge Optional. If set to false, it will treat the current room as a 1x1
|
|
191
|
+
-- room for the purposes of calculating how much charge to grant. Default
|
|
192
|
+
-- is true.
|
|
193
|
+
function ____exports.addRoomClearCharges(self, bigRoomDoubleCharge)
|
|
194
|
+
if bigRoomDoubleCharge == nil then
|
|
195
|
+
bigRoomDoubleCharge = true
|
|
196
|
+
end
|
|
197
|
+
for ____, player in ipairs(getAllPlayers(nil)) do
|
|
198
|
+
____exports.addRoomClearCharge(nil, player, bigRoomDoubleCharge)
|
|
199
199
|
end
|
|
200
200
|
end
|
|
201
201
|
function ____exports.isActiveSlotDoubleCharged(self, player, activeSlot)
|
package/dist/index.d.ts
CHANGED
|
@@ -262,11 +262,11 @@ export declare function addRoomClearCharge(player: EntityPlayer, bigRoomDoubleCh
|
|
|
262
262
|
* - The Battery
|
|
263
263
|
* - AAA Battery
|
|
264
264
|
*
|
|
265
|
-
* @param
|
|
266
|
-
*
|
|
267
|
-
*
|
|
265
|
+
* @param bigRoomDoubleCharge Optional. If set to false, it will treat the current room as a 1x1
|
|
266
|
+
* room for the purposes of calculating how much charge to grant. Default
|
|
267
|
+
* is true.
|
|
268
268
|
*/
|
|
269
|
-
export declare function addRoomClearCharges(
|
|
269
|
+
export declare function addRoomClearCharges(bigRoomDoubleCharge?: boolean): void;
|
|
270
270
|
|
|
271
271
|
/**
|
|
272
272
|
* Helper function to add a charge to one of a player's active items, emulating what happens when a
|
package/package.json
CHANGED
package/src/functions/charge.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "isaac-typescript-definitions";
|
|
7
7
|
import { game, sfxManager } from "../core/cachedClasses";
|
|
8
8
|
import { getCollectibleMaxCharges } from "./collectibles";
|
|
9
|
-
import {
|
|
9
|
+
import { getAllPlayers } from "./playerIndex";
|
|
10
10
|
import { getRoomShapeCharges } from "./roomShape";
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -203,13 +203,13 @@ function getChargesToAddWithAAAModifier(
|
|
|
203
203
|
* - The Battery
|
|
204
204
|
* - AAA Battery
|
|
205
205
|
*
|
|
206
|
-
* @param
|
|
207
|
-
*
|
|
208
|
-
*
|
|
206
|
+
* @param bigRoomDoubleCharge Optional. If set to false, it will treat the current room as a 1x1
|
|
207
|
+
* room for the purposes of calculating how much charge to grant. Default
|
|
208
|
+
* is true.
|
|
209
209
|
*/
|
|
210
|
-
export function addRoomClearCharges(
|
|
211
|
-
for (const player of
|
|
212
|
-
addRoomClearCharge(player,
|
|
210
|
+
export function addRoomClearCharges(bigRoomDoubleCharge = true): void {
|
|
211
|
+
for (const player of getAllPlayers()) {
|
|
212
|
+
addRoomClearCharge(player, bigRoomDoubleCharge);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
|