Skip to content

Commit

Permalink
Merge branch 'dev/1190-Shop_duplicates'
Browse files Browse the repository at this point in the history
  • Loading branch information
NPBruce committed Aug 13, 2019
2 parents 0a01d0a + 10a50b5 commit 33cefd0
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 28 deletions.
2 changes: 1 addition & 1 deletion unity/Assets/Resources/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.01
2.4.02
5 changes: 0 additions & 5 deletions unity/Assets/Scripts/Content/ContentData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,6 @@ public class ItemData : GenericData
public int price = 0;
public int minFame = -1;
public int maxFame = -1;
public int qty = 1;

public ItemData(string name, Dictionary<string, string> content, string path) : base(name, content, path, type)
{
Expand All @@ -1252,10 +1251,6 @@ public ItemData(string name, Dictionary<string, string> content, string path) :
{
maxFame = Fame(content["maxfame"]);
}
if (content.ContainsKey("qty"))
{
int.TryParse(content["qty"], out qty);
}
}

public static int Fame(string name)
Expand Down
20 changes: 0 additions & 20 deletions unity/Assets/Scripts/Quest/Quest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,26 +304,6 @@ public bool AttemptItemMatch(QuestData.QItem qItem, int fame, bool force = true)
// we don't want duplicate in the shop
exclude.AddRange(itemSelect.Values.ToList());

// remove items with qty not yet reached from exclude list
Dictionary<string, int> itemsRemaining = new Dictionary<string, int>();
foreach (string item in exclude)
{
if (game.cd.items.ContainsKey(item))
{
if (!itemsRemaining.ContainsKey(item))
{
itemsRemaining.Add(item, game.cd.items[item].qty);
}
}
}
foreach (string item in itemsRemaining.Keys)
{
if (itemsRemaining[item] <= exclude.Count(element => element == item))
{
exclude.RemoveAll(element => element == item);
}
}

// Start a list of matches
List<string> list = new List<string>();
foreach (KeyValuePair<string, ItemData> kv in game.cd.items)
Expand Down
2 changes: 0 additions & 2 deletions unity/Assets/StreamingAssets/content/D2E/base/items.ini
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ traits=armor light_armor act1
minfame=insignificant
maxfame=noteworthy
price=75
qty=2

[ItemLeatherArmor2]
name={ffg:ITEM_LEATHER_ARMOR}
Expand Down Expand Up @@ -142,7 +141,6 @@ traits=one_handed shield act1
minfame=insignificant
maxfame=noteworthy
price=50
qty=2

[ItemIronShield2]
name={ffg:ITEM_IRON_SHIELD_2}
Expand Down

0 comments on commit 33cefd0

Please # to comment.