Commit 258f95b6 authored by POLYMER's avatar POLYMER

fix

parent 554edd58
......@@ -21,22 +21,20 @@ function cm.initial_effect(c)
e2:SetTarget(cm.tg)
c:RegisterEffect(e2)
end
cm[0]=0
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x353c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.exop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
local loc,id=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_CHAIN_ID)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
local b1=rc:IsOriginalCodeRule(53718001) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp)
local b2=rc:IsOriginalCodeRule(53718002) and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil)
if id~=cm[0] and loc==LOCATION_SZONE and rc:IsFaceup() and (b1 or b2) and e:GetHandler():IsAbleToGrave() and Duel.SelectEffectYesNo(tp,c,aux.Stringid(m,0)) then
if loc==LOCATION_SZONE and rc:IsFaceup() and (b1 or b2) and e:GetHandler():IsAbleToGrave() and Duel.SelectEffectYesNo(tp,c,aux.Stringid(m,0)) then
Duel.Hint(HINT_CARD,0,m)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
local op=re:GetOperation()
if b1 then
if not re:IsHasCategory(CATEGORY_SPECIAL_SUMMON) then re:SetCategory(re:GetCategory()+CATEGORY_SPECIAL_SUMMON) end
local repop=function(e,tp,eg,ep,ev,re,r,rp)
op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......@@ -45,10 +43,10 @@ function cm.exop(e,tp,eg,ep,ev,re,r,rp)
end
re:SetOperation(repop)
end
local opx=re:GetOperation()
if b2 then
if not re:IsHasCategory(CATEGORY_DESTROY) then re:SetCategory(re:GetCategory()+CATEGORY_DESTROY) end
local repop=function(e,tp,eg,ep,ev,re,r,rp)
op(e,tp,eg,ep,ev,re,r,rp)
opx(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
if #g2>0 then
......@@ -58,6 +56,20 @@ function cm.exop(e,tp,eg,ep,ev,re,r,rp)
end
re:SetOperation(repop)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetLabelObject(re)
e1:SetOperation(cm.rsop(op))
Duel.RegisterEffect(e1,tp)
end
end
function cm.rsop(op)
return function(e,...)
local te=e:GetLabelObject()
if te then te:SetOperation(op) end
e:Reset()
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -45,7 +45,8 @@ function cm.initial_effect(c)
Effect.IsHasType=function(re,type)
local res=cm[4](re,type)
local rc=re:GetHandler()
local xe={rc:IsHasEffect(m)}
local xe={}
if rc then xe={rc:IsHasEffect(m)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then
......@@ -55,7 +56,8 @@ function cm.initial_effect(c)
cm[5]=Effect.GetType
Effect.GetType=function(re)
local rc=re:GetHandler()
local xe={rc:IsHasEffect(m)}
local xe={}
if rc then xe={rc:IsHasEffect(m)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return EFFECT_TYPE_ACTIVATE else return cm[5](re) end
......@@ -64,7 +66,8 @@ function cm.initial_effect(c)
Effect.IsActiveType=function(re,type)
local res=cm[6](re,type)
local rc=re:GetHandler()
local xe={rc:IsHasEffect(m)}
local xe={}
if rc then xe={rc:IsHasEffect(m)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then
......@@ -74,7 +77,8 @@ function cm.initial_effect(c)
cm[7]=Effect.GetActiveType
Effect.GetActiveType=function(re)
local rc=re:GetHandler()
local xe={rc:IsHasEffect(m)}
local xe={}
if rc then xe={rc:IsHasEffect(m)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return 0x10002 else return cm[7](re) end
......@@ -82,7 +86,8 @@ function cm.initial_effect(c)
cm[10]=Effect.GetActivateLocation
Effect.GetActivateLocation=function(re)
local rc=re:GetHandler()
local xe={rc:IsHasEffect(m)}
local xe={}
if rc then xe={rc:IsHasEffect(m)} end
local b=false
for _,v in pairs(xe) do if re==v:GetLabelObject() then b=true end end
if b then return LOCATION_SZONE else return cm[10](re) end
......@@ -90,7 +95,8 @@ function cm.initial_effect(c)
cm[11]=Effect.GetActivateSequence
Effect.GetActivateSequence=function(re)
local rc=re:GetHandler()
local xe={rc:IsHasEffect(m)}
local xe={}
if rc then xe={rc:IsHasEffect(m)} end
local ls=0
local seq=cm[11](re)
for _,v in pairs(xe) do
......@@ -105,7 +111,8 @@ function cm.initial_effect(c)
Duel.GetChainInfo=function(chainc,...)
local re=cm[12](chainc,CHAININFO_TRIGGERING_EFFECT)
local rc=re:GetHandler()
local xe={rc:IsHasEffect(m)}
local xe={}
if rc then xe={rc:IsHasEffect(m)} end
local b=false
local ls=0
for _,v in pairs(xe) do
......
......@@ -3,7 +3,7 @@ local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,88884429+EFFECT_COUNT_CODE_OATH)
......
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