isaacscript-common 9.9.0 → 9.10.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/functions/npcs.d.ts +6 -0
- package/dist/functions/npcs.d.ts.map +1 -1
- package/dist/functions/npcs.lua +10 -0
- package/dist/index.d.ts +7 -0
- package/package.json +1 -1
- package/src/functions/npcs.ts +19 -0
package/dist/functions/npcs.d.ts
CHANGED
|
@@ -28,6 +28,12 @@ export declare function isAliveExceptionNPC(npc: EntityNPC): boolean;
|
|
|
28
28
|
* the way to tell them apart is to check for a non-undefined `Entity.SpawnerEntity` field.
|
|
29
29
|
*/
|
|
30
30
|
export declare function isDaddyLongLegsChildStompEntity(npc: EntityNPC): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Helper function to detect the custom death state of a Dump. When Dumps die, they go to
|
|
33
|
+
* `NpcState.SPECIAL`, spit out their head, and then slowly fade away while shooting a burst of
|
|
34
|
+
* tears.
|
|
35
|
+
*/
|
|
36
|
+
export declare function isDyingDump(npc: EntityNPC): boolean;
|
|
31
37
|
/**
|
|
32
38
|
* Helper function to detect the custom death state of an Eggy. Eggies are never actually marked
|
|
33
39
|
* dead by the game. Instead, when Eggies take fatal damage, they go into NpcState.STATE_SUICIDE and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"npcs.d.ts","sourceRoot":"","sources":["../../src/functions/npcs.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"npcs.d.ts","sourceRoot":"","sources":["../../src/functions/npcs.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,UAAU,EASX,MAAM,8BAA8B,CAAC;AAgCtC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,UAAU,GAAE,UAAe,EAC3B,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAiC3D;AAED;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAIvE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAMnD;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAOpE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAO3D"}
|
package/dist/functions/npcs.lua
CHANGED
|
@@ -11,6 +11,7 @@ local ChargerSubType = ____isaac_2Dtypescript_2Ddefinitions.ChargerSubType
|
|
|
11
11
|
local ChargerVariant = ____isaac_2Dtypescript_2Ddefinitions.ChargerVariant
|
|
12
12
|
local DarkEsauVariant = ____isaac_2Dtypescript_2Ddefinitions.DarkEsauVariant
|
|
13
13
|
local DeathVariant = ____isaac_2Dtypescript_2Ddefinitions.DeathVariant
|
|
14
|
+
local DumpVariant = ____isaac_2Dtypescript_2Ddefinitions.DumpVariant
|
|
14
15
|
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
15
16
|
local HopperVariant = ____isaac_2Dtypescript_2Ddefinitions.HopperVariant
|
|
16
17
|
local MamaGurdyVariant = ____isaac_2Dtypescript_2Ddefinitions.MamaGurdyVariant
|
|
@@ -46,6 +47,9 @@ function ____exports.isAliveExceptionNPC(self, npc)
|
|
|
46
47
|
if ____exports.isRaglingDeathPatch(nil, npc) then
|
|
47
48
|
return true
|
|
48
49
|
end
|
|
50
|
+
if ____exports.isDyingDump(nil, npc) then
|
|
51
|
+
return true
|
|
52
|
+
end
|
|
49
53
|
return false
|
|
50
54
|
end
|
|
51
55
|
--- Helper function to distinguish between a normal Daddy Long Legs / Triachnid and the child entity
|
|
@@ -57,6 +61,12 @@ end
|
|
|
57
61
|
function ____exports.isDaddyLongLegsChildStompEntity(self, npc)
|
|
58
62
|
return npc.Type == EntityType.DADDY_LONG_LEGS and npc.SpawnerEntity ~= nil
|
|
59
63
|
end
|
|
64
|
+
--- Helper function to detect the custom death state of a Dump. When Dumps die, they go to
|
|
65
|
+
-- `NpcState.SPECIAL`, spit out their head, and then slowly fade away while shooting a burst of
|
|
66
|
+
-- tears.
|
|
67
|
+
function ____exports.isDyingDump(self, npc)
|
|
68
|
+
return npc.Type == EntityType.DUMP and npc.Variant == asNumber(nil, DumpVariant.DUMP) and npc.State == NpcState.SPECIAL
|
|
69
|
+
end
|
|
60
70
|
--- Helper function to detect the custom death state of an Eggy. Eggies are never actually marked
|
|
61
71
|
-- dead by the game. Instead, when Eggies take fatal damage, they go into NpcState.STATE_SUICIDE and
|
|
62
72
|
-- spawn 14 Swarm Spiders while their StateFrame ticks upwards.
|
package/dist/index.d.ts
CHANGED
|
@@ -5785,6 +5785,13 @@ export declare function isDoorToMines(door: GridEntityDoor): boolean;
|
|
|
5785
5785
|
*/
|
|
5786
5786
|
export declare function isDoorToMomsHeart(door: GridEntityDoor): boolean;
|
|
5787
5787
|
|
|
5788
|
+
/**
|
|
5789
|
+
* Helper function to detect the custom death state of a Dump. When Dumps die, they go to
|
|
5790
|
+
* `NpcState.SPECIAL`, spit out their head, and then slowly fade away while shooting a burst of
|
|
5791
|
+
* tears.
|
|
5792
|
+
*/
|
|
5793
|
+
export declare function isDyingDump(npc: EntityNPC): boolean;
|
|
5794
|
+
|
|
5788
5795
|
/**
|
|
5789
5796
|
* Helper function to detect the custom death state of an Eggy. Eggies are never actually marked
|
|
5790
5797
|
* dead by the game. Instead, when Eggies take fatal damage, they go into NpcState.STATE_SUICIDE and
|
package/package.json
CHANGED
package/src/functions/npcs.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
ChargerVariant,
|
|
6
6
|
DarkEsauVariant,
|
|
7
7
|
DeathVariant,
|
|
8
|
+
DumpVariant,
|
|
8
9
|
EntityType,
|
|
9
10
|
HopperVariant,
|
|
10
11
|
MamaGurdyVariant,
|
|
@@ -101,6 +102,11 @@ export function isAliveExceptionNPC(npc: EntityNPC): boolean {
|
|
|
101
102
|
return true;
|
|
102
103
|
}
|
|
103
104
|
|
|
105
|
+
// EntityType.DUMP (876)
|
|
106
|
+
if (isDyingDump(npc)) {
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
|
|
104
110
|
return false;
|
|
105
111
|
}
|
|
106
112
|
|
|
@@ -118,6 +124,19 @@ export function isDaddyLongLegsChildStompEntity(npc: EntityNPC): boolean {
|
|
|
118
124
|
);
|
|
119
125
|
}
|
|
120
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Helper function to detect the custom death state of a Dump. When Dumps die, they go to
|
|
129
|
+
* `NpcState.SPECIAL`, spit out their head, and then slowly fade away while shooting a burst of
|
|
130
|
+
* tears.
|
|
131
|
+
*/
|
|
132
|
+
export function isDyingDump(npc: EntityNPC): boolean {
|
|
133
|
+
return (
|
|
134
|
+
npc.Type === EntityType.DUMP &&
|
|
135
|
+
npc.Variant === asNumber(DumpVariant.DUMP) &&
|
|
136
|
+
npc.State === NpcState.SPECIAL
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
121
140
|
/**
|
|
122
141
|
* Helper function to detect the custom death state of an Eggy. Eggies are never actually marked
|
|
123
142
|
* dead by the game. Instead, when Eggies take fatal damage, they go into NpcState.STATE_SUICIDE and
|