- Trading for foil now also requires a payment of 4G.
This commit is contained in:
@@ -109,7 +109,7 @@ public class CollectionsManager {
|
||||
addItemsToPlayerCollection(_playerDAO.getPlayer(player), collectionType, items);
|
||||
}
|
||||
|
||||
public boolean tradeCards(Player player, CollectionType collectionType, String blueprintId1, int count1, String blueprintId2, int count2) {
|
||||
public boolean tradeCards(Player player, CollectionType collectionType, String blueprintId1, int count1, String blueprintId2, int count2, int currencyCost) {
|
||||
_readWriteLock.writeLock().lock();
|
||||
try {
|
||||
final CardCollection playerCollection = getPlayerCollection(player, collectionType.getCode());
|
||||
@@ -117,6 +117,8 @@ public class CollectionsManager {
|
||||
MutableCardCollection mutableCardCollection = new DefaultCardCollection(playerCollection);
|
||||
if (!mutableCardCollection.removeItem(blueprintId1, count1))
|
||||
return false;
|
||||
if (!mutableCardCollection.removeCurrency(currencyCost))
|
||||
return false;
|
||||
mutableCardCollection.addItem(blueprintId2, count2);
|
||||
|
||||
_collectionDAO.setCollectionForPlayer(player.getId(), collectionType.getCode(), mutableCardCollection);
|
||||
|
||||
@@ -164,9 +164,9 @@ public class MerchantService {
|
||||
Lock lock = _lock.writeLock();
|
||||
lock.lock();
|
||||
try {
|
||||
boolean success = _collectionsManager.tradeCards(player, _permanentCollection, blueprintId, 4, blueprintId + "*", 1);
|
||||
boolean success = _collectionsManager.tradeCards(player, _permanentCollection, blueprintId, 4, blueprintId + "*", 1, 400);
|
||||
if (!success)
|
||||
throw new MerchantException("Unable to remove the required cards from your collection");
|
||||
throw new MerchantException("Unable to remove the required cards or currency from your collection");
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ color now.
|
||||
- Added collector's information sorting, also added checkbox for hiding merchant buttons on Merchant screen.
|
||||
- Deck upon loading now will be sorted, sites by site number and shadow number, cards in deck by card type, culture
|
||||
and name.
|
||||
- Trading for foil now also requires a payment of 4G.
|
||||
|
||||
<b>14 Mar. 2012</b>
|
||||
- "White Hand Destroyer" no longer has "Hunter 0" when you control no sites.
|
||||
|
||||
@@ -68,20 +68,20 @@ var GempLotrMerchantUI = Class.extend({
|
||||
|
||||
this.infoDialog = $("<div></div>")
|
||||
.dialog({
|
||||
autoOpen: false,
|
||||
closeOnEscape: true,
|
||||
resizable: false,
|
||||
title: "Card information"
|
||||
});
|
||||
autoOpen: false,
|
||||
closeOnEscape: true,
|
||||
resizable: false,
|
||||
title: "Card information"
|
||||
});
|
||||
|
||||
this.questionDialog = $("<div></div>")
|
||||
.dialog({
|
||||
autoOpen: false,
|
||||
closeOnEscape: true,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
title: "Merchant operation"
|
||||
});
|
||||
autoOpen: false,
|
||||
closeOnEscape: true,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
title: "Merchant operation"
|
||||
});
|
||||
|
||||
var swipeOptions = {
|
||||
threshold: 20,
|
||||
@@ -275,7 +275,7 @@ var GempLotrMerchantUI = Class.extend({
|
||||
var tradeFoilBut = $("<div class='tradeFoil'>Trade 4 for foil</div>").button();
|
||||
tradeFoilBut.click(
|
||||
function() {
|
||||
that.displayMerchantAction(card, "Do you want to trade 4 of this card for a foil version?",
|
||||
that.displayMerchantAction(card, "Do you want to trade 4 of this card and 4G in currency for a foil version of the card?",
|
||||
function() {
|
||||
that.comm.tradeInFoil(blueprintId, function() {
|
||||
that.cardFilter.getCollection();
|
||||
|
||||
Reference in New Issue
Block a user