It is currently 10 May 2025, 06:35
   
Text Size

Kira, Great Glass-Spinner

Moderator: CCGHQ Admins

Kira, Great Glass-Spinner

Postby --Dream-- » 07 Sep 2012, 11:31

I'm trying to code Kira, Great Glass-Spinner. Granting the ability to other creatures is easy, but how can I make sure it only gets triggered once per turn?

Code: Select all
<TRIGGERED_ABILITY resource_id="1" auto_skip="1" filter_zone="ZONE_IN_PLAY">
    <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
    <LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever this creature becomes the target of a spell or ability for the first time in a turn, counter that spell or ability.]]></LOCALISED_TEXT>
    <TRIGGER value="BECAME_TARGET" simple_qualifier="self">
    return SecondaryObject() ~= nil
    </TRIGGER>
    <RESOLUTION_TIME_ACTION>
    local target_spell = SecondaryObject()
    if target_spell ~= nil then
      target_spell:CounterSpell()
   end
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
EDIT: Just saw the per_turn_limit="1" option lol. Hope it works.
--Dream--
 
Posts: 65
Joined: 28 Jul 2012, 12:01
Has thanked: 4 times
Been thanked: 0 time

Re: Kira, Great Glass-Spinner

Postby thefiremind » 07 Sep 2012, 11:38

I'm afraid that per_turn_limit only works with activated abilities. If that's the case, you'll have to make another similar trigger that saves TriggerObject() in a chest, and another one that clears the chest at end of turn. The added triggers will have to work in any zone. Finally, the trigger that you already coded will check if the TriggerObject() is already saved in the chest, and in that case, it won't trigger.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times

Re: Kira, Great Glass-Spinner

Postby --Dream-- » 07 Sep 2012, 11:48

thefiremind wrote:I'm afraid that per_turn_limit only works with activated abilities. If that's the case, you'll have to make another similar trigger that saves TriggerObject() in a chest, and another one that clears the chest at end of turn. The added triggers will have to work in any zone. Finally, the trigger that you already coded will check if the TriggerObject() is already saved in the chest, and in that case, it won't trigger.
Damn. So I need to grant 3 triggered abilities to each creature, right?
--Dream--
 
Posts: 65
Joined: 28 Jul 2012, 12:01
Has thanked: 4 times
Been thanked: 0 time

Re: Kira, Great Glass-Spinner

Postby thefiremind » 07 Sep 2012, 12:04

I forgot that this ability has to be granted... this complicates things a bit. My idea was based on keeping the checks on Kira, and it can be still applied: make a copy of your triggered ability, give it a different resource_id, and delete the code so that it does nothing at all (you can call it static instead of triggered if you want). You'll grant the "real" triggered ability to the creatures that haven't been targetted this turn, and the other one to the others. By keeping the same localised text, players won't see the trick while playing.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 722 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 8 guests


Who is online

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

Login Form