isaacscript-common 15.5.0 → 15.6.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/index.d.ts CHANGED
@@ -3794,7 +3794,7 @@ export declare const fonts: {
3794
3794
  export declare function forEach<T>(array: T[], func: (value: T, index: number, array: T[]) => void): void;
3795
3795
 
3796
3796
  declare class ForgottenSwitch extends Feature {
3797
- private isActionTriggered;
3797
+ private pressInput;
3798
3798
  /**
3799
3799
  * When used on The Forgotten, switches to The Soul. When used on The Soul, switches to The
3800
3800
  * Forgotten. This takes 1 game frame to take effect.
@@ -7121,19 +7121,20 @@ export declare enum ISCFeature {
7121
7121
  PICKUP_INDEX_CREATION = 36,
7122
7122
  PLAYER_INVENTORY = 37,
7123
7123
  PONY_DETECTION = 38,
7124
- PREVENT_CHILD_ENTITIES = 39,
7125
- PREVENT_COLLECTIBLE_ROTATION = 40,
7126
- PREVENT_GRID_ENTITY_RESPAWN = 41,
7127
- ROOM_CLEAR_FRAME = 42,
7128
- ROOM_HISTORY = 43,
7129
- RUN_IN_N_FRAMES = 44,
7130
- RUN_NEXT_ROOM = 45,
7131
- SAVE_DATA_MANAGER = 46,
7132
- SPAWN_ALT_ROCK_REWARDS = 47,
7133
- SPAWN_COLLECTIBLE = 48,
7134
- STAGE_HISTORY = 49,
7135
- START_AMBUSH = 50,
7136
- TAINTED_LAZARUS_PLAYERS = 51
7124
+ PRESS_INPUT = 39,
7125
+ PREVENT_CHILD_ENTITIES = 40,
7126
+ PREVENT_COLLECTIBLE_ROTATION = 41,
7127
+ PREVENT_GRID_ENTITY_RESPAWN = 42,
7128
+ ROOM_CLEAR_FRAME = 43,
7129
+ ROOM_HISTORY = 44,
7130
+ RUN_IN_N_FRAMES = 45,
7131
+ RUN_NEXT_ROOM = 46,
7132
+ SAVE_DATA_MANAGER = 47,
7133
+ SPAWN_ALT_ROCK_REWARDS = 48,
7134
+ SPAWN_COLLECTIBLE = 49,
7135
+ STAGE_HISTORY = 50,
7136
+ START_AMBUSH = 51,
7137
+ TAINTED_LAZARUS_PLAYERS = 52
7137
7138
  }
7138
7139
 
7139
7140
  /**
@@ -7182,6 +7183,7 @@ declare interface ISCFeatureToClass {
7182
7183
  [ISCFeature.PICKUP_INDEX_CREATION]: PickupIndexCreation;
7183
7184
  [ISCFeature.PLAYER_INVENTORY]: PlayerInventory;
7184
7185
  [ISCFeature.PONY_DETECTION]: PonyDetection;
7186
+ [ISCFeature.PRESS_INPUT]: PressInput;
7185
7187
  [ISCFeature.PREVENT_CHILD_ENTITIES]: PreventChildEntities;
7186
7188
  [ISCFeature.PREVENT_COLLECTIBLE_ROTATION]: PreventCollectibleRotation;
7187
7189
  [ISCFeature.PREVENT_GRID_ENTITY_RESPAWN]: PreventGridEntityRespawn;
@@ -10974,6 +10976,8 @@ export declare class ModUpgradedBase implements Mod {
10974
10976
  private initOptionalFeature;
10975
10977
  }
10976
10978
 
10979
+ export declare const MOVEMENT_ACTIONS_SET: ReadonlySet<ButtonAction>;
10980
+
10977
10981
  /**
10978
10982
  * Helper function to move all of the players to where they would normally go when arriving at a new
10979
10983
  * floor. (In normal mode, this is the center of the room. In Greed Mode, this is below the top
@@ -11713,6 +11717,18 @@ declare class PreItemPickup extends CustomCallback<ModCallbackCustom.PRE_ITEM_PI
11713
11717
  protected shouldFire: typeof shouldFireItemPickup;
11714
11718
  }
11715
11719
 
11720
+ declare class PressInput extends Feature {
11721
+ private isActionTriggered;
11722
+ /**
11723
+ * Helper function to press an arbitrary `ButtonAction` on the next possible input poll. In most
11724
+ * cases, this will be equivalent to if the first player pressed the corresponding input. It
11725
+ * usually takes 1 frame for the input to take effect.
11726
+ *
11727
+ * In order to use this function, you must upgrade your mod with `ISCFeature.PRESS_INPUT`.
11728
+ */
11729
+ pressInput(buttonAction: ButtonAction): void;
11730
+ }
11731
+
11716
11732
  declare class PreventChildEntities extends Feature {
11717
11733
  private postNPCInit;
11718
11734
  /**
@@ -12888,8 +12904,8 @@ declare class SaveDataManager extends Feature {
12888
12904
  *
12889
12905
  * Note that when the player uses Glowing Hourglass, the save data manager will automatically
12890
12906
  * restore any variables on a "run" or "level" object with a backup that was created when the room
12891
- * was entered. Thus, you should not have to explicitly program support for Glowing Hourglass
12892
- * into your mod features that use the save data manager. If this is undesired for your specific
12907
+ * was entered. Thus, you should not have to explicitly program support for Glowing Hourglass into
12908
+ * your mod features that use the save data manager. If this is undesired for your specific
12893
12909
  * use-case, then add a key of `__ignoreGlowingHourGlass: true` to your "run" or "level" object.
12894
12910
  *
12895
12911
  * @param key The name of the file or feature that is submitting data to be managed by the save
@@ -13428,6 +13444,8 @@ export declare function setUnseeded(): void;
13428
13444
  */
13429
13445
  export declare const sfxManager: SFXManager;
13430
13446
 
13447
+ export declare const SHOOTING_ACTIONS_SET: ReadonlySet<ButtonAction>;
13448
+
13431
13449
  declare function shouldFireCollectibleType(fireArgs: [player: EntityPlayer, collectibleType: CollectibleType], optionalArgs: [collectibleType?: CollectibleType]): boolean;
13432
13450
 
13433
13451
  declare function shouldFireGridEntity(fireArgs: [gridEntity: GridEntity] | [gridEntity: GridEntity, oldState: int, newState: int], optionalArgs: [gridEntityType?: GridEntityType, variant?: int]): boolean;
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 15.5.0
3
+ isaacscript-common 15.6.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -15479,31 +15479,33 @@ ____exports.ISCFeature.PLAYER_INVENTORY = 37
15479
15479
  ____exports.ISCFeature[____exports.ISCFeature.PLAYER_INVENTORY] = "PLAYER_INVENTORY"
15480
15480
  ____exports.ISCFeature.PONY_DETECTION = 38
15481
15481
  ____exports.ISCFeature[____exports.ISCFeature.PONY_DETECTION] = "PONY_DETECTION"
15482
- ____exports.ISCFeature.PREVENT_CHILD_ENTITIES = 39
15482
+ ____exports.ISCFeature.PRESS_INPUT = 39
15483
+ ____exports.ISCFeature[____exports.ISCFeature.PRESS_INPUT] = "PRESS_INPUT"
15484
+ ____exports.ISCFeature.PREVENT_CHILD_ENTITIES = 40
15483
15485
  ____exports.ISCFeature[____exports.ISCFeature.PREVENT_CHILD_ENTITIES] = "PREVENT_CHILD_ENTITIES"
15484
- ____exports.ISCFeature.PREVENT_COLLECTIBLE_ROTATION = 40
15486
+ ____exports.ISCFeature.PREVENT_COLLECTIBLE_ROTATION = 41
15485
15487
  ____exports.ISCFeature[____exports.ISCFeature.PREVENT_COLLECTIBLE_ROTATION] = "PREVENT_COLLECTIBLE_ROTATION"
15486
- ____exports.ISCFeature.PREVENT_GRID_ENTITY_RESPAWN = 41
15488
+ ____exports.ISCFeature.PREVENT_GRID_ENTITY_RESPAWN = 42
15487
15489
  ____exports.ISCFeature[____exports.ISCFeature.PREVENT_GRID_ENTITY_RESPAWN] = "PREVENT_GRID_ENTITY_RESPAWN"
15488
- ____exports.ISCFeature.ROOM_CLEAR_FRAME = 42
15490
+ ____exports.ISCFeature.ROOM_CLEAR_FRAME = 43
15489
15491
  ____exports.ISCFeature[____exports.ISCFeature.ROOM_CLEAR_FRAME] = "ROOM_CLEAR_FRAME"
15490
- ____exports.ISCFeature.ROOM_HISTORY = 43
15492
+ ____exports.ISCFeature.ROOM_HISTORY = 44
15491
15493
  ____exports.ISCFeature[____exports.ISCFeature.ROOM_HISTORY] = "ROOM_HISTORY"
15492
- ____exports.ISCFeature.RUN_IN_N_FRAMES = 44
15494
+ ____exports.ISCFeature.RUN_IN_N_FRAMES = 45
15493
15495
  ____exports.ISCFeature[____exports.ISCFeature.RUN_IN_N_FRAMES] = "RUN_IN_N_FRAMES"
15494
- ____exports.ISCFeature.RUN_NEXT_ROOM = 45
15496
+ ____exports.ISCFeature.RUN_NEXT_ROOM = 46
15495
15497
  ____exports.ISCFeature[____exports.ISCFeature.RUN_NEXT_ROOM] = "RUN_NEXT_ROOM"
15496
- ____exports.ISCFeature.SAVE_DATA_MANAGER = 46
15498
+ ____exports.ISCFeature.SAVE_DATA_MANAGER = 47
15497
15499
  ____exports.ISCFeature[____exports.ISCFeature.SAVE_DATA_MANAGER] = "SAVE_DATA_MANAGER"
15498
- ____exports.ISCFeature.SPAWN_ALT_ROCK_REWARDS = 47
15500
+ ____exports.ISCFeature.SPAWN_ALT_ROCK_REWARDS = 48
15499
15501
  ____exports.ISCFeature[____exports.ISCFeature.SPAWN_ALT_ROCK_REWARDS] = "SPAWN_ALT_ROCK_REWARDS"
15500
- ____exports.ISCFeature.SPAWN_COLLECTIBLE = 48
15502
+ ____exports.ISCFeature.SPAWN_COLLECTIBLE = 49
15501
15503
  ____exports.ISCFeature[____exports.ISCFeature.SPAWN_COLLECTIBLE] = "SPAWN_COLLECTIBLE"
15502
- ____exports.ISCFeature.STAGE_HISTORY = 49
15504
+ ____exports.ISCFeature.STAGE_HISTORY = 50
15503
15505
  ____exports.ISCFeature[____exports.ISCFeature.STAGE_HISTORY] = "STAGE_HISTORY"
15504
- ____exports.ISCFeature.START_AMBUSH = 50
15506
+ ____exports.ISCFeature.START_AMBUSH = 51
15505
15507
  ____exports.ISCFeature[____exports.ISCFeature.START_AMBUSH] = "START_AMBUSH"
15506
- ____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS = 51
15508
+ ____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS = 52
15507
15509
  ____exports.ISCFeature[____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS] = "TAINTED_LAZARUS_PLAYERS"
15508
15510
  return ____exports
15509
15511
  end,
@@ -34223,9 +34225,9 @@ local MODIFIER_KEYS = {
34223
34225
  Keyboard.RIGHT_SUPER
34224
34226
  }
34225
34227
  local MOVEMENT_ACTIONS = {ButtonAction.LEFT, ButtonAction.RIGHT, ButtonAction.UP, ButtonAction.DOWN}
34226
- local MOVEMENT_ACTIONS_SET = __TS__New(Set, MOVEMENT_ACTIONS)
34228
+ ____exports.MOVEMENT_ACTIONS_SET = __TS__New(Set, MOVEMENT_ACTIONS)
34227
34229
  local SHOOTING_ACTIONS = {ButtonAction.SHOOT_LEFT, ButtonAction.SHOOT_RIGHT, ButtonAction.SHOOT_UP, ButtonAction.SHOOT_DOWN}
34228
- local SHOOTING_ACTIONS_SET = __TS__New(Set, SHOOTING_ACTIONS)
34230
+ ____exports.SHOOTING_ACTIONS_SET = __TS__New(Set, SHOOTING_ACTIONS)
34229
34231
  function ____exports.controllerToString(self, controller)
34230
34232
  local key = Controller[controller]
34231
34233
  if key == nil then
@@ -34234,10 +34236,10 @@ function ____exports.controllerToString(self, controller)
34234
34236
  return trimPrefix(nil, key, "BUTTON_")
34235
34237
  end
34236
34238
  function ____exports.getMoveActions(self)
34237
- return MOVEMENT_ACTIONS_SET
34239
+ return ____exports.MOVEMENT_ACTIONS_SET
34238
34240
  end
34239
34241
  function ____exports.getShootActions(self)
34240
- return SHOOTING_ACTIONS_SET
34242
+ return ____exports.SHOOTING_ACTIONS_SET
34241
34243
  end
34242
34244
  function ____exports.isActionPressedOnAnyInput(self, buttonAction)
34243
34245
  local controllerIndexes = getEnumValues(nil, ControllerIndex)
@@ -34267,7 +34269,7 @@ function ____exports.isModifierKeyPressed(self)
34267
34269
  )
34268
34270
  end
34269
34271
  function ____exports.isMoveAction(self, buttonAction)
34270
- return MOVEMENT_ACTIONS_SET:has(buttonAction)
34272
+ return ____exports.MOVEMENT_ACTIONS_SET:has(buttonAction)
34271
34273
  end
34272
34274
  function ____exports.isMoveActionPressedOnAnyInput(self)
34273
34275
  return __TS__ArraySome(
@@ -34282,7 +34284,7 @@ function ____exports.isMoveActionTriggeredOnAnyInput(self)
34282
34284
  )
34283
34285
  end
34284
34286
  function ____exports.isShootAction(self, buttonAction)
34285
- return SHOOTING_ACTIONS_SET:has(buttonAction)
34287
+ return ____exports.SHOOTING_ACTIONS_SET:has(buttonAction)
34286
34288
  end
34287
34289
  function ____exports.isShootActionPressedOnAnyInput(self)
34288
34290
  return __TS__ArraySome(
@@ -46289,38 +46291,69 @@ end
46289
46291
  __TS__Decorate({Exported}, FlyingDetection.prototype, "hasFlyingTemporaryEffect", true)
46290
46292
  return ____exports
46291
46293
  end,
46292
- ["src.classes.features.other.ForgottenSwitch"] = function(...)
46294
+ ["src.classes.features.other.PressInput"] = function(...)
46293
46295
  local ____lualib = require("lualib_bundle")
46294
46296
  local __TS__Class = ____lualib.__TS__Class
46295
46297
  local __TS__ClassExtends = ____lualib.__TS__ClassExtends
46298
+ local Set = ____lualib.Set
46299
+ local __TS__New = ____lualib.__TS__New
46296
46300
  local __TS__Decorate = ____lualib.__TS__Decorate
46297
46301
  local ____exports = {}
46298
46302
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
46299
- local ButtonAction = ____isaac_2Dtypescript_2Ddefinitions.ButtonAction
46300
46303
  local InputHook = ____isaac_2Dtypescript_2Ddefinitions.InputHook
46301
46304
  local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
46302
46305
  local ____decorators = require("src.decorators")
46303
46306
  local Exported = ____decorators.Exported
46304
46307
  local ____Feature = require("src.classes.private.Feature")
46305
46308
  local Feature = ____Feature.Feature
46309
+ ____exports.PressInput = __TS__Class()
46310
+ local PressInput = ____exports.PressInput
46311
+ PressInput.name = "PressInput"
46312
+ __TS__ClassExtends(PressInput, Feature)
46313
+ function PressInput.prototype.____constructor(self)
46314
+ Feature.prototype.____constructor(self)
46315
+ self.v = {run = {pressButtonAction = __TS__New(Set)}}
46316
+ self.isActionTriggered = function(____, _entity, _inputHook, buttonAction)
46317
+ if not self.v.run.pressButtonAction:has(buttonAction) then
46318
+ return nil
46319
+ end
46320
+ self.v.run.pressButtonAction:delete(buttonAction)
46321
+ return true
46322
+ end
46323
+ self.callbacksUsed = {{ModCallback.INPUT_ACTION, {self.isActionTriggered, InputHook.IS_ACTION_TRIGGERED}}}
46324
+ end
46325
+ function PressInput.prototype.pressInput(self, buttonAction)
46326
+ self.v.run.pressButtonAction:add(buttonAction)
46327
+ end
46328
+ __TS__Decorate({Exported}, PressInput.prototype, "pressInput", true)
46329
+ return ____exports
46330
+ end,
46331
+ ["src.classes.features.other.ForgottenSwitch"] = function(...)
46332
+ local ____lualib = require("lualib_bundle")
46333
+ local __TS__Class = ____lualib.__TS__Class
46334
+ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
46335
+ local __TS__Decorate = ____lualib.__TS__Decorate
46336
+ local ____exports = {}
46337
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
46338
+ local ButtonAction = ____isaac_2Dtypescript_2Ddefinitions.ButtonAction
46339
+ local ____decorators = require("src.decorators")
46340
+ local Exported = ____decorators.Exported
46341
+ local ____ISCFeature = require("src.enums.ISCFeature")
46342
+ local ISCFeature = ____ISCFeature.ISCFeature
46343
+ local ____Feature = require("src.classes.private.Feature")
46344
+ local Feature = ____Feature.Feature
46306
46345
  ____exports.ForgottenSwitch = __TS__Class()
46307
46346
  local ForgottenSwitch = ____exports.ForgottenSwitch
46308
46347
  ForgottenSwitch.name = "ForgottenSwitch"
46309
46348
  __TS__ClassExtends(ForgottenSwitch, Feature)
46310
- function ForgottenSwitch.prototype.____constructor(self)
46349
+ function ForgottenSwitch.prototype.____constructor(self, pressInput)
46311
46350
  Feature.prototype.____constructor(self)
46312
46351
  self.v = {run = {shouldSwitch = false}}
46313
- self.isActionTriggered = function(____, _entity, _inputHook, buttonAction)
46314
- if buttonAction == ButtonAction.DROP and self.v.run.shouldSwitch then
46315
- self.v.run.shouldSwitch = false
46316
- return true
46317
- end
46318
- return nil
46319
- end
46320
- self.callbacksUsed = {{ModCallback.INPUT_ACTION, {self.isActionTriggered, InputHook.IS_ACTION_TRIGGERED}}}
46352
+ self.featuresUsed = {ISCFeature.PRESS_INPUT}
46353
+ self.pressInput = pressInput
46321
46354
  end
46322
46355
  function ForgottenSwitch.prototype.forgottenSwitch(self)
46323
- self.v.run.shouldSwitch = true
46356
+ self.pressInput:pressInput(ButtonAction.DROP)
46324
46357
  end
46325
46358
  __TS__Decorate({Exported}, ForgottenSwitch.prototype, "forgottenSwitch", true)
46326
46359
  return ____exports
@@ -48438,6 +48471,8 @@ local ____PlayerInventory = require("src.classes.features.other.PlayerInventory"
48438
48471
  local PlayerInventory = ____PlayerInventory.PlayerInventory
48439
48472
  local ____PonyDetection = require("src.classes.features.other.PonyDetection")
48440
48473
  local PonyDetection = ____PonyDetection.PonyDetection
48474
+ local ____PressInput = require("src.classes.features.other.PressInput")
48475
+ local PressInput = ____PressInput.PressInput
48441
48476
  local ____PreventChildEntities = require("src.classes.features.other.PreventChildEntities")
48442
48477
  local PreventChildEntities = ____PreventChildEntities.PreventChildEntities
48443
48478
  local ____PreventCollectibleRotation = require("src.classes.features.other.PreventCollectibleRotation")
@@ -48484,6 +48519,7 @@ function ____exports.getFeatures(self, mod, callbacks)
48484
48519
  local disableInputs = __TS__New(DisableInputs)
48485
48520
  local moddedElementDetection = __TS__New(ModdedElementDetection)
48486
48521
  local ponyDetection = __TS__New(PonyDetection)
48522
+ local pressInput = __TS__New(PressInput)
48487
48523
  local preventCollectibleRotation = __TS__New(PreventCollectibleRotation)
48488
48524
  local roomClearFrame = __TS__New(RoomClearFrame)
48489
48525
  local roomHistory = __TS__New(RoomHistory)
@@ -48566,7 +48602,7 @@ function ____exports.getFeatures(self, mod, callbacks)
48566
48602
  [ISCFeature.FADE_IN_REMOVER] = __TS__New(FadeInRemover),
48567
48603
  [ISCFeature.FAST_RESET] = __TS__New(FastReset),
48568
48604
  [ISCFeature.FLYING_DETECTION] = __TS__New(FlyingDetection, moddedElementSets),
48569
- [ISCFeature.FORGOTTEN_SWITCH] = __TS__New(ForgottenSwitch),
48605
+ [ISCFeature.FORGOTTEN_SWITCH] = __TS__New(ForgottenSwitch, pressInput),
48570
48606
  [ISCFeature.EXTRA_CONSOLE_COMMANDS] = __TS__New(ExtraConsoleCommands),
48571
48607
  [ISCFeature.ITEM_POOL_DETECTION] = itemPoolDetection,
48572
48608
  [ISCFeature.MODDED_ELEMENT_DETECTION] = moddedElementDetection,
@@ -48577,6 +48613,7 @@ function ____exports.getFeatures(self, mod, callbacks)
48577
48613
  [ISCFeature.PICKUP_INDEX_CREATION] = pickupIndexCreation,
48578
48614
  [ISCFeature.PLAYER_INVENTORY] = __TS__New(PlayerInventory),
48579
48615
  [ISCFeature.PONY_DETECTION] = ponyDetection,
48616
+ [ISCFeature.PRESS_INPUT] = pressInput,
48580
48617
  [ISCFeature.PREVENT_CHILD_ENTITIES] = __TS__New(PreventChildEntities),
48581
48618
  [ISCFeature.PREVENT_COLLECTIBLE_ROTATION] = preventCollectibleRotation,
48582
48619
  [ISCFeature.PREVENT_GRID_ENTITY_RESPAWN] = preventGridEntityRespawn,
@@ -1,6 +1,6 @@
1
1
  import { Feature } from "../../private/Feature";
2
2
  export declare class ForgottenSwitch extends Feature {
3
- private isActionTriggered;
3
+ private pressInput;
4
4
  /**
5
5
  * When used on The Forgotten, switches to The Soul. When used on The Soul, switches to The
6
6
  * Forgotten. This takes 1 game frame to take effect.
@@ -1 +1 @@
1
- {"version":3,"file":"ForgottenSwitch.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ForgottenSwitch.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,qBAAa,eAAgB,SAAQ,OAAO;IAsB1C,OAAO,CAAC,iBAAiB,CAWvB;IAEF;;;;;OAKG;IAEI,eAAe,IAAI,IAAI;CAG/B"}
1
+ {"version":3,"file":"ForgottenSwitch.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ForgottenSwitch.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGhD,qBAAa,eAAgB,SAAQ,OAAO;IAQ1C,OAAO,CAAC,UAAU,CAAa;IAW/B;;;;;OAKG;IAEI,eAAe,IAAI,IAAI;CAG/B"}
@@ -5,30 +5,24 @@ local __TS__Decorate = ____lualib.__TS__Decorate
5
5
  local ____exports = {}
6
6
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
7
  local ButtonAction = ____isaac_2Dtypescript_2Ddefinitions.ButtonAction
8
- local InputHook = ____isaac_2Dtypescript_2Ddefinitions.InputHook
9
- local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
10
8
  local ____decorators = require("src.decorators")
11
9
  local Exported = ____decorators.Exported
10
+ local ____ISCFeature = require("src.enums.ISCFeature")
11
+ local ISCFeature = ____ISCFeature.ISCFeature
12
12
  local ____Feature = require("src.classes.private.Feature")
13
13
  local Feature = ____Feature.Feature
14
14
  ____exports.ForgottenSwitch = __TS__Class()
15
15
  local ForgottenSwitch = ____exports.ForgottenSwitch
16
16
  ForgottenSwitch.name = "ForgottenSwitch"
17
17
  __TS__ClassExtends(ForgottenSwitch, Feature)
18
- function ForgottenSwitch.prototype.____constructor(self)
18
+ function ForgottenSwitch.prototype.____constructor(self, pressInput)
19
19
  Feature.prototype.____constructor(self)
20
20
  self.v = {run = {shouldSwitch = false}}
21
- self.isActionTriggered = function(____, _entity, _inputHook, buttonAction)
22
- if buttonAction == ButtonAction.DROP and self.v.run.shouldSwitch then
23
- self.v.run.shouldSwitch = false
24
- return true
25
- end
26
- return nil
27
- end
28
- self.callbacksUsed = {{ModCallback.INPUT_ACTION, {self.isActionTriggered, InputHook.IS_ACTION_TRIGGERED}}}
21
+ self.featuresUsed = {ISCFeature.PRESS_INPUT}
22
+ self.pressInput = pressInput
29
23
  end
30
24
  function ForgottenSwitch.prototype.forgottenSwitch(self)
31
- self.v.run.shouldSwitch = true
25
+ self.pressInput:pressInput(ButtonAction.DROP)
32
26
  end
33
27
  __TS__Decorate({Exported}, ForgottenSwitch.prototype, "forgottenSwitch", true)
34
28
  return ____exports
@@ -0,0 +1,14 @@
1
+ import { ButtonAction } from "isaac-typescript-definitions";
2
+ import { Feature } from "../../private/Feature";
3
+ export declare class PressInput extends Feature {
4
+ private isActionTriggered;
5
+ /**
6
+ * Helper function to press an arbitrary `ButtonAction` on the next possible input poll. In most
7
+ * cases, this will be equivalent to if the first player pressed the corresponding input. It
8
+ * usually takes 1 frame for the input to take effect.
9
+ *
10
+ * In order to use this function, you must upgrade your mod with `ISCFeature.PRESS_INPUT`.
11
+ */
12
+ pressInput(buttonAction: ButtonAction): void;
13
+ }
14
+ //# sourceMappingURL=PressInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PressInput.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PressInput.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,qBAAa,UAAW,SAAQ,OAAO;IAsBrC,OAAO,CAAC,iBAAiB,CAWvB;IAEF;;;;;;OAMG;IAEI,UAAU,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;CAGpD"}
@@ -0,0 +1,35 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__Class = ____lualib.__TS__Class
3
+ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
4
+ local Set = ____lualib.Set
5
+ local __TS__New = ____lualib.__TS__New
6
+ local __TS__Decorate = ____lualib.__TS__Decorate
7
+ local ____exports = {}
8
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
9
+ local InputHook = ____isaac_2Dtypescript_2Ddefinitions.InputHook
10
+ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
11
+ local ____decorators = require("src.decorators")
12
+ local Exported = ____decorators.Exported
13
+ local ____Feature = require("src.classes.private.Feature")
14
+ local Feature = ____Feature.Feature
15
+ ____exports.PressInput = __TS__Class()
16
+ local PressInput = ____exports.PressInput
17
+ PressInput.name = "PressInput"
18
+ __TS__ClassExtends(PressInput, Feature)
19
+ function PressInput.prototype.____constructor(self)
20
+ Feature.prototype.____constructor(self)
21
+ self.v = {run = {pressButtonAction = __TS__New(Set)}}
22
+ self.isActionTriggered = function(____, _entity, _inputHook, buttonAction)
23
+ if not self.v.run.pressButtonAction:has(buttonAction) then
24
+ return nil
25
+ end
26
+ self.v.run.pressButtonAction:delete(buttonAction)
27
+ return true
28
+ end
29
+ self.callbacksUsed = {{ModCallback.INPUT_ACTION, {self.isActionTriggered, InputHook.IS_ACTION_TRIGGERED}}}
30
+ end
31
+ function PressInput.prototype.pressInput(self, buttonAction)
32
+ self.v.run.pressButtonAction:add(buttonAction)
33
+ end
34
+ __TS__Decorate({Exported}, PressInput.prototype, "pressInput", true)
35
+ return ____exports
@@ -123,8 +123,8 @@ export declare class SaveDataManager extends Feature {
123
123
  *
124
124
  * Note that when the player uses Glowing Hourglass, the save data manager will automatically
125
125
  * restore any variables on a "run" or "level" object with a backup that was created when the room
126
- * was entered. Thus, you should not have to explicitly program support for Glowing Hourglass
127
- * into your mod features that use the save data manager. If this is undesired for your specific
126
+ * was entered. Thus, you should not have to explicitly program support for Glowing Hourglass into
127
+ * your mod features that use the save data manager. If this is undesired for your specific
128
128
  * use-case, then add a key of `__ignoreGlowingHourGlass: true` to your "run" or "level" object.
129
129
  *
130
130
  * @param key The name of the file or feature that is submitting data to be managed by the save
@@ -38,18 +38,19 @@ export declare enum ISCFeature {
38
38
  PICKUP_INDEX_CREATION = 36,
39
39
  PLAYER_INVENTORY = 37,
40
40
  PONY_DETECTION = 38,
41
- PREVENT_CHILD_ENTITIES = 39,
42
- PREVENT_COLLECTIBLE_ROTATION = 40,
43
- PREVENT_GRID_ENTITY_RESPAWN = 41,
44
- ROOM_CLEAR_FRAME = 42,
45
- ROOM_HISTORY = 43,
46
- RUN_IN_N_FRAMES = 44,
47
- RUN_NEXT_ROOM = 45,
48
- SAVE_DATA_MANAGER = 46,
49
- SPAWN_ALT_ROCK_REWARDS = 47,
50
- SPAWN_COLLECTIBLE = 48,
51
- STAGE_HISTORY = 49,
52
- START_AMBUSH = 50,
53
- TAINTED_LAZARUS_PLAYERS = 51
41
+ PRESS_INPUT = 39,
42
+ PREVENT_CHILD_ENTITIES = 40,
43
+ PREVENT_COLLECTIBLE_ROTATION = 41,
44
+ PREVENT_GRID_ENTITY_RESPAWN = 42,
45
+ ROOM_CLEAR_FRAME = 43,
46
+ ROOM_HISTORY = 44,
47
+ RUN_IN_N_FRAMES = 45,
48
+ RUN_NEXT_ROOM = 46,
49
+ SAVE_DATA_MANAGER = 47,
50
+ SPAWN_ALT_ROCK_REWARDS = 48,
51
+ SPAWN_COLLECTIBLE = 49,
52
+ STAGE_HISTORY = 50,
53
+ START_AMBUSH = 51,
54
+ TAINTED_LAZARUS_PLAYERS = 52
54
55
  }
55
56
  //# sourceMappingURL=ISCFeature.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ISCFeature.d.ts","sourceRoot":"","sources":["../../../src/enums/ISCFeature.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IAEpB,aAAa,IAAA;IACb,iBAAiB,IAAA;IACjB,cAAc,IAAA;IACd,+BAA+B,IAAA;IAC/B,4BAA4B,IAAA;IAC5B,4BAA4B,IAAA;IAC5B,wBAAwB,IAAA;IACxB,qBAAqB,IAAA;IACrB,4BAA4B,IAAA;IAC5B,0BAA0B,IAAA;IAC1B,qBAAqB,KAAA;IACrB,qBAAqB,KAAA;IAGrB,2BAA2B,KAAA;IAC3B,eAAe,KAAA;IACf,0BAA0B,KAAA;IAC1B,oBAAoB,KAAA;IACpB,iBAAiB,KAAA;IACjB,cAAc,KAAA;IACd,cAAc,KAAA;IACd,aAAa,KAAA;IACb,gBAAgB,KAAA;IAChB,aAAa,KAAA;IACb,gBAAgB,KAAA;IAChB,iBAAiB,KAAA;IACjB,cAAc,KAAA;IACd,eAAe,KAAA;IACf,UAAU,KAAA;IACV,gBAAgB,KAAA;IAChB,gBAAgB,KAAA;IAChB,sBAAsB,KAAA;IACtB,mBAAmB,KAAA;IACnB,wBAAwB,KAAA;IACxB,mBAAmB,KAAA;IACnB,cAAc,KAAA;IACd,KAAK,KAAA;IACL,mBAAmB,KAAA;IACnB,qBAAqB,KAAA;IACrB,gBAAgB,KAAA;IAChB,cAAc,KAAA;IACd,sBAAsB,KAAA;IACtB,4BAA4B,KAAA;IAC5B,2BAA2B,KAAA;IAC3B,gBAAgB,KAAA;IAChB,YAAY,KAAA;IACZ,eAAe,KAAA;IACf,aAAa,KAAA;IACb,iBAAiB,KAAA;IACjB,sBAAsB,KAAA;IACtB,iBAAiB,KAAA;IACjB,aAAa,KAAA;IACb,YAAY,KAAA;IACZ,uBAAuB,KAAA;CACxB"}
1
+ {"version":3,"file":"ISCFeature.d.ts","sourceRoot":"","sources":["../../../src/enums/ISCFeature.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IAEpB,aAAa,IAAA;IACb,iBAAiB,IAAA;IACjB,cAAc,IAAA;IACd,+BAA+B,IAAA;IAC/B,4BAA4B,IAAA;IAC5B,4BAA4B,IAAA;IAC5B,wBAAwB,IAAA;IACxB,qBAAqB,IAAA;IACrB,4BAA4B,IAAA;IAC5B,0BAA0B,IAAA;IAC1B,qBAAqB,KAAA;IACrB,qBAAqB,KAAA;IAGrB,2BAA2B,KAAA;IAC3B,eAAe,KAAA;IACf,0BAA0B,KAAA;IAC1B,oBAAoB,KAAA;IACpB,iBAAiB,KAAA;IACjB,cAAc,KAAA;IACd,cAAc,KAAA;IACd,aAAa,KAAA;IACb,gBAAgB,KAAA;IAChB,aAAa,KAAA;IACb,gBAAgB,KAAA;IAChB,iBAAiB,KAAA;IACjB,cAAc,KAAA;IACd,eAAe,KAAA;IACf,UAAU,KAAA;IACV,gBAAgB,KAAA;IAChB,gBAAgB,KAAA;IAChB,sBAAsB,KAAA;IACtB,mBAAmB,KAAA;IACnB,wBAAwB,KAAA;IACxB,mBAAmB,KAAA;IACnB,cAAc,KAAA;IACd,KAAK,KAAA;IACL,mBAAmB,KAAA;IACnB,qBAAqB,KAAA;IACrB,gBAAgB,KAAA;IAChB,cAAc,KAAA;IACd,WAAW,KAAA;IACX,sBAAsB,KAAA;IACtB,4BAA4B,KAAA;IAC5B,2BAA2B,KAAA;IAC3B,gBAAgB,KAAA;IAChB,YAAY,KAAA;IACZ,eAAe,KAAA;IACf,aAAa,KAAA;IACb,iBAAiB,KAAA;IACjB,sBAAsB,KAAA;IACtB,iBAAiB,KAAA;IACjB,aAAa,KAAA;IACb,YAAY,KAAA;IACZ,uBAAuB,KAAA;CACxB"}
@@ -78,30 +78,32 @@ ____exports.ISCFeature.PLAYER_INVENTORY = 37
78
78
  ____exports.ISCFeature[____exports.ISCFeature.PLAYER_INVENTORY] = "PLAYER_INVENTORY"
79
79
  ____exports.ISCFeature.PONY_DETECTION = 38
80
80
  ____exports.ISCFeature[____exports.ISCFeature.PONY_DETECTION] = "PONY_DETECTION"
81
- ____exports.ISCFeature.PREVENT_CHILD_ENTITIES = 39
81
+ ____exports.ISCFeature.PRESS_INPUT = 39
82
+ ____exports.ISCFeature[____exports.ISCFeature.PRESS_INPUT] = "PRESS_INPUT"
83
+ ____exports.ISCFeature.PREVENT_CHILD_ENTITIES = 40
82
84
  ____exports.ISCFeature[____exports.ISCFeature.PREVENT_CHILD_ENTITIES] = "PREVENT_CHILD_ENTITIES"
83
- ____exports.ISCFeature.PREVENT_COLLECTIBLE_ROTATION = 40
85
+ ____exports.ISCFeature.PREVENT_COLLECTIBLE_ROTATION = 41
84
86
  ____exports.ISCFeature[____exports.ISCFeature.PREVENT_COLLECTIBLE_ROTATION] = "PREVENT_COLLECTIBLE_ROTATION"
85
- ____exports.ISCFeature.PREVENT_GRID_ENTITY_RESPAWN = 41
87
+ ____exports.ISCFeature.PREVENT_GRID_ENTITY_RESPAWN = 42
86
88
  ____exports.ISCFeature[____exports.ISCFeature.PREVENT_GRID_ENTITY_RESPAWN] = "PREVENT_GRID_ENTITY_RESPAWN"
87
- ____exports.ISCFeature.ROOM_CLEAR_FRAME = 42
89
+ ____exports.ISCFeature.ROOM_CLEAR_FRAME = 43
88
90
  ____exports.ISCFeature[____exports.ISCFeature.ROOM_CLEAR_FRAME] = "ROOM_CLEAR_FRAME"
89
- ____exports.ISCFeature.ROOM_HISTORY = 43
91
+ ____exports.ISCFeature.ROOM_HISTORY = 44
90
92
  ____exports.ISCFeature[____exports.ISCFeature.ROOM_HISTORY] = "ROOM_HISTORY"
91
- ____exports.ISCFeature.RUN_IN_N_FRAMES = 44
93
+ ____exports.ISCFeature.RUN_IN_N_FRAMES = 45
92
94
  ____exports.ISCFeature[____exports.ISCFeature.RUN_IN_N_FRAMES] = "RUN_IN_N_FRAMES"
93
- ____exports.ISCFeature.RUN_NEXT_ROOM = 45
95
+ ____exports.ISCFeature.RUN_NEXT_ROOM = 46
94
96
  ____exports.ISCFeature[____exports.ISCFeature.RUN_NEXT_ROOM] = "RUN_NEXT_ROOM"
95
- ____exports.ISCFeature.SAVE_DATA_MANAGER = 46
97
+ ____exports.ISCFeature.SAVE_DATA_MANAGER = 47
96
98
  ____exports.ISCFeature[____exports.ISCFeature.SAVE_DATA_MANAGER] = "SAVE_DATA_MANAGER"
97
- ____exports.ISCFeature.SPAWN_ALT_ROCK_REWARDS = 47
99
+ ____exports.ISCFeature.SPAWN_ALT_ROCK_REWARDS = 48
98
100
  ____exports.ISCFeature[____exports.ISCFeature.SPAWN_ALT_ROCK_REWARDS] = "SPAWN_ALT_ROCK_REWARDS"
99
- ____exports.ISCFeature.SPAWN_COLLECTIBLE = 48
101
+ ____exports.ISCFeature.SPAWN_COLLECTIBLE = 49
100
102
  ____exports.ISCFeature[____exports.ISCFeature.SPAWN_COLLECTIBLE] = "SPAWN_COLLECTIBLE"
101
- ____exports.ISCFeature.STAGE_HISTORY = 49
103
+ ____exports.ISCFeature.STAGE_HISTORY = 50
102
104
  ____exports.ISCFeature[____exports.ISCFeature.STAGE_HISTORY] = "STAGE_HISTORY"
103
- ____exports.ISCFeature.START_AMBUSH = 50
105
+ ____exports.ISCFeature.START_AMBUSH = 51
104
106
  ____exports.ISCFeature[____exports.ISCFeature.START_AMBUSH] = "START_AMBUSH"
105
- ____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS = 51
107
+ ____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS = 52
106
108
  ____exports.ISCFeature[____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS] = "TAINTED_LAZARUS_PLAYERS"
107
109
  return ____exports
@@ -38,6 +38,7 @@ import { PersistentEntities } from "./classes/features/other/PersistentEntities"
38
38
  import { PickupIndexCreation } from "./classes/features/other/PickupIndexCreation";
39
39
  import { PlayerInventory } from "./classes/features/other/PlayerInventory";
40
40
  import { PonyDetection } from "./classes/features/other/PonyDetection";
41
+ import { PressInput } from "./classes/features/other/PressInput";
41
42
  import { PreventChildEntities } from "./classes/features/other/PreventChildEntities";
42
43
  import { PreventCollectibleRotation } from "./classes/features/other/PreventCollectibleRotation";
43
44
  import { PreventGridEntityRespawn } from "./classes/features/other/PreventGridEntityRespawn";
@@ -93,6 +94,7 @@ export interface ISCFeatureToClass {
93
94
  [ISCFeature.PICKUP_INDEX_CREATION]: PickupIndexCreation;
94
95
  [ISCFeature.PLAYER_INVENTORY]: PlayerInventory;
95
96
  [ISCFeature.PONY_DETECTION]: PonyDetection;
97
+ [ISCFeature.PRESS_INPUT]: PressInput;
96
98
  [ISCFeature.PREVENT_CHILD_ENTITIES]: PreventChildEntities;
97
99
  [ISCFeature.PREVENT_COLLECTIBLE_ROTATION]: PreventCollectibleRotation;
98
100
  [ISCFeature.PREVENT_GRID_ENTITY_RESPAWN]: PreventGridEntityRespawn;
@@ -147,18 +149,19 @@ export declare function getFeatures(mod: ModUpgradedInterface, callbacks: ModCal
147
149
  readonly 36: PickupIndexCreation;
148
150
  readonly 37: PlayerInventory;
149
151
  readonly 38: PonyDetection;
150
- readonly 39: PreventChildEntities;
151
- readonly 40: PreventCollectibleRotation;
152
- readonly 41: PreventGridEntityRespawn;
153
- readonly 42: RoomClearFrame;
154
- readonly 43: RoomHistory;
155
- readonly 44: RunInNFrames;
156
- readonly 45: RunNextRoom;
157
- readonly 46: SaveDataManager;
158
- readonly 47: SpawnRockAltRewards;
159
- readonly 48: SpawnCollectible;
160
- readonly 49: StageHistory;
161
- readonly 50: StartAmbush;
162
- readonly 51: TaintedLazarusPlayers;
152
+ readonly 39: PressInput;
153
+ readonly 40: PreventChildEntities;
154
+ readonly 41: PreventCollectibleRotation;
155
+ readonly 42: PreventGridEntityRespawn;
156
+ readonly 43: RoomClearFrame;
157
+ readonly 44: RoomHistory;
158
+ readonly 45: RunInNFrames;
159
+ readonly 46: RunNextRoom;
160
+ readonly 47: SaveDataManager;
161
+ readonly 48: SpawnRockAltRewards;
162
+ readonly 49: SpawnCollectible;
163
+ readonly 50: StageHistory;
164
+ readonly 51: StartAmbush;
165
+ readonly 52: TaintedLazarusPlayers;
163
166
  };
164
167
  //# sourceMappingURL=features.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/features.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,gDAAgD,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,yDAAyD,CAAC;AACjG,OAAO,EAAE,4BAA4B,EAAE,MAAM,+DAA+D,CAAC;AAC7G,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AACvG,OAAO,EAAE,yBAAyB,EAAE,MAAM,4DAA4D,CAAC;AACvG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAC;AACzG,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAC;AACrG,OAAO,EAAE,mBAAmB,E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AAU,CAAC,iBAAiB,CAAC,EAAE,eAAe,CAAC;IAChD,CAAC,UAAU,CAAC,sBAAsB,CAAC,EAAE,mBAAmB,CAAC;IACzD,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;IACjD,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC;IACzC,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC;IACvC,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE,qBAAqB,CAAC;CAC7D;AAKD,wBAAgB,WAAW,CACzB,GAAG,EAAE,oBAAoB,EACzB,SAAS,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiKpC"}
@@ -79,6 +79,8 @@ local ____PlayerInventory = require("src.classes.features.other.PlayerInventory"
79
79
  local PlayerInventory = ____PlayerInventory.PlayerInventory
80
80
  local ____PonyDetection = require("src.classes.features.other.PonyDetection")
81
81
  local PonyDetection = ____PonyDetection.PonyDetection
82
+ local ____PressInput = require("src.classes.features.other.PressInput")
83
+ local PressInput = ____PressInput.PressInput
82
84
  local ____PreventChildEntities = require("src.classes.features.other.PreventChildEntities")
83
85
  local PreventChildEntities = ____PreventChildEntities.PreventChildEntities
84
86
  local ____PreventCollectibleRotation = require("src.classes.features.other.PreventCollectibleRotation")
@@ -125,6 +127,7 @@ function ____exports.getFeatures(self, mod, callbacks)
125
127
  local disableInputs = __TS__New(DisableInputs)
126
128
  local moddedElementDetection = __TS__New(ModdedElementDetection)
127
129
  local ponyDetection = __TS__New(PonyDetection)
130
+ local pressInput = __TS__New(PressInput)
128
131
  local preventCollectibleRotation = __TS__New(PreventCollectibleRotation)
129
132
  local roomClearFrame = __TS__New(RoomClearFrame)
130
133
  local roomHistory = __TS__New(RoomHistory)
@@ -207,7 +210,7 @@ function ____exports.getFeatures(self, mod, callbacks)
207
210
  [ISCFeature.FADE_IN_REMOVER] = __TS__New(FadeInRemover),
208
211
  [ISCFeature.FAST_RESET] = __TS__New(FastReset),
209
212
  [ISCFeature.FLYING_DETECTION] = __TS__New(FlyingDetection, moddedElementSets),
210
- [ISCFeature.FORGOTTEN_SWITCH] = __TS__New(ForgottenSwitch),
213
+ [ISCFeature.FORGOTTEN_SWITCH] = __TS__New(ForgottenSwitch, pressInput),
211
214
  [ISCFeature.EXTRA_CONSOLE_COMMANDS] = __TS__New(ExtraConsoleCommands),
212
215
  [ISCFeature.ITEM_POOL_DETECTION] = itemPoolDetection,
213
216
  [ISCFeature.MODDED_ELEMENT_DETECTION] = moddedElementDetection,
@@ -218,6 +221,7 @@ function ____exports.getFeatures(self, mod, callbacks)
218
221
  [ISCFeature.PICKUP_INDEX_CREATION] = pickupIndexCreation,
219
222
  [ISCFeature.PLAYER_INVENTORY] = __TS__New(PlayerInventory),
220
223
  [ISCFeature.PONY_DETECTION] = ponyDetection,
224
+ [ISCFeature.PRESS_INPUT] = pressInput,
221
225
  [ISCFeature.PREVENT_CHILD_ENTITIES] = __TS__New(PreventChildEntities),
222
226
  [ISCFeature.PREVENT_COLLECTIBLE_ROTATION] = preventCollectibleRotation,
223
227
  [ISCFeature.PREVENT_GRID_ENTITY_RESPAWN] = preventGridEntityRespawn,
@@ -1,4 +1,6 @@
1
1
  import { ButtonAction, Controller, Keyboard } from "isaac-typescript-definitions";
2
+ export declare const MOVEMENT_ACTIONS_SET: ReadonlySet<ButtonAction>;
3
+ export declare const SHOOTING_ACTIONS_SET: ReadonlySet<ButtonAction>;
2
4
  /**
3
5
  * Helper function to get the enum name for the specified `Controller` value. Note that this will
4
6
  * trim off the "BUTTON_" prefix.
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/functions/input.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EAEV,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAsCtC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,E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CAO7E;AAED,wBAAgB,cAAc,IAAI,WAAW,CAAC,YAAY,CAAC,CAE1D;AAED,wBAAgB,eAAe,IAAI,WAAW,CAAC,YAAY,CAAC,CAE3D;AAED,gGAAgG;AAChG,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAK7E;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,YAAY,GACzB,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,CAI9D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAEhE;AAED,wBAAgB,6BAA6B,IAAI,OAAO,CAIvD;AAED,wBAAgB,+BAA+B,IAAI,OAAO,CAIzD;AAED,wBAAgB,aAAa,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAEjE;AAED,wBAAgB,8BAA8B,IAAI,OAAO,CAIxD;AAED,wBAAgB,gCAAgC,IAAI,OAAO,CAI1D;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,OAAO,GACjB,MAAM,GAAG,SAAS,CAQpB"}
@@ -25,9 +25,9 @@ local MODIFIER_KEYS = {
25
25
  Keyboard.RIGHT_SUPER
26
26
  }
27
27
  local MOVEMENT_ACTIONS = {ButtonAction.LEFT, ButtonAction.RIGHT, ButtonAction.UP, ButtonAction.DOWN}
28
- local MOVEMENT_ACTIONS_SET = __TS__New(Set, MOVEMENT_ACTIONS)
28
+ ____exports.MOVEMENT_ACTIONS_SET = __TS__New(Set, MOVEMENT_ACTIONS)
29
29
  local SHOOTING_ACTIONS = {ButtonAction.SHOOT_LEFT, ButtonAction.SHOOT_RIGHT, ButtonAction.SHOOT_UP, ButtonAction.SHOOT_DOWN}
30
- local SHOOTING_ACTIONS_SET = __TS__New(Set, SHOOTING_ACTIONS)
30
+ ____exports.SHOOTING_ACTIONS_SET = __TS__New(Set, SHOOTING_ACTIONS)
31
31
  --- Helper function to get the enum name for the specified `Controller` value. Note that this will
32
32
  -- trim off the "BUTTON_" prefix.
33
33
  function ____exports.controllerToString(self, controller)
@@ -38,10 +38,10 @@ function ____exports.controllerToString(self, controller)
38
38
  return trimPrefix(nil, key, "BUTTON_")
39
39
  end
40
40
  function ____exports.getMoveActions(self)
41
- return MOVEMENT_ACTIONS_SET
41
+ return ____exports.MOVEMENT_ACTIONS_SET
42
42
  end
43
43
  function ____exports.getShootActions(self)
44
- return SHOOTING_ACTIONS_SET
44
+ return ____exports.SHOOTING_ACTIONS_SET
45
45
  end
46
46
  --- Iterates over all inputs to determine if a particular button is pressed (i.e. held down).
47
47
  function ____exports.isActionPressedOnAnyInput(self, buttonAction)
@@ -81,7 +81,7 @@ function ____exports.isModifierKeyPressed(self)
81
81
  )
82
82
  end
83
83
  function ____exports.isMoveAction(self, buttonAction)
84
- return MOVEMENT_ACTIONS_SET:has(buttonAction)
84
+ return ____exports.MOVEMENT_ACTIONS_SET:has(buttonAction)
85
85
  end
86
86
  function ____exports.isMoveActionPressedOnAnyInput(self)
87
87
  return __TS__ArraySome(
@@ -96,7 +96,7 @@ function ____exports.isMoveActionTriggeredOnAnyInput(self)
96
96
  )
97
97
  end
98
98
  function ____exports.isShootAction(self, buttonAction)
99
- return SHOOTING_ACTIONS_SET:has(buttonAction)
99
+ return ____exports.SHOOTING_ACTIONS_SET:has(buttonAction)
100
100
  end
101
101
  function ____exports.isShootActionPressedOnAnyInput(self)
102
102
  return __TS__ArraySome(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "15.5.0",
3
+ "version": "15.6.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -1,10 +1,8 @@
1
- import {
2
- ButtonAction,
3
- InputHook,
4
- ModCallback,
5
- } from "isaac-typescript-definitions";
1
+ import { ButtonAction } from "isaac-typescript-definitions";
6
2
  import { Exported } from "../../../decorators";
3
+ import { ISCFeature } from "../../../enums/ISCFeature";
7
4
  import { Feature } from "../../private/Feature";
5
+ import { PressInput } from "./PressInput";
8
6
 
9
7
  export class ForgottenSwitch extends Feature {
10
8
  /** @internal */
@@ -14,32 +12,16 @@ export class ForgottenSwitch extends Feature {
14
12
  },
15
13
  };
16
14
 
15
+ private pressInput: PressInput;
16
+
17
17
  /** @internal */
18
- constructor() {
18
+ constructor(pressInput: PressInput) {
19
19
  super();
20
20
 
21
- this.callbacksUsed = [
22
- [
23
- ModCallback.INPUT_ACTION,
24
- [this.isActionTriggered, InputHook.IS_ACTION_TRIGGERED],
25
- ], // 13
26
- ];
27
- }
28
-
29
- // ModCallback.INPUT_ACTION (13)
30
- // InputHook.IS_ACTION_TRIGGERED (1)
31
- private isActionTriggered = (
32
- _entity: Entity | undefined,
33
- _inputHook: InputHook,
34
- buttonAction: ButtonAction,
35
- ) => {
36
- if (buttonAction === ButtonAction.DROP && this.v.run.shouldSwitch) {
37
- this.v.run.shouldSwitch = false;
38
- return true;
39
- }
21
+ this.featuresUsed = [ISCFeature.PRESS_INPUT];
40
22
 
41
- return undefined;
42
- };
23
+ this.pressInput = pressInput;
24
+ }
43
25
 
44
26
  /**
45
27
  * When used on The Forgotten, switches to The Soul. When used on The Soul, switches to The
@@ -49,6 +31,6 @@ export class ForgottenSwitch extends Feature {
49
31
  */
50
32
  @Exported
51
33
  public forgottenSwitch(): void {
52
- this.v.run.shouldSwitch = true;
34
+ this.pressInput.pressInput(ButtonAction.DROP);
53
35
  }
54
36
  }
@@ -0,0 +1,55 @@
1
+ import {
2
+ ButtonAction,
3
+ InputHook,
4
+ ModCallback,
5
+ } from "isaac-typescript-definitions";
6
+ import { Exported } from "../../../decorators";
7
+ import { Feature } from "../../private/Feature";
8
+
9
+ export class PressInput extends Feature {
10
+ /** @internal */
11
+ public override v = {
12
+ run: {
13
+ pressButtonAction: new Set(),
14
+ },
15
+ };
16
+
17
+ /** @internal */
18
+ constructor() {
19
+ super();
20
+
21
+ this.callbacksUsed = [
22
+ [
23
+ ModCallback.INPUT_ACTION,
24
+ [this.isActionTriggered, InputHook.IS_ACTION_TRIGGERED],
25
+ ], // 13
26
+ ];
27
+ }
28
+
29
+ // ModCallback.INPUT_ACTION (13)
30
+ // InputHook.IS_ACTION_TRIGGERED (1)
31
+ private isActionTriggered = (
32
+ _entity: Entity | undefined,
33
+ _inputHook: InputHook,
34
+ buttonAction: ButtonAction,
35
+ ) => {
36
+ if (!this.v.run.pressButtonAction.has(buttonAction)) {
37
+ return undefined;
38
+ }
39
+
40
+ this.v.run.pressButtonAction.delete(buttonAction);
41
+ return true;
42
+ };
43
+
44
+ /**
45
+ * Helper function to press an arbitrary `ButtonAction` on the next possible input poll. In most
46
+ * cases, this will be equivalent to if the first player pressed the corresponding input. It
47
+ * usually takes 1 frame for the input to take effect.
48
+ *
49
+ * In order to use this function, you must upgrade your mod with `ISCFeature.PRESS_INPUT`.
50
+ */
51
+ @Exported
52
+ public pressInput(buttonAction: ButtonAction): void {
53
+ this.v.run.pressButtonAction.add(buttonAction);
54
+ }
55
+ }
@@ -279,8 +279,8 @@ export class SaveDataManager extends Feature {
279
279
  *
280
280
  * Note that when the player uses Glowing Hourglass, the save data manager will automatically
281
281
  * restore any variables on a "run" or "level" object with a backup that was created when the room
282
- * was entered. Thus, you should not have to explicitly program support for Glowing Hourglass
283
- * into your mod features that use the save data manager. If this is undesired for your specific
282
+ * was entered. Thus, you should not have to explicitly program support for Glowing Hourglass into
283
+ * your mod features that use the save data manager. If this is undesired for your specific
284
284
  * use-case, then add a key of `__ignoreGlowingHourGlass: true` to your "run" or "level" object.
285
285
  *
286
286
  * @param key The name of the file or feature that is submitting data to be managed by the save
@@ -41,6 +41,7 @@ export enum ISCFeature {
41
41
  PICKUP_INDEX_CREATION,
42
42
  PLAYER_INVENTORY,
43
43
  PONY_DETECTION,
44
+ PRESS_INPUT,
44
45
  PREVENT_CHILD_ENTITIES,
45
46
  PREVENT_COLLECTIBLE_ROTATION,
46
47
  PREVENT_GRID_ENTITY_RESPAWN,
package/src/features.ts CHANGED
@@ -38,6 +38,7 @@ import { PersistentEntities } from "./classes/features/other/PersistentEntities"
38
38
  import { PickupIndexCreation } from "./classes/features/other/PickupIndexCreation";
39
39
  import { PlayerInventory } from "./classes/features/other/PlayerInventory";
40
40
  import { PonyDetection } from "./classes/features/other/PonyDetection";
41
+ import { PressInput } from "./classes/features/other/PressInput";
41
42
  import { PreventChildEntities } from "./classes/features/other/PreventChildEntities";
42
43
  import { PreventCollectibleRotation } from "./classes/features/other/PreventCollectibleRotation";
43
44
  import { PreventGridEntityRespawn } from "./classes/features/other/PreventGridEntityRespawn";
@@ -102,6 +103,7 @@ export interface ISCFeatureToClass {
102
103
  [ISCFeature.PICKUP_INDEX_CREATION]: PickupIndexCreation;
103
104
  [ISCFeature.PLAYER_INVENTORY]: PlayerInventory;
104
105
  [ISCFeature.PONY_DETECTION]: PonyDetection;
106
+ [ISCFeature.PRESS_INPUT]: PressInput;
105
107
  [ISCFeature.PREVENT_CHILD_ENTITIES]: PreventChildEntities;
106
108
  [ISCFeature.PREVENT_COLLECTIBLE_ROTATION]: PreventCollectibleRotation;
107
109
  [ISCFeature.PREVENT_GRID_ENTITY_RESPAWN]: PreventGridEntityRespawn;
@@ -136,6 +138,7 @@ export function getFeatures(
136
138
  const disableInputs = new DisableInputs();
137
139
  const moddedElementDetection = new ModdedElementDetection();
138
140
  const ponyDetection = new PonyDetection();
141
+ const pressInput = new PressInput();
139
142
  const preventCollectibleRotation = new PreventCollectibleRotation();
140
143
  const roomClearFrame = new RoomClearFrame();
141
144
  const roomHistory = new RoomHistory();
@@ -254,7 +257,7 @@ export function getFeatures(
254
257
  [ISCFeature.FADE_IN_REMOVER]: new FadeInRemover(),
255
258
  [ISCFeature.FAST_RESET]: new FastReset(),
256
259
  [ISCFeature.FLYING_DETECTION]: new FlyingDetection(moddedElementSets),
257
- [ISCFeature.FORGOTTEN_SWITCH]: new ForgottenSwitch(),
260
+ [ISCFeature.FORGOTTEN_SWITCH]: new ForgottenSwitch(pressInput),
258
261
  [ISCFeature.EXTRA_CONSOLE_COMMANDS]: new ExtraConsoleCommands(),
259
262
  [ISCFeature.ITEM_POOL_DETECTION]: itemPoolDetection,
260
263
  [ISCFeature.MODDED_ELEMENT_DETECTION]: moddedElementDetection,
@@ -265,6 +268,7 @@ export function getFeatures(
265
268
  [ISCFeature.PICKUP_INDEX_CREATION]: pickupIndexCreation,
266
269
  [ISCFeature.PLAYER_INVENTORY]: new PlayerInventory(),
267
270
  [ISCFeature.PONY_DETECTION]: ponyDetection,
271
+ [ISCFeature.PRESS_INPUT]: pressInput,
268
272
  [ISCFeature.PREVENT_CHILD_ENTITIES]: new PreventChildEntities(),
269
273
  [ISCFeature.PREVENT_COLLECTIBLE_ROTATION]: preventCollectibleRotation,
270
274
  [ISCFeature.PREVENT_GRID_ENTITY_RESPAWN]: preventGridEntityRespawn,
@@ -26,7 +26,7 @@ const MOVEMENT_ACTIONS: readonly ButtonAction[] = [
26
26
  ButtonAction.DOWN, // 3
27
27
  ];
28
28
 
29
- const MOVEMENT_ACTIONS_SET: ReadonlySet<ButtonAction> = new Set(
29
+ export const MOVEMENT_ACTIONS_SET: ReadonlySet<ButtonAction> = new Set(
30
30
  MOVEMENT_ACTIONS,
31
31
  );
32
32
 
@@ -37,7 +37,7 @@ const SHOOTING_ACTIONS: readonly ButtonAction[] = [
37
37
  ButtonAction.SHOOT_DOWN, // 7
38
38
  ];
39
39
 
40
- const SHOOTING_ACTIONS_SET: ReadonlySet<ButtonAction> = new Set(
40
+ export const SHOOTING_ACTIONS_SET: ReadonlySet<ButtonAction> = new Set(
41
41
  SHOOTING_ACTIONS,
42
42
  );
43
43