Commit graph

1124 commits

Author SHA1 Message Date
Oleg Agafonov
3abdb72910
dev: improved code coverage (jacoco) and static analyser (sonar) support (#11367):
* fixed code coverage data lost on failed tests;
* fixed code coverage report duplication and improved performance;
* fixed that sonar analyser can't see code coverage for some modules;
* added new aggregation module: Mage.Reports (used for code coverage report generation);
* reorganized pom and added additional instructions for jacoco and sonar usage;
2023-10-30 09:19:12 +04:00
Oleg Agafonov
36ccfb0a2a Performance: fixed memory leaks on each card viewer or draft open (10 Mb per call, related to #11285, fixes #9548) 2023-10-14 12:39:49 +04:00
Oleg Agafonov
fe8b8e1def server: fixed npe error on load tests (miss buffer timer), code refactor 2023-10-11 14:15:15 +04:00
Susucre
b8ba2da23e
fix infoText of tournament causing NPE (#11290) 2023-10-09 15:25:30 -04:00
Susucre
f14479c53c
Add custom options for starting life total and starting hand size (#11259)
* add startHandSize / startLife to the custom option panel

* use the custom startLife/startHandsize in all Game Modes
2023-10-06 23:22:48 -04:00
Artemis Kearney
41874b0b4b
new feature: Emblem Cards (#10498)
* new feature: Emblem Cards

Allows match/tournament creator to specify cards to give each player
emblem versions of (or just the starting player for symmetric effects).

Technical details:
- new UI for specifying emblem cards (.dck files)
  - available for all match/tournament types
- new class `EmblemOfCard`
- new method `copyWithZone` on `AbilityImpl` (used to make abilities
  work from command zone)
- new fields on `GameOptions` and `MatchOptions` for emblem cards
- emblems are granted after mulligans, before first turn (technically
  after Planechase starting plane creation)

* fixes

* defaults for emblem cards in match options (fixes quick game buttons)

* minor fixes

* use DeckCardInfo instead of Card for emblem cards options

* restore accessible parent properties

* fix images for card emblems

* look up cards in a way that preserves which art

* fix typos; make Emblem.sourceObject protected

* add descriptions to planechase and emblem cards

* fixes

* add some unit tests for known working cards

* fix author name

* add explanation comment

* fix up tests

* copyWithZone: no longer modifies zone for singleton abilities

* directly check for MageSingleton
2023-09-26 22:47:13 -04:00
Oleg Agafonov
a3e5754d10 GUI: improved preferences dialog and battlefield:
* removed outdated storm counter button and settings (related cards must have same card hint);
* clean preferences dialog from empty events/actions;
* fixed logs folder names to release names in the labels;
2023-09-23 21:13:59 +04:00
Oleg Agafonov
abda1fb53b GUI: fixed wrong feedback panel status in computer games (related to #11189) 2023-09-22 11:00:47 +04:00
Oleg Agafonov
342979a55a
network: reworked client-server events (related to triggers dialog problem from #11173) (#11189)
* added bad connection mode to test client works on slow network, use -Dxmage.badconnection;
* added bad connection protection in events processing due event type;
* split events to different types (can be ignored, must be synced, etc);
* removed some unused server events.
2023-09-21 18:40:52 +04:00
Oleg Agafonov
9b634d44c6 server: fixed broken work on network's non-compress mode (-Dxmage.network.nocompress) 2023-09-18 12:05:55 +04:00
bobwoco
a7b06483ab
dev: added back concurrent and add dep comments, related to #11028 (#11059)
Co-authored-by: Ethan Ward <ethanandrewward@gmail.com>
2023-08-29 04:06:43 +04:00
ssk97
c50e913398
Add Smoothed London Mulligan option (#10965)
* Add Smoothed London Mulligan (similar to but weaker than MTGA's)

* Make SmoothedLondonMulligan extend LondonMulligan instead of copying code

* modified to be have no effect within +1/-1 of the expected lands
fixed tests by always putting nonchosen hand on the bottom

* Inherit the primary mulligan logic as well, add comments

* Make drawHand public and part of Mulligan, use it on opening 7
use Card::isLand instead of reimplementing it, remove unused imports
Use standard spacing

* Better account for half-land MDFCs

* Don't count TDFCs as half-lands

* Remove "crossover_point" calculation to make algorithm clearer

* Genericize the tests, undo changed access that's no longer needed, unbox bool

* Use standard case in function naming

* Add Override

* Add mulligan type to TableView info, add tourneyMatchOptions local variable
2023-08-27 15:08:27 -04:00
Ethan Ward
8f7b19a64d Remove old unused dependency 2023-08-26 19:35:05 -04:00
Susucre
5062c84098
Refactor: removed server side objects from a client side game's data (#10788)
* Clean original values transmitted with CardView.originalObject
* Move RateCard to mage.Common, support cardView as argument.
* Clean PermanentView constructor for TestCardRenderDialog
2023-08-24 12:04:07 +04:00
Susucre
8457ce31c5
fix the CardViewer not displaying tokens (#10789) 2023-08-13 14:10:48 -04:00
PurpleCrowbar
d9a23d505a
Add image number support for command objects (#10774) 2023-08-10 00:47:32 +01:00
Artemis Kearney
9ba0da00ff
Basic groundwork for extra decks (contraptions, attractions) (#10378)
* extra deck cards not counted in deck size

* extra deck handling in deckbuilder

* move responsibility for extraDeckCard boolean to CardImpl

* remove redundant field copy
2023-08-06 21:06:32 -04:00
Susucre
f75b1c9f0a
Code cleanup: protect all copy constructors (#10750)
* apply regex to change public copy constructors to protected
* cleanup code using now protected constructors
* fix manaBuilder weird casting of Mana into ConditionalMana
2023-08-04 19:34:58 -04:00
Alexander Novotny
519b3988be
game timer: Add chess-style buffer time option (#10598)
* UI Changes

* Add new buffer time options

* Main functionality

* Final implementation

Also added player UI for when they are using their buffer time (timer turns green)
2023-07-28 22:05:21 -04:00
Alexander Novotny
a36a7d9b7f
[LTR] Add Goldberry, River-Daughter (#10524)
* Added Goldberry

* Slight optimizaztion

* Happy Path Test

* More unhappy tests

* Sanity check for Goldberry's counter choices

* Updated player.getMultiAmount to support individual constraints

* Some cleanup

Also modified ResourcefulDefense to use new multi amount api

* Updated logging

* Added hint for number of counters

* Fixed issue with Resourceful Defense

* Improvements to defaults

Default list will properly make sure to stay within individual maximums
If a player is asked for a choice that isn't actually a choice because each choice's min and max are equal, instead the default response is immediately returned. This helps with situations like moving a counter off of Goldberry when she only has one counter on her.

* -1/-1 Counter test

* Fixed issue with -1/-1 counters

* Adjusted dialog to properly enforce constraints
2023-07-28 21:29:40 -04:00
Susucre
14235b6320
Rework Ring-bearer implementation. Add GUI + gamelogs. (#10596)
* Fix Ring-bearer choosing & add some GUI + logs

* use a ring svg in a separate gold panel

* use a fontawesome svg

* add a couple null checks, group icon with commander

* rework rinbearer logic according to review

* fix typo in game log

* small fixes
2023-07-12 19:40:09 -04:00
Alexander Novotny
fae63d9d4b
Add additional ability icons (#10549)
* Slightly revamped basic card icons

All icon classes which were just static text have been removed, and instead replaced with a static instance.

A new icon for reach has been added

Some icons have been reused for new abilities (hexproof for shroud and ward, infect for toxic)

When a card would have two icons of the same type, the icons are instead combines into one with a combined hover tooltip.

* Fixed missing capitalization on ward, hexproof
2023-07-04 01:22:07 +04:00
Oleg Agafonov
23d9fc50ba actual beta version instead release 2023-06-17 18:20:09 +04:00
Oleg Agafonov
94dfbdfed4 gui: fixed miss playable mark for emblems and other objects from command zone (example: momir emblem) 2023-06-17 17:32:02 +04:00
Alexander Novotny
76f30b3046
Added attachment controller info (#10440)
Fixes magefree/mage#9971
2023-06-09 05:34:26 +04:00
Evan Kranzler
60e488cf05
rename classes (#10383) 2023-05-17 18:49:30 -04:00
Evan Kranzler
024c3081df
[BRC] Implement Rootpath Purifier (ready for review) (#10363)
* refactor check supertype methods

* change supertype to list to match card type

* refactor various subtype methods

* implement mageobjectattribute for supertype

* a few fixes

* [BRC] Implement Rootpath Purifier

* a few extra fixes

* more fixes

* add test for purifier
2023-05-13 10:48:07 -04:00
xenohedron
4cc9329b15
New feature: "Chaos Remixed" booster draft (#10328)
* Fix error in draft pick logger that was failing on chaos drafts with fewer than 3 sets

* Implement Remixed Booster Draft

* Add debug test

* minor cleanup

* Cleanup unnecessary checks

* Fix elimination tournament type

* Add note for future improvement
2023-05-12 18:12:23 +04:00
Oleg Agafonov
bc79b5f5d1 dev: enabled debug main menu by default in developer builds (example: test render dialog) 2023-05-09 00:49:46 +04:00
Oleg Agafonov
5f55c7c667 Tokens and command objects reworked (part 1 of 2):
- fixed that copy effect doesn't restore original image after effect's end;
 - removed outdated availableImageSetCodes (all images auto-selected from tokens database now, related to #10139);
 - refactor command objects to use CommandObjectImpl;
 - refactor planes/emblems/etc objects to use MageObjectImpl, added copyable support;
 - refactor another game objects to remove some duplicated fields;
2023-05-08 02:15:07 +04:00
Oleg Agafonov
583c5fe4e9 GUI: improved double faced tokens:
- added tokens support in test render dialog;
 - improved PT drawing;
 - fixed broken second side switch button (related to #10231);
 - fixed miss override in TokenImpl (all override with backFace must be removed, see todo);
2023-04-29 19:13:13 +04:00
Evan Kranzler
947351932b
Ready for Review: Implementing Battles (#10156)
* add types and subtypes

* add startingDefense attribute

* [MOM] Implement Invasion of Ravnica / Guildpact Paragon

* fix two small errors

* refactor various instances of "any target"

* fully implement defense counters

* battles can now be attacked

* [MOM] Implement Invasion of Dominaria / Serra Faithkeeper

* [MOM] Implement Invasion of Innistrad / Deluge of the Dead

* [MOM] Implement Invasion of Kaladesh / Aetherwing, Golden-Scale Flagship

* [MOM] Implement Invasion of Kamigawa / Rooftop Saboteurs

* [MOM] Implement Invasion of Karsus / Refraction Elemental

* [MOM] Implement Invasion of Tolvada / The Broken Sky

* simplify battle info ability

* fix verify failure

* some more fixes for attacking battles

* [MOM] Implement Invasion of Kaldheim / Pyre of the World Tree

* [MOM] Implement Invasion of Lorwyn / Winnowing Forces

* [MOM] Implement Invasion of Moag / Bloomwielder Dryads

* [MOM] Implement Invasion of Shandalar / Leyline Surge

* [MOM] Implement Invasion of Belenon / Belenon War Anthem

* [MOM] Implement Invasion of Pyrulea / Gargantuan Slabhorn

* [MOM] Implement Invasion of Vryn / Overloaded Mage-Ring

* [MOM] Implement Marshal of Zhalfir

* [MOM] Implement Sunfall

* implement protectors for sieges

* partially implement siege defeated trigger

* fix verify failure

* some updates to blocking

* [MOM] Implement Invasion of Mercadia / Kyren Flamewright

* [MOM] Implement Invasion of Theros / Ephara, Ever-Sheltering

* [MOM] Implement Invasion of Ulgrotha / Grandmother Ravi Sengir

* [MOM] Implement Invasion of Xerex / Vertex Paladin

* add initial battle test

* fix verify failure

* [MOM] Implement Invasion of Amonkhet / Lazotep Convert

* [MOM] update spoiler

* update how protectors are chosen

* update text

* battles can't block

* add control change test

* rename battle test for duel

* add multiplayer test

* [MOM] Implement Invasion of Alara / Awaken the Maelstrom

* [MOM] Implement Invasion of Eldraine

* [MOM] Implement Invasion of Ergamon / Truga Cliffhanger

* [MOM] Implement Invasion of Ixalan / Belligerent Regisaur

* battles now cast transformed (this is super hacky but we need to refactor TDFCs anyway)

* add TODO

* add ignore for randomly failing test

* a few small fixes

* add defense to MtgJsonCard (unused like loyalty)

* implement ProtectorIdPredicate

* small fixes
2023-04-13 20:03:16 -04:00
Oleg Agafonov
1f68e4f9ba GUI: fixed that Card Viewer can't open tokens list; 2023-04-13 14:35:43 +04:00
Oleg Agafonov
914cfc1d3a Refactor: fixed getRules usage, clean SplitCard code 2023-04-08 19:27:47 +04:00
Oleg Agafonov
a9f1e15168 Tests: improved load test (added connection errors processing, fixed too long generated usernames, related to #10154); 2023-04-05 18:43:44 +04:00
Oleg Agafonov
4bf3e43da6 * GUI: face down cards improved:
* now it show face up cards in game logs on game end;
 * now it show face up cards in battlefield on game end (#4635);
 * fixed that real card face was visible in network data;
2023-04-01 18:40:06 +04:00
Oleg Agafonov
a15a0daa04 Fixed potential NPE errors in getPhase usage (fixed Berserker's Frenzy, etc) 2023-03-25 16:01:27 +04:00
Oleg Agafonov
66d0ef4b35 Refactor cards and token images code (#10139):
- removed outdated token store format (example: BIRD.W.BIRD.CREATURE.1.1.full.jpg)
 - removed duplicated cache images code;
 - removed duplicated set code fields;
 - removed outdated auto-generated thumb files (also all *.thumb.zip files will be deleted on startup);
2023-03-24 06:44:11 +04:00
Oleg Agafonov
743143acde * GUI: meld cards improves:
* added images download for melds cards (#9660);
 * added switch card side button to view a meld part;
 * fixed NPE and other errors on card side switching;
 * added meld cards support in test render dialog;
2023-03-09 21:36:39 +04:00
sprangg
b9530e307d
Draft stability improvements (#9435) 2022-09-25 17:33:16 -04:00
Alex W. Jackson
07902f64b7 Fix #9555 2022-09-23 16:55:12 -04:00
Alex Vasile
8b71e0a444 [DEV] JDK 11+ support. All builds still target Java 1.8. 2022-08-05 00:17:00 -04:00
DeepCrimson
9084180937
Fix 'chosen' spelling (#9021) 2022-05-27 21:45:07 -06:00
Evan Kranzler
86dad5e54f [CLB] Implemented White Plume Adventurer 2022-05-17 20:18:18 -04:00
Oleg Agafonov
53def4155b
Merge pull request #8627 from weirddan455/jboss
Change from jboss to java serialization (fixes #8609)
2022-04-18 16:42:01 +04:00
Evan Kranzler
26ae7b7281 replaced various instances of instanceof lambda functions with 2022-04-03 11:11:07 -04:00
Evan Kranzler
09636d7332 fixed starting loyalty display in mock card 2022-03-09 20:32:48 -05:00
Jeff Wadsworth
4af54ef196 - Fixed #8721 2022-03-03 15:33:48 -06:00
Daniel Bomar
7428258882
Fix test failure 2022-01-31 20:48:23 -06:00
Daniel Bomar
df9cc31d41
Change from jboss to java serialization (fixes #8609) 2022-01-31 20:16:06 -06:00