Example #1
0
    static 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
    static SkillInfo()
    {
        int    charOffset = 0;
        string charClass  = null;

        foreach (var row in sheet)
        {
            if (row.id == -1)
            {
                continue;
            }

            if (charClass != row.charClass)
            {
                charClass  = row.charClass;
                charOffset = row.id;
            }

            row.name = Translation.Find("skillname" + row.id);
            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.iconIndex   = row.id - charOffset;
            row.castOverlay = OverlayInfo.Find(row.castOverlayId);
            row.startSound  = SoundInfo.Find(row._stsound);
            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 #3
0
        public static Overlay Create(GameObject gameObject, string overlayId, bool loop, float speed = 1.0f)
        {
            var overlayInfo = OverlayInfo.Find(overlayId);

            if (overlayInfo == null)
            {
                Debug.LogWarning("overlay not found: " + overlayId);
                return(null);
            }

            return(Create(gameObject, overlayInfo, loop, speed));
        }
Example #4
0
    public static Overlay Create(GameObject gameObject, string overlayId)
    {
        var overlayInfo = OverlayInfo.Find(overlayId);

        if (overlayInfo == null)
        {
            Debug.LogWarning("overlay not found: " + overlayId);
            return(null);
        }

        return(Create(gameObject, overlayInfo));
    }
Example #5
0
    static 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 * 1.5f;
            row.travelSound = SoundInfo.Find(row.travelSoundId);
            row.hitSound    = SoundInfo.Find(row.hitSoundId);
            row.progSound   = SoundInfo.Find(row.progSoundId);
            row.progOverlay = OverlayInfo.Find(row.progOverlayId);
            map.Add(row.missile, row);
            idMap.Add(row.id, row);
        }
    }
Example #6
0
    static SkillInfo()
    {
        foreach (var row in sheet)
        {
            if (row.id == -1)
            {
                continue;
            }

            row.name        = Translation.Find("skillname" + row.id);
            row.castOverlay = OverlayInfo.Find(row.castOverlayId);
            row.startSound  = SoundInfo.Find(row._stsound);
            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");
    }