diff options
author | chai <215380520@qq.com> | 2023-11-26 23:54:38 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2023-11-26 23:54:38 +0800 |
commit | b45e22c164fa364263b00ce82842999f8e5976b2 (patch) | |
tree | bbc996364325c820d215572e4b16ae0e776c5f04 /Assembly_CSharp/Building | |
parent | 626381f061cde0c78564f6336e3131835cf20a5b (diff) |
*move
Diffstat (limited to 'Assembly_CSharp/Building')
-rw-r--r-- | Assembly_CSharp/Building/TeslaCoil.cs | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/Assembly_CSharp/Building/TeslaCoil.cs b/Assembly_CSharp/Building/TeslaCoil.cs deleted file mode 100644 index 97954e7..0000000 --- a/Assembly_CSharp/Building/TeslaCoil.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections; -using UnityEngine; - -public class TeslaCoil : Tower -{ - [SerializeField] - private GameObject lightningTrail; - - protected override void AimTurret() - { - } - - protected override void Fire() - { - if (consumesMana) - { - int manaCost = (int)((float)base.damage * manaConsumptionRate); - if (!ResourceManager.instance.CheckMana(manaCost)) - { - return; - } - ResourceManager.instance.SpendMana(manaCost); - } - Vector3 position = base.transform.position; - position.y = 0f; - Collider[] array = Physics.OverlapSphere(position, base.range, enemyLayerMask, QueryTriggerInteraction.Collide); - for (int i = 0; i < array.Length; i++) - { - array[i].GetComponent<IDamageable>()?.TakeDamage(towerType, base.damage, base.healthDamage, base.armorDamage, base.shieldDamage, base.slowPercent, base.bleedPercent, base.burnPercent, base.poisonPercent, base.critChance, base.stunChance); - } - SFXManager.instance.PlaySound(Sound.TeslaZap, base.transform.position); - StartCoroutine(DrawLightning()); - } - - private IEnumerator DrawLightning() - { - for (float i = 0f; i <= (float)Math.PI * 2f; i += 0.5f) - { - Vector3 vector = new Vector3(UnityEngine.Random.Range(-0.5f, 0.5f), UnityEngine.Random.Range(-0.5f, 0.5f), UnityEngine.Random.Range(-0.5f, 0.5f)); - lightningTrail.transform.position = vector + new Vector3(base.transform.position.x + Mathf.Sin(i) * base.range, 0.75f, base.transform.position.z + Mathf.Cos(i) * base.range); - yield return new WaitForEndOfFrame(); - } - } -} |