-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMain.cs
52 lines (41 loc) · 1.61 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
using BTD_Mod_Helper;
using Il2CppAssets.Scripts.Models.Profile;
using Il2CppAssets.Scripts.Simulation.Towers;
using Il2CppAssets.Scripts.Simulation.Towers.Behaviors;
using OmegaCrosspathing;
using Main = OmegaCrosspathing.Main;
[assembly: MelonInfo(typeof(Main), ModHelperData.Name, ModHelperData.Version, ModHelperData.RepoOwner)]
[assembly: MelonGame("Ninja Kiwi", "BloonsTD6")]
[assembly: MelonOptionalDependencies("PathsPlusPlus")]
namespace OmegaCrosspathing;
[HarmonyPatch]
public partial class Main : BloonsTD6Mod
{
public static float totalcost;
public static bool HasPathsPlusPlus => ModHelper.HasMod("PathsPlusPlus");
public static string selectedBaseID = "";
public static TowerModel? selectedtower;
public override void OnTowerSelected(Tower tower)
{
PortraitManager.SetUpPortrait(tower.GetTowerToSim());
}
public override void OnMainMenu()
{
selectedBaseID = "";
selectedtower = null;
}
public override void OnTowerSaved(Tower tower, TowerSaveDataModel saveData)
{
var OCMutator = tower.GetMutator("OC")?.TryCast<SupportRemoveFilterOutTag.MutatorTower>();
if (OCMutator != null)
saveData.metaData["OC"] = OCMutator.removeScriptsWithSupportMutatorId;
}
public override void OnTowerLoaded(Tower tower, TowerSaveDataModel saveData)
{
if (!saveData.metaData.TryGetValue("OC", out var ocMutator))
return;
if (tower.mutators != null)
tower.RemoveMutatorsById("OC");
tower.AddMutator(new SupportRemoveFilterOutTag.MutatorTower("OC", ocMutator, null));
}
}