Exemple #1
0
 // Start is called before the first frame update
 private void Awake()
 {
     currentAttackPattern = SingleAttackFromAllGunsGroup1;
     movementController   = GetComponent <MovementController>();
     stats             = GetComponent <Stats>();
     currentCollider2D = GetComponent <Collider2D>();
     bossStats         = GetComponent <BossStats>();
 }
Exemple #2
0
 protected override void Start()
 {
     base.Start();
     damageDealer    = GetComponentInChildren <DamageDealer>();
     bossStats       = GetComponent <BossStats>();
     meshAgent       = GetComponentInChildren <NavMeshAgent>();
     target          = targetGiver.Player;
     meshAgent.speed = 2 * bossStats.Speed;
 }
Exemple #3
0
    private void OnBossDead(BossStats bossStats)
    {
        int newMoneyReward = ((int)(moneySession * bossStats.GetMoneyRewardMultiplier())) - moneySession;
        int newScore       = ((int)(score * bossStats.GetScoreRewardMultiplier())) - score;

        AddSessionMoney(newMoneyReward);
        AddMoney(newMoneyReward);
        AddScore(newScore);
    }
Exemple #4
0
    void Awake()
    {
        if (_instance != null)
        {
            Destroy(gameObject);
            return;
        }

        _instance = this;
    }
Exemple #5
0
    private void Awake()
    {
        // get the values to display
        bossStats = GameObject.FindGameObjectWithTag("Boss").GetComponent <BossStats>();
        if (bossStats == null)
        {
            Debug.Log("BossGUIManager could not retrieve BossStats component from Boss gameObject");
        }

        // set the correct layout
        InitBarLayout();
    }
Exemple #6
0
    // Start is called before the first frame update
    void Start()
    {
        this.stage = 0;

        //Estadisticas fase 1
        phases[0] = new BossStats(15, 5.0f, 10.0f, 2.0f, true);

        //Estadisticas fase 2
        phases[1] = new BossStats(3, 25.0f, 30.0f, 1.0f, false);

        //Estadisticas fase 3
        phases[2] = new BossStats(10, 10.0f, 15.0f, 3.0f, true);
    }
Exemple #7
0
    private bool TryToSpawnBoss()
    {
        BossStats boss = bossList.Where(b => b.GetMinimalKilledWeightToSpawn(killedBossIteration) < sumKilledWeight).FirstOrDefault();

        if (boss != null)
        {
            boss.Spawn(GetRandomPositionForSpawn(), killedBossIteration);
            isBossSpawned = true;
            DespawnObjectsByPrefabList(prefabSpawnEnemy);
            return(true);
        }
        return(false);
    }
 // Use this for initialization
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player");
     boss = GameObject.FindGameObjectWithTag("Boss");
     if (boss != null)
     {
         bStats = boss.GetComponent<BossStats>();
     }
     if (player != null)
     {
         pStats = player.GetComponent<PlayerStats>();
         runner = player.GetComponent<Cryomancer>();
     }
 }
 // Start is called before the first frame update
 void Start()
 {
     audioSource      = GetComponent <AudioSource>();
     damageble        = false;
     shieldActive     = false;
     AirPhaseComplete = false;
     BossEngaged      = false;
     engaged          = BossEngaged;
     AirPhase         = false;
     attacking        = false;
     boss             = GetComponent <BossStats>();
     target           = PlayerManager.instance.player.transform;
     agent            = GetComponent <NavMeshAgent>();
     enemyAnimations  = GetComponentInChildren <Animator>();
 }
Exemple #10
0
 //initialise scripts and variables
 void Start()
 {
     an    = GetComponent <Animator> ();
     bs    = GetComponent <BossStats> ();
     eod   = GetComponent <EffectOnDeath> ();
     spawn = GameObject.Find("Projectiles");
     //start firing only if the player is alive
     if (player = GameObject.FindGameObjectWithTag("Player"))
     {
         StartCoroutine(BossAttacks());
     }
     //initialise health bar
     bs.health       = bs.maxHealth;
     healthBar       = GameObject.Find("Boss Health Bar").GetComponent <Slider>();
     healthBar.value = bs.health;
 }
    //play the intro animation, assign scripts to variables


    void Start()
    {
        clip.Play();
        bs  = GetComponent <BossStats> ();
        bm  = GetComponent <Boss1Movement> ();
        eod = GetComponent <EffectOnDeath> ();
        gc  = GameObject.Find("Game Controller").GetComponent <GameController> ();

        //begin coroutines if the player is alive
        if (player = GameObject.FindGameObjectWithTag("Player"))
        {
            StartCoroutine(AimTurrets());
            StartCoroutine(BossAttacks());
            StartCoroutine(bm.Hover());
        }

        //initialise the health bar
        bs.health       = bs.maxHealth;
        healthBar       = GameObject.Find("Boss Health Bar").GetComponent <Slider>();
        healthBar.value = bs.health;
    }
    void Awake()
    {
        Scene scene = SceneManager.GetActiveScene();

        if (scene.name == "Dungeon Boss")
        {
            fsmBoss   = GameObject.FindGameObjectWithTag("Boss").GetComponent <FSMBoss>();
            bossStats = GameObject.FindGameObjectWithTag("Boss").GetComponent <BossStats>();
        }

        contains = new List <GameObject>();

        tornadoCirclesPS = tornadoCircleGO.GetComponent <ParticleSystem>();
        foggyBasePS      = foggyBaseGO.GetComponent <ParticleSystem>();
        smallFragmentsPS = smallFragmentsGO.GetComponent <ParticleSystem>();

        player       = GameObject.FindGameObjectWithTag("Player");
        playerStatus = player.GetComponent <PlayerStatus>();

        tornadoEyeTr   = transform.FindChild("TornadoEye");
        tornadoCircles = new ParticleSystem.Particle[tornadoCirclesPS.main.maxParticles];
    }
Exemple #13
0
    public void Spawn(Vector3 pos, int bossKillIteration)
    {
        GameObject spawnedBoss = Instantiate(gameObject);

        spawnedBoss.transform.position = pos;
        GameObject spawnedArena = Instantiate(arena);

        currentIteration = bossKillIteration;

        Stats stats = spawnedBoss.GetComponent <Stats>();

        stats.SetDamageMultiplier(currentIteration);
        stats.SetLiveMultiplier(currentIteration);

        BossStats bossStats = spawnedBoss.GetComponent <BossStats>();

        bossStats.SetIteration(currentIteration);

        spawnedArena.transform.position = spawnedBoss.transform.position;
        spawnedArena.GetComponent <FollowToTarget>().SetTarget(spawnedBoss.transform);

        Messenger.Broadcast(GameEvents.BOSS_SPAWNED, gameObject);
    }
    public override bool Decide(DayFSM FSM)
    {
        // Get boss stats
        BossStats bossStats = FSM.bossB.bossStats;
        //Get distance between the boss and the player
        float targetDistance = FSM.bossB.TargetDistance();

        //Depending on the selected type we return true for
        switch (distanceType)
        {
        case DistanceType.CAC:
            if (targetDistance >= 0 && targetDistance <= bossStats.CACReach)
            {
                return(true);
            }
            break;

        case DistanceType.MID:
            if (targetDistance > bossStats.CACReach && targetDistance <= bossStats.MIDReach)
            {
                return(true);
            }
            break;

        case DistanceType.LONG:
            if (targetDistance > bossStats.MIDReach && targetDistance <= bossStats.LONGReach)
            {
                return(true);
            }
            break;

        default:
            break;
        }

        return(false);
    }
Exemple #15
0
    void Awake()
    {
        currState = State.PATROL;

        thePlayer       = GameObject.FindGameObjectWithTag("Player");
        thePlayerStatus = thePlayer.GetComponent <PlayerStatus>();
        bossAnimator    = GetComponent <Animator>();
        bossStats       = GetComponent <BossStats>();
        meleeDamage     = bossStats.meleeDamage;

        iceSpikesScript = FindObjectOfType <IceSpikesBehaviour>();
        if (iceSpikesScript == null)
        {
            iceSpikesScript3D = FindObjectOfType <IceSpikesBehaviour3D>();
            if (iceSpikesScript3D == null)
            {
                Debug.LogError("Error: iceSpikesScript not found.");
            }
        }

        castingArea = GameObject.FindGameObjectWithTag("CastingArea");


        earthAuraPS = earthAura.GetComponent <ParticleSystem>();
        earthAuraPS.Stop();
        ballAttackIndicatorPS = ballAttackIndicator.GetComponent <ParticleSystem>();
        ballAttackIndicatorPS.Stop();
        fireAura.GetComponent <SphereCollider>().enabled = false;
        fireAuraPS = fireAura.GetComponent <ParticleSystem>();
        fireAuraPS.Stop();
        fireAuraDamageScript   = fireAura.GetComponent <FireAuraDamage>();
        earthAuraDamageScript  = earthAura.GetComponent <EarthAuraDamage>();
        levitatingSkullsScript = levitatingSkulls.GetComponent <LevitatingSkullsBehaviour>();

        bodyMesh = transform.Find("ModelContainer").gameObject;
    }
Exemple #16
0
 private void BossWereKilled(BossStats stats)
 {
     bar.transform.parent.gameObject.SetActive(false);
 }
Exemple #17
0
 protected override void ResetState()
 {
     playerStats = null;
 }
Exemple #18
0
 protected override void LoadState()
 {
     playerStats = BossStats.Parse(FileContents);
 }
Exemple #19
0
 void Start()
 {
     _bossStats = GetComponent <BossStats>();
 }
Exemple #20
0
 protected override void ResetState()
 {
     bossStats = null;
 }
 void Awake()
 {
     bs = GetComponent <BossStats> ();
 }
    void Start()
    {
        if (cursorLocking)
        {
            Cursor.visible = false;
            Screen.lockCursor = true;
        }

        health = maxHealth;

        //Get game stat initialization info
        if (GameObject.FindGameObjectWithTag("Properties") != null)
        {
            gameStats = GameObject.FindGameObjectWithTag("Properties").GetComponent<GameStats>();
            gameStats.AssignData();
        }

        //Get a ref to the boss (for cheat keys)
        if (GameObject.FindGameObjectWithTag("Boss") != null)
        {
            boss = GameObject.FindGameObjectWithTag("Boss").GetComponent<BossStats>();
        }

        SetPauseMenuRect();
    }
Exemple #23
0
 private void OnKilledBoss(BossStats stats)
 {
     isBossSpawned = false;
     killedBossIteration++;
 }