Exemple #1
0
        public void refresh(GameLogic.ItemInstance itemInstance)
        {
            this.ItemInstance = itemInstance;
            Item item = this.ItemInstance.Item;

            this.Notifier.SetActive(!this.ItemInstance.InspectedByPlayer);
            this.Name.text       = StringExtensions.ToUpperLoca(item.Name);
            this.LevelValue.text = this.ItemInstance.Level + "/" + App.Binder.ConfigMeta.GLOBAL_LEVEL_CAP;
            for (int i = 0; i < 5; i++)
            {
                this.Stars[i].enabled = item.Rarity >= i;
            }
            if (item.Type == ItemType.Weapon)
            {
                this.PrimaryStatText.text  = "Attack";
                this.PrimaryStatValue.text = "CHANGE ME";
            }
            else
            {
                this.PrimaryStatText.text  = "Defense";
                this.PrimaryStatValue.text = "CHANGE ME";
            }
            this.Icon.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", itemInstance.Item.SpriteId);
            if (GameLogic.Binder.GameState.Player.ActiveCharacter.isItemInstanceEquipped(this.ItemInstance))
            {
                this.EquippedText.gameObject.SetActive(true);
            }
            else
            {
                this.EquippedText.gameObject.SetActive(false);
            }
        }
 private void onItemRankUpped(CharacterInstance character, GameLogic.ItemInstance itemInstance, int rankUpCount, bool free)
 {
     if (!this.UpgradeParticleEffect.isPlaying)
     {
         this.UpgradeParticleEffect.Play();
     }
     this.onRefresh();
 }
 private void onItemEvolved(CharacterInstance character, GameLogic.ItemInstance itemInstance)
 {
     if (!this.UpgradeParticleEffect.isPlaying)
     {
         this.UpgradeParticleEffect.Play();
     }
     this.onRefresh();
 }
Exemple #4
0
        public void addShopEntryDrop(Player player, string shopEntryId, [Optional, DefaultParameterValue(false)] bool applyMysteryChestDiminisher)
        {
            double            num;
            CharacterInstance activeCharacter = player.ActiveCharacter;
            ShopEntry         shopEntry       = ConfigShops.GetShopEntry(shopEntryId);

            this.ShopEntryDrops.Add(shopEntryId);
            if (string.IsNullOrEmpty(this.ShopEntryId))
            {
                this.ShopEntryId = shopEntryId;
            }
            switch (shopEntry.Type)
            {
            case ShopEntryType.CoinBundle:
            {
                if (!applyMysteryChestDiminisher)
                {
                    num = ConfigShops.CalculateCoinBundleSize(player, shopEntry.Id, 1);
                    break;
                }
                ConfigMeta configMeta  = App.Binder.ConfigMeta;
                double     numUpgrades = player.getMysteryCoinOfferMultiplier(shopEntryId);
                num = configMeta.CoinBundleSize(activeCharacter.HighestLevelItemOwnedAtFloorStart, player, shopEntryId, numUpgrades, 0.0);
                break;
            }

            case ShopEntryType.IapDiamonds:
            case ShopEntryType.IapStarterBundle:
            case ShopEntryType.SpecialChest:
            case ShopEntryType.RewardBox:
                return;

            case ShopEntryType.Boost:
                this.Boost = shopEntry.Boost;
                return;

            case ShopEntryType.MysteryItem:
            {
                ItemInstance item = ConfigShops.CreateNewMysteryItemInstance(player, shopEntry.Id);
                this.ItemDrops.Add(item);
                return;
            }

            case ShopEntryType.TokenBundle:
                MathUtil.DistributeValuesIntoChunksInt((int)ConfigShops.CalculateTokenBundleSize(player, shopEntry.Id), shopEntry.NumBursts, ref this.TokenDrops);
                return;

            case ShopEntryType.ReviveBundle:
                this.Revives = (int)ConfigShops.CalculateReviveBundleSize(shopEntry.Id);
                return;

            case ShopEntryType.FrenzyBundle:
                this.FrenzyPotions = (int)ConfigShops.CalculateFrenzyBundleSize(shopEntry.Id);
                return;

            case ShopEntryType.DustBundle:
                MathUtil.DistributeValuesIntoChunksInt((int)ConfigShops.CalculateDustBundleSize(activeCharacter, shopEntry.Id), shopEntry.NumBursts, ref this.DustDrops);
                return;

            case ShopEntryType.DiamondBundle:
                MathUtil.DistributeValuesIntoChunksInt((int)ConfigShops.CalculateDiamondBundleSize(player, shopEntry.Id), shopEntry.NumBursts, ref this.DiamondDrops);
                return;

            case ShopEntryType.XpBundle:
                this.XpPotions = (int)ConfigShops.CalculateXpBundleSize(shopEntry.Id);
                return;

            case ShopEntryType.BossBundle:
                this.BossPotions = (int)ConfigShops.CalculateBossBundleSize(shopEntry.Id);
                return;

            case ShopEntryType.PetBundle:
            {
                string    str     = CmdRollPetBundleLootTable.ExecuteStatic(App.Binder.ConfigLootTables.PetBundleLootTables[shopEntry.Id], player);
                int       num6    = ConfigShops.CalculatePetBundleSize(player, shopEntry.Id);
                PetReward reward3 = new PetReward();
                reward3.PetId  = str;
                reward3.Amount = num6;
                this.Pets.Add(reward3);
                return;
            }

            case ShopEntryType.PetBox:
            {
                this.ChestType = shopEntry.ChestType;
                Reward reward = new Reward();
                CmdRollChestLootTable.ExecuteStatic(shopEntry.ChestType, player, false, ref reward, null);
                this.Pets.AddRange(reward.Pets);
                return;
            }

            case ShopEntryType.MegaBoxBundle:
                this.MegaBoxes = (int)ConfigShops.CalculateMegaBoxBundleSize(shopEntry.Id);
                return;

            case ShopEntryType.LootBox:
            {
                Reward reward2 = new Reward();
                CmdRollChestLootTable.ExecuteStatic(shopEntry.ChestType, player, false, ref reward2, null);
                this.copyFrom(reward2);
                this.ChestType = shopEntry.ChestType;
                return;
            }

            default:
                return;
            }
            MathUtil.DistributeValuesIntoChunksDouble(num, shopEntry.NumBursts, ref this.CoinDrops);
        }
 public CmdRerollItemPerks(CharacterInstance character, ItemInstance itemInstance)
 {
     this.m_character    = character;
     this.m_itemInstance = itemInstance;
 }
 public CmdEvolveItem(CharacterInstance character, ItemInstance itemInstance)
 {
     this.m_character    = character;
     this.m_itemInstance = itemInstance;
 }
 public CmdUnlockItem(ItemInstance itemInstance)
 {
     this.m_itemInstance = itemInstance;
 }
 public CmdInstantUpgradeItem(ItemInstance itemInstance, CharacterInstance owner)
 {
     this.m_itemInstance = itemInstance;
     this.m_owner        = owner;
 }
 public CmdSellItem(CharacterInstance character, ItemInstance itemInstance, [Optional, DefaultParameterValue(null)] RectTransform flyToHudOrigin)
 {
     this.m_character      = character;
     this.m_itemInstance   = itemInstance;
     this.m_flyToHudOrigin = flyToHudOrigin;
 }
Exemple #10
0
 public CmdGainItemInstance(CharacterInstance character, ItemInstance itemInstance, [Optional, DefaultParameterValue("")] string trackingId)
 {
     this.m_character    = character;
     this.m_itemInstance = itemInstance;
     this.m_trackingId   = trackingId;
 }
Exemple #11
0
 private void onItemEquipped(CharacterInstance character, ItemInstance itemInstance, ItemInstance replacedItemInstance)
 {
     if (replacedItemInstance != null)
     {
         List <Buff> list = this.m_characterBuffLists[character];
         for (int i = list.Count - 1; i >= 0; i--)
         {
             Buff buff = list[i];
             if (buff.Source.IconProvider == replacedItemInstance.Item)
             {
                 this.endBuff(buff);
             }
         }
     }
 }
 public CmdInspectItem(ItemInstance itemInstance)
 {
     this.m_itemInstance = itemInstance;
 }
 public void refresh(CharacterInstance owner, GameLogic.ItemInstance itemInstance, GameLogic.Item item)
 {
     this.ItemInstance = itemInstance;
     this.Item         = item;
     if (itemInstance != null)
     {
         this.Background.gameObject.SetActive(true);
         if (owner.isItemEquipped(itemInstance.Item))
         {
             this.Background.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", "sprite_ui_itemcard_equipped");
         }
         else
         {
             this.Background.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", "sprite_ui_itemcard_active");
         }
         this.Button.interactable = true;
         this.Icon.gameObject.SetActive(true);
         this.Icon.sprite = PlayerView.Binder.SpriteResources.getSprite("Menu", itemInstance.Item.SpriteId);
         this.Icon.color  = Color.white;
         this.IconBorders.gameObject.SetActive(true);
         this.IconBorders.enabled  = true;
         this.IconBorders.material = null;
         if (owner.hasReachedUnlockFloorForItem(itemInstance))
         {
             this.Icon.material = null;
         }
         else
         {
             this.Icon.material = !ConfigUi.MENU_UNEQUIPPABLE_ITEM_GREYSCALE_ENABLED ? null : this.m_greyscaleMaterial;
         }
         this.LevelIcon.gameObject.SetActive(false);
         this.Level.gameObject.SetActive(false);
         MenuHelpers.RefreshStarContainer(this.Stars, this.m_originalStarLocalPositions, itemInstance.Rarity, false);
         this.IndicatorNew.enabled     = !itemInstance.InspectedByPlayer;
         this.IndicatorNewIcon.enabled = !itemInstance.InspectedByPlayer;
         this.ProgressBar.gameObject.SetActive(true);
         this.ProgressText.gameObject.SetActive(true);
         this.ProgressBarFill.color = Color.white;
         this.ProgressText.text     = "Lv 0";
         this.ProgressBar.setNormalizedValue(0f);
         this.ProgressBarFill.sprite = PlayerView.Binder.SpriteResources.getSprite("DungeonHud", "sprite_ui_progressbar_front_gold");
         this.UnlockButtonRoot.SetActive(false);
         this.Name.gameObject.SetActive(true);
         this.Name.text = StringExtensions.ToUpperLoca(itemInstance.Item.Name);
         this.Type.text = itemInstance.Item.Type.ToString();
     }
     else if (item != null)
     {
         this.Background.gameObject.SetActive(true);
         this.Background.sprite   = PlayerView.Binder.SpriteResources.getSprite("Menu", "sprite_ui_itemcard_inactive");
         this.Button.interactable = true;
         this.Icon.gameObject.SetActive(true);
         this.Icon.sprite   = PlayerView.Binder.SpriteResources.getSprite("Menu", item.SpriteId);
         this.Icon.material = this.m_greyscaleMaterial;
         this.Icon.color    = Color.white;
         this.IconBorders.gameObject.SetActive(true);
         this.IconBorders.enabled = true;
         this.LevelIcon.gameObject.SetActive(false);
         this.Level.gameObject.SetActive(false);
         MenuHelpers.RefreshStarContainer(this.Stars, this.m_originalStarLocalPositions, item.Rarity, false);
         this.IconBorders.material     = this.m_greyscaleMaterial;
         this.LevelIcon.sprite         = PlayerView.Binder.SpriteResources.getSprite("Menu", ConfigUi.RARITY_ITEM_LEVEL_BACKGROUND_SPRITES[0]);
         this.IndicatorNew.enabled     = false;
         this.IndicatorNewIcon.enabled = false;
         int num = owner.getShardCountForItem(item);
         this.UnlockButtonRoot.SetActive(false);
         this.ProgressBar.gameObject.SetActive(true);
         this.ProgressText.gameObject.SetActive(true);
         this.ProgressBar.setNormalizedValue(Mathf.Clamp01(((float)num) / 1f));
         this.ProgressText.text      = num + "/" + 1f;
         this.ProgressBarFill.sprite = PlayerView.Binder.SpriteResources.getSprite("DungeonHud", "sprite_ui_progressbar_front_blue");
         this.Name.gameObject.SetActive(true);
         this.Name.text = StringExtensions.ToUpperLoca(item.Name);
         this.Type.text = item.Type.ToString();
     }
     else
     {
         this.Background.gameObject.SetActive(false);
         this.Button.interactable = false;
         this.Icon.gameObject.SetActive(false);
         this.IconBorders.gameObject.SetActive(false);
         for (int i = 0; i < 5; i++)
         {
             this.Stars[i].enabled = false;
         }
         this.LevelIcon.gameObject.SetActive(false);
         this.Level.gameObject.SetActive(false);
         this.IndicatorNew.enabled     = false;
         this.IndicatorNewIcon.enabled = false;
         this.ProgressBar.gameObject.SetActive(false);
         this.ProgressText.gameObject.SetActive(false);
         this.UnlockButtonRoot.SetActive(false);
         this.Name.gameObject.SetActive(false);
         this.Type.gameObject.SetActive(false);
     }
 }
 private bool isItemBetterThanEquipped(CharacterInstance owner, GameLogic.ItemInstance itemInstance)
 {
     return(true);
 }