isaacscript-common 1.0.460 → 1.0.461
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,9 +1,4 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
-
/**
|
|
3
|
-
* Helper function to change the item on an item pedestal. Simply updating the SubType is not
|
|
4
|
-
* sufficient because you also need to update the sprite.
|
|
5
|
-
*/
|
|
6
|
-
export declare function changeCollectibleSubType(collectible: EntityPickup, newCollectibleType: CollectibleType | int): void;
|
|
7
2
|
export declare function collectibleHasTag(collectibleType: CollectibleType | int, tag: ItemConfigTag): boolean;
|
|
8
3
|
/**
|
|
9
4
|
* Helper function to get the heart cost that a collectible item would be if it were being offered
|
|
@@ -49,3 +44,8 @@ export declare function removeAllCollectibles(): void;
|
|
|
49
44
|
export declare function removeCollectibleFromItemTracker(collectibleType: CollectibleType | int): void;
|
|
50
45
|
export declare function setCollectibleBlind(pickup: EntityPickup): void;
|
|
51
46
|
export declare function setCollectibleSprite(pickup: EntityPickup, pngPath: string): void;
|
|
47
|
+
/**
|
|
48
|
+
* Helper function to change the item on an item pedestal. Simply updating the SubType is not
|
|
49
|
+
* sufficient because you also need to update the sprite.
|
|
50
|
+
*/
|
|
51
|
+
export declare function setCollectibleSubType(collectible: EntityPickup, newCollectibleType: CollectibleType | int): void;
|
|
@@ -19,17 +19,6 @@ end
|
|
|
19
19
|
COLLECTIBLE_SPRITE_LAYER = 1
|
|
20
20
|
local BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png"
|
|
21
21
|
local GLITCHED_ITEM_THRESHOLD = 4000000000
|
|
22
|
-
function ____exports.changeCollectibleSubType(self, collectible, newCollectibleType)
|
|
23
|
-
collectible.SubType = newCollectibleType
|
|
24
|
-
local itemConfig = Isaac.GetItemConfig()
|
|
25
|
-
local itemConfigItem = itemConfig:GetCollectible(newCollectibleType)
|
|
26
|
-
if itemConfigItem == nil then
|
|
27
|
-
error(
|
|
28
|
-
"Failed to get the item config for: " .. tostring(newCollectibleType)
|
|
29
|
-
)
|
|
30
|
-
end
|
|
31
|
-
____exports.setCollectibleSprite(nil, collectible, itemConfigItem.GfxFileName)
|
|
32
|
-
end
|
|
33
22
|
function ____exports.collectibleHasTag(self, collectibleType, tag)
|
|
34
23
|
local itemConfig = Isaac.GetItemConfig()
|
|
35
24
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
@@ -135,4 +124,15 @@ end
|
|
|
135
124
|
function ____exports.setCollectibleBlind(self, pickup)
|
|
136
125
|
____exports.setCollectibleSprite(nil, pickup, BLIND_ITEM_PNG_PATH)
|
|
137
126
|
end
|
|
127
|
+
function ____exports.setCollectibleSubType(self, collectible, newCollectibleType)
|
|
128
|
+
collectible.SubType = newCollectibleType
|
|
129
|
+
local itemConfig = Isaac.GetItemConfig()
|
|
130
|
+
local itemConfigItem = itemConfig:GetCollectible(newCollectibleType)
|
|
131
|
+
if itemConfigItem == nil then
|
|
132
|
+
error(
|
|
133
|
+
"Failed to get the item config for: " .. tostring(newCollectibleType)
|
|
134
|
+
)
|
|
135
|
+
end
|
|
136
|
+
____exports.setCollectibleSprite(nil, collectible, itemConfigItem.GfxFileName)
|
|
137
|
+
end
|
|
138
138
|
return ____exports
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.461",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist/**/*.d.ts"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^1.0.
|
|
28
|
+
"isaac-typescript-definitions": "^1.0.280",
|
|
29
29
|
"isaacscript-lint": "^1.0.67",
|
|
30
30
|
"typedoc": "^0.22.9",
|
|
31
31
|
"typescript": "4.4.4",
|