Exemplo n.º 1
0
    private void DiscoverQuest()
    {
        Quests.RemoveAll(quest => quest == null);
        InnController innController = inn.GetComponent <InnController>();

        if (Random.value * 20f < innController.questDiscovery && range.radius > 2f && Quests.Count < maxQuests) // factor in discoverd into this
        {
            Vector2    pos   = (Vector2)transform.position + Random.insideUnitCircle * range.radius;
            GameObject quest = Instantiate(questPrefab, pos, Quaternion.identity);
            quest.GetComponent <EnemyGroupQuest>().enemyLocation = gameObject;
            innController.Quests.Add(quest);
            Quests.Add(quest);
            innController.OnListChanged();
        }
    }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        InnController innController = inn.GetComponent <InnController>();

        if (range.radius < maxRadius)
        {
            range.radius += 0.1f * Time.deltaTime;
        }
        if (dicovered >= 100)
        {
            dicovered = 0;
            var EnemyLocationQuest = GetComponent <EnemyLocationQuest>();
            if (!EnemyLocationQuest)
            {
                EnemyLocationQuest = gameObject.AddComponent <EnemyLocationQuest>() as EnemyLocationQuest;
                EnemyLocationQuest.enemyLocation = gameObject;
                EnemyLocationQuest.enabled       = true;
                innController.Quests.Add(gameObject);
                range.radius = 0.1f;
            }
        }
    }