Exemplo n.º 1
0
    public void Init()
    {
        for (int i = 0; i < DB.Instance.GetCount("Map"); i++)
        {
            string[] monsters;

            Data.MapData mapData = DB.Instance.GetMapData("Map" + i);
            monsters = mapData._sqawnedMonsters.Split('|');
            _monsterSqawnTable.Add(mapData._mapName, monsters);
        }
    }
Exemplo n.º 2
0
    private void MapDBRegist()
    {
        //LowText mapsData = GameMng.Table.Get(TableType.Map);
        LowText mapsData = TableMng.Instance.Get(TableType.Map);

        for (int i = 0; i < mapsData.GetCount(); i++)
        {
            Data.MapData mapData = new Data.MapData(mapsData, i);
            _mapInfos.Add(mapData._mapName, mapData);
            _datas.Add(mapData._mapName, mapData);
        }
    }
Exemplo n.º 3
0
        public WeaponData(MapData map, string id)
        {
            ID = id;
            DisplayEffectID = null;
            EffectID        = null;
            Range           = 5;
            Period          = 0.8332;
            Required        = (TargetFilter)0;
            Excluded        = (TargetFilter)0;

            if (map.ProcessedDataFiles.ContainsKey("WeaponData"))
            {
                foreach (DataFile dataFile in map.ProcessedDataFiles["WeaponData"])
                {
                    foreach (XElement element in dataFile.Data)
                    {
                        if (element.HasAttributes && element.Attribute("id") != null && element.Attribute("id").Value == id)                         //found
                        {
                            if (element.Element("Range") != null)
                            {
                                Range = float.Parse(element.Element("Range").Attribute("value").Value);
                            }
                            if (element.Element("DisplayEffect") != null)
                            {
                                EffectID = element.Element("DisplayEffect").Attribute("value").Value;
                            }
                            if (element.Element("Effect") != null)
                            {
                                EffectID = element.Element("Effect").Attribute("value").Value;
                            }
                            if (element.Element("TargetFilters") != null)
                            {
                                string[] tf  = element.Element("TargetFilters").Attribute("value").Value.Split(';');
                                string[] req = tf[0].Split(',');
                                foreach (string s in req)
                                {
                                    TargetFilter temp;
                                    if (Enum.TryParse <TargetFilter>(s, out temp))
                                    {
                                        Required |= temp;
                                    }
                                }
                                if (tf.Length > 1)
                                {
                                    string[] ex = tf[1].Split(',');
                                    foreach (string s in ex)
                                    {
                                        TargetFilter temp;
                                        if (Enum.TryParse <TargetFilter>(s, out temp))
                                        {
                                            Excluded |= temp;
                                        }
                                    }
                                }
                            }
                            break;
                        }
                    }
                }
            }
        }