Commit d409a109 authored by mercury233's avatar mercury233

fix

parent f57fe547
...@@ -60,7 +60,7 @@ function c100259001.mfilter(c) ...@@ -60,7 +60,7 @@ function c100259001.mfilter(c)
return c:IsFusionCode(74677422) or (c:IsRace(RACE_DRAGON) and c:IsFusionType(TYPE_EFFECT)) return c:IsFusionCode(74677422) or (c:IsRace(RACE_DRAGON) and c:IsFusionType(TYPE_EFFECT))
end end
function c100259001.descon(e,tp,eg,ep,ev,re,r,rp) function c100259001.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffectLabel(100259101)>0 return e:GetHandler():GetFlagEffectLabel(100259101) and e:GetHandler():GetFlagEffectLabel(100259101)>0
end end
function c100259001.destg(e,tp,eg,ep,ev,re,r,rp,chk) function c100259001.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -52,8 +52,8 @@ function c100423045.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,8 +52,8 @@ function c100423045.spcon(e,tp,eg,ep,ev,re,r,rp)
end end
function c100423045.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c100423045.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ec=eg:GetFirst() local ec=eg:GetFirst()
if chk==0 then return (ec:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) if chk==0 then return ((ec:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)
or (ec:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp)>0) end or (ec:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp)>0)) and ec:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetTargetCard(ec) Duel.SetTargetCard(ec)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,ec,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,ec,1,0,0)
end end
......
...@@ -55,18 +55,20 @@ function c100423048.thfilter(c,p) ...@@ -55,18 +55,20 @@ function c100423048.thfilter(c,p)
end end
function c100423048.atktg(e,tp,eg,ep,ev,re,r,rp,chk) function c100423048.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,1-rp,LOCATION_REMOVED) local p=1-ep
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,1,1-rp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,p,LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,1,p,LOCATION_HAND)
end end
function c100423048.atkop(e,tp,eg,ep,ev,re,r,rp) function c100423048.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject():Filter(c100423048.thfilter,nil,1-rp) local p=1-ep
if g:GetCount()>0 and Duel.SelectYesNo(1-rp,aux.Stringid(100423048,1)) then local g=e:GetLabelObject():Filter(c100423048.thfilter,nil,p)
if g:GetCount()>0 and Duel.SelectYesNo(p,aux.Stringid(100423048,1)) then
local flag=false local flag=false
local sg=g:RandomSelect(rp,1) local sg=g:RandomSelect(1-p,1)
local sc=sg:GetFirst() local sc=sg:GetFirst()
if Duel.SendtoHand(sc,nil,REASON_EFFECT)~=0 and sc:IsLocation(LOCATION_HAND) and sc:IsControler(1-rp) then if Duel.SendtoHand(sc,nil,REASON_EFFECT)~=0 and sc:IsLocation(LOCATION_HAND) and sc:IsControler(p) then
Duel.ConfirmCards(rp,sc) Duel.ConfirmCards(1-p,sc)
if sc:IsDiscardable() and Duel.SelectYesNo(1-rp,aux.Stringid(100423048,2)) then if sc:IsDiscardable() and Duel.SelectYesNo(p,aux.Stringid(100423048,2)) then
flag=true flag=true
Duel.BreakEffect() Duel.BreakEffect()
Duel.SendtoGrave(sc,REASON_EFFECT+REASON_DISCARD) Duel.SendtoGrave(sc,REASON_EFFECT+REASON_DISCARD)
...@@ -81,7 +83,7 @@ function c100423048.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -81,7 +83,7 @@ function c100423048.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetValue(c100423048.damval) e1:SetValue(c100423048.damval)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,1-rp) Duel.RegisterEffect(e1,p)
end end
end end
end end
......
--ペンデュラム・ディメンション --ペンデュラム・ディメンション
--Scripted by mallu11 --Scripted by mallu11, Rewrited by nekrozar
function c100423049.initial_effect(c) function c100423049.initial_effect(c)
--activate --activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--spsummon --special summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100423049,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c100423049.spcon) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c100423049.effcon)
e2:SetTarget(c100423049.sptg) e2:SetTarget(c100423049.sptg)
e2:SetOperation(c100423049.spop) e2:SetOperation(c100423049.spop)
e2:SetLabel(TYPE_FUSION)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--to hand
local e3=e2:Clone()
e3:SetDescription(aux.Stringid(100423049,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetTarget(c100423049.thtg1)
e3:SetOperation(c100423049.thop1)
e3:SetLabel(TYPE_SYNCHRO)
c:RegisterEffect(e3)
--to hand
local e4=e2:Clone()
e4:SetDescription(aux.Stringid(100423049,2))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetTarget(c100423049.thtg2)
e4:SetOperation(c100423049.thop2)
e4:SetLabel(TYPE_XYZ)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE)
e5:SetRange(LOCATION_SZONE)
e5:SetCode(EFFECT_MATERIAL_CHECK)
e5:SetValue(c100423049.valcheck)
c:RegisterEffect(e5)
end end
function c100423049.cfilter(c) function c100423049.valcheck(e,c)
return c:IsFaceup() and c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ) and c:GetMaterial():IsExists(Card.IsType,1,nil,TYPE_PENDULUM) if c:GetMaterial():IsExists(Card.IsType,1,nil,TYPE_PENDULUM) then
end c:RegisterFlagEffect(100423049,RESET_EVENT+0x4fe0000+RESET_PHASE+PHASE_END,0,1)
function c100423049.tgfilter1(c,e,tp,eg) end
return eg:IsContains(c) and c:IsFaceup() and c:IsType(TYPE_FUSION) and Duel.IsExistingMatchingCard(c100423049.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetOriginalLevel())
end
function c100423049.spfilter1(c,e,tp,lv)
return c:GetOriginalLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100423049.tgfilter2(c,tp,eg)
return eg:IsContains(c) and c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and Duel.IsExistingMatchingCard(c100423049.spfilter2,tp,LOCATION_DECK,0,1,nil)
end
function c100423049.spfilter2(c)
return c:IsCode(24094653) and c:IsAbleToHand()
end
function c100423049.tgfilter3(c,tp,eg)
return eg:IsContains(c) and c:IsFaceup() and c:IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(c100423049.spfilter3,tp,LOCATION_DECK,0,1,nil,c:GetRank())
end
function c100423049.spfilter3(c,rank)
return c:IsType(TYPE_TUNER) and c:GetLevel()<=rank and c:IsAbleToHand()
end
function c100423049.tgfilter4(c,e,tp,eg)
return eg:IsContains(c) and c:IsFaceup() and c:IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(c100423049.spfilter4,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetRank())
end
function c100423049.spfilter4(c,e,tp,rank)
return c:IsType(TYPE_TUNER) and c:GetLevel()<=rank and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c100423049.spfilter5(c,e,tp,rank) function c100423049.effcon(e,tp,eg,ep,ev,re,r,rp)
return c:IsType(TYPE_TUNER) and c:GetLevel()<=rank and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false)) return eg:GetCount()==1 and eg:GetFirst():IsType(e:GetLabel()) and eg:GetFirst():GetFlagEffect(100423049)~=0
end end
function c100423049.spcon(e,tp,eg,ep,ev,re,r,rp) function c100423049.spfilter(c,e,tp,lv)
return rp==tp and eg:IsExists(c100423049.cfilter,1,nil) local lvl=c:GetOriginalLevel()
return lvl>0 and lvl==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end end
function c100423049.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c100423049.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local mz=Duel.GetLocationCount(tp,LOCATION_MZONE) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b1=Duel.GetFlagEffect(tp,100423049)==0 and Duel.IsExistingMatchingCard(c100423049.tgfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp,eg) and mz>0 and Duel.IsExistingMatchingCard(c100423049.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,eg:GetFirst():GetOriginalLevel())
local b2=Duel.GetFlagEffect(tp,100423149)==0 and Duel.IsExistingMatchingCard(c100423049.tgfilter2,tp,LOCATION_MZONE,0,1,nil,tp,eg) and Duel.GetFlagEffect(tp,100423049)==0 end
local b3=Duel.GetFlagEffect(tp,100423249)==0 and (Duel.IsExistingMatchingCard(c100423049.tgfilter3,tp,LOCATION_MZONE,0,1,nil,tp,eg)
or (Duel.IsExistingMatchingCard(c100423049.tgfilter4,tp,LOCATION_MZONE,0,1,nil,e,tp,eg) and mz>0))
if chk==0 then return b1 or b2 or b3 end
Duel.SetTargetCard(eg)
if b1 or b3 then
e:SetLabel(1)
local cat=e:GetCategory()
e:SetCategory(bit.bor(cat,CATEGORY_SPECIAL_SUMMON))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
if b2 or b3 then
e:SetLabel(2)
local cat=e:GetCategory()
e:SetCategory(bit.bor(cat,CATEGORY_SEARCH+CATEGORY_TOHAND))
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
if b3 then
e:SetLabel(3)
end
end end
function c100423049.spop(e,tp,eg,ep,ev,re,r,rp) function c100423049.spop(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local s=0
local mz=Duel.GetLocationCount(tp,LOCATION_MZONE)
if op==1 then
if Duel.GetFlagEffect(tp,100423049)~=0 then return end if Duel.GetFlagEffect(tp,100423049)~=0 then return end
Duel.RegisterFlagEffect(tp,100423049,RESET_PHASE+PHASE_END,0,1) local c=e:GetHandler()
if mz<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
if tc:IsFaceup() and tc:IsRelateToEffect(e) then local g=Duel.SelectMatchingCard(tp,c100423049.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,eg:GetFirst():GetOriginalLevel())
local lv=tc:GetOriginalLevel() local tc=g:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
local g=Duel.SelectMatchingCard(tp,c100423049.spfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp,lv)
local gc=g:GetFirst()
if gc and Duel.SpecialSummonStep(gc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
gc:RegisterEffect(e1,true) tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
gc:RegisterEffect(e2,true) tc:RegisterEffect(e2,true)
Duel.SpecialSummonComplete() Duel.SpecialSummonComplete()
end end
end end
end Duel.RegisterFlagEffect(tp,100423049,RESET_PHASE+PHASE_END,0,1)
if op==2 then end
function c100423049.thfilter1(c)
return c:IsCode(24094653) and c:IsAbleToHand()
end
function c100423049.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100423049.thfilter1,tp,LOCATION_DECK,0,1,nil)
and Duel.GetFlagEffect(tp,100423149)==0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100423049.thop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,100423149)~=0 then return end if Duel.GetFlagEffect(tp,100423149)~=0 then return end
Duel.RegisterFlagEffect(tp,100423149,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100423049.spfilter2,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c100423049.thfilter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end Duel.RegisterFlagEffect(tp,100423149,RESET_PHASE+PHASE_END,0,1)
if op==3 then end
function c100423049.thfilter2(c,e,tp,ft,rk)
return c:IsLevelBelow(rk) and c:IsType(TYPE_TUNER) and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function c100423049.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return Duel.IsExistingMatchingCard(c100423049.thfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,ft,eg:GetFirst():GetRank())
and Duel.GetFlagEffect(tp,100423249)==0 end
end
function c100423049.thop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,100423249)~=0 then return end if Duel.GetFlagEffect(tp,100423249)~=0 then return end
Duel.RegisterFlagEffect(tp,100423249,RESET_PHASE+PHASE_END,0,1) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if tc:IsFaceup() and tc:IsRelateToEffect(e) then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local rank=tc:GetRank() local g=Duel.SelectMatchingCard(tp,c100423049.thfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp,ft,eg:GetFirst():GetRank())
if mz<=0 then local tc=g:GetFirst()
local g=Duel.SelectMatchingCard(tp,c100423049.spfilter3,tp,LOCATION_DECK,0,1,1,nil,rank) if tc then
if g:GetCount()>0 then if ft>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
local gc=g:GetFirst() and (not tc:IsAbleToHand() or Duel.SelectOption(tp,1190,1152)==1) then
e:SetLabelObject(gc) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
s=Duel.SelectOption(tp,1190)
end
else else
local g=Duel.SelectMatchingCard(tp,c100423049.spfilter5,tp,LOCATION_DECK,0,1,1,nil,e,tp,rank) Duel.SendtoHand(tc,nil,REASON_EFFECT)
if g:GetCount()>0 then Duel.ConfirmCards(1-tp,tc)
local gc=g:GetFirst()
e:SetLabelObject(gc)
local b1=gc:IsAbleToHand()
local b2=gc:IsCanBeSpecialSummoned(e,0,tp,false,false)
if b1 and not b2 then
s=Duel.SelectOption(tp,1190)
end
if not b1 and b2 then
s=Duel.SelectOption(tp,1152)+1
end
if b1 and b2 then
s=Duel.SelectOption(tp,1190,1152)
end
end
end
local gc=e:GetLabelObject()
if s==0 then
Duel.SendtoHand(gc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,gc)
end
if s==1 then
Duel.SpecialSummon(gc,0,tp,tp,false,false,POS_FACEUP)
end
end end
end end
Duel.RegisterFlagEffect(tp,100423249,RESET_PHASE+PHASE_END,0,1)
end end
...@@ -31,8 +31,9 @@ end ...@@ -31,8 +31,9 @@ end
function c101011053.fcheck(tp,sg,fc) function c101011053.fcheck(tp,sg,fc)
if sg:IsExists(c101011053.chkfilter,1,nil,tp) then if sg:IsExists(c101011053.chkfilter,1,nil,tp) then
return sg:FilterCount(Card.IsControler,nil,1-tp)<=1 return sg:FilterCount(Card.IsControler,nil,1-tp)<=1
else
return sg:FilterCount(Card.IsControler,nil,1-tp)<=0
end end
return true
end end
function c101011053.gcheck(tp) function c101011053.gcheck(tp)
return function(sg) return function(sg)
......
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