public override void Interact()
 {
     Debug.Log("doing thing");
     base.Interact();
     if (woodCount == 8)
     {
         YahwehController.YouDidIt();
     }
     else
     {
         ClaimWood();
     }
 }
    private void ClaimWood()
    {
        var           gm         = GameManager.instance;
        var           player     = gm.player;
        List <Animal> toBeKilled = new List <Animal>();

        Debug.Log("looking for children");

        for (var i = 0; i < player.followTrail.Count; i++)
        {
            var test = player.followTrail[i];

            Debug.Log($"looking at {test.gameObject.name}");

            if (test.animalType == AnimalType.WOOD)
            {
                Debug.Log("found child");

                woodCount++;
                toBeKilled.Add(test);
            }
        }

        foreach (var vermin in toBeKilled)
        {
            player.followTrail.Remove(vermin);
            player.MakeChain();

            Destroy(vermin.gameObject);
        }

        if (toBeKilled.Count == 0 && woodCount < 8)
        {
            TextMaster.ShowText(new Message(false, "You do not have enough wood to fix the Ark.", ""));
        }

        if (woodCount == 8)
        {
            YahwehController.YouDidIt();
        }
    }
Beispiel #3
0
    public void TakeNewPartner(Animal newPartner)
    {
        // don't do anything if i'm with my love
        if (amMatched)
        {
            Debug.Log("no way, jose");
        }
        else
        {
            var isMatch = CheckForMatch(newPartner);

            if (isMatch)
            {
                Debug.Log("my love, how i missed you");
                amMatched = true;

                // take the match
                BeMine(newPartner);
                newPartner.amMatched = true;

                // give the player my partner
                if (myPartner != null)
                {
                    myPartner.GetCarried();
                }

                CreateChild();
                GameManager.instance.player.MakeChain();
            }
            else
            {
                // Deny the match
                Debug.Log("nah");

                YahwehController.ScoldNoah(this, newPartner);
            }
        }
    }