Beispiel #1
0
 private void Awake()
 {
     animator     = GetComponent <Animator>();
     treeCollider = GetComponent <Collider2D>();
     lumberCount  = FindObjectOfType <Lumber>();
     sprite       = GetComponent <SpriteRenderer>();
     forestHealth = FindObjectOfType <ForestHealth>();
     GameManager.instance.numTreesInPlay++;
     InitializeTree();
     UpdateTreeStats();
     PickAnimationStartFrame();
 }
Beispiel #2
0
 private void Awake()
 {
     bidText             = GetComponentInChildren <TMP_Text>();
     TalkingHeadAnimator = GetComponentInChildren <Animator>();
     rectTransform       = GetComponent <RectTransform>();
     bidManager          = GameObject.FindObjectOfType <BidManager>();
     screenHeight        = FindObjectOfType <Canvas>().pixelRect.height;
     screenWidth         = FindObjectOfType <Canvas>().pixelRect.width;
     money  = FindObjectOfType <Money>();
     lumber = FindObjectOfType <Lumber>();
     demand = FindObjectOfType <Demand>();
     stats  = FindObjectOfType <StatsManager>();
 }
Beispiel #3
0
        public SecondQuest()
        {
            Title     = "Meet and Greet!";
            Objective = "Collect lumber in the forest. Once collected, return to the blacksmith.\n" +
                        "Forest is displayed with a 'F' on the map.";
            CollectObjective = new Lumber();
            RewardXP         = 75;

            Dialogues.Add("Quest: " + Title + "\n");
            Dialogues.Add("Greetings.");
            Dialogues.Add("You are " + Environment.player.Name + ", huh?");
            Dialogues.Add("Im sure you have no idea what is going on.");
            Dialogues.Add("Here you have an axe - you will need it to chop down some trees in the Forest.");
            Dialogues.Add("I will create a pair of spike-shoes for you with the lumber you gather.");
            Dialogues.Add("Now get going!");
        }
Beispiel #4
0
    public override void Init()
    {
        plantLumberTask = Task.Run()
                          .Time(7f)
                          .Random(2.5f)
                          .Loop(-1)
                          .OnRepeat(_ =>
        {
            Pos[] neighbours = Controller.Instance.grid.GetNeighbours(tile.pos);

            Pos randomNeighbour = neighbours[Random.Range(0, neighbours.Length)];

            Lumber l = new Lumber();
            l.level  = level;

            Builder.Build(l, randomNeighbour.x, randomNeighbour.y);
        });
    }