diff --git a/Artifacts/ArtifactUi.cs b/Artifacts/ArtifactUi.cs new file mode 100644 index 0000000..e22c2b7 --- /dev/null +++ b/Artifacts/ArtifactUi.cs @@ -0,0 +1,17 @@ +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using MelonLoader; +using UnityEngine; + +namespace BTD6Rogue; + +[RegisterTypeInIl2Cpp(false)] +public class ArtifactUi : MonoBehaviour { + + + public static void CreateArtifactBarUi(RectTransform rect, InGame inGame) { + } +} + +[RegisterTypeInIl2Cpp] +public class ArtifactIconUi : MonoBehaviour { +} diff --git a/Artifacts/Bloons/BlackBloonPopping.cs b/Artifacts/Bloons/BlackBloonPopping.cs new file mode 100644 index 0000000..0622638 --- /dev/null +++ b/Artifacts/Bloons/BlackBloonPopping.cs @@ -0,0 +1,41 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; + +namespace BTD6Rogue; + +public class BlackBloonPoppingArtifact : RogueArtifact { + public override string DisplayName => "Black Bloon Popping"; + public override string ArtifactSprite => VanillaSprites.BlackBloonIcon; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(10, 30); + + public override void Register() { } + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("BlackBloonPoppingArtifact") != null) { tower.RemoveMutatorsById("BlackBloonPoppingArtifact"); } + BehaviorMutator bm = new DamageTypeSupport.MutatorTower("BlackBloonPoppingArtifact", false, new BuffIndicatorModel("", "", ""), Il2Cpp.BloonProperties.Black); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + } + } + + public override void OnPlaceTower(InGame game, Tower tower) { + if (tower.GetMutator("BlackBloonPoppingArtifact") != null) { tower.RemoveMutatorsById("BlackBloonPoppingArtifact"); } + BehaviorMutator bm = new DamageTypeSupport.MutatorTower("BlackBloonPoppingArtifact", false, new BuffIndicatorModel("", "", ""), Il2Cpp.BloonProperties.Black); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("BlackBloonPoppingArtifact") != null) { tower.RemoveMutatorsById("BlackBloonPoppingArtifact"); } + } + } +} diff --git a/Artifacts/Bloons/CamoDetection.cs b/Artifacts/Bloons/CamoDetection.cs new file mode 100644 index 0000000..364a703 --- /dev/null +++ b/Artifacts/Bloons/CamoDetection.cs @@ -0,0 +1,42 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors.Abilities.Behaviors; + +namespace BTD6Rogue; + +public class CamoDetectionArtifact : RogueArtifact { + public override string DisplayName => "Camo Detection"; + public override string ArtifactSprite => VanillaSprites.CamoBloonIcon; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(10, 30); + + public override void Register() { } + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("CamoDetectionArtifact") != null) { tower.RemoveMutatorsById("CamoDetectionArtifact"); } + BehaviorMutator bm = new DetectCamoMutator("CamoDetectionArtifact"); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + } + } + + public override void OnPlaceTower(InGame game, Tower tower) { + if (tower.GetMutator("CamoDetectionArtifact") != null) { tower.RemoveMutatorsById("CamoDetectionArtifact"); } + BehaviorMutator bm = new DetectCamoMutator("CamoDetectionArtifact"); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("CamoDetectionArtifact") != null) { tower.RemoveMutatorsById("CamoDetectionArtifact"); } + } + } +} diff --git a/Artifacts/Bloons/LeadBloonPopping.cs b/Artifacts/Bloons/LeadBloonPopping.cs new file mode 100644 index 0000000..78b3f6f --- /dev/null +++ b/Artifacts/Bloons/LeadBloonPopping.cs @@ -0,0 +1,41 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; + +namespace BTD6Rogue; + +public class LeadBloonPoppingArtifact : RogueArtifact { + public override string DisplayName => "Lead Bloon Popping"; + public override string ArtifactSprite => VanillaSprites.LeadBloonIcon; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(10, 30); + + public override void Register() { } + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("LeadBloonPoppingArtifact") != null) { tower.RemoveMutatorsById("LeadBloonPoppingArtifact"); } + BehaviorMutator bm = new DamageTypeSupport.MutatorTower("LeadBloonPoppingArtifact", false, new BuffIndicatorModel("", "", ""), Il2Cpp.BloonProperties.Lead); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + } + } + + public override void OnPlaceTower(InGame game, Tower tower) { + if (tower.GetMutator("LeadBloonPoppingArtifact") != null) { tower.RemoveMutatorsById("LeadBloonPoppingArtifact"); } + BehaviorMutator bm = new DamageTypeSupport.MutatorTower("LeadBloonPoppingArtifact", false, new BuffIndicatorModel("", "", ""), Il2Cpp.BloonProperties.Lead); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("LeadBloonPoppingArtifact") != null) { tower.RemoveMutatorsById("LeadBloonPoppingArtifact"); } + } + } +} diff --git a/Artifacts/Bloons/PurpleBloonPopping.cs b/Artifacts/Bloons/PurpleBloonPopping.cs new file mode 100644 index 0000000..81ff6ee --- /dev/null +++ b/Artifacts/Bloons/PurpleBloonPopping.cs @@ -0,0 +1,41 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; + +namespace BTD6Rogue; + +public class PurpleBloonPoppingArtifact : RogueArtifact { + public override string DisplayName => "Purple Bloon Popping"; + public override string ArtifactSprite => VanillaSprites.PurpleBloonIcon; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(10, 30); + + public override void Register() { } + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("PurpleBloonPoppingArtifact") != null) { tower.RemoveMutatorsById("PurpleBloonPoppingArtifact"); } + BehaviorMutator bm = new DamageTypeSupport.MutatorTower("PurpleBloonPoppingArtifact", false, new BuffIndicatorModel("", "", ""), Il2Cpp.BloonProperties.Purple); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + } + } + + public override void OnPlaceTower(InGame game, Tower tower) { + if (tower.GetMutator("PurpleBloonPoppingArtifact") != null) { tower.RemoveMutatorsById("PurpleBloonPoppingArtifact"); } + BehaviorMutator bm = new DamageTypeSupport.MutatorTower("PurpleBloonPoppingArtifact", false, new BuffIndicatorModel("", "", ""), Il2Cpp.BloonProperties.Purple); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("PurpleBloonPoppingArtifact") != null) { tower.RemoveMutatorsById("PurpleBloonPoppingArtifact"); } + } + } +} diff --git a/Artifacts/Bloons/WhiteBloonPopping.cs b/Artifacts/Bloons/WhiteBloonPopping.cs new file mode 100644 index 0000000..919e52e --- /dev/null +++ b/Artifacts/Bloons/WhiteBloonPopping.cs @@ -0,0 +1,41 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; + +namespace BTD6Rogue; + +public class WhiteBloonPoppingArtifact : RogueArtifact { + public override string DisplayName => "White Bloon Popping"; + public override string ArtifactSprite => VanillaSprites.WhiteBloonIcon; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(10, 30); + + public override void Register() { } + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("WhiteBloonPoppingArtifact") != null) { tower.RemoveMutatorsById("WhiteBloonPoppingArtifact"); } + BehaviorMutator bm = new DamageTypeSupport.MutatorTower("WhiteBloonPoppingArtifact", false, new BuffIndicatorModel("", "", ""), Il2Cpp.BloonProperties.White); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + } + } + + public override void OnPlaceTower(InGame game, Tower tower) { + if (tower.GetMutator("WhiteBloonPoppingArtifact") != null) { tower.RemoveMutatorsById("WhiteBloonPoppingArtifact"); } + BehaviorMutator bm = new DamageTypeSupport.MutatorTower("WhiteBloonPoppingArtifact", false, new BuffIndicatorModel("", "", ""), Il2Cpp.BloonProperties.White); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("WhiteBloonPoppingArtifact") != null) { tower.RemoveMutatorsById("WhiteBloonPoppingArtifact"); } + } + } +} diff --git a/Artifacts/Other/RegrowRush.cs b/Artifacts/Other/RegrowRush.cs new file mode 100644 index 0000000..70951ac --- /dev/null +++ b/Artifacts/Other/RegrowRush.cs @@ -0,0 +1,43 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.Rounds; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using Il2CppSystem.Collections.Generic; + +namespace BTD6Rogue; + +public class BloonRush : RogueArtifact { + public override string DisplayName => "Bloon Rush"; + public override string ArtifactSprite => VanillaSprites.Rainbow; + + public override ArtifactLength ArtifactLength => ArtifactLength.Once; + + public override ArtifactRange ArtifactRange => ArtifactRange.Local; + + public override void Register() {} + + public override void OnChooseArtifact(InGame game) { + int round = game.bridge.GetCurrentRound(); + List bmes = new List(); + for (int i = 0; i < 50; i++) { + BloonEmissionModel bme = new BloonEmissionModel("", i * 10); + if (round > 0 && round < 19) { + bme.bloon = BloonType.PinkRegrow; + } else if (round > 19 && round < 39) { + bme.bloon = BloonType.ZebraRegrow; + } else if (round > 39 && round < 59) { + bme.bloon = BloonType.RainbowRegrow; + } else if (round > 59 && round < 79) { + bme.bloon = BloonType.MoabFortified; + } else if (round > 79 && round < 99) { + bme.bloon = BloonType.BfbFortified; + } else if (round > 99 && round < 119) { + bme.bloon = BloonType.DdtFortifiedCamo; + } else if (round > 119) { + bme.bloon = BloonType.BadFortified; + } + bmes.Add(bme); + } + game.bridge.SpawnBloons(bmes.ToIl2CppReferenceArray(), 0, 0); + } +} \ No newline at end of file diff --git a/Artifacts/RogueArtifact.cs b/Artifacts/RogueArtifact.cs new file mode 100644 index 0000000..f7a720b --- /dev/null +++ b/Artifacts/RogueArtifact.cs @@ -0,0 +1,80 @@ +using BTD_Mod_Helper.Api; +using BTD_Mod_Helper.Api.Enums; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public abstract class RogueArtifact : NamedModContent { + + public override string DisplayName => "Unnamed Artifact"; + public virtual string ArtifactSprite => ""; + + public virtual ArtifactLength ArtifactLength => ArtifactLength.Both; + public virtual ArtifactRange ArtifactRange => ArtifactRange.Both; + public virtual Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public virtual void OnChooseArtifact(InGame game) { } + public virtual void OnPlaceTower(InGame game, Tower tower) { } + public virtual void OnRoundStart(InGame game) { } + public virtual void OnRoundEnd(InGame game) { } + public virtual void OnArtifactExpire(InGame game) { } + public virtual bool CanGetArtifact(InGame game) { return true; } + + public override void Register() {} +} + +public enum ArtifactLength { + Once, + Temp, + Perm, + Both +} + +public enum ArtifactRange { + Local, + Global, + Both +} + +public class ArtifactGameData { + public RogueArtifact baseArtifact; + public ArtifactLength artifactLength; + public ArtifactRange artifactRange; + public int timer; + + public ArtifactGameData(RogueArtifact baseArtifact) { + this.baseArtifact = baseArtifact; + + if (baseArtifact.ArtifactLength == ArtifactLength.Both) { + if (new System.Random().Next(2) == 0) { + artifactLength = ArtifactLength.Temp; + } else { + artifactLength = ArtifactLength.Perm; + } + } else { + artifactLength = baseArtifact.ArtifactLength; + } + + if (artifactLength == ArtifactLength.Temp) { + if (baseArtifact.ArtifactMinMax.x == 0 && baseArtifact.ArtifactMinMax.y == 0) { + timer = new System.Random().Next(5, 16); + } else { + timer = new System.Random().Next(baseArtifact.ArtifactMinMax.x, baseArtifact.ArtifactMinMax.y); + } + } else { + timer = -1; + } + + if (baseArtifact.ArtifactRange == ArtifactRange.Both) { + if (new System.Random().Next(2) == 0) { + artifactRange = ArtifactRange.Local; + } else { + artifactRange = ArtifactRange.Global; + } + } else { + artifactLength = baseArtifact.ArtifactLength; + } + } +} diff --git a/Artifacts/Towers/AlchemistArtifact.cs b/Artifacts/Towers/AlchemistArtifact.cs new file mode 100644 index 0000000..aba1722 --- /dev/null +++ b/Artifacts/Towers/AlchemistArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class AlchemistArtifact : RogueArtifact { + public override string DisplayName => "Alchemist Training"; + public override string ArtifactSprite => VanillaSprites.Alchemist000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("AlchemistArtifact") != null) { tower.RemoveMutatorsById("AlchemistArtifact"); } + if (tower.towerModel.baseId == TowerType.Alchemist) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "AlchemistArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "AlchemistArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "AlchemistArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "AlchemistArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("AlchemistArtifact") != null) { tower.RemoveMutatorsById("AlchemistArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("AlchemistArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.Alchemist) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/BananaFarmArtifact.cs b/Artifacts/Towers/BananaFarmArtifact.cs new file mode 100644 index 0000000..1669f67 --- /dev/null +++ b/Artifacts/Towers/BananaFarmArtifact.cs @@ -0,0 +1 @@ +namespace BTD6Rogue.Artifacts.Towers; \ No newline at end of file diff --git a/Artifacts/Towers/BeastHandlerArtifact.cs b/Artifacts/Towers/BeastHandlerArtifact.cs new file mode 100644 index 0000000..0b34d1d --- /dev/null +++ b/Artifacts/Towers/BeastHandlerArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class BeastHandlerArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.BeastHandler000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("BeastHandlerArtifact") != null) { tower.RemoveMutatorsById("BeastHandlerArtifact"); } + if (tower.towerModel.baseId == TowerType.BeastHandler) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "BeastHandlerArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "BeastHandlerArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "BeastHandlerArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "BeastHandlerArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("BeastHandlerArtifact") != null) { tower.RemoveMutatorsById("BeastHandlerArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("BeastHandlerArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.BeastHandler) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/BombShooterArtifact.cs b/Artifacts/Towers/BombShooterArtifact.cs new file mode 100644 index 0000000..f6065d5 --- /dev/null +++ b/Artifacts/Towers/BombShooterArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class BombShooterArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.BombShooter000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("BombShooterArtifact") != null) { tower.RemoveMutatorsById("BombShooterArtifact"); } + if (tower.towerModel.baseId == TowerType.BombShooter) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "BombShooterArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "BombShooterArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "BombShooterArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "BombShooterArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("BombShooterArtifact") != null) { tower.RemoveMutatorsById("BombShooterArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("BombShooterArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.BombShooter) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/BoomerangMonkeyArtifact.cs b/Artifacts/Towers/BoomerangMonkeyArtifact.cs new file mode 100644 index 0000000..072e174 --- /dev/null +++ b/Artifacts/Towers/BoomerangMonkeyArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class BoomerangMonkeyArtifact : RogueArtifact { + public override string DisplayName => "Boomerang Monkey Training"; + public override string ArtifactSprite => VanillaSprites.BoomerangMonkey000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("BoomerangMonkeyArtifact") != null) { tower.RemoveMutatorsById("BoomerangMonkeyArtifact"); } + if (tower.towerModel.baseId == TowerType.BoomerangMonkey) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "BoomerangMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "BoomerangMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "BoomerangMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "BoomerangMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("BoomerangMonkeyArtifact") != null) { tower.RemoveMutatorsById("BoomerangMonkeyArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("BoomerangMonkeyArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.BoomerangMonkey) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/DartMonkeyArtifact.cs b/Artifacts/Towers/DartMonkeyArtifact.cs new file mode 100644 index 0000000..4ea9d82 --- /dev/null +++ b/Artifacts/Towers/DartMonkeyArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class DartMonkeyArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.DartMonkey000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("DartMonkeyArtifact") != null) { tower.RemoveMutatorsById("DartMonkeyArtifact"); } + if (tower.towerModel.baseId == TowerType.DartMonkey) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "DartMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "DartMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "DartMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "DartMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("DartMonkeyArtifact") != null) { tower.RemoveMutatorsById("DartMonkeyArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("DartMonkeyArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.DartMonkey) { return true; } + } + return false; + } +} diff --git a/Artifacts/Towers/DartlingGunnerArtifact.cs b/Artifacts/Towers/DartlingGunnerArtifact.cs new file mode 100644 index 0000000..5423c37 --- /dev/null +++ b/Artifacts/Towers/DartlingGunnerArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class DartlingGunnerArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.DartlingGunner000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("DartlingGunnerArtifact") != null) { tower.RemoveMutatorsById("DartlingGunnerArtifact"); } + if (tower.towerModel.baseId == TowerType.DartlingGunner) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "DartlingGunnerArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "DartlingGunnerArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "DartlingGunnerArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "DartlingGunnerArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("DartlingGunnerArtifact") != null) { tower.RemoveMutatorsById("DartlingGunnerArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("DartlingGunnerArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.DartlingGunner) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/DruidArtifact.cs b/Artifacts/Towers/DruidArtifact.cs new file mode 100644 index 0000000..0d85bd1 --- /dev/null +++ b/Artifacts/Towers/DruidArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class DruidArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.Druid000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("DruidArtifact") != null) { tower.RemoveMutatorsById("DruidArtifact"); } + if (tower.towerModel.baseId == TowerType.Druid) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "DruidArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "DruidArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "DruidArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "DruidArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("DruidArtifact") != null) { tower.RemoveMutatorsById("DruidArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("DruidArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.Druid) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/EngineerMonkeyArtifact.cs b/Artifacts/Towers/EngineerMonkeyArtifact.cs new file mode 100644 index 0000000..f366c33 --- /dev/null +++ b/Artifacts/Towers/EngineerMonkeyArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class EngineerMonkeyArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.EngineerMonkey000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("EngineerMonkeyArtifact") != null) { tower.RemoveMutatorsById("EngineerMonkeyArtifact"); } + if (tower.towerModel.baseId == TowerType.EngineerMonkey) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "EngineerMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "EngineerMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "EngineerMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "EngineerMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("EngineerMonkeyArtifact") != null) { tower.RemoveMutatorsById("EngineerMonkeyArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("EngineerMonkeyArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.EngineerMonkey) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/GlueGunnerArtifact.cs b/Artifacts/Towers/GlueGunnerArtifact.cs new file mode 100644 index 0000000..b0afc92 --- /dev/null +++ b/Artifacts/Towers/GlueGunnerArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class GlueGunnerArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.GlueGunner000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("GlueGunnerArtifact") != null) { tower.RemoveMutatorsById("GlueGunnerArtifact"); } + if (tower.towerModel.baseId == TowerType.GlueGunner) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "GlueGunnerArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "GlueGunnerArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "GlueGunnerArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "GlueGunnerArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("GlueGunnerArtifact") != null) { tower.RemoveMutatorsById("GlueGunnerArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("GlueGunnerArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.GlueGunner) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/HeliPilotArtifact.cs b/Artifacts/Towers/HeliPilotArtifact.cs new file mode 100644 index 0000000..692c993 --- /dev/null +++ b/Artifacts/Towers/HeliPilotArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class HeliPilotArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.HeliPilot000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("HeliPilotArtifact") != null) { tower.RemoveMutatorsById("HeliPilotArtifact"); } + if (tower.towerModel.baseId == TowerType.HeliPilot) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "HeliPilotArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "HeliPilotArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "HeliPilotArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "HeliPilotArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("HeliPilotArtifact") != null) { tower.RemoveMutatorsById("HeliPilotArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("HeliPilotArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.HeliPilot) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/IceMonkeyArtifact.cs b/Artifacts/Towers/IceMonkeyArtifact.cs new file mode 100644 index 0000000..41eae87 --- /dev/null +++ b/Artifacts/Towers/IceMonkeyArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class IceMonkeyArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.IceMonkey000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("IceMonkeyArtifact") != null) { tower.RemoveMutatorsById("IceMonkeyArtifact"); } + if (tower.towerModel.baseId == TowerType.IceMonkey) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "IceMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "IceMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "IceMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "IceMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("IceMonkeyArtifact") != null) { tower.RemoveMutatorsById("IceMonkeyArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("IceMonkeyArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.IceMonkey) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/MonkeyAceArtifact.cs b/Artifacts/Towers/MonkeyAceArtifact.cs new file mode 100644 index 0000000..9eaddca --- /dev/null +++ b/Artifacts/Towers/MonkeyAceArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class MonkeyAceArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.MonkeyAce000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("MonkeyAceArtifact") != null) { tower.RemoveMutatorsById("MonkeyAceArtifact"); } + if (tower.towerModel.baseId == TowerType.MonkeyAce) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "MonkeyAceArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "MonkeyAceArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "MonkeyAceArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "MonkeyAceArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("MonkeyAceArtifact") != null) { tower.RemoveMutatorsById("MonkeyAceArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("MonkeyAceArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.MonkeyAce) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/MonkeyBuccaneerArtifact.cs b/Artifacts/Towers/MonkeyBuccaneerArtifact.cs new file mode 100644 index 0000000..071fd1d --- /dev/null +++ b/Artifacts/Towers/MonkeyBuccaneerArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class MonkeyBuccaneerArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.MonkeyBuccaneer000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("MonkeyBuccaneerArtifact") != null) { tower.RemoveMutatorsById("MonkeyBuccaneerArtifact"); } + if (tower.towerModel.baseId == TowerType.MonkeyBuccaneer) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "MonkeyBuccaneerArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "MonkeyBuccaneerArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "MonkeyBuccaneerArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "MonkeyBuccaneerArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("MonkeyBuccaneerArtifact") != null) { tower.RemoveMutatorsById("MonkeyBuccaneerArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("MonkeyBuccaneerArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.MonkeyBuccaneer) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/MonkeySubArtifact.cs b/Artifacts/Towers/MonkeySubArtifact.cs new file mode 100644 index 0000000..643c8ac --- /dev/null +++ b/Artifacts/Towers/MonkeySubArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class MonkeySubArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.MonkeySub000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("MonkeySubArtifact") != null) { tower.RemoveMutatorsById("MonkeySubArtifact"); } + if (tower.towerModel.baseId == TowerType.MonkeySub) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "MonkeySubArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "MonkeySubArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "MonkeySubArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "MonkeySubArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("MonkeySubArtifact") != null) { tower.RemoveMutatorsById("MonkeySubArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("MonkeySubArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.MonkeySub) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/MonkeyVillageArtifact.cs b/Artifacts/Towers/MonkeyVillageArtifact.cs new file mode 100644 index 0000000..1669f67 --- /dev/null +++ b/Artifacts/Towers/MonkeyVillageArtifact.cs @@ -0,0 +1 @@ +namespace BTD6Rogue.Artifacts.Towers; \ No newline at end of file diff --git a/Artifacts/Towers/MortarMonkeyArtifact.cs b/Artifacts/Towers/MortarMonkeyArtifact.cs new file mode 100644 index 0000000..fcc0308 --- /dev/null +++ b/Artifacts/Towers/MortarMonkeyArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class MortarMonkeyArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.MortarMonkey000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("MortarMonkeyArtifact") != null) { tower.RemoveMutatorsById("MortarMonkeyArtifact"); } + if (tower.towerModel.baseId == TowerType.MortarMonkey) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "MortarMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "MortarMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "MortarMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "MortarMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("MortarMonkeyArtifact") != null) { tower.RemoveMutatorsById("MortarMonkeyArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("MortarMonkeyArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.MortarMonkey) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/NinjaMonkeyArtifact.cs b/Artifacts/Towers/NinjaMonkeyArtifact.cs new file mode 100644 index 0000000..d21304a --- /dev/null +++ b/Artifacts/Towers/NinjaMonkeyArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class NinjaMonkeyArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.NInjaMonkey000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("NinjaMonkeyArtifact") != null) { tower.RemoveMutatorsById("NinjaMonkeyArtifact"); } + if (tower.towerModel.baseId == TowerType.NinjaMonkey) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "NinjaMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "NinjaMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "NinjaMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "NinjaMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("NinjaMonkeyArtifact") != null) { tower.RemoveMutatorsById("NinjaMonkeyArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("NinjaMonkeyArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.NinjaMonkey) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/SniperMonkeyArtifact.cs b/Artifacts/Towers/SniperMonkeyArtifact.cs new file mode 100644 index 0000000..7ff7523 --- /dev/null +++ b/Artifacts/Towers/SniperMonkeyArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class SniperMonkeyArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.SniperMonkey000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("SniperMonkeyArtifact") != null) { tower.RemoveMutatorsById("SniperMonkeyArtifact"); } + if (tower.towerModel.baseId == TowerType.SniperMonkey) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "SniperMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "SniperMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "SniperMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "SniperMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("SniperMonkeyArtifact") != null) { tower.RemoveMutatorsById("SniperMonkeyArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("SniperMonkeyArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.SniperMonkey) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/SpikeFactoryArtifact.cs b/Artifacts/Towers/SpikeFactoryArtifact.cs new file mode 100644 index 0000000..9dfe456 --- /dev/null +++ b/Artifacts/Towers/SpikeFactoryArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class SpikeFactoryArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.SpikeFactory000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("SpikeFactoryArtifact") != null) { tower.RemoveMutatorsById("SpikeFactoryArtifact"); } + if (tower.towerModel.baseId == TowerType.SpikeFactory) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "SpikeFactoryArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "SpikeFactoryArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "SpikeFactoryArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "SpikeFactoryArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("SpikeFactoryArtifact") != null) { tower.RemoveMutatorsById("SpikeFactoryArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("SpikeFactoryArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.SpikeFactory) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/SuperMonkeyArtifact.cs b/Artifacts/Towers/SuperMonkeyArtifact.cs new file mode 100644 index 0000000..17b84fd --- /dev/null +++ b/Artifacts/Towers/SuperMonkeyArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class SuperMonkeyArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.SuperMonkey000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("SuperMonkeyArtifact") != null) { tower.RemoveMutatorsById("SuperMonkeyArtifact"); } + if (tower.towerModel.baseId == TowerType.SuperMonkey) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "SuperMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "SuperMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "SuperMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "SuperMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("SuperMonkeyArtifact") != null) { tower.RemoveMutatorsById("SuperMonkeyArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("SuperMonkeyArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.SuperMonkey) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/TackShooterArtifact.cs b/Artifacts/Towers/TackShooterArtifact.cs new file mode 100644 index 0000000..b0cbc26 --- /dev/null +++ b/Artifacts/Towers/TackShooterArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class TackShooterArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.TackShooter000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("TackShooterArtifact") != null) { tower.RemoveMutatorsById("TackShooterArtifact"); } + if (tower.towerModel.baseId == TowerType.TackShooter) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "TackShooterArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "TackShooterArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "TackShooterArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "TackShooterArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("TackShooterArtifact") != null) { tower.RemoveMutatorsById("TackShooterArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("TackShooterArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.TackShooter) { return true; } + } + return false; + } +} \ No newline at end of file diff --git a/Artifacts/Towers/WizardMonkeyArtifact.cs b/Artifacts/Towers/WizardMonkeyArtifact.cs new file mode 100644 index 0000000..80cde21 --- /dev/null +++ b/Artifacts/Towers/WizardMonkeyArtifact.cs @@ -0,0 +1,53 @@ +using BTD_Mod_Helper.Api.Enums; +using BTD_Mod_Helper.Extensions; +using Il2CppAssets.Scripts.Models.GenericBehaviors; +using Il2CppAssets.Scripts.Models.Towers; +using Il2CppAssets.Scripts.Models.Towers.Behaviors; +using Il2CppAssets.Scripts.Simulation.Objects; +using Il2CppAssets.Scripts.Simulation.Towers; +using Il2CppAssets.Scripts.Simulation.Towers.Behaviors; +using Il2CppAssets.Scripts.Unity.UI_New.InGame; +using UnityEngine; + +namespace BTD6Rogue; + +public class WizardMonkeyArtifact : RogueArtifact { + public override string DisplayName => "Dart Monkey Training"; + public override string ArtifactSprite => VanillaSprites.Wizard000; + + public override ArtifactLength ArtifactLength => ArtifactLength.Both; + public override ArtifactRange ArtifactRange => ArtifactRange.Both; + public override Vector2Int ArtifactMinMax => new Vector2Int(5, 10); + + public override void OnChooseArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("WizardMonkeyArtifact") != null) { tower.RemoveMutatorsById("WizardMonkeyArtifact"); } + if (tower.towerModel.baseId == TowerType.WizardMonkey) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "WizardMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "WizardMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + } + } + public override void OnPlaceTower(InGame game, Tower tower) { + BehaviorMutator bm = new DamageSupport.MutatorTower(1f, false, "WizardMonkeyArtifact", new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm, 9999999); + BehaviorMutator bm2 = new RateSupportModel.RateSupportMutator(false, "WizardMonkeyArtifact", 0.75f, 0, new BuffIndicatorModel("", "", "")); + tower.AddMutatorIncludeSubTowers(bm2, 9999999); + } + + public override void OnArtifactExpire(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("WizardMonkeyArtifact") != null) { tower.RemoveMutatorsById("WizardMonkeyArtifact"); } + } + } + + public override bool CanGetArtifact(InGame game) { + foreach (Tower tower in game.GetTowers()) { + if (tower.GetMutator("WizardMonkeyArtifact") != null) { return false; } + if (tower.towerModel.baseId == TowerType.WizardMonkey) { return true; } + } + return false; + } +} \ No newline at end of file