private void setup(string iname, int grid_x, int grid_y, string tag, Unit creator, int create_clock, int rank, int rankcap) { if (string.IsNullOrEmpty(iname)) { return; } GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect(); if (!UnityEngine.Object.op_Implicit((UnityEngine.Object)instanceDirect)) { return; } this.mTrickParam = instanceDirect.MasterParam.GetTrickParam(iname); if (this.mTrickParam == null) { return; } this.mRankCap = (OInt)Math.Max(rankcap, 1); this.mRank = (OInt)Math.Min(rank, (int)this.mRankCap); this.mBuffEffect = BuffEffect.CreateBuffEffect(instanceDirect.MasterParam.GetBuffEffectParam(this.mTrickParam.BuffId), (int)this.mRank, (int)this.mRankCap); this.mCondEffect = CondEffect.CreateCondEffect(instanceDirect.MasterParam.GetCondEffectParam(this.mTrickParam.CondId), (int)this.mRank, (int)this.mRankCap); this.mCreateUnit = creator; this.mGridX = (OInt)grid_x; this.mGridY = (OInt)grid_y; this.mTag = tag; this.mRestActionCount = this.mTrickParam.ActionCount; this.mCreateClock = (OInt)create_clock; this.mValid = (OBool)true; }
public void Deserialize(JSON_TrickParam json) { if (json == null) { return; } this.mIname = json.iname; this.mName = json.name; this.mExpr = json.expr; this.mDamageType = (eTrickDamageType)json.dmg_type; this.mDamageVal = (OInt)json.dmg_val; this.mCalcType = (SkillParamCalcTypes)json.calc; this.mElem = (EElement)json.elem; this.mAttackDetail = (AttackDetailTypes)json.atk_det; this.mBuffId = json.buff; this.mCondId = json.cond; this.mKnockBackRate = (OInt)json.kb_rate; this.mKnockBackVal = (OInt)json.kb_val; this.mTarget = (ESkillTarget)json.target; this.mVisualType = (eTrickVisualType)json.visual; this.mActionCount = (OInt)json.count; this.mValidClock = (OInt)json.clock; this.mIsNoOverWrite = (OBool)(json.is_no_ow != 0); this.mMarkerName = json.marker; this.mEffectName = json.effect; this.mEffTarget = (ESkillTarget)json.eff_target; this.mEffShape = (ESelectType)json.eff_shape; this.mEffScope = (OInt)json.eff_scope; this.mEffHeight = (OInt)json.eff_height; }
public bool Deserialize(JSON_GeoParam json) { if (json == null) { return(false); } this.iname = json.iname; this.name = json.name; this.cost = (OInt)Math.Max(json.cost, 1); this.DisableStopped = (OBool)(json.stop != 0); return(true); }
public bool Deserialize(JSON_SkillParam json) { if (json == null) { return(false); } this.iname = json.iname; this.name = json.name; this.expr = json.expr; this.motion = json.motnm; this.effect = json.effnm; this.defend_effect = json.effdef; this.weapon = json.weapon; this.tokkou = json.tktag; this.tk_rate = json.tkrate; this.type = (ESkillType)json.type; this.timing = (ESkillTiming)json.timing; this.condition = (ESkillCondition)json.cond; this.target = (ESkillTarget)json.target; this.line_type = (ELineType)json.line; this.lvcap = (OInt)json.cap; this.cost = (OInt)json.cost; this.count = (OInt)json.count; this.rate = (OInt)json.rate; this.select_range = (ESelectType)json.sran; this.range_min = (OInt)json.rangemin; this.range_max = (OInt)json.range; this.select_scope = (ESelectType)json.ssco; this.scope = (OInt)json.scope; this.effect_height = (OInt)json.eff_h; this.back_defrate = (OInt)json.bdb; this.side_defrate = (OInt)json.sdb; this.ignore_defense_rate = (OInt)json.idr; this.job = json.job; this.SceneName = json.scn; this.ComboNum = (OInt)json.combo_num; this.ComboDamageRate = (OInt)(100 - Math.Abs(json.combo_rate)); this.IsCritical = (OBool)(json.is_cri != 0); this.JewelDamageType = (JewelDamageTypes)json.jdtype; this.JewelDamageValue = (OInt)json.jdv; this.IsJewelAbsorb = (OBool)(json.jdabs != 0); this.DuplicateCount = (OInt)json.dupli; this.CollaboMainId = json.cs_main_id; this.CollaboHeight = (OInt)json.cs_height; this.KnockBackRate = (OInt)json.kb_rate; this.KnockBackVal = (OInt)json.kb_val; this.KnockBackDir = (eKnockBackDir)json.kb_dir; this.KnockBackDs = (eKnockBackDs)json.kb_ds; this.DamageDispType = (eDamageDispType)json.dmg_dt; this.ReplaceTargetIdLists = (List <string>)null; if (json.rp_tgt_ids != null) { this.ReplaceTargetIdLists = new List <string>(); foreach (string rpTgtId in json.rp_tgt_ids) { this.ReplaceTargetIdLists.Add(rpTgtId); } } this.ReplaceChangeIdLists = (List <string>)null; if (json.rp_chg_ids != null && this.ReplaceTargetIdLists != null) { this.ReplaceChangeIdLists = new List <string>(); foreach (string rpChgId in json.rp_chg_ids) { this.ReplaceChangeIdLists.Add(rpChgId); } } if (this.ReplaceTargetIdLists != null && this.ReplaceChangeIdLists != null && this.ReplaceTargetIdLists.Count != this.ReplaceChangeIdLists.Count) { this.ReplaceTargetIdLists.Clear(); this.ReplaceChangeIdLists.Clear(); } this.AbilityReplaceTargetIdLists = (List <string>)null; if (json.ab_rp_tgt_ids != null) { this.AbilityReplaceTargetIdLists = new List <string>(); foreach (string abRpTgtId in json.ab_rp_tgt_ids) { this.AbilityReplaceTargetIdLists.Add(abRpTgtId); } } this.AbilityReplaceChangeIdLists = (List <string>)null; if (json.ab_rp_chg_ids != null && this.AbilityReplaceTargetIdLists != null) { this.AbilityReplaceChangeIdLists = new List <string>(); foreach (string abRpChgId in json.ab_rp_chg_ids) { this.AbilityReplaceChangeIdLists.Add(abRpChgId); } } if (this.AbilityReplaceTargetIdLists != null && this.AbilityReplaceChangeIdLists != null && this.AbilityReplaceTargetIdLists.Count != this.AbilityReplaceChangeIdLists.Count) { this.AbilityReplaceTargetIdLists.Clear(); this.AbilityReplaceChangeIdLists.Clear(); } this.CollaboVoiceId = json.cs_voice; this.CollaboVoicePlayDelayFrame = json.cs_vp_df; this.TeleportType = (eTeleportType)json.tl_type; this.TeleportTarget = (ESkillTarget)json.tl_target; this.TeleportHeight = json.tl_height; this.TeleportIsMove = json.tl_is_mov != 0; this.TrickId = json.tr_id; this.TrickSetType = (eTrickSetType)json.tr_set; this.BreakObjId = json.bo_id; this.MapEffectDesc = json.me_desc; this.WeatherRate = json.wth_rate; this.WeatherId = json.wth_id; this.ElementSpcAtkRate = json.elem_tk; this.MaxDamageValue = json.max_dmg; this.CutInConceptCardId = json.ci_cc_id; this.JudgeHpVal = json.jhp_val; this.JudgeHpCalc = (SkillParamCalcTypes)json.jhp_calc; this.AcFromAbilId = json.ac_fr_ab_id; this.AcToAbilId = json.ac_to_ab_id; this.AcTurn = json.ac_turn; this.EffectHitTargetNumRate = (OInt)json.eff_htnrate; this.AbsorbAndGive = (eAbsorbAndGive)json.aag; this.TargetEx = (eSkillTargetEx)json.target_ex; this.JumpSpcAtkRate = json.jmp_tk; this.flags = (SkillFlags)0; if (json.cutin != 0) { this.flags |= SkillFlags.ExecuteCutin; } if (json.isbtl != 0) { this.flags |= SkillFlags.ExecuteInBattle; } if (json.chran != 0) { this.flags |= SkillFlags.EnableChangeRange; } if (json.sonoba != 0) { this.flags |= SkillFlags.SelfTargetSelect; } if (json.pierce != 0) { this.flags |= SkillFlags.PierceAttack; } if (json.hbonus != 0) { this.flags |= SkillFlags.EnableHeightRangeBonus; } if (json.ehpa != 0) { this.flags |= SkillFlags.EnableHeightParamAdjust; } if (json.utgt != 0) { this.flags |= SkillFlags.EnableUnitLockTarget; } if (json.ctbreak != 0) { this.flags |= SkillFlags.CastBreak; } if (json.mpatk != 0) { this.flags |= SkillFlags.JewelAttack; } if (json.fhit != 0) { this.flags |= SkillFlags.ForceHit; } if (json.suicide != 0) { this.flags |= SkillFlags.Suicide; } if (json.sub_actuate != 0) { this.flags |= SkillFlags.SubActuate; } if (json.is_fixed != 0) { this.flags |= SkillFlags.FixedDamage; } if (json.f_ulock != 0) { this.flags |= SkillFlags.ForceUnitLock; } if (json.ad_react != 0) { this.flags |= SkillFlags.AllDamageReaction; } if (json.ig_elem != 0) { this.flags |= SkillFlags.IgnoreElement; } if (json.is_pre_apply != 0) { this.flags |= SkillFlags.PrevApply; } if (json.jhp_over != 0) { this.flags |= SkillFlags.JudgeHpOver; } if (json.is_mhm_dmg != 0) { this.flags |= SkillFlags.MhmDamage; } if (json.ac_is_self != 0) { this.flags |= SkillFlags.AcSelf; } if (json.ac_is_reset != 0) { this.flags |= SkillFlags.AcReset; } if (json.is_htndiv != 0) { this.flags |= SkillFlags.HitTargetNumDiv; } if (json.is_no_ccc != 0) { this.flags |= SkillFlags.NoChargeCalcCT; } if (json.jmpbreak != 0) { this.flags |= SkillFlags.JumpBreak; } this.hp_cost = (OInt)json.hp_cost; this.hp_cost_rate = (OInt)Math.Min(Math.Max(json.hp_cost_rate, 0), 100); this.random_hit_rate = (OInt)json.rhit; this.effect_type = (SkillEffectTypes)json.eff_type; this.effect_calc = (SkillParamCalcTypes)json.eff_calc; this.effect_rate = new SkillRankUpValue(); this.effect_rate.ini = (OInt)json.eff_rate_ini; this.effect_rate.max = (OInt)json.eff_rate_max; this.effect_value = new SkillRankUpValue(); this.effect_value.ini = (OInt)json.eff_val_ini; this.effect_value.max = (OInt)json.eff_val_max; this.effect_range = new SkillRankUpValue(); this.effect_range.ini = (OInt)json.eff_range_ini; this.effect_range.max = (OInt)json.eff_range_max; this.effect_hprate = (OInt)json.eff_hprate; this.effect_mprate = (OInt)json.eff_mprate; this.effect_dead_rate = (OInt)json.eff_durate; this.effect_lvrate = (OInt)json.eff_lvrate; this.attack_type = (AttackTypes)json.atk_type; this.attack_detail = (AttackDetailTypes)json.atk_det; this.element_type = (EElement)json.elem; this.element_value = (SkillRankUpValue)null; if (this.element_type != EElement.None) { this.element_value = new SkillRankUpValue(); this.element_value.ini = (OInt)json.elem_ini; this.element_value.max = (OInt)json.elem_max; } this.cast_type = (ECastTypes)json.ct_type; this.cast_speed = (SkillRankUpValue)null; if (this.type == ESkillType.Skill && (json.ct_spd_ini != 0 || json.ct_spd_max != 0)) { this.cast_speed = new SkillRankUpValue(); this.cast_speed.ini = (OInt)json.ct_spd_ini; this.cast_speed.max = (OInt)json.ct_spd_max; } this.absorb_damage_rate = (OInt)json.abs_d_rate; this.reaction_damage_type = (DamageTypes)json.react_d_type; this.reaction_det_lists = (List <AttackDetailTypes>)null; if (json.react_dets != null) { this.reaction_det_lists = new List <AttackDetailTypes>(); foreach (AttackDetailTypes reactDet in json.react_dets) { this.reaction_det_lists.Add(reactDet); } } this.control_ct_rate = (SkillRankUpValue)null; this.control_ct_value = (SkillRankUpValue)null; if (this.control_ct_calc == SkillParamCalcTypes.Fixed || json.ct_val_ini != 0 || json.ct_val_max != 0) { this.control_ct_rate = new SkillRankUpValue(); this.control_ct_rate.ini = (OInt)json.ct_rate_ini; this.control_ct_rate.max = (OInt)json.ct_rate_max; this.control_ct_value = new SkillRankUpValue(); this.control_ct_value.ini = (OInt)json.ct_val_ini; this.control_ct_value.max = (OInt)json.ct_val_max; this.control_ct_calc = (SkillParamCalcTypes)json.ct_calc; } this.target_buff_iname = json.t_buff; this.target_cond_iname = json.t_cond; this.self_buff_iname = json.s_buff; this.self_cond_iname = json.s_cond; this.shield_type = (ShieldTypes)json.shield_type; this.shield_damage_type = (DamageTypes)json.shield_d_type; this.shield_turn = (SkillRankUpValue)null; this.shield_value = (SkillRankUpValue)null; if (this.shield_type != ShieldTypes.None && this.shield_damage_type != DamageTypes.None) { this.shield_turn = new SkillRankUpValue(); this.shield_turn.ini = (OInt)json.shield_turn_ini; this.shield_turn.max = (OInt)json.shield_turn_max; this.shield_value = new SkillRankUpValue(); this.shield_value.ini = (OInt)json.shield_ini; this.shield_value.max = (OInt)json.shield_max; if (json.shield_reset != 0) { this.flags |= SkillFlags.ShieldReset; } } if (this.reaction_damage_type != DamageTypes.None || this.shield_damage_type != DamageTypes.None) { this.control_damage_rate = new SkillRankUpValue(); this.control_damage_rate.ini = (OInt)json.ctrl_d_rate_ini; this.control_damage_rate.max = (OInt)json.ctrl_d_rate_max; this.control_damage_value = new SkillRankUpValue(); this.control_damage_value.ini = (OInt)json.ctrl_d_ini; this.control_damage_value.max = (OInt)json.ctrl_d_max; this.control_damage_calc = (SkillParamCalcTypes)json.ctrl_d_calc; } SkillEffectTypes effectType = this.effect_type; switch (effectType) { case SkillEffectTypes.Teleport: case SkillEffectTypes.Changing: case SkillEffectTypes.Throw: this.scope = (OInt)0; this.select_scope = ESelectType.Cross; break; case SkillEffectTypes.RateDamage: if (this.attack_type == AttackTypes.None) { this.attack_type = AttackTypes.PhyAttack; break; } break; default: if (effectType == SkillEffectTypes.Attack || effectType == SkillEffectTypes.ReflectDamage || effectType == SkillEffectTypes.RateDamageCurrent) { goto case SkillEffectTypes.RateDamage; } else { break; } } if (this.select_range == ESelectType.Laser) { this.select_scope = ESelectType.Laser; this.scope = (OInt)Math.Max((int)this.scope, 1); } else { switch (this.select_range) { case ESelectType.LaserSpread: this.select_scope = ESelectType.LaserSpread; break; case ESelectType.LaserWide: this.select_scope = ESelectType.LaserWide; break; case ESelectType.LaserTwin: this.select_scope = ESelectType.LaserTwin; break; case ESelectType.LaserTriple: this.select_scope = ESelectType.LaserTriple; break; } switch (this.select_scope) { case ESelectType.LaserSpread: case ESelectType.LaserWide: case ESelectType.LaserTwin: case ESelectType.LaserTriple: this.scope = (OInt)1; break; } } if (this.TeleportType != eTeleportType.None) { if (!this.IsTargetGridNoUnit && this.TeleportType != eTeleportType.BeforeSkill) { this.target = ESkillTarget.GridNoUnit; } if (this.IsTargetTeleport) { if (this.IsCastSkill()) { this.cast_speed = (SkillRankUpValue)null; } if ((int)this.scope != 0) { this.scope = (OInt)0; } } } if (this.IsTargetValidGrid && !this.IsTrickSkill()) { this.target = ESkillTarget.GridNoUnit; } if (this.timing == ESkillTiming.Auto && this.effect_type == SkillEffectTypes.Attack) { this.effect_type = SkillEffectTypes.Buff; } return(true); }
public bool Deserialize(JSON_SkillParam json) { if (json == null) { return(false); } this.iname = json.iname; this.name = json.name; this.expr = json.expr; this.motion = json.motnm; this.effect = json.effnm; this.defend_effect = json.effdef; this.weapon = json.weapon; this.tokkou = json.tktag; this.tk_rate = json.tkrate; this.type = (ESkillType)json.type; this.timing = (ESkillTiming)json.timing; this.condition = (ESkillCondition)json.cond; this.target = (ESkillTarget)json.target; this.line_type = (ELineType)json.line; this.lvcap = (OInt)json.cap; this.cost = (OInt)json.cost; this.count = (OInt)json.count; this.rate = (OInt)json.rate; this.select_range = (ESelectType)json.sran; this.range_min = (OInt)json.rangemin; this.range_max = (OInt)json.range; this.select_scope = (ESelectType)json.ssco; this.scope = (OInt)json.scope; this.effect_height = (OInt)json.eff_h; this.back_defrate = (OInt)json.bdb; this.side_defrate = (OInt)json.sdb; this.ignore_defense_rate = (OInt)json.idr; this.job = json.job; this.SceneName = json.scn; this.ComboNum = (OInt)json.combo_num; this.ComboDamageRate = (OInt)(100 - Math.Abs(json.combo_rate)); this.IsCritical = (OBool)(json.is_cri != 0); this.JewelDamageType = (JewelDamageTypes)json.jdtype; this.JewelDamageValue = (OInt)json.jdv; this.IsJewelAbsorb = (OBool)(json.jdabs != 0); this.DuplicateCount = (OInt)json.dupli; this.CollaboMainId = json.cs_main_id; this.CollaboHeight = (OInt)json.cs_height; this.KnockBackRate = (OInt)json.kb_rate; this.KnockBackVal = (OInt)json.kb_val; this.DamageDispType = (eDamageDispType)json.dmg_dt; this.ReplaceTargetIdLists.Clear(); if (json.rp_tgt_ids != null) { foreach (string rpTgtId in json.rp_tgt_ids) { this.ReplaceTargetIdLists.Add(rpTgtId); } } this.ReplaceChangeIdLists.Clear(); if (json.rp_chg_ids != null) { foreach (string rpChgId in json.rp_chg_ids) { this.ReplaceChangeIdLists.Add(rpChgId); } } if (this.ReplaceTargetIdLists.Count != this.ReplaceChangeIdLists.Count) { this.ReplaceTargetIdLists.Clear(); this.ReplaceChangeIdLists.Clear(); } this.AbilityReplaceTargetIdLists.Clear(); if (json.ab_rp_tgt_ids != null) { foreach (string abRpTgtId in json.ab_rp_tgt_ids) { this.AbilityReplaceTargetIdLists.Add(abRpTgtId); } } this.AbilityReplaceChangeIdLists.Clear(); if (json.ab_rp_chg_ids != null) { foreach (string abRpChgId in json.ab_rp_chg_ids) { this.AbilityReplaceChangeIdLists.Add(abRpChgId); } } if (this.AbilityReplaceTargetIdLists.Count != this.AbilityReplaceChangeIdLists.Count) { this.AbilityReplaceTargetIdLists.Clear(); this.AbilityReplaceChangeIdLists.Clear(); } this.CollaboVoiceId = json.cs_voice; this.CollaboVoicePlayDelayFrame = json.cs_vp_df; this.flags = (SkillFlags)0; if (json.cutin != 0) { this.flags |= SkillFlags.ExecuteCutin; } if (json.isbtl != 0) { this.flags |= SkillFlags.ExecuteInBattle; } if (json.chran != 0) { this.flags |= SkillFlags.EnableChangeRange; } if (json.sonoba != 0) { this.flags |= SkillFlags.SelfTargetSelect; } if (json.pierce != 0) { this.flags |= SkillFlags.PierceAttack; } if (json.hbonus != 0) { this.flags |= SkillFlags.EnableHeightRangeBonus; } if (json.ehpa != 0) { this.flags |= SkillFlags.EnableHeightParamAdjust; } if (json.utgt != 0) { this.flags |= SkillFlags.EnableUnitLockTarget; } if (json.ctbreak != 0) { this.flags |= SkillFlags.CastBreak; } if (json.mpatk != 0) { this.flags |= SkillFlags.JewelAttack; } if (json.fhit != 0) { this.flags |= SkillFlags.ForceHit; } if (json.suicide != 0) { this.flags |= SkillFlags.Suicide; } this.hp_cost = (OInt)json.hp_cost; this.hp_cost_rate = (OInt)Math.Min(Math.Max(json.hp_cost_rate, 0), 100); this.random_hit_rate = (OInt)json.rhit; this.effect_type = (SkillEffectTypes)json.eff_type; this.effect_calc = (SkillParamCalcTypes)json.eff_calc; this.effect_rate = new SkillRankUpValue(); this.effect_rate.ini = (OInt)json.eff_rate_ini; this.effect_rate.max = (OInt)json.eff_rate_max; this.effect_value = new SkillRankUpValue(); this.effect_value.ini = (OInt)json.eff_val_ini; this.effect_value.max = (OInt)json.eff_val_max; this.effect_range = new SkillRankUpValue(); this.effect_range.ini = (OInt)json.eff_range_ini; this.effect_range.max = (OInt)json.eff_range_max; this.effect_hprate = (OInt)json.eff_hprate; this.effect_mprate = (OInt)json.eff_mprate; this.effect_dead_rate = (OInt)json.eff_durate; this.effect_lvrate = (OInt)json.eff_lvrate; this.attack_type = (AttackTypes)json.atk_type; this.attack_detail = (AttackDetailTypes)json.atk_det; this.element_type = (EElement)json.elem; this.element_value = (SkillRankUpValue)null; if (this.element_type != EElement.None) { this.element_value = new SkillRankUpValue(); this.element_value.ini = (OInt)json.elem_ini; this.element_value.max = (OInt)json.elem_max; } this.cast_type = (ECastTypes)json.ct_type; this.cast_speed = (SkillRankUpValue)null; if (this.type == ESkillType.Skill && (json.ct_spd_ini != 0 || json.ct_spd_max != 0)) { this.cast_speed = new SkillRankUpValue(); this.cast_speed.ini = (OInt)json.ct_spd_ini; this.cast_speed.max = (OInt)json.ct_spd_max; } this.absorb_damage_rate = (OInt)json.abs_d_rate; this.reaction_damage_type = (DamageTypes)json.react_d_type; this.reaction_det_lists.Clear(); if (json.react_dets != null) { foreach (AttackDetailTypes reactDet in json.react_dets) { this.reaction_det_lists.Add(reactDet); } } if (this.reaction_damage_type != DamageTypes.None) { this.control_damage_value = new SkillRankUpValue(); this.control_damage_value.ini = (OInt)json.ctrl_d_ini; this.control_damage_value.max = (OInt)json.ctrl_d_max; this.control_damage_calc = (SkillParamCalcTypes)json.ctrl_d_calc; } this.control_ct_rate = (SkillRankUpValue)null; this.control_ct_value = (SkillRankUpValue)null; if (this.control_ct_calc == SkillParamCalcTypes.Fixed || json.ct_val_ini != 0 || json.ct_val_max != 0) { this.control_ct_rate = new SkillRankUpValue(); this.control_ct_rate.ini = (OInt)json.ct_rate_ini; this.control_ct_rate.max = (OInt)json.ct_rate_max; this.control_ct_value = new SkillRankUpValue(); this.control_ct_value.ini = (OInt)json.ct_val_ini; this.control_ct_value.max = (OInt)json.ct_val_max; this.control_ct_calc = (SkillParamCalcTypes)json.ct_calc; } this.target_buff_iname = json.t_buff; this.target_cond_iname = json.t_cond; this.self_buff_iname = json.s_buff; this.self_cond_iname = json.s_cond; this.shield_type = (ShieldTypes)json.shield_type; this.shield_damage_type = (DamageTypes)json.shield_d_type; this.shield_turn = (SkillRankUpValue)null; this.shield_value = (SkillRankUpValue)null; if (this.shield_type != ShieldTypes.None && this.shield_damage_type != DamageTypes.None) { this.shield_turn = new SkillRankUpValue(); this.shield_turn.ini = (OInt)json.shield_turn_ini; this.shield_turn.max = (OInt)json.shield_turn_max; this.shield_value = new SkillRankUpValue(); this.shield_value.ini = (OInt)json.shield_ini; this.shield_value.max = (OInt)json.shield_max; } SkillEffectTypes effectType = this.effect_type; switch (effectType) { case SkillEffectTypes.Teleport: case SkillEffectTypes.Changing: case SkillEffectTypes.Throw: this.scope = (OInt)0; this.select_scope = ESelectType.Cross; break; case SkillEffectTypes.RateDamage: if (this.attack_type == AttackTypes.None) { this.attack_type = AttackTypes.PhyAttack; break; } break; default: if (effectType == SkillEffectTypes.Attack || effectType == SkillEffectTypes.ReflectDamage) { goto case SkillEffectTypes.RateDamage; } else { break; } } if (this.select_range == ESelectType.Laser) { this.select_scope = ESelectType.Laser; this.scope = (OInt)Math.Max((int)this.scope, 1); } else { switch (this.select_range) { case ESelectType.LaserSpread: this.select_scope = ESelectType.LaserSpread; break; case ESelectType.LaserWide: this.select_scope = ESelectType.LaserWide; break; case ESelectType.LaserTwin: this.select_scope = ESelectType.LaserTwin; break; case ESelectType.LaserTriple: this.select_scope = ESelectType.LaserTriple; break; } switch (this.select_scope) { case ESelectType.LaserSpread: case ESelectType.LaserWide: case ESelectType.LaserTwin: case ESelectType.LaserTriple: this.scope = (OInt)1; break; } } 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); }
public NPCSetting(JSON_MapEnemyUnit json) { this.uniqname = (OString)json.name; this.iname = (OString)json.iname; this.side = (OInt)json.side; this.lv = (OInt)Math.Max(json.lv, 1); this.rare = (OInt)json.rare; this.awake = (OInt)json.awake; this.elem = (OInt)json.elem; this.exp = (OInt)json.exp; this.gems = (OInt)json.gems; this.gold = (OInt)json.gold; this.ai = (OString)json.ai; this.pos.x = (OInt)json.x; this.pos.y = (OInt)json.y; this.dir = (OInt)json.dir; this.search = (OInt)json.search; this.control = (OBool)(json.ctrl != 0); this.trigger = (EventTrigger)null; this.abilities = (EquipAbilitySetting[])null; this.waitEntryClock = (OInt)json.wait_e; this.waitMoveTurn = (OInt)json.wait_m; this.waitExitTurn = (OInt)json.wait_exit; this.startCtCalc = (eMapUnitCtCalcType)json.ct_calc; this.startCtVal = (OInt)json.ct_val; this.DisableFirceVoice = json.fvoff != 0; this.ai_type = (AIActionType)json.ai_type; this.ai_pos.x = (OInt)json.ai_x; this.ai_pos.y = (OInt)json.ai_y; this.ai_len = (OInt)json.ai_len; this.parent = (OString)json.parent; this.fskl = (OString)json.fskl; this.notice_damage = (OInt)json.notice_damage; if (json.notice_members != null) { this.notice_members = new List <OString>(json.notice_members.Length); for (int index = 0; index < json.notice_members.Length; ++index) { if (!string.IsNullOrEmpty(json.notice_members[index])) { this.notice_members.Add((OString)json.notice_members[index]); } } } if (json.trg != null) { this.trigger = new EventTrigger(); this.trigger.Deserialize(json.trg); } if (json.entries != null && json.entries.Length > 0) { this.entries = new List <UnitEntryTrigger>((IEnumerable <UnitEntryTrigger>)json.entries); this.entries_and = (OInt)json.entries_and; } if (json.abils != null && json.abils.Length > 0) { this.abilities = new EquipAbilitySetting[json.abils.Length]; for (int index1 = 0; index1 < json.abils.Length; ++index1) { this.abilities[index1] = new EquipAbilitySetting(); this.abilities[index1].iname = (OString)json.abils[index1].iname; this.abilities[index1].rank = (OInt)json.abils[index1].rank; if (json.abils[index1].skills != null) { this.abilities[index1].skills = new EquipSkillSetting[json.abils[index1].skills.Length]; for (int index2 = 0; index2 < json.abils[index1].skills.Length; ++index2) { this.abilities[index1].skills[index2] = new EquipSkillSetting(); this.abilities[index1].skills[index2].iname = (OString)json.abils[index1].skills[index2].iname; this.abilities[index1].skills[index2].rate = (OInt)json.abils[index1].skills[index2].rate; if (json.abils[index1].skills[index2].cond != null && json.abils[index1].skills[index2].cond.type != 0) { SkillLockCondition dsc = new SkillLockCondition(); json.abils[index1].skills[index2].cond.CopyTo(dsc); this.abilities[index1].skills[index2].cond = dsc; } } } } } if (json.acttbl != null && json.acttbl.actions != null && json.acttbl.actions.Length > 0) { this.acttbl.actions.Clear(); for (int index = 0; index < json.acttbl.actions.Length; ++index) { AIAction aiAction = new AIAction(); aiAction.skill = (OString)json.acttbl.actions[index].skill; aiAction.type = (OInt)json.acttbl.actions[index].type; aiAction.turn = (OInt)json.acttbl.actions[index].turn; aiAction.notBlock = (OBool)(json.acttbl.actions[index].notBlock != 0); if (json.acttbl.actions[index].cond != null && json.acttbl.actions[index].cond.type != 0) { SkillLockCondition dsc = new SkillLockCondition(); json.acttbl.actions[index].cond.CopyTo(dsc); aiAction.cond = dsc; } this.acttbl.actions.Add(aiAction); } this.acttbl.looped = json.acttbl.looped; } if (json.patrol != null && json.patrol.routes != null && json.patrol.routes.Length > 0) { json.patrol.CopyTo(this.patrol); } if (json.break_obj == null) { return; } this.break_obj = new MapBreakObj(); json.break_obj.CopyTo(this.break_obj); }
public bool Deserialize(JSON_FixParam json) { if (json == null) { return(false); } this.ShopUpdateTime = (OInt[])null; this.CriticalRate_Cri_Multiply = (OInt)json.mulcri; this.CriticalRate_Cri_Division = (OInt)json.divcri; this.CriticalRate_Luk_Multiply = (OInt)json.mulluk; this.CriticalRate_Luk_Division = (OInt)json.divluk; this.MinCriticalDamageRate = (OInt)json.mincri; this.MaxCriticalDamageRate = (OInt)json.maxcri; this.HighGridAtkRate = (OInt)json.hatk; this.HighGridDefRate = (OInt)json.hdef; this.HighGridCriRate = (OInt)json.hcri; this.DownGridAtkRate = (OInt)json.datk; this.DownGridDefRate = (OInt)json.ddef; this.DownGridCriRate = (OInt)json.dcri; this.ParalysedRate = (OInt)json.paralyse; this.PoisonDamageRate = (OInt)json.poi_rate; this.BlindnessHitRate = (OInt)json.bli_hit; this.BlindnessAvoidRate = (OInt)json.bli_avo; this.BerserkAtkRate = (OInt)json.ber_atk; this.BerserkDefRate = (OInt)json.ber_def; this.TokkouDamageRate = (OInt)json.tk_rate; this.AbilityRankUpCountCoin = (OInt)json.abilupcoin; this.AbilityRankUpCountMax = (OInt)json.abilupmax; this.AbilityRankUpCountRecoveryVal = (OInt)json.abiluprec; this.AbilityRankUpCountRecoverySec = (OLong)((long)json.abilupsec); this.StaminaRecoveryCoin = (OInt)json.stmncoin; this.StaminaRecoveryVal = (OInt)json.stmnrec; this.StaminaRecoverySec = (OLong)((long)json.stmnsec); this.StaminaStockCap = (OInt)json.stmncap; this.StaminaAdd = (OInt)json.stmnadd; this.StaminaAdd2 = (OInt)json.stmnadd2; this.StaminaAddCost = (OInt[])null; if (json.stmncost != null) { this.StaminaAddCost = new OInt[json.stmncost.Length]; for (int index = 0; index < json.stmncost.Length; ++index) { this.StaminaAddCost[index] = (OInt)json.stmncost[index]; } } this.CaveStaminaMax = (OInt)json.cavemax; this.CaveStaminaRecoveryVal = (OInt)json.caverec; this.CaveStaminaRecoverySec = (OLong)((long)json.cavesec); this.CaveStaminaStockCap = (OInt)json.cavecap; this.CaveStaminaAdd = (OInt)json.caveadd; this.CaveStaminaAddCost = (OInt[])null; if (json.cavecost != null) { this.CaveStaminaAddCost = new OInt[json.cavecost.Length]; for (int index = 0; index < json.cavecost.Length; ++index) { this.CaveStaminaAddCost[index] = (OInt)json.cavecost[index]; } } this.ChallengeArenaMax = (OInt)json.arenamax; this.ChallengeArenaCoolDownSec = (OLong)((long)json.arenasec); this.ArenaMedalMultipler = (OInt)json.arenamedal; this.ArenaCoinRewardMultipler = (OInt)json.arenacoin; this.ArenaResetCooldownCost = (OInt)json.arenaccost; this.ArenaResetTicketCost = (OInt[])null; if (json.arenatcost != null) { this.ArenaResetTicketCost = new OInt[json.arenatcost.Length]; for (int index = 0; index < json.arenatcost.Length; ++index) { this.ArenaResetTicketCost[index] = (OInt)json.arenatcost[index]; } } this.ChallengeTourMax = (OInt)json.tourmax; this.ChallengeMultiMax = (OInt)json.multimax; this.AwakeRate = (OInt)json.awakerate; this.GemsGainNormalAttack = (OInt)json.na_gems; this.GemsGainSideAttack = (OInt)json.sa_gems; this.GemsGainBackAttack = (OInt)json.ba_gems; this.GemsGainWeakAttack = (OInt)json.wa_gems; this.GemsGainCriticalAttack = (OInt)json.ca_gems; this.GemsGainKillBonus = (OInt)json.ki_gems; this.GemsGainDiffFloorCount = (OInt)json.di_gems_floor; this.GemsGainDiffFloorMax = (OInt)json.di_gems_max; this.ElementResistUpRate = (OInt)json.elem_up; this.ElementResistDownRate = (OInt)json.elem_down; this.GemsGainValue = (OInt)json.gems_gain; this.GemsBuffValue = (OInt)json.gems_buff; this.GemsBuffTurn = (OInt)json.gems_buff_turn; this.ContinueCoinCost = (OInt)json.continue_cost; this.ContinueCoinCostMulti = (OInt)json.continue_cost_multi; this.ContinueCoinCostMultiTower = (OInt)json.continue_cost_multitower; this.AvoidBaseRate = (OInt)json.avoid_rate; this.AvoidParamScale = (OInt)json.avoid_scale; this.MaxAvoidRate = (OInt)json.avoid_rate_max; if (json.shop_update_time != null && json.shop_update_time.Length > 0) { this.ShopUpdateTime = new OInt[json.shop_update_time.Length]; for (int index = 0; index < this.ShopUpdateTime.Length; ++index) { this.ShopUpdateTime[index] = (OInt)json.shop_update_time[index]; } } if (json.products != null && json.products.Length > 0) { this.Products = new OString[json.products.Length]; for (int index = 0; index < this.Products.Length; ++index) { this.Products[index] = (OString)json.products[index]; } } this.VipCardProduct = (OString)json.vip_product; this.VipCardDate = (OInt)json.vip_date; this.FreeGachaGoldMax = (OInt)json.ggmax; this.FreeGachaGoldCoolDownSec = (OLong)((long)json.ggsec); this.FreeGachaCoinCoolDownSec = (OLong)((long)json.cgsec); this.BuyGoldCost = (OInt)json.buygoldcost; this.BuyGoldAmount = (OInt)json.buygold; this.SupportCost = (OInt)json.sp_cost; this.ChallengeEliteMax = (OInt)json.elitemax; this.EliteResetMax = (OInt)json.elite_reset_max; if (json.elite_reset_cost != null && json.elite_reset_cost.Length > 0) { this.EliteResetCosts = new OInt[json.elite_reset_cost.Length]; for (int index = 0; index < this.EliteResetCosts.Length; ++index) { this.EliteResetCosts[index] = (OInt)json.elite_reset_cost[index]; } } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.Poison)) { this.DefaultCondTurns.Add(EUnitCondition.Poison, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.Paralysed)) { this.DefaultCondTurns.Add(EUnitCondition.Paralysed, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.Stun)) { this.DefaultCondTurns.Add(EUnitCondition.Stun, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.Sleep)) { this.DefaultCondTurns.Add(EUnitCondition.Sleep, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.Charm)) { this.DefaultCondTurns.Add(EUnitCondition.Charm, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.Stone)) { this.DefaultCondTurns.Add(EUnitCondition.Stone, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.Blindness)) { this.DefaultCondTurns.Add(EUnitCondition.Blindness, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableSkill)) { this.DefaultCondTurns.Add(EUnitCondition.DisableSkill, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableMove)) { this.DefaultCondTurns.Add(EUnitCondition.DisableMove, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableAttack)) { this.DefaultCondTurns.Add(EUnitCondition.DisableAttack, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.Zombie)) { this.DefaultCondTurns.Add(EUnitCondition.Zombie, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DeathSentence)) { this.DefaultCondTurns.Add(EUnitCondition.DeathSentence, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.Berserk)) { this.DefaultCondTurns.Add(EUnitCondition.Berserk, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableKnockback)) { this.DefaultCondTurns.Add(EUnitCondition.DisableKnockback, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableBuff)) { this.DefaultCondTurns.Add(EUnitCondition.DisableBuff, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableDebuff)) { this.DefaultCondTurns.Add(EUnitCondition.DisableDebuff, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.Stop)) { this.DefaultCondTurns.Add(EUnitCondition.Stop, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.Fast)) { this.DefaultCondTurns.Add(EUnitCondition.Fast, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.Slow)) { this.DefaultCondTurns.Add(EUnitCondition.Slow, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.AutoHeal)) { this.DefaultCondTurns.Add(EUnitCondition.AutoHeal, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.Donsoku)) { this.DefaultCondTurns.Add(EUnitCondition.Donsoku, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.Rage)) { this.DefaultCondTurns.Add(EUnitCondition.Rage, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.GoodSleep)) { this.DefaultCondTurns.Add(EUnitCondition.GoodSleep, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.AutoJewel)) { this.DefaultCondTurns.Add(EUnitCondition.AutoJewel, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableHeal)) { this.DefaultCondTurns.Add(EUnitCondition.DisableHeal, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableSingleAttack)) { this.DefaultCondTurns.Add(EUnitCondition.DisableSingleAttack, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableAreaAttack)) { this.DefaultCondTurns.Add(EUnitCondition.DisableAreaAttack, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableDecCT)) { this.DefaultCondTurns.Add(EUnitCondition.DisableDecCT, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableIncCT)) { this.DefaultCondTurns.Add(EUnitCondition.DisableIncCT, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableEsaFire)) { this.DefaultCondTurns.Add(EUnitCondition.DisableEsaFire, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableEsaWater)) { this.DefaultCondTurns.Add(EUnitCondition.DisableEsaWater, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableEsaWind)) { this.DefaultCondTurns.Add(EUnitCondition.DisableEsaWind, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableEsaThunder)) { this.DefaultCondTurns.Add(EUnitCondition.DisableEsaThunder, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableEsaShine)) { this.DefaultCondTurns.Add(EUnitCondition.DisableEsaShine, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableEsaDark)) { this.DefaultCondTurns.Add(EUnitCondition.DisableEsaDark, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableMaxDamageHp)) { this.DefaultCondTurns.Add(EUnitCondition.DisableMaxDamageHp, (OInt)0); } if (!this.DefaultCondTurns.ContainsKey(EUnitCondition.DisableMaxDamageMp)) { this.DefaultCondTurns.Add(EUnitCondition.DisableMaxDamageMp, (OInt)0); } this.DefaultCondTurns[EUnitCondition.Poison] = (OInt)json.ct_poi; this.DefaultCondTurns[EUnitCondition.Paralysed] = (OInt)json.ct_par; this.DefaultCondTurns[EUnitCondition.Stun] = (OInt)json.ct_stu; this.DefaultCondTurns[EUnitCondition.Sleep] = (OInt)json.ct_sle; this.DefaultCondTurns[EUnitCondition.Charm] = (OInt)json.st_cha; this.DefaultCondTurns[EUnitCondition.Stone] = (OInt)json.ct_sto; this.DefaultCondTurns[EUnitCondition.Blindness] = (OInt)json.ct_bli; this.DefaultCondTurns[EUnitCondition.DisableSkill] = (OInt)json.ct_dsk; this.DefaultCondTurns[EUnitCondition.DisableMove] = (OInt)json.ct_dmo; this.DefaultCondTurns[EUnitCondition.DisableAttack] = (OInt)json.ct_dat; this.DefaultCondTurns[EUnitCondition.Zombie] = (OInt)json.ct_zom; this.DefaultCondTurns[EUnitCondition.DeathSentence] = (OInt)json.ct_dea; this.DefaultCondTurns[EUnitCondition.Berserk] = (OInt)json.ct_ber; this.DefaultCondTurns[EUnitCondition.DisableKnockback] = (OInt)json.ct_dkn; this.DefaultCondTurns[EUnitCondition.DisableBuff] = (OInt)json.ct_dbu; this.DefaultCondTurns[EUnitCondition.DisableDebuff] = (OInt)json.ct_ddb; this.DefaultCondTurns[EUnitCondition.Stop] = (OInt)json.ct_stop; this.DefaultCondTurns[EUnitCondition.Fast] = (OInt)json.ct_fast; this.DefaultCondTurns[EUnitCondition.Slow] = (OInt)json.ct_slow; this.DefaultCondTurns[EUnitCondition.AutoHeal] = (OInt)json.ct_ahe; this.DefaultCondTurns[EUnitCondition.Donsoku] = (OInt)json.ct_don; this.DefaultCondTurns[EUnitCondition.Rage] = (OInt)json.ct_rag; this.DefaultCondTurns[EUnitCondition.GoodSleep] = (OInt)json.ct_gsl; this.DefaultCondTurns[EUnitCondition.AutoJewel] = (OInt)json.ct_aje; this.DefaultCondTurns[EUnitCondition.DisableHeal] = (OInt)json.ct_dhe; this.DefaultCondTurns[EUnitCondition.DisableSingleAttack] = (OInt)json.ct_dsa; this.DefaultCondTurns[EUnitCondition.DisableAreaAttack] = (OInt)json.ct_daa; this.DefaultCondTurns[EUnitCondition.DisableDecCT] = (OInt)json.ct_ddc; this.DefaultCondTurns[EUnitCondition.DisableIncCT] = (OInt)json.ct_dic; this.DefaultCondTurns[EUnitCondition.DisableEsaFire] = (OInt)json.ct_esa; this.DefaultCondTurns[EUnitCondition.DisableEsaWater] = (OInt)json.ct_esa; this.DefaultCondTurns[EUnitCondition.DisableEsaWind] = (OInt)json.ct_esa; this.DefaultCondTurns[EUnitCondition.DisableEsaThunder] = (OInt)json.ct_esa; this.DefaultCondTurns[EUnitCondition.DisableEsaShine] = (OInt)json.ct_esa; this.DefaultCondTurns[EUnitCondition.DisableEsaDark] = (OInt)json.ct_esa; this.DefaultCondTurns[EUnitCondition.DisableMaxDamageHp] = (OInt)json.ct_mdh; this.DefaultCondTurns[EUnitCondition.DisableMaxDamageMp] = (OInt)json.ct_mdm; this.RandomEffectMax = (OInt)json.yuragi; this.ChargeTimeMax = (OInt)json.ct_max; this.ChargeTimeDecWait = (OInt)json.ct_wait; this.ChargeTimeDecMove = (OInt)json.ct_mov; this.ChargeTimeDecAction = (OInt)json.ct_act; this.AddHitRateSide = (OInt)json.hit_side; this.AddHitRateBack = (OInt)json.hit_back; this.HpAutoHealRate = (OInt)json.ahhp_rate; this.MpAutoHealRate = (OInt)json.ahmp_rate; this.GoodSleepHpHealRate = (OInt)json.gshp_rate; this.GoodSleepMpHealRate = (OInt)json.gsmp_rate; this.HpDyingRate = (OInt)json.dy_rate; this.ZeneiSupportSkillRate = (OInt)json.zsup_rate; this.BeginnerDays = (OInt)json.beginner_days; this.ArtifactBoxCap = (OInt)json.afcap; this.CommonPieceFire = (OString)json.cmn_pi_fire; this.CommonPieceWater = (OString)json.cmn_pi_water; this.CommonPieceThunder = (OString)json.cmn_pi_thunder; this.CommonPieceWind = (OString)json.cmn_pi_wind; this.CommonPieceShine = (OString)json.cmn_pi_shine; this.CommonPieceDark = (OString)json.cmn_pi_dark; this.CommonPieceAll = (OString)json.cmn_pi_all; this.PartyNumNormal = json.ptnum_nml; this.PartyNumEvent = json.ptnum_evnt; this.PartyNumMulti = json.ptnum_mlt; this.PartyNumArenaAttack = json.ptnum_aatk; this.PartyNumArenaDefense = json.ptnum_adef; this.PartyNumChQuest = json.ptnum_chq; this.PartyNumTower = json.ptnum_tow; this.PartyNumVersus = json.ptnum_vs; this.PartyNumMultiTower = json.ptnum_mt; this.PartyNumOrdeal = json.ptnum_ordeal; this.IsDisableSuspend = (OBool)(json.notsus != 0); this.SuspendSaveInterval = (OInt)json.sus_int; this.IsJobMaster = json.jobms != 0; this.DefaultDeathCount = (OInt)json.death_count; this.DefaultClockUpValue = (OInt)json.fast_val; this.DefaultClockDownValue = (OInt)json.slow_val; if (json.equip_artifact_slot_unlock != null && json.equip_artifact_slot_unlock.Length > 0) { this.EquipArtifactSlotUnlock = new OInt[json.equip_artifact_slot_unlock.Length]; for (int index = 0; index < json.equip_artifact_slot_unlock.Length; ++index) { this.EquipArtifactSlotUnlock[index] = (OInt)json.equip_artifact_slot_unlock[index]; } } this.KnockBackHeight = (OInt)json.kb_gh; this.ThrowHeight = (OInt)json.th_gh; if (json.art_rare_pi != null) { this.ArtifactRarePiece = new OString[json.art_rare_pi.Length]; for (int index = 0; index < this.ArtifactRarePiece.Length; ++index) { this.ArtifactRarePiece[index] = (OString)json.art_rare_pi[index]; } } this.ArtifactCommonPiece = (OString)json.art_cmn_pi; this.SoulCommonPiece = this.ConvertOStringArray(json.soul_rare); this.EquipCommonPiece = this.ConvertOStringArray(json.equ_rare_pi); this.EquipCommonPieceNum = this.ConvertOIntArray(json.equ_rare_pi_use); this.EquipCommonPieceCost = this.ConvertOIntArray(json.equ_rare_cost); this.EquipCmn = this.ConvertOStringArray(json.equip_cmn); this.AudienceMax = (OInt)json.aud_max; this.AbilityRankUpPointMax = (OInt)json.ab_rankup_max; this.AbilityRankUpPointAddMax = (OInt)json.ab_rankup_addmax; this.AbilityRankupPointCoinRate = (OInt)json.ab_coin_convert; this.FirstFriendMax = (OInt)json.firstfriend_max; this.FirstFriendCoin = (OInt)json.firstfriend_coin; this.CombinationRate = (OInt)json.cmb_rate; this.WeakUpRate = (OInt)json.weak_up; this.ResistDownRate = (OInt)json.resist_dw; this.OrdealCT = (OInt)json.ordeal_ct; this.EsaAssist = (OInt)json.esa_assist; this.EsaResist = (OInt)json.esa_resist; this.CardSellMul = json.card_sell_mul; this.CardExpMul = json.card_exp_mul; this.CardMax = (OInt)json.card_max; this.CardTrustMax = (OInt)json.card_trust_max; this.CardTrustPileUp = (OInt)json.card_trust_en_bonus; this.CardAwakeUnlockLevelCap = (OInt)json.card_awake_unlock_lvcap; this.TobiraLvCap = (OInt)json.tobira_lv_cap; this.TobiraUnitLvCapBonus = (OInt)json.tobira_unit_lv_cap; this.TobiraUnlockElem = new OString[json.tobira_unlock_elem.Length]; for (int index = 0; index < this.TobiraUnlockElem.Length; ++index) { this.TobiraUnlockElem[index] = (OString)json.tobira_unlock_elem[index]; } this.TobiraUnlockBirth = new OString[json.tobira_unlock_birth.Length]; for (int index = 0; index < this.TobiraUnlockBirth.Length; ++index) { this.TobiraUnlockBirth[index] = (OString)json.tobira_unlock_birth[index]; } this.IniValRec = (OInt)json.ini_rec; this.GuerrillaVal = (OInt)json.guerrilla_val; this.DraftSelectSeconds = (OInt)json.draft_select_sec; this.DraftOrganizeSeconds = (OInt)json.draft_organize_sec; this.DraftPlaceSeconds = (OInt)json.draft_place_sec; return(true); }
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); }