I've been working on a script for my entry into the Create-A-Card competition this week over at Yugioh Forums, and I'm having an issue with a part of the effect in which it skips the turn to the End Phase. Here's the card (open it in a new tab for full size and effect):

All the other parts of the effect work fine, however, I've been testing it in a Duel Puzzle by giving the AI an Ultimate Offering with 11 Shapesnatches in their hand and a Shapesnatch on the field, and as expected, when I enter the Battle Phase, it Tribute Summons everything in its hand, and after activating Offering 10 times, it gives me the option to activate God. The issue lies in the fact that after God negates Ultimate Offering, it doesn't skip immediately to the End Phase, instead the AI activates Offering once more, it resolves, and then it goes from Battle Phase -> M2 -> End Phase by itself.
Based on how I've written it and how Cardcar D works, I would expect that after Ultimate Offering is negated, the Battle Phase ends immediately and goes straight to the End Phase, however, it seems to give the AI the option to activate one more card before it goes through each phase. I'm not sure if this issue lies exclusively with Ultimate Offering since I haven't tested it with any other cards (not really many more elegant ways of getting the AI to predictably activate 10 effects), but regardless, it should work in any case.
Here's the script:
--God
function c18589484.initial_effect(c)
e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c18589484.discon)
e1:SetTarget(c18589484.distg)
e1:SetOperation(c18589484.disop)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(18589484,ACTIVITY_CHAIN,aux.FALSE)
end
function c18589484.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return Duel.IsChainNegatable(ev) and rp~=tp and Duel.GetCustomActivityCount(18589484,1-tp,ACTIVITY_CHAIN)>9
end
function c18589484.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(18589484,0))
local code=Duel.AnnounceCard(tp)
e:SetLabel(code)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetChainLimit(aux.FALSE)
end
function c18589484.disop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()~=18589485 then return end
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
local turnp=Duel.GetTurnPlayer()
Duel.SkipPhase(turnp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(turnp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(turnp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(turnp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(turnp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,turnp)
end
end
Anyone got any ideas why this might be, or how to fix it?
Here's a link to the expansion files if you need them, and
here's the Duel Puzzle that I test it in.
Cheers!
Edited by user
2015-06-20T04:37:16Z
|
Reason: Not specified