forked from Timotheeee/btd6_mods
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.cs
90 lines (66 loc) · 2.6 KB
/
Main.cs
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
using MelonLoader;
using Harmony;
using Il2CppAssets.Scripts.Unity.UI_New.InGame;
using Il2CppAssets.Scripts.Models.Towers;
using Il2CppAssets.Scripts.Unity;
using Il2CppAssets.Scripts.Utils;
using System;
using System.Text.RegularExpressions;
using System.IO;
using Il2CppAssets.Main.Scenes;
using UnityEngine;
using System.Linq;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Attack;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Attack.Behaviors;
using BTD_Mod_Helper.Extensions;
using Il2CppAssets.Scripts.Models.Towers.Behaviors;
using Il2CppAssets.Scripts.Models.Bloons.Behaviors;
using Il2CppAssets.Scripts.Models.Towers.Projectiles.Behaviors;
using System.Collections.Generic;
using Il2CppAssets.Scripts.Models;
using Il2CppAssets.Scripts.Models.Towers.Projectiles;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Emissions;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Abilities;
using Il2CppAssets.Scripts.Simulation.Track;
[assembly: MelonInfo(typeof(double_children.Main), double_children.ModHelperData.Name, double_children.ModHelperData.Version, double_children.ModHelperData.RepoOwner)]
[assembly: MelonGame("Ninja Kiwi", "BloonsTD6")]
namespace double_children
{
public class Main : MelonMod
{
public override void OnApplicationStart()
{
base.OnApplicationStart();
Console.WriteLine("double_children mod loaded");
}
static string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).Replace("Roaming", "LocalLow") + " /Ninja Kiwi/BloonsTD6/";
[HarmonyPatch(typeof(TitleScreen), "Start")]
public class Awake_Patch
{
[HarmonyPostfix]
public static void Postfix()
{
string[] affected = new string[] { "Blue", "Green", "Yellow", "Pink", };
foreach (var bloon in Game.instance.model.bloons)
{
if (affected.Any(bloon.id.Contains))
{
var spawn = bloon.GetBehavior<SpawnChildrenModel>();
string temp = spawn.children[0];
spawn.children = new Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppStringArray(2);
spawn.children[0] = temp;
spawn.children[1] = temp;
}
}
}
}
public override void OnUpdate()
{
base.OnUpdate();
bool inAGame = InGame.instance != null && InGame.instance.bridge != null;
if (inAGame)
{
}
}
}
}