Commit 1855fb71 authored by wind2009's avatar wind2009

Merge remote-tracking branch 'upstream/master' into master

parents 5d667bfc cfbb14cd
...@@ -71,7 +71,7 @@ end ...@@ -71,7 +71,7 @@ end
function s.tgop(e,tp,eg,ep,ev,re,r,rp) function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA) local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
if #g==0 then return end if #g==0 then return end
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:FilterSelect(tp,Card.IsAbleToGrave,1,1,nil) local sg=g:FilterSelect(tp,Card.IsAbleToGrave,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT) Duel.SendtoGrave(sg,REASON_EFFECT)
......
--M・HERO ダスク・クロウ
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,id+o)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function s.costfilter(c)
return c:IsSetCard(0x8) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToChain() then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.thfilter(c)
return not c:IsCode(id) and c:IsSetCard(0xa008) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--御巫奉サナキ
local s,id,o=GetID()
function s.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_EQUIP)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--equip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,id+o*2)
e3:SetTarget(s.eqtg)
e3:SetOperation(s.eqop)
c:RegisterEffect(e3)
end
function s.thfilter(c)
return c:IsFaceup() and c:IsSetCard(0x18d) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and s.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToChain() then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x18d) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsRace(RACE_ILLUSION)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not c:IsSetCard(0x18d) and c:IsLocation(LOCATION_EXTRA)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if e:GetHandler():IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToChain() then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() or not tc:IsRelateToChain() or not c:CheckUniqueOnField(tp) then return end
if not Duel.Equip(tp,c,tc) then return end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(s.eqlimit)
e2:SetLabelObject(tc)
c:RegisterEffect(e2)
end
function s.eqlimit(e,c)
return c==e:GetLabelObject()
end
...@@ -50,7 +50,7 @@ function c14220547.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,7 +50,7 @@ function c14220547.tgop(e,tp,eg,ep,ev,re,r,rp)
g=g1 g=g1
else else
g=g2 g=g2
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g,true)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=g:FilterSelect(tp,Card.IsAbleToGrave,1,1,nil) local tg=g:FilterSelect(tp,Card.IsAbleToGrave,1,1,nil)
......
...@@ -48,7 +48,7 @@ end ...@@ -48,7 +48,7 @@ end
function s.rmlimit(e,c,rp,r,re) function s.rmlimit(e,c,rp,r,re)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
return c:IsControler(tp) and c:IsOnField() and c:IsCode(13331639) and c:IsFaceup() return c:IsControler(tp) and c:IsOnField() and c:IsCode(13331639) and c:IsFaceup()
and r&REASON_EFFECT~=0 and re:GetOwnerPlayer()~=tp and r&REASON_EFFECT~=0 and r&REASON_REDIRECT==0 and rp==1-tp
end end
function s.penfilter(c) function s.penfilter(c)
return c:IsSetCard(0x10f8) and c:IsType(TYPE_PENDULUM) and not c:IsCode(id) and not c:IsForbidden() return c:IsSetCard(0x10f8) and c:IsType(TYPE_PENDULUM) and not c:IsCode(id) and not c:IsForbidden()
......
...@@ -54,12 +54,12 @@ function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -54,12 +54,12 @@ function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
g1:Merge(g2) g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g1,g1:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g1,g1:GetCount(),0,0)
end end
function s.rmopfilter(c,e) function s.rmopfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsRelateToEffect(e) return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end end
function s.rmop(e,tp,eg,ep,ev,re,r,rp) function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetTargetsRelateToChain()
local tg=g:Filter(aux.NecroValleyFilter(s.rmopfilter),nil,e) local tg=g:Filter(aux.NecroValleyFilter(s.rmopfilter),nil)
if tg:GetCount()==2 then if tg:GetCount()==2 then
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT) Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end end
......
...@@ -105,7 +105,7 @@ function c17016131.tgtg2(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -105,7 +105,7 @@ function c17016131.tgtg2(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c17016131.tgop2(e,tp,eg,ep,ev,re,r,rp) function c17016131.tgop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA) local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g,true)
local tg=g:Filter(Card.IsAbleToGrave,nil) local tg=g:Filter(Card.IsAbleToGrave,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=tg:Select(tp,1,1,nil):GetFirst() local tc=tg:Select(tp,1,1,nil):GetFirst()
......
...@@ -62,7 +62,7 @@ function s.filter2(c,e,tp,m,f,chkf) ...@@ -62,7 +62,7 @@ function s.filter2(c,e,tp,m,f,chkf)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function s.fcheck(tp,sg,fc) function s.fcheck(tp,sg,fc)
return sg:IsExists(Card.IsSetCard,1,nil,0xdd) return sg:IsExists(Card.IsFusionSetCard,1,nil,0xdd)
end end
function s.fsptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.fsptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
......
...@@ -25,13 +25,6 @@ function s.initial_effect(c) ...@@ -25,13 +25,6 @@ function s.initial_effect(c)
e2:SetTargetRange(1,1) e2:SetTargetRange(1,1)
e2:SetTarget(s.efilter) e2:SetTarget(s.efilter)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(id)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(s.eftg)
c:RegisterEffect(e3)
--remove and tograve --remove and tograve
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DECKDES) e4:SetCategory(CATEGORY_DECKDES)
...@@ -65,10 +58,9 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,10 +58,9 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.efilter(e,c,rp,r,re) function s.efilter(e,c,rp,r,re)
return c:IsHasEffect(id) and r&REASON_EFFECT>0 local tp=e:GetHandlerPlayer()
end return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsSetCard(0x38) and c:IsFaceup()
function s.eftg(e,c) and r&REASON_EFFECT>0 and r&REASON_REDIRECT==0
return c:IsSetCard(0x38) and c:IsFaceup()
end end
function s.refilter(c) function s.refilter(c)
return c:IsSetCard(0x38) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() return c:IsSetCard(0x38) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
......
--E・HERO サンダー・ジャイアント-ボルティック・サンダー
local s,id,o=GetID()
function s.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,s.ffilter,2,true)
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.fuslimit)
c:RegisterEffect(e0)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_ACTIVATE_CONDITION)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCondition(s.descon)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+o)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--material check
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_MATERIAL_CHECK)
e3:SetValue(s.valcheck)
c:RegisterEffect(e3)
end
s.material_setcode=0x8
function s.ffilter(c,fc,sub,mg,sg)
return c:IsFusionSetCard(0x3008) and (not sg or not sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute()))
end
function s.valcheck(e,c)
local mg=c:GetMaterial()
if mg:IsExists(Card.IsType,1,nil,TYPE_NORMAL) then
c:RegisterFlagEffect(id,RESET_EVENT+0x4fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2))
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,0,nil)<Duel.GetMatchingGroupCount(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and e:GetHandler():IsReleasable()
and e:GetHandler():GetFlagEffect(id)>0 end
Duel.Release(e:GetHandler(),REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x3008) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToChain() and aux.NecroValleyFilter()(tc) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
...@@ -11,12 +11,6 @@ function c19748583.initial_effect(c) ...@@ -11,12 +11,6 @@ function c19748583.initial_effect(c)
e1:SetTarget(c19748583.eqtg) e1:SetTarget(c19748583.eqtg)
e1:SetOperation(c19748583.eqop) e1:SetOperation(c19748583.eqop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(300)
c:RegisterEffect(e2)
--destroy sub --destroy sub
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_EQUIP+EFFECT_TYPE_CONTINUOUS)
...@@ -65,6 +59,12 @@ function c19748583.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,6 +59,12 @@ function c19748583.eqop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c19748583.eqlimit) e1:SetValue(c19748583.eqlimit)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(300)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
end end
function c19748583.eqlimit(e,c) function c19748583.eqlimit(e,c)
return c:IsSetCard(0x107a) return c:IsSetCard(0x107a)
......
...@@ -50,7 +50,7 @@ end ...@@ -50,7 +50,7 @@ end
function c20426907.disop1(e,tp,eg,ep,ev,re,r,rp) function c20426907.disop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsCanBeDisabledByEffect(e) 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)
...@@ -82,6 +82,7 @@ function c20426907.disop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -82,6 +82,7 @@ function c20426907.disop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c20426907.disfilter,nil,e) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c20426907.disfilter,nil,e)
local tc=g:GetFirst() local tc=g:GetFirst()
while tc do while tc do
if tc:IsCanBeDisabledByEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET) Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -94,6 +95,7 @@ function c20426907.disop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -94,6 +95,7 @@ function c20426907.disop2(e,tp,eg,ep,ev,re,r,rp)
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)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
end
local e3=Effect.CreateEffect(e:GetHandler()) local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
......
...@@ -88,7 +88,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -88,7 +88,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
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()
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)~=0 then if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK) e1:SetCode(EFFECT_SET_ATTACK)
......
--ティマイオスの眼光
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,46986414,38033121,1784686)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c,e,tp)
return c:IsFaceupEx() and c:IsCode(46986414,38033121) and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
and c:IsCanBeFusionMaterial() and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_FMATERIAL)
and Duel.IsExistingMatchingCard(s.fusfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetCode(),c)
end
function s.fusfilter(c,e,tp,code,mc)
return c:IsType(TYPE_FUSION) and aux.IsMaterialListCode(c,code)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and s.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_FMATERIAL) or not tc:IsCode(46986414,38033121) then return end
local code=tc:GetCode()
if tc and tc:IsRelateToChain() and aux.NecroValleyFilter()(tc) and not tc:IsImmuneToEffect(e)
and (tc:IsAbleToDeck() or tc:IsAbleToExtra()) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,s.fusfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,code,tc)
local sc=sg:GetFirst()
if sc then
sc:SetMaterial(Group.FromCards(tc))
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.BreakEffect()
Duel.SpecialSummon(sc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
local fid=sc:GetFieldID()
sc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1,fid)
sc:CompleteProcedure()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(sc)
e1:SetLabel(Duel.GetTurnCount()+1)
e1:SetCondition(s.rmcon(fid))
e1:SetOperation(s.rmop)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
end
end
function s.rmcon(fid)
return function(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(id)~=0 and tc:GetFlagEffectLabel(id)==fid then
return Duel.GetTurnCount()==e:GetLabel()
else
e:Reset()
return false
end
end
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc and tc:IsOnField() then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
...@@ -38,7 +38,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -38,7 +38,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
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()
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)~=0 then if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_TYPE) e1:SetCode(EFFECT_ADD_TYPE)
......
...@@ -22,6 +22,7 @@ function s.initial_effect(c) ...@@ -22,6 +22,7 @@ function s.initial_effect(c)
e2:SetCode(EVENT_BATTLE_START) e2:SetCode(EVENT_BATTLE_START)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id) e2:SetCountLimit(1,id)
e2:SetCondition(s.atkcon)
e2:SetTarget(s.atktg) e2:SetTarget(s.atktg)
e2:SetOperation(s.atkop) e2:SetOperation(s.atkop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -36,6 +37,10 @@ end ...@@ -36,6 +37,10 @@ end
function s.atkfilter(c) function s.atkfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceupEx() and c:IsAbleToRemove() return c:IsType(TYPE_MONSTER) and c:IsFaceupEx() and c:IsAbleToRemove()
end end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
return tc and tc:IsControler(1-tp)
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() local c=e:GetHandler()
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) end if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) end
...@@ -61,5 +66,5 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,5 +66,5 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.eacon(e,tp,eg,ep,ev,re,r,rp) function s.eacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceupEx,Card.IsLevelAbove),e:GetHandlerPlayer(),LOCATION_REMOVED,0,1,nil,10) return Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsLevelAbove),0,LOCATION_REMOVED,LOCATION_REMOVED,1,nil,10)
end end
...@@ -60,7 +60,7 @@ function s.descon(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,7 +60,7 @@ function s.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ac=c:GetBattleTarget() local ac=c:GetBattleTarget()
e:SetLabelObject(ac) e:SetLabelObject(ac)
return ac and ac:IsFaceup() and ac:IsControler(1-tp) return ac and ac:IsControler(1-tp)
end end
function s.desfilter2(c) function s.desfilter2(c)
return c:IsFaceup() and c:IsSetCard(0x1115) return c:IsFaceup() and c:IsSetCard(0x1115)
......
...@@ -47,7 +47,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,7 +47,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
else else
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER) e1:SetCode(EFFECT_CANNOT_TRIGGER)
......
...@@ -45,7 +45,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,7 +45,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetCode(EFFECT_CANNOT_ATTACK)
......
...@@ -83,7 +83,7 @@ function s.drmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -83,7 +83,7 @@ function s.drmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,2,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,2,0,0)
end end
function s.drmop(e,tp,eg,ep,ev,re,r,rp) function s.drmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain() local g=Duel.GetTargetsRelateToChain():Filter(Card.IsAbleToRemove,nil)
if #g~=2 or Duel.Remove(g,0,REASON_EFFECT+REASON_TEMPORARY)==0 if #g~=2 or Duel.Remove(g,0,REASON_EFFECT+REASON_TEMPORARY)==0
or not g:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED) then return end or not g:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED) then return end
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED) local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
......
...@@ -23,6 +23,11 @@ function c31044787.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -23,6 +23,11 @@ function c31044787.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,1-tp,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,1-tp,LOCATION_MZONE)
end end
function c31044787.getAttack(c)
local atk=c:GetAttack()
if atk>0xffff then atk=(atk&0x7fffffff)|0x80000000 end
return atk
end
function c31044787.activate(e,tp,eg,ep,ev,re,r,rp) function c31044787.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c31044787.filter,tp,0,LOCATION_MZONE,nil,1-tp) local g=Duel.GetMatchingGroup(c31044787.filter,tp,0,LOCATION_MZONE,nil,1-tp)
local atk=g:GetSum(Card.GetAttack) local atk=g:GetSum(Card.GetAttack)
...@@ -30,6 +35,6 @@ function c31044787.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -30,6 +35,6 @@ function c31044787.activate(e,tp,eg,ep,ev,re,r,rp)
local diff=atk-lp local diff=atk-lp
if diff<=0 then return end if diff<=0 then return end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK)
local sg=g:SelectWithSumGreater(1-tp,Card.GetAttack,diff) local sg=g:SelectWithSumGreater(1-tp,c31044787.getAttack,diff)
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_RULE,1-tp) Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_RULE,1-tp)
end end
...@@ -90,7 +90,7 @@ function c34813545.filter2(c,e,tp,m,f,chkf) ...@@ -90,7 +90,7 @@ function c34813545.filter2(c,e,tp,m,f,chkf)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function c34813545.fcheck(tp,sg,fc) function c34813545.fcheck(tp,sg,fc)
return sg:IsExists(Card.IsSetCard,1,nil,0x2a) return sg:IsExists(Card.IsFusionSetCard,1,nil,0x2a)
end end
function c34813545.fstg(e,tp,eg,ep,ev,re,r,rp,chk) function c34813545.fstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
......
...@@ -29,7 +29,7 @@ function c35098357.filter2(c,e,tp,m,f,chkf) ...@@ -29,7 +29,7 @@ function c35098357.filter2(c,e,tp,m,f,chkf)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function c35098357.fcheck(tp,sg,fc) function c35098357.fcheck(tp,sg,fc)
return sg:IsExists(Card.IsSetCard,1,nil,0x128) return sg:IsExists(Card.IsFusionSetCard,1,nil,0x128)
end end
function c35098357.target(e,tp,eg,ep,ev,re,r,rp,chk) function c35098357.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
......
...@@ -86,7 +86,7 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -86,7 +86,7 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
g=g1 g=g1
elseif sel==1 then elseif sel==1 then
g=g2 g=g2
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g,true)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:FilterSelect(tp,s.tgfilter,1,1,nil) local sg=g:FilterSelect(tp,s.tgfilter,1,1,nil)
......
...@@ -63,7 +63,8 @@ end ...@@ -63,7 +63,8 @@ end
function c3657444.operation2(e,tp,eg,ep,ev,re,r,rp) function c3657444.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsControler(tp) and tc:IsFaceup() and c:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) and tc:IsControler(tp) and tc:IsFaceup() and c:IsRelateToEffect(e)
and c:IsAbleToRemove() and tc:IsAbleToRemove() then
local sg=Group.FromCards(c,tc) local sg=Group.FromCards(c,tc)
if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)~=2 then return end if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)~=2 then return end
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -36,6 +36,9 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -36,6 +36,9 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,sg:Filter(Card.IsLocation,nil,LOCATION_GRAVE),1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,sg:Filter(Card.IsLocation,nil,LOCATION_GRAVE),1,0,0)
end end
function s.ovfilter(c,e)
return c:IsCanOverlay() and not c:IsImmuneToEffect(e)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tg=Duel.GetTargetsRelateToChain() local tg=Duel.GetTargetsRelateToChain()
...@@ -45,7 +48,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,7 +48,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
local sc=sg:GetFirst() local sc=sg:GetFirst()
if sc and Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)~=0 then if sc and Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)~=0 then
sc:CompleteProcedure() sc:CompleteProcedure()
local og=tg:Filter(Card.IsCanOverlay,nil) local og=tg:Filter(s.ovfilter,nil,e)
for tc in aux.Next(og) do for tc in aux.Next(og) do
local mg=tc:GetOverlayGroup() local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then if mg:GetCount()~=0 then
......
...@@ -57,7 +57,7 @@ end ...@@ -57,7 +57,7 @@ end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.tdfilter(chkc) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.tdfilter(chkc) 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.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
......
...@@ -43,7 +43,7 @@ function c40352445.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,7 +43,7 @@ function c40352445.tgop(e,tp,eg,ep,ev,re,r,rp)
local atk=tc1:GetAttack() local atk=tc1:GetAttack()
local rg=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA) local rg=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
if #rg>0 then if #rg>0 then
Duel.ConfirmCards(tp,rg) Duel.ConfirmCards(tp,rg,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc2=rg:FilterSelect(tp,Card.IsAbleToGrave,1,1,nil):GetFirst() local tc2=rg:FilterSelect(tp,Card.IsAbleToGrave,1,1,nil):GetFirst()
Duel.ShuffleExtra(1-tp) Duel.ShuffleExtra(1-tp)
......
...@@ -57,7 +57,7 @@ function c42427230.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -57,7 +57,7 @@ function c42427230.spop(e,tp,eg,ep,ev,re,r,rp)
end end
for i=1,count do for i=1,count do
local token=Duel.CreateToken(tp,42427231) local token=Duel.CreateToken(tp,42427231)
if Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(42427230,3)) e1:SetDescription(aux.Stringid(42427230,3))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
......
...@@ -37,8 +37,8 @@ function s.initial_effect(c) ...@@ -37,8 +37,8 @@ function s.initial_effect(c)
--discard deck --discard deck
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1)) e4:SetDescription(aux.Stringid(id,1))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCategory(CATEGORY_DECKDES) e4:SetCategory(CATEGORY_DECKDES)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCountLimit(1) e4:SetCountLimit(1)
e4:SetCode(EVENT_PHASE+PHASE_END) e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
...@@ -49,6 +49,7 @@ function s.initial_effect(c) ...@@ -49,6 +49,7 @@ function s.initial_effect(c)
--to hand --to hand
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,2)) e5:SetDescription(aux.Stringid(id,2))
e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DESTROYED) e5:SetCode(EVENT_DESTROYED)
e5:SetProperty(EFFECT_FLAG_DELAY) e5:SetProperty(EFFECT_FLAG_DELAY)
...@@ -60,20 +61,20 @@ end ...@@ -60,20 +61,20 @@ end
function s.fusfilter(c) function s.fusfilter(c)
return c:IsCode(19959563,57774843) and c:IsAbleToRemoveAsCost() return c:IsCode(19959563,57774843) and c:IsAbleToRemoveAsCost()
end end
function s.fselect(g) function s.fselect(g,tp,sc)
return g:GetClassCount(Card.GetCode)==2 and g:IsExists(Card.IsLocation,1,nil,LOCATION_ONFIELD) and g:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) return g:GetClassCount(Card.GetCode)==2 and Duel.GetLocationCountFromEx(tp,tp,g,sc)>0
and g:IsExists(Card.IsLocation,1,nil,LOCATION_MZONE) and g:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE)
end end
function s.spcon(e,c) function s.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local fg=Duel.GetMatchingGroup(s.fusfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(s.fusfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil)
return fg:CheckSubGroup(s.fselect,2,2) return g:CheckSubGroup(s.fselect,2,2,tp,c)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local cp=c:GetControler() local g=Duel.GetMatchingGroup(s.fusfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil)
local g=Duel.GetMatchingGroup(s.fusfilter,cp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.Hint(HINT_SELECTMSG,cp,HINTMSG_REMOVE) local sg=g:SelectSubGroup(tp,s.fselect,true,2,2,tp,c)
local sg=g:SelectSubGroup(cp,s.fselect,true,2,2)
if sg then if sg then
sg:KeepAlive() sg:KeepAlive()
e:SetLabelObject(sg) e:SetLabelObject(sg)
...@@ -84,6 +85,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -84,6 +85,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
local sg=e:GetLabelObject() local sg=e:GetLabelObject()
c:SetMaterial(sg) c:SetMaterial(sg)
Duel.Remove(sg,POS_FACEUP,REASON_COST) Duel.Remove(sg,POS_FACEUP,REASON_COST)
sg:DeleteGroup()
end end
function s.recost(e,tp,eg,ep,ev,re,r,rp,chk) function s.recost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000) end if chk==0 then return Duel.CheckLPCost(tp,2000) end
...@@ -112,31 +114,32 @@ end ...@@ -112,31 +114,32 @@ end
function s.thcon(e,tp,eg,ep,ev,re,r,rp) function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():IsPreviousControler(tp) return rp==1-tp and e:GetHandler():IsPreviousControler(tp)
end end
function s.thfilter1(c) function s.thfilter1(c,tp)
return c:IsFaceup() and c:IsCode(19959563) and c:IsAbleToHand() return c:IsFaceup() and c:IsCode(19959563) and c:IsAbleToHand()
and Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_REMOVED,0,1,c)
end end
function s.thfilter2(c) function s.thfilter2(c)
return c:IsFaceup() and c:IsCode(57774843) and c:IsAbleToHand() return c:IsFaceup() and c:IsCode(57774843) and c:IsAbleToHand()
end end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter1,tp,LOCATION_REMOVED,0,1,nil) and Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_REMOVED,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter1,tp,LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,0,LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,0,LOCATION_REMOVED)
end end
function s.fselect2(g)
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,true,false) return c:IsLocation(LOCATION_HAND) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
function s.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=Duel.GetMatchingGroup(s.thfilter1,tp,LOCATION_REMOVED,0,nil) local g1=Duel.SelectMatchingCard(tp,s.thfilter1,tp,LOCATION_REMOVED,0,1,1,nil,tp)
local g2=Duel.GetMatchingGroup(s.thfilter2,tp,LOCATION_REMOVED,0,nil) if #g1==0 then return end
if #g1>0 and #g2>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
Duel.SendtoHand((g1+g2):SelectSubGroup(tp,s.fselect2,false,2,2),nil,REASON_EFFECT) local g2=Duel.SelectMatchingCard(tp,s.thfilter2,tp,LOCATION_REMOVED,0,1,1,g1,tp)
g1:Merge(g2)
if Duel.SendtoHand(g1,nil,REASON_EFFECT)==2 then
local tg=Duel.GetOperatedGroup() local tg=Duel.GetOperatedGroup()
Duel.ConfirmCards(1-tp,tg) if tg:FilterCount(s.spfilter,nil,e,tp)==2
if tg:FilterCount(s.spfilter,nil,e,tp)==2 and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.BreakEffect() Duel.BreakEffect()
for tc in aux.Next(tg) do for tc in aux.Next(tg) do
Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP)
......
--ドリル・アームド・ドラゴン
local s,id,o=GetID()
function s.initial_effect(c)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.atkcost)
e1:SetOperation(s.atkop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
function s.costfilter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsAbleToGraveAsCost()
end
function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and
Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,c)
g:AddCard(c)
Duel.SendtoGrave(g,REASON_COST)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(s.atktg)
e1:SetValue(300)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.atktg(e,c)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_WIND)
end
function s.cfilter(c)
return c:IsRace(RACE_DRAGON) and (c:IsLevelAbove(7) or c:IsAttribute(ATTRIBUTE_WIND)) and c:IsAbleToRemoveAsCost()
end
function s.fselect(g,tg)
return tg:IsExists(Card.IsLevel,1,nil,#g)
end
function s.thfilter(c)
return not c:IsCode(id) and c:IsLevelAbove(1) and c:IsRace(RACE_DRAGON)
and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local cg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_GRAVE,0,nil)
local tg=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
local _,maxlv=tg:GetMaxGroup(Card.GetLevel)
if chk==0 then
if not e:IsCostChecked() then return false end
return cg:CheckSubGroup(s.fselect,1,maxlv,tg)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=cg:SelectSubGroup(tp,s.fselect,false,1,maxlv,tg)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
e:SetLabel(rg:GetCount())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thfilter2(c,lv)
return not c:IsCode(id) and c:IsLevel(lv) and c:IsRace(RACE_DRAGON)
and c:IsAbleToHand()
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter2,tp,LOCATION_DECK,0,1,1,nil,e:GetLabel())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
...@@ -74,7 +74,7 @@ function c4837861.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -74,7 +74,7 @@ function c4837861.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then return end if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then return end
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA) local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local sg=g:FilterSelect(tp,c4837861.eqfilter,1,1,nil,tp) local sg=g:FilterSelect(tp,c4837861.eqfilter,1,1,nil,tp)
local tc=sg:GetFirst() local tc=sg:GetFirst()
......
...@@ -46,9 +46,9 @@ function c48654323.atktgfilter2(c) ...@@ -46,9 +46,9 @@ function c48654323.atktgfilter2(c)
end end
function c48654323.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c48654323.atktg(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.IsExistingTarget(c48654323.atktgfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(c48654323.atktgfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c48654323.atktgfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,c48654323.atktgfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c48654323.atktgfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,g) Duel.SelectTarget(tp,c48654323.atktgfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,g)
end end
...@@ -90,7 +90,7 @@ end ...@@ -90,7 +90,7 @@ end
function c48654323.tgop(e,tp,eg,ep,ev,re,r,rp) function c48654323.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA) local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
if #g==0 then return end if #g==0 then return end
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=g:FilterSelect(tp,Card.IsAbleToGrave,1,1,nil) local tg=g:FilterSelect(tp,Card.IsAbleToGrave,1,1,nil)
Duel.SendtoGrave(tg,REASON_EFFECT) Duel.SendtoGrave(tg,REASON_EFFECT)
......
...@@ -72,7 +72,7 @@ end ...@@ -72,7 +72,7 @@ end
function c50179591.rmop2(e,tp,eg,ep,ev,re,r,rp) function c50179591.rmop2(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA) local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local mg=g:FilterSelect(tp,Card.IsAbleToRemove,1,1,nil) local mg=g:FilterSelect(tp,Card.IsAbleToRemove,1,1,nil)
if mg:GetCount()>0 then if mg:GetCount()>0 then
......
...@@ -59,7 +59,7 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -59,7 +59,7 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,s.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
......
...@@ -32,7 +32,7 @@ end ...@@ -32,7 +32,7 @@ end
function s.rmlimit(e,c,rp,r,re) function s.rmlimit(e,c,rp,r,re)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
return c:IsControler(tp) and c:IsOnField() and c:IsSetCard(0xea) and c:IsFaceup() return c:IsControler(tp) and c:IsOnField() and c:IsSetCard(0xea) and c:IsFaceup()
and r&REASON_EFFECT~=0 and re:GetOwnerPlayer()~=tp and r&REASON_EFFECT~=0 and r&REASON_REDIRECT==0 and rp==1-tp
end end
function s.cfilter(c) function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xea) and c:IsType(TYPE_SYNCHRO) return c:IsFaceup() and c:IsSetCard(0xea) and c:IsType(TYPE_SYNCHRO)
......
...@@ -64,7 +64,7 @@ function c56347375.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -64,7 +64,7 @@ function c56347375.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c56347375.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst() local tc=Duel.SelectMatchingCard(tp,c56347375.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if tc then if tc then
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_TYPE) e1:SetCode(EFFECT_ADD_TYPE)
......
...@@ -39,7 +39,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -39,7 +39,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp,co,nil) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp,co,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK) e1:SetCode(EFFECT_CANNOT_ATTACK)
......
--ウズヒメの御巫
local s,id,o=GetID()
function s.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x18d),3,2)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--battle indestructable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
c:RegisterEffect(e2)
--reflect battle damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
e3:SetValue(1)
c:RegisterEffect(e3)
--chain attack
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DAMAGE_STEP_END)
e4:SetCondition(s.atcon)
e4:SetCost(s.atcost)
e4:SetOperation(s.atop)
c:RegisterEffect(e4)
end
function s.thfilter(c)
return c:IsType(TYPE_EQUIP) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetAttacker()==c and c:IsChainAttackable(0)
end
function s.atcost(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 s.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
end
--M・HERO ファーネス
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,21143940,24094653)
local e0=aux.AddThisCardInGraveAlreadyCheck(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.thcost)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetLabelObject(e0)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
end
function s.counterfilter(c)
return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsSetCard(0x8)
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic()
and Duel.GetCustomActivityCount(id,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x8) and c:IsLocation(LOCATION_EXTRA)
end
function s.thfilter(c)
return c:IsCode(21143940,24094653) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local dg=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,1,1,nil,REASON_EFFECT)
Duel.BreakEffect()
Duel.ShuffleHand(tp)
Duel.SendtoGrave(dg,REASON_EFFECT+REASON_DISCARD)
end
end
end
function s.spfilter(c,tp,se)
return c:IsSummonPlayer(tp) and not c:IsAttribute(ATTRIBUTE_FIRE) and c:IsSetCard(0x8) and c:IsType(TYPE_FUSION) and c:IsFaceup()
and (se==nil or c:GetReasonEffect()~=se)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local se=e:GetLabelObject():GetLabelObject()
return eg:IsExists(s.spfilter,1,nil,tp,se)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToChain() and aux.NecroValleyFilter()(c) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
Duel.SpecialSummonComplete()
end
...@@ -9,6 +9,7 @@ function c5908650.initial_effect(c) ...@@ -9,6 +9,7 @@ function c5908650.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCost(c5908650.thcost) e1:SetCost(c5908650.thcost)
e1:SetCondition(c5908650.thcon)
e1:SetTarget(c5908650.thtg) e1:SetTarget(c5908650.thtg)
e1:SetOperation(c5908650.thop) e1:SetOperation(c5908650.thop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -29,6 +30,9 @@ function c5908650.thcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -29,6 +30,9 @@ function c5908650.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c5908650.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsAttribute(ATTRIBUTE_LIGHT)
end
function c5908650.aclimit(e,re,tp) function c5908650.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsNonAttribute(ATTRIBUTE_LIGHT) return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsNonAttribute(ATTRIBUTE_LIGHT)
end end
......
--滅びの黒魔術師
local s,id,o=GetID()
function s.initial_effect(c)
--fusion
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,46986414,aux.FilterBoolFunction(Card.IsFusionAttribute,ATTRIBUTE_LIGHT+ATTRIBUTE_DARK),1,true,true)
--splimit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCondition(s.condition)
e0:SetOperation(s.regop)
c:RegisterEffect(e0)
--alt summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--spsummon condition
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
e2:SetValue(s.splimit)
c:RegisterEffect(e2)
--change name
aux.EnableChangeCode(c,46986414,LOCATION_MZONE+LOCATION_GRAVE)
--search
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_SPELL)
end
function s.spfilter(c,tp,sc)
return c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsLevelAbove(6)
and c:IsAbleToRemoveAsCost() and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0
and c:IsAbleToRemove(tp,POS_FACEUP,REASON_SPSUMMON)
end
function s.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_MZONE,0,1,nil,tp,c)
and Duel.GetFlagEffect(tp,id)==0
and (Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)~=0
or Duel.GetCustomActivityCount(id,1-tp,ACTIVITY_CHAIN)~=0)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_MZONE,0,nil,tp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END,0,1)
local g=e:GetLabelObject()
Duel.Remove(g,POS_FACEUP,REASON_SPSUMMON)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_FUSION) or c:GetFlagEffect(id)>0
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
end
function s.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION and Duel.GetFlagEffect(sp,id)==0
end
function s.thfilter(c)
return c:IsAbleToHand() and aux.IsCodeOrListed(c,46986414)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--紋章獣グリフォン --紋章獣グリフォン
--not fully implemented
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetCode(EVENT_ADJUST)
e0:SetRange(LOCATION_MZONE)
e0:SetOperation(s.adjustop)
c:RegisterEffect(e0)
--spsummon --spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
...@@ -19,14 +13,14 @@ function s.initial_effect(c) ...@@ -19,14 +13,14 @@ function s.initial_effect(c)
e1:SetTarget(s.sptg) e1:SetTarget(s.sptg)
e1:SetOperation(s.spop) e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--flag --2X material
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(81096431) e2:SetCode(EFFECT_DOUBLE_XMATERIAL)
e2:SetValue(id) e2:SetRange(LOCATION_MZONE)
e2:SetRange(0xff)
e2:SetTarget(s.sxyzfilter) e2:SetTarget(s.sxyzfilter)
e2:SetValue(id)
e2:SetCountLimit(1,id+o) e2:SetCountLimit(1,id+o)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
...@@ -90,199 +84,3 @@ end ...@@ -90,199 +84,3 @@ end
function s.sxyzfilter(e,c) function s.sxyzfilter(e,c)
return c:IsSetCard(0x48) return c:IsSetCard(0x48)
end end
function s.Drake_shark_f(function_f,int_lv,card_c)
return function (c)
return c:IsXyzLevel(card_c,int_lv) and (not function_f or function_f(c))
end
end
function s.sxfilter(c,tp,xc)
local te=c:IsHasEffect(81096431,tp)
if te then
local etg=te:GetTarget()
return not etg or etg(te,xc)
end
return false
end
function s.sxvalue(c,tp,xc)
local te=c:IsHasEffect(81096431,tp)
if te then
local etg=te:GetTarget()
if not etg or etg(te,xc) then
return te:GetValue()
end
end
end
function s.Drake_shark_gf(int_ct,int_tp,xc)
return function (g)
local ct=g:GetCount()
local eg=g:Filter(s.sxfilter,nil,int_tp,xc)
if #eg>0 then
ct=ct+eg:GetClassCount(s.sxvalue,int_tp,xc)
end
local tc=g:GetFirst()
while tc do
local te=tc:IsHasEffect(EFFECT_XYZ_LEVEL,int_tp)
if te then
local evf=te:GetValue()
if evf then
local ev=evf(te,tc,xc)
local lmct=(ev>>12)&0xf
if lmct>0 and lmct>g:GetCount() then
return false
end
end
end
tc=g:GetNext()
end
return ct>=int_ct
end
end
function s.xfilter(c,tp)
return c:IsHasEffect(81096431,tp)
end
function s.eftfilter(c,tp)
local te=c:IsHasEffect(81096431,tp)
return te:GetValue()
end
function s.gcheck(g,tp)
return g:GetClassCount(s.eftfilter,tp)==g:GetCount()
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(0,81096431)==0 then
Duel.RegisterFlagEffect(0,81096431,0,0,1)
Drake_shark_AddXyzProcedure=aux.AddXyzProcedure
function aux.AddXyzProcedure(card_c,function_f,int_lv,int_ct,function_alterf,int_dese,int_maxc,function_op)
if int_ct>=3 then
if function_alterf then
Drake_shark_XyzLevelFreeOperationAlter=Auxiliary.XyzLevelFreeOperationAlter
function Auxiliary.XyzLevelFreeOperationAlter(f,gf,minc,maxc,alterf,alterdesc,alterop)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
Auxiliary.Drake_Solve(tp,og,maxc,minc)
local sg=Group.CreateGroup()
local tc=og:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=og:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
Auxiliary.Drake_Solve(tp,mg,maxc,minc)
if e:GetLabel()==1 then
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
else
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
end
aux.AddXyzProcedureLevelFree(card_c,s.Drake_shark_f(function_f,int_lv,card_c),s.Drake_shark_gf(int_ct,card_c:GetOwner(),card_c),int_ct-2,int_ct,function_alterf,int_dese,function_op)
Auxiliary.XyzLevelFreeOperationAlter=Drake_shark_XyzLevelFreeOperationAlter
else
Drake_shark_XyzLevelFreeOperation=Auxiliary.XyzLevelFreeOperation
function Auxiliary.XyzLevelFreeOperation(f,gf,minct,maxct)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
Auxiliary.Drake_Solve(tp,og,maxct,minct)
local sg=Group.CreateGroup()
local tc=og:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=og:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
Auxiliary.Drake_Solve(tp,mg,maxct,minct)
if e:GetLabel()==1 then
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
else
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
end
aux.AddXyzProcedureLevelFree(card_c,s.Drake_shark_f(function_f,int_lv,card_c),s.Drake_shark_gf(int_ct,card_c:GetOwner(),card_c),int_ct-2,int_ct)
Auxiliary.XyzLevelFreeOperation=Drake_shark_XyzLevelFreeOperation
end
else
if function_alterf then
Drake_shark_AddXyzProcedure(card_c,function_f,int_lv,int_ct,function_alterf,int_dese,int_maxc,function_op)
else
Drake_shark_AddXyzProcedure(card_c,function_f,int_lv,int_ct,nil,nil,int_maxc,nil)
end
end
end
local rg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_EXTRA,LOCATION_EXTRA,nil,TYPE_MONSTER)
for tc in aux.Next(rg) do
if tc.initial_effect then
local Traitor_initial_effect=s.initial_effect
s.initial_effect=function() end
tc:ReplaceEffect(id,0)
s.initial_effect=Traitor_initial_effect
tc.initial_effect(tc)
end
end
end
e:Reset()
end
function Auxiliary.Drake_Solve(tp,g,maxct,minct)
if g:GetCount()<maxct and g:GetCount()>=minct and maxct==minct+2 then
local et=maxct-g:GetCount()
local exg=g:Filter(Card.IsHasEffect,nil,81096431,tp)
local ext=exg:GetClassCount(s.eftfilter,tp)
if (et==0 or et==ext) and #exg>0 then
for ttc in aux.Next(exg) do
local tte=ttc:IsHasEffect(81096431,tp)
if tte then
Duel.Hint(HINT_CARD,0,ttc:GetCode())
tte:UseCountLimit(tp)
end
end
elseif #exg>0 then
local st=et
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RESOLVECARD)
local reg=exg:SelectSubGroup(tp,s.gcheck,false,st,st,tp)
for ttc in aux.Next(reg) do
local tte=ttc:IsHasEffect(81096431,tp)
if tte then
Duel.Hint(HINT_CARD,0,ttc:GetCode())
tte:UseCountLimit(tp)
end
end
end
end
end
...@@ -27,8 +27,8 @@ function c60921537.extraop(e,tp,eg,ep,ev,re,r,rp,tc) ...@@ -27,8 +27,8 @@ function c60921537.extraop(e,tp,eg,ep,ev,re,r,rp,tc)
g=g1 g=g1
else else
g=g2 g=g2
Duel.ConfirmCards(tp,g,true)
end end
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=g:FilterSelect(tp,Card.IsAbleToGrave,1,1,nil) local tg=g:FilterSelect(tp,Card.IsAbleToGrave,1,1,nil)
Duel.SendtoGrave(tg,REASON_EFFECT) Duel.SendtoGrave(tg,REASON_EFFECT)
......
...@@ -133,7 +133,8 @@ function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -133,7 +133,8 @@ function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc~=c and s.atkfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc~=c and s.atkfilter(chkc) end
if chk==0 then return c:IsAttackAbove(500) and c:IsDefenseAbove(500) and Duel.IsExistingTarget(s.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) end if chk==0 then return c:IsAttackAbove(500) and c:IsDefenseAbove(500) and Duel.IsExistingTarget(s.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c) local tc=Duel.SelectTarget(tp,s.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
end end
function s.atkop(e,tp,eg,ep,ev,re,r,rp) function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -41,7 +41,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -41,7 +41,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
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()
if c:IsRelateToChain() and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)~=0 then if c:IsRelateToChain() and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL) e1:SetCode(EFFECT_CHANGE_LEVEL)
......
...@@ -50,7 +50,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,7 +50,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_HAND,0,1,1,nil,e,tp,race,att,atk) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_HAND,0,1,1,nil,e,tp,race,att,atk)
local sc=g:GetFirst() local sc=g:GetFirst()
if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP)~=0 then if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
......
...@@ -91,7 +91,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -91,7 +91,7 @@ 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 g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_TYPE) e1:SetCode(EFFECT_ADD_TYPE)
......
...@@ -49,7 +49,7 @@ function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -49,7 +49,7 @@ function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g1,2,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g1,2,0,0)
end end
function s.rmop(e,tp,eg,ep,ev,re,r,rp) function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetTargetsRelateToChain():Filter(Card.IsAbleToRemove,nil)
if #g==2 and Duel.Remove(g,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then if #g==2 and Duel.Remove(g,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local resetv=1 local resetv=1
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()<=PHASE_STANDBY then if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()<=PHASE_STANDBY then
......
...@@ -69,9 +69,9 @@ function s.exfilter(c,tp) ...@@ -69,9 +69,9 @@ function s.exfilter(c,tp)
end end
function s.fcheck(tp,sg,fc) function s.fcheck(tp,sg,fc)
if Duel.GetFlagEffect(tp,id)~=0 then if Duel.GetFlagEffect(tp,id)~=0 then
return sg:IsExists(Card.IsSetCard,1,nil,0x1a1) return sg:IsExists(Card.IsFusionSetCard,1,nil,0x1a1)
else else
return sg:IsExists(Card.IsSetCard,1,nil,0x1a1) and not sg:IsExists(s.exfilter,1,nil,tp) return sg:IsExists(Card.IsFusionSetCard,1,nil,0x1a1) and not sg:IsExists(s.exfilter,1,nil,tp)
end end
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -72,7 +72,7 @@ function c68304193.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -72,7 +72,7 @@ function c68304193.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c68304193.rmop(e,tp,eg,ep,ev,re,r,rp) function c68304193.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA) local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:FilterSelect(tp,c68304193.rmfilter,1,1,nil,tp) local sg=g:FilterSelect(tp,c68304193.rmfilter,1,1,nil,tp)
if #sg>0 then if #sg>0 then
......
--黒魔術の護符
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,46986414)
--act in set turn
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,0))
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetValue(id)
e0:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e0:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCondition(s.condition)
e0:SetCost(s.cost)
c:RegisterEffect(e0)
--disable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(s.discon)
e1:SetTarget(s.distg)
e1:SetOperation(s.disop)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(s.setcon)
e2:SetCost(s.setcost)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
end
function s.condition(e)
return e:GetHandler():IsStatus(STATUS_SET_TURN) and e:GetHandler():IsLocation(LOCATION_ONFIELD)
end
function s.costfilter(c)
return c:IsRace(RACE_SPELLCASTER) and not c:IsPublic()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsChainDisablable(ev) then return false end
local te=Duel.GetChainInfo(ev-1,CHAININFO_TRIGGERING_EFFECT)
return Duel.GetCurrentChain()>=2
and te and aux.IsCodeListed(te:GetHandler(),46986414) and re:IsActiveType(TYPE_MONSTER)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
if Duel.NegateEffect(ev) and rc then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(s.discon1)
e1:SetOperation(s.disop1)
e1:SetLabel(rc:GetOriginalCodeRule())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function s.discon1(e,tp,eg,ep,ev,re,r,rp)
local code=e:GetLabel()
return re:GetHandler():IsOriginalCodeRule(code) and re:IsActiveType(TYPE_MONSTER)
end
function s.disop1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function s.setfilter(c,tp)
return c:IsFaceup() and c:IsCode(46986414) and c:IsSummonPlayer(tp)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.setfilter,1,nil,tp)
end
function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2500) end
Duel.PayLPCost(tp,2500)
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToChain() and aux.NecroValleyFilter()(c) then
Duel.SSet(tp,c)
end
end
...@@ -48,7 +48,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -48,7 +48,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
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()
if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP)~=0 then if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local fid=e:GetHandler():GetFieldID() local fid=e:GetHandler():GetFieldID()
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1,fid) c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
......
...@@ -48,7 +48,7 @@ function c73898890.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -48,7 +48,7 @@ function c73898890.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,2,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g1,2,0,0)
end end
function c73898890.tdop(e,tp,eg,ep,ev,re,r,rp) function c73898890.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain() local g=Duel.GetTargetsRelateToChain():Filter(Card.IsAbleToDeck,nil)
if #g==2 then if #g==2 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end end
......
...@@ -4,7 +4,7 @@ function s.initial_effect(c) ...@@ -4,7 +4,7 @@ function s.initial_effect(c)
--spsummon --spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+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)
e1:SetHintTiming(0,TIMING_MAIN_END) e1:SetHintTiming(0,TIMING_MAIN_END)
......
...@@ -27,7 +27,7 @@ function c80159717.exop(e,tp,eg,ep,ev,re,r,rp) ...@@ -27,7 +27,7 @@ function c80159717.exop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA) local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
local ct=e:GetLabel() local ct=e:GetLabel()
if g:GetCount()<ct then return end if g:GetCount()<ct then return end
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,0,LOCATION_EXTRA,ct,ct,nil) local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,0,LOCATION_EXTRA,ct,ct,nil)
Duel.SendtoGrave(sg,REASON_EFFECT) Duel.SendtoGrave(sg,REASON_EFFECT)
......
...@@ -37,8 +37,9 @@ function c81038234.tfcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -37,8 +37,9 @@ function c81038234.tfcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2 return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end end
function c81038234.tfcost(e,tp,eg,ep,ev,re,r,rp,chk) function c81038234.tfcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end local c=e:GetHandler()
Duel.SendtoGrave(e:GetHandler(),REASON_COST) if chk==0 then return c:IsAbleToGraveAsCost() and c:IsStatus(STATUS_EFFECT_ENABLED) end
Duel.SendtoGrave(c,REASON_COST)
end end
function c81038234.tffilter(c) function c81038234.tffilter(c)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsCode(74665651,1050355) return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsCode(74665651,1050355)
......
--ドレイク・シャーク --ドレイク・シャーク
--not fully implemented
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetCode(EVENT_ADJUST)
e0:SetRange(0xff)
e0:SetOperation(s.adjustop)
c:RegisterEffect(e0)
--spsummon --spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
...@@ -20,14 +14,14 @@ function s.initial_effect(c) ...@@ -20,14 +14,14 @@ function s.initial_effect(c)
e1:SetTarget(s.sptg) e1:SetTarget(s.sptg)
e1:SetOperation(s.spop) e1:SetOperation(s.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--flag --2X material
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(id) e2:SetCode(EFFECT_DOUBLE_XMATERIAL)
e2:SetValue(id) e2:SetRange(LOCATION_MZONE)
e2:SetRange(0xff)
e2:SetTarget(s.sxyzfilter) e2:SetTarget(s.sxyzfilter)
e2:SetValue(id)
e2:SetCountLimit(1,id+o) e2:SetCountLimit(1,id+o)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--material effect --material effect
...@@ -46,175 +40,6 @@ end ...@@ -46,175 +40,6 @@ end
function s.sxyzfilter(e,c) function s.sxyzfilter(e,c)
return c:IsAttribute(ATTRIBUTE_WATER) return c:IsAttribute(ATTRIBUTE_WATER)
end end
function s.Drake_shark_f(function_f,int_lv,card_c)
return function (c)
return c:IsXyzLevel(card_c,int_lv) and (not function_f or function_f(c))
end
end
function s.sxfilter(c,tp,xc)
local te=c:IsHasEffect(id,tp)
if te then
local etg=te:GetTarget()
return not etg or etg(te,xc)
end
return false
end
function s.sxvalue(c,tp,xc)
local te=c:IsHasEffect(id,tp)
if te then
local etg=te:GetTarget()
if not etg or etg(te,xc) then
return te:GetValue()
end
end
end
function s.Drake_shark_gf(int_ct,int_tp,xc)
return function (g)
local ct=g:GetCount()
local eg=g:Filter(s.sxfilter,nil,int_tp,xc)
if #eg>0 then
ct=ct+eg:GetClassCount(s.sxvalue,int_tp,xc)
end
local tc=g:GetFirst()
while tc do
local te=tc:IsHasEffect(EFFECT_XYZ_LEVEL,int_tp)
if te then
local evf=te:GetValue()
if evf then
local ev=evf(te,tc,xc)
local lmct=(ev>>12)&0xf
if lmct>0 and lmct>g:GetCount() then
return false
end
end
end
tc=g:GetNext()
end
return ct>=int_ct
end
end
function s.xfilter(c,tp)
return c:IsHasEffect(id,tp)
end
function s.eftfilter(c,tp)
local te=c:IsHasEffect(id,tp)
return te:GetValue()
end
function s.gcheck(g,tp)
return g:GetClassCount(s.eftfilter,tp)==g:GetCount()
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(0,81096431)==0 then
Duel.RegisterFlagEffect(0,81096431,0,0,1)
Drake_shark_AddXyzProcedure=aux.AddXyzProcedure
function aux.AddXyzProcedure(card_c,function_f,int_lv,int_ct,function_alterf,int_dese,int_maxc,function_op)
if int_ct>=3 then
if function_alterf then
Drake_shark_XyzLevelFreeOperationAlter=Auxiliary.XyzLevelFreeOperationAlter
function Auxiliary.XyzLevelFreeOperationAlter(f,gf,minc,maxc,alterf,alterdesc,alterop)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
Auxiliary.Drake_Solve(tp,og,maxc,minc)
local sg=Group.CreateGroup()
local tc=og:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=og:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
Auxiliary.Drake_Solve(tp,mg,maxc,minc)
if e:GetLabel()==1 then
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
else
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
end
aux.AddXyzProcedureLevelFree(card_c,s.Drake_shark_f(function_f,int_lv,card_c),s.Drake_shark_gf(int_ct,card_c:GetOwner(),card_c),int_ct-2,int_ct,function_alterf,int_dese,function_op)
Auxiliary.XyzLevelFreeOperationAlter=Drake_shark_XyzLevelFreeOperationAlter
else
Drake_shark_XyzLevelFreeOperation=Auxiliary.XyzLevelFreeOperation
function Auxiliary.XyzLevelFreeOperation(f,gf,minct,maxct)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
if og and not min then
Auxiliary.Drake_Solve(tp,og,maxct,minct)
local sg=Group.CreateGroup()
local tc=og:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=og:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(og)
Duel.Overlay(c,og)
else
local mg=e:GetLabelObject()
Auxiliary.Drake_Solve(tp,mg,maxct,minct)
if e:GetLabel()==1 then
local mg2=mg:GetFirst():GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
else
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
end
end
end
aux.AddXyzProcedureLevelFree(card_c,s.Drake_shark_f(function_f,int_lv,card_c),s.Drake_shark_gf(int_ct,card_c:GetOwner(),card_c),int_ct-2,int_ct)
Auxiliary.XyzLevelFreeOperation=Drake_shark_XyzLevelFreeOperation
end
else
if function_alterf then
Drake_shark_AddXyzProcedure(card_c,function_f,int_lv,int_ct,function_alterf,int_dese,int_maxc,function_op)
else
Drake_shark_AddXyzProcedure(card_c,function_f,int_lv,int_ct,nil,nil,int_maxc,nil)
end
end
end
local rg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_EXTRA,LOCATION_EXTRA,nil,TYPE_MONSTER)
for tc in aux.Next(rg) do
if tc.initial_effect then
local Traitor_initial_effect=s.initial_effect
s.initial_effect=function() end
tc:ReplaceEffect(id,0)
s.initial_effect=Traitor_initial_effect
tc.initial_effect(tc)
end
end
end
e:Reset()
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW) return not e:GetHandler():IsReason(REASON_DRAW)
end end
...@@ -255,30 +80,3 @@ function s.xyzop(e,tp,eg,ep,ev,re,r,rp) ...@@ -255,30 +80,3 @@ function s.xyzop(e,tp,eg,ep,ev,re,r,rp)
Duel.Overlay(c,Group.FromCards(tc)) Duel.Overlay(c,Group.FromCards(tc))
end end
end end
function Auxiliary.Drake_Solve(tp,g,maxct,minct,chkg)
if g:GetCount()<maxct and g:GetCount()>=minct and maxct==minct+2 then
local et=maxct-g:GetCount()
local exg=g:Filter(Card.IsHasEffect,nil,81096431,tp)
local ext=exg:GetClassCount(s.eftfilter,tp)
if (et==0 or et==ext) and #exg>0 then
for ttc in aux.Next(exg) do
local tte=ttc:IsHasEffect(81096431,tp)
if tte then
Duel.Hint(HINT_CARD,0,ttc:GetCode())
tte:UseCountLimit(tp)
end
end
elseif #exg>0 then
local st=et
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RESOLVECARD)
local reg=exg:SelectSubGroup(tp,s.gcheck,false,st,st,tp)
for ttc in aux.Next(reg) do
local tte=ttc:IsHasEffect(81096431,tp)
if tte then
Duel.Hint(HINT_CARD,0,ttc:GetCode())
tte:UseCountLimit(tp)
end
end
end
end
end
--ライトウォーター・ドラゴン
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.GetMZoneCount(tp,e:GetHandler())>2 end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsRace(RACE_DINOSAUR) and c:IsAttribute(ATTRIBUTE_WIND+ATTRIBUTE_WATER) and c:IsLevelBelow(5)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and (e:IsCostChecked() or Duel.GetLocationCount(tp,LOCATION_MZONE)>2)
and g:GetCount()>=3 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>2
and g:GetCount()>=3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=g:Select(tp,3,3,nil)
local tc=sg1:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
tc=sg1:GetNext()
end
Duel.SpecialSummonComplete()
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not c:IsRace(RACE_DINOSAUR+RACE_SEASERPENT) and c:IsLocation(LOCATION_EXTRA)
end
...@@ -74,8 +74,7 @@ function c82791472.aclimit(e,re,tp) ...@@ -74,8 +74,7 @@ function c82791472.aclimit(e,re,tp)
return not re:GetHandler():IsSetCard(0x137) and re:IsActiveType(TYPE_MONSTER) return not re:GetHandler():IsSetCard(0x137) and re:IsActiveType(TYPE_MONSTER)
end end
function c82791472.descon(e,tp,eg,ep,ev,re,r,rp) function c82791472.descon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase() return Duel.IsMainPhase() and e:GetHandler():IsSetCard(0x137)
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end end
function c82791472.destg(e,tp,eg,ep,ev,re,r,rp,chk) function c82791472.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
......
...@@ -25,6 +25,7 @@ function c83407038.initial_effect(c) ...@@ -25,6 +25,7 @@ function c83407038.initial_effect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLED) e3:SetCode(EVENT_BATTLED)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c83407038.rmcon)
e3:SetTarget(c83407038.rmtg) e3:SetTarget(c83407038.rmtg)
e3:SetOperation(c83407038.rmop) e3:SetOperation(c83407038.rmop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
...@@ -70,6 +71,9 @@ end ...@@ -70,6 +71,9 @@ end
function c83407038.check(c,tp) function c83407038.check(c,tp)
return c and c:IsControler(tp) and c:IsSetCard(0x4) return c and c:IsControler(tp) and c:IsSetCard(0x4)
end end
function c83407038.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED)
end
function c83407038.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) function c83407038.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetAttackTarget()~=nil if chk==0 then return Duel.GetAttackTarget()~=nil
and (c83407038.check(Duel.GetAttacker(),tp) or c83407038.check(Duel.GetAttackTarget(),tp)) end and (c83407038.check(Duel.GetAttacker(),tp) or c83407038.check(Duel.GetAttackTarget(),tp)) end
......
--御巫神舞-二貴子
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.tgfilter(c)
return not c:IsCode(id) and c:IsSetCard(0x18d) and c:IsAbleToGrave()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.setfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x18d) and not c:IsCode(id) and not c:IsForbidden() and c:IsSSetable()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE)
and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SSet(tp,sg:GetFirst())
end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
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(1,0)
e1:SetTarget(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function s.splimit(e,c)
return not c:IsSetCard(0x18d) and c:IsLocation(LOCATION_EXTRA)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST)
and aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk) end
aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x18d) and c:IsAllTypes(TYPE_MONSTER+TYPE_RITUAL)
and c:IsCanBeSpecialSummoned(e,0,tp,false,true)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,true,POS_FACEUP)
end
end
...@@ -64,7 +64,7 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -64,7 +64,7 @@ function s.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetLabel()) local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetLabel())
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local fid=e:GetHandler():GetFieldID() local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1,fid) tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
......
...@@ -70,7 +70,7 @@ function c85216896.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -70,7 +70,7 @@ function c85216896.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g1,2,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g1,2,0,0)
end end
function c85216896.rmop(e,tp,eg,ep,ev,re,r,rp) function c85216896.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=Duel.GetTargetsRelateToChain():Filter(Card.IsAbleToRemove,nil)
if g:GetCount()~=2 then return end if g:GetCount()~=2 then return end
if Duel.Remove(g,0,REASON_EFFECT+REASON_TEMPORARY)~=0 and g:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED) then if Duel.Remove(g,0,REASON_EFFECT+REASON_TEMPORARY)~=0 and g:IsExists(Card.IsLocation,1,nil,LOCATION_REMOVED) then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED) local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_REMOVED)
......
--M・HERO アトミック
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.MaskChangeLimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e3:SetCountLimit(1)
e3:SetValue(s.indct)
c:RegisterEffect(e3)
--set
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,id+o)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCondition(s.setcon)
e4:SetTarget(s.settg)
e4:SetOperation(s.setop)
c:RegisterEffect(e4)
end
function s.spfilter(c,e,tp)
return c:IsFaceupEx() and not c:IsAttribute(ATTRIBUTE_FIRE) and c:IsSetCard(0xa008) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEUP_DEFENCE)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToChain() and aux.NecroValleyFilter()(tc) then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP_DEFENCE)
end
end
function s.indct(e,re,r,rp)
return bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function s.sfilter(c)
return c:IsSetCard(0xa5) and c:IsType(TYPE_QUICKPLAY) and c:IsSSetable()
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.sfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(s.sfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,s.sfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToChain() and aux.NecroValleyFilter()(tc) then Duel.SSet(tp,tc) end
end
--合体魔竜ティマイオス
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--material
aux.AddMaterialCodeList(c,38033121,46986414)
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionCode,38033121,46986414),aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON+RACE_SPELLCASTER),true)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetOperation(s.imop)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.atktg)
e2:SetOperation(s.atkop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCountLimit(1,id+o)
e3:SetCondition(s.descon)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
end
function s.matfilter1(c)
return c:IsCode(46986414) or c:IsCode(38033121)
end
function s.imop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(s.efilter)
if Duel.GetTurnPlayer()==tp then
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end
c:RegisterEffect(e1)
end
function s.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function s.atkfilter(c)
return c:IsType(TYPE_SPELL) and c:IsFaceupEx()
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMatchingGroupCount(s.atkfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,nil)>0 end
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToChain() then return end
local atk=Duel.GetMatchingGroupCount(s.atkfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,nil)*100
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsType(TYPE_SPELL+TYPE_TRAP) end
if chk==0 then return Duel.IsExistingTarget(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,TYPE_SPELL+TYPE_TRAP)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToChain() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
...@@ -74,7 +74,8 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -74,7 +74,8 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
end end
function s.efilter(e,c,rp,r,re) function s.efilter(e,c,rp,r,re)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and re and r&REASON_EFFECT>0 and rp==1-tp return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
and r&REASON_EFFECT>0 and r&REASON_REDIRECT==0 and rp==1-tp
end end
function s.rmfilter(c,code) function s.rmfilter(c,code)
return c:IsFaceupEx() and c:IsCode(code) and c:IsAbleToRemove() return c:IsFaceupEx() and c:IsCode(code) and c:IsAbleToRemove()
......
...@@ -45,7 +45,7 @@ function c87170768.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -45,7 +45,7 @@ function c87170768.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c87170768.operation(e,tp,eg,ep,ev,re,r,rp) function c87170768.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0 then if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE) Duel.SpecialSummon(c,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
end end
end end
...@@ -126,7 +126,7 @@ function s.filter3(c,e) ...@@ -126,7 +126,7 @@ function s.filter3(c,e)
return c:IsOnField() and not c:IsImmuneToEffect(e) return c:IsOnField() and not c:IsImmuneToEffect(e)
end end
function s.fcheck(tp,sg,fc) function s.fcheck(tp,sg,fc)
return sg:IsExists(Card.IsSetCard,1,nil,0x1a5) return sg:IsExists(Card.IsFusionSetCard,1,nil,0x1a5)
end end
function s.futg(e,tp,eg,ep,ev,re,r,rp,chk) function s.futg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
......
...@@ -4,7 +4,7 @@ function s.initial_effect(c) ...@@ -4,7 +4,7 @@ function s.initial_effect(c)
c:SetUniqueOnField(1,0,id) c:SetUniqueOnField(1,0,id)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcFunFun(c,s.ffilter1,s.ffilter2,1,true) aux.AddFusionProcFunFun(c,s.ffilter1,s.ffilter2,1,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToGraveAsCost,LOCATION_ONFIELD,0,Duel.SendtoGrave,REASON_COST) aux.AddContactFusionProcedure(c,Card.IsAbleToGraveAsCost,LOCATION_ONFIELD+LOCATION_HAND,0,Duel.SendtoGrave,REASON_COST)
--special summon condition --special summon condition
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -38,7 +38,7 @@ function c94185340.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,7 +38,7 @@ function c94185340.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c94185340.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetRank()+1) local sg=Duel.SelectMatchingCard(tp,c94185340.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetRank()+1)
local sc=sg:GetFirst() local sc=sg:GetFirst()
if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP)~=0 then if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(94185340,1)) e1:SetDescription(aux.Stringid(94185340,1))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
......
...@@ -8,7 +8,7 @@ function c94973028.initial_effect(c) ...@@ -8,7 +8,7 @@ function c94973028.initial_effect(c)
e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(c94973028.lvval) e1:SetValue(c94973028.lvval)
c:RegisterEffect(e1) c:RegisterEffect(e1)
-- --indes
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
...@@ -59,7 +59,6 @@ function c94973028.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -59,7 +59,6 @@ function c94973028.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
end end
function c94973028.spop(e,tp,eg,ep,ev,re,r,rp) function c94973028.spop(e,tp,eg,ep,ev,re,r,rp)
if not c94973028.spcon(e,tp,eg,ep,ev,re,r,rp) then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,31533705,0x101b,TYPES_TOKEN_MONSTER,0,0,3,RACE_MACHINE,ATTRIBUTE_WIND) then if Duel.IsPlayerCanSpecialSummonMonster(tp,31533705,0x101b,TYPES_TOKEN_MONSTER,0,0,3,RACE_MACHINE,ATTRIBUTE_WIND) then
......
...@@ -58,7 +58,7 @@ function c95474755.extg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -58,7 +58,7 @@ function c95474755.extg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c95474755.exop(e,tp,eg,ep,ev,re,r,rp) function c95474755.exop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA) local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:FilterSelect(tp,Card.IsAbleToRemove,1,1,nil,tp,POS_FACEDOWN) local sg=g:FilterSelect(tp,Card.IsAbleToRemove,1,1,nil,tp,POS_FACEDOWN)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT) Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
......
...@@ -92,9 +92,10 @@ function s.rmop(e,tp,eg,ep,ev,re,r,rp) ...@@ -92,9 +92,10 @@ function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local res1,tg1=Duel.GetOperationInfo(0,CATEGORY_REMOVE) local res1,tg1=Duel.GetOperationInfo(0,CATEGORY_REMOVE)
local res2,tg2=Duel.GetOperationInfo(0,CATEGORY_SPECIAL_SUMMON) local res2,tg2=Duel.GetOperationInfo(0,CATEGORY_SPECIAL_SUMMON)
local c,rc,sc=e:GetHandler(),tg1:GetFirst(),tg2:GetFirst() local c,rc,sc=e:GetHandler(),tg1:GetFirst(),tg2:GetFirst()
if rc:IsRelateToEffect(e) and rc:IsControler(1-tp) and rc:IsType(TYPE_MONSTER) and c:IsOnField() if rc:IsRelateToEffect(e) and rc:IsControler(1-tp) and rc:IsType(TYPE_MONSTER) and c:IsRelateToEffect(e)
and Duel.Remove(c,POS_FACEUP,REASON_EFFECT)*Duel.Remove(tg1,POS_FACEUP,REASON_EFFECT)>0 then and c:IsAbleToRemove() and rc:IsAbleToRemove() then
if sc:IsRelateToEffect(e) and sc:IsRace(RACE_FISH) then local rg=Group.FromCards(c,rc)
if Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)==2 and sc:IsRelateToEffect(e) then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end end
end end
......
...@@ -50,6 +50,9 @@ function c99801464.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,6 +50,9 @@ function c99801464.eqop(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(100) e2:SetValue(100)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
end end
function c99801464.eqlimit(e,c) function c99801464.eqlimit(e,c)
return c==e:GetLabelObject() return c==e:GetLabelObject()
......
...@@ -609,6 +609,7 @@ EFFECT_REPLACE_DAMAGE =371 --伤害由特定行动代替 ...@@ -609,6 +609,7 @@ EFFECT_REPLACE_DAMAGE =371 --伤害由特定行动代替
EFFECT_XYZ_MIN_COUNT =372 --只能用在X只以上的超量召唤 EFFECT_XYZ_MIN_COUNT =372 --只能用在X只以上的超量召唤
EFFECT_SYNCHRO_LEVEL_EX =373 --支持使用没有等级的怪兽作为同调素材 EFFECT_SYNCHRO_LEVEL_EX =373 --支持使用没有等级的怪兽作为同调素材
EFFECT_RITUAL_LEVEL_EX =374 --支持使用没有等级的怪兽作为仪式素材 EFFECT_RITUAL_LEVEL_EX =374 --支持使用没有等级的怪兽作为仪式素材
EFFECT_DOUBLE_XMATERIAL =375 --召唤需3只以上作素材的超量怪兽时可以作为2只数量的素材
EFFECT_FLAG_EFFECT =0x20000000 --标记类效果,即RegisterFlagEffect()创建的效果 EFFECT_FLAG_EFFECT =0x20000000 --标记类效果,即RegisterFlagEffect()创建的效果
--下面是诱发效果的诱发事件、时点 (如果是TYPE_SINGLE则自己发生以下事件后触发,如果TYPE_FIELD则场上任何卡发生以下事件都触发) --下面是诱发效果的诱发事件、时点 (如果是TYPE_SINGLE则自己发生以下事件后触发,如果TYPE_FIELD则场上任何卡发生以下事件都触发)
......
This diff is collapsed.
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