Add most of research
This commit is contained in:
24
GOAP/Assets/Scrips/Actions/GoToBed.cs
Normal file
24
GOAP/Assets/Scrips/Actions/GoToBed.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class GoToBed : AI_Action
|
||||
{
|
||||
public override bool PrePerform()
|
||||
{
|
||||
target = inventory.FindItemWithTag("Bed");
|
||||
if(target == null)
|
||||
return false;
|
||||
|
||||
AI_World.Instance.GetWorld().ModifyState("TreatingPatient", 1);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool PostPerform()
|
||||
{
|
||||
|
||||
AI_World.Instance.GetWorld().ModifyState("TreatingPatient", -1);
|
||||
AI_World.Instance.AddTreatmentBed(target);
|
||||
inventory.RemoveItem(target);
|
||||
// AI_World.Instance.GetWorld().ModifyState("FreeBeds", 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user