I made a bit of... cleanup (which you forgot to include in the delayed trigger, by the way

):
- Jeering Homunculus cleaned-up code (untested) | Open
- Code: Select all
<TRIGGERED_ABILITY>
<LOCALISED_TEXT LanguageCode="en-US">...</LOCALISED_TEXT>
<TRIGGER value="ZONECHANGE_END" simple_qualifier="self" to_zone="ZONE_BATTLEFIELD" />
<TARGET tag="SPL_CARD_QUERY_CHOOSE_CREATURE_TO_GOAD" definition="0" compartment="0" count="1" />
<TARGET_DEFINITION id="0">
local filter = ClearFilter()
filter:Add( FE_TYPE, OP_IS, CARD_TYPE_CREATURE )
</TARGET_DEFINITION>
<RESOLUTION_TIME_ACTION>
local creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
if creature ~= nil then
local turn = MTG():GetTurnNumber()
EffectDC():Set_Int(33, turn)
local delayDC = EffectDC():Make_Chest(1)
delayDC:Set_CardPtr(0, creature)
delayDC:Set_PlayerPtr(1, EffectController())
delayDC:Set_Int(33, turn)
MTG():CreateDelayedTrigger(2, delayDC)
end
</RESOLUTION_TIME_ACTION>
<CONTINUOUS_ACTION layer="8">
local creature = EffectDC():Get_Targets(0):Get_CardPtr(0)
if creature ~= nil then
creature:GetCurrentCharacteristics():Bool_Set( CHARACTERISTIC_MUST_ATTACK, 1 )
end
</CONTINUOUS_ACTION>
<DURATION>
return EffectDC():Get_Targets(0):Get_CardPtr(0) == nil or TFM_UntilMyNextTurn( EffectDC():Get_Int(33) )
</DURATION>
<MAY />
<AI_SIMPLIFIED_TARGETING compartment="0" hint="HINT_ENEMY_ONLY" />
</TRIGGERED_ABILITY>
<TRIGGERED_ABILITY resource_id="2" replacement_effect="1">
<TRIGGER value="CANT_ATTACK_PLAYER_TEST" pre_trigger="1">
return TriggerObject() == EffectDC():Get_CardPtr(0) and TriggerPlayer() == EffectDC():Get_PlayerPtr(1)
</TRIGGER>
<CLEANUP>
return EffectDC():Get_CardPtr(0) == nil or TFM_UntilMyNextTurn( EffectDC():Get_Int(33) )
</CLEANUP>
</TRIGGERED_ABILITY>
Note that you should use CHARACTERISTIC_MUST_ATTACK, without _EACH_TURN, because the goad mechanic says "each combat", not "each turn" (it makes a difference if a second combat phase is issued in the same turn with cards like
Aurelia, the Warleader).
I removed the short-circuit check for the target chest being not nil ("EffectDC():Get_Targets(0) and...") because the TARGET block always initializes the chest so it will never be nil. It doesn't hurt if you leave it, and it's better to add it when not needed than to forget it when needed, but in this case I can guarantee it's not needed.

Splinterverse wrote:(a check to see if there are no other players to attack, because in that situation it IS supposed to attack the player who goaded it).
It would be a wonderful idea, but I doubt it would be easy to accomplish. The only way to do it that I can think of is to save in an ObjectDC the players that each creature is unable to attack, so that you can check them whenever you want. All the cards that enforce a similar kind of restriction would need to be revised so that they do the same.