Exemplo n.º 1
0
        /// <summary>
        /// (effect) (cond)* (sup)*
        /// </summary>
        /// <param name="value"></param>
        public void SetEffect_effect(string value)
        {
            if (value.StartsWith("{"))
            {
                return;
            }

            byte order = 0;

            foreach (string str in value.Split(';'))
            {
                TEffectType type = (TEffectType)Enum.Parse(typeof(TEffectType), str.Split(' ')[0]);
                TEffect     te   = TEffectRegistrator.getInstance().BuildProc(type, str);
                if (te != null)
                {
                    te.type    = type;
                    te.HashID  = this.HashID();
                    te.Order   = order;
                    te.SkillId = skill_id;
                    te.SkillLv = level;
                    effects.Add(te);
                    order++;
                }
                // else
                //     CLogger.error("skill #" + skill_id + " requested unregistered effect " + str);
                ///  order++;
            }
        }
Exemplo n.º 2
0
        private double getTemplate(TEffectType type)
        {
            if (!statTemplate.ContainsKey(type))
            {
                return(0);
            }

            return((double)statTemplate[type]);
        }
Exemplo n.º 3
0
        public double getStat(TEffectType type)
        {
            if (!statBuff.ContainsKey(type))
            {
                if (!statTemplate.ContainsKey(type))
                {
                    return(0);
                }
                else
                {
                    return((double)statTemplate[type]);
                }
            }

            return((double)statBuff[type]);
        }
Exemplo n.º 4
0
 public void addTemplate(TEffectType type, double value)
 {
     statTemplate.Add(type, value);
 }
Exemplo n.º 5
0
        public TEffect BuildProc(TEffectType type, string str)
        {
            TEffect effect = null;

            switch (type)
            {
            case TEffectType.p_speed:
                effect = new p_speed();
                break;

            case TEffectType.p_physical_defense:
                effect = new p_physical_defence();
                break;

            case TEffectType.i_restoration:
                effect = new i_restoration();
                break;

            case TEffectType.i_fatal_blow:
                effect = new i_fatal_blow();
                break;

            case TEffectType.i_death:
                effect = new i_death();
                break;

            case TEffectType.p_block_skill_physical:
                effect = new p_block_skill_physical();
                break;

            case TEffectType.p_block_skill_special:
                effect = new p_block_skill_special();
                break;

            case TEffectType.p_block_spell:
                effect = new p_block_spell();
                break;

            case TEffectType.i_target_cancel:
                effect = new i_target_cancel();
                break;

            case TEffectType.p_defence_attribute:
                effect = new p_defence_attribute();
                break;

            case TEffectType.i_p_attack:
                effect = new i_p_attack();
                break;

            case TEffectType.i_remove_soul:
                effect = new i_remove_soul();
                break;

            case TEffectType.i_agathion_energy:
                effect = new i_agathion_energy();
                break;

            case TEffectType.i_summon_cubic:
                effect = new i_summon_cubic();
                break;

            case TEffectType.cub_heal:
                effect = new cub_heal();
                break;

            default:
                return(null);
            }

            effect.build(str);
            return(effect);
        }