Esempio n. 1
0
 void Awake()
 {
     instance  = GetComponent <BossMonster>();
     myAnims   = GetComponent <Animator>();
     spriteRdr = GetComponent <SpriteRenderer>();
     myAnims.SetInteger("Boss", PlayerStats.instance.stats.curStage);
 }
Esempio n. 2
0
    public void CalculateCorrect()
    {
        bool correct = true;

        if (!boss)
        {
            boss = FindObjectOfType <BossMonster>();
        }

        for (int i = 0; i < 3; i++)
        {
            if (!answers[i].AnswerCorrect())
            {
                correct = false;
                break;
            }
        }

        if (correct)
        {
            boss.MonsterHurt();
        }
        else

        {
            boss.EnemyAttack();
        }
    }
Esempio n. 3
0
    internal void GenerateMultiplication(QuizButton button, BossMonster a_boss)
    {
        if (button.enemyChoices < 2)
        {
            enemyChoices = 2;
        }
        else if (button.enemyChoices > 6)
        {
            enemyChoices = 6;
        }
        else
        {
            enemyChoices = button.enemyChoices;
        }


        ClearEverything();

        if (!questionManager)
        {
            questionManager = FindObjectOfType <questionManager>();
        }


        questionManager.questionNeeded = CreateCorrectAnswer(button);


        boss = a_boss;

        SetBoxes(button);
    }
Esempio n. 4
0
    public override void PrepareMinigameObjects()
    {
        StageElementsToModify = GameObject.FindGameObjectsWithTag("Disable_BossBattle");
        foreach (var ele in StageElementsToModify)
        {
            ele.SetActive(false);
        }
        BossMonster boss_instance = Instantiate(Boss);

        boss_instance.Initialize();
        NPCS.Add(boss_instance.GetComponent <BossMonster>());
    }
Esempio n. 5
0
    private IEnumerator MonsterWaveCoroutine()
    {
        yield return(StartCoroutine(WaitWaveCoroutine(5)));

        while (true)
        {
            //yield return StartCoroutine(WaitWaveCoroutine(30));
            InGameUIManager.instance.panel_MainInGame.text_round.text = LanguageManager.instance.GetCurrentLanguageText("Text_Round") + " : " + round;
            InGameUIManager.instance.panel_MainInGame.text_time.text  = round.ToString();

            if (round % 10 == 0)
            {
                BossMonster bossMonsterPrefab = ResourceManager.instance.GetMonoBehavioursObject <BossMonster>("BossMonster");
                BossMonster bossMonster       = Instantiate(bossMonsterPrefab);
                bossMonster.transform.SetParent(null);
                roundCheckMonster.Add(bossMonster);
                monsterList.Add(bossMonster);

                MonsterUIRefresh();
                if (IsMonsterOver())
                {
                    EndGame();
                }
            }

            else
            {
                for (int i = 0; i < 10; i++)
                {
                    Monster monster = _objectpoolManager.GetMonster();
                    monster.SetSpriteOrder(round - i);
                    monster.gameObject.SetActive(true);
                    roundCheckMonster.Add(monster);
                    monsterList.Add(monster);

                    MonsterUIRefresh();
                    if (IsMonsterOver())
                    {
                        EndGame();
                    }

                    yield return(new WaitForSeconds(0.25f));
                }
            }

            //yield return new WaitUntil(() => roundCheckMonster.Count <= 0);

            round++;

            yield return(StartCoroutine(WaitWaveCoroutine(30)));
        }
    }
Esempio n. 6
0
    internal void MultipleAnswers(BossMonster boss, BossButton a_running)
    {
        //Spacing prevents answers from being spread out at first, but slowly expands them as we continue.
        int spacing = boss.bossSpacing;

        if (spacing > answers.Length)//If we have a range that is over our threshold, we'll have to clamp it back down.
        {
            spacing = answers.Length;
        }


        DisableMultiple();//Turn off all buttons.



        enemyAnswerNeeded = boss.answerNeeded;

        player.SetTime(true, a_running.levelTime);

        foreach (AdditionAnswer item in answers) //Set answers to negative. Easier to find if they're inactive now.
        {
            item.SetAnswer(-1);
        }
        int index = Random.Range(0, spacing);


        //Our list of duplicates. If you're the same, you're invalid.
        answersList = new List <int>();

        //One Answer is set to be correct.
        answers[index].gameObject.SetActive(true);
        answers[index].SetAnswer(enemyAnswerNeeded);
        answersList.Add(enemyAnswerNeeded);

        for (int i = 1; i < a_running.enemyChoices; i++)
        {
            int wrongAnswer = -3;
            while (wrongAnswer < a_running.minNumber || CheckMultiple(a_running, wrongAnswer)) //Continue looping if we have a dupe, or the number is under 0, essentially.
            {
                int range = Random.Range(-a_running.enemyAnswerRange, a_running.enemyAnswerRange);

                wrongAnswer = enemyAnswerNeeded + range;
            }
            index = Random.Range(0, spacing);
            while (answers[index].GetAnswer() != -1) //continue looking for buttons until we find an empty one.
            {
                index = Random.Range(0, spacing);
            }
            answers[index].gameObject.SetActive(true);
            answers[index].SetAnswer(wrongAnswer);
        }
    }
Esempio n. 7
0
    public void SetBossInfo()
    {
        boss = GameObject.FindGameObjectWithTag("Boss").GetComponent <BossMonster>();

        if (boss != null)
        {
            hpBar.maxValue = boss.maxHP;
            hpBar.value    = boss.curHP;
            bossname.text  = "달빛 아래의 백합";

            Invoke("FollowRedBar", 0.5f);
        }
    }
Esempio n. 8
0
    public void BossClass(AnotherVec2 a_vcDir, float a_fSpeed)
    {
        if (BossliPool.Count == 0)
        {
            BmMake(nMAKE_DEFAULT_COUNT);
        }

        BossMonster Bossmonster = BossliPool[BossliPool.Count - 1];

        BossliPool.RemoveAt(BossliPool.Count - 1);

        Bossmonster.Init(6.0F, 10, 0, a_vcDir, a_fSpeed);
        BossliActive.Add(Bossmonster);
    }
    internal void CreateTorpedo(RectTransform a_start, RectTransform a_end, BossMonster a_boss, string a_answer, SubtractionContainer subtractionContainer, float a_velocity)
    {
        start = a_start;

        container = subtractionContainer;

        Answer = a_answer;

        GetComponentInChildren <Text>().text = a_answer.ToString();

        rect = GetComponent <RectTransform>();
        end  = a_end;
        boss = a_boss;

        velocity = a_velocity;
    }
    //Player has clicked on button, button checks if the answer was correct, and acts accordingly.
    public void submitAnswer()
    {
        if (!monster)
        {
            container = GetComponentInParent <AdditionContainer>();
            monster   = FindObjectOfType <BossMonster>();
        }

        if (Answer == container.enemyAnswerNeeded)
        {
            monster.MonsterHurt();
        }
        else
        {
            monster.EnemyAttack();
        }
    }
Esempio n. 11
0
    public void EndGame()
    {
        if (gameEnd)
        {
            return;
        }
        gameEnd = true;

        StopCoroutine(waveCoroutine);
        int len = monsterList.Count;

        for (int i = 0; i < len; i++)
        {
            QuestMonster qm = monsterList[i] as QuestMonster;
            BossMonster  bm = monsterList[i] as BossMonster;

            if (bm != null && qm != null)
            {
                Destroy(monsterList[i]);
            }
            else
            {
                _objectpoolManager.ReturnMonster(monsterList[i]);
            }
        }

        bool renewal = DataManager.instance.CheckRenewal(round);

        if (renewal)
        {
            UnlockAcheive();
            DataManager.instance.SaveIntData(DataManager.SaveDataType.UploadScrore, round);
        }

        //if (DataManager.instance.CheckData(DataManager.SaveDataType.UploadScrore))
        //{
        //    GooglePlayManager.instance.UploadRanking(
        //        GPGSIds.leaderboard,
        //        DataManager.instance.GetIntData(DataManager.SaveDataType.UploadScrore),
        //        () => { DataManager.instance.DeleteKey(DataManager.SaveDataType.UploadScrore);});
        //}

        InGameUIManager.instance.panel_Result.ShowResult(round, renewal);
    }
Esempio n. 12
0
    void Update()
    {
        if (boss != null)
        {
            SetBossInfo();
        }
        else
        {
            GameObject monster = GameObject.FindGameObjectWithTag("Boss");

            if (monster != null)
            {
                boss = monster.GetComponent <BossMonster>();
            }
        }

        if (yellowbar.fillAmount >= curBarPer)
        {
            yellowbar.fillAmount -= Time.deltaTime;
        }
    }
 public Attack_SkillAttack(BaseCharacter target) : base(target)
 {
     m_targetCharacter = target as BossMonster;
 }
Esempio n. 14
0
 public BAttackState(BossMonster BossMonster)
 {
     bossMon = BossMonster;
 }
Esempio n. 15
0
 public BPatrolState(BossMonster bossMonster)
 {
     bossMon = bossMonster;
 }
Esempio n. 16
0
    void AddObstacle(Layer layer, float posX, int stageObjectId, ItemDropManager itemDropManager, FSM parentFsm, bool lastMonster)
    {
        FieldInstance instance = null;
        ObjectField objectField = TableLoader.GetTable<ObjectField>().Get(stageObjectId);
        ObjectStage objectStage = TableLoader.GetTable<ObjectStage>().Get(stageObjectId);

        if (objectStage.Type == E_StageObjectType.Monster)
        {
            ObjectMonster objectMonster = TableLoader.GetTable<ObjectMonster>().Get(objectStage.ObjectID);
            if (objectMonster.MonsterType == E_MonsterType.Boss)
            {
                BossAlertTrigger alertTrigger = new BossAlertTrigger(parentFsm);
                layer.AddSubject(alertTrigger, posX - Constants.Instance.Field.CameraWidth, 0);
                AddFieldInstance(alertTrigger);

                instance = new BossMonster(objectField, objectStage, itemDropManager, parentFsm);
            }
            else if (lastMonster)
            {
                instance = new LastMonster(objectField, objectStage, itemDropManager, parentFsm);
            }
            else
            {
                instance = new BattleObstacle(objectField, objectStage, itemDropManager, parentFsm);
            }
        }
        else if (objectStage.Type == E_StageObjectType.Chest)
        {
            instance = new Chest(objectField, objectStage, itemDropManager, parentFsm);
        }
        else if (objectStage.Type == E_StageObjectType.EndPoint)
        {
            instance = new StageEndDoor(objectField, objectStage, itemDropManager, parentFsm);
        }
        else if (objectStage.Type == E_StageObjectType.Trap)
        {
            instance = new Trap(objectField, objectStage, itemDropManager, parentFsm);
        }
        else if (objectStage.Type == E_StageObjectType.Etc)
        {
            instance = new StageObject(objectField, objectStage, itemDropManager, parentFsm);
        }
        else
        {
            Assert.Fail("not implemented");
        }

        layer.AddSubject(instance, posX, 0);
        AddFieldInstance(instance);
    }
Esempio n. 17
0
 public BChaseState(BossMonster bossMonster)
 {
     bossMon = bossMonster;
 }