-
Notifications
You must be signed in to change notification settings - Fork 4
/
2Squirtle.cs
206 lines (175 loc) · 8.79 KB
/
2Squirtle.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
using Assets.Scripts.Models.Towers;
using Assets.Scripts.Unity;
using BTD_Mod_Helper.Api.Towers;
using BTD_Mod_Helper.Extensions;
using System.Linq;
using static PokemonExpansion.PokemonUI;
using Assets.Scripts.Models.Towers.Projectiles.Behaviors;
using Assets.Scripts.Models.Towers.Filters;
using BTD_Mod_Helper.Api.Display;
using Assets.Scripts.Unity.Display;
using Squirtle.Displays.Projectiles;
using Assets.Scripts.Models.Map;
namespace Squirtle.Displays.Projectiles
{
public class WaterSprayDisplay : ModDisplay
{
public override string BaseDisplay => Generic2dDisplay;
public override void ModifyDisplayNode(UnityDisplayNode node)
{
Set2DTexture(node, Name);
}
}
}
namespace Squirtle
{
public class Squirtle : ModTower<PokemonSet>
{
public override string BaseTower => TowerType.DartMonkey;
public override int Cost => 620;
public override int TopPathUpgrades => 0;
public override int MiddlePathUpgrades => 5;
public override int BottomPathUpgrades => 0;
public override bool Use2DModel => true;
public override string Portrait => "Squirtle-Icon";
public override string Description => "Squirtle = WATER!";
public override void ModifyBaseTowerModel(TowerModel towerModel)
{
towerModel.GetDescendants<FilterInvisibleModel>().ForEach(model => model.isActive = false);
towerModel.range += 20;
var attackModel = towerModel.GetAttackModel();
var projectile = attackModel.weapons[0].projectile;
attackModel.range += 20;
attackModel.weapons[0].Rate = 1f;
attackModel.weapons[0].projectile.GetDamageModel().damage = 3;
projectile.ApplyDisplay<WaterSprayDisplay>();
attackModel.weapons[0].projectile.GetDamageModel().immuneBloonProperties = BloonProperties.Lead;
UnhollowerBaseLib.Il2CppStructArray<AreaType> areaTypes = new UnhollowerBaseLib.Il2CppStructArray<AreaType>(2);
towerModel.areaTypes = areaTypes;
towerModel.areaTypes[0] = AreaType.land;
towerModel.areaTypes[1] = AreaType.water;
}
public override string Get2DTexture(int[] tiers)
{
if (tiers[1] < 2)
{
return "SquirtleBaseDisplay";
}
if (tiers[1] < 4)
{
return "WartortleDisplay";
}
if (tiers[1] == 4)
{
return "BlastoiseDisplay";
}
if (tiers[1] == 5)
{
return "BlastoiseDisplay";
}
return "SquirtleBaseDisplay";
}
}
}
namespace Squirtle.Upgrades.MiddlePath
{
public class WaterPulse : ModUpgrade<Squirtle>
{
// public override string Portrait => "Don't need to override this, using the default of Pair-Portrait.png";
// public override string Icon => "Don't need to override this, using the default of Pair-Icon.png";
public override string Portrait => "Squirtle-Icon";
public override string Icon => "Squirtle-Icon";
public override int Path => MIDDLE;
public override int Tier => 1;
public override int Cost => 550;
// public override string DisplayName => "Don't need to override this, the default turns it into 'Pair'"
public override string Description => "The user attacks the target with a pulsing blast of water. This may also confuse the target.";
public override void ApplyUpgrade(TowerModel towerModel)
{
var attackModel = towerModel.GetAttackModel();
var WindModel = Game.instance.model.GetTowerFromId("NinjaMonkey-010").GetWeapon().projectile.GetBehavior<WindModel>().Duplicate();
WindModel.chance = 0.05f;
WindModel.distanceMin = 5f;
WindModel.distanceMax = 50f;
WindModel.speedMultiplier = 2.5f;
attackModel.weapons[0].projectile.AddBehavior(WindModel);
attackModel.weapons[0].projectile.pierce += 1;
attackModel.weapons[0].projectile.GetDamageModel().damage += 1;
attackModel.weapons[0].Rate = .9f;
}
}
public class Wartortle : ModUpgrade<Squirtle>
{
// public override string Portrait => "Don't need to override this, using the default of Pair-Portrait.png";
// public override string Icon => "Don't need to override this, using the default of Pair-Icon.png";
public override string Portrait => "Wartortle-Icon";
public override int Path => MIDDLE;
public override int Tier => 2;
public override int Cost => 800;
// public override string DisplayName => "Don't need to override this, the default turns it into 'Pair'"
public override string Description => "Often hides in water to stalk unwary prey. For swimming fast, it moves its ears to maintain balance.";
public override void ApplyUpgrade(TowerModel towerModel)
{
var attackModel = towerModel.GetAttackModel();
attackModel.weapons[0].projectile.GetBehavior<WindModel>().chance = 0.1f;
attackModel.weapons[0].Rate = 0.7f;
}
}
public class RapidSpin : ModUpgrade<Squirtle>
{
// public override string Portrait => "Don't need to override this, using the default of Pair-Portrait.png";
// public override string Icon => "Don't need to override this, using the default of Pair-Icon.png";
public override string Portrait => "Wartortle-Icon";
public override string Icon => "Wartortle-Icon";
public override int Path => MIDDLE;
public override int Tier => 3;
public override int Cost => 1350;
// public override string DisplayName => "Don't need to override this, the default turns it into 'Pair'"
public override string Description => "A spin attack that can also eliminate such moves as Bind, Wrap, Leech Seed, and Spikes.";
public override void ApplyUpgrade(TowerModel towerModel)
{
var attackModel = towerModel.GetAttackModel();
attackModel.weapons[0].projectile.GetBehavior<WindModel>().chance = 0.15f;
attackModel.weapons[0].Rate = 0.5f;
}
}
public class Blastoise : ModUpgrade<Squirtle>
{
// public override string Portrait => "Don't need to override this, using the default of Pair-Portrait.png";
// public override string Icon => "Don't need to override this, using the default of Pair-Icon.png";
public override string Portrait => "Blastoise-Icon";
public override string Icon => "Blastoise-Icon";
public override int Path => MIDDLE;
public override int Tier => 4;
public override int Cost => 3150;
// public override string DisplayName => "Don't need to override this, the default turns it into 'Pair'"
public override string Description => "A brutal Pokémon with pressurized water jets on its shell. They are used for high speed tackles.";
public override void ApplyUpgrade(TowerModel towerModel)
{
var attackModel = towerModel.GetAttackModel();
attackModel.weapons[0].projectile.GetBehavior<WindModel>().chance = 0.2f;
attackModel.weapons[0].Rate = 0.3f;
attackModel.weapons[0].projectile.GetDamageModel().damage += 2;
attackModel.weapons[0].projectile.GetDamageModel().immuneBloonProperties = BloonProperties.None;
}
}
public class MegaBlastoise : ModUpgrade<Squirtle>
{
// public override string Portrait => "Don't need to override this, using the default of Pair-Portrait.png";
// public override string Icon => "Don't need to override this, using the default of Pair-Icon.png";
public override string Portrait => "MegaBlastoise-Icon";
public override int Path => MIDDLE;
public override int Tier => 5;
public override int Cost => 63150;
// public override string DisplayName => "Don't need to override this, the default turns it into 'Pair'"
public override string Description => "The foe is blasted by a huge volume of water launched under great pressure.";
public override void ApplyUpgrade(TowerModel towerModel)
{
var attackModel = towerModel.GetAttackModel();
attackModel.weapons[0].projectile.GetBehavior<WindModel>().chance = 0.02f;
attackModel.weapons[0].projectile.GetBehavior<WindModel>().affectMoab = true;
attackModel.weapons[0].Rate = 0.08f;
attackModel.weapons[0].projectile.GetDamageModel().damage *= 6;
}
}
}