Пример #1
0
        public static ITimedEffect CreateEmpty(string result)
        {
            string[]     parts       = result.Split(new char[] { '_' }, 2);
            string[]     dummyparams = new string[] { "0,0", "0,0", "0,0", "0,0", "0,0", "0,0", "0,0", "0,0", "0,0", "0,0" };
            ITimedEffect eff;

            switch (parts[0])
            {
            case "VFX":
            {
                eff = AbilityVFX.CreateEffect(parts[1], dummyparams);
                break;
            }

            case "Effect":
            {
                eff = AbilityEffect.CreateEffect(parts[1], dummyparams);
                break;
            }

            case "Selector":
            {
                eff = AbilitySelector.CreateEffect(parts[1], dummyparams);
                break;
            }

            default:
            {
                eff = AbilityEffect.CreateEffect("null", dummyparams);
                break;
            }
            }
            return(eff);
        }
Пример #2
0
        public static AbilityEffect CreateEffect(string type, string[] parameters)
        {
            AbilityEffect ef = null;

            switch (type)
            {
            case "damage_bmd_full":
                return(new GameEffects.Effect_damage_bmd_full(parameters));

            case "dot_mwp":
                return(new GameEffects.Effect_dot_mwp(parameters));
            }


            return(ef);
        }
Пример #3
0
        /// <summary>
        /// Deprecated do not use
        /// </summary>
        /// <returns></returns>
        public List <Ability> LoadAbilities()
        {
            List <Ability> result = new List <Ability>();

            // List<List<KeyValuePair<string, string>>> l = new List<List<KeyValuePair<string, string>>>();
            while (!_finished)
            {
                List <KeyValuePair <string, string> > ability = FetchAbility();
                Ability  a           = new Ability();
                string[] effectparts = null;
                foreach (KeyValuePair <string, string> kvp in ability)
                {
                    switch (kvp.Key)
                    {
                    case "Icon":
                    {
                        a.Icon = Int32.Parse(kvp.Value);
                        break;
                    }

                    case "Name":
                    {
                        a.Name = kvp.Value;
                        break;
                    }

                    case "Description":
                    {
                        a.Description = kvp.Value;
                        break;
                    }

                    case "Target":
                    {
                        switch (kvp.Value)
                        {
                        case "Hostile":
                        {
                            a.Target = Ability.AbilityTarget.Hostile;
                            break;
                        }

                        case "Self":
                        {
                            a.Target = Ability.AbilityTarget.Self;
                            break;
                        }

                        case "Friendly":
                        {
                            a.Target = Ability.AbilityTarget.Friendly;
                            break;
                        }

                        case "Neutral":
                        {
                            a.Target = Ability.AbilityTarget.Neutral;
                            break;
                        }
                        }
                        break;
                    }

                    case "Cast":
                    {
                        string[] castparts = kvp.Value.Split('/');
                        a.CastTime      = (float)int.Parse(castparts[0]) / 10f;
                        a.CastGrowth    = (float)int.Parse(castparts[1]) / 10f;
                        a.CastAnimation = new AbilityAnimation(castparts[2], Utility.GetColor(castparts[3]));

                        break;
                    }

                    case "Charge":
                    {
                        string[] castparts = kvp.Value.Split('/');
                        a.ChargeTime      = (float)int.Parse(castparts[0]) / 10f;
                        a.ChargeGrowth    = (float)int.Parse(castparts[1]) / 10f;
                        a.ChargeAnimation = new AbilityAnimation(castparts[2], Utility.GetColor(castparts[3]));

                        break;
                    }

                    case "LearnLevel":
                    {
                        a.LearnLevel = int.Parse(kvp.Value);

                        break;
                    }

                    case "Effect":
                    {
                        effectparts = kvp.Value.Split('/');
                        //AbilityEffect e = AbilityEffect.CreateEffect()
                        break;
                    }

                    case "EffectParams":
                    {
                        string[] eparams = kvp.Value.Split('/');
                        if (effectparts != null)
                        {
                            AbilityEffect e     = AbilityEffect.CreateEffect(effectparts[2], eparams);
                            string[]      probs = effectparts[1].Split(',');
                            e.Probability       = (float)int.Parse(probs[0]) / 100f;
                            e.ProbabilityGrowth = (float)int.Parse(probs[1]) / 100f;
                            e.Animation         = new AbilityAnimation(effectparts[3], Utility.GetColor(effectparts[4]));
                            switch (effectparts[0])
                            {
                            case "target":
                            {
                                e.Target = AbilityEffect.EffectTarget.Target;
                                break;
                            }

                            case "user":
                            {
                                e.Target = AbilityEffect.EffectTarget.User;
                                break;
                            }

                            case "userarea":
                            {
                                e.Target = AbilityEffect.EffectTarget.UserArea;
                                break;
                            }

                            case "userareaex":
                            {
                                e.Target = AbilityEffect.EffectTarget.UserAreaExclude;
                                break;
                            }

                            case "targetarea":
                            {
                                e.Target = AbilityEffect.EffectTarget.TargetArea;
                                break;
                            }

                            default:
                            {
                                e.Target = AbilityEffect.EffectTarget.Target;
                                break;
                            }
                            }
                            a.Effects.Add(e);
                        }
                        effectparts = null;
                        break;
                    }

                    case "MPCost":
                    {
                        string[] castparts = kvp.Value.Split(',');
                        a.MPCost       = (float)int.Parse(castparts[0]) / 10f;
                        a.MPCostGrowth = (float)int.Parse(castparts[1]) / 10f;
                        break;
                    }
                    }
                }
                result.Add(a);
                Console.Write(a.FormatDescription());
                a.Level += 5;
                Console.Write(a.FormatDescription());
            }
            // l.Sort();
            return(result);
        }