forked from Laraz39/RepentancePlus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
2496 lines (2184 loc) · 116 KB
/
main.lua
File metadata and controls
2496 lines (2184 loc) · 116 KB
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
----------------------------------------------------------------------------------------------
-- Welcome to main.lua, please make yourself comfortable while reading all of this bullshit --
-- Popcorn 100g: $5 350g: $10 ----------------------------------------------------------------
-- Nachos 100g, any dip: $6 --------------------- For Saver menus, allergens, other food -----
-- Soft-Drink, any 0.5l: $4 1l: $6 -------------- and further questions please ask our ------
-- Water, sparkling or still 0.5l: $2 1l: $3 ------------------ staff -----------------------
-- Beer 0.33l: $3 ------------------------------------------ Enjoy the show! -----------------
----------------------------------------------------------------------------------------------
----- VARIABLES -----
---------------------
local game = Game()
local rplus = RegisterMod("repentanceplus", 1)
local sfx = SFXManager()
local music = MusicManager()
local CustomData
local json = require("json")
--[[ for displaying achievement papers
achievement = Sprite()
achievement:Load("gfx/ui/achievement/achievements.anm2", true)
--]]
-- used for rendering sprites on the floor/walls
CustomBackDropEntity = Isaac.GetEntityVariantByName("CustomBackDropEntity")
local BASEMENTKEY_CHANCE = 5 -- chance to replace golden chest with the old chest
local HEARTKEY_CHANCE = 5 -- chance for enemy to drop Scarlet chest on death
local CARDRUNE_REPLACE_CHANCE = 2 -- chance to replace vanilla card with card from our mod
local SUPERBERSERKSTATE_CHANCE = 25 -- chance to enter berserk state via Temper Tantrum
local SUPERBERSERK_DELETE_CHANCE = 7 -- chance to erase enemies while in this state
local TRASHBAG_BREAK_CHANCE = 1 -- chance of Bag o' Trash breaking
local CHERRY_SPAWN_CHANCE = 20 -- chance to spawn cherry friend on enemy death
local SLEIGHTOFHAND_UPGRADECHANCE = 17 -- chance to upgrade your coins via Sleight of Hand
local JACKOF_CHANCE = 60 -- chance for Jack cards to spawn their respective type of pickup
local TRICKPENNY_CHANCE = 17 -- chance to save your consumable when using it via Trick Penny
local ENRAGED_SOUL_COOLDOWN = 420 -- 7 seconds in 60 FPS callback; cooldown for Enraged Soul familiar
local CEREM_DAGGER_LAUNCH_CHANCE = 5 -- chance to launch a dagger
local NIGHT_SOIL_CHANCE = 40 -- chance to negate curse
Costumes = {
-- add ONLY NON-PERSISTENT COSTUMES here, because persistent costumes work without lua
ORDLIFE = Isaac.GetCostumeIdByPath("gfx/characters/costume_001_ordinarylife.anm2"),
BIRDOFHOPE = Isaac.GetCostumeIdByPath("gfx/characters/costume_004_birdofhope.anm2")
}
TearVariants = {
CEREMDAGGER = Isaac.GetEntityVariantByName("Ceremonial Dagger Tear")
}
Familiars = {
BAGOTRASH = Isaac.GetEntityVariantByName("Bag O' Trash"),
ZENBABY = Isaac.GetEntityVariantByName("Zen Baby"),
CHERRY = Isaac.GetEntityVariantByName("Cherry"),
BIRD = Isaac.GetEntityVariantByName("Bird of Hope"),
SOUL = Isaac.GetEntityVariantByName("Enraged Soul"),
TOYTANK1 = Isaac.GetEntityVariantByName("Toy Tank 1"),
TOYTANK2 = Isaac.GetEntityVariantByName("Toy Tank 2"),
}
Collectibles = {
ORDLIFE = Isaac.GetItemIdByName("Ordinary Life"),
COOKIECUTTER = Isaac.GetItemIdByName("Cookie Cutter"),
RUBIKSCUBE = Isaac.GetItemIdByName("Rubik's Cube"),
MAGICCUBE = Isaac.GetItemIdByName("Magic Cube"),
MAGICPEN = Isaac.GetItemIdByName("Magic Pen"),
SINNERSHEART = Isaac.GetItemIdByName("Sinner's Heart"),
MARKCAIN = Isaac.GetItemIdByName("The Mark of Cain"),
BAGOTRASH = Isaac.GetItemIdByName("Bag-o-Trash"),
TEMPERTANTRUM = Isaac.GetItemIdByName("Temper Tantrum"),
CHERRYFRIENDS = Isaac.GetItemIdByName("Cherry Friends"),
ZENBABY = Isaac.GetItemIdByName("Zen Baby"),
BLACKDOLL = Isaac.GetItemIdByName("Black Doll"),
BIRDOFHOPE = Isaac.GetItemIdByName("A Bird of Hope"),
ENRAGEDSOUL = Isaac.GetItemIdByName("Enraged Soul"),
CEREMDAGGER = Isaac.GetItemIdByName("Ceremonial Blade"), -- LIMITED SECONDARY PLAYERS FUNCTIONALITY
CEILINGSTARS = Isaac.GetItemIdByName("Ceiling With the Stars"),
QUASAR = Isaac.GetItemIdByName("Quasar"),
TWOPLUSONE = Isaac.GetItemIdByName("2+1"),
REDMAP = Isaac.GetItemIdByName("Red Map"),
CHEESEGRATER = Isaac.GetItemIdByName("Cheese Grater"), -- MINOR COMPATIBILITY ISSUES
DNAREDACTOR = Isaac.GetItemIdByName("DNA Redactor"),
TOWEROFBABEL = Isaac.GetItemIdByName("Tower of Babel"),
BLESSOTDEAD = Isaac.GetItemIdByName("Bless of the Dead"),
TOYTANKS = Isaac.GetItemIdByName("Tank Boys")
CAT = Isaac.GetItemIdByName("Cat in A Box")
}
Trinkets = {
BASEMENTKEY = Isaac.GetTrinketIdByName("Basement Key"),
KEYTOTHEHEART = Isaac.GetTrinketIdByName("Key to the Heart"),
TRICKPENNY = Isaac.GetTrinketIdByName("Trick Penny"),
JUDASKISS = Isaac.GetTrinketIdByName("Judas' Kiss"), -- MINOR COMPATIBILITY ISSUES
SLEIGHTOFHAND = Isaac.GetTrinketIdByName("Sleight of Hand"),
GREEDSHEART = Isaac.GetTrinketIdByName("Greed's Heart"), -- MINOR COMPATIBILITY ISSUES
ANGELSCROWN = Isaac.GetTrinketIdByName("Angel's Crown"),
CHALKPIECE = Isaac.GetTrinketIdByName("A Piece of Chalk"),
MAGICSWORD = Isaac.GetTrinketIdByName("Magic Sword"), -- MINOR COMPATIBILITY ISSUES
WAITNO = Isaac.GetTrinketIdByName("Wait, No!"),
EDENSLOCK = Isaac.GetTrinketIdByName("Eden's Lock"), -- MINOR COMPATIBILITY ISSUES
ADAMSRIB = Isaac.GetTrinketIdByName("Adam's Rib"), -- MINOR COMPATIBILITY ISSUES
NIGHTSOIL = Isaac.GetTrinketIdByName("Night Soil")
}
PocketItems = {
RJOKER = Isaac.GetCardIdByName("Joker?"),
SDDSHARD = Isaac.GetCardIdByName("Spindown Dice Shard"),
REVERSECARD = Isaac.GetCardIdByName("Reverse Card"),
REDRUNE = Isaac.GetCardIdByName("Red Rune"),
KINGOFSPADES = Isaac.GetCardIdByName("King of Spades"),
KINGOFCLUBS = Isaac.GetCardIdByName("King of Clubs"),
KINGOFDIAMONDS = Isaac.GetCardIdByName("King of Diamonds"),
NEEDLEANDTHREAD = Isaac.GetCardIdByName("Needle and Thread"),
QUEENOFDIAMONDS = Isaac.GetCardIdByName("Queen of Diamonds"),
QUEENOFCLUBS = Isaac.GetCardIdByName("Queen of Clubs"),
BAGTISSUE = Isaac.GetCardIdByName("Bag Tissue"),
LOADEDDICE = Isaac.GetCardIdByName("Loaded Dice"),
JACKOFDIAMONDS = Isaac.GetCardIdByName("Jack of Diamonds"),
JACKOFCLUBS = Isaac.GetCardIdByName("Jack of Clubs"),
JACKOFSPADES = Isaac.GetCardIdByName("Jack of Spades"),
JACKOFHEARTS = Isaac.GetCardIdByName("Jack of Hearts"),
BEDSIDEQUEEN = Isaac.GetCardIdByName("Bedside Queen"),
QUASARSHARD = Isaac.GetCardIdByName("Quasar Shard"),
BUSINESSCARD = Isaac.GetCardIdByName("Business Card"),
SACBLOOD = Isaac.GetCardIdByName("Sacrificial Blood"), -- MINOR COMPATIBILITY ISSUES
FLYPAPER = Isaac.GetCardIdByName("Flypaper"),
LIBRARYCARD = Isaac.GetCardIdByName("Library Card")
}
PickUps = {
SCARLETCHEST = Isaac.GetEntityVariantByName("Scarlet Chest")
}
Pills = {
ESTROGEN = Isaac.GetPillEffectByName("Estrogen Up"),
LAXATIVE = Isaac.GetPillEffectByName("Laxative")
}
--[[
local Unlocks = {
["21"] = { --T.Isaac
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = 300, SubType = PocketItems.REVERSECARD},
["Satan"] = {Unlocked = false, Type = 5, Variant = 100, SubType = Collectibles.ORDLIFE},
["Isaac"] = {Unlocked = false, Type = 5, Variant = nil, SubType = Collectibles.RUBIKSCUBE},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = nil, SubType = Trinkets.BASEMENTKEY},
["Greed"] = {Unlocked = false, Type = 5, Variant = 300, SubType = PocketItems.SDDSHARD}
},
["22"] = { --T.Maggy
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = 300, SubType = PocketItems.QUEENOFDIAMONDS},
["Satan"] = {Unlocked = false, Type = 5, Variant = 100, SubType = Collectibles.CHERRYFRIENDS},
["Isaac"] = {Unlocked = false, Type = 5, Variant = 100, SubType = Collectibles.COOKIECUTTER},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = 350, SubType = Trinkets.KEYTOTHEHEART},
["Greed"] = {Unlocked = false, Type = 5, Variant = 300, SubType = PocketItems.NEEDLEANDTHREAD}
},
["23"] = { --T.Cain
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Satan"] = {Unlocked = false, Type = 5, Variant = 100, SubType = Collectibles.MARKCAIN},
["Isaac"] = {Unlocked = false, Type = 5, Variant = 350, SubType = Trinkets.SLEIGHTOFHAND},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = 350, SubType = Trinkets.TRICKPENNY},
["Greed"] = {Unlocked = false, Type = 5, Variant = 300, SubType = PocketItems.BAGTISSUE}
},
["24"] = { --T.Judas
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = 300, SubType = PocketItems.JACKOFHEARTS},
["Satan"] = {Unlocked = false, Type = 5, Variant = 100, SubType = Collectibles.CEREMDAGGER},
["Isaac"] = {Unlocked = false, Type = 5, Variant = 350, SubType = Collectibles.BLACKDOLL},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = 350, SubType = Trinkets.JUDASKISS},
["Greed"] = {Unlocked = false, Type = 5, Variant = 300, SubType = PocketItems.SACBLOOD}
},
["25"] = { --T.???
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = 300, SubType = PocketItems.FLYPAPER},
["Satan"] = {Unlocked = false, Type = 5, Variant = 100, SubType = Collectibles.BAGOTRASH},
["Isaac"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Greed"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil}
},
["26"] = { --T.Eve
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = 300, SubType = PocketItems.BEDSIDEQUEEN},
["Satan"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Isaac"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Greed"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil}
},
["27"] = { --T.Samson
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = 300, SubType = PocketItems.JACKOFCLUBS},
["Satan"] = {Unlocked = false, Type = 5, Variant = 100, SubType = Collectibles.TEMPERTANTRUM},
["Isaac"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Greed"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil}
},
["28"] = { --T.Azazel
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Satan"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Isaac"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Greed"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil}
},
["29"] = { --T.Lazarus
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = 300, SubType = PocketItems.JACKOFSPADES},
["Satan"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Isaac"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Greed"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil}
},
["30"] = { --T.Eden
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Satan"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Isaac"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Greed"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil}
},
["31"] = { --T.Lost
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Satan"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Isaac"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Greed"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil}
},
["32"] = { --T.Lilith
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = 300, SubType = PocketItems.QUEENOFCLUBS},
["Satan"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Isaac"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Greed"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil}
},
["33"] = { --T.Keeper
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Satan"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Isaac"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Greed"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil}
},
["34"] = { --T.Appolyon
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Satan"] = {Unlocked = false, Type = 5, Variant = 100, SubType = Collectibles.SINNERSHEART},
["Isaac"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Greed"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil}
},
["35"] = { --T.Forgor
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Satan"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Isaac"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Greed"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil}
},
["36"] = { --T.Bethany
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Satan"] = {Unlocked = false, Type = 5, Variant = 100, SubType = Collectibles.CEILINGSTARS},
["Isaac"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Greed"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil}
},
["37"] = { --T.Jacob
["Boss Rush"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Satan"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Isaac"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Blue Baby"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil},
["Greed"] = {Unlocked = false, Type = 5, Variant = nil, SubType = nil}
}
}
--]]
ItemPools = {
SCARLETCHEST = {
16, -- Raw Liver
73, -- Cube of Meat
155, -- The Peeper
176, -- Stem Cells
214, -- Anemic
218, -- Placenta
236, -- E. Coli
253, -- Magic Scab
440, -- Kidney Stone
446, -- Dead Tooth
452, -- Varicose Veins
502, -- Large Zit
509, -- Bloodshot Eye
529, -- Pop!
541, -- Marrow
542, -- Slipped Rib
544, -- Pointy Rib
548, -- Jaw Bone
549, -- Brittle Bones
611, -- Larynx
639, -- Yuck Heart
642, -- Magic Skin
657, -- Vasculitis
676, -- Empty Heart
688, -- Inner Child
695 -- Bloody Gust
},
MOMNDAD = {
175, -- Dad's Key
102, -- Mom's Bottle of Pills
439, -- Mom's Box
604, -- Mom's Bracelet
455, -- Dad's Lost Coin
547, -- Divorce Papers
195, -- Mom's Coin Purse
110, -- Mom's Contacts
55, -- Mom's Eye
199, -- Mom's Key
355, -- Mom's Pearls
228, -- Mom's Perfume
139, -- Mom's Purse
217, -- Mom's Wig
546 -- Dad's Ring
}
}
StatUps = {
SINNERSHEART_DMG_MUL = 1.5,
SINNERSHEART_DMG_ADD = 2,
SINNERSHEART_SHSP = -0.3,
SINNERSHEART_TEARHEIGHT = -3, -- negative TearHeight = positive Range
MARKCAIN_DMG = 0.4,
LOADEDDICE_LUCK = 10,
CEREMDAGGER_DMG_MUL = 0.85,
SACBLOOD_DMG = 1,
MAGICSWORD_DMG_MUL = 2,
GRATER_DMG = 0.5,
BLESS_DMG = 0.5,
ORDLIFE_TEARS = 0.8
}
-- used by Bag Tissue
PickupWeights = {
[PickupVariant.PICKUP_HEART] = {
[HeartSubType.HEART_FULL] = 1,
[HeartSubType.HEART_HALF] = 1,
[HeartSubType.HEART_SOUL] = 4,
[HeartSubType.HEART_ETERNAL] = 6,
[HeartSubType.HEART_DOUBLEPACK] = 2,
[HeartSubType.HEART_BLACK] = 5,
[HeartSubType.HEART_GOLDEN] = 5,
[HeartSubType.HEART_HALF_SOUL] = 4,
[HeartSubType.HEART_SCARED] = 1,
[HeartSubType.HEART_BLENDED] = 3,
[HeartSubType.HEART_BONE] = 5,
[HeartSubType.HEART_ROTTEN] = 5
},
[PickupVariant.PICKUP_COIN] = {
[CoinSubType.COIN_PENNY] = 1,
[CoinSubType.COIN_NICKEL] = 3,
[CoinSubType.COIN_DIME] = 5,
[CoinSubType.COIN_DOUBLEPACK] = 2,
[CoinSubType.COIN_LUCKYPENNY] = 7,
[CoinSubType.COIN_GOLDEN] = 4
},
[PickupVariant.PICKUP_KEY] = {
[KeySubType.KEY_NORMAL] = 1,
[KeySubType.KEY_GOLDEN] = 5,
[KeySubType.KEY_DOUBLEPACK] = 2,
[KeySubType.KEY_CHARGED] = 5
},
[PickupVariant.PICKUP_BOMB] = {
[BombSubType.BOMB_NORMAL] = 2,
[BombSubType.BOMB_DOUBLEPACK] = 4,
[BombSubType.BOMB_GOLDEN] = 6
},
[PickupVariant.PICKUP_LIL_BATTERY] = {
[BatterySubType.BATTERY_NORMAL] = 4,
[BatterySubType.BATTERY_MICRO] = 2,
[BatterySubType.BATTERY_MEGA] = 8,
[BatterySubType.BATTERY_GOLDEN] = 5
}
}
DIRECTION_FLOAT_ANIM = {
[Direction.NO_DIRECTION] = "FloatDown",
[Direction.LEFT] = "FloatLeft",
[Direction.UP] = "FloatUp",
[Direction.RIGHT] = "FloatRight",
[Direction.DOWN] = "FloatDown"
}
DIRECTION_SHOOT_ANIM = {
[Direction.NO_DIRECTION] = "FloatShootDown",
[Direction.LEFT] = "FloatShootRight",
[Direction.UP] = "FloatShootUp",
[Direction.RIGHT] = "FloatShootLeft",
[Direction.DOWN] = "FloatShootDown"
}
DIRECTION_VECTOR = {
[Direction.NO_DIRECTION] = Vector(0, 1), -- when you don't shoot or move, you default to HeadDown
[Direction.LEFT] = Vector(-1, 0),
[Direction.UP] = Vector(0, -1),
[Direction.RIGHT] = Vector(1, 0),
[Direction.DOWN] = Vector(0, 1)
}
DIRECTION_VECTOR_SIMPLIFIED = {
Vector(0, 1),
Vector(-1, 0),
Vector(0, -1),
Vector(1, 0)
}
---------------------
-- LOCAL FUNCTIONS --
---------------------
-- Helper function to return a random custom Card to take place of the normal one.
local function GetRandomCustomCard()
local keys = {}
for k in pairs(PocketItems) do
if k ~= REDRUNE and k ~= QUASARSHARD then table.insert(keys, k) end
end
local random_key = keys[math.random(1, #keys)]
return PocketItems[random_key]
end
--[[
-- Helpers for rendering unlock papers
local function Unlock(checkmark)
local player = Isaac.GetPlayer(0)
local playerType = player:GetPlayerType()
local itemConfig = Isaac.GetItemConfig()
if playerType > 20 then
if playerType == 38 then
playerType = 29
end
if playerType == 39 then
playerType = 37
end
playerType = tostring(playerType)
if not Unlocks[playerType][checkmark].Unlocked and Unlocks[playerType][checkmark].Variant then
Unlocks[playerType][checkmark].Unlocked = true
local Variant = Unlocks[playerType][checkmark].Variant
local SubType = Unlocks[playerType][checkmark].SubType
local name
if Variant == 100 then
name = itemConfig:GetCollectible(SubType).Name
elseif Variant == 300 then
name = itemConfig:GetCard(SubType).Name
elseif Variant == 70 then
name = itemConfig:GetPillEffect(SubType).Name
elseif Variant == 350 then
name = itemConfig:GetTrinket(SubType).Name
--elseif
-- manual Name depending on which Pickup to choose from
end
achievement:ReplaceSpritesheet(3, "gfx/ui/achievement/achievement_" .. name .. ".png")
achievement:LoadGraphics()
flagRenderPaper = true
paperRenderFrame = 0
Isaac.SaveModData(rplus, json.encode(Unlocks, "Unlocks"))
end
end
end
local function RenderAchievementPapers()
local roomCenter = room:GetCenterPos()
local roomTopLeft = room:GetTopLeftPos()
local roomTypeToRenderPos = {
[RoomShape.ROOMSHAPE_1x2] = {roomCenter.X, roomTopLeft.Y * 2},
[RoomShape.ROOMSHAPE_1x1] = {roomCenter.X, roomCenter.Y},
[RoomShape.ROOMSHAPE_2x2] = {roomTopLeft.X * 5.5, roomTopLeft.Y * 2}
}
pos = Isaac.WorldToRenderPosition(Vector(roomTypeToRenderPos[room:GetRoomShape()][1], roomTypeToRenderPos[room:GetRoomShape()][2]), true)
if paperRenderFrame % 2 == 0 then
achievement:SetFrame("Appear", paperRenderFrame / 2)
end
achievement:Render(pos, Vector.Zero, Vector.Zero)
paperRenderFrame = paperRenderFrame + 1
if paperRenderFrame >= 75 * 2 then flagRenderPaper = false end
end
function isUltraGreedRoom()
return game.Difficulty >= 2 and game:GetRoom():GetRoomShape() == RoomShape.ROOMSHAPE_1x2 and game:GetLevel():GetStage() == LevelStage.STAGE7_GREED
end
--]]
-- Is this collectible unlocked?
local function IsCollectibleUnlocked(collectibleType)
local isUnlocked = false
local itemPool = game:GetItemPool()
local player = Isaac.GetPlayer(0)
player:AddCollectible(CollectibleType.COLLECTIBLE_CHAOS, 0, false)
isUnlocked = itemPool:RemoveCollectible(collectibleType)
player:RemoveCollectible(CollectibleType.COLLECTIBLE_CHAOS)
return isUnlocked
end
local function GetUnlockedVanillaCollectible(allPools)
allPools = allPools or false
local ID = 0
local itemPool = game:GetItemPool()
local player = Isaac.GetPlayer(0)
if allPools then
player:AddCollectible(CollectibleType.COLLECTIBLE_CHAOS, 0, false) -- makes all items appear in the list
ID = itemPool:GetCollectible(1, false) -- gets an item without removing it from the item pool
player:RemoveCollectible(CollectibleType.COLLECTIBLE_CHAOS) -- removes chaos
else
local rt = game:GetRoom():GetType()
local ip
if rt == 2 or rt == 22 then ip = 1
elseif rt == 5 then ip = 2
elseif rt == 7 or rt == 8 then ip = 5
elseif rt == 10 then ip = 12
elseif rt == 14 then ip = 3
elseif rt == 15 or rt == 29 then ip = 4
elseif rt == 24 then ip = 26
else ip = 0
end
ID = itemPool:GetCollectible(ip, false)
end
return ID
end
-- Handle displaying error message advising players to restart
local function DisplayErrorMessage()
local ErrorMessage = "Warning! Custom Mod Data of Repentance Plus #wasn't loaded, the mod could work incorrectly. #Custom Mod Data will be properly loaded next time you start a new run. #(Type 'hide' into the console or press H to hide this message)"
if not CustomData and not hideErrorMessage then
YOffset = 0
for line in string.gmatch(ErrorMessage, '([^#]+)') do
Isaac.RenderText(line, 30, 220 + YOffset, 1, 0.2, 0.2, 1)
YOffset = YOffset + 12
end
end
end
-- Helper to give proper IV frames on revival
local function GiveRevivalIVFrames(p)
-- taking fake damage
p:TakeDamage(1, DamageFlag.DAMAGE_FAKE, EntityRef(p), 1)
-- stopping 'hit' animation
local Sprite = p:GetSprite()
if Sprite:IsPlaying("Hit") then Sprite:Stop() end
-- stopping hit sound
if sfx:IsPlaying(SoundEffect.SOUND_ISAAC_HURT_GRUNT) then sfx:Stop(SoundEffect.SOUND_ISAAC_HURT_GRUNT) end
end
-- Helpers for handling gulped trinkets
local function IsTrinketGulped(trinketType, player)
player = player or Isaac.GetPlayer(0)
return player:HasTrinket(trinketType) and player:GetTrinket(0) ~= trinketType and player:GetTrinket(1) ~= trinketType
end
local function GetTrinketGulped(trinketType, player)
player = player or Isaac.GetPlayer(0)
local currentTrinket = player:GetTrinket(0)
local currentTrinket2 = player:GetTrinket(1)
player:TryRemoveTrinket(currentTrinket)
player:TryRemoveTrinket(currentTrinket2)
player:AddTrinket(trinketType)
player:UseActiveItem(479, false, false, false, false)
player:AddTrinket(currentTrinket)
player:AddTrinket(currentTrinket2)
end
local function isMirrorItemRoom()
for _, entity in pairs(Isaac.GetRoomEntities()) do
if entity.Type == 5 and entity.SubType == 626 then
return true
end
end
return false
end
----------------------
-- GLOBAL FUNCTIONS --
----------------------
-- GAME STARTED --
------------------
function rplus:OnGameStart(Continued)
--[[
if Isaac.HasModData(rplus) then
local data = Isaac.LoadModData(rplus)
Unlocks = json.decode(data)
else
Isaac.SaveModData(rplus, json.encode(Unlocks, "Unlocks"))
end
--]]
-- recalculating cache, just in case
Isaac.GetPlayer(0):AddCacheFlags(CacheFlag.CACHE_ALL)
Isaac.GetPlayer(0):EvaluateItems()
-- deleting Wait, No! from trinket pool
game:GetItemPool():RemoveTrinket(Trinkets.WAITNO)
if not Continued then
hideErrorMessage = false
CustomData = {
Items = {
BIRDOFHOPE = {NumRevivals = 0, BirdCaught = true},
RUBIKSCUBE = {Counter = 0},
MARKCAIN = nil,
BAGOTRASH = {Levels = 0},
TEMPERTANTRUM = {ErasedEnemies = {}},
ENRAGEDSOUL = {SoulLaunchCooldown = nil, AttachedEnemy = nil},
CEILINGSTARS = {SleptInBed = false},
TWOPLUSONE = {ItemsBought_COINS = 0, ItemsBought_HEARTS = 0},
CHEESEGRATER = {NumUses = 0},
BLESSOTDEAD = 0
},
Cards = {
JACK = nil,
SACBLOOD = {Data = false, NumUses = 0}
},
Trinkets = {
GREEDSHEART = "CoinHeartEmpty",
CHALKPIECE = {RoomEnterFrame = 0},
TORNPAGE = {SomeBookFlags = nil}
},
Pills = {
LAXATIVE = {LaxUseFrame = nil}
}
}
if CustomData then print("Repentance+ Mod v1.6 Initialized") end
--[[ Spawn items/trinkets or turn on debug commands for testing here if necessary
! DEBUG: 3 - INFINITE HP, 4 - HIGH DAMAGE, 8 - INFINITE CHARGES, 10 - INSTAKILL ENEMIES !
Isaac.Spawn(5, 350, Trinkets.TestTrinket, Isaac.GetFreeNearPosition(Vector(320,280), 10.0), Vector.Zero, nil)
Isaac.Spawn(5, 100, Collectibles.TestCollectible, Isaac.GetFreeNearPosition(Vector(320,280), 10.0), Vector.Zero, nil)
Isaac.ExecuteCommand("debug 0")
--]]
else
local customDataLoaded = Isaac.LoadModData(rplus)
CustomData = json.decode(customDataLoaded)
end
end
rplus:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, rplus.OnGameStart)
-- PRE GAME EXIT --
-------------------
function rplus:PreGameExit(ShouldSave)
if ShouldSave then
Isaac.SaveModData(rplus, json.encode(CustomData, "CustomData"))
end
end
rplus:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, rplus.PreGameExit)
-- ON COMMAND EXECUTE --
------------------------
function rplus:OnCommandExecute(command, args)
if command == 'hide' then
hideErrorMessage = true
print('Error message hidden. To see it again, type *show* into the console')
elseif command == 'show' then
hideErrorMessage = false
end
end
rplus:AddCallback(ModCallbacks.MC_EXECUTE_CMD, rplus.OnCommandExecute)
-- EVERY NEW LEVEL --
---------------------
function rplus:OnNewLevel()
local level = game:GetLevel()
for i = 0, game:GetNumPlayers() - 1 do
local player = Isaac.GetPlayer(i)
if CustomData then
CustomData.Cards.JACK = nil
CustomData.Items.CEILINGSTARS.SleptInBed = false
if player:HasCollectible(Collectibles.BAGOTRASH) then
CustomData.Items.BAGOTRASH.Levels = CustomData.Items.BAGOTRASH.Levels + 1
end
end
if player:HasCollectible(Collectibles.REDMAP) then
local USR = level:GetRoomByIdx(level:QueryRoomTypeIndex(RoomType.ROOM_ULTRASECRET, true, RNG(), true))
if USR.Data and USR.Data.Type == RoomType.ROOM_ULTRASECRET and USR.DisplayFlags & 1 << 2 == 0 then
USR.DisplayFlags = USR.DisplayFlags | 1 << 2
level:UpdateVisibility()
end
end
if player:HasCollectible(Collectibles.CEILINGSTARS) then
for i = 1, 2 do
repeat
newID = GetUnlockedVanillaCollectible()
until Isaac.GetItemConfig():GetCollectible(newID).Type % 3 == 1
player:AddItemWisp(newID, player.Position, true)
end
end
if player:HasCollectible(Collectibles.TWOPLUSONE) then
CustomData.Items.TWOPLUSONE.ItemsBought_COINS = 0
end
end
end
rplus:AddCallback(ModCallbacks.MC_POST_NEW_LEVEL, rplus.OnNewLevel)
-- EVERY NEW ROOM --
--------------------
function rplus:OnNewRoom()
local level = game:GetLevel()
local room = game:GetRoom()
local roomtype = room:GetType()
for i = 0, game:GetNumPlayers() - 1 do
local player = Isaac.GetPlayer(i)
if player:HasCollectible(Collectibles.ORDLIFE) and room:GetType() == RoomType.ROOM_TREASURE and room:IsFirstVisit() and not isMirrorItemRoom() then
momNDadItem = Isaac.Spawn(5, 100, ItemPools.MOMNDAD[math.random(#ItemPools.MOMNDAD)], room:FindFreePickupSpawnPosition(Vector(320,280), 1, true, false), Vector.Zero, nil):ToPickup()
momNDadItem.OptionsPickupIndex = 3
for _, entity in pairs(Isaac.GetRoomEntities()) do
if entity.Type == 5 and entity.Variant == PickupVariant.PICKUP_COLLECTIBLE then
entity:ToPickup().OptionsPickupIndex = 3
end
end
end
if player:HasCollectible(Collectibles.BLACKDOLL) and room:IsFirstVisit() and Isaac.CountEnemies() > 1 then
ABSepNumber = math.floor(Isaac.CountEnemies() / 2)
EntitiesGroupA = {}
EntitiesGroupB = {}
local Count = 0
for _, entity in pairs(Isaac.GetRoomEntities()) do
if entity:IsActiveEnemy(false) and not entity:IsBoss() then
Count = Count + 1
if Count <= ABSepNumber then
table.insert(EntitiesGroupA, entity)
else
table.insert(EntitiesGroupB, entity)
end
end
end
end
for _, entity in pairs(Isaac.GetRoomEntities()) do
if entity.Type == 3 and entity.Variant == Familiars.SOUL then
entity:Remove()
end
end
if player:HasTrinket(Trinkets.ANGELSCROWN) and roomtype == RoomType.ROOM_TREASURE then
if room:IsFirstVisit() then
for _, entity in pairs(Isaac.GetRoomEntities()) do
if entity.Type == 5 then entity:Remove() end
end
local AngelItem = Isaac.Spawn(5, 100, game:GetItemPool():GetCollectible(ItemPoolType.POOL_ANGEL, false, Random(), CollectibleType.COLLECTIBLE_NULL), Vector(320,280), Vector.Zero, nil):ToPickup()
AngelItem.Price = 15
AngelItem.ShopItemId = -777
end
for i = 1, room:GetGridSize() do
if room:GetGridEntity(i) ~= nil
and room:GetGridEntity(i):GetType() ~= GridEntityType.GRID_DOOR and room:GetGridEntity(i):GetType() ~= GridEntityType.GRID_WALL then
room:RemoveGridEntity(i, 0, false)
end
end
if room:GetRoomShape() == RoomShape.ROOMSHAPE_1x1 then
AngelPos = Vector(320, 200)
FloorPos = Vector(60, 140)
WallPos = Vector(-20, 60)
elseif room:GetRoomShape() == RoomShape.ROOMSHAPE_IH then
AngelPos = Vector(320, 240)
FloorPos = Vector(60, 220)
WallPos = Vector(-20, 138)
elseif room:GetRoomShape() == RoomShape.ROOMSHAPE_IV then
AngelPos = Vector(320, 200)
FloorPos = Vector(220, 140)
WallPos = Vector(145, 60)
end
Isaac.GridSpawn(GridEntityType.GRID_STATUE, 1, AngelPos, false)
FloorPiece = Isaac.Spawn(1000, CustomBackDropEntity, 0, FloorPos, Vector.Zero, nil)
WallPiece = Isaac.Spawn(1000, CustomBackDropEntity, 0, WallPos, Vector.Zero, nil)
end
if player:HasTrinket(Trinkets.CHALKPIECE) and not room:IsClear() and room:IsFirstVisit() then
CustomData.Trinkets.CHALKPIECE.RoomEnterFrame = game:GetFrameCount()
end
if player:HasCollectible(Collectibles.TWOPLUSONE) and CustomData then
CustomData.Items.TWOPLUSONE.ItemsBought_HEARTS = 0
end
player:GetData()['usedLoadedDice'] = false
player:AddCacheFlags(CacheFlag.CACHE_LUCK)
player:EvaluateItems()
end
end
rplus:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, rplus.OnNewRoom)
-- ACTIVE ITEM USED --
----------------------
function rplus:OnItemUse(ItemUsed, _, Player, _, _, _)
local level = game:GetLevel()
local room = game:GetRoom()
if ItemUsed == Collectibles.COOKIECUTTER then
Player:AddMaxHearts(2, true)
Player:AddBrokenHearts(1)
sfx:Play(SoundEffect.SOUND_BLOODBANK_SPAWN, 1, 2, false, 1, 0)
if Player:GetBrokenHearts() >= 12 then
Player:Die()
end
return true
end
if ItemUsed == Collectibles.CHEESEGRATER and Player:GetMaxHearts() > 0 then
Player:AddMaxHearts(-2, false)
Player:AddMinisaac(Player.Position, true)
Player:AddMinisaac(Player.Position, true)
sfx:Play(SoundEffect.SOUND_BLOODBANK_SPAWN, 1, 2, false, 1, 0)
Player:GetData()['graterUsed'] = true
CustomData.Items.CHEESEGRATER.NumUses = CustomData.Items.CHEESEGRATER.NumUses + 1
Player:AddCacheFlags(CacheFlag.CACHE_DAMAGE)
Player:EvaluateItems()
end
if ItemUsed == Collectibles.RUBIKSCUBE then
local SolveChance = math.random(100)
if SolveChance <= 5 or CustomData.Items.RUBIKSCUBE.Counter == 20 then
Player:RemoveCollectible(Collectibles.RUBIKSCUBE, true, ActiveSlot.SLOT_PRIMARY, true)
Player:AddCollectible(Collectibles.MAGICCUBE, 4, true, ActiveSlot.SLOT_PRIMARY, 0)
Player:AnimateHappy()
CustomData.Items.RUBIKSCUBE.Counter = 0
return false
else
CustomData.Items.RUBIKSCUBE.Counter = CustomData.Items.RUBIKSCUBE.Counter + 1
return true
end
end
if ItemUsed == Collectibles.MAGICCUBE then
for _, entity in pairs(Isaac.GetRoomEntities()) do
if entity.Type == 5 and entity.Variant == 100 and entity.SubType > 0 then
entity:ToPickup():Morph(5, 100, GetUnlockedVanillaCollectible(true), true, false, true)
end
end
return true
end
if ItemUsed == Collectibles.QUASAR then
for _, entity in pairs(Isaac.GetRoomEntities()) do
if entity.Type == 5 and entity.Variant == 100 and entity.SubType > 0
and entity:ToPickup() and entity:ToPickup().Price % 10 == 0 then
for i = 1, 3 do
repeat
newID = GetUnlockedVanillaCollectible()
until Isaac.GetItemConfig():GetCollectible(newID).Type % 3 == 1
Player:AddItemWisp(newID, Player.Position, true)
Isaac.Spawn(1000, EffectVariant.POOF01, 0, entity.Position, Vector.Zero, nil)
entity:Remove()
end
sfx:Play(SoundEffect.SOUND_DEATH_CARD, 1, 2, false, 1, 0)
end
end
return true
end
if ItemUsed == Collectibles.TOWEROFBABEL then
for g = 1, room:GetGridSize() do
if room:GetGridEntity(g) then room:GetGridEntity(g):Destroy() end
end
for _, enemy in pairs(Isaac.FindInRadius(Player.Position, 200, EntityPartition.ENEMY)) do
if not enemy:IsBoss() then enemy:AddEntityFlags(EntityFlag.FLAG_CONFUSION) end
end
return {Discharge = true, Remove = false, ShowAnim = true}
end
end
rplus:AddCallback(ModCallbacks.MC_USE_ITEM, rplus.OnItemUse)
-- EVERY FRAME --
-----------------
function rplus:OnFrame()
local room = game:GetRoom()
local level = game:GetLevel()
local stage = level:GetStage()
for i = 0, game:GetNumPlayers() - 1 do
local player = Isaac.GetPlayer(i)
local sprite = player:GetSprite()
if player:GetData()['reverseCardRoom'] and player:GetData()['reverseCardRoom'] ~= game:GetLevel():GetCurrentRoomIndex() then
local secondaryCard = player:GetCard(1)
player:SetCard(1, 0)
player:SetCard(0, secondaryCard)
player:GetData()['reverseCardRoom'] = nil
end
if player:HasCollectible(Collectibles.MAGICPEN) then
-- taste the rainbow
for _, entity in pairs(Isaac.GetRoomEntities()) do
if entity.Type == 1000 and entity.Variant == EffectVariant.PLAYER_CREEP_HOLYWATER_TRAIL and entity.SubType == 4 then
local Frame = game:GetFrameCount() % 490 + 1
if Frame <= 140 then
entity:SetColor(Color(1, Frame / 140, 0), 1, 1, false, false)
elseif Frame <= 210 then
entity:SetColor(Color(1 - (Frame - 140) / 70, 1, 0), 1, 1, false, false)
elseif Frame <= 280 then
entity:SetColor(Color(0, 1 - (Frame - 210) / 70, (Frame - 210) / 70), 1, 1, false, false)
elseif Frame <= 350 then
entity:SetColor(Color((Frame - 280) / 70 * 75 / 255, 0, (Frame - 280) / 70 * 130 / 255), 1, 1, false, false)
elseif Frame <= 420 then
entity:SetColor(Color((75 + (Frame - 350) / 70 * 58) / 255, 0, (130 + (Frame - 350) / 70 * 125) / 255), 1, 1, false, false)
else
entity:SetColor(Color((143 + (Frame - 420) / 70 * 112) / 255, 0, 1 - (Frame - 420) / 70), 1, 1, false, false)
end
end
end
end
if player:HasCollectible(Collectibles.MARKCAIN)
and player:GetExtraLives() == 0 then
if sprite:IsPlaying("Death") and sprite:GetFrame() > 50 then
MyFamiliars = {}
for i = 1, 1000 do
if Isaac.GetItemConfig():GetCollectible(i) and Isaac.GetItemConfig():GetCollectible(i).Type == ItemType.ITEM_FAMILIAR and player:HasCollectible(i) then
for j = 1, player:GetCollectibleNum(i, true) do
table.insert(MyFamiliars, i)
end
end
end
if #MyFamiliars > 0 then
player:RemoveCollectible(Collectibles.MARKCAIN)
for i = 0, game:GetNumPlayers() - 1 do
Isaac.GetPlayer(i):Revive()
GiveRevivalIVFrames(Isaac.GetPlayer(i))
end
CustomData.Items.MARKCAIN = "player revived"
sfx:Play(SoundEffect.SOUND_SUPERHOLY, 1, 2, false, 1, 0)
for i = 1, #MyFamiliars do player:RemoveCollectible(MyFamiliars[i]) end
player:AddCacheFlags(CacheFlag.CACHE_DAMAGE)
player:EvaluateItems()
end
end
end
if player:HasCollectible(Collectibles.TEMPERTANTRUM) then
if SUPERBERSERKSTATE and sfx:IsPlaying(SoundEffect.SOUND_BERSERK_END) then SUPERBERSERKSTATE = false end
end
for _, entity in pairs(Isaac.GetRoomEntities()) do
if entity:IsActiveEnemy() and CustomData.Items.TEMPERTANTRUM.ErasedEnemies ~= nil then
for i = 1, #CustomData.Items.TEMPERTANTRUM.ErasedEnemies do
if entity.Type == CustomData.Items.TEMPERTANTRUM.ErasedEnemies[i] then
entity:Kill()
break
end
end
end
end
if player:HasCollectible(Collectibles.CHERRYFRIENDS) and room:IsClear() then
for _, entity in pairs(Isaac.GetRoomEntities()) do
if entity.Type == 3 and entity.Variant == Familiars.CHERRY then
entity:GetSprite():Play("Collect")
if entity:GetSprite():IsFinished("Collect") then
entity:Remove()
Isaac.Spawn(5, PickupVariant.PICKUP_HEART, HeartSubType.HEART_HALF, entity.Position, Vector.Zero, nil)
end
end
end
end
if player:HasCollectible(Collectibles.BIRDOFHOPE) then
if sprite:IsPlaying("Death") and CustomData.Items.BIRDOFHOPE.BirdCaught == true then
CustomData.Items.BIRDOFHOPE.BirdCaught = false
DieFrame = game:GetFrameCount()
DiePos = player.Position
CustomData.Items.BIRDOFHOPE.NumRevivals = CustomData.Items.BIRDOFHOPE.NumRevivals + 1
dyingPlayer = player
player:Revive()
sprite:Stop()
player:AddCollectible(185, 0, false, 0, 0)
player:AddNullCostume(Costumes.BIRDOFHOPE)
Birdy = Isaac.Spawn(3, Familiars.BIRD, 0, room:GetCenterPos(), Vector.FromAngle(math.random(360)) * CustomData.Items.BIRDOFHOPE.NumRevivals, nil)
Birdy:GetSprite():Play("Flying")
elseif DieFrame and game:GetFrameCount() > DieFrame + 120 and not CustomData.Items.BIRDOFHOPE.BirdCaught then
player:Die()
CustomData.Items.BIRDOFHOPE.BirdCaught = "blah blah" -- just so that it's not true and player doesn't die over and over
-- until all his extra lives are depleted
-- !!! THIS IS A SERIOUS CROTCH !!! since you end up near the door when reviving, and the bird familiar doesn't despawn if you don't catch her,
-- you automatically pick her up and this allows you to repeat the cycle (since it switches data to true) and doesn't take away your extra lives
-- so don't touch it if you don't think it through. like, for real.