Table of Contents
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.Object ModContent NamedModContent ModTower ModFakeTower
Derived
↳ ModFakeTower<T>
No base tower
public sealed override string BaseTower { get; }
The number of upgrades the tower has in it's 3rd / bottom path
public sealed override int BottomPathUpgrades { get; }
Set to true to be highlighting towers while placing the fake tower if placement is valid
public virtual bool HighlightTowers { get; }
Whether this tower should be allowed to be included in Monkey Teams
public override bool IncludeInMonkeyTeams { get; }
Whether this tower should be allowed to show up as an insta in Rogue Legends
public override bool IncludeInRogueLegends { get; }
The number of upgrades the tower has in it's 2nd / middle path
public sealed override int MiddlePathUpgrades { get; }
Defines whether / how this ModTower has a Paragon
public sealed override BTD_Mod_Helper.Api.Towers.ParagonMode ParagonMode { get; }
Effect to spawn on successful placement
public virtual EffectModel PlacementEffect { get; }
Il2CppAssets.Scripts.Models.Effects.EffectModel
Sound to play on successful placement
public virtual AudioClipReference PlacementSound { get; }
Il2CppNinjaKiwi.Common.ResourceUtils.AudioClipReference
The sprite to show hovering in the world while placing the fake tower
public virtual Sprite PlacementSprite { get; }
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; }
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; }
Il2CppNinjaKiwi.Common.ResourceUtils.SpriteReference
The number of upgrades the tower has in it's 1st / top path
public sealed override int TopPathUpgrades { get; }
Enables tracking placements of these fake towers in the tower inventory
public virtual bool TowerInventoryEnabled { get; }
Controls whether the fake tower can be placed at a particular location
public virtual bool CanPlaceAt(Vector2 at, Tower hoveredTower, ref string helperMessage);
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
System.Boolean
if its a valid placement
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);
tiers
System.Int32[]
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);
towerModel
Il2CppAssets.Scripts.Models.Towers.TowerModel
The Base Tower Model
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);
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
Runs side effects like the placement effect and placement sound
public void PlacementSideEffects(Vector3 position, IRootBehavior root=null);
position
Il2CppAssets.Scripts.Simulation.SMath.Vector3
root
Il2CppAssets.Scripts.Simulation.Objects.IRootBehavior
Purchases this fake tower at a specific spot
public void Purchase(Vector2 at, TowerModel towerModelFake, Tower hoveredTower);
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
Returns all the valid tiers for the TowerModels of this Tower
public sealed override System.Collections.Generic.IEnumerable<int[]> TowerTiers();