Commit 276835db authored by Tachibana's avatar Tachibana

12

parent f8d182a9
Pipeline #3745 passed with stages
in 44 minutes and 1 second
No preview for this file type
......@@ -23,7 +23,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2)
end
function cm.filter(c)
return (c:IsSetCard(0x1374) and c:IsType(TYPE_MONSTER)) or (c:IsSetCard(0x374) and c:IsType(TYPE_CONTINUOUS) and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP)) and c:IsAbleToDeck()
return (((c:IsSetCard(0x1374) and c:IsType(TYPE_MONSTER)) or (c:IsSetCard(0x374) and c:IsType(TYPE_CONTINUOUS))) and c:IsAbleToDeck()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.filter(chkc) end
......
--四夜一夜物语
local m=81000015
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,81000000)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,m)
e1:SetCondition(aux.bpcon)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m+900)
e2:SetCost(cm.hcost)
e2:SetTarget(cm.drtg)
e2:SetOperation(cm.drop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(m,ACTIVITY_SUMMON,cm.counterfilter)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
Duel.AddCustomActivityCounter(m,ACTIVITY_FLIPSUMMON,cm.counterfilter)
Duel.AddCustomActivityCounter(m,ACTIVITY_CHAIN,cm.chainfilter)
end
function cm.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER)
end
function cm.counterfilter(c)
return not c:IsType(TYPE_EFFECT)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SUMMON)==0
and Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0
and Duel.GetCustomActivityCount(m,tp,ACTIVITY_FLIPSUMMON)==0 and Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)==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:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.sumlimit)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
Duel.RegisterEffect(e3,tp)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetTargetRange(1,0)
e4:SetValue(cm.aclimit)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsType(TYPE_EFFECT)
end
function cm.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER)
end
function cm.filter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and not (c:IsType(TYPE_TOKEN) or c:IsType(TYPE_EFFECT))
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetLabelObject(tc)
e1:SetCondition(cm.rmcon1)
e1:SetOperation(cm.rmop1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function cm.rmcon1(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return eg:IsContains(tc) and tc:GetFlagEffect(m)~=0 and ep~=tp
end
function cm.rmop1(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)
if rg<1 then return end
Duel.Hint(HINT_CARD,0,m)
Duel.DiscardHand(1-tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
end
function cm.cfilter(c)
return c:IsCode(81000000,81011000,26807000) and c:IsFaceup()
end
function cm.hcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,0)
and cm.cost(e,tp,eg,ep,ev,re,r,rp,0) end
aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,1)
cm.cost(e,tp,eg,ep,ev,re,r,rp,1)
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD,0,nil)
local ct=g:GetClassCount(Card.GetCode)
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_ONFIELD,0,nil)
local ct=g:GetClassCount(Card.GetCode)
Duel.Draw(p,ct,REASON_EFFECT)
end
--八宫一月·寂
local m=81001012
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(cm.spcon)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--banish deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_REMOVE)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e3:SetCondition(cm.dscon)
e3:SetCost(cm.cost)
e3:SetTarget(cm.dstg)
e3:SetOperation(cm.dsop)
c:RegisterEffect(e3)
--banish deck
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_REMOVE)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e4:SetCondition(cm.dkcon)
e4:SetCost(cm.cost)
e4:SetTarget(cm.dktg)
e4:SetOperation(cm.dkop)
c:RegisterEffect(e4)
end
function cm.spfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToRemoveAsCost()
end
function cm.spcon(e,c)
if c==nil then return true end
if Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)<=0 then return false end
local g=Duel.GetMatchingGroup(cm.spfilter,c:GetControler(),LOCATION_GRAVE,0,nil)
local ct=g:GetClassCount(Card.GetCode)
return ct>=8
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
aux.GCheckAdditional=aux.dncheck
local rg=g:SelectSubGroup(tp,aux.TRUE,false,7,7)
aux.GCheckAdditional=nil
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.dsfilter(c,p)
return c:IsFaceup() and c:IsControler(p)
end
function cm.dscon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.dsfilter,1,nil,tp)
end
function cm.dstg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(cm.dsfilter,tp,LOCATION_REMOVED,0,nil,tp)
local tg=Duel.GetDecktopGroup(tp,ct)
if chk==0 then return ct>0
and tg:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEUP)==ct end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,ct,tp,LOCATION_DECK)
end
function cm.dsop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(cm.dsfilter,tp,0,LOCATION_REMOVED,nil,tp)
if ct==0 then return end
local tg=Duel.GetDecktopGroup(tp,ct)
Duel.DisableShuffleCheck()
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
end
function cm.dkfilter(c,p)
return c:IsFacedown() and c:IsControler(p)
end
function cm.dkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.dkfilter,1,nil,tp)
end
function cm.dktg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(cm.dkfilter,tp,LOCATION_REMOVED,0,nil,tp)
local tg=Duel.GetDecktopGroup(tp,ct)
if chk==0 then return ct>0
and tg:FilterCount(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)==ct end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,ct,tp,LOCATION_DECK)
end
function cm.dkop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(cm.dkfilter,tp,0,LOCATION_REMOVED,nil,tp)
if ct==0 then return end
local tg=Duel.GetDecktopGroup(tp,ct)
Duel.DisableShuffleCheck()
Duel.Remove(tg,POS_FACEDOWN,REASON_EFFECT)
end
......@@ -52,6 +52,7 @@ function c9330014.target(e,tp,eg,ep,ev,re,r,rp,chk)
if not c:IsStatus(STATUS_ACT_FROM_HAND) and c:IsLocation(LOCATION_SZONE) then
and e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(c9330014.chlimit)
end
end
function c9330014.chlimit(e,ep,tp)
return tp==ep
......
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