Commit db7192ff authored by Nemo Ma's avatar Nemo Ma

fix

parent 32a71ab5
......@@ -856,6 +856,10 @@
30015045 0
30015080 0
30015100 0
#220821
9951001 0
53087982 0
60009998 0
#220814
15000404 0
15000534 0
......@@ -938,7 +942,6 @@
12023935 0
29002021 0
29065506 0
67200351 0
90700031 0
33711408 1
79078004 1
......@@ -2175,7 +2178,7 @@
82221051 0
82221057 0
82224065 0
82224072 0
82224072 1
131000000 0
131000013 0
131000016 0
......
......@@ -100,7 +100,7 @@ end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if chk==0 then return c:GetFlagEffect(m)<ct end
if chk==0 then return Duel.GetFlagEffect(tp,m)<ct end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -112,9 +112,4 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and e:IsHasType(EFFECT_TYPE_ACTIVATE) then
c:CancelToGrave()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end
end
......@@ -67,7 +67,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5 end
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5 end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,5)
end
function cm.cfilter(c)
......
......@@ -38,7 +38,7 @@ end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,0,1,nil)
end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
......@@ -62,7 +62,7 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local t1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_DECK,0,1,nil,e,tp)
local t2=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)>0
local t2=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil):GetCount()>0
if chk==0 then return t1 or t2 end
local op=0
local m={}
......
......@@ -40,7 +40,7 @@ end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,0,1,nil)
end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
......
......@@ -7,6 +7,7 @@ function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(cm.ntcon)
c:RegisterEffect(e1)
......@@ -39,6 +40,10 @@ function cm.initial_effect(c)
c:RegisterEffect(e4)
end
function cm.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function cm.lvcon(e)
return e:GetHandler():GetMaterialCount()==0
end
......
......@@ -88,9 +88,11 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsCanOverlay),tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
if g:GetCount()>0 then
Duel.Overlay(c,g)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsCanOverlay),tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil):GetFirst()
if tc and not tc:IsImmuneToEffect(e) then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then Duel.SendtoGrave(og,REASON_RULE) end
Duel.Overlay(c,tc)
end
end
function cm.aclimit(e,re,tp)
......
......@@ -8,7 +8,7 @@ function cm.initial_effect(c)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m+100000000)
e2:SetCondition(cm.con)
e2:SetTarget(cm.tg)
......
......@@ -8,6 +8,7 @@ function cm.initial_effect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,m+100000000)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
......
......@@ -110,7 +110,7 @@ function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.thfilter(c,lv)
return not c:IsLevel(lv) and c:IsSetCard(0x163) and c:IsAbleToHand()
return c:IsType(TYPE_MONSTER) and not c:IsLevel(lv) and c:IsSetCard(0x163) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local lv=e:GetLabelObject():GetLabel()
......
......@@ -84,7 +84,6 @@ function c33200740.counttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanAddCounter(0x32a,2) and Duel.IsExistingTarget(c33200740.cfilter,tp,LOCATION_REMOVED,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c33200740.cfilter,tp,LOCATION_REMOVED,0,2,2,nil)
Duel.HintSelection(g)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,e:GetHandler(),0,0x32a)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(33200740,1))
......
......@@ -164,11 +164,8 @@ end
function cm.tdcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,33460651)>0 and e:GetHandler():GetFlagEffect(m)==0
end
function cm.tdfilter1(c)
return c:IsAbleToRemove() and c:IsSetCard(0x340,0x341)
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter1,tp,LOCATION_DECK,0,1,nil,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,6))
end
......
......@@ -142,11 +142,7 @@ function cm.stop(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD,nil)~=0 then
local sg=Duel.GetOperatedGroup()
local sc=sg:GetFirst()
Duel.Draw(tp,1,REASON_EFFECT)
if Duel.IsPlayerCanDraw(tp,1) and sc:IsSetCard(0xa341) and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
Duel.Draw(tp,2,REASON_EFFECT)
end
end
end
\ No newline at end of file
......@@ -30,7 +30,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e3)
end
function cm.tgfilter(c)
return c:IsSetCard(0x341,0x340) and c:IsType(TYPE_CONTINUOUS) and c:IsAbleToGrave()
return c:IsSetCard(0x341,0x340) and c:IsType(TYPE_CONTINUOUS+TYPE_FIELD) and c:IsAbleToGrave()
end
function cm.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
......
......@@ -88,7 +88,7 @@ function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc:IsType(TYPE_RITUAL) then Duel.SpecialSummon(tc2,SUMMON_TYPE_RITUAL,tp,tp,true,true,POS_FACEUP)
if tc:IsType(TYPE_RITUAL) then Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,true,true,POS_FACEUP)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
......
......@@ -37,8 +37,30 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
Duel.RegisterEffect(e1,tp)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(m)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetLabelObject(),nil,REASON_EFFECT)
end
function cm.filter0(c)
return c:IsAbleToRemove()
......
......@@ -3,5 +3,100 @@ local m=33700354
local cm=_G["c"..m]
xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end)
function cm.initial_effect(c)
aux.AddXyzProcedureLevelFree(c,nil,cm.gcheck,2,63)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetCost(cm.cost)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TOSS_DICE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.dicecon)
e2:SetOperation(cm.diceop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TOSS_COIN)
e3:SetOperation(cm.coinop)
c:RegisterEffect(e3)
end
function cm.gcheck(g)
return g:GetClassCount(Card.GetCode)==1
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
if op==0 then
local coinop=Duel.SelectOption(tp,aux.Stringid(m,2),aux.Stringid(m,3))
_TossCoin=Duel.TossCoin
function Duel.TossCoin(player,count)
local boolflg=false
local result = {_TossCoin(player,count)}
local result_ret={}
for i=0,count do
if boolflg==false then
table.insert(result_ret,coinop)
else
table.insert(result_ret,result[i])
end
end
Duel.TossCoin=_TossCoin
return table.unpack(result_ret)
end
else
local diceop=Duel.AnnounceNumber(tp,1,2,3,4,5,6)
_TossDice=Duel.TossDice
function Duel.TossDice(player,count,count2)
local boolflg=true
local result = {_TossDice(player,count,count2)}
local result_ret={}
local sum=count
if count2 then
sum=sum+count2
end
for i=0,sum do
if boolflg == true then
table.insert(result_ret,diceop)
boolflg=false
else
table.insert(result_ret,result[i])
end
end
Duel.TossDice=_TossDice
return table.unpack(result_ret)
end
end
end
function cm.dicecon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp
end
function cm.diceop(e,tp,eg,ep,ev,re,r,rp)
local flag=0
local dc={Duel.GetDiceResult()}
for _,v in ipairs(dc) do
if v==6 then
flag=flag+1
end
end
Duel.Recover(tp,flag*2000,REASON_EFFECT)
end
function cm.coinop(e,tp,eg,ep,ev,re,r,rp)
local flag=0
local dc={Duel.GetCoinResult()}
for _,v in ipairs(dc) do
if v==1 then
flag=flag+1
end
end
Duel.Recover(tp,flag*2000,REASON_EFFECT)
end
\ No newline at end of file
......@@ -144,7 +144,7 @@ function cm.sumval(e,c)
return c:IsControler(sp)
end
function cm.drcon(e)
return Duel.GetTurnPlayer()=1-cm.GetNorthPlayer(e:GetHandler(),e:GetHandlerPlayer())
return Duel.GetTurnPlayer()==1-cm.GetNorthPlayer(e:GetHandler(),e:GetHandlerPlayer())
end
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
local sp=cm.GetNorthPlayer(e:GetHandler(),tp)
......
......@@ -67,7 +67,7 @@ function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.filter(c)
return cm.CosmosHero(c) and c:IsCanOverlay()
return cm.CosmosHero(c) and c:IsCanOverlay() and c:IsType(TYPE_MONSTER)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) and chkc~=e:GetHandler() end
......
......@@ -62,7 +62,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local loc=LOCATION_MZONE+LOCATION_HAND
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g1=Duel.SelectMatchingCard(tp,cm.cfilter2,tp,loc,0,4,4,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,nil)
if g1:GetCount()>0 and Duel.Release(g1,REASON_EFFECT)>0 and g2:GetCount()>0 then
Duel.SendtoGrave(g2,REASON_EFFECT)
local sg=Duel.GetMatchingGroup(cm.spfilter2,tp,LOCATION_DECK,0,nil,e,tp)
......
......@@ -32,20 +32,20 @@ function cm.matfilter1(c)
return c:IsSynchroType(TYPE_TUNER) or c:IsSetCard(0x353b)
end
function cm.filter(c)
return c:GetSequence()<5
return c:GetSequence()<5 and not c:IsLocation(LOCATION_PZONE)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and cm.setfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.setfilter,tp,LOCATION_SZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_SZONE-LOCATION_FZONE,PLAYER_NONE,0)>0 end
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_SZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_SZONE,PLAYER_NONE,0)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2))
local g=Duel.SelectTarget(tp,cm.setfilter,tp,LOCATION_SZONE-LOCATION_FZONE,0,1,1,nil)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_SZONE,0,1,1,nil)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or Duel.GetLocationCount(tp,LOCATION_SZONE-LOCATION_FZONE,PLAYER_NONE,0)<=0 then return end
if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or Duel.GetLocationCount(tp,LOCATION_SZONE,PLAYER_NONE,0)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_SZONE-LOCATION_FZONE,0,0)
local s=Duel.SelectDisableField(tp,1,LOCATION_SZONE,0,0)
local nseq=math.log(s,2)
Duel.MoveSequence(tc,nseq-8)
end
......
......@@ -5,7 +5,7 @@ if not pcall(function() require("expansions/script/c53702500") end) then require
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
......
......@@ -11,7 +11,7 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE+TIMING_ATTACK)
e1:SetHintTiming(TIMING_END_PHASE,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE+TIMING_ATTACK)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
......
......@@ -105,7 +105,7 @@ end
function c67210105.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and eg:IsExists(c67210105.filter11,1,nil) and eg:GetCount()>1 and ((c:IsLocation(LOCATION_HAND) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and eg:IsExists(c67210105.filter11,1,nil) and eg:GetCount()>1 and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and ((c:IsLocation(LOCATION_HAND) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or
(c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0)) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,eg:GetCount()-1,0,0)
......
......@@ -2,96 +2,96 @@
local m=89387002
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddLinkProcedure(c,cm.matfilter,1,1)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(cm.efilter)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
aux.AddLinkProcedure(c,cm.matfilter,1,1)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(cm.efilter)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
end
function cm.matfilter(c)
return c:GetOriginalType()&TYPE_TRAP>0
return c:GetOriginalType()&TYPE_TRAP>0
end
function cm.efilter(e,re)
return re:IsActiveType(TYPE_MONSTER) and re:GetOwner()~=e:GetOwner()
return re:IsActiveType(TYPE_MONSTER) and re:GetOwner()~=e:GetOwner()
end
function cm.setfilter(c,tp)
return c:IsType(TYPE_TRAP) and c:IsSetCard(0xd4) and c:IsSSetable() and Duel.IsExistingMatchingCard(cm.setfilter2,tp,LOCATION_DECK,0,1,nil,c)
return c:IsType(TYPE_TRAP) and c:IsSetCard(0xd4) and c:IsSSetable() and Duel.IsExistingMatchingCard(cm.setfilter2,tp,LOCATION_DECK,0,1,nil,c)
end
function cm.setfilter2(c,tc)
return not c:IsCode(tc:GetCode()) andc:IsType(TYPE_TRAP) and c:IsSetCard(0xd4) and c:IsAbleToGrave()
return not c:IsCode(tc:GetCode()) and c:IsType(TYPE_TRAP) and c:IsSetCard(0xd4) and c:IsAbleToGrave()
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and cm.setfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.setfilter,tp,LOCATION_REMOVED,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,cm.setfilter,tp,LOCATION_REMOVED,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and cm.setfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.setfilter,tp,LOCATION_REMOVED,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,cm.setfilter,tp,LOCATION_REMOVED,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SSet(tp,tc)>0 then
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e0:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e0:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e0)
local fid=e:GetHandler():GetFieldID()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
if Duel.GetTurnPlayer()==tp then
e1:SetLabel(0)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
else
e1:SetLabel(Duel.GetTurnCount())
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,2)
end
e1:SetLabelObject(tc)
e1:SetValue(fid)
e1:SetCondition(cm.rmcon)
e1:SetOperation(cm.rmop)
Duel.RegisterEffect(e1,tp)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1,fid)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.setfilter2,tp,LOCATION_DECK,0,1,1,nil,tc)
if g and g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SSet(tp,tc)>0 then
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e0:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e0:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e0)
local fid=e:GetHandler():GetFieldID()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
if Duel.GetTurnPlayer()==tp then
e1:SetLabel(0)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
else
e1:SetLabel(Duel.GetTurnCount())
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,2)
end
e1:SetLabelObject(tc)
e1:SetValue(fid)
e1:SetCondition(cm.rmcon)
e1:SetOperation(cm.rmop)
Duel.RegisterEffect(e1,tp)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1,fid)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.setfilter2,tp,LOCATION_DECK,0,1,1,nil,tc)
if g and g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetTurnPlayer()~=tp
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetTurnPlayer()~=tp
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(m)==e:GetValue() then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(m)==e:GetValue() then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function cm.splimit(e,c)
return not c:IsAttribute(ATTRIBUTE_WATER)
return not c:IsAttribute(ATTRIBUTE_WATER)
end
......@@ -47,6 +47,7 @@ function c9910443.atkcon(e)
end
function c9910443.descon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp==1-tp and re:IsActiveType(TYPE_MONSTER)
and Duel.IsChainNegatable(ev)
end
function c9910443.cfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAbleToRemoveAsCost()
......
......@@ -91,7 +91,7 @@ function c9910518.atkop(e,tp,eg,ep,ev,re,r,rp)
sc:RegisterEffect(e0)
sc=tg:GetNext()
end
local g=Duel.GetMatchingGroup(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local g=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(9910518,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(9910518,3))
......
......@@ -66,7 +66,7 @@ function c9910879.cfilter2(c)
return c:IsSummonLocation(LOCATION_EXTRA) and c:IsFaceup() and c:IsRace(RACE_MACHINE)
end
function c9910879.descon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
and Duel.IsExistingMatchingCard(c9910879.cfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function c9910879.destg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -7,7 +7,7 @@ function c9911011.initial_effect(c)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,9911011)
......
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