Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk



Living Death - Looks like I overdid with the effects
Moderator: CCGHQ Admins
Living Death - Looks like I overdid with the effects
by 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:
I still don't know what for example the AntiHint stuff (and much more...) does.
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
///////////////////////////////////////////////////////////////////////////////////
-->
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
by 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"
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
by IceManOnline » 20 Dec 2010, 15:16
Okay, let us take my code and I tell you, what I think it does ^^
<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)
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
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...
- 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>
<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>
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>
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
by IceManOnline » 20 Dec 2010, 20:35
Tried it with a different approach today, but still no luck...
Now I really need some help of the "gurus" I think (kev, yanna etc. I'm looking at you
)
- 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>
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
by kevlahnota » 21 Dec 2010, 05:55


- 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>
-
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
by 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
by 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.
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
by kevlahnota » 21 Dec 2010, 16:15
your welcome

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.
-
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
by IceManOnline » 21 Dec 2010, 16:30
Just one last question:
Is
Is
- Code: Select all
return SelfTriggered() and ( Object():Register_Get(1) == 1 )
- Code: Select all
if Object():Register_Get(1)==1
then return SelfTriggered()
- 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
by 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.
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:
Isidentical to
- Code: Select all
return SelfTriggered() and ( Object():Register_Get(1) == 1 )
If not, what's the difference?
- Code: Select all
if Object():Register_Get(1)==1
then return SelfTriggered()
-
kevlahnota - Programmer
- Posts: 825
- Joined: 19 Jul 2010, 17:45
- Location: Philippines
- Has thanked: 14 times
- Been thanked: 264 times
10 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 9 guests