Commit Graph
278 Commits
Author SHA1 Message Date
ctrlaltcaandebbit1q 2d8f01b2e9 Show current counter value on "set counter" dialog (#3650)
* fix point 10 of issue #655

* clanfigyism
2019-03-11 00:33:19 +01:00
ctrlaltcaandGitHub 6f95556632 Fix related cards menu in deck editor (#3649) 2019-03-10 23:15:24 +01:00
ctrlaltcaandGitHub 52cc725de4 Fix crash on card relation to inexistent card; fix #3637 (#3640)
* Fix crash on card relation to inexistent card; fix #3637

But that whole loop is a logic mess

* Check if related cards exists before creating the menu entry

* honor and glory to the hypnoclanfigier
2019-03-10 18:47:24 +01:00
Rob BlanckaertandZach H 55c4207182 Fix related cards popup (#3613) 2019-03-04 02:19:37 -05:00
ebbit1qandZach H abe4f5ca60 don't remove pt! 🔥🔥🔥🔥 (#3606)
* don't remove pt! 🔥🔥🔥🔥

* apply water to burns

* clangify

* fix clientside

* clangify

* missed qdebug

Signed-off-by: Zach Halpern <ZaHalpern+github@gmail.com>
2019-03-04 00:55:54 -05:00
ebbit1qandZach H 9411396b97 rework pt setting (#3584)
* rework pt setting

save pt as a string serverside
set the pt of cards that enter the battlefield to empty (was -1/0)
implement old behaviour as changePT clientside
display old pt to messagelog
add new keybind for new set behaviour (default ctrl+shift+p)
add flow pt actions and keybinds that increase while decreasing
put more braces everywhere
various refactors like adding consts and for loops
remove a single superfluous semicolon
does not change the way pt is displayed client side
does not fix 3455 fully

* fix drawing of pt

remove search for / in carditem's paint() (crash)
ptstring is now always orange unless it's a faceup card with a pt that
matches the cardinfo pt
set changept to remove the pt if the field is empty
set changept to keep the old value if one side is empty
return in changept for +0/+0
clean up some if statements

* return on change to +0/+0

* change log message for empty original pts

* typo

* remove changept

add parsept to unify reading pt strings
change setpt behavior to be an "upgraded" version of the old setpt
add arbitrary strings as anything that starts with /

* clangify

* remove debug lines

* add tip of the day

* add missing images

* clangify
2019-03-03 16:24:57 -05:00
Rob BlanckaertandZach H e68305d7bf - CardItems have dummy CardInfos if they arent in the database (#3589)
- If a CardInfo has no sets, add a dummy one to try to download it by non-set specific templates.
2019-02-23 19:52:38 -05:00
Rob BlanckaertandZach H ea8201af5c Judge mode (#3531)
* Judge mode

* Use seperate judge icon

* Fix clang init ordering complaint

* Create gavel.svg

* Add judge level

* Adjust judge permissions.

* - Tag events caused by judges
- Allow judges access to card right click menus.

* Allow judges to  change phase / turn.

* Remove gavel from pawn

* Make judge action text black.

* Create scales

* Rename scales to scales.svg

* Use scales

* remove gavel

* - Address PR feedback
- Fix sort order

* Zach

* add option to servatrice.ini
2019-02-21 14:00:00 -05:00
Rob Blanckaert c32f2190bd - Mill cards in correct order
- Roll up shuffles into bottom message
- Remove unused variable
2019-02-11 02:12:56 -08:00
ctrlaltcaandZach H 2703db75d0 Update card menu when its counters change (#3565) 2019-02-08 01:50:34 -05:00
Rob BlanckaertandZach H 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 BlanckaertandZach H 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 Blanckaertandctrlaltca 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
ebbit1qandZach H 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 BlanckaertandZach H 7cd9b9c0c8 Unconcede (#3515) 2019-01-27 12:50:41 -05:00
ebbit1qandctrlaltca 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
ctrlaltcaandZach H 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
ebbit1qandZach H 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
ebbit1qandZach H 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
ebbit1qandZach H 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 HandGitHub af2bce7141 add token creations from graveyard/exile (#3445) 2018-11-21 03:53:35 -05:00
ebbit1qandZach H 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 Tranandctrlaltca 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
tooommandZach H a056a882c3 flip rename (client side) (#3149) 2018-04-05 22:42:54 -04:00
David SzaboandZach H 281e52eaa9 power and toughness values displayed after card flip (#3120) 2018-03-01 12:28:30 -05:00
David SzaboandZach H 7cfbf114b7 "Show related card" option added to ingame context menu (#3115) 2018-02-19 01:12:25 -05:00
ctrlaltcaandZach H 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
ctrlaltcaandGitHub 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 HandGitHub 261d3ac591 better null check (#3036) 2018-01-20 14:54:34 -05:00
Zach HandGitHub bc52882ac4 Fix Bad Gameplay (#3034) 2018-01-19 20:34:14 -05:00
Zach HandGitHub 691bf36fbe Disable sideboard button w/o deck (#3025) 2018-01-19 10:50:18 -05:00
tooommandZach H 7efab80d9b token creation context menu improvements (#2999) 2018-01-10 13:32:29 -05:00
Zach HandGitHub 297f1f2555 remove untap option, combine w/ tap (#2964) 2017-12-17 17:31:31 -05:00
John HillandZach H e694cbe854 add ability to clone from stack (#2824) 2017-08-06 23:56:17 -04:00
John HillandZach H 3963570838 Mana counter shortcut (#2821) 2017-08-06 21:09:25 -04:00
John HillandZach H 556d19ff70 Clone in exile and graveyard (#2813) 2017-07-31 00:34:24 -04:00
Zach HandGitHub e8dbdc3c6d Add token creation for opponent board items (#2744) 2017-06-28 23:09:10 -04:00
PsithiefandZach H ae15f5df06 Handling of tokens/related cards improved. (#2773) 2017-06-20 18:35:06 -04:00
backendrandZach H 62681f7f8d contect menu fix (#2719) 2017-05-18 17:03:21 -04:00
backendrandctrlaltca 77e0cddbae counter context sensative (#2714) 2017-05-13 11:48:26 +02:00
Fabio BasandZach H 36f6907fa3 Improved token loading 2017-05-04 23:28:51 -04:00
tooommandZach H cbd9d2c4fc better wording (#2674) 2017-04-29 22:15:43 -04:00
Zach HandGavin Bisesi 12c9e4b81a allow placement below top X cards (#2666)
Close #2666
2017-04-27 20:32:24 -04:00
Zach HandGitHub 7c1a18da5e Add "Random card from graveyard" (#2652) 2017-04-26 18:12:56 -04:00
Zach HandGitHub 0da2bdd7aa additional null checks in player, gameselector, remoteclient, log (#2514) 2017-03-19 12:55:55 -04:00
Zach HandGitHub fb194db766 additional null checks & parsing (#2506)
* additional null checks & parsing
2017-03-18 18:48:23 -04:00
Zach Handctrlaltca 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 HandGitHub cf08d1d267 Revert "Condensed Card Counter Context Menu" (#2433) 2017-03-02 17:47:15 -05:00
Mark McDonaldandctrlaltca 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