-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.cs
More file actions
1485 lines (1124 loc) · 55 KB
/
Main.cs
File metadata and controls
1485 lines (1124 loc) · 55 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
using Harmony;
using Il2Cpp;
using Il2CppAssets.Scripts.Simulation.Bloons.Behaviors;
using Il2CppAssets.Scripts.Unity.UI_New.ChallengeEditor;
using Il2CppAssets.Scripts.Unity.UI_New.InGame;
using Il2CppNinjaKiwi.Common;
using Il2CppNinjaKiwi.NKMulti.IO;
using Il2CppTMPro;
using System.IO;
using System.Runtime.CompilerServices;
using UnityEngine;
using Il2CppAssets.Scripts.Data;
using Il2CppAssets.Scripts.Data.MapSets;
using Il2CppAssets.Scripts.Models;
using Il2CppAssets.Scripts.Models.GenericBehaviors;
using Il2CppAssets.Scripts.Models.Map;
using Il2CppAssets.Scripts.Models.Towers;
using Il2CppAssets.Scripts.Models.Towers.Behaviors;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Attack;
using Il2CppAssets.Scripts.Models.Towers.Projectiles;
using Il2CppAssets.Scripts.Models.Towers.Projectiles.Behaviors;
using Il2CppAssets.Scripts.Models.Towers.Weapons;
using Il2CppAssets.Scripts.Unity;
using Il2CppAssets.Scripts.Unity.Bridge;
using Il2CppAssets.Scripts.Unity.Display;
using Il2CppAssets.Scripts.Unity.Map;
using Il2CppAssets.Scripts.Unity.UI_New;
using Il2CppAssets.Scripts.Unity.UI_New.InGame;
using Il2CppNinjaKiwi.Common;
using UnityEngine;
using Il2CppAssets.Scripts.Simulation.Towers;
using Il2CppAssets.Scripts.Models.Gameplay.Mods;
[assembly: MelonModInfo(typeof(MoreGameModes.MoreGameModes), MoreGameModes.ModHelperData.Name, MoreGameModes.ModHelperData.Version, MoreGameModes.ModHelperData.RepoOwner)]
[assembly: MelonGame("Ninja Kiwi", "BloonsTD6")]
namespace MoreGameModes;
public class MoreGameModes : BloonsTD6Mod
{
private static readonly ModSettingBool savetofile = new(false)
{
displayName = "Save Random Rounds to file?",
button = true,
};
private static readonly ModSettingDouble InflationFloat = new(1.05)
{
displayName = "Inflation Percentage",
min = 0,
max = 100,
};
public const string EventId = nameof(MoreGameModes);
public override void OnBloonCreated(Bloon bloon)
{
// MelonLogger.Msg(bloon.bloonModel.maxHealth);
// MelonLogger.Msg(InGame.instance.GetGameModel().gameMode.ToString());
}
public override void OnTowerUpgraded(Tower tower, string upgradeName, TowerModel newBaseTowerModel)
{
if (InGame.instance.GetGameModel().roundSet.name.Contains("Inflation"))
{
foreach (var a in InGame.instance.GetGameModel().upgrades)
{
a.cost = (int)(a.cost * InflationFloat);
if (a.cost < 0)
{
// MelonLogger.Msg("Overflow :)");
a.cost = 2147000000;
}
}
foreach (var a in InGame.instance.GetGameModel().towers)
{
a.cost = (int)(a.cost * InflationFloat);
if (a.cost < 0)
{
// MelonLogger.Msg("Overflow :)");
a.cost = 2147000000;
}
}
}
}
public override void OnNewGameModel(GameModel result)
{
//MelonLogger.Msg(result.GetRoundSet().name.ToString());
if (result.roundSet.name.ToString().Contains("Small"))
{
foreach (DisplayModel displayModel in Il2CppGenericIEnumerableExt.ToList<DisplayModel>(result.GetDescendants<DisplayModel>()))
{
// displayModel.scale *= 0.33333334f;
displayModel.positionOffset *= 0.33333334f;
}
foreach (TowerModel tower in Il2CppGenericIEnumerableExt.ToList<TowerModel>(result.GetDescendants<TowerModel>()))
{
tower.range *= 0.5f;
tower.displayScale *= 0.55555f;
foreach (AttackModel am in TowerModelExt.GetAttackModels(tower))
{
am.range *= 0.5f;
am.offsetX *= 0.33333334f;
am.offsetY *= 0.33333334f;
am.offsetZ *= 0.33333334f;
foreach (WeaponModel weaponModel in am.weapons)
{
weaponModel.ejectX *= 0.33333334f;
weaponModel.ejectY *= 0.33333334f;
weaponModel.ejectZ *= 0.33333334f;
}
}
tower.radius *= 0.33333334f;
CircleFootprintModel circleFootprintModel = tower.footprint.TryCast<CircleFootprintModel>();
RectangleFootprintModel rectangleFootprintModel = tower.footprint.TryCast<RectangleFootprintModel>();
bool flag2 = circleFootprintModel != null;
if (flag2)
{
circleFootprintModel.radius *= 0.53333334f;
}
bool flag3 = rectangleFootprintModel != null;
if (flag3)
{
rectangleFootprintModel.xWidth *= 0.53333334f;
rectangleFootprintModel.yWidth *= 0.53333334f;
}
}
foreach (ProjectileModel projectile in Il2CppGenericIEnumerableExt.ToList<ProjectileModel>(result.GetDescendants<ProjectileModel>()))
{
projectile.radius *= 0.33333334f;
projectile.pierce *= 0.5f;
if (projectile.GetBehavior<CashModel>() != null)
{
projectile.GetBehavior<CashModel>().minimum *= 0.7f;
projectile.GetBehavior<CashModel>().maximum *= 0.7f;
}
}
foreach (WeaponModel weapon in Il2CppGenericIEnumerableExt.ToList<WeaponModel>(result.GetDescendants<WeaponModel>()))
{
weapon.rate *= 1.5555f;
}
foreach (MonkeyopolisModel monkeyopolisModel in Il2CppGenericIEnumerableExt.ToList<MonkeyopolisModel>(result.GetDescendants<MonkeyopolisModel>()))
{
monkeyopolisModel.cashFromCrate *= (int)1.42857143f;
monkeyopolisModel.valueRequiredForCrate *= (int)0.7f;
}
foreach (DamageModel damageModel in Il2CppGenericIEnumerableExt.ToList<DamageModel>(result.GetDescendants<DamageModel>()))
{
if (damageModel.damage * 0.8f > 1)
{
damageModel.damage = (float)System.Math.Floor(damageModel.damage * 0.8f);
}
}
foreach (TravelStraitModel behavior in Il2CppGenericIEnumerableExt.ToList<TravelStraitModel>(result.GetDescendants<TravelStraitModel>()))
{
behavior.lifespan *= 0.33333334f;
behavior.lifespanFrames = (int)(0.33333334f * (float)behavior.lifespanFrames);
}
foreach (TravelCurvyModel behavior2 in Il2CppGenericIEnumerableExt.ToList<TravelCurvyModel>(result.GetDescendants<TravelCurvyModel>()))
{
behavior2.lifespan *= 0.33333334f;
behavior2.lifespanFrames = (int)(0.33333334f * (float)behavior2.lifespanFrames);
}
foreach (TravelAlongPathModel behavior3 in Il2CppGenericIEnumerableExt.ToList<TravelAlongPathModel>(result.GetDescendants<TravelAlongPathModel>()))
{
float lifespan = (float)behavior3.lifespanFrames * 0.33333334f;
behavior3.lifespanFrames = (int)lifespan;
behavior3.range *= 0.33333334f;
}
}
if(result.roundSet.name.Contains("Inflation"))
{
foreach (var inflat in result.upgrades)
{
inflat.cost = (int)(inflat.cost * 0.25f);
}
foreach (var inflat in result.towers)
{
inflat.cost = (int)(inflat.cost * 0.25f);
}
}
}
public override void OnApplicationStart()
{
//UnityEngine.Random.seed = UnityEngine.Random.RandomRangeInt(0, 57347985);
if (!Directory.Exists("Mods/Gamemodes++/"))
{
Directory.CreateDirectory("Mods/Gamemodes++/");
}
if (!File.Exists("Mods/Gamemodes++/CurrentRandomRounds.txt"))
{
if (Debugmode) { MelonLogger.Msg("CurrentRandomRounds.txt doesn't exist, creating it..."); }
try
{
File.Create("Mods/Gamemodes++/CurrentRandomRounds.txt").Close();
}
catch {
if (Debugmode)
{
MelonLogger.Msg("Upcoming error, sorry mate :(");
}
File.Create("Mods/Gamemodes++/CurrentRandomRounds.txt").Close();
}
File.WriteAllText("Mods/Gamemodes++/CurrentRandomRounds.txt", "Seed: \n" + UnityEngine.Random.seed.ToString() + "\n");
try
{
string[] fuckyou = File.ReadAllLines("Mods/Gamemodes++/CurrentRandomRounds.txt");
UnityEngine.Random.seed = Convert.ToInt32(fuckyou[1]);
}
catch
{
if (Debugmode)
{
MelonLogger.Msg("Something went wrong, trying again :/");
}
File.WriteAllText("Mods/Gamemodes++/CurrentRandomRounds.txt", "Seed: \n" + UnityEngine.Random.seed.ToString() + "\n");
}
if (Debugmode)
{
MelonLogger.Msg("CurrentRandomRounds.txt does exist :/");
}
string[] lines = File.ReadAllLines("Mods/Gamemodes++/CurrentRandomRounds.txt");
UnityEngine.Random.seed = Convert.ToInt32(lines[1]);
if (Debugmode)
{
MelonLogger.Msg(UnityEngine.Random.seed);
}
File.WriteAllText("Mods/Gamemodes++/CurrentRandomRounds.txt", "Seed: \n" + UnityEngine.Random.seed.ToString() + "\n");
}
if (File.Exists("Mods/Gamemodes++/CurrentRandomRounds.txt"))
{
try
{
string[] fuckyou = File.ReadAllLines("Mods/Gamemodes++/CurrentRandomRounds.txt");
UnityEngine.Random.seed = Convert.ToInt32(fuckyou[1]);
}
catch
{
if (Debugmode)
{
MelonLogger.Msg("Something went wrong, trying again :/");
}
File.WriteAllText("Mods/Gamemodes++/CurrentRandomRounds.txt", "Seed: \n" + UnityEngine.Random.seed.ToString() + "\n");
}
if (Debugmode)
{
MelonLogger.Msg("CurrentRandomRounds.txt does exist :/");
}
string[] lines = File.ReadAllLines("Mods/Gamemodes++/CurrentRandomRounds.txt");
UnityEngine.Random.seed = Convert.ToInt32(lines[1]);
if (Debugmode)
{
MelonLogger.Msg(UnityEngine.Random.seed);
}
File.WriteAllText("Mods/Gamemodes++/CurrentRandomRounds.txt", "Seed: \n" + UnityEngine.Random.seed.ToString() + "\n");
}
}
private static readonly string path = "Mods/Gamemodes++/";
private static readonly string roundsnotespath = path + "CurrentRandomRounds.txt";
static float[] startingcashs = new float[]
{
5000f
,8000f
,17000f
,38000f
,71000f
};
//settings
private static readonly System.Collections.Generic.Dictionary<string, string> promotionMap = new System.Collections.Generic.Dictionary<string, string>()
{
{ "Red", "Blue" },
{ "RedCamo", "BlueCamo" },
{ "RedRegrow", "BlueRegrow" },
{ "RedRegrowCamo", "BlueRegrowCamo" },
{ "Blue", "Green" },
{ "BlueCamo", "GreenCamo" },
{ "BlueRegrow", "GreenRegrow" },
{ "BlueRegrowCamo", "GreenRegrowCamo" },
{ "Green", "Yellow" },
{ "GreenCamo", "YellowCamo" },
{ "GreenRegrow", "YellowRegrow" },
{ "GreenRegrowCamo", "YellowRegrowCamo" },
{ "Yellow", "Pink" },
{ "YellowCamo", "PinkCamo" },
{ "YellowRegrow", "PinkRegrow" },
{ "YellowRegrowCamo", "PinkRegrowCamo" },
{ "Pink", "Purple" },
{ "PinkCamo", "PurpleCamo" },
{ "PinkRegrow", "PurpleRegrow" },
{ "PinkRegrowCamo", "PurpleRegrowCamo" },
{ "Black", "Lead" },
{ "BlackCamo", "LeadCamo" },
{ "BlackRegrow", "LeadRegrow" },
{ "BlackRegrowCamo", "LeadRegrowCamo" },
{ "White", "Zebra" },
{ "WhiteCamo", "ZebraCamo" },
{ "WhiteRegrow", "ZebraRegrow" },
{ "WhiteRegrowCamo", "ZebraRegrowCamo" },
{ "Purple", "Rainbow" },
{ "PurpleCamo", "RainbowCamo" },
{ "PurpleRegrow", "RainbowRegrow" },
{ "PurpleRegrowCamo", "RainbowRegrowCamo" },
{ "Lead", "Rainbow" },
{ "LeadCamo", "RainbowCamo" },
{ "LeadRegrow", "RainbowRegrow" },
{ "LeadRegrowCamo", "RainbowRegrowCamo" },
{ "LeadFortified", "RainbowRegrowCamo" },
{ "LeadRegrowFortified", "RainbowRegrowCamo" },
{ "LeadFortifiedCamo", "RainbowRegrowCamo" },
{ "LeadRegrowFortifiedCamo", "RainbowRegrowCamo" },
{ "Zebra", "Rainbow" },
{ "ZebraCamo", "RainbowCamo" },
{ "ZebraRegrow", "RainbowRegrow" },
{ "ZebraRegrowCamo", "RainbowRegrowCamo" },
{ "Rainbow", "Ceramic" },
{ "Rainbow ", "Ceramic" },
{ "RainbowCamo", "CeramicCamo" },
{ "RainbowRegrow", "CeramicRegrow" },
{ "RainbowRegrowCamo", "CeramicRegrowCamo" },
{ "Ceramic", "Moab" },
{ "CeramicCamo", "Moab" },
{ "CeramicRegrow", "Moab" },
{ "CeramicRegrowCamo", "Moab" },
{ "CeramicFortified", "MoabFortified" },
{ "CeramicFortifiedCamo", "MoabFortified" },
{ "CeramicRegrowFortified", "MoabFortified" },
{ "CeramicRegrowFortifiedCamo", "MoabFortified" },
{ "Moab", "Bfb" },
{ "MoabFortified", "BfbFortified" },
{ "Bfb", "Zomg" },
{ "BfbFortified", "ZomgFortified" },
{ "DdtCamo", "DdtFortifiedCamo" },
{ "DdtFortifiedCamo", "DdtFortifiedCamo" },
{ "Zomg", "Bad" },
{ "ZomgFortified", "BadFortified" },
{ "Bad", "Bloonarius3" },
{ "BadFortified", "BloonariusElite3" },
{ "Bloonarius3", "Bloonarius3" },
{ "BloonariusElite3", "BloonariusElite3" }
};
private static readonly System.Collections.Generic.Dictionary<string, string> promotionMap2 = new System.Collections.Generic.Dictionary<string, string>()
{
{ "Lead", "CeramicFortifiedCamo" },
{ "LeadCamo", "CeramicFortifiedCamo" },
{ "LeadRegrow", "CeramicRegrowFortifiedCamo" },
{ "LeadRegrowCamo", "CeramicRegrowFortifiedCamo" },
{ "LeadFortified", "CeramicFortifiedCamo" },
{ "LeadRegrowFortified", "CeramicRegrowFortifiedCamo" },
{ "LeadFortifiedCamo", "CeramicRegrowFortifiedCamo" },
{ "LeadRegrowFortifiedCamo", "CeramicRegrowFortifiedCamo" },
};
private static readonly ModSettingBool FastTrackEnabled = new(false)
{
displayName = "Fast Track Enabled",
button = true
};
/*
private static readonly ModSettingInt Seed = new(0)
{
displayName = "Seed",
min = -9999999999,
max = 9999999999,
};
private static readonly ModSettingButton RamdomizeSeed = new(() => UnityEngine.Random.seed = Seed)
{
displayName = "Set Seed",
buttonText = "Set it",
action = () => {
File.AppendAllText(roundsnotespath, "Seed: \n " + Seed);
},
requiresRestart = true,
};
*/
private static readonly ModSettingInt MasterModeScale = new(1)
{
displayName = "Master Mode Boost",
slider= true,
min =1,
max =12,
requiresRestart= true,
};
private static readonly ModSettingBool EliteBosses = new(false)
{
displayName = "Elite Bosses",
requiresRestart = true,
};
/* private static readonly ModSettingBool BossRoundOverride = new(false)
{
displayName = "Override Boss Rounds with normal rounds",
description = "Will cause some amount of lags when entering a game." +
"\n Designed to be used with co-op mode " +
"\n USE AT YOUR OWN RISK",
requiresRestart = true,
};*/
private static readonly ModSettingDouble MoabHpScale = new(4)
{
displayName = "Moab Health Boost",
// slider = true,
min = 0,
max = 999999,
requiresRestart = true,
};
private static readonly ModSettingDouble CeramicHpScale = new(4)
{
displayName = "Ceramic Health Boost",
// slider = true,
min = 0,
max = 999999,
requiresRestart = true,
};
private static readonly ModSettingDouble BloonSpeedBoost = new(3)
{
displayName = "Bloon Speed Boost",
// slider = true,
min = 0.1,
max = 999999,
requiresRestart = true,
};
private static readonly ModSettingDouble BossSpawningSpeed = new(40)
{
displayName = "Boss Spawning Delays (In Seconds)",
// slider = true,
min = 0,
max = 180,
requiresRestart = true,
};
private static readonly ModSettingInt MinRandValue = new(20)
{
displayName = "MinRandValue",
slider = true,
min = 0,
max = 100,
requiresRestart = true,
};
private static readonly ModSettingInt MaxRandValue = new(20)
{
displayName = "MaxRandValue",
slider = true,
min = 0,
max = 100,
requiresRestart = true,
};
private static readonly ModSettingBool Debugmode = new(false)
{
displayName = "Debug Mode",
button = true
};
public override void OnNewGameModel(GameModel gameModel, List<ModModel> mods)
{
// fucking coding nighmare
int x = gameModel.endRound / 2;
if (FastTrackEnabled & gameModel.cash < 5000) {
gameModel.startRound = gameModel.endRound/2;
if (gameModel.endRound == 40) { gameModel.cash = startingcashs[0]; gameModel.spawnHeroesAtLevel = 5; }
else if(gameModel.endRound == 60) { gameModel.cash = startingcashs[1]; gameModel.spawnHeroesAtLevel = 6; }
else if(gameModel.endRound == 80) { gameModel.cash = startingcashs[2]; gameModel.spawnHeroesAtLevel = 7; }
else if(gameModel.endRound == 100) { gameModel.cash = startingcashs[3]; gameModel.spawnHeroesAtLevel = 9; }
else if(gameModel.endRound == 140) { gameModel.cash = startingcashs[4]; gameModel.spawnHeroesAtLevel = 10; gameModel.startRound = 60; }
else
{
gameModel.cash = Il2CppAssets.Scripts.Simulation.SMath.Math.Round((.71f * Il2CppAssets.Scripts.Simulation.SMath.Math.Pow((x - 15), 3) + 5000)*100)/100;
// MelonLogger.Msg(gameModel.endRound * gameModel.endRound);
}
}
}
public class AllFortified : ModRoundSet
{
public override string BaseRoundSet => RoundSetType.Default;
public override int DefinedRounds => BaseRounds.Count;
public override string DisplayName => "All Fortified";
public override string Icon => VanillaSprites.FortifiedBloonIcon;
public override void ModifyRoundModels(RoundModel roundModel, int round)
{
foreach (var group in roundModel.groups)
{
var bloon = Game.instance.model.GetBloon(group.bloon);
if (bloon.FindChangedBloonId(bloonModel => bloonModel.isFortified = true, out var fortifiedBloon))
{
group.bloon = fortifiedBloon;
}
}
}
}
public static string PromoteBloon(string bloon, int round, int times)
{
//if (bloon.Contains("Pink") || bloon.Contains("Lead")) return bloon;
string temp = bloon;
if (times > 0)
{
for (int i = 0; i < times; i++)
{
if (bloon != null)
{
if (bloon.Contains("Lead") & round > 80)
{
promotionMap2.TryGetValue(bloon, out temp);
}
else
{
promotionMap.TryGetValue(bloon, out temp);
}
if (i != times)
{
bloon = temp;
}
}
}
}
return temp;
}
public static float RoundMultiplyier(int round)
{
round += 1;
if (44 <= round & round < 60)
{
return (round * -0.0625f) + 4.75f;
}
if (60 <= round & round < 80)
{
return (round * -0.05f) + 5f;
}
if (80 <= round & round < 100)
{
return (round * -0.05f) + 6f;
}
if (100 <= round & round < 120)
{
return (round * -0.05f) + 7f;
}
if (120 <= round & round < 140)
{
return (round * -0.05f) + 8f;
}
else
{
return 1;
}
}
public class HarderRounds : ModRoundSet
{
public override string BaseRoundSet => RoundSetType.Default;
public override int DefinedRounds => BaseRounds.Count;
public override string DisplayName => "Harder Rounds";
public override string Icon => VanillaSprites.Fortifried;
public override void ModifyRoundModels(RoundModel roundModel, int round)
{
switch (round)
{
default:
foreach (var group in roundModel.groups)
{
group.bloon = PromoteBloon(group.bloon, round, MasterModeScale);
}
break;
}
}
}
public class OneRedBloonSet : ModRoundSet
{
public override string BaseRoundSet => RoundSetType.Default;
public override int DefinedRounds => BaseRounds.Count;
public override string DisplayName => "ORB";
public override bool AddToOverrideMenu => false;
public override string Icon => VanillaSprites.BloonDecreaseHPIcon;
public override void ModifyRoundModels(RoundModel roundModel, int round)
{
switch (round)
{
default:
roundModel.ClearBloonGroups();
roundModel.AddBloonGroup("Red", 1, 0, 1);
break;
}
}
}
public class Smalltowersorwhatever : ModRoundSet
{
public override string BaseRoundSet => RoundSetType.Default;
public override int DefinedRounds => BaseRounds.Count;
public override string DisplayName => "Make Towers Small";
public override bool AddToOverrideMenu => Debugmode;
public override string Icon => VanillaSprites.SmallMonkeysModeIcon;
public override void ModifyRoundModels(RoundModel roundModel, int round)
{
}
}
public class InflationWatvere : ModRoundSet
{
public override string BaseRoundSet => RoundSetType.Default;
public override int DefinedRounds => BaseRounds.Count;
public override string DisplayName => "Inflation";
public override bool AddToOverrideMenu => Debugmode;
public override string Icon => VanillaSprites.MoMonkeyMoneyIcon;
public override void ModifyRoundModels(RoundModel roundModel, int round)
{
}
}
static string[] lines2 = {};
public class RandomizedRound : ModRoundSet
{
public override string BaseRoundSet => RoundSetType.Default;
public override int DefinedRounds => BaseRounds.Count;
public override string DisplayName => "Randomized Rounds";
public string asd = "";
public override string Icon => "RandRounds-Icon";
public override bool AddToOverrideMenu => false;
public override void ModifyRoundModels(RoundModel roundModel, int round)
{
/*
if (round == 0 )
{
try
{
lines2 = File.ReadAllLines(roundsnotespath);
asd = lines2[0] + "\n" + lines2[1] + "\nMin: " + MinRandValue.GetValue().ToString() + "\nMax: " + MaxRandValue.GetValue().ToString() + "\n";
}
catch { asd = "Seed: \n" + UnityEngine.Random.seed.ToString() + "\nMin: " + MinRandValue.GetValue().ToString() + "\nMax: " + MaxRandValue.GetValue().ToString() + "\n"; }
}
switch (round)
{
default:
// Thanks warper for letting me use his code :)
RoundSetModel roundSet = Game.instance.model.roundSet;
RoundModel newRound = roundSet.rounds[round];
int minvalue = 0;
int maxvalue = 140;
if (round - MinRandValue > 0)
{
minvalue = round - MinRandValue;
}
if (round + MaxRandValue < 140)
{
maxvalue = round + MaxRandValue;
}
int randvalue = UnityEngine.Random.RandomRange(minvalue, maxvalue);
newRound = roundSet.rounds[randvalue];
foreach (var bloon in newRound.groups)
{
string bloonName = bloon.bloon;
BloonGroupModel bloonNew = bloon;
newRound.groups.Add(bloonNew);
}
roundModel.groups = newRound.groups;
asd += "Round " + (round+1).ToString() + " is replaced with Round " + (randvalue+1).ToString() + "\n";
if (round == 139)
{
// MelonLogger.Msg(asd);
File.WriteAllText(roundsnotespath, asd);
}
break;
}
*/
}
}
public class AllFortifiedGamemode : ModGameMode
{
public override string Difficulty => DifficultyType.Hard;
public override string BaseGameMode => GameModeType.Hard;
public override string DisplayName => "All Fortified";
public override string Icon => VanillaSprites.FortifiedBloonIcon;
public override void ModifyBaseGameModeModel(ModModel gameModeModel)
{
gameModeModel.UseRoundSet<AllFortified>();
}
}
public class AcceleratedRounds : ModGameMode
{
public override string Difficulty => DifficultyType.Hard;
public override string BaseGameMode => GameModeType.Medium;
public override string DisplayName => "Accelerated Rounds";
public override string Icon => VanillaSprites.FasterBloonsIcon;
public override void ModifyBaseGameModeModel(ModModel gameModeModel)
{
gameModeModel.UseRoundSet("AcceleratedRoundSet");
gameModeModel.SetStartingCash(2000);
gameModeModel.SetEndingRound(31);
gameModeModel.SetStartingRound(1);
gameModeModel.SetAllCashMultiplier(1.35f);
}
}
public class MegaChimps : ModGameMode
{
public override string Difficulty => DifficultyType.Hard;
public override string BaseGameMode => GameModeType.Impoppable;
public override string DisplayName => "Mastery Mode";
public override string Icon => VanillaSprites.Fortifried;
public override void ModifyBaseGameModeModel(ModModel gameModeModel)
{
gameModeModel.SetStartingRound(10);
if (FastTrackEnabled == false)
{
gameModeModel.SetStartingCash(1500);
}
gameModeModel.SetEndingRound(140);
gameModeModel.SetSellingEnabled(false);
gameModeModel.SetPowersEnabled(false);
gameModeModel.SetContinuesEnabled(false);
gameModeModel.SetIncomeEnabled(false);
// gameModeModel.SetMkEnabled(false);
gameModeModel.UseRoundSet<HarderRounds>();
gameModeModel.SetSellMultiplier(0f);
gameModeModel.SetAllCashMultiplier(0.25f);
gameModeModel.AddMutator(new LockTowerModModel("lockingurmom", "BananaFarm"));
gameModeModel.AddMutator(new MonkeyMoneyModModel("mrkrabs", 0, 2));
gameModeModel.AddMutator(new DisableMonkeyKnowledgeModModel("fr this works"));
}
}
public class SupportOnly : ModGameMode
{
public override string Difficulty => DifficultyType.Hard;
public override string BaseGameMode => GameModeType.Impoppable;
public override string DisplayName => "Support Only";
public override string Icon => VanillaSprites.SupportBtn;
public override void ModifyBaseGameModeModel(ModModel gameModeModel)
{
gameModeModel.LockTowerSet(TowerSet.Primary);
gameModeModel.LockTowerSet(TowerSet.Military);
gameModeModel.LockTowerSet(TowerSet.Magic);
}
}
public class StrongerBloons : ModGameMode
{
public override string Difficulty => DifficultyType.Medium;
public override string BaseGameMode => GameModeType.Medium;
public override string DisplayName => "Stonger Bloons";
public override string Icon => VanillaSprites.BloonBoostIcon;
public override void ModifyBaseGameModeModel(ModModel gameModeModel)
{
gameModeModel.AddMutator(new GlobalSpeedModModel("yippee", BloonSpeedBoost, 0));
gameModeModel.SetEndingRound(80);
gameModeModel.AddMutator(new BloonHealthModel("yippesdsade", MoabHpScale, "Moabs"));
gameModeModel.AddMutator(new BloonHealthModel("yahooo", CeramicHpScale, "Ceramic"));
}
}
/* public class RandomizedRounds: ModGameMode
{
public override string Difficulty => DifficultyType.Medium;
public override string BaseGameMode => GameModeType.Hard;
public override string DisplayName => "Random Rounds";
public override string Icon => "RandRounds-Icon";
public override void ModifyBaseGameModeModel(ModModel gameModeModel)
{
gameModeModel.UseRoundSet<RandomizedRound>();
gameModeModel.SetEndingRound(80);
}
}
*/