isaacscript-common 1.0.462 → 1.0.463
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.
|
@@ -42,10 +42,10 @@ export declare function removeAllCollectibles(): void;
|
|
|
42
42
|
* Python program located at: https://github.com/Rchardon/RebirthItemTracker
|
|
43
43
|
*/
|
|
44
44
|
export declare function removeCollectibleFromItemTracker(collectibleType: CollectibleType | int): void;
|
|
45
|
-
export declare function setCollectibleBlind(
|
|
46
|
-
export declare function setCollectibleSprite(
|
|
45
|
+
export declare function setCollectibleBlind(collectible: EntityPickup): void;
|
|
46
|
+
export declare function setCollectibleSprite(collectible: EntityPickup, pngPath: string): void;
|
|
47
47
|
/**
|
|
48
|
-
* Helper function to change the
|
|
49
|
-
* sufficient because
|
|
48
|
+
* Helper function to change the collectible on a pedestal. Simply updating the SubType property is
|
|
49
|
+
* not sufficient because the sprite will not change.
|
|
50
50
|
*/
|
|
51
51
|
export declare function setCollectibleSubType(collectible: EntityPickup, newCollectibleType: CollectibleType | int): void;
|
|
@@ -6,13 +6,13 @@ local ____collectibleNameMap = require("collectibleNameMap")
|
|
|
6
6
|
local COLLECTIBLE_NAME_MAP = ____collectibleNameMap.COLLECTIBLE_NAME_MAP
|
|
7
7
|
local ____entity = require("functions.entity")
|
|
8
8
|
local removeAllMatchingEntities = ____entity.removeAllMatchingEntities
|
|
9
|
-
function ____exports.setCollectibleSprite(self,
|
|
10
|
-
if
|
|
9
|
+
function ____exports.setCollectibleSprite(self, collectible, pngPath)
|
|
10
|
+
if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
|
|
11
11
|
error(
|
|
12
|
-
"You cannot set a collectible sprite for pickups of variant: " .. tostring(
|
|
12
|
+
"You cannot set a collectible sprite for pickups of variant: " .. tostring(collectible.Variant)
|
|
13
13
|
)
|
|
14
14
|
end
|
|
15
|
-
local sprite =
|
|
15
|
+
local sprite = collectible:GetSprite()
|
|
16
16
|
sprite:ReplaceSpritesheet(COLLECTIBLE_SPRITE_LAYER, pngPath)
|
|
17
17
|
sprite:LoadGraphics()
|
|
18
18
|
end
|
|
@@ -121,18 +121,20 @@ function ____exports.removeCollectibleFromItemTracker(self, collectibleType)
|
|
|
121
121
|
((("Removing collectible " .. tostring(collectibleType)) .. " (") .. collectibleName) .. ") on player 0 (Player)"
|
|
122
122
|
)
|
|
123
123
|
end
|
|
124
|
-
function ____exports.setCollectibleBlind(self,
|
|
125
|
-
|
|
124
|
+
function ____exports.setCollectibleBlind(self, collectible)
|
|
125
|
+
if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
|
|
126
|
+
error(
|
|
127
|
+
"You cannot set a collectible to be blind for pickups of variant: " .. tostring(collectible.Variant)
|
|
128
|
+
)
|
|
129
|
+
end
|
|
130
|
+
____exports.setCollectibleSprite(nil, collectible, BLIND_ITEM_PNG_PATH)
|
|
126
131
|
end
|
|
127
132
|
function ____exports.setCollectibleSubType(self, collectible, newCollectibleType)
|
|
128
|
-
collectible.
|
|
129
|
-
local itemConfig = Isaac.GetItemConfig()
|
|
130
|
-
local itemConfigItem = itemConfig:GetCollectible(newCollectibleType)
|
|
131
|
-
if itemConfigItem == nil then
|
|
133
|
+
if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
|
|
132
134
|
error(
|
|
133
|
-
"
|
|
135
|
+
"You cannot set a collectible sub type for pickups of variant: " .. tostring(collectible.Variant)
|
|
134
136
|
)
|
|
135
137
|
end
|
|
136
|
-
|
|
138
|
+
collectible:Morph(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, newCollectibleType, true, true, true)
|
|
137
139
|
end
|
|
138
140
|
return ____exports
|