Bait usage
This commit is contained in:
parent
c06d161006
commit
f25892b1e8
1 changed files with 11 additions and 0 deletions
|
|
@ -33,6 +33,8 @@ public class FishingController : MonoBehaviour {
|
|||
private bool _catchable;
|
||||
private bool _caught;
|
||||
private Vector2 _ampsXY;
|
||||
private Inventory _iv;
|
||||
private ItemContainer _ic;
|
||||
|
||||
public bool Fishing => _fishing;
|
||||
|
||||
|
|
@ -78,6 +80,10 @@ public class FishingController : MonoBehaviour {
|
|||
}
|
||||
|
||||
public void StartFishing() {
|
||||
if (!_iv.items.ContainsKey(_ic.GetItemByName("Bait"))) {
|
||||
Debug.Log("No bait!");
|
||||
return;
|
||||
}
|
||||
Vector3 pos = Input.mousePosition;
|
||||
|
||||
if (Camera.main != null) {
|
||||
|
|
@ -93,6 +99,11 @@ public class FishingController : MonoBehaviour {
|
|||
_exMark.transform.position = new Vector3(newPosX, newPosY);
|
||||
}
|
||||
_fishing = true;
|
||||
|
||||
if (Random.Range(0, 10) > 5) { //uses bait to certain chance
|
||||
_iv.RemoveItem(_ic.GetItemByName("Bait"), 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void TryCatch() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue