Skip to content

Commit

Permalink
Fixed primitives, improved "@discarded", "@counteradded" and "@counte…
Browse files Browse the repository at this point in the history
…rremoved" triggers in order to user "all(trigger)" target.
  • Loading branch information
Vitty85 committed Sep 22, 2021
1 parent 6be219f commit cd67711
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

## [master] (https://github.com/WagicProject/wagic/tree/master)

### 21/09/21
- *Committed:* Added/fixed primitives, replaced all occurrences of "AEther" with "Aether" in each ".txt" and ".dat" file according to the new naming convention (pull request #1072 by @remigiusz-suwalski). ([Vitty85](https://github.com/Vitty85))
### 22/09/21
- *Committed:* Fixed primitives, improved "@discarded", "@counteradded" and "@counterremoved" triggers in order to user "all(trigger)" target. ([Vitty85](https://github.com/Vitty85))

### 20/09/21
- *Committed:* Added/fixed primitives, replaced all occurrences of "AEther" with "Aether" in each ".txt" and ".dat" file according to the new naming convention (pull request #1072 by @remigiusz-suwalski). https://github.com/WagicProject/wagic/commit/6be219f5864226acabf58c76a874b74474f6fb04 ([Vitty85](https://github.com/Vitty85))

### 21/09/21
- *Committed:* Fixed primitives, fixed STA set, fixed a bug in new background images management. https://github.com/WagicProject/wagic/commit/e2ac10be9589ce69c67c7c1c1aec21f38e570278 ([Vitty85](https://github.com/Vitty85))

### 20/09/21
Expand Down
3 changes: 1 addition & 2 deletions projects/mtg/bin/Res/sets/primitives/borderline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6450,7 +6450,7 @@ toughness=2
[card]
name=Blightbeetle
abilities=protection from green
auto=@counteradded(1/1) from(creature|opponentbattlefield):name(Opponent creatures can't have 1/1 counter) target(creature[counter{1/1}]|opponentbattlefield) counter(1/1,-1)
auto=@counteradded(1/1) from(creature|opponentbattlefield):name(Opponent creatures can't have 1/1 counter) all(trigger[from]) name(Opponent creatures can't have 1/1 counter) counter(1/1,-1) notrg
text=Protection from green (This creature can't be blocked, targeted, dealt damage, enchanted, or equipped by anything green.) -- Creatures your opponents control can't have +1/+1 counters put on them.
mana={1}{B}
type=Creature
Expand Down Expand Up @@ -21463,7 +21463,6 @@ type=Sorcery
[/card]
[card]
name=Essence Symbiote
abilities=iscommander
auto=@mutated(creature|mybattlefield):all(trigger[to]) counter(1/1)
auto=@mutated(creature|mybattlefield):life:2 controller
text=Whenever a creature you control mutates, put a +1/+1 counter on that creature and you gain 2 life.
Expand Down
2 changes: 1 addition & 1 deletion projects/mtg/include/WEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct WEventCounters : public WEvent {
MTGCardInstance * source;
WEventCounters(Counters *counter,string name,int power, int toughness,bool added = false, bool removed = false, MTGCardInstance * source = NULL);
using WEvent::getTarget;
virtual Targetable * getTarget();
virtual Targetable * getTarget(int target);
};

struct WEventLife : public WEvent {
Expand Down
19 changes: 13 additions & 6 deletions projects/mtg/src/MTGAbility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6935,17 +6935,24 @@ int TriggeredAbility::receiveEvent(WEvent * e)
{
if(dynamic_cast<WEventTarget*>(e))
{
//@targetted trigger as per mtg rules is a state based trigger
//that resolves instantly before the event that targetted it.
//@targetted trigger as per mtg rules is a state based trigger
//that resolves instantly before the event that targetted it.
resolve();
return 1;
}
if(dynamic_cast<WEventCardSacrifice*>(e))
{
//sacrificed event
//thraximundar vs bloodfore collosus, thraximundar
//must be able to survive a sacrificed bloodfire collosus,
//same with mortician beetle vs phyrexian denouncer test
//sacrificed event
//thraximundar vs bloodfore collosus, thraximundar
//must be able to survive a sacrificed bloodfire collosus,
//same with mortician beetle vs phyrexian denouncer test
resolve();
return 1;
}
if(dynamic_cast<WEventCardDiscard*>(e))
{
//discard event must resolve instantly or by the time they do the cards that triggered them
//have already been put in graveyard.
resolve();
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion projects/mtg/src/WEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ Targetable * WEventLife::getTarget(int target)
return NULL;
}

Targetable * WEventCounters::getTarget()
Targetable * WEventCounters::getTarget(int target)
{
return targetCard;
}
Expand Down

0 comments on commit cd67711

Please sign in to comment.