Noobyhead99
2015-06-20T04:33:02Z
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):

UserPostedImage

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!
Michael Lawrence Dee
2015-06-20T04:39:07Z
Neko Mane King. [:thumbu:]
Now this is how I play:
Noobyhead99
2015-06-20T04:47:10Z
I checked Neko Mane King and its effect is almost identical to what I already have, the only difference being the 'e1:SetTargetRange' and 'Duel.RegisterEffect' in the No-Battle-Phase sub-effect, so I changed them in my script to match it but the result was the same as before :/. Anything else you might suggest?
Michael Lawrence Dee
2015-06-20T05:41:05Z
Originally Posted by: Noobyhead99 

I checked Neko Mane King and its effect is almost identical to what I already have, the only difference being the 'e1:SetTargetRange' and 'Duel.RegisterEffect' in the No-Battle-Phase sub-effect, so I changed them in my script to match it but the result was the same as before :/. Anything else you might suggest?



Hmmm...
1. I have never tried the Custom Activity
2. I never done it in Duel Puzzles.

Have you tested this against the AI?
Now this is how I play:
Noobyhead99
2015-06-20T07:57:43Z
The Custom Activity thing works fine, that just tracks the number of actions done by a player in a turn for things like Pot of Duality, the issue is that rather than skipping straight to the End Phase as part of the resolution like Carcar D does, it seems to declare an 'end of the Battle Phase' instead, letting the opponent activate any effects they want, and then passing through the rest of the phases one by one.

http://gfycat.com/Impres...ableCreamyCommabutterfly 

I've got absolutely no idea why it doesn't follow the behaviour of similar cards, even with the same script. It baffles me.

Also, I haven't tested the AI, primarily because of the difficulty of actually getting out a Level 10 monster with no protection and no Special Summoning method consistently, and the fact that any deck that will activate 10 or more effects per turn will probably have Castel'd it by then. You should try testing in Duel Puzzles, though, it works really well 😉