public void Deserialize(Json_Artifact json) { if (json == null || string.IsNullOrEmpty(json.iname)) { this.Reset(); } else { GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect(); this.mArtifactParam = instanceDirect.MasterParam.GetArtifactParam(json.iname); this.mUniqueID = (OLong)json.iid; this.mRarity = (OInt)Math.Min(Math.Max(json.rare, this.mArtifactParam.rareini), this.mArtifactParam.raremax); this.mRarityParam = instanceDirect.GetRarityParam((int)this.mRarity); this.mExp = (OInt)json.exp; this.mLv = (OInt)this.GetLevelFromExp((int)this.mExp); this.mFavorite = json.fav != 0; this.UpdateEquipEffect(); this.UpdateLearningAbilities(false); } }
public bool Deserialize(JSON_EvaluationParam json) { if (json == null) { return(false); } this.iname = json.iname; this.value = (OInt)json.val; this.status.Clear(); this.status.hp = (OInt)json.hp; this.status.mp = (OShort)json.mp; this.status.atk = (OShort)json.atk; this.status.def = (OShort)json.def; this.status.mag = (OShort)json.mag; this.status.mnd = (OShort)json.mnd; this.status.dex = (OShort)json.dex; this.status.spd = (OShort)json.spd; this.status.cri = (OShort)json.cri; this.status.luk = (OShort)json.luk; return(true); }
private void SetBuffValue(BuffTypes type, ref OInt param, int value) { switch (type) { case BuffTypes.Buff: if ((int)param >= value) { break; } param = (OInt)value; break; case BuffTypes.Debuff: if ((int)param <= value) { break; } param = (OInt)value; break; } }
public bool Deserialize(JSON_ItemParam json) { if (json == null) { return(false); } this.iname = json.iname; this.name = json.name; this.expr = json.expr; this.flavor = json.flavor; this.type = (EItemType)json.type; this.rare = (OInt)json.rare; this.cap = (OInt)json.cap; this.invcap = (OInt)json.invcap; this.equipLv = (OInt)Math.Max(json.eqlv, 1); this.coin = (OInt)json.coin; this.tour_coin = (OInt)json.tc; this.arena_coin = (OInt)json.ac; this.multi_coin = (OInt)json.mc; this.piece_point = (OInt)json.pp; this.buy = (OInt)json.buy; this.sell = (OInt)json.sell; this.enhace_cost = (OInt)json.encost; this.enhace_point = (OInt)json.enpt; this.value = (OInt)json.val; this.icon = (OString)json.icon; this.skill = (OString)json.skill; this.recipe = json.recipe; this.quests = (string[])null; if (json.quests != null) { this.quests = new string[json.quests.Length]; for (int index = 0; index < json.quests.Length; ++index) { this.quests[index] = json.quests[index]; } } return(true); }
public void SubValue(int subval) { this.at = (OLong)Network.GetServerTime(); this.val = (OInt)Math.Max((int)this.val - subval, 0); }
public bool Deserialize(JSON_JobRankParam json) { if (json == null) { return(false); } this.JobChangeCost = json.chcost; this.JobChangeItems[0] = json.chitm1; this.JobChangeItems[1] = json.chitm2; this.JobChangeItems[2] = json.chitm3; this.JobChangeItemNums[0] = json.chnum1; this.JobChangeItemNums[1] = json.chnum2; this.JobChangeItemNums[2] = json.chnum3; this.cost = json.cost; this.equips[0] = json.eqid1; this.equips[1] = json.eqid2; this.equips[2] = json.eqid3; this.equips[3] = json.eqid4; this.equips[4] = json.eqid5; this.equips[5] = json.eqid6; this.status.hp = (OInt)json.hp; this.status.mp = (OShort)json.mp; this.status.atk = (OShort)json.atk; this.status.def = (OShort)json.def; this.status.mag = (OShort)json.mag; this.status.mnd = (OShort)json.mnd; this.status.dex = (OShort)json.dex; this.status.spd = (OShort)json.spd; this.status.cri = (OShort)json.cri; this.status.luk = (OShort)json.luk; this.avoid = (OInt)json.avoid; this.inimp = (OInt)json.inimp; this.learnings = (OString[])null; int length = 0; if (!string.IsNullOrEmpty(json.learn1)) { ++length; } if (!string.IsNullOrEmpty(json.learn2)) { ++length; } if (!string.IsNullOrEmpty(json.learn3)) { ++length; } if (length > 0) { this.learnings = new OString[length]; int num1 = 0; if (!string.IsNullOrEmpty(json.learn1)) { this.learnings[num1++] = (OString)json.learn1; } if (!string.IsNullOrEmpty(json.learn2)) { this.learnings[num1++] = (OString)json.learn2; } if (!string.IsNullOrEmpty(json.learn3)) { OString[] learnings = this.learnings; int index = num1; int num2 = index + 1; learnings[index] = (OString)json.learn3; } } return(true); }
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_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); }
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 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); }
public UnitSubSetting(JSON_MapPartySubCT json) { this.startCtCalc = (eMapUnitCtCalcType)json.ct_calc; this.startCtVal = (OInt)json.ct_val; }
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)(1L << json.conds[index]); } } } this.BuffIds = (string[])null; if (json.buffs != null) { this.BuffIds = new string[json.buffs.Length]; for (int index = 0; index < json.buffs.Length; ++index) { this.BuffIds[index] = json.buffs[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 OInt this[EUnitCondition condition] { get { EUnitCondition eunitCondition = condition; switch (eunitCondition) { case EUnitCondition.Poison: return(this.poison); case EUnitCondition.Paralysed: return(this.paralyse); case EUnitCondition.Stun: return(this.stun); case EUnitCondition.Sleep: return(this.sleep); default: if (eunitCondition == EUnitCondition.Charm) { return(this.charm); } if (eunitCondition == EUnitCondition.Stone) { return(this.stone); } if (eunitCondition == EUnitCondition.Blindness) { return(this.blind); } if (eunitCondition == EUnitCondition.DisableSkill) { return(this.notskl); } if (eunitCondition == EUnitCondition.DisableMove) { return(this.notmov); } if (eunitCondition == EUnitCondition.DisableAttack) { return(this.notatk); } if (eunitCondition == EUnitCondition.Zombie) { return(this.zombie); } if (eunitCondition == EUnitCondition.DeathSentence) { return(this.death); } if (eunitCondition == EUnitCondition.Berserk) { return(this.berserk); } if (eunitCondition == EUnitCondition.Stop) { return(this.stop); } if (eunitCondition == EUnitCondition.Fast) { return(this.fast); } if (eunitCondition == EUnitCondition.Slow) { return(this.slow); } if (eunitCondition == EUnitCondition.AutoHeal) { return(this.auto_heal); } if (eunitCondition == EUnitCondition.Donsoku) { return(this.donsoku); } if (eunitCondition == EUnitCondition.Rage) { return(this.rage); } if (eunitCondition == EUnitCondition.GoodSleep) { return(this.good_sleep); } if (eunitCondition == EUnitCondition.AutoJewel) { return(this.auto_jewel); } if (eunitCondition == EUnitCondition.DisableHeal) { return(this.notheal); } return((OInt)0); } } set { EUnitCondition eunitCondition = condition; switch (eunitCondition) { case EUnitCondition.Poison: this.poison = value; break; case EUnitCondition.Paralysed: this.paralyse = value; break; case EUnitCondition.Stun: this.stun = value; break; case EUnitCondition.Sleep: this.sleep = value; break; default: if (eunitCondition != EUnitCondition.Charm) { if (eunitCondition != EUnitCondition.Stone) { if (eunitCondition != EUnitCondition.Blindness) { if (eunitCondition != EUnitCondition.DisableSkill) { if (eunitCondition != EUnitCondition.DisableMove) { if (eunitCondition != EUnitCondition.DisableAttack) { if (eunitCondition != EUnitCondition.Zombie) { if (eunitCondition != EUnitCondition.DeathSentence) { if (eunitCondition != EUnitCondition.Berserk) { if (eunitCondition != EUnitCondition.Stop) { if (eunitCondition != EUnitCondition.Fast) { if (eunitCondition != EUnitCondition.Slow) { if (eunitCondition != EUnitCondition.AutoHeal) { if (eunitCondition != EUnitCondition.Donsoku) { if (eunitCondition != EUnitCondition.Rage) { if (eunitCondition != EUnitCondition.GoodSleep) { if (eunitCondition != EUnitCondition.AutoJewel) { if (eunitCondition != EUnitCondition.DisableHeal) { break; } this.notheal = value; break; } this.auto_jewel = value; break; } this.good_sleep = value; break; } this.rage = value; break; } this.donsoku = value; break; } this.auto_heal = value; break; } this.slow = value; break; } this.fast = value; break; } this.stop = value; break; } this.berserk = value; break; } this.death = value; break; } this.zombie = value; break; } this.notatk = value; break; } this.notmov = value; break; } this.notskl = value; break; } this.blind = value; break; } this.stone = value; break; } this.charm = value; break; } } }
public OIntVector2(int a, int b) { this.x = (OInt)a; this.y = (OInt)b; }
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_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 void Deserialize(JSON_VersusTowerParam json) { if (json == null) { return; } this.VersusTowerID = (OString)json.vstower_id; this.FloorName = (OString)json.iname; this.Floor = (OInt)json.floor; this.RankupNum = (OInt)json.rankup_num; this.WinNum = (OInt)json.win_num; this.LoseNum = (OInt)json.lose_num; this.BonusNum = (OInt)json.bonus_num; this.DownFloor = (OInt)json.downfloor; this.ResetFloor = (OInt)json.resetfloor; if (json.winitem != null && json.win_itemnum != null) { if (json.winitem.Length != json.win_itemnum.Length) { Debug.LogError((object)"VersusTower Param [ WinItem ] is Invalid"); } this.WinIteminame = new OString[json.winitem.Length]; this.WinItemNum = new OInt[json.win_itemnum.Length]; for (int index = 0; index < json.winitem.Length; ++index) { this.WinIteminame[index] = (OString)json.winitem[index]; } for (int index = 0; index < json.win_itemnum.Length; ++index) { this.WinItemNum[index] = (OInt)json.win_itemnum[index]; } } if (json.joinitem != null && json.join_itemnum != null) { if (json.joinitem.Length != json.join_itemnum.Length) { Debug.LogError((object)"VersusTower Param [ LoseItem ] is Invalid"); } this.JoinIteminame = new OString[json.joinitem.Length]; this.JoinItemNum = new OInt[json.join_itemnum.Length]; for (int index = 0; index < json.joinitem.Length; ++index) { this.JoinIteminame[index] = (OString)json.joinitem[index]; } for (int index = 0; index < json.join_itemnum.Length; ++index) { this.JoinItemNum[index] = (OInt)json.join_itemnum[index]; } } if (json.spbtl_item != null && json.spbtl_itemnum != null) { if (json.spbtl_item.Length != json.spbtl_itemnum.Length) { Debug.LogError((object)"VersusTower Param [ SpecialItem ] is Invalid"); } this.SpIteminame = new OString[json.spbtl_item.Length]; this.SpItemnum = new OInt[json.spbtl_itemnum.Length]; for (int index = 0; index < json.spbtl_item.Length; ++index) { this.SpIteminame[index] = (OString)json.spbtl_item[index]; } for (int index = 0; index < json.spbtl_itemnum.Length; ++index) { this.SpItemnum[index] = (OInt)json.spbtl_itemnum[index]; } } if (json.season_item != null && json.season_itemnum != null && json.season_itype != null) { if (json.season_item.Length != json.season_itemnum.Length) { Debug.LogError((object)"VersusTower Param [ SeasonItem ] is Invalid"); } this.SeasonIteminame = new OString[json.season_item.Length]; this.SeasonItemType = new VERSUS_ITEM_TYPE[json.season_itype.Length]; this.SeasonItemnum = new OInt[json.season_itemnum.Length]; for (int index = 0; index < json.season_item.Length; ++index) { this.SeasonIteminame[index] = (OString)json.season_item[index]; } for (int index = 0; index < json.season_itype.Length; ++index) { this.SeasonItemType[index] = (VERSUS_ITEM_TYPE)Enum.Parse(typeof(VERSUS_ITEM_TYPE), json.season_itype[index], true); } for (int index = 0; index < json.season_itemnum.Length; ++index) { this.SeasonItemnum[index] = (OInt)json.season_itemnum[index]; } } if (string.IsNullOrEmpty(json.arrival_item)) { return; } this.ArrivalIteminame = (OString)json.arrival_item; this.ArrivalItemType = (VERSUS_ITEM_TYPE)Enum.Parse(typeof(VERSUS_ITEM_TYPE), json.arrival_type, true); this.ArrivalItemNum = (OInt)json.arrival_num; }