public void SetParamIni(JSON_UnitParam json) { this.param.hp = (OInt)json.hp; this.param.mp = (OShort)json.mp; this.param.atk = (OShort)json.atk; this.param.def = (OShort)json.def; this.param.mag = (OShort)json.mag; this.param.mnd = (OShort)json.mnd; this.param.dex = (OShort)json.dex; this.param.spd = (OShort)json.spd; this.param.cri = (OShort)json.cri; this.param.luk = (OShort)json.luk; }
public bool Deserialize(JSON_UnitParam json) { if (json == null) { return(false); } this.no = json.no; this.iname = json.iname; this.name = json.name; this.ai = (OString)json.ai; this.model = json.mdl; this.grow = (OString)json.grow; this.piece = (OString)json.piece; this.birth = (OString)json.birth; this.skill = (OString)json.skill; this.ability = (OString)json.ability; this.ma_quest = (OString)json.ma_quest; this.sw = (OInt)Math.Max(json.sw, 1); this.sh = (OInt)Math.Max(json.sh, 1); this.sex = (ESex)json.sex; this.rare = (OInt)json.rare; this.raremax = (OInt)json.raremax; this.type = (EUnitType)json.type; this.element = (EElement)json.elem; this.hero = (OInt)json.hero; this.search = (OInt)json.search; this.stopped = (OBool)(json.stop != 0); this.summon = json.notsmn == 0; if (!string.IsNullOrEmpty(json.available_at)) { try { this.available_at = DateTime.Parse(json.available_at); } catch { this.available_at = DateTime.MaxValue; } } this.height = (OInt)json.height; this.weight = (OInt)json.weight; this.jobsets = (OString[])null; this.mJobSetCache = (JobSetParam[])null; this.tags = (string[])null; this.jobtype = (JobTypes)json.jt; this.role = (RoleTypes)json.role; this.mov = (OInt)json.mov; this.jmp = (OInt)json.jmp; this.inimp = (OInt)json.inimp; this.ma_rarity = (OInt)json.ma_rarity; this.ma_lv = (OInt)json.ma_lv; if (json.skins != null && json.skins.Length >= 1) { this.skins = new OString[json.skins.Length]; for (int index = 0; index < json.skins.Length; ++index) { this.skins[index] = (OString)json.skins[index]; } } this.djob = (OString)json.djob; this.dbuki = (OString)json.dbuki; this.default_skill = (OString)json.dskl; this.default_abilities = (OString[])null; if (json.dabi != null && json.dabi.Length > 0) { this.default_abilities = new OString[json.dabi.Length]; for (int index = 0; index < json.dabi.Length; ++index) { this.default_abilities[index] = (OString)json.dabi[index]; } } if (this.type == EUnitType.EventUnit) { return(true); } if (json.jobsets != null) { this.jobsets = new OString[json.jobsets.Length]; for (int index = 0; index < this.jobsets.Length; ++index) { this.jobsets[index] = (OString)json.jobsets[index]; } } if (json.tag != null) { this.tags = json.tag.Split(','); } if (this.ini_status == null) { this.ini_status = new BaseStatus(); } this.ini_status.param.hp = (OInt)json.hp; this.ini_status.param.mp = (OShort)json.mp; this.ini_status.param.atk = (OShort)json.atk; this.ini_status.param.def = (OShort)json.def; this.ini_status.param.mag = (OShort)json.mag; this.ini_status.param.mnd = (OShort)json.mnd; this.ini_status.param.dex = (OShort)json.dex; this.ini_status.param.spd = (OShort)json.spd; this.ini_status.param.cri = (OShort)json.cri; this.ini_status.param.luk = (OShort)json.luk; this.ini_status.enchant_resist.poison = (OInt)json.rpo; this.ini_status.enchant_resist.paralyse = (OInt)json.rpa; this.ini_status.enchant_resist.stun = (OInt)json.rst; this.ini_status.enchant_resist.sleep = (OInt)json.rsl; this.ini_status.enchant_resist.charm = (OInt)json.rch; this.ini_status.enchant_resist.stone = (OInt)json.rsn; this.ini_status.enchant_resist.blind = (OInt)json.rbl; this.ini_status.enchant_resist.notskl = (OInt)json.rns; this.ini_status.enchant_resist.notmov = (OInt)json.rnm; this.ini_status.enchant_resist.notatk = (OInt)json.rna; this.ini_status.enchant_resist.zombie = (OInt)json.rzo; this.ini_status.enchant_resist.death = (OInt)json.rde; this.ini_status.enchant_resist.knockback = (OInt)json.rkn; this.ini_status.enchant_resist.resist_buff = (OInt)0; this.ini_status.enchant_resist.resist_debuff = (OInt)json.rdf; this.ini_status.enchant_resist.berserk = (OInt)json.rbe; this.ini_status.enchant_resist.stop = (OInt)json.rcs; this.ini_status.enchant_resist.fast = (OInt)json.rcu; this.ini_status.enchant_resist.slow = (OInt)json.rcd; this.ini_status.enchant_resist.donsoku = (OInt)json.rdo; this.ini_status.enchant_resist.rage = (OInt)json.rra; if (this.max_status == null) { this.max_status = new BaseStatus(); } this.max_status.param.hp = (OInt)json.mhp; this.max_status.param.mp = (OShort)json.mmp; this.max_status.param.atk = (OShort)json.matk; this.max_status.param.def = (OShort)json.mdef; this.max_status.param.mag = (OShort)json.mmag; this.max_status.param.mnd = (OShort)json.mmnd; this.max_status.param.dex = (OShort)json.mdex; this.max_status.param.spd = (OShort)json.mspd; this.max_status.param.cri = (OShort)json.mcri; this.max_status.param.luk = (OShort)json.mluk; this.max_status.enchant_resist.poison = (OInt)json.mrpo; this.max_status.enchant_resist.paralyse = (OInt)json.mrpa; this.max_status.enchant_resist.stun = (OInt)json.mrst; this.max_status.enchant_resist.sleep = (OInt)json.mrsl; this.max_status.enchant_resist.charm = (OInt)json.mrch; this.max_status.enchant_resist.stone = (OInt)json.mrsn; this.max_status.enchant_resist.blind = (OInt)json.mrbl; this.max_status.enchant_resist.notskl = (OInt)json.mrns; this.max_status.enchant_resist.notmov = (OInt)json.mrnm; this.max_status.enchant_resist.notatk = (OInt)json.mrna; this.max_status.enchant_resist.zombie = (OInt)json.mrzo; this.max_status.enchant_resist.death = (OInt)json.mrde; this.max_status.enchant_resist.knockback = (OInt)json.mrkn; this.max_status.enchant_resist.resist_buff = (OInt)0; this.max_status.enchant_resist.resist_debuff = (OInt)json.mrdf; this.max_status.enchant_resist.berserk = (OInt)json.mrbe; this.max_status.enchant_resist.stop = (OInt)json.mrcs; this.max_status.enchant_resist.fast = (OInt)json.mrcu; this.max_status.enchant_resist.slow = (OInt)json.mrcd; this.max_status.enchant_resist.donsoku = (OInt)json.mrdo; this.max_status.enchant_resist.rage = (OInt)json.mrra; this.leader_skills[0] = json.ls1; this.leader_skills[1] = json.ls2; this.leader_skills[2] = json.ls3; this.leader_skills[3] = json.ls4; this.leader_skills[4] = json.ls5; this.leader_skills[5] = json.ls6; this.recipes[0] = json.recipe1; this.recipes[1] = json.recipe2; this.recipes[2] = json.recipe3; this.recipes[3] = json.recipe4; this.recipes[4] = json.recipe5; this.recipes[5] = json.recipe6; this.image = json.img; this.voice = json.vce; if (json.jidx != null) { this.job_option_index = new OString[json.jidx.Length]; for (int index = 0; index < json.jidx.Length; ++index) { this.job_option_index[index] = (OString)json.jidx[index]; } } if (json.jimgs != null) { this.job_images = new OString[json.jimgs.Length]; for (int index = 0; index < json.jimgs.Length; ++index) { this.job_images[index] = (OString)json.jimgs[index]; } } if (json.jvcs != null) { this.job_voices = new OString[json.jvcs.Length]; for (int index = 0; index < json.jvcs.Length; ++index) { this.job_voices[index] = (OString)json.jvcs[index]; } } this.is_throw = (OBool)(json.no_trw == 0); return(true); }
public static bool IsExistParam(JSON_UnitParam json) { return(json.dskl != null || json.jt != 0 || (json.role != 0 || json.mov != 0) || (json.jmp != 0 || json.inimp != 0)); }
private bool IsExistEnchentParamMax(JSON_UnitParam json) { return(json.mrpo != 0 || json.mrpa != 0 || (json.mrst != 0 || json.mrsl != 0) || (json.mrch != 0 || json.mrsn != 0 || (json.mrbl != 0 || json.mrns != 0)) || (json.mrnm != 0 || json.mrna != 0 || (json.mrzo != 0 || json.mrde != 0) || (json.mrkn != 0 || json.mrdf != 0 || (json.mrbe != 0 || json.mrcs != 0))) || (json.mrcu != 0 || json.mrcd != 0 || (json.mrdo != 0 || json.mrra != 0) || (json.mrsa != 0 || json.mraa != 0 || (json.mrdc != 0 || json.mric != 0)))); }
private bool IsExistEnchentParamIni(JSON_UnitParam json) { return(json.rpo != 0 || json.rpa != 0 || (json.rst != 0 || json.rsl != 0) || (json.rch != 0 || json.rsn != 0 || (json.rbl != 0 || json.rns != 0)) || (json.rnm != 0 || json.rna != 0 || (json.rzo != 0 || json.rde != 0) || (json.rkn != 0 || json.rdf != 0 || (json.rbe != 0 || json.rcs != 0))) || (json.rcu != 0 || json.rcd != 0 || (json.rdo != 0 || json.rra != 0) || (json.rsa != 0 || json.raa != 0 || (json.rdc != 0 || json.ric != 0)))); }
public bool Deserialize(JSON_UnitParam json) { if (json == null) { return(false); } this.iname = json.iname; this.name = json.name; this.model = json.mdl; this.grow = (OString)json.grow; this.piece = json.piece; this.birth = (OString)json.birth; this.birthID = json.birth_id; this.ability = json.ability; this.ma_quest = json.ma_quest; this.sex = (ESex)json.sex; this.rare = (byte)json.rare; this.raremax = (byte)json.raremax; this.type = (EUnitType)json.type; this.element = (EElement)json.elem; this.flag.Set(0, json.hero != 0); this.search = (byte)json.search; this.flag.Set(1, json.notsmn == 0); if (!string.IsNullOrEmpty(json.available_at)) { try { this.available_at = DateTime.Parse(json.available_at); } catch { this.available_at = DateTime.MaxValue; } } this.height = (short)json.height; this.weight = (short)json.weight; this.jobsets = (string[])null; this.mJobSetCache = (JobSetParam[])null; this.tags = (string[])null; if (json.skins != null && json.skins.Length >= 1) { this.skins = new string[json.skins.Length]; for (int index = 0; index < json.skins.Length; ++index) { this.skins[index] = json.skins[index]; } } if (UnitParam.NoJobStatus.IsExistParam(json)) { this.no_job_status = new UnitParam.NoJobStatus(); this.no_job_status.SetParam(json); } if (this.type == EUnitType.EventUnit) { return(true); } if (json.jobsets != null) { this.jobsets = new string[json.jobsets.Length]; for (int index = 0; index < this.jobsets.Length; ++index) { this.jobsets[index] = json.jobsets[index]; } } if (json.tag != null) { this.tags = json.tag.Split(','); } if (this.ini_status == null) { this.ini_status = new UnitParam.Status(); } this.ini_status.SetParamIni(json); this.ini_status.SetEnchentParamIni(json); if (this.max_status == null) { this.max_status = new UnitParam.Status(); } this.max_status.SetParamMax(json); this.max_status.SetEnchentParamMax(json); this.leader_skills[0] = json.ls1; this.leader_skills[1] = json.ls2; this.leader_skills[2] = json.ls3; this.leader_skills[3] = json.ls4; this.leader_skills[4] = json.ls5; this.leader_skills[5] = json.ls6; this.recipes[0] = json.recipe1; this.recipes[1] = json.recipe2; this.recipes[2] = json.recipe3; this.recipes[3] = json.recipe4; this.recipes[4] = json.recipe5; this.recipes[5] = json.recipe6; this.image = json.img; this.voice = json.vce; this.flag.Set(2, json.no_trw == 0); this.flag.Set(3, json.no_kb == 0); this.unlock_time = json.unlck_t; return(true); }