Пример #1
0
        private void PathFollow(List <GridNode> path)
        {
            //if (tarNode != path [0]) {
            SeekToGrid(tarNode);
            if (self.currentNode == tarNode)
            {
                //tarNode = path [path.IndexOf (tarNode) - 1];
                ResetPathColor();
                FindPath();
            }
            if (self.currentNode == goalNode)
            {
                targetFlag.FlagCapture(self);
                ResetPathColor();
                if (self._Team == OrientedActor.Team.cyan)
                {
                    self.PrintMessage("Status: Captured the Flag");
                    self.PrintMessage("Intent: Returning");
                }
                self.currentJob.CurrentState = flagger.returnState;
                flagger.returnState.Enter();
            }
            //}
            //if (tarNode == path [0]) {
            //	ArriveAtGrid (path [0]);
            //	if (DisToGrid (tarNode) < 0.5f) {

            //	}
            //}
        }
Пример #2
0
 public CapturedState(OrientedActor actor, OrientedActor cap)
 {
     self          = actor;
     self.captured = true;
     CtF           = self.CtF;
     capturer      = cap;
     if (cap != null)
     {
         if (self._Team == OrientedActor.Team.cyan)
         {
             if (cap._Team != self._Team)
             {
                 self.PrintMessage("Status: I am Captured!");
             }
             else
             {
                 self.PrintMessage("Status: I am being Rescued!");
             }
         }
         self.jailed = false;
     }
     else
     {
         if (self._Team == OrientedActor.Team.cyan)
         {
             self.PrintMessage("Status: I am in Jail");
         }
         self.jailed = true;
         self.CallforHelp();
     }
 }
Пример #3
0
 public void Enter()
 {
     if (self._Team == OrientedActor.Team.cyan)
     {
         self.PrintMessage("Status: Enemy Spotted!");
         self.PrintMessage("Intent: Arrest the enemy");
     }
     FindPath();
 }
Пример #4
0
 public void Enter()
 {
     //Debug.Log ("patrolling");
     if (self._Team == OrientedActor.Team.cyan)
     {
         self.PrintMessage("Intent: Guard the Treasure");
     }
     FindPath();
 }
Пример #5
0
 private void PathFollow(List <GridNode> path)
 {
     SeekToGrid(tarNode);
     if (self.currentNode == tarNode)
     {
         ResetPathColor();
         FindPath();
     }
     if (self.currentNode == goalNode)
     {
         ResetPathColor();
         if (self._Team == OrientedActor.Team.cyan)
         {
             self.PrintMessage("Status: Reached Jail");
             self.PrintMessage("Intent: Returning with Teammate");
         }
         teamMate.currentJob.Captured(self);
         self.currentJob.CurrentState = new ConvoyState(self, teamMate);
         self.currentJob.CurrentState.Enter();
     }
 }
Пример #6
0
 private void PathFollow(List <GridNode> path)
 {
     SeekToGrid(tarNode);
     if (self.currentNode == tarNode)
     {
         ResetPathColor();
         FindPath();
     }
     if (self.currentNode == goalNode)
     {
         if (self._Team == OrientedActor.Team.cyan)
         {
             self.PrintMessage("Status: Teammate Rescued!");
         }
         self.SetJob(1);
         teamMate.captured = false;
         teamMate.SetJob(2);
     }
 }
Пример #7
0
        private void PathFollow(List <GridNode> path)
        {
            //if (tarNode != path [0]) {
            SeekToGrid(tarNode);
            if (self.currentNode == tarNode)
            {
                //tarNode = path [path.IndexOf (tarNode) - 1];
                ResetPathColor();
                FindPath();
            }
            if (self.currentNode == goalNode)
            {
                if (self._Team == OrientedActor.Team.cyan)
                {
                    self.PrintMessage("Status: We won!!!");
                }
                else
                {
                    self.enemies[0].PrintMessage("Status: We Lost!!!");
                }

                self.currentJob.ToHappy();
                foreach (OrientedActor player in self.teammates)
                {
                    player.currentJob.ToHappy();
                }
                foreach (OrientedActor player in self.enemies)
                {
                    player.currentJob.ToSad();
                }
            }

            //}
            //if (tarNode == path [0]) {
            //	ArriveAtGrid (path [0]);
            //	if (DisToGrid (tarNode) < 0.5f) {

            //	}
            //}
        }