Skip to content

Commit

Permalink
Episode 4
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkTerraYT committed Dec 17, 2023
1 parent 4a480a1 commit 4dca1c8
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 22 deletions.
Binary file added Cog1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions ExampleMod.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using MelonLoader;
using BTD_Mod_Helper;
using ExampleMod;
using BTD_Mod_Helper.Api.ModOptions;
using Il2CppNinjaKiwi.NKMulti.IO;

[assembly: MelonInfo(typeof(ExampleMod.ExampleMod), ModHelperData.Name, ModHelperData.Version, ModHelperData.RepoOwner)]
[assembly: MelonGame("Ninja Kiwi", "BloonsTD6")]
Expand All @@ -13,4 +15,42 @@ public override void OnApplicationStart()
{
ModHelper.Msg<ExampleMod>("ExampleMod loaded!");
}

public static readonly ModSettingCategory Category = new("Example Category")
{
icon = "Cog1.png"
};

public static readonly ModSettingInt Damage = new(5)
{
requiresRestart = true,
category = Category,
description = "Description"
};
public static readonly ModSettingInt Range = new(10)
{
requiresRestart = true,
category = Category,
description = "Description"
};
public static readonly ModSettingInt Pierce = new(5)
{
requiresRestart = true,
category = Category,
description = "Description"
};
public static readonly ModSettingInt Cost = new(1040)
{
requiresRestart = true,
category = Category,
description = "Description"
};

public static readonly ModSettingDouble AttackSpeedMultiplier = new(0.5)
{
requiresRestart = true,
category = Category,
description = "What the attack speed is multiplied by"
};

}
2 changes: 1 addition & 1 deletion ExampleMonkey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal class ExampleMonkey : ModTower

public override int Cost => 1050;

public override int TopPathUpgrades => 0;
public override int TopPathUpgrades => 1;

public override int MiddlePathUpgrades => 2;

Expand Down
Binary file added Upgrade/CustomizableUpgrade-Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Upgrade/CustomizableUpgrade-Portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions Upgrade/CustomizableUpgrade.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using BTD_Mod_Helper.Api.Towers;
using BTD_Mod_Helper.Extensions;
using Il2CppAssets.Scripts.Models.Towers;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Abilities.Behaviors;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Abilities;
using Il2CppAssets.Scripts.Unity;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using static ExampleMod.ExampleMod;

namespace ExampleMod.Upgrade
{
internal class CustomizableUpgrade : ModUpgrade<ExampleMonkey>
{
public override int Path => MIDDLE; //You can use TOP, MIDDLE or BOTTOM

public override int Tier => 2; // 1, 2, 3, 4 or 5

public override int Cost => ExampleMod.Cost;

public override string Description => "Customizable, Made for Episode 4";

public override void ApplyUpgrade(TowerModel towerModel)
{
var attackModel = towerModel.GetAttackModel();
var weaponModel = towerModel.GetWeapon(); // You can change this is towerModel.GetAttackModel().weapons[0];
var projectileModel = weaponModel.projectile;

attackModel.range += Range;
towerModel.range += Range;

weaponModel.rate *= AttackSpeedMultiplier;

projectileModel.pierce += Pierce;
projectileModel.GetDamageModel().damage += Damage;
}
}
}
41 changes: 20 additions & 21 deletions Upgrade/ExampleUpgrade2.cs
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
using BTD_Mod_Helper.Api.Towers;
using BTD_Mod_Helper.Api.Enums;
using BTD_Mod_Helper.Api.Towers;
using BTD_Mod_Helper.Extensions;
using ExampleMod;
using Il2CppAssets.Scripts.Models.Towers;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Emissions;
using Il2CppAssets.Scripts.Models.Towers.Projectiles.Behaviors;
using Il2CppAssets.Scripts.Unity;

namespace ExampleMod.Upgrade
using Il2CppSystem;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MeJacksonCompete.UpgradesOliver
{
internal class ExampleUpgrade2 : ModUpgrade<ExampleMonkey>
internal class ThornSwarm : ModUpgrade<ExampleMonkey>
{
public override int Path => MIDDLE; //You can use TOP, MIDDLE or BOTTOM
public override int Path => TOP;

public override int Tier => 1;

public override int Tier => 2; // 1, 2, 3, 4 or 5
public override int Cost => 250;

public override int Cost => 965;
public override string Description => "Shoots 8 thorns per shot instead of 5.";

public override string Description => "Adds Multishot + Cool Stuff";
public override string Icon => VanillaSprites.ThornSwarmUpgradeIcon;

public override void ApplyUpgrade(TowerModel towerModel)
{
var attackModel = towerModel.GetAttackModel();
var weaponModel = towerModel.GetWeapon();
var projectileModel = weaponModel.projectile;

weaponModel.emission = new ArcEmissionModel("ArcEmissionModel_", 3, 0, 25, null, false, false);

// Behaviors

// weaponModel.projectile.AddBehavior(new TrackTargetModel("TrackTargetModel_", 80f, true, true, 360f, false, 1f, false, false));
weaponModel.projectile.AddBehavior(Game.instance.model.GetTower("WizardMonkey", 2).GetWeapon().projectile.GetBehavior<TrackTargetModel>().Duplicate());
weaponModel.projectile.AddBehavior(new CashModel("CashModel_", 5, 5, 0, 0, false, false, false, false));
// weaponModel.projectile.AddBehavior(Game.instance.model.GetTower("BananaFarm").GetWeapon().projectile.GetBehavior<CashModel>().Duplicate());

weaponModel.projectile.AddBehavior<CreateProjectileOnExhaustFractionModel>(new("CreateProjectileOnExhaustFractionModel_", weaponModel.projectile.Duplicate(), new ArcEmissionModel("ArcEmissionModel_", 2, 0, 45, null, false, false), 0.5f, 0.33333f, false, false, false));
/*
var airburstModel = Game.instance.model.GetTower("DartMonkey", 5).GetWeapon().projectile.GetBehavior<CreateProjectileOnExhaustFractionModel>().Duplicate());
ariburstModel.projectile = weaponModel.projectile.Duplicate();
weaponModel.projectile.AddBehavior(airbustModel);
*/
}
}
}

0 comments on commit 4dca1c8

Please sign in to comment.