isaacscript-common 1.0.562 → 1.0.566
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/postPlayerChangeType.lua +1 -1
- package/dist/callbacks/preNewLevel.lua +1 -1
- package/dist/callbacks/subscriptions/PreNewLevel.d.ts +2 -1
- package/dist/callbacks/subscriptions/PreNewLevel.lua +2 -2
- package/dist/callbacks/subscriptions/postPlayerChangeType.d.ts +1 -1
- package/dist/callbacks/subscriptions/postPlayerChangeType.lua +2 -2
- package/dist/callbacks/subscriptions/postTrinketBreak.d.ts +1 -1
- package/dist/functions/input.lua +7 -1
- package/dist/functions/log.d.ts +5 -0
- package/dist/functions/log.lua +51 -3
- package/dist/types/CallbackParametersCustom.d.ts +1 -1
- package/package.json +2 -2
|
@@ -27,7 +27,7 @@ function postPEffectUpdateReordered(self, player)
|
|
|
27
27
|
end
|
|
28
28
|
if character ~= storedCharacter then
|
|
29
29
|
v.run.characterMap:set(playerIndex, character)
|
|
30
|
-
postPlayerChangeTypeFire(nil, player)
|
|
30
|
+
postPlayerChangeTypeFire(nil, player, character)
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
v = {
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
export declare type PreNewLevelCallbackType = (player: EntityPlayer) => void;
|
|
@@ -8,11 +8,11 @@ end
|
|
|
8
8
|
function ____exports.preNewLevelRegister(self, callback)
|
|
9
9
|
__TS__ArrayPush(subscriptions, {callback})
|
|
10
10
|
end
|
|
11
|
-
function ____exports.preNewLevelFire(self)
|
|
11
|
+
function ____exports.preNewLevelFire(self, player)
|
|
12
12
|
for ____, ____value in ipairs(subscriptions) do
|
|
13
13
|
local callback
|
|
14
14
|
callback = ____value[1]
|
|
15
|
-
callback(nil)
|
|
15
|
+
callback(nil, player)
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
return ____exports
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
-
export declare type PostPlayerChangeTypeCallbackType = (player: EntityPlayer) => void;
|
|
2
|
+
export declare type PostPlayerChangeTypeCallbackType = (player: EntityPlayer, character: PlayerType) => void;
|
|
@@ -8,11 +8,11 @@ end
|
|
|
8
8
|
function ____exports.postPlayerChangeTypeRegister(self, callback)
|
|
9
9
|
__TS__ArrayPush(subscriptions, {callback})
|
|
10
10
|
end
|
|
11
|
-
function ____exports.postPlayerChangeTypeFire(self, player)
|
|
11
|
+
function ____exports.postPlayerChangeTypeFire(self, player, character)
|
|
12
12
|
for ____, ____value in ipairs(subscriptions) do
|
|
13
13
|
local callback
|
|
14
14
|
callback = ____value[1]
|
|
15
|
-
callback(nil, player)
|
|
15
|
+
callback(nil, player, character)
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
return ____exports
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
-
export declare type PostTrinketBreakCallbackType = (player: EntityPlayer, trinketType: TrinketType) => void;
|
|
2
|
+
export declare type PostTrinketBreakCallbackType = (player: EntityPlayer, trinketType: TrinketType | int) => void;
|
package/dist/functions/input.lua
CHANGED
|
@@ -132,7 +132,13 @@ function ____exports.isShootActionTriggeredOnAnyInput(self)
|
|
|
132
132
|
return false
|
|
133
133
|
end
|
|
134
134
|
function ____exports.keyboardToString(self, keyboard)
|
|
135
|
-
for
|
|
135
|
+
for ____, ____value in ipairs(
|
|
136
|
+
__TS__ObjectEntries(Keyboard)
|
|
137
|
+
) do
|
|
138
|
+
local keyName
|
|
139
|
+
keyName = ____value[1]
|
|
140
|
+
local keyCode
|
|
141
|
+
keyCode = ____value[2]
|
|
136
142
|
if keyCode == keyboard then
|
|
137
143
|
local withoutPrefix = __TS__StringSlice(keyName, #"KEY_")
|
|
138
144
|
local withoutUnderscores = string.gsub(withoutPrefix, "_", " ")
|
package/dist/functions/log.d.ts
CHANGED
|
@@ -28,6 +28,11 @@ export declare function logAllProjectileFlags(this: void, flags: int): void;
|
|
|
28
28
|
export declare function logAllTearFlags(this: void, flags: int): void;
|
|
29
29
|
/** Helper function for printing out every use flag that is turned on. Helpful when debugging. */
|
|
30
30
|
export declare function logAllUseFlags(this: void, flags: int): void;
|
|
31
|
+
/**
|
|
32
|
+
* Helper function for printing out every seed effect (i.e. Easter Egg) that is turned on for the
|
|
33
|
+
* particular run.
|
|
34
|
+
*/
|
|
35
|
+
export declare function logAllSeedEffects(this: void): void;
|
|
31
36
|
export declare function logArray<T>(this: void, array: T[]): void;
|
|
32
37
|
export declare function logColor(this: void, color: Color): void;
|
|
33
38
|
export declare function logEntity(this: void, entity: Entity): void;
|
package/dist/functions/log.lua
CHANGED
|
@@ -34,12 +34,25 @@ function ____exports.logAllFlags(flags, flagEnum, description)
|
|
|
34
34
|
description = description .. " "
|
|
35
35
|
end
|
|
36
36
|
____exports.log(("Logging all " .. description) .. "flags:")
|
|
37
|
-
|
|
37
|
+
local hasNoFlags = true
|
|
38
|
+
local i = 1
|
|
39
|
+
for ____, ____value in ipairs(
|
|
40
|
+
__TS__ObjectEntries(flagEnum)
|
|
41
|
+
) do
|
|
42
|
+
local key
|
|
43
|
+
key = ____value[1]
|
|
44
|
+
local value
|
|
45
|
+
value = ____value[2]
|
|
38
46
|
if hasFlag(nil, flags, value) then
|
|
39
47
|
____exports.log(
|
|
40
|
-
"
|
|
48
|
+
(((((" " .. tostring(i)) .. ") Has flag: ") .. key) .. " (") .. tostring(value)) .. ")"
|
|
41
49
|
)
|
|
50
|
+
hasNoFlags = false
|
|
42
51
|
end
|
|
52
|
+
i = i + 1
|
|
53
|
+
end
|
|
54
|
+
if hasNoFlags then
|
|
55
|
+
____exports.log(" n/a (no flags)")
|
|
43
56
|
end
|
|
44
57
|
end
|
|
45
58
|
function ____exports.logAllDamageFlags(flags)
|
|
@@ -51,6 +64,8 @@ end
|
|
|
51
64
|
function ____exports.logAllGameStateFlags()
|
|
52
65
|
local game = Game()
|
|
53
66
|
____exports.log("Logging all game state flags:")
|
|
67
|
+
local hasNoFlags = true
|
|
68
|
+
local i = 1
|
|
54
69
|
for ____, ____value in ipairs(
|
|
55
70
|
__TS__ObjectEntries(GameStateFlag)
|
|
56
71
|
) do
|
|
@@ -61,8 +76,15 @@ function ____exports.logAllGameStateFlags()
|
|
|
61
76
|
local gameStateFlag = value
|
|
62
77
|
local flagValue = game:GetStateFlag(gameStateFlag)
|
|
63
78
|
if flagValue then
|
|
64
|
-
____exports.log(
|
|
79
|
+
____exports.log(
|
|
80
|
+
(((((" " .. tostring(i)) .. ") Has flag: ") .. key) .. " (") .. tostring(value)) .. ")"
|
|
81
|
+
)
|
|
82
|
+
hasNoFlags = false
|
|
65
83
|
end
|
|
84
|
+
i = i + 1
|
|
85
|
+
end
|
|
86
|
+
if hasNoFlags then
|
|
87
|
+
____exports.log(" n/a (no flags)")
|
|
66
88
|
end
|
|
67
89
|
end
|
|
68
90
|
function ____exports.logAllProjectileFlags(flags)
|
|
@@ -74,6 +96,32 @@ end
|
|
|
74
96
|
function ____exports.logAllUseFlags(flags)
|
|
75
97
|
____exports.logAllFlags(flags, UseFlag, "use")
|
|
76
98
|
end
|
|
99
|
+
function ____exports.logAllSeedEffects()
|
|
100
|
+
local game = Game()
|
|
101
|
+
local seeds = game:GetSeeds()
|
|
102
|
+
____exports.log("Logging all seed effects:")
|
|
103
|
+
local hasNoSeedEffects = true
|
|
104
|
+
local i = 1
|
|
105
|
+
for ____, ____value in ipairs(
|
|
106
|
+
__TS__ObjectEntries(SeedEffect)
|
|
107
|
+
) do
|
|
108
|
+
local key
|
|
109
|
+
key = ____value[1]
|
|
110
|
+
local value
|
|
111
|
+
value = ____value[2]
|
|
112
|
+
local seedEffect = value
|
|
113
|
+
if seeds:HasSeedEffect(seedEffect) then
|
|
114
|
+
____exports.log(
|
|
115
|
+
(((((" " .. tostring(i)) .. ") ") .. key) .. " (") .. tostring(value)) .. ")"
|
|
116
|
+
)
|
|
117
|
+
hasNoSeedEffects = false
|
|
118
|
+
end
|
|
119
|
+
i = i + 1
|
|
120
|
+
end
|
|
121
|
+
if hasNoSeedEffects then
|
|
122
|
+
____exports.log(" n/a (no seed effects)")
|
|
123
|
+
end
|
|
124
|
+
end
|
|
77
125
|
function ____exports.logArray(array)
|
|
78
126
|
local arrayString = arrayToString(nil, array)
|
|
79
127
|
____exports.log("Array: " .. arrayString)
|
|
@@ -172,7 +172,7 @@ export interface CallbackParametersCustom {
|
|
|
172
172
|
];
|
|
173
173
|
[ModCallbacksCustom.MC_POST_TRINKET_BREAK]: [
|
|
174
174
|
callback: PostTrinketBreakCallbackType,
|
|
175
|
-
trinketType?: TrinketType
|
|
175
|
+
trinketType?: TrinketType | int
|
|
176
176
|
];
|
|
177
177
|
[ModCallbacksCustom.MC_POST_SLOT_INIT]: [
|
|
178
178
|
callback: PostSlotInitCallbackType,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.566",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist/**/*.d.ts"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^1.0.
|
|
28
|
+
"isaac-typescript-definitions": "^1.0.313",
|
|
29
29
|
"isaacscript-lint": "^1.0.74",
|
|
30
30
|
"typedoc": "^0.22.10",
|
|
31
31
|
"typescript": "4.4.4",
|