-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathinit.lua
More file actions
1508 lines (1242 loc) · 69 KB
/
Copy pathinit.lua
File metadata and controls
1508 lines (1242 loc) · 69 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
dofile_once("data/scripts/lib/utilities.lua")
dofile_once("mods/Apotheosis/lib/Apotheosis/apotheosis_utils.lua")
local apoth_version = "v1.4.0 Beta Branch"
--local modCompatibilityConjurer = ModSettingGet( "Apotheosis.mod_compat_mode_conjurer" )
local modCompatibilitySpellEvolutions = ModSettingGet("Apotheosis.mod_compat_mode_spell_evolution")
local motdSetting = ModSettingGet("Apotheosis.motd_setting")
local seasonalSetting = ModSettingGet("Apotheosis.seasonal_events")
local spoopyGFXSetting = ModSettingGet("Apotheosis.spoopy_graphics")
local experimental_biomemap = ModSettingGet("Apotheosis.exp_biomemap")
local capeSetting = ModSettingGet("Apotheosis.secret_golden_cape")
--Debug flag removals, be sure to remove before release!!!
--RemoveFlagPersistent( "apotheosis_card_unlocked_secret_knowledge_of_kings" )
--RemoveFlagPersistent( "apotheosis_card_unlocked_secret_knowledge_of_kings_spell" )
--Spawn Bosses
--This was a coding marathon and a half, huge shoutouts to Horscht for the help on this one.
--And Zathers for making this lua file
--Note: This has been moved lower down for cleaner organisation & implementing mod compatibility
--Note: 16/06/2023 Some boss spawns may be moved into biome files as well
if ModIsEnabled("quant.ew") then
ModLuaFileAppend("mods/quant.ew/files/api/extra_modules.lua", "mods/Apotheosis/files/scripts/mod_compatibility/entangled_alt_fire_fix.lua")
ModLuaFileAppend("mods/quant.ew/files/api/global_perks.lua", "mods/Apotheosis/files/scripts/mod_compatibility/ew_global_perks.lua")
end
-- Spell Unlock Fixes
-- If someone attains a spell through another mod, twitch integration, etc, this is just to make sure they aren't getting unlocks they shouldn't.
-- They'll still get the spell, it just won't be added to their permanent record
-- Rat bite isn't "verified" because it's a funny spell
-- Protect spell progress in case of accidental unlocks
do
for _, entry in ipairs({
"divinebeing",
"boss_toxic_worm",
"musical_boss",
"blob_boss",
"fire_lukki",
"boss_flesh_monster",
"cat_secret",
"orb_12",
"orb_14",
"orb_15",
"orb_16",
"lost_alchemy",
"omega_cross",
"support_bullet",
}) do
local progressflag = "apotheosis_card_unlocked_" .. entry
if HasFlagPersistent( progressflag ) then
AddFlagPersistent( progressflag .. "_spell" )
else
RemoveFlagPersistent( progressflag .. "_spell" )
end
end
end
--Ending Reward
if HasFlagPersistent("apotheosis_card_unlocked_ending_apotheosis_02") then
AddFlagPersistent("apotheosis_card_unlocked_ending_apotheosis_02_spell")
else
RemoveFlagPersistent("apotheosis_card_unlocked_ending_apotheosis_02_spell")
end
--Ensure this flag is never enabled, so spells can properly be disabled in hardcore mode while still appearing in the progress log
RemoveFlagPersistent("this_should_never_spawn")
--Description fix for Ghostly Vision Perk
--Wow, I've come a long way since then.
--Thankyou for all the help, gamers!
--Thankyou Nathan for the cleaner translation implementation
local translations = ModTextFileGetContent("data/translations/common.csv")
local new_translations = ModTextFileGetContent("mods/Apotheosis/translations.csv")
translations = translations .. "\n" .. new_translations .. "\n"
translations = translations:gsub("\r", ""):gsub("\n\n+", "\n")
ModTextFileSetContent("data/translations/common.csv", translations)
--Yggdrasil's Knowledge (The knowledge of life)
--
--Custom Spell Border for one-off spells would be sick
--
--Previous contact damage description
--perk_apotheosis_contactdamage_description,"You take no damage from close-range enemy attacks but enemies near you take damage; the damage is higher the lower your health gets.",,,,,,,,,,,,,
--Regular Spawns
ModLuaFileAppend("data/scripts/biomes/wizardcave.lua", "mods/Apotheosis/files/scripts/biomes/wizardcave_populator.lua")
ModLuaFileAppend("data/scripts/biomes/tower_end.lua", "mods/Apotheosis/files/scripts/biomes/tower_end_populator.lua")
ModLuaFileAppend("data/scripts/biomes/coalmine.lua", "mods/Apotheosis/files/scripts/biomes/coalmine_populator.lua")
ModLuaFileAppend("data/scripts/biomes/the_end.lua", "mods/Apotheosis/files/scripts/biomes/the_end_populator.lua")
ModLuaFileAppend("data/scripts/biomes/desert.lua", "mods/Apotheosis/files/scripts/biomes/desert_populator.lua")
ModLuaFileAppend("data/scripts/biomes/crypt.lua", "mods/Apotheosis/files/scripts/biomes/crypt_populator.lua")
ModLuaFileAppend("data/scripts/biomes/pyramid.lua", "mods/Apotheosis/files/scripts/biomes/pyramid_populator.lua")
ModLuaFileAppend("data/scripts/biomes/fungicave.lua", "mods/Apotheosis/files/scripts/biomes/fungicave_populator.lua")
ModLuaFileAppend("data/scripts/biomes/coalmine_alt.lua","mods/Apotheosis/files/scripts/biomes/coalmine_alt_populator.lua")
ModLuaFileAppend("data/scripts/biomes/pyramid_hallway.lua","mods/Apotheosis/files/scripts/biomes/pyramid_hallway_populator.lua")
ModLuaFileAppend("data/scripts/biomes/liquidcave.lua", "mods/Apotheosis/files/scripts/biomes/liquidcave_populator.lua")
ModLuaFileAppend("data/scripts/biomes/snowcastle_cavern.lua", "mods/Apotheosis/files/scripts/biomes/hiisi_shop_populator.lua")
ModLuaFileAppend("data/scripts/biomes/excavationsite.lua","mods/Apotheosis/files/scripts/biomes/excavationsite_populator.lua")
ModLuaFileAppend("data/scripts/biomes/vault_frozen.lua","mods/Apotheosis/files/scripts/biomes/vault_frozen_populator.lua")
ModLuaFileAppend("data/scripts/biomes/fungiforest.lua", "mods/Apotheosis/files/scripts/biomes/fungiforest_populator.lua")
ModLuaFileAppend("data/scripts/biomes/snowcastle.lua", "mods/Apotheosis/files/scripts/biomes/snowcastle_populator.lua")
ModLuaFileAppend("data/scripts/biomes/snowcave.lua", "mods/Apotheosis/files/scripts/biomes/snowcave_populator.lua")
ModLuaFileAppend("data/scripts/biomes/wandcave.lua", "mods/Apotheosis/files/scripts/biomes/wandcave_populator.lua")
ModLuaFileAppend("data/scripts/biomes/meat.lua", "mods/Apotheosis/files/scripts/biomes/meat_populator.lua")
ModLuaFileAppend("data/scripts/biomes/sandcave.lua", "mods/Apotheosis/files/scripts/biomes/sandcave_populator.lua")
ModLuaFileAppend("data/scripts/biomes/vault.lua", "mods/Apotheosis/files/scripts/biomes/vault_populator.lua")
--ModLuaFileAppend( "data/scripts/biomes/tower.lua", "mods/Apotheosis/files/scripts/biomes/tower_populator.lua" )
ModLuaFileAppend("data/scripts/biomes/rainforest.lua", "mods/Apotheosis/files/scripts/biomes/rainforest_populator.lua") --Jungle
ModLuaFileAppend("data/scripts/biomes/rainforest_dark.lua","mods/Apotheosis/files/scripts/biomes/rainforest_dark_populator.lua") --Lukki Lair
ModLuaFileAppend("data/scripts/biomes/winter.lua", "mods/Apotheosis/files/scripts/biomes/winter_populator.lua") --Snow Chasm
ModLuaFileAppend("data/scripts/biomes/clouds.lua", "mods/Apotheosis/files/scripts/biomes/clouds_populator.lua") --Cloud Scape, for example coral chest area & essence of air area
ModLuaFileAppend("data/scripts/biomes/robobase.lua", "mods/Apotheosis/files/scripts/biomes/robobase_populator.lua") --Power Plant
ModLuaFileAppend("data/scripts/biomes/lake_statue.lua", "mods/Apotheosis/files/scripts/biomes/lake_statue_populator.lua") --Lake Island
ModLuaFileAppend("data/scripts/biomes/hills.lua", "mods/Apotheosis/files/scripts/biomes/hills_populator.lua") --Hills and shallow caves
ModLuaFileAppend("data/scripts/biomes/robot_egg.lua", "mods/Apotheosis/files/scripts/biomes/robot_egg_populator.lua") --End of Everything Robotic Egg
--Not looking quite as good as the statues, might need a different art approach
--ModLuaFileAppend( "data/scripts/biomes/mountain_tree.lua", "mods/Apotheosis/files/scripts/biomes/mountain_tree_populator.lua" ) --Treechievements
ModLuaFileAppend("data/scripts/gun/gun_actions.lua", "mods/Apotheosis/files/actions.lua")
-- Could this be gsubbed?
ModLuaFileAppend("data/scripts/gun/gun.lua", "mods/Apotheosis/files/gun.lua")
dofile_once("mods/Apotheosis/lib/injection.lua")
inject(args.StringFile, modes.PREPEND, "data/shaders/post_final.frag", "gl_FragColor.a = 1.0;",
"mods/Apotheosis/files/scripts/shader/constellation_transition_white.frag")
inject(args.StringFile, modes.PREPEND, "data/shaders/post_final.frag", "varying vec2 tex_coord_fogofwar;",
"mods/Apotheosis/files/scripts/shader/constellation_transition_global.frag")
GameSetPostFxParameter("conga_constellation_transition_amount", 0, 0, 0, 0)
inject(args.StringFile, modes.PREPEND, "data/shaders/post_final.frag", "// liquid distortion",
"mods/Apotheosis/files/scripts/shader/trip_red_pre.frag")
inject(args.StringFile, modes.PREPEND, "data/shaders/post_final.frag", "gl_FragColor",
"mods/Apotheosis/files/scripts/shader/trip_red_post.frag")
inject(args.StringFile, modes.PREPEND, "data/shaders/post_final.frag", "varying vec2 tex_coord_fogofwar;",
"mods/Apotheosis/files/scripts/shader/trip_red_global.frag")
GameSetPostFxParameter("conga_red_sand_effect_amount", 0, 0, 0, 0)
inject(args.StringFile, modes.APPEND, "data/shaders/post_final.frag", "vec2 tex_coord_glow = tex_coord_glow_;",
"mods/Apotheosis/files/scripts/shader/mind_warp_wavy.frag")
inject(args.StringFile, modes.APPEND, "data/shaders/post_final.frag", "gl_FragColor.a = 1.0;",
"mods/Apotheosis/files/scripts/shader/mind_warp_red.frag")
inject(args.StringFile, modes.PREPEND, "data/shaders/post_final.frag", "varying vec2 tex_coord_fogofwar;",
"mods/Apotheosis/files/scripts/shader/mind_warp_global.frag")
GameSetPostFxParameter("conga_mind_warp_effect_amount", 0, 0, 0, 0)
--Appends Global Spawns to vanilla biome
do -- Global Spawns
--DO NOT INCLUDE ANYTHING TOWER RELATED HERE, they're... "special" and need to be done in their own unique way
for _, append in ipairs({
{ -- General
script = "global_populator",
biomes = {
"wizardcave", --Wizard's Den, aside from the darkness it's pretty habitable. Polymorph liquid is scarier, I can't shield that.
"coalmine", --Coal Mine, first area, goodluck on your run
"desert", --Desert above ground, careful not to die to any Stendari
"crypt", --Temple of the Arts.. who died here?
"pyramid", --Presumably everything below the entrance to the pyramid
"fungicave", --BUNGUS!! cave, west side of area 2 for example
"coalmine_alt", --Coalmine but to the west side near damp cave
"pyramid_hallway", --Pyramid entrance, presumably
"excavationsite", --Coal Pits, area 2
"fungiforest", --Overgrowth
"snowcave", --Snowy Depths
"wandcave", --Magical temple.. huh
"sandcave", --Desert sand cave, I don't think it includes desert chasm
"winter", --Winter appears to be the snow chasm... terrifying. Also line 69!
"rainforest", --Jungle
"rainforest_dark", --Lukki Lair.. creepy
"liquidcave", --Abandoned Alchemy Lab
}
},
{ -- No Magic
script = "global_populator_no_magic",
biomes = {
"the_end", --Heaven, or Hell, your choice. Either are The Work.
"vault", --The Vault
"robot_egg", --I'm sure you can guess
"vault_frozen", --Like the vault, but way colder, worse, more hisii and with a really rude welcoming
"snowcastle", --Hisii Base... Interesting name.. I won't judge.. too much, I've used some really weird inengine names myself in the past
"robobase", --Power Plant
}
},
{ -- Small Only
script = "global_populator_smallonly",
biomes = {
"clouds", --Cloudscapes
"hills", --Hills, aka forest.
}
},
}) do
-- Generate append script file path
local appendpath = table.concat({ "mods/Apotheosis/files/scripts/biomes/", append.script, ".lua" })
-- Iterate over all biomes for the path
for _, biome in ipairs(append.biomes) do
-- Generate biome file path
local biomepath = table.concat({ "data/scripts/biomes/", biome, ".lua" })
-- Add the stuff
ModLuaFileAppend(biomepath, appendpath)
end
end
end
--Appends Global Spawns to new biome files
do -- Global Spawns
--DO NOT INCLUDE ANYTHING TOWER RELATED HERE, they're... "special" and need to be done in their own unique way
for _, append in ipairs({
{ -- General
script = "global_populator",
biomes = {
"lava_excavation", --Core Mines, Volcanic lava filled land in the desert with plenty of loot but plenty of death
"evil_temple", --Temple of Sacriligious Remains
}
},
}) do
-- Generate append script file path
local appendpath = table.concat({ "mods/Apotheosis/files/scripts/biomes/", append.script, ".lua" })
-- Iterate over all biomes for the path
for _, biome in ipairs(append.biomes) do
-- Generate biome file path
local biomepath = table.concat({ "mods/Apotheosis/files/scripts/biomes/newbiome/", biome, ".lua" })
-- Add the stuff
ModLuaFileAppend(biomepath, appendpath)
end
end
end
--Spawns all the above spawns in a single file and appends to pixel scenes to prevent double spawning
-- If Conjurer is enabled, disable this for a fix.
if not (ModIsEnabled("raksa") or ModIsEnabled("conjurer_reborn")) then
dofile_once("mods/Apotheosis/files/scripts/biomes/boss_spawns/boss_spawn_list.lua")
dofile_once("mods/Apotheosis/files/scripts/biomes/boss_spawns/blob_cave_spawn_list.lua")
end
--Spawns statues in the trophy room
--Deprecated, now down through a spawner w/ pixelscenes
--[[
if ModIsEnabled("purgatory") then
ModLuaFileAppend( "data/scripts/biomes/mountain/mountain_hall.lua", "mods/Apotheosis/files/scripts/biomes/boss_spawns/purgatory/statue_room_populator.lua" )
else
ModLuaFileAppend( "data/scripts/biomes/mountain/mountain_hall.lua", "mods/Apotheosis/files/scripts/biomes/boss_spawns/statue_room_populator.lua" )
end
]]
--
--Modded compatibility
--Alternate Biomes
--Remember to make specific files for these at some point.. it'd be weird if there were totally normal guys spawning in irridiated mines, or magical people in the robotics factory
if ModIsEnabled("biome-plus") then
--Normal Spawns
ModLuaFileAppend("data/scripts/biomes/mod/floodcave.lua","mods/Apotheosis/files/scripts/biomes/mod_compatibility/alt_biomes/aquifer_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/the_void.lua","mods/Apotheosis/files/scripts/biomes/mod_compatibility/alt_biomes/void_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/floating_mountain.lua","mods/Apotheosis/files/scripts/biomes/mod_compatibility/alt_biomes/floating_mountain_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/holy_temple.lua","mods/Apotheosis/files/scripts/biomes/crypt_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/collapsed_lab.lua","mods/Apotheosis/files/scripts/biomes/fungicave_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/irradiated_mines.lua",
"mods/Apotheosis/files/scripts/biomes/coalmine_alt_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/blast_pit.lua","mods/Apotheosis/files/scripts/biomes/excavationsite_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/snowvillage.lua","mods/Apotheosis/files/scripts/biomes/mod_compatibility/alt_biomes/hisiivillage_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/frozen_passages.lua","mods/Apotheosis/files/scripts/biomes/snowcave_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/catacombs.lua","mods/Apotheosis/files/scripts/biomes/wandcave_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/tomb.lua", "mods/Apotheosis/files/scripts/biomes/sandcave_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/robofactory.lua","mods/Apotheosis/files/scripts/biomes/vault_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/swamp.lua","mods/Apotheosis/files/scripts/biomes/mod_compatibility/alt_biomes/swamp_populator.lua") --Jungle, could probably include bonus fungus here
ModLuaFileAppend("data/scripts/biomes/mod/rainforest_wormy.lua","mods/Apotheosis/files/scripts/biomes/mod_compatibility/alt_biomes/wormtunnels_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/conduit.lua", "mods/Apotheosis/files/scripts/biomes/winter_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/sulfur_cave.lua","mods/Apotheosis/files/scripts/biomes/mod_compatibility/alt_biomes/hiddengrove_populator.lua") --Hidden Grove, Overgrowth populator
--Global Spawns
ModLuaFileAppend("data/scripts/biomes/mod/floodcave.lua","mods/Apotheosis/files/scripts/biomes/global_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/irradiated_mines.lua","mods/Apotheosis/files/scripts/biomes/global_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/blast_pit.lua", "mods/Apotheosis/files/scripts/biomes/global_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/frozen_passages.lua","mods/Apotheosis/files/scripts/biomes/global_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/the_void.lua", "mods/Apotheosis/files/scripts/biomes/global_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/collapsed_lab.lua","mods/Apotheosis/files/scripts/biomes/global_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/catacombs.lua", "mods/Apotheosis/files/scripts/biomes/global_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/swamp.lua", "mods/Apotheosis/files/scripts/biomes/global_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/robofactory.lua","mods/Apotheosis/files/scripts/biomes/global_populator_no_magic.lua")
ModLuaFileAppend("data/scripts/biomes/mod/holy_temple.lua","mods/Apotheosis/files/scripts/biomes/global_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/snowvillage.lua","mods/Apotheosis/files/scripts/biomes/global_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/tomb.lua", "mods/Apotheosis/files/scripts/biomes/global_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/rainforest_wormy.lua","mods/Apotheosis/files/scripts/biomes/global_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/conduit.lua", "mods/Apotheosis/files/scripts/biomes/global_populator.lua")
ModLuaFileAppend("data/scripts/biomes/mod/sulfur_cave.lua","mods/Apotheosis/files/scripts/biomes/global_populator.lua")
--Dark Areas
ModLuaFileAppend("data/scripts/biomes/mod/irradiated_mines.lua","mods/Apotheosis/files/scripts/biomes/suspicious.lua")
ModLuaFileAppend("data/scripts/biomes/mod/tomb.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua")
ModLuaFileAppend("data/scripts/biomes/mod/conduit.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua")
ModLuaFileAppend("data/scripts/biomes/mod/the_void.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua")
end
--New Enemies, boosts ghost spawnrate in sandcave so they aren't flushed out by the quantity of other creatures.
--Also boosts Divine Being & Divine Poring spawnrates in Heaven & Hell for unlocks
if ModIsEnabled("new_enemies") then
ModLuaFileAppend("data/scripts/biomes/sandcave.lua", "mods/Apotheosis/files/scripts/biomes/mod_compatibility/sandcave_ghostbooster_populator.lua")
--ModLuaFileAppend( "data/scripts/biomes/the_end.lua", "mods/Apotheosis/files/scripts/biomes/mod_compatibility/the_end_angelboost_populator.lua" )
end
--New Enemies, boosts ghost spawnrate in sandcave so they aren't flushed out by the quantity of other creatures, compatibility for alt biomes.
if ModIsEnabled("new_enemies") then
if ModIsEnabled("biome-plus") then
ModLuaFileAppend("data/scripts/biomes/mod/tomb.lua", "mods/Apotheosis/files/scripts/biomes/mod_compatibility/sandcave_ghostbooster_populator.lua")
end
end
-- Conjurer Mod, adds enemies, buildings and wands to a custom tab
if ModIsEnabled("raksa") then
ModLuaFileAppend("mods/raksa/files/scripts/lists/entity_categories.lua", "mods/Apotheosis/files/scripts/mod_compatibility/conjurer_populator.lua")
end
if ModIsEnabled("conjurer_reborn") then
ModLuaFileAppend("mods/conjurer_reborn/files/wandhelper/ent_list_pre.lua", "mods/Apotheosis/files/scripts/mod_compatibility/conjurer_populator.lua")
end
--Worse Enemies, Overrides Hisii Minecart visuals & attacks to match those from the mod
if ModIsEnabled("worse_enemies") then
local nxml = dofile_once("mods/Apotheosis/lib/nxml.lua")
local content = ModTextFileGetContent("data/entities/animals/hisii_minecart_tnt.xml")
local xml = nxml.parse(content)
xml:first_of("Base"):first_of("SpriteComponent").attr.image_file =
"mods/Apotheosis/files/enemies_gfx/hisii_minecart_worse_tnt.xml"
xml:first_of("Base"):first_of("AnimalAIComponent").attr.attack_ranged_entity_file =
"data/entities/projectiles/cocktail_gunpowder.xml"
ModTextFileSetContent("data/entities/animals/hisii_minecart_tnt.xml", tostring(xml))
local content = ModTextFileGetContent("data/entities/animals/hisii_minecart.xml")
local xml = nxml.parse(content)
xml:first_of("Base"):first_of("SpriteComponent").attr.image_file =
"mods/Apotheosis/files/enemies_gfx/hisii_minecart_worse.xml"
xml:first_of("Base"):first_of("AnimalAIComponent").attr.attack_ranged_entity_file =
"data/entities/projectiles/meteor_green.xml"
xml:first_of("Base"):first_of("DamageModelComponent").attr.hp = "1.0"
xml:add_child(nxml.parse([[
<SpriteComponent
_tags="character"
image_file="mods/Apotheosis/files/enemies_gfx/hisii_minecart_worse_emissive.xml"
offset_x="0"
offset_y="0"
alpha="1"
emissive="1"
additive="1">
</SpriteComponent>
]]))
ModTextFileSetContent("data/entities/animals/hisii_minecart.xml", tostring(xml))
local content = ModTextFileGetContent("data/entities/animals/hisii_minecart_weak.xml")
local xml = nxml.parse(content)
xml:first_of("Base"):first_of("SpriteComponent").attr.image_file =
"mods/Apotheosis/files/enemies_gfx/hisii_minecart_worse_weak.xml"
xml:first_of("Base"):first_of("AnimalAIComponent").attr.attack_ranged_entity_file =
"data/entities/projectiles/fireball_buckshot.xml"
ModTextFileSetContent("data/entities/animals/hisii_minecart_weak.xml", tostring(xml))
--Bat Illusion Fix
local content = ModTextFileGetContent("data/entities/animals/psychotic/bat.xml")
local xml = nxml.parse(content)
xml:first_of("Base"):first_of("SpriteComponent").attr.image_file = "data/enemies_gfx/worse/bat.xml"
ModTextFileSetContent("data/entities/animals/psychotic/bat.xml", tostring(xml))
--Illusion Shotgunner Hisii Fix
local content = ModTextFileGetContent("data/entities/animals/psychotic/shotgunner.xml")
local xml = nxml.parse(content)
xml:first_of("Base"):first_of("AnimalAIComponent").attr.attack_ranged_entity_file =
"mods/Apotheosis/files/entities/projectiles/psychotic/meteor_green.xml"
ModTextFileSetContent("data/entities/animals/psychotic/shotgunner.xml", tostring(xml))
end
-- Noita Toether compatibility, allows items like the new tablets, Fungus Stone & Hungry Orb to be added to the item bank
--This is done... weirdly
--[[
if ModIsEnabled("noita-together") then
ModLuaFileAppend( "mods/noita-together/files/scripts/item_list.lua", "mods/Apotheosis/files/scripts/mod_compatibility/nt_itemlist_populator.lua" )
end
]]
--
-- Graham's Dialogue Mod, have fun! -S
if ModIsEnabled("grahamsdialogue") then
ModLuaFileAppend("mods/grahamsdialogue/files/common.lua", "mods/Apotheosis/files/scripts/mod_compatibility/graham_dialogue_populator.lua")
ModTextFileSetContent( "mods/grahamsdialogue/files/font_data/font_pixel_flesh.xml", ModTextFileGetContent("mods/Apotheosis/files/fonts/font_pixel_flesh.xml") )
ModTextFileSetContent( "mods/grahamsdialogue/files/font_data/font_pixel_flesh.lua", ModTextFileGetContent("mods/Apotheosis/files/fonts/font_pixel_flesh.lua") )
end
-- Parallel Parity
if ModIsEnabled("parallel_parity") then
ModLuaFileAppend("mods/parallel_parity/data.lua", "mods/Apotheosis/files/scripts/mod_compatibility/parallel_parity_append.lua")
ModLuaFileAppend("mods/parallel_parity/settings.lua", "mods/Apotheosis/files/scripts/mod_compatibility/parallel_parity_settings.lua")
end
-- Custom Perk support injection
ModLuaFileAppend("data/scripts/perks/perk_list.lua", "mods/Apotheosis/files/scripts/perks/custom_perks.lua")
-- Add portals to spatial awareness
do
ModTextFileSetContent("data/scripts/perks/map.lua",ModTextFileGetContent("data/scripts/perks/map.lua"):gsub("if %( pw ~= 0 %) then", [[
do local x, y = GlobalsGetValue("apotheosis_markerportal_red_x", "INVALID"), GlobalsGetValue("apotheosis_markerportal_red_y", "INVALID") if x ~= "INVALID" then GameCreateSpriteForXFrames( "mods/Apotheosis/files/particles/spatial_map_portal_r.png", mi_x + ((x / 512) * 6) + 3, mi_y + ((y / 512) * 6) - 56, true, 0, 0, 1, true ) end end
do local x, y = GlobalsGetValue("apotheosis_markerportal_blue_x", "INVALID"), GlobalsGetValue("apotheosis_markerportal_blue_y", "INVALID") if x ~= "INVALID" then GameCreateSpriteForXFrames( "mods/Apotheosis/files/particles/spatial_map_portal_b.png", mi_x + ((x / 512) * 6) + 3, mi_y + ((y / 512) * 6) - 56, true, 0, 0, 1, true ) end end
do local x, y = GlobalsGetValue("apotheosis_markerportal_green_x", "INVALID"), GlobalsGetValue("apotheosis_markerportal_green_y", "INVALID") if x ~= "INVALID" then GameCreateSpriteForXFrames( "mods/Apotheosis/files/particles/spatial_map_portal_g.png", mi_x + ((x / 512) * 6) + 3, mi_y + ((y / 512) * 6) - 56, true, 0, 0, 1, true ) end end
if ( pw ~= 0 ) then]])
)
ModTextFileSetContent("data/scripts/perks/map.lua",ModTextFileGetContent("data/scripts/perks/map.lua"):gsub("is_moving == false", "true") )
end
-- Custom Status support injection
ModLuaFileAppend("data/scripts/status_effects/status_list.lua", "mods/Apotheosis/files/scripts/status_effects/status_effects.lua")
-- Custom Audio Support
ModRegisterAudioEventMappings("mods/Apotheosis/files/audio/GUIDs.txt")
-- Misc
--Twitch Integration
--01/01/2023 Conga: I will only add creature shifting as an event as it's functionality is exclusive to Apotheosis.
ModLuaFileAppend( "data/scripts/streaming_integration/event_list.lua", "mods/Apotheosis/files/scripts/streaming_integration/event_list_populator_apoth.lua" )
--Musicstone tag addition
dofile_once("mods/Apotheosis/files/scripts/magic/music_magic_tag_nxml.lua")
if HasFlagPersistent("action_apotheosis_aqua_mine") or HasFlagPersistent("action_apotheosis_bomb_giga") then
AddFlagPersistent("apotheosis_card_unlocked_welcome_hint")
end
--MOTD & Welcome Hint
if not (ModIsEnabled("raksa") or ModIsEnabled("conjurer_reborn")) then
local flag_status = HasFlagPersistent("apotheosis_card_unlocked_welcome_hint")
if motdSetting == true or is_holiday_active("april_fools") then
dofile_once("mods/Apotheosis/files/scripts/misc/motd_list.lua")
elseif flag_status == false then
--dofile_once( "mods/Apotheosis/files/scripts/misc/welcome_hint.lua" )
end
end
--Allows hisii to jump into minecarts
local nxml = dofile_once("mods/Apotheosis/lib/nxml.lua")
if ModIsEnabled("Ride Minecart") == false then
local content = ModTextFileGetContent("data/entities/props/physics_minecart.xml")
local xml = nxml.parse(content)
xml.attr.name = "minecart_hisii_hopin"
ModTextFileSetContent("data/entities/props/physics_minecart.xml", tostring(xml))
ModTextFileSetContent("data/entities/props/physics/minecart.xml", tostring(xml))
end
--local content = ModTextFileGetContent("data/entities/props/physics/minecart.xml")
--local xml = nxml.parse(content)
--xml.attr.name = "minecart_hisii_hopin"
--ModTextFileSetContent("data/entities/props/physics/minecart.xml", tostring(xml))
--Same thing but for hisii
local content = ModTextFileGetContent("data/entities/animals/shotgunner.xml")
local xml = nxml.parse(content)
xml:add_child(nxml.parse([[
<LuaComponent
script_source_file="mods/Apotheosis/files/scripts/buildings/hisii_minecart_hopin.lua"
execute_every_n_frame="60"
>
</LuaComponent>
]]))
ModTextFileSetContent("data/entities/animals/shotgunner.xml", tostring(xml))
--Same thing but for hisii with TNT
local content = ModTextFileGetContent("data/entities/animals/miner_weak.xml")
local xml = nxml.parse(content)
xml:add_child(nxml.parse([[
<LuaComponent
script_source_file="mods/Apotheosis/files/scripts/buildings/hisii_minecart_hopin_tnt.lua"
execute_every_n_frame="60"
>
</LuaComponent>
]]))
ModTextFileSetContent("data/entities/animals/miner_weak.xml", tostring(xml))
-- Stendari magic wetness fix
local content = ModTextFileGetContent("data/entities/animals/firemage.xml")
local xml = nxml.parse(content)
local attrs = xml:first_of("Base"):first_of("DamageModelComponent").attr
attrs.materials_that_damage = attrs.materials_that_damage .. ",water_fading"
attrs.materials_how_much_damage = attrs.materials_how_much_damage .. ",0.0005"
ModTextFileSetContent("data/entities/animals/firemage.xml", tostring(xml))
-- Gazer magic wetness fix
local content = ModTextFileGetContent("data/entities/animals/gazer.xml")
local xml = nxml.parse(content)
local attrs = xml:first_of("Base"):first_of("DamageModelComponent").attr
attrs.materials_that_damage = attrs.materials_that_damage .. ",water,water_fading"
attrs.materials_how_much_damage = attrs.materials_how_much_damage .. ",0.0005,0.0005"
ModTextFileSetContent("data/entities/animals/gazer.xml", tostring(xml))
-- Burning Skull magic wetness fix
local content = ModTextFileGetContent("data/entities/animals/fireskull.xml")
local xml = nxml.parse(content)
local attrs = xml:first_of("Base"):first_of("DamageModelComponent").attr
attrs.materials_that_damage = attrs.materials_that_damage .. ",water_fading"
attrs.materials_how_much_damage = attrs.materials_how_much_damage .. ",0.0005"
ModTextFileSetContent("data/entities/animals/fireskull.xml", tostring(xml))
-- Spit Monster magic wetness fix
local content = ModTextFileGetContent("data/entities/animals/spitmonster.xml")
local xml = nxml.parse(content)
local attrs = xml:first_of("Base"):first_of("DamageModelComponent").attr
attrs.materials_that_damage = attrs.materials_that_damage .. ",water,water_fading"
attrs.materials_how_much_damage = attrs.materials_how_much_damage .. ",0.0005,0.0005"
ModTextFileSetContent("data/entities/animals/spitmonster.xml", tostring(xml))
--Allows for essence of fungus to be turned into a stone
local content = ModTextFileGetContent("data/entities/buildings/essence_eater.xml")
local xml = nxml.parse(content)
xml:add_child(nxml.parse([[
<LuaComponent
execute_every_n_frame="-1"
script_death="mods/Apotheosis/files/scripts/essence/away_modded.lua"
remove_after_executed="0"
>
</LuaComponent>
]]))
ModTextFileSetContent("data/entities/buildings/essence_eater.xml", tostring(xml))
--Allows for moon shenanigans involving essences at the Sky Moon
local content = ModTextFileGetContent("data/entities/buildings/moon_altar.xml")
local xml = nxml.parse(content)
xml:add_child(nxml.parse([[
<LuaComponent
_enabled="1"
execute_every_n_frame="70"
script_source_file="mods/Apotheosis/files/scripts/magic/moon_altar_modded.lua"
>
</LuaComponent>
]]))
ModTextFileSetContent("data/entities/buildings/moon_altar.xml", tostring(xml))
--Allows for moon shenanigans involving essences at the Dark Moon
local content = ModTextFileGetContent("data/entities/buildings/dark_moon_altar.xml")
local xml = nxml.parse(content)
xml:add_child(nxml.parse([[
<LuaComponent
_enabled="1"
execute_every_n_frame="70"
script_source_file="mods/Apotheosis/files/scripts/magic/dark_moon_altar_modded.lua"
>
</LuaComponent>
]]))
ModTextFileSetContent("data/entities/buildings/dark_moon_altar.xml", tostring(xml))
--Resets Blob Boss kill reward to prevent cheesing multiple "reward events" per kill
ModLuaFileAppend("data/scripts/newgame_plus.lua", "mods/Apotheosis/files/scripts/newgame_plus_appends.lua")
--GameRemoveFlagRun( "apotheosis_blob_boss_slain" )
--Adds custom enlightened alchemist types
--Could instead have a script that has a 2 in 6 chance to occur, and if it does make the alchemist one of the new variants, and append all this as a script on the englightened alch entity that runs after the vanilla init occurs
local content = ModTextFileGetContent("mods/Apotheosis/files/scripts/mod_compatibility/vanilla_enlightened_alchemist_init_append.lua")
ModTextFileSetContent("data/scripts/animals/enlightened_alchemist_init.lua", tostring(content))
--ModLuaFileAppend( "data/scripts/animals/enlightened_alchemist_init.lua", "mods/Apotheosis/files/scripts/mod_compatibility/vanilla_enlightened_alchemist_init_append.lua" )
-- Adds musical_stone tag to the worm projectile, not to make musical ghosts appear but rather to make it double for a "spells to worms" effect
local content = ModTextFileGetContent("data/entities/projectiles/deck/worm_shot.xml")
local xml = nxml.parse(content)
xml.attr.tags = xml.attr.tags .. ",musical_stone"
ModTextFileSetContent("data/entities/projectiles/deck/worm_shot.xml", tostring(xml))
-- Adds various powders to dissolve powders perk
local content = ModTextFileGetContent("data/entities/misc/perks/dissolve_powders.xml")
local xml = nxml.parse(content)
local attrs = xml:first_of("CellEaterComponent").attr
attrs.materials = attrs.materials .. ",apotheosis_insect_husk,apotheosis_sand_pink,templebrick_static_broken_apotheosisoft,sand_blue"
ModTextFileSetContent("data/entities/misc/perks/dissolve_powders.xml", tostring(xml))
-- Adds various liquids to freeze charge modifier
local content = ModTextFileGetContent("data/entities/particles/freeze_charge.xml")
local xml = nxml.parse(content)
local attrs = xml:all_of("MagicConvertMaterialComponent")
attrs[2].attr.from_material_array = attrs[2].attr.from_material_array .. ",apotheosis_water_fading_fast,water_fading"
attrs[2].attr.to_material_array = attrs[2].attr.to_material_array .. ",ice_static,ice_static"
ModTextFileSetContent("data/entities/particles/freeze_charge.xml", tostring(xml))
-- Adds various liquids to circle of stillness
local content = ModTextFileGetContent("data/entities/projectiles/deck/freeze_field.xml")
local xml = nxml.parse(content)
xml:add_child(nxml.parse([[
<MagicConvertMaterialComponent
kill_when_finished="0"
from_material="water_fading"
steps_per_frame="5"
to_material="ice_static"
is_circle="1"
radius="72" >
</MagicConvertMaterialComponent>
]]))
ModTextFileSetContent("data/entities/projectiles/deck/freeze_field.xml", tostring(xml))
-- Adds various liquids to freeze field perk
local content = ModTextFileGetContent("data/entities/misc/perks/freeze_field.xml")
local xml = nxml.parse(content)
xml:add_child(nxml.parse([[
<MagicConvertMaterialComponent
kill_when_finished="0"
from_material="apotheosis_water_fading_fast"
steps_per_frame="5"
to_material="ice_static"
is_circle="1"
radius="72" >
</MagicConvertMaterialComponent>
]]))
ModTextFileSetContent("data/entities/misc/perks/freeze_field.xml", tostring(xml))
--Boss health multiplier insertion
dofile_once("mods/Apotheosis/files/scripts/mod_compatibility/boss_health_multiplier_plug.lua")
--Boss vulnerability immunity insertion
dofile_once("mods/Apotheosis/files/scripts/mod_compatibility/boss_vulnerability_immune_plug.lua")
--Modifies vanilla entity data
--Try not to tinker with base noita too much, the main goal to this mod is to be an expansion pack, not a rebalance.
dofile_once("mods/Apotheosis/files/scripts/mod_compatibility/vanilla_appends.lua")
dofile_once("mods/Apotheosis/files/scripts/mod_compatibility/seasonal_tweaks.lua")
--Master of Masters master spawner insertion, allows him to spawn Master of Mallards & Master of Immortality too.. He doesn't appreciate Master of Trolling too much to invite him in
--Note, this has been moved to a file override, could probably use string.gsub to fix that
--Note 17/07/2023, string.gsub has been used
-- Seasonal Events
if seasonalSetting == true then
-- Halloween Event
if is_holiday_active("halloween") then
ModLuaFileAppend("data/scripts/biomes/coalmine.lua", "mods/Apotheosis/files/scripts/biomes/seasonal/halloween.lua") --Coal Mine, first area, goodluck on your run
ModLuaFileAppend("data/scripts/biomes/coalmine_alt.lua", "mods/Apotheosis/files/scripts/biomes/seasonal/halloween.lua") --Coalmine but to the west side near damp cave
ModLuaFileAppend("data/scripts/biomes/excavationsite.lua", "mods/Apotheosis/files/scripts/biomes/seasonal/halloween.lua") --Coal Pits, area 2
ModLuaFileAppend("data/scripts/biomes/pyramid.lua", "mods/Apotheosis/files/scripts/biomes/seasonal/halloween.lua") --Presumably everything below the entrance to the pyramid
--ModLuaFileAppend("data/scripts/biomes/sandcave.lua", "mods/Apotheosis/files/scripts/biomes/seasonal/halloween.lua") --Meant to add jackolaterns to the sandcaves, but no lamps naturally spawn down there, effort to work it in.
local nxml = dofile_once("mods/Apotheosis/lib/nxml.lua")
local content = ModTextFileGetContent("data/entities/animals/poring.xml")
content, count = content:gsub([[script_death="mods/Apotheosis/files/scripts/animals/poring_death_explosion.lua"]], [[script_death="mods/Apotheosis/files/scripts/animals/poring_halloween_death_explosion.lua"]])
local xml = nxml.parse(content)
xml:first_of("Base"):first_of("SpriteComponent").attr.image_file =
"mods/Apotheosis/files/enemies_gfx/poring_halloween.xml"
xml:first_of("Base"):first_of("DamageModelComponent").attr.ragdoll_filenames_file =
"mods/Apotheosis/files/ragdolls/poring_halloween/filenames.txt"
ModTextFileSetContent("data/entities/animals/poring.xml", tostring(xml))
local content = ModTextFileGetContent("data/entities/animals/coal_mines/poring.xml")
content, count = content:gsub([[script_death="mods/Apotheosis/files/scripts/animals/poring_death_explosion.lua"]], [[script_death="mods/Apotheosis/files/scripts/animals/poring_halloween_death_explosion.lua"]])
local xml = nxml.parse(content)
xml:first_of("Base"):first_of("SpriteComponent").attr.image_file =
"mods/Apotheosis/files/enemies_gfx/poring_halloween_weak.xml"
xml:first_of("Base"):first_of("DamageModelComponent").attr.ragdoll_filenames_file =
"mods/Apotheosis/files/ragdolls/poring_halloween_weak/filenames.txt"
ModTextFileSetContent("data/entities/animals/coal_mines/poring.xml", tostring(xml))
local content = ModTextFileGetContent("data/entities/animals/psychotic/poring.xml")
local xml = nxml.parse(content)
xml:first_of("Base"):first_of("SpriteComponent").attr.image_file =
"mods/Apotheosis/files/enemies_gfx/poring_halloween.xml"
xml:first_of("Base"):first_of("DamageModelComponent").attr.ragdoll_filenames_file =
"mods/Apotheosis/files/ragdolls/poring_halloween/filenames.txt"
ModTextFileSetContent("data/entities/animals/psychotic/poring.xml", tostring(xml))
end
-- Smissmass Event
if is_holiday_active("smissmass") then
local nxml = dofile_once("mods/Apotheosis/lib/nxml.lua")
local content = ModTextFileGetContent("data/entities/animals/hisii_minecart_tnt.xml")
local xml = nxml.parse(content)
xml:first_of("Base"):first_of("SpriteComponent").attr.image_file =
"mods/Apotheosis/files/enemies_gfx/hisii_minecart_tnt_santa.xml"
xml:first_of("Base"):first_of("AnimalAIComponent").attr.attack_ranged_entity_file =
"data/entities/projectiles/present.xml"
xml:add_child(nxml.parse([[
<LuaComponent
script_source_file="mods/Apotheosis/files/scripts/animals/esoteric_being_shifted_smoke.lua"
execute_every_n_frame="1"
remove_after_executed="1"
>
</LuaComponent>
]]))
ModTextFileSetContent("data/entities/animals/hisii_minecart_tnt.xml", tostring(xml))
if ModIsEnabled("worse_enemies") then
local content = ModTextFileGetContent("data/entities/animals/hisii_minecart.xml")
local xml = nxml.parse(content)
xml:first_of("Base"):first_of("SpriteComponent").attr.image_file =
"mods/Apotheosis/files/enemies_gfx/hisii_minecart_worse_smissmass.xml"
ModTextFileSetContent("data/entities/animals/hisii_minecart.xml", tostring(xml))
else
local content = ModTextFileGetContent("data/entities/animals/hisii_minecart.xml")
local xml = nxml.parse(content)
xml:first_of("Base"):first_of("SpriteComponent").attr.image_file =
"mods/Apotheosis/files/enemies_gfx/hisii_minecart_smissmass.xml"
ModTextFileSetContent("data/entities/animals/hisii_minecart.xml", tostring(xml))
end
if ModIsEnabled("worse_enemies") then
local content = ModTextFileGetContent("data/entities/animals/hisii_minecart_weak.xml")
local xml = nxml.parse(content)
xml:first_of("Base"):first_of("SpriteComponent").attr.image_file =
"mods/Apotheosis/files/enemies_gfx/hisii_minecart_worse_weak_smissmass.xml"
ModTextFileSetContent("data/entities/animals/hisii_minecart_weak.xml", tostring(xml))
else
local content = ModTextFileGetContent("data/entities/animals/hisii_minecart_weak.xml")
local xml = nxml.parse(content)
xml:first_of("Base"):first_of("SpriteComponent").attr.image_file =
"mods/Apotheosis/files/enemies_gfx/hisii_minecart_weak_smissmass.xml"
ModTextFileSetContent("data/entities/animals/hisii_minecart_weak.xml", tostring(xml))
end
local nxml = dofile_once("mods/Apotheosis/lib/nxml.lua")
local content = ModTextFileGetContent("data/entities/animals/poring.xml")
local xml = nxml.parse(content)
xml:first_of("Base"):first_of("SpriteComponent").attr.image_file =
"mods/Apotheosis/files/enemies_gfx/poring_santa.xml"
ModTextFileSetContent("data/entities/animals/poring.xml", tostring(xml))
local nxml = dofile_once("mods/Apotheosis/lib/nxml.lua")
local content = ModTextFileGetContent("data/entities/animals/coal_mines/poring.xml")
local xml = nxml.parse(content)
xml:first_of("Base"):first_of("SpriteComponent").attr.image_file =
"mods/Apotheosis/files/enemies_gfx/poring_santa_weak.xml"
ModTextFileSetContent("data/entities/animals/coal_mines/poring.xml", tostring(xml))
end
-- Birthday Event
-- Update to be centered on 21/07/2022, this is when the first enemy was created and development officially began. Should be a fair trade off between not being the official release date but also not clashing with Halloween
--Remember Update global_populator & global_populator_small too, wand tinkering crystal spawns are inside.
if is_holiday_active("birthday") then
ModLuaFileAppend("data/scripts/biomes/hills.lua", "mods/Apotheosis/files/scripts/biomes/seasonal/birthday.lua") --Hills slightly below ground
ModLuaFileAppend("data/scripts/biomes/coalmine.lua", "mods/Apotheosis/files/scripts/biomes/seasonal/birthday.lua") --Coal Mine, first area, goodluck on your run
ModLuaFileAppend("data/scripts/biomes/coalmine_alt.lua",
"mods/Apotheosis/files/scripts/biomes/seasonal/birthday.lua") --Coalmine but to the west side near damp cave
ModLuaFileAppend("data/scripts/biomes/excavationsite.lua",
"mods/Apotheosis/files/scripts/biomes/seasonal/birthday.lua") --Coal Pits, area 2
ModLuaFileAppend("data/scripts/biomes/snowcave.lua",
"mods/Apotheosis/files/scripts/biomes/seasonal/birthday_rare.lua") --Hiisi Base
ModLuaFileAppend("data/scripts/biomes/snowcastle.lua",
"mods/Apotheosis/files/scripts/biomes/seasonal/birthday_rare.lua")
ModLuaFileAppend("data/scripts/biomes/desert.lua", "mods/Apotheosis/files/scripts/biomes/seasonal/birthday.lua")
ModLuaFileAppend("data/scripts/biomes/rainforest.lua",
"mods/Apotheosis/files/scripts/biomes/seasonal/birthday_rare.lua")
ModLuaFileAppend("data/scripts/biomes/vault.lua",
"mods/Apotheosis/files/scripts/biomes/seasonal/birthday_rare.lua")
end
-- April Fools Event
if is_holiday_active("april_fools") then
--Replace all hisii hobos with clowns.
local content = ModTextFileGetContent("data/entities/animals/seasonal/hisii_hobo.xml")
ModTextFileSetContent("data/entities/animals/hisii_hobo.xml", content)
--Replace small fairies with lethal versions.
local content = ModTextFileGetContent("data/entities/animals/seasonal/fairy_cheap.xml")
ModTextFileSetContent("data/entities/animals/fairy_cheap.xml", content)
--Replace big fairies with non-lethal versions.
local content = ModTextFileGetContent("data/entities/animals/seasonal/fairy_big.xml")
ModTextFileSetContent("data/entities/animals/fairy_big.xml", content)
do -- Rename overgrown caverns to wandmart
local path = "data/biome/fungiforest.xml"
local content = ModTextFileGetContent(path)
content = content:gsub("$biome_fun", "$biome_fungiforest_aprilfools")
ModTextFileSetContent(path, content)
end
--100% chance for the Temple of the Art to be spawn everything
ModLuaFileAppend("data/scripts/biomes/crypt.lua", "mods/Apotheosis/files/scripts/biomes/global_everything_populator.lua")
end
end
--Dark Areas
ModLuaFileAppend("data/scripts/biomes/wizardcave.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua") --Wizard's Den, aside from the darkness it's pretty habitable. Polymorph liquid is scarier, I can't shield that.
ModLuaFileAppend("data/scripts/biomes/crypt.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua") --Temple of the Arts.. who died here?
ModLuaFileAppend("data/scripts/biomes/pyramid.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua") --Presumably everything below the entrance to the pyramid
ModLuaFileAppend("data/scripts/biomes/fungicave.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua") --BUNGUS!! cave, west side of area 2 for example
ModLuaFileAppend("data/scripts/biomes/fungiforest.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua") --Overgrowth
ModLuaFileAppend("data/scripts/biomes/wandcave.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua") --Magical temple.. huh
ModLuaFileAppend("data/scripts/biomes/sandcave.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua") --Desert sand cave, I don't think it includes desert chasm
ModLuaFileAppend("data/scripts/biomes/vault.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua") --The Vault
ModLuaFileAppend("data/scripts/biomes/winter.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua") --Winter appears to be the snow chasm... terrifying.
ModLuaFileAppend("data/scripts/biomes/rainforest_dark.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua") --Lukki Lair.. creepy
ModLuaFileAppend("data/scripts/biomes/vault_frozen.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua") --Like the vault, but way colder, worse, more hisii and with a really rude welcoming
ModLuaFileAppend("data/scripts/biomes/robobase.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua") --Power Plant
ModLuaFileAppend("data/scripts/biomes/the_end.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua") --Heaven & Hell, but for this specific lua file append I'm only adding to hell
ModLuaFileAppend( "mods/Apotheosis/files/scripts/biomes/newbiome/evil_temple.lua", "mods/Apotheosis/files/scripts/biomes/suspicious.lua" ) --Temple of Sacrilegious Remains
--Secret
do -- Player Editor
local path = "data/entities/player_base.xml"
local xml = nxml.parse(ModTextFileGetContent(path))
--Adds Biome tracker script to the player character, it will update their current biome difficulty and save the highest one they've ever achieved, maxing out at 7 in Heaven/Hell
--This is currently only used for twitch integration so is disabled if TI is turned off, can be changed if needed elsewhere
-- xml:add_child(nxml.parse([[
-- <LuaComponent
-- script_source_file="mods/Apotheosis/files/scripts/magic/biome_difficulty_tracker.lua"
-- execute_every_n_frame="600"
-- execute_times="-1"
-- remove_after_executed="0"
-- >
-- </LuaComponent>
-- ]]))
--Makes player take contact damage from cursed liquid, poisonous gas, and other materials added by Apotheosis
--Cursed Liquid, Cursed Liquid (Static), Poisonous Gas, Radioactive Gas (Fading)
local attrs = xml:first_of("DamageModelComponent").attr
attrs.materials_that_damage = attrs.materials_that_damage .. ",apotheosis_cursed_liquid_red,apotheosis_cursed_liquid_red_static,poison_gas,apotheosis_radioactive_gas_fading"
attrs.materials_how_much_damage = attrs.materials_how_much_damage .. ",0.003,0.003,0.0008,0.001"
if HasFlagPersistent("apotheosis_card_unlocked_secret_knowledge_of_kings") and capeSetting then
--Adds Golden Cape if check is successful
xml:add_child(nxml.parse([[
<LuaComponent
script_source_file="data/apotheosis_gfx/player_cape_colour_append.lua"
execute_every_n_frame="2"
execute_times="1"
remove_after_executed="1"
>
</LuaComponent>
]]))
end
--Adds Parallel World checker to the player
--Adds vampirism HP scaling
--Previously every 30 seconds, now every 10 seconds after vampirism buff
xml:add_child(nxml.parse([[
<LuaComponent
script_source_file="mods/Apotheosis/files/scripts/magic/player_parallel_check.lua"
execute_every_n_frame="600"
execute_times="-1"
remove_after_executed="0"
>
</LuaComponent>
]]))
--Since Heretic now has a new way to be summoned tied to a new area we don't want people in old runs to be locked out of him -S
xml:add_child(nxml.parse([[
<LuaComponent
script_source_file="mods/Apotheosis/files/scripts/magic/new_run_check.lua"
execute_every_n_frame="60"
remove_after_executed="1"
>
</LuaComponent>
]]))
--Causes the player to gain the wounded status upon taking damage.
xml:add_child(nxml.parse([[
<LuaComponent
_enabled="0"
_tags="hardcore_healing"
script_damage_received="mods/Apotheosis/files/scripts/setup/hardcore_damage.lua"
execute_every_n_frame="-1"
>
</LuaComponent>
]]))
--Causes the player to gain the wounded status upon taking damage.
xml:add_child(nxml.parse([[
<LuaComponent
_enabled="0"
_tags="hardcore_healing"
script_damage_about_to_be_received="mods/Apotheosis/files/scripts/setup/hardcore_healthcap.lua"
execute_every_n_frame="-1"
>
</LuaComponent>
]]))
--Spellbook support
xml:add_child(nxml.parse([[
<VariableStorageComponent
name="spellbook_spell"
value_string=""
></VariableStorageComponent>
]]))
--Adds Biome Check to the player
xml:add_child(nxml.parse([[
<Entity>
<Base file="mods/Apotheosis/files/scripts/magic/biome_effects.xml" >
</Base>
</Entity>
]]))
--Adds minimum cast delay gun extra to the player
xml:add_child(nxml.parse([[
<ShotEffectComponent
extra_modifier="apotheosis_min_cast_delay"
>
</ShotEffectComponent>
]]))