Add most of research

This commit is contained in:
Bram verhulst
2025-05-31 15:54:23 +02:00
commit 70f128f092
270 changed files with 80847 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
using UnityEngine;
public class Charge : AI_Action
{
public GameObject m_Resource;
public override bool PrePerform()
{
m_Resource = AI_World.Instance.RemoveCharger();
if (m_Resource == null)
{
return false; // No charger available
}
inventory.AddItem(m_Resource);
target = m_Resource;
return true;
}
public override bool PostPerform()
{
agentWorldStates.RemoveState("Depleted");
AI_World.Instance.AddCharger(m_Resource);
m_Resource = null; // Clear the resource after use
return true;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d65acb659c17edb43b07f1984ce199a1

View File

@@ -0,0 +1,14 @@
using UnityEngine;
public class CheckIn : AI_Action
{
public override bool PrePerform()
{
return true;
}
public override bool PostPerform()
{
return true;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: da447a39bb3a3c144a8a1245dac6953d

View File

@@ -0,0 +1,36 @@
using UnityEngine;
public class GetPatient : AI_Action
{
GameObject m_Resource;
public override bool PrePerform()
{
target = AI_World.Instance.RemovePatient();
if(target == null)
{
return false;
}
m_Resource = AI_World.Instance.RemoveTreatmentBed();
if (m_Resource != null)
{
inventory.AddItem(m_Resource);
} else {
AI_World.Instance.AddPatient(target);
target = null;
return false;
}
return true;
}
public override bool PostPerform()
{
AI_World.Instance.GetWorld().ModifyState("Waiting", -1);
if (target)
{
target.GetComponent<AI_Agent>().inventory.AddItem(m_Resource);
}
return true;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 1a3594ff153540945b38f6c6e7969913

View File

@@ -0,0 +1,23 @@
using Unity.VisualScripting;
using UnityEngine;
public class GetTreated : AI_Action
{
public override bool PrePerform()
{
target = inventory.FindItemWithTag("Bed");
if(target == null)
return false;
return true;
}
public override bool PostPerform()
{
AI_World.Instance.GetWorld().ModifyState("Treated", 1);
agentWorldStates.ModifyState("IsCured", 1);
inventory.RemoveItem(target);
return true;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: b134cecb1ecf86140a6bef65725746b3

View File

@@ -0,0 +1,17 @@
using Unity.VisualScripting;
using UnityEngine;
public class GoHome : AI_Action
{
public override bool PrePerform()
{
return true;
}
public override bool PostPerform()
{
AI_World.Instance.GetWorld().ModifyState("Home", 1);
Destroy(this.gameObject);
return true;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: ee0072bcc9d306949b2510eb33147033

View 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;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 9744404dabc38e24390e5f04a158b73d

View File

@@ -0,0 +1,14 @@
using UnityEngine;
public class GoToHospital : AI_Action
{
public override bool PrePerform()
{
return true;
}
public override bool PostPerform()
{
return true;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: df82dab2aef220d4eaf8d1953b5668d3

View File

@@ -0,0 +1,17 @@
using UnityEngine;
public class GoToWaitingRoom : AI_Action
{
public override bool PrePerform()
{
return true;
}
public override bool PostPerform()
{
AI_World.Instance.GetWorld().ModifyState("Waiting", 1);
AI_World.Instance.AddPatient(this.gameObject);
agentWorldStates.ModifyState("InWaitingRoom", 1);
return true;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e80a344ad86244145a0a6408b77f4a9d