示例#1
0
 // Token: 0x06000296 RID: 662 RVA: 0x00009F70 File Offset: 0x00008370
 public void CloseBagScrollView1Result(Item.Type itemType, int btnId, int itemId)
 {
     this.ChangeButton.GetComponent <Button>().enabled = true;
     base.GetComponentInParent <FlickCheaker>().stopFlick(false);
     if (itemType == Item.Type.NONE)
     {
         return;
     }
     if (itemType != Item.Type._ElmMax)
     {
         ItemDataFormat itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(itemId);
         if (itemDataFormat == null)
         {
             return;
         }
         this.BagButton[btnId].GetComponent <BagPanelButton>().CngItemImage(itemDataFormat.img);
         this.tmpBagList[btnId] = itemId;
     }
     else
     {
         this.BagButton[btnId].GetComponent <BagPanelButton>().CngItemImage(this.DefaultSplite);
         this.tmpBagList[btnId] = -1;
     }
     if (this.DeskPanel)
     {
         this.ResetBtnEnableCheck();
     }
 }
示例#2
0
 // Token: 0x060002D5 RID: 725 RVA: 0x0000C4E4 File Offset: 0x0000A8E4
 public void OpenPanel(int index, ShowType showType)
 {
     base.gameObject.SetActive(true);
     base.GetComponentInParent <UIMaster>().freezeObject(true);
     base.GetComponentInParent <UIMaster>().blockUI(true, new Color(0f, 0f, 0f, 0.3f));
     if (showType != ShowType.Collect)
     {
         if (showType == ShowType.Specialty)
         {
             SpecialtyDataFormat specialtyDataFormat = SuperGameMaster.sDataBase.get_SpecialtyDB(index);
             ItemDataFormat      itemDataFormat      = SuperGameMaster.sDataBase.get_ItemDB_forId(specialtyDataFormat.itemId);
             this.DetailNameText.GetComponent <Text>().text  = itemDataFormat.name;
             this.DetailImage.GetComponent <Image>().sprite  = itemDataFormat.img;
             this.DetailPlaceText.GetComponent <Text>().text = specialtyDataFormat.place;
             this.DetailInfoText.GetComponent <Text>().text  = itemDataFormat.info;
         }
     }
     else
     {
         CollectionDataFormat collectionDataFormat = SuperGameMaster.sDataBase.get_CollectDB(index);
         this.DetailNameText.GetComponent <Text>().text  = collectionDataFormat.name;
         this.DetailImage.GetComponent <Image>().sprite  = collectionDataFormat.img;
         this.DetailPlaceText.GetComponent <Text>().text = collectionDataFormat.place;
         this.DetailInfoText.GetComponent <Text>().text  = collectionDataFormat.info;
     }
     SuperGameMaster.audioMgr.PlaySE(Define.SEDict["SE_Enter"]);
     this.BackFunc();
 }
 public ItemDataFormat(ItemDataFormat ori)
 {
     this.name    = ori.name;
     this.price   = ori.price;
     this.onStock = ori.onStock;
     this.isUsed  = ori.isUsed;
 }
示例#4
0
    // Token: 0x060003FF RID: 1023 RVA: 0x0001A1F4 File Offset: 0x000185F4
    public void SelectPrize(int prizeId)
    {
        this.selectPrizeId = prizeId;
        PrizeDataFormat prizeDataFormat = SuperGameMaster.sDataBase.get_PrizeDB_forId(this.selectPrizeId);
        ItemDataFormat  itemDataFormat  = SuperGameMaster.sDataBase.get_ItemDB_forId(prizeDataFormat.itemId);

        if (prizeDataFormat.itemId != -1 && itemDataFormat == null)
        {
            return;
        }
        if (prizeDataFormat.itemId == -1)
        {
            itemDataFormat      = new ItemDataFormat();
            itemDataFormat.name = "ふくびき券";
        }
        ConfilmPanel confilm = this.ConfilmUI.GetComponent <ConfilmPanel>();

        confilm.OpenPanel_YesNo(itemDataFormat.name + "\nを受け取りますか");
        confilm.ResetOnClick_Yes();
        confilm.SetOnClick_Yes(delegate
        {
            confilm.ClosePanel();
        });
        confilm.SetOnClick_Yes(delegate
        {
            this.GetPrize();
        });
        confilm.ResetOnClick_No();
        confilm.SetOnClick_No(delegate
        {
            confilm.ClosePanel();
        });
    }
示例#5
0
        public static long CreateTransaction(User userInfo, string itemData, ItemDataFormat itemDataFormat, TransactionType transactionType, TransactionStatus transactionStatus)
        {
            long transactionId = -1;

            using (var context = new OnStoreEntities())
            {
                Transaction trans = context.Transactions.Create();
                trans.TransactionId   = transactionId;
                trans.UserId          = userInfo.UserId;
                trans.ItemData        = itemData;
                trans.ItemDataFormat  = (byte)itemDataFormat;
                trans.Status          = (byte)transactionStatus;
                trans.TransactionDate = DateTime.UtcNow;
                trans.TransactionType = (byte)transactionType;
                trans.CreatedDate     = DateTime.UtcNow;
                context.Transactions.Add(trans);
                bool created = context.SaveChanges() > 0;
                if (created)
                {
                    transactionId = trans.TransactionId;
                }
            }

            return(transactionId);
        }
	// Token: 0x060003C8 RID: 968 RVA: 0x00016B64 File Offset: 0x00014F64
	public void CreateButton(int showType)
	{
		RectTransform component = this.contentsList.GetComponent<RectTransform>();
		for (int i = 0; i < component.transform.childCount; i++)
		{
			UnityEngine.Object.Destroy(component.GetChild(i).gameObject);
		}
		this.nowShowType = (ShowType)showType;
		if (showType != 0)
		{
			if (showType == 1)
			{
				for (int j = 0; j < SuperGameMaster.sDataBase.count_SpecialtyDB(); j++)
				{
					GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(this.btnPref);
					gameObject.transform.SetParent(component, false);
					SpecialtyDataFormat specialtyDataFormat = SuperGameMaster.sDataBase.get_SpecialtyDB(j);
					if (SuperGameMaster.saveData.specialtyFlags[specialtyDataFormat.id])
					{
						ItemDataFormat itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(specialtyDataFormat.itemId);
						gameObject.GetComponent<CollectionButton>().SetData(j, true);
						gameObject.GetComponent<CollectionButton>().CngName(itemDataFormat.name);
						gameObject.GetComponent<CollectionButton>().CngImage(itemDataFormat.img);
					}
					else
					{
						gameObject.GetComponent<CollectionButton>().SetData(j, false);
					}
					gameObject.GetComponent<CollectionButton>().MainScrollView = base.gameObject;
				}
				this.CollectBtn.GetComponent<Button>().interactable = true;
				this.SpecialtyBtn.GetComponent<Button>().interactable = false;
			}
		}
		else
		{
			for (int k = 0; k < SuperGameMaster.sDataBase.count_CollectDB(); k++)
			{
				GameObject gameObject2 = UnityEngine.Object.Instantiate<GameObject>(this.btnPref);
				gameObject2.transform.SetParent(component, false);
				CollectionDataFormat collectionDataFormat = SuperGameMaster.sDataBase.get_CollectDB(k);
				if (SuperGameMaster.saveData.collectFlags[collectionDataFormat.id])
				{
					gameObject2.GetComponent<CollectionButton>().SetData(k, true);
					gameObject2.GetComponent<CollectionButton>().CngName(collectionDataFormat.name);
					gameObject2.GetComponent<CollectionButton>().CngImage(collectionDataFormat.img);
				}
				else
				{
					gameObject2.GetComponent<CollectionButton>().SetData(k, false);
				}
				gameObject2.GetComponent<CollectionButton>().MainScrollView = base.gameObject;
			}
			this.CollectBtn.GetComponent<Button>().interactable = false;
			this.SpecialtyBtn.GetComponent<Button>().interactable = true;
		}
		SuperGameMaster.audioMgr.PlaySE(Define.SEDict["SE_Cursor"]);
	}
示例#7
0
 // Token: 0x06000424 RID: 1060 RVA: 0x0001C030 File Offset: 0x0001A430
 public ItemDataFormat(ItemDataFormat original)
 {
     this.name        = original.name;
     this.info        = original.info;
     this.img         = original.img;
     this.id          = original.id;
     this.type        = original.type;
     this.price       = original.price;
     this.spend       = original.spend;
     this.effectType  = original.effectType;
     this.effectElm   = original.effectElm;
     this.effectValue = original.effectValue;
 }
示例#8
0
 // Token: 0x060002DA RID: 730 RVA: 0x0000C7D4 File Offset: 0x0000ABD4
 public void CreateItemButton()
 {
     this.unsetCursor();
     for (int i = -1; i <= 1; i++)
     {
         for (int j = 0; j < this.pageDisplayMax; j++)
         {
             int num = j + (this.nowPage + i) * this.pageDisplayMax;
             if (num < 0)
             {
                 break;
             }
             if (num > this.shopItemMax - 1)
             {
                 break;
             }
             Vector3 position = new Vector3(this.btnPref.transform.localPosition.x, this.btnPref.transform.localPosition.y, 0f);
             position.x += (float)(j % this.column) * this.btnPadding.x + (float)(this.pageWidth * i);
             position.y += (float)(j / this.column) * this.btnPadding.y;
             GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.btnPref, position, Quaternion.identity);
             gameObject.transform.SetParent(base.transform, false);
             ShopDataFormat shopData       = SuperGameMaster.sDataBase.get_ShopDB(num);
             ItemDataFormat itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(shopData.itemId);
             gameObject.GetComponent <DisplayItemButton>().setShopIndex(num);
             gameObject.GetComponent <DisplayItemButton>().CngDisplayName(itemDataFormat.name);
             gameObject.GetComponent <DisplayItemButton>().CngDisplayImage(itemDataFormat.img, shopData.fixY);
             gameObject.GetComponent <DisplayItemButton>().CngBackImage(this.ItemBackSprite[j % 4]);
             if (num == this.selectShopIndex)
             {
                 this.setCursor(gameObject.transform.localPosition);
             }
             if (itemDataFormat.type != Item.Type.LunchBox)
             {
                 if (SuperGameMaster.saveData.ItemList.FindIndex((ItemListFormat item) => item.id.Equals(shopData.itemId)) != -1)
                 {
                     gameObject.GetComponent <DisplayItemButton>().SetSoldOut();
                 }
                 else
                 {
                     gameObject.GetComponent <DisplayItemButton>().CngPriceNum(itemDataFormat.price);
                 }
             }
             else
             {
                 gameObject.GetComponent <DisplayItemButton>().CngPriceNum(itemDataFormat.price);
             }
         }
     }
 }
示例#9
0
 // Token: 0x06000297 RID: 663 RVA: 0x0000A01C File Offset: 0x0000841C
 public void SetPanelButton()
 {
     for (int i = 0; i < this.tmpBagList.Count; i++)
     {
         int            num            = this.tmpBagList[i];
         ItemDataFormat itemDataFormat = new ItemDataFormat();
         if (num != -1)
         {
             itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(num);
             this.BagButton[i].GetComponent <BagPanelButton>().CngItemImage(itemDataFormat.img);
         }
         else
         {
             this.BagButton[i].GetComponent <BagPanelButton>().CngItemImage(this.DefaultSplite);
         }
     }
 }
示例#10
0
 // Token: 0x060003F9 RID: 1017 RVA: 0x00019FC4 File Offset: 0x000183C4
 public void LoadImages()
 {
     for (int i = 0; i < SuperGameMaster.sDataBase.count_PrizeDB(); i++)
     {
         PrizeDataFormat prizeDataFormat = SuperGameMaster.sDataBase.get_PrizeDB(i);
         ItemDataFormat  itemDataFormat  = SuperGameMaster.sDataBase.get_ItemDB_forId(prizeDataFormat.itemId);
         if (prizeDataFormat.itemId == -1 || itemDataFormat != null)
         {
             int        rank       = (int)prizeDataFormat.rank;
             GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.itemPref);
             gameObject.transform.SetParent(this.ItemPanels[rank].GetComponent <RectTransform>(), false);
             if (prizeDataFormat.itemId != -1)
             {
                 gameObject.transform.GetChild(0).GetComponentInChildren <Image>().sprite = itemDataFormat.img;
             }
         }
     }
 }
    // Update is called once per frame
    void Update()
    {
        // update itemData;
        this.itemData = SuperGameMaster.saveData.Item;
        switch (this.currentPage)
        {
        case 0:
            this.ItemName.SetActive(true);
            this.ItemImage.SetActive(true);
            this.ItemDescription.SetActive(true);
            if (this.itemData.onStock)
            {
                // display item image
                this.OutOfStock.SetActive(false);
                this.ItemPriceImage.SetActive(true);
                this.ItemPrice.SetActive(true);
                this.BuyButton.SetActive(true);
            }
            else
            {
                // display out of stock image
                this.OutOfStock.SetActive(true);
                this.ItemPriceImage.SetActive(false);
                this.ItemPrice.SetActive(false);
                this.BuyButton.SetActive(false);
            }
            break;

        case 1:
            this.ItemName.SetActive(false);
            this.ItemImage.SetActive(false);
            this.OutOfStock.SetActive(false);
            this.ItemDescription.SetActive(false);
            this.ItemPriceImage.SetActive(false);
            this.ItemPrice.SetActive(false);
            this.BuyButton.SetActive(false);
            break;

        default: break;
        }
    }
    // Use this for initialization
    void Start()
    {
        // load data
        this.itemData          = SuperGameMaster.saveData.Item;
        this.itemImage         = ItemImage.GetComponent <Image> ();
        this.ItemNameText      = GameObject.Find("ItemNameText").GetComponent <Text> ();
        this.ItemNameText.text = SuperGameMaster.saveData.Item.name;

        this.itemPriceImage           = ItemPriceImage.GetComponent <Image> ();
        this.ItemPriceText            = ItemPrice.GetComponent <Text> ();
        this.ItemPriceText.text       = SuperGameMaster.saveData.Item.price.ToString();
        this.ItemDescriptionText      = ItemDescription.GetComponent <Text> ();
        this.ItemDescriptionText.text = "An empty birdhouse.";        // TODO: Add description to ItemDataFormat

        this.OutOfStockImage = OutOfStock.GetComponent <Image> ();

        this.btn = BuyButton.GetComponent <Button> ();

        this.message = Message.GetComponent <Text> ();

        this.ItemName.SetActive(true);
        this.ItemImage.SetActive(true);
        if (this.itemData.onStock)
        {
            this.OutOfStock.SetActive(false);
            this.ItemPrice.SetActive(true);
            this.BuyButton.SetActive(true);
        }
        else
        {
            this.OutOfStock.SetActive(true);
            this.ItemPrice.SetActive(false);
            this.BuyButton.SetActive(false);
        }
        this.Message.SetActive(false);
    }
示例#13
0
    // Token: 0x06000401 RID: 1025 RVA: 0x0001A344 File Offset: 0x00018744
    public void CreateButton(Rank createRank)
    {
        RectTransform component       = this.contentsList.GetComponent <RectTransform>();
        float         spacing         = component.GetComponent <VerticalLayoutGroup>().spacing;
        float         preferredHeight = this.btnPref.GetComponent <LayoutElement>().preferredHeight;
        bool          flag            = true;

        for (int i = 0; i < SuperGameMaster.sDataBase.count_PrizeDB(); i++)
        {
            PrizeDataFormat prizeDataFormat = SuperGameMaster.sDataBase.get_PrizeDB(i);
            if (createRank == Rank.NONE || prizeDataFormat.rank == createRank)
            {
                ItemDataFormat itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(prizeDataFormat.itemId);
                if (prizeDataFormat.itemId == -1 || itemDataFormat != null)
                {
                    GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.btnPref);
                    gameObject.transform.SetParent(component, false);
                    gameObject.GetComponent <PrizeButton>().setPrizeId(prizeDataFormat.id, prizeDataFormat.rank);
                    gameObject.GetComponent <PrizeButton>().CngStockNum(prizeDataFormat.stock);
                    if (prizeDataFormat.itemId != -1)
                    {
                        gameObject.GetComponent <PrizeButton>().CngPrizeName(itemDataFormat.name);
                        gameObject.GetComponent <PrizeButton>().CngImage(itemDataFormat.img);
                        int num = SuperGameMaster.FindItemStock(prizeDataFormat.itemId);
                        gameObject.GetComponent <PrizeButton>().CngHaveItemStock(num);
                        if (num >= 99)
                        {
                            gameObject.GetComponent <Button>().interactable = false;
                        }
                    }
                    else
                    {
                        gameObject.GetComponent <PrizeButton>().CngPrizeName("ふくびき券");
                        int num2 = SuperGameMaster.TicketStock();
                        gameObject.GetComponent <PrizeButton>().CngHaveItemStock(num2);
                        if (num2 >= 999)
                        {
                            gameObject.GetComponent <Button>().interactable = false;
                        }
                    }
                    if (gameObject.GetComponent <Button>().interactable)
                    {
                        flag = false;
                    }
                    gameObject.GetComponent <PrizeButton>().PrizeScrollViewUI = base.gameObject;
                }
            }
        }
        if (flag)
        {
            int num3 = Define.PrizeClover[createRank];
            SuperGameMaster.getCloverPoint(num3);
            base.GetComponentInParent <UIMaster>().OnSave();
            ConfilmPanel confilm = this.ConfilmUI.GetComponent <ConfilmPanel>();
            confilm.OpenPanel("みつ葉を" + num3 + "枚\n受け取りました");
            confilm.ResetOnClick_Screen();
            confilm.SetOnClick_Screen(delegate
            {
                this.CloseScrollView();
            });
            confilm.SetOnClick_Screen(delegate
            {
                confilm.ClosePanel();
            });
        }
    }
示例#14
0
    // Token: 0x060003B1 RID: 945 RVA: 0x00016228 File Offset: 0x00014628
    public void CreateResult(bool success, int _evtId, List <int> itemList, int goalNodeId)
    {
        this.evtId = _evtId;
        this.numBase_Clover.createNumObj(itemList[0], this.numBase_Clover.GetComponent <NumObjCreater>().prefub.transform.localPosition, (int)this.numBase_Clover.GetComponent <NumObjCreater>().prefub.transform.GetComponent <RectTransform>().sizeDelta.x);
        this.numBase_Ticket.createNumObj(itemList[1], this.numBase_Ticket.GetComponent <NumObjCreater>().prefub.transform.localPosition, (int)this.numBase_Ticket.GetComponent <NumObjCreater>().prefub.transform.GetComponent <RectTransform>().sizeDelta.x);
        itemList.RemoveAt(0);
        itemList.RemoveAt(0);
        if (!success)
        {
            this.MainUI.SetActive(false);
            this.SubUI.SetActive(true);
            return;
        }
        this.MainUI.SetActive(true);
        this.SubUI.SetActive(false);
        int num = itemList.FindIndex((int val) => val > 10000);

        if (num != -1)
        {
            CollectionDataFormat collectionDataFormat = SuperGameMaster.sDataBase.get_CollectDB_forId(itemList[num] - 10000);
            if (collectionDataFormat != null)
            {
                this.CollectionImage.GetComponent <Image>().sprite = collectionDataFormat.img;
            }
        }
        else
        {
            NodeDataFormat     nodeDataFormat     = SuperGameMaster.sDataBase.get_NodeDB_forId(goalNodeId);
            NodePrefDataFormat nodePrefDataFormat = SuperGameMaster.sDataBase.get_NodePrefDB_forId(nodeDataFormat.pathId);
            if (nodePrefDataFormat.collectionId == -1)
            {
                this.CollectionResultPanel.SetActive(false);
            }
            else if (SuperGameMaster.FindCollection(nodePrefDataFormat.collectionId))
            {
                CollectionDataFormat collectionDataFormat2 = SuperGameMaster.sDataBase.get_CollectDB_forId(nodePrefDataFormat.collectionId);
                if (collectionDataFormat2 != null)
                {
                    this.CollectionImage.GetComponent <Image>().sprite = collectionDataFormat2.img;
                    this.CompleteStampImage.SetActive(true);
                }
            }
            else
            {
                this.CollectionImage.GetComponent <Image>().sprite            = this.QuestionImg;
                this.CollectionImage.GetComponent <RectTransform>().sizeDelta = new Vector2(this.QuestionImg.rect.width, this.QuestionImg.rect.height);
            }
        }
        for (int i = 0; i < this.SpecialtyMax * 2; i += 2)
        {
            if (i >= itemList.Count)
            {
                GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.itemPref);
                gameObject.transform.SetParent(this.SpecialtyImagePanel.GetComponent <RectTransform>(), false);
            }
            else
            {
                int num2 = itemList[i];
                int num3 = itemList[i + 1];
                if (num2 >= 10000)
                {
                    itemList.RemoveAt(i);
                    itemList.RemoveAt(i);
                    i -= 2;
                }
                else
                {
                    GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(this.itemPref);
                    gameObject2.transform.SetParent(this.SpecialtyImagePanel.GetComponent <RectTransform>(), false);
                    ItemDataFormat itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(num2);
                    if (itemDataFormat != null)
                    {
                        gameObject2.GetComponent <Image>().enabled = true;
                        gameObject2.transform.GetChild(0).GetComponentInChildren <Image>().sprite = itemDataFormat.img;
                        if (num3 > 1)
                        {
                            gameObject2.transform.GetChild(1).gameObject.SetActive(true);
                            gameObject2.GetComponentInChildren <Text>().text = "x" + num3;
                            if (SuperGameMaster.FindItemStock(num2) + num3 > 99)
                            {
                                gameObject2.GetComponentInChildren <Text>().color = new Color(1f, 0f, 0f);
                            }
                        }
                    }
                }
            }
        }
    }
示例#15
0
    // Token: 0x060002E0 RID: 736 RVA: 0x0000D180 File Offset: 0x0000B580
    public void BuyItem()
    {
        ShopDataFormat shopDataFormat = SuperGameMaster.sDataBase.get_ShopDB(this.selectShopIndex);
        ItemDataFormat itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(shopDataFormat.itemId);

        SuperGameMaster.getCloverPoint(-itemDataFormat.price);
        SuperGameMaster.GetItem(shopDataFormat.itemId, 1);
        base.GetComponentInParent <UIMaster>().OnSave();
        if (itemDataFormat.type != Item.Type.LunchBox)
        {
            IEnumerator enumerator = base.transform.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    object    obj       = enumerator.Current;
                    Transform transform = (Transform)obj;
                    if (transform.name.Equals("DisplayItemButton(Clone)") && transform.GetComponent <DisplayItemButton>().shopIndex == this.selectShopIndex)
                    {
                        transform.GetComponent <DisplayItemButton>().SetSoldOut();
                        transform.GetComponent <DisplayItemButton>().NumDelete();
                    }
                }
            }
            finally
            {
                IDisposable disposable;
                if ((disposable = (enumerator as IDisposable)) != null)
                {
                    disposable.Dispose();
                }
            }
            this.selectShopIndex = -1;
            this.SetInfoPanelData(-1, Vector3.zero);
            base.GetComponent <FlickCheaker>().stopFlick(true);
            ConfilmPanel confilm = this.ConfilmUI.GetComponent <ConfilmPanel>();
            confilm.OpenPanel(itemDataFormat.name + "\nを買いました");
            confilm.ResetOnClick_Screen();
            confilm.SetOnClick_Screen(delegate
            {
                confilm.ClosePanel();
            });
            confilm.SetOnClick_Screen(delegate
            {
                this.GetComponent <FlickCheaker>().stopFlick(false);
            });
        }
        if (SuperGameMaster.tutorial.TutorialComplete() && (itemDataFormat.type != Item.Type.Tool || SuperGameMaster.GetFirstFlag(Flag.FIRST_BUY_TOOL)) && UnityEngine.Random.Range(0, 100) < 15)
        {
            SuperGameMaster.GetTicket(1);
            base.GetComponentInParent <UIMaster>().OnSave();
            if (itemDataFormat.type != Item.Type.LunchBox)
            {
                ConfilmPanel confilm = this.ConfilmUI.GetComponent <ConfilmPanel>();
                confilm.SetOnClick_Screen(delegate
                {
                    confilm.OpenPanel(string.Empty);
                });
                confilm.SetOnClick_Screen(delegate
                {
                    confilm.AddContents(UnityEngine.Object.Instantiate <GameObject>(this.AddConfirm_pref));
                });
                confilm.SetOnClick_Screen(delegate
                {
                    confilm.ResetOnClick_Screen();
                });
                confilm.SetOnClick_Screen(delegate
                {
                    this.GetComponent <FlickCheaker>().stopFlick(true);
                });
                confilm.SetOnClick_Screen(delegate
                {
                    confilm.SetOnClick_Screen(delegate
                    {
                        confilm.ClosePanel();
                    });
                });
                confilm.SetOnClick_Screen(delegate
                {
                    confilm.SetOnClick_Screen(delegate
                    {
                        this.GetComponent <FlickCheaker>().stopFlick(false);
                    });
                });
            }
            else
            {
                base.GetComponent <FlickCheaker>().stopFlick(true);
                ConfilmPanel confilm = this.ConfilmUI.GetComponent <ConfilmPanel>();
                confilm.OpenPanel(string.Empty);
                confilm.AddContents(UnityEngine.Object.Instantiate <GameObject>(this.AddConfirm_pref));
                confilm.ResetOnClick_Screen();
                confilm.SetOnClick_Screen(delegate
                {
                    confilm.ClosePanel();
                });
                confilm.SetOnClick_Screen(delegate
                {
                    this.GetComponent <FlickCheaker>().stopFlick(false);
                });
            }
        }
        if (itemDataFormat.type == Item.Type.Tool && !SuperGameMaster.GetFirstFlag(Flag.FIRST_BUY_TOOL))
        {
            SuperGameMaster.SetFirstFlag(Flag.FIRST_BUY_TOOL);
            base.GetComponent <FlickCheaker>().stopFlick(true);
            HelpPanel help = base.GetComponentInParent <UIMaster_Shop>().HelpUI.GetComponent <HelpPanel>();
            help.OpenPanel(string.Concat(new string[]
            {
                "<color=#61a8c7><b>どうぐ</b></color>をしたくしてあげると\n",
                SuperGameMaster.GetFrogName(),
                "の行き先に影響をあたえます\n色んな<color=#61a8c7><b>どうぐ</b></color>を用意して",
                SuperGameMaster.GetFrogName(),
                "に\n旅の提案をしてあげましょう"
            }));
            help.ResetOnClick_Screen();
            help.SetOnClick_Screen(delegate
            {
                help.ClosePanel();
            });
            help.SetOnClick_Screen(delegate
            {
                this.GetComponent <FlickCheaker>().stopFlick(false);
            });
            help.gameObject.SetActive(false);
            ConfilmPanel component = this.ConfilmUI.GetComponent <ConfilmPanel>();
            component.SetOnClick_Screen(delegate
            {
                help.gameObject.SetActive(true);
            });
            component.SetOnClick_Screen(delegate
            {
                this.GetComponent <FlickCheaker>().stopFlick(true);
            });
        }
        SuperGameMaster.audioMgr.StopSE();
        SuperGameMaster.audioMgr.PlaySE(Define.SEDict["SE_Buy"]);
    }
示例#16
0
    // Token: 0x060003E6 RID: 998 RVA: 0x00019060 File Offset: 0x00017460
    public void CreateMailButton()
    {
        RectTransform component       = this.contentsList.GetComponent <RectTransform>();
        float         spacing         = component.GetComponent <VerticalLayoutGroup>().spacing;
        float         preferredHeight = this.btnPref.GetComponent <LayoutElement>().preferredHeight;

        foreach (MailEventFormat mailEventFormat in SuperGameMaster.saveData.MailList)
        {
            GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.btnPref);
            gameObject.transform.SetParent(component, false);
            gameObject.GetComponent <MailButton>().setId(mailEventFormat.mailId);
            gameObject.GetComponent <MailButton>().CngTitleName(mailEventFormat.title);
            if (mailEventFormat.senderCharaId != -1)
            {
                CharacterDataFormat characterDataFormat = SuperGameMaster.sDataBase.get_CharaDB_forId(mailEventFormat.senderCharaId);
                gameObject.GetComponent <MailButton>().CngSenderImage(characterDataFormat.img);
            }
            else
            {
                gameObject.GetComponent <MailButton>().CngSenderImage(null);
            }
            if (mailEventFormat.mailEvt == EvtId.Gift || mailEventFormat.mailEvt == EvtId.Management)
            {
                if (mailEventFormat.CloverPoint > 0)
                {
                    gameObject.GetComponent <MailButton>().SetImageAndNum(mailEventFormat.CloverPoint, this.cloverImg);
                }
                else if (mailEventFormat.ticket > 0)
                {
                    gameObject.GetComponent <MailButton>().SetImageAndNum(mailEventFormat.ticket, this.ticketImg);
                }
                else if (mailEventFormat.itemId == 1000)
                {
                    gameObject.GetComponent <MailButton>().SetImageAndNum(mailEventFormat.itemStock, this.fourCloverImg);
                }
                else
                {
                    gameObject.GetComponent <MailButton>().SetImageAndNum(0, this.cloverImg);
                }
            }
            if (mailEventFormat.mailEvt == EvtId.Leaflet)
            {
                gameObject.GetComponent <MailButton>().SetImage(this.leafletImg);
            }
            gameObject.GetComponent <MailButton>().SetMailEvtId(mailEventFormat.mailEvt, mailEventFormat.opened);
            if (mailEventFormat.itemId != -1 && mailEventFormat.itemId != 1000)
            {
                if (mailEventFormat.itemId < 10000)
                {
                    ItemDataFormat itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(mailEventFormat.itemId);
                    gameObject.GetComponent <MailButton>().CngItemImage(itemDataFormat.img);
                }
                else
                {
                    CollectionDataFormat collectionDataFormat = SuperGameMaster.sDataBase.get_CollectDB_forId(mailEventFormat.itemId - 10000);
                    gameObject.GetComponent <MailButton>().CngItemImage(collectionDataFormat.img);
                }
            }
            else
            {
                gameObject.GetComponent <MailButton>().CngItemImage(null);
            }
            gameObject.GetComponent <MailButton>().mailScrollView = base.gameObject;
            if (mailEventFormat.opened)
            {
                gameObject.GetComponent <Image>().color = new Color(0.8f, 0.8f, 0.8f);
            }
        }
    }
示例#17
0
 // Token: 0x060002DF RID: 735 RVA: 0x0000CE54 File Offset: 0x0000B254
 public void SetInfoPanelData(int shopIndex, Vector3 pos)
 {
     if (shopIndex == -1)
     {
         this.unsetCursor();
         this.InfoPanel.GetComponent <InfoPanel>().SetInfoPanel(-1);
         return;
     }
     if (Mathf.Abs(this.flickMove) > this.S_FlickChecker.flickMin / 3f)
     {
         return;
     }
     if (this.selectShopIndex != shopIndex)
     {
         this.InfoPanel.GetComponent <InfoPanel>().SetInfoPanel(shopIndex);
         this.selectShopIndex = shopIndex;
         this.setCursor(pos);
         SuperGameMaster.audioMgr.PlaySE(Define.SEDict["SE_Cursor"]);
     }
     else
     {
         ShopDataFormat shopDataFormat = SuperGameMaster.sDataBase.get_ShopDB(shopIndex);
         ItemDataFormat itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(shopDataFormat.itemId);
         if (itemDataFormat == null)
         {
             return;
         }
         if (!itemDataFormat.spend && SuperGameMaster.FindItemStock(itemDataFormat.id) != 0)
         {
             SuperGameMaster.audioMgr.PlaySE(Define.SEDict["SE_Cancel"]);
             return;
         }
         if (SuperGameMaster.CloverPointStock() >= itemDataFormat.price)
         {
             if (SuperGameMaster.FindItemStock(shopDataFormat.itemId) < 99)
             {
                 base.GetComponent <FlickCheaker>().stopFlick(true);
                 ConfilmPanel confilm = this.ConfilmUI.GetComponent <ConfilmPanel>();
                 if (itemDataFormat.type == Item.Type.LunchBox)
                 {
                     confilm.OpenPanel_YesNo(string.Concat(new object[]
                     {
                         itemDataFormat.name,
                         "\nを買いますか?\n(所持数\u3000",
                         SuperGameMaster.FindItemStock(shopDataFormat.itemId),
                         ")"
                     }));
                 }
                 else
                 {
                     confilm.OpenPanel_YesNo(itemDataFormat.name + "\nを買いますか?");
                 }
                 confilm.ResetOnClick_Yes();
                 confilm.SetOnClick_Yes(delegate
                 {
                     confilm.ClosePanel();
                 });
                 confilm.SetOnClick_Yes(delegate
                 {
                     this.GetComponent <FlickCheaker>().stopFlick(false);
                 });
                 confilm.SetOnClick_Yes(delegate
                 {
                     this.BuyItem();
                 });
                 confilm.ResetOnClick_No();
                 confilm.SetOnClick_No(delegate
                 {
                     confilm.ClosePanel();
                 });
                 confilm.SetOnClick_No(delegate
                 {
                     this.GetComponent <FlickCheaker>().stopFlick(false);
                 });
             }
             else
             {
                 base.GetComponent <FlickCheaker>().stopFlick(true);
                 ConfilmPanel confilm = this.ConfilmUI.GetComponent <ConfilmPanel>();
                 confilm.OpenPanel("もちものがいっぱいです");
                 confilm.ResetOnClick_Screen();
                 confilm.SetOnClick_Screen(delegate
                 {
                     confilm.ClosePanel();
                 });
                 confilm.SetOnClick_Screen(delegate
                 {
                     this.GetComponent <FlickCheaker>().stopFlick(false);
                 });
             }
         }
         else
         {
             base.GetComponent <FlickCheaker>().stopFlick(true);
             ConfilmPanel confilm = this.ConfilmUI.GetComponent <ConfilmPanel>();
             confilm.OpenPanel("みつ葉が足りません");
             confilm.ResetOnClick_Screen();
             confilm.SetOnClick_Screen(delegate
             {
                 confilm.ClosePanel();
             });
             confilm.SetOnClick_Screen(delegate
             {
                 this.GetComponent <FlickCheaker>().stopFlick(false);
             });
         }
     }
 }
示例#18
0
    // Token: 0x06000331 RID: 817 RVA: 0x0001049C File Offset: 0x0000E89C
    public void getItemTest()
    {
        if (this.pathNodeSelect)
        {
            this.setResultText("経路選択中のモードです。\n終了するには再度「経由」ボタンを押してください");
            return;
        }
        if (this.travelResult.route == null)
        {
            this.setResultText("移動データがありません。");
            return;
        }
        List <ItemListFormat> list = new List <ItemListFormat>();

        list = base.GetComponent <TravelSimulator>().getItem(this.travelResult.route);
        string text = "取得結果:route[";

        foreach (int num in this.travelResult.route)
        {
            text = text + num.ToString() + "-";
        }
        if (this.travelResult.route.Count != 0)
        {
            text = text.Remove(text.Length - 1, 1);
        }
        text += "] ⇒ item[";
        foreach (ItemListFormat itemListFormat in list)
        {
            text += itemListFormat.id.ToString();
            if (itemListFormat.stock != 1)
            {
                string text2 = text;
                text = string.Concat(new object[]
                {
                    text2,
                    "(*",
                    itemListFormat.stock,
                    ")"
                });
            }
            text += ",";
        }
        if (list.Count != 0)
        {
            text = text.Remove(text.Length - 1, 1);
        }
        text += "] (";
        foreach (ItemListFormat itemListFormat2 in list)
        {
            if (itemListFormat2.id < 10000)
            {
                if (itemListFormat2.id >= 0)
                {
                    ItemDataFormat itemDataFormat = new ItemDataFormat();
                    itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(itemListFormat2.id);
                    text          += itemDataFormat.name;
                    if (itemListFormat2.stock != 1)
                    {
                        string text2 = text;
                        text = string.Concat(new object[]
                        {
                            text2,
                            "*",
                            itemListFormat2.stock,
                            string.Empty
                        });
                    }
                }
                else
                {
                    if (itemListFormat2.id == -1)
                    {
                        text = text + "みつ葉*" + itemListFormat2.stock;
                    }
                    if (itemListFormat2.id == -2)
                    {
                        text = text + "福引き*" + itemListFormat2.stock;
                    }
                }
            }
            else if (itemListFormat2.id < 30000)
            {
                int id = itemListFormat2.id - 10000;
                CollectionDataFormat collectionDataFormat = new CollectionDataFormat();
                collectionDataFormat = SuperGameMaster.sDataBase.get_CollectDB_forId(id);
                text = text + "【" + collectionDataFormat.name + "】";
            }
            text += ",";
        }
        if (list.Count != 0)
        {
            text = text.Remove(text.Length - 1, 1);
        }
        text += ")";
        this.setResultText(text);
    }
示例#19
0
    // Token: 0x06000262 RID: 610 RVA: 0x00007E94 File Offset: 0x00006294
    public void selectedItem(int charaId, int itemId)
    {
        if (itemId == -1)
        {
            this.ResetFocus();
            return;
        }
        int index = this.RefChara.FindIndex((GameObject rec) => rec.GetComponent <CharaObject>().charaId.Equals(charaId));
        EventTimerFormat eventTimerFormat = SuperGameMaster.evtMgr.get_ActEvt_forId(this.RefActEvtId[index]);
        ItemDataFormat   itemDataFormat   = new ItemDataFormat();

        itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(itemId);
        bool flag = false;

        for (int i = 0; i < itemDataFormat.effectType.Length; i++)
        {
            if (itemDataFormat.effectElm[i] == EffectElm.FL_RARE)
            {
                flag = true;
            }
        }
        int num  = UnityEngine.Random.Range(0, 100);
        int num2 = 0;

        Define.Gift gift = Define.Gift.NONE;
        for (int j = 0; j < 3; j++)
        {
            if (flag)
            {
                num2 += Define.FRIEND_GIFTPER_RARE[(Define.Gift)j];
            }
            else
            {
                num2 += Define.FRIEND_GIFTPER_NORMAL[(Define.Gift)j];
            }
            if (num < num2)
            {
                gift = (Define.Gift)j;
                break;
            }
        }
        CharacterDataFormat characterDataFormat = SuperGameMaster.sDataBase.get_CharaDB_forId(charaId);
        int num3 = Define.FRIEND_GIFTFIX[gift];

        if (gift != Define.Gift.Clover)
        {
            if (gift != Define.Gift.FourClover)
            {
                if (gift == Define.Gift.Ticket)
                {
                    if (flag)
                    {
                        num3 += UnityEngine.Random.Range(1, 4);
                    }
                }
            }
        }
        else
        {
            int   num4 = SuperGameMaster.sDataBase.get_CharaDB_rowItemId_index(itemId);
            float num5 = (100f + (float)characterDataFormat.taste[num4]) / 100f;
            float num6 = (float)(eventTimerFormat.activeTime / 1800);
            int   num7 = new List <int>
            {
                eventTimerFormat.evtValue[2],
                eventTimerFormat.evtValue[3],
                eventTimerFormat.evtValue[4]
            }.FindIndex((int rec) => rec.Equals(itemId));
            float num8 = 1f;
            if (num7 != -1)
            {
                num8 = Define.FRIEND_ITEM_DEBUFF[num7];
            }
            num3 += (int)((float)characterDataFormat.cloverPow * num5 * num6 * num8 / 15f);
            Debug.Log(string.Concat(new object[]
            {
                "みつば数算出:[",
                num3,
                "] pow = ",
                characterDataFormat.cloverPow,
                " / taste = ",
                num5,
                " / count = ",
                num6,
                " / buf = ",
                num8
            }));
            if (flag)
            {
                num3 += 20;
            }
        }
        Debug.Log(string.Concat(new object[]
        {
            "[CharaTable] お返しの抽選を行ないました: charaId = ",
            charaId,
            " / itemId = ",
            itemId,
            "(",
            flag,
            ") >> ",
            gift.ToString(),
            "(",
            num3,
            ")"
        }));
        List <int> list = new List <int>();

        list.Add(eventTimerFormat.evtValue[0]);
        list.Add(1);
        list.Add(itemId);
        list.Add(eventTimerFormat.evtValue[2]);
        list.Add(eventTimerFormat.evtValue[3]);
        list.Add(eventTimerFormat.evtValue[5]);
        SuperGameMaster.evtMgr.set_ActEvt_forId(eventTimerFormat.id, list);
        EventTimerFormat eventTimerFormat2 = new EventTimerFormat();

        eventTimerFormat2.id          = -1;
        eventTimerFormat2.timeSpanSec = eventTimerFormat.timeSpanSec;
        eventTimerFormat2.activeTime  = -1;
        eventTimerFormat2.addTime     = new DateTime(1970, 1, 1);
        eventTimerFormat2.evtType     = TimerEvent.Type.Gift;
        eventTimerFormat2.evtId       = charaId;
        eventTimerFormat2.evtValue    = new List <int>();
        eventTimerFormat2.evtValue.Add((int)gift);
        eventTimerFormat2.evtValue.Add(num3);
        eventTimerFormat2.trigger = true;
        SuperGameMaster.evtMgr.TimerAdd(eventTimerFormat2);
        this.ResetFocus();
        SuperGameMaster.UseItem(itemId, 1);
        this.ConfilmUI.GetComponentInParent <UIMaster>().freezeObject(true);
        this.ConfilmUI.GetComponentInParent <UIMaster>().blockUI(true, new Color(0.3f, 0.3f, 0.3f, 0f));
        ConfilmPanel confilm = this.ConfilmUI.GetComponent <ConfilmPanel>();

        confilm.OpenPanel(characterDataFormat.name + "に" + itemDataFormat.name + "\nをふるまいました");
        confilm.ResetOnClick_Screen();
        confilm.SetOnClick_Screen(delegate
        {
            confilm.ClosePanel();
        });
        confilm.SetOnClick_Screen(delegate
        {
            this.ConfilmUI.GetComponentInParent <UIMaster>().freezeObject(false);
        });
        confilm.SetOnClick_Screen(delegate
        {
            this.ConfilmUI.GetComponentInParent <UIMaster>().blockUI(false, new Color(0f, 0f, 0f, 0f));
        });
    }
示例#20
0
    // Token: 0x06000334 RID: 820 RVA: 0x00011578 File Offset: 0x0000F978
    public void getPrefTest()
    {
        if (this.pathNodeSelect)
        {
            return;
        }
        if (this.goalNodeId == -1)
        {
            this.setResultText("ノードが選択されていません");
            return;
        }
        NodeDataFormat     nodeDataFormat     = SuperGameMaster.sDataBase.get_NodeDB_forId(this.goalNodeId);
        NodeItemDataFormat nodeItemDataFormat = SuperGameMaster.sDataBase.get_NodeItemDB_forId(this.goalNodeId);

        object[] array = new object[6];
        array[0] = "ノード [";
        array[1] = nodeDataFormat.id;
        array[2] = "] Type:";
        int      num  = 3;
        NodeType type = nodeDataFormat.type;

        array[num] = type.ToString();
        array[4]   = " / Path:";
        array[5]   = nodeDataFormat.pathId;
        string text = string.Concat(array);

        text += " / ";
        text += "specialty:";
        string text2 = string.Empty;
        string text3 = "[";
        string text4 = "(";

        for (int i = 0; i < nodeItemDataFormat.specialtyId.Length; i++)
        {
            ItemDataFormat itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(nodeItemDataFormat.specialtyId[i]);
            text2 = text2 + itemDataFormat.id + ",";
            text3 = text3 + nodeItemDataFormat.specialtyPer[i] + "%,";
            text4 = text4 + itemDataFormat.name + ",";
        }
        if (nodeItemDataFormat.specialtyId.Length != 0)
        {
            text2 = text2.Remove(text2.Length - 1, 1);
            text3 = text3.Remove(text3.Length - 1, 1);
            text4 = text4.Remove(text4.Length - 1, 1);
        }
        text2 += " ";
        text3 += "] ";
        text4 += ") ";
        string text5 = text;

        text = string.Concat(new string[]
        {
            text5,
            text2,
            text3,
            text4,
            "\n"
        });
        NodePrefDataFormat nodePrefDataFormat = SuperGameMaster.sDataBase.get_NodePrefDB_forId(this.goalNodeId);

        if (nodePrefDataFormat != null)
        {
            text += "<color=orange>【県データ】";
            text += "ノード [";
            List <int> list_NodeDB_prefIds = SuperGameMaster.sDataBase.getList_NodeDB_prefIds(nodePrefDataFormat.id);
            foreach (int num2 in list_NodeDB_prefIds)
            {
                text = text + num2 + ",";
            }
            text  = text.Remove(text.Length - 1, 1);
            text += "]";
            text += " / ";
            if (nodePrefDataFormat.collectionId != -1)
            {
                CollectionDataFormat collectionDataFormat = SuperGameMaster.sDataBase.get_CollectDB_forId(nodePrefDataFormat.collectionId);
                text5 = text;
                text  = string.Concat(new object[]
                {
                    text5,
                    "collect:",
                    collectionDataFormat.id,
                    " (",
                    collectionDataFormat.name,
                    ") / "
                });
            }
            else
            {
                text += "collect:(なし) / ";
            }
            text += "specialty:";
            text2 = string.Empty;
            text4 = "(";
            for (int j = 0; j < nodePrefDataFormat.specialtyId.Length; j++)
            {
                ItemDataFormat itemDataFormat2 = SuperGameMaster.sDataBase.get_ItemDB_forId(nodePrefDataFormat.specialtyId[j]);
                text2 = text2 + itemDataFormat2.id + ",";
                text4 = text4 + itemDataFormat2.name + ",";
            }
            if (nodeItemDataFormat.specialtyId.Length != 0)
            {
                text2 = text2.Remove(text2.Length - 1, 1);
                text4 = text4.Remove(text4.Length - 1, 1);
            }
            text2 += " ";
            text4 += ") ";
            text   = text + text2 + text4 + "\n";
            text  += "</color>";
        }
        this.setResultText(text);
    }
示例#21
0
    // Token: 0x060003DB RID: 987 RVA: 0x000184F4 File Offset: 0x000168F4
    public void CreateButton(Item.Type itemType)
    {
        RectTransform component = this.contentsList.GetComponent <RectTransform>();

        this.DeleteButtonAll();
        List <int> list = new List <int>();

        if (this.listMode == ItemScrollView.Mode.Equip)
        {
            list = this.CallObj.GetComponent <BagPanel>().Get_tmpItemListAll();
        }
        else
        {
            list.AddRange(SuperGameMaster.GetBagList());
            list.AddRange(SuperGameMaster.GetDeskList());
        }
        using (List <ItemListFormat> .Enumerator enumerator = SuperGameMaster.saveData.ItemList.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                ItemListFormat item           = enumerator.Current;
                ItemDataFormat itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(item.id);
                if (itemDataFormat != null)
                {
                    if (itemType == Item.Type.NONE || itemDataFormat.type == itemType)
                    {
                        GameObject gameObject;
                        if (itemDataFormat.type != Item.Type.Specialty)
                        {
                            gameObject = UnityEngine.Object.Instantiate <GameObject>(this.btnPref);
                            gameObject.transform.SetParent(component, false);
                            gameObject.GetComponent <ItemButton>().CngItemName(itemDataFormat.name);
                            gameObject.GetComponent <ItemButton>().CngItemInfo(itemDataFormat.info);
                        }
                        else
                        {
                            gameObject = UnityEngine.Object.Instantiate <GameObject>(this.spe_btnPref);
                            gameObject.transform.SetParent(this.spe_contentsList.GetComponent <RectTransform>(), false);
                        }
                        gameObject.GetComponent <ItemButton>().setItemId(itemDataFormat.id, itemDataFormat.type);
                        gameObject.GetComponent <ItemButton>().CngImage(itemDataFormat.img);
                        gameObject.GetComponent <ItemButton>().ItemScrollView = base.gameObject;
                        ItemScrollView.Mode mode = this.listMode;
                        if (mode != ItemScrollView.Mode.View)
                        {
                            if (mode != ItemScrollView.Mode.Present)
                            {
                                if (mode == ItemScrollView.Mode.Equip)
                                {
                                    if (itemDataFormat.spend)
                                    {
                                        int num = item.stock;
                                        if (list.FindIndex((int itemId) => itemId.Equals(item.id)) != -1)
                                        {
                                            foreach (int num2 in list)
                                            {
                                                if (num2 == item.id)
                                                {
                                                    num--;
                                                }
                                            }
                                        }
                                        gameObject.GetComponent <ItemButton>().CngStockNum(num);
                                        if (this.CallObj.GetComponent <BagPanel>().tmpBagList[this.setId] == itemDataFormat.id)
                                        {
                                            gameObject.GetComponent <ItemButton>().Fade(new Color(0.7f, 0.7f, 0.7f));
                                            gameObject.GetComponent <ItemButton>().SetCheckImage(true);
                                            gameObject.GetComponent <ItemButton>().setItemId(-2, Item.Type._ElmMax);
                                        }
                                        else if (num <= 0)
                                        {
                                            UnityEngine.Object.Destroy(gameObject);
                                        }
                                    }
                                    else
                                    {
                                        if (list.FindIndex((int itemId) => itemId.Equals(item.id)) != -1)
                                        {
                                            gameObject.GetComponent <Button>().interactable = false;
                                            if (this.CallObj.GetComponent <BagPanel>().tmpBagList[this.setId] == itemDataFormat.id)
                                            {
                                                gameObject.GetComponent <ItemButton>().SetCheckImage(true);
                                                gameObject.GetComponent <ItemButton>().Fade(new Color(0.7f, 0.7f, 0.7f));
                                                gameObject.GetComponent <ItemButton>().setItemId(-2, Item.Type._ElmMax);
                                                gameObject.GetComponent <Button>().interactable = true;
                                            }
                                            else
                                            {
                                                gameObject.GetComponent <ItemButton>().Fade(new Color(0.7f, 0.7f, 0.7f));
                                            }
                                        }
                                        gameObject.GetComponent <ItemButton>().CngStockNum(-2);
                                    }
                                }
                            }
                            else if (itemDataFormat.spend)
                            {
                                int num3 = item.stock;
                                if (list.FindIndex((int itemId) => itemId.Equals(item.id)) != -1)
                                {
                                    foreach (int num4 in list)
                                    {
                                        if (num4 == item.id)
                                        {
                                            num3--;
                                        }
                                    }
                                }
                                if (num3 > 0)
                                {
                                    gameObject.GetComponent <ItemButton>().CngStockNum(num3);
                                }
                                else
                                {
                                    UnityEngine.Object.Destroy(gameObject);
                                }
                            }
                            else
                            {
                                gameObject.GetComponent <ItemButton>().CngStockNum(-2);
                            }
                        }
                        else
                        {
                            gameObject.GetComponent <Button>().enabled = false;
                            if (itemDataFormat.spend)
                            {
                                int num5 = item.stock;
                                if (list.FindIndex((int itemId) => itemId.Equals(item.id)) != -1)
                                {
                                    foreach (int num6 in list)
                                    {
                                        if (num6 == item.id)
                                        {
                                            num5--;
                                        }
                                    }
                                }
                                if (num5 > 0)
                                {
                                    gameObject.GetComponent <ItemButton>().CngStockNum(num5);
                                }
                                else
                                {
                                    UnityEngine.Object.Destroy(gameObject);
                                }
                            }
                            else
                            {
                                gameObject.GetComponent <ItemButton>().CngStockNum(-2);
                            }
                        }
                    }
                }
            }
        }
    }
示例#22
0
    // Token: 0x06000333 RID: 819 RVA: 0x00010DE4 File Offset: 0x0000F1E4
    public void getState()
    {
        if (this.pathNodeSelect)
        {
            this.setResultText("経路選択中のモードです。\n終了するには再度「経由」ボタンを押してください");
            return;
        }
        List <TravelSimulator.ItemEffect> list = new List <TravelSimulator.ItemEffect>();
        List <int> list2 = new List <int>(SuperGameMaster.GetBagList());

        foreach (int num in list2)
        {
            if (num != -1)
            {
                ItemDataFormat itemDataFormat = new ItemDataFormat();
                itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(num);
                for (int i = 0; i < itemDataFormat.effectType.Length; i++)
                {
                    list.Add(new TravelSimulator.ItemEffect
                    {
                        type  = itemDataFormat.effectType[i],
                        elm   = itemDataFormat.effectElm[i],
                        value = itemDataFormat.effectValue[i]
                    });
                }
            }
        }
        int        num2  = 100;
        int        num3  = 0;
        List <int> list3 = new List <int>();

        for (int j = 0; j < 5; j++)
        {
            list3.Add(0);
        }
        int        num4  = 0;
        List <int> list4 = new List <int>();

        for (int k = 0; k < 5; k++)
        {
            list4.Add(0);
        }
        List <int> list5 = new List <int>();

        for (int l = 0; l < 4; l++)
        {
            list5.Add(0);
        }
        int  num5 = 0;
        bool flag = false;

        foreach (TravelSimulator.ItemEffect itemEffect in list)
        {
            switch (itemEffect.type)
            {
            case EffectType.HP:
                if (itemEffect.elm == EffectElm.H_UP)
                {
                    num2 += itemEffect.value;
                }
                if (itemEffect.elm == EffectElm.H_UP_RND)
                {
                    num3 += itemEffect.value;
                }
                break;

            case EffectType.AREA_DECIDE:
            {
                int num6 = itemEffect.elm - EffectElm.A_EAST;
                if (itemEffect.elm == EffectElm.A_NEW_AREA)
                {
                    num6 = 4;
                }
                if (itemEffect.value == -2)
                {
                    list3[num6] = -2;
                }
                if (itemEffect.value == -1 && list3[num6] != -2)
                {
                    list3[num6] = -1;
                }
                if (list3[num6] != -1 && list3[num6] != -2)
                {
                    List <int> list6;
                    int        index;
                    (list6 = list3)[index = num6] = list6[index] + itemEffect.value;
                }
                break;
            }

            case EffectType.ITEM_PERCENT:
                if (itemEffect.elm == EffectElm.I_UP)
                {
                    num4 += itemEffect.value;
                }
                break;

            case EffectType.WAY_SPEED:
            {
                int num6 = itemEffect.elm - EffectElm.W_MOUNTAIN + 1;
                if (itemEffect.elm == EffectElm.W_NONE)
                {
                    num6 = 0;
                }
                if (itemEffect.elm == EffectElm.W_ALL)
                {
                    num6 = list4.Count - 1;
                }
                List <int> list6;
                int        index2;
                (list6 = list4)[index2 = num6] = list6[index2] + itemEffect.value;
                break;
            }

            case EffectType.EVT_WAY:
                if (itemEffect.value > list5[itemEffect.elm - EffectElm.E_MOUNTAIN])
                {
                    list5[itemEffect.elm - EffectElm.E_MOUNTAIN] = itemEffect.value;
                }
                break;

            case EffectType.FRIENDSHIP:
                if (itemEffect.value == -1)
                {
                    num5 = -1;
                }
                if (num5 != -1)
                {
                    num5 += num5;
                }
                break;

            case EffectType.TELEPORT:
                if (itemEffect.value == 1)
                {
                    flag = true;
                }
                break;
            }
        }
        string text = "【装備:";

        foreach (int num7 in list2)
        {
            if (num7 == -1)
            {
                text += "(なし),";
            }
            else
            {
                ItemDataFormat itemDataFormat2 = new ItemDataFormat();
                itemDataFormat2 = SuperGameMaster.sDataBase.get_ItemDB_forId(num7);
                text            = text + itemDataFormat2.name + ",";
            }
        }
        text  = text.Remove(text.Length - 1, 1);
        text += "】\n";
        string text2;

        if (num3 == 0)
        {
            text2 = text;
            text  = string.Concat(new object[]
            {
                text2,
                " HP:",
                (int)((double)(100 * num2) * 0.01),
                "(",
                num2 - 100,
                "%) "
            });
        }
        else
        {
            text2 = text;
            text  = string.Concat(new object[]
            {
                text2,
                " HP:",
                (int)((double)(100 * num2) * 0.01),
                " ~ ",
                (double)(100 * (num2 + num3)) * 0.01,
                "(+",
                num2 - 100,
                " ~ ",
                num2 - 100 + num3,
                "%) "
            });
        }
        text += " / エリア出現率補正(+新): ";
        for (int m = 0; m < list3.Count; m++)
        {
            if (list3[m] == -1)
            {
                text += "確定1 ";
            }
            else if (list3[m] == -2)
            {
                text += "確定2 ";
            }
            else
            {
                text = text + list3[m] + "% ";
            }
        }
        text2 = text;
        text  = string.Concat(new object[]
        {
            text2,
            " / アイテム取得:逸品 + ",
            num4,
            "% 名物",
            60 + num4,
            " ( + ",
            num4,
            "%) "
        });
        text += " / 移動コスト(+All): ";
        for (int n = 0; n < list4.Count; n++)
        {
            text = text + list4[n] + "% ";
        }
        text += " / グレード: ";
        for (int num8 = 0; num8 < list5.Count; num8++)
        {
            text = text + list5[num8] + ",";
        }
        text  = text.Remove(text.Length - 1, 1);
        text += " / 遭遇率:(共通)";
        if (num5 == -1)
        {
            text += "確定 ";
        }
        else
        {
            text2 = text;
            text  = string.Concat(new object[]
            {
                text2,
                num5,
                "%(",
                num5,
                "%)"
            });
        }
        text = text + " / 瞬間移動:" + flag.ToString().Substring(0, 1);
        this.setResultText(text);
    }
示例#23
0
    // Token: 0x060003D1 RID: 977 RVA: 0x00017DE4 File Offset: 0x000161E4
    public void GetBagList()
    {
        string text = "\n";

        text += "\n\n【支度リスト】 (bagList/DeskList) ~~~~~~~~~~~ \n";
        text += "\u3000かばん:\n";
        foreach (int num in SuperGameMaster.GetBagList())
        {
            if (num == -1)
            {
                text += "\u3000\u3000\u3000\u3000\u3000- ,\n";
            }
            else
            {
                ItemDataFormat itemDataFormat = new ItemDataFormat();
                itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(num);
                text           = text + "\u3000\u3000\u3000\u3000\u3000" + itemDataFormat.name + ",\n";
            }
        }
        text += "\u3000つくえ:\n";
        foreach (int num2 in SuperGameMaster.GetDeskList())
        {
            if (num2 == -1)
            {
                text += "\u3000\u3000\u3000\u3000\u3000\u3000- ,\n";
            }
            else
            {
                ItemDataFormat itemDataFormat2 = new ItemDataFormat();
                itemDataFormat2 = SuperGameMaster.sDataBase.get_ItemDB_forId(num2);
                text            = text + "\u3000\u3000\u3000\u3000\u3000" + itemDataFormat2.name + ",\n";
            }
        }
        text += "\n~~~~~~~~~(仮想リスト)~~~~~~~~~\n";
        text += "\u3000かばん:\n";
        foreach (int num3 in SuperGameMaster.GetBagList_virtual())
        {
            if (num3 == -1)
            {
                text += "\u3000\u3000\u3000\u3000\u3000\u3000- ,\n";
            }
            else
            {
                ItemDataFormat itemDataFormat3 = new ItemDataFormat();
                itemDataFormat3 = SuperGameMaster.sDataBase.get_ItemDB_forId(num3);
                text            = text + "\u3000\u3000\u3000\u3000\u3000" + itemDataFormat3.name + ",\n";
            }
        }
        text += "\u3000つくえ:\n";
        foreach (int num4 in SuperGameMaster.GetDeskList_virtual())
        {
            if (num4 == -1)
            {
                text += "\u3000\u3000\u3000\u3000\u3000\u3000- ,\n";
            }
            else
            {
                ItemDataFormat itemDataFormat4 = new ItemDataFormat();
                itemDataFormat4 = SuperGameMaster.sDataBase.get_ItemDB_forId(num4);
                text            = text + "\u3000\u3000\u3000\u3000\u3000" + itemDataFormat4.name + ",\n";
            }
        }
        this.Result_text.GetComponent <Text>().text = text;
    }