Exemplo n.º 1
0
        public IEnumerable <Act.Status> PutResources()
        {
            if (BuildRoom.MeetsBuildRequirements())
            {
                yield return(Act.Status.Success);
            }

            if (BuildRoom.ResourcesReservedFor == Agent)
            {
                Agent.Creature.Inventory.Remove(Resources, Inventory.RestockType.None);
                BuildRoom.AddResources(Resources);
                BuildRoom.ResourcesReservedFor = null;
            }
            yield return(Act.Status.Success);
        }
Exemplo n.º 2
0
 public override IEnumerable <Status> Run()
 {
     if (BuildRoom == null || BuildRoom.IsBuilt || BuildRoom.VoxelOrders.Count == 0)
     {
         yield return(Status.Fail);
     }
     else
     {
         BuildRoom.AddResources(Resources);
         Creature.Inventory.Remove(Resources);
         Creature.Stats.NumRoomsBuilt++;
         Creature.AI.AddXP(10);
         yield return(Status.Success);
     }
 }
Exemplo n.º 3
0
        public IEnumerable <Act.Status> PutResources()
        {
            if (BuildRoom.MeetsBuildRequirements())
            {
                yield return(Act.Status.Success);
            }

            if (BuildRoom.ResourcesReservedFor == Agent)
            {
                var resources = Agent.Blackboard.GetData <List <Resource> >("zone_resources");
                Agent.Creature.Inventory.Remove(resources, Inventory.RestockType.None);
                BuildRoom.AddResources(resources);
                BuildRoom.ResourcesReservedFor = null;
            }

            yield return(Act.Status.Success);
        }