Commit 9e8ec06c authored by VanillaSalt's avatar VanillaSalt

fix (1/4)

parent cdaf5efc
...@@ -17,22 +17,25 @@ function c10971759.initial_effect(c) ...@@ -17,22 +17,25 @@ function c10971759.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCost(c10971759.cost) e2:SetCost(c10971759.cost)
e2:SetTarget(c10971759.target) e2:SetTarget(c10971759.target)
e2:SetOperation(c10971759.operation) e2:SetOperation(c10971759.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c10971759.spfil(c,e,tp) function c10971759.spfilter(c,e,tp)
return c:GetLevel()==3 and c:IsRace(RACE_INSECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:GetLevel()==3 and c:IsRace(RACE_INSECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c10971759.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c10971759.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c10971759.spfil(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c10971759.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and Duel.IsExistingTarget(c10971759.spfil,tp,LOCATION_GRAVE,0,2,nil,e,tp) end if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
local g=Duel.SelectTarget(tp,c10971759.spfil,tp,LOCATION_GRAVE,0,2,2,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingTarget(c10971759.spfilter,tp,LOCATION_GRAVE,0,2,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c10971759.spfilter,tp,LOCATION_GRAVE,0,2,2,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end end
function c10971759.spop(e,tp,eg,ep,ev,re,r,rp) function c10971759.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<g:GetCount() then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<g:GetCount() then return end
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -18,7 +18,7 @@ end ...@@ -18,7 +18,7 @@ end
function c11193246.condition(e,tp,eg,ep,ev,re,r,rp) function c11193246.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c11193246.cfilter,1,nil,tp) return eg:IsExists(c11193246.cfilter,1,nil,tp)
end end
function c11193246.thfilter(c,e,tp) function c11193246.thfilter(c)
return c:IsSetCard(0xdf) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsSetCard(0xdf) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function c11193246.target(e,tp,eg,ep,ev,re,r,rp,chk) function c11193246.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -58,7 +58,7 @@ function c11317977.sctg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -58,7 +58,7 @@ function c11317977.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11317977.scfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c11317977.scfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function c11317977.scop(e,tp,eg,ep,ev,re,r,rp,chk) function c11317977.scop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c11317977.scfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c11317977.scfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
...@@ -70,11 +70,12 @@ function c11317977.thcon2(e,tp,eg,ep,ev,re,r,rp) ...@@ -70,11 +70,12 @@ function c11317977.thcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_FUSION return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_FUSION
end end
function c11317977.thfilter2(c) function c11317977.thfilter2(c)
return c:IsSetCard(0xdf) and not c:IsCode(11317977) and c:IsAbleToHand() and ((c:IsFaceup() and c:IsType(TYPE_MONSTER+TYPE_PENDULUM)) or c:IsType(TYPE_MONSTER)) return c:IsSetCard(0xdf) and not c:IsCode(11317977) and c:IsAbleToHand()
and ((c:IsFaceup() and c:IsLocation(LOCATION_EXTRA) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_PENDULUM))
or (c:IsLocation(LOCATION_EXTRA) and c:IsType(TYPE_MONSTER)))
end end
function c11317977.thtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c11317977.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_EXTRA) and chkc:IsControler(tp) and c11317977.thfilter2(chkc) end if chk==0 then return Duel.IsExistingMatchingCard(c11317977.thfilter2,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) end
if chk==0 then return Duel.IsExistingTarget(c11317977.thfilter2,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
end end
function c11317977.thop2(e,tp,eg,ep,ev,re,r,rp) function c11317977.thop2(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -27,13 +27,11 @@ end ...@@ -27,13 +27,11 @@ end
function c19254117.condition(e,tp,eg,ep,ev,re,r,rp) function c19254117.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated() return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end end
function c19254117.deffil(c)
return aux.nzdef(c) and c:IsFaceup()
end
function c19254117.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c19254117.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c19254117.deffil(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and aux.nzdef(chkc) end
if chk==0 then return Duel.IsExistingTarget(c19254117.deffil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(aux.nzdef,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SelectTarget(tp,c19254117.deffil,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.nzdef,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end end
function c19254117.activate(e,tp,eg,ep,ev,re,r,rp) function c19254117.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -21,11 +21,10 @@ function c23160024.initial_effect(c) ...@@ -21,11 +21,10 @@ function c23160024.initial_effect(c)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DRAW) e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_SZONE) e4:SetRange(LOCATION_FZONE)
e4:SetCode(EVENT_RELEASE) e4:SetCode(EVENT_RELEASE)
e4:SetProperty(EFFECT_FLAG_DELAY) e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(c23160024.drcon) e4:SetCondition(c23160024.drcon)
e4:SetTarget(c23160024.drtg)
e4:SetOperation(c23160024.drop) e4:SetOperation(c23160024.drop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--ritural --ritural
...@@ -44,21 +43,12 @@ end ...@@ -44,21 +43,12 @@ end
function c23160024.drcon(e,tp,eg,ep,ev,re,r,rp) function c23160024.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(23160024)<2 and eg:IsExists(c23160024.cfilter,1,nil,tp) return e:GetHandler():GetFlagEffect(23160024)<2 and eg:IsExists(c23160024.cfilter,1,nil,tp)
end end
function c23160024.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c23160024.drop(e,tp,eg,ep,ev,re,r,rp) function c23160024.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,e:GetHandler():GetCode()) Duel.Hint(HINT_CARD,0,e:GetHandler():GetCode())
e:GetHandler():RegisterFlagEffect(23160024,RESET_PHASE+PHASE_END,0,1) e:GetHandler():RegisterFlagEffect(23160024,RESET_PHASE+PHASE_END,0,1)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT) Duel.Draw(p,d,REASON_EFFECT)
end end
function c23160024.ritual_filter(c)
return c:IsCode()
end
function c23160024.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c23160024.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
...@@ -70,7 +60,8 @@ end ...@@ -70,7 +60,8 @@ end
function c23160024.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c23160024.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_PENDULUM) local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,TYPE_PENDULUM)
return Duel.IsExistingMatchingCard(c23160024.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,mg) end return Duel.IsExistingMatchingCard(c23160024.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end end
function c23160024.spop(e,tp,eg,ep,ev,re,r,rp) function c23160024.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -11,6 +11,7 @@ function c23377694.initial_effect(c) ...@@ -11,6 +11,7 @@ function c23377694.initial_effect(c)
e1:SetTarget(c23377694.atktg) e1:SetTarget(c23377694.atktg)
e1:SetOperation(c23377694.atkop) e1:SetOperation(c23377694.atkop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
...@@ -38,7 +39,7 @@ end ...@@ -38,7 +39,7 @@ end
function c23377694.atkop(e,tp,eg,ep,ev,re,r,rp) function c23377694.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local ct=Duel.GetMatchingGroupCount(c23377694.filter2,tp,LOCATION_MZONE,0,nil) local ct=Duel.GetMatchingGroupCount(c23377694.filter2,tp,LOCATION_MZONE,0,nil)
if tc:IsFaceup() and tc:IsRelateToEffect(e) then if ct>0 and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
...@@ -47,24 +48,26 @@ function c23377694.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,24 +48,26 @@ function c23377694.atkop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
end end
function c23377694.filter3(c,tp) function c23377694.cfilter(c,tp)
return c:IsSetCard(0x9f) and c:GetPreviousControler()==tp return c:IsSetCard(0x9f) and c:GetPreviousControler()==tp
end end
function c23377694.filter4(c,e,tp)
return (c:IsSetCard(0x9f) or c:IsSetCard(0x99)) and (c:GetSequence()==6 or c:GetSequence()==7) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c23377694.spcon(e,tp,eg,ep,ev,re,r,rp) function c23377694.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c23377694.filter3,1,nil,tp) return eg:IsExists(c23377694.cfilter,1,nil,tp)
end
function c23377694.spfilter(c,e,tp)
return (c:IsSetCard(0x9f) or c:IsSetCard(0x99)) and (c:GetSequence()==6 or c:GetSequence()==7) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c23377694.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c23377694.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c23377694.filter4,tp,LOCATION_SZONE,0,1,nil,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_SZONE) and c23377694.spfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c23377694.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c23377694.filter4,tp,LOCATION_SZONE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c23377694.spfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function c23377694.spop(e,tp,eg,ep,ev,re,r,rp) function c23377694.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and e:GetHandler():IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end end
end end
...@@ -40,15 +40,15 @@ function c24672164.fscon(e,g,gc,chkf) ...@@ -40,15 +40,15 @@ function c24672164.fscon(e,g,gc,chkf)
if gc then if gc then
local g1=g:Filter(Card.IsFusionSetCard,nil,0x9b) local g1=g:Filter(Card.IsFusionSetCard,nil,0x9b)
if not g1:IsContains(gc) then g1:AddCard(gc) end if not g1:IsContains(gc) then g1:AddCard(gc) end
local c1=g1:GetCount() local ct1=g1:GetCount()
local c2=g1:FilterCount(Card.IsFusionSetCard,nil,0x109b) local ct2=g1:FilterCount(Card.IsFusionSetCard,nil,0x109b)
return gc:IsSetCard(0x9b) and c1>=2 and c2>0 return gc:IsSetCard(0x9b) and ct1>=2 and ct2>0
end end
local g1=g:Filter(Card.IsFusionSetCard,nil,0x9b) local g1=g:Filter(Card.IsFusionSetCard,nil,0x9b)
local c1=g1:GetCount() local ct1=g1:GetCount()
local c2=g1:FilterCount(Card.IsFusionSetCard,nil,0x109b) local ct2=g1:FilterCount(Card.IsFusionSetCard,nil,0x109b)
if chkf~=PLAYER_NONE and not ag:IsExists(aux.FConditionCheckF,1,nil,chkf) then return false end if chkf~=PLAYER_NONE and not g1:IsExists(aux.FConditionCheckF,1,nil,chkf) then return false end
return c1>=2 and c2>0 return ct1>=2 and ct2>0
end end
function c24672164.fsop(e,tp,eg,ep,ev,re,r,rp,gc,chkf) function c24672164.fsop(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
if gc then if gc then
...@@ -78,12 +78,12 @@ function c24672164.fsop(e,tp,eg,ep,ev,re,r,rp,gc,chkf) ...@@ -78,12 +78,12 @@ function c24672164.fsop(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
end end
function c24672164.matcheck(e,c) function c24672164.matcheck(e,c)
local ct=c:GetMaterialCount() local ct=c:GetMaterialCount()
local ae=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
ae:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
ae:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
ae:SetValue(ct*300) e1:SetValue(ct*300)
ae:SetReset(RESET_EVENT+0xff0000) e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(ae) c:RegisterEffect(e1)
end end
function c24672164.thcon(e,tp,eg,ep,ev,re,r,rp) function c24672164.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -47,6 +47,6 @@ end ...@@ -47,6 +47,6 @@ end
function c32687071.cfilter(c) function c32687071.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xe0) return c:IsFaceup() and c:IsSetCard(0xe0)
end end
function c32687071.limcon(e,tp,eg,ep,ev,re,r,rp) function c32687071.limcon(e)
return Duel.IsExistingMatchingCard(c32687071.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c32687071.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end end
...@@ -45,7 +45,7 @@ end ...@@ -45,7 +45,7 @@ end
function c34522216.cfilter(c) function c34522216.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xe0) return c:IsFaceup() and c:IsSetCard(0xe0)
end end
function c34522216.limcon(e,tp,eg,ep,ev,re,r,rp) function c34522216.limcon(e)
return Duel.IsExistingMatchingCard(c34522216.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c34522216.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end end
function c34522216.limval(e,re,rp) function c34522216.limval(e,re,rp)
......
...@@ -27,8 +27,8 @@ function c45644898.thfilter(c) ...@@ -27,8 +27,8 @@ function c45644898.thfilter(c)
return c:IsType(TYPE_TUNER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:GetLevel()==1 and c:IsAbleToHand() return c:IsType(TYPE_TUNER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:GetLevel()==1 and c:IsAbleToHand()
end end
function c45644898.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c45644898.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c45644898.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c45644898.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c45644898.filter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(c45644898.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c45644898.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,c45644898.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
...@@ -45,23 +45,24 @@ function c45644898.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -45,23 +45,24 @@ function c45644898.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST) Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end end
function c45644898.gvfilter(c,e,tp) function c45644898.gvfilter(c,e,tp)
return c:IsType(TYPE_EFFECT) and c:IsAbleToGraveAsCost() return c:IsType(TYPE_EFFECT) and c:IsAbleToGrave()
and Duel.IsExistingMatchingCard(c45644898.spfilter,tp,LOCATION_GRAVE,0,1,c,e,tp) and Duel.IsExistingMatchingCard(c45644898.spfilter,tp,LOCATION_GRAVE,0,1,c,e,tp)
end end
function c45644898.spfilter(c,e,tp) function c45644898.spfilter(c,e,tp)
return c:IsSetCard(0xdd) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0xdd) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c45644898.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c45644898.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c45644898.cfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c45644898.gvfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c45644898.gvfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) if chk==0 then return Duel.IsExistingTarget(c45644898.gvfilter,tp,LOCATION_MZONE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 end and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
Duel.SelectTarget(tp,c45644898.gvfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c45644898.gvfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function c45644898.spop(e,tp,eg,ep,ev,re,r,rp) function c45644898.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) if tc:IsRelateToEffect(e)
and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and Duel.SendtoGrave(tc,REASON_EFFECT)~=0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
...@@ -10,6 +10,7 @@ function c46589034.initial_effect(c) ...@@ -10,6 +10,7 @@ function c46589034.initial_effect(c)
e1:SetTarget(c46589034.sptg) e1:SetTarget(c46589034.sptg)
e1:SetOperation(c46589034.spop) e1:SetOperation(c46589034.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE) e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
...@@ -21,38 +22,39 @@ function c46589034.cfilter(c) ...@@ -21,38 +22,39 @@ function c46589034.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xba) and c:IsLevelAbove(1) and c:GetAttack()~=0 and c:GetDefence()~=0 return c:IsFaceup() and c:IsSetCard(0xba) and c:IsLevelAbove(1) and c:GetAttack()~=0 and c:GetDefence()~=0
end end
function c46589034.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c46589034.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c46589034.cfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c46589034.cfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c46589034.cfilter,tp,LOCATION_MZONE,0,1,nil) if chk==0 then return Duel.IsExistingTarget(c46589034.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c46589034.cfilter,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectTarget(tp,c46589034.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
local c=g:GetFirst() local tc=g:GetFirst()
local atk=c:GetAttack() local atk=tc:GetAttack()
local def=c:GetDefence() local def=tc:GetDefence()
local val=0 local val=math.min(atk,def)
if atk<=def and atk>0 then val=atk
elseif def>0 then val=def end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,tp,val) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,tp,val)
end end
function c46589034.spop(e,tp,eg,ep,ev,re,r,rp) function c46589034.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not (c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) then return end if not (c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e)) then return end
local atk=tc:GetAttack() local atk=tc:GetAttack()
local def=tc:GetDefence() local def=tc:GetDefence()
local val=0 local val=math.min(atk,def)
if atk<=def and atk>0 then val=atk
elseif def>0 then val=def end
if Duel.Damage(tp,val,REASON_EFFECT)~=0 then if Duel.Damage(tp,val,REASON_EFFECT)~=0 then
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
if Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(tc:GetLevel()) e1:SetValue(tc:GetLevel())
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1) c:RegisterEffect(e1)
Duel.SpecialSummonComplete()
end
else
Duel.SendtoGrave(c,REASON_RULE)
end end
end end
end 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