isaacscript-common 6.23.0 → 7.1.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.
- package/dist/callbacks/postPlayerChangeHealth.lua +8 -1
- package/dist/callbacks/postPlayerChangeStat.d.ts +3 -0
- package/dist/callbacks/postPlayerChangeStat.d.ts.map +1 -0
- package/dist/callbacks/postPlayerChangeStat.lua +88 -0
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.d.ts +2 -2
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +9 -2
- package/dist/callbacks/subscriptions/postPlayerChangeStat.d.ts +12 -0
- package/dist/callbacks/subscriptions/postPlayerChangeStat.d.ts.map +1 -0
- package/dist/callbacks/subscriptions/postPlayerChangeStat.lua +35 -0
- package/dist/classes/DefaultMap.d.ts +3 -3
- package/dist/classes/DefaultMap.d.ts.map +1 -1
- package/dist/classes/DefaultMap.lua +37 -0
- package/dist/core/constants.d.ts +1 -1
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.lua +1 -1
- package/dist/enums/ModCallbackCustom.d.ts +70 -39
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/enums/ModCallbackCustom.lua +37 -35
- package/dist/enums/StatType.d.ts +28 -0
- package/dist/enums/StatType.d.ts.map +1 -0
- package/dist/enums/StatType.lua +28 -0
- package/dist/enums/index.d.ts +1 -0
- package/dist/enums/index.d.ts.map +1 -1
- package/dist/enums/index.lua +8 -0
- package/dist/enums/private/CopyableIsaacAPIClassType.d.ts +5 -1
- package/dist/enums/private/CopyableIsaacAPIClassType.d.ts.map +1 -1
- package/dist/enums/private/CopyableIsaacAPIClassType.lua +3 -1
- package/dist/enums/private/SerializationBrand.d.ts +1 -0
- package/dist/enums/private/SerializationBrand.d.ts.map +1 -1
- package/dist/enums/private/SerializationBrand.lua +1 -0
- package/dist/features/customStage/versusScreen.lua +2 -2
- package/dist/features/disableInputs.d.ts +1 -1
- package/dist/features/disableInputs.d.ts.map +1 -1
- package/dist/features/runInNFrames.lua +1 -6
- package/dist/features/runNextRoom.lua +1 -6
- package/dist/features/saveDataManager/exports.d.ts +1 -1
- package/dist/features/saveDataManager/exports.d.ts.map +1 -1
- package/dist/features/saveDataManager/merge.d.ts +1 -0
- package/dist/features/saveDataManager/merge.d.ts.map +1 -1
- package/dist/features/saveDataManager/merge.lua +1 -0
- package/dist/functions/bitSet128.d.ts +25 -0
- package/dist/functions/bitSet128.d.ts.map +1 -0
- package/dist/functions/bitSet128.lua +71 -0
- package/dist/functions/collectibles.d.ts +2 -2
- package/dist/functions/collectibles.lua +2 -2
- package/dist/functions/color.d.ts +1 -1
- package/dist/functions/color.d.ts.map +1 -1
- package/dist/functions/color.lua +2 -2
- package/dist/functions/deepCopy.d.ts +1 -0
- package/dist/functions/deepCopy.d.ts.map +1 -1
- package/dist/functions/deepCopy.lua +2 -1
- package/dist/functions/familiars.d.ts +4 -4
- package/dist/functions/familiars.lua +4 -4
- package/dist/functions/flag.d.ts +1 -1
- package/dist/functions/flag.lua +1 -1
- package/dist/functions/index.d.ts +2 -0
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.lua +16 -0
- package/dist/functions/jsonRoom.lua +4 -4
- package/dist/functions/kColor.d.ts +1 -1
- package/dist/functions/kColor.d.ts.map +1 -1
- package/dist/functions/kColor.lua +2 -2
- package/dist/functions/log.lua +1 -1
- package/dist/functions/npcs.d.ts +2 -2
- package/dist/functions/npcs.lua +2 -2
- package/dist/functions/playerIndex.d.ts +1 -1
- package/dist/functions/playerIndex.lua +1 -1
- package/dist/functions/playerStats.d.ts +6 -0
- package/dist/functions/playerStats.d.ts.map +1 -0
- package/dist/functions/playerStats.lua +21 -0
- package/dist/functions/players.d.ts +1 -1
- package/dist/functions/players.lua +1 -1
- package/dist/functions/rng.d.ts +1 -1
- package/dist/functions/rng.d.ts.map +1 -1
- package/dist/functions/rng.lua +2 -2
- package/dist/functions/roomTransition.d.ts +1 -1
- package/dist/functions/roomTransition.lua +1 -1
- package/dist/functions/rooms.d.ts +1 -1
- package/dist/functions/rooms.lua +1 -1
- package/dist/functions/sprites.d.ts +3 -3
- package/dist/functions/sprites.lua +3 -3
- package/dist/functions/tears.d.ts +5 -4
- package/dist/functions/tears.d.ts.map +1 -1
- package/dist/functions/tears.lua +5 -4
- package/dist/functions/utils.d.ts +4 -1
- package/dist/functions/utils.d.ts.map +1 -1
- package/dist/functions/utils.lua +4 -1
- package/dist/functions/vector.d.ts +1 -1
- package/dist/functions/vector.d.ts.map +1 -1
- package/dist/functions/vector.lua +2 -2
- package/dist/initCustomCallbacks.d.ts.map +1 -1
- package/dist/initCustomCallbacks.lua +3 -0
- package/dist/interfaces/SaveData.d.ts +17 -10
- package/dist/interfaces/SaveData.d.ts.map +1 -1
- package/dist/interfaces/SaveData.lua +66 -0
- package/dist/interfaces/StatTypeType.d.ts +17 -0
- package/dist/interfaces/StatTypeType.d.ts.map +1 -0
- package/dist/interfaces/StatTypeType.lua +4 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/private/AddCallbackParameterCustom.d.ts +2 -0
- package/dist/interfaces/private/AddCallbackParameterCustom.d.ts.map +1 -1
- package/dist/objects/callbackRegisterFunctions.d.ts.map +1 -1
- package/dist/objects/callbackRegisterFunctions.lua +3 -0
- package/dist/objects/isaacAPIClassTypeToBrand.d.ts.map +1 -1
- package/dist/objects/isaacAPIClassTypeToBrand.lua +7 -1
- package/dist/objects/isaacAPIClassTypeToFunctions.d.ts.map +1 -1
- package/dist/objects/isaacAPIClassTypeToFunctions.lua +12 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/callbacks/postPlayerChangeHealth.ts +7 -1
- package/src/callbacks/postPlayerChangeStat.ts +110 -0
- package/src/callbacks/subscriptions/postPlayerChangeHealth.ts +5 -1
- package/src/callbacks/subscriptions/postPlayerChangeStat.ts +55 -0
- package/src/classes/DefaultMap.ts +36 -7
- package/src/core/constants.ts +1 -1
- package/src/enums/ModCallbackCustom.ts +36 -4
- package/src/enums/StatType.ts +47 -0
- package/src/enums/index.ts +1 -0
- package/src/enums/indexTypeDoc.ts +1 -0
- package/src/enums/private/CopyableIsaacAPIClassType.ts +5 -1
- package/src/enums/private/SerializationBrand.ts +1 -0
- package/src/features/customStage/versusScreen.ts +2 -2
- package/src/features/disableInputs.ts +3 -9
- package/src/features/runInNFrames.ts +1 -1
- package/src/features/runNextRoom.ts +1 -1
- package/src/features/saveDataManager/exports.ts +1 -1
- package/src/features/saveDataManager/merge.ts +1 -0
- package/src/functions/bitSet128.ts +96 -0
- package/src/functions/collectibles.ts +2 -2
- package/src/functions/color.ts +3 -2
- package/src/functions/deepCopy.ts +2 -1
- package/src/functions/familiars.ts +4 -4
- package/src/functions/flag.ts +1 -1
- package/src/functions/index.ts +2 -0
- package/src/functions/indexTypeDoc.ts +2 -0
- package/src/functions/jsonRoom.ts +4 -4
- package/src/functions/kColor.ts +2 -2
- package/src/functions/log.ts +1 -1
- package/src/functions/npcs.ts +2 -2
- package/src/functions/playerIndex.ts +1 -1
- package/src/functions/playerStats.ts +25 -0
- package/src/functions/players.ts +1 -1
- package/src/functions/rng.ts +2 -2
- package/src/functions/roomTransition.ts +1 -1
- package/src/functions/rooms.ts +1 -1
- package/src/functions/sprites.ts +3 -3
- package/src/functions/tears.ts +5 -4
- package/src/functions/utils.ts +5 -1
- package/src/functions/vector.ts +2 -2
- package/src/initCustomCallbacks.ts +2 -0
- package/src/interfaces/SaveData.ts +224 -26
- package/src/interfaces/StatTypeType.ts +17 -0
- package/src/interfaces/index.ts +1 -0
- package/src/interfaces/indexTypeDoc.ts +1 -0
- package/src/interfaces/private/AddCallbackParameterCustom.ts +2 -0
- package/src/objects/callbackRegisterFunctions.ts +2 -0
- package/src/objects/isaacAPIClassTypeToBrand.ts +1 -0
- package/src/objects/isaacAPIClassTypeToFunctions.ts +12 -0
- package/src/types/index.ts +0 -1
- package/src/types/indexTypeDoc.ts +0 -1
- package/dist/types/AnyClass.d.ts +0 -2
- package/dist/types/AnyClass.d.ts.map +0 -1
- package/dist/types/AnyClass.lua +0 -2
- package/src/types/AnyClass.ts +0 -1
|
@@ -35,7 +35,14 @@ function postPEffectUpdateReordered(self, player)
|
|
|
35
35
|
playerHealthMap:set(healthType, currentHealthValue)
|
|
36
36
|
if storedHealthValue ~= nil and storedHealthValue ~= currentHealthValue then
|
|
37
37
|
local difference = currentHealthValue - storedHealthValue
|
|
38
|
-
postPlayerChangeHealthFire(
|
|
38
|
+
postPlayerChangeHealthFire(
|
|
39
|
+
nil,
|
|
40
|
+
player,
|
|
41
|
+
healthType,
|
|
42
|
+
difference,
|
|
43
|
+
storedHealthValue,
|
|
44
|
+
currentHealthValue
|
|
45
|
+
)
|
|
39
46
|
end
|
|
40
47
|
end
|
|
41
48
|
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postPlayerChangeStat.d.ts","sourceRoot":"","sources":["../../src/callbacks/postPlayerChangeStat.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA+BrD,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAO/D"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local hasSubscriptions, postPEffectUpdateReordered, statEquals, v
|
|
6
|
+
local ____DefaultMap = require("classes.DefaultMap")
|
|
7
|
+
local DefaultMap = ____DefaultMap.DefaultMap
|
|
8
|
+
local ____enums = require("enums.index")
|
|
9
|
+
local StatType = ____enums.StatType
|
|
10
|
+
local ____ModCallbackCustom = require("enums.ModCallbackCustom")
|
|
11
|
+
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
12
|
+
local ____exports = require("features.saveDataManager.exports")
|
|
13
|
+
local saveDataManager = ____exports.saveDataManager
|
|
14
|
+
local ____functions = require("functions.index")
|
|
15
|
+
local colorEquals = ____functions.colorEquals
|
|
16
|
+
local getPlayerStat = ____functions.getPlayerStat
|
|
17
|
+
local isBitSet128 = ____functions.isBitSet128
|
|
18
|
+
local isBoolean = ____functions.isBoolean
|
|
19
|
+
local isColor = ____functions.isColor
|
|
20
|
+
local isNumber = ____functions.isNumber
|
|
21
|
+
local ____enums = require("functions.enums")
|
|
22
|
+
local getEnumValues = ____enums.getEnumValues
|
|
23
|
+
local ____playerIndex = require("functions.playerIndex")
|
|
24
|
+
local getPlayerIndex = ____playerIndex.getPlayerIndex
|
|
25
|
+
local ____postPlayerChangeStat = require("callbacks.subscriptions.postPlayerChangeStat")
|
|
26
|
+
local postPlayerChangeStatFire = ____postPlayerChangeStat.postPlayerChangeStatFire
|
|
27
|
+
local postPlayerChangeStatHasSubscriptions = ____postPlayerChangeStat.postPlayerChangeStatHasSubscriptions
|
|
28
|
+
function hasSubscriptions(self)
|
|
29
|
+
return postPlayerChangeStatHasSubscriptions(nil)
|
|
30
|
+
end
|
|
31
|
+
function postPEffectUpdateReordered(self, player)
|
|
32
|
+
if not hasSubscriptions(nil) then
|
|
33
|
+
return
|
|
34
|
+
end
|
|
35
|
+
local playerIndex = getPlayerIndex(nil, player, true)
|
|
36
|
+
local playerStatMap = v.run.playersStatMap:getAndSetDefault(playerIndex)
|
|
37
|
+
for ____, statType in ipairs(getEnumValues(nil, StatType)) do
|
|
38
|
+
do
|
|
39
|
+
local storedStatValue = playerStatMap:get(statType)
|
|
40
|
+
local currentStatValue = getPlayerStat(nil, player, statType)
|
|
41
|
+
playerStatMap:set(statType, currentStatValue)
|
|
42
|
+
if storedStatValue == nil then
|
|
43
|
+
goto __continue7
|
|
44
|
+
end
|
|
45
|
+
if not statEquals(nil, storedStatValue, currentStatValue) then
|
|
46
|
+
local isNumberStat = isNumber(nil, storedStatValue) and isNumber(nil, currentStatValue)
|
|
47
|
+
local difference = isNumberStat and currentStatValue - storedStatValue or 0
|
|
48
|
+
postPlayerChangeStatFire(
|
|
49
|
+
nil,
|
|
50
|
+
player,
|
|
51
|
+
statType,
|
|
52
|
+
difference,
|
|
53
|
+
storedStatValue,
|
|
54
|
+
currentStatValue
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
::__continue7::
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
function statEquals(self, oldValue, newValue)
|
|
62
|
+
local isNumberStat = isNumber(nil, oldValue) and isNumber(nil, newValue)
|
|
63
|
+
if isNumberStat then
|
|
64
|
+
return oldValue == newValue
|
|
65
|
+
end
|
|
66
|
+
local isBooleanStat = isBoolean(nil, oldValue) and isBoolean(nil, newValue)
|
|
67
|
+
if isBooleanStat then
|
|
68
|
+
return oldValue == newValue
|
|
69
|
+
end
|
|
70
|
+
local isBitSet128Stat = isBitSet128(nil, oldValue) and isBitSet128(nil, newValue)
|
|
71
|
+
if isBitSet128Stat then
|
|
72
|
+
return oldValue == newValue
|
|
73
|
+
end
|
|
74
|
+
local isColorStat = isColor(nil, oldValue) and isColor(nil, newValue)
|
|
75
|
+
if isColorStat then
|
|
76
|
+
return colorEquals(nil, oldValue, newValue)
|
|
77
|
+
end
|
|
78
|
+
error("Failed to determine the type of a stat in the \"POST_PLAYER_CHANGE_STAT\" callback.")
|
|
79
|
+
end
|
|
80
|
+
v = {run = {playersStatMap = __TS__New(
|
|
81
|
+
DefaultMap,
|
|
82
|
+
function() return __TS__New(Map) end
|
|
83
|
+
)}}
|
|
84
|
+
function ____exports.postPlayerChangeStatInit(self, mod)
|
|
85
|
+
saveDataManager(nil, "postPlayerChangeStat", v, hasSubscriptions)
|
|
86
|
+
mod:AddCallbackCustom(ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, postPEffectUpdateReordered)
|
|
87
|
+
end
|
|
88
|
+
return ____exports
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PlayerType, PlayerVariant } from "isaac-typescript-definitions";
|
|
2
2
|
import { HealthType } from "../../enums/HealthType";
|
|
3
3
|
export declare type PostPlayerChangeHealthRegisterParameters = [
|
|
4
|
-
callback: (player: EntityPlayer, healthType: HealthType, difference: int) => void,
|
|
4
|
+
callback: (player: EntityPlayer, healthType: HealthType, difference: int, oldValue: int, newValue: int) => void,
|
|
5
5
|
playerVariant?: PlayerVariant,
|
|
6
6
|
character?: PlayerType
|
|
7
7
|
];
|
|
8
8
|
export declare function postPlayerChangeHealthHasSubscriptions(): boolean;
|
|
9
9
|
export declare function postPlayerChangeHealthRegister(...args: PostPlayerChangeHealthRegisterParameters): void;
|
|
10
|
-
export declare function postPlayerChangeHealthFire(player: EntityPlayer, healthType: HealthType, difference: int): void;
|
|
10
|
+
export declare function postPlayerChangeHealthFire(player: EntityPlayer, healthType: HealthType, difference: int, oldValue: int, newValue: int): void;
|
|
11
11
|
//# sourceMappingURL=postPlayerChangeHealth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postPlayerChangeHealth.d.ts","sourceRoot":"","sources":["../../../src/callbacks/subscriptions/postPlayerChangeHealth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,oBAAY,wCAAwC,GAAG;IACrD,QAAQ,EAAE,CACR,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"postPlayerChangeHealth.d.ts","sourceRoot":"","sources":["../../../src/callbacks/subscriptions/postPlayerChangeHealth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,oBAAY,wCAAwC,GAAG;IACrD,QAAQ,EAAE,CACR,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,GAAG,EACf,QAAQ,EAAE,GAAG,EACb,QAAQ,EAAE,GAAG,KACV,IAAI;IACT,aAAa,CAAC,EAAE,aAAa;IAC7B,SAAS,CAAC,EAAE,UAAU;CACvB,CAAC;AAIF,wBAAgB,sCAAsC,IAAI,OAAO,CAEhE;AAED,wBAAgB,8BAA8B,CAC5C,GAAG,IAAI,EAAE,wCAAwC,GAChD,IAAI,CAEN;AAED,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,GAAG,EACf,QAAQ,EAAE,GAAG,EACb,QAAQ,EAAE,GAAG,GACZ,IAAI,CAgBN"}
|
|
@@ -7,7 +7,7 @@ function ____exports.postPlayerChangeHealthRegister(self, ...)
|
|
|
7
7
|
local args = {...}
|
|
8
8
|
subscriptions[#subscriptions + 1] = args
|
|
9
9
|
end
|
|
10
|
-
function ____exports.postPlayerChangeHealthFire(self, player, healthType, difference)
|
|
10
|
+
function ____exports.postPlayerChangeHealthFire(self, player, healthType, difference, oldValue, newValue)
|
|
11
11
|
local character = player:GetPlayerType()
|
|
12
12
|
for ____, ____value in ipairs(subscriptions) do
|
|
13
13
|
local callback = ____value[1]
|
|
@@ -20,7 +20,14 @@ function ____exports.postPlayerChangeHealthFire(self, player, healthType, differ
|
|
|
20
20
|
if callbackCharacter ~= nil and callbackCharacter ~= character then
|
|
21
21
|
goto __continue5
|
|
22
22
|
end
|
|
23
|
-
callback(
|
|
23
|
+
callback(
|
|
24
|
+
nil,
|
|
25
|
+
player,
|
|
26
|
+
healthType,
|
|
27
|
+
difference,
|
|
28
|
+
oldValue,
|
|
29
|
+
newValue
|
|
30
|
+
)
|
|
24
31
|
end
|
|
25
32
|
::__continue5::
|
|
26
33
|
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PlayerType, PlayerVariant, TearFlag } from "isaac-typescript-definitions";
|
|
2
|
+
import { StatType } from "../../enums/StatType";
|
|
3
|
+
import { StatTypeType } from "../../interfaces/StatTypeType";
|
|
4
|
+
export declare type PostPlayerChangeStatRegisterParameters = [
|
|
5
|
+
callback: (player: EntityPlayer, statType: StatType, difference: int, oldValue: number | boolean | BitFlags<TearFlag> | Color | Vector, newValue: number | boolean | BitFlags<TearFlag> | Color | Vector) => void,
|
|
6
|
+
playerVariant?: PlayerVariant,
|
|
7
|
+
character?: PlayerType
|
|
8
|
+
];
|
|
9
|
+
export declare function postPlayerChangeStatHasSubscriptions(): boolean;
|
|
10
|
+
export declare function postPlayerChangeStatRegister(...args: PostPlayerChangeStatRegisterParameters): void;
|
|
11
|
+
export declare function postPlayerChangeStatFire<T extends StatType>(player: EntityPlayer, statType: T, difference: int, oldValue: StatTypeType[T], newValue: StatTypeType[T]): void;
|
|
12
|
+
//# sourceMappingURL=postPlayerChangeStat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postPlayerChangeStat.d.ts","sourceRoot":"","sources":["../../../src/callbacks/subscriptions/postPlayerChangeStat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,aAAa,EACb,QAAQ,EACT,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,oBAAY,sCAAsC,GAAG;IACnD,QAAQ,EAAE,CACR,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,GAAG,EACf,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,KAAK,GAAG,MAAM,EAChE,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,KAAK,GAAG,MAAM,KAC7D,IAAI;IACT,aAAa,CAAC,EAAE,aAAa;IAC7B,SAAS,CAAC,EAAE,UAAU;CACvB,CAAC;AAIF,wBAAgB,oCAAoC,IAAI,OAAO,CAE9D;AAED,wBAAgB,4BAA4B,CAC1C,GAAG,IAAI,EAAE,sCAAsC,GAC9C,IAAI,CAEN;AAED,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,QAAQ,EACzD,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,CAAC,EACX,UAAU,EAAE,GAAG,EACf,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,EACzB,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,GACxB,IAAI,CAgBN"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local subscriptions = {}
|
|
3
|
+
function ____exports.postPlayerChangeStatHasSubscriptions(self)
|
|
4
|
+
return #subscriptions > 0
|
|
5
|
+
end
|
|
6
|
+
function ____exports.postPlayerChangeStatRegister(self, ...)
|
|
7
|
+
local args = {...}
|
|
8
|
+
subscriptions[#subscriptions + 1] = args
|
|
9
|
+
end
|
|
10
|
+
function ____exports.postPlayerChangeStatFire(self, player, statType, difference, oldValue, newValue)
|
|
11
|
+
local character = player:GetPlayerType()
|
|
12
|
+
for ____, ____value in ipairs(subscriptions) do
|
|
13
|
+
local callback = ____value[1]
|
|
14
|
+
local playerVariant = ____value[2]
|
|
15
|
+
local callbackCharacter = ____value[3]
|
|
16
|
+
do
|
|
17
|
+
if playerVariant ~= nil and playerVariant ~= player.Variant then
|
|
18
|
+
goto __continue5
|
|
19
|
+
end
|
|
20
|
+
if callbackCharacter ~= nil and callbackCharacter ~= character then
|
|
21
|
+
goto __continue5
|
|
22
|
+
end
|
|
23
|
+
callback(
|
|
24
|
+
nil,
|
|
25
|
+
player,
|
|
26
|
+
statType,
|
|
27
|
+
difference,
|
|
28
|
+
oldValue,
|
|
29
|
+
newValue
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
::__continue5::
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
return ____exports
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* A function that creates the default value for your `DefaultMap`. For example, if it was a
|
|
3
3
|
* `DefaultMap` containing maps, the factory function would be: `() => new Map()`
|
|
4
4
|
*/
|
|
5
|
-
export declare type FactoryFunction<V, Args extends unknown[]> = (...
|
|
5
|
+
export declare type FactoryFunction<V, Args extends unknown[]> = (...args: Args) => V;
|
|
6
6
|
/**
|
|
7
7
|
* `DefaultMap` is a data structure that makes working with default values easier.
|
|
8
8
|
*
|
|
@@ -95,12 +95,12 @@ export declare class DefaultMap<Key, Value, Args extends unknown[] = []> extends
|
|
|
95
95
|
* If the key exists, this will return the same thing as the normal `Map.get` method. Otherwise,
|
|
96
96
|
* it will set a default value for the provided key, and then return the default value.
|
|
97
97
|
*/
|
|
98
|
-
getAndSetDefault(key: Key, ...
|
|
98
|
+
getAndSetDefault(key: Key, ...args: Args): Value;
|
|
99
99
|
/**
|
|
100
100
|
* Returns the default value to be used for a new key. (If a factory function was provided during
|
|
101
101
|
* instantiation, this will execute the factory function.)
|
|
102
102
|
*/
|
|
103
|
-
getDefaultValue(...
|
|
103
|
+
getDefaultValue(...args: Args): Value;
|
|
104
104
|
/**
|
|
105
105
|
* Helper method for cloning the map. Returns either the default value or a reference to the
|
|
106
106
|
* factory function.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultMap.d.ts","sourceRoot":"","sources":["../../src/classes/DefaultMap.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,oBAAY,eAAe,CAAC,CAAC,EAAE,IAAI,SAAS,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"DefaultMap.d.ts","sourceRoot":"","sources":["../../src/classes/DefaultMap.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,oBAAY,eAAe,CAAC,CAAC,EAAE,IAAI,SAAS,OAAO,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,CAAC,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,qBAAa,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,SAAS,OAAO,EAAE,GAAG,EAAE,CAAE,SAAQ,GAAG,CAC1E,GAAG,EACH,KAAK,CACN;IACC,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,mBAAmB,CAA2C;IAEtE;;;OAGG;gBAED,6BAA6B,EAAE,KAAK,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,EACnE,gBAAgB,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAqB3C;;;OAGG;IACH,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK;IAWhD;;;OAGG;IACH,eAAe,CAAC,GAAG,IAAI,EAAE,IAAI,GAAG,KAAK;IAYrC;;;OAGG;IACH,iBAAiB,IAAI,KAAK,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC;CAW1D"}
|
|
@@ -3,6 +3,7 @@ local __TS__Class = ____lualib.__TS__Class
|
|
|
3
3
|
local Map = ____lualib.Map
|
|
4
4
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
5
5
|
local __TS__TypeOf = ____lualib.__TS__TypeOf
|
|
6
|
+
local __TS__New = ____lualib.__TS__New
|
|
6
7
|
local ____exports = {}
|
|
7
8
|
local ____types = require("functions.types")
|
|
8
9
|
local isFunction = ____types.isFunction
|
|
@@ -131,4 +132,40 @@ function DefaultMap.prototype.getConstructorArg(self)
|
|
|
131
132
|
end
|
|
132
133
|
error("A DefaultMap was incorrectly instantiated.")
|
|
133
134
|
end
|
|
135
|
+
local function test(self)
|
|
136
|
+
local myDefaultMapBoolean = __TS__New(____exports.DefaultMap, false)
|
|
137
|
+
local myDefaultMapBooleanFactory = __TS__New(
|
|
138
|
+
____exports.DefaultMap,
|
|
139
|
+
function() return false end
|
|
140
|
+
)
|
|
141
|
+
local myDefaultMapBooleanWithoutParams = __TS__New(____exports.DefaultMap, false)
|
|
142
|
+
local myDefaultMapNumber = __TS__New(____exports.DefaultMap, 123)
|
|
143
|
+
local myDefaultMapNumberFactory = __TS__New(
|
|
144
|
+
____exports.DefaultMap,
|
|
145
|
+
function() return 123 end
|
|
146
|
+
)
|
|
147
|
+
local myDefaultMapNumberWithoutParams = __TS__New(____exports.DefaultMap, 123)
|
|
148
|
+
local myDefaultMapString = __TS__New(____exports.DefaultMap, "foo")
|
|
149
|
+
local myDefaultMapStringFactory = __TS__New(
|
|
150
|
+
____exports.DefaultMap,
|
|
151
|
+
function() return "foo" end
|
|
152
|
+
)
|
|
153
|
+
local myDefaultMapStringWithoutParams = __TS__New(____exports.DefaultMap, "foo")
|
|
154
|
+
local myDefaultMapArray = __TS__New(
|
|
155
|
+
____exports.DefaultMap,
|
|
156
|
+
function() return {} end
|
|
157
|
+
)
|
|
158
|
+
local myDefaultMapArrayWithoutParams = __TS__New(
|
|
159
|
+
____exports.DefaultMap,
|
|
160
|
+
function() return {} end
|
|
161
|
+
)
|
|
162
|
+
local myDefaultMapMap = __TS__New(
|
|
163
|
+
____exports.DefaultMap,
|
|
164
|
+
function() return __TS__New(Map) end
|
|
165
|
+
)
|
|
166
|
+
local myDefaultMapMapWithoutParams = __TS__New(
|
|
167
|
+
____exports.DefaultMap,
|
|
168
|
+
function() return __TS__New(Map) end
|
|
169
|
+
)
|
|
170
|
+
end
|
|
134
171
|
return ____exports
|
package/dist/core/constants.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare const AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125;
|
|
|
22
22
|
export declare const BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png";
|
|
23
23
|
/** Bombs explode when their frame count is equal to this value. */
|
|
24
24
|
export declare const BOMB_EXPLODE_FRAME = 45;
|
|
25
|
-
/** This is the initial value of the `EntityPickup.Wait`
|
|
25
|
+
/** This is the initial value of the `EntityPickup.Wait` field after a collectible is spawned. */
|
|
26
26
|
export declare const COLLECTIBLE_INITIAL_WAIT = 20;
|
|
27
27
|
export declare const DEFAULT_ITEM_POOL_TYPE = ItemPoolType.TREASURE;
|
|
28
28
|
/** This is also the distance that a player spawns from the door that they enter a room from. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGf,YAAY,EAEb,MAAM,8BAA8B,CAAC;AAKtC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;EAI7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iCAAiC,SAAS,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,4CAA4C,CAAC;AAE7E,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGf,YAAY,EAEb,MAAM,8BAA8B,CAAC;AAKtC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;EAI7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iCAAiC,SAAS,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,4CAA4C,CAAC;AAE7E,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,iGAAiG;AACjG,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D,gGAAgG;AAChG,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,KAAK,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,iBACrB,CAAC;AAExB,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,6DAA6D;AAC7D,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,iFAAiF;AACjF,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,eAAO,MAAM,wBAAwB,QAA6B,CAAC;AAEnE,yFAAyF;AACzF,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,cAAc,IAAM,CAAC;AAElC,yCAAyC;AACzC,eAAO,MAAM,uCAAuC,QAAmB,CAAC;AAExE,iCAAiC;AACjC,eAAO,MAAM,sCAAsC,QAAmB,CAAC;AAEvE;;;GAGG;AACH,eAAO,MAAM,gCAAgC,QAAmB,CAAC;AAEjE,+EAA+E;AAC/E,eAAO,MAAM,iCAAiC,SAAS,CAAC;AAExD,eAAO,MAAM,cAAc,QAA+B,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAyB,CAAC;AAExD,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,sBAAsB,QAA8B,CAAC;AAElE,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,6FAA6F;AAC7F,eAAO,MAAM,gDAAgD,QAAQ,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAgB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAgB,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAkB,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAsB,CAAC"}
|
package/dist/core/constants.lua
CHANGED
|
@@ -23,7 +23,7 @@ ____exports.AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125
|
|
|
23
23
|
____exports.BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png"
|
|
24
24
|
--- Bombs explode when their frame count is equal to this value.
|
|
25
25
|
____exports.BOMB_EXPLODE_FRAME = 45
|
|
26
|
-
--- This is the initial value of the `EntityPickup.Wait`
|
|
26
|
+
--- This is the initial value of the `EntityPickup.Wait` field after a collectible is spawned.
|
|
27
27
|
____exports.COLLECTIBLE_INITIAL_WAIT = 20
|
|
28
28
|
____exports.DEFAULT_ITEM_POOL_TYPE = ItemPoolType.TREASURE
|
|
29
29
|
--- This is also the distance that a player spawns from the door that they enter a room from.
|