Ejemplo n.º 1
0
        public static void Load()
        {
            sheet = Datasheet.Load <MissileInfo>("data/global/excel/Missiles.txt");
            map   = new Dictionary <string, MissileInfo>();
            idMap = new Dictionary <int, MissileInfo>();
            foreach (var row in sheet)
            {
                if (row.id == -1)
                {
                    continue;
                }

                row.spritesheetFilename = @"data\global\missiles\" + row.celFile;
                row.material            = row.trans == 0 ? Materials.normal : Materials.softAdditive;
                row.lifeTime            = row.range / 25.0f;
                row.explosionMissile    = Find(row.explosionMissileId);
                row.fps         = row.animSpeed;
                row.travelSound = SoundInfo.Find(row.travelSoundId);
                row.hitSound    = SoundInfo.Find(row.hitSoundId);
                row.progSound   = SoundInfo.Find(row.progSoundId);
                row.progOverlay = OverlayInfo.Find(row.progOverlayId);
                row.collideType = (CollideType)row._collideType;
                map.Add(row.missile, row);
                idMap.Add(row.id, row);
            }
        }
Ejemplo n.º 2
0
        public static void Load()
        {
            sheet = Datasheet.Load <SkillInfo>("data/global/excel/Skills.txt");
            map   = new Dictionary <string, SkillInfo>();
            idMap = new Dictionary <int, SkillInfo>();
            foreach (var row in sheet)
            {
                if (row.id == -1)
                {
                    continue;
                }

                if (row.charClass != null)
                {
                    row._iconSpritesheetFilename = @"data\global\ui\spells\" + row.charClass.Substring(0, 2) + "Skillicon";
                }
                else
                {
                    row._iconSpritesheetFilename = @"data\global\ui\spells\Skillicon";
                }
                row.castOverlay  = OverlayInfo.Find(row.castOverlayId);
                row.startSound   = SoundInfo.Find(row._stsound);
                row._description = SkillDescription.Find(row.skillDescId);
                if (row._description != null)
                {
                    row.name             = Translation.Find(row._description.strName);
                    row.shortDescription = Translation.Find(row._description.strShort);
                    row.longDescription  = Translation.Find(row._description.strLong);
                    row.shortName        = Translation.Find(row._description.strAlt);
                }
                else
                {
                    row.name = row.skill;
                }
                if (row._range == "none")
                {
                    row.range = Range.NoRestrictions;
                }
                else if (row._range == "h2h")
                {
                    row.range = Range.Melee;
                }
                else if (row._range == "rng")
                {
                    row.range = Range.Ranged;
                }
                else if (row._range == "both")
                {
                    row.range = Range.Both;
                }
                else
                {
                    throw new System.Exception("Unknown skill range " + row._range);
                }
                map.Add(row.skill, row);
                idMap.Add(row.id, row);
            }

            Attack = Find("Attack");
        }
Ejemplo n.º 3
0
        public static void Load()
        {
            sheet          = Datasheet.Load <Translation>("data/local/string.txt", headerLines: 0);
            expansionSheet = Datasheet.Load <Translation>("data/local/expansionstring.txt", headerLines: 0);
            patchSheet     = Datasheet.Load <Translation>("data/local/patchstring.txt", headerLines: 0);
            foreach (var translation in patchSheet)
            {
                if (!map.ContainsKey(translation.key))
                {
                    map.Add(translation.key, translation.value);
                }
            }

            foreach (var translation in expansionSheet)
            {
                if (!map.ContainsKey(translation.key))
                {
                    map.Add(translation.key, translation.value);
                }
            }

            foreach (var translation in sheet)
            {
                if (!map.ContainsKey(translation.key))
                {
                    map.Add(translation.key, translation.value);
                }
            }
        }
Ejemplo n.º 4
0
 public static void Load()
 {
     sheet = Datasheet.Load <LevelInfo>("data/global/excel/Levels.txt");
     foreach (var levelInfo in sheet)
     {
         if (levelInfo.id == 0)
         {
             continue;
         }
         levelInfo.type      = LevelType.sheet[levelInfo.levelTypeIndex];
         levelInfo.preset    = LevelPreset.Find(levelInfo.id);
         levelInfo.entryFile = @"data\local\ui\eng\act" + (levelInfo.act + 1) + @"\" + levelInfo._entryFile + ".dc6";
         foreach (string mon in levelInfo._monsters)
         {
             if (mon != null && mon != "")
             {
                 levelInfo.monsters.Add(mon);
             }
         }
         levelInfo.soundEnv = SoundEnvironment.Find(levelInfo.soundEnvId);
         levelInfo.maze     = LevelMazeInfo.Find(levelInfo.id);
         nameIndex.Add(levelInfo.name, levelInfo);
         idMap.Add(levelInfo.id, levelInfo);
         while (byAct.Count <= levelInfo.act)
         {
             byAct.Add(new List <LevelInfo>());
         }
         byAct[levelInfo.act].Add(levelInfo);
     }
 }
Ejemplo n.º 5
0
 public static void Load()
 {
     sheet    = Datasheet.Load <MonStat>("data/global/excel/MonStats.txt");
     monStats = new Dictionary <string, MonStat>();
     foreach (MonStat stat in sheet)
     {
         var key = stat.id.ToLower();
         if (monStats.ContainsKey(key))
         {
             monStats.Remove(key);
         }
         monStats.Add(key, stat);
         stat.ext         = MonStatsExtended.Find(stat.monStatEx);
         stat.name        = stat.nameStr == null ? null : Translation.Find(stat.nameStr);
         stat.minion1     = stat.minion1Id == null ? null : Find(stat.minion1Id);
         stat.minion2     = stat.minion2Id == null ? null : Find(stat.minion2Id);
         stat.sound       = MonSound.Find(stat.monSoundId);
         stat.uniqueSound = MonSound.Find(stat.uMonSoundId);
         for (int i = 0; i < stat.treasureClass.Length; ++i)
         {
             stat.treasureClass[i].normal   = TreasureClass.Find(stat.treasureClass[i]._normal);
             stat.treasureClass[i].champion = TreasureClass.Find(stat.treasureClass[i]._champion);
             stat.treasureClass[i].unique   = TreasureClass.Find(stat.treasureClass[i]._unique);
             stat.treasureClass[i].quest    = TreasureClass.Find(stat.treasureClass[i]._quest);
         }
     }
 }
Ejemplo n.º 6
0
        public static void Load()
        {
            sheet = Datasheet.Load <ItemType>("data/global/excel/ItemTypes.txt");
            foreach (ItemType type in sheet)
            {
                if (type.code == null)
                {
                    continue;
                }
                if (byCode.ContainsKey(type.code))
                {
                    continue;
                }
                if (type.body)
                {
                    type.bodyLoc1 = BodyLoc.GetIndex(type.bodyLoc1Code);
                    type.bodyLoc2 = BodyLoc.GetIndex(type.bodyLoc2Code);
                }
                byCode.Add(type.code, type);
            }

            foreach (ItemType type in sheet)
            {
                if (type._equiv1 != null)
                {
                    type.equiv1 = Find(type._equiv1);
                }
                if (type._equiv2 != null)
                {
                    type.equiv2 = Find(type._equiv2);
                }
            }
        }
Ejemplo n.º 7
0
        public static void Load()
        {
            sheet   = Datasheet.Load <ObjectInfo>("data/global/excel/objects.txt");
            byToken = new Dictionary <string, ObjectInfo>();
            foreach (var info in sheet)
            {
                for (int i = 0; i < 8; ++i)
                {
                    info.frameDuration[i] = 256.0f / 25 / info.frameDelta[i];
                }

                info.name = Translation.Find(info.nameStr);

                if (info.token == null)
                {
                    continue;
                }

                if (byToken.ContainsKey(info.token))
                {
                    byToken.Remove(info.token);
                }
                byToken.Add(info.token, info);
            }
        }
Ejemplo n.º 8
0
        public static void Load()
        {
            sheet = Datasheet.Load <MonSound>("data/global/excel/MonSounds.txt");
            map   = new Dictionary <string, MonSound>();
            foreach (var sound in sheet)
            {
                if (sound.id == null)
                {
                    continue;
                }

                sound.death         = SoundInfo.Find(sound._deathSound);
                sound.hit           = SoundInfo.Find(sound._hitSound);
                sound.attack1       = SoundInfo.Find(sound._attack1);
                sound.attack2       = SoundInfo.Find(sound._attack2);
                sound.weapon1       = SoundInfo.Find(sound._weapon1);
                sound.weapon2       = SoundInfo.Find(sound._weapon2);
                sound.taunt         = SoundInfo.Find(sound._taunt);
                sound.init          = SoundInfo.Find(sound._init);
                sound.neutral       = SoundInfo.Find(sound._neutral);
                sound.footstep      = SoundInfo.Find(sound._footstep);
                sound.footstepLayer = SoundInfo.Find(sound._footstepLayer);
                sound.attack1Delay  = sound._attack1Delay / 25f;
                sound.attack2Delay  = sound._attack2Delay / 25f;
                sound.weapon1Delay  = sound._weapon1Delay / 25f;
                sound.weapon2Delay  = sound._weapon2Delay / 25f;
                sound.weapon1Volume = sound._weapon1Volume / 255f;
                sound.weapon2Volume = sound._weapon2Volume / 255f;
                sound.hitDelay      = sound._hitDelay / 25f;
                sound.deathDelay    = sound._deathDelay / 25f;
                sound.neutralDelay  = sound._neuTime / 25f;
                map.Add(sound.id, sound);
            }
        }
Ejemplo n.º 9
0
 public static void Load()
 {
     sheet = Datasheet.Load<ItemSet>("data/global/excel/Sets.txt");
     foreach(var set in sheet)
     {
         set.name = Translation.Find(set.nameStr);
     }
 }
Ejemplo n.º 10
0
 public static void Load()
 {
     sheet = Datasheet.Load <LevelWarpInfo>("data/global/excel/LvlWarp.txt");
     foreach (var warpInfo in sheet)
     {
         idMap[warpInfo.id] = warpInfo;
     }
 }
Ejemplo n.º 11
0
 public static void Load()
 {
     sheet = Datasheet.Load <SkillDescription>("data/global/excel/SkillDesc.txt");
     map   = new Dictionary <string, SkillDescription>();
     foreach (var row in sheet)
     {
         map.Add(row.id, row);
     }
 }
Ejemplo n.º 12
0
 public static void Load()
 {
     sheet = Datasheet.Load <MonLvl>("data/global/excel/MonLvl.txt");
     map   = new Dictionary <int, MonLvl>();
     foreach (var monLvl in sheet)
     {
         map.Add(monLvl.level, monLvl);
     }
 }
Ejemplo n.º 13
0
 public static void Load()
 {
     sheet  = Datasheet.Load <StateInfo>("data/global/excel/States.txt");
     byCode = new Dictionary <string, StateInfo>();
     foreach (var row in sheet)
     {
         byCode.Add(row.code, row);
     }
 }
Ejemplo n.º 14
0
 public static void Load()
 {
     sheet  = Datasheet.Load <SpawnPreset>("/obj.txt");
     lookup = new Dictionary <long, SpawnPreset>();
     foreach (SpawnPreset obj in sheet)
     {
         lookup.Add(Key(obj.act - 1, obj.type, obj.id), obj);
     }
 }
Ejemplo n.º 15
0
 public static void Load()
 {
     sheet  = Datasheet.Load <SpawnPreset>("/obj.txt");
     lookup = new Dictionary <long, SpawnPreset>();
     foreach (SpawnPreset obj in sheet)
     {
         obj.mode = StaticObjectMode.GetByToken(obj.modeToken, StaticObjectMode.Neutral);
         lookup.Add(Key(obj.act - 1, obj.type, obj.id), obj);
     }
 }
Ejemplo n.º 16
0
 public static void Load()
 {
     sheet = Datasheet.Load <UniqueItem>("data/global/excel/UniqueItems.txt");
     foreach (var unique in sheet)
     {
         unique.name           = Translation.Find(unique.nameStr);
         unique.dropSound      = SoundInfo.Find(unique._dropSound);
         unique.dropSoundFrame = unique._dropSoundFrame;
         unique.useSound       = SoundInfo.Find(unique._useSound);
     }
 }
Ejemplo n.º 17
0
 public static void Load()
 {
     sheet = Datasheet.Load <SuperUnique>("data/global/excel/SuperUniques.txt");
     map   = new Dictionary <string, SuperUnique>();
     foreach (var row in sheet)
     {
         row.monStat = MonStat.Find(row.monStatId);
         row.name    = Translation.Find(row.nameStr);
         map.Add(row.superUnique, row);
     }
 }
Ejemplo n.º 18
0
 public static void Load()
 {
     sheet = Datasheet.Load <ItemStat>("data/global/excel/ItemStatCost.txt");
     foreach (var prop in sheet)
     {
         prop.descPositive = Translation.Find(prop.descStrPositive);
         prop.descNegative = Translation.Find(prop.descStrNegative);
         prop.desc2        = Translation.Find(prop.descStr2);
         map.Add(prop.code, prop);
     }
 }
Ejemplo n.º 19
0
 public static void Load()
 {
     sheet = Datasheet.Load <CharStatsInfo>("data/global/excel/CharStats.txt");
     sheet.RemoveAll(row => row.baseWClass == null);
     foreach (var info in sheet)
     {
         info.token          = tokens[info.className];
         info.code           = codes[info.className];
         info.classNameLower = info.className.ToLower();
     }
 }
Ejemplo n.º 20
0
        public static void Load()
        {
            sheet = Datasheet.Load <LevelMazeInfo>("data/global/excel/LvlMaze.txt");
            foreach (var info in sheet)
            {
                if (info.levelId == -1)
                {
                    continue;
                }

                map.Add(info.levelId, info);
            }
        }
Ejemplo n.º 21
0
 public static void Load()
 {
     sheet = Datasheet.Load <SoundEnvironment>("data/global/excel/SoundEnviron.txt");
     foreach (var env in sheet)
     {
         env.song          = SoundInfo.sheet[env.songId];
         env.dayAmbience   = SoundInfo.sheet[env.dayAmbienceId];
         env.nightAmbience = SoundInfo.sheet[env.nightAmbienceId];
         env.dayEvent      = SoundInfo.sheet[env.dayEventId];
         env.nightEvent    = SoundInfo.sheet[env.nightEventId];
         env.eventDelay    = env._eventDelay / 25f;
     }
 }
Ejemplo n.º 22
0
        public static void Load()
        {
            sheet = Datasheet.Load <OverlayInfo>("data/global/excel/Overlay.txt");
            map   = new Dictionary <string, OverlayInfo>(sheet.Count);
            foreach (var row in sheet)
            {
                if (row.filename == null)
                {
                    continue;
                }

                row.spritesheetFilename = @"data\global\overlays\" + row.filename;
                map.Add(row.id, row);
            }
        }
Ejemplo n.º 23
0
        public static void Load()
        {
            sheet   = Datasheet.Load <MonPreset>("data/global/excel/MonPreset.txt");
            presets = new List <MonPreset> [ActCount + 1];

            for (int act = 0; act < presets.Length; ++act)
            {
                presets[act] = new List <MonPreset>();
            }

            for (int i = 0; i < sheet.Count; ++i)
            {
                MonPreset preset = sheet[i];
                presets[preset.act].Add(preset);
            }
        }
Ejemplo n.º 24
0
        public static void Load()
        {
            sheet = Datasheet.Load <LevelType>("data/global/excel/LvlTypes.txt");
            foreach (var levelType in sheet)
            {
                foreach (var file in levelType.files)
                {
                    if (file == "0" || file == null)
                    {
                        continue;
                    }

                    levelType.dt1Files.Add(@"data\global\tiles\" + file.Replace("/", @"\"));
                }
            }
        }
Ejemplo n.º 25
0
        public static void Load()
        {
            sheet  = Datasheet.Load <TreasureClass>("data/global/excel/TreasureClassEx.txt");
            byName = new Dictionary <string, TreasureClass>();
            GenerateFromItemTypes();

            for (int i = 0; i < sheet.Count; ++i)
            {
                TreasureClass tc = sheet[i];
                if (tc.name == null)
                {
                    continue;
                }
                if (byName.ContainsKey(tc.name))
                {
                    continue;
                }
                byName.Add(tc.name, tc);
                tc.index = i;
            }

            foreach (TreasureClass tc in sheet)
            {
                if (tc.name == null)
                {
                    continue;
                }
                tc.probSum = 0;
                for (int i = 0; i < tc.nodeArray.Length; ++i)
                {
                    var node = tc.nodeArray[i];
                    if (node.code == null)
                    {
                        break;
                    }
                    if (node.code.StartsWith("\"gld"))
                    {
                        node.code = "gld"; // todo correctly parse strings like "gld,mul=123"
                    }
                    tc.probSum     += node.prob;
                    tc.nodeArray[i] = node;
                }
            }
        }
Ejemplo n.º 26
0
        public static void Load()
        {
            prefixes = Datasheet.Load <MagicAffix>("data/global/excel/MagicPrefix.txt");
            suffixes = Datasheet.Load <MagicAffix>("data/global/excel/MagicSuffix.txt");
            all      = new List <MagicAffix>();
            foreach (var affix in prefixes)
            {
                affix.prefix = true;
                affix.name   = Translation.Find(affix.nameStr);
            }

            foreach (var affix in suffixes)
            {
                affix.name = Translation.Find(affix.nameStr);
            }

            all.AddRange(prefixes);
            all.AddRange(suffixes);
        }
Ejemplo n.º 27
0
        public static void Load()
        {
            sheet = Datasheet.Load <SetItem>("data/global/excel/SetItems.txt");
            foreach (var item in sheet)
            {
                if (item.itemCode == null)
                {
                    continue;
                }

                item.name           = Translation.Find(item.id);
                item.dropSound      = SoundInfo.Find(item._dropSound);
                item.dropSoundFrame = item._dropSoundFrame;
                item.useSound       = SoundInfo.Find(item._useSound);
                item.itemInfo       = ItemInfo.Find(item.itemCode);
                item.set            = ItemSet.Find(item.setId);
                item.set.items.Add(item);
            }
        }
Ejemplo n.º 28
0
        public static void Load()
        {
            List <UniqueItem> loadedItems = Datasheet.Load <UniqueItem>("data/global/excel/UniqueItems.txt");

            sheet = new List <UniqueItem>(loadedItems.Count);
            foreach (var item in loadedItems)
            {
                if (item.nameStr != null)
                {
                    sheet.Add(item);
                }
            }
            foreach (var unique in sheet)
            {
                unique.name           = Translation.Find(unique.nameStr);
                unique.dropSound      = SoundInfo.Find(unique._dropSound);
                unique.dropSoundFrame = unique._dropSoundFrame;
                unique.useSound       = SoundInfo.Find(unique._useSound);
            }
        }
Ejemplo n.º 29
0
        public static void Load()
        {
            sheet = Datasheet.Load <ItemPropertyInfo>("data/global/excel/Properties.txt");
            sheet.RemoveAll(row => !row._done);

            foreach (var prop in sheet)
            {
                map.Add(prop.code, prop);

                for (int i = 0; i < prop._blocks.Length; ++i)
                {
                    Block block = prop._blocks[i];
                    if (block.func == 0)
                    {
                        break;
                    }
                    block.stat = ItemStat.Find(block.statId);
                    prop.blocks.Add(block);
                }
            }
        }
Ejemplo n.º 30
0
 public static void Load()
 {
     sheet = Datasheet.Load <MonStatsExtended>("data/global/excel/MonStats2.txt");
     stats = new Dictionary <string, MonStatsExtended>();
     foreach (var stat in sheet)
     {
         for (int i = 0; i < stat.gearVariantsStr.Length; ++i)
         {
             if (stat.gearVariantsStr[i] == null)
             {
                 continue;
             }
             var gearVariants = stat.gearVariantsStr[i].Replace("nil", "").Replace("\"", "").Split(',');
             stat.gearVariants[i] = gearVariants;
         }
         if (stats.ContainsKey(stat.id))
         {
             stats.Remove(stat.id);
         }
         stats.Add(stat.id.ToLower(), stat);
     }
 }