Ejemplo n.º 1
0
    public GameObject CreateTreasureBox(UIDropAnnounce.COLOR color)
    {
        switch (color)
        {
        case UIDropAnnounce.COLOR.NORMAL:
            return(RealizeTreasureBox(dropNCaches, MonoBehaviourSingleton <InGameLinkResourcesField> .I.dropItemBoxN));

        case UIDropAnnounce.COLOR.DELIVERY:
            return(RealizeTreasureBox(dropHNCaches, MonoBehaviourSingleton <InGameLinkResourcesField> .I.dropItemBoxHN));

        case UIDropAnnounce.COLOR.RARE:
            return(RealizeTreasureBox(dropRCaches, MonoBehaviourSingleton <InGameLinkResourcesField> .I.dropItemBoxR));

        case UIDropAnnounce.COLOR.LOUNGE:
            return(RealizeTreasureBox(dropLoungeCaches, MonoBehaviourSingleton <InGameLinkResourcesField> .I.dropItemLoungeShare));

        case UIDropAnnounce.COLOR.SP_N:
            return(RealizeTreasureBox(dropSPNCaches, MonoBehaviourSingleton <InGameLinkResourcesField> .I.dropItemBoxSPN));

        case UIDropAnnounce.COLOR.SP_HN:
            return(RealizeTreasureBox(dropSPHNCaches, MonoBehaviourSingleton <InGameLinkResourcesField> .I.dropItemBoxSPHN));

        case UIDropAnnounce.COLOR.SP_R:
            return(RealizeTreasureBox(dropSPRCaches, MonoBehaviourSingleton <InGameLinkResourcesField> .I.dropItemBoxSPR));

        case UIDropAnnounce.COLOR.HALLOWEEN:
            return(RealizeTreasureBox(dropHalloweenCaches, MonoBehaviourSingleton <InGameLinkResourcesField> .I.dropItemHalloween));

        default:
            return(null);
        }
    }
    }    //IL_002d: Unknown result type (might be due to invalid IL or missing references)

    //IL_0032: Unknown result type (might be due to invalid IL or missing references)


    public static FieldDropObject Create(Coop_Model_EnemyDefeat model, List <InGameManager.DropDeliveryInfo> deliveryList, List <InGameManager.DropItemInfo> itemList)
    {
        if (itemList.Count <= 0 && deliveryList.Count <= 0)
        {
            return(null);
        }
        UIDropAnnounce.COLOR color = GetColor(model, deliveryList);
        return(CreateTreasureBox(model, deliveryList, itemList, color));
    }
    public static FieldDropObject CreateTreasureBox(Coop_Model_EnemyDefeat model, List <InGameManager.DropDeliveryInfo> deliveryList, List <InGameManager.DropItemInfo> itemList, UIDropAnnounce.COLOR color)
    {
        //IL_004a: Unknown result type (might be due to invalid IL or missing references)
        //IL_004f: Unknown result type (might be due to invalid IL or missing references)
        //IL_0138: Unknown result type (might be due to invalid IL or missing references)
        //IL_013a: Unknown result type (might be due to invalid IL or missing references)
        //IL_013b: Unknown result type (might be due to invalid IL or missing references)
        //IL_0140: Unknown result type (might be due to invalid IL or missing references)
        //IL_014b: Unknown result type (might be due to invalid IL or missing references)
        //IL_0151: Unknown result type (might be due to invalid IL or missing references)
        //IL_0153: Unknown result type (might be due to invalid IL or missing references)
        //IL_016b: Unknown result type (might be due to invalid IL or missing references)
        //IL_0170: Unknown result type (might be due to invalid IL or missing references)
        //IL_0182: Unknown result type (might be due to invalid IL or missing references)
        //IL_0187: Unknown result type (might be due to invalid IL or missing references)
        //IL_0196: Unknown result type (might be due to invalid IL or missing references)
        //IL_0198: Unknown result type (might be due to invalid IL or missing references)
        GameObject val = MonoBehaviourSingleton <InGameManager> .I.CreateTreasureBox(color);

        FieldDropObject fieldDropObject = val.GetComponent <FieldDropObject>();

        if (fieldDropObject == null)
        {
            fieldDropObject = val.AddComponent <FieldDropObject>();
        }
        fieldDropObject.itemInfo     = itemList;
        fieldDropObject.deliveryInfo = deliveryList;
        fieldDropObject.rewardId     = model.rewardId;
        fieldDropObject.isRare       = (color == UIDropAnnounce.COLOR.RARE);
        Vector3 zero = Vector3.get_zero();

        if (MonoBehaviourSingleton <InGameSettingsManager> .IsValid())
        {
            InGameSettingsManager.FieldDropItem fieldDrop = MonoBehaviourSingleton <InGameSettingsManager> .I.fieldDrop;
            float value  = Random.get_value();
            float value2 = Random.get_value();
            float value3 = Random.get_value();
            float num    = (!(Random.get_value() > 0.5f)) ? 1f : (-1f);
            float num2   = (!(Random.get_value() > 0.5f)) ? 1f : (-1f);
            zero._002Ector(Mathf.Lerp(fieldDrop.offsetMin.x, fieldDrop.offsetMax.x, value) * num, Mathf.Lerp(fieldDrop.offsetMin.y, fieldDrop.offsetMax.y, value2), Mathf.Lerp(fieldDrop.offsetMin.z, fieldDrop.offsetMax.z, value3) * num2);
        }
        Vector3 val2 = default(Vector3);

        val2._002Ector((float)model.x, 0f, (float)model.z);
        Vector3    target       = val2 + zero;
        int        obstacleMask = AIUtility.GetObstacleMask();
        RaycastHit hit          = default(RaycastHit);

        if (AIUtility.RaycastForTargetPos(val2, target, obstacleMask, out hit))
        {
            Vector3 point  = hit.get_point();
            float   x      = point.x;
            float   y      = target.y;
            Vector3 point2 = hit.get_point();
            target._002Ector(x, y, point2.z);
        }
        fieldDropObject.Drop(val2, target);
        return(fieldDropObject);
    }
    private static UIDropAnnounce.COLOR GetColor(Coop_Model_EnemyDefeat model, List <InGameManager.DropDeliveryInfo> deliveryList)
    {
        UIDropAnnounce.COLOR cOLOR = UIDropAnnounce.COLOR.NORMAL;
        if (!model.dropLoungeShare)
        {
            switch (model.boxType)
            {
            case 1:
                return(UIDropAnnounce.COLOR.SP_N);

            case 2:
                return(UIDropAnnounce.COLOR.SP_HN);

            case 3:
                return(UIDropAnnounce.COLOR.SP_R);

            case 4:
                return(UIDropAnnounce.COLOR.HALLOWEEN);

            default:
            {
                int i = 0;
                for (int count = model.dropIds.Count; i < count; i++)
                {
                    if (cOLOR == UIDropAnnounce.COLOR.NORMAL)
                    {
                        switch (model.dropTypes[i])
                        {
                        case 5:
                            cOLOR = UIDropAnnounce.COLOR.RARE;
                            break;

                        case 4:
                        {
                            EquipItemTable.EquipItemData equipItemData = Singleton <EquipItemTable> .I.GetEquipItemData((uint)model.dropItemIds[i]);

                            if (equipItemData != null && GameDefine.IsRare(equipItemData.rarity))
                            {
                                cOLOR = UIDropAnnounce.COLOR.RARE;
                            }
                            break;
                        }

                        default:
                        {
                            ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData((uint)model.dropItemIds[i]);

                            if (itemData != null && GameDefine.IsRare(itemData.rarity))
                            {
                                cOLOR = UIDropAnnounce.COLOR.RARE;
                            }
                            break;
                        }
                        }
                    }
                }
                if (deliveryList.Count > 0 && cOLOR == UIDropAnnounce.COLOR.NORMAL)
                {
                    cOLOR = UIDropAnnounce.COLOR.DELIVERY;
                }
                return(cOLOR);
            }
            }
        }
        return(UIDropAnnounce.COLOR.LOUNGE);
    }