It is currently 24 Apr 2024, 18:43
   
Text Size

Living Death - Looks like I overdid with the effects

Moderator: CCGHQ Admins

Living Death - Looks like I overdid with the effects

Postby IceManOnline » 16 Dec 2010, 17:14

It's me again.

I try to code Living Death since a couple of days.
Today I thought, I would get it, but it seems, I have still several errors in it...
I'm not sure, if I have chosen the correct abilities for it, but maybe someone can help me with it.

Here's my code:
Code: Select all
<!--
///////////////////////////////////////////////////////////////////////////////////

 START OF CARD ABILITIES

///////////////////////////////////////////////////////////////////////////////////
-->

    <SPELL_ABILITY layer="0" tag="LIVING_DEATH_RULE_1">
      <FILTER>
         return InGraveyard() and Subject():GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0
      </FILTER>
      <PRE_EFFECT>
         for i=0,Subject():Count() -1 do
            Subject():Register_Object_Set( 5, Object() )
         end
      </PRE_EFFECT>
      <EFFECT>
         Subject():RemoveFromGame()
         Object():Register_Set( 1 , 1 )
      </EFFECT>   
   </SPELL_ABILITY>
   
   
   <TRIGGERED_ABILITY auto_skip="1" layer="0">
      <TRIGGER value="COMES_INTO_PLAY">
         return Object():Register_Get(1) == 1
      </TRIGGER>
      <FILTER>
         return CreaturesInPlay()
      </FILTER>
      <EFFECT>
         Subject():Sacrifice()
         Object():Register_Set( 1, 2)
      </EFFECT>   
   </TRIGGERED_ABILITY>
   
   <TRIGGERED_ABILITY auto_skip="1" layer="0">
      <TRIGGER value="SPELL_RESOLVED">
         return Object():Register_Get(1) == 2
      </TRIGGER>
      <FILTER>
         return Subject():Register_Object_Get(5) == Object() and Subject():GetZone() == ZONE_REMOVED_FROM_GAME
      </FILTER>
      <EFFECT>
         Subject():PutIntoPlay( Subject():GetPlayer() )
         Object():Register_Set( 1, 0)
      </EFFECT>   
   </TRIGGERED_ABILITY>
   
<!--
///////////////////////////////////////////////////////////////////////////////////

 END OF CARD ABILITIES

///////////////////////////////////////////////////////////////////////////////////
-->
Btw is there a commented version of the triggers and abilities etc?
I still don't know what for example the AntiHint stuff (and much more...) does.
IceManOnline
 
Posts: 80
Joined: 12 Dec 2010, 19:00
Has thanked: 0 time
Been thanked: 0 time

Re: Living Death - Looks like I overdid with the effects

Postby castled » 20 Dec 2010, 14:04

second ability ,you can use spell_resolved to trigger,
and those triggered abilitys with same condition to happen in same time follow the "instant rule" ----later first,
== object(), i think it means "is this card itself"
castled
 
Posts: 84
Joined: 09 Oct 2010, 14:50
Location: Shenzhen,China
Has thanked: 16 times
Been thanked: 1 time

Re: Living Death - Looks like I overdid with the effects

Postby IceManOnline » 20 Dec 2010, 15:16

Okay, let us take my code and I tell you, what I think it does ^^
Code: Select all
<SPELL_ABILITY layer="0" tag="LIVING_DEATH_RULE_1">
      <FILTER>
         return ( InGraveyard() and Creatures() )
      </FILTER>
      <PRE_EFFECT>
         <!-- for i=0,Subject():Count() -1 do -->
            Subject():Register_Object_Set( 5, Object() )
         <!-- end -->
      </PRE_EFFECT>
      <EFFECT>
         Subject():RemoveFromGame()
         Object():Register_Set( 1 , 1 )
      </EFFECT>   
   </SPELL_ABILITY>
<FILTER> -> Get Creature that are in Graveyard (Subject = target card, Object = Living Death if I understand it correct?)
<PRE_EFFECT> -> For every creature found, put the card "Living Death" into their register (for obtaining them later)
<EFFECT> -> Remove found cards from the game and put Register into "Living Death" (just for triggering)

Code: Select all
<TRIGGERED_ABILITY layer="0">
      <TRIGGER value="SPELL_RESOLVED">
         return ( SelfTriggered() and ( Object():Register_Get(1) == 1 ) )
      </TRIGGER>
      <FILTER>
         return CreaturesInPlay()
      </FILTER>
      <EFFECT>
         Subject():Sacrifice()
         Object():Register_Set( 1, 2)
      </EFFECT>   
   </TRIGGERED_ABILITY>
<TRIGGER> -> Spell-Resolved = Spell is not countered (?)
return -> card itself is the trigger and just trigger, if Register(1)=1 (maybe that's wrong here...)
<FILTER> -> find all creatures in play
<EFFECT> -> sacrifice them and put register to 2 for the next trigger

Code: Select all
<TRIGGERED_ABILITY layer="0">
      <TRIGGER value="SPELL_RESOLVED">
         return ( SelfTriggered() and ( Object():Register_Get(1) == 2 ) )
      </TRIGGER>
      <FILTER>
         return Subject():Register_Object_Get(5) == Object() and Subject():GetZone() == ZONE_REMOVED_FROM_GAME
      </FILTER>
      <EFFECT>
         Subject():PutIntoPlay( Subject():GetPlayer() )
         Object():Register_Set( 1, 0)
      </EFFECT>   
   </TRIGGERED_ABILITY>
<TRIGGER> -> same as above
return -> card itself is the trigger and register(1)=2
<FILTER> -> get all card, that have "Living Death" in their register and that are Removed from game
<EFFECT> -> put them into play for their given owner and delete the "trigger-register"

Maybe I just misunderstood some of the trigger stuff, but like it is now, the card does absolutely nothing...
IceManOnline
 
Posts: 80
Joined: 12 Dec 2010, 19:00
Has thanked: 0 time
Been thanked: 0 time

Re: Living Death - Looks like I overdid with the effects

Postby IceManOnline » 20 Dec 2010, 20:35

Tried it with a different approach today, but still no luck...
Code: Select all
<!--
///////////////////////////////////////////////////////////////////////////////////

 START OF CARD ABILITIES

///////////////////////////////////////////////////////////////////////////////////
-->

    <SPELL_ABILITY layer="0" zone="any">
   <FILTER>
      return
          Subject():GetZone() == ZONE_REMOVED_FROM_GAME
            and
          ( Subject():Register_Object_Get(5) == Object() )
   </FILTER>
   <EFFECT>
      Subject():PutIntoPlay( Subject():GetPlayer() )
      Subject():Register_Object_Set( 5, nil )
   </EFFECT>
   </SPELL_ABILITY>
   
   
   <TRIGGERED_ABILITY layer="0">
   <TRIGGER value="SPELL_PLAYED">
      return SelfTriggered()
   </TRIGGER>
   <FILTER>
      return
          SubjectType() == SUBJECT_OBJECT
            and
         Subject():GetZone() == ZONE_IN_PLAY
            and
          (Subject():GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0)
   </FILTER>
   <EFFECT>
      Subject():Sacrifice()
   </EFFECT>
   </TRIGGERED_ABILITY>
   
      
   <TRIGGERED_ABILITY layer="0" tag="LIVING_DEATH_RULE_1">
      <TRIGGER value="SPELL_PLAYED">
         return SelfTriggered()
      </TRIGGER>
      <FILTER>
         return
          SubjectType() == SUBJECT_OBJECT
            and
         Subject():GetZone() == ZONE_GRAVEYARD
            and
          (Subject():GetCardType():Test( CARD_TYPE_CREATURE ) ~= 0)
      </FILTER>
      <POST_PLAYTIME>
         Subject():Register_Object_Set( 5, Object() )
      </POST_PLAYTIME>
      <EFFECT>
         Subject():RemoveFromGame()
      </EFFECT>   
   </TRIGGERED_ABILITY>
If I put all abilities to <SPELL_ABILITY>, just the sacrifice part triggers...

Now I really need some help of the "gurus" I think (kev, yanna etc. I'm looking at you ;))
IceManOnline
 
Posts: 80
Joined: 12 Dec 2010, 19:00
Has thanked: 0 time
Been thanked: 0 time

Re: Living Death - Looks like I overdid with the effects

Postby kevlahnota » 21 Dec 2010, 05:55

:lol: try this code for living death if this works then its good :shock: :

Code: Select all
    <!--
    ///////////////////////////////////////////////////////////////////////////////////

    START OF CARD ABILITIES

    ///////////////////////////////////////////////////////////////////////////////////
    -->

       <SPELL_ABILITY tag="LIVING_DEATH_RULE_1" layer="0">
       <FILTER>
         return CreaturesInPlay()
       </FILTER>
       <EFFECT>
          Subject():Register_Object_Set(4, Object())
          Subject():Sacrifice()
       </EFFECT>
       </SPELL_ABILITY>
       
       
       <TRIGGERED_ABILITY layer="0" zone="any" forced_skip="1">
       <TRIGGER value="SPELL_RESOLVED">
          return SelfTriggered()
       </TRIGGER>
       <FILTER>
          return InGraveyard() and Creatures() and Subject():Register_Object_Get(4) ~= Object()
       </FILTER>
       <EFFECT>
          Subject():PutIntoPlay( Subject():GetOwner() )
          Object():Register_Set(0,1)
       </EFFECT>
       </TRIGGERED_ABILITY>
       
       <TRIGGERED_ABILITY layer="0" zone="any" internal="1">
       <TRIGGER value="ABILITY_RESOLVED">
          return SelfTriggered() and Object():Register_Get(0) == 1
       </TRIGGER>
       <FILTER>
          return InGraveyard() and Creatures() and Subject():Register_Object_Get(4) == Object()
       </FILTER>
       <EFFECT>
          Subject():Register_Object_Clear(4)
          Object():Register_Clear(0)
       </EFFECT>
       </TRIGGERED_ABILITY>
         
User avatar
kevlahnota
Programmer
 
Posts: 825
Joined: 19 Jul 2010, 17:45
Location: Philippines
Has thanked: 14 times
Been thanked: 264 times

Re: Living Death - Looks like I overdid with the effects

Postby IceManOnline » 21 Dec 2010, 07:00

Thanks kev, I'll try the code tonight after work.
IceManOnline
 
Posts: 80
Joined: 12 Dec 2010, 19:00
Has thanked: 0 time
Been thanked: 0 time

Re: Living Death - Looks like I overdid with the effects

Postby IceManOnline » 21 Dec 2010, 16:08

Works like a charm.
Thanks again kev.

Your code is almost too simple to work ^^ But it does. I was thinking way too complicated.
IceManOnline
 
Posts: 80
Joined: 12 Dec 2010, 19:00
Has thanked: 0 time
Been thanked: 0 time

Re: Living Death - Looks like I overdid with the effects

Postby kevlahnota » 21 Dec 2010, 16:15

your welcome :mrgreen:
IceManOnline wrote:Works like a charm.
Thanks again kev.

Your code is almost too simple to work ^^ But it does. I was thinking way too complicated.
User avatar
kevlahnota
Programmer
 
Posts: 825
Joined: 19 Jul 2010, 17:45
Location: Philippines
Has thanked: 14 times
Been thanked: 264 times

Re: Living Death - Looks like I overdid with the effects

Postby IceManOnline » 21 Dec 2010, 16:30

Just one last question:
Is
Code: Select all
return  SelfTriggered() and ( Object():Register_Get(1) == 1 )
identical to
Code: Select all
if Object():Register_Get(1)==1
      then return SelfTriggered()
If not, what's the difference?
IceManOnline
 
Posts: 80
Joined: 12 Dec 2010, 19:00
Has thanked: 0 time
Been thanked: 0 time

Re: Living Death - Looks like I overdid with the effects

Postby kevlahnota » 21 Dec 2010, 17:11

yup its identical but not the same approach.

the first one checks if its self-triggered AND its Register # 1 is equal to 1 then the trigger will execute.

the second one checks first if Register # 1 is equal to 1 then
return TRUE if its self-triggered

then you can terminate by adding end or add else
if you want to add another trigger statement.

IceManOnline wrote:Just one last question:
Is
Code: Select all
return  SelfTriggered() and ( Object():Register_Get(1) == 1 )
identical to
Code: Select all
if Object():Register_Get(1)==1
      then return SelfTriggered()
If not, what's the difference?
User avatar
kevlahnota
Programmer
 
Posts: 825
Joined: 19 Jul 2010, 17:45
Location: Philippines
Has thanked: 14 times
Been thanked: 264 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 16 guests


Who is online

In total there are 16 users online :: 0 registered, 0 hidden and 16 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 16 guests

Login Form