-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathARAOI_API.lua
1091 lines (877 loc) · 36.9 KB
/
ARAOI_API.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---@diagnostic disable: missing-return
--[[
This does not contain code! It contains the definitions of the actual code!
To use this API with VSCode, go into your mod and paste this file in there
Next, go into the .luarc.json file created by `Binding of Isaac Lua API`, which I assume you are using
Add "ARAOI" into the "diagnostics.globals" list, make sure to save your change!
Now go into your mod and type "ARAOI." (without quotes)
There you go! Now you should be getting autocomplete suggestions!
If you don't, I noticed that adding the API script into the .gitignore file can mess
with API autocompletion. To fix this, simply open the API file in a new tab
Make sure to check if the user does actually have my mod installed:
if ARAOI then
-- Your code that requires ARAOI to run here!
else
error("ARAOI is not installed!")
end
Side note: DO NOT INCLUDE THIS FILE IN YOUR MOD! THE USER DOES NOT NEED IT!
]]
---@class ARAOI
ARAOI = {}
---@class CollectibleType
---@field THREED_GLASSES integer
---@field BAG_OF_HOLDING integer
---@field ETERNAL_DPLOPIA integer
---@field GLASS_DIE integer
---@field RUBIKS_CUBE integer
---@field SPELLBOOK integer
---@field WIRE_CUTTER integer
---@field BLESSINGS_PETAL integer
---@field DUALITY_HALO integer
---@field GAMBLING_CHIPS integer
---@field LUCKY_COIN integer
---@field RAINBOW_HEADBAND integer
---@field SACRIFICIAL_HEART integer
---@field VAMPIRE_CLOAK integer
---@field VOODOO_BODY integer
---@field RECYCLE integer
ARAOI.CollectibleType = {}
ARAOI.CollectibleType.NUM_COLLECTIBLES = 16
---@class TrinketType
---@field SPARE_BATTERY integer
---@field SOLVED_RUBIKS_CUBE integer
---@field INVERTED_SPADES integer
---@field BOUNTIFUL_SACK integer
ARAOI.TrinketType = {}
ARAOI.TrinketType.NUM_TRINKETS = 4
---@class Card
---@field INVERTED_FOOL integer
---@field INVERTED_MAGICIAN integer
---@field INVERTED_HIGH_PRIESTESS integer
---@field INVERTED_EMPRESS integer
---@field INVERTED_EMPEROR integer
---@field INVERTED_HERMIT integer
---@field INVERTED_HIEROPHANT integer
---@field INVERTED_LOVERS integer
---@field INVERTED_CHARIOT integer
---@field INVERTED_JUSTICE integer
---@field INVERTED_WHEEL_OF_FORTUNE integer
---@field INVERTED_STRENGTH integer
---@field INVERTED_HANGED_MAN integer
---@field INVERTED_DEATH integer
---@field INVERTED_TEMPERANCE integer
---@field INVERTED_DEVIL integer
---@field INVERTED_TOWER integer
---@field INVERTED_STARS integer
---@field INVERTED_MOON integer
---@field INVERTED_SUN integer
---@field INVERTED_JUDGEMENT integer
---@field INVERTED_WORLD integer
ARAOI.CardSubType = {}
ARAOI.CardSubType.NUM_CARDS = 22
---@class SaveDataManager
local SaveDataManager = {}
-- Function that initializes the SaveDataManager
---@param Mod ModReference
---@return self
function SaveDataManager:init(Mod)
end
-- Creates a timer that will run the callback in the amount of defined seconds
---- "But couldn't I just use Isaac.CreateTimer() instead?"
--
-- Well, yes, but this persists across saving and loading.
---@param callbackID string -- The ID of the callback to be ran
---@param time number -- Time, in seconds, after which the callback will run
---@param ... any -- Parameters to pass to the callback
function SaveDataManager:CreateTimer(callbackID, time, ...)
end
-- Creates a timer that will run the callback in the amount of defined update frames
---- "But couldn't I just use Isaac.CreateTimer() instead?"
--
-- Well, yes, but this persists across saving and loading.
---@param callbackID string -- The ID of the callback to be ran
---@param time number -- Time, in seconds, after which the callback will run
---@param ... any -- Parameters to pass to the callback
function SaveDataManager:CreateTimerInFrames(callbackID, time, ...)
end
-- Get/Set data from/to an access point
---@param access any -- Can be anywhere, as long as it's a table, like `save.RUN`
---@param point any -- What point to access from the table, for example: `"CursedObjects"`
---@param default any -- What should the default value of the access point (`save.RUN["CursedObjects"]`) be, for example: `{}`
---@param key any -- Should be a string, it will be automatically converted to one
---@param default_value any -- What should the default returned value be?
---@param value? any -- The value to set the key to, leave blank to not set the value
---@return any
function SaveDataManager:Data(access, point, default, key, default_value, value)
end
-- Get/Set data from/to an access point
---@param access any -- Can be anywhere, as long as it's a table, like `save.RUN`
---@param key any -- Should be a string, it will be automatically converted to one
---@param default any -- What should the default value of the access point (`save.RUN["CursedObjects"]`) be, for example: `{}`
---@param value? any -- The value to set the key to, leave blank to not set the value
---@return any
function SaveDataManager:Key(access, key, default, value)
end
ARAOI.SaveData = SaveDataManager
---@class EIDUtils
local EIDUtils = {}
-- Function that matches the given descObj parameters to the ones given
---@param descObj any
---@param entityType? integer -- Default: `any`
---@param entityVariant? integer -- Default: `any`
---@param entitySubtype? integer -- Default: `any`
---@return boolean
function EIDUtils.DescObjIs(descObj, entityType, entityVariant, entitySubtype)
end
-- Function that makes it easier to append Book Of Virtues synergies to items
--
-- The `Book Of Virtues` icon will be automatically appended to the description string
---@param modifier_id string
---@param to_this_item CollectibleType
---@param description string
function EIDUtils.BookOfVirtuesSynergy(modifier_id, to_this_item, description)
end
-- Function that makes it easier to append Abyss synergies to items
--
-- The `Abyss` icon will be automatically appended to the description string
---@param modifier_id string
---@param to_this_item CollectibleType
---@param description string
function EIDUtils.AbyssSynergy(modifier_id, to_this_item, description)
end
-- Function that makes it easier to append Car Battery synergies to items
--
-- The `Car Battery` icon will be automatically appended to the description string
---@param modifier_id string
---@param to_this_item CollectibleType
---@param description string
function EIDUtils.CarBatterySynergy(modifier_id, to_this_item, description)
end
-- Function that makes it easier to append a synergy description to items
---@param modifier_id string
---@param to_this_item CollectibleType
---@param if_player_has_this_item CollectibleType
---@param append_to_description string
function EIDUtils.SimpleSynergyModifier(modifier_id, to_this_item, if_player_has_this_item, append_to_description)
end
-- Function that makes it easier to append some player-based information to items
---@param modifier_id string
---@param to_this_item CollectibleType
---@param if_player_is PlayerType[]
---@param player_icon PlayerType
---@param append_to_description string
function EIDUtils.PlayerBasedModifier(modifier_id, to_this_item, if_player_is, player_icon, append_to_description)
end
-- @_param_ `changes`
--
-- _type_ `string` — Text will be appended to the description
--
-- _type_ `string[]` — Replaces index 1 with 2, 3 with 4, etc. So passing in `{" a ", " a lot ", " an ", " two "}` will replace `" a "` with `" a lot "` and `" an "` with `" two "`
--
-- _type_ `number[]` — Replaces index 1 with 2, 3 with 4, etc. So passing in `{1, 2, 0.6, 0.8}` will replace `1` with `2` and `0.6` with `0.8`
---@param id Card
---@param changes string | string[] | number[]
---@param language any?
function EIDUtils.TarotClothMetadata(id, changes, language)
end
ARAOI.EIDUtils = EIDUtils
---@class ItemUtils
local ItemUtils = {}
-- Checks if the given entity is a collectible
---@param entity Entity
---@param allowEmpty? boolean -- *Default: `false` — Should we count empty pedestals as collectibles?*
---@return boolean
function ItemUtils.IsCollectible(entity, allowEmpty)
end
-- Helper function for spawning collectibles.
-- Should feel exactly like using Isaac.Spawn() only this
-- function has an IgnoreModifiers parameter which should keep items such as Glitched Crown
-- and players like T. Isaac from affecting the item.
--
-- This works by first spawning a dummy pickup (5.42.0) and then using the Morph() function
-- to change it into the desired collectible. If we were to first spawn the collectible then T. Isaac,
-- Glitched Crown, etc. would be able to add an item to the cycle of the pedestal, which
-- would remove that item from the pool.
--
-- Basically, this function spawns the desired item, and **ONLY** the desired item.
---@param SubType CollectibleType
---@param Position? Vector *Default: `Game():GetRoom():GetCenterPos()`*
---@param Velocity? Vector *Default: `Vector.Zero`*
---@param Spawner? Entity | nil *Default: `nil`*
---@param IgnoreModifiers? boolean *Default: `false`*
---@param KeepPrice? boolean *Default: `false`*
---@param KeepSeed? boolean *Default: `false`*
---@return EntityPickup
function ItemUtils.SpawnCollectible(SubType, Position, Velocity, Spawner, IgnoreModifiers, KeepPrice, KeepSeed)
end
-- Gives a list of items as if the player had Glitched Crown, Binge Eater, Isaac's Birthright, etc.
--
-- If you plan on using this function to spawn a set amount of items then set `IgnoreModifiers` to `true`.
---@param ItemPool? ItemPoolType
---@param NumCollectibles? integer *Default: `1`*
---@param IgnoreModifiers? integer *Default: `false`*
---@param Decrease? boolean *Default: `true`*
---@param Seed? RNG *Default: `math.random(10000000000)`*
---@param DefaultItem? integer *Default: `CollectibleType.COLLECTIBLE_BREAKFAST`*
---@return CollectibleType[]
function ItemUtils.GetCollectibleCycle(ItemPool, NumCollectibles, IgnoreModifiers, Decrease, Seed, DefaultItem)
end
-- This function spawns a collectible from the given pool, and will add item cycles respecting Glitched Crown, Binge Eater, T. Isaac and Isaac's Birthright.
---@param ItemPool? ItemPoolType
---@param Position? Vector *Default: `Game():GetRoom():GetCenterPos()`*
---@param Velocity? Vector *Default: `Vector.Zero`*
---@param Spawner? Entity | nil *Default: `nil`*
---@param Decrease? boolean *Default: `true`*
---@param Seed? RNG *Default: `math.random(10000000000)`*
---@param DefaultItem? integer *Default: `CollectibleType.COLLECTIBLE_BREAKFAST`*
---@return EntityPickup
function ItemUtils.SpawnCollectibleFromPool(ItemPool, Position, Velocity, Spawner, Decrease, Seed, DefaultItem)
end
-- Returns a random pickup for you to spawn
---@param rng? RNG
---@param allowHearts? boolean -- Default: `true`
---@param allowCoins? boolean -- Default: `true`
---@param allowKeys? boolean -- Default: `true`
---@param allowBombs? boolean -- Default: `true`
---@param allowBatteries? boolean -- Default: `true`
---@param allowChests? boolean -- Default: `true`
---@param allowExtremelyRareOccurrences? boolean -- Default: `false` — Should we allow extremely rare occurrences? Like spawning Mom's Chest.
---@return PickupVariant
function ItemUtils.GetRandomPickup(rng, allowHearts, allowCoins, allowKeys, allowBombs, allowBatteries, allowChests, allowExtremelyRareOccurrences)
end
ARAOI.ItemUtils = ItemUtils
---@class MiscUtils
local MiscUtils = {}
-- This function returns true when checking for the normal item pool and its greed counterpart
---@param item_pool ItemPoolType | ItemPool
---@return boolean
function MiscUtils.isAngelItemPool(item_pool)
end
-- This function returns true when checking for the normal item pool and its greed counterpart
---@param item_pool ItemPoolType | ItemPool
---@return boolean
function MiscUtils.isBossItemPool(item_pool)
end
-- This function returns true when checking for the normal item pool and its greed counterpart
---@param item_pool ItemPoolType | ItemPool
---@return boolean
function MiscUtils.isCurseItemPool(item_pool)
end
-- This function returns true when checking for the normal item pool and its greed counterpart
---@param item_pool ItemPoolType | ItemPool
---@return boolean
function MiscUtils.isSecretItemPool(item_pool)
end
-- This function returns true when checking for the normal item pool and its greed counterpart
---@param item_pool ItemPoolType | ItemPool
function MiscUtils.isShopItemPool(item_pool)
end
-- This function returns true when checking for the normal item pool and its greed counterpart
---@param item_pool ItemPoolType | ItemPool
---@return boolean
function MiscUtils.isTreasureItemPool(item_pool)
end
-- This function returns true when checking for the normal item pool and its greed counterpart
---@param item_pool ItemPoolType | ItemPool
---@return boolean
function MiscUtils.isDevilItemPool(item_pool)
end
-- Function that converts HSL to RGB
---@param H integer -- *Number between 0 and 360*
---@param S? number -- *Default: `1` — Number between 0 and 1*
---@param L? number -- *Default: `0.5` — Number between 0 and 1*
---@return number
---@return number
---@return number
function MiscUtils.HSLtoRGB(H, S, L)
end
-- Function that linearly interpolates between 2 numbers
---@return number
function MiscUtils.Lerp(A, B, t)
end
-- Function that checks whether any reverse card is unlocked, used for Inverted Spades
---@return boolean
function MiscUtils.IsAnyReverseCardUnlocked()
end
-- Converts pennies into dimes, nickels and pennies
---@param pennies integer
---@return integer dimes
---@return integer nickels
---@return integer pennies
function MiscUtils.PenniesToCoins(pennies)
end
-- Function that drops the specified amount of pennies into dimes, nickels and pennies
---@param pennies integer
---@param position? Vector -- Default: `Game():GetRoom():FindFreePickupSpawnPosition(Game():GetRoom():GetCenterPos())`
---@param velocityMult? number -- Default: `1`
function MiscUtils.DropCompactedCoins(pennies, position, velocityMult)
end
-- This function was directly copied from [The Official API](https://wofsauge.github.io/IsaacDocs/rep/Room.html#getdevilroomchance),
-- I changed the anyPlayerHasCollectible and anyPlayerHasTrinket functions with the Repentogon functions
---@return number[] -- List where the first item is the devil chance and the second the angel chance
function MiscUtils.getDevilAngelRoomChance()
end
ARAOI.MiscUtils = MiscUtils
---@class PlayerUtils
local PlayerUtils = {}
---@class FireDirection
PlayerUtils.FireDirection = {
DOWN = 7,
LEFT = 4,
RIGHT = 5,
UP = 6,
NONE = nil
}
-- Function that modifies the player fire delay (tears stat) using the fire delay formula, which means that +1 tears up will be +1 tears up
---@param player EntityPlayer
---@param delay number
---@param respectTearCap? boolean
function PlayerUtils.AddFireDelay(player, delay, respectTearCap)
end
-- Function that returns the player's current tear delay using the fire delay formula
---@param player EntityPlayer
---@return number
function PlayerUtils.GetTearDelay(player)
end
-- Function that modifies the players range using the range formula, which means that +1 range up will be +1 range up
---@param player EntityPlayer
---@param range number
function PlayerUtils.ModifyTearRange(player, range)
end
-- Gets the approximate damage multiplier for the player using the data from the wiki
--
-- I am not confident enough to say that I did this 100% right
---@param player EntityPlayer
---@return number
function PlayerUtils.GetAproxDamageMultiplier(player)
end
-- Gets the approximate tear rate multiplier for the player using the data from the wiki
--
-- I am not confident enough to say that I did this 100% right
---@param player EntityPlayer
---@return number
function PlayerUtils.GetAproxTearRateMultiplier(player)
end
-- Tries to get the player from an EntityRef, going through every possible reference
---@param ref EntityRef
---@return EntityPlayer | nil
function PlayerUtils.FromEntityRef(ref)
end
-- Gets the player's current shooting direction
---@param player EntityPlayer
---@return FireDirection
function PlayerUtils.GetCurrentShootingDirection(player)
end
-- Returns the direction of the player's shooting direction only if it's just been triggered
---@param player EntityPlayer
---@return FireDirection
function PlayerUtils.TriggeredShooting(player)
end
-- Checks if any player is at least one of the provided player types
--
-- For checking just one type, use `PlayerManager.AnyoneIsPlayerType(PlayerType)`
---@param ... PlayerType
---@return boolean
function PlayerUtils.AnyPlayerIs(...)
end
-- Returns all the players that match the provided player types
---@param ... PlayerType
---@return EntityPlayer[]
function PlayerUtils.GetPlayersOfType(...)
end
-- Checks if the player is Eden or T. Eden
---@param player EntityPlayer
---@return boolean
function PlayerUtils.IsEden(player)
end
---@param player EntityPlayer
---@param accountForCurses boolean -- Should we account for the white fire curse and T. Jacob?
---@return boolean
function PlayerUtils.IsLost(player, accountForCurses)
end
-- Checks if the player is Keeper or T. Keeper
---@param player EntityPlayer
---@return boolean
function PlayerUtils.IsKeeper(player)
end
-- Gets the ID of the player in a reliable way that persists across closing and reopening the game
---- Will fail if other mods use the Collectible's RNG though
---@param player? EntityPlayer Default: Isaac.GetPlayer(0) — The `EntityPlayer` to get the ID for
---@param collectible? CollectibleType Default: 1 — Change this to another collectible if you want to get the ID of sub-players like Esau
---@return integer
function PlayerUtils.GetID(player, collectible)
end
-- Gets all the wisps spawned by the player, index ordered from oldest to newest.
---@param player? EntityPlayer -- The player to get the wisps from
---@param fromCollectible? CollectibleType -- Only get wisps spawned from using this collectible
---@return EntityFamiliar[]
function PlayerUtils.GetWisps(player, fromCollectible)
end
-- Gets all the locusts spawned by the player, index ordered from oldest to newest.
---@param player? EntityPlayer -- The player to get the locusts from
---@param fromCollectible? CollectibleType -- Only get locusts spawned from using this collectible
---@return EntityFamiliar[]
function PlayerUtils.GetLocusts(player, fromCollectible)
end
-- Returns a table with the amount of each collectible the player has without counting innate items.
---- This function has extra parameters for blacklisting certain items and tags.
---- Unlike `Isaac.GetPlayer():GetCollectiblesList()`, this table contains items the player ACTUALLY HAS.
---- If you only need the items without the amount, pass the result through `TableUtils.Keys()`
---@param player EntityPlayer
---@param itemTypeBlacklist? ItemType[]
---@param itemTagBlacklist? integer
---@param itemTypeWhitelist? ItemType[]
---@param itemTagWhitelist? integer
---@return table<CollectibleType, integer>
function PlayerUtils.GetCollectibleListCurated(player, itemTypeBlacklist, itemTagBlacklist, itemTypeWhitelist, itemTagWhitelist)
end
-- Returns the number of collectibles the player is holding without counting innate items.
---- This function has extra parameters for ignoring duplicates and blacklisting certain items and tags.
---@param player EntityPlayer
---@param allowDuplicates? boolean -- Default: `true`
---@param itemTypeBlacklist? ItemType[]
---@param itemTagBlacklist? integer
---@param itemTypeWhitelist? ItemType[]
---@param itemTagWhitelist? integer
---@return integer
function PlayerUtils.GetCollectibleCountCurated(player, allowDuplicates, itemTypeBlacklist, itemTagBlacklist, itemTypeWhitelist, itemTagWhitelist)
end
-- Returns a list with all the players that have the specified collectible
---@param collectibleType CollectibleType
---@return EntityPlayer[]
function PlayerUtils.GetPlayersWithCollectible(collectibleType)
end
-- Function that adds a charge to the active item
--
-- I don't like the default ways of adding a charge since I found them confusing to use
---@param player EntityPlayer -- The player who's item will get charged
---@param charge integer -- The amount of charge to add
---@param slot ActiveSlot -- The slot of the active item to charge
---@param force boolean? -- Default: `false` — Should the item be overcharged even if the player doesn't have The Battery?
---@param ignore_limit boolean? -- Default: `false` — Should the item be overcharged even past its limit?
---@param flashHUD boolean? -- Default: `false` — Should the player be notified of this recharge?
function PlayerUtils.AddActiveCharge(player, slot, charge, force, ignore_limit, flashHUD)
end
-- Function that keeps the active item's charge unchanged after item use
--
-- To be called on `ModCallbacks.MC_USE_ITEM`
---@param player EntityPlayer -- The player who's item will get freezed
---@param slot ActiveSlot? -- The slot of the active item to freeze
function PlayerUtils.FreezeActiveCharge(player, slot)
end
---@param player EntityPlayer
---@param cooldown integer -- Amount of time, in frames, that the shield should last
function PlayerUtils.AddShield(player, cooldown)
end
-- Wrapper to make Car Battery synergies easier to write
-- Calls the provided function twice:
---- First time calls it with the parameter being 0
---- Second time it calls it with the flag UseFlag.USE_CARBATTERY as a parameter if Car Battery was used, otherwise it doesn't call the function at all
--
-- You should use this function like this:
-- ```
-- ARAOI.PlayerUtils.CarBatteryWrapper(player, function (car_battery_flag)
-- player:UseActiveItem(105, car_battery_flag)
-- end)
-- ```
---@param player EntityPlayer
---@param func function
function PlayerUtils.CarBatteryWrapper(player, func)
end
ARAOI.PlayerUtils = PlayerUtils
---@class RoomUtils
local RoomUtils = {}
-- Returns a list of all GridEntities in the current room
---@return GridEntity[]
function RoomUtils.GetGridEntities()
end
-- Returns a list of all Pickups in the current room
---@return EntityPickup[]
function RoomUtils.GetPickups()
end
-- Returns the nearest enemy to the provided position
---@return Entity
function RoomUtils.GetNearestEnemy(position)
end
ARAOI.RoomUtils = RoomUtils
---@class TableUtils
local TableUtils = {}
-- Returns the index of the provided value
---@param t table
---@return integer
function TableUtils.FindFirstInstanceInTable(value, t)
end
-- Checks if the provided value is in the table
---@param t table
---@return boolean
function TableUtils.IsValueInTable(value, t)
end
-- Returns a list of all the table's keys
---@param t table
---@return table
function TableUtils.Keys(t)
end
-- Returns a list of all the table's values
---@param t table
---@return table
function TableUtils.Values(t)
end
-- Returns the keys and values of the provided table
---@param t table
---@return table, table
function TableUtils.KeysAndValues(t)
end
-- Returns a shallow copy of the table
---@param t table
---@return table
function TableUtils.ShallowCopy(t)
end
-- Returns one item random item from the table
---@param t table
---@param weights? table
---@param rng? RNG
---@return any
function TableUtils.Choice(t, weights, rng)
end
-- Splits a list into a number of other lists
---@return table[]
function TableUtils.SplitTable(t, num_sublists)
end
-- Shuffles the table in place
---@param rng? RNG
function TableUtils.ShuffleTable(t, rng)
end
-- Reverses the provided list
---@param list any[]
---@return any[]
function TableUtils.ReverseList(list)
end
ARAOI.TableUtils = TableUtils
-- Wrapper for the description reloaded callback
---@param func function
function ARAOI.EIDWrapper(func)
end
-- Calls the callback responsible for reloading the EID descriptions
function ARAOI.EIDReload()
end
---@class ModCallbacks
---@field OnReload string
---@field EIDReload string
ARAOI.ModCallbacks = {}
ARAOI.ThreeD_Glasses = {}
---@class ColorEnum
---@field NO_ITEM 0
---@field RED 1
---@field BLUE 2
---@field toggle function
ARAOI.ThreeD_Glasses.ColorEnum = {}
-- Gets/Sets the player's current color
---@param player EntityPlayer
---@param set? ColorEnum | integer
---@return ColorEnum
function ARAOI.ThreeD_Glasses.PlayerColorData(player, set)
end
-- Does the player have the 20/20 effect applied from the car battery synergy?
---@param player EntityPlayer
---@param set? boolean
---@return boolean
function ARAOI.ThreeD_Glasses.PlayerHas2020Effect(player, set)
end
ARAOI.Bag_of_Holding = {}
-- Single use items. Modded items do not need to be added as they trigger
-- the RemoveCollectible function, which will be detected automatically
---@type CollectibleType[]
ARAOI.Bag_of_Holding.SingleUseItems = {}
-- Gets the player's stored items
--
-- If `add` is set, adds the item to the player's stored items and returns them
--
-- If `removeInstead` is set, removes the item defined in `add` from the player's stored items and returns them
---@param player EntityPlayer
---@param add? CollectibleType
---@param removeInstead? boolean -- Default: `false`
---@return CollectibleType[]
function ARAOI.Bag_of_Holding.StoredItems(player, add, removeInstead)
end
-- Cycles to the next item from the player's stored items. If we reached the end, it automatically wraps around
---@param player EntityPlayer
---@return integer
function ARAOI.Bag_of_Holding.CycleItem(player)
end
-- Gets the currently selected item, returns `nil` if no item is selected
---@param player EntityPlayer
---@return CollectibleType | nil
function ARAOI.Bag_of_Holding.GetSelectedItem(player)
end
---@param player EntityPlayer
---@param set? CollectibleType
---@return CollectibleType
function ARAOI.Bag_of_Holding.LastItemUsed(player, set)
end
ARAOI.Eternal_Dplopia = {}
ARAOI.Eternal_Dplopia.Config = {
ITEM_DELETE_CHANCE = 25, -- *Default: `25` — This is the same chance as the `Eternal D6`.*
MIN_ITEM_DELETE_CHANCE = 20, -- *Default: `20` — Goes from 1/4 to 1/5 chance of deleting an item, scaling with luck.*
ITEM_DELETE_CHANCE_STEP = 5, -- *Default: `5` — Added chance for an item to getting deleted after picking up a cursed item.*
LUCK_DECREASE_DELETION_CHANCE = 1, -- *Default: `1` — By how much should 1 luck decrease the chance of an item being deleted?*
MAX_WISPS = 2, -- *Default: `2` — Maximum wisps that the item can spawn. Max: `8`, but set it to `9` to avoid deleting existing wisps. — WARNING: Setting this to 0 will throw an error!*
WISP_DELETE_CHANCE = 35 -- *Default: `35` — The chance of a wisp being deleted instead of an item.*
}
-- Checks if the collectible is cursed for the current run
--
-- If `set` is passed, it sets the collectible's cursed state to the provided boolean
---@param collectible CollectibleType
---@param set? boolean
---@return boolean
function ARAOI.Eternal_Dplopia.IsCollectibleTypeCursed(collectible, set)
end
-- Get the amount of cursed items we picked up in the current floor
--
-- If `set` is passed, it sets the amount of collectibles picked up to the provided integer
---@param set? integer
---@return integer
function ARAOI.Eternal_Dplopia.CursedPickupCountForFloor(set)
end
-- Gets the current delete chance for the provided player, calculating it based on luck and cursed pickup count for the current floor
---@param player EntityPlayer
---@return number float From 0 to 1
function ARAOI.Eternal_Dplopia.GetCollectibleDeleteChanceForPlayer(player)
end
ARAOI.Glass_Die = {}
-- Function to add modded icons to the Glass Die
--
-- Sprites added this way will be rendered in the middle of the die with an offset of `Vector(16, 16)`, which means you should place the sprite in the middle of the green cursor when creating the ANM2 file
---@param sprite Sprite
---@param pool_id ItemPoolType
---@param sprite_frame integer
---@param sprite_offset? Vector
---@param sprite_scale? integer
---@param do_initial_setup? boolean -- Default: `true` — Sets some initial sprite variables just in case. Set this to `false` if it's giving errors
function ARAOI.Glass_Die.RegisterPoolSprite(sprite, pool_id, sprite_frame, sprite_offset, sprite_scale, do_initial_setup)
end
ARAOI.Rubiks_Cube = {}
ARAOI.Rubiks_Cube.Config = {
SOLVE_CHANCE = 10 -- *Default: `10` — Chance for the item to be solved and give you the Rubik's Cube trinket.*
}
ARAOI.Spellbook = {}
ARAOI.Spellbook.Config = {
ENABLE_EID_HISTORY = true, -- *Default: `true` — Enables the External Item Descriptions history.*
MAX_EID_HISTORY = 10, -- *Default: `10` — Maximum number of items displayed on the External Item Descriptions history.*
-- If we get these items, we roll again.
-- This can be because the game just crashes, or the item just doesn't work.
REROLL_ITEMS = {
CollectibleType.COLLECTIBLE_DELIRIOUS
},
-- If you feel like an item should have a default spell that never changes, you can add it here
--
-- 1 = LEFT
--
-- 2 = UP
--
-- 3 = RIGHT
--
-- 4 = DOWN
SPELL_OVERWRITE = {
-- ["22441313"] = CollectibleType.COLLECTIBLE_DEATH_CERTIFICATE
}
}
-- Checks if the player is writing a spell
--
-- If `is_writing` is passed, sets the current state to the provided boolean
---@param player EntityPlayer
---@param is_writing? boolean
---@return boolean
function ARAOI.Spellbook.IsPlayerWritingSpell(player, is_writing)
end
-- Gets the player's currently written spell
--
-- If `spell` is passed, sets the currently written spell to the provided string
---@param player EntityPlayer
---@param spell? string
---@return string
function ARAOI.Spellbook.PlayerWrittenSpell(player, spell)
end
-- Adds a temporary item to the player, which will be deleted on the next floor
---@param player EntityPlayer
---@param item CollectibleType
---@return nil
function ARAOI.Spellbook.AddTemporaryItemToPlayer(player, item)
end
-- Removes the temporary items from the player
---@param player EntityPlayer
---@return nil
function ARAOI.Spellbook.RemoveTemporaryItemsFromPlayer(player)
end
-- Returns the known spells for use with EID
--
-- If `spell` and `item` are passed, adds them to the known spells
---@param spell string?
---@param item CollectibleType?
---@return table table -- `{{spell: str, item: CollectibleType}, ...}`
function ARAOI.Spellbook.EIDRegisteredSpells(spell, item)
end
-- Converts the passed spell into a string of EID Inline Icons
---@param spell string
---@return string
function ARAOI.Spellbook.SpellToEIDInlineArrows(spell)
end
-- Function to add overwrites from other scripts or mods more easily
---@param spell string -- The spell which, when entered, will give the specified item. `1 = LEFT`, `2 = UP`, `3 = RIGHT`, `4 = DOWN`
---@param item CollectibleType
function ARAOI.Spellbook.AddSpellOverwrite(spell, item)
end
-- Function to add an item to the blacklist from other scripts or mods more easily
---@param item CollectibleType
function ARAOI.Spellbook.AddItemToBlacklist(item)
end
ARAOI.Blessings_Petal = {}
-- Checks if the player has picked up the item in a previous run
--
-- If `set` is passed, it will set the variable to the provided boolean
---@param set? boolean
---@return boolean
function ARAOI.Blessings_Petal.HasPickedUpBlessingsPetal(set)
end
ARAOI.Duality_Halo = {}
---@type number[] -- List containing the Devil Chance and Angel Chance: `{DevilChance: number, AngelChance: number}`
ARAOI.Duality_Halo.Devil_Angel_Chances = {0, 0}
-- Sets the Devil and Angel Chances of spawning an item to the provided values
--
-- This will be updated immediately after defeating the floor's boss, so this function should only be used for testing purposes
---@param devilChance number -- Between 0 and 1
---@param angelChance number -- Between 0 and 1
function ARAOI.Duality_Halo.SetDevilAngelChances(devilChance, angelChance)
end
-- Updates the Devil and Angel Chances according to the current Devil and Angel room chances
function ARAOI.Duality_Halo.UpdateDevilAngelChances()
end
-- Spawns the collectibles according to the `Devil_Angel_Chances`
function ARAOI.Duality_Halo.SpawnCollectibles()
end
ARAOI.Gambling_Chips = {}
ARAOI.Gambling_Chips.Config = {
MAX_CHANCE = 30, -- *Default: `30` — The maximum chance for a slot to spawn.*
BASE_CHANCE = 15, -- *Default: `15` — The base chance for a slot to spawn, scales with luck using the `LUCK_MODIFIER` up uo `MAX_CHANCE`.*
LUCK_MODIFIER = 0.75, -- *Default: `0.75` — Player's luck will be multiplied by this and added to the `BASE_CHANCE`.*
COIN_CHANCE = 10, -- *Default: `10` — Chance to spawn a coin on enemy kill.*
}
-- Gets a random slot machine that is considered "gambling"
---@param rng? RNG
---@param allowSelfDamage? boolean
---@return SlotVariant
function ARAOI.Gambling_Chips.GetRandomGamblingSlot(rng, allowSelfDamage)
end
ARAOI.Lucky_Coin = {}
ARAOI.Lucky_Coin.Config = {
COIN_TIMEOUT = 120, -- *Default: `120` — The amount of time the coin will stay in the air, in update frames.*
CHANCE_PER_LUCK = 1, -- *Default: `1` — The chance per 1 luck that will be added towards doubling the damage.*
}
-- Spawn a coin for the provided player
---@param player EntityPlayer
function ARAOI.Lucky_Coin.SpawnCoin(player)
end
ARAOI.Rainbow_Headband = {}
ARAOI.Rainbow_Headband.Config = {
TIME_MODIFIER = 0, -- *Default: `0` — Time added, in seconds, when calculating the amount of time you had this item for.*
INCREASE_TRAIL_SIZE_EVERY = 25, -- *Default: `25` — Time it takes, in seconds, for the trail to get longer.*
INCREASE_TRAIL_TIMEOUT_BY = 3, -- *Default: `3` — Time added every `INCREASE_TRAIL_SIZE_EVERY`, in frames, that it takes the trail to be removed.*
CREEP_COLOR_INTERVAL_MULTIPLIER = 1, -- *Default: `1` — Multiplier for the color change of the creep, higher values means the creep will switch colors quicker.*
INSTANTLY_REMOVE_CREEP = true -- *Default: `true` — Should the creep be instantly removed? The animation of the creep disappearing does not do damage to enemies.*
}
-- Gets the frame at which the player picked up the item, returns `-1` if the player hasn't picked up the item yet
--
-- If `set` is provided
---@param player any
---@param set? any
function ARAOI.Rainbow_Headband.PickedUpTimestamp(player, set)
end
-- Calculates the creep timeout, after which it will disappear
---@param player EntityPlayer
function ARAOI.Rainbow_Headband.GetCreepTimeout(player)
end
ARAOI.Sacrificial_Heart = {}
ARAOI.Sacrificial_Heart.Config = {
BROKEN_HEARTS = 2 -- *Default: `2` — The amount of broken hearts the player will get. T. Magdalene will multiply this by 2.*
}
ARAOI.Vampire_Cloak = {}
-- Creates a bat particle that follows the player
---@param player EntityPlayer
---@param amount integer
---@param offset number
function ARAOI.Vampire_Cloak.AddBatParticles(player, amount, offset)
end