-
Notifications
You must be signed in to change notification settings - Fork 14
/
CardMonkey.cs
62 lines (50 loc) · 2.21 KB
/
CardMonkey.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System.Collections.Generic;
using System.Linq;
using BTD_Mod_Helper;
using Il2CppAssets.Scripts.Models.Towers;
using Il2CppAssets.Scripts.Models.TowerSets;
using BTD_Mod_Helper.Api.ModOptions;
using BTD_Mod_Helper.Api.Towers;
using BTD_Mod_Helper.Extensions;
using CardMonkey.Displays.Projectiles;
namespace CardMonkey;
/// <summary>
/// The main class that adds the core tower to the game
/// </summary>
public class CardMonkey : ModTower
{
// public override string Portrait => "Don't need to override this, using the default of Name-Portrait";
// public override string Icon => "Don't need to override this, using the default of Name-Icon";
public override TowerSet TowerSet => TowerSet.Primary;
public override string BaseTower => TowerType.DartMonkey;
public override int Cost => 400;
public override string Description => "Throws playing cards at Bloons";
// public override string DisplayName => "Don't need to override this, the default turns it into 'Card Monkey'"
public override ParagonMode ParagonMode => ParagonMode.Base555;
public override ModSettingHotkey Hotkey => CardMonkeyMod.CardMonkeyHotkey;
public override void ModifyBaseTowerModel(TowerModel towerModel)
{
towerModel.range += 10;
var attackModel = towerModel.GetAttackModel();
attackModel.range += 10;
var projectile = attackModel.weapons[0].projectile;
projectile.ApplyDisplay<RedCardDisplay>(); // Make the projectiles look like Cards
projectile.pierce += 2;
}
/// <summary>
/// Make Card Monkey go right after the Boomerang Monkey in the shop
/// <br />
/// If we didn't have this, it would just put it at the end of the Primary section
/// </summary>
public override int GetTowerIndex(List<TowerDetailsModel> towerSet)
{
return towerSet.First(model => model.towerId == TowerType.BoomerangMonkey).towerIndex + 1;
}
/// <summary>
/// Support the Ultimate Crosspathing Mod
/// <br />
/// That mod will handle actually allowing the upgrades to happen in the UI
/// </summary>
public override bool IsValidCrosspath(int[] tiers) =>
ModHelper.HasMod("UltimateCrosspathing") || base.IsValidCrosspath(tiers);
}