isaacscript-common 1.2.148 → 1.2.149
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.
|
@@ -43,8 +43,9 @@ export declare function addRoomClearCharge(player: EntityPlayer, ignoreBigRoomDo
|
|
|
43
43
|
export declare function addRoomClearChargeToSlot(player: EntityPlayer, activeSlot: ActiveSlot, ignoreBigRoomDoubleCharge?: boolean): void;
|
|
44
44
|
/**
|
|
45
45
|
* Helper function to get the combined normal charge and the battery charge for the player's active
|
|
46
|
-
* item.
|
|
46
|
+
* item. This is useful because you have to add these two values together when setting the active
|
|
47
|
+
* charge.
|
|
47
48
|
*/
|
|
48
|
-
export declare function
|
|
49
|
+
export declare function getTotalCharge(player: EntityPlayer, activeSlot: ActiveSlot): int;
|
|
49
50
|
export declare function isActiveSlotDoubleCharged(player: EntityPlayer, activeSlot: ActiveSlot): boolean;
|
|
50
51
|
export declare function playChargeSoundEffect(player: EntityPlayer, activeSlot: ActiveSlot): void;
|
|
@@ -8,7 +8,6 @@ local ____collectibles = require("functions.collectibles")
|
|
|
8
8
|
local getCollectibleMaxCharges = ____collectibles.getCollectibleMaxCharges
|
|
9
9
|
local ____player = require("functions.player")
|
|
10
10
|
local getPlayers = ____player.getPlayers
|
|
11
|
-
local getTotalCharge = ____player.getTotalCharge
|
|
12
11
|
function ____exports.addRoomClearCharge(self, player, ignoreBigRoomDoubleCharge)
|
|
13
12
|
if ignoreBigRoomDoubleCharge == nil then
|
|
14
13
|
ignoreBigRoomDoubleCharge = false
|
|
@@ -25,7 +24,7 @@ function ____exports.addRoomClearChargeToSlot(self, player, activeSlot, ignoreBi
|
|
|
25
24
|
return
|
|
26
25
|
end
|
|
27
26
|
local hud = game:GetHUD()
|
|
28
|
-
local totalCharge = getTotalCharge(nil, player, activeSlot)
|
|
27
|
+
local totalCharge = ____exports.getTotalCharge(nil, player, activeSlot)
|
|
29
28
|
local chargesToAdd = getNumChargesToAdd(nil, player, activeSlot, ignoreBigRoomDoubleCharge)
|
|
30
29
|
local modifiedChargesToAdd = getNumChargesWithAAAModifier(nil, player, activeSlot, chargesToAdd)
|
|
31
30
|
local newCharge = totalCharge + modifiedChargesToAdd
|
|
@@ -61,6 +60,11 @@ function getNumChargesToAdd(self, player, activeSlot, ignoreBigRoomDoubleCharge)
|
|
|
61
60
|
end
|
|
62
61
|
return 1
|
|
63
62
|
end
|
|
63
|
+
function ____exports.getTotalCharge(self, player, activeSlot)
|
|
64
|
+
local activeCharge = player:GetActiveCharge(activeSlot)
|
|
65
|
+
local batteryCharge = player:GetBatteryCharge(activeSlot)
|
|
66
|
+
return activeCharge + batteryCharge
|
|
67
|
+
end
|
|
64
68
|
function getNumChargesWithAAAModifier(self, player, activeSlot, chargesToAdd)
|
|
65
69
|
local activeItem = player:GetActiveItem(activeSlot)
|
|
66
70
|
local activeCharge = player:GetActiveCharge(activeSlot)
|
|
@@ -105,11 +109,6 @@ function ____exports.addRoomClearCharges(self, ignoreBigRoomDoubleCharge)
|
|
|
105
109
|
____exports.addRoomClearCharge(nil, player, ignoreBigRoomDoubleCharge)
|
|
106
110
|
end
|
|
107
111
|
end
|
|
108
|
-
function ____exports.getActiveCharge(self, player, activeSlot)
|
|
109
|
-
local charge = player:GetActiveCharge(activeSlot)
|
|
110
|
-
local batteryCharge = player:GetBatteryCharge(activeSlot)
|
|
111
|
-
return charge + batteryCharge
|
|
112
|
-
end
|
|
113
112
|
function ____exports.isActiveSlotDoubleCharged(self, player, activeSlot)
|
|
114
113
|
local collectibleType = player:GetActiveItem(activeSlot)
|
|
115
114
|
local batteryCharge = player:GetBatteryCharge(activeSlot)
|
|
@@ -239,11 +239,6 @@ export declare function getSubPlayerParent(subPlayer: EntitySubPlayer): EntityPl
|
|
|
239
239
|
* should be accomplished before invoking this function.
|
|
240
240
|
*/
|
|
241
241
|
export declare function getTaintedMagdaleneNonTemporaryMaxHearts(player: EntityPlayer): int;
|
|
242
|
-
/**
|
|
243
|
-
* Helper function to return the active charge and the battery charge combined. This is useful
|
|
244
|
-
* because you are not able to set the battery charge directly.
|
|
245
|
-
*/
|
|
246
|
-
export declare function getTotalCharge(player: EntityPlayer, activeSlot: ActiveSlot): int;
|
|
247
242
|
/**
|
|
248
243
|
* Returns the total number of collectibles amongst all players. For example, if player 1 has 1 Sad
|
|
249
244
|
* Onion and player 2 has 2 Sad Onions, then this function would return 3.
|
|
@@ -259,6 +254,7 @@ export declare function hasLostCurse(player: EntityPlayer): boolean;
|
|
|
259
254
|
* items. (Only Tainted Forgotten can pick up items.)
|
|
260
255
|
*/
|
|
261
256
|
export declare function hasOpenActiveItemSlot(player: EntityPlayer): boolean;
|
|
257
|
+
export declare function isActiveSlotEmpty(player: EntityPlayer, activeSlot: ActiveSlot): boolean;
|
|
262
258
|
/**
|
|
263
259
|
* Helper function for detecting when a player is Bethany or Tainted Bethany. This is useful if you
|
|
264
260
|
* need to adjust UI elements to account for Bethany's soul charges or Tainted Bethany's blood
|
|
@@ -471,11 +471,6 @@ function ____exports.getTaintedMagdaleneNonTemporaryMaxHearts(self, player)
|
|
|
471
471
|
local maxNonTemporaryMaxHearts = hasBirthright and 6 or 4
|
|
472
472
|
return math.min(maxHearts, maxNonTemporaryMaxHearts)
|
|
473
473
|
end
|
|
474
|
-
function ____exports.getTotalCharge(self, player, activeSlot)
|
|
475
|
-
local activeCharge = player:GetActiveCharge(activeSlot)
|
|
476
|
-
local batteryCharge = player:GetBatteryCharge(activeSlot)
|
|
477
|
-
return activeCharge + batteryCharge
|
|
478
|
-
end
|
|
479
474
|
function ____exports.getTotalPlayerCollectibles(self, collectibleType)
|
|
480
475
|
local players = ____exports.getPlayers(nil)
|
|
481
476
|
local numCollectiblesArray = __TS__ArrayMap(
|
|
@@ -501,6 +496,10 @@ function ____exports.hasOpenActiveItemSlot(self, player)
|
|
|
501
496
|
end
|
|
502
497
|
return activeItemPrimary == CollectibleType.COLLECTIBLE_NULL
|
|
503
498
|
end
|
|
499
|
+
function ____exports.isActiveSlotEmpty(self, player, activeSlot)
|
|
500
|
+
local activeCollectibleType = player:GetActiveItem(activeSlot)
|
|
501
|
+
return activeCollectibleType == CollectibleType.COLLECTIBLE_NULL
|
|
502
|
+
end
|
|
504
503
|
function ____exports.isBethany(self, player)
|
|
505
504
|
local character = player:GetPlayerType()
|
|
506
505
|
return character == PlayerType.PLAYER_BETHANY or character == PlayerType.PLAYER_BETHANY_B
|