TriggerAttacks and SingleTime Triggering
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
2 posts
• Page 1 of 1
TriggerAttacks and SingleTime Triggering
by 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.
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.
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
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
by 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!
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
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
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 34 guests