It is currently 25 Apr 2024, 09:32
   
Text Size

Talk about new cards here

Moderator: CCGHQ Admins

Re: Talk about new cards here

Postby Yanna » 28 Aug 2010, 09:54

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 [-o< )
That's exactly what i was looking into, and interacting with the stack itself seems the most elegant way to do so.
Unfortunately my attempts at moving a card in the zone stack fails (SetZone is a filter method not a card method).
Image
User avatar
Yanna
 
Posts: 137
Joined: 03 Mar 2009, 14:52
Has thanked: 0 time
Been thanked: 1 time

Re: Talk about new cards here

Postby 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...)
Image
User avatar
Yanna
 
Posts: 137
Joined: 03 Mar 2009, 14:52
Has thanked: 0 time
Been thanked: 1 time

Re: Talk about new cards here

Postby 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! :lol:

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...)
User avatar
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

Postby Yanna » 28 Aug 2010, 14:58

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.
Yeah, you can put any card into play (that can be put into play, not a sorcery for example) with PutTokensIntoPlay( RefString, Count).

As for the GetRef question, i don't get what you want to do ? You want to set a filter with the ref ?
Image
User avatar
Yanna
 
Posts: 137
Joined: 03 Mar 2009, 14:52
Has thanked: 0 time
Been thanked: 1 time

Re: Talk about new cards here

Postby 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() ) )
then

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>
now for the Force of Will Trigger ability i've added( Object():Register_Get( 0 ) == 0 (assuming dream halls is not in play it will ask a question):
Code: Select all
TRIGGER value="ZONECHANGE">
         
              return (TriggerObject():GetZone() == ZONE_STACK and TriggerObject():GetPlayer():GetTeam() ~= Object():GetPlayer():GetTeam() and CountIfHandHasColour( COLOUR_BLUE ) &gt; 1 and Object_Register_Get( 0 ) == 0)
          </TRIGGER>
Yanna wrote:
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.
Yeah, you can put any card into play (that can be put into play, not a sorcery for example) with PutTokensIntoPlay( RefString, Count).

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.
User avatar
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

Postby Yanna » 28 Aug 2010, 15:46

kevlahnota wrote:(i don't know why it is working)
Is it working then ? Great thinking btw, this could be used for other purposes.
Image
User avatar
Yanna
 
Posts: 137
Joined: 03 Mar 2009, 14:52
Has thanked: 0 time
Been thanked: 1 time

Re: Talk about new cards here

Postby kevlahnota » 28 Aug 2010, 16:22

oh i'm sorry, it's not working i'll edit my post
User avatar
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

Postby kevlahnota » 29 Aug 2010, 11:14

@Yanna
anyway can we change the card type ingame?
like
Code: Select all
Subject():GetCardType( CARD_TYPE_CREATURE, 1 )
or do you have any idea?
User avatar
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

Postby Clark » 29 Aug 2010, 15:07

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 [-o< )

Clark wrote:Hi folks,

When implementing one new effect 'Cascade', i met one bottleneck.
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).
Here are the code:
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 &gt; 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 &lt; 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>
I tried every way to decrease the cost of new card but failed :(

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
Hi,

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. :x

But it seems a tough work without any API document :twisted:
Clark
 
Posts: 64
Joined: 21 Aug 2010, 16:07
Has thanked: 0 time
Been thanked: 0 time

Re: Talk about new cards here

Postby 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. :x

But it seems a tough work without any API document :twisted:
User avatar
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

Postby Clark » 29 Aug 2010, 16:17

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. :x

But it seems a tough work without any API document :twisted:
Not exactly.

To
Code: Select all
Object():GetFilter():SetStackObjectType( int param )
, there are four meaningful input value in all.

Which are
Code: Select all
STACK_OBJECT_UNDEFINED =                     0
STACK_OBJECT_CARD =                           1
STACK_OBJECT_ABILITY =                        2
STACK_OBJECT_COMBAT_DAMAGE =                  3
like the contents in constant.lua

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

Postby Yanna » 29 Aug 2010, 16:51

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. :x

But it seems a tough work without any API document :twisted:
Exactly,

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.
Image
User avatar
Yanna
 
Posts: 137
Joined: 03 Mar 2009, 14:52
Has thanked: 0 time
Been thanked: 1 time

Re: Talk about new cards here

Postby 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 8)
Clark
 
Posts: 64
Joined: 21 Aug 2010, 16:07
Has thanked: 0 time
Been thanked: 0 time

Re: Talk about new cards here

Postby Clark » 30 Aug 2010, 13:32

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 8)
It seems the count number for levels & corresponding status are fixed in template...ennnn im trying to find a common way.
Clark
 
Posts: 64
Joined: 21 Aug 2010, 16:07
Has thanked: 0 time
Been thanked: 0 time

Re: Talk about new cards here

Postby kevlahnota » 30 Aug 2010, 14:13

yup, I created the student warfare template with the fixed count numbers. :D
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:
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 8)
It seems the count number for levels & corresponding status are fixed in template...ennnn im trying to find a common way.
User avatar
kevlahnota
Programmer
 
Posts: 825
Joined: 19 Jul 2010, 17:45
Location: Philippines
Has thanked: 14 times
Been thanked: 264 times

PreviousNext

Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 40 guests


Who is online

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

Login Form