// Use this for initialization
    void Start()
    {
        combatBoard = GameObject.Find ("CombatBoard").GetComponent<CombatBoard>();
        boardInfo = GameObject.Find("BoardManager").GetComponent<BoardMaker>();

        troopsPlaced = false;
    }
Example #2
0
        private CombatLocation loadCombatLocation(CombatBoard board, XmlNode locationNode, ObstacleSprite sprite)
        {
            CombatLocation location = null;

            try
            {
                int row = Convert.ToInt16(locationNode.Attributes["row"].Value);
                int col = Convert.ToInt16(locationNode.Attributes["col"].Value);
                location = new CombatLocation(board, row, col);
            }
            catch (Exception ex)
            {
            }

            return(location);
        }
        private CombatLocation loadCombatLocation(CombatBoard combatBoard, Player player, XmlNode locationNode)
        {
            CombatLocation location = null;

            try
            {
                int          row       = Convert.ToInt16(locationNode.Attributes["row"].Value);
                int          col       = Convert.ToInt16(locationNode.Attributes["col"].Value);
                AnimationKey direction = getDirectionFromString(locationNode.Attributes["facing"].Value);
                location = new CombatLocation(combatBoard, row, col, direction);
            }
            catch (Exception ex)
            {
            }

            return(location);
        }
Example #4
0
        public Obstacle createObstacleForCombat(CombatBoard board, XmlNode obstacleNode)
        {
            string referenceName = obstacleNode.Attributes["referenceName"].Value;

            Obstacle obstacle = createObstacleFromTemplate(referenceName);

            XmlNodeList children = obstacleNode.ChildNodes;

            foreach (XmlNode childNode in children)
            {
                if (childNode.Name.Equals("location"))
                {
                    obstacle.Location = loadCombatLocation(board, childNode, obstacle.MySprite);
                }
            }

            return(obstacle);
        }
        public Player createPlayerForCombat(CombatBoard combatBoard, XmlNode playerNode)
        {
            string referenceName = playerNode.Attributes["referenceName"].Value;
            string name          = playerNode.Attributes["name"].Value;

            progress.updateProgress("Creating player " + name + " for combat", "Loading", 0);

            Player player = createPlayerFromTemplate(referenceName);

            player.MyName  = name;
            player.IsAlive = true;

            PrimaryStatistics stats    = null;
            CombatLocation    location = null;

            XmlNodeList childNodes = playerNode.ChildNodes;

            foreach (XmlNode childNode in childNodes)
            {
                switch (childNode.Name)
                {
                case "stats":
                    progress.updateProgress("Loading " + name + " stats", "Loading", 0);
                    stats = loadStats(childNode);
                    break;

                case "location":
                    progress.updateProgress("Loading " + name + " location", "Loading", 0);
                    location = loadCombatLocation(combatBoard, player, childNode);
                    break;
                }
            }

            player.Location = location;
            return(player);
        }
Example #6
0
 public virtual void executeAbility(CombatBoard board, CombatCharacter currentFighter, SquareIcon targetSquare)
 {
 }
 // Use this for initialization
 void Start()
 {
     isSelected = false;
     highlit = false;
     boardInfo = GameObject.Find ("CombatBoard").GetComponent<CombatBoard>();
 }