Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Talk about new cards here
Moderator: CCGHQ Admins
Re: Talk about new cards here
by Yanna » 28 Aug 2010, 09:54
That's exactly what i was looking into, and interacting with the stack itself seems the most elegant way to do so.kevlahnota wrote:i was thinking of that also, did you try to set the object stackable?
i'm still wondering how to use these constants:
------------------------------------
STACK OBJECT TYPES -----------------
------------------------------------
STACK_OBJECT_UNDEFINED
STACK_OBJECT_CARD
STACK_OBJECT_ABILITY
STACK_OBJECT_COMBAT_DAMAGE
if we can utilize those and set the zone in ZONE_STACK we can make a new card ability like cascade,suspend,storm...etc(AD Nauseum )
Unfortunately my attempts at moving a card in the zone stack fails (SetZone is a filter method not a card method).
Re: Talk about new cards here
by Yanna » 28 Aug 2010, 12:31
Found some interesting functions, but those are realted to 'challenges' :
<!-- PLAYER 0 -->
<!-- LANDS -->
<!-- Draw thole whole deck (count - 1)-->
<DRAW_CARDS player_id="0" count="-1"/>
<GO_TO_TURN_STEP player_id="0" step="STEP_MAIN_1"/>
<PLAY_LAND player_id="0" repeat="-1"/>
<!-- CARDS -->
<MOVE_CARD player_id="0" card="HOLY_DAY" zone="ZONE_GRAVEYARD"/>
<MOVE_CARD player_id="0" card="GOLDENGLOW_MOTH" zone="ZONE_GRAVEYARD"/>
If only we could call those functions into the real game, it would mean more control over it (move cards, go to step, etc...)
<!-- PLAYER 0 -->
<!-- LANDS -->
<!-- Draw thole whole deck (count - 1)-->
<DRAW_CARDS player_id="0" count="-1"/>
<GO_TO_TURN_STEP player_id="0" step="STEP_MAIN_1"/>
<PLAY_LAND player_id="0" repeat="-1"/>
<!-- CARDS -->
<MOVE_CARD player_id="0" card="HOLY_DAY" zone="ZONE_GRAVEYARD"/>
<MOVE_CARD player_id="0" card="GOLDENGLOW_MOTH" zone="ZONE_GRAVEYARD"/>
If only we could call those functions into the real game, it would mean more control over it (move cards, go to step, etc...)
Re: Talk about new cards here
by kevlahnota » 28 Aug 2010, 13:30
interesting! by the way i corrected the shocklands. it will not ask to pay for 2 life if it comes into play tapped!
anyway, you said that we can put any card into play right (i think as long at it is a permanent i guess) do you know how to determine a specific card by using Object():GetRef()? I'm still trying to figure out FOW alternate cost, when Dream Halls is in play it will not ask to remove a blue card in the game and pay for 1 life.
anyway, you said that we can put any card into play right (i think as long at it is a permanent i guess) do you know how to determine a specific card by using Object():GetRef()? I'm still trying to figure out FOW alternate cost, when Dream Halls is in play it will not ask to remove a blue card in the game and pay for 1 life.
Yanna wrote:Found some interesting functions, but those are realted to 'challenges' :
<!-- PLAYER 0 -->
<!-- LANDS -->
<!-- Draw thole whole deck (count - 1)-->
<DRAW_CARDS player_id="0" count="-1"/>
<GO_TO_TURN_STEP player_id="0" step="STEP_MAIN_1"/>
<PLAY_LAND player_id="0" repeat="-1"/>
<!-- CARDS -->
<MOVE_CARD player_id="0" card="HOLY_DAY" zone="ZONE_GRAVEYARD"/>
<MOVE_CARD player_id="0" card="GOLDENGLOW_MOTH" zone="ZONE_GRAVEYARD"/>
If only we could call those functions into the real game, it would mean more control over it (move cards, go to step, etc...)
-
kevlahnota - Programmer
- Posts: 825
- Joined: 19 Jul 2010, 17:45
- Location: Philippines
- Has thanked: 14 times
- Been thanked: 264 times
Re: Talk about new cards here
by Yanna » 28 Aug 2010, 14:58
Yeah, you can put any card into play (that can be put into play, not a sorcery for example) with PutTokensIntoPlay( RefString, Count).kevlahnota wrote:anyway, you said that we can put any card into play right (i think as long at it is a permanent i guess) do you know how to determine a specific card by using Object():GetRef()? I'm still trying to figure out FOW alternate cost, when Dream Halls is in play it will not ask to remove a blue card in the game and pay for 1 life.
As for the GetRef question, i don't get what you want to do ? You want to set a filter with the ref ?
Re: Talk about new cards here
by kevlahnota » 28 Aug 2010, 15:39
yup, just to check if a specific card is in play or not. i've tried this(i don't know why it is not working):
- Code: Select all
Object():Register_Object_Set( 0, MTG():ObtainToken( "DREAM_HALLS", Object():GetPlayer() ) )
- Code: Select all
<FILTER>
local TargetIsInPlay = Object():Register_Object_Get( 0 )
return SubjectType() == SUBJECT_OBJECT and
TargetIsInPlay:GetRef() == Subject():GetRef()
</FILTER>
<EFFECT>
if Subject() ~= nil and Subject():GetZone() == ZONE_IN_PLAY then
Object():Register_Set( 0, 1 )
else
Object():Register_Set( 0, 0 )
end
</EFFECT>
- Code: Select all
TRIGGER value="ZONECHANGE">
return (TriggerObject():GetZone() == ZONE_STACK and TriggerObject():GetPlayer():GetTeam() ~= Object():GetPlayer():GetTeam() and CountIfHandHasColour( COLOUR_BLUE ) > 1 and Object_Register_Get( 0 ) == 0)
</TRIGGER>
Yanna wrote:Yeah, you can put any card into play (that can be put into play, not a sorcery for example) with PutTokensIntoPlay( RefString, Count).kevlahnota wrote:anyway, you said that we can put any card into play right (i think as long at it is a permanent i guess) do you know how to determine a specific card by using Object():GetRef()? I'm still trying to figure out FOW alternate cost, when Dream Halls is in play it will not ask to remove a blue card in the game and pay for 1 life.
As for the GetRef question, i don't get what you want to do ? You want to set a filter with the ref ?
Last edited by kevlahnota on 28 Aug 2010, 16:22, edited 1 time in total.
-
kevlahnota - Programmer
- Posts: 825
- Joined: 19 Jul 2010, 17:45
- Location: Philippines
- Has thanked: 14 times
- Been thanked: 264 times
Re: Talk about new cards here
by Yanna » 28 Aug 2010, 15:46
Is it working then ? Great thinking btw, this could be used for other purposes.kevlahnota wrote:(i don't know why it is working)
Re: Talk about new cards here
by kevlahnota » 28 Aug 2010, 16:22
oh i'm sorry, it's not working i'll edit my post
-
kevlahnota - Programmer
- Posts: 825
- Joined: 19 Jul 2010, 17:45
- Location: Philippines
- Has thanked: 14 times
- Been thanked: 264 times
Re: Talk about new cards here
by kevlahnota » 29 Aug 2010, 11:14
@Yanna
anyway can we change the card type ingame?
like
anyway can we change the card type ingame?
like
- Code: Select all
Subject():GetCardType( CARD_TYPE_CREATURE, 1 )
-
kevlahnota - Programmer
- Posts: 825
- Joined: 19 Jul 2010, 17:45
- Location: Philippines
- Has thanked: 14 times
- Been thanked: 264 times
Re: Talk about new cards here
by Clark » 29 Aug 2010, 15:07
Hi,kevlahnota wrote:i was thinking of that also, did you try to set the object stackable?
i'm still wondering how to use these constants:
------------------------------------
STACK OBJECT TYPES -----------------
------------------------------------
STACK_OBJECT_UNDEFINED
STACK_OBJECT_CARD
STACK_OBJECT_ABILITY
STACK_OBJECT_COMBAT_DAMAGE
if we can utilize those and set the zone in ZONE_STACK we can make a new card ability like cascade,suspend,storm...etc(AD Nauseum )Clark wrote:Hi folks,
When implementing one new effect 'Cascade', i met one bottleneck.Here are the code:Cascade (When you play this spell, remove cards from the top of your library from the game until you remove a nonland cart that cost less. You may play it without paying its mana cost. Put the removed cards on the bottom in a random order).I tried every way to decrease the cost of new card but failed
- Code: Select all
<TRIGGERED_ABILITY tag="BLOODBRAID_ELF_RULE_1" forced_skip="1" layer="0">
<TRIGGER value="COMES_INTO_PLAY">
return SelfTriggered()
</TRIGGER>
<EFFECT>
local LNC_CARD_COST = 4
local LNC_FLAG_SUCCESS = 1
local LNC_OBJ_SELF = Object():GetOwner()
while (LNC_FLAG_SUCCESS > 0) do
if (LNC_OBJ_SELF:Library_GetTop() ~= nil) then
local LNC_OBJ_SELF_TOPCARD = LNC_OBJ_SELF:Library_GetTop()
local LNG_TOPCARD_CONVERTEDMANACOST = LNC_OBJ_SELF_TOPCARD:GetConvertedManaCost()
if ( ( LNC_OBJ_SELF_TOPCARD:GetCardType():Test( CARD_TYPE_LAND ) == 0 ) and ( LNG_TOPCARD_CONVERTEDMANACOST < LNC_CARD_COST ) ) then
Subject():DecreaseCost( 16 )
Subject():DecreaseColouredCost( COLOUR_BLACK, 7 )
Subject():DecreaseColouredCost( COLOUR_RED, 7 )
Subject():DecreaseColouredCost( COLOUR_GREEN, 7 )
Subject():DecreaseColouredCost( COLOUR_BLUE, 7 )
Subject():DecreaseColouredCost( COLOUR_WHITE, 7 )
Subject():DecreaseColouredCost( COLOUR_X, 1 )
LNC_OBJ_SELF_TOPCARD:PutInHand()
LNC_OBJ_SELF_TOPCARD:GuidedReveal( ZONE_LIBRARY, ZONE_HAND )
LNC_FLAG_SUCCESS = 0
end
end
end
LNC_OBJ_SELF:ShuffleLibrary()
</EFFECT>
Because the new card type would not be only 'creature', so that i cannot simply move it from library into the battlefield.
Could you please give me some suggestion?
Thanks
To STACK OBJECT TYPES (all numbers in constant.lua), they are the enumeration value/key to narrow the input param range for related application method.
Which is same as Enum in JAVA.
To Yanna,
Those tags i'm afraid are only useful for the root tag "<challenge>".
What i wanna know is not those customer tags, but the implementation in the application program for those service interface.
But it seems a tough work without any API document
- Clark
- Posts: 64
- Joined: 21 Aug 2010, 16:07
- Has thanked: 0 time
- Been thanked: 0 time
Re: Talk about new cards here
by kevlahnota » 29 Aug 2010, 15:32
Hmmm. So you say that if I want to change the card type like CARD_TYPE_LAND to CARD_TYPE_CREATURE then I must change the number from 4 to 1?
Clark wrote:Which is same as Enum in JAVA.
To Yanna,
Those tags i'm afraid are only useful for the root tag "<challenge>".
What i wanna know is not those customer tags, but the implementation in the application program for those service interface.
But it seems a tough work without any API document
-
kevlahnota - Programmer
- Posts: 825
- Joined: 19 Jul 2010, 17:45
- Location: Philippines
- Has thanked: 14 times
- Been thanked: 264 times
Re: Talk about new cards here
by Clark » 29 Aug 2010, 16:17
Not exactly.kevlahnota wrote:Hmmm. So you say that if I want to change the card type like CARD_TYPE_LAND to CARD_TYPE_CREATURE then I must change the number from 4 to 1?
Clark wrote:Which is same as Enum in JAVA.
To Yanna,
Those tags i'm afraid are only useful for the root tag "<challenge>".
What i wanna know is not those customer tags, but the implementation in the application program for those service interface.
But it seems a tough work without any API document
To
- Code: Select all
Object():GetFilter():SetStackObjectType( int param )
Which are
- Code: Select all
STACK_OBJECT_UNDEFINED = 0
STACK_OBJECT_CARD = 1
STACK_OBJECT_ABILITY = 2
STACK_OBJECT_COMBAT_DAMAGE = 3
The words like "STACK_OBJECT_CARD" are the enumeration key which are easy to understand its meanning, while its corresponding number are the enumeration value.
In this case, the value is 1.
Which means in application program only 0~3 are meaningful input param.
If other value like 4 etc inputed, some exception would be thrown.
Thats all
- Clark
- Posts: 64
- Joined: 21 Aug 2010, 16:07
- Has thanked: 0 time
- Been thanked: 0 time
Re: Talk about new cards here
by Yanna » 29 Aug 2010, 16:51
Exactly,Clark wrote:To Yanna,
Those tags i'm afraid are only useful for the root tag "<challenge>".
What i wanna know is not those customer tags, but the implementation in the application program for those service interface.
But it seems a tough work without any API document
Altought they are interpreted by the code at some other level, the <Mutluacode> tags even provide another interface where you can embed code (and have access to other functions). But you can't use anything of the like in a <CARD> tag...
And whithout any documentation, all is left to do is trial and error to figure out the function and the correct syntax.
It will be quite improbable to code storm/cascade cards without interacting directly with the stack i think.
Re: Talk about new cards here
by Clark » 30 Aug 2010, 12:37
It seems someone create the template for those levelup creature cards.
Its a great work!!!
I cannot wait to code one blue white levelup deck now
Its a great work!!!
I cannot wait to code one blue white levelup deck now
- Clark
- Posts: 64
- Joined: 21 Aug 2010, 16:07
- Has thanked: 0 time
- Been thanked: 0 time
Re: Talk about new cards here
by Clark » 30 Aug 2010, 13:32
It seems the count number for levels & corresponding status are fixed in template...ennnn im trying to find a common way.Clark wrote:It seems someone create the template for those levelup creature cards.
Its a great work!!!
I cannot wait to code one blue white levelup deck now
- Clark
- Posts: 64
- Joined: 21 Aug 2010, 16:07
- Has thanked: 0 time
- Been thanked: 0 time
Re: Talk about new cards here
by kevlahnota » 30 Aug 2010, 14:13
yup, I created the student warfare template with the fixed count numbers.
anyway, the original template I'm using does not look good on DOTP that's why I modified it.The fonts I used are Caslon Bold, MatrixB.
anyway, the original template I'm using does not look good on DOTP that's why I modified it.The fonts I used are Caslon Bold, MatrixB.
Clark wrote:It seems the count number for levels & corresponding status are fixed in template...ennnn im trying to find a common way.Clark wrote:It seems someone create the template for those levelup creature cards.
Its a great work!!!
I cannot wait to code one blue white levelup deck now
-
kevlahnota - Programmer
- Posts: 825
- Joined: 19 Jul 2010, 17:45
- Location: Philippines
- Has thanked: 14 times
- Been thanked: 264 times
Who is online
Users browsing this forum: No registered users and 40 guests