Exemple #1
0
 public bool Deserialize(JSON_CondEffectParam json)
 {
     if (json == null)
     {
         return(false);
     }
     this.iname      = json.iname;
     this.job        = json.job;
     this.buki       = json.buki;
     this.birth      = json.birth;
     this.sex        = (ESex)json.sex;
     this.elem       = (EElement)json.elem;
     this.cond       = (ESkillCondition)json.cond;
     this.type       = (ConditionEffectTypes)json.type;
     this.chk_target = (EffectCheckTargets)json.chktgt;
     this.chk_timing = (EffectCheckTimings)json.timing;
     this.value_ini  = (OInt)json.vini;
     this.value_max  = (OInt)json.vmax;
     this.rate_ini   = (OInt)json.rini;
     this.rate_max   = (OInt)json.rmax;
     this.turn_ini   = (OInt)json.tini;
     this.turn_max   = (OInt)json.tmax;
     this.curse      = (OInt)json.curse;
     this.conditions = (EUnitCondition[])null;
     if (json.conds != null)
     {
         this.conditions = new EUnitCondition[json.conds.Length];
         for (int index = 0; index < json.conds.Length; ++index)
         {
             if (json.conds[index] >= 0)
             {
                 this.conditions[index] = (EUnitCondition)(1 << json.conds[index]);
             }
         }
     }
     this.v_poison_rate      = (OInt)json.v_poi;
     this.v_poison_fix       = (OInt)json.v_poifix;
     this.v_paralyse_rate    = (OInt)json.v_par;
     this.v_blink_hit        = (OInt)json.v_blihit;
     this.v_blink_avo        = (OInt)json.v_bliavo;
     this.v_death_count      = (OInt)json.v_dea;
     this.v_berserk_atk      = (OInt)json.v_beratk;
     this.v_berserk_def      = (OInt)json.v_berdef;
     this.v_fast             = (OInt)json.v_fast;
     this.v_slow             = (OInt)json.v_slow;
     this.v_donmov           = (OInt)json.v_don;
     this.v_auto_hp_heal     = (OInt)json.v_ahp;
     this.v_auto_mp_heal     = (OInt)json.v_amp;
     this.v_auto_hp_heal_fix = (OInt)json.v_ahpfix;
     this.v_auto_mp_heal_fix = (OInt)json.v_ampfix;
     return(true);
 }
        public bool Deserialize(JSON_BuffEffectParam json)
        {
            if (json == null)
            {
                return(false);
            }
            this.iname      = json.iname;
            this.job        = json.job;
            this.buki       = json.buki;
            this.birth      = json.birth;
            this.sex        = (ESex)json.sex;
            this.un_group   = json.un_group;
            this.elem       = Convert.ToInt32(json.elem.ToString("d7"), 2);
            this.rate       = (OInt)json.rate;
            this.turn       = (OInt)json.turn;
            this.chk_target = (EffectCheckTargets)json.chktgt;
            this.chk_timing = (EffectCheckTimings)json.timing;
            this.cond       = (ESkillCondition)json.cond;
            this.mIsUpBuff  = (OBool)false;
            this.mUpTiming  = (EffectCheckTimings)json.up_timing;
            this.mAppType   = (EAppType)json.app_type;
            this.mAppMct    = json.app_mct;
            this.mEffRange  = (EEffRange)json.eff_range;
            this.mFlags     = (BuffFlags)0;
            if (json.is_up_rep != 0)
            {
                this.mFlags |= BuffFlags.UpReplenish;
            }
            if (json.is_no_dis != 0)
            {
                this.mFlags |= BuffFlags.NoDisabled;
            }
            if (json.is_no_bt != 0)
            {
                this.mFlags |= BuffFlags.NoBuffTurn;
            }
            ParamTypes type1  = (ParamTypes)json.type1;
            ParamTypes type2  = (ParamTypes)json.type2;
            ParamTypes type3  = (ParamTypes)json.type3;
            ParamTypes type4  = (ParamTypes)json.type4;
            ParamTypes type5  = (ParamTypes)json.type5;
            ParamTypes type6  = (ParamTypes)json.type6;
            ParamTypes type7  = (ParamTypes)json.type7;
            ParamTypes type8  = (ParamTypes)json.type8;
            ParamTypes type9  = (ParamTypes)json.type9;
            ParamTypes type10 = (ParamTypes)json.type10;
            ParamTypes type11 = (ParamTypes)json.type11;
            int        length = 0;

            if (type1 != ParamTypes.None)
            {
                ++length;
            }
            if (type2 != ParamTypes.None)
            {
                ++length;
            }
            if (type3 != ParamTypes.None)
            {
                ++length;
            }
            if (type4 != ParamTypes.None)
            {
                ++length;
            }
            if (type5 != ParamTypes.None)
            {
                ++length;
            }
            if (type6 != ParamTypes.None)
            {
                ++length;
            }
            if (type7 != ParamTypes.None)
            {
                ++length;
            }
            if (type8 != ParamTypes.None)
            {
                ++length;
            }
            if (type9 != ParamTypes.None)
            {
                ++length;
            }
            if (type10 != ParamTypes.None)
            {
                ++length;
            }
            if (type11 != ParamTypes.None)
            {
                ++length;
            }
            if (length > 0)
            {
                this.buffs = new BuffEffectParam.Buff[length];
                int index = 0;
                if (type1 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type1;
                    this.buffs[index].value_ini = (OInt)json.vini1;
                    this.buffs[index].value_max = (OInt)json.vmax1;
                    this.buffs[index].value_one = (OInt)json.vone1;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc1;
                    ++index;
                }
                if (type2 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type2;
                    this.buffs[index].value_ini = (OInt)json.vini2;
                    this.buffs[index].value_max = (OInt)json.vmax2;
                    this.buffs[index].value_one = (OInt)json.vone2;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc2;
                    ++index;
                }
                if (type3 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type3;
                    this.buffs[index].value_ini = (OInt)json.vini3;
                    this.buffs[index].value_max = (OInt)json.vmax3;
                    this.buffs[index].value_one = (OInt)json.vone3;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc3;
                    ++index;
                }
                if (type4 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type4;
                    this.buffs[index].value_ini = (OInt)json.vini4;
                    this.buffs[index].value_max = (OInt)json.vmax4;
                    this.buffs[index].value_one = (OInt)json.vone4;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc4;
                    ++index;
                }
                if (type5 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type5;
                    this.buffs[index].value_ini = (OInt)json.vini5;
                    this.buffs[index].value_max = (OInt)json.vmax5;
                    this.buffs[index].value_one = (OInt)json.vone5;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc5;
                    ++index;
                }
                if (type6 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type6;
                    this.buffs[index].value_ini = (OInt)json.vini6;
                    this.buffs[index].value_max = (OInt)json.vmax6;
                    this.buffs[index].value_one = (OInt)json.vone6;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc6;
                    ++index;
                }
                if (type7 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type7;
                    this.buffs[index].value_ini = (OInt)json.vini7;
                    this.buffs[index].value_max = (OInt)json.vmax7;
                    this.buffs[index].value_one = (OInt)json.vone7;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc7;
                    ++index;
                }
                if (type8 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type8;
                    this.buffs[index].value_ini = (OInt)json.vini8;
                    this.buffs[index].value_max = (OInt)json.vmax8;
                    this.buffs[index].value_one = (OInt)json.vone8;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc8;
                    ++index;
                }
                if (type9 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type9;
                    this.buffs[index].value_ini = (OInt)json.vini9;
                    this.buffs[index].value_max = (OInt)json.vmax9;
                    this.buffs[index].value_one = (OInt)json.vone9;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc9;
                    ++index;
                }
                if (type10 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type10;
                    this.buffs[index].value_ini = (OInt)json.vini10;
                    this.buffs[index].value_max = (OInt)json.vmax10;
                    this.buffs[index].value_one = (OInt)json.vone10;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc10;
                    ++index;
                }
                if (type11 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type11;
                    this.buffs[index].value_ini = (OInt)json.vini11;
                    this.buffs[index].value_max = (OInt)json.vmax11;
                    this.buffs[index].value_one = (OInt)json.vone11;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc11;
                    int num = index + 1;
                }
                foreach (BuffEffectParam.Buff buff in this.buffs)
                {
                    if ((int)buff.value_one != 0)
                    {
                        this.mIsUpBuff = (OBool)true;
                        break;
                    }
                }
            }
            if (json.custom_targets != null)
            {
                this.custom_targets = new string[json.custom_targets.Length];
                for (int index = 0; index < json.custom_targets.Length; ++index)
                {
                    this.custom_targets[index] = json.custom_targets[index];
                }
            }
            return(true);
        }
Exemple #3
0
        public bool Deserialize(JSON_BuffEffectParam json)
        {
            if (json == null)
            {
                return(false);
            }
            this.iname      = json.iname;
            this.job        = json.job;
            this.buki       = json.buki;
            this.birth      = json.birth;
            this.sex        = (ESex)json.sex;
            this.elem       = Convert.ToInt32(json.elem.ToString("d7"), 2);
            this.rate       = (OInt)json.rate;
            this.turn       = (OInt)json.turn;
            this.chk_target = (EffectCheckTargets)json.chktgt;
            this.chk_timing = (EffectCheckTimings)json.timing;
            this.cond       = (ESkillCondition)json.cond;
            this.mAppType   = (EAppType)json.app_type;
            this.mAppMct    = json.app_mct;
            this.mEffRange  = (EEffRange)json.eff_range;
            ParamTypes type1  = (ParamTypes)json.type1;
            ParamTypes type2  = (ParamTypes)json.type2;
            ParamTypes type3  = (ParamTypes)json.type3;
            ParamTypes type4  = (ParamTypes)json.type4;
            ParamTypes type5  = (ParamTypes)json.type5;
            ParamTypes type6  = (ParamTypes)json.type6;
            ParamTypes type7  = (ParamTypes)json.type7;
            ParamTypes type8  = (ParamTypes)json.type8;
            ParamTypes type9  = (ParamTypes)json.type9;
            ParamTypes type10 = (ParamTypes)json.type10;
            int        length = 0;

            if (type1 != ParamTypes.None)
            {
                ++length;
            }
            if (type2 != ParamTypes.None)
            {
                ++length;
            }
            if (type3 != ParamTypes.None)
            {
                ++length;
            }
            if (type4 != ParamTypes.None)
            {
                ++length;
            }
            if (type5 != ParamTypes.None)
            {
                ++length;
            }
            if (type6 != ParamTypes.None)
            {
                ++length;
            }
            if (type7 != ParamTypes.None)
            {
                ++length;
            }
            if (type8 != ParamTypes.None)
            {
                ++length;
            }
            if (type9 != ParamTypes.None)
            {
                ++length;
            }
            if (type10 != ParamTypes.None)
            {
                ++length;
            }
            if (length > 0)
            {
                this.buffs = new BuffEffectParam.Buff[length];
                int index = 0;
                if (type1 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type1;
                    this.buffs[index].value_ini = (OInt)json.vini1;
                    this.buffs[index].value_max = (OInt)json.vmax1;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc1;
                    ++index;
                }
                if (type2 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type2;
                    this.buffs[index].value_ini = (OInt)json.vini2;
                    this.buffs[index].value_max = (OInt)json.vmax2;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc2;
                    ++index;
                }
                if (type3 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type3;
                    this.buffs[index].value_ini = (OInt)json.vini3;
                    this.buffs[index].value_max = (OInt)json.vmax3;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc3;
                    ++index;
                }
                if (type4 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type4;
                    this.buffs[index].value_ini = (OInt)json.vini4;
                    this.buffs[index].value_max = (OInt)json.vmax4;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc4;
                    ++index;
                }
                if (type5 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type5;
                    this.buffs[index].value_ini = (OInt)json.vini5;
                    this.buffs[index].value_max = (OInt)json.vmax5;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc5;
                    ++index;
                }
                if (type6 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type6;
                    this.buffs[index].value_ini = (OInt)json.vini6;
                    this.buffs[index].value_max = (OInt)json.vmax6;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc6;
                    ++index;
                }
                if (type7 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type7;
                    this.buffs[index].value_ini = (OInt)json.vini7;
                    this.buffs[index].value_max = (OInt)json.vmax7;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc7;
                    ++index;
                }
                if (type8 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type8;
                    this.buffs[index].value_ini = (OInt)json.vini8;
                    this.buffs[index].value_max = (OInt)json.vmax8;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc8;
                    ++index;
                }
                if (type9 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type9;
                    this.buffs[index].value_ini = (OInt)json.vini9;
                    this.buffs[index].value_max = (OInt)json.vmax9;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc9;
                    ++index;
                }
                if (type10 != ParamTypes.None)
                {
                    this.buffs[index]           = new BuffEffectParam.Buff();
                    this.buffs[index].type      = type10;
                    this.buffs[index].value_ini = (OInt)json.vini10;
                    this.buffs[index].value_max = (OInt)json.vmax10;
                    this.buffs[index].calc      = (SkillParamCalcTypes)json.calc10;
                    int num = index + 1;
                }
            }
            return(true);
        }