예제 #1
0
    public void Metal(ResourceCapsule rc, int gatherRate)
    {
        rc.metalAmount = rc.metalAmount - gatherRate;
        metalAmount    = metalAmount + gatherRate;
        UpdateDisplays();

        rc.IsDepleted();
    }
예제 #2
0
    public void Stone(ResourceCapsule rc, int gatherRate)
    {
        rc.stoneAmount = rc.stoneAmount - gatherRate;
        stoneAmount    = stoneAmount + gatherRate;
        UpdateDisplays();

        rc.IsDepleted();
    }
예제 #3
0
 public void Wood(ResourceCapsule rc, int gatherRate)
 {
     rc.woodAmount = rc.woodAmount - gatherRate;
     woodAmount    = woodAmount + gatherRate;
     //skillsController.AddGatheringExp (fruitGatherRate);
     UpdateDisplays();
     rc.IsDepleted();
 }
예제 #4
0
 public void Meat(ResourceCapsule rc, int gatherRate)
 {
     rc.meatAmount = rc.meatAmount - gatherRate;
     meatAmount    = meatAmount + gatherRate;
     //skillsController.AddHuntingExp (meatGatherRate);
     UpdateDisplays();
     rc.IsDepleted();
 }
예제 #5
0
 public void Fruit(ResourceCapsule rc, int gatherRate)
 {
     rc.fruitAmount = rc.fruitAmount - fruitGatherRate;
     fruitAmount    = fruitAmount + fruitGatherRate;
     //skillsController.AddGatheringExp (fruitGatherRate);
     UpdateDisplays();
     rc.IsDepleted();
 }
예제 #6
0
    public void Gather(GameObject model, RaycastHit hit, SkillsController skillsController)
    {
        model.GetComponent <Animator> ().SetTrigger("punching");
        ResourceCapsule rc = hit.transform.gameObject.GetComponent <ResourceCapsule> ();

        if (rc)
        {
            Debug.Log("Attempting Harvest");
            SkillTree playerSkillTree = skillsController.skilltrees.Where(x => x.skillTreeName == rc.requiredAbility.parentSkillTree.skillTreeName && x.abilities.Contains(rc.requiredAbility)).Single();
            Ability   playerAbility   = playerSkillTree.abilities.Where(x => x.abilityName == rc.requiredAbility.abilityName).Single();

            if (playerAbility.unlocked)
            {
                Debug.Log("Has sufficient skiiiiil");
                GatherFromCapsule(hit.transform.gameObject.GetComponent <ResourceCapsule> (), playerAbility.rate);
            }
            else
            {
                Debug.Log("Cant harvest from this yet... Dummy");
            }
        }
    }
예제 #7
0
 public void GatherFromCapsule(ResourceCapsule resourceCapsule, int gatherRate)
 {
     if (resourceCapsule.fruitAmount > 0)
     {
         Fruit(resourceCapsule, gatherRate);
     }
     else if (resourceCapsule.meatAmount > 0)
     {
         Meat(resourceCapsule, gatherRate);
     }
     else if (resourceCapsule.woodAmount > 0)
     {
         Wood(resourceCapsule, gatherRate);
     }
     else if (resourceCapsule.stoneAmount > 0)
     {
         Stone(resourceCapsule, gatherRate);
     }
     else if (resourceCapsule.metalAmount > 0)
     {
         Metal(resourceCapsule, gatherRate);
     }
 }