carte sans effet
This commit is contained in:
parent
10fc731f5f
commit
6b19fac8b8
1 changed files with 10 additions and 1 deletions
11
server.js
11
server.js
|
|
@ -115,7 +115,8 @@ function buildDefaultDeck(){
|
||||||
['vole d une pièce','Désigne une pièce non roi qui change de camp'],
|
['vole d une pièce','Désigne une pièce non roi qui change de camp'],
|
||||||
['promotion','Un pion au choix est promu'],
|
['promotion','Un pion au choix est promu'],
|
||||||
['vole d une carte','Vole une carte aléatoirement au joueur adverse'],
|
['vole d une carte','Vole une carte aléatoirement au joueur adverse'],
|
||||||
['resurection','Ressucite la dernière pièce perdue'],
|
['resurection','Choisie une pièce capturée pour la ressuciter dans son camp'],
|
||||||
|
['carte sans effet',"N'a aucun effet"],
|
||||||
// ['carte sans effet',"N'a aucun effet"],
|
// ['carte sans effet',"N'a aucun effet"],
|
||||||
// ['défausse','Le joueur adverse défausse une carte de son choix'],
|
// ['défausse','Le joueur adverse défausse une carte de son choix'],
|
||||||
// ['immunité à la capture','Désigne une pièce qui ne pourra pas être capturée au prochain tour'],
|
// ['immunité à la capture','Désigne une pièce qui ne pourra pas être capturée au prochain tour'],
|
||||||
|
|
@ -1318,6 +1319,14 @@ io.on('connection', (socket) => {
|
||||||
}
|
}
|
||||||
}catch(e){ console.error('steal-card effect error', e); }
|
}catch(e){ console.error('steal-card effect error', e); }
|
||||||
}
|
}
|
||||||
|
// carte sans effet: consumed but does nothing
|
||||||
|
else if((typeof cardId === 'string' && (cardId.indexOf('carte_sans_effet') !== -1 || cardId.indexOf('sans_effet') !== -1 || cardId.indexOf('no_effect') !== -1))){
|
||||||
|
try{
|
||||||
|
// no game state change; just inform the owner that the card was consumed with no effect
|
||||||
|
played.payload = Object.assign({}, payload, { applied: 'no_effect' });
|
||||||
|
try{ const owner = (room.players || []).find(p => p.id === senderId); if(owner && owner.socketId) io.to(owner.socketId).emit('card:effect:applied', { roomId: room.id, effect: { id: played.id, type: 'no_effect', playerId: senderId, ts: Date.now() } }); }catch(_){ }
|
||||||
|
}catch(e){ console.error('no_effect card error', e); }
|
||||||
|
}
|
||||||
// resurrection: bring back one of your captured pieces and place it on an empty square
|
// resurrection: bring back one of your captured pieces and place it on an empty square
|
||||||
else if((typeof cardId === 'string' && cardId.indexOf('resur') !== -1) || (typeof cardId === 'string' && cardId.indexOf('ressur') !== -1)){
|
else if((typeof cardId === 'string' && cardId.indexOf('resur') !== -1) || (typeof cardId === 'string' && cardId.indexOf('ressur') !== -1)){
|
||||||
try{
|
try{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue