Example #1
0
 private void Awake()
 {
     playerSprites        = GetComponent <PlayerSprites>();
     playerNetworkActions = GetComponent <PlayerNetworkActions>();
     registerTile         = GetComponent <RegisterPlayer>();
     playerHealth         = GetComponent <PlayerHealth>();
     pushPull             = GetComponent <ObjectBehaviour>();
     weaponNetworkActions = GetComponent <WeaponNetworkActions>();
     mouseInputController = GetComponent <MouseInputController>();
     hitIcon           = GetComponentInChildren <HitIcon>(true);
     playerMove        = GetComponent <PlayerMove>();
     playerDirectional = GetComponent <Directional>();
 }
Example #2
0
    private IEnumerator InstantDeathFunction()
    {
        List <CharacterStateControl> characters = BattleFunctionUtility.GetSufferCharacters(SufferStateProperty.SufferType.InstantDeath, base.battleStateData);
        bool playedDeadSE = false;
        Dictionary <CharacterStateControl, bool> hit = new Dictionary <CharacterStateControl, bool>(characters.Count);

        if (characters.Count == 0)
        {
            yield break;
        }
        List <HitIcon> hitIconlist = new List <HitIcon>();

        Vector3[] hitIconPositions = BattleFunctionUtility.GetHitIconPositions(base.stateManager.uiControl, characters);
        for (int i = 0; i < characters.Count; i++)
        {
            SufferStateProperty sufferStateProperty = characters[i].currentSufferState.GetSufferStateProperty(SufferStateProperty.SufferType.InstantDeath);
            hit.Add(characters[i], sufferStateProperty.isMiss);
            HitIcon item = base.stateManager.uiControl.ApplyShowHitIcon(i, hitIconPositions[i], AffectEffect.InstantDeath, 0, Strength.None, sufferStateProperty.isMiss, false, false, false, false, ExtraEffectType.Non, true, null);
            hitIconlist.Add(item);
        }
        this.ShowDigimon(characters);
        this.PlayCamera(characters);
        base.stateManager.cameraControl.PlayCameraShake();
        base.stateManager.uiControl.ShowCharacterHUDFunction(characters.ToArray());
        Action hudReposition = delegate()
        {
            foreach (CharacterStateControl characterStateControl2 in characters)
            {
                this.stateManager.uiControl.RepositionCharacterHUDPosition(new CharacterStateControl[]
                {
                    characterStateControl2
                });
            }
            for (int j = 0; j < characters.Count; j++)
            {
                Vector3 fixableCharacterCenterPosition2DFunction = this.stateManager.uiControl.GetFixableCharacterCenterPosition2DFunction(characters[j]);
                hitIconlist[j].HitIconReposition(fixableCharacterCenterPosition2DFunction);
            }
        };
        float       waitSecond = base.stateManager.stateProperty.skillAfterWaitSecond;
        IEnumerator wait       = base.stateManager.time.WaitForCertainPeriodTimeAction(waitSecond, hudReposition, null);

        while (wait.MoveNext())
        {
            yield return(null);
        }
        base.stateManager.cameraControl.StopCameraShake();
        foreach (CharacterStateControl characterStateControl in characters)
        {
            if (!hit[characterStateControl])
            {
                Action deathEffectPlay = delegate()
                {
                    if (!playedDeadSE)
                    {
                        this.stateManager.soundPlayer.PlayDeathSE();
                    }
                    playedDeadSE = true;
                };
                base.stateManager.threeDAction.PlayDeadAnimationCharacterAction(deathEffectPlay, characterStateControl);
                characterStateControl.Kill();
                characterStateControl.isDiedJustBefore = true;
            }
            characterStateControl.currentSufferState.RemoveSufferState(SufferStateProperty.SufferType.InstantDeath, false);
        }
        IEnumerator end_wait = base.stateManager.time.WaitForCertainPeriodTimeAction(base.stateManager.stateProperty.skillAfterWaitSecond, null, null);

        while (end_wait.MoveNext())
        {
            yield return(null);
        }
        yield break;
    }
Example #3
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;
    }
Example #4
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 #5
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;
    }