Exemplo n.º 1
0
 public override void load()
 {
     Loader.loadSettings("settings");
     Game.getInstance().m_camera.load();
     ClassesData.load();
     RacesData.load();
     ElementsData.load();
     AbilitiesData.load();
     XMLParser.setAbilities();
     m_gameGui.load();
     createTileMap(20, 20);
 }
Exemplo n.º 2
0
        public static void setAbilities()
        {
            XmlDocument l_xmlDocument = new XmlDocument();

            l_xmlDocument.Load("XML Data/ClassesData.xml");
            foreach (ChampionClass l_class in ClassesData.availableClasses())
            {
                XmlNodeList l_abilityList = l_xmlDocument.SelectNodes("/ClassesData/Abilities/" + l_class.getName());
                string      l_trimmedAbility;
                for (int i = 0; i < l_abilityList.Count; i++)
                {
                    l_trimmedAbility = l_abilityList[i].InnerText.Trim();
                    if (l_trimmedAbility.Equals(""))
                    {
                        continue;
                    }
                    l_class.addAbility(AbilitiesData.getAbility(l_trimmedAbility));
                }
            }

            l_xmlDocument.Load("XML Data/RacesData.xml");
            foreach (ChampionRace l_race in RacesData.availableRaces())
            {
                XmlNodeList l_abilityList = l_xmlDocument.SelectNodes("/RacesData/Abilities/" + l_race.getName());
                string      l_trimmedAbility;
                for (int i = 0; i < l_abilityList.Count; i++)
                {
                    l_trimmedAbility = l_abilityList[i].InnerText.Trim();
                    if (l_trimmedAbility.Equals(""))
                    {
                        continue;
                    }
                    l_race.addAbility(AbilitiesData.getAbility(l_trimmedAbility));
                }
            }
        }
Exemplo n.º 3
0
        public Champion(Vector2 a_position, string a_name, string a_class, bool a_male, string a_race)
            : base(((GameState)Game.getInstance().getCurrentState()).getTileMap().getTile(a_position).p_position + new Vector2(64, -64))
        {
            m_name       = a_name;
            m_layer      = 0.300f;
            m_male       = a_male;
            m_faceNumber = 1;
            m_race       = RacesData.getRace(a_race);
            m_class      = ClassesData.getClass(a_class);

            m_stats = m_class.getBaseStats();
            foreach (KeyValuePair <string, int> l_kvPair in RacesData.getStats(m_race))
            {
                m_stats[l_kvPair.Key] += l_kvPair.Value;
            }
            m_stats.Add("CurrentHealth", m_stats["MaxHealth"]);
            m_stats.Add("CurrentMana", m_stats["MaxMana"]);
            m_stats.Add("Level", 1);
            m_stats.Add("MoveLeft", m_stats["Move"]);
            p_speed = m_stats["Speed"];

            m_currentPosition = ((GameState)Game.getInstance().getCurrentState()).getTileMap().getTile(a_position);
            m_bodySprites     = new Dictionary <KeyValuePair <HeroState, FacingState>, Sprite>();
        }