Inheritance: EnemyController
Example #1
0
        public void DB_DeleteSpecificEntries_Collection()
        {
            BossController controller = new BossController(db);
            Boss           testBoss1  = new Boss
            {
                Name            = "Bowser",
                Species         = "Koopa King",
                Sex             = "Male",
                Location        = "Mushroom Kingdom",
                ImmediateThreat = true,
                HeroId          = 1
            };
            Boss testBoss2 = new Boss
            {
                Name            = "Madame Broode",
                Species         = "Rabbit",
                Sex             = "Female",
                Location        = "Cascade Kingdom",
                ImmediateThreat = false,
                HeroId          = 1
            };

            controller.Create(testBoss1, null);
            controller.Create(testBoss2, null);
            var collection = (controller.Index() as ViewResult).ViewData.Model as List <Boss>;

            controller.DeleteConfirmed(collection[0].BossId);
            var collection2 = (controller.Index() as ViewResult).ViewData.Model as List <Boss>;

            CollectionAssert.DoesNotContain(collection2, testBoss1);
        }
Example #2
0
 void Start()
 {
     bossController = GetComponent <BossController>();
     fullBlood      = blood;
     halfBlood      = fullBlood / 2;
     quarterBlood   = fullBlood / 4;
 }
Example #3
0
    public IEnumerator Fire(MovementController ctr, UtilityAction act)
    {
        act.isStoppable = false;

        BossController     btr  = ctr as BossController;
        BossHandController hand = btr.SelectOneHand();

        hand.anim.SetBool("Aim", true);
        Coroutine co = StartCoroutine(this.HandFire(btr, hand));

        if (Random.Range(0, 100) < this.boss.doubleAttackProbability)
        {
            BossHandController hand2 = btr.SelectOtherHand(hand);

            hand2.anim.SetBool("Aim", true);
            yield return(btr.Aim(hand2));

            yield return(btr.Fire(hand2));

            yield return(btr.Reset(hand2));
        }

        yield return(co);

        act.isRunning = false;
    }
Example #4
0
        public void ToggleState(bool enabled, PlayerMachine playerMachine)
        {
            _enabled       = enabled;
            PlayerMachine  = null;
            bossController = null;

            // Search for Boss
            var go = GameObject.Find("Boss Room");

            if (_enabled)
            {
                PlayerMachine = playerMachine;
                BuildDialogueCache();

                tvRadiusCache.ClearCache();
                talkVolumeRenderFlag = false;
                tvRadiusCache.UpdateCache(TalkVolumeCreator, talkVolumeRenderFlag);

                collPlaneCache.ClearCache();
                collisionRenderFlag = false;
                collPlaneCache.UpdateCache(VoidOutCreator, collisionRenderFlag);

                camEventsFound = FindObjectsOfType <HiddenPlatform>().Length > 0;

                if (go)
                {
                    bossController = go.GetComponent <BossRoomController>().Boss;
                }
            }
        }
Example #5
0
    public IEnumerator Death(MovementController ctr, UtilityAction act)
    {
        act.isStoppable = false;

        if (this.isDead)
        {
            yield break;
        }

        BossController     btr   = ctr as BossController;
        BossHandController hand1 = btr.SelectOneHand();
        BossHandController hand2 = btr.SelectOtherHand(hand1);

        this.TryStopCoroutine(ref this.followCoroutine);

        hand1.anim.SetTrigger("Death");
        hand2.anim.SetTrigger("Death");
        Coroutine c1 = StartCoroutine(btr.Reset(hand1));

        yield return(btr.Reset(hand2));

        yield return(c1);

        this.isDead   = true;
        act.isRunning = false;
    }
Example #6
0
 void Awake()
 {
     if (boss == null)
     {
         boss = this;
     }
 }
    /*
    void Start () {
        GameObject gameControllerObject = GameObject.FindWithTag("GameController");
        if (gameObject != null){
            gameController = gameControllerObject.GetComponent<GameController>();
        }
        if (gameController == null){
            Debug.Log("Cannot find GameController script");
        }
    }
    */
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Boundary"){
            return;
        }
        if (other.tag == "Player" && this.tag == "BossBolt"){
            Instantiate(playerExplosion, other.transform.position, other.transform.rotation);
            Destroy(other.gameObject);
            gameController.endGame();
        }
        if (other.tag == "Boss" && this.tag == "PlayerBolt"){

            GameObject bossObject = GameObject.FindWithTag("Boss");
            if (bossObject != null){
                boss = bossObject.GetComponent<BossController>();
            }
            if (boss == null){
                Debug.Log("cannot find boss script");
            }
            boss.bossInfo.health -= 10;
            gameController.updateBossHealthText();
            Destroy(gameObject);
            if (boss.bossInfo.health <= 0){
                Instantiate(bossExplosion, other.transform.position, other.transform.rotation);
                Destroy(other.gameObject);
                //gameController.destroyBoss();
                //gameController.setBossAlive(false);
                //StartCoroutine (gameController.spawnBoss());
            }

        }
    }
Example #8
0
 public WaitForSecondsOrHealth(float numSeconds, BossController boss, int phase)
 {
     startTime       = Time.time;
     this.numSeconds = numSeconds;
     this.boss       = boss;
     this.phase      = phase;
 }
Example #9
0
    public void MyCollision()
    {
        Collider[] enemyColliders = Physics.OverlapBox(transform.position, transform.localScale, Quaternion.LookRotation(Vector3.forward, Vector3.up));
        int        i = 0;

        //Check when there is a new collider coming into contact with the box
        while (i < enemyColliders.Length)
        {
            //Damage every enemy in the collider
            Debug.Log("Hit : " + enemyColliders[i].name + i);
            if (enemyColliders[i].tag == "Enemy")
            {
                EnemyController enemy = enemyColliders[i].GetComponent <EnemyController>();
                enemy.GetDamage(Random.Range(damage - difDamage, damage + difDamage));
            }
            if (enemyColliders[i].tag == "Turret")
            {
                TurretEnemy turret = enemyColliders[i].GetComponent <TurretEnemy>();
                turret.TakeDamage(Random.Range(damage - difDamage, damage + difDamage));
            }
            if (enemyColliders[i].tag == "Father")
            {
                BossController father = enemyColliders[i].GetComponent <BossController>();
                father.GetDamage(Random.Range(damage - difDamage, damage + difDamage));
            }
            //Increase the number of Colliders in the array
            i++;
        }
    }
 void Awake()
 {
     bossAudio  = transform.GetChild(0).GetComponent <AudioSource>();
     bossCtrl   = GameObject.FindGameObjectWithTag("Boss").GetComponent <BossController>();
     audioSrc   = GetComponent <AudioSource>();
     bossHealth = GameObject.FindGameObjectWithTag("Boss").GetComponentInChildren <BossHealth>();
 }
Example #11
0
    public INPCState UpdateState(BossController npc)
    {
        m_Timer += Time.deltaTime;
        Vector3 offset = npc.transform.position - m_Destination.position;
        float   sqrLen = offset.sqrMagnitude;


        npc.m_NavMeshAgent.SetDestination(m_DestPos);

        //CAUSE ISSUE, KEEP FOR REFERENCE
        //if (StayInRange(npc) != Vector3.zero)
        //    npc.m_NavMeshAgent.SetDestination(StayInRange(npc));
        //
        //if (Avoidance(npc) != Vector3.zero)
        //    npc.m_NavMeshAgent.SetDestination(Avoidance(npc));

        NavMeshPath path = new NavMeshPath();

        npc.m_NavMeshAgent.CalculatePath(m_Destination.position, path);
        if (path.status == NavMeshPathStatus.PathPartial)
        {
            npc.m_NavMeshAgent.SetDestination(npc.GetPlayer().transform.position);
        }

        if (IsLineOfSight(npc) && sqrLen < GetSqrDist(MAX_RADIUS) && offset.sqrMagnitude > GetSqrDist(MIN_RADIUS) || m_Timer >= m_MoveTime)
        {
            return(ExitState(npc.m_AttackState, npc));
        }

        return(this);
    }
Example #12
0
    public void EndWave()
    {
        Destroy(this.waves[0]);
        this.waves.RemoveAt(0);                  // Remove the cleared wave.
        ObjectPooler.SharedInstance.ClearPool(); // Clear pooled game objects on the previous wave.

        if (this.waves.Count != 0)
        {
            BossController boss = GameObject.FindGameObjectWithTag("Mountain").GetComponent <BossController>();
            StartCoroutine(boss.PlayWaveEndCutscene());
            this.SpawnUpgrades(spawnPoints);
        }
        else
        {
            DissolveController controller = GameObject.FindGameObjectWithTag("Mountain").GetComponent <DissolveController>();
            controller.StartDissolving();
            controller.PlaySoundEffect();
            controller.PlayVictoryMusic();
        }

        if (waves.Count != 0)
        {
            this.spawnPoints[0].GetComponentsInParent <BoxCollider>(true)[0].enabled = true;
        }
    }
    //==============================================
    // Methods
    //==============================================

    /// <summary>
    /// Spawn new boss with higher level if current boss is destroyed.
    /// </summary>
    IEnumerator spawnWaves()
    {
        yield return(new WaitForSeconds(startWait));

        while (true)
        {
            GameObject bossObject = GameObject.FindWithTag("Boss");
            if (bossObject == null)
            {
                bossObject     = (GameObject)Instantiate(boss, bossSpawn.position, bossSpawn.rotation);
                bossController = bossObject.GetComponent <BossController>();
                bossController.bossInfo.level          = previousBossLevel + 1;
                bossController.bossInfo.health        += (bossController.bossInfo.level - 1) * 20;
                bossController.bossInfo.numberOfBolts += (bossController.bossInfo.level - 1);
                if (bossController.bossInfo.miniWave < 6)
                {
                    bossController.bossInfo.miniWave += (bossController.bossInfo.level - 1);
                }
                previousBossLevel = bossController.bossInfo.level;
                bossAlive         = true;
                updateBossHealthText();
                updateBossLevelText();
            }
            yield return(new WaitForSeconds(waveWait));
        }
    }
    void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.name == "Invader(Clone)")
        {
            // GameObject particle = Instantiate(hitParticleSystem, this.transform);
            // particle.transform.parent = null;
            enemyController = collision.gameObject.GetComponent <EnemyController>();
            float hp = enemyController.hp;
            hp = hp - 5;
            enemyController.hp = hp;
            Destroy(this.gameObject);
        }
        else if (collision.name == "EnemyHP") //This is fine for now but if I add more enemy types I should optimise this
        {
            enemyController = collision.gameObject.GetComponent <EnemyController>();
            float hp = enemyController.hp;
            hp -= 5;
            enemyController.hp = hp;
            if (ctrl.hp != ctrl.maxHp)
            {
                ctrl.hp += 5;
            }

            Destroy(this.gameObject);
        }
        else if (collision.name == "Boss_Placeholder(Clone)")
        {
            GameObject particle = Instantiate(hitParticleSystem, this.transform);
            particle.transform.parent = null;
            bossController            = collision.GetComponent <BossController>();
            bossController.hp        -= 5;
            Destroy(this.gameObject);
        }
    }
 void Awake()
 {
     bossCtrl      = FindObjectOfType <BossController>();
     characterCtrl = FindObjectOfType <CharacterMovement>();
     smoothFollow  = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <SmoothFollow>();
     anim          = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <Animator>();
 }
Example #16
0
        /*
         * Called on collision with player. Triggers collison death.
         */
        public virtual void OnTriggerEnter(Collider other)
        {
            Profiler.BeginSample("Projectile Collision");
            GameObject otherObject = other.gameObject;
            Entity     otherEntity = otherObject.GetComponentInParent <Entity>();

            if (otherEntity != null)
            {
                // All projectiles break if they do damage
                if (!otherEntity.IsInvincible() && otherEntity.GetFaction() != data.Entity.GetFaction())
                {
                    //Debug.Log("Projectile collided, should apply damage");
                    Entity.DamageEntity(otherEntity, data.Entity, data.Damage);
                    BossController.ExecuteAsync(data.OnDestroyCollision(this));
                    Destroy(this.gameObject);
                }

                // Player's projectiles always break on the boss, even if he's invincible
                if (data.Entity.GetFaction() == Entity.Faction.player)
                {
                    if (otherEntity.IsInvincible())
                    {
                        data.OnDestroyCollision(this);
                        Destroy(this.gameObject);
                    }
                }
            }
            Profiler.EndSample();
        }
Example #17
0
    // DONT DESTROY ON LOAD

	void Start () {
        cdNow = 0;
        shoot();
        instance = this;
        hitDelay = 0;
        DontDestroyOnLoad(gameObject);
    }
Example #18
0
 private void Start()
 {
     if (boss == null)
     {
         boss = GameObject.FindObjectOfType <BossController>();
     }
 }
 void Awake()
 {
     bossCtrl   = FindObjectOfType <BossController>();
     eyeModel   = GameObject.FindGameObjectWithTag("EyeModel");
     sceneFader = GameObject.FindGameObjectWithTag("Fader").GetComponent <SceneFadeInOut>();
     anim       = GameObject.Find("Boss_Rig").GetComponent <Animator>();
 }
 private void Update()
 {
     if (IsActive)
     {
         targeting.LookAt(Target.transform);
         if (!isCharging)
         {
             if (!IsMoving)
             {
                 MoveToPosition();
                 AimAtPlayer(false);
                 TargetPlayerConstraint.constraintActive = false;
             }
             else
             {
                 if ((BossController.remainingDistance < 2.5f && BossController.remainingDistance != 0) && !waiting)
                 {
                     TargetPlayerConstraint.constraintActive = true;
                     BossController.isStopped = true;
                     StartCoroutine("WaitToMove");
                     AimAtPlayer(true);
                     waiting = true;
                 }
             }
         }
         else
         {
             if (IsMoving && !isStunned)
             {
                 BossController.Move(mainBody.transform.forward * chargeSpeed * Time.deltaTime);
             }
         }
     }
 }
Example #21
0
    void Update()
    {
        if (this.canDissolve)
        {
            if (!this.hasAppliedMaterial)
            {
                GetComponent <BossController>().SwitchMountainMaterial(this.dissolveMaterial);
                this.hasAppliedMaterial = true;
            }

            if (!this.isInCinemaMode)
            {
                BossController boss = gameObject.GetComponent <BossController>();
                StartCoroutine(boss.PlayLevelEndCutscene());
                this.isInCinemaMode = true;
            }

            this.dissolveMaterial.SetFloat("_AnimationFrame", this.dissolveMaterial.GetFloat("_AnimationFrame") + this.animationSpeed);
        }
        if (this.dissolveMaterial.GetFloat("_AnimationFrame") >= 1)
        {
            this.canDissolve = false;

            // Reset the animation frame because for some reason Unity saves this.
            this.dissolveMaterial.SetFloat("_AnimationFrame", 0);

            this.gameObject.SetActive(false);
        }
    }
Example #22
0
 public override void Enter(BossController bossController)
 {
     stateName    = "Teleport";
     teleportTime = bossController.bossTeleport.GetTeleportTime();
     bossController.TurnOnInvulnerable();
     bossController.bossTeleport.TeleportStart();
 }
Example #23
0
 // Start is called before the first frame update
 void Start()
 {
     script         = player.GetComponent <PlayerController>();
     scriptB        = boss.GetComponent <BossController>();
     scriptB.speed += (float)script.gravesDestroyed;
     oldGraveCount  = script.gravesDestroyed;
 }
Example #24
0
        public void DB_FilterEntriesByThreat_Collection()
        {
            BossController controller = new BossController(db);

            Boss testBoss1 = new Boss
            {
                Name            = "Bowser",
                Species         = "Koopa King",
                Sex             = "Male",
                Location        = "Mushroom Kingdom",
                ImmediateThreat = true,
                HeroId          = 1
            };
            Boss testBoss2 = new Boss
            {
                Name            = "Madame Broode",
                Species         = "Rabbit",
                Sex             = "Female",
                Location        = "Cascade Kingdom",
                ImmediateThreat = false,
                HeroId          = 1
            };

            var isThreat = new List <Boss> {
                testBoss1
            };

            controller.Create(testBoss1, null);
            controller.Create(testBoss2, null);
            var collection = (controller.IndexThreat(true) as ViewResult).ViewData.Model as List <Boss>;

            CollectionAssert.AreEqual(isThreat, collection);
        }
Example #25
0
    public static bool BossAttack(PlayerAttack target, BossController attacker)
    {
        float attack = attacker.Attack - (target.Defence + target.Armour);

        target.Health -= attack;
        return(target.Health <= 0);
    }
    private void OnTriggerEnter2D(Collider2D other)
    {
        switch (other.tag)
        {
        case "Enemy":
            Destroy(transform.gameObject);
            other.GetComponent <Animator>().SetTrigger("Dead");

            GameObject.Find("GameMaster").GetComponent <GameMaster>().OnEnemyDestroyed(other.gameObject);
            other.GetComponents <AudioSource>()[1].Play();
            break;

        case "Boss":
            Destroy(transform.gameObject);

            BossController bossController = other.GetComponent <BossController>();
            bossController.currentLife -= damage;
            if (bossController.currentLife <= 0)
            {
                other.GetComponent <Animator>().SetTrigger("Dead");
                GameObject.Find("GameMaster").GetComponent <GameMaster>().OnBossDestroyed(other.gameObject);
                other.GetComponents <AudioSource>()[1].Play();
            }
            else
            {
                other.GetComponents <AudioSource>()[2].Play();
            }
            break;

        case "VerticalBorder":
            Destroy(transform.gameObject);
            break;
        }
    }
Example #27
0
    void Start()
    {
        if (m_Type == type.player)
        {
            m_MaxHeal       = GameController.m_MaxHealPlayer;
            m_Heal          = m_MaxHeal;
            m_PlayerControl = GetComponentInParent <PlayerController>();
            if (m_PlayerControl.m_HealManager)
            {
                m_PlayerControl.m_HealManager.Innit();
                m_PlayerControl.m_HealManager.DrawUI(m_MaxHeal, m_Heal);
            }
        }

        if (m_Type == type.boss)
        {
            m_BossControl = GetComponent <BossController>();
            if (m_BossControl.m_HealManager)
            {
                m_BossControl.m_HealManager.Innit();
                m_BossControl.m_HealManager.DrawUI(m_MaxHeal, m_Heal);
            }
        }

        GameObject soundManager = GameObject.FindGameObjectWithTag("sound");

        if (soundManager)
        {
            m_soundControl = soundManager.GetComponent <SoundController>();
        }
    }
    public void fireBullet()
    {
        int score     = int.Parse(mainScore.text);
        int realScore = 0;

        if (score >= 10 && Guntip)
        {
            if (Time.time > nextFire)
            {
                nextFire = Time.time + fireRate;
                if (facingRight)
                {
                    Instantiate(bullet, Guntip.position, Quaternion.Euler(new Vector3(0, 0, 0)));
                }
                else if (!facingRight)
                {
                    Instantiate(bullet, Guntip.position, Quaternion.Euler(new Vector3(0, 0, 180)));
                }
            }
            realScore      = score - 10;
            mainScore.text = realScore.ToString();
        }
        else if (realScore < 100)
        {
            BossController bossHandle = bossCastle.gameObject.GetComponent <BossController>();
            bossHandle.orderLayerForBoss(1);
        }
    }
Example #29
0
    public static GameObject CreateEnemy(float x_position, float z_position, float maxLife, string type, int id)
    {
        Object     prefab;
        GameObject enemyObj;

        if (type == "boss")
        {
            prefab = Resources.Load("boss");
//			print ("CreateEnemy boss" + " " + type);

            enemyObj = Instantiate(prefab, new Vector3(x_position, 1, z_position), Quaternion.identity) as GameObject;

            //		GameObject enemyObj = Instantiate(prefab) as GameObject;
            BossController bossController = enemyObj.GetComponent <BossController>();
            bossController.config(maxLife, type, id);
        }
        else
        {
            prefab = Resources.Load("Enemy");
//			print ("CreateEnemy Enemy" + " " + type);

            enemyObj = Instantiate(prefab, new Vector3(x_position, 0, z_position), Quaternion.identity) as GameObject;

            //		GameObject enemyObj = Instantiate(prefab) as GameObject;
            NormalEnemyController normalEnemyController = enemyObj.GetComponent <NormalEnemyController>();
            normalEnemyController.config(maxLife, type, id);
        }
        return(enemyObj);
    }
Example #30
0
    void Awake()
    {
        if (forEnemy)
        {
            ec = transform.parent.parent.GetComponent <EnemyController>();
//			Debug.Log (transform.parent.parent);
        }
        if (forBoss)
        {
            bc = transform.parent.parent.GetComponent <BossController>();
        }
        else
        {
            pc = transform.root.GetComponent <PlayerController>();
        }
        Collider col = gameObject.GetComponent <Collider>();

        col.isTrigger = true;
        Rigidbody rb = gameObject.GetComponent <Rigidbody>();

        rb.isKinematic = true;
        rb.useGravity  = false;

        if (gameObject.tag == "Shield")
        {
            gameObject.SetActive(false);
        }
    }
 // Use this for initialization
 void Start()
 {
     sprite         = this.gameObject.transform.Find("Sprite");
     animator       = sprite.GetComponent <Animator>();
     agent          = gameObject.GetComponent <NavMeshAgent>(); //Get the agent of the Enemy
     bossController = GetComponent <BossController>();
 }
Example #32
0
        private void SearchPhoneButton_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;

            try
            {
                customer = BossController.Instance().customerController.GetCustomer(PhoneTextBox.Text);
            }
            catch (Exception exception)
            {
                MessageBox.Show(ErrorManager.Instance().GetErrorMessage(exception));
                this.Cursor = Cursors.Default;
                return;
            }

            CustomerNameLabel.Text    = customer.name.ToString();
            CustomerNameLabel.Enabled = true;
            AdressTextBox.Text        = customer.address;
            EmailTextBox.Text         = customer.email;

            sale.SetCustomer(customer);
            LoadeAllUnPaidPrescriptions(customer);
            LoadeAllUnpaidTreatments(customer);

            this.Cursor = Cursors.Default;
        }
Example #33
0
    void Start()
    {
        _playerCont = player.GetComponent<PlayerController>();
        _bossCont = boss.GetComponent<BossController>();

        _tempPlayerText = tempPlayerText.GetComponent<Text>();
        _tempEnemyText = tempEnemyText.GetComponent<Text>();
    }
Example #34
0
	void Awake() {
		if (instance == null) {
			instance = this;
			DontDestroyOnLoad(gameObject);
		}
		if (instance != this) {
			Destroy(gameObject);
		}
	}
Example #35
0
    void Start()
    {
        bossController = GameObject.Find("Boss controller").GetComponent<BossController>();
        rangeScript = GetComponentInChildren<RangeAngle>();

        currentPoint = points[startPoint];
        pointSelection = startPoint;
        autostart = false;
    }
    public void LoadNextBoss(float depth)
    {
        GameObject boss = (GameObject)Instantiate (bossPrefab, this.transform.position, Quaternion.identity);
        bossController = boss.GetComponent<BossController> ();
        bossController.Init (depth);
        time = bossController.GetBossTime ();

        fightStarted = false;
    }
	// Use this for initialization
	void Start () {
		if (gameObject.name == "Acolyte")
		    maxHealth = 250;
		if (gameObject.name == "Priest")
			maxHealth = 1500;

		currentHealth = maxHealth;
		sprite = GetComponent<SpriteRenderer> ();
		defaultColor = sprite.color;
		BossController = GetComponent<BossController> ();
	}
    void Start()
    {
        scoreMiddleBat = GameObject.Find("SpawnPoint").GetComponent<Spawner>();
        scoreMiddleSquirrel = GameObject.Find("squirrelspawn").GetComponent<Spawner>();

        scoreToEndbat = GameObject.Find("SpawnPoint").GetComponent<Spawner>();
        scoreToEndsquirrel = GameObject.Find("squirrelspawn").GetComponent<Spawner>();

        bossTrigger = GameObject.FindObjectOfType<BossController>();

        backgroundScroller = GameObject.FindObjectOfType<BackgroundScroller>();

        fasterSound = GameObject.FindObjectOfType<FasterSound>();
        changeRadiusSound = GameObject.FindObjectOfType<ChangeRadiusSound>();

        text = GetComponent<Text>();

        score = 0;
    }
Example #39
0
	// Use this for initialization
	void Start () {
        targetGo = GameController.Instance.GetPlayerByRoleID(targetRoleId);
        player = targetGo.transform;
		//player = TranscriptManager._instance.player.transform;
        TranscriptManager._instance.AddEnemy(this.gameObject);
		attack01GameObject = transform.Find("attack01").gameObject;
		attack02GameObject = transform.Find("attack02").gameObject;
		attack03Pos = transform.Find("attack03Pos");
	    renderer = transform.Find("Object01").GetComponent<Renderer>();
        BossHPProgressBar.Instance.Show(hp);


        bossController = GetComponent<BossController>();
        bossController.OnSyncBossAnimation += this.OnSyncBossAnimation;
        if (GameController.Instance.battleType == BattleType.Team && GameController.Instance.isMaster)
        {
            InvokeRepeating("CheckPositionAndRotation", 0, 1f / 30f);
            InvokeRepeating("CheckAnimation", 0, 1f / 30);
        }
	}
Example #40
0
    void OnTriggerEnter2D(Collider2D coll)
    {
        if(coll.gameObject.tag == "Easy" || coll.gameObject.tag == "Medium" || coll.gameObject.tag == "Hard")
        {
            enemyController = coll.gameObject.GetComponent<EnemyController>();
            if(coll.gameObject.transform.position.y <= 5)
            {
                bool isDead = enemyController.IsDead();

                if (!isDead)
                {
                    Destroy(gameObject);
                    enemyController.DoDamage(1);
                }
                else
                {
                    return;
                }
            }
        }
        else if (coll.gameObject.tag == "Boss1" || coll.gameObject.tag == "Boss2" || coll.gameObject.tag == "Boss3" || coll.gameObject.tag == "Boss4" || coll.gameObject.tag == "Boss5")
        {
            bossController = coll.gameObject.GetComponent<BossController>();
            if(coll.gameObject.transform.position.y <= 5)
            {
                bool isDead = bossController.IsDead();

                if(!isDead)
                {
                    Destroy(gameObject);
                    bossController.DoDamage(1);
                }
                else
                {
                    return;
                }
            }
        }
    }
    public void Init(BossController bossController, Vector3 location)
    {
        this.bossController = bossController;
        this.location = location;

        /*
        this.masterBodyComponent = masterBodyComponent;
        if (this.masterBodyComponent != null) {
            this.transform.parent = masterBodyComponent.transform;
        }
        */
    }
 // Use this for initialization
 void Start() {
     boss = GameObject.FindObjectOfType<BossController>();
     bossHealth = GetComponent<Text>();
 }
Example #43
0
	void Start() {
		player = PlayerController.instance;
		boss = GameObject.FindObjectOfType<BossController>();
		clock = GameObject.FindObjectOfType<Clock>();

	}
Example #44
0
    // Use this for initialization
    void Start()
    {
        script = this;
        GameManager.script.CurrentBossObject = this.gameObject; //紀錄當前魔王物件(使用絕技要暫停iTween)

        //載入敵人資訊
        this.bossInfo = this.GetComponent<BossPropertyInfo>();

        //設定BoneAnimation
        this.boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();
        this.boneAnimation.RegisterUserTriggerDelegate(UserTrigger);
        this.boneAnimation.RegisterColliderTriggerDelegate(WeaponHit);
        GameManager.script.RegisterBoneAnimation(this.boneAnimation);   //註冊BoneAnimation,GameManager統一管理

        //紀錄原始Scale
        this.originScale = this.transform.localScale;

        //抓到Boss的定位點
        foreach (var pos in this.BattlePositionList)
            pos.PositionTransform = GameObject.Find(pos.PositionName).transform;

        this.NextActionTime = 0;

        //測試用,進行魔王登場
        this.BossReadyAppear();
    }
Example #45
0
	// Use this for initialization
	void Start () {
		audioSource = GetComponent<AudioSource>();
		boss = GameObject.FindObjectOfType<BossController>();
	}