Commit graph

319 commits

Author SHA1 Message Date
ctrlaltca
2703db75d0 Update card menu when its counters change (#3565) 2019-02-08 01:50:34 -05:00
Rob Blanckaert
d932581f4a Move to bottom of library in random order. (#3549)
* - Allow shuffling a subset of a zone
- When moving cards to the bottom of library, shuffle them after
- Process events in the correct order serverside

* Zach fixes

Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>

* Comments + additional guard
2019-02-07 14:08:44 -05:00
Rob Blanckaert
a719e3b306 Log number of cards revealed to other players. (#3555) 2019-02-05 02:33:11 -05:00
Fabio Bas
ec081b8b03 Fix active player game area highlightning 2019-02-03 19:15:30 +01:00
Rob Blanckaert
5e38214675 Playing a tableRow 3 card from the stack puts it to grave. (#3547)
* Playing a tableRow 3 card from the stack puts it to grave.

* move to top by resetting pos

* Zach touch

Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
2019-02-03 11:33:38 +01:00
ebbit1q
ba985f97e5 removes the pt of face down cards (#3542)
* removes the pt of face down cards

Instead of setting the pt of a hidden card to the value only known to
you, it's reset to nothing.
Resetting a card while it's already reset does nothing.
Removing the pt of a card is logged as "player removes the pt of card."
instead of "player sets the pt of card to ." (note the missing value).

* reset unknown cards to nothing instead

* replace cardname with card id for unknown cards

fixes #3543

* prefix #
2019-02-02 20:33:29 -05:00
Rob Blanckaert
7cd9b9c0c8 Unconcede (#3515) 2019-01-27 12:50:41 -05:00
ebbit1q
495e232c22 add the amount of cards logged to the reveal cards event (#3516)
* add the amount of cards logged to the reveal cards event

sets cardname to the amount for the call if not 1 for the fromstr only
add braces for single line statements

* zach cleanup
2019-01-24 08:53:05 +01:00
ctrlaltca
ed70099e36 Rework of the card database, xml format and oracle parser (#3511)
* CardDB: merge all card properties in a new structure

* Pre Json parser changes

 * Cockatrice: use qt's builtin json support
 * Move qt-json src dir from cockatrice to oracle
 * Add dummy cockatricexml4 parser (yet to be implemented)

* Implement a new parser and xml format

 * cockatricexml4: new xml parser following the "generic properties hash" pattern;
 * oracleimporter: refactor the parsing code to better adapt to cockatricexml4; rewrote split cards parsing
 * carddb: change "colors" from a stringlist to a string
 * carddb: move the getMainCardType() method to the cockatricexml3 parser
 *

* CardInfo: show all properties (stil missing: nice name + translation)

* Rework the "add related card" feature so that it doesn't change the card name in the carddb

Also, fix token count display

* Picture loader: Added support for transform cards

* Fix side information for flip cards

Mtgjson uses side a/b for flip cards, while scryfall doesn't

* Pictureloader: dynamic tag resolution from card properties

Examples old => new
* !cardid! => !set:muid!
* !uuid!   => !set:uuid!
* !collectornumber! => !set:num!
New examples:
 * !prop:type!
 * !prop:manacost!

* Start moving mtg-related property names to a specific file

* Clangify

* Fix tests

* Make gcc an happy puppy

* Revert "Make gcc an happy puppy"

This reverts commit 446ec5f27516c4d3b32dbfc79557f4827c5c5bdf.

* Some gcc fixes

* Share set list between different db parsers, so they won't overwrite one each other

* All glory to the hypnoclangifier!

* Fix test compilation

* Cleanup edited files in the prior PR. (#3519)

* Cleanup edited files in the prior PR.

Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>

* Fix includes

Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>

* Update carddatabase.h
2019-01-23 18:17:10 -05:00
ebbit1q
1c6b43c545 fix typo in shortcut name (#3509)
In #3439 the shortcuts got some overhaul but this shortcut wasn't
correctly renamed.
This fix will clear users' original shortcut for increasing toughness.
An improvement over the current state of it not working at all and being
unable to set to the default shortcut.
Fixes #3506
2019-01-19 05:15:22 -05:00
ebbit1q
06081bd940 add keybinds to mill cards (#3439)
* add keybinds to mill cards

Add functions to move single card from top of deck to the graveyard and
exile.
Add keybinds to move single or multiple cards from top of deck to exile
or graveyard.
Add new keybinds to settings menu.
Move settings menu items around for a better fit.
Rename a few of the items in the settings menu.
Add default keybinds: ctrl alt d/e for single/multiple cards from top of
deck to the graveyard. No defaults are set for moving to exile.

* fix shortcut menu

* fix missing tag

* rename mismatched functions

* fixed your typos

* refactor shortcutsettings

correct a lot of typos
optimize a lot of functions
this could merit a pr on its own

* set mill keybinds

* refactor add related card actions

I found a function that was completely unintelligible so I made it
remotely legible and removed the duplication.

* shorten line by 17 characters

replace a lot of function calls with just a single reference

* add brackets

add brackets to all single line if statements etc.
readability improvements
2018-11-23 22:21:20 -05:00
ebbit1q
843b9df939 fix a bug from #3412 (#3454)
check if the card returned any info at all
2018-11-23 22:19:06 -05:00
Zach H
af2bce7141
add token creations from graveyard/exile (#3445) 2018-11-21 03:53:35 -05:00
ebbit1q
75203cf385 add reset power and toughness option #3402 (#3412)
* add reset power and toughness function on cards

Add actResetPT to set the power and toughness in the same way as
actSetPT but instead of prompting the user it will fetch the original
pt from the card info for each card.
Add the new command to the card rmb list, keybinds and settings.

* changed style to .clang-format

Please change the contributing guidelines to use this style instead.
2018-10-20 23:33:35 -04:00
Lee Tran
70005a6f1d Enable the creation and using of shortcuts to move cards from the top of the library to play face down. (#3388) 2018-09-07 09:14:34 +02:00
tooomm
a056a882c3 flip rename (client side) (#3149) 2018-04-05 22:42:54 -04:00
David Szabo
281e52eaa9 power and toughness values displayed after card flip (#3120) 2018-03-01 12:28:30 -05:00
David Szabo
7cfbf114b7 "Show related card" option added to ingame context menu (#3115) 2018-02-19 01:12:25 -05:00
ctrlaltca
517420cccb Replace CardInfo* and Carset* with smart pointers (#3053)
* Replace CardInfo* and Carset* with smart pointers

* fixes to help memory & c++11 stuff
2018-02-02 12:52:47 -05:00
ctrlaltca
b29bd9e070
Clang-format (#3028)
* 1/3 Add .clang-format file and travis compilation check

* 2/3 Run clang-format

* 3/3 Fix compilation problems due to include reordering

* 3bis/3 AfterControlStatement: false
2018-01-27 10:41:32 +01:00
Zach H
261d3ac591
better null check (#3036) 2018-01-20 14:54:34 -05:00
Zach H
bc52882ac4
Fix Bad Gameplay (#3034) 2018-01-19 20:34:14 -05:00
Zach H
691bf36fbe
Disable sideboard button w/o deck (#3025) 2018-01-19 10:50:18 -05:00
tooomm
7efab80d9b token creation context menu improvements (#2999) 2018-01-10 13:32:29 -05:00
Zach H
297f1f2555
remove untap option, combine w/ tap (#2964) 2017-12-17 17:31:31 -05:00
John Hill
e694cbe854 add ability to clone from stack (#2824) 2017-08-06 23:56:17 -04:00
John Hill
3963570838 Mana counter shortcut (#2821) 2017-08-06 21:09:25 -04:00
John Hill
556d19ff70 Clone in exile and graveyard (#2813) 2017-07-31 00:34:24 -04:00
Zach H
e8dbdc3c6d Add token creation for opponent board items (#2744) 2017-06-28 23:09:10 -04:00
Psithief
ae15f5df06 Handling of tokens/related cards improved. (#2773) 2017-06-20 18:35:06 -04:00
backendr
62681f7f8d contect menu fix (#2719) 2017-05-18 17:03:21 -04:00
backendr
77e0cddbae counter context sensative (#2714) 2017-05-13 11:48:26 +02:00
Fabio Bas
36f6907fa3 Improved token loading 2017-05-04 23:28:51 -04:00
tooomm
cbd9d2c4fc better wording (#2674) 2017-04-29 22:15:43 -04:00
Zach H
12c9e4b81a allow placement below top X cards (#2666)
Close #2666
2017-04-27 20:32:24 -04:00
Zach H
7c1a18da5e Add "Random card from graveyard" (#2652) 2017-04-26 18:12:56 -04:00
Zach H
0da2bdd7aa additional null checks in player, gameselector, remoteclient, log (#2514) 2017-03-19 12:55:55 -04:00
Zach H
fb194db766 additional null checks & parsing (#2506)
* additional null checks & parsing
2017-03-18 18:48:23 -04:00
Zach H
bd850fa3ff create related token if you press the 'Token:' button (#2455)
* create related token if you press the 'Token:' button

* function set
2017-03-12 11:51:59 +01:00
Zach H
cf08d1d267 Revert "Condensed Card Counter Context Menu" (#2433) 2017-03-02 17:47:15 -05:00
Mark McDonald
b9cd942308 Add keybaord shortcut for creating related cards (#2426)
* Extract createCard from actCreateRelatedCard

* Merge related cards and reverse related cards before handling

* Add "Create all related cards" action to a card

* Stop displaying all related tokens if only one token is available

* Add shortcut for Creating all tokens related to selected card

* Extract method for adding related card actions

* Prefer foreach to index based iteration

* Guard against null cards, card menus, or cardInfos

* Remove QRegExp dependency from commonly depended header
2017-02-27 08:50:10 +01:00
poixen
2d216807c7 Condensed counter menu 2017-01-06 19:07:31 +01:00
Zach H
3d0600b516 Tokens in sub menu (#2320) 2016-12-17 13:05:29 -05:00
Fabio Bas
bb5292aa8d Drop Qt4, libgcrypt, qtmobility dependencies 2016-05-11 12:45:58 +02:00
Fabio Bas
1e3fb6c6e1 Rework "paths" settings loading and card database loading
* main.cpp: removed path checking and db loading
 * card database: merge card loading methods into a single one
 * settings cache: take care of returning safe paths for decks,
replays, etc..
 * main window: if db loading fails (eg. first run), propose to run
oracle

NSIS: propose to run cockatrice instead of oracle

Rework card database loading

 * Move carddatabase-related method out of deckeditor tab
 * Load cards in another thread and render them progressively
 * Optimize database reload after enabled sets change

Fix deck editor column width

 * removed the noCard hack.
 * getCard() no more creates cards instead of just returning existing
ones
 * Fix the “edit tokens” dialog.
 * PictureLoader: avoid trying to download twice the same card
 * PictureLoader: correct return of card background
 * AbstractCardItem: avoid recalculating card color at every paint

Use a different file to save custom tokens

Misc required improvements

 * Use nullptr;
 * Refactor CardInfoWidget to use CardInfoPicture and CardInfoText
instead of duplicating code;
 * Added CardInfo::getColorChar()
 * Fixed some potential crashes
 * removed dead code related to CardInfoWidget
 * Don't require a restart after adding a new custom sets file
 * Bump CMake requirements to 3.1
2016-03-15 22:27:55 +01:00
Zach H
e0a25e74ac fix merge issues 2015-12-30 11:54:30 -05:00
Zach H
f568a4e865 todo 2015-12-30 11:51:53 -05:00
Zach H
703ff7905c token coordinates 2015-12-29 23:43:03 -05:00
Zach H
da0e3292d3 Token PT shown in create related dialog 2015-12-29 18:28:41 -05:00
Fabio Bas
4b1c59424e Implement reverse-related tag for cards 2015-12-26 19:57:20 +01:00
Fabio Bas
deec7cdc14 Avoid crash on dereferencing null pointer 2015-12-11 19:32:08 +01:00
marco
baa61d0571 Merge branch 'master' into Refactor-settings
Conflicts:
	oracle/CMakeLists.txt
2015-09-01 21:28:53 +02:00
Fabio Bas
5cfb034452 merged with master 2015-08-31 22:48:14 +02:00
marco
c8d59eec5e Refactred settings to use settingscache & ini files 2015-08-22 01:05:15 +02:00
marco
c6aba5a6d0 Renamed file + reduced window size + resfresh on change 2015-08-20 20:23:08 +02:00
marco
d3d6f70496 Removed 2nd arg from ShortcutsSettings::getShortcut 2015-08-16 21:53:59 +02:00
marco
beaa4e9383 Configurable shortcuts 2015-08-16 13:46:57 +02:00
marco
b0bf94e378 Shorcut read from settings 2015-08-09 12:16:52 +02:00
mildmongrel
ba50025e80 tablezone refactor and cleanup 2015-07-24 16:15:08 -07:00
Fabio Bas
68e176cc00 Add an option to annotate tokens from card text (default off); fix #241 2015-07-07 19:19:58 +02:00
Fizztastic
19bd6cc381 Adds Move To... Hand context menu for cards 2015-07-06 19:10:13 -04:00
Fabio Bas
f84d6fec1b Never send wrong row numbers 2015-06-25 15:39:03 +02:00
Fabio Bas
ed24b38add support <tablerow> for tokens; fix #232 2015-06-24 10:31:00 +02:00
Fabio Bas
6b8ebe54e9 Theme manager
This is the first implementation of a theme manager. It’s a rebased and
revisited version of #792.
2015-06-15 14:35:58 +02:00
Fabio Bas
8826908923 Automatically attach related cards to the original card 2015-06-13 15:40:59 +02:00
Fabio Bas
946598375f Expose related cards in card menu 2015-06-11 12:45:25 +02:00
ctrlaltca
25f444a5af Merge pull request #1051 from poixen/reveal_top_x
Reveal top x cards
2015-05-16 18:20:56 +02:00
Fabio Bas
2299fa1ac4 Add backward compatibility for new client on old servers 2015-05-15 18:18:25 +02:00
Matt Lowe
80e53b334e Connected die roll dlg to parent
Die roll now has a logo as it is correctly connected to the parent.
2015-05-08 20:36:31 +02:00
Matt Lowe
5dfef6215c Added punctuation mark 2015-05-06 14:19:01 +02:00
Matt Lowe
45d214aa19 Added deck size limit
Updated to use the current deck size limit
2015-05-04 16:21:59 +02:00
Matt Lowe
59c0834427 Reveal top x cards
Updated reveal top card to reveal top x cards
Sometimes you want to reveal more than only the top 1 card.
2015-05-04 10:49:49 +02:00
Fabio Bas
e649535211 Add "play top card face down" menu entry to library; fix #762 2015-04-27 23:02:45 +02:00
Matt Lowe
6fd5c4dd27 Only use local db if no pt is provided
Addresses issue #1032

If a token is created with no p/t then the local db value will be passed
instead. If a value is provided then that will be used instead.
2015-04-27 10:17:46 +02:00
Zach H
9be29641b0 apply QKeySequence & remove unnecessary tr 2015-04-14 17:17:01 -04:00
Matt Lowe
1b165bde4c Updated context menus
+ added more separators
+ swapped some actions from lib menu (scry action now higher)
+ Added capital letters to words
2015-04-12 22:36:48 +02:00
Matt Lowe
9689b8e56a Fixed token PT issue for #931
The problem was that back when I added #336 I made it so that if YOU
didnt recive the PT of the token, then it would be fetched from your
tokens.xml, the issue is that we needed to send that value to the
server. The server sees it as a 0/0

This fix will send the PT from the tokens.xml if available.
2015-04-10 13:26:38 +02:00
poixen
2356788289 Merge pull request #929 from poixen/reveal_top_card_shortcut
Added shortcut to reveal top card or lib
2015-04-10 10:33:04 +02:00
Matt Lowe
56cbae17ac added separator
Felt like areas different to the current zone should be segregated.
2015-04-09 14:44:29 +02:00
Matt Lowe
fbbeb12413 Added shortcut to reveal top card or lib
+ Ctrl + N
2015-04-08 13:09:00 +02:00
Matt Lowe
a082fbcfef Left hand justification
Set to false by default, let me know if you think it should be true.

As all cards are played to the left of the screen this feels more
comfortable to use as you dont need to keep looking at different areas
of the screen.

Will auto rearrange when changed during game-play.
2015-04-02 12:49:06 +02:00
Zach
5f05c0be91 Merge pull request #775 from Cockatrice/fix-331
Cards played face down always go untapped to main row.
2015-03-06 23:57:05 -05:00
Fabio Bas
a7b8934a1b Fix remaining issues 2015-02-22 20:02:58 +01:00
Gavin Bises
e423fb2a39 Readability tweak 2015-02-21 21:31:17 -05:00
Gavin Bises
779a400de4 Fix #331 2015-02-21 15:18:32 -05:00
Jeffrey Oliver
4bd161ab06 Put back the new action. 2015-02-11 20:31:00 -08:00
Jeffrey Oliver
5add56d850 Fixed up whitespace. 2015-02-11 20:25:34 -08:00
Jeffrey Oliver
cc32e8c86e Add a play face down context menu item when in the hand zone. 2015-02-10 22:58:32 -08:00
Jaeic Lee
bfc1bd04b5 Added separators
Looks better imo.
2015-01-27 09:54:11 +09:00
Jaeic Lee
c6800c48d2 More ellipsis
Should be the last of them
2015-01-27 03:32:58 +09:00
Jaeic Lee
46fb5f820e Tweaked some texts
Per Daenyth’s request
2015-01-27 03:14:52 +09:00
Jaeic Lee
cc14e3cfc6 Submenus for moving all cards in a zone to another 2015-01-25 11:34:51 +09:00
Zach
dac5726dab Merge pull request #504 from ctrlaltca/local_scry_and_move
Specify the player when triggering a move on a revealed card
2015-01-23 10:14:05 -05:00
Fabio Bas
0abd1fb299 Rework patch for "move to.." menu; fix "P/T"-related menus 2015-01-02 17:10:19 +01:00
Michael Callahan
142b42e095 Reset Always reveal top card when starting a new game. 2015-01-01 09:53:29 -07:00
Fabio Bas
ea1067189d Specify the player when triggering a move on a revealed card
Fixes #72, #493
2014-12-27 17:12:21 +01:00
Gavin Bisesi
19de7cbc03 Merge pull request #428 from woogerboy21/static_reveal_library
Don't remove card images from revealed decks
2014-11-25 08:41:08 -05:00
Matt Lowe
a2c4a1e537 Action: Move Bottom Card to Graveyard
Created menu action to move card from the bottom of the library to the
graveyard. Qt accelerator key is "i". #125
2014-11-15 16:35:30 +01:00
woogerboy21
6811819161 Don't remove card images from revealed decks
Revealed library had write access, which meant that the user would see cards being removed from the zone as the other player drew cards. The cards were not the actual ones drawn, just the ones at the same index, so no information was leaked.

Fix #297
2014-11-13 20:31:55 -05:00
Matt Lowe
e3a94ecca3 Token PT is now set to DB values if not defined in event. 2014-10-01 19:20:42 +02:00