Example #1
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");
        }
Example #2
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);
            }
        }