Exemple #1
0
 public void AddIngredient(int itemID, int quantity)
 {
     if (!RequiredItems.Any(x => x.ItemId == itemID))
     {
         RequiredItems.Add(new ItemQuantity(itemID, quantity));
     }
 }
Exemple #2
0
 /// <summary>
 /// Marks the specified item as required. It is moved from the bank to the inventory and will not be moved into the bank via BankAllCoinItems.
 /// </summary>
 /// <param name="item">The item to mark as required.</param>
 public void Require(string item)
 {
     RequiredItems.Add(item.ToLower());
     if (Bot.Bank.Contains(item))
     {
         ScriptInterface.Instance.Bank.ToInventory(item);
     }
 }
 public RecipeItem(string name, long strengthBonus, long agilityBonus, long intelligenceBonus, long hitPointsBonus, long damageBonus, params string[] items) : base(name, strengthBonus, agilityBonus, intelligenceBonus, hitPointsBonus, damageBonus)
 {
     this.RequiredItems = new List <string>();
     foreach (var item in items)
     {
         RequiredItems.Add(item);
     }
 }
 void Awake()
 {
     if (_alertList.Count == 0)
     {
         throw new System.Exception(gameObject.name + " has no interactable object");
     }
     _requiredItems = GetComponent <RequiredItems>();
     _renderer      = GetComponent <Renderer>();
     _baseMaterial  = _renderer.material;
 }
Exemple #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dataString"></param>
        public RewardEntry(string dataString)
            : this()
        {
            var data         = dataString.Split(';');
            var requiredData = data[0];
            var rewardedData = data[1];

            foreach (var required in requiredData.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
            {
                var subData  = required.Split(':');
                var type     = subData[0];
                var id       = int.Parse(subData[1]);
                var quantity = int.Parse(subData[2]);

                switch (type)
                {
                case "kamas":
                    RequiredKamas = quantity;
                    break;

                case "item":
                    RequiredItems.Add(new ItemEntry(id, quantity));
                    break;
                }
            }

            foreach (var reward in rewardedData.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
            {
                var subData  = reward.Split(':');
                var type     = subData[0];
                var id       = int.Parse(subData[1]);
                var quantity = int.Parse(subData[2]);

                switch (type)
                {
                case "kamas":
                    RewardedKamas = quantity;
                    break;

                case "item":
                    RewardedItems.Add(new ItemEntry(id, quantity));
                    break;
                }
            }
        }
Exemple #6
0
 public bool DeepEquals(DestinyItemActionBlockDefinition?other)
 {
     return(other is not null &&
            VerbName == other.VerbName &&
            VerbDescription == other.VerbDescription &&
            IsPositive == other.IsPositive &&
            OverlayScreenName == other.OverlayScreenName &&
            OverlayIcon == other.OverlayIcon &&
            RequiredCooldownSeconds == other.RequiredCooldownSeconds &&
            RequiredItems.DeepEqualsList(other.RequiredItems) &&
            ProgressionRewards.DeepEqualsList(other.ProgressionRewards) &&
            ActionTypeLabel == other.ActionTypeLabel &&
            RequiredLocation == other.RequiredLocation &&
            RequiredCooldownHash == other.RequiredCooldownHash &&
            DeleteOnAction == other.DeleteOnAction &&
            ConsumeEntireStack == other.ConsumeEntireStack &&
            UseOnAcquire == other.UseOnAcquire);
 }
        /// <summary>
        /// Gets the reward string for all the required items
        /// </summary>
        /// <returns>The reward string</returns>
        private string GetRewardStringForRequiredItems()
        {
            if (RequiredItems.Count == 0)
            {
                Globals.ConsoleError($"No items defined for bundle {Name}");
                return("");
            }

            if (Room == CommunityCenterRooms.Vault)
            {
                return(RequiredItems.First().GetStringForBundles(true));
            }

            string output = "";

            foreach (RequiredItem item in RequiredItems)
            {
                output += $"{item.GetStringForBundles(false)} ";
            }
            return(output.Trim());
        }
Exemple #8
0
 public bool DeepEquals(InventoryItemAction other)
 {
     return(other != null &&
            OverlayScreenName == other.OverlayScreenName &&
            OverlayIcon == other.OverlayIcon &&
            ActionTypeLabel == other.ActionTypeLabel &&
            ConsumeEntireStack == other.ConsumeEntireStack &&
            DeleteOnAction == other.DeleteOnAction &&
            IsPositive == other.IsPositive &&
            ProgressionRewards.DeepEqualsReadOnlyCollections(other.ProgressionRewards) &&
            RequiredCooldownHash == other.RequiredCooldownHash &&
            RequiredCooldownSeconds == other.RequiredCooldownSeconds &&
            RequiredLocation == other.RequiredLocation &&
            RequiredItems.DeepEqualsReadOnlyCollections(other.RequiredItems) &&
            UseOnAcquire == other.UseOnAcquire &&
            VerbDescription == other.VerbDescription &&
            VerbName == other.VerbName &&
            RewardItemHash == other.RewardItemHash &&
            RewardSheet.DeepEquals(other.RewardSheet) &&
            RewardSiteHash == other.RewardSiteHash);
 }
Exemple #9
0
        /// <summary>
        /// Returns the string used for the blueprint object
        /// </summary>
        /// <returns />
        public override string ToString()
        {
            string requiredItemsString = string.Join(" ", RequiredItems.Select(x => x.GetStringForBuildings()));

            return($"{requiredItemsString}/{CenterText}/{Price}/{EndText}");
        }
 void Awake()
 {
     _requiredItems = GetComponent <RequiredItems>();
 }
Exemple #11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="templateIds"></param>
 /// <param name="quantity"></param>
 /// <returns></returns>
 public bool Match(Dictionary <int, long> templates, long kamas)
 {
     return(RequiredKamas == kamas &&
            RequiredItems.All(required => templates.Any(template => required.TemplateId == template.Key && required.Quantity == template.Value)) &&
            templates.All(template => RequiredItems.Any(required => required.TemplateId == template.Key && required.Quantity == template.Value)));
 }
Exemple #12
0
        public bool Equals(DestinyItemActionBlockDefinition input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     VerbName == input.VerbName ||
                     (VerbName != null && VerbName.Equals(input.VerbName))
                     ) &&
                 (
                     VerbDescription == input.VerbDescription ||
                     (VerbDescription != null && VerbDescription.Equals(input.VerbDescription))
                 ) &&
                 (
                     IsPositive == input.IsPositive ||
                     (IsPositive != null && IsPositive.Equals(input.IsPositive))
                 ) &&
                 (
                     OverlayScreenName == input.OverlayScreenName ||
                     (OverlayScreenName != null && OverlayScreenName.Equals(input.OverlayScreenName))
                 ) &&
                 (
                     OverlayIcon == input.OverlayIcon ||
                     (OverlayIcon != null && OverlayIcon.Equals(input.OverlayIcon))
                 ) &&
                 (
                     RequiredCooldownSeconds == input.RequiredCooldownSeconds ||
                     (RequiredCooldownSeconds.Equals(input.RequiredCooldownSeconds))
                 ) &&
                 (
                     RequiredItems == input.RequiredItems ||
                     (RequiredItems != null && RequiredItems.SequenceEqual(input.RequiredItems))
                 ) &&
                 (
                     ProgressionRewards == input.ProgressionRewards ||
                     (ProgressionRewards != null && ProgressionRewards.SequenceEqual(input.ProgressionRewards))
                 ) &&
                 (
                     ActionTypeLabel == input.ActionTypeLabel ||
                     (ActionTypeLabel != null && ActionTypeLabel.Equals(input.ActionTypeLabel))
                 ) &&
                 (
                     RequiredLocation == input.RequiredLocation ||
                     (RequiredLocation != null && RequiredLocation.Equals(input.RequiredLocation))
                 ) &&
                 (
                     RequiredCooldownHash == input.RequiredCooldownHash ||
                     (RequiredCooldownHash.Equals(input.RequiredCooldownHash))
                 ) &&
                 (
                     DeleteOnAction == input.DeleteOnAction ||
                     (DeleteOnAction != null && DeleteOnAction.Equals(input.DeleteOnAction))
                 ) &&
                 (
                     ConsumeEntireStack == input.ConsumeEntireStack ||
                     (ConsumeEntireStack != null && ConsumeEntireStack.Equals(input.ConsumeEntireStack))
                 ) &&
                 (
                     UseOnAcquire == input.UseOnAcquire ||
                     (UseOnAcquire != null && UseOnAcquire.Equals(input.UseOnAcquire))
                 ));
        }
Exemple #13
0
 public void Update(DestinyItemActionBlockDefinition?other)
 {
     if (other is null)
     {
         return;
     }
     if (VerbName != other.VerbName)
     {
         VerbName = other.VerbName;
         OnPropertyChanged(nameof(VerbName));
     }
     if (VerbDescription != other.VerbDescription)
     {
         VerbDescription = other.VerbDescription;
         OnPropertyChanged(nameof(VerbDescription));
     }
     if (IsPositive != other.IsPositive)
     {
         IsPositive = other.IsPositive;
         OnPropertyChanged(nameof(IsPositive));
     }
     if (OverlayScreenName != other.OverlayScreenName)
     {
         OverlayScreenName = other.OverlayScreenName;
         OnPropertyChanged(nameof(OverlayScreenName));
     }
     if (OverlayIcon != other.OverlayIcon)
     {
         OverlayIcon = other.OverlayIcon;
         OnPropertyChanged(nameof(OverlayIcon));
     }
     if (RequiredCooldownSeconds != other.RequiredCooldownSeconds)
     {
         RequiredCooldownSeconds = other.RequiredCooldownSeconds;
         OnPropertyChanged(nameof(RequiredCooldownSeconds));
     }
     if (!RequiredItems.DeepEqualsList(other.RequiredItems))
     {
         RequiredItems = other.RequiredItems;
         OnPropertyChanged(nameof(RequiredItems));
     }
     if (!ProgressionRewards.DeepEqualsList(other.ProgressionRewards))
     {
         ProgressionRewards = other.ProgressionRewards;
         OnPropertyChanged(nameof(ProgressionRewards));
     }
     if (ActionTypeLabel != other.ActionTypeLabel)
     {
         ActionTypeLabel = other.ActionTypeLabel;
         OnPropertyChanged(nameof(ActionTypeLabel));
     }
     if (RequiredLocation != other.RequiredLocation)
     {
         RequiredLocation = other.RequiredLocation;
         OnPropertyChanged(nameof(RequiredLocation));
     }
     if (RequiredCooldownHash != other.RequiredCooldownHash)
     {
         RequiredCooldownHash = other.RequiredCooldownHash;
         OnPropertyChanged(nameof(RequiredCooldownHash));
     }
     if (DeleteOnAction != other.DeleteOnAction)
     {
         DeleteOnAction = other.DeleteOnAction;
         OnPropertyChanged(nameof(DeleteOnAction));
     }
     if (ConsumeEntireStack != other.ConsumeEntireStack)
     {
         ConsumeEntireStack = other.ConsumeEntireStack;
         OnPropertyChanged(nameof(ConsumeEntireStack));
     }
     if (UseOnAcquire != other.UseOnAcquire)
     {
         UseOnAcquire = other.UseOnAcquire;
         OnPropertyChanged(nameof(UseOnAcquire));
     }
 }