Yare: SecondaryPlayer() only works in triggered abilities. Outside of a triggered ability, you'll need to make a filter for all attacking creatures, and then iterate through those creatures and check which player each is attacking.
Alternatively, make a for loop, and check each player for at least one creature attacking them with FE_PLAYER_ATTACKED.
- Code: Select all
local oPlayersAttacked = {}
local iNumPlayers = MTG():GetNumberOfPlayers()
for i=0,iNumPlayers-1 do
local oPlayer = MTG():GetNthPlayer(i)
if oPlayer ~= nil then
local oFilter = ClearFilter()
oFilter:Add(FE_PLAYER_ATTACKED, OP_IS, oPlayer)
if oFilter:CountStopAt(1) == 1 then
CW_Tables_Add(oPlayersAttacked, oPlayer)
end
end
end
local oFilter = ClearFilter()
oFilter:Add(FE_TYPE, OP_IS, CARD_TYPE_CREATURE)
for i=0,#oPlayersAttacked-1 do
oFilter:Add(FE_CONTROLLER, OP_IS, oPlayersAttacked[i])
end
The first for loop checks each player to see if they're being attacked. If so, they're a defending player, and thus valid as the controller of a target. The second for loop adds each found player to a filter for the target tag to read.
----
Ydwen Efreet: Not sure why that bit isn't working, but there's no way to make the creatures it was blocking become unblocked. This actually makes
Ydwen Efreet more powerful than it should be, since there's a chance it'll be removed from combat with no damage, but still successfully have blocked the creature. I can look into the CW_General_RemoveFromCombat() function later.
----
Zada, Hedron Grinder: You can't. This is the same basic effect as
Mirrorwing Dragon, and it requires my protection functions to be distributed, which they haven't been yet.
The issue with not copying, though, is because (at least in part, if not in entirely) of your target retrieval.
local target = EffectDC():Get_CardPtr(0) -> local target = EffectDC():Get_Targets(0):Get_CardPtr(0)
----
Zhalfirin Crusader: Your first RTA has two if's but only one end.
Line 16 uses the variable target, but 'target' was never defined.
You need to check if target_player is valid. If it is, store it in a delaydc with Set_CardPtr, and make a delayed trigger.
If target_player is nil, then check if target_creature is valid. If it is, store it in a delaydc with Set_PLayerPtr, and make the same delayed trigger.
The delayed trigger ability needs two <TRIGGER...>...</TRIGGER> blocks. One should have value="SOUCE_DEALS_DAMAGE_TO_PLAYER" and should check for the player value with Get_PlayerPtr. The other should be the one you already have.
----
Zur's Wierding: I see a few issues.
1: When a player activates the card, it's unlikely they're doing so in order to reveal their own hand. They're probably wanting to look at others' hands. Whenever it's activated, it should cycle through all players and reveal each hand in turn.
Also, for the activated ability, give these.
- Code: Select all
--At beginning of ability.
<PLAY_TIME_ACTION>
RSN_MarkManaAbilityStart()
</PLAY_TIME_ACTION>
--At end of ability.
<RESOLUTION_TIME_ACTION>
RSN_MarkManaAbilityEnd()
</RESOLUTION_TIME_ACTION>
These functions prevent
Burning-Tree Shaman and other similar effects from firing. They're really just meant for mana, and they should be reworked into new functions that shut down all activated-ability triggers without regard to mana/non-mana ability status just for use with activated abilities like this, but until that's done, just use those.
2: Line 32 makes no sense.
- Code: Select all
return Object():GetPlayer() ~= (RSN_ObjectDC():Get_Int(0)==1)
So, if the player that controls this object (Zur's Wierding) is not equal to (some true/false value), then return true. I suspect it was supposed to check if Object():GetPlayer() ~= nil and ...
But really it just needs to check if EffectSource() is nil. The player isn't even really all that relevant for the availability.
3: In the repeating RTA, the card in question should be in the multiple choice dialogue so players can see it while deciding. So, grab
local card = EffectDC():Get_CardPtr(0)
Make sure it's not nil, too, since if it is, they shouldn't even be asked.
4: Also in the repeating RTA, under parity 1, it checks if the current player has more than 4 life. If they do, store their pointer (overwriting the stored card), and stop running. This should be checking if the multiple choice result is 0 and they have 2 or more life (not more than 2). It also shouldn't overwrite the card pointer. The player pointer should go into a new register.
5: In the final RTA, it makes sure they chose to pay 2 life. If they didn't choose that, then nothing else happens. This should check if the player is nil. If it's not, then did they choose to pay? If they did, make them pay and mill the stored card. If they didn't choose to pay or if the player was nil, then TriggerPlayer():DrawCards(1). Don't use PutIntoHand(). It should fire the 'drew-card' trigger, because the card says they draw a card.
6: Also in the final RTA, it's EffectSource() into the graveyard or hand. EffectSource() is Zur's Wierding. No reason for that to go anywhere.
7: Also in the final RTA and also in the TRIGGER, it should use LinkedDC():Int(0) to make sure each card is only questioned once. In the trigger, only fire if LinkedDC():Get_Int(0) == 0. Still in the trigger, before returning true, set that int to 1. In the final RTA (or a new one after that), set the int back to 0. Don't forget to mark the ability as linked_ability_group="1".