예제 #1
0
        protected override void takeAction(SkillEffect effect)
        {
            if (effect.IsAwake)
            {
                mStillRunning.Add(SkillUtilities.MakePair(effect.Type, effect.ResID));
            }

            effect.Stop(StopReason);
        }
예제 #2
0
    /// <summary>
    /// <para>解析属性.</para>
    /// 多组属性之间, 用'|'分割. 属性以及操作用'+'或者'-'分割, 分别表示该属性增加或者减少指定值.
    /// </summary>
    public static List <Pair <int, int> > ParseProperties(string properties)
    {
        if (string.IsNullOrEmpty(properties))
        {
            return(null);
        }

        List <Pair <int, int> > result = new List <Pair <int, int> >();

        string[] group = properties.Split('|');
        foreach (string p in group)
        {
            int sep      = p.IndexOfAny(new char[] { '+', '-' });
            int propID   = System.Convert.ToInt32(p.Substring(0, sep));
            int addValue = System.Convert.ToInt32(p.Substring(sep));
            result.Add(SkillUtilities.MakePair(propID, addValue));
        }

        return(result);
    }