Skip to content

Commit

Permalink
Unused artifact code for future updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mend-dev committed Aug 17, 2023
1 parent 0388d99 commit 0cc509b
Show file tree
Hide file tree
Showing 31 changed files with 1,461 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Artifacts/ArtifactUi.cs
Original file line number Diff line number Diff line change
@@ -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 {
}
41 changes: 41 additions & 0 deletions Artifacts/Bloons/BlackBloonPopping.cs
Original file line number Diff line number Diff line change
@@ -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"); }
}
}
}
42 changes: 42 additions & 0 deletions Artifacts/Bloons/CamoDetection.cs
Original file line number Diff line number Diff line change
@@ -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"); }
}
}
}
41 changes: 41 additions & 0 deletions Artifacts/Bloons/LeadBloonPopping.cs
Original file line number Diff line number Diff line change
@@ -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"); }
}
}
}
41 changes: 41 additions & 0 deletions Artifacts/Bloons/PurpleBloonPopping.cs
Original file line number Diff line number Diff line change
@@ -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"); }
}
}
}
41 changes: 41 additions & 0 deletions Artifacts/Bloons/WhiteBloonPopping.cs
Original file line number Diff line number Diff line change
@@ -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"); }
}
}
}
43 changes: 43 additions & 0 deletions Artifacts/Other/RegrowRush.cs
Original file line number Diff line number Diff line change
@@ -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<BloonEmissionModel> bmes = new List<BloonEmissionModel>();
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);
}
}
80 changes: 80 additions & 0 deletions Artifacts/RogueArtifact.cs
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
Loading

0 comments on commit 0cc509b

Please sign in to comment.