isaacscript-common 6.17.0 → 6.17.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.
@@ -519,7 +519,7 @@ export declare enum ModCallbackCustom {
519
519
  * - When registering the callback, takes an optional second argument that will make the callback
520
520
  * only fire if it matches the `ItemType` provided.
521
521
  * - When registering the callback, takes an optional third argument that will make the callback
522
- * only fire if the `CollectibleType` or the `TrinketType` matches the ID provided.
522
+ * only fire if the `CollectibleType` or the `TrinketType` matches the sub-type provided.
523
523
  *
524
524
  * ```ts
525
525
  * function postItemPickup(
@@ -1,5 +1,5 @@
1
1
  import { GridCollisionClass, GridEntityType } from "isaac-typescript-definitions";
2
- import { CustomGridEntityData } from "../interfaces/CustomGridEntityData";
2
+ import { GridEntityCustomData } from "../interfaces/GridEntityCustomData";
3
3
  /**
4
4
  * Helper function to spawn a custom grid entity. Custom grid entities are persistent in that they
5
5
  * will reappear if the player leaves and re-enters the room. (It will be manually respawned in the
@@ -46,13 +46,13 @@ export declare function spawnCustomGridEntity(gridEntityTypeCustom: GridEntityTy
46
46
  * @returns The grid entity that was removed. Returns undefined if no grid entity was found at the
47
47
  * given location or if the given grid entity was not a custom grid entity.
48
48
  */
49
- export declare function removeCustomGrid(gridIndexOrPositionOrGridEntity: int | Vector | GridEntity, updateRoom?: boolean): GridEntity | undefined;
49
+ export declare function removeCustomGridEntity(gridIndexOrPositionOrGridEntity: int | Vector | GridEntity, updateRoom?: boolean): GridEntity | undefined;
50
50
  /**
51
51
  * Helper function to get the custom grid entities in the current room. Returns an array of tuples
52
52
  * containing the raw decoration grid entity and the associated entity data.
53
53
  */
54
54
  export declare function getCustomGridEntities(): Array<[
55
55
  gridEntity: GridEntity,
56
- data: CustomGridEntityData
56
+ data: GridEntityCustomData
57
57
  ]>;
58
58
  //# sourceMappingURL=customGridEntity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"customGridEntity.d.ts","sourceRoot":"","sources":["../../src/features/customGridEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,kBAAkB,EAClB,cAAc,EAGf,MAAM,8BAA8B,CAAC;AAgBtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AA0K1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,qBAAqB,CACnC,oBAAoB,EAAE,cAAc,EACpC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,MAAM,EAChB,gBAAgB,CAAC,EAAE,MAAM,EACzB,SAAS,UAAQ,GAChB,UAAU,CA8DZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC9B,+BAA+B,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,EAC1D,UAAU,UAAO,GAChB,UAAU,GAAG,SAAS,CAqCxB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,KAAK,CAC5C;IAAC,UAAU,EAAE,UAAU;IAAE,IAAI,EAAE,oBAAoB;CAAC,CACrD,CAiBA"}
1
+ {"version":3,"file":"customGridEntity.d.ts","sourceRoot":"","sources":["../../src/features/customGridEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,kBAAkB,EAClB,cAAc,EAGf,MAAM,8BAA8B,CAAC;AAgBtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AA2K1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,qBAAqB,CACnC,oBAAoB,EAAE,cAAc,EACpC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,MAAM,EAChB,gBAAgB,CAAC,EAAE,MAAM,EACzB,SAAS,UAAQ,GAChB,UAAU,CAyEZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,+BAA+B,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,EAC1D,UAAU,UAAO,GAChB,UAAU,GAAG,SAAS,CAqCxB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,KAAK,CAC5C;IAAC,UAAU,EAAE,UAAU;IAAE,IAAI,EAAE,oBAAoB;CAAC,CACrD,CAiBA"}
@@ -4,10 +4,11 @@ local __TS__New = ____lualib.__TS__New
4
4
  local Set = ____lualib.Set
5
5
  local __TS__Iterator = ____lualib.__TS__Iterator
6
6
  local ____exports = {}
7
- local entityTakeDmgDummy, preUseItemWeNeedToGoDeeper, postNewRoomReordered, v
7
+ local entityTakeDmgGenericProp, preUseItemWeNeedToGoDeeper, postNewRoomReordered, v
8
8
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
9
9
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
10
10
  local DamageFlag = ____isaac_2Dtypescript_2Ddefinitions.DamageFlag
11
+ local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
11
12
  local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
12
13
  local GridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.GridCollisionClass
13
14
  local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
@@ -24,8 +25,8 @@ local ____ModCallbackCustom = require("enums.ModCallbackCustom")
24
25
  local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
25
26
  local ____featuresInitialized = require("featuresInitialized")
26
27
  local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
27
- local ____entitiesSpecific = require("functions.entitiesSpecific")
28
- local spawnNPC = ____entitiesSpecific.spawnNPC
28
+ local ____entities = require("functions.entities")
29
+ local spawn = ____entities.spawn
29
30
  local ____flag = require("functions.flag")
30
31
  local hasFlag = ____flag.hasFlag
31
32
  local ____gridEntities = require("functions.gridEntities")
@@ -39,9 +40,9 @@ local ____runInNFrames = require("features.runInNFrames")
39
40
  local runNextGameFrame = ____runInNFrames.runNextGameFrame
40
41
  local ____exports = require("features.saveDataManager.exports")
41
42
  local saveDataManager = ____exports.saveDataManager
42
- function entityTakeDmgDummy(self, tookDamage, _damageAmount, damageFlags, _damageSource, _damageCountdownFrames)
43
+ function entityTakeDmgGenericProp(self, tookDamage, _damageAmount, damageFlags, _damageSource, _damageCountdownFrames)
43
44
  local ptrHash = GetPtrHash(tookDamage)
44
- if not v.room.dummyPtrHashes:has(ptrHash) then
45
+ if not v.room.genericPropPtrHashes:has(ptrHash) then
45
46
  return nil
46
47
  end
47
48
  if not hasFlag(nil, damageFlags, DamageFlag.EXPLOSION) then
@@ -125,13 +126,14 @@ function postNewRoomReordered(self)
125
126
  end
126
127
  end
127
128
  local FEATURE_NAME = "customGridEntity"
129
+ local GENERIC_PROP_SIZE_MULTIPLIER = 0.66
128
130
  v = {
129
131
  level = {customGridEntities = __TS__New(
130
132
  DefaultMap,
131
133
  function() return __TS__New(Map) end
132
134
  )},
133
135
  room = {
134
- dummyPtrHashes = __TS__New(Set),
136
+ genericPropPtrHashes = __TS__New(Set),
135
137
  manuallyUsingShovel = false
136
138
  }
137
139
  }
@@ -139,7 +141,7 @@ v = {
139
141
  -- @internal
140
142
  function ____exports.customGridEntityInit(self, mod)
141
143
  saveDataManager(nil, FEATURE_NAME, v)
142
- mod:AddCallback(ModCallback.ENTITY_TAKE_DMG, entityTakeDmgDummy, EntityType.DUMMY)
144
+ mod:AddCallback(ModCallback.ENTITY_TAKE_DMG, entityTakeDmgGenericProp, EntityType.GENERIC_PROP)
143
145
  mod:AddCallback(ModCallback.PRE_USE_ITEM, preUseItemWeNeedToGoDeeper, CollectibleType.WE_NEED_TO_GO_DEEPER)
144
146
  mod:AddCallbackCustom(ModCallbackCustom.POST_NEW_ROOM_REORDERED, postNewRoomReordered)
145
147
  end
@@ -188,6 +190,7 @@ function ____exports.spawnCustomGridEntity(self, gridEntityTypeCustom, gridIndex
188
190
  if decoration == nil then
189
191
  error("Failed to spawn a decoration for a custom grid entity.")
190
192
  end
193
+ decoration.CollisionClass = gridCollisionClass
191
194
  local sprite = decoration:GetSprite()
192
195
  sprite:Load(anm2Path, true)
193
196
  local animationToPlay = defaultAnimation == nil and sprite:GetDefaultAnimation() or defaultAnimation
@@ -204,14 +207,18 @@ function ____exports.spawnCustomGridEntity(self, gridEntityTypeCustom, gridIndex
204
207
  roomCustomGridEntities:set(gridIndex, customGridEntityData)
205
208
  if breakable then
206
209
  local position = room:GetGridPosition(gridIndex)
207
- local dummy = spawnNPC(
210
+ local entity = spawn(
208
211
  nil,
209
- EntityType.DUMMY,
212
+ EntityType.GENERIC_PROP,
210
213
  0,
211
214
  0,
212
215
  position
213
216
  )
214
- dummy.Visible = false
217
+ entity:ClearEntityFlags(EntityFlag.APPEAR)
218
+ entity.Visible = false
219
+ entity.SizeMulti = Vector(GENERIC_PROP_SIZE_MULTIPLIER, GENERIC_PROP_SIZE_MULTIPLIER)
220
+ local ptrHash = GetPtrHash(entity)
221
+ v.room.genericPropPtrHashes:add(ptrHash)
215
222
  end
216
223
  return decoration
217
224
  end
@@ -228,7 +235,7 @@ end
228
235
  -- multiple times.
229
236
  -- @returns The grid entity that was removed. Returns undefined if no grid entity was found at the
230
237
  -- given location or if the given grid entity was not a custom grid entity.
231
- function ____exports.removeCustomGrid(self, gridIndexOrPositionOrGridEntity, updateRoom)
238
+ function ____exports.removeCustomGridEntity(self, gridIndexOrPositionOrGridEntity, updateRoom)
232
239
  if updateRoom == nil then
233
240
  updateRoom = true
234
241
  end
@@ -53,7 +53,7 @@ local addFlag = ____flag.addFlag
53
53
  local ____gridEntities = require("functions.gridEntities")
54
54
  local spawnGridEntity = ____gridEntities.spawnGridEntity
55
55
  local ____log = require("functions.log")
56
- local logEffects = ____log.logEffects
56
+ local logPlayerEffects = ____log.logPlayerEffects
57
57
  local logRoom = ____log.logRoom
58
58
  local logSeedEffects = ____log.logSeedEffects
59
59
  local logSounds = ____log.logSounds
@@ -512,7 +512,7 @@ end
512
512
  --- Logs the player's current temporary effects to the "log.txt" file.
513
513
  function ____exports.effects(self)
514
514
  local player = Isaac.GetPlayer()
515
- logEffects(player)
515
+ logPlayerEffects(player)
516
516
  printConsole(nil, "Logged the player's effects to the \"log.txt\" file.")
517
517
  end
518
518
  --- Alias for the "eternalHearts" command.
@@ -108,8 +108,9 @@ function postNewRoomReordered(self)
108
108
  pickupIndex = getPostAscentPickupIndex(nil, pickup)
109
109
  end
110
110
  if pickupIndex == nil then
111
- local entityID = getEntityID(nil, pickup)
112
- error("Failed to find a pickup index corresponding to existing pickup: " .. entityID)
111
+ local ____v_run_2, ____pickupCounter_3 = v.run, "pickupCounter"
112
+ ____v_run_2[____pickupCounter_3] = ____v_run_2[____pickupCounter_3] + 1
113
+ pickupIndex = v.run.pickupCounter
113
114
  end
114
115
  local ptrHash = GetPtrHash(pickup)
115
116
  v.room.pickupIndexes:set(ptrHash, pickupIndex)
@@ -21,7 +21,6 @@ export declare function logArray<T>(this: void, array: T[] | readonly T[]): void
21
21
  export declare function logColor(this: void, color: Color): void;
22
22
  /** Helper function for printing out every damage flag that is turned on. Useful when debugging. */
23
23
  export declare function logDamageFlags(this: void, flags: DamageFlag | BitFlags<DamageFlag>): void;
24
- export declare function logEffects(this: void, player: EntityPlayer): void;
25
24
  /** Helper function for logging an array of specific entities. */
26
25
  export declare function logEntities(this: void, entities: Entity[]): void;
27
26
  /** Helper function to log information about a specific entity. */
@@ -52,6 +51,7 @@ export declare function logKColor(this: void, kColor: KColor): void;
52
51
  */
53
52
  export declare function logLevelStateFlags(this: void): void;
54
53
  export declare function logMap(this: void, map: Map<AnyNotNil, unknown>): void;
54
+ export declare function logPlayerEffects(this: void, player: EntityPlayer): void;
55
55
  export declare function logPlayerHealth(this: void, player: EntityPlayer): void;
56
56
  /**
57
57
  * Helper function for printing out every projectile flag that is turned on. Useful when debugging.
@@ -1 +1 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/functions/log.ts"],"names":[],"mappings":";AA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,GAAG,QAAQ,CAAC,OAAO,CAAC,GACjC,IAAI,CAEN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAsB/D;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,UAAQ,GAAG,IAAI,CAGzE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAkC5C"}
@@ -312,32 +312,6 @@ end
312
312
  function ____exports.logDamageFlags(flags)
313
313
  ____exports.logFlags(flags, DamageFlag, "damage")
314
314
  end
315
- function ____exports.logEffects(player)
316
- local effects = getEffectsList(nil, player)
317
- ____exports.log("Logging player effects:")
318
- if #effects == 0 then
319
- ____exports.log(" n/a (no effects)")
320
- return
321
- end
322
- __TS__ArrayForEach(
323
- effects,
324
- function(____, effect, i)
325
- local effectDescription
326
- if effect.Item:IsCollectible() then
327
- local collectibleName = getCollectibleName(nil, effect.Item.ID)
328
- effectDescription = "Collectible: " .. collectibleName
329
- elseif effect.Item:IsTrinket() then
330
- local trinketName = getTrinketName(nil, effect.Item.ID)
331
- effectDescription = "Trinket: " .. trinketName
332
- elseif effect.Item:IsNull() then
333
- effectDescription = "Null item: " .. tostring(effect.Item.ID)
334
- else
335
- effectDescription = "Unknown type of effect: " .. tostring(effect.Item.ID)
336
- end
337
- ____exports.log((((((" " .. tostring(i + 1)) .. ") ") .. effectDescription) .. " (x") .. tostring(effect.Count)) .. ")")
338
- end
339
- )
340
- end
341
315
  --- Helper function for logging an array of specific entities.
342
316
  function ____exports.logEntities(entities)
343
317
  for ____, entity in ipairs(entities) do
@@ -417,6 +391,32 @@ function ____exports.logMap(map)
417
391
  end
418
392
  ____exports.log(" The size of the map was: " .. tostring(map.size))
419
393
  end
394
+ function ____exports.logPlayerEffects(player)
395
+ local effects = getEffectsList(nil, player)
396
+ ____exports.log("Logging player effects:")
397
+ if #effects == 0 then
398
+ ____exports.log(" n/a (no effects)")
399
+ return
400
+ end
401
+ __TS__ArrayForEach(
402
+ effects,
403
+ function(____, effect, i)
404
+ local effectDescription
405
+ if effect.Item:IsCollectible() then
406
+ local collectibleName = getCollectibleName(nil, effect.Item.ID)
407
+ effectDescription = "Collectible: " .. collectibleName
408
+ elseif effect.Item:IsTrinket() then
409
+ local trinketName = getTrinketName(nil, effect.Item.ID)
410
+ effectDescription = "Trinket: " .. trinketName
411
+ elseif effect.Item:IsNull() then
412
+ effectDescription = "Null item: " .. tostring(effect.Item.ID)
413
+ else
414
+ effectDescription = "Unknown type of effect: " .. tostring(effect.Item.ID)
415
+ end
416
+ ____exports.log((((((" " .. tostring(i + 1)) .. ") ") .. effectDescription) .. " (x") .. tostring(effect.Count)) .. ")")
417
+ end
418
+ )
419
+ end
420
420
  function ____exports.logPlayerHealth(player)
421
421
  local playerName = getPlayerName(nil, player)
422
422
  local playerHealth = getPlayerHealth(nil, player)
@@ -613,7 +613,6 @@ function ____exports.setLogFunctionsGlobal(self)
613
613
  globals.logArray = ____exports.logArray
614
614
  globals.logColor = ____exports.logColor
615
615
  globals.logDamageFlags = ____exports.logDamageFlags
616
- globals.logEffects = ____exports.logEffects
617
616
  globals.logEntities = ____exports.logEntities
618
617
  globals.logEntity = ____exports.logEntity
619
618
  globals.logEntityID = ____exports.logEntityID
@@ -626,6 +625,7 @@ function ____exports.setLogFunctionsGlobal(self)
626
625
  globals.logKColor = ____exports.logKColor
627
626
  globals.logLevelStateFlags = ____exports.logLevelStateFlags
628
627
  globals.logMap = ____exports.logMap
628
+ globals.logPlayerEffects = ____exports.logPlayerEffects
629
629
  globals.logPlayerHealth = ____exports.logPlayerHealth
630
630
  globals.logProjectileFlags = ____exports.logProjectileFlags
631
631
  globals.logRoom = ____exports.logRoom
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@ export * from "./enums/SerializationType";
12
12
  export { ConversionHeartSubType, registerCharacterHealthConversion, } from "./features/characterHealthConversion";
13
13
  export { registerCharacterStats } from "./features/characterStats";
14
14
  export { getCollectibleItemPoolType } from "./features/collectibleItemPoolType";
15
- export { removeCustomGrid, spawnCustomGridEntity as spawnCustomGrid, } from "./features/customGridEntity";
15
+ export { removeCustomGridEntity as removeCustomGrid, spawnCustomGridEntity as spawnCustomGrid, } from "./features/customGridEntity";
16
16
  export * from "./features/customStage/exports";
17
17
  export * from "./features/customTrapdoor/exports";
18
18
  export * from "./features/debugDisplay/exports";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EACL,cAAc,EACd,eAAe,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EACL,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EACL,gBAAgB,EAChB,qBAAqB,IAAI,eAAe,GACzC,MAAM,6BAA6B,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,SAAS,GACV,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAA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AC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC"}
package/dist/index.lua CHANGED
@@ -104,7 +104,7 @@ do
104
104
  end
105
105
  do
106
106
  local ____customGridEntity = require("features.customGridEntity")
107
- local removeCustomGrid = ____customGridEntity.removeCustomGrid
107
+ local removeCustomGrid = ____customGridEntity.removeCustomGridEntity
108
108
  local spawnCustomGrid = ____customGridEntity.spawnCustomGridEntity
109
109
  ____exports.removeCustomGrid = removeCustomGrid
110
110
  ____exports.spawnCustomGrid = spawnCustomGrid
@@ -1,5 +1,5 @@
1
1
  import { GridCollisionClass, GridEntityType } from "isaac-typescript-definitions";
2
- export interface CustomGridEntityData {
2
+ export interface GridEntityCustomData {
3
3
  /**
4
4
  * This is not a real `GridEntityType`; rather it is an arbitrary integer selected by end-user
5
5
  * mods.
@@ -11,4 +11,4 @@ export interface CustomGridEntityData {
11
11
  defaultAnimation?: string;
12
12
  gridCollisionClass: GridCollisionClass;
13
13
  }
14
- //# sourceMappingURL=CustomGridEntityData.d.ts.map
14
+ //# sourceMappingURL=GridEntityCustomData.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomGridEntityData.d.ts","sourceRoot":"","sources":["../../src/interfaces/CustomGridEntityData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACf,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,oBAAoB,EAAE,cAAc,CAAC;IAErC,aAAa,EAAE,GAAG,CAAC;IACnB,SAAS,EAAE,GAAG,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,kBAAkB,CAAC;CACxC"}
1
+ {"version":3,"file":"GridEntityCustomData.d.ts","sourceRoot":"","sources":["../../src/interfaces/GridEntityCustomData.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,cAAc,EACf,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,oBAAoB,EAAE,cAAc,CAAC;IAErC,aAAa,EAAE,GAAG,CAAC;IACnB,SAAS,EAAE,GAAG,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,kBAAkB,CAAC;CACxC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "6.17.0",
3
+ "version": "6.17.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -564,7 +564,7 @@ export enum ModCallbackCustom {
564
564
  * - When registering the callback, takes an optional second argument that will make the callback
565
565
  * only fire if it matches the `ItemType` provided.
566
566
  * - When registering the callback, takes an optional third argument that will make the callback
567
- * only fire if the `CollectibleType` or the `TrinketType` matches the ID provided.
567
+ * only fire if the `CollectibleType` or the `TrinketType` matches the sub-type provided.
568
568
  *
569
569
  * ```ts
570
570
  * function postItemPickup(
@@ -2,6 +2,7 @@ import {
2
2
  ActiveSlot,
3
3
  CollectibleType,
4
4
  DamageFlag,
5
+ EntityFlag,
5
6
  EntityType,
6
7
  GridCollisionClass,
7
8
  GridEntityType,
@@ -15,7 +16,7 @@ import { ModUpgraded } from "../classes/ModUpgraded";
15
16
  import { DecorationVariant } from "../enums/DecorationVariant";
16
17
  import { ModCallbackCustom } from "../enums/ModCallbackCustom";
17
18
  import { errorIfFeaturesNotInitialized } from "../featuresInitialized";
18
- import { spawnNPC } from "../functions/entitiesSpecific";
19
+ import { spawn } from "../functions/entities";
19
20
  import { hasFlag } from "../functions/flag";
20
21
  import {
21
22
  removeGridEntity,
@@ -23,22 +24,23 @@ import {
23
24
  } from "../functions/gridEntities";
24
25
  import { getRoomListIndex } from "../functions/roomData";
25
26
  import { isVector } from "../functions/vector";
26
- import { CustomGridEntityData } from "../interfaces/CustomGridEntityData";
27
+ import { GridEntityCustomData } from "../interfaces/GridEntityCustomData";
27
28
  import { runNextGameFrame } from "./runInNFrames";
28
29
  import { saveDataManager } from "./saveDataManager/exports";
29
30
 
30
31
  const FEATURE_NAME = "customGridEntity";
32
+ const GENERIC_PROP_SIZE_MULTIPLIER = 0.66;
31
33
 
32
34
  const v = {
33
35
  level: {
34
36
  /** Indexed by room list index and grid index. */
35
- customGridEntities: new DefaultMap<int, Map<int, CustomGridEntityData>>(
37
+ customGridEntities: new DefaultMap<int, Map<int, GridEntityCustomData>>(
36
38
  () => new Map(),
37
39
  ),
38
40
  },
39
41
 
40
42
  room: {
41
- dummyPtrHashes: new Set<PtrHash>(),
43
+ genericPropPtrHashes: new Set<PtrHash>(),
42
44
  manuallyUsingShovel: false,
43
45
  },
44
46
  };
@@ -49,8 +51,8 @@ export function customGridEntityInit(mod: ModUpgraded): void {
49
51
 
50
52
  mod.AddCallback(
51
53
  ModCallback.ENTITY_TAKE_DMG,
52
- entityTakeDmgDummy,
53
- EntityType.DUMMY,
54
+ entityTakeDmgGenericProp,
55
+ EntityType.GENERIC_PROP,
54
56
  ); // 11
55
57
 
56
58
  mod.AddCallback(
@@ -66,8 +68,8 @@ export function customGridEntityInit(mod: ModUpgraded): void {
66
68
  }
67
69
 
68
70
  // ModCallback.ENTITY_TAKE_DMG (11)
69
- // EntityType.DUMMY (964)
70
- function entityTakeDmgDummy(
71
+ // EntityType.GENERIC_PROP (960)
72
+ function entityTakeDmgGenericProp(
71
73
  tookDamage: Entity,
72
74
  _damageAmount: float,
73
75
  damageFlags: BitFlags<DamageFlag>,
@@ -75,7 +77,7 @@ function entityTakeDmgDummy(
75
77
  _damageCountdownFrames: int,
76
78
  ): boolean | undefined {
77
79
  const ptrHash = GetPtrHash(tookDamage);
78
- if (!v.room.dummyPtrHashes.has(ptrHash)) {
80
+ if (!v.room.genericPropPtrHashes.has(ptrHash)) {
79
81
  return undefined;
80
82
  }
81
83
 
@@ -105,8 +107,8 @@ function entityTakeDmgDummy(
105
107
 
106
108
  postGridEntityCustomBrokenFire(gridEntity, data.gridEntityTypeCustom);
107
109
 
108
- // Even though the custom grid entity is now broke, we do not want to remove it, as the end-user
109
- // could intend for it to persist with different graphics.
110
+ // Even though the custom grid entity is now broken, we do not want to remove it, as the end-user
111
+ // could intend for it to persist with different graphics (or take multiple hits to be destroyed).
110
112
  return false;
111
113
  }
112
114
 
@@ -261,6 +263,7 @@ export function spawnCustomGridEntity(
261
263
  if (decoration === undefined) {
262
264
  error("Failed to spawn a decoration for a custom grid entity.");
263
265
  }
266
+ decoration.CollisionClass = gridCollisionClass;
264
267
 
265
268
  const sprite = decoration.GetSprite();
266
269
  sprite.Load(anm2Path, true);
@@ -270,7 +273,7 @@ export function spawnCustomGridEntity(
270
273
  : defaultAnimation;
271
274
  sprite.Play(animationToPlay, true);
272
275
 
273
- const customGridEntityData: CustomGridEntityData = {
276
+ const customGridEntityData: GridEntityCustomData = {
274
277
  gridEntityTypeCustom,
275
278
  roomListIndex,
276
279
  gridIndex,
@@ -287,8 +290,18 @@ export function spawnCustomGridEntity(
287
290
  // the monitoring for explosions in the `ENTITY_TAKE_DMG` callback.
288
291
  if (breakable) {
289
292
  const position = room.GetGridPosition(gridIndex);
290
- const dummy = spawnNPC(EntityType.DUMMY, 0, 0, position);
291
- dummy.Visible = false;
293
+ const entity = spawn(EntityType.GENERIC_PROP, 0, 0, position);
294
+ entity.ClearEntityFlags(EntityFlag.APPEAR);
295
+ entity.Visible = false;
296
+
297
+ // By default, it is larger than a grid tile, so make it a bit smaller.
298
+ entity.SizeMulti = Vector(
299
+ GENERIC_PROP_SIZE_MULTIPLIER,
300
+ GENERIC_PROP_SIZE_MULTIPLIER,
301
+ );
302
+
303
+ const ptrHash = GetPtrHash(entity);
304
+ v.room.genericPropPtrHashes.add(ptrHash);
292
305
  }
293
306
 
294
307
  return decoration;
@@ -309,7 +322,7 @@ export function spawnCustomGridEntity(
309
322
  * @returns The grid entity that was removed. Returns undefined if no grid entity was found at the
310
323
  * given location or if the given grid entity was not a custom grid entity.
311
324
  */
312
- export function removeCustomGrid(
325
+ export function removeCustomGridEntity(
313
326
  gridIndexOrPositionOrGridEntity: int | Vector | GridEntity,
314
327
  updateRoom = true,
315
328
  ): GridEntity | undefined {
@@ -356,7 +369,7 @@ export function removeCustomGrid(
356
369
  * containing the raw decoration grid entity and the associated entity data.
357
370
  */
358
371
  export function getCustomGridEntities(): Array<
359
- [gridEntity: GridEntity, data: CustomGridEntityData]
372
+ [gridEntity: GridEntity, data: GridEntityCustomData]
360
373
  > {
361
374
  const roomListIndex = getRoomListIndex();
362
375
  const roomCustomGridEntities = v.level.customGridEntities.get(roomListIndex);
@@ -365,7 +378,7 @@ export function getCustomGridEntities(): Array<
365
378
  }
366
379
 
367
380
  const room = game.GetRoom();
368
- const customGridEntities: Array<[GridEntity, CustomGridEntityData]> = [];
381
+ const customGridEntities: Array<[GridEntity, GridEntityCustomData]> = [];
369
382
  for (const [gridIndex, data] of roomCustomGridEntities.entries()) {
370
383
  const gridEntity = room.GetGridEntity(gridIndex);
371
384
  if (gridEntity !== undefined) {
@@ -64,7 +64,7 @@ import { getEnumValues } from "../../functions/enums";
64
64
  import { addFlag } from "../../functions/flag";
65
65
  import { spawnGridEntity } from "../../functions/gridEntities";
66
66
  import {
67
- logEffects,
67
+ logPlayerEffects,
68
68
  logRoom,
69
69
  logSeedEffects,
70
70
  logSounds,
@@ -515,7 +515,7 @@ export function dungeon(): void {
515
515
  /** Logs the player's current temporary effects to the "log.txt" file. */
516
516
  export function effects(): void {
517
517
  const player = Isaac.GetPlayer();
518
- logEffects(player);
518
+ logPlayerEffects(player);
519
519
  printConsole('Logged the player\'s effects to the "log.txt" file.');
520
520
  }
521
521
 
@@ -170,10 +170,10 @@ function postNewRoomReordered() {
170
170
  }
171
171
 
172
172
  if (pickupIndex === undefined) {
173
- const entityID = getEntityID(pickup);
174
- error(
175
- `Failed to find a pickup index corresponding to existing pickup: ${entityID}`,
176
- );
173
+ // At this point, if we do not already have an existing pickup index, we need to create a new
174
+ // one in order to cover the cases where mods spawn items in the `POST_NEW_ROOM` callback.
175
+ v.run.pickupCounter++;
176
+ pickupIndex = v.run.pickupCounter;
177
177
  }
178
178
 
179
179
  const ptrHash = GetPtrHash(pickup);
@@ -203,34 +203,6 @@ export function logDamageFlags(
203
203
  logFlags(flags, DamageFlag, "damage");
204
204
  }
205
205
 
206
- export function logEffects(this: void, player: EntityPlayer): void {
207
- const effects = getEffectsList(player);
208
-
209
- log("Logging player effects:");
210
-
211
- if (effects.length === 0) {
212
- log(" n/a (no effects)");
213
- return;
214
- }
215
-
216
- effects.forEach((effect, i) => {
217
- let effectDescription: string;
218
- if (effect.Item.IsCollectible()) {
219
- const collectibleName = getCollectibleName(effect.Item.ID);
220
- effectDescription = `Collectible: ${collectibleName}`;
221
- } else if (effect.Item.IsTrinket()) {
222
- const trinketName = getTrinketName(effect.Item.ID);
223
- effectDescription = `Trinket: ${trinketName}`;
224
- } else if (effect.Item.IsNull()) {
225
- effectDescription = `Null item: ${effect.Item.ID}`;
226
- } else {
227
- effectDescription = `Unknown type of effect: ${effect.Item.ID}`;
228
- }
229
-
230
- log(` ${i + 1}) ${effectDescription} (x${effect.Count})`);
231
- });
232
- }
233
-
234
206
  /** Helper function for logging an array of specific entities. */
235
207
  export function logEntities(this: void, entities: Entity[]): void {
236
208
  for (const entity of entities) {
@@ -505,6 +477,34 @@ export function logMap(this: void, map: Map<AnyNotNil, unknown>): void {
505
477
  log(` The size of the map was: ${map.size}`);
506
478
  }
507
479
 
480
+ export function logPlayerEffects(this: void, player: EntityPlayer): void {
481
+ const effects = getEffectsList(player);
482
+
483
+ log("Logging player effects:");
484
+
485
+ if (effects.length === 0) {
486
+ log(" n/a (no effects)");
487
+ return;
488
+ }
489
+
490
+ effects.forEach((effect, i) => {
491
+ let effectDescription: string;
492
+ if (effect.Item.IsCollectible()) {
493
+ const collectibleName = getCollectibleName(effect.Item.ID);
494
+ effectDescription = `Collectible: ${collectibleName}`;
495
+ } else if (effect.Item.IsTrinket()) {
496
+ const trinketName = getTrinketName(effect.Item.ID);
497
+ effectDescription = `Trinket: ${trinketName}`;
498
+ } else if (effect.Item.IsNull()) {
499
+ effectDescription = `Null item: ${effect.Item.ID}`;
500
+ } else {
501
+ effectDescription = `Unknown type of effect: ${effect.Item.ID}`;
502
+ }
503
+
504
+ log(` ${i + 1}) ${effectDescription} (x${effect.Count})`);
505
+ });
506
+ }
507
+
508
508
  export function logPlayerHealth(this: void, player: EntityPlayer): void {
509
509
  const playerName = getPlayerName(player);
510
510
  const playerHealth = getPlayerHealth(player);
@@ -769,7 +769,6 @@ export function setLogFunctionsGlobal(): void {
769
769
  globals["logArray"] = logArray;
770
770
  globals["logColor"] = logColor;
771
771
  globals["logDamageFlags"] = logDamageFlags;
772
- globals["logEffects"] = logEffects;
773
772
  globals["logEntities"] = logEntities;
774
773
  globals["logEntity"] = logEntity;
775
774
  globals["logEntityID"] = logEntityID;
@@ -782,6 +781,7 @@ export function setLogFunctionsGlobal(): void {
782
781
  globals["logKColor"] = logKColor;
783
782
  globals["logLevelStateFlags"] = logLevelStateFlags;
784
783
  globals["logMap"] = logMap;
784
+ globals["logPlayerEffects"] = logPlayerEffects;
785
785
  globals["logPlayerHealth"] = logPlayerHealth;
786
786
  globals["logProjectileFlags"] = logProjectileFlags;
787
787
  globals["logRoom"] = logRoom;
package/src/index.ts CHANGED
@@ -23,7 +23,7 @@ export {
23
23
  export { registerCharacterStats } from "./features/characterStats";
24
24
  export { getCollectibleItemPoolType } from "./features/collectibleItemPoolType";
25
25
  export {
26
- removeCustomGrid,
26
+ removeCustomGridEntity as removeCustomGrid,
27
27
  spawnCustomGridEntity as spawnCustomGrid,
28
28
  } from "./features/customGridEntity";
29
29
  export * from "./features/customStage/exports";
@@ -3,7 +3,7 @@ import {
3
3
  GridEntityType,
4
4
  } from "isaac-typescript-definitions";
5
5
 
6
- export interface CustomGridEntityData {
6
+ export interface GridEntityCustomData {
7
7
  /**
8
8
  * This is not a real `GridEntityType`; rather it is an arbitrary integer selected by end-user
9
9
  * mods.