public void TryPlaySE(HitEffectParams hitEffect)
 {
     if (hitEffect != null)
     {
         this.TryPlaySE(hitEffect.seId, 0f, false);
     }
 }
示例#2
0
    public void PlayDeadAnimationCharacterAction(Action deathEffectPlay, CharacterStateControl character)
    {
        HitEffectParams hitEffectParams;

        if (character.isEnemy)
        {
            bool flag = base.stateManager.IsLastBattleAndAllDeath();
            if (flag)
            {
                hitEffectParams = (BattleEffectManager.Instance.GetEffect("EFF_COM_BOSSDEATH") as HitEffectParams);
                base.battleStateData.UseLastDeadEffect.Add(hitEffectParams);
            }
            else
            {
                hitEffectParams = (BattleEffectManager.Instance.GetEffect("EFF_COM_DEATH") as HitEffectParams);
                base.battleStateData.UseDeathEffect.Add(hitEffectParams);
            }
        }
        else
        {
            hitEffectParams = (BattleEffectManager.Instance.GetEffect("EFF_COM_DEATH") as HitEffectParams);
            base.battleStateData.UseDeathEffect.Add(hitEffectParams);
        }
        CharacterParams        characterParams  = character.CharacterParams;
        CharacterAnimationType type             = CharacterAnimationType.dead;
        HitEffectParams        hitEffectParams2 = hitEffectParams;

        characterParams.PlayAnimation(type, SkillType.Attack, 0, hitEffectParams2, deathEffectPlay);
    }
 public void TryStopSE(HitEffectParams hitEffect)
 {
     if (hitEffect != null)
     {
         this.TryStopSE(hitEffect.seId, 0f);
     }
 }
 public static void AddHitEffectParams(string id, HitEffectParams hitEffect)
 {
     if (!BattleObjectPooler.hitEffectParamsCache.ContainsKey(id))
     {
         BattleObjectPooler.hitEffectParamsCache.Add(id, new List <HitEffectParams>());
     }
     BattleObjectPooler.hitEffectParamsCache[id].Add(hitEffect);
 }
 public void PlayAnimation(HitEffectParams hitEffectParams, float deathEffectGenerationInterval, Action callbackDeathEffect = null)
 {
     if (this.playDeadAnimation != null)
     {
         this.characterParams.StopCoroutine(this.playDeadAnimation);
     }
     this.playDeadAnimation = this.DeadEffectCorutine(hitEffectParams, deathEffectGenerationInterval, callbackDeathEffect);
     this.characterParams.StartCoroutine(this.playDeadAnimation);
 }
 public static bool TryGetHitEffectParams(string id, int index, out HitEffectParams hitEffect)
 {
     if (BattleObjectPooler.hitEffectParamsCache.ContainsKey(id) && BattleObjectPooler.hitEffectParamsCache[id].Count > index)
     {
         hitEffect = BattleObjectPooler.hitEffectParamsCache[id][index];
         return(true);
     }
     hitEffect = null;
     return(false);
 }
 public static bool ContainHitEffectParams(HitEffectParams c)
 {
     foreach (KeyValuePair <string, List <HitEffectParams> > keyValuePair in BattleObjectPooler.hitEffectParamsCache)
     {
         if (keyValuePair.Value.Contains(c))
         {
             return(true);
         }
     }
     return(false);
 }
示例#8
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());
    }
    protected IEnumerator RevivalCharacter()
    {
        this.isLastFindRevivalCharacter = true;
        List <CharacterStateControl> characters = new List <CharacterStateControl>();

        for (int i = 0; i < base.battleStateData.playerCharacters.Length; i++)
        {
            if (base.battleStateData.isRevivalReservedCharacter[i])
            {
                characters.Add(base.battleStateData.playerCharacters[i]);
                base.battleStateData.isRevivalReservedCharacter[i] = false;
                base.stateManager.threeDAction.PlayAlwaysEffectAction(base.battleStateData.revivalReservedEffect[i], AlwaysEffectState.Out);
                int totalCharacterIndex = base.battleStateData.GetTotalCharacterIndex(base.battleStateData.playerCharacters[i]);
                base.battleStateData.isRoundStartApRevival[totalCharacterIndex] = false;
                base.battleStateData.isRoundStartHpRevival[i] = false;
            }
        }
        if (characters.Count > 1)
        {
            this.cameraKey = "skillA";
        }
        else
        {
            this.cameraKey = "skillF";
        }
        base.stateManager.cameraControl.PlayCameraMotionActionCharacter(this.cameraKey, characters[0]);
        for (int j = 0; j < characters.Count; j++)
        {
            characters[j].Revival();
            characters[j].CharacterParams.Initialize(base.hierarchyData.cameraObject.camera3D);
            characters[j].CharacterParams.gameObject.SetActive(true);
            characters[j].CharacterParams.transform.localScale = Vector3.one;
            HitEffectParams hitEffectParams = BattleEffectManager.Instance.GetEffect("EFF_COM_L_HEAL") as HitEffectParams;
            this.use_revival_effect_list_.Add(hitEffectParams);
            base.stateManager.threeDAction.PlayHitEffectAction(hitEffectParams, characters[j]);
            characters[j].CharacterParams.transform.localScale = Vector3.zero;
            characters[j].CharacterParams.PlayAnimation(CharacterAnimationType.revival, SkillType.Attack, 0, null, null);
        }
        base.stateManager.soundPlayer.TryPlaySE(base.battleStateData.revivalReservedEffect[0], AlwaysEffectState.Out);
        base.stateManager.soundPlayer.TryPlaySE(this.use_revival_effect_list_[0]);
        base.stateManager.uiControl.SetMenuAuto2xButtonEnabled(true);
        IEnumerator wait = base.stateManager.threeDAction.SmoothIncreaseCharactersAction(base.stateManager.stateProperty.revivalActionWaitSecond, characters.ToArray());

        while (wait.MoveNext())
        {
            object obj = wait.Current;
            yield return(obj);
        }
        yield break;
    }
示例#10
0
    public void SetHitEffectPool(string prefab_key, string key)
    {
        GameObject hitEffectPrefab = base.stateManager.serverControl.GetHitEffectPrefab(prefab_key);

        hitEffectPrefab.name = prefab_key;
        HitEffectParams component = hitEffectPrefab.GetComponent <HitEffectParams>();

        if (component != null)
        {
            base.stateManager.soundPlayer.AddEffectSe(component.seId);
        }
        BattleEffectManager.Instance.SetCamera(base.hierarchyData.cameraObject.camera3D);
        BattleEffectManager.Instance.SetPool(key, base.battleStateData.hitEffectRoot.transform, hitEffectPrefab);
    }
示例#11
0
    public IEnumerator LoadHitEffect(string effectId, int index, Action <HitEffectParams, int> result)
    {
        BattleDebug.Log(string.Concat(new object[]
        {
            "-- ヒットエフェクト単体ロード effectId[",
            effectId,
            "] index[",
            index,
            "] : 開始"
        }));
        HitEffectParams hitEffectParams = null;
        GameObject      hitEffect       = null;

        if (!BattleObjectPooler.TryGetHitEffectParams(effectId, index, out hitEffectParams))
        {
            GameObject prefab = base.stateManager.serverControl.GetHitEffectPrefab(effectId);
            hitEffect = base.Instantiate <GameObject>(prefab);
            yield return(null);

            hitEffect.name  = effectId;
            hitEffectParams = hitEffect.GetComponent <HitEffectParams>();
            BattleObjectPooler.AddHitEffectParams(effectId, hitEffectParams);
        }
        else
        {
            hitEffect = hitEffectParams.gameObject;
        }
        hitEffect.transform.SetParent(base.battleStateData.hitEffectRoot);
        hitEffect.SetActive(false);
        IEnumerator initialize = hitEffectParams.Initialize(base.hierarchyData.cameraObject.camera3D);

        while (initialize.MoveNext())
        {
            yield return(null);
        }
        base.stateManager.soundPlayer.AddEffectSe(hitEffectParams.seId);
        result(hitEffectParams, index);
        BattleDebug.Log(string.Concat(new object[]
        {
            "-- ヒットエフェクト単体ロード effectId[",
            effectId,
            "] index[",
            index,
            "] : 完了"
        }));
        yield break;
    }
    private IEnumerator DeadEffectCorutine(HitEffectParams hitEffectParams, float deathEffectGenerationInterval, Action callbackDeathEffect = null)
    {
        float timing = Time.time + TimeExtension.GetTimeScaleDivided(deathEffectGenerationInterval);

        while (Time.time < timing)
        {
            yield return(null);
        }
        if (hitEffectParams != null)
        {
            hitEffectParams.gameObject.SetActive(true);
            hitEffectParams.PlayAnimationTrigger(this.characterParams);
            if (callbackDeathEffect != null)
            {
                callbackDeathEffect();
            }
        }
        callbackDeathEffect = null;
        yield break;
    }
示例#13
0
    private void PlayHpAndApRevivalEffect()
    {
        bool flag = false;

        for (int i = 0; i < base.battleStateData.playerCharacters.Length; i++)
        {
            if (base.battleStateData.isRoundStartHpRevival[i] && !base.battleStateData.playerCharacters[i].isDied)
            {
                HitEffectParams hitEffectParams = BattleEffectManager.Instance.GetEffect("EFF_COM_L_HEAL") as HitEffectParams;
                base.stateManager.threeDAction.PlayHitEffectAction(hitEffectParams, base.battleStateData.playerCharacters[i]);
                this.use_revival_effect_list_.Add(hitEffectParams);
                if (!flag)
                {
                    flag = true;
                    base.stateManager.soundPlayer.TryPlaySE(hitEffectParams);
                }
            }
        }
        bool flag2 = false;

        CharacterStateControl[] totalCharacters = base.battleStateData.GetTotalCharacters();
        for (int j = 0; j < base.battleStateData.totalCharacterLength; j++)
        {
            if (!totalCharacters[j].isDied && base.battleStateData.isRoundStartApRevival[j])
            {
                HitEffectParams hitEffectParams2 = BattleEffectManager.Instance.GetEffect(AffectEffect.ApUp.ToString()) as HitEffectParams;
                base.stateManager.threeDAction.PlayHitEffectAction(hitEffectParams2, totalCharacters[j]);
                this.use_effect_list_.Add(hitEffectParams2);
                if (!flag2)
                {
                    flag2 = true;
                    base.stateManager.soundPlayer.TryPlaySE(hitEffectParams2);
                }
            }
        }
        base.stateManager.threeDAction.ShowAliveCharactersAction(base.battleStateData.GetTotalCharacters());
        base.stateManager.threeDAction.PlayIdleAnimationActiveCharacterAction(base.battleStateData.GetTotalCharacters());
    }
示例#14
0
 public void PlayHitEffectAction(HitEffectParams hitEffects, CharacterStateControl characters)
 {
     hitEffects.PlayAnimationTrigger(characters.CharacterParams);
 }
示例#15
0
    private IEnumerator PoisonFunction()
    {
        List <CharacterStateControl> characters = this.GetSufferCharacters(SufferStateProperty.SufferType.Poison);

        if (characters.Count == 0)
        {
            yield break;
        }
        foreach (CharacterStateControl characterStateControl in base.stateManager.battleStateData.GetTotalCharacters())
        {
            base.stateManager.threeDAction.ShowAliveCharactersAction(new CharacterStateControl[]
            {
                characterStateControl
            });
            base.stateManager.threeDAction.PlayIdleAnimationUndeadCharactersAction(new CharacterStateControl[]
            {
                characterStateControl
            });
        }
        base.stateManager.SetBattleScreen(BattleScreen.PoisonHit);
        foreach (CharacterStateControl characterStateControl2 in this.GetTotalCharacters())
        {
            characterStateControl2.OnChipTrigger(EffectStatusBase.EffectTriggerType.DamagePossibility);
        }
        if (base.hierarchyData.batteWaves[base.battleStateData.currentWaveNumber].cameraType == 1)
        {
            base.stateManager.cameraControl.PlayCameraMotionAction("BigBoss/0002_command", base.battleStateData.stageSpawnPoint, true);
        }
        else
        {
            base.stateManager.cameraControl.PlayCameraMotionAction("0002_command", base.battleStateData.stageSpawnPoint, true);
        }
        List <CharacterStateControl> currentDeathCharacters = new List <CharacterStateControl>();
        List <int>            damage = new List <int>();
        List <bool>           isMiss = new List <bool>();
        CharacterStateControl currentDeathBigBoss = null;
        bool playedDeadSE = false;

        for (int k = 0; k < characters.Count; k++)
        {
            SufferStateProperty sufferStateProperty = characters[k].currentSufferState.GetSufferStateProperty(SufferStateProperty.SufferType.Poison);
            int poisonDamageFluctuation             = sufferStateProperty.GetPoisonDamageFluctuation(characters[k]);
            characters[k].hp -= poisonDamageFluctuation;
            damage.Add(poisonDamageFluctuation);
            isMiss.Add(false);
            if (!characters[k].isDied)
            {
                base.stateManager.threeDAction.PlayAnimationCharacterAction(CharacterAnimationType.hit, new CharacterStateControl[]
                {
                    characters[k]
                });
            }
            else
            {
                if (base.hierarchyData.batteWaves[base.battleStateData.currentWaveNumber].cameraType == 1 && characters[k].isEnemy)
                {
                    base.stateManager.threeDAction.PlayAnimationCharacterAction(CharacterAnimationType.strongHit, new CharacterStateControl[]
                    {
                        characters[k]
                    });
                    currentDeathBigBoss = characters[k];
                }
                else
                {
                    Action deathEffectPlay = delegate()
                    {
                        if (!playedDeadSE)
                        {
                            this.stateManager.soundPlayer.PlayDeathSE();
                        }
                        playedDeadSE = true;
                    };
                    base.stateManager.threeDAction.PlayDeadAnimationCharacterAction(deathEffectPlay, characters[k]);
                }
                currentDeathCharacters.Add(characters[k]);
            }
            HitEffectParams item = BattleEffectManager.Instance.GetEffect(AffectEffect.Poison.ToString()) as HitEffectParams;
            this.use_effect_params_.Add(item);
            base.stateManager.threeDAction.PlayHitEffectAction(this.use_effect_params_[k], characters[k]);
        }
        foreach (CharacterStateControl characterStateControl3 in this.GetTotalCharacters())
        {
            characterStateControl3.ClearGutsData();
        }
        List <HitIcon> hitIconlist = new List <HitIcon>();

        Vector3[] hitIconPositions = this.GetHitIconPositions(characters);
        for (int m = 0; m < characters.Count; m++)
        {
            HitIcon item2 = base.stateManager.uiControl.ApplyShowHitIcon(m, hitIconPositions[m], AffectEffect.Poison, damage[m], Strength.None, isMiss[m], false, false, false, false, ExtraEffectType.Non, true, null);
            hitIconlist.Add(item2);
        }
        base.stateManager.uiControl.HideCharacterHUDFunction();
        base.stateManager.uiControl.ShowCharacterHUDFunction(characters.ToArray());
        if (this.use_effect_params_.Count > 0)
        {
            base.stateManager.soundPlayer.TryPlaySE(this.use_effect_params_[0]);
        }
        Action hudReposition = delegate()
        {
            foreach (CharacterStateControl characterStateControl5 in characters)
            {
                this.stateManager.uiControl.RepositionCharacterHUDPosition(new CharacterStateControl[]
                {
                    characterStateControl5
                });
            }
            for (int n = 0; n < characters.Count; n++)
            {
                Vector3 fixableCharacterCenterPosition2DFunction = this.stateManager.uiControl.GetFixableCharacterCenterPosition2DFunction(characters[n]);
                hitIconlist[n].HitIconReposition(fixableCharacterCenterPosition2DFunction);
            }
        };

        if (currentDeathBigBoss != null)
        {
            base.stateManager.uiControl.Fade(Color.white, 1f, 1f);
        }
        float       waitSecond = base.stateManager.stateProperty.poisonHitEffectWaitSecond + ((currentDeathCharacters.Count <= 0) ? 0f : 1f);
        IEnumerator wait       = base.stateManager.time.WaitForCertainPeriodTimeAction(waitSecond, hudReposition, null);

        while (wait.MoveNext())
        {
            yield return(null);
        }
        if (this.use_effect_params_.Count > 0)
        {
            base.stateManager.soundPlayer.TryStopSE(this.use_effect_params_[0]);
        }
        base.stateManager.soundPlayer.StopHitEffectSE();
        foreach (CharacterStateControl characterStateControl4 in currentDeathCharacters)
        {
            characterStateControl4.isDiedJustBefore = true;
        }
        if (base.battleMode != BattleMode.PvP)
        {
            if (currentDeathBigBoss != null)
            {
                base.stateManager.cameraControl.StopCameraMotionAction("0002_command");
                IEnumerator transitionCount = base.stateManager.threeDAction.BigBossExitAction(currentDeathBigBoss);
                while (transitionCount.MoveNext())
                {
                    yield return(null);
                }
            }
            this.subStateEnemiesItemDroppingFunction.Init(currentDeathCharacters.ToArray());
            base.SetState(this.subStateEnemiesItemDroppingFunction.GetType());
            while (base.isWaitState)
            {
                yield return(null);
            }
            if (currentDeathBigBoss != null)
            {
                base.stateManager.cameraControl.StopCameraMotionAction("skillA");
            }
        }
        yield break;
    }
示例#16
0
 public void PlayAnimation(CharacterAnimationType type, SkillType attackType = SkillType.Attack, int motionIndex = 0, HitEffectParams hitEffectParams = null, Action callback = null)
 {
     if (!base.isActiveAndEnabled)
     {
         return;
     }
     this.PlayAnimationCorutine(type, attackType, motionIndex, hitEffectParams, callback, false);
 }
示例#17
0
    private IEnumerator RegenerateFunction()
    {
        List <CharacterStateControl> characters = this.GetSufferCharacters(SufferStateProperty.SufferType.Regenerate);

        if (characters.Count == 0)
        {
            yield break;
        }
        foreach (CharacterStateControl characterStateControl in base.stateManager.battleStateData.GetTotalCharacters())
        {
            base.stateManager.threeDAction.ShowAliveCharactersAction(new CharacterStateControl[]
            {
                characterStateControl
            });
            base.stateManager.threeDAction.PlayIdleAnimationUndeadCharactersAction(new CharacterStateControl[]
            {
                characterStateControl
            });
        }
        base.stateManager.uiControl.HideCharacterHUDFunction();
        base.stateManager.SetBattleScreen(BattleScreen.PoisonHit);
        if (base.hierarchyData.batteWaves[base.battleStateData.currentWaveNumber].cameraType == 1)
        {
            base.stateManager.cameraControl.PlayCameraMotionAction("BigBoss/0002_command", base.battleStateData.stageSpawnPoint, true);
        }
        else
        {
            base.stateManager.cameraControl.PlayCameraMotionAction("0002_command", base.battleStateData.stageSpawnPoint, true);
        }
        HitEffectParams regenerate_effect = BattleEffectManager.Instance.GetEffect(AffectEffect.HpRevival.ToString()) as HitEffectParams;

        this.use_effect_params_.Add(regenerate_effect);
        List <int>  damage = new List <int>();
        List <bool> isMiss = new List <bool>();

        for (int j = 0; j < characters.Count; j++)
        {
            SufferStateProperty sufferStateProperty = characters[j].currentSufferState.GetSufferStateProperty(SufferStateProperty.SufferType.Regenerate);
            int regenerate = sufferStateProperty.GetRegenerate(characters[j]);
            characters[j].hp += regenerate;
            damage.Add(regenerate);
            isMiss.Add(false);
            base.stateManager.threeDAction.PlayAnimationCharacterAction(CharacterAnimationType.revival, new CharacterStateControl[]
            {
                characters[j]
            });
        }
        base.stateManager.soundPlayer.TryPlaySE(regenerate_effect);
        List <HitIcon> hitIconlist = new List <HitIcon>();

        Vector3[] hitIconPositions = this.GetHitIconPositions(characters);
        for (int k = 0; k < characters.Count; k++)
        {
            HitIcon item = base.stateManager.uiControl.ApplyShowHitIcon(k, hitIconPositions[k], AffectEffect.Regenerate, damage[k], Strength.None, isMiss[k], false, false, false, false, ExtraEffectType.Non, true, null);
            hitIconlist.Add(item);
        }
        base.stateManager.uiControl.ShowCharacterHUDFunction(characters.ToArray());
        Action hudReposition = delegate()
        {
            foreach (CharacterStateControl characterStateControl2 in characters)
            {
                this.stateManager.uiControl.RepositionCharacterHUDPosition(new CharacterStateControl[]
                {
                    characterStateControl2
                });
            }
            for (int l = 0; l < characters.Count; l++)
            {
                Vector3 fixableCharacterCenterPosition2DFunction = this.stateManager.uiControl.GetFixableCharacterCenterPosition2DFunction(characters[l]);
                hitIconlist[l].HitIconReposition(fixableCharacterCenterPosition2DFunction);
            }
        };
        float       waitSecond = base.stateManager.stateProperty.poisonHitEffectWaitSecond;
        IEnumerator wait       = base.stateManager.time.WaitForCertainPeriodTimeAction(waitSecond, hudReposition, null);

        while (wait.MoveNext())
        {
            yield return(null);
        }
        base.stateManager.soundPlayer.TryStopSE(regenerate_effect);
        base.stateManager.soundPlayer.StopHitEffectSE();
        yield break;
    }
示例#18
0
    private void PlayAnimationCorutine(CharacterAnimationType type, SkillType attackType = SkillType.Attack, int motionIndex = 0, HitEffectParams hitEffectParams = null, Action callback = null, bool isSmooth = false)
    {
        if (!this._characterAnimation)
        {
            return;
        }
        if (this._isBigBoss && type == CharacterAnimationType.strongHit)
        {
            type = CharacterAnimationType.hit;
        }
        this.isPlayingAnimation = true;
        AnimationClip clip = this._characterAnimation.clip;

        this.currentAnimationType = type;
        switch (type)
        {
        case CharacterAnimationType.idle:
            if (!this._clips.idle)
            {
                return;
            }
            this._clips.idle.wrapMode     = WrapMode.Loop;
            this._characterAnimation.clip = this._clips.idle;
            goto IL_3CD;

        case CharacterAnimationType.hit:
            if (!this._clips.hit)
            {
                return;
            }
            this._clips.hit.wrapMode      = WrapMode.Once;
            this._characterAnimation.clip = this._clips.hit;
            goto IL_3CD;

        case CharacterAnimationType.dead:
            if (!this._clips.down)
            {
                return;
            }
            this._clips.down.wrapMode     = WrapMode.ClampForever;
            this._characterAnimation.clip = this._clips.down;
            goto IL_3CD;

        case CharacterAnimationType.guard:
            if (!this._clips.guard)
            {
                return;
            }
            this._clips.guard.wrapMode    = WrapMode.Once;
            this._characterAnimation.clip = this._clips.guard;
            goto IL_3CD;

        case CharacterAnimationType.revival:
            if (!this._clips.revival)
            {
                return;
            }
            this._clips.revival.wrapMode  = WrapMode.Once;
            this._characterAnimation.clip = this._clips.revival;
            goto IL_3CD;

        case CharacterAnimationType.win:
            if (!this._clips.win)
            {
                return;
            }
            this._clips.win.wrapMode      = WrapMode.Once;
            this._characterAnimation.clip = this._clips.win;
            goto IL_3CD;

        case CharacterAnimationType.eat:
            if (!this._clips.eat)
            {
                return;
            }
            this._clips.eat.wrapMode      = WrapMode.Once;
            this._characterAnimation.clip = this._clips.eat;
            goto IL_3CD;

        case CharacterAnimationType.move:
            if (!this._clips.move)
            {
                return;
            }
            if (this._isBigBoss)
            {
                this._clips.move.wrapMode = WrapMode.Once;
            }
            else
            {
                this._clips.move.wrapMode = WrapMode.Loop;
            }
            this._characterAnimation.clip = this._clips.move;
            goto IL_3CD;

        case CharacterAnimationType.down:
            if (!this._clips.down)
            {
                return;
            }
            this._clips.down.wrapMode     = WrapMode.ClampForever;
            this._characterAnimation.clip = this._clips.down;
            goto IL_3CD;

        case CharacterAnimationType.getup:
            if (!this._clips.getup)
            {
                return;
            }
            this._clips.getup.wrapMode    = WrapMode.Once;
            this._characterAnimation.clip = this._clips.getup;
            goto IL_3CD;

        case CharacterAnimationType.strongHit:
            if (!this._clips.down)
            {
                return;
            }
            this._clips.down.wrapMode     = WrapMode.Once;
            this._characterAnimation.clip = this._clips.down;
            goto IL_3CD;
        }
        AnimationClip attackClip = this._clips.GetAttackClip(attackType, motionIndex);

        if (!attackClip)
        {
            return;
        }
        if (attackType == SkillType.Deathblow)
        {
            attackClip.wrapMode = WrapMode.ClampForever;
        }
        else
        {
            attackClip.wrapMode = WrapMode.Once;
        }
        this._characterAnimation.clip = attackClip;
IL_3CD:
        if (BattleStateManager.current != null)
        {
            this.SetEscapeRotation(this.currentAnimationType == CharacterAnimationType.move);
        }
        if (type != CharacterAnimationType.strongHit)
        {
            if (this._characterAnimation.clip.wrapMode == WrapMode.Once || this._characterAnimation.clip.wrapMode == WrapMode.Default)
            {
                if (isSmooth)
                {
                    this._characterAnimation.CrossFadeQueued(this._characterAnimation.clip.name, this.AnimationCrossFadeLength, QueueMode.PlayNow);
                }
                else
                {
                    this._characterAnimation.PlayQueued(this._characterAnimation.clip.name, QueueMode.PlayNow);
                }
                if (this._clips.idle != null)
                {
                    this._characterAnimation.CrossFadeQueued(this._clips.idle.name, this.AnimationCrossFadeLength, QueueMode.CompleteOthers);
                }
            }
            else if (this._characterAnimation.clip.wrapMode == WrapMode.Loop)
            {
                if (!this._characterAnimation.isPlaying)
                {
                    if (isSmooth)
                    {
                        this._characterAnimation.CrossFadeQueued(this._characterAnimation.clip.name, this.AnimationCrossFadeLength, QueueMode.PlayNow);
                    }
                    else
                    {
                        this._characterAnimation.PlayQueued(this._characterAnimation.clip.name, QueueMode.PlayNow);
                    }
                }
                else if (this._characterAnimation.clip != clip)
                {
                    QueueMode queue = QueueMode.CompleteOthers;
                    if (type != CharacterAnimationType.idle)
                    {
                        queue = QueueMode.PlayNow;
                    }
                    this._characterAnimation.CrossFadeQueued(this._characterAnimation.clip.name, this.AnimationCrossFadeLength, queue);
                }
            }
            else if (isSmooth)
            {
                this._characterAnimation.CrossFadeQueued(this._characterAnimation.clip.name, this.AnimationCrossFadeLength, QueueMode.PlayNow);
            }
            else
            {
                this._characterAnimation.PlayQueued(this._characterAnimation.clip.name, QueueMode.PlayNow);
            }
        }
        else
        {
            if (isSmooth)
            {
                this._characterAnimation.CrossFadeQueued(this._characterAnimation.clip.name, this.AnimationCrossFadeLength, QueueMode.PlayNow);
            }
            else
            {
                this._characterAnimation.PlayQueued(this._characterAnimation.clip.name, QueueMode.PlayNow);
            }
            IEnumerator enumerator = this._characterAnimation.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    object         obj            = enumerator.Current;
                    AnimationState animationState = obj as AnimationState;
                    if (animationState.name.Replace(" - Queued Clone", string.Empty).Equals(this._characterAnimation.clip.name))
                    {
                        animationState.wrapMode = this._clips.getup.wrapMode;
                    }
                }
            }
            finally
            {
                IDisposable disposable;
                if ((disposable = (enumerator as IDisposable)) != null)
                {
                    disposable.Dispose();
                }
            }
            if (this._clips.getup)
            {
                this._clips.getup.wrapMode = WrapMode.Once;
                this._characterAnimation.CrossFadeQueued(this._clips.getup.name, this.AnimationCrossFadeLength, QueueMode.CompleteOthers);
            }
            if (this._clips.idle != null)
            {
                this._characterAnimation.CrossFadeQueued(this._clips.idle.name, this.AnimationCrossFadeLength, QueueMode.CompleteOthers);
            }
        }
        this.SetActiveRenderers(true);
        if (type == CharacterAnimationType.dead)
        {
            Action callbackDeathEffect = delegate()
            {
                if (callback != null)
                {
                    callback();
                }
                this.SetActiveRenderers(false);
                this.StopAnimation();
            };
            this.characterDeadEffect.PlayAnimation(hitEffectParams, 1f, callbackDeathEffect);
        }
    }