Commit eb646372 authored by POLYMER's avatar POLYMER

fix

parent 8f0c1e77
...@@ -33,21 +33,23 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -33,21 +33,23 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e4,tp) Duel.RegisterEffect(e4,tp)
end end
function s.costtg(e,te,tp) function s.costtg(e,te,tp)
e:SetLabelObject(te:GetHandler()) e:SetLabelObject(te)
local tc=te:GetHandler()
local typ=tc:GetType()&0x7
e:SetLabel(typ)
return true return true
end end
function s.costchk(e,tp,eg,ep,ev,re,r,rp,chk) function s.costchk(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local tc=e:GetLabelObject() local te=e:GetLabelObject()
local typ=tc:GetType()&0x7 local typ=e:GetLabel()
return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_HAND,0,1,tc,typ) return Duel.IsExistingMatchingCard(Card.IsType,te:GetHandlerPlayer(),LOCATION_HAND,0,1,te:GetHandler(),typ)
end end
function s.costop(e,tp,eg,ep,ev,re,r,rp) function s.costop(e,tp,eg,ep,ev,re,r,rp)
local ctype=0 local te=e:GetLabelObject()
local tc=e:GetLabelObject() local typ=e:GetLabel()
local typ=tc:GetType()&0x7
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,Card.IsType,tp,LOCATION_HAND,0,1,1,tc,typ) local g=Duel.SelectMatchingCard(tp,Card.IsType,te:GetHandlerPlayer(),LOCATION_HAND,0,1,1,te:GetHandler(),typ)
if #g>0 then if #g>0 then
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
......
...@@ -149,7 +149,12 @@ function s.drop(e,tp,eg,ep,ev,re,r,rp) ...@@ -149,7 +149,12 @@ function s.drop(e,tp,eg,ep,ev,re,r,rp)
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,nil)
local op=aux.SelectFromOptions(tp,{true,aux.Stringid(id,7)},{res,aux.Stringid(id,8)}) local op=aux.SelectFromOptions(tp,{true,aux.Stringid(id,7)},{res,aux.Stringid(id,8)})
if op==1 then if op==1 then
Duel.Draw(tp,1,REASON_RULE) local g=Duel.GetDecktopGroup(tp,1)
local ec=g:GetFirst()
local code=ec:GetOriginalCode()
Duel.Exile(ec,REASON_RULE)
local token=Duel.CreateToken(tp,code)
Duel.SendtoHand(token,nil,REASON_RULE)
elseif op==2 then elseif op==2 then
local sg2=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) local sg2=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if #sg2>0 then if #sg2>0 then
...@@ -245,22 +250,20 @@ function s.adop(e,tp,eg,ep,ev,re,r,rp) ...@@ -245,22 +250,20 @@ function s.adop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_OPSELECTED,0,aux.Stringid(id,11)) Duel.Hint(HINT_OPSELECTED,0,aux.Stringid(id,11))
local check=false local check=false
local res=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0 local res=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0
if res and not Duel.SelectYesNo(tp,aux.Stringid(id,13)) then if res and not (Duel.IsExistingMatchingCard(s.cfilter4,tp,LOCATION_HAND,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,13))) then
if Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_RULE,nil)>0 then check=true
check=true end
end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
else if not check then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local cg=Duel.SelectMatchingCard(tp,s.cfilter4,tp,LOCATION_HAND,0,1,1,nil) local cg=Duel.SelectMatchingCard(tp,s.cfilter4,tp,LOCATION_HAND,0,1,1,nil)
if #cg>0 then if #cg>0 then
Duel.ConfirmCards(1-tp,cg) Duel.ConfirmCards(1-tp,cg)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
if Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_RULE,nil)>0 then check=true
check=true
end
end end
end end
if check then if check then
Duel.DiscardHand(tp,nil,1,1,REASON_RULE,nil)
local token1=Duel.CreateToken(tp,1784686) local token1=Duel.CreateToken(tp,1784686)
Duel.SendtoHand(token1,nil,REASON_RULE) Duel.SendtoHand(token1,nil,REASON_RULE)
Duel.ConfirmCards(1-tp,token1) Duel.ConfirmCards(1-tp,token1)
......
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