Commit 3f6f93fd authored by Tachibana's avatar Tachibana

tnndx

parent a154bf91
Pipeline #2930 passed with stages
in 30 minutes and 24 seconds
No preview for this file type
--zone
local m=37564321
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(cm.atktarget)
c:RegisterEffect(e2)
local t={EVENT_SUMMON_SUCCESS,EVENT_FLIP_SUMMON_SUCCESS,EVENT_SPSUMMON_SUCCESS}
for i,v in pairs(t) do
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(0x14000)
e1:SetRange(LOCATION_FZONE)
e1:SetCode(v)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function cm.atktarget(e,c)
return not c:IsType(TYPE_TOKEN)
end
function cm.filter(c)
return c:IsAbleToGrave() and not c:IsType(TYPE_TOKEN)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(cm.filter,1,e:GetHandler()) end
local g=eg:Filter(cm.filter,e:GetHandler(),tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0)
end
function cm.filter2(c,e)
return c:IsAbleToGrave() and c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) and not c:IsType(TYPE_TOKEN)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.filter2,e:GetHandler(),e)
local tc=g:GetFirst()
local c=e:GetHandler()
local tokent={}
while tc do
local p=tc:GetControler()
local atk=tc:GetTextAttack()
local def=tc:GetTextDefense()
local code=tc:GetOriginalCode()
Duel.SendtoGrave(tc,REASON_EFFECT)
table.insert(tokent,{p=tc:GetControler(),
atk=tc:GetTextAttack(),
def=tc:GetTextDefense(),
code=tc:GetOriginalCode()})
tc=g:GetNext()
end
for i,t in pairs(tokent) do
if Duel.GetMZoneCount(p)>0 then
local token=Duel.CreateToken(t.p,m+1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(t.atk)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0xfe0000)
token:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
e2:SetValue(t.def)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+0xfe0000)
token:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetValue(t.code)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+0xfe0000)
token:RegisterEffect(e3,true)
token:CopyEffect(t.code,RESET_EVENT+0xfe0000,1)
Duel.MoveToField(token,t.p,t.p,LOCATION_MZONE,POS_FACEUP,true)
end
end
end
\ No newline at end of file
--Pluto
local m=37564322
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
--[[local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,37564322+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(37564322,ACTIVITY_SPSUMMON,cm.counterfilter)]]
end
function cm.counterfilter(c)
return c:IsSetCard(0x776)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(37564015,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x776)
end
function cm.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x776) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
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