Commit a542a12a authored by VanillaSalt's avatar VanillaSalt

fix (2/4)

parent 1b83a10a
...@@ -31,10 +31,10 @@ function c24550676.initial_effect(c) ...@@ -31,10 +31,10 @@ function c24550676.initial_effect(c)
--Destroy --Destroy
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(24550676,0)) e4:SetDescription(aux.Stringid(24550676,0))
e4:SetCategory(CATEGORY_COUNTER) e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DAMAGE_STEP_END) e4:SetCode(EVENT_DAMAGE_STEP_END)
e4:SetRange(LOCATION_MZONE) e4:SetCountLimit(1)
e4:SetCondition(c24550676.condition) e4:SetCondition(c24550676.condition)
e4:SetTarget(c24550676.target) e4:SetTarget(c24550676.target)
e4:SetOperation(c24550676.operation) e4:SetOperation(c24550676.operation)
...@@ -47,11 +47,10 @@ function c24550676.tgvalue(e,re,rp) ...@@ -47,11 +47,10 @@ function c24550676.tgvalue(e,re,rp)
return rp~=e:GetHandlerPlayer() return rp~=e:GetHandlerPlayer()
end end
function c24550676.condition(e,tp,eg,ep,ev,re,r,rp) function c24550676.condition(e,tp,eg,ep,ev,re,r,rp)
local atg=Duel.GetAttackTarget() return Duel.GetAttacker()==e:GetHandler() and Duel.GetAttackTarget()
return Duel.GetAttacker()==e:GetHandler() and atg
end end
function c24550676.filter(c) function c24550676.filter(c)
return c:IsFaceup() and c:IsDestructable() and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL return c:IsDestructable() and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end end
function c24550676.target(e,tp,eg,ep,ev,re,r,rp,chk) function c24550676.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24550676.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c24550676.filter,tp,0,LOCATION_MZONE,1,nil) end
......
...@@ -2,13 +2,7 @@ ...@@ -2,13 +2,7 @@
function c24672164.initial_effect(c) function c24672164.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
local e1=Effect.CreateEffect(c) aux.AddFusionProcFunFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x109b),aux.FilterBoolFunction(Card.IsFusionSetCard,0x9b),1,63,true)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_FUSION_MATERIAL)
e1:SetCondition(c24672164.fscon)
e1:SetOperation(c24672164.fsop)
c:RegisterEffect(e1)
--summon success --summon success
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
...@@ -27,55 +21,12 @@ function c24672164.initial_effect(c) ...@@ -27,55 +21,12 @@ function c24672164.initial_effect(c)
e4:SetCategory(CATEGORY_TOHAND) e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE) e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetCondition(c24672164.thcon) e4:SetCondition(c24672164.thcon)
e4:SetTarget(c24672164.thtg) e4:SetTarget(c24672164.thtg)
e4:SetOperation(c24672164.thop) e4:SetOperation(c24672164.thop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c24672164.fscon(e,g,gc,chkf)
if g==nil then
return false
end
if gc then
local g1=g:Filter(Card.IsFusionSetCard,nil,0x9b)
if not g1:IsContains(gc) then g1:AddCard(gc) end
local ct1=g1:GetCount()
local ct2=g1:FilterCount(Card.IsFusionSetCard,nil,0x109b)
return gc:IsSetCard(0x9b) and ct1>=2 and ct2>0
end
local g1=g:Filter(Card.IsFusionSetCard,nil,0x9b)
local ct1=g1:GetCount()
local ct2=g1:FilterCount(Card.IsFusionSetCard,nil,0x109b)
if chkf~=PLAYER_NONE and not g1:IsExists(aux.FConditionCheckF,1,nil,chkf) then return false end
return ct1>=2 and ct2>0
end
function c24672164.fsop(e,tp,eg,ep,ev,re,r,rp,gc,chkf)
if gc then
local g1=eg:Filter(Card.IsFusionSetCard,nil,0x9b)
local mg=Group.CreateGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local tc=g1:FilterSelect(tp,Card.IsFusionSetCard,1,1,nil,0x109b):GetFirst()
mg:AddCard(tc)
if g1:IsContains(tc) then g1:RemoveCard(tc) end
mg:AddCard(gc)
if g1:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(24672164,1)) then
local fg2=g1:Select(tp,1,63,tc)
mg:Merge(fg2)
end
Duel.SetFusionMaterial(mg)
return
end
local g1=eg:Filter(Card.IsFusionSetCard,nil,0x9b)
local mg=Group.CreateGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local tc=g1:FilterSelect(tp,Card.IsFusionSetCard,1,1,nil,0x109b):GetFirst()
mg:AddCard(tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
local fg2=g1:Select(tp,1,63,tc)
mg:Merge(fg2)
Duel.SetFusionMaterial(mg)
end
function c24672164.matcheck(e,c) function c24672164.matcheck(e,c)
local ct=c:GetMaterialCount() local ct=c:GetMaterialCount()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -101,7 +52,7 @@ function c24672164.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -101,7 +52,7 @@ function c24672164.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c24672164.thop(e,tp,eg,ep,ev,re,r,rp) function c24672164.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
end end
......
...@@ -24,4 +24,4 @@ function c26517393.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -24,4 +24,4 @@ function c26517393.op(e,tp,eg,ep,ev,re,r,rp)
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 end
\ No newline at end of file
...@@ -59,5 +59,5 @@ function c33300669.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -59,5 +59,5 @@ function c33300669.desop(e,tp,eg,ep,ev,re,r,rp)
end end
function c33300669.sumlimit(e,c,sump,sumtype,sumpos,targetp,se) function c33300669.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0xe0) return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0xe0)
and (e:GetHandler():GetSummonType()==SUMMON_TYPE_PENDULUM or e:GetHandler():GetFlagEffect(33300669)~=0) and (e:GetHandler():GetSummonType()==SUMMON_TYPE_PENDULUM or e:GetHandler():GetFlagEffect(33300669)~=0)
end end
...@@ -37,21 +37,23 @@ function c45467446.initial_effect(c) ...@@ -37,21 +37,23 @@ function c45467446.initial_effect(c)
c:RegisterEffect(e5) c:RegisterEffect(e5)
end end
function c45467446.rmfilter(c) function c45467446.rmfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove() return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
end end
function c45467446.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c45467446.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) and c45467446.rmfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) and c45467446.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingMatchingCard(c45467446.rmfilter,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(c45467446.rmfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.SelectTarget(tp,c45467446.rmfilter,tp,0,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,c45467446.rmfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end end
function c45467446.rmop(e,tp,eg,ep,ev,re,r,rp) function c45467446.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end end
function c45467446.spcon(e) function c45467446.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(e:GetHandler():GetControler(),0,LOCATION_MZONE)>0 return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end end
function c45467446.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c45467446.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end if chk==0 then return e:GetHandler():IsReleasable() end
...@@ -61,7 +63,8 @@ function c45467446.spfilter(c,e,tp) ...@@ -61,7 +63,8 @@ function c45467446.spfilter(c,e,tp)
return c:IsCode(89631139) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCode(89631139) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c45467446.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c45467446.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c45467446.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c45467446.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) 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 c45467446.spop(e,tp,eg,ep,ev,re,r,rp) function c45467446.spop(e,tp,eg,ep,ev,re,r,rp)
...@@ -71,4 +74,4 @@ function c45467446.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -71,4 +74,4 @@ function c45467446.spop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
end end
\ No newline at end of file
...@@ -7,7 +7,7 @@ function c48427163.initial_effect(c) ...@@ -7,7 +7,7 @@ function c48427163.initial_effect(c)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE+LOCATION_HAND) e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
e1:SetCost(c48427163.atkcost) e1:SetCost(c48427163.atkcost)
e1:SetTarget(c48427163.atktarget) e1:SetTarget(c48427163.atktg)
e1:SetOperation(c48427163.atkop) e1:SetOperation(c48427163.atkop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon --special summon
...@@ -17,7 +17,7 @@ function c48427163.initial_effect(c) ...@@ -17,7 +17,7 @@ function c48427163.initial_effect(c)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,48427163) e2:SetCountLimit(1,48427163)
e2:SetCost(c48427163.spcost) e2:SetCost(c48427163.spcost)
e2:SetTarget(c48427163.sptarget) e2:SetTarget(c48427163.sptg)
e2:SetOperation(c48427163.spop) e2:SetOperation(c48427163.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
...@@ -28,7 +28,7 @@ function c48427163.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -28,7 +28,7 @@ function c48427163.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end end
function c48427163.atktarget(e,tp,eg,ep,ev,re,r,rp,chk) function c48427163.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c48427163.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c48427163.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c48427163.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(c48427163.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
...@@ -52,7 +52,7 @@ function c48427163.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -52,7 +52,7 @@ function c48427163.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)
end end
function c48427163.sptarget(e,tp,eg,ep,ev,re,r,rp,chk) function c48427163.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c48427163.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c48427163.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
......
...@@ -32,7 +32,7 @@ function c50371210.initial_effect(c) ...@@ -32,7 +32,7 @@ function c50371210.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c50371210.spfilter(c,e,tp) function c50371210.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0xdd) return c:IsSetCard(0xdd) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c50371210.gvfilter(c) function c50371210.gvfilter(c)
return c:IsSetCard(0xdd) return c:IsSetCard(0xdd)
...@@ -43,9 +43,9 @@ end ...@@ -43,9 +43,9 @@ end
function c50371210.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c50371210.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c50371210.spfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c50371210.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c50371210.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.IsExistingTarget(c50371210.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.IsExistingTarget(c50371210.gvfilter,tp,LOCATION_GRAVE,0,3,nil) and Duel.IsExistingMatchingCard(c50371210.gvfilter,tp,LOCATION_GRAVE,0,3,nil)
and not Duel.IsExistingTarget(c50371210.cfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end and not Duel.IsExistingMatchingCard(c50371210.cfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c50371210.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c50371210.spfilter,tp,LOCATION_GRAVE,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)
...@@ -76,7 +76,6 @@ function c50371210.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -76,7 +76,6 @@ function c50371210.operation(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c50371210.rmop(e,tp,eg,ep,ev,re,r,rp) function c50371210.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetHandler():GetEquipTarget() local tc=e:GetHandler():GetEquipTarget()
if tc then if tc then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
......
...@@ -21,16 +21,16 @@ function c5067884.initial_effect(c) ...@@ -21,16 +21,16 @@ function c5067884.initial_effect(c)
e2:SetOperation(c5067884.atkop) e2:SetOperation(c5067884.atkop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c5067884.xfilter(c,tp) function c5067884.repfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD) and c:IsSetCard(0xd8) return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD) and c:IsSetCard(0xd8)
and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp)) and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp))
end end
function c5067884.reptg(e,tp,eg,ep,ev,re,r,rp,chk) function c5067884.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c5067884.xfilter,1,e:GetHandler(),tp) and not e:GetHandler():IsStatus(STATUS_DESTROY_CONFIRMED) end if chk==0 then return eg:IsExists(c5067884.repfilter,1,e:GetHandler(),tp) and not e:GetHandler():IsStatus(STATUS_DESTROY_CONFIRMED) end
return Duel.SelectYesNo(tp,aux.Stringid(5067884,0)) return Duel.SelectYesNo(tp,aux.Stringid(5067884,0))
end end
function c5067884.repval(e,c) function c5067884.repval(e,c)
return c5067884.xfilter(c,e:GetHandlerPlayer()) return c5067884.repfilter(c,e:GetHandlerPlayer())
end end
function c5067884.repop(e,tp,eg,ep,ev,re,r,rp) function c5067884.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT+REASON_REPLACE) Duel.Destroy(e:GetHandler(),REASON_EFFECT+REASON_REPLACE)
...@@ -47,14 +47,14 @@ end ...@@ -47,14 +47,14 @@ end
function c5067884.atktg(e,tp,eg,ep,ev,re,r,rp,chk) function c5067884.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local con1=c:GetFlagEffect(5067884)==0 local con1=c:GetFlagEffect(5067884)==0
local con2=c:GetFlagEffect(50678841)==0 local con2=c:GetFlagEffect(5067885)==0
if chk==0 then return con1 or con2 end if chk==0 then return con1 or con2 end
local op local op=0
if con1 and con2 then if con1 and con2 then
op=Duel.SelectOption(tp,aux.Stringid(5067884,1),aux.Stringid(5067884,2)) op=Duel.SelectOption(tp,aux.Stringid(5067884,1),aux.Stringid(5067884,2))
elseif con1 and not con2 then elseif con1 then
op=Duel.SelectOption(tp,aux.Stringid(5067884,1)) op=Duel.SelectOption(tp,aux.Stringid(5067884,1))
elseif not con1 and con2 then else
op=Duel.SelectOption(tp,aux.Stringid(5067884,2))+1 op=Duel.SelectOption(tp,aux.Stringid(5067884,2))+1
end end
e:SetLabel(op) e:SetLabel(op)
...@@ -65,7 +65,7 @@ function c5067884.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,7 +65,7 @@ function c5067884.atkop(e,tp,eg,ep,ev,re,r,rp)
if op==0 then if op==0 then
if c:IsFaceup() and c:IsRelateToEffect(e) then if c:IsFaceup() and c:IsRelateToEffect(e) then
c:RegisterFlagEffect(5067884,RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END,0,0) c:RegisterFlagEffect(5067884,RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END,0,0)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetCode(EFFECT_DIRECT_ATTACK)
...@@ -74,7 +74,7 @@ function c5067884.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -74,7 +74,7 @@ function c5067884.atkop(e,tp,eg,ep,ev,re,r,rp)
end end
elseif op==1 then elseif op==1 then
if c:IsFaceup() and c:IsRelateToEffect(e) then if c:IsFaceup() and c:IsRelateToEffect(e) then
c:RegisterFlagEffect(50678841,RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END,0,0) c:RegisterFlagEffect(5067885,RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END,0,0)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EXTRA_ATTACK) e2:SetCode(EFFECT_EXTRA_ATTACK)
......
...@@ -16,6 +16,7 @@ function c50954680.initial_effect(c) ...@@ -16,6 +16,7 @@ function c50954680.initial_effect(c)
e1:SetTarget(c50954680.target) e1:SetTarget(c50954680.target)
e1:SetOperation(c50954680.operation) e1:SetOperation(c50954680.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
...@@ -27,7 +28,6 @@ end ...@@ -27,7 +28,6 @@ end
function c50954680.condition(e,tp,eg,ep,ev,re,r,rp) function c50954680.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local rc=re:GetHandler() local rc=re:GetHandler()
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return re:IsActiveType(TYPE_MONSTER) and rc~=c and not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) return re:IsActiveType(TYPE_MONSTER) and rc~=c and not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end end
function c50954680.target(e,tp,eg,ep,ev,re,r,rp,chk) function c50954680.target(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -40,14 +40,16 @@ function c50954680.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -40,14 +40,16 @@ function c50954680.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c50954680.operation(e,tp,eg,ep,ev,re,r,rp) function c50954680.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev) Duel.NegateActivation(ev)
local c=e:GetHandler()
local rc=re:GetHandler() local rc=re:GetHandler()
if rc:IsRelateToEffect(re) and Duel.Destroy(rc,REASON_EFFECT)~=0 and rc:GetBaseAttack()>=0 then if rc:IsRelateToEffect(re) and Duel.Destroy(rc,REASON_EFFECT)~=0 and rc:GetBaseAttack()>=0
local e1=Effect.CreateEffect(e:GetHandler()) and c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
e1:SetValue(rc:GetBaseAttack()) e1:SetValue(rc:GetBaseAttack())
e:GetHandler():RegisterEffect(e1) c:RegisterEffect(e1)
end end
end end
function c50954680.atkcon(e,tp,eg,ep,ev,re,r,rp) function c50954680.atkcon(e,tp,eg,ep,ev,re,r,rp)
...@@ -59,11 +61,11 @@ function c50954680.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -59,11 +61,11 @@ function c50954680.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local bc=c:GetBattleTarget() local bc=c:GetBattleTarget()
if c:IsRelateToBattle() and c:IsFaceup() and bc:IsRelateToBattle() and bc:IsFaceup() then if c:IsRelateToBattle() and c:IsFaceup() and bc:IsRelateToBattle() and bc:IsFaceup() then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE_CAL) e1:SetReset(RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(bc:GetAttack()) e1:SetValue(bc:GetAttack())
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
end end
...@@ -33,8 +33,8 @@ function c51777272.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -33,8 +33,8 @@ function c51777272.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 return Duel.GetCurrentPhase()==PHASE_MAIN1
end end
function c51777272.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c51777272.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c51777272.matfil,1,e:GetHandler()) end if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,e:GetHandler(),0xdf) end
local g=Duel.SelectReleaseGroup(tp,c51777272.matfil,1,1,e:GetHandler()) local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,e:GetHandler(),0xdf)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c51777272.operation(e,tp,eg,ep,ev,re,r,rp) function c51777272.operation(e,tp,eg,ep,ev,re,r,rp)
...@@ -90,4 +90,4 @@ end ...@@ -90,4 +90,4 @@ end
function c51777272.damop(e,tp,eg,ep,ev,re,r,rp) function c51777272.damop(e,tp,eg,ep,ev,re,r,rp)
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.Damage(p,d,REASON_EFFECT) Duel.Damage(p,d,REASON_EFFECT)
end end
\ No newline at end of file
...@@ -39,8 +39,8 @@ function c58600555.ovfilter(c,tp,xyzc) ...@@ -39,8 +39,8 @@ function c58600555.ovfilter(c,tp,xyzc)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and (c:GetRank()==3 or c:GetRank()==4) and c:IsRace(RACE_INSECT) and c:IsCanBeXyzMaterial(xyzc) return c:IsFaceup() and c:IsType(TYPE_XYZ) and (c:GetRank()==3 or c:GetRank()==4) and c:IsRace(RACE_INSECT) and c:IsCanBeXyzMaterial(xyzc)
and c:CheckRemoveOverlayCard(tp,2,REASON_COST) and c:CheckRemoveOverlayCard(tp,2,REASON_COST)
end end
function c58600555.ovfilter2(c,tp,xyzc) function c58600555.ovfilter2(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:GetLevel()==5 and c:IsRace(RACE_INSECT) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsCanBeXyzMaterial(xyzc) return c:IsFaceup() and c:GetLevel()==5 and c:IsRace(RACE_INSECT) and c:IsAttribute(ATTRIBUTE_LIGHT)
end end
function c58600555.xyzcon(e,c,og) function c58600555.xyzcon(e,c,og)
if c==nil then return true end if c==nil then return true end
...@@ -83,13 +83,14 @@ function c58600555.tdcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -83,13 +83,14 @@ function c58600555.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end end
function c58600555.tdfil(c) function c58600555.tdfilter(c)
return c:IsPosition(POS_DEFENCE) and c:IsAbleToDeck() return c:IsPosition(POS_DEFENCE) and c:IsAbleToDeck()
end end
function c58600555.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c58600555.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c58600555.tdfil(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c58600555.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c58600555.tdfil,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(c58600555.tdfilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.SelectTarget(tp,c58600555.tdfil,tp,0,LOCATION_MZONE,1,1,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c58600555.tdfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end end
function c58600555.tdop(e,tp,eg,ep,ev,re,r,rp) function c58600555.tdop(e,tp,eg,ep,ev,re,r,rp)
...@@ -109,4 +110,4 @@ function c58600555.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -109,4 +110,4 @@ function c58600555.operation(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 and not g:GetFirst():IsHasEffect(EFFECT_NECRO_VALLEY) then if g:GetCount()>0 and not g:GetFirst():IsHasEffect(EFFECT_NECRO_VALLEY) then
Duel.Overlay(c,g) Duel.Overlay(c,g)
end end
end end
\ No newline at end of file
...@@ -60,7 +60,7 @@ function c58988903.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,7 +60,7 @@ function c58988903.activate(e,tp,eg,ep,ev,re,r,rp)
end end
function c58988903.cfilter(c,e,tp) function c58988903.cfilter(c,e,tp)
return c:IsSetCard(0xba) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() return c:IsSetCard(0xba) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c58988903.spfilter,tp,LOCATION_GRAVE,0,1,c,e,tp) and Duel.IsExistingTarget(c58988903.spfilter,tp,LOCATION_GRAVE,0,1,c,e,tp)
end end
function c58988903.spfilter(c,e,tp) function c58988903.spfilter(c,e,tp)
return c:IsSetCard(0xba) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0xba) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
...@@ -75,8 +75,7 @@ function c58988903.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -75,8 +75,7 @@ function c58988903.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c58988903.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c58988903.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c58988903.spfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c58988903.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
and Duel.IsExistingTarget(c58988903.spfilter,tp,LOCATION_GRAVE,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,c58988903.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c58988903.spfilter,tp,LOCATION_GRAVE,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)
...@@ -86,4 +85,4 @@ function c58988903.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -86,4 +85,4 @@ function c58988903.spop(e,tp,eg,ep,ev,re,r,rp)
if tc: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
\ No newline at end of file
...@@ -13,11 +13,11 @@ function c59432181.filter(c) ...@@ -13,11 +13,11 @@ function c59432181.filter(c)
return c:IsType(TYPE_FUSION) return c:IsType(TYPE_FUSION)
end end
function c59432181.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c59432181.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil) if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c59432181.filter,tp,LOCATION_EXTRA,0,1,nil) end and Duel.IsExistingMatchingCard(c59432181.filter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,0,1,1,nil) Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end end
function c59432181.activate(e,tp,eg,ep,ev,re,r,rp) function c59432181.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
...@@ -26,12 +26,18 @@ function c59432181.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -26,12 +26,18 @@ function c59432181.activate(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.SelectMatchingCard(tp,c59432181.filter,tp,LOCATION_EXTRA,0,1,1,nil) local cg=Duel.SelectMatchingCard(tp,c59432181.filter,tp,LOCATION_EXTRA,0,1,1,nil)
if cg:GetCount()==0 then return end if cg:GetCount()==0 then return end
Duel.ConfirmCards(1-tp,cg) Duel.ConfirmCards(1-tp,cg)
local code1,code2=cg:GetFirst():GetCode()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(59432181,0)) e1:SetDescription(aux.Stringid(59432181,0))
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_FUSION_CODE) e1:SetCode(EFFECT_ADD_FUSION_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(cg:GetFirst():GetCode()) e1:SetValue(code1)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end if code2 then
\ No newline at end of file local e2=e1:Clone()
e2:SetValue(code2)
tc:RegisterEffect(e2)
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