Exemplo n.º 1
0
        public override void Activate()
        {
            RemoveAllSubGoals();


            if (hunter.foundTorches.Count > 0)
            {
                TorchObject torchObject = hunter.foundTorches.First();

                AddSubgoal(new IgniteTorch(hunter, torchObject));

                AddSubgoal(new WalkPath(hunter, torchObject.Pos));
                if (hunter.tinder < Hunter.TINDER_USAGE)
                {
                    AddSubgoal(new GetResources(hunter));
                }
            }
            else
            {
                if (AreAllExplorePointsVisited())
                {
                    AddSubgoal(new Wander(hunter));
                }
                else
                {
                    AddSubgoal(new Explore(hunter));
                }
            }

            status = Status.Active;
        }
Exemplo n.º 2
0
        public void CreateTorches()
        {
            List <string> keys     = graph.keys;
            int           maxIndex = keys.Count - 1;

            for (int i = 0; i < amountOfTorches; i++)
            {
                string      key      = keys[random.Next(0, maxIndex)];
                Vector2D    location = graph.vertexMap[key].position;
                TorchObject torch    = new TorchObject(location, this, new Vector2D());
                if (torches.Contains(torch))
                {
                    i--;
                    continue;
                }
                torches.Add(torch);
            }
        }
Exemplo n.º 3
0
        public void addTorch(Vector2D pos)
        {
            TorchObject torch = new TorchObject(pos, this, new Vector2D());

            entities.Add(torch);
        }
Exemplo n.º 4
0
 public IgniteTorch(Hunter hunter, TorchObject torch) : base(hunter)
 {
     random     = World.random;
     this.torch = torch;
 }