Esempio n. 1
0
        private QuestItemGetFmt _ItemGet(enumMaterialCategory material_category, int count)
        {
            QuestItemGetFmt questItemGetFmt = new QuestItemGetFmt();

            questItemGetFmt.Category = QuestItemGetKind.Material;
            questItemGetFmt.Id       = (int)material_category;
            questItemGetFmt.Count    = count;
            if (questItemGetFmt.Category == QuestItemGetKind.Material)
            {
                enumMaterialCategory id = (enumMaterialCategory)questItemGetFmt.Id;
                Comm_UserDatas.Instance.User_material[id].Add_Material(questItemGetFmt.Count);
            }
            return(questItemGetFmt);
        }
Esempio n. 2
0
        private QuestItemGetFmt _ItemGet(int type, int id, int count, bool maxExpFlag, bool useCrewFlag)
        {
            QuestItemGetFmt questItemGetFmt = new QuestItemGetFmt();

            questItemGetFmt.Category      = (QuestItemGetKind)type;
            questItemGetFmt.Id            = id;
            questItemGetFmt.Count         = count;
            questItemGetFmt.IsUseCrewItem = useCrewFlag;
            if (questItemGetFmt.Category == QuestItemGetKind.Material)
            {
                enumMaterialCategory id2 = (enumMaterialCategory)questItemGetFmt.Id;
                Comm_UserDatas.Instance.User_material[id2].Add_Material(questItemGetFmt.Count);
            }
            else if (questItemGetFmt.Category == QuestItemGetKind.Deck)
            {
                Comm_UserDatas.Instance.Add_Deck(questItemGetFmt.Id);
            }
            else if (questItemGetFmt.Category == QuestItemGetKind.LargeBuild)
            {
                Comm_UserDatas.Instance.User_basic.OpenLargeDock();
            }
            else if (questItemGetFmt.Category == QuestItemGetKind.Ship)
            {
                Comm_UserDatas.Instance.Add_Ship(questItemGetFmt.createIds());
            }
            else if (questItemGetFmt.Category == QuestItemGetKind.SlotItem)
            {
                Comm_UserDatas.Instance.Add_Slot(questItemGetFmt.createIds());
            }
            else if (questItemGetFmt.Category == QuestItemGetKind.FurnitureBox || questItemGetFmt.Category == QuestItemGetKind.UseItem)
            {
                if (questItemGetFmt.Id == 63)
                {
                    questItemGetFmt.IsQuestExtend = Comm_UserDatas.Instance.User_basic.QuestExtend(Mst_DataManager.Instance.Mst_const);
                }
                else
                {
                    Comm_UserDatas.Instance.Add_Useitem(questItemGetFmt.Id, questItemGetFmt.Count);
                }
            }
            else if (questItemGetFmt.Category == QuestItemGetKind.Furniture)
            {
                Comm_UserDatas.Instance.Add_Furniture(questItemGetFmt.Id);
            }
            else if (questItemGetFmt.Category == QuestItemGetKind.Exchange)
            {
                questItemGetFmt.FromId = mst_slotitemchange[id][0];
                questItemGetFmt.Id     = mst_slotitemchange[id][1];
                int      key      = Comm_UserDatas.Instance.User_deck[1].Ship[0];
                Mem_ship mem_ship = Comm_UserDatas.Instance.User_ship[key];
                int      num      = findModelChangeEnableSlotPos(mem_ship.Slot, questItemGetFmt.FromId, maxExpFlag);
                if (num < 0)
                {
                    return(null);
                }
                Mem_slotitem obj = Comm_UserDatas.Instance.User_slot[mem_ship.Slot[num]];
                ((Mem_slotitem.IMemSlotIdOperator) this).ChangeSlotId(obj, questItemGetFmt.Id);
                Mem_shipBase baseData = new Mem_shipBase(mem_ship);
                mem_ship.Set_ShipParam(baseData, Mst_DataManager.Instance.Mst_ship[mem_ship.Ship_id], enemy_flag: false);
                if (questItemGetFmt.IsUseCrewItem && Comm_UserDatas.Instance.User_useItem.TryGetValue(70, out Mem_useitem value))
                {
                    value.Sub_UseItem(1);
                }
            }
            else if (questItemGetFmt.Category == QuestItemGetKind.Spoint)
            {
                Comm_UserDatas.Instance.User_basic.AddPoint(questItemGetFmt.Count);
            }
            else if (questItemGetFmt.Category == QuestItemGetKind.DeckPractice)
            {
                Comm_UserDatas.Instance.User_deckpractice.StateChange((DeckPracticeType)questItemGetFmt.Id, state: true);
            }
            else
            {
                if (questItemGetFmt.Category != QuestItemGetKind.Tanker)
                {
                    return(null);
                }
                Comm_UserDatas.Instance.Add_Tanker(questItemGetFmt.Count);
            }
            return(questItemGetFmt);
        }