Commit graph

326 commits

Author SHA1 Message Date
Susucre
2d625f0364 implement [MH3] Volatile Stormdrake ; provide source Ability to canBeTargetedBy and HexproofBaseAbility::checkObject 2024-06-06 17:36:11 +02:00
xenohedron
4025b312ad cleanup calls to respect range of influence 2024-06-02 21:28:14 -04:00
Susucre
60193e797d fix (mostly text) for [MH3] and [M3C] 2024-05-28 18:56:04 +02:00
Susucre
754b382e78
implement [MH3] Nethergoyf, refactor targets usages by game param (#12267) 2024-05-21 13:34:38 +02:00
xenohedron
88b6f4036f text fixes 2024-05-21 01:12:57 -04:00
xenohedron
abd0e4ca8f adjust comments 2024-05-21 01:04:14 -04:00
Susucre
2522f712e9
refactor: cleanup TargetCardInExile (#12218) 2024-05-03 22:15:13 -04:00
Susucre
85cad4ff1e
cleanup AbilityType for easier check that an ability is an activated ability (#12153)
* cleanup AbilityType

* further cleanup

* cleanup instanceof

* tweak formatting

* rework Rex

* fix mistake in PlayerImpl

* cleanup 'instanceof' for 'ActivatedManaAbilityImpl'
2024-05-03 22:13:34 -04:00
ssk97
32bf3eb9bf
Genericize Target Adjusters (#12107)
* Create generic X MV adjuster

* Update XTargetsAdjuster

* Create DynamicValueTargetsAdjuster to replace VerseCounterAdjuster

* Convert XTargetsAdjuster to use DynamicValueTargetsAdjuster

* Genericize MV target adjuster

* Converting custom classes for A and B cards, fix Back in Town to only target creature cards

* Add Power and Toughness target adjusters, C cards

* Set up and use Monstrosity X DynamicValue

* Move Scry amount dynamic value to common, add D and E cards

* Convert F to I cards

* Cards K-M

* N, O cards

* Cards O-R

* S cards (check Scrap Welder)

* Cards T - Z

* Rename target adjusters

* Add filter messages, don't add 0 count targets

* Clear blueprint targets (just in case), fix target names, Temporal Firestorm is not target

* Requested renames

* Aether Burst is "up to"

* Review fixes

* Add new cards, add source to dynamic value calculation
2024-05-03 01:12:52 -04:00
Susucre
860a767cca implement [PIP] Vault 112: Sadistic Simulation 2024-05-02 13:00:41 +02:00
Oleg Agafonov
34dac7877d fixed empty targets in EachOpponentPermanentTargetsAdjuster (related to #11886) 2024-04-11 22:46:26 +04:00
ssk97
124d60e2b7
refactor: improved EachOpponentPermanentTargetsAdjuster and few card fixes (#12102)
* Wreck and Rebuild: Return a land, not a creature
* Sinister Concierge should still gain suspend with 0 targets
* Fixed Tolarian Contempt
2024-04-10 06:59:21 +04:00
xenohedron
35a22527f1 another batch of text fixes 2024-04-04 23:21:44 -04:00
ssk97
f0740c6f09
implement [MKM] Agency Outfitter (#12034)
* Fix move cards log messages

* Sludge Titan: Only track milled cards in public zones
2024-04-02 00:43:35 -04:00
xenohedron
b1f83d1f9e fix #12006 (NthTargetPointer error on TargetAdjuster) 2024-03-29 00:51:30 -04:00
ssk97
d886b3e450
[WHO] Implement 4 cards, create generic EachOpponentPermanentTargetsAdjuster (#11886)
* Implement Bigger on the Inside
* implement Reverse the Polarity
* Implement Sontaran General
* Implement Everything Comes to Dust
2024-03-29 01:32:38 +04:00
xenohedron
56ba6b1072 fix some text 2024-03-14 23:13:56 -04:00
Oleg Agafonov
b746a601f2 docs: added additional comments for #11933 2024-03-12 11:13:43 +04:00
Oleg Agafonov
46d751f996 refactor: improved usage of target pointers 2024-02-18 15:38:53 +04:00
Oleg Agafonov
78612ddc91 multiple changes:
* refactor: improved target pointer init code and logic, added docs and runtime checks;
* game: fixed miss or wrong init calls in some continuous effects;
* game: fixed wrong usage of target pointers (miss copy code, miss npe checks);
2024-02-18 15:05:05 +04:00
Susucre
7df86e91a0 [CLU] Implement Sludge Titan
Introduced TargetCardAndOrCardInGraveyard, derived from the Library one.
Did not achieved everything I wanted in the tests, as the choice seems to be accepted.
Tested it live, no particular issue, you can't select more than one per category.
2024-01-23 19:51:13 +01:00
xenohedron
9b3ff32a33
Rework sacrifice effects to support "can't be sacrificed" (#11587)
* add TargetSacrifice and canBeSacrificed

* SacrificeTargetCost refactor, now uses TargetSacrifice, constructors simplified, subclasses aligned

* fix text errors introduced by refactor

* refactor SacrificeEffect, SacrificeAllEffect, SacrificeOpponentsEffect

* cleanup keyword abilities involving sacrifice

* fix a bunch of custom effect classes involving sacrifice

* fix test choices

* update Assault Suit implementation

* fix filter check arguments

* add documentation to refactored common classes

* [CLB] Implement Jon Irenicus, Shattered One

* implement "{this} can't be sacrificed"

* add tests for Assault Suit and Jon Irenicus

* refactor out PlayerToRightGainsControlOfSourceEffect

* implement [LTC] Hithlain Rope

* add choose hint to all TargetSacrifice

---------

Co-authored-by: Evan Kranzler <theelk801@gmail.com>
Co-authored-by: PurpleCrowbar <26198472+PurpleCrowbar@users.noreply.github.com>
2023-12-31 14:10:37 -05:00
xenohedron
264b73355a
refactor: improved targets that find a [type1] card and/or a [type2] card (#11497) 2023-12-01 19:26:30 +04:00
Oleg Agafonov
202f4b5112 Merge fix 2023-11-07 02:54:23 +04:00
Oleg Agafonov
ddc1ec8ef8 performance: improved CPU/memory usage with copy of cost's targets (related to #11285), added runtime check for wrong targets usage 2023-11-07 02:47:48 +04:00
Oleg Agafonov
70c79fd6a6 performance: improved CPU usage in games with big amount of permanents (related to #11285) 2023-11-07 01:14:07 +04:00
theelk801
86389b81d9 [LCI] Implement Tishana's Tidebinder 2023-11-05 13:34:08 -05:00
Evan Kranzler
bc4aa6931f
Ready for review: Implement Craft mechanic (#11352)
* [LCI] Implement Spring-Loaded Sawblades / Bladewheel Chariot

* [LCI] Implement Sunbird Standard / Sunbird Effigy

* card filter needs to have an owner predicate

* [LCI] Implement Throne of the Grim Captain / The Grim Captain

* make default constructor for craft with artifact

* dedupe some code

* refactor constructors for simplicity

* add currently failing test
2023-10-27 22:32:11 -04:00
PurpleCrowbar
7bc5105c1f
Implement Time Travel mechanic (#11299)
Implement [WHO] Wibbly-wobbly, Timey-wimey
2023-10-13 23:28:29 -04:00
xenohedron
e6e241cfcb fix notTarget handling in TargetPermanentAmount 2023-10-11 20:53:09 -04:00
xenohedron
d9ca387fad
another batch of text gen improvements (#11247)
* describe targets: UntapTargetEffect

* describe targets: SetBasePowerToughnessTargetEffect

* cleanup text

* describe targets: RegenerateTargetEffect

* describe targets: PhaseOutTargetEffect

* adjust text

* remove superfluous param

* describe targets: TapAllTargetPlayerControlsEffect

* describe targets: TurnFaceUpTargetEffect

* describe targets: TransformTargetEffect

* describe targets: RemoveFromCombatTargetEffect

* describe targets: DetainTargetEffect

* cleanup DiscardHandTargetEffect

* describe targets: DrawCardTargetEffect

* describe targets: GainLifeTargetEffect

* describe targets: LoseLifeTargetEffect

* describe targets: ExchangeLifeTargetEffect

* describe targets: DamageTargetControllerEffect
2023-10-01 22:51:02 -04:00
Oleg Agafonov
a4daad1f92 docs: added additional comments and todos for "choose new targets" code 2023-09-16 10:19:23 +04:00
Susucre
f4b0b83612
[UNF] Implement Comet, Stellar Pup (#10925) 2023-09-15 17:55:11 -04:00
Oleg Agafonov
4b3a19b4d5 refactor: improved target usage, replaced setNotTarget by withNotTarget 2023-09-07 05:35:54 +04:00
Oleg Agafonov
8a65b0f149 refactor: removed netbeans's auto-generated comments 2023-09-02 16:05:29 +04:00
Susucre
96a2c277b2
clean some of the most frequent copy constructor / copy method (#11053) 2023-08-30 19:48:03 -04:00
Alex Vasile
a2162ec3e7
Refactor: private fields and performance tweaks (#9625)
1a. Make `costs`, `manaCosts`, and `manaCostsToPay` private in `AbilityImpl` with access through getters/setters 
1b. fix cost adjuster for imprinted cards affected by the above

2a. Lazy instantiation for rarely used `data` field in `TargetPointerImpl`

3a. Pre-allocate certain array sizes in `Modes` and `CostsImpl`

4a. Make `manaTemplate` private in `BasicManaEffect`, copy when passing outside the class 
4b. Don't copy `manaTemplate` in copy constructor since it doesn't change 
4c. Add comments explaining copy usage for `manaTemplate` 
4d. Remove redundant variable assignment and make fields final 

---------

Co-authored-by: xenohedron <xenohedron@users.noreply.github.com>
2023-08-27 17:58:19 -04:00
Susucre
a9870b6ff8
text fixes [WOE] etc. (#11035)
* Fix Callous Sell Sword text

* simple text fixes

* fix some target texts
2023-08-26 19:34:49 -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
Susucre
23781ecb37
[LTC] Implement Elrond of the White Council (#10731) 2023-08-03 00:26:19 -04:00
Susucre
5a6ee98b41
[LTC] Implement The Black Gate (#10725) 2023-08-03 00:25:54 -04:00
Susucre
a53abeaf40
[CMM] Implement Descendants' Fury (#10700)
* [CMM] Implement Descendants' Fury

* various cleanup

* reset watcher on cleanup, in case of 'end the turn' during combat damage step
2023-07-30 19:25:43 -04:00
Susucre
bc403fd6fe
[LTC] Implement Mirkwood Trapper (#10665) 2023-07-27 00:23:58 -04:00
xenohedron
3886075dac
Update common effect class text generation (A-C) (#10651) 2023-07-21 22:55:47 -04:00
xenohedron
f944408252 fix text: BecomesColorTargetEffect 2023-07-19 20:26:20 -04:00
xenohedron
0fa971514a
code style: eliminate unnecessary static imports (#10585)
* SacrificeTargetCost(StaticFilters)

* remove import static mage.constants.Outcome

* remove import static mage.constants.Duration

* remove other import static

* a few more sacrifice filters

* simpler constructors

* remove import static mage.filter

* remove a few more import static
2023-07-08 13:08:28 -04:00
Alexander Novotny
fb8424556e
Player auto-choose respects required targets (#10557)
* Player auto-choose respects required targets
2023-07-04 07:02:46 +04:00
xenohedron
231ab77bcd
New common class CopyTargetStackAbilityEffect (#10525)
- Fix superfluous null check in Lithoform Engine
- Remove hardcoding of controlled abilities in TargetTriggeredAbility (used only in Strionic Resonator)
- EnchantmentSourcePredicate analogous to ArtifactSourcePredicate
2023-06-25 22:20:41 -04:00
Alexander Novotny
b0809c4a7a
Beamtown Bullies now properly targets opponent (#10439)
* Beamtown Bullies now properly targets opponent

Fixes magefree/mage#9975

* Fixed filter initialization
2023-06-07 14:27:59 -04:00
Evan Kranzler
a850e3660b
Change supertype method in constructors (#10361)
* replace addSuperType with supertype.add in card constructors

* more supertype replacements

* update MDFC supertype implementation

* remove unnecessary class

* update test
2023-05-12 20:45:07 -04:00