Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Will of the Council
Moderator: CCGHQ Admins
Re: Will of the Council
by RiiakShiNal » 17 Aug 2014, 17:33
Ok, that's what I will use then.volrathxp wrote:Right right, which is why I kind of think the table would be fine.
Edit: Barring any test failure this is what Bite of the Black Rose now looks like:
- Bite of the Black Rose | Open
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="BITE_OF_THE_BLACK_ROSE_1000382219" />
<CARDNAME text="BITE_OF_THE_BLACK_ROSE" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Bite of the Black Rose]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Bite of the Black Rose]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Bite of the Black Rose]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Bite of the Black Rose]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Bite of the Black Rose]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[黒薔薇の一片]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Bite of the Black Rose]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Bite of the Black Rose]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Bite of the Black Rose]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="1000382219" />
<ARTID value="1000382219" />
<ARTIST name="Franz Vohwinkel" />
<CASTING_COST cost="{3}{B}" />
<TYPE metaname="Sorcery" />
<EXPANSION value="CNS" />
<RARITY metaname="U" />
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Will of the council — Starting with you, each player votes for sickness or psychosis. If sickness gets more votes, creatures your opponents control get -2/-2 until end of turn. If psychosis gets more votes or the vote is tied, each opponent discards two cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Will of the council — Starting with you, each player votes for sickness or psychosis. If sickness gets more votes, creatures your opponents control get -2/-2 until end of turn. If psychosis gets more votes or the vote is tied, each opponent discards two cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Will of the council — Starting with you, each player votes for sickness or psychosis. If sickness gets more votes, creatures your opponents control get -2/-2 until end of turn. If psychosis gets more votes or the vote is tied, each opponent discards two cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Will of the council — Starting with you, each player votes for sickness or psychosis. If sickness gets more votes, creatures your opponents control get -2/-2 until end of turn. If psychosis gets more votes or the vote is tied, each opponent discards two cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Will of the council — Starting with you, each player votes for sickness or psychosis. If sickness gets more votes, creatures your opponents control get -2/-2 until end of turn. If psychosis gets more votes or the vote is tied, each opponent discards two cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[議決 ― あなたから始めて各プレイヤーは「身体疾患」または「精神疾患」のいずれかに投票する。「身体疾患」がより多くの票を得た場合、あなたの対戦相手がコントロールするクリーチャーは、ターン終了時まで-2/-2の修整を受ける。「精神疾患」がより多くの票を得た、あるいは票が同数だった場合、各対戦相手はそれぞれカードを2枚捨てる。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Will of the council — Starting with you, each player votes for sickness or psychosis. If sickness gets more votes, creatures your opponents control get -2/-2 until end of turn. If psychosis gets more votes or the vote is tied, each opponent discards two cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Will of the council — Starting with you, each player votes for sickness or psychosis. If sickness gets more votes, creatures your opponents control get -2/-2 until end of turn. If psychosis gets more votes or the vote is tied, each opponent discards two cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Will of the council — Starting with you, each player votes for sickness or psychosis. If sickness gets more votes, creatures your opponents control get -2/-2 until end of turn. If psychosis gets more votes or the vote is tied, each opponent discards two cards.]]></LOCALISED_TEXT>
<RESOLUTION_TIME_ACTION>
VXP_SetupVote()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
return VXP_ConductVoteMultipleChoice( EffectSourceLKI(), "CARD_QUERY_BLACK_ROSE_QUESTION", "CARD_QUERY_VOTE_SICKNESS", "CARD_QUERY_VOTE_PSYCHOSIS" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
VXP_TallyVotes()
-- This will show the winners along with votes for the winners (will show both in case of tie, up to card to handle ties).
VXP_ShowVoteWinners("Sickness", "Psychosis")
-- Get our winner(s) and store what we are going to do:
local tWinners = VXP_GetWinners()
if (tWinners[0] > 1) then
-- Tie, so choose option to do in case of tie.
EffectDC():Int_Set(0, 1) -- Psychosis
else
EffectDC():Int_Set(0, tWinners[1])
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
local nOption = EffectDC():Get_Int(0)
if (nOption == 1) then
-- Psychosis
local n = MTG():GetActionRepCount()
local num_Players = MTG():GetNumberOfPlayers()
if (n < num_Players) then
local player = MTG():GetNthPlayer(n)
if player:GetTeam() ~= EffectController():GetTeam() then
local filter = ClearFilter()
filter:SetZone(ZONE_HAND, player)
local numItemsToDiscard = 2
player:SetItemCount( numItemsToDiscard )
for i = 0, (numItemsToDiscard-1) do
player:SetItemPrompt( i, "CARD_QUERY_CHOOSE_CARD_TO_DISCARD" )
end
player:ChooseItems( EffectDC():Make_Targets(n+1) )
return true
else
return true
end
else
for i = 0, (num_Players-1) do
local player = MTG():GetNthPlayer(i)
if player:GetTeam() ~= EffectController():GetTeam() then
local numDiscard = EffectDC():Get_Targets(i+1):Count()
for j = 0, (numDiscard-1) do
local cardToDiscard = EffectDC():Get_Targets(i+1):Get_CardPtr(j)
cardToDiscard:Discard()
end
end
end
return false
end
else
return false
end
</RESOLUTION_TIME_ACTION>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_CONTROLLER, OP_NOT, EffectController())
</FILTER>
<CONTINUOUS_ACTION layer="7C" filter_id="0">
local nOption = EffectDC():Int_Get(0)
if (nOption == 0) and FilteredCard() ~= nil then
local characteristics = FilteredCard():GetCurrentCharacteristics()
characteristics:Power_Add( -2 )
characteristics:Toughness_Add( -2 )
end
</CONTINUOUS_ACTION>
<DURATION simple_duration="UntilEOT" />
</SPELL_ABILITY>
</CARD_V2>
Edit 3: Grudge Keeper is now tested and working here is the ability code required:
- Grudge Keeper Abilities | Open
- Code: Select all
<TRIGGERED_ABILITY linked_ability_group="1" replacement_effect="1">
<TRIGGER value="ROLLED_CHAOS" />
<RESOLUTION_TIME_ACTION>
-- Currently the voting system is set to fire ROLLED_CHAOS when tallying a vote. Hopefully no-one else is using this unused trigger.
LinkedDC():Int_Set(0, 1)
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY linked_ability_group="1">
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Whenever players finish voting, each opponent who voted for a choice you didn’t vote for loses 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Whenever players finish voting, each opponent who voted for a choice you didn’t vote for loses 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Whenever players finish voting, each opponent who voted for a choice you didn’t vote for loses 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Whenever players finish voting, each opponent who voted for a choice you didn’t vote for loses 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Whenever players finish voting, each opponent who voted for a choice you didn’t vote for loses 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[プレイヤーが投票を完了するたび、あなたと異なる選択に投票した各プレイヤーは2点のライフを失う。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Whenever players finish voting, each opponent who voted for a choice you didn’t vote for loses 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Whenever players finish voting, each opponent who voted for a choice you didn’t vote for loses 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Whenever players finish voting, each opponent who voted for a choice you didn’t vote for loses 2 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[每当所有牌手完成投票时,每位投票选择了你未投票之选项的对手各失去2点生命。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[Whenever players finish voting, each opponent who voted for a choice you didn’t vote for loses 2 life.]]></LOCALISED_TEXT>
<TRIGGER value="ABILITY_RESOLVED">
-- If the LinkedDC flag is set then we had a vote as a result of the ability that just resolved.
return LinkedDC():Int_Get(0) == 1
</TRIGGER>
<TRIGGER value="SPELL_RESOLVED">
-- If the LinkedDC flag is set then we had a vote as a result of the spell that just resolved.
return LinkedDC():Int_Get(0) == 1
</TRIGGER>
<PLAY_TIME_ACTION>
-- Reset the LinkedDC flag so that we don't do a multiple trigger by mistake.
LinkedDC():Int_Set(0, 0)
</PLAY_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
-- First we need to get the results from our controller.
local dcMyResults = VXP_GetResults( EffectController() )
local nType = VXP_GetResultsType()
if (dcMyResults ~= nil) then
-- Now we need to go through all players.
local nPlayers = MTG():GetNumberOfPlayers()
for i = 0, nPlayers - 1 do
local oPlayer = MTG():GetNthPlayer(i)
if (oPlayer:GetTeam() ~= EffectController():GetTeam()) then
-- This is an opponent we need to check their votes against ours.
local dcTheirResults = VXP_GetResults( oPlayer )
local bBadVoting = VXP_DidPlayer2VoteForSomethingPlayer1Didnt( dcMyResults, dcTheirResults, nType )
if (bBadVoting) then
-- They voted for something we didn't so deal 2 damage.
EffectSourceLKI():DealDamageTo( 2, oPlayer )
end
end
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
Edit 4: Council's Judgement is now tested and working. Here is that ability code:
- Council's Judgement ability | Open
- Code: Select all
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Will of the council — Starting with you, each player votes for a nonland permanent you don’t control. Exile each permanent with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Will of the council — Starting with you, each player votes for a nonland permanent you don’t control. Exile each permanent with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Will of the council — Starting with you, each player votes for a nonland permanent you don’t control. Exile each permanent with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Will of the council — Starting with you, each player votes for a nonland permanent you don’t control. Exile each permanent with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Will of the council — Starting with you, each player votes for a nonland permanent you don’t control. Exile each permanent with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[議決 ― あなたから始めて各プレイヤーは、あなたがコントロールしていない土地でないパーマネント1つに投票する。最多あるいは最多と同数の票を獲得した各パーマネントを追放する。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Will of the council — Starting with you, each player votes for a nonland permanent you don’t control. Exile each permanent with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Will of the council — Starting with you, each player votes for a nonland permanent you don’t control. Exile each permanent with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Will of the council — Starting with you, each player votes for a nonland permanent you don’t control. Exile each permanent with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-CN"><![CDATA[议定~由你开始,每位牌手各投票选择一个不由你操控的非地永久物。放逐票数最多或与他者同为最多的所有永久物。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="zh-HK"><![CDATA[Will of the council — Starting with you, each player votes for a nonland permanent you don’t control. Exile each permanent with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<RESOLUTION_TIME_ACTION>
VXP_SetupVote()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
-- Not controlled by you.
local oFilter = ClearFilter()
oFilter:Add( FE_CONTROLLER, OP_NOT, EffectController() )
-- Non-Land (done this way to exclude invisible tokens)
local oSubFilter = oFilter:AddSubFilter_Or()
oSubFilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
oSubFilter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
oSubFilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT )
oSubFilter:Add( FE_TYPE, OP_IS, CARD_TYPE_PLANESWALKER )
-- Do the vote.
return VXP_ConductVoteFilterSingle( "CARD_QUERY_COUNCILS_JUDGEMENT_QUESTION" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
-- This is a required step, we have to tally the votes before we do anything else.
VXP_TallyVotes()
-- This will show the winners along with votes for the winners (will show both in case of tie, up to card to handle ties).
VXP_ShowVoteWinners("Sickness", "Psychosis")
-- Get our winner(s) and exile them:
local tWinners = VXP_GetWinners()
local nNumCards = tWinners[0]
for i = 1, nNumCards do
local oCard = tWinners[i]
if (oCard ~= nil) then
oCard:Exile()
end
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
- VXP_VOTING.LOL | Open
- Code: Select all
VXP_VOTE_MODIFIER = 100011
-- This constant defines the register where we will
-- put the voting information while voting and for
-- later retrieval.
VXP_VOTE_INFO_CHEST = 100012
-- These are the Result Types:
VXP_RESULT_TYPE_ERROR = -1
VXP_RESULT_TYPE_INT = 0
VXP_RESULT_TYPE_CARD = 1
-- These are the registers used for Results
VXP_RESULT_NUM_OPTIONS = 0
VXP_RESULT_OPTIONS = 1
VXP_RESULT_TALLIES = 2
-- ////////////////////////////////////////////////
-- Vote Modifier Functions
-- ////////////////////////////////////////////////
VXP_ClearVotes = function()
EffectController():PlayerDataChest():Int_Set( VXP_VOTE_MODIFIER, 0 )
end
VXP_CreateVoteManager = function( ... )
VXP_CreateManagerToken( "VXP_TOKEN_VOTING_MANAGER" )
for _, sManagerToken in ipairs(arg) do
VXP_CreateManagerToken( sManagerToken )
end
end
VXP_CreateManagerToken = function( sToken )
if (string.len(sToken) > 0) then
local nPlayerCount = MTG():GetNumberOfPlayers()
for i = 0, (nPlayerCount - 1) do
local oPlayer = MTG():GetNthPlayer(i)
if (oPlayer ~= nil) then
local oFilter = ClearFilter()
oFilter:Add( FE_CARD_NAME, OP_IS, sToken )
oFilter:Add( FE_CONTROLLER, OP_IS, oPlayer )
if (oFilter:CountStopAt(1) < 1) then
MTG():PutTokensOntoBattlefield( sToken, 1, oPlayer, EffectDC():Make_Chest(0) )
end
end
end
end
end
-- This allows for using a unified call for
-- incrementing the votes for a player regardless
-- of whether it is for the Effectcontroller() or
-- another player.
VXP_IncrementVotes = function( oPlayer )
if (oPlayer == nil) then
oPlayer = EffectController()
end
oPlayer:PlayerDataChest():Int_Inc( VXP_VOTE_MODIFIER )
end
-- This is the first function called in any vote
-- ability and it needs to be in a non-repeating
-- RESOLUTION_TIME_ACTION.
VXP_SetupVote = function()
-- Since we are setting up we should clear any previous info, if any.
VXP_Internal_ClearVoteInfo()
-- Get our global vote info chest.
local dcVoteInfo = VXP_Internal_GetVoteInfoChest()
-- Make a chest for the player pointers
local dcPlayers = dcVoteInfo:Make_Chest(1)
local nPlayers = MTG():GetNumberOfPlayers()
local nVoteIndex = 0
-- Loop through all players in order
for nPlayer = 0, nPlayers - 1 do
local oPlayer = MTG():GetNthPlayer(nPlayer)
-- Get additional votes (if any)
local nVotes = oPlayer:PlayerDataChest():Int_Get( VXP_VOTE_MODIFIER )
-- Loop through all votes (to setup voting queue).
for nVote = 0, nVotes do
-- Store the player that gets this vote.
dcPlayers:Set_PlayerPtr(nVoteIndex, oPlayer)
-- Increment vote index so we don't overwrite any.
nVoteIndex = nVoteIndex + 1
end
end
-- We have now cycled through all players and setup when
-- they are going to vote and how many votes they get so
-- now we need to store how many votes we need to conduct.
dcVoteInfo:Int_Set(0, nVoteIndex)
-- Make our voting chest (we don't need the pointer now just need to create it)
dcVoteInfo:Make_Chest(2)
end
-- //// For Multiple Choice Votes Only ////
-- This function is the meat of the voting and should be
-- called from within a repeating RESOLUTION_TIME_ACTION
-- with the return value being used to determine whether
-- we should continue to repeat or not.
VXP_ConductVoteMultipleChoice = function( oSource, sQuestion, ... )
local n = MTG():GetActionRepCount()
local dcVoteInfo = VXP_Internal_GetVoteInfoChest()
-- Get our voting information from the Vote Info chest
local nNumVotes = dcVoteInfo:Int_Get(0)
local dcPlayers = dcVoteInfo:Get_Chest(1)
local dcVotes = dcVoteInfo:Get_Chest(2)
-- If this is not the first rep then we need to record a vote
if (n > 0) then
local nVoteIndex = n - 1
local oVotePlayer = dcPlayers:Get_PlayerPtr(nVoteIndex)
dcVotes:Int_Set(nVoteIndex, oVotePlayer:GetMultipleChoiceResult())
end
-- Now we check to see if we should continue.
if (n >= nNumVotes) then
-- Nope, we already recorded our last vote so end.
return false
end
-- If we got to here then we need to ask a player a question.
-- We can also use this opportunity to record how many total
-- options we have for later use.
local nOptions = 0
local oPlayer = dcPlayers:Get_PlayerPtr(n)
oPlayer:BeginNewMultipleChoice()
for _, sAnswer in ipairs(arg) do
nOptions = nOptions + 1
oPlayer:AddMultipleChoiceAnswer(sAnswer)
end
dcVoteInfo:Int_Set(4, nOptions)
oPlayer:AskMultipleChoiceQuestion(sQuestion, oSource)
-- We want to continue this repeating action.
return true
end
-- //// For Single Card Choice Votes Only ////
-- This function is the meat of the voting and should be
-- called from within a repeating RESOLUTION_TIME_ACTION
-- with the return value being used to determine whether
-- we should continue to repeat or not.
-- ADDITIONAL NOTE: This requires a filter to be defined
-- before this function is called. This also give the
-- function better general use as there is no need to
-- make separate functions for each card just define a
-- different filter for each card.
VXP_ConductVoteFilterSingle = function( sQuestion )
local n = MTG():GetActionRepCount()
local dcVoteInfo = VXP_Internal_GetVoteInfoChest()
-- Get our voting information from the Vote Info chest
local nNumVotes = dcVoteInfo:Int_Get(0)
local dcPlayers = dcVoteInfo:Get_Chest(1)
local dcVotes = dcVoteInfo:Get_Chest(2)
-- If this is not the first rep then we need to record a vote
if (n > 0) then
local nVoteIndex = n - 1
local oVotePlayer = dcPlayers:Get_PlayerPtr(nVoteIndex)
dcVotes:Set_CardPtr(nVoteIndex, dcVoteInfo:Get_Targets(6):Get_CardPtr(0))
end
-- Now we check to see if we should continue.
if (n >= nNumVotes) then
-- Nope, we already recorded our last vote so end.
return false
end
-- If we got to here then we need to ask a player a question.
-- We can also use this opportunity to record how many total
-- options we have for later use.
local oPlayer = dcPlayers:Get_PlayerPtr(n)
oPlayer:ChooseItem(sQuestion, dcVoteInfo:Make_Targets(6))
-- We want to continue this repeating action.
return true
end
-- This function will tally up our votes in a unified way
-- so that we can get and provide the information to
-- support cards like Grudge Keeper.
VXP_TallyVotes = function()
-- Get the Voting Info chest
local dcVoteInfo = VXP_Internal_GetVoteInfoChest()
-- Get variables from Voting Info
local nNumVotes = dcVoteInfo:Int_Get(0)
local dcPlayers = dcVoteInfo:Get_Chest(1)
local dcVotes = dcVoteInfo:Get_Chest(2)
local nOptions = dcVoteInfo:Int_Get(4)
-- Determine the type of results we will be recording.
local nResultType = VXP_Internal_DetermineResultType( dcVotes )
-- Setup the Results chest.
local dcResults = dcVoteInfo:Make_Chest(3)
VXP_Internal_SetupResults( dcResults, nResultType )
-- Loop through our votes.
for nVote = 0, nNumVotes-1 do
-- Record each individual vote in our results.
VXP_Internal_RecordVote( nVote, dcVotes, dcPlayers, dcResults, nOptions )
end
MTG():FireTrigger( TRIGGER_ROLLED_CHAOS, EffectSourceLKI() )
end
-- This function gets a results chest either a chest
-- for a specific player or the simple results if
-- no player is specified.
VXP_GetResults = function( oPlayer )
-- Setup our default return in case something goes wrong.
-- Otherwise this will become a pointer to the correct
-- chest with the appropriate results.
local dcReturn = nil
-- Get the Voting Info chest
local dcVoteInfo = VXP_Internal_GetVoteInfoChest()
if (dcVoteInfo ~= nil) then
local dcResults = dcVoteInfo:Get_Chest(3)
if (dcResults ~= nil) then
-- Now we have verified that we have a good chest.
-- So now we can get the chest we want.
if (oPlayer == nil) then
-- Simple Results.
dcReturn = dcResults:Get_Chest(1)
else
-- Player Results.
local dcIndPlayerResults = dcResults:Get_Chest(2)
if (dcIndPlayerResults ~= nil) then
local nIndex = 0
local dcPlayerResults = dcIndPlayerResults:Get_Chest(nIndex)
while (dcPlayerResults ~= nil) do
if (dcPlayerResults:Get_PlayerPtr(0) == oPlayer) then
dcReturn = dcPlayerResults:Get_Chest(1)
break
end
nIndex = nIndex + 1
dcPlayerResults = dcIndPlayerResults:Get_Chest(nIndex)
end
end
end
end
end
return dcReturn
end
VXP_GetResultsType = function()
local nType = VXP_RESULT_TYPE_ERROR
-- Get the Voting Info chest
local dcVoteInfo = VXP_Internal_GetVoteInfoChest()
if (dcVoteInfo ~= nil) then
local dcResults = dcVoteInfo:Get_Chest(3)
if (dcResults ~= nil) then
nType = dcResults:Int_Get(0)
end
end
return nType
end
-- This function will return a table with index 0
-- holding the number of winners and subsequent
-- indexes holding the winning options.
-- Cards should already know whether these are ints
-- or card pointers so there should be no need to
-- pass back the type or for the card to call
-- VXP_GetResultsType()
VXP_GetWinners = function()
local nType = VXP_GetResultsType()
local dcResults = VXP_GetResults()
local nMaxVotes = 0
local nOptions = 0
local tWinners = {}
tWinners[0] = 0
if (dcResults ~= nil) and (nType ~= VXP_RESULT_TYPE_ERROR) then
local dcOptions = dcResults:Get_Chest(VXP_RESULT_OPTIONS)
local dcTally = dcResults:Get_Chest(VXP_RESULT_TALLIES)
if (dcOptions ~= nil) and (dcTally ~= nil) then
-- First we loop through to find the highest number of votes.
if (nType ~= VXP_RESULT_TYPE_CARD) then
-- We have a valid number of options that we can read.
nOptions = dcResults:Int_Get(VXP_RESULT_NUM_OPTIONS)
-- Now we loop to actually find the highest number of votes.
for i = 0, nOptions - 1 do
if (dcTally:Int_Get(i) > nMaxVotes) then
nMaxVotes = dcTally:Int_Get(i)
end
end
-- Now we have the max number of votes so find all
-- items that have that max.
for i = 0, nOptions - 1 do
if (dcTally:Int_Get(i) == nMaxVotes) then
-- Int type so index equals option.
tWinners[0] = tWinners[0] + 1
tWinners[tWinners[0]] = i
end
end
else
-- Card type so we don't have a valid number of options or associated text.
-- We still need to loop through once to get the max number of votes.
while (dcOptions:Get_CardPtr(nOptions) ~= nil) do
if (dcTally:Int_Get(nOptions) > nMaxVotes) then
nMaxVotes = dcTally:Int_Get(nOptions)
end
nOptions = nOptions + 1
end
-- Now we get our winners (cards that have max number of votes).
-- Though now we also have a valid max number of options.
for i = 0, nOptions - 1 do
if (dcTally:Int_Get(i) == nMaxVotes) then
-- Card type so we store the card pointer.
tWinners[0] = tWinners[0] + 1
tWinners[tWinners[0]] = dcOptions:Get_CardPtr(i)
end
end
end
end
end
return tWinners
end
-- This function is designed to show the options in
-- the vote that either got the most votes or tied
-- for first place.
VXP_ShowVoteWinners = function( ... )
local nType = VXP_GetResultsType()
local dcResults = VXP_GetResults()
local nMaxVotes = 0
local nOptions = 0
local nWinners = 0
local tOptions = {}
local tWinners = {}
if (dcResults ~= nil) and (nType ~= VXP_RESULT_TYPE_ERROR) then
local dcOptions = dcResults:Get_Chest(VXP_RESULT_OPTIONS)
local dcTally = dcResults:Get_Chest(VXP_RESULT_TALLIES)
if (dcOptions ~= nil) and (dcTally ~= nil) then
-- First we loop through to find the highest number of votes.
if (nType ~= VXP_RESULT_TYPE_CARD) then
-- We have a valid number of options that we can read.
nOptions = dcResults:Int_Get(VXP_RESULT_NUM_OPTIONS)
-- Since we are dealing with an Int type then we should have text associated with those options.
-- Store our text.
local nOption = 0
for _, sText in ipairs(arg) do
tOptions[nOption] = sText
nOption = nOption + 1
end
-- Now we loop to actually find the highest number of votes.
for i = 0, nOptions - 1 do
if (dcTally:Int_Get(i) > nMaxVotes) then
nMaxVotes = dcTally:Int_Get(i)
end
end
-- Now we have the max number of votes so find all
-- items that have that max.
for i = 0, nOptions - 1 do
if (dcTally:Int_Get(i) == nMaxVotes) then
-- Int type so store the text we were given.
tWinners[nWinners] = tOptions[i]
nWinners = nWinners + 1
end
end
else
-- Card type so we don't have a valid number of options or associated text.
-- We still need to loop through once to get the max number of votes.
while (dcOptions:Get_CardPtr(nOptions) ~= nil) do
if (dcTally:Int_Get(nOptions) > nMaxVotes) then
nMaxVotes = dcTally:Int_Get(nOptions)
end
nOptions = nOptions + 1
end
-- Now we get our winners (cards that have max number of votes).
-- Though now we also have a valid max number of options.
for i = 0, nOptions - 1 do
if (dcTally:Int_Get(i) == nMaxVotes) then
-- Card type so we store card name.
tWinners[nWinners] = dcOptions:Get_CardPtr(i) and dcOptions:Get_CardPtr(i):GetCardName()
nWinners = nWinners + 1
end
end
end
-- By this point we should have a number of winners and their
-- stored text along with the max number of votes. Time to
-- construct our string and display it.
local sWinnerText = ""
for i = 0, nWinners - 1 do
if (string.len(sWinnerText) > 0) then
sWinnerText = sWinnerText .. " and "
end
sWinnerText = sWinnerText .. tWinners[i]
end
-- Now we add "has/have won the vote with X".
if (nWinners > 1) then
sWinnerText = sWinnerText .. " have tied the vote for the win with " .. nMaxVotes
else
sWinnerText = sWinnerText .. " has won the vote with " .. nMaxVotes
end
-- Now we add " vote(s)".
if (nMaxVotes > 1) then
sWinnerText = sWinnerText .. " votes."
else
sWinnerText = sWinnerText .. " vote."
end
-- Now that we have finished constructing our string, show it.
MTG():MessageAllPlayers(sWinnerText)
end
end
end
-- This function basically compares two result sets
-- looking to see if the second set has a vote for
-- something the first set doesn't have. I just
-- couldn't really think of a good name for this
-- function so it got this monstrosity.
VXP_DidPlayer2VoteForSomethingPlayer1Didnt = function( dcResults1, dcResults2, nType )
-- We want to be kind if we don't have all the information we need.
local bResult = false
if (dcResults1 ~= nil) and (dcResults2 ~= nil) then
if (nType == VXP_RESULT_TYPE_INT) then
-- Since this is an int type we need to look at
-- all of the tallies to see if any of them are
-- greater than 0 then check if player 1 voted
-- for that option.
local dcTallies = dcResults2:Get_Chest(VXP_RESULT_TALLIES)
if (dcTallies ~= nil) then
local nNumOptions = dcResults2:Int_Get(VXP_RESULT_NUM_OPTIONS)
for i = 0, nNumOptions - 1 do
if (dcTallies:Int_Get(i) > 0) then
if (not VXP_IsOptionInResultSet(dcResults1, i, nType)) then
bResult = true
break
end
end
end
end
elseif (nType == VXP_RESULT_TYPE_CARD) then
-- This one is fairly easy we loop through all
-- options in dcResults2 until we hit a nil or
-- one not in dcResults1.
local dcOptions = dcResults2:Get_Chest(VXP_RESULT_OPTIONS)
if (dcOptions ~= nil) then
local nIndex = 0
local oCard = dcOptions:Get_CardPtr(nIndex)
while (oCard ~= nil) do
if (not VXP_IsOptionInResultSet(dcResults1, oCard, nType)) then
bResult = true
break
end
nIndex = nIndex + 1
oCard = dcOptions:Get_CardPtr(nIndex)
end
end
end
end
return bResult
end
-- This function simply looks to see if an option
-- of a given type is in a given result set.
VXP_IsOptionInResultSet = function( dcResults, vOption, nType )
local bResult = false
-- Make sure we have a valid chest.
if (dcResults ~= nil) then
if (nType == VXP_RESULT_TYPE_INT) then
-- This is an int type so we can do a simple compare.
local dcTally = dcResults:Get_Chest(VXP_RESULT_TALLIES)
if (dcTally:Get_Int(vOption) > 0) then
-- Yep, it's in there so report we found it.
bResult = true
end
elseif (nType == VXP_RESULT_TYPE_CARD) then
-- We look through options until we hit a nil.
local dcOptions = dcResults:Get_Chest(VXP_RESULT_OPTIONS)
if (dcOptions ~= nil) then
local nIndex = 0
local oCard = dcOptions:Get_CardPtr(nIndex)
while (oCard ~= nil) do
if (oCard == vOption) then
bResult = true
break
end
nIndex = nIndex + 1
oCard = dcOptions:Get_CardPtr(nIndex)
end
end
end
end
return bResult
end
-- ////////////////////////////////////////////////
-- Internal Functions (not used by cards directly)
-- ////////////////////////////////////////////////
-- This function is used to clear all chests and
-- registers associated with voting to make sure
-- we start off with a clean slate now that we are
-- no longer using the EffectDC().
VXP_Internal_ClearVoteInfo = function()
local dcChest = MTG():DuelDataChest():Get_Chest( VXP_VOTE_INFO_CHEST )
-- Only clear it if it exists.
if (dcChest ~= nil) then
dcChest:Clear()
end
end
-- This function will figure out what type of votes
-- we received from the conduct voting function.
VXP_Internal_DetermineResultType = function( dcVotes )
-- We will assume integer results as the default.
local nResultType = VXP_RESULT_TYPE_INT
-- Do we have a valid card pointer?
if (dcVotes:Get_CardPtr(0) ~= nil) then
nResultType = VXP_RESULT_TYPE_CARD
end
-- Return our results.
return nResultType
end
-- This gets the chest where we will be storing
-- all of our vote data and if it doesn't already
-- exist we create it.
VXP_Internal_GetVoteInfoChest = function()
local dcChest = MTG():DuelDataChest():Get_Chest( VXP_VOTE_INFO_CHEST )
-- If the chest doesn't exist create it.
if (dcChest == nil) then
dcChest = MTG():DuelDataChest():Make_Chest( VXP_VOTE_INFO_CHEST )
end
-- Now return the chest we found or created.
return dcChest
end
VXP_Internal_RecordVote = function( nVote, dcVotes, dcPlayers, dcResults, nOptions )
local nType = dcResults:Int_Get(0)
local dcSimpleResults = dcResults:Get_Chest(1)
local dcIndPlayerResults = dcResults:Get_Chest(2)
local oPlayer = dcPlayers:Get_PlayerPtr(nVote)
local vVote = nil
-- Now get our vote.
if (nType == VXP_RESULT_TYPE_CARD) then
vVote = dcVotes:Get_CardPtr( nVote )
elseif (nType == VXP_RESULT_TYPE_PLAYER) then
vVote = dcVotes:Get_PlayerPtr( nVote )
else
vVote = dcVotes:Int_Get( nVote )
end
-- Store our vote in the Simple Results.
VXP_Internal_StoreVote( dcSimpleResults, nType, vVote, nOptions )
-- First we find the player's result chest.
local dcPlayerResults = nil
local bFound = false
local nIndex = 0
local dcChest = dcIndPlayerResults:Get_Chest( nIndex )
while (dcChest ~= nil) do
if (dcChest:Get_PlayerPtr(0) == oPlayer) then
-- Found the chest.
dcPlayerResults = dcChest:Get_Chest(1)
bFound = true
break
end
-- Not found yet look at next chest.
nIndex = nIndex + 1
dcChest = dcIndPlayerResults:Get_Chest( nIndex )
end
if (not bfound) then
-- Did not find the player's chest so we need to create it.
dcChest = dcIndPlayerResults:Make_Chest( nIndex )
dcChest:Set_PlayerPtr( 0, oPlayer )
dcPlayerResults = dcChest:Make_Chest(1)
end
-- Now we need to store vote in the individual player results.
VXP_Internal_StoreVote( dcPlayerResults, nType, vVote, nOptions )
end
-- This creates our results structure.
VXP_Internal_SetupResults = function( dcResults, nType )
-- Record our type.
dcResults:Int_Set( 0, nType )
-- Create the chest for Simple Results.
dcResults:Make_Chest( 1 )
-- Create the chest for individual player results.
dcResults:Make_Chest( 2 )
end
-- This stores a single vote in a result chest.
VXP_Internal_StoreVote = function( dcResult, nType, vVote, nOptions )
local nOption = 0
-- Store how many options we have (only valid for Int type).
dcResult:Int_Set(VXP_RESULT_NUM_OPTIONS, nOptions)
-- Get options chest.
local dcOptions = dcResult:Get_Chest(VXP_RESULT_OPTIONS)
if (dcOptions == nil) then
dcOptions = dcResult:Make_Chest(VXP_RESULT_OPTIONS)
end
-- Get tally chest.
local dcTally = dcResult:Get_Chest(VXP_RESULT_TALLIES)
if (dcTally == nil) then
dcTally = dcResult:Make_Chest(VXP_RESULT_TALLIES)
end
-- Find the option.
local bFound = false
local nIndex = 0
if (nType == VXP_RESULT_TYPE_CARD) then
-- We need to loop through all currently existing
-- vote options to see if there is a match.
local oCard = dcOptions:Get_CardPtr( nIndex )
while (oCard ~= nil) do
if (oCard == vVote) then
-- We found a match.
bFound = true
break
end
-- No match yet, go to next option.
nIndex = nIndex + 1
oCard = dcOptions:Get_CardPtr( nIndex )
end
-- We did not find a match so this is a new option.
if (not bFound) then
dcOptions:Set_CardPtr( nIndex, vVote )
-- Protect the pointer in case card changes zones as a result of vote.
dcOptions:Protect_CardPtr( nIndex )
end
-- Set our Option index.
nOption = nIndex
else
dcOptions:Int_Set( vVote, vVote )
nOption = vVote
end
-- Increment the number of votes for this option.
dcTally:Int_Inc( nOption )
end
What you do with it now is up to you. Note that this version is not compatible with the code that we have worked with up to this point, so to use the new version the other cards will need to be converted to this version.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: Will of the Council
by gorem2k » 18 Aug 2014, 16:26
that's insane, that LOL all that just for council cards, but nice work
Re: Will of the Council
by RiiakShiNal » 18 Aug 2014, 23:22
There's that much because the solution has to be generic enough to work with all vote cards and Grudge Keeper, yet simple enough so that it can be used easily (if it's too much work to use modders aren't going to use it). If you don't take into account the differences between integers and cards (mainly the functions used to access them from data chests) it won't work right.
Plus, I put in quite a few comments as I went along.
Edit: Looking at it now, it's actually the longest LOL file I've written to this point. Even longer than Manual Mana. Though there are a lot more comments in this LOL than in Manual Mana and this one doesn't require another functions file whereas Manual Mana requires ObjectDC.
Plus, I put in quite a few comments as I went along.
Edit: Looking at it now, it's actually the longest LOL file I've written to this point. Even longer than Manual Mana. Though there are a lot more comments in this LOL than in Manual Mana and this one doesn't require another functions file whereas Manual Mana requires ObjectDC.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: Will of the Council
by volrathxp » 19 Aug 2014, 02:17
Just got home! So I will start looking at this soon here. lol.RiiakShiNal wrote:There's that much because the solution has to be generic enough to work with all vote cards and Grudge Keeper, yet simple enough so that it can be used easily (if it's too much work to use modders aren't going to use it). If you don't take into account the differences between integers and cards (mainly the functions used to access them from data chests) it won't work right.
Plus, I put in quite a few comments as I went along.
Edit: Looking at it now, it's actually the longest LOL file I've written to this point. Even longer than Manual Mana. Though there are a lot more comments in this LOL than in Manual Mana and this one doesn't require another functions file whereas Manual Mana requires ObjectDC.
Okay so here's where I'm at with converting the existing cards. The only one I haven't done yet is Council Guardian. Just need a spot check to make sure I understood how to convert these over.
- Coercive Portal | Open
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="COERCIVE_PORTAL_1000382231" />
<CARDNAME text="COERCIVE_PORTAL" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[強制の門]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="1000382231" />
<ARTID value="1000382231" />
<ARTIST name="Yeong-Hao Han" />
<CASTING_COST cost="{4}" />
<TYPE metaname="Artifact" />
<EXPANSION value="CNS" />
<RARITY metaname="M" />
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[議決 ― あなたのアップキープの開始時に、あなたから始めて各プレイヤーは「殺戮」または「忠誠」のいずれかに投票する。「殺戮」がより多くの票を得た場合、強制の門を生け贄に捧げ、すべての土地でないパーマネントを破壊する。「忠誠」がより多くの票を得た、あるいは票が同数だった場合、カードを1枚引く。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
return MTG():GetStep() == STEP_UPKEEP
</TRIGGER>
<RESOLUTION_TIME_ACTION>
VXP_SetupVote()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
return VXP_ConductVoteMultipleChoice( EffectSourceLKI(), "CARD_QUERY_COERCIVE_PORTAL_QUESTION", "CARD_QUERY_VOTE_CARNAGE", "CARD_QUERY_VOTE_HOMAGE" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
VXP_TallyVotes()
-- This will show the winners along with votes for the winners (will show both in case of tie, up to card to handle ties).
VXP_ShowVoteWinners("Carnage", "Homage")
-- Get our winner(s) and store what we are going to do:
local tWinners = VXP_GetWinners()
if (tWinners[0] > 1) then
-- Tie, so choose option to do in case of tie.
EffectDC():Int_Set(0, 1) -- Homage
else
EffectDC():Int_Set(0, tWinners[1])
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local nOption = EffectDC():Get_Int(0)
if (nOption == 1) then
-- Homage
EffectController():DrawCards(1)
end
</RESOLUTION_TIME_ACTION>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_NOT, CARD_TYPE_LAND )
filter:Add( FE_IS_PERMANENT, true )
</FILTER>
<RESOLUTION_TIME_ACTION filter_id="0">
local nOption = EffectDC():Int_Get(0)
if (nOption == 0) and FilteredCard() ~= nil then
EffectController():Sacrifice( EffectSource() )
FilteredCard():Destroy()
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
</CARD_V2>
- Magister of Worth | Open
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="MAGISTER_OF_WORTH_1000382300" />
<CARDNAME text="MAGISTER_OF_WORTH" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[真価の宗匠]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="1000382300" />
<ARTID value="1000382300" />
<ARTIST name="John Stanko" />
<CASTING_COST cost="{4}{W}{B}" />
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Angel" />
<EXPANSION value="CNS" />
<RARITY metaname="R" />
<POWER value="4" />
<TOUGHNESS value="4" />
<STATIC_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Vol]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Vuela.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fliegend]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Volare]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[飛行]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[비행]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Полет]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Voar]]></LOCALISED_TEXT>
<INTRINSIC characteristic="CHARACTERISTIC_FLYING" />
</STATIC_ABILITY>
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[議決 ― 真価の宗匠が戦場に出たとき、あなたから始めて各プレイヤーは「恩寵」または「糾弾」のいずれかに投票する。「恩寵」がより多くの票を得た場合、各プレイヤーはそれぞれ、自分の墓地にある各クリーチャー・カードを戦場に戻す。「糾弾」がより多くの票を得た、あるいは票が同数だった場合、真価の宗匠以外のすべてのクリーチャーを破壊する。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION>
VXP_SetupVote()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
return VXP_ConductVoteMultipleChoice( EffectSourceLKI(), "CARD_QUERY_MAGISTER_QUESTION", "CARD_QUERY_VOTE_GRACE", "CARD_QUERY_VOTE_CONDEMN" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
VXP_TallyVotes()
-- This will show the winners along with votes for the winners (will show both in case of tie, up to card to handle ties).
VXP_ShowVoteWinners("Grace", "Condemnation")
-- Get our winner(s) and store what we are going to do:
local tWinners = VXP_GetWinners()
if (tWinners[0] > 1) then
-- Tie, so choose option to do in case of tie.
EffectDC():Int_Set(0, 1) -- Condemnation
else
EffectDC():Int_Set(0, tWinners[1])
end
</RESOLUTION_TIME_ACTION>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_CARD_INSTANCE, OP_NOT, EffectSource() )
</FILTER>
<RESOLUTION_TIME_ACTION filter_id="0">
local nOption = EffectDC():Get_Int(0)
if (nOption == 1) then
if FilteredCard() ~= nil then
FilteredCard():Destroy()
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
local nOption = EffectDC():Get_Int(0)
if (nOption == 0) then
local n = MTG():GetActionRepCount()
local num_Players = MTG():GetNumberOfPlayers()
if (n < num_Players) then
local player = MTG():GetNthPlayer(n)
local filter = ClearFilter()
filter:SetZone( ZONE_GRAVEYARD )
filter:Add(FE_CONTROLLER, OP_IS, player)
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
player:SetItemCount( 1 )
for i = 0, (1-1) do
player:SetItemPrompt( i, "CARD_QUERY_CHOOSE_CREATURE_TO_PUT_INTO_PLAY" )
end
player:ChooseItems( EffectDC():Make_Targets(n+1) )
return true
else
for i = 0, (num_Players-1) do
local player = MTG():GetNthPlayer(i)
local numBounce = EffectDC():Get_Targets(i+1):Count()
for j = 0, (numBounce-1) do
local cardToBounce = EffectDC():Get_Targets(i+1):Get_CardPtr(j)
cardToBounce:PutOntoBattlefield( cardToBounce:GetOwner() )
end
end
return false
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
<SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
<SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
- Plea for Power | Open
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="PLEA_FOR_POWER_1000382329" />
<CARDNAME text="PLEA_FOR_POWER" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[権力への嘆願]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="1000382329" />
<ARTID value="1000382329" />
<ARTIST name="John Severin Brassell" />
<CASTING_COST cost="{3}{U}" />
<TYPE metaname="Sorcery" />
<EXPANSION value="CNS" />
<RARITY metaname="R" />
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[議決 ― あなたから始めて各プレイヤーは「時間」または「知識」のいずれかに投票する。「時間」がより多くの票を得た場合、あなたはこのターンの後に追加のターンを行う。「知識」がより多くの票を得た、あるいは票が同数だった場合、カードを3枚引く。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<RESOLUTION_TIME_ACTION>
VXP_SetupVote()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
return VXP_ConductVoteMultipleChoice( EffectSourceLKI(), "CARD_QUERY_PLEA_QUESTION", "CARD_QUERY_VOTE_TIME", "CARD_QUERY_VOTE_KNOWLEDGE" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
VXP_TallyVotes()
-- This will show the winners along with votes for the winners (will show both in case of tie, up to card to handle ties).
VXP_ShowVoteWinners("Time", "Knowledge")
-- Get our winner(s) and store what we are going to do:
local tWinners = VXP_GetWinners()
if (tWinners[0] > 1) then
-- Tie, so choose option to do in case of tie.
EffectDC():Int_Set(0, 1) -- Psychosis
else
EffectDC():Int_Set(0, tWinners[1])
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local nOption = EffectDC():Get_Int(0)
if (nOption == 1) then
-- Knowledge
EffectController():DrawCards(3)
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local nOption = EffectDC():Get_Int(0)
if (nOption == 0) then
EffectController():GetTeam():TakeExtraTurn()
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
</CARD_V2>
- Split Decision | Open
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="SPLIT_DECISION_1000382371" />
<CARDNAME text="SPLIT_DECISION" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Split Decision]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Split Decision]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Split Decision]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Split Decision]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Split Decision]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[分割判定]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Split Decision]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Split Decision]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Split Decision]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="1000382371" />
<ARTID value="1000382371" />
<ARTIST name="Robbie Trevino" />
<CASTING_COST cost="{1}{U}" />
<TYPE metaname="Instant" />
<EXPANSION value="CNS" />
<RARITY metaname="U" />
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[議決 ― インスタント呪文またはソーサリー呪文を1つ対象として選ぶ。あなたから始めて各プレイヤーは「否定」または「複製」のいずれかに投票する。「否定」がより多くの票を得た場合、その呪文を打ち消す。「複製」がより多くの票を得た、あるいは票が同数だった場合、その呪文をコピーする。あなたはそのコピーの新しい対象を選んでもよい。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<TARGET tag="CARD_QUERY_CHOOSE_SPELL" definition="5" compartment="5" count="1" />
<TARGET_DEFINITION id="5">
local filter = ClearFilter()
local subfilter = filter:AddSubFilter_Or()
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_INSTANT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_SORCERY )
filter:SetZone( ZONE_STACK )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
VXP_SetupVote()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
return VXP_ConductVoteMultipleChoice( EffectSourceLKI(), "CARD_QUERY_SPLIT_QUESTION", "CARD_QUERY_VOTE_DENIAL", "CARD_QUERY_VOTE_DUPE" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
VXP_TallyVotes()
-- This will show the winners along with votes for the winners (will show both in case of tie, up to card to handle ties).
VXP_ShowVoteWinners("Denial", "Duplication")
-- Get our winner(s) and store what we are going to do:
local tWinners = VXP_GetWinners()
if (tWinners[0] > 1) then
-- Tie, so choose option to do in case of tie.
EffectDC():Int_Set(0, 1) -- Psychosis
else
EffectDC():Int_Set(0, tWinners[1])
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local nOption = EffectDC():Get_Int(0)
if (nOption == 1) then
-- Duplication
local target = EffectDC():Get_Targets(5):Get_CardPtr(0)
local effectController = EffectController()
if target ~= nil then
local copy = effectController:CopySpell( target )
effectController:ChooseNewTargets( copy)
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local nOption = EffectDC():Get_Int(0)
if (nOption == 0) then
local target = EffectDC():Get_Targets(5):Get_CardPtr(0)
if target ~= nil then
target:CounterSpell()
end
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
</CARD_V2>
- Tyrant's Choice | Open
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="TYRANTS_CHOICE_1000382391" />
<CARDNAME text="TYRANTS_CHOICE" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[暴君の選択]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="1000382391" />
<ARTID value="1000382391" />
<ARTIST name="Daarken" />
<CASTING_COST cost="{1}{B}" />
<TYPE metaname="Sorcery" />
<EXPANSION value="CNS" />
<RARITY metaname="C" />
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[議決 ― あなたから始めて各プレイヤーは「死」または「拷問」のいずれかに投票する。「死」がより多くの票を得た場合、各対戦相手はそれぞれクリーチャーを1体生け贄に捧げる。「拷問」がより多くの票を得た、あるいは票が同数だった場合、各対戦相手はそれぞれ4点のライフを失う。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<RESOLUTION_TIME_ACTION>
VXP_SetupVote()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
return VXP_ConductVoteMultipleChoice( EffectSourceLKI(), "CARD_QUERY_TYRANTS_CHOICE_QUESTION", "CARD_QUERY_VOTE_DEATH", "CARD_QUERY_VOTE_TORTURE" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
VXP_TallyVotes()
-- This will show the winners along with votes for the winners (will show both in case of tie, up to card to handle ties).
VXP_ShowVoteWinners("Death", "Torture")
-- Get our winner(s) and store what we are going to do:
local tWinners = VXP_GetWinners()
if (tWinners[0] > 1) then
-- Tie, so choose option to do in case of tie.
EffectDC():Int_Set(0, 1) -- Psychosis
else
EffectDC():Int_Set(0, tWinners[1])
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local nOption = EffectDC():Get_Int(0)
if (nOption == 1) then
local number = MTG():GetNumberOfPlayers()
for i = 0, (number-1) do
local player = MTG():GetNthPlayer(i)
if player:GetTeam() ~= EffectController():GetTeam() then
player:LoseLife(4)
end
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
local nOption = EffectDC():Get_Int(0)
if (nOption == 0) then
local n = MTG():GetActionRepCount()
local num_players = MTG():GetNumberOfPlayers()
if n < num_players then
local player = MTG():GetNthPlayer(n)
if player ~= nil and player:GetTeam() ~= EffectController():GetTeam() then
local filter = ClearFilter()
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
filter:Add(FE_CONTROLLER, OP_IS, player)
if filter:CountStopAt(1) == 1 then
player:ChooseItem( "CHOOSE_A_CREATURE_TO_SACRIFICE", EffectDC():Make_Targets(n) )
end
end
return true
else
for i=0,num_players-1 do
local player = MTG():GetNthPlayer(i)
if player ~= nil and player:GetTeam() ~= EffectController():GetTeam() then
local creature = EffectDC():Get_Targets(i) and EffectDC():Get_Targets(i):Get_CardPtr(0)
if creature ~= nil then
MTG():GetNthPlayer(i):Sacrifice(creature)
end
end
end
end
return false
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
</CARD_V2>
volrathxp
Re: Will of the Council
by gorem2k » 19 Aug 2014, 12:36
I don't really know how to get the 4-colors results in Council Guardian. Other than that, I understand the two-choices cards.
And for some reason, the AI will always pick the same color I choose when I have Grudge Keeper in play. Is this coincidence or just him being a nifty cheater?
And for some reason, the AI will always pick the same color I choose when I have Grudge Keeper in play. Is this coincidence or just him being a nifty cheater?
Re: Will of the Council
by RiiakShiNal » 19 Aug 2014, 23:22
For the most part they look fine, Magister of Worth looks a bit odd because even though it says "each player returns each creature" (which means "affect all") you are having the players choose. There shouldn't be a choice of which creatures to bring back, they all come back.volrathxp wrote:Okay so here's where I'm at with converting the existing cards. The only one I haven't done yet is Council Guardian. Just need a spot check to make sure I understood how to convert these over.
- Coercive Portal | Open
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="COERCIVE_PORTAL_1000382231" />
<CARDNAME text="COERCIVE_PORTAL" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[強制の門]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Coercive Portal]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="1000382231" />
<ARTID value="1000382231" />
<ARTIST name="Yeong-Hao Han" />
<CASTING_COST cost="{4}" />
<TYPE metaname="Artifact" />
<EXPANSION value="CNS" />
<RARITY metaname="M" />
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[議決 ― あなたのアップキープの開始時に、あなたから始めて各プレイヤーは「殺戮」または「忠誠」のいずれかに投票する。「殺戮」がより多くの票を得た場合、強制の門を生け贄に捧げ、すべての土地でないパーマネントを破壊する。「忠誠」がより多くの票を得た、あるいは票が同数だった場合、カードを1枚引く。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Will of the council — At the beginning of your upkeep, starting with you, each player votes for carnage or homage. If carnage gets more votes, sacrifice Coercive Portal and destroy all nonland permanents. If homage gets more votes or the vote is tied, draw a card.]]></LOCALISED_TEXT>
<TRIGGER value="BEGINNING_OF_PLAYERS_STEP" simple_qualifier="controller">
return MTG():GetStep() == STEP_UPKEEP
</TRIGGER>
<RESOLUTION_TIME_ACTION>
VXP_SetupVote()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
return VXP_ConductVoteMultipleChoice( EffectSourceLKI(), "CARD_QUERY_COERCIVE_PORTAL_QUESTION", "CARD_QUERY_VOTE_CARNAGE", "CARD_QUERY_VOTE_HOMAGE" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
VXP_TallyVotes()
-- This will show the winners along with votes for the winners (will show both in case of tie, up to card to handle ties).
VXP_ShowVoteWinners("Carnage", "Homage")
-- Get our winner(s) and store what we are going to do:
local tWinners = VXP_GetWinners()
if (tWinners[0] > 1) then
-- Tie, so choose option to do in case of tie.
EffectDC():Int_Set(0, 1) -- Homage
else
EffectDC():Int_Set(0, tWinners[1])
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local nOption = EffectDC():Get_Int(0)
if (nOption == 1) then
-- Homage
EffectController():DrawCards(1)
end
</RESOLUTION_TIME_ACTION>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_NOT, CARD_TYPE_LAND )
filter:Add( FE_IS_PERMANENT, true )
</FILTER>
<RESOLUTION_TIME_ACTION filter_id="0">
local nOption = EffectDC():Int_Get(0)
if (nOption == 0) and FilteredCard() ~= nil then
EffectController():Sacrifice( EffectSource() )
FilteredCard():Destroy()
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
</CARD_V2>
- Magister of Worth | Open
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="MAGISTER_OF_WORTH_1000382300" />
<CARDNAME text="MAGISTER_OF_WORTH" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[真価の宗匠]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Magister of Worth]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="1000382300" />
<ARTID value="1000382300" />
<ARTIST name="John Stanko" />
<CASTING_COST cost="{4}{W}{B}" />
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Angel" />
<EXPANSION value="CNS" />
<RARITY metaname="R" />
<POWER value="4" />
<TOUGHNESS value="4" />
<STATIC_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Vol]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Vuela.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fliegend]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Volare]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[飛行]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[비행]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Полет]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Voar]]></LOCALISED_TEXT>
<INTRINSIC characteristic="CHARACTERISTIC_FLYING" />
</STATIC_ABILITY>
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[議決 ― 真価の宗匠が戦場に出たとき、あなたから始めて各プレイヤーは「恩寵」または「糾弾」のいずれかに投票する。「恩寵」がより多くの票を得た場合、各プレイヤーはそれぞれ、自分の墓地にある各クリーチャー・カードを戦場に戻す。「糾弾」がより多くの票を得た、あるいは票が同数だった場合、真価の宗匠以外のすべてのクリーチャーを破壊する。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Will of the council — When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from his or her graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION>
VXP_SetupVote()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
return VXP_ConductVoteMultipleChoice( EffectSourceLKI(), "CARD_QUERY_MAGISTER_QUESTION", "CARD_QUERY_VOTE_GRACE", "CARD_QUERY_VOTE_CONDEMN" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
VXP_TallyVotes()
-- This will show the winners along with votes for the winners (will show both in case of tie, up to card to handle ties).
VXP_ShowVoteWinners("Grace", "Condemnation")
-- Get our winner(s) and store what we are going to do:
local tWinners = VXP_GetWinners()
if (tWinners[0] > 1) then
-- Tie, so choose option to do in case of tie.
EffectDC():Int_Set(0, 1) -- Condemnation
else
EffectDC():Int_Set(0, tWinners[1])
end
</RESOLUTION_TIME_ACTION>
<FILTER filter_id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
filter:Add( FE_CARD_INSTANCE, OP_NOT, EffectSource() )
</FILTER>
<RESOLUTION_TIME_ACTION filter_id="0">
local nOption = EffectDC():Get_Int(0)
if (nOption == 1) then
if FilteredCard() ~= nil then
FilteredCard():Destroy()
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
local nOption = EffectDC():Get_Int(0)
if (nOption == 0) then
local n = MTG():GetActionRepCount()
local num_Players = MTG():GetNumberOfPlayers()
if (n < num_Players) then
local player = MTG():GetNthPlayer(n)
local filter = ClearFilter()
filter:SetZone( ZONE_GRAVEYARD )
filter:Add(FE_CONTROLLER, OP_IS, player)
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
player:SetItemCount( 1 )
for i = 0, (1-1) do
player:SetItemPrompt( i, "CARD_QUERY_CHOOSE_CREATURE_TO_PUT_INTO_PLAY" )
end
player:ChooseItems( EffectDC():Make_Targets(n+1) )
return true
else
for i = 0, (num_Players-1) do
local player = MTG():GetNthPlayer(i)
local numBounce = EffectDC():Get_Targets(i+1):Count()
for j = 0, (numBounce-1) do
local cardToBounce = EffectDC():Get_Targets(i+1):Get_CardPtr(j)
cardToBounce:PutOntoBattlefield( cardToBounce:GetOwner() )
end
end
return false
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
<SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
<SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
- Plea for Power | Open
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="PLEA_FOR_POWER_1000382329" />
<CARDNAME text="PLEA_FOR_POWER" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[権力への嘆願]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Plea for Power]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="1000382329" />
<ARTID value="1000382329" />
<ARTIST name="John Severin Brassell" />
<CASTING_COST cost="{3}{U}" />
<TYPE metaname="Sorcery" />
<EXPANSION value="CNS" />
<RARITY metaname="R" />
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[議決 ― あなたから始めて各プレイヤーは「時間」または「知識」のいずれかに投票する。「時間」がより多くの票を得た場合、あなたはこのターンの後に追加のターンを行う。「知識」がより多くの票を得た、あるいは票が同数だった場合、カードを3枚引く。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Will of the council — Starting with you, each player votes for time or knowledge. If time gets more votes, take an extra turn after this one. If knowledge gets more votes or the vote is tied, draw three cards.]]></LOCALISED_TEXT>
<RESOLUTION_TIME_ACTION>
VXP_SetupVote()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
return VXP_ConductVoteMultipleChoice( EffectSourceLKI(), "CARD_QUERY_PLEA_QUESTION", "CARD_QUERY_VOTE_TIME", "CARD_QUERY_VOTE_KNOWLEDGE" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
VXP_TallyVotes()
-- This will show the winners along with votes for the winners (will show both in case of tie, up to card to handle ties).
VXP_ShowVoteWinners("Time", "Knowledge")
-- Get our winner(s) and store what we are going to do:
local tWinners = VXP_GetWinners()
if (tWinners[0] > 1) then
-- Tie, so choose option to do in case of tie.
EffectDC():Int_Set(0, 1) -- Psychosis
else
EffectDC():Int_Set(0, tWinners[1])
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local nOption = EffectDC():Get_Int(0)
if (nOption == 1) then
-- Knowledge
EffectController():DrawCards(3)
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local nOption = EffectDC():Get_Int(0)
if (nOption == 0) then
EffectController():GetTeam():TakeExtraTurn()
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
</CARD_V2>
- Split Decision | Open
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="SPLIT_DECISION_1000382371" />
<CARDNAME text="SPLIT_DECISION" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Split Decision]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Split Decision]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Split Decision]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Split Decision]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Split Decision]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[分割判定]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Split Decision]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Split Decision]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Split Decision]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="1000382371" />
<ARTID value="1000382371" />
<ARTIST name="Robbie Trevino" />
<CASTING_COST cost="{1}{U}" />
<TYPE metaname="Instant" />
<EXPANSION value="CNS" />
<RARITY metaname="U" />
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[議決 ― インスタント呪文またはソーサリー呪文を1つ対象として選ぶ。あなたから始めて各プレイヤーは「否定」または「複製」のいずれかに投票する。「否定」がより多くの票を得た場合、その呪文を打ち消す。「複製」がより多くの票を得た、あるいは票が同数だった場合、その呪文をコピーする。あなたはそのコピーの新しい対象を選んでもよい。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Will of the council — Choose target instant or sorcery spell. Starting with you, each player votes for denial or duplication. If denial gets more votes, counter the spell. If duplication gets more votes or the vote is tied, copy the spell. You may choose new targets for the copy.]]></LOCALISED_TEXT>
<TARGET tag="CARD_QUERY_CHOOSE_SPELL" definition="5" compartment="5" count="1" />
<TARGET_DEFINITION id="5">
local filter = ClearFilter()
local subfilter = filter:AddSubFilter_Or()
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_INSTANT )
subfilter:Add( FE_TYPE, OP_IS, CARD_TYPE_SORCERY )
filter:SetZone( ZONE_STACK )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
VXP_SetupVote()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
return VXP_ConductVoteMultipleChoice( EffectSourceLKI(), "CARD_QUERY_SPLIT_QUESTION", "CARD_QUERY_VOTE_DENIAL", "CARD_QUERY_VOTE_DUPE" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
VXP_TallyVotes()
-- This will show the winners along with votes for the winners (will show both in case of tie, up to card to handle ties).
VXP_ShowVoteWinners("Denial", "Duplication")
-- Get our winner(s) and store what we are going to do:
local tWinners = VXP_GetWinners()
if (tWinners[0] > 1) then
-- Tie, so choose option to do in case of tie.
EffectDC():Int_Set(0, 1) -- Psychosis
else
EffectDC():Int_Set(0, tWinners[1])
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local nOption = EffectDC():Get_Int(0)
if (nOption == 1) then
-- Duplication
local target = EffectDC():Get_Targets(5):Get_CardPtr(0)
local effectController = EffectController()
if target ~= nil then
local copy = effectController:CopySpell( target )
effectController:ChooseNewTargets( copy)
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local nOption = EffectDC():Get_Int(0)
if (nOption == 0) then
local target = EffectDC():Get_Targets(5):Get_CardPtr(0)
if target ~= nil then
target:CounterSpell()
end
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
</CARD_V2>
- Tyrant's Choice | Open
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="TYRANTS_CHOICE_1000382391" />
<CARDNAME text="TYRANTS_CHOICE" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[暴君の選択]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Tyrant’s Choice]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="1000382391" />
<ARTID value="1000382391" />
<ARTIST name="Daarken" />
<CASTING_COST cost="{1}{B}" />
<TYPE metaname="Sorcery" />
<EXPANSION value="CNS" />
<RARITY metaname="C" />
<SPELL_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[議決 ― あなたから始めて各プレイヤーは「死」または「拷問」のいずれかに投票する。「死」がより多くの票を得た場合、各対戦相手はそれぞれクリーチャーを1体生け贄に捧げる。「拷問」がより多くの票を得た、あるいは票が同数だった場合、各対戦相手はそれぞれ4点のライフを失う。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Will of the council — Starting with you, each player votes for death or torture. If death gets more votes, each opponent sacrifices a creature. If torture gets more votes or the vote is tied, each opponent loses 4 life.]]></LOCALISED_TEXT>
<RESOLUTION_TIME_ACTION>
VXP_SetupVote()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
return VXP_ConductVoteMultipleChoice( EffectSourceLKI(), "CARD_QUERY_TYRANTS_CHOICE_QUESTION", "CARD_QUERY_VOTE_DEATH", "CARD_QUERY_VOTE_TORTURE" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
VXP_TallyVotes()
-- This will show the winners along with votes for the winners (will show both in case of tie, up to card to handle ties).
VXP_ShowVoteWinners("Death", "Torture")
-- Get our winner(s) and store what we are going to do:
local tWinners = VXP_GetWinners()
if (tWinners[0] > 1) then
-- Tie, so choose option to do in case of tie.
EffectDC():Int_Set(0, 1) -- Psychosis
else
EffectDC():Int_Set(0, tWinners[1])
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
local nOption = EffectDC():Get_Int(0)
if (nOption == 1) then
local number = MTG():GetNumberOfPlayers()
for i = 0, (number-1) do
local player = MTG():GetNthPlayer(i)
if player:GetTeam() ~= EffectController():GetTeam() then
player:LoseLife(4)
end
end
end
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
local nOption = EffectDC():Get_Int(0)
if (nOption == 0) then
local n = MTG():GetActionRepCount()
local num_players = MTG():GetNumberOfPlayers()
if n < num_players then
local player = MTG():GetNthPlayer(n)
if player ~= nil and player:GetTeam() ~= EffectController():GetTeam() then
local filter = ClearFilter()
filter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
filter:Add(FE_CONTROLLER, OP_IS, player)
if filter:CountStopAt(1) == 1 then
player:ChooseItem( "CHOOSE_A_CREATURE_TO_SACRIFICE", EffectDC():Make_Targets(n) )
end
end
return true
else
for i=0,num_players-1 do
local player = MTG():GetNthPlayer(i)
if player ~= nil and player:GetTeam() ~= EffectController():GetTeam() then
local creature = EffectDC():Get_Targets(i) and EffectDC():Get_Targets(i):Get_CardPtr(0)
if creature ~= nil then
MTG():GetNthPlayer(i):Sacrifice(creature)
end
end
end
end
return false
end
</RESOLUTION_TIME_ACTION>
</SPELL_ABILITY>
</CARD_V2>
This is pretty much the same as any 2-choice vote with a couple of exceptions:gorem2k wrote:I don't really know how to get the 4-colors results in Council Guardian. Other than that, I understand the two-choices cards.
- You put 2 more parameters in VXP_ConductVoteMultipleChoice() and VXP_ShowVoteWinners().
- Instead of using an if to check for a tie you simply iterate through all the winning choices.
So for example that part would look similar to this:
- Code: Select all
local tWinners = VXP_GetWinners()
for i = 1, tWinners[0] do
-- Get choice (remember choices are 0-indexed so we
-- add 1 to make sure we don't have any zeros in the mix.)
LinkedDC():Int_Set(i - 1, tWinners[i] + 1)
end
- Code: Select all
<CONTINUOUS_ACTION layer="6">
if (EffectSource ~= nil) then
local nIndex = 0
while (LinkedDC():Int_Get(nIndex) > 0) do
local nChoice = LinkedDC():Int_Get(nIndex)
local oFilter = ClearFilter()
if (nChoice == 1) then
-- First choice let's say it was Blue (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_BLUE )
elseif (nChoice == 2) then
-- Second choice let's say it was Black (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_BLACK )
elseif (nChoice == 3) then
-- Third choice let's say it was Red (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_RED )
else
-- Fourth choice let's say it was Green (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_GREEN )
end
EffectSource():Protection()
end
end
</CONTINUOUS_ACTION>
It may be part coincidence and part cheating. I say that because the AI seems to at least partially understand Grudge Keeper's ability in relation to voting, but it's still part cheating because the way it is coded players don't know what other players have voted for. Though in a real game of magic everyone would get to hear what was voted for by the player(s) who chose before them. Trying to code the actual order of voting and showing all players what was voted for would have made the code considerably more complex for the actual vote so for now I just skipped that.gorem2k wrote:And for some reason, the AI will always pick the same color I choose when I have Grudge Keeper in play. Is this coincidence or just him being a nifty cheater?
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: Will of the Council
by gorem2k » 20 Aug 2014, 00:46
I have this:
- Council Guardian vote section | Open
- Code: Select all
<RESOLUTION_TIME_ACTION>
VXP_SetupVote()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
return VXP_ConductVoteMultipleChoice( EffectSourceLKI(), "CARD_QUERY_VOTE", "CARD_QUERY_VOTE_BLUE", "CARD_QUERY_VOTE_BLACK", "CARD_QUERY_VOTE_RED", "CARD_QUERY_VOTE_GREEN" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
VXP_TallyVotes()
VXP_ShowVoteWinners("Blue", "Black", "Red", "Green")
local tWinners = VXP_GetWinners()
for i = 1, tWinners[0] do
-- Get choice (remember choices are 0-indexed so we
-- add 1 to make sure we don't have any zeros in the mix.)
LinkedDC():Int_Set(i - 1, tWinners[i] + 1)
end
</RESOLUTION_TIME_ACTION>
<CONTINUOUS_ACTION layer="6">
if (EffectSource ~= nil) then
local nIndex = 0
while (LinkedDC():Int_Get(nIndex) > 0) do
local nChoice = LinkedDC():Int_Get(nIndex)
local oFilter = ClearFilter()
if (nChoice == 1) then
-- First choice let's say it was Blue (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_BLUE )
elseif (nChoice == 2) then
-- Second choice let's say it was Black (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_BLACK )
elseif (nChoice == 3) then
-- Third choice let's say it was Red (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_RED )
else
-- Fourth choice let's say it was Green (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_GREEN )
end
EffectSource():Protection()
end
end
</CONTINUOUS_ACTION>
<DURATION>
return EffectSource() == nil
</DURATION>
Oh and yes I added linked_ability_group="1" to my trigger since you used LinkedDC.SCRIPT_LOG.TXT wrote:[lua] (error object is not a string)
[lua] not enough memory
Re: Will of the Council
by RiiakShiNal » 20 Aug 2014, 01:29
If you keep it all in a single ability you can change the LinkedDC() calls to EffectDC() calls. I had actually set it up so that it could be moved to another ability for easier testing (when the LinkedDC() hasn't been set there is no worry about getting random protections since all registers default to 0 which would stop the loop).
As for the error log I'm not sure why it is running out of memory (though if it runs out of memory somewhere in the middle that could explain the not a string error). I don't have any globals that would continually eat memory. I don't use too much memory in the way of locals as most pieces use data chests. Though if you want to free up some memory where I do string concatenation you could remove the call to VXP_ShowVoteWinners() since all it does is show a message about the winners (no actual processing or anything required).
As for the error log I'm not sure why it is running out of memory (though if it runs out of memory somewhere in the middle that could explain the not a string error). I don't have any globals that would continually eat memory. I don't use too much memory in the way of locals as most pieces use data chests. Though if you want to free up some memory where I do string concatenation you could remove the call to VXP_ShowVoteWinners() since all it does is show a message about the winners (no actual processing or anything required).
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: Will of the Council
by gorem2k » 20 Aug 2014, 02:00
- Code: Select all
while (LinkedDC():Int_Get(nIndex) > 0) do
ok now this works:
- Code: Select all
<CONTINUOUS_ACTION layer="6">
if (EffectSource ~= nil) then
local nIndex = 0
while (LinkedDC():Int_Get(nIndex) > 0) do
local nChoice = LinkedDC():Int_Get(nIndex)
local oFilter = ClearFilter()
nIndex = nIndex + 1
if (nChoice == 1) then
-- First choice let's say it was Blue (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_BLUE )
elseif (nChoice == 2) then
-- Second choice let's say it was Black (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_BLACK )
elseif (nChoice == 3) then
-- Third choice let's say it was Red (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_RED )
else
-- Fourth choice let's say it was Green (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_GREEN )
end
EffectSource():Protection()
end
end
</CONTINUOUS_ACTION>
Re: Will of the Council
by volrathxp » 20 Aug 2014, 02:11
Oof. I realize that I can't read cards. I'll fix it tomorrow, and publish a new update to my Core DLC tomorrow night. I just got home from EDH night, so I'm not doing any coding tonight.RiiakShiNal wrote:For the most part they look fine, Magister of Worth looks a bit odd because even though it says "each player returns each creature" (which means "affect all") you are having the players choose. There shouldn't be a choice of which creatures to bring back, they all come back.
volrathxp
Re: Will of the Council
by RiiakShiNal » 20 Aug 2014, 10:51
Oops, I guess that's what I get for just writing it off the top of my head and not actually testing it.gorem2k wrote:this seems strange, how can it exit the loop if nIndex doesn't change.
- Code: Select all
while (LinkedDC():Int_Get(nIndex) > 0) do
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: Will of the Council
by volrathxp » 21 Aug 2014, 02:15
Alright so I fixed Magister of Worth, do we have a good Council Guardian with the new code? If I can get it here I'll populate it so I can upload the new core tomorrow morning when I get up.
Also, still trying to kind of sort out Custodi Squire.
Also, still trying to kind of sort out Custodi Squire.
volrathxp
Re: Will of the Council
by RiiakShiNal » 21 Aug 2014, 10:30
The Council Guardian code is basically the code that I posted with 1 additional line: nIndex = nIndex + 1 to stop the infinite loop (as gorem2k pointed out). If you are keeping all of the code in a single ability with a DURATION like gorem2k has then you can replace the LinkedDC() with EffectDC().
Custodi Squire is basically like Council's Judgement except with a different filter in the repeating action (instead of non-land you don't control it's artifact, creature, or enchantment in your graveyard) and effect at the end (instead of Exile() you use PutInHand()).
Custodi Squire is basically like Council's Judgement except with a different filter in the repeating action (instead of non-land you don't control it's artifact, creature, or enchantment in your graveyard) and effect at the end (instead of Exile() you use PutInHand()).
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2185
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 496 times
Re: Will of the Council
by volrathxp » 21 Aug 2014, 10:44
Right on. Thanks.RiiakShiNal wrote:The Council Guardian code is basically the code that I posted with 1 additional line: nIndex = nIndex + 1 to stop the infinite loop (as gorem2k pointed out). If you are keeping all of the code in a single ability with a DURATION like gorem2k has then you can replace the LinkedDC() with EffectDC().
Custodi Squire is basically like Council's Judgement except with a different filter in the repeating action (instead of non-land you don't control it's artifact, creature, or enchantment in your graveyard) and effect at the end (instead of Exile() you use PutInHand()).
volrathxp
Re: Will of the Council
by volrathxp » 22 Aug 2014, 02:35
So according to Kith, Council Guardian isn't actually granting protection. Here's the code, maybe I copied something wrong.
- Council Guardian | Open
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="COUNCIL_GUARDIAN_1000382238" />
<CARDNAME text="COUNCIL_GUARDIAN" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Council Guardian]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Council Guardian]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Council Guardian]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Council Guardian]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Council Guardian]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[議会の守衛]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Council Guardian]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Council Guardian]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Council Guardian]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="1000382238" />
<ARTID value="1000382238" />
<ARTIST name="Volkan Baga" />
<CASTING_COST cost="{5}{W}" />
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Giant" />
<SUB_TYPE metaname="Soldier" />
<EXPANSION value="CNS" />
<RARITY metaname="U" />
<POWER value="5" />
<TOUGHNESS value="5" />
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Will of the council — When Council Guardian enters the battlefield, starting with you, each player votes for blue, black, red, or green. Council Guardian gains protection from each color with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Will of the council — When Council Guardian enters the battlefield, starting with you, each player votes for blue, black, red, or green. Council Guardian gains protection from each color with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Will of the council — When Council Guardian enters the battlefield, starting with you, each player votes for blue, black, red, or green. Council Guardian gains protection from each color with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Will of the council — When Council Guardian enters the battlefield, starting with you, each player votes for blue, black, red, or green. Council Guardian gains protection from each color with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Will of the council — When Council Guardian enters the battlefield, starting with you, each player votes for blue, black, red, or green. Council Guardian gains protection from each color with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[議決 ― 議会の守衛が戦場に出たとき、あなたから始めて各プレイヤーは青、黒、赤、緑のいずれかに投票する。議会の守衛は最多あるいは最多と同数の票を獲得した各色に対するプロテクションを得る。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Will of the council — When Council Guardian enters the battlefield, starting with you, each player votes for blue, black, red, or green. Council Guardian gains protection from each color with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Will of the council — When Council Guardian enters the battlefield, starting with you, each player votes for blue, black, red, or green. Council Guardian gains protection from each color with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Will of the council — When Council Guardian enters the battlefield, starting with you, each player votes for blue, black, red, or green. Council Guardian gains protection from each color with the most votes or tied for most votes.]]></LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<RESOLUTION_TIME_ACTION>
VXP_SetupVote()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
return VXP_ConductVoteMultipleChoice( EffectSourceLKI(), "CARD_QUERY_VOTE", "CARD_QUERY_VOTE_BLUE", "CARD_QUERY_VOTE_BLACK", "CARD_QUERY_VOTE_RED", "CARD_QUERY_VOTE_GREEN" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
VXP_TallyVotes()
VXP_ShowVoteWinners("Blue", "Black", "Red", "Green")
local tWinners = VXP_GetWinners()
for i = 1, tWinners[0] do
-- Get choice (remember choices are 0-indexed so we
-- add 1 to make sure we don't have any zeros in the mix.)
EffectDC():Int_Set(i - 1, tWinners[i] + 1)
end
</RESOLUTION_TIME_ACTION>
<CONTINUOUS_ACTION layer="6">
if (EffectSource ~= nil) then
local nIndex = 0
while (LinkedDC():Int_Get(nIndex) > 0) do
local nChoice = EffectDC():Int_Get(nIndex)
local oFilter = ClearFilter()
nIndex = nIndex + 1
if (nChoice == 1) then
-- First choice let's say it was Blue (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_BLUE )
elseif (nChoice == 2) then
-- Second choice let's say it was Black (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_BLACK )
elseif (nChoice == 3) then
-- Third choice let's say it was Red (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_RED )
else
-- Fourth choice let's say it was Green (like on the card)
oFilter:Add( FE_COLOUR, OP_IS, COLOUR_GREEN )
end
EffectSource():Protection()
end
end
</CONTINUOUS_ACTION>
<DURATION>
return EffectSource() == nil
</DURATION>
</TRIGGERED_ABILITY>
<SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
<SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
- Custodi Squire | Open
- Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<CARD_V2 ExportVersion="1">
<FILENAME text="CUSTODI_SQUIRE_1000382243" />
<CARDNAME text="CUSTODI_SQUIRE" />
<TITLE>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Custodi Squire]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Custodi Squire]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Custodi Squire]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Custodi Squire]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Custodi Squire]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[カストーディの従者]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Custodi Squire]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Custodi Squire]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Custodi Squire]]></LOCALISED_TEXT>
</TITLE>
<MULTIVERSEID value="1000382243" />
<ARTID value="1000382243" />
<ARTIST name="Alex Horley-Orlandelli" />
<CASTING_COST cost="{4}{W}" />
<TYPE metaname="Creature" />
<SUB_TYPE metaname="Spirit" />
<SUB_TYPE metaname="Cleric" />
<EXPANSION value="CNS" />
<RARITY metaname="C" />
<POWER value="3" />
<TOUGHNESS value="3" />
<STATIC_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Flying]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Vol]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Vuela.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Fliegend]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Volare]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[飛行]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[비행]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Полет]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Voar]]></LOCALISED_TEXT>
<INTRINSIC characteristic="CHARACTERISTIC_FLYING" />
</STATIC_ABILITY>
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Will of the council — When Custodi Squire enters the battlefield, starting with you, each player votes for an artifact, creature, or enchantment card in your graveyard. Return each card with the most votes or tied for most votes to your hand.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="fr-FR"><![CDATA[Will of the council — When Custodi Squire enters the battlefield, starting with you, each player votes for an artifact, creature, or enchantment card in your graveyard. Return each card with the most votes or tied for most votes to your hand.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="es-ES"><![CDATA[Will of the council — When Custodi Squire enters the battlefield, starting with you, each player votes for an artifact, creature, or enchantment card in your graveyard. Return each card with the most votes or tied for most votes to your hand.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="de-DE"><![CDATA[Will of the council — When Custodi Squire enters the battlefield, starting with you, each player votes for an artifact, creature, or enchantment card in your graveyard. Return each card with the most votes or tied for most votes to your hand.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="it-IT"><![CDATA[Will of the council — When Custodi Squire enters the battlefield, starting with you, each player votes for an artifact, creature, or enchantment card in your graveyard. Return each card with the most votes or tied for most votes to your hand.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="jp-JA"><![CDATA[議決 ― カストーディの従者が戦場に出たとき、あなたから始めて各プレイヤーは、あなたの墓地にあるアーティファクト・カード1枚か、クリーチャー・カード1枚か、エンチャント・カード1枚に投票する。最多あるいは最多と同数の票を獲得した各カードをあなたの手札に戻す。]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ko-KR"><![CDATA[Will of the council — When Custodi Squire enters the battlefield, starting with you, each player votes for an artifact, creature, or enchantment card in your graveyard. Return each card with the most votes or tied for most votes to your hand.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="ru-RU"><![CDATA[Will of the council — When Custodi Squire enters the battlefield, starting with you, each player votes for an artifact, creature, or enchantment card in your graveyard. Return each card with the most votes or tied for most votes to your hand.]]></LOCALISED_TEXT>
<LOCALISED_TEXT LanguageCode="pt-BR"><![CDATA[Will of the council — When Custodi Squire enters the battlefield, starting with you, each player votes for an artifact, creature, or enchantment card in your graveyard. Return each card with the most votes or tied for most votes to your hand.]]></LOCALISED_TEXT>
<RESOLUTION_TIME_ACTION>
VXP_SetupVote()
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION repeating="1">
-- Not controlled by you.
local oFilter = ClearFilter()
local oFilter:SetZone( ZONE_GRAVEYARD )
oFilter:Add( FE_CONTROLLER, OP_IS, EffectController() )
-- Non-Land (done this way to exclude invisible tokens)
local oSubFilter = oFilter:AddSubFilter_Or()
oSubFilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ARTIFACT )
oSubFilter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
oSubFilter:Add( FE_TYPE, OP_IS, CARD_TYPE_ENCHANTMENT )
-- Do the vote.
return VXP_ConductVoteFilterSingle( "CARD_QUERY_CUSTODI_SQUIRE_QUESTION" )
</RESOLUTION_TIME_ACTION>
<RESOLUTION_TIME_ACTION>
-- This is a required step, we have to tally the votes before we do anything else.
VXP_TallyVotes()
-- This will show the winners along with votes for the winners (will show both in case of tie, up to card to handle ties).
VXP_ShowVoteWinners("Sickness", "Psychosis")
-- Get our winner(s) and exile them:
local tWinners = VXP_GetWinners()
local nNumCards = tWinners[0]
for i = 1, nNumCards do
local oCard = tWinners[i]
if (oCard ~= nil) then
oCard:PutInHand()
end
end
</RESOLUTION_TIME_ACTION>
</TRIGGERED_ABILITY>
<HELP title="MORE_INFO_BADGE_TITLE_10" body="MORE_INFO_BADGE_BODY_10" zone="ZONE_ANY" />
<SFX text="COMBAT_BLUNT_LARGE_ATTACK" power_boundary_min="4" power_boundary_max="-1" />
<SFX text="COMBAT_BLUNT_SMALL_ATTACK" power_boundary_min="1" power_boundary_max="3" />
</CARD_V2>
volrathxp
Who is online
Users browsing this forum: No registered users and 61 guests