Esempio n. 1
0
    public void resetGameManager()
    {
        playerSkill = 1f;
        skillFactor = 1f;
        health      = 250f;

        Melee        = new enemyAttributes(150f, 0f, 4.5f, 50);
        Shooter      = new enemyAttributes(150f, 17f, 3f, 50);
        QuickShooter = new enemyAttributes(100f, 18f, 5f, 25);
        Swordsman    = new enemyAttributes(200f, 0f, 3f, 50);
        Boss         = new enemyAttributes(1000f, 15f, 5f, 25);

        score = combo = highestCombo = 0;
    }
Esempio n. 2
0
    void Awake()
    {
        playerSkill = 1f;
        skillFactor = 1f;
        health      = 250f;

        Melee        = new enemyAttributes(150f, 0f, 4.5f, 50);
        Shooter      = new enemyAttributes(150f, 17f, 3f, 50);
        QuickShooter = new enemyAttributes(100f, 18f, 5f, 25);
        Swordsman    = new enemyAttributes(200f, 0f, 3f, 50);
        Boss         = new enemyAttributes(1000f, 15f, 5f, 25);

        ui             = GameObject.Find("Canvas").GetComponent <UIController>();
        ChildrenGetter = GetComponent <FindChildrenWithTag>();
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(instance);
        }
        else if (instance != this)
        {
            if (instance.inMenu == false)
            {
                // instance.playerSkill = 1f;
                // instance.skillFactor = 1f;
                // instance.health = 250f;

                // instance.Melee = new enemyAttributes(150f, 0f, 4.5f, 50);
                // instance.Shooter = new enemyAttributes(150f, 17f, 3f, 50);
                // instance.QuickShooter = new enemyAttributes(100f, 18f, 5f, 25);
                // instance.Swordsman = new enemyAttributes(200f, 0f, 4f, 50);
                // instance.Boss = new enemyAttributes(1000f, 15f, 5f, 50);
            }
            instance.ui             = GameObject.Find("Canvas").GetComponent <UIController>();
            instance.ChildrenGetter = GetComponent <FindChildrenWithTag>();
            // GameObject Canvas = GameObject.Find("Canvas");
            // instance.PauseScreen = ChildrenGetter.GetChildWithName(Canvas.transform,"PauseScreen");
            Destroy(gameObject);
        }
    }
Esempio n. 3
0
    public void enemyAdapt(EnemyController enemy)
    {
        if (enemy.gameObject.name.Contains("Melee"))
        {
            float Health    = Melee.health;
            float Speed     = Melee.speed;
            float AttackPow = Melee.attackPow;

            if (meleeAdapted == false)
            {
                Health      *= skillFactor;
                Speed       *= skillFactor;
                AttackPow   *= skillFactor;
                meleeAdapted = true;
                Melee        = new enemyAttributes(Health, 0f, Speed, AttackPow);
            }
            enemy.setHealth(Health);
            enemy.setMovementSpeed(Speed);
            enemy.setAttacKPow(AttackPow);
        }

        else if (enemy.gameObject.name.Contains("Shooter"))
        {
            float Health      = Shooter.health;
            float BulletSpeed = Shooter.bulletSpeed;
            float AttackPow   = Shooter.attackPow;

            if (ShooterAdapted == false)
            {
                Health        *= skillFactor;
                BulletSpeed   *= skillFactor;
                AttackPow     *= skillFactor;
                ShooterAdapted = true;
                Shooter        = new enemyAttributes(Health, BulletSpeed, 0f, AttackPow);
            }
            enemy.setHealth(Health);
            enemy.setBulletSpeed(BulletSpeed);
            enemy.setAttacKPow(AttackPow);
        }

        else if (enemy.gameObject.name.Contains("QuickShooter"))
        {
            float Health      = QuickShooter.health;
            float BulletSpeed = QuickShooter.bulletSpeed;
            float AttackPow   = QuickShooter.attackPow;

            if (QuickShooterAdapted == false)
            {
                Health             *= skillFactor;
                BulletSpeed        *= skillFactor;
                AttackPow          *= skillFactor;
                QuickShooterAdapted = true;
                QuickShooter        = new enemyAttributes(Health, BulletSpeed, 0f, AttackPow);
            }
            enemy.setHealth(Health);
            enemy.setBulletSpeed(BulletSpeed);
            enemy.setAttacKPow(AttackPow);
        }

        else if (enemy.gameObject.name.Contains("Swordsman"))
        {
            float Health    = Swordsman.health;
            float Speed     = Swordsman.speed;
            float AttackPow = Swordsman.attackPow;

            if (SwordsmanAdapted == false)
            {
                Health          *= skillFactor;
                Speed           *= skillFactor;
                AttackPow       *= skillFactor;
                SwordsmanAdapted = true;
                Swordsman        = new enemyAttributes(Health, 0f, Speed, AttackPow);
            }
            enemy.setHealth(Health);
            enemy.setMovementSpeed(Speed);
            enemy.setAttacKPow(AttackPow);
        }

        else if (enemy.gameObject.name.Contains("Boss"))
        {
            float Health      = Boss.health;
            float BulletSpeed = Boss.bulletSpeed;
            float AttackPow   = Boss.attackPow;

            if (BossAdapted == false)
            {
                Health      *= skillFactor;
                BulletSpeed *= skillFactor;
                AttackPow   *= skillFactor;
                BossAdapted  = true;
                Boss         = new enemyAttributes(Health, BulletSpeed, 0f, AttackPow);
            }
            enemy.setHealth(Health);
            enemy.setBulletSpeed(BulletSpeed);
            enemy.setAttacKPow(AttackPow);
        }
    }