It is currently 13 Sep 2025, 21:15
   
Text Size

TriggerAttacks and SingleTime Triggering

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

TriggerAttacks and SingleTime Triggering

Postby friarsol » 16 Sep 2011, 13:04

So we had a bug report about Lightmine Field not dealing appropriate damage. Looking into it, it's basically because the phrase "Whenever one or more creatures attack" isn't scripted correctly.

The Script should be a single trigger going on the stack when any amount of creatures attack, but it currently goes on once per attacking creature.

I'd expect to see something like this as the script, where AttackersDeclared only fires once.

Code: Select all
T:Mode$ AttackersDeclared | ValidCard$ Creature | Execute$ TrigDamage | TriggerZones$ Battlefield | TriggerDescription$ Whenever one or more creatures attack, CARDNAME deals damage to each of those creatures equal to the number of attacking creatures.
SVar:TrigDamage:AB$DealDamage | Cost$ 0 | Defined$ TriggeredAttackers | NumDmg$ X
SVar:X:Count$TriggeredAttackers
There's a few other cards that would need this script:
Orim's Prayer (already scripted incorrectly)
Reveille Squad (already scripted incorrectly, and can be very broken)
Raging River (although this won't be scripted anytime soon)
Total War (this one might be doable)

We probably could move the "Attacks Alone" triggers over to this Mode, since this would only fire once, and if a player attacks with 20 creatures, the code wouldn't need to count the attackers 20 times.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: TriggerAttacks and SingleTime Triggering

Postby Hellfish » 17 Sep 2011, 07:06

On it like gnomes on gold!

EDIT: Alright, initial checkin done and Lightmine Field converted. I'll see about converting all other "One or more" triggers.

EDIT2: Done!
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 34 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 34 users online :: 0 registered, 0 hidden and 34 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 34 guests

Login Form