Commit cf202a65 authored by Fluorohydride's avatar Fluorohydride

Merge pull request #1010 from salix5/patch-hat

fix: Magical Hat
parents 32841b22 40f9ff44
......@@ -59,6 +59,7 @@ function c77462146.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e)
and Duel.IsPlayerCanSpecialSummonMonster(tp,77462146,0,0x11,4,0,300,RACE_WARRIOR,ATTRIBUTE_DARK) then
c:SetStatus(STATUS_NO_LEVEL,false)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
......
......@@ -44,6 +44,7 @@ function c81210420.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
local tg=sg:GetFirst()
local fid=e:GetHandler():GetFieldID()
while tg do
local e1=Effect.CreateEffect(tg)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -68,6 +69,7 @@ function c81210420.activate(e,tp,eg,ep,ev,re,r,rp)
e5:SetCode(EFFECT_SET_BASE_DEFENCE)
e5:SetValue(0)
tg:RegisterEffect(e5,true)
tg:RegisterFlagEffect(81210420,RESET_EVENT+0x47c0000+RESET_PHASE+PHASE_BATTLE,0,1,fid)
tg:SetStatus(STATUS_NO_LEVEL,true)
tg=sg:GetNext()
end
......@@ -82,16 +84,18 @@ function c81210420.activate(e,tp,eg,ep,ev,re,r,rp)
de:SetCode(EVENT_PHASE+PHASE_BATTLE)
de:SetReset(RESET_PHASE+PHASE_BATTLE)
de:SetCountLimit(1)
de:SetLabel(fid)
de:SetLabelObject(sg)
de:SetOperation(c81210420.desop)
Duel.RegisterEffect(de,tp)
end
function c81210420.desfilter(c)
return c:GetFlagEffect(81210420)>0
function c81210420.desfilter(c,fid)
return c:GetFlagEffectLabel(81210420)==fid
end
function c81210420.desop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(c81210420.desfilter,nil)
local fid=e:GetLabel()
local tg=g:Filter(c81210420.desfilter,nil,fid)
g:DeleteGroup()
Duel.Destroy(tg,REASON_EFFECT)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment