Commit b244360c authored by Tachibana's avatar Tachibana 🐟

reclean

parent ad404312
Pipeline #25969 passed with stages
in 29 minutes
......@@ -10,17 +10,18 @@ function c16200001.initial_effect(c)
c:RegisterEffect(e1)
--inactivatable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_CANNOT_INACTIVATE)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_SZONE,0)
e2:SetValue(c16200001.efilter1)
c:RegisterEffect(e2)
--imm
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(LOCATION_SZONE,0)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetTarget(c16200001.efilter1)
e3:SetValue(c16200001.efilter2)
c:RegisterEffect(e3)
......@@ -30,7 +31,6 @@ function c16200001.initial_effect(c)
e4:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1,16200001)
e4:SetTarget(c16200001.tg1)
......@@ -50,7 +50,7 @@ function c16200001.initial_effect(c)
c:RegisterEffect(e5)
--sum limit
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetRange(LOCATION_FZONE)
e6:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
......@@ -59,7 +59,7 @@ function c16200001.initial_effect(c)
c:RegisterEffect(e6)
end
function c16200001.splimit(e,c,tp,sumtp,sumpos)
return c:GetOriginalCode()~=16200003
return c:GetCode()~=16200003
end
function c16200001.efilter(e,c)
return aux.IsCodeListed(c,16200003) and c:IsFaceup()
......
......@@ -3,7 +3,6 @@ function c16200004.initial_effect(c)
aux.AddCodeList(c,16200003)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_SUMMON)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
......@@ -22,9 +21,9 @@ function c16200004.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16200004,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN+CATEGORY_REMOVE+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,16200004+100)
e1:SetCondition(c16200004.condition)
e1:SetTarget(c16200004.target)
......@@ -47,7 +46,7 @@ function c16200004.initial_effect(c)
end
--sum limit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetRange(LOCATION_SZONE)
e5:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
......@@ -56,7 +55,7 @@ function c16200004.initial_effect(c)
c:RegisterEffect(e5)
end
function c16200004.splimit(e,c,tp,sumtp,sumpos)
return c:GetOriginalCode()~=16200003
return c:GetCode()~=16200003
end
function c16200004.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
......@@ -76,8 +75,8 @@ function c16200004.filter(c)
return c:IsSummonable(true,nil,1) or c:IsMSetable(true,nil,1)
end
function c16200004.scost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(REASON_COST,tp,c16200004.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(REASON_COST,tp,c16200004.cfilter,1,1,nil,tp)
if chk==0 then return Duel.CheckReleaseGroup(tp,c16200004.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c16200004.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c16200004.stg(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -110,18 +109,19 @@ function c16200004.sop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function c16200004.relfilter(c)
return c:IsAbleToRemove()
function c16200004.relfilter(c,tp)
return c:IsAbleToRemove(tp,POS_FACEDOWN)
end
function c16200004.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(1-tp,16200004)>=5 and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c16200004.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroupCount(c16200004.relfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local g2=Duel.GetMatchingGroupCount(c16200004.relfilter,tp,0,LOCATION_MZONE,nil)
local g=Duel.GetMatchingGroupCount(c16200004.relfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)
Debug.Message(g)
if chk==0 then return Duel.IsPlayerCanSpecialSummonMonster(tp,16200003,0,0x4011,0,0,1,RACE_WARRIOR,ATTRIBUTE_DARK)
and g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,g2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,0,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,g,0,0)
end
function c16200004.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -56,7 +56,7 @@ function c16200005.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return e:GetLabelObject()~=se
end
function c16200005.thfilter(c)
return c:IsAbleToHand() and aux.IsCodeListed(c,16200003)
return (c:IsAbleToHand() or c:GetActivateEffect():IsActivatable(tp)) and aux.IsCodeListed(c,16200003)
end
function c16200005.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE,0)
......@@ -106,11 +106,33 @@ function c16200005.activate(e,tp,eg,ep,ev,re,r,rp)
end
Duel.SpecialSummonComplete()
if Duel.IsExistingMatchingCard(c16200005.thfilter,tp,LOCATION_DECK,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c16200005.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
local op=aux.SelectFromOptions(tp,
{tc:IsAbleToHand(),aux.Stringid(16200005,0)},
{tc:GetActivateEffect():IsActivatable(tp),aux.Stringid(16200005,1)})
if op==1 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
elseif op==2 then
local zone=LOCATION_SZONE
if tc:IsType(TYPE_FIELD) then
zone=LOCATION_FZONE
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
end
Duel.MoveToField(tc,tp,tp,zone,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
end
......
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