Ejemplo n.º 1
0
        private void LoadActions()
        {
            XmlDocument actionDoc = new XmlDocument();
            actionDoc.Load("Xml/Action.xml");

            XmlNode actionNode;
            actionNode = actionDoc.FirstChild.NextSibling;
            int actionCount = actionNode.ChildNodes.Count;
            actionNode = actionNode.FirstChild;

            for (int i = 0; i < actionCount; i++)
            {
                lua.DoFile(actionNode.Attributes[0].Value);

                double aggro = Convert.ToDouble(lua["aggression"]);
                double def = Convert.ToDouble(lua["defense"]);
                int targets = Convert.ToInt16(lua["targets"]);
                int AoE=Convert.ToInt16(lua["area"]);

                AIAction action=new AIAction(aggro, def, targets, AoE, actionNode.Attributes[0].Value);
                combatSystem.AddAction(actionNode.Attributes[1].Value, action , Convert.ToInt16(lua["energyCost"]), Convert.ToInt16(lua["staminaCost"]), Convert.ToInt16(lua["lifeCost"]));
                actionNode = actionNode.NextSibling;
            }
        }
Ejemplo n.º 2
0
 public void AddAction(string key, AIAction action, int eCost, int sCost, int lCost)
 {
     action.SetCost(eCost, sCost, lCost);
     actionSystem.AddAction(key, action);
 }