Exemplo n.º 1
0
    public void CacheAnimDataUseResource(AnimEventData animEventData, EffectNameAnalyzer name_analyzer = null, List <AnimEventData.EventData> cntAtkDataList = null)
    {
        if (!(animEventData == null))
        {
            animEventData.Initialize();
            AnimEventData.AnimData[] animations = animEventData.animations;
            int i = 0;
            for (int num = animations.Length; i < num; i++)
            {
                AnimEventData.EventData[] events = animations[i].events;
                int j = 0;
                for (int num2 = events.Length; j < num2; j++)
                {
                    AnimEventData.EventData eventData = events[j];
                    switch (eventData.id)
                    {
                    case AnimEventFormat.ID.EFFECT:
                    case AnimEventFormat.ID.EFFECT_ONESHOT:
                    case AnimEventFormat.ID.EFFECT_STATIC:
                    case AnimEventFormat.ID.EFFECT_LOOP_CUSTOM:
                    case AnimEventFormat.ID.CAMERA_EFFECT:
                    case AnimEventFormat.ID.EFFECT_SCALE_DEPEND_VALUE:
                    {
                        string text4 = eventData.stringArgs[0];
                        if (name_analyzer != null)
                        {
                            text4 = name_analyzer(text4);
                        }
                        if (!string.IsNullOrEmpty(text4))
                        {
                            CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, text4);
                        }
                        break;
                    }

                    case AnimEventFormat.ID.EFFECT_DEPEND_SP_ATTACK_TYPE:
                    {
                        int k = 1;
                        for (int num4 = eventData.stringArgs.Length; k < num4; k++)
                        {
                            string text7 = eventData.stringArgs[k];
                            if (name_analyzer != null && !string.IsNullOrEmpty(text7))
                            {
                                text7 = name_analyzer(text7);
                            }
                            if (!string.IsNullOrEmpty(text7))
                            {
                                CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, text7);
                            }
                        }
                        break;
                    }

                    case AnimEventFormat.ID.SE_ONESHOT:
                    case AnimEventFormat.ID.SE_LOOP_PLAY:
                        CacheSE(eventData.intArgs[0], null);
                        break;

                    case AnimEventFormat.ID.CONTINUS_ATTACK:
                    {
                        cntAtkDataList?.Add(eventData);
                        string text5 = eventData.stringArgs[2];
                        if (name_analyzer != null)
                        {
                            text5 = name_analyzer(text5);
                        }
                        if (!string.IsNullOrEmpty(text5))
                        {
                            CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, text5);
                        }
                        break;
                    }

                    case AnimEventFormat.ID.WEAKPOINT_ON:
                    {
                        Enemy.WEAK_STATE wEAK_STATE = (Enemy.WEAK_STATE)((eventData.intArgs.Length > 1) ? eventData.intArgs[1] : 0);
                        if (Enemy.IsWeakStateElementAttack(wEAK_STATE) || Enemy.IsWeakStateSkillAttack(wEAK_STATE) || Enemy.IsWeakStateHealAttack(wEAK_STATE) || Enemy.IsWeakStateCannonAttack(wEAK_STATE))
                        {
                            TargetMarker.EFFECT_TYPE eFFECT_TYPE = Enemy.WeakStateToEffectType(wEAK_STATE);
                            if (eFFECT_TYPE != TargetMarker.EFFECT_TYPE.NONE)
                            {
                                string           text2       = MonoBehaviourSingleton <InGameSettingsManager> .I.targetMarkerSettings.effectNames[(int)eFFECT_TYPE];
                                Enemy.WEAK_STATE wEAK_STATE2 = wEAK_STATE;
                                if (wEAK_STATE2 == Enemy.WEAK_STATE.WEAK_ELEMENT_ATTACK || wEAK_STATE2 == Enemy.WEAK_STATE.WEAK_ELEMENT_SKILL_ATTACK)
                                {
                                    int num3 = (eventData.intArgs.Length <= 2) ? (-1) : eventData.intArgs[2];
                                    if (num3 >= 0)
                                    {
                                        text2 += num3.ToString();
                                    }
                                }
                                CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, text2);
                            }
                        }
                        eventData.attackMode = Player.ATTACK_MODE.NONE;
                        string text3 = (eventData.stringArgs.Length <= 0) ? string.Empty : eventData.stringArgs[0];
                        if (!string.IsNullOrEmpty(text3))
                        {
                            if (!Enum.IsDefined(typeof(EQUIPMENT_TYPE), text3))
                            {
                                Log.Error("Undefined EQUIPMENT_TYPE name:" + text3);
                            }
                            else
                            {
                                EQUIPMENT_TYPE equipment_type = (EQUIPMENT_TYPE)(int)Enum.Parse(typeof(EQUIPMENT_TYPE), text3);
                                eventData.attackMode = Player.ConvertEquipmentTypeToAttackMode(equipment_type);
                            }
                        }
                        break;
                    }

                    case AnimEventFormat.ID.WEAKPOINT_ALL_ON:
                    {
                        eventData.attackMode = Player.ATTACK_MODE.NONE;
                        string text6 = (eventData.stringArgs.Length <= 0) ? string.Empty : eventData.stringArgs[0];
                        if (!string.IsNullOrEmpty(text6))
                        {
                            if (!Enum.IsDefined(typeof(EQUIPMENT_TYPE), text6))
                            {
                                Log.Error("Undefined EQUIPMENT_TYPE name:" + text6);
                            }
                            else
                            {
                                EQUIPMENT_TYPE equipment_type2 = (EQUIPMENT_TYPE)(int)Enum.Parse(typeof(EQUIPMENT_TYPE), text6);
                                eventData.attackMode = Player.ConvertEquipmentTypeToAttackMode(equipment_type2);
                            }
                        }
                        break;
                    }

                    case AnimEventFormat.ID.GENERATE_AEGIS:
                    {
                        string text = eventData.stringArgs[0];
                        if (!string.IsNullOrEmpty(text))
                        {
                            CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, text);
                        }
                        if (eventData.intArgs.Length >= 3 && eventData.intArgs[2] > 0)
                        {
                            CacheSE(eventData.intArgs[2], null);
                        }
                        if (eventData.intArgs.Length >= 4 && eventData.intArgs[3] > 0)
                        {
                            CacheSE(eventData.intArgs[3], null);
                        }
                        if (eventData.intArgs.Length >= 5 && eventData.intArgs[4] > 0)
                        {
                            CacheSE(eventData.intArgs[4], null);
                        }
                        break;
                    }
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
    public static Transform EffectEventExec(ID id, AnimEventData.EventData data, Transform transform, bool is_oneshot_priority, EffectNameAnalyzer name_analyzer = null, NodeFinder node_finder = null, Character chara = null)
    {
        //IL_0204: Unknown result type (might be due to invalid IL or missing references)
        //IL_0209: Unknown result type (might be due to invalid IL or missing references)
        //IL_020c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0210: Unknown result type (might be due to invalid IL or missing references)
        //IL_023b: Unknown result type (might be due to invalid IL or missing references)
        //IL_025e: Unknown result type (might be due to invalid IL or missing references)
        //IL_0263: Unknown result type (might be due to invalid IL or missing references)
        //IL_02d2: Unknown result type (might be due to invalid IL or missing references)
        //IL_02d7: Unknown result type (might be due to invalid IL or missing references)
        //IL_02da: Unknown result type (might be due to invalid IL or missing references)
        //IL_02de: Unknown result type (might be due to invalid IL or missing references)
        //IL_0309: Unknown result type (might be due to invalid IL or missing references)
        //IL_032c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0331: Unknown result type (might be due to invalid IL or missing references)
        //IL_034a: Unknown result type (might be due to invalid IL or missing references)
        //IL_034f: Unknown result type (might be due to invalid IL or missing references)
        //IL_036b: Unknown result type (might be due to invalid IL or missing references)
        //IL_0370: Unknown result type (might be due to invalid IL or missing references)
        //IL_0375: Unknown result type (might be due to invalid IL or missing references)
        //IL_0379: Unknown result type (might be due to invalid IL or missing references)
        //IL_0396: Unknown result type (might be due to invalid IL or missing references)
        //IL_039b: Unknown result type (might be due to invalid IL or missing references)
        //IL_03a0: Unknown result type (might be due to invalid IL or missing references)
        //IL_03a5: Unknown result type (might be due to invalid IL or missing references)
        //IL_03a7: Unknown result type (might be due to invalid IL or missing references)
        //IL_03a9: Unknown result type (might be due to invalid IL or missing references)
        //IL_03ab: Unknown result type (might be due to invalid IL or missing references)
        //IL_03ad: Unknown result type (might be due to invalid IL or missing references)
        //IL_03b6: Unknown result type (might be due to invalid IL or missing references)
        //IL_03bb: Unknown result type (might be due to invalid IL or missing references)
        //IL_03bf: Unknown result type (might be due to invalid IL or missing references)
        //IL_03c4: Unknown result type (might be due to invalid IL or missing references)
        //IL_03c8: Unknown result type (might be due to invalid IL or missing references)
        //IL_03dd: Unknown result type (might be due to invalid IL or missing references)
        //IL_03df: Unknown result type (might be due to invalid IL or missing references)
        //IL_03e3: Unknown result type (might be due to invalid IL or missing references)
        //IL_03ea: Unknown result type (might be due to invalid IL or missing references)
        if (id != ID.EFFECT && id != ID.EFFECT_ONESHOT && id != ID.EFFECT_STATIC && id != ID.EFFECT_LOOP_CUSTOM && id != ID.EFFECT_DEPEND_SP_ATTACK_TYPE && id != ID.EFFECT_DEPEND_WEAPON_ELEMENT && id != ID.EFFECT_SCALE_DEPEND_VALUE && id != ID.CAMERA_EFFECT)
        {
            return(null);
        }
        Transform val    = null;
        string    empty  = string.Empty;
        string    empty2 = string.Empty;

        if (id == ID.EFFECT_DEPEND_SP_ATTACK_TYPE)
        {
            if (object.ReferenceEquals(chara, null))
            {
                return(null);
            }
            Player player = chara as Player;
            if (object.ReferenceEquals(player, null))
            {
                return(null);
            }
            int num = (int)(1 + player.spAttackType);
            if (num >= data.stringArgs.Length)
            {
                return(null);
            }
            empty  = data.stringArgs[num];
            empty2 = data.stringArgs[0];
        }
        else
        {
            empty  = data.stringArgs[0];
            empty2 = ((data.stringArgs.Length <= 1) ? string.Empty : data.stringArgs[1]);
        }
        if (name_analyzer != null)
        {
            empty = name_analyzer(empty);
            if (empty == null)
            {
                return(null);
            }
        }
        int   num2 = data.floatArgs.Length;
        float num3 = (num2 <= 0) ? 1f : data.floatArgs[0];

        if (id == ID.CAMERA_EFFECT)
        {
            return(CreateCameraEffect(empty, num3, data));
        }
        Transform val2 = (node_finder != null) ? node_finder(empty2) : ((!string.IsNullOrEmpty(empty2)) ? Utility.Find(transform, empty2) : transform);

        switch (id)
        {
        case ID.EFFECT:
        case ID.EFFECT_STATIC:
        case ID.EFFECT_LOOP_CUSTOM:
        case ID.EFFECT_DEPEND_SP_ATTACK_TYPE:
        case ID.EFFECT_SCALE_DEPEND_VALUE:
            val = EffectManager.GetEffect(empty, val2);
            if (val == null)
            {
                Log.Warning("Failed to create effect!! " + empty);
            }
            else
            {
                if (id == ID.EFFECT_SCALE_DEPEND_VALUE && !object.ReferenceEquals(chara, null))
                {
                    num3 = chara.GetEffectScaleDependValue();
                }
                Vector3 localScale2 = val.get_localScale();
                val.set_localScale(localScale2 * num3);
                if (num2 >= 7)
                {
                    val.set_localPosition(new Vector3(data.floatArgs[1], data.floatArgs[2], data.floatArgs[3]));
                    val.set_localRotation(Quaternion.Euler(new Vector3(data.floatArgs[4], data.floatArgs[5], data.floatArgs[6])));
                }
            }
            break;

        case ID.EFFECT_DEPEND_WEAPON_ELEMENT:
        {
            Player player2 = chara as Player;
            if (!(player2 == null))
            {
                int currentWeaponElement = player2.GetCurrentWeaponElement();
                if (currentWeaponElement >= 0 && currentWeaponElement < 6)
                {
                    val = EffectManager.GetEffect(empty + currentWeaponElement.ToString(), val2);
                    if (!(val == null))
                    {
                        Vector3 localScale = val.get_localScale();
                        val.set_localScale(localScale * num3);
                        if (num2 >= 7)
                        {
                            val.set_localPosition(new Vector3(data.floatArgs[1], data.floatArgs[2], data.floatArgs[3]));
                            val.set_localRotation(Quaternion.Euler(new Vector3(data.floatArgs[4], data.floatArgs[5], data.floatArgs[6])));
                        }
                    }
                }
            }
            break;
        }

        case ID.EFFECT_ONESHOT:
        {
            Vector3    pos;
            Quaternion rot;
            if (num2 >= 7)
            {
                Matrix4x4  localToWorldMatrix = val2.get_localToWorldMatrix();
                Vector3    val3 = localToWorldMatrix.MultiplyPoint3x4(new Vector3(data.floatArgs[1], data.floatArgs[2], data.floatArgs[3]));
                Quaternion val4 = val2.get_rotation() * Quaternion.Euler(new Vector3(data.floatArgs[4], data.floatArgs[5], data.floatArgs[6]));
                pos = val3;
                rot = val4;
            }
            else
            {
                pos = val2.get_position();
                rot = val2.get_rotation();
            }
            if (val2.get_gameObject().get_activeInHierarchy())
            {
                EffectManager.OneShot(empty, pos, rot, val2.get_lossyScale() * num3, is_oneshot_priority, delegate(Transform effect)
                    {
                        //IL_0001: Unknown result type (might be due to invalid IL or missing references)
                        rymFX component = effect.get_gameObject().GetComponent <rymFX>();
                        if (component != null)
                        {
                            component.LoopEnd    = true;
                            component.AutoDelete = true;
                        }
                    });
            }
            break;
        }
        }
        return(val);
    }