isaacscript-common 1.2.116 → 1.2.119
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.
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper function to stop muting all sound effects and music.
|
|
3
|
+
*
|
|
4
|
+
* Use this function to set things back to normal after having used [[`disableAllSounds`]].
|
|
5
|
+
*
|
|
6
|
+
* @param key The name of the mod feature that is requesting the enable/disable. This is needed so
|
|
7
|
+
* that multiple mod features can work in tandem.
|
|
8
|
+
*/
|
|
9
|
+
export declare function enableAllSound(key: string): void;
|
|
10
|
+
/**
|
|
11
|
+
* Helper function to disable all sound effects and music (by constantly musting them).
|
|
12
|
+
*
|
|
13
|
+
* Use the [[`enableAllSounds`]] helper function to set things back to normal.
|
|
14
|
+
*
|
|
15
|
+
* @param key The name of the mod feature that is requesting the enable/disable. This is needed so
|
|
16
|
+
* that multiple mod features can work in tandem.
|
|
17
|
+
*/
|
|
18
|
+
export declare function disableAllSound(key: string): void;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____lualib = require("lualib_bundle")
|
|
3
|
+
local Set = ____lualib.Set
|
|
4
|
+
local __TS__New = ____lualib.__TS__New
|
|
5
|
+
local ____exports = {}
|
|
6
|
+
local postRender, v
|
|
7
|
+
local ____errors = require("errors")
|
|
8
|
+
local getUpgradeErrorMsg = ____errors.getUpgradeErrorMsg
|
|
9
|
+
local ____sound = require("functions.sound")
|
|
10
|
+
local stopAllSoundEffects = ____sound.stopAllSoundEffects
|
|
11
|
+
local ____exports = require("features.saveDataManager.exports")
|
|
12
|
+
local saveDataManager = ____exports.saveDataManager
|
|
13
|
+
function postRender(self)
|
|
14
|
+
if v.run.disableSoundSet.size == 0 then
|
|
15
|
+
return
|
|
16
|
+
end
|
|
17
|
+
stopAllSoundEffects(nil)
|
|
18
|
+
end
|
|
19
|
+
local FEATURE_NAME = "sound disabler"
|
|
20
|
+
local initialized = false
|
|
21
|
+
local musicWasEnabled = false
|
|
22
|
+
v = {run = {disableSoundSet = __TS__New(Set)}}
|
|
23
|
+
function ____exports.disableSoundsInit(self, mod)
|
|
24
|
+
initialized = true
|
|
25
|
+
saveDataManager(nil, "disableSounds", v)
|
|
26
|
+
mod:AddCallback(ModCallbacks.MC_POST_RENDER, postRender)
|
|
27
|
+
end
|
|
28
|
+
function ____exports.enableAllSound(self, key)
|
|
29
|
+
if not initialized then
|
|
30
|
+
local msg = getUpgradeErrorMsg(nil, FEATURE_NAME)
|
|
31
|
+
error(msg)
|
|
32
|
+
end
|
|
33
|
+
if not v.run.disableSoundSet:has(key) then
|
|
34
|
+
return
|
|
35
|
+
end
|
|
36
|
+
v.run.disableSoundSet:delete(key)
|
|
37
|
+
if v.run.disableSoundSet.size == 0 and musicWasEnabled then
|
|
38
|
+
local musicManager = MusicManager()
|
|
39
|
+
musicManager:Enable()
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
function ____exports.disableAllSound(self, key)
|
|
43
|
+
if not initialized then
|
|
44
|
+
local msg = getUpgradeErrorMsg(nil, FEATURE_NAME)
|
|
45
|
+
error(msg)
|
|
46
|
+
end
|
|
47
|
+
if v.run.disableSoundSet.size == 0 then
|
|
48
|
+
local musicManager = MusicManager()
|
|
49
|
+
musicWasEnabled = musicManager:IsEnabled()
|
|
50
|
+
end
|
|
51
|
+
v.run.disableSoundSet:add(key)
|
|
52
|
+
end
|
|
53
|
+
return ____exports
|
|
@@ -218,7 +218,7 @@ export declare function getSubPlayerParent(subPlayer: EntitySubPlayer): EntityPl
|
|
|
218
218
|
* This function does not validate whether or not the provided player is Tainted Magdalene; that
|
|
219
219
|
* should be accomplished before invoking this function.
|
|
220
220
|
*/
|
|
221
|
-
export declare function getTaintedMagdaleneNonTemporaryMaxHearts(player: EntityPlayer):
|
|
221
|
+
export declare function getTaintedMagdaleneNonTemporaryMaxHearts(player: EntityPlayer): number;
|
|
222
222
|
/**
|
|
223
223
|
* Helper function to return the active charge and the battery charge combined. This is useful
|
|
224
224
|
* because you are not able to set the battery charge directly.
|
|
@@ -504,8 +504,10 @@ function ____exports.getSoulHearts(self, player)
|
|
|
504
504
|
return soulHearts - blackHearts
|
|
505
505
|
end
|
|
506
506
|
function ____exports.getTaintedMagdaleneNonTemporaryMaxHearts(self, player)
|
|
507
|
+
local maxHearts = player:GetMaxHearts()
|
|
507
508
|
local hasBirthright = player:HasCollectible(CollectibleType.COLLECTIBLE_BIRTHRIGHT)
|
|
508
|
-
|
|
509
|
+
local maxNonTemporaryMaxHearts = hasBirthright and 6 or 4
|
|
510
|
+
return math.min(maxHearts, maxNonTemporaryMaxHearts)
|
|
509
511
|
end
|
|
510
512
|
function ____exports.getTotalCharge(self, player, activeSlot)
|
|
511
513
|
local activeCharge = player:GetActiveCharge(activeSlot)
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { forceNewLevelCallback, forceNewRoomCallback, } from "./callbacks/reorde
|
|
|
2
2
|
export * from "./constants";
|
|
3
3
|
export { deployJSONRoom, deployRandomJSONRoom, emptyRoom, } from "./features/deployJSONRoom";
|
|
4
4
|
export { disableAllInputs, disableAllInputsExceptFor, disableMovementInputs, disableShootingInputs, enableAllInputs, enableAllInputsExceptFor, } from "./features/disableInputs";
|
|
5
|
+
export { disableAllSound, enableAllSound } from "./features/disableSound";
|
|
5
6
|
export { forgottenSwitch } from "./features/forgottenSwitch";
|
|
6
7
|
export { getCollectibleItemPoolType } from "./features/getCollectibleItemPoolType";
|
|
7
8
|
export * from "./features/isPonyActive";
|
package/dist/index.lua
CHANGED
|
@@ -39,6 +39,13 @@ do
|
|
|
39
39
|
____exports.enableAllInputs = enableAllInputs
|
|
40
40
|
____exports.enableAllInputsExceptFor = enableAllInputsExceptFor
|
|
41
41
|
end
|
|
42
|
+
do
|
|
43
|
+
local ____disableSound = require("features.disableSound")
|
|
44
|
+
local disableAllSound = ____disableSound.disableAllSound
|
|
45
|
+
local enableAllSound = ____disableSound.enableAllSound
|
|
46
|
+
____exports.disableAllSound = disableAllSound
|
|
47
|
+
____exports.enableAllSound = enableAllSound
|
|
48
|
+
end
|
|
42
49
|
do
|
|
43
50
|
local ____forgottenSwitch = require("features.forgottenSwitch")
|
|
44
51
|
local forgottenSwitch = ____forgottenSwitch.forgottenSwitch
|
package/dist/upgradeMod.lua
CHANGED
|
@@ -75,6 +75,8 @@ local ____deployJSONRoom = require("features.deployJSONRoom")
|
|
|
75
75
|
local deployJSONRoomInit = ____deployJSONRoom.deployJSONRoomInit
|
|
76
76
|
local ____disableInputs = require("features.disableInputs")
|
|
77
77
|
local disableInputsInit = ____disableInputs.disableInputsInit
|
|
78
|
+
local ____disableSound = require("features.disableSound")
|
|
79
|
+
local disableSoundsInit = ____disableSound.disableSoundsInit
|
|
78
80
|
local ____forgottenSwitch = require("features.forgottenSwitch")
|
|
79
81
|
local forgottenSwitchInit = ____forgottenSwitch.forgottenSwitchInit
|
|
80
82
|
local ____getCollectibleItemPoolType = require("features.getCollectibleItemPoolType")
|
|
@@ -134,6 +136,7 @@ end
|
|
|
134
136
|
function initFeatures(self, mod)
|
|
135
137
|
deployJSONRoomInit(nil, mod)
|
|
136
138
|
disableInputsInit(nil, mod)
|
|
139
|
+
disableSoundsInit(nil, mod)
|
|
137
140
|
forgottenSwitchInit(nil, mod)
|
|
138
141
|
getCollectibleItemPoolTypeInit(nil, mod)
|
|
139
142
|
preventCollectibleRotateInit(nil, mod)
|