isaacscript-common 9.18.0 → 9.18.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectibles.d.ts","sourceRoot":"","sources":["../../src/functions/collectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,
|
|
1
|
+
{"version":3,"file":"collectibles.d.ts","sourceRoot":"","sources":["../../src/functions/collectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAEvB,eAAe,EAEf,oBAAoB,EACpB,aAAa,EAEb,QAAQ,EACR,WAAW,EAGZ,MAAM,8BAA8B,CAAC;AAgBtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAwB7D,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAEtE;AAED,6FAA6F;AAC7F,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAsBT;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,eAAe,GAC/B,oBAAoB,CAOtB;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,eAAe,GAC/B,MAAM,CAeR;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,eAAe,EAAE,eAAe,GAC/B,GAAG,CAYL;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,YAAY,GACnB,WAAW,CAyBb;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,eAAe,GAC/B,MAAM,CAOR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,YAAY,GACxB,gBAAgB,CAsBlB;A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AC/B,OAAO,CAGT;AAED,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,eAAe,EAAE,eAAe,GAAG,MAAM,CAa7E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gCAAgC,CAC9C,eAAe,EAAE,eAAe,GAC/B,IAAI,CAQN;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAS5E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CASnE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAUnE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAuBtE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,IAAI,CAqBN;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,YAAY,EACzB,kBAAkB,EAAE,eAAe,GAClC,IAAI,CA2BN;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,IAAI,IAAI,CAK5D"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
|
-
local initQuestionMarkSprite
|
|
2
|
+
local initQuestionMarkSprite
|
|
3
3
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
4
|
+
local CollectibleSpriteLayer = ____isaac_2Dtypescript_2Ddefinitions.CollectibleSpriteLayer
|
|
4
5
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
5
6
|
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
6
7
|
local ItemConfigChargeType = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigChargeType
|
|
@@ -80,9 +81,9 @@ function ____exports.setCollectibleSprite(self, collectible, pngPath)
|
|
|
80
81
|
end
|
|
81
82
|
local sprite = collectible:GetSprite()
|
|
82
83
|
if pngPath == nil then
|
|
83
|
-
clearSprite(nil, sprite,
|
|
84
|
+
clearSprite(nil, sprite, CollectibleSpriteLayer.HEAD, CollectibleSpriteLayer.ITEM_SHADOW)
|
|
84
85
|
else
|
|
85
|
-
sprite:ReplaceSpritesheet(
|
|
86
|
+
sprite:ReplaceSpritesheet(CollectibleSpriteLayer.HEAD, pngPath)
|
|
86
87
|
sprite:LoadGraphics()
|
|
87
88
|
end
|
|
88
89
|
end
|
|
@@ -107,8 +108,6 @@ function ____exports.setCollectibleSubType(self, collectible, newCollectibleType
|
|
|
107
108
|
)
|
|
108
109
|
end
|
|
109
110
|
local COLLECTIBLE_ANM2_PATH = "gfx/005.100_collectible.anm2"
|
|
110
|
-
COLLECTIBLE_SPRITE_LAYER = 1
|
|
111
|
-
COLLECTIBLE_SHADOW_LAYER = 4
|
|
112
111
|
local GLITCHED_ITEM_THRESHOLD = 4000000000
|
|
113
112
|
local questionMarkSprite = initQuestionMarkSprite(nil)
|
|
114
113
|
--- Helper function to check if two collectible sprites have the same sprite sheet loaded.
|
|
@@ -123,7 +122,7 @@ function ____exports.collectibleSpriteEquals(self, sprite1, sprite2)
|
|
|
123
122
|
nil,
|
|
124
123
|
sprite1,
|
|
125
124
|
sprite2,
|
|
126
|
-
|
|
125
|
+
CollectibleSpriteLayer.HEAD,
|
|
127
126
|
xStart,
|
|
128
127
|
xFinish,
|
|
129
128
|
xIncrement,
|
|
@@ -403,7 +402,7 @@ function ____exports.newCollectibleSprite(self, collectibleType)
|
|
|
403
402
|
sprite:Load(COLLECTIBLE_ANM2_PATH, false)
|
|
404
403
|
clearSprite(nil, sprite)
|
|
405
404
|
local gfxFileName = ____exports.getCollectibleGfxFilename(nil, collectibleType)
|
|
406
|
-
sprite:ReplaceSpritesheet(
|
|
405
|
+
sprite:ReplaceSpritesheet(CollectibleSpriteLayer.HEAD, gfxFileName)
|
|
407
406
|
sprite:LoadGraphics()
|
|
408
407
|
return sprite
|
|
409
408
|
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "9.18.
|
|
3
|
+
"version": "9.18.1",
|
|
4
4
|
"description": "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"main": "dist/index",
|
|
23
23
|
"types": "dist/index.d.ts",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"isaac-typescript-definitions": "^4.
|
|
25
|
+
"isaac-typescript-definitions": "^4.1.1"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CollectiblePedestalType,
|
|
3
|
+
CollectibleSpriteLayer,
|
|
3
4
|
CollectibleType,
|
|
4
5
|
EntityType,
|
|
5
6
|
ItemConfigChargeType,
|
|
@@ -33,8 +34,6 @@ import { clearSprite, spriteEquals } from "./sprites";
|
|
|
33
34
|
import { irange } from "./utils";
|
|
34
35
|
|
|
35
36
|
const COLLECTIBLE_ANM2_PATH = "gfx/005.100_collectible.anm2";
|
|
36
|
-
const COLLECTIBLE_SPRITE_LAYER = 1;
|
|
37
|
-
const COLLECTIBLE_SHADOW_LAYER = 4;
|
|
38
37
|
|
|
39
38
|
// Glitched items start at id 4294967295 (the final 32-bit integer) and increment backwards.
|
|
40
39
|
const GLITCHED_ITEM_THRESHOLD = 4000000000;
|
|
@@ -73,7 +72,7 @@ export function collectibleSpriteEquals(
|
|
|
73
72
|
return spriteEquals(
|
|
74
73
|
sprite1,
|
|
75
74
|
sprite2,
|
|
76
|
-
|
|
75
|
+
CollectibleSpriteLayer.HEAD,
|
|
77
76
|
xStart,
|
|
78
77
|
xFinish,
|
|
79
78
|
xIncrement,
|
|
@@ -498,7 +497,7 @@ export function newCollectibleSprite(collectibleType: CollectibleType): Sprite {
|
|
|
498
497
|
clearSprite(sprite);
|
|
499
498
|
|
|
500
499
|
const gfxFileName = getCollectibleGfxFilename(collectibleType);
|
|
501
|
-
sprite.ReplaceSpritesheet(
|
|
500
|
+
sprite.ReplaceSpritesheet(CollectibleSpriteLayer.HEAD, gfxFileName);
|
|
502
501
|
sprite.LoadGraphics();
|
|
503
502
|
|
|
504
503
|
return sprite;
|
|
@@ -631,9 +630,15 @@ export function setCollectibleSprite(
|
|
|
631
630
|
|
|
632
631
|
const sprite = collectible.GetSprite();
|
|
633
632
|
if (pngPath === undefined) {
|
|
634
|
-
|
|
633
|
+
// We want to remove the little circle that appears on top of the pedestal, which is why we also
|
|
634
|
+
// clear `CollectibleSpriteLayer.ITEM_SHADOW`.
|
|
635
|
+
clearSprite(
|
|
636
|
+
sprite,
|
|
637
|
+
CollectibleSpriteLayer.HEAD,
|
|
638
|
+
CollectibleSpriteLayer.ITEM_SHADOW,
|
|
639
|
+
);
|
|
635
640
|
} else {
|
|
636
|
-
sprite.ReplaceSpritesheet(
|
|
641
|
+
sprite.ReplaceSpritesheet(CollectibleSpriteLayer.HEAD, pngPath);
|
|
637
642
|
sprite.LoadGraphics();
|
|
638
643
|
}
|
|
639
644
|
}
|