示例#1
0
 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;
 }
示例#2
0
 public bool IsReactionDet(AttackDetailTypes atk_detail_type)
 {
     if (this.mSkillParam == null)
     {
         return(false);
     }
     return(this.mSkillParam.IsReactionDet(atk_detail_type));
 }
示例#3
0
        public void SetAtkDetail(AttackDetailTypes atk_detail, BattleUnitDetailAtkDetail.eType type, BattleUnitDetail.eBudFluct fluct)
        {
            if (Object.op_Implicit((Object)this.ImageAtkDetail))
            {
                int num = (int)atk_detail;
                if (num >= 0 && num < this.ImageAtkDetail.Images.Length)
                {
                    this.ImageAtkDetail.ImageIndex = num;
                }
            }
            if (Object.op_Implicit((Object)this.GoResist))
            {
                this.GoResist.SetActive(false);
            }
            if (Object.op_Implicit((Object)this.GoAvoid))
            {
                this.GoAvoid.SetActive(false);
            }
            switch (type)
            {
            case BattleUnitDetailAtkDetail.eType.RESIST:
                if (Object.op_Implicit((Object)this.GoResist))
                {
                    this.GoResist.SetActive(true);
                    break;
                }
                break;

            case BattleUnitDetailAtkDetail.eType.AVOID:
                if (Object.op_Implicit((Object)this.GoAvoid))
                {
                    this.GoAvoid.SetActive(true);
                    break;
                }
                break;
            }
            if (Object.op_Implicit((Object)this.ImageFluct))
            {
                int num = (int)fluct;
                if (num < this.ImageFluct.Images.Length)
                {
                    this.ImageFluct.ImageIndex = num;
                }
            }
            if (!Object.op_Implicit((Object)this.TextValue))
            {
                return;
            }
            StringBuilder sb = new StringBuilder(64);

            sb.Length = 0;
            sb.Append(LocalizedText.Get(BattleUnitDetailAtkDetail.mStrAtkDetails[(int)atk_detail]) + (object)' ');
            sb.Append(LocalizedText.Get(BattleUnitDetailAtkDetail.mStrTypes[(int)type]));
            this.AddUpDownText(sb, fluct);
            this.TextValue.set_text(sb.ToString());
        }
示例#4
0
 public bool IsReactionDet(AttackDetailTypes atk_detail_type)
 {
     return(this.reaction_det_lists == null || this.reaction_det_lists.Count == 0 || this.reaction_det_lists.Contains(atk_detail_type));
 }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
示例#7
0
        public static UnitListFilterWindow.SelectType GetFilterMask(UnitListWindow.Data data)
        {
            if (data.param == null)
            {
                return(UnitListFilterWindow.SelectType.RARITY_1 | UnitListFilterWindow.SelectType.RARITY_2 | UnitListFilterWindow.SelectType.RARITY_3 | UnitListFilterWindow.SelectType.RARITY_4 | UnitListFilterWindow.SelectType.RARITY_5 | UnitListFilterWindow.SelectType.WEAPON_SLASH | UnitListFilterWindow.SelectType.WEAPON_STAB | UnitListFilterWindow.SelectType.WEAPON_BLOW | UnitListFilterWindow.SelectType.WEAPON_SHOT | UnitListFilterWindow.SelectType.WEAPON_MAG | UnitListFilterWindow.SelectType.WEAPON_NONE | UnitListFilterWindow.SelectType.BIRTH_ENV | UnitListFilterWindow.SelectType.BIRTH_WRATH | UnitListFilterWindow.SelectType.BIRTH_SAGA | UnitListFilterWindow.SelectType.BIRTH_SLOTH | UnitListFilterWindow.SelectType.BIRTH_LUST | UnitListFilterWindow.SelectType.BIRTH_WADATSUMI | UnitListFilterWindow.SelectType.BIRTH_DESERT | UnitListFilterWindow.SelectType.BIRTH_GREED | UnitListFilterWindow.SelectType.BIRTH_GLUTTONY | UnitListFilterWindow.SelectType.BIRTH_OTHER | UnitListFilterWindow.SelectType.BIRTH_NOZ);
            }
            MasterParam masterParam = MonoSingleton <GameManager> .Instance.MasterParam;
            UnitParam   unitParam   = data.param;

            UnitListFilterWindow.SelectType selectType = UnitListFilterWindow.SelectType.NONE;
            AttackDetailTypes attackDetailTypes        = AttackDetailTypes.None;

            if (data.unit != null)
            {
                UnitData unit = data.unit;
                if (unit.CurrentJob.GetAttackSkill() != null)
                {
                    attackDetailTypes = unit.CurrentJob.GetAttackSkill().AttackDetailType;
                }
                if (unit.Rarity == 0)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_1;
                }
                else if (unit.Rarity == 1)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_2;
                }
                else if (unit.Rarity == 2)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_3;
                }
                else if (unit.Rarity == 3)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_4;
                }
                else if (unit.Rarity == 4)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_5;
                }
                else if (unit.Rarity == 5)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_6;
                }
            }
            else
            {
                if (unitParam.jobsets != null && unitParam.jobsets.Length > 0)
                {
                    JobSetParam jobSetParam = MonoSingleton <GameManager> .Instance.GetJobSetParam(unitParam.jobsets[0]);

                    if (jobSetParam != null)
                    {
                        JobParam jobParam = MonoSingleton <GameManager> .Instance.GetJobParam(jobSetParam.job);

                        if (jobParam != null && jobParam.atkskill != null && jobParam.atkskill.Length > 0)
                        {
                            string key = jobParam.atkskill[0];
                            if (!string.IsNullOrEmpty(key))
                            {
                                SkillParam skillParam = masterParam.GetSkillParam(key);
                                if (skillParam != null)
                                {
                                    attackDetailTypes = skillParam.attack_detail;
                                }
                            }
                        }
                    }
                }
                if (unitParam.rare == (byte)0)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_1;
                }
                else if (unitParam.rare == (byte)1)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_2;
                }
                else if (unitParam.rare == (byte)2)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_3;
                }
                else if (unitParam.rare == (byte)3)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_4;
                }
                else if (unitParam.rare == (byte)4)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_5;
                }
                else if (unitParam.rare == (byte)5)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_6;
                }
            }
            switch (attackDetailTypes)
            {
            case AttackDetailTypes.None:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_NONE;
                break;

            case AttackDetailTypes.Slash:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_SLASH;
                break;

            case AttackDetailTypes.Stab:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_STAB;
                break;

            case AttackDetailTypes.Blow:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_BLOW;
                break;

            case AttackDetailTypes.Shot:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_SHOT;
                break;

            case AttackDetailTypes.Magic:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_MAG;
                break;
            }
            if (!string.IsNullOrEmpty((string)unitParam.birth))
            {
                string birth = (string)unitParam.birth;
                if (birth == "エンヴィリア")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_ENV;
                }
                else if (birth == "ラーストリス")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_WRATH;
                }
                else if (birth == "サガ地方")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_SAGA;
                }
                else if (birth == "スロウスシュタイン")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_SLOTH;
                }
                else if (birth == "ルストブルグ")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_LUST;
                }
                else if (birth == "ワダツミ")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_WADATSUMI;
                }
                else if (birth == "砂漠地帯")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_DESERT;
                }
                else if (birth == "グリードダイク")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_GREED;
                }
                else if (birth == "グラトニー=フォス")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_GLUTTONY;
                }
                else if (birth == "その他")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_OTHER;
                }
                else if (birth == "ノーザンブライド")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_NOZ;
                }
            }
            return(selectType);
        }
示例#8
0
        public static void FilterUnitsRevert(List <UnitData> units, List <int> sortValues, string[] filter)
        {
            if (filter == null)
            {
                return;
            }
            int           num1       = 0;
            int           num2       = 0;
            int           num3       = 0;
            List <string> stringList = new List <string>();
            string        s          = (string)null;

            for (int index = 0; index < filter.Length; ++index)
            {
                if (UnitListV2.GetValue(filter[index], "RARE:", ref s))
                {
                    int result;
                    if (int.TryParse(s, out result))
                    {
                        num1 |= 1 << result;
                    }
                }
                else if (UnitListV2.GetValue(filter[index], "ELEM:", ref s))
                {
                    try
                    {
                        EElement eelement = (EElement)Enum.Parse(typeof(EElement), s, true);
                        num2 |= 1 << (int)(eelement & (EElement)31 & (EElement)31);
                    }
                    catch
                    {
                        if (GameUtility.IsDebugBuild)
                        {
                            Debug.LogError((object)("Unknown element type: " + s));
                        }
                    }
                }
                else if (UnitListV2.GetValue(filter[index], "WEAPON:", ref s))
                {
                    try
                    {
                        AttackDetailTypes attackDetailTypes = (AttackDetailTypes)Enum.Parse(typeof(AttackDetailTypes), s, true);
                        num3 |= 1 << (int)(attackDetailTypes & (AttackDetailTypes)31 & (AttackDetailTypes)31);
                    }
                    catch
                    {
                        if (GameUtility.IsDebugBuild)
                        {
                            Debug.LogError((object)("Unknown weapon type: " + s));
                        }
                    }
                }
                else if (UnitListV2.GetValue(filter[index], "BIRTH:", ref s))
                {
                    stringList.Add(s);
                }
            }
            for (int index = units.Count - 1; index >= 0; --index)
            {
                UnitData unit = units[index];
                if ((1 << unit.Rarity & num1) != 0 || (1 << (int)(unit.Element & (EElement)31) & num2) != 0 || (unit.CurrentJob.GetAttackSkill() == null || (1 << (int)(unit.CurrentJob.GetAttackSkill().AttackDetailType & (AttackDetailTypes)31) & num3) != 0) || (string.IsNullOrEmpty((string)unit.UnitParam.birth) || stringList.Contains(unit.UnitParam.birth.ToString())))
                {
                    units.RemoveAt(index);
                    if (sortValues != null)
                    {
                        sortValues.RemoveAt(index);
                    }
                }
            }
        }