-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed for v36.0 + balanced
- Loading branch information
Showing
8 changed files
with
974 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
using BTD_Mod_Helper.Api.Display; | ||
using Il2CppAssets.Scripts.Models.Towers; | ||
using Il2CppAssets.Scripts.Unity.Display; | ||
using System.Linq; | ||
using static marinetower.Main; | ||
|
||
namespace marinetower | ||
{ | ||
internal class Displays | ||
{ | ||
public class MarineBaseDisplay : ModTowerDisplay<Marinetower> | ||
{ | ||
public override string BaseDisplay => GetDisplay(TowerType.Marine); | ||
|
||
public override bool UseForTower(int[] tiers) | ||
{ | ||
return tiers.Sum() == 0; | ||
} | ||
|
||
public override void ModifyDisplayNode(UnityDisplayNode node) | ||
{ | ||
SetMeshTexture(node, Name); | ||
} | ||
} | ||
|
||
public class Top5Display : ModTowerDisplay<Marinetower> | ||
{ | ||
public override string BaseDisplay => GetDisplay(TowerType.Marine); | ||
|
||
public override bool UseForTower(int[] tiers) | ||
{ | ||
return tiers[0] == 5; | ||
} | ||
|
||
public override void ModifyDisplayNode(UnityDisplayNode node) | ||
{ | ||
SetMeshTexture(node, Name); | ||
} | ||
} | ||
|
||
public class Middle5Display : ModTowerDisplay<Marinetower> | ||
{ | ||
public override string BaseDisplay => GetDisplay(TowerType.Marine); | ||
|
||
public override bool UseForTower(int[] tiers) | ||
{ | ||
return tiers[1] == 5; | ||
} | ||
|
||
public override void ModifyDisplayNode(UnityDisplayNode node) | ||
{ | ||
SetMeshTexture(node, Name); | ||
} | ||
} | ||
|
||
public class Bottom4Display : ModTowerDisplay<Marinetower> | ||
{ | ||
public override string BaseDisplay => GetDisplay(TowerType.Marine); | ||
|
||
public override bool UseForTower(int[] tiers) | ||
{ | ||
return tiers[2] == 4; | ||
} | ||
|
||
public override void ModifyDisplayNode(UnityDisplayNode node) | ||
{ | ||
SetMeshTexture(node, Name); | ||
} | ||
} | ||
|
||
public class Bottom5Display : ModTowerDisplay<Marinetower> | ||
{ | ||
public override float Scale => 1.05f; | ||
public override string BaseDisplay => GetDisplay(TowerType.Marine); | ||
|
||
public override bool UseForTower(int[] tiers) | ||
{ | ||
return tiers[2] == 5; | ||
} | ||
|
||
public override void ModifyDisplayNode(UnityDisplayNode node) | ||
{ | ||
SetMeshTexture(node, Name); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using Il2CppAssets.Scripts.Models; | ||
using Il2CppAssets.Scripts.Models.Towers.Projectiles; | ||
using Il2CppAssets.Scripts.Models.Towers.Projectiles.Behaviors; | ||
using Il2CppSystem.Collections.Generic; | ||
using Il2CppInterop.Runtime.InteropTypes.Arrays; | ||
|
||
namespace marinetower | ||
{ | ||
static class Extensions | ||
{ | ||
public static Il2CppReferenceArray<T> Add<T>(this Il2CppReferenceArray<T> reference, T newPart) where T : Model | ||
{ | ||
List<T> list = new(); | ||
foreach (T item in reference) | ||
{ | ||
list.Add(item); | ||
} | ||
list.Add(newPart); | ||
return new Il2CppReferenceArray<T>(list.ToArray()); | ||
} | ||
|
||
public static Il2CppReferenceArray<T> Add<T>(this Il2CppReferenceArray<T> reference, List<T> newPart) where T : Model | ||
{ | ||
List<T> list = new(); | ||
foreach (T item in reference) | ||
{ | ||
list.Add(item); | ||
} | ||
foreach (T item2 in newPart) | ||
{ | ||
list.Add(item2); | ||
} | ||
return new Il2CppReferenceArray<T>(list.ToArray()); | ||
} | ||
|
||
|
||
public static ProjectileModel SetPierce(this ProjectileModel pm,float pierce,bool infiniteMax=true) | ||
{ | ||
pm.pierce = pierce; | ||
pm.maxPierce = infiniteMax?999999:pierce; | ||
pm.CapPierce(infiniteMax ? 999999 : pierce); | ||
|
||
return pm; | ||
} | ||
|
||
public static DamageModel SetDamage(this DamageModel dm, float damage, bool infiniteMax = true) | ||
{ | ||
dm.damage = damage; | ||
dm.maxDamage = infiniteMax ? 999999 : damage; | ||
dm.CapDamage(infiniteMax ? 999999 : damage); | ||
|
||
return dm; | ||
} | ||
|
||
//public static Transform FindDeepChild(this Transform aParent, string aName) | ||
//{ | ||
// System.Collections.Generic.Queue<Transform> queue = new System.Collections.Generic.Queue<Transform>(); | ||
// queue.Enqueue(aParent); | ||
// while (queue.Count > 0) | ||
// { | ||
// var c = queue.Dequeue(); | ||
// if (c.name == aName) | ||
// return c; | ||
// foreach (Transform t in c) | ||
// queue.Enqueue(t); | ||
// } | ||
// return null; | ||
//} | ||
} | ||
} |
Oops, something went wrong.