public static GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] GetInvocationList(GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffects, EffectStatusBase.EffectTriggerType targetType, int monsterGroupId, CharacterStateControl characterStateControl, int areaId)
    {
        List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> list = new List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect>();

        foreach (GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffect in chipEffects)
        {
            EffectStatusBase.EffectTriggerType effectTriggerType = (EffectStatusBase.EffectTriggerType)chipEffect.effectTrigger.ToInt32();
            if (targetType == effectTriggerType)
            {
                int num = 10000;
                if (chipEffect.lot != null && chipEffect.lot.Length > 0)
                {
                    num = chipEffect.lot.ToInt32();
                }
                if (num > 0)
                {
                    if (num != 10000)
                    {
                        int num2 = UnityEngine.Random.Range(0, 10000);
                        if (num2 > num)
                        {
                            goto IL_119;
                        }
                    }
                    if (ChipEffectStatus.CheckInvocation(chipEffect.targetType, chipEffect.targetSubType, chipEffect.targetValue, chipEffect.targetValue2, chipEffect.effectType, chipEffect.effectValue, chipEffect.effectTrigger, chipEffect.effectTriggerValue, monsterGroupId, characterStateControl, areaId) && ChipEffectStatus.CheckInvocation(chipEffect.targetType, chipEffect.targetSubType, chipEffect.targetValue, chipEffect.targetValue2, chipEffect.effectType, chipEffect.effectValue, chipEffect.effectTrigger2, chipEffect.effectTriggerValue2, monsterGroupId, characterStateControl, areaId))
                    {
                        list.Add(chipEffect);
                    }
                }
            }
            IL_119 :;
        }
        return(list.ToArray());
    }
Beispiel #2
0
    public static List <ExtraEffectStatus> GetInvocationList(List <ExtraEffectStatus> extraEffectStatuses, EffectStatusBase.EffectTriggerType effectTriggerType)
    {
        List <ExtraEffectStatus> list = new List <ExtraEffectStatus>();

        foreach (ExtraEffectStatus extraEffectStatus in extraEffectStatuses)
        {
            EffectStatusBase.EffectTriggerType effectTrigger = (EffectStatusBase.EffectTriggerType)extraEffectStatus.EffectTrigger;
            if (effectTrigger == effectTriggerType)
            {
                list.Add(extraEffectStatus);
            }
        }
        List <ExtraEffectStatus> list2 = new List <ExtraEffectStatus>();

        if (effectTriggerType != EffectStatusBase.EffectTriggerType.WaveStarted)
        {
            if (effectTriggerType != EffectStatusBase.EffectTriggerType.RoundEnd)
            {
                list2.AddRange(list);
            }
            else
            {
                List <ExtraEffectStatus> loopPlayExtraEffectStatusList = ExtraEffectStatus.GetLoopPlayExtraEffectStatusList(list, BattleStateManager.current.battleStateData.currentRoundNumber);
                list2.AddRange(loopPlayExtraEffectStatusList);
            }
        }
        else
        {
            int targetNumber = BattleStateManager.current.battleStateData.currentWaveNumber + 1;
            List <ExtraEffectStatus> loopPlayExtraEffectStatusList2 = ExtraEffectStatus.GetLoopPlayExtraEffectStatusList(list, targetNumber);
            list2.AddRange(loopPlayExtraEffectStatusList2);
        }
        return(list2);
    }
Beispiel #3
0
    public void RemovePotencyChip(EffectStatusBase.EffectTriggerType triggerType)
    {
        List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> list = new List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect>();

        foreach (int num in this.potencyChipIdList.Keys)
        {
            GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffectDataToId = ChipDataMng.GetChipEffectDataToId(num.ToString());
            if (chipEffectDataToId != null && chipEffectDataToId.effectTrigger.ToInt32() == (int)triggerType)
            {
                list.Add(chipEffectDataToId);
            }
        }
        foreach (GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffect in list)
        {
            this.potencyChipIdList.Remove(chipEffect.chipEffectId.ToInt32());
        }
        this.AddChipParam(false, list.ToArray(), true, false);
    }
    private IEnumerator PlayStageEffect(EffectStatusBase.EffectTriggerType effectTriggerType)
    {
        bool isBigBoss = base.hierarchyData.batteWaves[base.battleStateData.currentWaveNumber].cameraType == 1;
        List <ExtraEffectStatus> extraEffectStatus = BattleStateManager.current.battleStateData.extraEffectStatus;
        List <ExtraEffectStatus> invocationList    = ExtraEffectStatus.GetInvocationList(extraEffectStatus, effectTriggerType);

        if (invocationList.Count == 0)
        {
            yield break;
        }
        base.stateManager.uiControl.HideCharacterHUDFunction();
        base.stateManager.SetBattleScreen(BattleScreen.PoisonHit);
        this.cameraKey = "0002_command";
        if (isBigBoss)
        {
            this.cameraKey = "BigBoss/0002_command";
        }
        base.stateManager.cameraControl.PlayCameraMotionAction(this.cameraKey, base.battleStateData.stageSpawnPoint, true);
        foreach (ExtraEffectStatus invocation in invocationList)
        {
            IEnumerator function = null;
            EffectStatusBase.ExtraEffectType effectType = (EffectStatusBase.ExtraEffectType)invocation.EffectType;
            if (effectType != EffectStatusBase.ExtraEffectType.LeaderChange)
            {
                function = this.PlayDefaultEffect(invocation);
            }
            else
            {
                function = this.PlayLeaderChange(invocation);
            }
            while (function.MoveNext())
            {
                yield return(null);
            }
            if (base.stateManager.IsLastBattleAndAllDeath())
            {
                break;
            }
        }
        base.stateManager.cameraControl.StopCameraMotionAction(this.cameraKey);
        yield break;
    }
Beispiel #5
0
 public void SetCharacterState(CharacterStateControlStore savedCSC)
 {
     this.SetChipEffectCount(savedCSC.chipEffectCount);
     this.SetPotencyChipIdList(savedCSC.potencyChipIdList);
     foreach (int num in this.potencyChipIdList.Keys)
     {
         GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffectDataToId = ChipDataMng.GetChipEffectDataToId(num.ToString());
         if (chipEffectDataToId != null)
         {
             GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffects = new GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[]
             {
                 chipEffectDataToId
             };
             EffectStatusBase.EffectTriggerType effectTriggerType = (EffectStatusBase.EffectTriggerType)chipEffectDataToId.effectTrigger.ToInt32();
             if (effectTriggerType != EffectStatusBase.EffectTriggerType.Usually && effectTriggerType != EffectStatusBase.EffectTriggerType.Area)
             {
                 this.AddChipParam(true, chipEffects, true, false);
             }
         }
     }
 }
Beispiel #6
0
 private List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> GetChipTriggerList(EffectStatusBase.EffectTriggerType triggerType)
 {
     if (!this.triggerChips.ContainsKey(triggerType))
     {
         List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> list = new List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect>();
         foreach (int num in this.characterStateControl.characterStatus.chipIds)
         {
             GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffectData = ChipDataMng.GetChipEffectData(num.ToString());
             if (chipEffectData != null)
             {
                 foreach (GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffect in chipEffectData)
                 {
                     if (chipEffect.effectTrigger.ToInt32() == (int)triggerType)
                     {
                         list.Add(chipEffect);
                     }
                 }
             }
         }
         this.triggerChips.Add(triggerType, list);
     }
     return(this.triggerChips[triggerType]);
 }
Beispiel #7
0
    public void OnChipTrigger(EffectStatusBase.EffectTriggerType triggerType)
    {
        List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> chipTriggerList = this.GetChipTriggerList(triggerType);

        if (chipTriggerList.Count == 0)
        {
            return;
        }
        GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[]      invocationList = ChipEffectStatus.GetInvocationList(chipTriggerList.ToArray(), triggerType, this.characterStateControl.groupId.ToInt32(), this.characterStateControl, BattleStateManager.current.hierarchyData.areaId);
        List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> list           = new List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect>();

        using (List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> .Enumerator enumerator = chipTriggerList.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffect = enumerator.Current;
                if (!invocationList.Where((GameWebAPI.RespDataMA_ChipEffectM.ChipEffect item) => item.chipEffectId == chipEffect.chipEffectId).Any <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect>())
                {
                    int key = chipEffect.chipEffectId.ToInt32();
                    if (this.potencyChipIdList.ContainsKey(key))
                    {
                        this.potencyChipIdList.Remove(key);
                        list.Add(chipEffect);
                    }
                }
            }
        }
        bool isAll  = triggerType != EffectStatusBase.EffectTriggerType.Usually;
        bool isArea = triggerType == EffectStatusBase.EffectTriggerType.Area;

        this.AddChipParam(true, this.GetAddChipParamEffects(invocationList).ToArray(), isAll, isArea);
        if (list.Count > 0)
        {
            this.AddChipParam(false, list.ToArray(), true, false);
        }
    }
Beispiel #8
0
    private List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> GetAddChipParamEffects(GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipInvocationEffects)
    {
        List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> list = new List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect>();

        foreach (GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffect in chipInvocationEffects)
        {
            int  num  = chipEffect.chipEffectId.ToInt32();
            bool flag = true;
            if (!this.potencyChipIdList.ContainsKey(num))
            {
                if (this.chipEffectCount.ContainsKey(num))
                {
                    if (this.chipEffectCount[num] <= 0)
                    {
                        goto IL_3A8;
                    }
                    Dictionary <int, int> dictionary;
                    int key;
                    (dictionary = this.chipEffectCount)[key = num] = dictionary[key] - 1;
                }
                if (chipEffect.effectType.ToInt32() == 57)
                {
                    int value;
                    if (chipEffect.effectSubType.ToInt32() == 1)
                    {
                        value = chipEffect.effectValue.ToInt32();
                    }
                    else if (chipEffect.effectSubType.ToInt32() == 2)
                    {
                        value = chipEffect.effectValue.ToInt32();
                    }
                    else if (chipEffect.effectSubType.ToInt32() == 3)
                    {
                        value = (int)((float)this.characterStateControl.extraMaxHp * chipEffect.effectValue.ToFloat());
                    }
                    else
                    {
                        value = chipEffect.effectValue.ToInt32();
                    }
                    int hp = Mathf.Clamp(value, 1, this.characterStateControl.extraMaxHp);
                    this.gutsData = new CharacterStateControlChip.GutsData(chipEffect.chipId, chipEffect.chipEffectId, hp);
                    flag          = false;
                }
                if (chipEffect.effectType.ToInt32() == 61)
                {
                    bool flag2 = false;
                    if (chipEffect.effectTrigger.ToInt32() == 31 || chipEffect.effectTrigger.ToInt32() == 32 || chipEffect.effectTrigger.ToInt32() == 33 || chipEffect.effectTrigger.ToInt32() == 34 || chipEffect.effectTrigger.ToInt32() == 35 || chipEffect.effectTrigger.ToInt32() == 36)
                    {
                        flag2 = true;
                    }
                    BattleServerControl         serverControl            = BattleStateManager.current.serverControl;
                    List <AffectEffectProperty> affectEffectPropertyList = serverControl.GetAffectEffectPropertyList(chipEffect.effectValue);
                    if (affectEffectPropertyList != null)
                    {
                        foreach (AffectEffectProperty affectEffectProperty in affectEffectPropertyList)
                        {
                            if (flag2)
                            {
                                EffectStatusBase.EffectTriggerType key2 = (EffectStatusBase.EffectTriggerType)chipEffect.effectTrigger.ToInt32();
                                if (!this.characterStateControl.everySkillList.ContainsKey(key2))
                                {
                                    this.characterStateControl.everySkillList.Add(key2, new List <AffectEffectProperty>());
                                }
                                this.characterStateControl.everySkillList[key2].Add(affectEffectProperty);
                            }
                            else
                            {
                                this.characterStateControl.currentSkillStatus.AddAffectEffect(affectEffectProperty);
                            }
                        }
                    }
                    flag = false;
                }
                if (chipEffect.effectType.ToInt32() == 70 || chipEffect.effectType.ToInt32() == 72 || chipEffect.effectType.ToInt32() == 71 || chipEffect.effectType.ToInt32() == 73 || chipEffect.effectType.ToInt32() == 74)
                {
                    this.isServerAddValue = true;
                }
                list.Add(chipEffect);
                if (chipEffect.effectType.ToInt32() != 57 && chipEffect.effectType.ToInt32() != 60 && chipEffect.effectType.ToInt32() != 61 && chipEffect.effectType.ToInt32() != 56 && !this.potencyChipIdList.ContainsKey(num))
                {
                    this.potencyChipIdList.Add(num, chipEffect.targetType.ToInt32());
                }
                if (flag && !this.stagingChipIdList.ContainsKey(num))
                {
                    this.stagingChipIdList.Add(num, chipEffect.chipId.ToInt32());
                }
            }
            IL_3A8 :;
        }
        return(list);
    }
 private IEnumerator PlaySkill()
 {
     foreach (CharacterStateControl characterStateControl in this.GetTotalCharacters())
     {
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.AttackStarted);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.SkillStartedApMax);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.AttackCommandedTarget);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.SkillSpecies);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.SkillTargetSpecies);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.SkillDamageStartedSend);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.SkillDamageStartedRecieve);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.SkillAttributeStartedSend);
         characterStateControl.OnChipTrigger(EffectStatusBase.EffectTriggerType.SkillAttributeStartedRecieve);
     }
     CharacterStateControl[] totalCharacters = base.stateManager.battleStateData.GetTotalCharacters();
     if (totalCharacters.Where((CharacterStateControl item) => item.stagingChipIdList.Count > 0).Any <CharacterStateControl>())
     {
         base.stateManager.cameraControl.PlayTweenCameraMotion(base.battleStateData.commandSelectTweenTargetCamera, null);
         base.stateManager.cameraControl.SetCameraLengthAction(base.battleStateData.commandSelectTweenTargetCamera);
     }
     base.SetState(this.subStateWaitForCertainPeriodTimeAction.GetType());
     while (base.isWaitState)
     {
         yield return(null);
     }
     base.SetState(this.subStatePlayChipEffect.GetType());
     while (base.isWaitState)
     {
         yield return(null);
     }
     if (this.lastCharacter.isEnemy)
     {
         BattleWave battleWave = base.hierarchyData.batteWaves[base.battleStateData.currentWaveNumber];
         if (!battleWave.enemiesInfinityApFlag[this.lastCharacter.myIndex])
         {
             this.lastCharacter.currentSkillStatus.OnAttackUseAttackerAp(this.lastCharacter);
         }
     }
     else
     {
         this.lastCharacter.currentSkillStatus.OnAttackUseAttackerAp(this.lastCharacter);
     }
     this.lastCharacter.AddSkillUseCount(this.lastCharacter.isSelectSkill, -1);
     if (this.lastCharacter.currentSkillStatus.skillType == SkillType.Attack)
     {
         base.battleStateData.isInvocationEffectPlaying = true;
     }
     base.stateManager.time.SetPlaySpeed(base.hierarchyData.on2xSpeedPlay, base.battleStateData.isShowMenuWindow);
     base.stateManager.uiControl.ApplyTurnActionBarSwipeout(true);
     base.SetState(this.subStatePlayInvocationEffectAction.GetType());
     while (base.isWaitState)
     {
         yield return(null);
     }
     if (this.lastCharacter.currentSkillStatus.skillType == SkillType.Attack)
     {
         base.battleStateData.isInvocationEffectPlaying = false;
     }
     base.stateManager.time.SetPlaySpeed(base.hierarchyData.on2xSpeedPlay, base.battleStateData.isShowMenuWindow);
     if (!this.lastCharacter.isEnemy)
     {
         base.battleStateData.lastAttackPlayerCharacterIndex = this.lastCharacter.myIndex;
     }
     base.stateManager.uiControl.ApplyTurnActionBarSwipeout(false);
     base.stateManager.uiControl.CharacterHudResetAndUpdate(false);
     base.battleStateData.SetChipSkillFlag(false);
     base.battleStateData.isConfusionAttack = base.stateManager.roundFunction.onConfusion;
     base.SetState(this.subStateSkillDetailsFunction.GetType());
     while (base.isWaitState)
     {
         yield return(null);
     }
     base.battleStateData.isConfusionAttack = false;
     this.isSkillEnd = true;
     CharacterStateControl[] playerCharacters = base.stateManager.battleStateData.playerCharacters.Where((CharacterStateControl item) => item.stagingChipIdList.Count > 0).ToArray <CharacterStateControl>();
     CharacterStateControl[] enemies          = base.stateManager.battleStateData.enemies.Where((CharacterStateControl item) => item.stagingChipIdList.Count > 0).ToArray <CharacterStateControl>();
     if (playerCharacters.Count <CharacterStateControl>() + enemies.Count <CharacterStateControl>() > 1)
     {
         base.stateManager.cameraControl.PlayTweenCameraMotion(base.battleStateData.commandSelectTweenTargetCamera, null);
         base.stateManager.cameraControl.SetCameraLengthAction(base.battleStateData.commandSelectTweenTargetCamera);
         CharacterStateControl[] characters = base.battleStateData.GetTotalCharacters().Where((CharacterStateControl item) => !item.isDied).ToArray <CharacterStateControl>();
         base.stateManager.threeDAction.ShowAllCharactersAction(characters);
         base.stateManager.threeDAction.PlayIdleAnimationActiveCharacterAction(characters);
     }
     else if (playerCharacters.Count <CharacterStateControl>() == 1)
     {
         string cameraKey = "skillF";
         base.stateManager.cameraControl.PlayCameraMotionActionCharacter(cameraKey, playerCharacters[0]);
         base.stateManager.cameraControl.SetTime(cameraKey, 1f);
         CharacterStateControl[] characters2 = base.battleStateData.playerCharacters.Where((CharacterStateControl item) => !item.isDied).ToArray <CharacterStateControl>();
         base.stateManager.threeDAction.ShowAllCharactersAction(characters2);
         base.stateManager.threeDAction.PlayIdleAnimationActiveCharacterAction(characters2);
     }
     else if (enemies.Count <CharacterStateControl>() == 1)
     {
         string cameraKey2 = "skillF";
         base.stateManager.cameraControl.PlayCameraMotionActionCharacter(cameraKey2, enemies[0]);
         base.stateManager.cameraControl.SetTime(cameraKey2, 1f);
         CharacterStateControl[] characters3 = base.battleStateData.enemies.Where((CharacterStateControl item) => !item.isDied).ToArray <CharacterStateControl>();
         base.stateManager.threeDAction.ShowAllCharactersAction(characters3);
         base.stateManager.threeDAction.PlayIdleAnimationActiveCharacterAction(characters3);
     }
     base.SetState(this.subStateWaitForCertainPeriodTimeAction.GetType());
     while (base.isWaitState)
     {
         yield return(null);
     }
     base.SetState(this.subStatePlayChipEffect.GetType());
     while (base.isWaitState)
     {
         yield return(null);
     }
     EffectStatusBase.EffectTriggerType[] triggers = new EffectStatusBase.EffectTriggerType[]
     {
         EffectStatusBase.EffectTriggerType.AttackStarted,
         EffectStatusBase.EffectTriggerType.SkillStartedApMax,
         EffectStatusBase.EffectTriggerType.AttackCommandedTarget,
         EffectStatusBase.EffectTriggerType.SkillSpecies,
         EffectStatusBase.EffectTriggerType.SkillTargetSpecies,
         EffectStatusBase.EffectTriggerType.SkillDamageStartedSend,
         EffectStatusBase.EffectTriggerType.SkillDamageStartedRecieve,
         EffectStatusBase.EffectTriggerType.SkillAttributeStartedSend,
         EffectStatusBase.EffectTriggerType.SkillAttributeStartedRecieve
     };
     foreach (CharacterStateControl characterStateControl2 in this.GetTotalCharacters())
     {
         characterStateControl2.RemovePotencyChip(triggers);
     }
     yield break;
 }
Beispiel #10
0
 public void RemovePotencyChip(EffectStatusBase.EffectTriggerType triggerType)
 {
     this.chip.RemovePotencyChip(triggerType);
 }
Beispiel #11
0
 public void OnChipTrigger(EffectStatusBase.EffectTriggerType triggerType)
 {
     this.chip.OnChipTrigger(triggerType);
 }