Added bank information to bank placement.
Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
parent
8d9926a413
commit
09690ee4e0
@ -2153,7 +2153,9 @@ router.put("/:id/:action/:value?", async (req, res) => {
|
||||
console.log(`Bank ${bank}`)
|
||||
return;
|
||||
}
|
||||
bankType = (type === 'bank') ? '3:1' : type;
|
||||
bankType = (type === 'bank')
|
||||
? '3 of anything for 1 resource'
|
||||
: `2 ${type} for 1 resource`;
|
||||
if (player.banks.indexOf(type) === -1) {
|
||||
player.banks.push(type);
|
||||
}
|
||||
@ -2162,7 +2164,8 @@ router.put("/:id/:action/:value?", async (req, res) => {
|
||||
game.turn.actions = [];
|
||||
game.turn.limits = {};
|
||||
if (bankType) {
|
||||
addChatMessage(game, session, `${name} placed a settlement by a maritime bank for ${bankType}.`);
|
||||
addChatMessage(game, session,
|
||||
`${name} placed a settlement by a maritime bank that trades ${bankType}.`);
|
||||
} else {
|
||||
addChatMessage(game, session, `${name} placed a settlement.`);
|
||||
}
|
||||
@ -2173,6 +2176,7 @@ router.put("/:id/:action/:value?", async (req, res) => {
|
||||
}
|
||||
corner.color = session.color;
|
||||
corner.type = 'settlement';
|
||||
let bankType = undefined;
|
||||
if (layout.corners[index].banks.length) {
|
||||
layout.corners[index].banks.forEach(bank => {
|
||||
console.log(game.borderOrder);
|
||||
@ -2183,15 +2187,24 @@ router.put("/:id/:action/:value?", async (req, res) => {
|
||||
if (!type) {
|
||||
return;
|
||||
}
|
||||
bankType = (type === 'bank')
|
||||
? '3 of anything for 1 resource'
|
||||
: `2 ${type} for 1 resource`;
|
||||
if (player.banks.indexOf(type) === -1) {
|
||||
player.banks.push(type);
|
||||
}
|
||||
});
|
||||
}
|
||||
player.settlements--;
|
||||
player.maritime = player.banks.map(bank => game.borders[Math.floor(bank / 3) + bank % 3]);
|
||||
if (bankType) {
|
||||
addChatMessage(game, session,
|
||||
`${name} placed a settlement by a maritime bank that trades ${bankType}. ` +
|
||||
`Next, they need to place a road.`);
|
||||
} else {
|
||||
addChatMessage(game, session, `${name} placed a settlement.` +
|
||||
`Next, they need to place a road.`);
|
||||
}
|
||||
placeRoad(game, layout.corners[index].roads);
|
||||
addChatMessage(game, session, `Placed a settlement. Next, they need to place a road.`);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2750,7 +2763,6 @@ const resetGame = (game) => {
|
||||
points: 0,
|
||||
development: [],
|
||||
banks: [],
|
||||
maritime: [],
|
||||
army: 0,
|
||||
playedCard: 0,
|
||||
haveResources: false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user