Exemple #1
0
 public bool Deserialize(JSON_ArtifactParam json)
 {
     if (json == null)
     {
         return(false);
     }
     this.iname     = json.iname;
     this.name      = json.name;
     this.expr      = json.expr;
     this.flavor    = json.flavor;
     this.spec      = json.spec;
     this.asset     = json.asset;
     this.voice     = json.voice;
     this.icon      = json.icon;
     this.tag       = json.tag;
     this.type      = (ArtifactTypes)json.type;
     this.rareini   = json.rini;
     this.raremax   = json.rmax;
     this.kakera    = json.kakera;
     this.maxnum    = json.maxnum;
     this.is_create = json.notsmn == 0;
     this.skills    = (string[])null;
     if (json.skills != null)
     {
         this.skills = new string[json.skills.Length];
         for (int index = 0; index < json.skills.Length; ++index)
         {
             this.skills[index] = json.skills[index];
         }
     }
     Array.Clear((Array)this.equip_effects, 0, this.equip_effects.Length);
     this.equip_effects[0] = json.equip1;
     this.equip_effects[1] = json.equip2;
     this.equip_effects[2] = json.equip3;
     this.equip_effects[3] = json.equip4;
     this.equip_effects[4] = json.equip5;
     Array.Clear((Array)this.attack_effects, 0, this.attack_effects.Length);
     this.attack_effects[0] = json.attack1;
     this.attack_effects[1] = json.attack2;
     this.attack_effects[2] = json.attack3;
     this.attack_effects[3] = json.attack4;
     this.attack_effects[4] = json.attack5;
     this.abil_inames       = (string[])null;
     this.abil_levels       = (int[])null;
     this.abil_rareties     = (int[])null;
     this.abil_shows        = (int[])null;
     this.abil_conds        = (string[])null;
     if (json.abils != null && json.ablvs != null && (json.abrares != null && json.abshows != null) && (json.abconds != null && json.abils.Length == json.ablvs.Length && (json.abils.Length == json.abrares.Length && json.abils.Length == json.abshows.Length)) && json.abils.Length == json.abconds.Length)
     {
         this.abil_inames   = new string[json.abils.Length];
         this.abil_levels   = new int[json.ablvs.Length];
         this.abil_rareties = new int[json.abrares.Length];
         this.abil_shows    = new int[json.abshows.Length];
         this.abil_conds    = new string[json.abconds.Length];
         for (int index = 0; index < json.ablvs.Length; ++index)
         {
             this.abil_inames[index]   = json.abils[index];
             this.abil_levels[index]   = json.ablvs[index];
             this.abil_rareties[index] = json.abrares[index];
             this.abil_shows[index]    = json.abshows[index];
             this.abil_conds[index]    = json.abconds[index];
         }
     }
     this.kcoin             = json.kc;
     this.tcoin             = json.tc;
     this.acoin             = json.ac;
     this.mcoin             = json.mc;
     this.pcoin             = json.pp;
     this.buy               = json.buy;
     this.sell              = json.sell;
     this.enhance_cost      = json.ecost;
     this.condition_lv      = json.eqlv;
     this.condition_sex     = (ESex)json.sex;
     this.condition_birth   = json.birth;
     this.condition_element = (EElement)json.elem;
     this.condition_units   = (string[])null;
     this.condition_jobs    = (string[])null;
     this.condition_raremin = (OInt)json.eqrmin;
     this.condition_raremax = (OInt)json.eqrmax;
     if (json.units != null && json.units.Length > 0)
     {
         this.condition_units = new string[json.units.Length];
         for (int index = 0; index < json.units.Length; ++index)
         {
             this.condition_units[index] = json.units[index];
         }
     }
     if (json.jobs != null && json.jobs.Length > 0)
     {
         this.condition_jobs = new string[json.jobs.Length];
         for (int index = 0; index < json.jobs.Length; ++index)
         {
             this.condition_jobs[index] = json.jobs[index];
         }
     }
     return(true);
 }
Exemple #2
0
 public void Deserialize(string language, JSON_ArtifactParam json)
 {
     this.Deserialize(json);
     this.localizeFields(language);
 }