- Trading for foil now also requires a payment of 4G.

This commit is contained in:
marcins78@gmail.com
2012-03-15 21:58:13 +00:00
parent 39edb9223a
commit 661edde823
4 changed files with 18 additions and 15 deletions

View File

@@ -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);

View File

@@ -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();
}

View File

@@ -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.

View File

@@ -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();