It is currently 28 Apr 2024, 07:11
   
Text Size

NEED HELP FOR Brine Seer's CODES

Moderator: CCGHQ Admins

NEED HELP FOR Brine Seer's CODES

Postby angbaguhan » 24 Sep 2013, 14:43

I have a work in progress for Brine Seer Card
I got the effect working and no conflict with the AI however I don't know the codes for showing hands and how would the opponent pay 1 mana for each blue cards shown

Here is the code that I have made for the ability so far

Code: Select all
<ACTIVATED_ABILITY>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{U}, {T}: Reveal any number of blue cards in your hand. Counter target spell unless its controller pays {1} for each card revealed this way.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[{U}, {T}: Reveal any number of blue cards in your hand. Counter target spell unless its controller pays {1} for each card revealed this way.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[{U}, {T}: Reveal any number of blue cards in your hand. Counter target spell unless its controller pays {1} for each card revealed this way.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[{U}, {T}: Reveal any number of blue cards in your hand. Counter target spell unless its controller pays {1} for each card revealed this way.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[{U}, {T}: Rivela un qualsiasi numero di carte blu dalla tua mano. Neutralizza la magia bersaglio a meno che il suo controllore paghi {1} per ogni carta rivelata in questo modo.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[{U}, {T}: Reveal any number of blue cards in your hand. Counter target spell unless its controller pays {1} for each card revealed this way.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[{U}, {T}: Reveal any number of blue cards in your hand. Counter target spell unless its controller pays {1} for each card revealed this way.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[{U}, {T}: Reveal any number of blue cards in your hand. Counter target spell unless its controller pays {1} for each card revealed this way.]]></LOCALISED_TEXT>
      <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[{U}, {T}: Reveal any number of blue cards in your hand. Counter target spell unless its controller pays {1} for each card revealed this way.]]></LOCALISED_TEXT>
      <COST mana_cost="{2}{U}" type="Mana" />
      <COST type="TapSelf" />
      <TARGET tag="CARD_QUERY_CHOOSE_SPELL_TO_COUNTER" definition="0" compartment="0" count="1" />
      <TARGET_DEFINITION id="0">
          local filter = ClearFilter()
          filter:SetZone( ZONE_STACK )
          filter:Add (FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
          </TARGET_DEFINITION>
      <RESOLUTION_TIME_ACTION>
                local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
                if target ~= nil then
                target:CounterSpell()
                end
             </RESOLUTION_TIME_ACTION>
      <AI_BASE_SCORE score="1050" zone="ZONE_HAND" />
   </ACTIVATED_ABILITY>
angbaguhan
 
Posts: 12
Joined: 23 Sep 2013, 13:32
Has thanked: 3 times
Been thanked: 0 time

Re: NEED HELP FOR Brine Seer's CODES

Postby sumomole » 24 Sep 2013, 16:48

Brine Seer | Open
Code: Select all
  <ACTIVATED_ABILITY>
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[{2}{U}, {T}: Reveal any number of blue cards in your hand. Counter target spell unless its controller pays {1} for each card revealed this way.]]></LOCALISED_TEXT>
    <SFX text="TARGET_PLASMA_PLAY" />
    <COST mana_cost="{2}{U}" type="Mana" />
    <COST type="TapSelf" />
    <TARGET tag="CARD_QUERY_CHOOSE_SPELL_TO_COUNTER" definition="0" compartment="0" count="1" />
    <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:SetZone( ZONE_STACK )
    </TARGET_DEFINITION>
    <RESOLUTION_TIME_ACTION>
    local filter = ClearFilter()
    local player = EffectController()
    filter:SetZone( ZONE_HAND, player )
    filter:Add( FE_COLOUR, OP_IS, COLOUR_BLUE )
    local total = filter:Count()
    player:SetItemCount( total )
    for i = 0,(total-1) do
       player:SetItemPrompt ( i, "CARD_QUERY_CHOOSE_CARD_TO_REVEAL" )
    end
    player:ChooseItems( EffectDC():Make_Targets(1), QUERY_FLAG_UP_TO )
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local targetDC = EffectDC():Get_Targets(1)
    if targetDC ~= nil then
      local number = targetDC:Count()
      for i = 0,(number-1) do
        local target = targetDC:Get_CardPtr(i)
        if target ~= nil then
            target:Reveal()
           EffectDC():Int_Inc(2)
        end
      end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
       local controller = target:GetPlayer()
       local mana = EffectDC():Get_Int(2)
      if mana &gt; 0 then
        local mana_string = ""
        for i=1,mana do
           mana_string = "{1}"..mana_string
        end
        if controller:CanPayManaCost(mana_string) then
           controller:SetCustomQueryInstructionValue( mana )
           controller:BeginNewMultipleChoice()
            controller:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_PAY_"..mana )   
            controller:AddMultipleChoiceAnswer( "CARD_QUERY_OPTION_IS_COUNTERED" )
            controller:AskMultipleChoiceQuestion( "CARD_QUERY_MC_RUNE_SNAG", target )
         end
       end
    end
    </RESOLUTION_TIME_ACTION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if target ~= nil then
      local characteristics = target:GetCurrentCharacteristics()
       local controller = target:GetPlayer()
      local result = controller:GetMultipleChoiceResult()
       local mana = EffectDC():Get_Int(2)
      if mana &gt; 0 then
        local mana_string = ""
        for i=1,mana do
           mana_string = "{1}"..mana_string
        end
         if result == 0 and controller:CanPayManaCost(mana_string) then
           controller:PayManaCost(mana_string)
        else
           target:CounterSpell()
        end
      end
    end
    </RESOLUTION_TIME_ACTION>
    <AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
  </ACTIVATED_ABILITY>
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: NEED HELP FOR Brine Seer's CODES

Postby angbaguhan » 24 Sep 2013, 23:03

awsome works great now if only I could find a way to make ai reserve mana :D thank you very much

Added Msg:
I edited this reply I just found out that in AI can choose ether to pay mana or not for his spell to work while on player there is no option to pay mana to cancel its ability

Added:
however after rebooting my PC AI is no longer using the ability unless he have a unit for blocking an attack, and if AI use it and player has enough mana to cancel it, the ability is automatically cancelled without tapping or paying the mana required
angbaguhan
 
Posts: 12
Joined: 23 Sep 2013, 13:32
Has thanked: 3 times
Been thanked: 0 time

Re: NEED HELP FOR Brine Seer's CODES

Postby sumomole » 25 Sep 2013, 16:05

angbaguhan wrote:awsome works great now if only I could find a way to make ai reserve mana :D thank you very much

Added Msg:
I edited this reply I just found out that in AI can choose ether to pay mana or not for his spell to work while on player there is no option to pay mana to cancel its ability

Added:
however after rebooting my PC AI is no longer using the ability unless he have a unit for blocking an attack, and if AI use it and player has enough mana to cancel it, the ability is automatically cancelled without tapping or paying the mana required
try to use "target:GuidedReveal( target:GetZone(), target:GetZone() )" instead of "target:Reveal()".
User avatar
sumomole
Programmer
 
Posts: 611
Joined: 07 Jun 2011, 08:34
Has thanked: 51 times
Been thanked: 234 times

Re: NEED HELP FOR Brine Seer's CODES

Postby angbaguhan » 26 Sep 2013, 02:39

I think brine seer is too much for a starters like me I appreciate your help sumomole I think I need to start with that option pop-up on the target first
angbaguhan
 
Posts: 12
Joined: 23 Sep 2013, 13:32
Has thanked: 3 times
Been thanked: 0 time


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 24 guests


Who is online

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

Login Form