isaacscript-common 1.0.562 → 1.0.563

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.
@@ -132,7 +132,13 @@ function ____exports.isShootActionTriggeredOnAnyInput(self)
132
132
  return false
133
133
  end
134
134
  function ____exports.keyboardToString(self, keyboard)
135
- for keyName, keyCode in pairs(Keyboard) do
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, "_", " ")
@@ -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;
@@ -34,11 +34,15 @@ function ____exports.logAllFlags(flags, flagEnum, description)
34
34
  description = description .. " "
35
35
  end
36
36
  ____exports.log(("Logging all " .. description) .. "flags:")
37
- for key, value in pairs(flagEnum) do
37
+ for ____, ____value in ipairs(
38
+ __TS__ObjectEntries(flagEnum)
39
+ ) do
40
+ local key
41
+ key = ____value[1]
42
+ local value
43
+ value = ____value[2]
38
44
  if hasFlag(nil, flags, value) then
39
- ____exports.log(
40
- "- Has flag: " .. tostring(key)
41
- )
45
+ ____exports.log("- Has flag: " .. key)
42
46
  end
43
47
  end
44
48
  end
@@ -74,6 +78,28 @@ end
74
78
  function ____exports.logAllUseFlags(flags)
75
79
  ____exports.logAllFlags(flags, UseFlag, "use")
76
80
  end
81
+ function ____exports.logAllSeedEffects()
82
+ local game = Game()
83
+ local seeds = game:GetSeeds()
84
+ ____exports.log("Logging all seed effects:")
85
+ local hasNoSeedEffects = true
86
+ for ____, ____value in ipairs(
87
+ __TS__ObjectEntries(SeedEffect)
88
+ ) do
89
+ local key
90
+ key = ____value[1]
91
+ local value
92
+ value = ____value[2]
93
+ local seedEffect = value
94
+ if seeds:HasSeedEffect(seedEffect) then
95
+ ____exports.log("- " .. key)
96
+ hasNoSeedEffects = false
97
+ end
98
+ end
99
+ if hasNoSeedEffects then
100
+ ____exports.log("- n/a")
101
+ end
102
+ end
77
103
  function ____exports.logArray(array)
78
104
  local arrayString = arrayToString(nil, array)
79
105
  ____exports.log("Array: " .. arrayString)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.562",
3
+ "version": "1.0.563",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",