Commit 869be725 authored by wind2009's avatar wind2009

Fix

parent 7ac5586a
Pipeline #42060 canceled with stages
in 4 seconds
No preview for this file type
No preview for this file type
...@@ -29,7 +29,7 @@ function s.initial_effect(c) ...@@ -29,7 +29,7 @@ function s.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.matfilter2(c) function s.matfilter2(c)
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) return c:IsFaceup() and c:IsLocation(LOCATION_MZONE)
end end
function s.thcon(e,tp,eg,ep,ev,re,r,rp) function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonLocation(LOCATION_EXTRA) return e:GetHandler():IsSummonLocation(LOCATION_EXTRA)
......
...@@ -59,10 +59,11 @@ function s.cfilter(c,tp) ...@@ -59,10 +59,11 @@ function s.cfilter(c,tp)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsPreviousControler(tp) return c:IsAttribute(ATTRIBUTE_WATER) and c:IsPreviousControler(tp)
end end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp) function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp) local c=e:GetHandler()
and not c:IsPublic() return eg:IsExists(s.cfilter,1,nil,tp) and not c:IsPublic()
end end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsPublic() end if chk==0 then return not c:IsPublic() end
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -78,7 +79,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -78,7 +79,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.descon(e,tp,eg,ep,ev,re,r,rp) function s.descon(e,tp,eg,ep,ev,re,r,rp)
return c:IsSummonLocation(LOCATION_HAND+LOCATION_DECK) return e:GetHandler():IsSummonLocation(LOCATION_HAND+LOCATION_DECK)
end end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk) function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) end
......
...@@ -15,7 +15,7 @@ function s.initial_effect(c) ...@@ -15,7 +15,7 @@ function s.initial_effect(c)
--search --search
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0)) e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SEARCH) e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
...@@ -79,5 +79,5 @@ function s.valcheck(e,c) ...@@ -79,5 +79,5 @@ function s.valcheck(e,c)
end end
function s.eacon(e) function s.eacon(e)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsAttackAbove(c:GetBaseAttack()+1) return c:GetAttack()>c:GetBaseAttack()
end end
...@@ -61,7 +61,9 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,7 +61,9 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
else else
g=tg g=tg
end end
Duel.SpecialSummonComplete() if g and g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -89,7 +91,7 @@ function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -89,7 +91,7 @@ function s.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,nil,1,tp,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,nil,1,tp,LOCATION_MZONE)
end end
function s.netop(e,tp,eg,ep,ev,re,r,rp) function s.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.disfilter,tp,LOCATION_MZONE,0,1,1,aux.ExceptThisCard(e)) local g=Duel.SelectMatchingCard(tp,s.disfilter,tp,LOCATION_MZONE,0,1,1,aux.ExceptThisCard(e))
Duel.HintSelection(g) Duel.HintSelection(g)
......
...@@ -37,26 +37,27 @@ end ...@@ -37,26 +37,27 @@ end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ) return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end end
function s.filter(c,mc) function s.filter(c,mc,e,tp)
return c:IsSetCard(0x55) return c:IsSetCard(0x55)
and (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and (Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
or (mc:IsType(TYPE_XYZ) and c:IsCanOverlay())) or (mc:IsType(TYPE_XYZ) and c:IsCanOverlay()))
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e:GetHandler(),e,tp) end
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,c) local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,c,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
if c:IsRelateToChain() and c:IsType(TYPE_XYZ) and tc:IsCanOverlay() and (not (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 local ovchk=c:IsRelateToChain() and c:IsType(TYPE_XYZ) and tc:IsCanOverlay()
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)) or Duel.SelectOption(tp,1190,1152)==1) then if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
and (not ovchk or Duel.SelectYesNo(tp,aux.Stringid(id,1))) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
elseif ovchk then
Duel.Overlay(c,Group.FromCards(tc)) Duel.Overlay(c,Group.FromCards(tc))
else
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end end
end end
end end
...@@ -64,30 +65,40 @@ function s.discost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -64,30 +65,40 @@ function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,3,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,3,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,3,3,REASON_COST) e:GetHandler():RemoveOverlayCard(tp,3,3,REASON_COST)
end end
function s.rsfilter(c,ec) function s.rsfilter(c,ec,tp,chk)
local ng=Group.FromCards(c)
if ec then ng:AddCard(ec) end
return c:IsReleasableByEffect() return c:IsReleasableByEffect()
and (Duel.IsExistingMatchingCard(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,Group.FromCards(c,ec)) and (not chk or Duel.IsExistingMatchingCard(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ng))
or not ec and Duel.IsExistingMatchingCard(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c))
end end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk) function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.rsfilter,tp,LOCATION_MZONE,0,1,c,c) end local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.rsfilter,tp,LOCATION_MZONE,0,1,c,c,tp,true) end
local g=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c) local g=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount()-1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount()-1,0,0)
end end
function s.disop(e,tp,eg,ep,ev,re,r,rp) function s.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=Duel.SelectMatchingCard(tp,Card.IsReleasableByEffect,tp,LOCATION_MZONE,0,1,1,aux.ExceptThisCard(e),aux.ExceptThisCard(e)) local rg=nil
local tc=sg:GetFirst() local ec=aux.ExceptThisCard(e)
if Duel.Release(tc,REASON_EFFECT)~=0 then if Duel.IsExistingMatchingCard(s.rsfilter,tp,LOCATION_MZONE,0,1,ec,ec,tp,true) then
rg=Duel.SelectMatchingCard(tp,s.rsfilter,tp,LOCATION_MZONE,0,1,1,ec,ec,tp,true)
else
rg=Duel.SelectMatchingCard(tp,s.rsfilter,tp,LOCATION_MZONE,0,1,1,ec,ec,tp,false)
end
if not rg or rg:GetCount()==0 then return end
if Duel.Release(rg,REASON_EFFECT)~=0 then
local g=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e)) local g=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
for tc in aux.Next(g) do for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET) e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
......
...@@ -35,8 +35,7 @@ function s.nefilter(c) ...@@ -35,8 +35,7 @@ function s.nefilter(c)
return aux.NegateMonsterFilter(c) or not c:IsAttack(0) or not c:IsAttribute(ATTRIBUTE_DARK) return aux.NegateMonsterFilter(c) or not c:IsAttack(0) or not c:IsAttribute(ATTRIBUTE_DARK)
end end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.nefilter(chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.nefilter(chkc) and chkc~=e:GetHandler() end
and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(s.nefilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingTarget(s.nefilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,s.nefilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler()) local g=Duel.SelectTarget(tp,s.nefilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler())
...@@ -76,17 +75,21 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -76,17 +75,21 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp return rp==1-tp
end end
function s.filter1(c,e) function s.filter1(c,e)
return c:IsOnField() and c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and not c:IsImmuneToEffect(e) return c:IsOnField() and c:IsFaceup() and c:IsFusionAttribute(ATTRIBUTE_DARK) and not c:IsImmuneToEffect(e)
end end
function s.filter2(c,e,tp,m,f,gc,chkf) function s.filter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and c:IsAttribute(ATTRIBUTE_DARK) and (not f or f(c)) return c:IsType(TYPE_FUSION) and c:IsAttribute(ATTRIBUTE_DARK) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf)
end end
function s.ffiltr(c,e)
return c:IsFaceup() and c:IsCanBeFusionMaterial() and c:IsFusionAttribute(ATTRIBUTE_DARK)
and (not e or not c:IsImmuneToEffect(e))
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then if chk==0 then
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil) local mg1=Duel.GetFusionMaterial(tp):Filter(s.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(s.ffiltr,tp,0,LOCATION_MZONE,nil) local mg2=Duel.GetMatchingGroup(s.ffiltr,tp,0,LOCATION_MZONE,nil)
mg1:Merge(mg2) mg1:Merge(mg2)
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf) local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
...@@ -103,9 +106,6 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -103,9 +106,6 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function s.ffiltr(c,e)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and (not e or not c:IsImmuneToEffect(e))
end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local chkf=tp local chkf=tp
...@@ -129,13 +129,13 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -129,13 +129,13 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil) local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst() local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or ce and not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,c,chkf) local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,c,chkf)
tc:SetMaterial(mat1) tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect() Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else elseif ce then
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,c,chkf) local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,c,chkf)
local fop=ce:GetOperation() local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2) fop(ce,e,tp,tc,mat2)
......
...@@ -7,12 +7,12 @@ function s.initial_effect(c) ...@@ -7,12 +7,12 @@ function s.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--control --control
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_CONTROL) e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END+TIMINGS_CHECK_MONSTER) e1:SetHintTiming(TIMING_BATTLE_START+TIMING_BATTLE_END+TIMINGS_CHECK_MONSTER)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCondition(s.cocon) e1:SetCondition(s.cocon)
e1:SetTarget(s.cotg) e1:SetTarget(s.cotg)
...@@ -20,6 +20,7 @@ function s.initial_effect(c) ...@@ -20,6 +20,7 @@ function s.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon --special summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
...@@ -32,8 +33,7 @@ function s.initial_effect(c) ...@@ -32,8 +33,7 @@ function s.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.cocon(e,tp,eg,ep,ev,re,r,rp) function s.cocon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() return Duel.IsBattlePhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end end
function s.cfilter(c,ec) function s.cfilter(c,ec)
local zone=bit.band(ec:GetLinkedZone(),0x1f) local zone=bit.band(ec:GetLinkedZone(),0x1f)
......
...@@ -18,12 +18,13 @@ function s.initial_effect(c) ...@@ -18,12 +18,13 @@ function s.initial_effect(c)
e2:SetCategory(CATEGORY_DAMAGE) e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BE_BATTLE_TARGET) e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetTargetCard(s.damtg2) e2:SetCountLimit(1)
e2:SetTarget(s.damtg2)
e2:SetOperation(s.damop2) e2:SetOperation(s.damop2)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function s.costfilter(c) function s.costfilter(c)
return c:IsFacedown() and c:IsAbleToGraveAsCost() return c:IsFacedown() and c:IsAbleToGraveAsCost() and c:GetSequence()<5
end end
function s.damcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_SZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_SZONE,0,1,nil) end
...@@ -52,24 +53,27 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,24 +53,27 @@ function s.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function s.damcon(e,re,val,r,rp,rc) function s.damcon(e,re,val,r,rp,rc)
if not re or not re:IsActiveType(TYPE_MONSTER) or bit.band(r,REASON_EFFECT)==0 then return 0 end if bit.band(r,REASON_EFFECT)~=0 and re and re:IsActiveType(TYPE_MONSTER) then
if re:GetHandler():IsRace(RACE_FIEND) then return val else return 0 end if re:GetHandler():IsRace(RACE_FIEND) then return val else return 0 end
else
return val
end
end end
function s.filter(c) function s.filter(c)
return c:IsPosition(POS_ATTACK) return c:IsPosition(POS_ATTACK)
end end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.damtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,0,LOCATION_MZONE,1,nil) end
local ct=Duel.GetMatchingGroupCount(s.filter,tp,0,LOCATION_MZONE,nil) local ct=Duel.GetMatchingGroupCount(s.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetTargetPlayer(1-tp) Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(ct*500) Duel.SetTargetParam(ct*500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*500) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*500)
end end
function s.damop(e,tp,eg,ep,ev,re,r,rp) function s.damop2(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(s.filter,tp,0,LOCATION_MZONE,nil) local ct=Duel.GetMatchingGroupCount(s.filter,tp,0,LOCATION_MZONE,nil)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
if Duel.Damage(p,ct*500,REASON_EFFECT)~=0 then if Duel.Damage(p,ct*500,REASON_EFFECT)~=0 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1) Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1)
end end
end end
\ No newline at end of file
...@@ -13,6 +13,7 @@ function s.initial_effect(c) ...@@ -13,6 +13,7 @@ function s.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--effect --effect
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
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)
...@@ -42,10 +43,9 @@ end ...@@ -42,10 +43,9 @@ end
function s.effcon(e,tp,eg,ep,ev,re,r,rp) function s.effcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_HAND,0,nil)==0 return Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_HAND,0,nil)==0
end end
function s.effpop(e,tp,eg,ep,ev,re,r,rp) function s.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local b1=Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_DECK,0,1,nil) local b1=Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_DECK,1,nil)
local b2=true local b2=true
local op=0 local op=0
if b1 or b2 then if b1 or b2 then
...@@ -56,10 +56,7 @@ function s.effpop(e,tp,eg,ep,ev,re,r,rp) ...@@ -56,10 +56,7 @@ function s.effpop(e,tp,eg,ep,ev,re,r,rp)
if op==1 then if op==1 then
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
local g1=Duel.GetDecktopGroup(tp,1) local g1=Duel.GetDecktopGroup(tp,1)
Duel.ConfirmDecktop(1-tp,1)
local g2=Duel.GetDecktopGroup(1-tp,1)
local res1=g1:GetFirst():IsType(TYPE_MONSTER) local res1=g1:GetFirst():IsType(TYPE_MONSTER)
local res2=g2:GetFirst():IsType(TYPE_MONSTER)
if res1 then if res1 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
...@@ -70,21 +67,8 @@ function s.effpop(e,tp,eg,ep,ev,re,r,rp) ...@@ -70,21 +67,8 @@ function s.effpop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
else else
Duel.Damage(tp,4000,REASON_EFFECT,true) Duel.Damage(tp,4000,REASON_EFFECT)
end end
if res2 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_REFLECT_DAMAGE)
e1:SetTargetRange(0,1)
e1:SetValue(s.val)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
else
Duel.Damage(1-tp,4000,REASON_EFFECT,true)
end
Duel.RDComplete()
elseif op==2 then elseif op==2 then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
......
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