Skip to content
This repository was archived by the owner on Jun 22, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 41 additions & 41 deletions script/c511000466.lua
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
--Cursebreaker
function c511000466.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetTarget(c511000466.target)
e1:SetOperation(c511000466.activate)
c:RegisterEffect(e1)
end
function c511000466.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL) and c:IsDestructable()
end
function c511000466.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c511000466.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c511000466.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c511000466.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c511000466.filter,tp,0,LOCATION_ONFIELD,nil)
local tc=g:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
Duel.BreakEffect()
Duel.Destroy(g,REASON_EFFECT)
end
--Cursebreaker
function c511000466.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c511000466.target)
e1:SetOperation(c511000466.activate)
c:RegisterEffect(e1)
end
function c511000466.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL)
end
function c511000466.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c511000466.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c511000466.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c511000466.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c511000466.filter,tp,0,LOCATION_ONFIELD,nil)
local tc=g:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
Duel.BreakEffect()
Duel.Destroy(g,REASON_EFFECT)
end
188 changes: 89 additions & 99 deletions script/c511004000.lua
Original file line number Diff line number Diff line change
@@ -1,99 +1,89 @@
--Destiny Draw
--Scripted by Edo9300
function c511004000.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PREDRAW)
e1:SetCountLimit(1)
e1:SetRange(0xff)
e1:SetCondition(c511004000.con)
e1:SetOperation(c511004000.op)
c:RegisterEffect(e1)
--Destiny Draw
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PREDRAW)
e2:SetRange(LOCATION_REMOVED)
e2:SetCountLimit(1,511004000+EFFECT_COUNT_CODE_DUEL)
e2:SetCondition(c511004000.drcon)
e2:SetTarget(c511004000.drtg)
e2:SetOperation(c511004000.drop)
c:RegisterEffect(e2)
--protection
local e3=Effect.CreateEffect(c)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_TO_GRAVE)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_TO_HAND)
c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_TO_DECK)
c:RegisterEffect(e5)
local e6=e3:Clone()
e6:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
c:RegisterEffect(e6)
end
function c511004000.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==1
end
function c511004000.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_REMOVED,0,1,nil,511004000) then
Duel.DisableShuffleCheck()
Duel.SendtoDeck(c,nil,-2,REASON_RULE)
else
Duel.Remove(c,POS_FACEUP,REASON_RULE)
end
if e:GetHandler():GetPreviousLocation()==LOCATION_HAND then
Duel.Draw(tp,1,REASON_RULE)
end
end
function c511004000.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=Duel.GetLP(1-tp)/2 and Duel.GetFieldGroupCount(e:GetHandler():GetControler(),LOCATION_MZONE,0)==0
and Duel.GetFieldGroupCount(e:GetHandler():GetControler(),0,LOCATION_MZONE)>0
end
function c511004000.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetTurnPlayer()~=tp then return end
if chk==0 then return true end
local dt=Duel.GetDrawCount(tp)
if dt~=0 then
_replace_count=0
_replace_max=dt
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW)
e1:SetValue(0)
Duel.RegisterEffect(e1,tp)
end
end
function c511004000.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
_replace_count=_replace_count+1
if _replace_count>_replace_max or not c:IsRelateToEffect(e) then return end
local g1=Duel.GetMatchingGroup(nil,tp,LOCATION_DECK,0,nil)
if g1:GetCount()>5 then
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_DECK,0,5,5,nil)
while g:GetCount()>0 do
local sg=g:RandomSelect(tp,1):GetFirst()
Duel.MoveSequence(sg,0)
g:RemoveCard(sg)
end
Duel.Draw(tp,1,REASON_RULE)
Duel.ShuffleDeck(tp)
else
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.MoveSequence(g:GetFirst(),0)
Duel.Draw(tp,1,REASON_RULE)
Duel.ShuffleDeck(tp)
end
end
end
--Destiny Draw
--Scripted by Edo9300
--fixed by MLD
function c511004000.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PREDRAW)
e1:SetCountLimit(1)
e1:SetRange(0xff)
e1:SetOperation(c511004000.op)
c:RegisterEffect(e1)
--Destiny Draw
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PREDRAW)
e2:SetRange(LOCATION_REMOVED)
e2:SetCondition(c511004000.drcon)
e2:SetOperation(c511004000.drop)
c:RegisterEffect(e2)
--protection
local e3=Effect.CreateEffect(c)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetRange(LOCATION_REMOVED)
e3:SetCode(EFFECT_CANNOT_TO_GRAVE)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_TO_HAND)
c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_TO_DECK)
c:RegisterEffect(e5)
local e6=e3:Clone()
e6:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
c:RegisterEffect(e6)
local e7=e3:Clone()
e7:SetCode(EFFECT_IMMUNE_EFFECT)
c:RegisterEffect(e7)
if not c511004000.global_check then
c511004000.global_check=true
c511004000[0]=nil
c511004000[1]=nil
end
end
function c511004000.cfilter(c,code)
return c:GetOriginalCode()==code
end
function c511004000.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_REMOVED,0,1,e:GetHandler(),511004000) then
Duel.DisableShuffleCheck()
Duel.SendtoDeck(c,nil,-2,REASON_RULE)
else
Duel.Remove(c,POS_FACEUP,REASON_RULE)
end
if e:GetHandler():GetPreviousLocation()==LOCATION_HAND then
Duel.Draw(tp,1,REASON_RULE)
end
local g=Duel.GetFieldGroup(tp,LOCATION_DECK+LOCATION_HAND,0)
g:Remove(c511004000.cfilter,nil,511004000)
if c511004000[tp]==nil then
c511004000[tp]=Group.CreateGroup()
c511004000[tp]:KeepAlive()
local i=0
while i<5 and g:GetCount()>0 and Duel.SelectYesNo(tp,529) do
local tc=g:Select(tp,1,1,nil):GetFirst()
local sg=g:Filter(c511004000.cfilter,nil,tc:GetOriginalCode())
c511004000[tp]:Merge(sg)
g:Sub(sg)
i=i+1
end
end
end
function c511004000.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=Duel.GetLP(1-tp)/2 and Duel.GetFieldGroupCount(e:GetHandler():GetControler(),LOCATION_MZONE,0)==0
and Duel.GetFieldGroupCount(e:GetHandler():GetControler(),0,LOCATION_MZONE)>0
end
function c511004000.drop(e,tp,eg,ep,ev,re,r,rp)
local g=c511004000[tp]:Filter(Card.IsLocation,nil,LOCATION_DECK)
if g:GetCount()>0 and Duel.GetFlagEffect(tp,511004000)==0 and Duel.SelectYesNo(tp,65) then
Duel.RegisterFlagEffect(tp,511004000,nil,0,1)
Duel.Hint(HINT_CARD,0,511004000)
local tc=g:RandomSelect(tp,1):GetFirst()
Duel.MoveSequence(tc,0)
end
end
23 changes: 6 additions & 17 deletions script/c511009406.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@ function c511009406.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c511009406.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() and Duel.GetActivityCount(tp,ACTIVITY_SUMMON)==0 end
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() and Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)==0 end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e2,tp)
end
function c511009406.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x10f3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
Expand All @@ -37,7 +40,7 @@ function c511009406.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingTarget(c511009406.filter,tp,LOCATION_GRAVE,0,2,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c511009406.filter,tp,LOCATION_GRAVE,0,2,2,e:GetHandler(),e,tp)
local g=Duel.SelectTarget(tp,c511009406.filter,tp,LOCATION_GRAVE,0,2,2,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function c511009406.spop(e,tp,eg,ep,ev,re,r,rp)
Expand All @@ -48,18 +51,4 @@ function c511009406.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
if g:GetCount()>ft then g=g:Select(tp,ft,ft,nil) end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c511009406.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
end
function c511009406.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsType(TYPE_FUSION)
end