isaacscript-common 20.4.1 → 20.6.0

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/index.d.ts CHANGED
@@ -7664,8 +7664,12 @@ export declare function isModifierKeyPressed(): boolean;
7664
7664
 
7665
7665
  export declare function isMoveAction(buttonAction: ButtonAction): boolean;
7666
7666
 
7667
+ export declare function isMoveActionPressed(controllerIndex: ControllerIndex): boolean;
7668
+
7667
7669
  export declare function isMoveActionPressedOnAnyInput(): boolean;
7668
7670
 
7671
+ export declare function isMoveActionTriggered(controllerIndex: ControllerIndex): boolean;
7672
+
7669
7673
  export declare function isMoveActionTriggeredOnAnyInput(): boolean;
7670
7674
 
7671
7675
  export declare function isNarrowRoom(roomShape: RoomShape): boolean;
@@ -7868,8 +7872,12 @@ export declare function isSerializedVector(object: unknown): object is Serialize
7868
7872
 
7869
7873
  export declare function isShootAction(buttonAction: ButtonAction): boolean;
7870
7874
 
7875
+ export declare function isShootActionPressed(controllerIndex: ControllerIndex): boolean;
7876
+
7871
7877
  export declare function isShootActionPressedOnAnyInput(): boolean;
7872
7878
 
7879
+ export declare function isShootActionTriggered(controllerIndex: ControllerIndex): boolean;
7880
+
7873
7881
  export declare function isShootActionTriggeredOnAnyInput(): boolean;
7874
7882
 
7875
7883
  /** Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust. */
@@ -10216,11 +10224,12 @@ export declare enum ModCallbackCustom {
10216
10224
  * change in the `GridCollisionClass`.
10217
10225
  * 2. When slot machine entities pay out with a collectible item. When this happens, they
10218
10226
  * immediately despawn without playing any special animation.
10219
- * 3. When beggars are destroyed with an explosion. When this happens, they immediately despawn
10220
- * without playing any special animation.
10221
- * 4. When beggars pay out with a collectible item. When this happens, they despawn after playing
10222
- * the "Teleport" animation. (This is not technically a "destruction" event, but the callback
10223
- * will fire for this to remain consistent with the other types of slot entities.)
10227
+ * 3. When beggar entities (e.g. `SlotVariant.BEGGAR` and `SlotVariant.SHELL_GAME`) are destroyed
10228
+ * with an explosion. When this happens, they immediately despawn without playing any special
10229
+ * animation.
10230
+ * 4. When beggar entities pay out with a collectible item. When this happens, they despawn after
10231
+ * playing the "Teleport" animation. (This is not technically a "destruction" event, but the
10232
+ * callback will fire for this to remain consistent with the other types of slot entities.)
10224
10233
  *
10225
10234
  * Depending on the specific types of slot removal that you need to detect, you can filter using:
10226
10235
  *
@@ -13916,6 +13925,15 @@ export declare function setDisplayFlags(displayFlagsMap: Map<int, BitFlags<Displ
13916
13925
  */
13917
13926
  export declare function setEntityDamageFlash(entity: Entity): void;
13918
13927
 
13928
+ /**
13929
+ * Helper function to keep an entity's color the same values as it already is but set the opacity to
13930
+ * a specific value.
13931
+ *
13932
+ * @param entity The entity to set.
13933
+ * @param alpha A value between 0 and 1 that represents the fade amount.
13934
+ */
13935
+ export declare function setEntityOpacity(entity: Entity, alpha: float): void;
13936
+
13919
13937
  /**
13920
13938
  * Helper function to set the position of every entity in the room based on a map of positions. If
13921
13939
  * an entity is found that does not have matching element in the provided map, then that entity will
@@ -14025,6 +14043,15 @@ export declare function setRoomVisible(roomGridIndex: int | undefined, updateVis
14025
14043
  /** Helper function to set a seed to an RNG object using Blade's recommended shift index. */
14026
14044
  export declare function setSeed(rng: RNG, seed: Seed): void;
14027
14045
 
14046
+ /**
14047
+ * Helper function to keep a sprite's color the same values as it already is but set the opacity to
14048
+ * a specific value.
14049
+ *
14050
+ * @param sprite The sprite to set.
14051
+ * @param alpha A value between 0 and 1 that represents the fade amount.
14052
+ */
14053
+ export declare function setSpriteOpacity(sprite: Sprite, alpha: float): void;
14054
+
14028
14055
  /**
14029
14056
  * Helper function to warp to a new stage/level.
14030
14057
  *
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 20.4.1
3
+ isaacscript-common 20.6.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -19640,6 +19640,79 @@ return ____exports
19640
19640
  end,
19641
19641
  ["src.types.EntityID"] = function(...)
19642
19642
  local ____exports = {}
19643
+ return ____exports
19644
+ end,
19645
+ ["src.functions.sprites"] = function(...)
19646
+ local ____exports = {}
19647
+ local ____constants = require("src.core.constants")
19648
+ local EMPTY_PNG_PATH = ____constants.EMPTY_PNG_PATH
19649
+ local VectorZero = ____constants.VectorZero
19650
+ local ____color = require("src.functions.color")
19651
+ local copyColor = ____color.copyColor
19652
+ local ____kColor = require("src.functions.kColor")
19653
+ local kColorEquals = ____kColor.kColorEquals
19654
+ local ____utils = require("src.functions.utils")
19655
+ local eRange = ____utils.eRange
19656
+ function ____exports.texelEquals(self, sprite1, sprite2, position, layerID)
19657
+ local kColor1 = sprite1:GetTexel(position, VectorZero, 1, layerID)
19658
+ local kColor2 = sprite2:GetTexel(position, VectorZero, 1, layerID)
19659
+ return kColorEquals(nil, kColor1, kColor2)
19660
+ end
19661
+ function ____exports.clearSprite(self, sprite, ...)
19662
+ local layerIDs = {...}
19663
+ if #layerIDs == 0 then
19664
+ local numLayers = sprite:GetLayerCount()
19665
+ layerIDs = eRange(nil, numLayers)
19666
+ end
19667
+ for ____, layerID in ipairs(layerIDs) do
19668
+ sprite:ReplaceSpritesheet(layerID, EMPTY_PNG_PATH)
19669
+ end
19670
+ sprite:LoadGraphics()
19671
+ end
19672
+ function ____exports.getLastFrameOfAnimation(self, sprite, animation)
19673
+ local currentAnimation = sprite:GetAnimation()
19674
+ local currentFrame = sprite:GetFrame()
19675
+ if animation ~= nil and animation ~= currentAnimation then
19676
+ sprite:SetAnimation(animation)
19677
+ end
19678
+ sprite:SetLastFrame()
19679
+ local finalFrame = sprite:GetFrame()
19680
+ if animation ~= nil and animation ~= currentAnimation then
19681
+ sprite:Play(currentAnimation, true)
19682
+ end
19683
+ sprite:SetFrame(currentFrame)
19684
+ return finalFrame
19685
+ end
19686
+ function ____exports.setSpriteOpacity(self, sprite, alpha)
19687
+ local fadedColor = copyColor(nil, sprite.Color)
19688
+ fadedColor.A = alpha
19689
+ sprite.Color = fadedColor
19690
+ end
19691
+ function ____exports.spriteEquals(self, sprite1, sprite2, layerID, xStart, xFinish, xIncrement, yStart, yFinish, yIncrement)
19692
+ do
19693
+ local x = xStart
19694
+ while x <= xFinish do
19695
+ do
19696
+ local y = yStart
19697
+ while y <= yFinish do
19698
+ local position = Vector(x, y)
19699
+ if not ____exports.texelEquals(
19700
+ nil,
19701
+ sprite1,
19702
+ sprite2,
19703
+ position,
19704
+ layerID
19705
+ ) then
19706
+ return false
19707
+ end
19708
+ y = y + yIncrement
19709
+ end
19710
+ end
19711
+ x = x + xIncrement
19712
+ end
19713
+ end
19714
+ return true
19715
+ end
19643
19716
  return ____exports
19644
19717
  end,
19645
19718
  ["src.functions.entities"] = function(...)
@@ -19666,6 +19739,8 @@ local getRandom = ____random.getRandom
19666
19739
  local ____rng = require("src.functions.rng")
19667
19740
  local isRNG = ____rng.isRNG
19668
19741
  local newRNG = ____rng.newRNG
19742
+ local ____sprites = require("src.functions.sprites")
19743
+ local setSpriteOpacity = ____sprites.setSpriteOpacity
19669
19744
  local ____types = require("src.functions.types")
19670
19745
  local asNumber = ____types.asNumber
19671
19746
  local isPrimitive = ____types.isPrimitive
@@ -19930,6 +20005,10 @@ end
19930
20005
  function ____exports.setEntityDamageFlash(self, entity)
19931
20006
  entity:SetColor(DAMAGE_FLASH_COLOR, 2, 0)
19932
20007
  end
20008
+ function ____exports.setEntityOpacity(self, entity, alpha)
20009
+ local sprite = entity:GetSprite()
20010
+ setSpriteOpacity(nil, sprite, alpha)
20011
+ end
19933
20012
  function ____exports.setEntityRandomColor(self, entity)
19934
20013
  local rng = newRNG(nil, entity.InitSeed)
19935
20014
  local r = getRandom(nil, rng)
@@ -20899,72 +20978,6 @@ function ____exports.setRoomData(self, roomGridIndex, roomData)
20899
20978
  local roomDescriptor = ____exports.getRoomDescriptor(nil, roomGridIndex)
20900
20979
  roomDescriptor.Data = roomData
20901
20980
  end
20902
- return ____exports
20903
- end,
20904
- ["src.functions.sprites"] = function(...)
20905
- local ____exports = {}
20906
- local ____constants = require("src.core.constants")
20907
- local EMPTY_PNG_PATH = ____constants.EMPTY_PNG_PATH
20908
- local VectorZero = ____constants.VectorZero
20909
- local ____kColor = require("src.functions.kColor")
20910
- local kColorEquals = ____kColor.kColorEquals
20911
- local ____utils = require("src.functions.utils")
20912
- local eRange = ____utils.eRange
20913
- function ____exports.texelEquals(self, sprite1, sprite2, position, layerID)
20914
- local kColor1 = sprite1:GetTexel(position, VectorZero, 1, layerID)
20915
- local kColor2 = sprite2:GetTexel(position, VectorZero, 1, layerID)
20916
- return kColorEquals(nil, kColor1, kColor2)
20917
- end
20918
- function ____exports.clearSprite(self, sprite, ...)
20919
- local layerIDs = {...}
20920
- if #layerIDs == 0 then
20921
- local numLayers = sprite:GetLayerCount()
20922
- layerIDs = eRange(nil, numLayers)
20923
- end
20924
- for ____, layerID in ipairs(layerIDs) do
20925
- sprite:ReplaceSpritesheet(layerID, EMPTY_PNG_PATH)
20926
- end
20927
- sprite:LoadGraphics()
20928
- end
20929
- function ____exports.getLastFrameOfAnimation(self, sprite, animation)
20930
- local currentAnimation = sprite:GetAnimation()
20931
- local currentFrame = sprite:GetFrame()
20932
- if animation ~= nil and animation ~= currentAnimation then
20933
- sprite:SetAnimation(animation)
20934
- end
20935
- sprite:SetLastFrame()
20936
- local finalFrame = sprite:GetFrame()
20937
- if animation ~= nil and animation ~= currentAnimation then
20938
- sprite:Play(currentAnimation, true)
20939
- end
20940
- sprite:SetFrame(currentFrame)
20941
- return finalFrame
20942
- end
20943
- function ____exports.spriteEquals(self, sprite1, sprite2, layerID, xStart, xFinish, xIncrement, yStart, yFinish, yIncrement)
20944
- do
20945
- local x = xStart
20946
- while x <= xFinish do
20947
- do
20948
- local y = yStart
20949
- while y <= yFinish do
20950
- local position = Vector(x, y)
20951
- if not ____exports.texelEquals(
20952
- nil,
20953
- sprite1,
20954
- sprite2,
20955
- position,
20956
- layerID
20957
- ) then
20958
- return false
20959
- end
20960
- y = y + yIncrement
20961
- end
20962
- end
20963
- x = x + xIncrement
20964
- end
20965
- end
20966
- return true
20967
- end
20968
20981
  return ____exports
20969
20982
  end,
20970
20983
  ["src.functions.collectibles"] = function(...)
@@ -37410,12 +37423,26 @@ end
37410
37423
  function ____exports.isMoveAction(self, buttonAction)
37411
37424
  return ____exports.MOVEMENT_ACTIONS_SET:has(buttonAction)
37412
37425
  end
37426
+ function ____exports.isMoveActionPressed(self, controllerIndex)
37427
+ return ____exports.isActionPressed(
37428
+ nil,
37429
+ controllerIndex,
37430
+ table.unpack(MOVEMENT_ACTIONS)
37431
+ )
37432
+ end
37413
37433
  function ____exports.isMoveActionPressedOnAnyInput(self)
37414
37434
  return __TS__ArraySome(
37415
37435
  MOVEMENT_ACTIONS,
37416
37436
  function(____, moveAction) return ____exports.isActionPressedOnAnyInput(nil, moveAction) end
37417
37437
  )
37418
37438
  end
37439
+ function ____exports.isMoveActionTriggered(self, controllerIndex)
37440
+ return ____exports.isActionTriggered(
37441
+ nil,
37442
+ controllerIndex,
37443
+ table.unpack(MOVEMENT_ACTIONS)
37444
+ )
37445
+ end
37419
37446
  function ____exports.isMoveActionTriggeredOnAnyInput(self)
37420
37447
  return __TS__ArraySome(
37421
37448
  MOVEMENT_ACTIONS,
@@ -37425,12 +37452,26 @@ end
37425
37452
  function ____exports.isShootAction(self, buttonAction)
37426
37453
  return ____exports.SHOOTING_ACTIONS_SET:has(buttonAction)
37427
37454
  end
37455
+ function ____exports.isShootActionPressed(self, controllerIndex)
37456
+ return ____exports.isActionPressed(
37457
+ nil,
37458
+ controllerIndex,
37459
+ table.unpack(SHOOTING_ACTIONS)
37460
+ )
37461
+ end
37428
37462
  function ____exports.isShootActionPressedOnAnyInput(self)
37429
37463
  return __TS__ArraySome(
37430
37464
  SHOOTING_ACTIONS,
37431
37465
  function(____, shootAction) return ____exports.isActionPressedOnAnyInput(nil, shootAction) end
37432
37466
  )
37433
37467
  end
37468
+ function ____exports.isShootActionTriggered(self, controllerIndex)
37469
+ return ____exports.isActionTriggered(
37470
+ nil,
37471
+ controllerIndex,
37472
+ table.unpack(SHOOTING_ACTIONS)
37473
+ )
37474
+ end
37434
37475
  function ____exports.isShootActionTriggeredOnAnyInput(self)
37435
37476
  return __TS__ArraySome(
37436
37477
  SHOOTING_ACTIONS,
@@ -1547,11 +1547,12 @@ export declare enum ModCallbackCustom {
1547
1547
  * change in the `GridCollisionClass`.
1548
1548
  * 2. When slot machine entities pay out with a collectible item. When this happens, they
1549
1549
  * immediately despawn without playing any special animation.
1550
- * 3. When beggars are destroyed with an explosion. When this happens, they immediately despawn
1551
- * without playing any special animation.
1552
- * 4. When beggars pay out with a collectible item. When this happens, they despawn after playing
1553
- * the "Teleport" animation. (This is not technically a "destruction" event, but the callback
1554
- * will fire for this to remain consistent with the other types of slot entities.)
1550
+ * 3. When beggar entities (e.g. `SlotVariant.BEGGAR` and `SlotVariant.SHELL_GAME`) are destroyed
1551
+ * with an explosion. When this happens, they immediately despawn without playing any special
1552
+ * animation.
1553
+ * 4. When beggar entities pay out with a collectible item. When this happens, they despawn after
1554
+ * playing the "Teleport" animation. (This is not technically a "destruction" event, but the
1555
+ * callback will fire for this to remain consistent with the other types of slot entities.)
1555
1556
  *
1556
1557
  * Depending on the specific types of slot removal that you need to detect, you can filter using:
1557
1558
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ModCallbackCustom.d.ts","sourceRoot":"","sources":["../../../src/enums/ModCallbackCustom.ts"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AACH,oBAAY,iBAAiB;IAC3B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,sBAAsB,IAAA;IAEtB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,sBAAsB,IAAA;IAEtB;;;;;;;;;;;;;;;;;OAiBG;IACH,mBAAmB,IAAA;IAEnB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,mBAAmB,IAAA;IAEnB;;;;;;;;;;;OAWG;IACH,oBAAoB,IAAA;IAEpB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OAYG;IACH,gBAAgB,KAAA;IAEhB;;;;;;;;;;OAUG;IACH,kBAAkB,KAAA;IAElB;;;;;;;;;;OAUG;IACH,kBAAkB,KAAA;IAElB;;;;;;;;;;;;;;;;OAgBG;IACH,mBAAmB,KAAA;IAEnB;;;;;;;;;;;;;;;OAeG;IACH,wBAAwB,KAAA;IAExB;;;;;;;;;;OAUG;IACH,eAAe,KAAA;IAEf;;;;;;;;;;OAUG;IACH,eAAe,KAAA;IAEf;;;;;;;;;;;;;;;;;OAiBG;IACH,mBAAmB,KAAA;IAEnB;;;;;;;;;;;;;OAaG;IACH,kBAAkB,KAAA;IAElB;;;;;;;;;;;;;;OAcG;IACH,iBAAiB,MAAA;IAEjB;;;;;;;;;;;;;;;;;OAiBG;IACH,iBAAiB,MAAA;IAEjB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,uBAAuB,MAAA;IAEvB;;;;;;;;;;;;;;;;;;OAkBG;IACH,gBAAgB,MAAA;IAEhB;;;;;;;;;;;;;;;;;;OAkBG;IACH,eAAe,MAAA;IAEf;;;;;;;;;;;;OAYG;IACH,aAAa,MAAA;IAEb;;;;;;;;;;;;;;;;;;;OAmBG;IACH,wBAAwB,MAAA;IAExB;;;;;;;;;;;;;;;OAeG;IACH,qBAAqB,MAAA;IAErB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,4BAA4B,MAAA;CAC7B"}
@@ -172,6 +172,14 @@ export declare function rerollEnemy(entity: Entity): Entity | undefined;
172
172
  * it.
173
173
  */
174
174
  export declare function setEntityDamageFlash(entity: Entity): void;
175
+ /**
176
+ * Helper function to keep an entity's color the same values as it already is but set the opacity to
177
+ * a specific value.
178
+ *
179
+ * @param entity The entity to set.
180
+ * @param alpha A value between 0 and 1 that represents the fade amount.
181
+ */
182
+ export declare function setEntityOpacity(entity: Entity, alpha: float): void;
175
183
  export declare function setEntityRandomColor(entity: Entity): void;
176
184
  /**
177
185
  * Helper function to spawn an entity. Use this instead of the `Isaac.Spawn` method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AED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEzD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAGnE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CASzD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CACnB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,GAC5C,MAAM,CA4CR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,GAC5C,MAAM,CAWR;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,MAAM,CAUR"}
@@ -21,6 +21,8 @@ local getRandom = ____random.getRandom
21
21
  local ____rng = require("src.functions.rng")
22
22
  local isRNG = ____rng.isRNG
23
23
  local newRNG = ____rng.newRNG
24
+ local ____sprites = require("src.functions.sprites")
25
+ local setSpriteOpacity = ____sprites.setSpriteOpacity
24
26
  local ____types = require("src.functions.types")
25
27
  local asNumber = ____types.asNumber
26
28
  local isPrimitive = ____types.isPrimitive
@@ -403,6 +405,15 @@ end
403
405
  function ____exports.setEntityDamageFlash(self, entity)
404
406
  entity:SetColor(DAMAGE_FLASH_COLOR, 2, 0)
405
407
  end
408
+ --- Helper function to keep an entity's color the same values as it already is but set the opacity to
409
+ -- a specific value.
410
+ --
411
+ -- @param entity The entity to set.
412
+ -- @param alpha A value between 0 and 1 that represents the fade amount.
413
+ function ____exports.setEntityOpacity(self, entity, alpha)
414
+ local sprite = entity:GetSprite()
415
+ setSpriteOpacity(nil, sprite, alpha)
416
+ end
406
417
  function ____exports.setEntityRandomColor(self, entity)
407
418
  local rng = newRNG(nil, entity.InitSeed)
408
419
  local r = getRandom(nil, rng)
@@ -56,10 +56,14 @@ export declare function isKeyboardPressed(...keys: Keyboard[]): boolean;
56
56
  */
57
57
  export declare function isModifierKeyPressed(): boolean;
58
58
  export declare function isMoveAction(buttonAction: ButtonAction): boolean;
59
+ export declare function isMoveActionPressed(controllerIndex: ControllerIndex): boolean;
59
60
  export declare function isMoveActionPressedOnAnyInput(): boolean;
61
+ export declare function isMoveActionTriggered(controllerIndex: ControllerIndex): boolean;
60
62
  export declare function isMoveActionTriggeredOnAnyInput(): boolean;
61
63
  export declare function isShootAction(buttonAction: ButtonAction): boolean;
64
+ export declare function isShootActionPressed(controllerIndex: ControllerIndex): boolean;
62
65
  export declare function isShootActionPressedOnAnyInput(): boolean;
66
+ export declare function isShootActionTriggered(controllerIndex: ControllerIndex): boolean;
63
67
  export declare function isShootActionTriggeredOnAnyInput(): boolean;
64
68
  /**
65
69
  * Helper function to get the string that would be typed if someone pressed the corresponding key.
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/functions/input.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EACV,eAAe,EACf,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAuBtC,eAAO,M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Ae,EAAE,eAAe,GAAG,OAAO,CAE7E;AAED,wBAAgB,6BAA6B,IAAI,OAAO,CAIvD;AAED,wBAAgB,qBAAqB,CACnC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAET;AAED,wBAAgB,+BAA+B,IAAI,OAAO,CAIzD;AAED,wBAAgB,aAAa,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAEjE;AAED,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAET;AAED,wBAAgB,8BAA8B,IAAI,OAAO,CAIxD;AAED,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAET;AAED,wBAAgB,gCAAgC,IAAI,OAAO,CAI1D;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,OAAO,GACjB,MAAM,GAAG,SAAS,CAQpB"}
@@ -126,12 +126,26 @@ end
126
126
  function ____exports.isMoveAction(self, buttonAction)
127
127
  return ____exports.MOVEMENT_ACTIONS_SET:has(buttonAction)
128
128
  end
129
+ function ____exports.isMoveActionPressed(self, controllerIndex)
130
+ return ____exports.isActionPressed(
131
+ nil,
132
+ controllerIndex,
133
+ table.unpack(MOVEMENT_ACTIONS)
134
+ )
135
+ end
129
136
  function ____exports.isMoveActionPressedOnAnyInput(self)
130
137
  return __TS__ArraySome(
131
138
  MOVEMENT_ACTIONS,
132
139
  function(____, moveAction) return ____exports.isActionPressedOnAnyInput(nil, moveAction) end
133
140
  )
134
141
  end
142
+ function ____exports.isMoveActionTriggered(self, controllerIndex)
143
+ return ____exports.isActionTriggered(
144
+ nil,
145
+ controllerIndex,
146
+ table.unpack(MOVEMENT_ACTIONS)
147
+ )
148
+ end
135
149
  function ____exports.isMoveActionTriggeredOnAnyInput(self)
136
150
  return __TS__ArraySome(
137
151
  MOVEMENT_ACTIONS,
@@ -141,12 +155,26 @@ end
141
155
  function ____exports.isShootAction(self, buttonAction)
142
156
  return ____exports.SHOOTING_ACTIONS_SET:has(buttonAction)
143
157
  end
158
+ function ____exports.isShootActionPressed(self, controllerIndex)
159
+ return ____exports.isActionPressed(
160
+ nil,
161
+ controllerIndex,
162
+ table.unpack(SHOOTING_ACTIONS)
163
+ )
164
+ end
144
165
  function ____exports.isShootActionPressedOnAnyInput(self)
145
166
  return __TS__ArraySome(
146
167
  SHOOTING_ACTIONS,
147
168
  function(____, shootAction) return ____exports.isActionPressedOnAnyInput(nil, shootAction) end
148
169
  )
149
170
  end
171
+ function ____exports.isShootActionTriggered(self, controllerIndex)
172
+ return ____exports.isActionTriggered(
173
+ nil,
174
+ controllerIndex,
175
+ table.unpack(SHOOTING_ACTIONS)
176
+ )
177
+ end
150
178
  function ____exports.isShootActionTriggeredOnAnyInput(self)
151
179
  return __TS__ArraySome(
152
180
  SHOOTING_ACTIONS,
@@ -32,6 +32,14 @@ export declare function clearSprite(sprite: Sprite, ...layerIDs: int[]): void;
32
32
  * player animations.
33
33
  */
34
34
  export declare function getLastFrameOfAnimation(sprite: Sprite, animation?: string): int;
35
+ /**
36
+ * Helper function to keep a sprite's color the same values as it already is but set the opacity to
37
+ * a specific value.
38
+ *
39
+ * @param sprite The sprite to set.
40
+ * @param alpha A value between 0 and 1 that represents the fade amount.
41
+ */
42
+ export declare function setSpriteOpacity(sprite: Sprite, alpha: float): void;
35
43
  /**
36
44
  * Helper function to check if two sprite layers have the same sprite sheet by using the
37
45
  * `Sprite.GetTexel` method.
@@ -1 +1 @@
1
- {"version":3,"file":"sprites.d.ts","sourceRoot":"","sources":["../../../src/functions/sprites.ts"],"names":[],"mappings":";;;AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,CAWpE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EA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AE,MAAM,EAChB,OAAO,EAAE,GAAG,GACX,OAAO,CAIT"}
@@ -2,6 +2,8 @@ local ____exports = {}
2
2
  local ____constants = require("src.core.constants")
3
3
  local EMPTY_PNG_PATH = ____constants.EMPTY_PNG_PATH
4
4
  local VectorZero = ____constants.VectorZero
5
+ local ____color = require("src.functions.color")
6
+ local copyColor = ____color.copyColor
5
7
  local ____kColor = require("src.functions.kColor")
6
8
  local kColorEquals = ____kColor.kColorEquals
7
9
  local ____utils = require("src.functions.utils")
@@ -62,6 +64,16 @@ function ____exports.getLastFrameOfAnimation(self, sprite, animation)
62
64
  sprite:SetFrame(currentFrame)
63
65
  return finalFrame
64
66
  end
67
+ --- Helper function to keep a sprite's color the same values as it already is but set the opacity to
68
+ -- a specific value.
69
+ --
70
+ -- @param sprite The sprite to set.
71
+ -- @param alpha A value between 0 and 1 that represents the fade amount.
72
+ function ____exports.setSpriteOpacity(self, sprite, alpha)
73
+ local fadedColor = copyColor(nil, sprite.Color)
74
+ fadedColor.A = alpha
75
+ sprite.Color = fadedColor
76
+ end
65
77
  --- Helper function to check if two sprite layers have the same sprite sheet by using the
66
78
  -- `Sprite.GetTexel` method.
67
79
  --
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "20.4.1",
3
+ "version": "20.6.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -1647,11 +1647,12 @@ export enum ModCallbackCustom {
1647
1647
  * change in the `GridCollisionClass`.
1648
1648
  * 2. When slot machine entities pay out with a collectible item. When this happens, they
1649
1649
  * immediately despawn without playing any special animation.
1650
- * 3. When beggars are destroyed with an explosion. When this happens, they immediately despawn
1651
- * without playing any special animation.
1652
- * 4. When beggars pay out with a collectible item. When this happens, they despawn after playing
1653
- * the "Teleport" animation. (This is not technically a "destruction" event, but the callback
1654
- * will fire for this to remain consistent with the other types of slot entities.)
1650
+ * 3. When beggar entities (e.g. `SlotVariant.BEGGAR` and `SlotVariant.SHELL_GAME`) are destroyed
1651
+ * with an explosion. When this happens, they immediately despawn without playing any special
1652
+ * animation.
1653
+ * 4. When beggar entities pay out with a collectible item. When this happens, they despawn after
1654
+ * playing the "Teleport" animation. (This is not technically a "destruction" event, but the
1655
+ * callback will fire for this to remain consistent with the other types of slot entities.)
1655
1656
  *
1656
1657
  * Depending on the specific types of slot removal that you need to detect, you can filter using:
1657
1658
  *
@@ -8,6 +8,7 @@ import { EntityID } from "../types/EntityID";
8
8
  import { getIsaacAPIClassName } from "./isaacAPIClass";
9
9
  import { getRandom } from "./random";
10
10
  import { isRNG, newRNG } from "./rng";
11
+ import { setSpriteOpacity } from "./sprites";
11
12
  import { asNumber, isPrimitive } from "./types";
12
13
  import { isVector, vectorToString } from "./vector";
13
14
 
@@ -477,6 +478,18 @@ export function setEntityDamageFlash(entity: Entity): void {
477
478
  entity.SetColor(DAMAGE_FLASH_COLOR, 2, 0);
478
479
  }
479
480
 
481
+ /**
482
+ * Helper function to keep an entity's color the same values as it already is but set the opacity to
483
+ * a specific value.
484
+ *
485
+ * @param entity The entity to set.
486
+ * @param alpha A value between 0 and 1 that represents the fade amount.
487
+ */
488
+ export function setEntityOpacity(entity: Entity, alpha: float): void {
489
+ const sprite = entity.GetSprite();
490
+ setSpriteOpacity(sprite, alpha);
491
+ }
492
+
480
493
  export function setEntityRandomColor(entity: Entity): void {
481
494
  const rng = newRNG(entity.InitSeed);
482
495
 
@@ -154,12 +154,22 @@ export function isMoveAction(buttonAction: ButtonAction): boolean {
154
154
  return MOVEMENT_ACTIONS_SET.has(buttonAction);
155
155
  }
156
156
 
157
+ export function isMoveActionPressed(controllerIndex: ControllerIndex): boolean {
158
+ return isActionPressed(controllerIndex, ...MOVEMENT_ACTIONS);
159
+ }
160
+
157
161
  export function isMoveActionPressedOnAnyInput(): boolean {
158
162
  return MOVEMENT_ACTIONS.some((moveAction) =>
159
163
  isActionPressedOnAnyInput(moveAction),
160
164
  );
161
165
  }
162
166
 
167
+ export function isMoveActionTriggered(
168
+ controllerIndex: ControllerIndex,
169
+ ): boolean {
170
+ return isActionTriggered(controllerIndex, ...MOVEMENT_ACTIONS);
171
+ }
172
+
163
173
  export function isMoveActionTriggeredOnAnyInput(): boolean {
164
174
  return MOVEMENT_ACTIONS.some((moveAction) =>
165
175
  isActionTriggeredOnAnyInput(moveAction),
@@ -170,12 +180,24 @@ export function isShootAction(buttonAction: ButtonAction): boolean {
170
180
  return SHOOTING_ACTIONS_SET.has(buttonAction);
171
181
  }
172
182
 
183
+ export function isShootActionPressed(
184
+ controllerIndex: ControllerIndex,
185
+ ): boolean {
186
+ return isActionPressed(controllerIndex, ...SHOOTING_ACTIONS);
187
+ }
188
+
173
189
  export function isShootActionPressedOnAnyInput(): boolean {
174
190
  return SHOOTING_ACTIONS.some((shootAction) =>
175
191
  isActionPressedOnAnyInput(shootAction),
176
192
  );
177
193
  }
178
194
 
195
+ export function isShootActionTriggered(
196
+ controllerIndex: ControllerIndex,
197
+ ): boolean {
198
+ return isActionTriggered(controllerIndex, ...SHOOTING_ACTIONS);
199
+ }
200
+
179
201
  export function isShootActionTriggeredOnAnyInput(): boolean {
180
202
  return SHOOTING_ACTIONS.some((shootAction) =>
181
203
  isActionTriggeredOnAnyInput(shootAction),
@@ -1,4 +1,5 @@
1
1
  import { EMPTY_PNG_PATH, VectorZero } from "../core/constants";
2
+ import { copyColor } from "./color";
2
3
  import { kColorEquals } from "./kColor";
3
4
  import { eRange } from "./utils";
4
5
 
@@ -68,6 +69,19 @@ export function getLastFrameOfAnimation(
68
69
  return finalFrame;
69
70
  }
70
71
 
72
+ /**
73
+ * Helper function to keep a sprite's color the same values as it already is but set the opacity to
74
+ * a specific value.
75
+ *
76
+ * @param sprite The sprite to set.
77
+ * @param alpha A value between 0 and 1 that represents the fade amount.
78
+ */
79
+ export function setSpriteOpacity(sprite: Sprite, alpha: float): void {
80
+ const fadedColor = copyColor(sprite.Color);
81
+ fadedColor.A = alpha;
82
+ sprite.Color = fadedColor;
83
+ }
84
+
71
85
  /**
72
86
  * Helper function to check if two sprite layers have the same sprite sheet by using the
73
87
  * `Sprite.GetTexel` method.