Commit 7ceb6042 authored by Nemo Ma's avatar Nemo Ma

0310wd

parent c43a5563
......@@ -1593,6 +1593,15 @@
98920618 0
98920671 0
98920730 0
14010146 0
14010147 0
14010148 0
16670007 0
16670012 0
16670035 0
16670045 0
60010034 0
60010035 0
#Semi-Wild 1003
31409200 0
31409201 0
......
No preview for this file type
This diff is collapsed.
--破名椛
local m=14010147
local cm=_G["c"..m]
function cm.initial_effect(c)
--limit
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
local ac=Duel.AnnounceCard(tp)
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,ANNOUNCE_CARD)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
e:GetHandler():SetHint(CHINT_CARD,ac)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetTarget(cm.splimit)
e1:SetLabel(ac)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetLabel(ac)
e2:SetValue(cm.aclimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsCode(e:GetLabel())
end
function cm.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel())
end
\ No newline at end of file
--亡都祭
local m=14010148
local cm=_G["c"..m]
function cm.initial_effect(c)
--tograve
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_FZONE,1,nil)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,tp,LOCATION_ONFIELD)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SendtoGrave(g,REASON_EFFECT)
end
\ No newline at end of file
--久远的传承
local m=16670007
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
-- e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
--
if not c16670007.global_check then
c16670007.global_check={}
-- local ge1=Effect.GlobalEffect(c)
-- ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
-- ge1:SetCode(EVENT_TO_GRAVE)
-- ge1:SetCondition(c16670007.checkcon)
-- ge1:SetOperation(c16670007.checkop)
-- Duel.RegisterEffect(ge1,0)
end
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
local code1=g:GetFirst()
local code=g:GetFirst():GetOriginalCodeRule()
local cid=0
local cid2=0
local ua=false
local token=true
local mt={}
for tc,num in pairs(c16670007.global_check) do
cid=num
token=Duel.CreateToken(tp,num)
mt=getmetatable(token)
cm.reg =Card.RegisterEffect
Card.RegisterEffect = cm.reg2
if mt.initial_effect then
mt.initial_effect(code1)
end
Card.RegisterEffect = cm.reg
-- cid2=code1:CopyEffect(cid,RESET_EVENT+RESETS_STANDARD,1)
-- Duel.MajesticCopy(code1,token)
end
for i,v in pairs(c16670007.global_check) do
if v==code then
ua=true
end
end
if ua==false then
table.insert(c16670007.global_check,code)
end
local e1_1=Effect.CreateEffect(c)
e1_1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1_1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1_1:SetRange(LOCATION_MZONE)
e1_1:SetCode(EVENT_LEAVE_FIELD)
e1_1:SetTarget(cm.tg1)
e1_1:SetOperation(cm.op1)
-- e1_1:SetReset(RESET_EVENT+0x1fe0000)
code1:RegisterEffect(e1_1)
--
local e1_2=Effect.CreateEffect(c)
e1_2:SetDescription(aux.Stringid(16670007,0))
e1_2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1_2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1_2:SetRange(LOCATION_MZONE)
e1_2:SetCode(EVENT_LEAVE_FIELD)
e1_2:SetReset(RESET_EVENT+0x1fe0000)
code1:RegisterEffect(e1_2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCountLimit(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetLabelObject(e1_1)
e3:SetLabel(cid2)
e3:SetOperation(cm.rstop)
code1:RegisterEffect(e3)
--
end
local ap=e:GetType()
if ap~=EFFECT_TYPE_ACTIVATE then
e:Reset()
end
end
--
function cm.rstop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cid=e:GetLabel()
if cid~=0 then
c:ResetEffect(cid,RESET_COPY)
c:ResetEffect(RESET_DISABLE,RESET_EVENT)
end
local e1=e:GetLabelObject()
local e2=e:GetProperty()
e1:Reset()
end
function cm.reg2(c,e,ob)
local b=ob or false
if e:IsHasType(EFFECT_TYPE_QUICK_F) then
e:SetType((e:GetType()-EFFECT_TYPE_QUICK_F)|EFFECT_TYPE_QUICK_O)
local flag1,flag2=e:GetProperty()
e:SetProperty(flag1|EFFECT_FLAG_DELAY,flag2)
end
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
e:SetType((e:GetType()-EFFECT_TYPE_TRIGGER_F)|EFFECT_TYPE_TRIGGER_O)
end
e:SetReset(RESET_EVENT+RESETS_STANDARD)
if not e:IsActivated() then e:Reset()
else
cm.reg(c,e,b)
end
end
--惊喜礼盒
local m=16670012
local cm=_G["c"..m]
cm.loaded_metatable_list={}
cm.loaded_metatable_list2={}
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
--e1:SetCountLimit(3,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
c:RegisterEffect(e2)
--
if not cm.global_check then
cm.global_check=true
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e11:SetCode(EVENT_PHASE+PHASE_DRAW)
e11:SetCountLimit(1)
e11:SetOperation(cm.thop)
-- Duel.RegisterEffect(e11,0)
end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local s=math.random(0,9)
local s1=s*1000000
local s2=s1+999999
for i=1,9999999 do
local mt1=cm.load_metatable(i)
if mt1 then
local token=Duel.CreateToken(tp,l)
if token and (token:IsType(TYPE_SPELL) or token:IsType(TYPE_TRAP)) then
table.insert(cm.loaded_metatable_list2,i)
end
end
end
e:Reset()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return true
end
e:SetLabel(0)
local c=e:GetHandler()
--[[
local codelist={}
local s=math.random(0,9)
local s1=s*1000000
local s2=s1+999999
math.randomseed(tostring(os.time()):reverse():sub(1, 6))
]]--
local codelist2=0
for i=1,9999999 do
if codelist2~=0 then
break
end
local l=Duel.GetRandomNumber(1,9999999)--math.random(1,9999999)
--local l=math.random(1,#cm.loaded_metatable_list2)
--local mt=cm.load_metatable(l)
local mt=cm.load_metatable_load(l)
if mt then
local token=Duel.CreateToken(tp,l)
if token and (token:IsType(TYPE_SPELL) or token:IsType(TYPE_TRAP)) and not token:IsType(TYPE_EQUIP)
and-- not token:IsType(TYPE_CONTINUOUS) and
not token:IsType(TYPE_FIELD)
-- and not token:IsType(TYPE_FIELD) and not token:IsType(TYPE_CONTINUOUS)
and token:CheckActivateEffect(false,true,false)~=nil
and token:CheckActivateEffect(false,true,false):GetOperation()~=nil then
-- table.insert(codelist,i)
--[[local ab=codelist--cm.get_announce(codelist)
for i=1,5 do
local p=math.random(1,#ab)
table.insert(codelist2,1,ab[p])
end
local ac=codelist2[1] ]]--
--if token:CheckActivateEffect(true,true,false)==nil then
-- e:SetLabelObject(nil)
-- else
-- c:SetHint(CHINT_CARD,l)
Duel.Hint(HINT_CARD,tp,l)
Duel.Hint(HINT_CODE,1-tp,l)
Duel.Hint(HINT_CODE,tp,l)
local te,ceg,cep,cev,cre,cr,crp=token:CheckActivateEffect(true,true,true)
e:SetProperty(te:GetProperty())
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET,0,1,0,0)
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
--end
codelist2=codelist2+1
end
end
end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
if not te then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
local num=c:GetFlagEffect(m)
if c:IsRelateToEffect(e) and c:IsCanTurnSet() and e:IsHasType(EFFECT_TYPE_ACTIVATE) and c:IsLocation(LOCATION_SZONE)
and num<2 then
Duel.BreakEffect()
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
function cm.get_announce(t)
local rt={t[1],OPCODE_ISCODE}
for i=2,#t do
if not t[i] then break end
table.insert(rt,t[i])
table.insert(rt,OPCODE_ISCODE)
table.insert(rt,OPCODE_OR)
end
table.insert(rt,TYPE_TRAP)
table.insert(rt,OPCODE_ISTYPE)
table.insert(rt,TYPE_SPELL)
table.insert(rt,OPCODE_ISTYPE)
table.insert(rt,OPCODE_AND)
table.insert(rt,OPCODE_AND)
return rt
end
function cm.load_metatable(code)
--local m1=_G["c"..code]
--if m1 then return m1 end
local m2=cm.loaded_metatable_list[code]
if m2 then return m2 end
_G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
local mt=_G["c"..code]
_G["c"..code]=nil
if mt then
-- cm.loaded_metatable_list[code]=mt
return mt
end
else
_G["c"..code]=nil
end
end
function cm.load_metatable_load(code)
local type=Duel.ReadCard(code,CARDDATA_TYPE)
return type
end
function cm.load_metatable2(code)
local m2=cm.loaded_metatable_list[code]
if m2 then return m2 end
_G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
local mt=_G["c"..code]
_G["c"..code]=nil
if mt then
cm.loaded_metatable_list[code]=mt
return mt
end
else
_G["c"..code]=nil
end
end
\ No newline at end of file
--军火大师
local m=16670035
local cm=_G["c"..m]
function cm.initial_effect(c)
--
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_PREDRAW)
e0:SetRange(0xfff)
e0:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e0:SetOperation(cm.autoop)
c:RegisterEffect(e0)
--
end
function cm.autoop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
Duel.Hint(HINT_CARD,1-tp,m)
Duel.ConfirmCards(1-tp,c)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0xfff,0,nil)
local g2=Duel.GetMatchingGroup(aux.TRUE,tp,0,0xfff-LOCATION_OVERLAY,nil)
Duel.Exile(g,REASON_RULE)
for tc in aux.Next(g2) do
local ac=tc:GetOriginalCode()
local token=Duel.CreateToken(tp,ac)
if tc:IsLocation(LOCATION_DECK) then
Duel.SendtoDeck(token,tp,SEQ_DECKBOTTOM,REASON_RULE)
elseif tc:IsLocation(LOCATION_HAND) then
Duel.SendtoHand(token,tp,REASON_RULE)
elseif tc:IsLocation(LOCATION_ONFIELD) then
local q=tc:GetPosition()
local w=tc:GetSequence()
local a=false
if tc:IsFaceup() then
a=true
end
if tc:IsLocation(LOCATION_MZONE) then
Duel.MoveToField(token,tp,tp,LOCATION_MZONE,q,a,w)
else
Duel.MoveToField(token,tp,tp,LOCATION_SZONE,q,a,w)
end
elseif tc:IsLocation(LOCATION_GRAVE) then
Duel.SendtoGrave(token,REASON_RULE)
elseif tc:IsLocation(LOCATION_EXTRA) then
if tc:IsFaceup() then
Duel.SendtoExtraP(token,nil,REASON_RULE)
else
Duel.SendtoDeck(token,tp,SEQ_DECKBOTTOM,REASON_RULE)
end
elseif tc:IsLocation(LOCATION_REMOVED) then
local q=tc:GetPosition()
Duel.Remove(token,q,REASON_RULE)
end
if tc:GetOverlayGroup()~=nil then
local g3=tc:GetOverlayGroup()
for tz in aux.Next(g3) do
local az=tz:GetOriginalCode()
local token2=Duel.CreateToken(tp,az)
Duel.SendtoDeck(token2,tp,SEQ_DECKBOTTOM,REASON_RULE)
Duel.Overlay(token,token2)
end
end
end
--[[
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_DRAW_COUNT)
e2:SetTargetRange(1,0)
e2:SetValue(2)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_SUMMON_COUNT_LIMIT)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetValue(2)
Duel.RegisterEffect(e3,tp)
]]--
g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_DECK,0,nil)
Duel.ConfirmCards(tp,g)
end
--血源猎手 永世的沉沦鲸梦
local cm,m,o=GetID()
function cm.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.rcon)
e1:SetOperation(cm.rop)
c:RegisterEffect(e1)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.otg)
e3:SetOperation(cm.oop)
c:RegisterEffect(e3)
end
cm.toss_dice=true
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_HAND) and e:GetHandler():IsAbleToRemove()
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0 and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)<=1 then
Duel.Draw(e:GetHandlerPlayer(),1,REASON_EFFECT)
end
end
function cm.otg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_DECK,0)>0 end
end
function cm.oop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local x=Duel.TossDice(tp,1)
Duel.Draw(tp,x,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local hg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil):Select(tp,x,x,nil)
Duel.SendtoDeck(hg,tp,0,REASON_EFFECT)
local hg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil)
local fst=false
local scd=false
local trd=false
if hg:IsExists(Card.IsType,2,nil,TYPE_SPELL) then fst=true end
if hg:IsExists(Card.IsType,2,nil,TYPE_MONSTER) then scd=true end
if hg:IsExists(Card.IsType,1,nil,TYPE_MONSTER) and hg:IsExists(Card.IsType,1,nil,TYPE_SPELL) and hg:IsExists(Card.IsType,1,nil,TYPE_TRAP) then trd=true end
if fst==true then
Duel.ConfirmDecktop(tp,x)
local g=Duel.GetDecktopGroup(tp,x)
if g:GetCount()>0 then
local gc=g:GetFirst()
for i=1,g:GetCount() do
if gc:IsType(TYPE_SPELL) and gc:CheckActivateEffect(false,false,false)~=nil then
local te=gc:GetActivateEffect()
if gc:IsType(TYPE_FIELD) then
Duel.MoveToField(gc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
Duel.RaiseEvent(gc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
else
Duel.MoveToField(gc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
te:UseCountLimit(tp,1,true)
cm.ActivateCard(gc,tp,e)
if not (gc:IsType(TYPE_CONTINUOUS) or gc:IsType(TYPE_FIELD) or gc:IsType(TYPE_EQUIP)) then
Duel.SendtoGrave(gc,REASON_RULE)
end
end
gc=g:GetNext()
end
end
end
if scd==true then
Duel.ConfirmDecktop(tp,x)
local g=Duel.GetDecktopGroup(tp,x)
if g:GetCount()>0 then
local gc=g:GetFirst()
for i=1,g:GetCount() do
if gc:IsType(TYPE_MONSTER) and gc:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SpecialSummon(gc,0,tp,tp,false,false,POS_FACEUP)
end
gc=g:GetNext()
end
end
end
if trd==true then
Duel.ConfirmDecktop(tp,x)
local hhg=Duel.GetDecktopGroup(tp,x)
local mth=math.min(hhg:Filter(Card.IsType,nil,TYPE_MONSTER):GetCount(),hhg:Filter(Card.IsType,nil,TYPE_SPELL):GetCount(),hhg:Filter(Card.IsType,nil,TYPE_TRAP):GetCount())
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(1-tp,g)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_DISCARD)
local sg=g:Select(tp,1,mth,nil)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD)
Duel.ShuffleHand(1-tp)
end
end
end
function cm.ActivateCard(c,tp,oe)
local e=c:GetActivateEffect()
local cos,tg,op=e:GetCost(),e:GetTarget(),e:GetOperation()
if e and (not cos or cos(e,tp,eg,ep,ev,re,r,rp,0)) and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0)) then
oe:SetProperty(e:GetProperty())
local code=c:GetOriginalCode()
Duel.Hint(HINT_CARD,tp,code)
Duel.Hint(HINT_CARD,1-tp,code)
e:UseCountLimit(tp,1,true)
c:CreateEffectRelation(e)
if cos then cos(e,p,eg,ep,ev,re,r,rp,1) end
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if g and #g~=0 then
local tg=g:GetFirst()
while tg do
tg:CreateEffectRelation(e)
tg=g:GetNext()
end
end
if op then op(e,tp,eg,ep,ev,re,r,rp) end
c:ReleaseEffectRelation(e)
if g then
tg=g:GetFirst()
while tg do
tg:ReleaseEffectRelation(e)
tg=g:GetNext()
end
end
end
end
--血源猎手 碎裂的大洋涡流
local cm,m,o=GetID()
function cm.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.rcon)
e1:SetOperation(cm.rop)
c:RegisterEffect(e1)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.otg)
e3:SetOperation(cm.oop)
c:RegisterEffect(e3)
end
cm.toss_dice=true
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_HAND) and e:GetHandler():IsAbleToRemove()
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.Remove(c,POS_FACEUP,REASON_EFFECT)~=0 and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)<=1 then
Duel.Draw(e:GetHandlerPlayer(),1,REASON_EFFECT)
end
end
function cm.otg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_DECK,0)>0 end
end
function cm.oop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local x=Duel.TossDice(tp,1)
Duel.Draw(tp,x,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local hg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil):Select(tp,x,x,nil)
Duel.SendtoDeck(hg,tp,0,REASON_EFFECT)
local hg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil)
local fst=false
local scd=false
local trd=false
if #Group.Filter(hg,Card.IsType,nil,TYPE_MONSTER)==1 and #Group.Filter(hg,Card.IsType,nil,TYPE_SPELL)==1 and #Group.Filter(hg,Card.IsType,nil,TYPE_TRAP)==1 then fst=true end
if not hg:IsExists(Card.IsType,1,nil,TYPE_SPELL+TYPE_TRAP) then scd=true end
if not hg:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then trd=true end
if fst==true then
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_DECK,0,nil):Select(tp,x,x,nil)
local tc=dg:GetFirst()
while tc do
Duel.MoveSequence(tc,SEQ_DECKTOP)
tc=dg:GetNext()
end
Duel.SortDecktop(tp,tp,x)
end
if scd==true then
Duel.ConfirmDecktop(tp,x)
local hhg=Duel.GetDecktopGroup(tp,x)
local yy=hhg:Filter(Card.IsType,nil,TYPE_MONSTER):GetCount()
Duel.RegisterFlagEffect(e:GetHandler(),m,RESET_PHASE+PHASE_END,0,yy)
--negate
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAINING)
e3:SetOperation(cm.negop1)
e3:SetReset(RESET_PHASE+PHASE_END,1)
Duel.RegisterEffect(e3,tp)
end
if trd==true then
Duel.ConfirmDecktop(tp,x)
local hhg=Duel.GetDecktopGroup(tp,x)
local yy=hhg:Filter(Card.IsType,nil,TYPE_SPELL):GetCount()+hhg:Filter(Card.IsType,nil,TYPE_TRAP):GetCount()
Duel.RegisterFlagEffect(e:GetHandler(),m+20000000,RESET_PHASE+PHASE_END,0,yy)
--negate
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAINING)
e3:SetOperation(cm.negop2)
e3:SetReset(RESET_PHASE+PHASE_END,1)
Duel.RegisterEffect(e3,tp)
end
end
function cm.negop1(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:GetControler()~=tp and rc:IsType(TYPE_MONSTER) and Duel.SelectEffectYesNo(tp,e:GetHandler()) then
Duel.NegateEffect(ev)
Duel.RegisterFlagEffect(e:GetHandler(),m+10000000,RESET_PHASE+PHASE_END,0,1)
if Duel.GetFlagEffect(e:GetHandler(),m)==Duel.GetFlagEffect(e:GetHandler(),m+10000000) then
e:Reset()
end
end
end
function cm.negop2(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:GetControler()~=tp and (rc:IsType(TYPE_SPELL) or rc:IsType(TYPE_TRAP)) and Duel.SelectEffectYesNo(tp,e:GetHandler()) then
Duel.NegateEffect(ev)
Duel.RegisterFlagEffect(e:GetHandler(),m+30000000,RESET_PHASE+PHASE_END,0,1)
if Duel.GetFlagEffect(e:GetHandler(),m+20000000)==Duel.GetFlagEffect(e:GetHandler(),m+30000000) then
e:Reset()
end
end
end
\ No newline at end of file
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