Commit 1feaa6c9 authored by Satty's avatar Satty

fix

parent 8c32f3de
Pipeline #36600 passed with stages
in 30 minutes and 1 second
......@@ -7,10 +7,12 @@ function s.initial_effect(c)
-- Effect ①: Remove 1 "Shin-Tsubaki" Spell/Trap from GY to add another "Shin-Tsubaki" Spell/Trap from deck to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetCondition(s.thcon1)
e1:SetTarget(s.thtg1)
e1:SetOperation(s.thop1)
c:RegisterEffect(e1)
......@@ -28,43 +30,50 @@ function s.initial_effect(c)
end
-- Effect ①: Remove 1 "Shin-Tsubaki" Spell/Trap from GY to add another "Shin-Tsubaki" Spell/Trap from deck to hand
function s.filter_th(c)
return c:IsSetCard(0x680) and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP)) and c:IsAbleToRemove()
function s.thcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
end
function s.thfilter1(c,tp)
return c:IsSetCard(0x680) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove() and Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_DECK,0,1,c)
end
function s.thfilter2(c,code)
return c:IsSetCard(0x680) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:GetCode()~=code and c:IsAbleToHand()
end
function s.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter_th,tp,LOCATION_GRAVE,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter1,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.filter_th,tp,LOCATION_GRAVE,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,s.thfilter1,tp,LOCATION_GRAVE,0,1,1,nil,tp)
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
local code=g:GetFirst():GetCode()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local exc=g:GetFirst()
local g2=Duel.GetMatchingGroup(aux.FilterBoolFunction(Card.IsSetCard,0x680),tp,LOCATION_DECK,0,nil)
g2:Remove(Card.IsCode,nil,exc:GetCode())
local g2=Duel.SelectMatchingCard(tp,s.thfilter2,tp,LOCATION_DECK,0,1,1,nil,code)
if #g2>0 then
Duel.SendtoHand(g2,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g2:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
-- Restrict special summoning non-"Shin-Tsubaki" monsters from the extra deck this turn
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
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,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x680) and c:IsLocation(LOCATION_EXTRA)
end
-- Effect ②: Show a Fusion Monster from the Extra Deck and send 1 Fusion Material to GY
function s.filter2(c,fc)
return aux.IsMaterialListCode(fc,c:GetCode()) and c:IsAbleToGraveAsCost()
......
......@@ -22,9 +22,8 @@ function s.initial_effect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_MOVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.spcon2)
e2:SetTarget(s.sptg2)
......
......@@ -2,11 +2,11 @@
local cm, m, o = GetID()
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
......@@ -22,6 +22,13 @@ function cm.initial_effect(c)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e4:SetCondition(cm.condition)
c:RegisterEffect(e4)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
......@@ -34,7 +41,12 @@ end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(rp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x829) and c:IsLevelAbove(7)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
end
function cm.actfilter(c)
return c:IsFaceup() and c:IsSetCard(0x829) and c:IsLevelAbove(7)
......
......@@ -69,7 +69,7 @@ function s.spfilter(c,e,tp)
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
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)
......@@ -77,7 +77,7 @@ function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
......
......@@ -37,7 +37,7 @@ function c5012730.initial_effect(c)
c:RegisterEffect(e6)
end
function s.ffilter(c)
return c:IsLocation(LOCATION_MZONE)
return c:IsLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_NORMAL)
end
function c5012730.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -11,7 +11,7 @@ function c60150509.initial_effect(c)
e12:SetCategory(CATEGORY_SPECIAL_SUMMON)
e12:SetType(EFFECT_TYPE_IGNITION)
e12:SetCountLimit(1,60150509)
e12:SetRange(LOCATION_SZONE)
e12:SetRange(LOCATION_FZONE)
--e12:SetCondition(c60150509.condition)
e12:SetTarget(c60150509.target)
e12:SetOperation(c60150509.operation)
......@@ -21,7 +21,7 @@ function c60150509.initial_effect(c)
e23:SetDescription(aux.Stringid(60150509,2))
e23:SetType(EFFECT_TYPE_IGNITION)
e23:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e23:SetRange(LOCATION_SZONE)
e23:SetRange(LOCATION_FZONE)
e23:SetCountLimit(1,6010509)
e23:SetCondition(c60150509.tgcon)
e23:SetCost(c60150509.cost)
......@@ -69,9 +69,7 @@ function c60150509.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
function c60150509.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c60150509.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
......
......@@ -29,7 +29,7 @@ function c60151013.initial_effect(c)
c:RegisterEffect(e3)
end
function c60151013.filter(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsSetCard(0x5b23) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsSetCard(0x5b23) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c60151013.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c60151013.filter(chkc,e,tp) end
......
......@@ -49,7 +49,7 @@ function c60158215.e1conf(c)
return c:IsFaceup() and (c:IsCode(60158001) or c:IsType(TYPE_LINK))
end
function c60158215.e1con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c60158215.e1conf,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsChainNegatable(ev)
return Duel.IsExistingMatchingCard(c60158215.e1conf,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.IsChainNegatable(ev)
and ep==1-tp
end
function c60158215.e1tg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -50,7 +50,7 @@ function c60158216.e1conf(c)
return c:IsFaceup() and (c:IsCode(60158001) or c:IsType(TYPE_LINK))
end
function c60158216.e1con(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c60158216.e1conf,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and rp==1-tp
return Duel.IsExistingMatchingCard(c60158216.e1conf,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and rp==1-tp
end
function c60158216.e1tgf(c)
return c:IsType(TYPE_LINK) and c:IsAbleToRemove()
......
......@@ -10,7 +10,6 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
......
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