public void Metal(ResourceCapsule rc, int gatherRate) { rc.metalAmount = rc.metalAmount - gatherRate; metalAmount = metalAmount + gatherRate; UpdateDisplays(); rc.IsDepleted(); }
public void Stone(ResourceCapsule rc, int gatherRate) { rc.stoneAmount = rc.stoneAmount - gatherRate; stoneAmount = stoneAmount + gatherRate; UpdateDisplays(); rc.IsDepleted(); }
public void Wood(ResourceCapsule rc, int gatherRate) { rc.woodAmount = rc.woodAmount - gatherRate; woodAmount = woodAmount + gatherRate; //skillsController.AddGatheringExp (fruitGatherRate); UpdateDisplays(); rc.IsDepleted(); }
public void Meat(ResourceCapsule rc, int gatherRate) { rc.meatAmount = rc.meatAmount - gatherRate; meatAmount = meatAmount + gatherRate; //skillsController.AddHuntingExp (meatGatherRate); UpdateDisplays(); rc.IsDepleted(); }
public void Fruit(ResourceCapsule rc, int gatherRate) { rc.fruitAmount = rc.fruitAmount - fruitGatherRate; fruitAmount = fruitAmount + fruitGatherRate; //skillsController.AddGatheringExp (fruitGatherRate); UpdateDisplays(); rc.IsDepleted(); }
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"); } } }
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); } }