isaacscript-common 20.4.1 → 20.5.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 +24 -5
- package/dist/isaacscript-common.lua +80 -67
- package/dist/src/enums/ModCallbackCustom.d.ts +6 -5
- package/dist/src/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/src/functions/entities.d.ts +8 -0
- package/dist/src/functions/entities.d.ts.map +1 -1
- package/dist/src/functions/entities.lua +11 -0
- package/dist/src/functions/sprites.d.ts +8 -0
- package/dist/src/functions/sprites.d.ts.map +1 -1
- package/dist/src/functions/sprites.lua +12 -0
- package/package.json +1 -1
- package/src/enums/ModCallbackCustom.ts +6 -5
- package/src/functions/entities.ts +13 -0
- package/src/functions/sprites.ts +14 -0
package/dist/index.d.ts
CHANGED
|
@@ -10216,11 +10216,12 @@ export declare enum ModCallbackCustom {
|
|
|
10216
10216
|
* change in the `GridCollisionClass`.
|
|
10217
10217
|
* 2. When slot machine entities pay out with a collectible item. When this happens, they
|
|
10218
10218
|
* immediately despawn without playing any special animation.
|
|
10219
|
-
* 3. When
|
|
10220
|
-
* without playing any special
|
|
10221
|
-
*
|
|
10222
|
-
*
|
|
10223
|
-
*
|
|
10219
|
+
* 3. When beggar entities (e.g. `SlotVariant.BEGGAR` and `SlotVariant.SHELL_GAME`) are destroyed
|
|
10220
|
+
* with an explosion. When this happens, they immediately despawn without playing any special
|
|
10221
|
+
* animation.
|
|
10222
|
+
* 4. When beggar entities pay out with a collectible item. When this happens, they despawn after
|
|
10223
|
+
* playing the "Teleport" animation. (This is not technically a "destruction" event, but the
|
|
10224
|
+
* callback will fire for this to remain consistent with the other types of slot entities.)
|
|
10224
10225
|
*
|
|
10225
10226
|
* Depending on the specific types of slot removal that you need to detect, you can filter using:
|
|
10226
10227
|
*
|
|
@@ -13916,6 +13917,15 @@ export declare function setDisplayFlags(displayFlagsMap: Map<int, BitFlags<Displ
|
|
|
13916
13917
|
*/
|
|
13917
13918
|
export declare function setEntityDamageFlash(entity: Entity): void;
|
|
13918
13919
|
|
|
13920
|
+
/**
|
|
13921
|
+
* Helper function to keep an entity's color the same values as it already is but set the opacity to
|
|
13922
|
+
* a specific value.
|
|
13923
|
+
*
|
|
13924
|
+
* @param entity The entity to set.
|
|
13925
|
+
* @param alpha A value between 0 and 1 that represents the fade amount.
|
|
13926
|
+
*/
|
|
13927
|
+
export declare function setEntityOpacity(entity: Entity, alpha: float): void;
|
|
13928
|
+
|
|
13919
13929
|
/**
|
|
13920
13930
|
* Helper function to set the position of every entity in the room based on a map of positions. If
|
|
13921
13931
|
* an entity is found that does not have matching element in the provided map, then that entity will
|
|
@@ -14025,6 +14035,15 @@ export declare function setRoomVisible(roomGridIndex: int | undefined, updateVis
|
|
|
14025
14035
|
/** Helper function to set a seed to an RNG object using Blade's recommended shift index. */
|
|
14026
14036
|
export declare function setSeed(rng: RNG, seed: Seed): void;
|
|
14027
14037
|
|
|
14038
|
+
/**
|
|
14039
|
+
* Helper function to keep a sprite's color the same values as it already is but set the opacity to
|
|
14040
|
+
* a specific value.
|
|
14041
|
+
*
|
|
14042
|
+
* @param sprite The sprite to set.
|
|
14043
|
+
* @param alpha A value between 0 and 1 that represents the fade amount.
|
|
14044
|
+
*/
|
|
14045
|
+
export declare function setSpriteOpacity(sprite: Sprite, alpha: float): void;
|
|
14046
|
+
|
|
14028
14047
|
/**
|
|
14029
14048
|
* Helper function to warp to a new stage/level.
|
|
14030
14049
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 20.
|
|
3
|
+
isaacscript-common 20.5.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(...)
|
|
@@ -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
|
|
1551
|
-
* without playing any special
|
|
1552
|
-
*
|
|
1553
|
-
*
|
|
1554
|
-
*
|
|
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;;;;;;;;;;;OAWG;IACH,mBAAmB,IAAA;IAEnB;;;;;;;;;;;;OAYG;IAC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AA;IAEnB;;;;;;;;;;;;;;;;;OAiBG;IACH,cAAc,KAAA;IAEd;;;;;;;;;;;;OAYG;IACH,gBAAgB,KAAA;IAEhB;;;;;;;;;;;;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 if you do not
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/functions/entities.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAK1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../../src/functions/entities.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAK1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAmB7C;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,UAAU,GAAE,UAAe,EAC3B,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,GAAG,CAcL;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,UAAU,GAAE,UAAe,EAC3B,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,OAAO,CAGT;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,SAAS,EACpD,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,CAAC,EAAE,EACb,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,GAClC,CAAC,GAAG,SAAS,CAgBf;AAED,wF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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)
|
|
@@ -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":";;;
|
|
1
|
+
{"version":3,"file":"sprites.d.ts","sourceRoot":"","sources":["../../../src/functions/sprites.ts"],"names":[],"mappings":";;;AAKA;;;;;;;;;;;;;;;;;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,EAAE,MAAM,GACjB,GAAG,CAmBL;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAInE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,GAAG,EACZ,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,GAAG,EACZ,UAAU,EAAE,GAAG,EACf,MAAM,EAAE,GAAG,EACX,OAAO,EAAE,GAAG,EACZ,UAAU,EAAE,GAAG,GACd,OAAO,CAaT;AAED,uFAAuF;AACvF,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,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
|
@@ -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
|
|
1651
|
-
* without playing any special
|
|
1652
|
-
*
|
|
1653
|
-
*
|
|
1654
|
-
*
|
|
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
|
|
package/src/functions/sprites.ts
CHANGED
|
@@ -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.
|