isaacscript-common 9.17.1 → 9.18.2
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/functions/charge.d.ts +2 -0
- package/dist/functions/charge.d.ts.map +1 -1
- package/dist/functions/charge.lua +12 -0
- package/dist/functions/collectibles.d.ts +6 -1
- package/dist/functions/collectibles.d.ts.map +1 -1
- package/dist/functions/collectibles.lua +16 -7
- package/dist/index.d.ts +35 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +8 -0
- package/dist/objects/colors.d.ts +1 -1
- package/dist/objects/colors.lua +1 -1
- package/dist/objects/kColors.d.ts +25 -0
- package/dist/objects/kColors.d.ts.map +1 -0
- package/dist/objects/kColors.lua +24 -0
- package/package.json +2 -2
- package/src/functions/charge.ts +19 -1
- package/src/functions/collectibles.ts +27 -6
- package/src/index.ts +1 -0
- package/src/objects/colors.ts +1 -1
- package/src/objects/kColors.ts +25 -0
|
@@ -27,6 +27,7 @@ export declare function addCharge(player: EntityPlayer, activeSlot: ActiveSlot,
|
|
|
27
27
|
* - 2x2 rooms and L rooms granting a double charge
|
|
28
28
|
* - The Battery
|
|
29
29
|
* - AAA Battery
|
|
30
|
+
* - Not charging active items with `chargetype="special"`
|
|
30
31
|
*
|
|
31
32
|
* @param player The player to grant the charges to.
|
|
32
33
|
* @param bigRoomDoubleCharge Optional. If set to false, it will treat the current room as a 1x1
|
|
@@ -43,6 +44,7 @@ export declare function addRoomClearCharge(player: EntityPlayer, bigRoomDoubleCh
|
|
|
43
44
|
* - L rooms and 2x2 rooms granting a double charge
|
|
44
45
|
* - The Battery
|
|
45
46
|
* - AAA Battery
|
|
47
|
+
* - Not charging active items with `chargetype="special"`
|
|
46
48
|
*
|
|
47
49
|
* @param player The player to grant the charges to.
|
|
48
50
|
* @param activeSlot The active item slot to grant the charges to.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charge.d.ts","sourceRoot":"","sources":["../../src/functions/charge.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,
|
|
1
|
+
{"version":3,"file":"charge.d.ts","sourceRoot":"","sources":["../../src/functions/charge.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAKX,MAAM,8BAA8B,CAAC;AAStC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,SAAI,EACd,eAAe,UAAO,GACrB,GAAG,CA2BL;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,mBAAmB,UAAO,EAC1B,eAAe,UAAO,GACrB,IAAI,CAaN;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,mBAAmB,UAAO,EAC1B,eAAe,UAAO,GACrB,IAAI,CAkBN;AAuED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,mBAAmB,UAAO,GAAG,IAAI,CAIpE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,GACrB,GAAG,CAKL;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,GACrB,OAAO,CAMT;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,GACrB,IAAI,CAYN"}
|
|
@@ -3,12 +3,14 @@ local getClampedChargesToAdd, getChargesToAddWithAAAModifier, shouldPlayFullRech
|
|
|
3
3
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
4
4
|
local ActiveSlot = ____isaac_2Dtypescript_2Ddefinitions.ActiveSlot
|
|
5
5
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
6
|
+
local ItemConfigChargeType = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigChargeType
|
|
6
7
|
local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
|
|
7
8
|
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
8
9
|
local ____cachedClasses = require("core.cachedClasses")
|
|
9
10
|
local game = ____cachedClasses.game
|
|
10
11
|
local sfxManager = ____cachedClasses.sfxManager
|
|
11
12
|
local ____collectibles = require("functions.collectibles")
|
|
13
|
+
local getCollectibleChargeType = ____collectibles.getCollectibleChargeType
|
|
12
14
|
local getCollectibleMaxCharges = ____collectibles.getCollectibleMaxCharges
|
|
13
15
|
local ____playerIndex = require("functions.playerIndex")
|
|
14
16
|
local getPlayers = ____playerIndex.getPlayers
|
|
@@ -60,6 +62,7 @@ end
|
|
|
60
62
|
-- - L rooms and 2x2 rooms granting a double charge
|
|
61
63
|
-- - The Battery
|
|
62
64
|
-- - AAA Battery
|
|
65
|
+
-- - Not charging active items with `chargetype="special"`
|
|
63
66
|
--
|
|
64
67
|
-- @param player The player to grant the charges to.
|
|
65
68
|
-- @param activeSlot The active item slot to grant the charges to.
|
|
@@ -74,6 +77,14 @@ function ____exports.addRoomClearChargeToSlot(self, player, activeSlot, bigRoomD
|
|
|
74
77
|
if playSoundEffect == nil then
|
|
75
78
|
playSoundEffect = true
|
|
76
79
|
end
|
|
80
|
+
local activeItem = player:GetActiveItem(activeSlot)
|
|
81
|
+
if activeItem == CollectibleType.NULL then
|
|
82
|
+
return
|
|
83
|
+
end
|
|
84
|
+
local chargeType = getCollectibleChargeType(nil, activeItem)
|
|
85
|
+
if chargeType == ItemConfigChargeType.SPECIAL then
|
|
86
|
+
return
|
|
87
|
+
end
|
|
77
88
|
local room = game:GetRoom()
|
|
78
89
|
local roomShape = room:GetRoomShape()
|
|
79
90
|
local numCharges = bigRoomDoubleCharge and getRoomShapeCharges(nil, roomShape) or 1
|
|
@@ -156,6 +167,7 @@ end
|
|
|
156
167
|
-- - 2x2 rooms and L rooms granting a double charge
|
|
157
168
|
-- - The Battery
|
|
158
169
|
-- - AAA Battery
|
|
170
|
+
-- - Not charging active items with `chargetype="special"`
|
|
159
171
|
--
|
|
160
172
|
-- @param player The player to grant the charges to.
|
|
161
173
|
-- @param bigRoomDoubleCharge Optional. If set to false, it will treat the current room as a 1x1
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { CollectiblePedestalType, CollectibleType, ItemConfigTag, ItemType, PickupPrice } from "isaac-typescript-definitions";
|
|
1
|
+
import { CollectiblePedestalType, CollectibleType, ItemConfigChargeType, ItemConfigTag, ItemType, PickupPrice } from "isaac-typescript-definitions";
|
|
2
2
|
import { CollectibleIndex } from "../types/CollectibleIndex";
|
|
3
3
|
export declare function clearCollectibleSprite(collectible: EntityPickup): void;
|
|
4
4
|
/** Helper function to check if two collectible sprites have the same sprite sheet loaded. */
|
|
5
5
|
export declare function collectibleSpriteEquals(sprite1: Sprite, sprite2: Sprite): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Helper function to get the charge type that a collectible has. Returns
|
|
8
|
+
* `ItemConfigChargeType.NORMAL` if the provided collectible type was not valid.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getCollectibleChargeType(collectibleType: CollectibleType): ItemConfigChargeType;
|
|
6
11
|
/**
|
|
7
12
|
* Helper function to get the in-game description for a collectible. Returns "Unknown" if the
|
|
8
13
|
* provided collectible type was not valid.
|
|
@@ -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,8B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AAgB,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,8 +1,10 @@
|
|
|
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
|
|
7
|
+
local ItemConfigChargeType = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigChargeType
|
|
6
8
|
local ItemConfigTagZero = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigTagZero
|
|
7
9
|
local ItemType = ____isaac_2Dtypescript_2Ddefinitions.ItemType
|
|
8
10
|
local PickupPrice = ____isaac_2Dtypescript_2Ddefinitions.PickupPrice
|
|
@@ -79,9 +81,9 @@ function ____exports.setCollectibleSprite(self, collectible, pngPath)
|
|
|
79
81
|
end
|
|
80
82
|
local sprite = collectible:GetSprite()
|
|
81
83
|
if pngPath == nil then
|
|
82
|
-
clearSprite(nil, sprite,
|
|
84
|
+
clearSprite(nil, sprite, CollectibleSpriteLayer.HEAD, CollectibleSpriteLayer.ITEM_SHADOW)
|
|
83
85
|
else
|
|
84
|
-
sprite:ReplaceSpritesheet(
|
|
86
|
+
sprite:ReplaceSpritesheet(CollectibleSpriteLayer.HEAD, pngPath)
|
|
85
87
|
sprite:LoadGraphics()
|
|
86
88
|
end
|
|
87
89
|
end
|
|
@@ -106,8 +108,6 @@ function ____exports.setCollectibleSubType(self, collectible, newCollectibleType
|
|
|
106
108
|
)
|
|
107
109
|
end
|
|
108
110
|
local COLLECTIBLE_ANM2_PATH = "gfx/005.100_collectible.anm2"
|
|
109
|
-
COLLECTIBLE_SPRITE_LAYER = 1
|
|
110
|
-
COLLECTIBLE_SHADOW_LAYER = 4
|
|
111
111
|
local GLITCHED_ITEM_THRESHOLD = 4000000000
|
|
112
112
|
local questionMarkSprite = initQuestionMarkSprite(nil)
|
|
113
113
|
--- Helper function to check if two collectible sprites have the same sprite sheet loaded.
|
|
@@ -122,7 +122,7 @@ function ____exports.collectibleSpriteEquals(self, sprite1, sprite2)
|
|
|
122
122
|
nil,
|
|
123
123
|
sprite1,
|
|
124
124
|
sprite2,
|
|
125
|
-
|
|
125
|
+
CollectibleSpriteLayer.HEAD,
|
|
126
126
|
xStart,
|
|
127
127
|
xFinish,
|
|
128
128
|
xIncrement,
|
|
@@ -131,6 +131,15 @@ function ____exports.collectibleSpriteEquals(self, sprite1, sprite2)
|
|
|
131
131
|
yIncrement
|
|
132
132
|
)
|
|
133
133
|
end
|
|
134
|
+
--- Helper function to get the charge type that a collectible has. Returns
|
|
135
|
+
-- `ItemConfigChargeType.NORMAL` if the provided collectible type was not valid.
|
|
136
|
+
function ____exports.getCollectibleChargeType(self, collectibleType)
|
|
137
|
+
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
138
|
+
if itemConfigItem == nil then
|
|
139
|
+
return ItemConfigChargeType.NORMAL
|
|
140
|
+
end
|
|
141
|
+
return itemConfigItem.ChargeType
|
|
142
|
+
end
|
|
134
143
|
--- Helper function to get the in-game description for a collectible. Returns "Unknown" if the
|
|
135
144
|
-- provided collectible type was not valid.
|
|
136
145
|
function ____exports.getCollectibleDescription(self, collectibleType)
|
|
@@ -393,7 +402,7 @@ function ____exports.newCollectibleSprite(self, collectibleType)
|
|
|
393
402
|
sprite:Load(COLLECTIBLE_ANM2_PATH, false)
|
|
394
403
|
clearSprite(nil, sprite)
|
|
395
404
|
local gfxFileName = ____exports.getCollectibleGfxFilename(nil, collectibleType)
|
|
396
|
-
sprite:ReplaceSpritesheet(
|
|
405
|
+
sprite:ReplaceSpritesheet(CollectibleSpriteLayer.HEAD, gfxFileName)
|
|
397
406
|
sprite:LoadGraphics()
|
|
398
407
|
return sprite
|
|
399
408
|
end
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ import { GridEntityType } from 'isaac-typescript-definitions';
|
|
|
35
35
|
import { GridEntityXMLType } from 'isaac-typescript-definitions';
|
|
36
36
|
import { HeartSubType } from 'isaac-typescript-definitions';
|
|
37
37
|
import { ItemConfigCardType } from 'isaac-typescript-definitions';
|
|
38
|
+
import { ItemConfigChargeType } from 'isaac-typescript-definitions';
|
|
38
39
|
import { ItemConfigPillEffectClass } from 'isaac-typescript-definitions';
|
|
39
40
|
import { ItemConfigPillEffectType } from 'isaac-typescript-definitions';
|
|
40
41
|
import { ItemConfigTag } from 'isaac-typescript-definitions';
|
|
@@ -245,6 +246,7 @@ export declare function addPlayerHealthType(player: EntityPlayer, healthType: He
|
|
|
245
246
|
* - 2x2 rooms and L rooms granting a double charge
|
|
246
247
|
* - The Battery
|
|
247
248
|
* - AAA Battery
|
|
249
|
+
* - Not charging active items with `chargetype="special"`
|
|
248
250
|
*
|
|
249
251
|
* @param player The player to grant the charges to.
|
|
250
252
|
* @param bigRoomDoubleCharge Optional. If set to false, it will treat the current room as a 1x1
|
|
@@ -277,6 +279,7 @@ export declare function addRoomClearCharges(bigRoomDoubleCharge?: boolean): void
|
|
|
277
279
|
* - L rooms and 2x2 rooms granting a double charge
|
|
278
280
|
* - The Battery
|
|
279
281
|
* - AAA Battery
|
|
282
|
+
* - Not charging active items with `chargetype="special"`
|
|
280
283
|
*
|
|
281
284
|
* @param player The player to grant the charges to.
|
|
282
285
|
* @param activeSlot The active item slot to grant the charges to.
|
|
@@ -857,8 +860,8 @@ export declare const COLORS: {
|
|
|
857
860
|
readonly Green: Readonly<Color>;
|
|
858
861
|
readonly Blue: Readonly<Color>;
|
|
859
862
|
readonly Yellow: Readonly<Color>;
|
|
860
|
-
readonly Pink: Readonly<Color>;
|
|
861
863
|
readonly Cyan: Readonly<Color>;
|
|
864
|
+
readonly Magenta: Readonly<Color>;
|
|
862
865
|
readonly White: Readonly<Color>;
|
|
863
866
|
readonly Brown: Readonly<Color>;
|
|
864
867
|
readonly Gray: Readonly<Color>;
|
|
@@ -2622,6 +2625,12 @@ export declare function getCoinValue(coinSubType: CoinSubType): int;
|
|
|
2622
2625
|
*/
|
|
2623
2626
|
export declare function getCollectibleArray(): readonly CollectibleType[];
|
|
2624
2627
|
|
|
2628
|
+
/**
|
|
2629
|
+
* Helper function to get the charge type that a collectible has. Returns
|
|
2630
|
+
* `ItemConfigChargeType.NORMAL` if the provided collectible type was not valid.
|
|
2631
|
+
*/
|
|
2632
|
+
export declare function getCollectibleChargeType(collectibleType: CollectibleType): ItemConfigChargeType;
|
|
2633
|
+
|
|
2625
2634
|
/**
|
|
2626
2635
|
* Helper function to get the in-game description for a collectible. Returns "Unknown" if the
|
|
2627
2636
|
* provided collectible type was not valid.
|
|
@@ -6518,6 +6527,31 @@ export declare interface JSONSpawn {
|
|
|
6518
6527
|
entity: JSONEntity[];
|
|
6519
6528
|
}
|
|
6520
6529
|
|
|
6530
|
+
/**
|
|
6531
|
+
* A collection of common colors that can be reused.
|
|
6532
|
+
*
|
|
6533
|
+
* Note that if you want to further modify these colors, you should copy them first with the
|
|
6534
|
+
* `copyColor` function.
|
|
6535
|
+
*
|
|
6536
|
+
* The non-standard colors come from:
|
|
6537
|
+
* https://htmlcolorcodes.com/color-names/
|
|
6538
|
+
*/
|
|
6539
|
+
export declare const K_COLORS: {
|
|
6540
|
+
readonly Black: Readonly<KColor>;
|
|
6541
|
+
readonly Red: Readonly<KColor>;
|
|
6542
|
+
readonly Green: Readonly<KColor>;
|
|
6543
|
+
readonly Blue: Readonly<KColor>;
|
|
6544
|
+
readonly Yellow: Readonly<KColor>;
|
|
6545
|
+
readonly Cyan: Readonly<KColor>;
|
|
6546
|
+
readonly Magenta: Readonly<KColor>;
|
|
6547
|
+
readonly White: Readonly<KColor>;
|
|
6548
|
+
readonly Transparent: Readonly<KColor>;
|
|
6549
|
+
readonly Brown: Readonly<KColor>;
|
|
6550
|
+
readonly Gray: Readonly<KColor>;
|
|
6551
|
+
readonly Orange: Readonly<KColor>;
|
|
6552
|
+
readonly Purple: Readonly<KColor>;
|
|
6553
|
+
};
|
|
6554
|
+
|
|
6521
6555
|
/**
|
|
6522
6556
|
* Equal to `KColor(1, 1, 1, 1)`.
|
|
6523
6557
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;A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C;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC"}
|
package/dist/index.lua
CHANGED
|
@@ -1239,6 +1239,14 @@ do
|
|
|
1239
1239
|
end
|
|
1240
1240
|
end
|
|
1241
1241
|
end
|
|
1242
|
+
do
|
|
1243
|
+
local ____export = require("objects.kColors")
|
|
1244
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
1245
|
+
if ____exportKey ~= "default" then
|
|
1246
|
+
____exports[____exportKey] = ____exportValue
|
|
1247
|
+
end
|
|
1248
|
+
end
|
|
1249
|
+
end
|
|
1242
1250
|
do
|
|
1243
1251
|
local ____export = require("types.PickingUpItem")
|
|
1244
1252
|
for ____exportKey, ____exportValue in pairs(____export) do
|
package/dist/objects/colors.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ export declare const COLORS: {
|
|
|
13
13
|
readonly Green: Readonly<Color>;
|
|
14
14
|
readonly Blue: Readonly<Color>;
|
|
15
15
|
readonly Yellow: Readonly<Color>;
|
|
16
|
-
readonly Pink: Readonly<Color>;
|
|
17
16
|
readonly Cyan: Readonly<Color>;
|
|
17
|
+
readonly Magenta: Readonly<Color>;
|
|
18
18
|
readonly White: Readonly<Color>;
|
|
19
19
|
readonly Brown: Readonly<Color>;
|
|
20
20
|
readonly Gray: Readonly<Color>;
|
package/dist/objects/colors.lua
CHANGED
|
@@ -12,8 +12,8 @@ ____exports.COLORS = {
|
|
|
12
12
|
Green = Color(0, 1, 0),
|
|
13
13
|
Blue = Color(0, 0, 1),
|
|
14
14
|
Yellow = Color(1, 1, 0),
|
|
15
|
-
Pink = Color(1, 0, 1),
|
|
16
15
|
Cyan = Color(0, 1, 1),
|
|
16
|
+
Magenta = Color(1, 0, 1),
|
|
17
17
|
White = Color(1, 1, 1),
|
|
18
18
|
Brown = Color(0.588, 0.294, 0),
|
|
19
19
|
Gray = Color(0.5, 0.5, 0.5),
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A collection of common colors that can be reused.
|
|
3
|
+
*
|
|
4
|
+
* Note that if you want to further modify these colors, you should copy them first with the
|
|
5
|
+
* `copyColor` function.
|
|
6
|
+
*
|
|
7
|
+
* The non-standard colors come from:
|
|
8
|
+
* https://htmlcolorcodes.com/color-names/
|
|
9
|
+
*/
|
|
10
|
+
export declare const K_COLORS: {
|
|
11
|
+
readonly Black: Readonly<KColor>;
|
|
12
|
+
readonly Red: Readonly<KColor>;
|
|
13
|
+
readonly Green: Readonly<KColor>;
|
|
14
|
+
readonly Blue: Readonly<KColor>;
|
|
15
|
+
readonly Yellow: Readonly<KColor>;
|
|
16
|
+
readonly Cyan: Readonly<KColor>;
|
|
17
|
+
readonly Magenta: Readonly<KColor>;
|
|
18
|
+
readonly White: Readonly<KColor>;
|
|
19
|
+
readonly Transparent: Readonly<KColor>;
|
|
20
|
+
readonly Brown: Readonly<KColor>;
|
|
21
|
+
readonly Gray: Readonly<KColor>;
|
|
22
|
+
readonly Orange: Readonly<KColor>;
|
|
23
|
+
readonly Purple: Readonly<KColor>;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=kColors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kColors.d.ts","sourceRoot":"","sources":["../../src/objects/kColors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;CAeX,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
--- A collection of common colors that can be reused.
|
|
3
|
+
--
|
|
4
|
+
-- Note that if you want to further modify these colors, you should copy them first with the
|
|
5
|
+
-- `copyColor` function.
|
|
6
|
+
--
|
|
7
|
+
-- The non-standard colors come from:
|
|
8
|
+
-- https://htmlcolorcodes.com/color-names/
|
|
9
|
+
____exports.K_COLORS = {
|
|
10
|
+
Black = KColor(0, 0, 0, 1),
|
|
11
|
+
Red = KColor(1, 0, 0, 1),
|
|
12
|
+
Green = KColor(0, 1, 0, 1),
|
|
13
|
+
Blue = KColor(0, 0, 1, 1),
|
|
14
|
+
Yellow = KColor(1, 1, 0, 1),
|
|
15
|
+
Cyan = KColor(0, 1, 1, 1),
|
|
16
|
+
Magenta = KColor(1, 0, 1, 1),
|
|
17
|
+
White = KColor(1, 1, 1, 1),
|
|
18
|
+
Transparent = KColor(0, 0, 0, 0),
|
|
19
|
+
Brown = KColor(0.588, 0.294, 0, 1),
|
|
20
|
+
Gray = KColor(0.5, 0.5, 0.5, 1),
|
|
21
|
+
Orange = KColor(1, 0.647, 0, 1),
|
|
22
|
+
Purple = KColor(0.5, 0, 0.5, 1)
|
|
23
|
+
}
|
|
24
|
+
return ____exports
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.18.2",
|
|
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": "^
|
|
25
|
+
"isaac-typescript-definitions": "^5.0.0"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/functions/charge.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ActiveSlot,
|
|
3
3
|
CollectibleType,
|
|
4
|
+
ItemConfigChargeType,
|
|
4
5
|
SoundEffect,
|
|
5
6
|
TrinketType,
|
|
6
7
|
} from "isaac-typescript-definitions";
|
|
7
8
|
import { game, sfxManager } from "../core/cachedClasses";
|
|
8
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
getCollectibleChargeType,
|
|
11
|
+
getCollectibleMaxCharges,
|
|
12
|
+
} from "./collectibles";
|
|
9
13
|
import { getPlayers } from "./playerIndex";
|
|
10
14
|
import { getRoomShapeCharges } from "./roomShape";
|
|
11
15
|
|
|
@@ -70,6 +74,7 @@ export function addCharge(
|
|
|
70
74
|
* - 2x2 rooms and L rooms granting a double charge
|
|
71
75
|
* - The Battery
|
|
72
76
|
* - AAA Battery
|
|
77
|
+
* - Not charging active items with `chargetype="special"`
|
|
73
78
|
*
|
|
74
79
|
* @param player The player to grant the charges to.
|
|
75
80
|
* @param bigRoomDoubleCharge Optional. If set to false, it will treat the current room as a 1x1
|
|
@@ -104,6 +109,7 @@ export function addRoomClearCharge(
|
|
|
104
109
|
* - L rooms and 2x2 rooms granting a double charge
|
|
105
110
|
* - The Battery
|
|
106
111
|
* - AAA Battery
|
|
112
|
+
* - Not charging active items with `chargetype="special"`
|
|
107
113
|
*
|
|
108
114
|
* @param player The player to grant the charges to.
|
|
109
115
|
* @param activeSlot The active item slot to grant the charges to.
|
|
@@ -118,6 +124,18 @@ export function addRoomClearChargeToSlot(
|
|
|
118
124
|
bigRoomDoubleCharge = true,
|
|
119
125
|
playSoundEffect = true,
|
|
120
126
|
): void {
|
|
127
|
+
const activeItem = player.GetActiveItem(activeSlot);
|
|
128
|
+
if (activeItem === CollectibleType.NULL) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Certain collectibles have special charge mechanisms and are not charged upon a room being
|
|
133
|
+
// cleared.
|
|
134
|
+
const chargeType = getCollectibleChargeType(activeItem);
|
|
135
|
+
if (chargeType === ItemConfigChargeType.SPECIAL) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
121
139
|
const room = game.GetRoom();
|
|
122
140
|
const roomShape = room.GetRoomShape();
|
|
123
141
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CollectiblePedestalType,
|
|
3
|
+
CollectibleSpriteLayer,
|
|
3
4
|
CollectibleType,
|
|
4
5
|
EntityType,
|
|
6
|
+
ItemConfigChargeType,
|
|
5
7
|
ItemConfigTag,
|
|
6
8
|
ItemConfigTagZero,
|
|
7
9
|
ItemType,
|
|
@@ -32,8 +34,6 @@ import { clearSprite, spriteEquals } from "./sprites";
|
|
|
32
34
|
import { irange } from "./utils";
|
|
33
35
|
|
|
34
36
|
const COLLECTIBLE_ANM2_PATH = "gfx/005.100_collectible.anm2";
|
|
35
|
-
const COLLECTIBLE_SPRITE_LAYER = 1;
|
|
36
|
-
const COLLECTIBLE_SHADOW_LAYER = 4;
|
|
37
37
|
|
|
38
38
|
// Glitched items start at id 4294967295 (the final 32-bit integer) and increment backwards.
|
|
39
39
|
const GLITCHED_ITEM_THRESHOLD = 4000000000;
|
|
@@ -72,7 +72,7 @@ export function collectibleSpriteEquals(
|
|
|
72
72
|
return spriteEquals(
|
|
73
73
|
sprite1,
|
|
74
74
|
sprite2,
|
|
75
|
-
|
|
75
|
+
CollectibleSpriteLayer.HEAD,
|
|
76
76
|
xStart,
|
|
77
77
|
xFinish,
|
|
78
78
|
xIncrement,
|
|
@@ -82,6 +82,21 @@ export function collectibleSpriteEquals(
|
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Helper function to get the charge type that a collectible has. Returns
|
|
87
|
+
* `ItemConfigChargeType.NORMAL` if the provided collectible type was not valid.
|
|
88
|
+
*/
|
|
89
|
+
export function getCollectibleChargeType(
|
|
90
|
+
collectibleType: CollectibleType,
|
|
91
|
+
): ItemConfigChargeType {
|
|
92
|
+
const itemConfigItem = itemConfig.GetCollectible(collectibleType);
|
|
93
|
+
if (itemConfigItem === undefined) {
|
|
94
|
+
return ItemConfigChargeType.NORMAL;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return itemConfigItem.ChargeType;
|
|
98
|
+
}
|
|
99
|
+
|
|
85
100
|
/**
|
|
86
101
|
* Helper function to get the in-game description for a collectible. Returns "Unknown" if the
|
|
87
102
|
* provided collectible type was not valid.
|
|
@@ -482,7 +497,7 @@ export function newCollectibleSprite(collectibleType: CollectibleType): Sprite {
|
|
|
482
497
|
clearSprite(sprite);
|
|
483
498
|
|
|
484
499
|
const gfxFileName = getCollectibleGfxFilename(collectibleType);
|
|
485
|
-
sprite.ReplaceSpritesheet(
|
|
500
|
+
sprite.ReplaceSpritesheet(CollectibleSpriteLayer.HEAD, gfxFileName);
|
|
486
501
|
sprite.LoadGraphics();
|
|
487
502
|
|
|
488
503
|
return sprite;
|
|
@@ -615,9 +630,15 @@ export function setCollectibleSprite(
|
|
|
615
630
|
|
|
616
631
|
const sprite = collectible.GetSprite();
|
|
617
632
|
if (pngPath === undefined) {
|
|
618
|
-
|
|
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
|
+
);
|
|
619
640
|
} else {
|
|
620
|
-
sprite.ReplaceSpritesheet(
|
|
641
|
+
sprite.ReplaceSpritesheet(CollectibleSpriteLayer.HEAD, pngPath);
|
|
621
642
|
sprite.LoadGraphics();
|
|
622
643
|
}
|
|
623
644
|
}
|
package/src/index.ts
CHANGED
|
@@ -164,6 +164,7 @@ export * from "./maps/characterNameToTypeMap";
|
|
|
164
164
|
export * from "./maps/pillNameToEffectMap";
|
|
165
165
|
export * from "./maps/roomNameToTypeMap";
|
|
166
166
|
export * from "./objects/colors";
|
|
167
|
+
export * from "./objects/kColors";
|
|
167
168
|
export * from "./types/AnyEntity";
|
|
168
169
|
export * from "./types/AnyGridEntity";
|
|
169
170
|
export * from "./types/CollectibleIndex";
|
package/src/objects/colors.ts
CHANGED
|
@@ -13,8 +13,8 @@ export const COLORS = {
|
|
|
13
13
|
Green: Color(0, 1, 0) as Readonly<Color>,
|
|
14
14
|
Blue: Color(0, 0, 1) as Readonly<Color>,
|
|
15
15
|
Yellow: Color(1, 1, 0) as Readonly<Color>,
|
|
16
|
-
Pink: Color(1, 0, 1) as Readonly<Color>,
|
|
17
16
|
Cyan: Color(0, 1, 1) as Readonly<Color>,
|
|
17
|
+
Magenta: Color(1, 0, 1) as Readonly<Color>,
|
|
18
18
|
White: Color(1, 1, 1) as Readonly<Color>,
|
|
19
19
|
|
|
20
20
|
Brown: Color(0.588, 0.294, 0) as Readonly<Color>,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A collection of common colors that can be reused.
|
|
3
|
+
*
|
|
4
|
+
* Note that if you want to further modify these colors, you should copy them first with the
|
|
5
|
+
* `copyColor` function.
|
|
6
|
+
*
|
|
7
|
+
* The non-standard colors come from:
|
|
8
|
+
* https://htmlcolorcodes.com/color-names/
|
|
9
|
+
*/
|
|
10
|
+
export const K_COLORS = {
|
|
11
|
+
Black: KColor(0, 0, 0, 1) as Readonly<KColor>,
|
|
12
|
+
Red: KColor(1, 0, 0, 1) as Readonly<KColor>,
|
|
13
|
+
Green: KColor(0, 1, 0, 1) as Readonly<KColor>,
|
|
14
|
+
Blue: KColor(0, 0, 1, 1) as Readonly<KColor>,
|
|
15
|
+
Yellow: KColor(1, 1, 0, 1) as Readonly<KColor>,
|
|
16
|
+
Cyan: KColor(0, 1, 1, 1) as Readonly<KColor>,
|
|
17
|
+
Magenta: KColor(1, 0, 1, 1) as Readonly<KColor>,
|
|
18
|
+
White: KColor(1, 1, 1, 1) as Readonly<KColor>,
|
|
19
|
+
Transparent: KColor(0, 0, 0, 0) as Readonly<KColor>,
|
|
20
|
+
|
|
21
|
+
Brown: KColor(0.588, 0.294, 0, 1) as Readonly<KColor>,
|
|
22
|
+
Gray: KColor(0.5, 0.5, 0.5, 1) as Readonly<KColor>,
|
|
23
|
+
Orange: KColor(1, 0.647, 0, 1) as Readonly<KColor>,
|
|
24
|
+
Purple: KColor(0.5, 0, 0.5, 1) as Readonly<KColor>,
|
|
25
|
+
} as const;
|