It is currently 23 Apr 2024, 16:10
   
Text Size

Two Headed Giant - 2014

Moderator: CCGHQ Admins

Two Headed Giant - 2014

Postby Luchian » 25 Mar 2014, 00:01

Hello,
I was wondering if I could get some help.
I have been playing a lot of local two headed giant and have been trying to put some decks into 2014 from 2010.
I recently found Riiak Shi Nal's code fixes and was really happy to see annihilator working much better now.
It got me thinking though, there are lots of cards that have triggers for when a creature deals damage to a defending player, but this doesn't really work in the game's two headed giant mode.
As an example I'll use the 2014 Dimir deck:
You have a Colossal Whale in play and attack. As it's currently coded, it can only exile a creature from the specific defending player across from you. So if you're on the left, it can only target the player on the left.
In two headed giant isn't the "defending player" the whole defending team, and aren't you supposed to be able to say which member of that team you are attacking, for certain card instances to trigger?
Colossal Whale is an easy coding fix, by just changing :
Code: Select all
      <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    filter:Add( FE_CONTROLLER, OP_IS, TriggerPlayer() )
    </TARGET_DEFINITION>
to
Code: Select all
      <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    filter:Add( FE_TEAM, OP_NOT, EffectController():GetTeam() )
    </TARGET_DEFINITION>
A bit dirty, but it works for me.
The problem I'm having - being really very new to all of this - is a card like Doomsday Specter or Ghastlord of Fugue . These two I just can't work out. I've been studying Riiak Shi Nal's fix LOL and hoping to see if there was some way of easily allowing these cards to choose an opponent to target either when they attack or upon dealing damage to a player. And in such a way as it doesn't affect the single player game?
I'm just feeling way out of my depth at the moment and could really use some advice or help in trying to work this out.
Luchian
 
Posts: 20
Joined: 21 Mar 2014, 20:50
Has thanked: 10 times
Been thanked: 2 times

Re: Two Headed Giant - 2014

Postby RiiakShiNal » 25 Mar 2014, 02:19

According to the rules you do get to choose the "defending player" in two-headed giant games:
810.7b Any one-shot effect that refers to the “defending player” refers to one specific defending player, not to both of the defending players. The controller of the effect chooses which one the spell or ability refers to at the time the effect is applied. The same is true for any one-shot effect that refers to the “attacking player.”
Any characteristic-defining ability that refers to the “defending player” refers to one specific defending player, not to both of the defending players. The controller of the object with the characteristic-defining ability chooses which one the ability refers to at the time the nonactive players become defending players.
All other cases in which the “defending player” is referred to actually refer to both defending players. If the reference involves a positive comparison (such as asking whether the defending player controls an Island) or a relative comparison (such as asking whether you control more creatures than the defending player), it gets only one answer. This answer is “yes” if either defending player in the comparison would return a “yes” answer if compared individually. If the reference involves a negative comparison (such as asking whether the defending player controls no black permanents), it also gets only one answer. This answer is “yes” if performing the analogous positive comparison would return a “no” answer. The same is true for all other cases that refer to the “attacking player.”
Rule 810.7f shows that the attackers get to determine on a creature-by-creature basis which player to deal damage to (and thus decide which is the "defending player" for effects that say the player that was dealt damage). Since DotP doesn't actually allow us to determine which player was actually dealt damage from attacking creatures in Two-Headed Giant games, approximating using rule 810.7b (shown above) seems appropriate.
810.7f As the combat damage step begins, the active team announces how each attacking creature will assign its combat damage. If an attacking creature would assign combat damage to the defending team, the active team chooses only one of the defending players for that creature to assign its combat damage to. Then the defending team announces how each blocking creature will assign its combat damage. See rule 510.1.
I don't know if the game properly handles landwalk based on these rules, but if it doesn't then there probably isn't a way to fix that.

As for Doomsday Specter and Ghastlord of Fugue they can be dealt with in a similar way to how I coded the Annihilator functions (not exactly because they use register 0 which I used for the player pick in the Annihilator functions and other minor differences). So their first RESOLUTION_TIME_ACTION (added action) should look something like this:
Code: Select all
<RESOLUTION_TIME_ACTION>
   local oDefending = SecondaryPlayer()
   if (oDefending ~= nil) then
      if (oDefending:GetTeam():GetNumberOfPlayers() > 1) then
         local oFilter = ClearFilter()
         oFilter:SetFilterType( FILTER_TYPE_PLAYERS )
         oFilter:Add( FE_TEAM, OP_IS, oDefending:GetTeam() )
         EffectController():ChooseItem( "CARD_QUERY_CHOOSE_PLAYER", EffectDC():Make_Targets(50) )
      else
         local oTargets = EffectDC():Make_Targets(50)
         oTargets:Set_PlayerPtr( 0, oDefending )
      end
   end
</RESOLUTION_TIME_ACTION>
Then in the subsequent actions you would replace all instances of SecondaryPlayer() with EffectDC():Get_Targets(50):Get_PlayerPtr(0).

This solution may not work verbatim for all cards that would need to be changed, but it would work for the two listed. In single player or FFA because team size will be 1 there will be no visible change to their abilities, but in Two-Headed Giant it will ask to choose a player then the later queries will work off the selected player.

Since these would fall under fixes to the official cards I will put them into the next version of the Core Fixes.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Two Headed Giant - 2014

Postby Luchian » 25 Mar 2014, 21:09

That solution has worked really well for all of the cards I've tried it with, apart from Scion of Darkness which is giving me trouble.
So far it works on :
Doomsday Specter
Ghastlord of Fugue
Liliana's Reaver
Lord of the Void
Sword of War & Peace
Dimir Cutpurse
and
Silent-Blade Oni

The Colossal Whale fix also can be applied to Cyclops Gladiator and Master of Diversion - not that Master of Diversion appears in a main deck.
The code I currently have for the Scion is :
Code: Select all
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
    <MAY />
    <TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_PUT_ONTO_BATTLEFIELD" definition="0" compartment="0" count="1" />
      <RESOLUTION_TIME_ACTION>
         RSI_NewDefending_Player_Choosing()
      </RESOLUTION_TIME_ACTION>
    <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    filter:SetZone( ZONE_GRAVEYARD, EffectDC():Get_Targets(50):Get_PlayerPtr(0) )
    </TARGET_DEFINITION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if  target ~= nil then
       target:PutOntoBattlefield( EffectController() )
    end 
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
Luchian
 
Posts: 20
Joined: 21 Mar 2014, 20:50
Has thanked: 10 times
Been thanked: 2 times

Re: Two Headed Giant - 2014

Postby Luchian » 25 Mar 2014, 22:31

Silly me, Scion of Darkness was actually a pretty easy fix I was just thinking totally along the wrong lines. A quick look at Body Double gave a working solution :
Code: Select all
    <TRIGGER value="SOURCE_DEALS_DAMAGE_TO_PLAYER" simple_qualifier="self" damage_type="combat" />
    <MAY />
    <TARGET tag="CARD_QUERY_CHOOSE_CREATURE_TO_PUT_ONTO_BATTLEFIELD" definition="0" compartment="0" count="1" />
      <TARGET_DEFINITION id="0">
    local filter = ClearFilter()
    filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
    filter:Add( FE_TEAM, OP_NOT, EffectController():GetTeam() )
    filter:SetZone( ZONE_GRAVEYARD )
    </TARGET_DEFINITION>
    <RESOLUTION_TIME_ACTION>
    local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
    if  target ~= nil then
       target:PutOntoBattlefield( EffectController() )
    end 
    </RESOLUTION_TIME_ACTION>
  </TRIGGERED_ABILITY>
Luchian
 
Posts: 20
Joined: 21 Mar 2014, 20:50
Has thanked: 10 times
Been thanked: 2 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 11 guests


Who is online

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

Login Form