temporary files rename
This commit is contained in:
parent
8e077e523c
commit
a87f0ed109
823 changed files with 20 additions and 5 deletions
|
@ -1,40 +0,0 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
public class BaseCapacity : MonoBehaviour
|
||||
{
|
||||
[field: SerializeField] public float MaxMana { get; private set; }
|
||||
[field: SerializeField] public float Mana { get; private set; }
|
||||
[SerializeField] private float manaCost;
|
||||
protected AbstractUnit _unit;
|
||||
|
||||
|
||||
|
||||
// Called every frame
|
||||
protected virtual bool CapacityCall()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void AddMana(float manaAdd)
|
||||
{
|
||||
Mana = Mathf.Min(Mana + manaAdd, MaxMana);
|
||||
}
|
||||
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
_unit = GetComponent<AbstractUnit>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (Mana >= manaCost)
|
||||
{
|
||||
bool capacityLaunched = CapacityCall();
|
||||
if (capacityLaunched) Mana -= manaCost;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: adbf6613bee8e8088b3389c62d61b845
|
|
@ -1,33 +0,0 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class GolemDefense : BaseCapacity
|
||||
{
|
||||
[SerializeField] private float armorGain;
|
||||
[SerializeField] private float buffTime;
|
||||
[SerializeField] private SphereCollider buffArea;
|
||||
|
||||
protected override bool CapacityCall()
|
||||
{
|
||||
Collider[] hitColliders = Physics.OverlapSphere(transform.position, buffArea.radius, buffArea.includeLayers);
|
||||
foreach (Collider target in hitColliders)
|
||||
{
|
||||
if (!target.CompareTag("CurrentMinecraftUnit")) continue;
|
||||
AbstractUnit targetUnit = target.GetComponent<AbstractUnit>();
|
||||
if (targetUnit.IsTeamA == _unit.IsTeamA)
|
||||
{
|
||||
CoroutineManager.Instance.StartCoroutine(AddThenRemoveArmor(targetUnit));
|
||||
}
|
||||
}
|
||||
return hitColliders.Length > 0;
|
||||
}
|
||||
|
||||
private IEnumerator AddThenRemoveArmor(AbstractUnit targetUnit)
|
||||
{
|
||||
targetUnit.AddArmor(armorGain);
|
||||
yield return new WaitForSeconds(buffTime);
|
||||
targetUnit.RemoveArmor(armorGain);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1ca640aad27b1da9d87fdc4302aa0cd3
|
|
@ -1,23 +0,0 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class TripleAttack : BaseCapacity
|
||||
{
|
||||
protected override bool CapacityCall()
|
||||
{
|
||||
MinecraftUnit minecraftUnit = _unit as MinecraftUnit;
|
||||
StartCoroutine(TripleAttackRoutine(minecraftUnit));
|
||||
return true;
|
||||
}
|
||||
|
||||
private IEnumerator TripleAttackRoutine(MinecraftUnit minecraftUnit)
|
||||
{
|
||||
minecraftUnit.AttackHandler.Attack();
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
minecraftUnit.AttackHandler.Attack();
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
minecraftUnit.AttackHandler.Attack();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b0344a53e7b8b8f30b008023599beb65
|
|
@ -1,14 +0,0 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class WitchSummon : BaseCapacity
|
||||
{
|
||||
[SerializeField] private GameObject summonUnit;
|
||||
|
||||
protected override bool CapacityCall()
|
||||
{
|
||||
GameObject unit = Instantiate(summonUnit, transform.position, Quaternion.identity);
|
||||
AbstractUnit unitScript = unit.GetComponent<AbstractUnit>();
|
||||
unitScript.StartFight();
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1c3c6b3848aa5f3cd9b73630ddae811e
|
|
@ -1,22 +0,0 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class ZombieSpeedBoost : BaseCapacity
|
||||
{
|
||||
[SerializeField] float timeToBoost;
|
||||
[SerializeField] float boost;
|
||||
protected override bool CapacityCall()
|
||||
{
|
||||
MinecraftUnit minecraftUnit = _unit as MinecraftUnit;
|
||||
StartCoroutine(AddThenRemoveSpeed(minecraftUnit));
|
||||
return true;
|
||||
}
|
||||
|
||||
private IEnumerator AddThenRemoveSpeed(MinecraftUnit minecraftUnit)
|
||||
{
|
||||
// Possibility float imprecision issues
|
||||
minecraftUnit.MovementHandler.speed *= boost;
|
||||
yield return new WaitForSeconds(timeToBoost);
|
||||
minecraftUnit.MovementHandler.speed /= boost;
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c3b089e9358a7b3adbe2f521fcfbc8c2
|
Loading…
Add table
Add a link
Reference in a new issue