private IEnumerator PlaySkill(AffectEffectProperty affectEffectProperty, List <CharacterStateControl> targetList)
 {
     SubStatePlayHitAnimationAction.Data data = new SubStatePlayHitAnimationAction.Data();
     foreach (CharacterStateControl characterStateControl in targetList)
     {
         if (!characterStateControl.isDied)
         {
             SkillResults skillResults;
             if (AffectEffectProperty.IsDamage(affectEffectProperty.type))
             {
                 skillResults = SkillStatus.GetStageDamageSkillResult(affectEffectProperty, null, characterStateControl);
                 if (!skillResults.onMissHit)
                 {
                     if (characterStateControl.currentSufferState.FindSufferState(SufferStateProperty.SufferType.CountBarrier))
                     {
                         this.sufferStatePropertyCounter.AddCountDictionary(SufferStateProperty.SufferType.CountBarrier, characterStateControl, null);
                     }
                     else if (characterStateControl.currentSufferState.FindSufferState(SufferStateProperty.SufferType.CountEvasion))
                     {
                         this.sufferStatePropertyCounter.AddCountDictionary(SufferStateProperty.SufferType.CountEvasion, characterStateControl, null);
                     }
                     else if (skillResults.isGuard)
                     {
                         this.sufferStatePropertyCounter.AddCountDictionary(SufferStateProperty.SufferType.CountGuard, characterStateControl, skillResults.damageRateResult.dataList.Select((SufferStateProperty.Data item) => item.id).ToArray <string>());
                     }
                 }
             }
             else if (Tolerance.OnInfluenceToleranceAffectEffect(affectEffectProperty.type))
             {
                 skillResults = base.stateManager.skillDetails.GetToleranceSkillResult(affectEffectProperty, null, characterStateControl);
                 if (!skillResults.onMissHit)
                 {
                     if (characterStateControl.currentSufferState.FindSufferState(SufferStateProperty.SufferType.CountBarrier))
                     {
                         this.sufferStatePropertyCounter.AddCountDictionary(SufferStateProperty.SufferType.CountBarrier, characterStateControl, null);
                     }
                     else if (characterStateControl.currentSufferState.FindSufferState(SufferStateProperty.SufferType.CountEvasion))
                     {
                         this.sufferStatePropertyCounter.AddCountDictionary(SufferStateProperty.SufferType.CountEvasion, characterStateControl, null);
                     }
                 }
             }
             else
             {
                 skillResults = base.stateManager.skillDetails.GetOtherSkillResult(affectEffectProperty, null, characterStateControl);
             }
             data.AddHitIcon(characterStateControl, skillResults.hitIconAffectEffect, skillResults.attackPower, skillResults.onWeakHit, skillResults.onMissHit, skillResults.onCriticalHit, false, false, false, skillResults.extraEffectType);
         }
     }
     data.time = base.stateManager.stateProperty.multiHitIntervalWaitSecond;
     data.affectEffectProperty = affectEffectProperty;
     data.cameraKey            = this.cameraKey;
     this.subStatePlayHitAnimationAction.Init(data);
     base.SetState(this.subStatePlayHitAnimationAction.GetType());
     while (base.isWaitState)
     {
         yield return(null);
     }
     yield break;
 }
 private IEnumerator PlaySkill(SkillStatus status, List <CharacterStateControl> targetList)
 {
     foreach (CharacterStateControl characterStateControl in this.GetTotalCharacters())
     {
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.DamagePossibility);
     }
     foreach (AffectEffectProperty affectEffectProperty in status.affectEffect)
     {
         int hitNumber = 1;
         if (AffectEffectProperty.IsDamage(affectEffectProperty.type))
         {
             hitNumber = affectEffectProperty.hitNumber;
         }
         for (int i = 0; i < hitNumber; i++)
         {
             IEnumerator playSkill = this.PlaySkill(affectEffectProperty, targetList);
             while (playSkill.MoveNext())
             {
                 yield return(null);
             }
         }
     }
     foreach (CharacterStateControl characterStateControl2 in this.GetTotalCharacters())
     {
         characterStateControl2.ClearGutsData();
     }
     this.sufferStatePropertyCounter.UpdateCount(SufferStateProperty.SufferType.CountGuard, null);
     this.sufferStatePropertyCounter.UpdateCount(SufferStateProperty.SufferType.CountBarrier, null);
     this.sufferStatePropertyCounter.UpdateCount(SufferStateProperty.SufferType.CountEvasion, null);
     yield break;
 }
Example #3
0
    private HitEffectParams[] GetHitEffectParams()
    {
        List <HitEffectParams> list = new List <HitEffectParams>();

        string[] array = new string[]
        {
            "EFF_COM_HIT_NORMAL",
            "EFF_COM_HIT_WEAK",
            "EFF_COM_HIT_CRITICAL",
            "EFF_COM_S_HEAL",
            "EFF_COM_HIT_WEAK"
        };
        for (int i = 0; i < this.data.hitIconList.Count; i++)
        {
            if (this.data.hitIconList[i].affectEffect == AffectEffect.Invalid)
            {
                HitEffectParams item = BattleEffectManager.Instance.GetEffect("EFF_COM_HIT_WEAK") as HitEffectParams;
                list.Add(item);
            }
            else if (AffectEffectProperty.IsDamage(this.data.hitIconList[i].affectEffect))
            {
                if (this.data.hitIconList[i].isMiss)
                {
                    HitEffectParams item2 = BattleEffectManager.Instance.GetEffect(array[0]) as HitEffectParams;
                    list.Add(item2);
                }
                else if (!base.stateManager.onEnableTutorial && this.data.hitIconList[i].extraEffectType == ExtraEffectType.Up)
                {
                    HitEffectParams item3 = BattleEffectManager.Instance.GetEffect(AffectEffect.gimmickSpecialAttackUp.ToString()) as HitEffectParams;
                    list.Add(item3);
                }
                else if (!base.stateManager.onEnableTutorial && this.data.hitIconList[i].extraEffectType == ExtraEffectType.Down)
                {
                    HitEffectParams item4 = BattleEffectManager.Instance.GetEffect(AffectEffect.gimmickSpecialAttackDown.ToString()) as HitEffectParams;
                    list.Add(item4);
                }
                else
                {
                    HitEffectParams item5 = BattleEffectManager.Instance.GetEffect(array[(int)this.data.hitIconList[i].strength]) as HitEffectParams;
                    list.Add(item5);
                }
            }
            else
            {
                HitEffectParams item6 = BattleEffectManager.Instance.GetEffect(this.data.hitIconList[i].affectEffect.ToString()) as HitEffectParams;
                list.Add(item6);
            }
        }
        return(list.ToArray());
    }
Example #4
0
 public int GetHate()
 {
     if (AffectEffectProperty.IsDamage(this.type))
     {
         return(20);
     }
     if (Tolerance.OnInfluenceToleranceAffectEffect(this.type))
     {
         return(10);
     }
     if (this.type == AffectEffect.HpRevival || this.type == AffectEffect.Regenerate)
     {
         return(15);
     }
     return(5);
 }
 private void GetSkillDetailViewData(out GameWebAPI.RespDataMA_GetSkillDetailM.SkillDetailM dest, List <GameWebAPI.RespDataMA_GetSkillDetailM.SkillDetailM> source)
 {
     dest = null;
     for (int i = 0; i < source.Count; i++)
     {
         if (dest == null)
         {
             dest = source[i];
         }
         AffectEffect affectEffect = ServerToBattleUtility.IntToAffectEffect(source[i].effectType);
         if (AffectEffectProperty.IsDamage(affectEffect))
         {
             dest = source[i];
             break;
         }
     }
 }
Example #6
0
    public void InitializeSkillExtraStatus()
    {
        List <ExtraEffectStatus> extraEffectStatus = BattleStateManager.current.battleStateData.extraEffectStatus;
        List <ExtraEffectStatus> invocationList    = ExtraEffectStatus.GetInvocationList(extraEffectStatus, EffectStatusBase.EffectTriggerType.Usually);

        if (this.skillStatus.Length > 1)
        {
            AffectEffectProperty affectEffectFirst = this.skillStatus[1].GetAffectEffectFirst();
            if (affectEffectFirst != null)
            {
                if (AffectEffectProperty.IsDamage(affectEffectFirst.type))
                {
                    this.m_extraDeathblowSkillPower = ExtraEffectStatus.GetSkillPowerCorrectionValue(invocationList, affectEffectFirst, this);
                }
                this.m_extraDeathblowSkillHitRate = ExtraEffectStatus.GetSkillHitRateCorrectionValue(invocationList, affectEffectFirst, this);
            }
        }
        if (this.skillStatus.Length > 2)
        {
            AffectEffectProperty affectEffectFirst2 = this.skillStatus[2].GetAffectEffectFirst();
            if (affectEffectFirst2 != null)
            {
                if (AffectEffectProperty.IsDamage(affectEffectFirst2.type))
                {
                    this.m_extraInheritanceSkillPower = ExtraEffectStatus.GetSkillPowerCorrectionValue(invocationList, affectEffectFirst2, this);
                }
                this.m_extraInheritanceSkillHitRate = ExtraEffectStatus.GetSkillHitRateCorrectionValue(invocationList, affectEffectFirst2, this);
            }
        }
        if (this.skillStatus.Length > 3)
        {
            AffectEffectProperty affectEffectFirst3 = this.skillStatus[3].GetAffectEffectFirst();
            if (affectEffectFirst3 != null)
            {
                if (AffectEffectProperty.IsDamage(affectEffectFirst3.type))
                {
                    this.m_extraInheritanceSkillPower2 = ExtraEffectStatus.GetSkillPowerCorrectionValue(invocationList, affectEffectFirst3, this);
                }
                this.m_extraInheritanceSkillHitRate2 = ExtraEffectStatus.GetSkillHitRateCorrectionValue(invocationList, affectEffectFirst3, this);
            }
        }
    }
    private bool checkUseSkill(SkillStatus status, CharacterStateControl currentCharacter, CharacterStateControl tg)
    {
        bool isProtectEnableSkill = false;

        foreach (AffectEffectProperty affectEffectProperty in status.affectEffect)
        {
            if (AffectEffectProperty.IsDamage(affectEffectProperty.type))
            {
                isProtectEnableSkill = true;
                break;
            }
        }
        List <SubStateSkillDetailsFunction.TargetData> list = new List <SubStateSkillDetailsFunction.TargetData>();
        int num = 0;

        for (int i = 0; i < status.affectEffect.Count; i++)
        {
            AffectEffectProperty affectEffectProperty2 = status.affectEffect[i];
            if (AffectEffectProperty.IsDamage(affectEffectProperty2.type))
            {
                num += affectEffectProperty2.hitNumber;
            }
        }
        bool flag = true;
        AffectEffectProperty affectEffectProperty3 = null;
        bool         flag2        = false;
        bool         result       = false;
        bool         flag3        = false;
        EffectTarget effectTarget = EffectTarget.Enemy;

        for (int j = 0; j < status.affectEffect.Count; j++)
        {
            DkLog.W("↓↓↓↓↓↓", false);
            AffectEffectProperty affectEffectProperty4 = status.affectEffect[j];
            if (j == 0)
            {
                effectTarget = affectEffectProperty4.target;
            }
            if (affectEffectProperty3 != null && affectEffectProperty3.target != affectEffectProperty4.target)
            {
                CharacterStateControl[] skillTargetList = base.stateManager.targetSelect.GetSkillTargetList(currentCharacter, affectEffectProperty4.target);
                if (skillTargetList != null && skillTargetList.Length > 0)
                {
                    currentCharacter.targetCharacter = skillTargetList[0];
                }
                if (effectTarget == affectEffectProperty4.target)
                {
                    currentCharacter.targetCharacter = tg;
                }
            }
            list = this.CreateTargetData(list, currentCharacter, affectEffectProperty4, isProtectEnableSkill, ref flag);
            affectEffectProperty3 = affectEffectProperty4;
            if (this.SwitchAffectEffect(affectEffectProperty4, currentCharacter, tg, list, ref flag3, ref flag2))
            {
                DkLog.W(string.Format("targetDataList {0} : currentSuffer.type {1} : tg {2} : skip {3}", new object[]
                {
                    list.Count,
                    affectEffectProperty4.type,
                    string.Empty,
                    flag2
                }), false);
                if (!flag2)
                {
                    result = true;
                    DkLog.W(string.Format("targetDataList.Count {0}", list.Count), false);
                }
            }
        }
        return(result);
    }
    protected static ConstValue.ResistanceType GetSkillResistanceType(AffectEffectProperty skillPropety)
    {
        ConstValue.ResistanceType result = ConstValue.ResistanceType.NONE;
        if (!AffectEffectProperty.IsDamage(skillPropety.type))
        {
            switch (skillPropety.type)
            {
            case AffectEffect.Paralysis:
                result = ConstValue.ResistanceType.PARALYSIS;
                break;

            case AffectEffect.Poison:
                result = ConstValue.ResistanceType.POISON;
                break;

            case AffectEffect.Sleep:
                result = ConstValue.ResistanceType.SLEEP;
                break;

            case AffectEffect.SkillLock:
                result = ConstValue.ResistanceType.SKILL_LOCK;
                break;

            case AffectEffect.InstantDeath:
                result = ConstValue.ResistanceType.DEATH;
                break;

            case AffectEffect.Confusion:
                result = ConstValue.ResistanceType.CONFUSION;
                break;

            case AffectEffect.Stun:
                result = ConstValue.ResistanceType.STUN;
                break;
            }
        }
        else
        {
            switch (skillPropety.attribute)
            {
            case global::Attribute.None:
                result = ConstValue.ResistanceType.NOTHINGNESS;
                break;

            case global::Attribute.Red:
                result = ConstValue.ResistanceType.FIRE;
                break;

            case global::Attribute.Blue:
                result = ConstValue.ResistanceType.WATER;
                break;

            case global::Attribute.Yellow:
                result = ConstValue.ResistanceType.THUNDER;
                break;

            case global::Attribute.Green:
                result = ConstValue.ResistanceType.NATURE;
                break;

            case global::Attribute.White:
                result = ConstValue.ResistanceType.LIGHT;
                break;

            case global::Attribute.Black:
                result = ConstValue.ResistanceType.DARK;
                break;
            }
        }
        return(result);
    }
Example #9
0
    private IEnumerator PlayHitAnimation()
    {
        if (!base.stateManager.cameraControl.IsPlaying(this.data.cameraKey))
        {
            foreach (SubStatePlayHitAnimationAction.Data.HitIcon hitIcon in this.data.hitIconList)
            {
                hitIcon.target.CharacterParams.PlayAnimation(CharacterAnimationType.idle, SkillType.Attack, 0, null, null);
            }
            if (this.data.hitIconList.Count == 1)
            {
                base.stateManager.cameraControl.PlayCameraMotionActionCharacter(this.data.cameraKey, this.data.hitIconList[0].target);
            }
            else if (this.data.hitIconList.Count >= 2 && this.data.hitIconList[0].affectEffect != AffectEffect.InstantDeath)
            {
                base.stateManager.cameraControl.PlayCameraMotionActionCharacter(this.data.cameraKey, this.data.hitIconList[0].target);
            }
        }
        List <HitIcon> hitIconList = new List <HitIcon>();

        foreach (SubStatePlayHitAnimationAction.Data.HitIcon hitIcon2 in this.data.hitIconList)
        {
            int     count = hitIconList.Count;
            HitIcon item2 = base.stateManager.uiControl.ApplyShowHitIcon(count, base.stateManager.uiControl.GetFixableCharacterCenterPosition2DFunction(hitIcon2.target), hitIcon2.affectEffect, hitIcon2.damage, hitIcon2.strength, hitIcon2.isMiss, hitIcon2.isCritical, hitIcon2.isDrain, hitIcon2.isCounter, hitIcon2.isReflection, hitIcon2.extraEffectType, hitIcon2.affectEffect != AffectEffect.InstantDeath, this.data.affectEffectProperty);
            hitIconList.Add(item2);
        }
        HitEffectParams[] currentHitEffect = this.GetHitEffectParams();
        base.stateManager.uiControl.HideCharacterHUDFunction();
        base.stateManager.threeDAction.ShowAllCharactersAction(this.data.hitIconList.Select((SubStatePlayHitAnimationAction.Data.HitIcon item) => item.target).ToArray <CharacterStateControl>());
        bool   isPlayedDeathSE = false;
        Action PlayDeadSE      = delegate()
        {
            if (!isPlayedDeathSE)
            {
                this.stateManager.soundPlayer.PlayDeathSE();
            }
            isPlayedDeathSE = true;
        };
        bool isFindDeathCharacter        = false;
        bool isBigBossFindDeathCharacter = false;
        bool isPlayedHitEffectSE         = false;

        for (int i = 0; i < this.data.hitIconList.Count; i++)
        {
            if (this.data.hitIconList[i].target.isDiedJustBefore)
            {
                this.data.hitIconList[i].target.CharacterParams.gameObject.SetActive(false);
            }
            else
            {
                base.stateManager.threeDAction.PlayHitEffectAction(currentHitEffect[i], this.data.hitIconList[i].target);
                if (!isPlayedHitEffectSE)
                {
                    isPlayedHitEffectSE = true;
                    base.stateManager.soundPlayer.TryPlaySE(currentHitEffect[i]);
                }
                bool flag  = AffectEffectProperty.IsDamage(this.data.affectEffectProperty.type);
                bool flag2 = Tolerance.OnInfluenceToleranceAffectEffect(this.data.affectEffectProperty.type);
                bool flag3 = this.data.hitIconList[i].affectEffect == AffectEffect.TurnBarrier || this.data.hitIconList[i].affectEffect == AffectEffect.CountBarrier;
                bool flag4 = this.data.hitIconList[i].affectEffect == AffectEffect.TurnEvasion || this.data.hitIconList[i].affectEffect == AffectEffect.CountEvasion;
                bool flag5 = this.data.hitIconList[i].strength == Strength.Invalid;
                if (!this.data.hitIconList[i].target.isDied)
                {
                    if ((flag || flag2) && (flag3 || flag4 || flag5))
                    {
                        base.stateManager.threeDAction.PlayIdleAnimationActiveCharacterAction(new CharacterStateControl[]
                        {
                            this.data.hitIconList[i].target
                        });
                    }
                    else if (!this.data.hitIconList[i].isMiss)
                    {
                        AffectEffect affectEffect = this.data.hitIconList[i].affectEffect;
                        switch (affectEffect)
                        {
                        case AffectEffect.Damage:
                            goto IL_69A;

                        default:
                            switch (affectEffect)
                            {
                            case AffectEffect.ReferenceTargetHpRate:
                            case AffectEffect.HpBorderlineDamage:
                            case AffectEffect.HpBorderlineSpDamage:
                            case AffectEffect.DefenseThroughDamage:
                            case AffectEffect.SpDefenseThroughDamage:
                            case AffectEffect.RefHpRateNonAttribute:
                                goto IL_69A;

                            case AffectEffect.ApDrain:
                            case AffectEffect.Escape:
                            case AffectEffect.Nothing:
                            case AffectEffect.SkillBranch:
                            case AffectEffect.ChangeToleranceUp:
                                goto IL_881;

                            case AffectEffect.HpSettingFixable:
                            case AffectEffect.HpSettingPercentage:
                                if (this.data.hitIconList[i].damage > 0)
                                {
                                    base.stateManager.threeDAction.PlayAnimationCharacterAction(CharacterAnimationType.hit, new CharacterStateControl[]
                                    {
                                        this.data.hitIconList[i].target
                                    });
                                }
                                else
                                {
                                    base.stateManager.threeDAction.PlayAnimationCharacterAction(CharacterAnimationType.revival, new CharacterStateControl[]
                                    {
                                        this.data.hitIconList[i].target
                                    });
                                }
                                break;

                            case AffectEffect.ChangeToleranceDown:
                                goto IL_79F;

                            default:
                                goto IL_881;
                            }
                            break;

                        case AffectEffect.AttackDown:
                        case AffectEffect.DefenceDown:
                        case AffectEffect.SpAttackDown:
                        case AffectEffect.SpDefenceDown:
                        case AffectEffect.SpeedDown:
                        case AffectEffect.CorrectionUpReset:
                        case AffectEffect.HateUp:
                        case AffectEffect.Paralysis:
                        case AffectEffect.Poison:
                        case AffectEffect.Sleep:
                        case AffectEffect.SkillLock:
                        case AffectEffect.HitRateDown:
                        case AffectEffect.InstantDeath:
                        case AffectEffect.Confusion:
                        case AffectEffect.Stun:
                        case AffectEffect.SatisfactionRateDown:
                        case AffectEffect.ApDown:
                        case AffectEffect.ApConsumptionUp:
                            goto IL_79F;

                        case AffectEffect.Counter:
                        case AffectEffect.Reflection:
                        case AffectEffect.Destruct:
                            goto IL_881;
                        }
IL_8C1:
                        goto IL_901;
IL_69A:
                        if (this.data.hitIconList[i].strength == Strength.Weak)
                        {
                            base.stateManager.threeDAction.PlayAnimationCharacterAction(CharacterAnimationType.strongHit, new CharacterStateControl[]
                            {
                                this.data.hitIconList[i].target
                            });
                        }
                        else if (this.data.hitIconList[i].strength == Strength.Drain)
                        {
                            base.stateManager.threeDAction.PlayAnimationCharacterAction(CharacterAnimationType.revival, new CharacterStateControl[]
                            {
                                this.data.hitIconList[i].target
                            });
                        }
                        else
                        {
                            base.stateManager.threeDAction.PlayAnimationCharacterAction(CharacterAnimationType.hit, new CharacterStateControl[]
                            {
                                this.data.hitIconList[i].target
                            });
                        }
                        goto IL_8C1;
IL_79F:
                        base.stateManager.threeDAction.PlayAnimationCharacterAction(CharacterAnimationType.hit, new CharacterStateControl[]
                        {
                            this.data.hitIconList[i].target
                        });
                        goto IL_8C1;
IL_881:
                        base.stateManager.threeDAction.PlayAnimationCharacterAction(CharacterAnimationType.revival, new CharacterStateControl[]
                        {
                            this.data.hitIconList[i].target
                        });
                    }
                    else
                    {
                        base.stateManager.threeDAction.PlayAnimationCharacterAction(CharacterAnimationType.guard, new CharacterStateControl[]
                        {
                            this.data.hitIconList[i].target
                        });
                    }
                    IL_901 :;
                }
                else
                {
                    if (base.hierarchyData.batteWaves[base.battleStateData.currentWaveNumber].cameraType == 1 && this.data.hitIconList[i].target.isEnemy)
                    {
                        base.stateManager.threeDAction.PlayAnimationCharacterAction(CharacterAnimationType.strongHit, new CharacterStateControl[]
                        {
                            this.data.hitIconList[i].target
                        });
                        isBigBossFindDeathCharacter = true;
                    }
                    else
                    {
                        base.stateManager.threeDAction.PlayDeadAnimationCharacterAction(PlayDeadSE, this.data.hitIconList[i].target);
                    }
                    isFindDeathCharacter = true;
                }
            }
        }
        base.stateManager.uiControl.ShowCharacterHUDFunction(this.data.hitIconList.Select((SubStatePlayHitAnimationAction.Data.HitIcon item) => item.target).ToArray <CharacterStateControl>());
        IEnumerator slowMotion = null;

        if (base.stateManager.IsLastBattleAndAllDeath())
        {
            if (base.stateManager.battleMode == BattleMode.Multi)
            {
                base.stateManager.uiControlMulti.HideAllDIalog();
            }
            slowMotion = base.stateManager.threeDAction.SlowMotionWaitAction();
        }
        if (isBigBossFindDeathCharacter)
        {
            base.stateManager.uiControl.Fade(Color.white, 1f, 1f);
        }
        float waitSecond = this.data.time;

        if (isFindDeathCharacter)
        {
            waitSecond += 1f;
        }
        while (waitSecond > 0f)
        {
            waitSecond -= Time.deltaTime;
            CharacterStateControl[] targets = this.data.hitIconList.Select((SubStatePlayHitAnimationAction.Data.HitIcon item) => item.target).ToArray <CharacterStateControl>();
            base.stateManager.uiControl.RepositionCharacterHUDPosition(targets);
            if (slowMotion != null)
            {
                slowMotion.MoveNext();
            }
            for (int j = 0; j < this.data.hitIconList.Count; j++)
            {
                Vector3 fixableCharacterCenterPosition2DFunction = base.stateManager.uiControl.GetFixableCharacterCenterPosition2DFunction(this.data.hitIconList[j].target);
                hitIconList[j].HitIconReposition(fixableCharacterCenterPosition2DFunction);
            }
            yield return(null);
        }
        AppCoroutine.Start(this.StopHitAnimation(currentHitEffect), false);
        yield break;
    }
Example #10
0
    public void ApplyMonsterDescription(bool isShow, CharacterStateControl characterStatus)
    {
        NGUITools.SetActiveSelf(base.gameObject, isShow);
        if (!isShow)
        {
            return;
        }
        this.monsterName.text = characterStatus.name;
        this.level.text       = characterStatus.level.ToString();
        base.SetupEvolutionStep(characterStatus);
        base.SetupSpecies(characterStatus);
        int num = 0;

        num           += this.ApplyValue(characterStatus.maxHp, characterStatus.extraMaxHp, this.hp, this.hpUpObject, this.hpDownObject);
        num           += this.ApplyValue(characterStatus.attackPower, characterStatus.extraAttackPower, this.atk, this.atkUpObject, this.atkDownObject);
        num           += this.ApplyValue(characterStatus.defencePower, characterStatus.extraDefencePower, this.def, this.defUpObject, this.defDownObject);
        num           += this.ApplyValue(characterStatus.specialAttackPower, characterStatus.extraSpecialAttackPower, this.satk, this.satkUpObject, this.satkDownObject);
        num           += this.ApplyValue(characterStatus.specialDefencePower, characterStatus.extraSpecialDefencePower, this.sdef, this.sdefUpObject, this.sdefDownObject);
        num           += this.ApplyValue(characterStatus.speed, characterStatus.extraSpeed, this.speed, this.speedUpObject, this.speedDownObject);
        this.luck.text = characterStatus.luck.ToString();
        if (MonsterDataMng.Instance() != null)
        {
            this.friendshipLevel.text = MonsterFriendshipData.GetMaxFriendshipFormat(characterStatus.friendshipLevel.ToString(), MonsterGrowStepData.ToGrowStepString(characterStatus.characterDatas.growStep));
        }
        if (characterStatus.isHavingLeaderSkill)
        {
            this.leaderSkillName.text        = characterStatus.leaderSkillStatus.name;
            this.leaderSkillDescription.text = characterStatus.leaderSkillStatus.description;
        }
        else
        {
            this.leaderSkillName.text        = StringMaster.GetString("SystemNone");
            this.leaderSkillDescription.text = string.Empty;
        }
        characterStatus.InitializeSkillExtraStatus();
        if (characterStatus.skillStatus.Length > 1)
        {
            this.deathblow.name.text        = characterStatus.skillStatus[1].name;
            this.deathblow.description.text = characterStatus.skillStatus[1].description;
            int powerFirst = characterStatus.skillStatus[1].GetPowerFirst(characterStatus);
            int extraValue = powerFirst;
            AffectEffectProperty affectEffectFirst = characterStatus.skillStatus[1].GetAffectEffectFirst();
            if (affectEffectFirst != null && AffectEffectProperty.IsDamage(affectEffectFirst.type))
            {
                extraValue = characterStatus.extraDeathblowSkillPower;
            }
            num += this.ApplyValue(powerFirst, extraValue, null, this.deathblow.upObject, this.deathblow.downObject);
        }
        else
        {
            this.deathblow.name.text        = StringMaster.GetString("SystemNone");
            this.deathblow.description.text = "-";
            this.ApplyValue(0, 0, null, this.deathblow.upObject, this.deathblow.downObject);
        }
        if (characterStatus.skillStatus.Length > 2)
        {
            this.inheritance1.name.text        = characterStatus.skillStatus[2].name;
            this.inheritance1.description.text = characterStatus.skillStatus[2].description;
            int powerFirst2 = characterStatus.skillStatus[2].GetPowerFirst(characterStatus);
            int extraValue2 = powerFirst2;
            AffectEffectProperty affectEffectFirst2 = characterStatus.skillStatus[2].GetAffectEffectFirst();
            if (affectEffectFirst2 != null && AffectEffectProperty.IsDamage(affectEffectFirst2.type))
            {
                extraValue2 = characterStatus.extraInheritanceSkillPower;
            }
            num += this.ApplyValue(powerFirst2, extraValue2, null, this.inheritance1.upObject, this.inheritance1.downObject);
        }
        else
        {
            this.inheritance1.name.text        = StringMaster.GetString("SystemNone");
            this.inheritance1.description.text = "-";
            this.ApplyValue(0, 0, null, this.inheritance1.upObject, this.inheritance1.downObject);
        }
        if (characterStatus.isVersionUp)
        {
            this.inheritance2.root.SetActive(true);
        }
        else
        {
            this.inheritance2.root.SetActive(false);
        }
        if (characterStatus.skillStatus.Length > 3)
        {
            this.inheritance2.name.text        = characterStatus.skillStatus[3].name;
            this.inheritance2.description.text = characterStatus.skillStatus[3].description;
            int powerFirst3 = characterStatus.skillStatus[3].GetPowerFirst(characterStatus);
            int extraValue3 = powerFirst3;
            AffectEffectProperty affectEffectFirst3 = characterStatus.skillStatus[3].GetAffectEffectFirst();
            if (affectEffectFirst3 != null && AffectEffectProperty.IsDamage(affectEffectFirst3.type))
            {
                extraValue3 = characterStatus.extraInheritanceSkillPower2;
            }
            num += this.ApplyValue(powerFirst3, extraValue3, null, this.inheritance2.upObject, this.inheritance2.downObject);
        }
        else
        {
            this.inheritance2.name.text        = StringMaster.GetString("SystemNone");
            this.inheritance2.description.text = "-";
            this.ApplyValue(0, 0, null, this.inheritance2.upObject, this.inheritance2.downObject);
        }
        this.stageGimmickObject.SetActive(num > 0 || characterStatus.isChipServerAddValue || characterStatus.isEffectiveBonus());
        this.SetArousal(characterStatus.arousal);
        base.SetupTolerance(characterStatus);
        this.MonsterMedalList.SetValues(characterStatus.talent);
        for (int i = 0; i < this.chipIcons.Length; i++)
        {
            if (i < characterStatus.chipIds.Length)
            {
                GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(characterStatus.chipIds[i].ToString());
                this.chipIcons[i].SetData(chipMainData, -1, -1);
                this.chipIcons[i].SetActive(true);
                this.chipIcons[i].transform.localScale = new Vector3(0.6f, 0.6f, 1f);
            }
            else
            {
                this.chipIcons[i].SetActive(false);
            }
        }
        if (MonsterDataMng.Instance() != null)
        {
            string monsterStatusId  = characterStatus.characterDatas.monsterStatusId;
            string specificTypeName = MonsterSpecificTypeData.GetSpecificTypeName(monsterStatusId);
            this.specificType.text = specificTypeName;
        }
        else
        {
            this.specificType.text = "-";
        }
    }
Example #11
0
    public void GetDifferenceExtraPram(out int upCount, out int downCount)
    {
        upCount   = 0;
        downCount = 0;
        int num = this.extraMaxHp - this.maxHp;

        if (num > 0)
        {
            upCount++;
        }
        else if (num < 0)
        {
            downCount++;
        }
        num = this.extraAttackPower - this.attackPower;
        if (num > 0)
        {
            upCount++;
        }
        else if (num < 0)
        {
            downCount++;
        }
        num = this.extraDefencePower - this.defencePower;
        if (num > 0)
        {
            upCount++;
        }
        else if (num < 0)
        {
            downCount++;
        }
        num = this.extraSpecialAttackPower - this.specialAttackPower;
        if (num > 0)
        {
            upCount++;
        }
        else if (num < 0)
        {
            downCount++;
        }
        num = this.extraSpecialDefencePower - this.specialDefencePower;
        if (num > 0)
        {
            upCount++;
        }
        else if (num < 0)
        {
            downCount++;
        }
        num = this.extraSpeed - this.speed;
        if (num > 0)
        {
            upCount++;
        }
        else if (num < 0)
        {
            downCount++;
        }
        if (this.skillStatus.Length > 1)
        {
            AffectEffectProperty affectEffectFirst = this.skillStatus[1].GetAffectEffectFirst();
            if (affectEffectFirst != null)
            {
                if (AffectEffectProperty.IsDamage(affectEffectFirst.type))
                {
                    int num2 = this.m_extraDeathblowSkillPower - affectEffectFirst.GetPower(this);
                    if (num2 > 0)
                    {
                        upCount++;
                    }
                    else if (num2 < 0)
                    {
                        downCount++;
                    }
                }
                float num3 = this.m_extraDeathblowSkillHitRate - affectEffectFirst.hitRate;
                if (num3 > 0f)
                {
                    upCount++;
                }
                else if (num3 < 0f)
                {
                    downCount++;
                }
            }
        }
        if (this.skillStatus.Length > 2)
        {
            AffectEffectProperty affectEffectFirst2 = this.skillStatus[2].GetAffectEffectFirst();
            if (affectEffectFirst2 != null)
            {
                if (AffectEffectProperty.IsDamage(affectEffectFirst2.type))
                {
                    int num4 = this.m_extraInheritanceSkillPower - affectEffectFirst2.GetPower(this);
                    if (num4 > 0)
                    {
                        upCount++;
                    }
                    else if (num4 < 0)
                    {
                        downCount++;
                    }
                }
                float num5 = this.m_extraInheritanceSkillHitRate - affectEffectFirst2.hitRate;
                if (num5 > 0f)
                {
                    upCount++;
                }
                else if (num5 < 0f)
                {
                    downCount++;
                }
            }
        }
        if (this.skillStatus.Length > 3)
        {
            AffectEffectProperty affectEffectFirst3 = this.skillStatus[3].GetAffectEffectFirst();
            if (affectEffectFirst3 != null)
            {
                if (AffectEffectProperty.IsDamage(affectEffectFirst3.type))
                {
                    int num6 = this.m_extraInheritanceSkillPower2 - affectEffectFirst3.GetPower(this);
                    if (num6 > 0)
                    {
                        upCount++;
                    }
                    else if (num6 < 0)
                    {
                        downCount++;
                    }
                }
                float num7 = this.m_extraInheritanceSkillHitRate2 - affectEffectFirst3.hitRate;
                if (num7 > 0f)
                {
                    upCount++;
                }
                else if (num7 < 0f)
                {
                    downCount++;
                }
            }
        }
    }
    public void ApplySkillButtonData(SkillStatus skills, bool onEnable, bool onSkillLock, CharacterStateControl selectCharacter, int useCount)
    {
        List <ExtraEffectStatus> extraEffectStatus    = BattleStateManager.current.battleStateData.extraEffectStatus;
        List <ExtraEffectStatus> invocationList       = ExtraEffectStatus.GetInvocationList(extraEffectStatus, EffectStatusBase.EffectTriggerType.Usually);
        AffectEffectProperty     affectEffectProperty = skills.GetAffectEffectFirst();

        foreach (AffectEffectProperty affectEffectProperty2 in skills.affectEffect)
        {
            if (affectEffectProperty2.ThisSkillIsAttack)
            {
                affectEffectProperty = affectEffectProperty2;
                break;
            }
        }
        int num = 0;

        if (AffectEffectProperty.IsDamage(affectEffectProperty.type))
        {
            num = ExtraEffectStatus.GetSkillPowerCorrectionValue(invocationList, affectEffectProperty, selectCharacter);
        }
        float num2 = ExtraEffectStatus.GetSkillHitRateCorrectionValue(invocationList, affectEffectProperty, selectCharacter);

        num2                       = Mathf.Clamp01(num2);
        this.skillType             = skills.skillType;
        this.skillName.text        = skills.name;
        this.skillDescription.text = skills.description;
        int    num3    = (int)Math.Round((double)(num2 * 100f), MidpointRounding.AwayFromZero);
        string @string = StringMaster.GetString("SystemPercent");

        this.hitRate.text = string.Format(@string, num3);
        this.power.text   = num.ToString();
        int correctedAp = skills.GetCorrectedAp(selectCharacter);

        if (correctedAp <= selectCharacter.ap)
        {
            this.ap.text = string.Format(StringMaster.GetString("BattleSkillUI-01"), correctedAp);
        }
        else
        {
            this.ap.text = StringMaster.GetString("BattleSkillUI-02");
        }
        if (skills.useCountValue > 0)
        {
            this.SetSkillUseCount(useCount);
        }
        this.SetAttributeIcon(skills.attribute);
        if (onSkillLock)
        {
            this.SetButtonType(BattleSkillBtn.Type.Invalid);
            this.SetSkillLock(onSkillLock);
        }
        else if (onEnable)
        {
            this.SetButtonType(BattleSkillBtn.Type.Off);
            this.SetSkillLock(false);
        }
        else
        {
            this.SetButtonType(BattleSkillBtn.Type.Invalid);
            this.SetSkillLock(false);
        }
    }