Ejemplo n.º 1
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);
    }