It is currently 11 May 2025, 12:50
   
Text Size

Fixing Cascade

Moderator: CCGHQ Admins

Fixing Cascade

Postby Shatterhouse » 16 May 2011, 02:43

The community set currently has a few attempts at Cascade cards (Bloodbraid Elf, Bituminous Blast). There are some flaws with them:

1.) The spells cascade upon resolution. They're supposed to cascade as soon as they're cast.
2.) The spells you cascade into stay in your hand with a free casting cost forever if you choose not to cast them right away. They should be put on the bottom of the library if they are not cast.
3.) If you cascade into a permanent, say Sprouting Thrinax, cast it, and then Unsummon it back to your hand, its casting cost goes to 0. It should revert to its regular cost of BRG.
4.) The community cascade function shuffles your library. It shouldn't do that.

So I got a working cascade mechanic that fixes all these, but there's a catch. I'll get to that later. Here's the 'fixed' code for Bloodbraid Elf:
Code: Select all
   <STATIC_ABILITY layer="0" tag="_COMMONTAG_HASTE">
      <EFFECT>
          Haste()
      </EFFECT>
    </STATIC_ABILITY>
   
   <TRIGGERED_ABILITY forced_skip="1" layer="0" zone="any">
     <TRIGGER value="ZONECHANGE">

     if( Object():GetErstwhileZone() == ZONE_STACK) then
        return SelfTriggered()
     else
       return false
     end
      </TRIGGER>
   <FILTER>
      return (OwnedByYou() and InHand() and Subject():Register_Get(7) == 1)
   </FILTER>
   <EFFECT>
      Subject():Register_Set(7,0)
      Subject():PutInLibrary( -1 )
   </EFFECT>
    </TRIGGERED_ABILITY>

  <TRIGGERED_ABILITY tag="BLOODBRAID_ELF_RULE_1" auto_skip="1" layer="0" zone="HAND">
      <TRIGGER value="SPELL_PLAYED">
        return SelfTriggered()
      </TRIGGER>
      <EFFECT>
   Cascade(4)
      </EFFECT>
  </TRIGGERED_ABILITY>
Bituminous Blast is trickier. Targeted spells lose their targets when they cascade, so you go and get another spell only to have your first spell not actually do anything. To fix this I used the 'charm' trick and added a triggered ability to choose the target for the spell. This seems to work (note, I think the order of these matters):

Code: Select all
    <SPELL_ABILITY tag="BITUMINOUS_BLAST_RULE_1" layer="7c" simple_filter="Target">
      <TARGET_DETERMINATION>
        return TargetCreatureBad()
      </TARGET_DETERMINATION>
      <PLAYTIME>   
      </PLAYTIME>

      <EFFECT>
         DealDamageToTarget(4)
      </EFFECT>
    </SPELL_ABILITY>

 
    <TRIGGERED_ABILITY forced_skip="1" layer="0" zone="any">
      <TRIGGER value="ZONECHANGE">
      if( Object():GetErstwhileZone() == ZONE_STACK) then
        return SelfTriggered()
      else
        return false
      end
      </TRIGGER>
   <FILTER>
      return (OwnedByYou() and InHand() and Subject():Register_Get(7) == 1)
   </FILTER>
   <EFFECT>
      Subject():Register_Set(7,0)
      Subject():PutInLibrary( -1 )
   </EFFECT>
    </TRIGGERED_ABILITY>

    <TRIGGERED_ABILITY layer="7c" zone="HAND" auto_skip="1" >
   <TRIGGER value="SPELL_PLAYED">
       return SelfTriggered()   
   </TRIGGER>   
   <PLAYTIME>
            TargetCreatureBad()
            ChooseTargetCreature()
   </PLAYTIME>
   <FILTER>
       return TargetCard()
   </FILTER>
   <EFFECT>
   </EFFECT>
      
    </TRIGGERED_ABILITY>

<TRIGGERED_ABILITY auto_skip="1" layer="0" zone="HAND">
      <TRIGGER value="SPELL_PLAYED">
        return SelfTriggered()
      </TRIGGER>
      <EFFECT>
   Cascade(5)
      </EFFECT>
</TRIGGERED_ABILITY>

Now here's the "problem". When we cascade into another card, we need to set its casting cost to 0. This has to be done by a STATIC_ABILITY, and it has to be done while the first spell is on the stack, which is a zone where STATIC_ABILITIES are not in effect. The best solution I've come up with so far is to add these two abilities to all lands, if not all cards:
Code: Select all
<STATIC_ABILITY layer="8" zone="ANYWHERE" influencing_zone="HAND">
   <FILTER>
      return (InHand() and Subject():Register_Get(7) == 1)
   </FILTER>
   <EFFECT>
      FreeCastingCost()
      Flash()
   </EFFECT>
</STATIC_ABILITY>
<TRIGGERED_ABILITY forced_skip="1" layer="0" zone="any">
      <TRIGGER value="SPELL_PLAYED">
        return (TriggerObject():Register_Get(7) ==1)
      </TRIGGER>
      <EFFECT>
   TriggerObject():Register_Set(7,0)
      </EFFECT>
</TRIGGERED_ABILITY>
The first sets casting costs to 0, and the second makes sure the casting cost will only be 0 the first time the free spell is cast.

Does anyone have any better ideas?
Last edited by Shatterhouse on 16 May 2011, 23:31, edited 2 times in total.
Shatterhouse
 
Posts: 72
Joined: 20 Apr 2011, 00:07
Has thanked: 0 time
Been thanked: 2 times

Re: Fixing Cascade

Postby Huggybaby » 16 May 2011, 16:22

Wow, excellent coding Shatterhouse!
User avatar
Huggybaby
Administrator
 
Posts: 3225
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 734 times
Been thanked: 601 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 3 guests


Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 3 guests

Login Form