mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 08:34:52 -07:00
Automatically attach related cards to the original card
This commit is contained in:
parent
9ca1329cac
commit
8826908923
3 changed files with 25 additions and 6 deletions
|
|
@ -1078,7 +1078,12 @@ void Player::actCreatePredefinedToken()
|
|||
|
||||
void Player::actCreateRelatedCard()
|
||||
{
|
||||
// get he target card name
|
||||
// get the clicked card
|
||||
CardItem * sourceCard = game->getActiveCard();
|
||||
if(!sourceCard)
|
||||
return;
|
||||
|
||||
// get the target card name
|
||||
QAction *action = static_cast<QAction *>(sender());
|
||||
CardInfo *cardInfo = db->getCard(action->text());
|
||||
|
||||
|
|
@ -1089,8 +1094,8 @@ void Player::actCreateRelatedCard()
|
|||
cmd.set_color(cardInfo->getColors().isEmpty() ? QString().toStdString() : cardInfo->getColors().first().toLower().toStdString());
|
||||
cmd.set_pt(cardInfo->getPowTough().toStdString());
|
||||
cmd.set_destroy_on_zone_change(true);
|
||||
cmd.set_x(-1);
|
||||
cmd.set_y(0);
|
||||
cmd.set_target_zone(sourceCard->getZone()->getName().toStdString());
|
||||
cmd.set_target_card_id(sourceCard->getId());
|
||||
|
||||
sendGameCommand(cmd);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue