Example #1
0
    public void Spawn()
    {
        GameObject spawnPosition = (GameObject)spawnPositions.Roll <GameObject>();
        GameObject spawnMonster  = (GameObject)spawnableMinions.Roll <GameObject>();

        Instantiate(spawnMonster, spawnPosition.transform.position, spawnPosition.transform.rotation);
    }
Example #2
0
        /// <summary>
        /// Zap a random zappable in the list, damage it unless it has its own tablecoil.
        /// </summary>
        /// <param name="damage"></param>
        public void ZapSomething(float damage = 0)
        {
            if (_zappables.Count < 1)
            {
                return;
            }

            Health healthInstance = _zappables.Roll <Health>(null, NotRecentlyZapped);

            ZapLineEffect(new List <Health>()
            {
                healthInstance
            });

            if (Math.Abs(damage) < .01f)
            {
                damage = _defaultDamage;
            }
            healthInstance.Damage(damage);
        }