Commit ac431ad0 authored by root's avatar root

Refresh on 2025-07-06 16:41:07

parent f2b0fbeb
--转瞬即逝的噩梦 --转瞬即逝的噩梦
local s,id,o=GetID() local s,id,o=GetID()
o=1e9
function s.initial_effect(c) function s.initial_effect(c)
--activate --activate
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
...@@ -72,15 +73,17 @@ end ...@@ -72,15 +73,17 @@ end
function s.desop(e,tp,eg,ep,ev,re,r,rp) function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
Duel.Destroy(tc,REASON_EFFECT) if Duel.Destroy(tc,REASON_EFFECT)>0 and tc:IsType(TYPE_PENDULUM) then
e:GetHandler():RegisterFlagEffect(id+o,RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end end
function s.sdcon(e,tp,eg,ep,ev,re,r,rp) function s.sdcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,22200403) return e:GetHandler():GetFlagEffect(id+o)>0 and not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,22200403)
end end
function s.sdop(e,tp,eg,ep,ev,re,r,rp) function s.sdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.Damage(tp,3000,REASON_EFFECT)>0 then if Duel.Damage(tp,3000,REASON_EFFECT)>0 then
Duel.Destroy(c,REASON_EFFECT) Duel.Destroy(c,REASON_EFFECT)
end end
end end
\ No newline at end of file
...@@ -21,9 +21,7 @@ function s.cfilter(c,id) ...@@ -21,9 +21,7 @@ function s.cfilter(c,id)
return c:IsFaceup() and c:IsCode(id) return c:IsFaceup() and c:IsCode(id)
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLocationCount(tp,LOCATION_SZONE)>=3 and ( return Duel.GetLocationCount(tp,LOCATION_SZONE)>=3
Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil,53375573)
or Duel.IsExistingMatchingCard(s.cfilter,tp,0,LOCATION_ONFIELD,1,nil,53982768))
end end
function s.filter(c,tp,code) function s.filter(c,tp,code)
return c:IsCode(code) and c:GetActivateEffect():IsActivatable(tp,true,true) return c:IsCode(code) and c:GetActivateEffect():IsActivatable(tp,true,true)
...@@ -35,6 +33,8 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -35,6 +33,8 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
end end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local skip=Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil,53375573)
or Duel.IsExistingMatchingCard(s.cfilter,tp,0,LOCATION_ONFIELD,1,nil,53982768)
for _, tid in ipairs({82732705,73599290,68937720}) do for _, tid in ipairs({82732705,73599290,68937720}) do
local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,tp,tid):GetFirst() local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,tp,tid):GetFirst()
if tc then if tc then
...@@ -42,8 +42,10 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,8 +42,10 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
local te=tc:GetActivateEffect() local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true) te:UseCountLimit(tp,1,true)
local tep=tc:GetControler() local tep=tc:GetControler()
local cost=te:GetCost() if not skip then
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
end
Duel.RaiseEvent(tc,tid,te,0,tp,tp,Duel.GetCurrentChain()) Duel.RaiseEvent(tc,tid,te,0,tp,tp,Duel.GetCurrentChain())
else else
return return
......
--神之预告 --神之预告
local s,id=GetID() local s,id=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--Activate(summon) --Activate(summon)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY) e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON) e1:SetCode(EVENT_SPSUMMON)
e1:SetCost(s.cost1) e1:SetCondition(s.con1)
e1:SetTarget(s.target1) e1:SetCost(s.cost1)
e1:SetOperation(s.activate1) e1:SetTarget(s.target1)
c:RegisterEffect(e1) e1:SetOperation(s.activate1)
--act in hand c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) --act in hand
e2:SetType(EFFECT_TYPE_SINGLE) local e2=Effect.CreateEffect(c)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCondition(s.handcon) e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
c:RegisterEffect(e2) e2:SetCondition(s.handcon)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter) c:RegisterEffect(e2)
end Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk) end
if chk==0 then return true end function s.con1(e,tp,eg,ep,ev,re,r,rp)
local lp=math.floor(Duel.GetLP(tp)/2) return ep~=tp
Duel.PayLPCost(tp,lp) end
e:SetLabel(lp) function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
end if chk==0 then return true end
function s.target1(e,tp,eg,ep,ev,re,r,rp,chk) local lp=math.floor(Duel.GetLP(tp)/2)
if chk==0 then return true end Duel.PayLPCost(tp,lp)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,2,0,0) e:SetLabel(lp)
end end
function s.activate1(e,tp,eg,ep,ev,re,r,rp) function s.target1(e,tp,eg,ep,ev,re,r,rp,chk)
local c1=Duel.AnnounceCard(tp) if chk==0 then return true end
local c2=Duel.AnnounceCard(1-tp) Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,2,0,0)
if c1~=c2 then end
local e1=Effect.CreateEffect(e:GetHandler()) function s.activate1(e,tp,eg,ep,ev,re,r,rp)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY) local c1=Duel.AnnounceCard(tp)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) local c2=Duel.AnnounceCard(1-tp)
e1:SetCode(EVENT_SPSUMMON) if c1~=c2 then
e1:SetCondition(s.ngcon) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetOperation(s.ngop) e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetLabel(c1) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetLabelObject(e) e1:SetCode(EVENT_SPSUMMON)
Duel.RegisterEffect(e1,tp) e1:SetCondition(s.ngcon)
end e1:SetOperation(s.ngop)
end e1:SetLabel(c1)
function s.ngcon(e,tp,eg,ep,ev,re,r,rp) e1:SetLabelObject(e)
return aux.NegateSummonCondition(e,tp,eg,ep,ev,re,r,rp) and eg:IsExists(Card.IsCode,1,nil,e:GetLabel()) Duel.RegisterEffect(e1,tp)
end end
function s.ngop(e,tp,eg,ep,ev,re,r,rp) end
Duel.NegateSummon(eg) function s.ngcon(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(eg,REASON_EFFECT) return aux.NegateSummonCondition(e,tp,eg,ep,ev,re,r,rp) and eg:IsExists(Card.IsCode,1,nil,e:GetLabel())
Duel.Remove(Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_EXTRA,nil,e:GetLabel()),POS_FACEDOWN,REASON_EFFECT) end
Duel.Recover(tp,e:GetLabelObject():GetLabel(),REASON_EFFECT) function s.ngop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject():GetHandler() Duel.NegateSummon(eg)
if c:IsLocation(LOCATION_GRAVE) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then Duel.Destroy(eg,REASON_EFFECT)
Duel.BreakEffect() Duel.Remove(Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_EXTRA,nil,e:GetLabel()),POS_FACEDOWN,REASON_EFFECT)
Duel.SendtoHand(c,nil,REASON_EFFECT) Duel.Recover(tp,e:GetLabelObject():GetLabel(),REASON_EFFECT)
end local c=e:GetLabelObject():GetHandler()
end if c:IsLocation(LOCATION_GRAVE) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
function s.handcon(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(c,nil,REASON_EFFECT)
return Duel.GetCustomActivityCount(id,e:GetHandlerPlayer(),ACTIVITY_CHAIN)==0 --and ep~=tp end
end end
function s.chainfilter(re,tp,cid)
local rc=re:GetHandler() function s.handcon(e,tp,eg,ep,ev,re,r,rp)
if rc==nil then return true end return Duel.GetCustomActivityCount(id,e:GetHandlerPlayer(),ACTIVITY_CHAIN)==0 --and ep~=tp
return not rc:IsType(TYPE_MONSTER+TYPE_SPELL) end
end function s.chainfilter(re,tp,cid)
local rc=re:GetHandler()
if rc==nil then return true end
return not rc:IsType(TYPE_MONSTER+TYPE_SPELL)
end
--看到这张卡在卡池里应该反省的是你不是我 --看到这张卡在卡池里应该反省的是你不是我
local s,id=GetID() local s,id=GetID()
s.enabled={0,0} s.enabled={0,0}
function s.initial_effect(c) function s.initial_effect(c)
--reflect --reflect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetCondition(s.reflectcon) e1:SetCondition(s.reflectcon)
e1:SetOperation(s.reflectop) e1:SetOperation(s.reflectop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--remove --remove
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DESTROY) e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_REMOVE) e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_SET_AVAILABLE) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCondition(s.rmcon) e2:SetCondition(s.rmcon)
e2:SetTarget(s.rmtg) e2:SetTarget(s.rmtg)
e2:SetOperation(s.rmop) e2:SetOperation(s.rmop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--draw --draw
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,3)) e4:SetDescription(aux.Stringid(id,3))
e4:SetCategory(CATEGORY_DRAW) e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_TO_GRAVE) e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_DELAY) e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_DELAY)
e4:SetCondition(s.drawcon) e4:SetCondition(s.drawcon)
e4:SetTarget(s.drawtg) e4:SetTarget(s.drawtg)
e4:SetOperation(s.drawop) e4:SetOperation(s.drawop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e4p=e4:Clone() local e4p=e4:Clone()
e4p:SetCode(EVENT_TO_DECK) e4p:SetCode(EVENT_TO_DECK)
c:RegisterEffect(e4p) c:RegisterEffect(e4p)
local e4q=e4:Clone() local e4q=e4:Clone()
e4q:SetCode(EVENT_REMOVE) e4q:SetCode(EVENT_REMOVE)
c:RegisterEffect(e4q) c:RegisterEffect(e4q)
--Choose --Choose
if not s.global_check then if not s.global_check then
local ge=Effect.CreateEffect(c) local ge=Effect.CreateEffect(c)
ge:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge:SetCode(EVENT_PREDRAW) ge:SetCode(EVENT_PREDRAW)
ge:SetReset(RESET_PHASE+PHASE_END) ge:SetReset(RESET_PHASE+PHASE_END)
ge:SetOperation(s.selectop) ge:SetOperation(s.selectop)
Duel.RegisterEffect(ge,0) Duel.RegisterEffect(ge,0)
s.global_check=true s.global_check=true
end end
end end
function s.reflectcon(e,tp,eg,ep,ev,re,r,rp) function s.reflectcon(e,tp,eg,ep,ev,re,r,rp)
if s.enabled[tp]&1==0 then return false end if s.enabled[tp]&1==0 then return false end
if re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end if re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_DAMAGE) local ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_DAMAGE)
if ex and (cp==tp or cp==PLAYER_ALL) then return true end if ex and (cp==tp or cp==PLAYER_ALL) then return true end
ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_RECOVER) ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_RECOVER)
return ex and (cp==tp or cp==PLAYER_ALL) and Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_RECOVER) return ex and (cp==tp or cp==PLAYER_ALL) and Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_RECOVER)
end end
function s.reflectop(e,tp,eg,ep,ev,re,r,rp) function s.reflectop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(id,5)) then if Duel.SelectYesNo(tp,aux.Stringid(id,5)) then
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD) Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
else else
return return
end end
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID) local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_REFLECT_DAMAGE) e1:SetCode(EFFECT_REFLECT_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetLabel(cid) e1:SetLabel(cid)
e1:SetValue(s.refcon) e1:SetValue(s.refcon)
e1:SetReset(RESET_CHAIN) e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_DAMAGE) e2:SetCode(EFFECT_CHANGE_DAMAGE)
e2:SetTargetRange(0,1) e2:SetTargetRange(0,1)
e2:SetValue(s.damval) e2:SetValue(s.damval)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
end end
function s.refcon(e,re,val,r,rp,rc) function s.refcon(e,re,val,r,rp,rc)
local cc=Duel.GetCurrentChain() local cc=Duel.GetCurrentChain()
if cc==0 or bit.band(r,REASON_EFFECT)==0 then return end if cc==0 or bit.band(r,REASON_EFFECT)==0 then return end
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID) local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
return cid==e:GetLabel() return cid==e:GetLabel()
end end
function s.damval(e,re,val,r,rp,rc) function s.damval(e,re,val,r,rp,rc)
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID) local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if cid~=e:GetLabel() then return val end if cid~=e:GetLabel() then return val end
local v=val*math.max(0,13-Duel.GetTurnCount()*3) local v=val*math.max(0,13-Duel.GetTurnCount()*3)
return v return v
end end
function s.rmcon(e,tp,eg,ep,ev,re,r,rp) function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
--print("rmcon",s.enabled[tp],rp,r) --print("rmcon",s.enabled[tp],rp,r)
return s.enabled[tp]&2>0 and rp~=tp and r&REASON_EFFECT>0 return s.enabled[tp]&2>0 and rp~=tp and r&REASON_EFFECT>0
end end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local ct=Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_REMOVED,0,nil) local ct=Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_REMOVED,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,ct,1-tp,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,ct,1-tp,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,ct*3,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,ct*3,0,0)
end end
function s.rmop(e,tp,eg,ep,ev,re,r,rp) function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_REMOVED,0,nil) local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_REMOVED,0,nil)
if #g==0 then return end if #g==0 then return end
Duel.SendtoDeck(g,tp,SEQ_DECKSHUFFLE,REASON_EFFECT) Duel.SendtoDeck(g,tp,SEQ_DECKSHUFFLE,REASON_EFFECT)
local tg=Duel.GetDecktopGroup(tp,#g*3) local tg=Duel.GetDecktopGroup(tp,#g*3)
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT) Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
local fc=Duel.GetFieldCard(1-tp,LOCATION_FZONE,0) local fc=Duel.GetFieldCard(1-tp,LOCATION_FZONE,0)
if fc~=nil and Duel.SelectYesNo(tp,aux.Stringid(id,5)) then if fc~=nil and Duel.SelectYesNo(tp,aux.Stringid(id,5)) then
Duel.Remove(fc,POS_FACEUP,REASON_EFFECT) Duel.Remove(fc,POS_FACEUP,REASON_EFFECT)
end end
end end
function s.drawcon(e,tp,eg,ep,ev,re,r,rp) function s.drawcon(e,tp,eg,ep,ev,re,r,rp)
return s.enabled[tp]&8>0 and rp~=tp and e:GetHandler():IsPreviousLocation(LOCATION_HAND) and r&REASON_EFFECT>0 return s.enabled[tp]&8>0 and rp~=tp and e:GetHandler():IsPreviousLocation(LOCATION_HAND) and r&REASON_EFFECT>0
end end
function s.drawtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.drawtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=5-Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) local ct=5-Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct) Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end end
function s.drawop(e,tp,eg,ep,ev,re,r,rp) function s.drawop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER) local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=5-Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) local ct=5-Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if ct==0 then return end if ct==0 then return end
if Duel.Draw(p,ct,REASON_EFFECT)>0 then if Duel.Draw(p,ct,REASON_EFFECT)>0 then
Duel.SkipPhase(1-tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1) Duel.SkipPhase(1-tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1) Duel.SkipPhase(1-tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1) Duel.SkipPhase(1-tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1) Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(1-tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1) Duel.SkipPhase(1-tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP) e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(0,1) e1:SetTargetRange(0,1)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
end end
function s.selectop(e,tp) function s.selectop(e,tp)
e:Reset() e:Reset()
for tp=0,1 do for tp=0,1 do
if Duel.IsExistingMatchingCard(Card.IsCode,tp,~0,0,1,nil,id) then if Duel.IsExistingMatchingCard(Card.IsCode,tp,~0,0,1,nil,id) then
Duel.Hint(HINT_CARD,0,id) Duel.Hint(HINT_CARD,0,id)
local option1=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2),aux.Stringid(id,3)) local option1=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2),aux.Stringid(id,3))
local option2=aux.SelectFromOptions(tp,{option1~=0,aux.Stringid(id,0),0},{option1~=1,aux.Stringid(id,1),1},{option1~=2,aux.Stringid(id,2),2},{option1~=3,aux.Stringid(id,3),3}) local option2=aux.SelectFromOptions(tp,{option1~=0,aux.Stringid(id,0),0},{option1~=1,aux.Stringid(id,1),1},{option1~=2,aux.Stringid(id,2),2},{option1~=3,aux.Stringid(id,3),3})
s.enabled[tp]=(1<<option1)+(1<<option2) s.enabled[tp]=(1<<option1)+(1<<option2)
--print("Enabled options: " .. s.enabled[tp]) --print("Enabled options: " .. s.enabled[tp])
if Duel.SelectYesNo(tp,aux.Stringid(id,4)) then if Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
local c=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK,0,nil,id):GetFirst() local c=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK,0,nil,id):GetFirst()
if c then if c then
local h=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil):RandomSelect(tp,1):GetFirst() local h=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil):RandomSelect(tp,1):GetFirst()
Duel.SendtoDeck(h,tp,SEQ_DECKSHUFFLE,REASON_RULE) Duel.SendtoDeck(h,tp,SEQ_DECKSHUFFLE,REASON_RULE)
Duel.SendtoHand(c,nil,REASON_RULE) Duel.SendtoHand(c,nil,REASON_RULE)
end end
end end
end end
end 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