Example #1
0
    void ValidateDrone()
    {
        if (watch.watchEvent == WatchEvent.PLANES)
        {
            luck       = Random.Range(0, 100);
            planeMalus = 25 + loadedBattery * 5;

            if (luck > planeMalus)
            {
                Success();
            }
            else
            {
                AudioManager.singleton.PlaySfx(Explosion);
            }
        }

        else if (watch.watchEvent == WatchEvent.SEAGELL)
        {
            luck       = Random.Range(0, 100);
            planeMalus = 5 + loadedBattery * 5;

            if (luck > planeMalus)
            {
                Success();
            }
            else
            {
                AudioManager.singleton.PlaySfx(Explosion);
            }
        }

        else
        {
            Success();
        }

        Destroy(gameObject);
        hangar.spawnDrone();
    }