Skip to Main Content

BTD_Mod_Helper​.Api​.Towers​.ModFakeTower


BloonsTD6 Mod Helper

BTD_Mod_Helper.Api.Towers

ModFakeTower Class

Defines a "fake" tower that will be added as an entry to the shop but instead of placing down as normal, will just show its
icon being placed with custom conditions and an action upon placement

public abstract class ModFakeTower : BTD_Mod_Helper.Api.Towers.ModTower

Inheritance System.ObjectModContentNamedModContentModTower  ModFakeTower

Derived
ModFakeTower<T>

Properties

ModFakeTower.BaseTower Property

No base tower

public sealed override string BaseTower { get; }

Property Value

System.String

ModFakeTower.BottomPathUpgrades Property

The number of upgrades the tower has in it's 3rd / bottom path

public sealed override int BottomPathUpgrades { get; }

Property Value

System.Int32

ModFakeTower.HighlightTowers Property

Set to true to be highlighting towers while placing the fake tower if placement is valid

public virtual bool HighlightTowers { get; }

Property Value

System.Boolean

ModFakeTower.IncludeInMonkeyTeams Property

Whether this tower should be allowed to be included in Monkey Teams

public override bool IncludeInMonkeyTeams { get; }

Property Value

System.Boolean

ModFakeTower.IncludeInRogueLegends Property

Whether this tower should be allowed to show up as an insta in Rogue Legends

public override bool IncludeInRogueLegends { get; }

Property Value

System.Boolean

ModFakeTower.MiddlePathUpgrades Property

The number of upgrades the tower has in it's 2nd / middle path

public sealed override int MiddlePathUpgrades { get; }

Property Value

System.Int32

ModFakeTower.ParagonMode Property

Defines whether / how this ModTower has a Paragon

public sealed override BTD_Mod_Helper.Api.Towers.ParagonMode ParagonMode { get; }

Property Value

ParagonMode

ModFakeTower.PlacementEffect Property

Effect to spawn on successful placement

public virtual EffectModel PlacementEffect { get; }

Property Value

Il2CppAssets.Scripts.Models.Effects.EffectModel

ModFakeTower.PlacementSound Property

Sound to play on successful placement

public virtual AudioClipReference PlacementSound { get; }

Property Value

Il2CppNinjaKiwi.Common.ResourceUtils.AudioClipReference

ModFakeTower.PlacementSprite Property

The sprite to show hovering in the world while placing the fake tower

public virtual Sprite PlacementSprite { get; }

Property Value

UnityEngine.Sprite

ModFakeTower.Portrait Property

The Portrait for the 0-0-0 tower, by default "[Name]-Portrait"


(Name of .png or .jpg, not including file extension)

public override string Portrait { get; }

Property Value

System.String

ModFakeTower.PortraitReference Property

If you're not going to use a custom .png for your Portrait, use this to directly control its SpriteReference

public override SpriteReference PortraitReference { get; }

Property Value

Il2CppNinjaKiwi.Common.ResourceUtils.SpriteReference

ModFakeTower.TopPathUpgrades Property

The number of upgrades the tower has in it's 1st / top path

public sealed override int TopPathUpgrades { get; }

Property Value

System.Int32

ModFakeTower.TowerInventoryEnabled Property

Enables tracking placements of these fake towers in the tower inventory

public virtual bool TowerInventoryEnabled { get; }

Property Value

System.Boolean

Methods

ModFakeTower.CanPlaceAt(Vector2, Tower, string) Method

Controls whether the fake tower can be placed at a particular location

public virtual bool CanPlaceAt(Vector2 at, Tower hoveredTower, ref string helperMessage);

Parameters

at UnityEngine.Vector2

location

hoveredTower Il2CppAssets.Scripts.Simulation.Towers.Tower

tower being hovered, or null if none

helperMessage System.String

message that, if not null, will be shown to the user to explain why the spot they just tried to place in is not valid

Returns

System.Boolean
if its a valid placement

ModFakeTower.IsValidCrosspath(int[]) Method

Another way to modify the allowable crosspaths for your tower. By default, checks that the highest tier is at
most 5, the next highest is at most 2, and the last one is 0


Used in the default implementation of TowerTiers()

public sealed override bool IsValidCrosspath(params int[] tiers);

Parameters

tiers System.Int32[]

Returns

System.Boolean

ModFakeTower.ModifyBaseTowerModel(TowerModel) Method

Implemented by a ModTower to modify the base tower model before applying any/all ModUpgrades


Things like the TowerModel's name, cost, tier, and upgrades are already taken care of before this point

public override void ModifyBaseTowerModel(TowerModel towerModel);

Parameters

towerModel Il2CppAssets.Scripts.Models.Towers.TowerModel

The Base Tower Model

ModFakeTower.OnPlace(Vector2, TowerModel, Tower, float) Method

Defines the actions that will be performed when this fake tower model is placed

public abstract void OnPlace(Vector2 at, TowerModel towerModelFake, Tower hoveredTower, float cost);

Parameters

at UnityEngine.Vector2

towerModelFake Il2CppAssets.Scripts.Models.Towers.TowerModel

fake towermodel, will not actually place

hoveredTower Il2CppAssets.Scripts.Simulation.Towers.Tower

tower being hovered, or null if none

cost System.Single

ModFakeTower.PlacementSideEffects(Vector3, IRootBehavior) Method

Runs side effects like the placement effect and placement sound

public void PlacementSideEffects(Vector3 position, IRootBehavior root=null);

Parameters

position Il2CppAssets.Scripts.Simulation.SMath.Vector3

root Il2CppAssets.Scripts.Simulation.Objects.IRootBehavior

ModFakeTower.Purchase(Vector2, TowerModel, Tower) Method

Purchases this fake tower at a specific spot

public void Purchase(Vector2 at, TowerModel towerModelFake, Tower hoveredTower);

Parameters

at UnityEngine.Vector2

position

towerModelFake Il2CppAssets.Scripts.Models.Towers.TowerModel

fake towermodel, will not actually place

hoveredTower Il2CppAssets.Scripts.Simulation.Towers.Tower

tower being hovered, or null if none

ModFakeTower.TowerTiers() Method

Returns all the valid tiers for the TowerModels of this Tower

public sealed override System.Collections.Generic.IEnumerable<int[]> TowerTiers();

Returns

System.Collections.Generic.IEnumerable<System.Int32[]>

To learn how to download BTD Mod Helper and install mods, click here