isaacscript-common 1.0.597 → 1.0.598
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/constants.d.ts +1 -0
- package/dist/constants.lua +15 -0
- package/dist/functions/entity.d.ts +6 -0
- package/dist/functions/entity.lua +5 -0
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -105,6 +105,7 @@ export declare const MOVEMENT_ACTIONS: Set<ButtonAction>;
|
|
|
105
105
|
export declare const ONE_BY_ONE_ROOM_GRID_SIZE = 135;
|
|
106
106
|
export declare const SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES: Set<CollectibleType>;
|
|
107
107
|
export declare const SHOOTING_ACTIONS: Set<ButtonAction>;
|
|
108
|
+
export declare const STORY_BOSSES: Set<EntityType>;
|
|
108
109
|
/**
|
|
109
110
|
* This is the number of draw coordinates that each heart spans on the UI in the upper left hand
|
|
110
111
|
* corner.
|
package/dist/constants.lua
CHANGED
|
@@ -98,5 +98,20 @@ ____exports.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES = __TS__New(Set, {
|
|
|
98
98
|
CollectibleType.COLLECTIBLE_R_KEY
|
|
99
99
|
})
|
|
100
100
|
____exports.SHOOTING_ACTIONS = __TS__New(Set, {ButtonAction.ACTION_SHOOTLEFT, ButtonAction.ACTION_SHOOTRIGHT, ButtonAction.ACTION_SHOOTUP, ButtonAction.ACTION_SHOOTDOWN})
|
|
101
|
+
____exports.STORY_BOSSES = __TS__New(Set, {
|
|
102
|
+
EntityType.ENTITY_MOM,
|
|
103
|
+
EntityType.ENTITY_MOMS_HEART,
|
|
104
|
+
EntityType.ENTITY_SATAN,
|
|
105
|
+
EntityType.ENTITY_ISAAC,
|
|
106
|
+
EntityType.ENTITY_THE_LAMB,
|
|
107
|
+
EntityType.ENTITY_MEGA_SATAN,
|
|
108
|
+
EntityType.ENTITY_MEGA_SATAN_2,
|
|
109
|
+
EntityType.ENTITY_ULTRA_GREED,
|
|
110
|
+
EntityType.ENTITY_HUSH,
|
|
111
|
+
EntityType.ENTITY_DELIRIUM,
|
|
112
|
+
EntityType.ENTITY_MOTHER,
|
|
113
|
+
EntityType.ENTITY_DOGMA,
|
|
114
|
+
EntityType.ENTITY_BEAST
|
|
115
|
+
})
|
|
101
116
|
____exports.UI_HEART_WIDTH = 12
|
|
102
117
|
return ____exports
|
|
@@ -165,6 +165,12 @@ export declare function getTears(matchingVariant?: number, matchingSubType?: num
|
|
|
165
165
|
* @param threshold Optional. The threshold from 0 to consider to be moving. 0.01 by default.
|
|
166
166
|
*/
|
|
167
167
|
export declare function isEntityMoving(entity: Entity, threshold?: number): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Helper function to determine if the current entity is an end-game story boss, like Isaac, Blue
|
|
170
|
+
* Baby, Mega Satan, The Beast, and so on. This is useful because certain effects should only apply
|
|
171
|
+
* to non-story bosses, like Vanishing Twin. Also see the `STORY_BOSSES` constant.
|
|
172
|
+
*/
|
|
173
|
+
export declare function isStoryBoss(entity: Entity): boolean;
|
|
168
174
|
/**
|
|
169
175
|
* Helper function to remove all of the entities in the supplied array.
|
|
170
176
|
*
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
require("lualib_bundle");
|
|
3
3
|
local ____exports = {}
|
|
4
|
+
local ____constants = require("constants")
|
|
5
|
+
local STORY_BOSSES = ____constants.STORY_BOSSES
|
|
4
6
|
local ____random = require("functions.random")
|
|
5
7
|
local getRandom = ____random.getRandom
|
|
6
8
|
local nextSeed = ____random.nextSeed
|
|
@@ -230,6 +232,9 @@ function ____exports.isEntityMoving(self, entity, threshold)
|
|
|
230
232
|
end
|
|
231
233
|
return entity.Velocity:Length() >= threshold
|
|
232
234
|
end
|
|
235
|
+
function ____exports.isStoryBoss(self, entity)
|
|
236
|
+
return STORY_BOSSES:has(entity.Type)
|
|
237
|
+
end
|
|
233
238
|
function ____exports.removeEntities(self, entities, cap)
|
|
234
239
|
if #entities == 0 then
|
|
235
240
|
return false
|