Fixed broken trading with bank
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
parent
287d2a1551
commit
0b540cd5ec
@ -104,7 +104,11 @@ const Trade = ({table}) => {
|
||||
const canMeetOffer = (player, offer) => {
|
||||
for (let i = 0; i < offer.gets.length; i++) {
|
||||
const get = offer.gets[i];
|
||||
if (player[get.type] < get.count) {
|
||||
if (get.type === 'bank') {
|
||||
if (player[player.gives[0].type] < get.count) {
|
||||
return false;
|
||||
}
|
||||
} else if (player[get.type] < get.count) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -291,6 +295,7 @@ const Trade = ({table}) => {
|
||||
if (item.self) {
|
||||
/* Order direction is reversed for self */
|
||||
source = {
|
||||
name: item.name,
|
||||
gets: trade.gives,
|
||||
gives: trade.gets
|
||||
};
|
||||
|
@ -60,8 +60,8 @@ const ViewCard = ({table, card}) => {
|
||||
break;
|
||||
case 'progress-monopoly':
|
||||
description = <>
|
||||
When you play this card, you will select <b>1</b> type of resource.
|
||||
All other players must give you all their resource cards of that type.
|
||||
<p>When you play this card, you will select <b>1</b> type of resource.
|
||||
All other players must give you all their resource cards of that type.</p>
|
||||
</>;
|
||||
break;
|
||||
case 'progress-year-of-plenty':
|
||||
|
@ -1299,7 +1299,11 @@ const getValidRoads = (game, color) => {
|
||||
const canMeetOffer = (player, offer) => {
|
||||
for (let i = 0; i < offer.gets.length; i++) {
|
||||
const get = offer.gets[i];
|
||||
if (player[get.type] < get.count) {
|
||||
if (get.type === 'bank') {
|
||||
if (player[player.gives[0].type] < get.count) {
|
||||
return false;
|
||||
}
|
||||
} else if (player[get.type] < get.count) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user