-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEeveeFourthPath.cs
200 lines (175 loc) · 7.41 KB
/
EeveeFourthPath.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
using MelonLoader;
using BTD_Mod_Helper;
using PathsPlusPlus;
using BTD_Mod_Helper.Api.Enums;
using Il2Cpp;
using Il2CppAssets.Scripts.Models.Towers.Projectiles.Behaviors;
using Il2CppAssets.Scripts.Models.Towers;
using Il2CppSystem.IO;
using BTD_Mod_Helper.Extensions;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Emissions;
using Il2CppAssets.Scripts.Models.Towers.Projectiles;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Attack;
using Il2CppAssets.Scripts.Unity;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Abilities;
using Il2CppAssets.Scripts.Models.Towers.Behaviors.Attack.Behaviors;
using BTD_Mod_Helper.Api.ModOptions;
using Il2CppAssets.Scripts.Models.Towers.Behaviors;
using BTD_Mod_Helper.Api.Display;
using Il2CppAssets.Scripts.Unity.Display;
using Il2CppAssets.Scripts.Simulation.Towers.TowerFilters;
[assembly: MelonInfo(typeof(EeveeFourthPath.EeveeFourthPath), EeveeFourthPath.ModHelperData.Name, EeveeFourthPath.ModHelperData.Version, EeveeFourthPath.ModHelperData.RepoOwner)]
[assembly: MelonGame("Ninja Kiwi", "BloonsTD6")]
namespace EeveeFourthPath;
public class EeveeFourthPath : BloonsTD6Mod
{
public override void OnApplicationStart()
{
ModHelper.Msg<EeveeFourthPath>("EeveeFourthPath loaded!");
}
public static readonly ModSettingCategory VeePatches = new("Patches")
{
collapsed = true
};
public static readonly ModSettingBool baseEeveeNerf = false;
public static readonly ModSettingBool flareonNerf = false;
}
public class SylveonPath : PathPlusPlus
{
public override string Tower => "Eevee-Eevee";
public override int UpgradeCount => 5; // Increase this up to 5 as you create your Upgrades
}
public class LongRangePins : UpgradePlusPlus<SylveonPath>
{
public override int Cost => 250;
public override int Tier => 1;
public override string Icon => VanillaSprites.LongRangeDartsUpgradeIcon;
public override string Description => "Eevee throws pins further than normal.";
public override void ApplyUpgrade(TowerModel towerModel)
{
towerModel.range += 10;
foreach (var attackModel in towerModel.GetDescendants<AttackModel>().ToArray())
{
attackModel.range += 10;
}
foreach (var travelStraitModel in towerModel.GetDescendants<TravelStraitModel>().ToArray())
{
travelStraitModel.Lifespan *= 1.25f;
travelStraitModel.lifespan = travelStraitModel.Lifespan;
//travelStraitModel.lifespanFrames = (int)(travelStraitModel.Lifespan * 60);
}
if (IsHighestUpgrade(towerModel))
{
// apply a custom display, if you want
}
}
}
public class HardPins : UpgradePlusPlus<SylveonPath>
{
public override int Cost => 500;
public override int Tier => 2;
public override string Icon => VanillaSprites.HeatTippedDartUpgradeIcon;
public override string Description => "Attacks can pop Lead and Frozen bloons. Jolteon's attacks can also pop Purple Bloons.";
public override void ApplyUpgrade(TowerModel towerModel)
{
foreach (var damageModel in towerModel.GetDescendants<DamageModel>().ToArray())
{
damageModel.immuneBloonProperties &= ~BloonProperties.Frozen;
damageModel.immuneBloonProperties &= ~BloonProperties.Lead;
if(towerModel.GetUpgradeLevel(0) >= 3) //Is Jolteon?
{
damageModel.immuneBloonProperties &= ~BloonProperties.Purple;
}
}
if (IsHighestUpgrade(towerModel))
{
// apply a custom display, if you want
}
}
}
public class Sylveon : UpgradePlusPlus<SylveonPath>
{
public override int Cost => 3350; //3000+350+
public override int Tier => 3;
public override string Icon => VanillaSprites.ArmorPiercingDartsUpgradeIcon;
public override string Description => "Evolving Eevee to Sylveon and increases pierce and damage, plus extra damage to MOAB-class Bloons.";
public override string Portrait => "700Sylveon_PSMD";
public override void ApplyUpgrade(TowerModel towerModel)
{
foreach (var damageModel in towerModel.GetDescendants<DamageModel>().ToArray())
{
damageModel.damage += 2;
}
foreach (var projectileModel in towerModel.GetDescendants<ProjectileModel>().ToArray())
{
projectileModel.pierce += 3;
projectileModel.AddBehavior<DamageModifierForTagModel>(new DamageModifierForTagModel("DamageModifierForTagModel_Projectile", "Moabs", 1.0f, 9.0f, false, false));
}
if (IsHighestUpgrade(towerModel))
{
// apply a custom display, if you want
}
}
}
public class PlayRough : UpgradePlusPlus<SylveonPath>
{
public override int Cost => 4900; //3000+350+
public override int Tier => 4;
public override string Icon => VanillaSprites.MonkeyPiratesUpgradeIconAA;
public override string Description => "More damage, pierce, and extra MOAB damage. MOAB Takedown Ability: harpoons a MOAB class Bloon and brings it down.";
public override string Portrait => "700Sylveon_PSMD";
public override void ApplyUpgrade(TowerModel towerModel)
{
foreach (var damageModel in towerModel.GetDescendants<DamageModel>().ToArray())
{
damageModel.damage += 2;
}
foreach (var projectileModel in towerModel.GetDescendants<ProjectileModel>().ToArray())
{
projectileModel.pierce *= 2;
projectileModel.GetBehavior<DamageModifierForTagModel>().damageAddative *= 3;
}
var ability = Game.instance.model.GetTowerFromId("MonkeyBuccaneer-040").Duplicate().GetBehavior<AbilityModel>();
towerModel.AddBehavior(ability);
if (IsHighestUpgrade(towerModel))
{
// apply a custom display, if you want
}
}
}
public class MasterofFairy : UpgradePlusPlus<SylveonPath>
{
public override int Cost => 49000; //3000+350+
public override int Tier => 5;
public override string Icon => VanillaSprites.NavarchOfTheSeasUpgradeIcon;
public override string Description => "Increased range, damage, attack speed and pierce. Ability has much shorter cooldown and can takedown ZOMGs";
public override string Portrait => "700Sylveon_PSMD";
public override void ApplyUpgrade(TowerModel towerModel)
{
foreach (var damageModel in towerModel.GetDescendants<DamageModel>().ToArray())
{
damageModel.damage += 1;
}
foreach (var projectileModel in towerModel.GetDescendants<ProjectileModel>().ToArray())
{
projectileModel.pierce += 3;
if (projectileModel.GetBehavior<DamageModifierForTagModel>() is not null) projectileModel.GetBehavior<DamageModifierForTagModel>().damageAddative += 10;
}
//towerModel.RemoveBehaviors<AbilityModel>();
//var ability = Game.instance.model.GetTowerFromId("MonkeyBuccaneer-050").Duplicate().GetBehavior<AbilityModel>();
var ability = towerModel.GetAbility();
if (ability is not null)
{
foreach (TargetGrapplableModel targetGrapplableModel in ability.GetDescendants<TargetGrapplableModel>().ToArray())
{
//targetGrapplableModel.hooks = 1;
targetGrapplableModel.zomgHooksRequired = 1;
}
}
//towerModel.AddBehavior(ability);
if (IsHighestUpgrade(towerModel))
{
// apply a custom display, if you want
}
}
}