Commit e689e1d1 authored by gggg's avatar gggg

add new

parent a670ab6c
No preview for this file type
......@@ -30,7 +30,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e4)
end
function cm.filter(c)
return c:IsFaceup() and Senya.check_set_elem(c)
return c:IsFaceup()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end
......
--otokaze2024
function c37573001.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(aux.TRUE),1)
c:EnableReviveLimit()
--search
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetDescription(aux.Stringid(37573001,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetCountLimit(1,37573001)
--e1:SetCost(c37573001.thcost)
e1:SetTarget(c37573001.thtg)
e1:SetOperation(c37573001.thop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetDescription(aux.Stringid(37573001,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,0x1e0)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,37573001)
e2:SetCost(c37573001.descost)
e2:SetTarget(c37573001.destg)
e2:SetOperation(c37573001.desop)
c:RegisterEffect(e2)
end
function c37573001.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,LOCATION_ONFIELD)
end
function c37573001.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if dg:GetCount()>0 then
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
function c37573001.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c37573001.cfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c37573001.cfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function c37573001.cfilter(c,tp)
if not c:IsType(TYPE_MONSTER) then return false end
local attr=c:GetAttribute()
local race=c:GetRace()
local function field_filter(c)
return c:IsFaceup() and c:IsAttribute(attr) and c:IsRace(race)
end
return c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(field_filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function c37573001.costfilter(c,tp)
if not (c:IsAbleToDeckAsCost() and c:IsType(TYPE_MONSTER)) then return false end
local race=c:GetRace()
local attr=c:GetAttribute()
return Duel.IsExistingMatchingCard(c37573001.costfilter2,tp,LOCATION_GRAVE,0,2,c,attr,race)
and Duel.IsExistingMatchingCard(c37573001.thfilter,tp,LOCATION_DECK,0,1,nil,attr,race)
end
function c37573001.costfilter2(c,attr,race)
return c:IsAbleToDeckAsCost() and c:IsAttribute(attr) and c:IsRace(race)
end
function c37573001.thfilter(c,attr,race)
return c:IsAbleToHand() and c:IsAttribute(attr) and c:IsRace(race)
end
local race_list={}
function c37573001.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c37573001.costfilter,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g1=Duel.SelectMatchingCard(tp,c37573001.costfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
local c1=g1:GetFirst()
local attr=c1:GetAttribute()
local race=c1:GetRace()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=Duel.SelectMatchingCard(tp,c37573001.costfilter2,tp,LOCATION_GRAVE,0,2,2,c1,attr,race)
Duel.SendtoDeck(g1+g2,nil,2,REASON_COST)
race_list[e]={attr=attr,race=race}
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c37573001.thop(e,tp,eg,ep,ev,re,r,rp)
local record=race_list[e]
if not record then return end
local attr=record.attr
local race=record.race
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c37573001.thfilter,tp,LOCATION_DECK,0,1,1,nil,attr,race)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
local s,id,o=GetID()
---@param c Card
function s.initial_effect(c)
c:EnableReviveLimit()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e3)
local e1=Effect.CreateEffect(c)
e1:SetDescription(1165)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetValue(function()
return SUMMON_TYPE_XYZ,0x60
end)
e1:SetCondition(s.xyzcon)
e1:SetOperation(s.xyzop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetCondition(s.discon)
e2:SetTarget(s.splimit)
c:RegisterEffect(e2)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetDescription(aux.Stringid(51960178,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.xyzcon(e,c,og,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local minc=2
local maxc=99
if min then
minc=math.max(minc,min)
maxc=math.min(maxc,max)
end
if maxc<minc then return false end
if og then
return false
end
local mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
if og and not og:Equal(mg) then return false end
local sg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_XMATERIAL)
return
not sg:IsExists(function(c) return not mg:IsContains(sg) end,1,nil)
and #mg>=minc
and #mg<=maxc
and not mg:IsExists(function(mc)
return not mc:IsXyzLevel(c,5) and not mc:IsRank(5) and not mc:IsLink(5)
or mc:IsOnField() and mc:IsFacedown()
or not mc:IsCanBeXyzMaterial(c)
end
,1,nil)
and Duel.GetLocationCountFromEx(tp,tp,mg,c,0x60)>0
end
function s.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
local mg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
local dg=Group.CreateGroup()
for mc in aux.Next(mg) do
dg = dg + mc:GetOverlayGroup()
end
if #dg>0 then
Duel.SendtoGrave(dg,REASON_RULE)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
end
function s.discon(e)
return e:GetHandler():GetOverlayCount()>0
end
function s.splimit(e,c)
return c:IsLocation(LOCATION_EXTRA)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
local s,id,o=GetID()
---@param c Card
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function s.filter(c)
return c:IsType(TYPE_FIELD) and c:IsSSetable()
end
function s.costfilter(c)
return c:IsType(TYPE_FIELD) and c:IsAbleToDeckAsCost()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local l=e:GetLabel()
e:SetLabel(0)
if chk==0 then return l==100 and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
Duel.SendtoDeck(g,tp,SEQ_DECKTOP,REASON_COST)
e:SetLabelObject(g:GetFirst())
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local dg=Duel.GetDecktopGroup(tp,1)
if dg:GetFirst()~=tc then return end
if Duel.SSet(tp,tc,1-tp,false)<=0 then return end
local confirms=Group.FromCards(tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.BreakEffect()
if Duel.SSet(tp,g,tp,false) then
confirms:Merge(g)
end
end
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetLabelObject(tc)
e1:SetCondition(s.con)
e1:SetValue(s.actlimit)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SSET)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetLabelObject(tc)
e2:SetCondition(s.con)
e2:SetTarget(s.setlimit)
Duel.RegisterEffect(e2,tp)
Duel.ConfirmCards(1-tp,confirms)
end
function s.con(e)
local tc=e:GetLabelObject()
if tc:IsFacedown() and tc:GetFlagEffect(id)~=0 then
return true
end
e:Reset()
return false
end
function s.actlimit(e,re,tp)
return re:IsActiveType(TYPE_FIELD) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function s.setlimit(e,c,tp)
return c:IsType(TYPE_FIELD)
end
function c37573004.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
--e1:SetCountLimit(1,37573004+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c37573004.target)
e1:SetOperation(c37573004.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c37573004.handcon)
e2:SetCost(c37573004.cost)
e2:SetDescription(aux.Stringid(37573004,1))
c:RegisterEffect(e2)
end
function c37573004.handcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==0
end
function c37573004.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000) end
Duel.PayLPCost(tp,2000)
end
function c37573004.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
end
function c37573004.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c37573004.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c37573004.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c37573004.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c37573004.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
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