Commit a350992d authored by REIKAI's avatar REIKAI 💬

bug fix

parent 9b39e165
Pipeline #22838 passed with stages
in 28 minutes and 43 seconds
No preview for this file type
...@@ -80,9 +80,15 @@ function c21520193.sctg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -80,9 +80,15 @@ function c21520193.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=4 end if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=4 end
end end
function c21520193.scop(e,tp,eg,ep,ev,re,r,rp) function c21520193.scop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<4 then return end local dct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
local mg=Duel.GetDecktopGroup(tp,4) if dct<0 then return end
Duel.ConfirmDecktop(tp,4) local dtt={}
for ic=1,math.min(4,dct) do
table.insert(dtt,ic)
end
local ann=Duel.AnnounceNumber(tp,table.unpack(dtt))
local mg=Duel.GetDecktopGroup(tp,ann)
Duel.ConfirmDecktop(tp,ann)
if mg:GetCount()>0 then if mg:GetCount()>0 then
mg:AddCard(e:GetHandler()) mg:AddCard(e:GetHandler())
local ct=0 local ct=0
...@@ -90,12 +96,16 @@ function c21520193.scop(e,tp,eg,ep,ev,re,r,rp) ...@@ -90,12 +96,16 @@ function c21520193.scop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg) local cg=Duel.SelectSynchroMaterial(tp,sg:GetFirst(),nil,nil,2,ann,e:GetHandler(),mg)
local cg=(sg:GetFirst()):GetMaterial()
mg:Sub(cg) mg:Sub(cg)
ct=mg:GetCount() ct=mg:GetCount()
Duel.Remove(mg,POS_FACEUP,REASON_EFFECT) Duel.Remove(mg,POS_FACEUP,REASON_EFFECT)
Duel.Damage(tp,ct*1000,REASON_RULE) Duel.Damage(tp,ct*1000,REASON_RULE)
sg:GetFirst():SetMaterial(cg)
Duel.SendtoGrave(cg,REASON_MATERIAL+REASON_SYNCHRO)
Duel.SpecialSummon(sg:GetFirst(),SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
sg:GetFirst():CompleteProcedure()
-- Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg)
else else
mg:RemoveCard(e:GetHandler()) mg:RemoveCard(e:GetHandler())
ct=mg:GetCount() ct=mg:GetCount()
......
...@@ -31,14 +31,14 @@ function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -31,14 +31,14 @@ function s.chtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function s.chop(e,tp,eg,ep,ev,re,r,rp) function s.chop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local ec=tc:GetEquipTarget()
if tc and tc:IsRelateToEffect(e) then if tc and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetCode()) local tg=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetCode())
local tc2=tg:GetFirst() local tc2=tg:GetFirst()
local flag=0 local flag=0
if tc2:IsType(TYPE_EQUIP) and Hnk.eqfilter(tc2,ec,tp) then local ec=tc:GetPreviousEquipTarget()
if tc2:IsType(TYPE_EQUIP) and ec~=nil and Hnk.eqfilter(tc2,ec,tp) then
if not tc2:IsAbleToHand() then if not tc2:IsAbleToHand() then
flag=1 flag=1
elseif Duel.SelectYesNo(tp,aux.Stringid(id,2)) then elseif Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
......
...@@ -14,14 +14,14 @@ function s.eff1(c) ...@@ -14,14 +14,14 @@ function s.eff1(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.filter(c,tp) function s.filter(c,tp)
return c:IsSetCard(0x431) and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_GRAVE,0,1,nil,c,tp) return c:IsSetCard(0x431) and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_GRAVE,0,1,nil,c,tp)
end end
function s.eqfilter(c,tc,tp) function s.eqfilter(c,tc,tp)
return c:IsType(TYPE_EQUIP) and c:CheckEquipTarget(tc) and c:CheckUniqueOnField(tp,LOCATION_SZONE) return c:IsType(TYPE_EQUIP) and c:CheckEquipTarget(tc) and c:CheckUniqueOnField(tp,LOCATION_SZONE)
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>1
and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil,tp) end and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,tp) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,tp)
...@@ -32,7 +32,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -32,7 +32,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp) local g=Duel.SelectMatchingCard(tp,s.eqfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tc,tp)
local eqc=g:GetFirst() local eqc=g:GetFirst()
if Duel.Equip(tp,eqc,tc) then if Duel.Equip(tp,eqc,tc) then
Hnk.public(e:GetHandler(),id,tp) Hnk.public(e:GetHandler(),id,tp)
...@@ -41,7 +41,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -41,7 +41,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
end end
function s.search(c) function s.search(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
......
...@@ -34,16 +34,22 @@ function c50223165.lcheck(g,lc) ...@@ -34,16 +34,22 @@ function c50223165.lcheck(g,lc)
return g:GetClassCount(Card.GetPreviousLocation)==g:GetCount() return g:GetClassCount(Card.GetPreviousLocation)==g:GetCount()
end end
function c50223165.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c50223165.negtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsAbleToGraveAsCost() end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsAbleToGrave() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToGraveAsCost,tp,LOCATION_MZONE,0,1,nil,tp) end if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToGrave,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_MZONE,0,1,1,nil,tp) local g=Duel.SelectTarget(tp,Card.IsAbleToGrave,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end end
function c50223165.negop(e,tp,eg,ep,ev,re,r,rp) function c50223165.negop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local seq=tc:GetSequence() local seq=tc:GetSequence()
if seq==5 then
seq=1
else if seq==6 then
seq=3
end
end
local fid=tc:GetFieldID() local fid=tc:GetFieldID()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
......
...@@ -36,7 +36,7 @@ function c60150507.initial_effect(c) ...@@ -36,7 +36,7 @@ function c60150507.initial_effect(c)
Duel.AddCustomActivityCounter(60150507,ACTIVITY_SPSUMMON,c60150507.counterfilter) Duel.AddCustomActivityCounter(60150507,ACTIVITY_SPSUMMON,c60150507.counterfilter)
end end
function c60150507.counterfilter(c) function c60150507.counterfilter(c)
return not (c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FIEND)) return (c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FIEND))
end end
function c60150507.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c60150507.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(60150507,tp,ACTIVITY_SPSUMMON)==0 end if chk==0 then return Duel.GetCustomActivityCount(60150507,tp,ACTIVITY_SPSUMMON)==0 end
......
--现世的赤龙唤士 索妮娅 --现世的赤龙唤士 索妮娅
local m=60159906 function c60159906.initial_effect(c)
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--splimit --splimit
local e00=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e00:SetType(EFFECT_TYPE_SINGLE) e6:SetType(EFFECT_TYPE_SINGLE)
e00:SetCode(EFFECT_SPSUMMON_COST) e6:SetCode(EFFECT_SPSUMMON_COST)
e00:SetCost(c60159906.e00cost) e6:SetCost(c60159906.e00cost)
c:RegisterEffect(e00) c:RegisterEffect(e6)
--special summon rule --special summon rule
local e0=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD) e5:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC) e5:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE) e5:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_EXTRA) e5:SetRange(LOCATION_EXTRA)
e0:SetValue(SUMMON_TYPE_LINK) e5:SetValue(SUMMON_TYPE_LINK)
e0:SetCondition(c60159906.sprcon) e5:SetCondition(c60159906.sprcon)
e0:SetOperation(c60159906.sprop) e5:SetOperation(c60159906.sprop)
c:RegisterEffect(e0) c:RegisterEffect(e5)
--spsummon condition --spsummon condition
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(cm.linklimit) e1:SetValue(c60159906.linklimit)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--remove --remove
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -36,9 +34,9 @@ function cm.initial_effect(c) ...@@ -36,9 +34,9 @@ function cm.initial_effect(c)
e3:SetCategory(CATEGORY_TODECK+CATEGORY_REMOVE) e3:SetCategory(CATEGORY_TODECK+CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(cm.con) e3:SetCondition(c60159906.con)
e3:SetTarget(cm.tg) e3:SetTarget(c60159906.tg)
e3:SetOperation(cm.op) e3:SetOperation(c60159906.op)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c60159906.e00cost(e,c,tp,st) function c60159906.e00cost(e,c,tp,st)
...@@ -78,36 +76,36 @@ function c60159906.sprop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -78,36 +76,36 @@ function c60159906.sprop(e,tp,eg,ep,ev,re,r,rp,c)
c:SetMaterial(sg) c:SetMaterial(sg)
Duel.SendtoGrave(sg,REASON_COST+REASON_LINK+REASON_MATERIAL) Duel.SendtoGrave(sg,REASON_COST+REASON_LINK+REASON_MATERIAL)
end end
function cm.linklimit(e,se,sp,st) function c60159906.linklimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK return bit.band(st,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end end
function cm.con(e,tp,eg,ep,ev,re,r,rp) function c60159906.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end end
function cm.filter(c) function c60159906.filter(c)
return c:IsAbleToDeck() return c:IsAbleToDeck()
end end
function cm.filter2(c) function c60159906.filter2(c)
return not (c:IsAttribute(ATTRIBUTE_EARTH) or c:IsAttribute(ATTRIBUTE_WATER) return not (c:IsAttribute(ATTRIBUTE_EARTH) or c:IsAttribute(ATTRIBUTE_WATER)
or c:IsAttribute(ATTRIBUTE_FIRE) or c:IsAttribute(ATTRIBUTE_WIND)) and c:IsType(TYPE_MONSTER) or c:IsAttribute(ATTRIBUTE_FIRE) or c:IsAttribute(ATTRIBUTE_WIND)) and c:IsType(TYPE_MONSTER)
and c:IsAbleToRemove() and c:IsAbleToRemove()
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) function c60159906.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND,e:GetHandler()) local g=Duel.GetMatchingGroup(c60159906.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,99,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,99,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,99,1-tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,99,1-tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA)
Duel.SetChainLimit(aux.FALSE) Duel.SetChainLimit(aux.FALSE)
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function c60159906.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND,e:GetHandler()) local g=Duel.GetMatchingGroup(c60159906.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND,e:GetHandler())
if Duel.SendtoDeck(g,nil,2,REASON_EFFECT) then Duel.BreakEffect() if Duel.SendtoDeck(g,nil,2,REASON_EFFECT) then Duel.BreakEffect()
local g1=Duel.GetFieldGroup(tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA,0) local g1=Duel.GetFieldGroup(tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA,0)
local g2=Duel.GetFieldGroup(tp,0,LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA) local g2=Duel.GetFieldGroup(tp,0,LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA)
Duel.ConfirmCards(1-tp,g1) Duel.ConfirmCards(1-tp,g1)
Duel.ConfirmCards(tp,g2) Duel.ConfirmCards(tp,g2)
local g3=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA,LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA,nil) local g3=Duel.GetMatchingGroup(c60159906.filter2,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA,LOCATION_GRAVE+LOCATION_DECK+LOCATION_EXTRA,nil)
Duel.Remove(g3,POS_FACEDOWN,REASON_EFFECT) Duel.Remove(g3,POS_FACEDOWN,REASON_EFFECT)
Duel.ShuffleDeck(tp) Duel.ShuffleDeck(tp)
Duel.ShuffleDeck(1-tp) Duel.ShuffleDeck(1-tp)
......
...@@ -40,7 +40,7 @@ function cm.thfilter(c,e,tp) ...@@ -40,7 +40,7 @@ function cm.thfilter(c,e,tp)
return c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) return c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(tp,math.ceil(Duel.GetLP(1-tp)/2)) Duel.SetLP(tp,math.ceil(Duel.GetLP(tp)/2))
local sg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil,e,tp) local sg=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil,e,tp)
if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then if sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
......
...@@ -69,6 +69,7 @@ end ...@@ -69,6 +69,7 @@ end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp) function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsSummonType(SUMMON_TYPE_LINK) then return end if not c:IsSummonType(SUMMON_TYPE_LINK) then return end
if c:GetMaterial():GetFirst():isty then return end
local e1_1=Effect.CreateEffect(c) local e1_1=Effect.CreateEffect(c)
e1_1:SetType(EFFECT_TYPE_SINGLE) e1_1:SetType(EFFECT_TYPE_SINGLE)
e1_1:SetCode(EFFECT_SET_ATTACK_FINAL) e1_1:SetCode(EFFECT_SET_ATTACK_FINAL)
......
...@@ -4,12 +4,19 @@ local cm=_G["c"..m] ...@@ -4,12 +4,19 @@ local cm=_G["c"..m]
Duel.LoadScript("81901011.lua") Duel.LoadScript("81901011.lua")
function cm.initial_effect(c) function cm.initial_effect(c)
--spsummon limit --spsummon limit
local e00=Effect.CreateEffect(c)
e00:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e00:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e00:SetCode(EVENT_SPSUMMON_SUCCESS)
e00:SetCondition(cm.hspcon1)
e00:SetOperation(cm.hspop1)
c:RegisterEffect(e00)
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE) e0:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS) e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCondition(cm.hspcon2) e0:SetCondition(cm.hspcon2)
e0:SetOperation(cm.hspop) e0:SetOperation(cm.hspop2)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--SpecialSummon --SpecialSummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -31,14 +38,15 @@ function cm.initial_effect(c) ...@@ -31,14 +38,15 @@ function cm.initial_effect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.drcon)
e3:SetOperation(cm.drop) e3:SetOperation(cm.drop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
--splimit --splimit
function cm.hspcon2(e,tp,eg,ep,ev,re,r,rp) function cm.hspcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL) return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL) and e:GetHandler():GetControler()==e:GetHandler():GetOwner()
end end
function cm.hspop(e,tp,eg,ep,ev,re,r,rp) function cm.hspop1(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
...@@ -48,8 +56,21 @@ function cm.hspop(e,tp,eg,ep,ev,re,r,rp) ...@@ -48,8 +56,21 @@ function cm.hspop(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)
end end
function cm.hspcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL) and e:GetHandler():GetControler()~=e:GetHandler():GetOwner()
end
function cm.hspop2(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se) function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:GetBaseAttack()==0 and c:IsType(TYPE_MONSTER)) return c:GetBaseAttack()~=0
end end
--spsummon --spsummon
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -66,7 +87,7 @@ end ...@@ -66,7 +87,7 @@ end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local rg=eg:Filter(cm.cfilter,nil,tp) local rg=eg:Filter(cm.cfilter,nil,tp)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp) end if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rg,rg:GetCount(),1-tp,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_REMOVE,rg,rg:GetCount(),1-tp,LOCATION_MZONE)
local tc=rg:GetFirst() local tc=rg:GetFirst()
...@@ -83,7 +104,7 @@ end ...@@ -83,7 +104,7 @@ end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local rg=eg:Filter(cm.cfilter,nil,tp) local rg=eg:Filter(cm.cfilter,nil,tp)
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEUP)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end end
......
...@@ -55,7 +55,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,7 +55,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then if g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINTMSG_SELECT,tp,HINTMSG_OPERATECARD) Duel.Hint(HINTMSG_SELECT,tp,HINTMSG_OPERATECARD)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
local tc=g:GetFirst() local tc=sg:GetFirst()
if tc then if tc then
local b1=tc:IsSSetable() local b1=tc:IsSSetable()
local b2=tc:IsForbidden() local b2=tc:IsForbidden()
......
...@@ -7,6 +7,7 @@ function c88178006.initial_effect(c) ...@@ -7,6 +7,7 @@ function c88178006.initial_effect(c)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,88178006) e1:SetCountLimit(1,88178006)
e1:SetCondition(c88178006.condition)
e1:SetTarget(c88178006.target) e1:SetTarget(c88178006.target)
e1:SetOperation(c88178006.operation) e1:SetOperation(c88178006.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -27,6 +28,12 @@ end ...@@ -27,6 +28,12 @@ end
function c88178006.counterfilter(c) function c88178006.counterfilter(c)
return c:IsSetCard(0x3591) return c:IsSetCard(0x3591)
end end
function c88178006.cfilter(c)
return c:IsFaceup() and c:IsCode(88178002)
end
function c88178006.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c88178006.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c88178006.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c88178006.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_ONFIELD) and aux.NegateEffectMonsterFilter(chkc) and Duel.GetCustomActivityCount(88179006,tp,ACTIVITY_SPSUMMON)==0 end if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_ONFIELD) and aux.NegateEffectMonsterFilter(chkc) and Duel.GetCustomActivityCount(88179006,tp,ACTIVITY_SPSUMMON)==0 end
if chk==0 then return Duel.IsExistingTarget(aux.NegateEffectMonsterFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(aux.NegateEffectMonsterFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
...@@ -69,7 +76,7 @@ function c88178006.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -69,7 +76,7 @@ function c88178006.operation(e,tp,eg,ep,ev,re,r,rp)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3) tc:RegisterEffect(e3)
end end
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
end end
......
...@@ -100,7 +100,7 @@ function c88178007.tnfilter(c) ...@@ -100,7 +100,7 @@ function c88178007.tnfilter(c)
end end
function c88178007.tntg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c88178007.tntg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) end if chkc then return chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(c88178007.tnfilter,tp,LOCATION_ONFIELD,0,1,nil,e,tp) end if chk==0 then return Duel.IsExistingTarget(c88178007.tnfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c88178007.tnfilter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SelectTarget(tp,c88178007.tnfilter,tp,LOCATION_MZONE,0,1,1,nil)
end end
......
...@@ -23,10 +23,9 @@ function c88178015.initial_effect(c) ...@@ -23,10 +23,9 @@ function c88178015.initial_effect(c)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE) e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetHintTiming(0,TIMING_END_PHASE) e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetCondition(c88178015.discon) e3:SetCondition(c88178015.thcon)
e3:SetTarget(c88178015.thtg) e3:SetTarget(c88178015.thtg)
e3:SetOperation(c88178015.thop) e3:SetOperation(c88178015.thop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
...@@ -36,12 +35,11 @@ function c88178015.initial_effect(c) ...@@ -36,12 +35,11 @@ function c88178015.initial_effect(c)
e4:SetType(EFFECT_TYPE_QUICK_O) e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN) e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_SZONE) e4:SetRange(LOCATION_SZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE) e4:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e4:SetCondition(c88178015.discon1) e4:SetCondition(c88178015.discon)
e4:SetTarget(c88178015.target) e4:SetTarget(c88178015.distg)
e4:SetOperation(c88178015.operation) e4:SetOperation(c88178015.disop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(88178015,2)) e5:SetDescription(aux.Stringid(88178015,2))
...@@ -49,7 +47,6 @@ function c88178015.initial_effect(c) ...@@ -49,7 +47,6 @@ function c88178015.initial_effect(c)
e5:SetType(EFFECT_TYPE_QUICK_O) e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN) e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_SZONE) e5:SetRange(LOCATION_SZONE)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE) e5:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e5:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e5:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e5:SetCondition(c88178015.rmcon) e5:SetCondition(c88178015.rmcon)
...@@ -62,7 +59,6 @@ function c88178015.initial_effect(c) ...@@ -62,7 +59,6 @@ function c88178015.initial_effect(c)
e6:SetType(EFFECT_TYPE_QUICK_O) e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetCode(EVENT_FREE_CHAIN) e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_SZONE) e6:SetRange(LOCATION_SZONE)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE) e6:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e6:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE) e6:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e6:SetCondition(c88178015.descon) e6:SetCondition(c88178015.descon)
...@@ -79,7 +75,7 @@ end ...@@ -79,7 +75,7 @@ end
function c88178015.filter(c) function c88178015.filter(c)
return c:IsCode(88178001) and c:IsFaceup() return c:IsCode(88178001) and c:IsFaceup()
end end
function c88178015.discon(e,tp,eg,ep,ev,re,r,rp) function c88178015.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c88178015.filter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c88178015.filter,tp,LOCATION_MZONE,0,1,nil)
end end
function c88178015.thfilter(c) function c88178015.thfilter(c)
...@@ -102,21 +98,21 @@ end ...@@ -102,21 +98,21 @@ end
function c88178015.filter1(c) function c88178015.filter1(c)
return c:IsCode(88178006) and c:IsFaceup() return c:IsCode(88178006) and c:IsFaceup()
end end
function c88178015.discon1(e,tp,eg,ep,ev,re,r,rp) function c88178015.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c88178015.filter1,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c88178015.filter1,tp,LOCATION_MZONE,0,1,nil)
end end
function c88178015.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c88178015.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and aux.NegateAnyFilter(chkc) end if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and aux.NegateAnyFilter(chkc) end
if chk==0 then return Duel.GetFlagEffect(tp,88179015)==0 and Duel.IsExistingTarget(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.GetFlagEffect(tp,88179015)==0 and Duel.IsExistingTarget(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RegisterFlagEffect(tp,88179015,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,88179015,RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,0,0)
end end
function c88178015.operation(e,tp,eg,ep,ev,re,r,rp) function c88178015.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local tc=Duel.SelectMatchingCard(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil) local tc=Duel.SelectMatchingCard(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil)
if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then if tc then
Duel.NegateRelatedChain(tc,RESET_TURN_SET) Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -64,13 +64,13 @@ function c88178023.descon(e,tp,eg,ep,ev,re,r,rp) ...@@ -64,13 +64,13 @@ function c88178023.descon(e,tp,eg,ep,ev,re,r,rp)
end end
function c88178023.desop(e,tp,eg,ep,ev,re,r,rp) function c88178023.desop(e,tp,eg,ep,ev,re,r,rp)
local res=Duel.SelectOption(tp,aux.Stringid(88178023,2),aux.Stringid(88178023,3)) local res=Duel.SelectOption(tp,aux.Stringid(88178023,2),aux.Stringid(88178023,3))
if res>2 then if res>0 then
Duel.SetLP(tp,Duel.GetLP(tp)-500) Duel.SetLP(tp,Duel.GetLP(tp)-500)
else else
Duel.Recover(tp,514,REASON_EFFECT) Duel.Recover(tp,514,REASON_EFFECT)
end end
local res1=Duel.SelectOption(1-tp,aux.Stringid(88178023,2),aux.Stringid(88178023,3)) local res1=Duel.SelectOption(1-tp,aux.Stringid(88178023,2),aux.Stringid(88178023,3))
if res1>2 then if res1>0 then
Duel.SetLP(1-tp,Duel.GetLP(1-tp)-500) Duel.SetLP(1-tp,Duel.GetLP(1-tp)-500)
else else
Duel.Recover(1-tp,514,REASON_EFFECT) Duel.Recover(1-tp,514,REASON_EFFECT)
......
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