Skip to content

Commit 45e8a13

Browse files
Add files via upload
1 parent 138b7bb commit 45e8a13

8 files changed

Lines changed: 110 additions & 7 deletions

File tree

BloonsTDClasses.cs

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
using Il2CppAssets.Scripts.Models.Towers.Behaviors;
1818
using Il2CppAssets.Scripts.Simulation.Bloons;
1919
using Il2CppAssets.Scripts.Unity.UI_New.InGame.TowerSelectionMenu.TowerSelectionMenuThemes;
20+
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Abilities.Behaviors;
21+
using Il2CppAssets.Scripts.Models.Towers.Projectiles.Behaviors;
2022

2123
[assembly: MelonInfo(typeof(BloonsTDClass.MelonMain), ModHelperData.Name, ModHelperData.Version, ModHelperData.Author)]
2224
[assembly: MelonGame("Ninja Kiwi", "BloonsTD6")]
@@ -248,6 +250,8 @@ public override void OnTowerCreated(Tower tower, Entity target, Model modelToUse
248250
}
249251
CommanderTowersAbility(tower, modelToUse.Cast<TowerModel>());
250252
EconomistTowers(tower, modelToUse.Cast<TowerModel>());
253+
EtherealTower(tower, modelToUse.Cast<TowerModel>());
254+
//PyrotechnicTower(tower, modelToUse.Cast<TowerModel>());
251255
}
252256
public override void OnTowerUpgraded(Tower tower, string upgradeName, TowerModel newBaseTowerModel)
253257
{
@@ -258,6 +262,8 @@ public override void OnTowerUpgraded(Tower tower, string upgradeName, TowerModel
258262
}
259263
CommanderTowersAbility(tower, newBaseTowerModel);
260264
EconomistTowers(tower, newBaseTowerModel);
265+
EtherealTower(tower, newBaseTowerModel);
266+
//PyrotechnicTower(tower, newBaseTowerModel);
261267
}
262268
public static void NecroTowers(Tower tower, string upgradeName = null, TowerModel newBaseTowerModel = null)
263269
{
@@ -482,4 +488,73 @@ public override void OnBloonCreated(Bloon bloon)
482488

483489
}
484490
}
491+
public static void EtherealTower(Tower tower, TowerModel towerModel)
492+
{
493+
var Model = towerModel.Duplicate();
494+
if (GlobalVar.Class == "Ethereal")
495+
{
496+
Model.AddBehavior(new OverrideCamoDetectionModel("EtherealClassCamoOverride", true));
497+
foreach (var am in Model.GetAttackModels())
498+
{
499+
am.attackThroughWalls = true;
500+
foreach (var proj in am.GetAllProjectiles())
501+
{
502+
proj.ignoreBlockers = true;
503+
}
504+
am.range += 6;
505+
}
506+
Model.IncreaseRange(6);
507+
Model.ignoreBlockers = true;
508+
}
509+
tower.UpdateRootModel(Model);
510+
}
511+
public static void PyrotechnicTower(Tower tower, TowerModel towerModel)
512+
{
513+
514+
if (GlobalVar.Class == "Pyrotechnic")
515+
{
516+
var Model = tower.towerModel.Duplicate();
517+
switch(Model.baseId)
518+
{
519+
case "Gwendolin":
520+
foreach(var am in Model.GetAttackModels())
521+
{
522+
foreach(var wp in am.weapons)
523+
{
524+
wp.rate *= 0.75f;
525+
}
526+
}
527+
try
528+
{
529+
Model.GetAbility(0).GetBehavior<ActivateAttackModel>().attacks[0].weapons[0].projectile.GetBehavior<TravelStraitModel>().lifespan = 15f;
530+
}
531+
catch
532+
{
533+
534+
}
535+
break;
536+
}
537+
tower.UpdateRootModel(Model);
538+
}
539+
}
540+
541+
public override void PostBloonLeaked(Bloon bloon)
542+
{
543+
if (GlobalVar.Class == "Ethereal")
544+
{
545+
InGame.instance.AddHealth(-bloon.GetModifiedTotalLeakDamage());
546+
foreach (var tower in InGame.instance.bridge.GetAllTowers())
547+
{
548+
var Model = tower.tower.towerModel.Duplicate();
549+
foreach(var am in Model.GetAttackModels())
550+
{
551+
foreach(var wp in am.weapons)
552+
{
553+
wp.rate *= 1.05f;
554+
}
555+
}
556+
tower.tower.UpdateRootModel(Model);
557+
}
558+
}
559+
}
485560
}

BloonsTDClasses.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<None Remove="UI\UIAssets\Bloontonium.png" />
2727
<None Remove="UI\UIAssets\ClassesButton.png" />
2828
<None Remove="UI\UIAssets\Commander.png" />
29+
<None Remove="UI\UIAssets\Etherial.png" />
2930
<None Remove="UI\UIAssets\ExtraClassesButton.png" />
3031
<None Remove="UI\UIAssets\Necromancer.png" />
3132
<None Remove="UI\UIAssets\Pyrotechnic.png" />

ModHelperData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ namespace BloonsTDClasses;
33
public static class ModHelperData
44
{
55
public const string WorksOnVersion = "34.3";
6-
public const string Version = "1.0.3";
6+
public const string Version = "1.1.0";
77
public const string Name = "BloonsTDClasses";
88

9-
public const string Description = "Adds a bunch of classes to BTD6";
9+
public const string Description = "Adds a bunch of classes to BTD6 that each shake up the gameplay in unique ways";
1010

1111
public const string RepoOwner = "Commander-Cat101";
1212
public const string RepoName = "ClassesMod";

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
</a>
55

66
<h1 align="center">BloonsTDClasses</h1>
7-
Adds classes to the game
7+
8+
This is an empty mod generated by BTD6 Mod Helper
9+
10+
For your mod, remember to add the GitHub topic "btd6-mod"
11+
12+
Features a GitHub actions setup to automatically build the mod whenever commits are pushed, and publish a release if a tag is pushed (using the LATEST.md as the body).
813

914
[![Requires BTD6 Mod Helper](https://raw.githubusercontent.com/gurrenm3/BTD-Mod-Helper/master/banner.png)](https://github.com/gurrenm3/BTD-Mod-Helper#readme)

UI/AbilityUI.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ public static void AbilityPressed()
5454
MelonLogger.Msg("Pressed");
5555
GlobalVar.abilityactive = true;
5656
break;
57+
default:
58+
break;
5759
}
5860
button.Image.SetSprite(NotReadyImage);
5961
}

UI/ClassUI.cs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public class ClassesMenu : ModGameMenu<ExtraSettingsScreen>
1818
public static SpriteReference ExtraClasses => ModContent.GetSpriteReference<MelonMain>("ExtraClassesButton");
1919
public static SpriteReference NecroButton => ModContent.GetSpriteReference<MelonMain>("Necromancer");
2020
public static SpriteReference PyroButton => ModContent.GetSpriteReference<MelonMain>("Pyrotechnic");
21+
public static SpriteReference EtherealButton => ModContent.GetSpriteReference<MelonMain>("Etherial");
2122
public static SpriteReference EconomistButton => ModContent.GetSpriteReference<MelonMain>("Economist");
2223
public static SpriteReference CommanderButton => ModContent.GetSpriteReference<MelonMain>("Commander");
2324

@@ -27,6 +28,8 @@ public class ClassesMenu : ModGameMenu<ExtraSettingsScreen>
2728
public static ModHelperImage? indicator1;
2829
public static ModHelperImage? indicator2;
2930
public static ModHelperImage? indicator3;
31+
public static ModHelperImage? indicator4;
32+
public static ModHelperImage? indicator5;
3033
public static ModHelperText? selectedclassname;
3134
public static ModHelperText? abouttext;
3235

@@ -96,13 +99,31 @@ private void CreateLeftMenu(ModHelperPanel ClassesMenu)
9699

97100
var Button4 = ClassesMenu.AddButton(new Info("Class4", -3275, 100, 150 * 3, 125 * 3, new Vector2(1, 0), new Vector2(0.5f, 0)), CommanderButton.guidRef, new Action(() =>
98101
{
99-
SetSelectedClass("Commander", CommanderButton.guidRef, "Awarded multiple medals in the monkey military, the commander will lead your monkey to victory with an inspiring banner. Unfortunely, bloons have gotten faster", "Pros" + "\n" + "- Flanking Tactics - Ability (20 Second Uptime, (120 + round) Second Cooldown)" + "\n" + "During Ability each tower gets" + "\n" + "- 2x Attack Speed, 4x for Bomb Shooters and Mortar Monkeys" + "\n" + "- 3x Pierce and an extra 3 damage" + "\n" + "Cons" + "\n" + "- Bloons are %30 faster", 150, 125, 75);
102+
SetSelectedClass("Commander", CommanderButton.guidRef, "Awarded multiple medals in the monkey military, the commander will lead your monkey to victory with an inspiring banner. Unfortunely, bloons have gotten faster", "Pros" + "\n" + "- Flanking Tactics - Ability (20 Second Uptime, (120 + round) Second Cooldown)" + "\n" + "During Ability each tower gets" + "\n" + "- 2x Attack Speed, 4x for Bomb Shooters and Mortar Monkeys" + "\n" + "- 3x Pierce and an extra 3 damage" + "\n\n" + "Cons" + "\n" + "- Bloons are %30 faster", 150, 125, 75);
100103

101104
}));
102105
Button4.AddText(new Info("Text", 0, -160, 1000, 200), "Commander", 70f);
103106
indicator3 = Button4.AddImage(new Info("SelectedButton", 100, 100, 150, 150), VanillaSprites.SelectedTick);
104107
indicator3.gameObject.SetActive(Globals.GlobalVar.Class == "Commander");
105108

109+
var Button5 = ClassesMenu.AddButton(new Info("Class5", -3300, 600, 125 * 3, 125 * 3, new Vector2(1, 0), new Vector2(0.5f, 0)), EtherealButton.guidRef, new Action(() =>
110+
{
111+
SetSelectedClass("Ethereal", EtherealButton.guidRef, "From back in the days the ghostly ethereal class turns all monkeys into spooky scary ghosts allowing towers to see through walls, but beware your hearts are even more fragile than before", "Pros" + "\n" + "- All towers can see through walls \n- Camo bloons are visable by all monkeys \n- All Towers get a small buff in attack range \n\nCons \n- Life loss from all sources are doubled\n- Losing lives makes all towers lose 5% attack speed", 125, 125, 70);
112+
113+
}));
114+
Button5.AddText(new Info("Text", 0, -160, 1000, 200), "Ethereal", 70f);
115+
indicator4 = Button5.AddImage(new Info("SelectedButton", 100, 100, 150, 150), VanillaSprites.SelectedTick);
116+
indicator4.gameObject.SetActive(Globals.GlobalVar.Class == "Ethereal");
117+
118+
/*var Button6 = ClassesMenu.AddButton(new Info("Class6", -2725, 600, 125 * 3, 125 * 3, new Vector2(1, 0), new Vector2(0.5f, 0)), PyroButton.guidRef, new Action(() =>
119+
{
120+
SetSelectedClass("Pyrotechnic", PyroButton.guidRef, "The Fiery Pyrotechnic Class is ready to heat up the game. Some attacks are enhanced by fire and fire attacks are improved greatly, but your monkeys are not used to being hot and are weakened.", "Pros\n- Gwendolyn gets a %50 attack speed buff and her cocktail ability lasts longer\n- All fire based upgrades deal an extra %40 damage and get a bonus %20 attack speed\n\nCons\n- All water towers get half range (unless using fire upgrade)\n- Towers without fire upgrades get %10 less attack speed", 125, 125, 70);
121+
122+
}));
123+
Button6.AddText(new Info("Text", 0, -160, 1000, 200), "Pyrotechnic", 70f);
124+
indicator5 = Button6.AddImage(new Info("SelectedButton", 100, 100, 150, 150), VanillaSprites.SelectedTick);
125+
indicator5.gameObject.SetActive(Globals.GlobalVar.Class == "Pyrotechnic");*/
126+
106127
}
107128
private static void SetSelectedClass(String Class, String Image, String About, String Desc, int width, int height, int DescSize = 90)
108129
{
@@ -120,6 +141,8 @@ private static void SetSelectedClass(String Class, String Image, String About, S
120141
indicator2?.gameObject.SetActive(Globals.GlobalVar.Class == "Economist");
121142
indicator?.gameObject.SetActive(Globals.GlobalVar.Class == "Default");
122143
indicator3?.gameObject.SetActive(Globals.GlobalVar.Class == "Commander");
144+
indicator4?.gameObject.SetActive(Globals.GlobalVar.Class == "Ethereal");
145+
//indicator5?.gameObject.SetActive(Globals.GlobalVar.Class == "Pyrotechnic");
123146
selectedclassname?.SetText(Class);
124147
image?.Image.SetSprite(Image);
125148
image?.SetInfo(new Info("SelectedImage", 250, 800, width * 2, height * 2));

UI/ClassesButton.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,15 @@ public static void CreatePanel(GameObject screen)
6969
{
7070
matchLocalPosition.offset = new Vector3(0, 0);
7171
matchLocalPosition.scale = new Vector3(1, 3.33f, 1);
72-
MelonLogger.Msg("1");
7372
}
7473
else if (aspectRatio < 1.7)
7574
{
7675
matchLocalPosition.offset = new Vector3(-700, 60, 0);
7776
matchLocalPosition.scale = new Vector3(1, 3f, 1);
78-
MelonLogger.Msg("2");
7977
}
8078
else
8179
{
8280
matchLocalPosition.offset = new Vector3(-750, 70);
83-
MelonLogger.Msg("3");
8481
}
8582
/*var mainMenuTransform = screen.transform.Cast<RectTransform>();
8683
var matchLocalPosition = image.transform.gameObject.AddComponent<MatchLocalPosition>();

UI/UIAssets/Etherial.png

28.2 KB
Loading

0 commit comments

Comments
 (0)