Commit 161e6788 authored by Nemo Ma's avatar Nemo Ma

upd

parent 6c04aaf0
No preview for this file type
......@@ -94,16 +94,22 @@ function cm.sprcon(e,c)
local tc=g:GetFirst()
while tc do
mg:Merge(tc:GetOverlayGroup())
tc:GetNext()
tc=g:GetNext()
end
return g:CheckSubGroup(cm.fselect,3,3,tp,c)
return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and mg:CheckSubGroup(cm.fselect,3,3,tp,c)
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_MZONE,LOCATION_MZONE,0,nil)
local mg=Group.CreateGroup()
local tc=g:GetFirst()
while tc do
mg:Merge(tc:GetOverlayGroup())
tc=g:GetNext()
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
local mg=g:SelectSubGroup(tp,cm.fselect,false,3,3,tp,c)
c:SetMaterial(mg)
Duel.SendtoGrave(mg,REASON_MATERIAL)
local sg=mg:SelectSubGroup(tp,cm.fselect,false,3,3,tp,c)
c:SetMaterial(sg)
Duel.SendtoGrave(sg,REASON_COST+REASON_MATERIAL)
end
function cm.atop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
......
......@@ -62,8 +62,8 @@ function cm.damop1(e,tp,eg,ep,ev,re,r,rp)
if seq==3 then flag=flag|(aux.SequenceToGlobal(p,LOCATION_MZONE,6)) end
end
else
if seq==5 then flag=flag|(aux.SequenceToGlobal(p,LOCATION_MZONE,1))
if seq==6 then flag=flag|(aux.SequenceToGlobal(p,LOCATION_MZONE,3))
if seq==5 then flag=flag|(aux.SequenceToGlobal(p,LOCATION_MZONE,1)) end
if seq==6 then flag=flag|(aux.SequenceToGlobal(p,LOCATION_MZONE,3)) end
else toGrave=true
end
elseif tc:IsLocation(LOCATION_SZONE) then
......
......@@ -15,15 +15,14 @@ function cm.initial_effect(c)
local e12=e1:Clone()
e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetRange(LOCATION_HAND)
e12:SetCode(EVENT_FREE_CHAIN)
e12:SetLabel(2)
e12:SetCost(cm.cost)
c:RegisterEffect(e12)
local e13=e1:Clone()
e13:SetType(EFFECT_TYPE_QUICK_O)
e13:SetRange(LOCATION_GRAVE)
e13:SetType(EFFECT_TYPE_ACTIVATE+EFFECT_TYPE_QUICK_O)
e13:SetCost(cm.cost)
e13:SetLabel(3)
e13:SetCost(cm.cost)
c:RegisterEffect(e13)
--disable
local e2=Effect.CreateEffect(c)
......@@ -33,6 +32,15 @@ function cm.initial_effect(c)
e2:SetTarget(cm.disable)
e2:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e2)
--act limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetValue(aux.TRUE)
c:RegisterEffect(e3)
--maintain
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -42,62 +50,63 @@ function cm.initial_effect(c)
e4:SetCountLimit(1)
e4:SetOperation(cm.mtop)
c:RegisterEffect(e4)
--leave
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_LEAVE_FIELD_P)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetOperation(cm.regop)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_LEAVE_FIELD)
e6:SetCondition(cm.leacon)
e6:SetOperation(cm.leaop)
e6:SetLabelObject(e5)
c:RegisterEffect(e6)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
if chk==0 then return c:IsLocation(LOCATION_HAND+LOCATION_GRAVE)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
c:CreateEffectRelation(e)
end
function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsCanRemoveCounter(tp,0x1442,1,REASON_COST) then
e:GetHandler():RemoveCounter(tp,1,1,REASON_COST)
e:GetHandler():RemoveCounter(tp,0x1442,1,REASON_COST)
else
Duel.Destroy(e:GetHandler(),REASON_COST)
if Duel.GetTurnPlayer()==1-tp then
local disg=Duel.GetMatchingGroup(cm.disfilter,1-tp,LOCATION_HAND,0,c)
local b1=( true )
local b2=( Duel.IsExistingMatchingCard(Card.IsAbleToRemove,1-tp,LOCATION_DECK,0,31,nil,1-tp,POS_FACEDOWN,REASON_COST) )
local b3=( disg:GetClassCount(Card.GetCode)>3 )
local op1=0
if b1 and b2 and b3 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
elseif b1 and b2 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif b1 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1))
elseif b2 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,2))+1
else return end
if op1==0 or op2==0 or op3==0 then cm.selop1(e,1-tp,eg,ep,ev,re,r,rp) end
if op1==1 or op2==1 or op3==1 then cm.selop2(e,1-tp,eg,ep,ev,re,r,rp) end
if op1==2 or op2==2 or op3==2 then cm.selop3(e,1-tp,eg,ep,ev,re,r,rp) end
end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
end
function cm.disable(e,c)
return c~=e:GetHandler() and c:IsFaceup()
return c~=e:GetHandler() and c:IsFaceup()
end
function cm.disfilter(c)
return c:IsAbleToGrave()
return c:IsDiscardable()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local disg=Duel.GetMatchingGroup(cm.disfilter,tp,LOCATION_HAND,0,c)
local c=e:GetHandler()
local el=e:GetLabel()
local b1=( true )
local b2=( Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,31,nil,tp,POS_FACEDOWN,REASON_COST) )
local b2=( Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,31,nil,tp,POS_FACEDOWN,REASON_EFFECT) )
local b3=( disg:GetClassCount(Card.GetCode)>3 )
if chk==0 then
if el==1 then
return b1 or b2 or b3
if el==1 then
return true
elseif el==2 then
return ( b1 and b2 ) or ( b2 and b3 ) or ( b1 and b3 )
return b2 or b3
elseif el==3 then
return b1 and b2 and b3
return b2 and b3
end
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local el=e:GetLabel()
local disg=Duel.GetMatchingGroup(cm.disfilter,tp,LOCATION_HAND,0,c)
local c=e:GetHandler()
local el=e:GetLabel()
local b1=( true )
local b2=( Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,31,nil,tp,POS_FACEDOWN,REASON_COST) )
......@@ -107,48 +116,69 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp,chk)
local op3=-1
local tt={aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3)}
if el==1 then
if b1 and b2 and b3 then op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
elseif b1 and b2 then op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif b1 then op1=Duel.SelectOption(tp,aux.Stringid(m,1))
elseif b2 then op1=Duel.SelectOption(tp,aux.Stringid(m,2))+1
else return end
if b2 and b3 then op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
elseif b2 then op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif b3 then op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,3))*2
else op1=0 end
end
if el==2 then
if b1 and b2 and b3 then
if b2 and b3 then
op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
table.remove(tt,op1+1)
op2=Duel.SelectOption(tp,table.unpack(tt))
if op1==0 then op2=op1+1 end
if op1==1 and op2==0 then op2=1 end
elseif b1 then op1=0
if b2 then op2=1
elseif b3 then op2=2
end
elseif b2 and b3 then op1=1 op2=2
end
if op1==0 then op2=op2+1 end
if op1==1 and op2==1 then op2=2 end
elseif b2 then op1=0 op2=1
elseif b3 then op1=0 op2=2
else return end
end
if el==3 and b1 and b2 and b3 then op1=0 op2=1 op3=2 end
if op1==0 or op2==0 or op3==0 then cm.selop1(e,tp,eg,ep,ev,re,r,rp) end
if op1==1 or op2==1 or op3==1 then cm.selop2(e,tp,eg,ep,ev,re,r,rp) end
if op1==2 or op2==2 or op3==2 then cm.selop3(e,tp,eg,ep,ev,re,r,rp) end
local ct=-1
if (op1==0 or op2==0 or op3==0) and cm.selop1(e,tp,eg,ep,ev,re,r,rp) then ct=ct+1 end
if (op1==1 or op2==1 or op3==1) and cm.selop2(e,tp,eg,ep,ev,re,r,rp) then ct=ct+1 end
if (op1==2 or op2==2 or op3==2) and cm.selop3(e,tp,eg,ep,ev,re,r,rp) then ct=ct+1 end
if ct>0 then c:AddCounter(0x1442,ct) end
end
function cm.selop3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local disg=Duel.GetMatchingGroup(cm.disfilter,tp,LOCATION_HAND,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g1=disg:SelectSubGroup(tp,aux.dncheck,true,4,4)
local g1=disg:SelectSubGroup(tp,aux.dncheck,false,4,4)
Duel.ConfirmCards(1-tp,g1)
Duel.SendtoGrave(g1,REASON_EFFECT)
c:AddCounter(0x1442,1)
return Duel.SendtoGrave(g1,REASON_EFFECT+REASON_DISCARD)~=0
end
function cm.selop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Damage(tp,4200,REASON_EFFECT)
c:AddCounter(0x1442,1)
return Duel.Damage(tp,4200,REASON_EFFECT)~=0
end
function cm.selop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rm=Duel.GetDecktopGroup(tp,31)
Duel.Remove(rm,POS_FACEDOWN,REASON_EFFECT)
c:AddCounter(0x1442,1)
end
\ No newline at end of file
return Duel.Remove(rm,POS_FACEDOWN,REASON_EFFECT)~=0
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetCounter(0x1442)>0 then
e:SetLabel(1)
else
e:SetLabel(0)
end
end
function cm.leacon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetTurnPlayer()~=tp and e:GetLabelObject():GetLabel()==1
end
function cm.leaop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local disg=Duel.GetMatchingGroup(cm.disfilter,1-tp,LOCATION_HAND,0,c)
local b1=( true )
local b2=( Duel.IsExistingMatchingCard(Card.IsAbleToRemove,1-tp,LOCATION_DECK,0,31,nil,1-tp,POS_FACEDOWN,REASON_EFFECT) )
local b3=( disg:GetClassCount(Card.GetCode)>3 )
local op1=-1
if b2 and b3 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
elseif b2 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif b3 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1),aux.Stringid(m,3))*2
else op1=0 end
if op1==0 then cm.selop1(e,1-tp,eg,ep,ev,re,r,rp) end
if op1==1 then cm.selop2(e,1-tp,eg,ep,ev,re,r,rp) end
if op1==2 then cm.selop3(e,1-tp,eg,ep,ev,re,r,rp) end
end
--未来崩崩崩
local m=33711501
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetTarget(cm.target)
e2:SetCost(cm.cost)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
--Recover
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetTarget(cm.condition)
e3:SetOperation(cm.operation2)
c:RegisterEffect(e3)
--SpecialSummon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetTarget(cm.condition)
e4:SetOperation(cm.spop)
c:RegisterEffect(e4)
end
function cm.filter(c)
return c:IsAbleToRemove()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
for tc in aux.Next(og) do
if tc:IsLocation(LOCATION_REMOVED) then
tc:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000,0,0)
end
end
end
end
function cm.get(c)
return c:GetFlagEffect(m)>0
end
function cm.condition(e)
return Duel.GetMatchingGroupCount(cm.get,e:GetHandlerPlayer(),LOCATION_REMOVED,LOCATION_REMOVED,nil)>0
end
function cm.get1(c,e,tp)
return c:GetFlagEffect(m)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local num=Duel.GetMatchingGroupCount(cm.get,e:GetHandlerPlayer(),LOCATION_REMOVED,LOCATION_REMOVED,nil)
if num>0 and Duel.SelectYesNo(e:GetHandlerPlayer(),aux.Stringid(m,1)) then
Duel.Destroy(c,REASON_EFFECT)
Duel.Recover(tp,num*1500,REASON_EFFECT)
end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=Duel.GetMatchingGroup(cm.get1,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil,e,tp)
if Duel.GetLocationCount(e:GetHandlerPlayer(),LOCATION_MZONE)>0 and #sg>0 and Duel.SelectYesNo(e:GetHandlerPlayer(),aux.Stringid(m,2)) then
for tc in aux.Next(sg) do
if Duel.GetLocationCount(e:GetHandlerPlayer(),LOCATION_MZONE)==0 then Duel.SendtoGrave(tc,REASON_RULE)
elseif tc:IsCanBeSpecialSummoned(e,0,e:GetHandler(),false,false) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetValue(cm.val)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_SET_ATTACK_FINAL)
e5:SetValue(0)
e5:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e6=e5:Clone()
e6:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e6)
local e7=e5:Clone()
e7:SetCode(EFFECT_CHANGE_LEVEL)
e7:SetValue(1)
tc:RegisterEffect(e7)
end
end
Duel.SpecialSummonComplete()
end
end
function cm.val(e,c)
return c:IsRank(1)
end
\ No newline at end of file
--隐之白幕
local m=33711502
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--destroy sub
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_CANNOT_RELEASE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetTarget(cm.rellimit)
c:RegisterEffect(e2)
local e6=e2:Clone()
e6:SetCode(EFFECT_UNRELEASABLE_SUM)
c:RegisterEffect(e6)
local e7=e2:Clone()
e7:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e7)
local e8=e2:Clone()
e8:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
c:RegisterEffect(e8)
local e9=e2:Clone()
e9:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e9)
local e10=e2:Clone()
e10:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e10)
local e11=e2:Clone()
e11:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e11)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(cm.eqlimit)
c:RegisterEffect(e3)
--adjust
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCode(EVENT_ADJUST)
e4:SetRange(LOCATION_SZONE)
e4:SetOperation(cm.adjustop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetCountLimit(1)
e5:SetLabelObject(e1)
e5:SetOperation(cm.op)
c:RegisterEffect(e5)
end
function cm.rellimit(e,c,tp,sumtp)
return c==e:GetHandler():GetEquipTarget()
end
function cm.eqlimit(e,c)
return c:IsControler(1-e:GetHandlerPlayer())
end
function cm.rfilter(c)
return c:IsReleasable()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tg=Duel.SelectMatchingCard(tp,cm.rfilter,tp,LOCATION_MZONE,0,1,1,nil)
local tc=tg:GetFirst()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,0)
Duel.Release(tg,REASON_COST)
e:SetLabelObject(tc)
e:SetLabel(tc:GetCode())
end
function cm.filter(c,tp)
return c:IsFaceup() and c:IsControler(1-tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local code=e:GetLabel()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
if Duel.Equip(tp,c,tc) then
local cid=tc:CopyEffect(code,RESET_EVENT+RESETS_STANDARD)
end
end
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget()
return c:IsReason(REASON_LOST_TARGET) and (ec:GetLocation()==LOCATION_DECK or ec:GetLocation()==LOCATION_EXTRA)
end
function cm.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
local dp=Duel.GetTurnPlayer()
if tp==dp and e:GetHandler():GetEquipTarget() then
Duel.GetControl(e:GetHandler():GetEquipTarget(),tp)
end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject():GetLabelObject()
local tp=e:GetHandlerPlayer()
if tc and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.SpecialSummon(tc,0,tp,tp,false,false)
end
end
\ No newline at end of file
--神秘守护的继承
local s = c33711503
local id = 33711503
function s.initial_effect(c)
--Activate
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.accon)
e1:SetOperation(s.acop)
c:RegisterEffect(e1)
--Link Spell
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_LINK_SPELL_KOISHI)
e2:SetValue(LINK_MARKER_TOP_LEFT)
c:RegisterEffect(e2)
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
c:RegisterEffect(e3)
--Gemini status
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE, 0)
e4:SetTarget(s.gemtg)
e4:SetCode(EFFECT_DUAL_STATUS)
c:RegisterEffect(e4)
end
function s.cfilter(c, oc, tp)
if not (c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:GetDefense() == c:GetAttack()) then
return false
end
local g = c:GetColumnGroup()
return g:FilterCount(
function(c, tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_SZONE)
end,
nil,
tp
) == 0 or g:IsContains(oc)
end
function s.accon(e, tp, eg, ep, ev, re, r, rp)
return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil, e:GetHandler(), tp)
end
function s.effilter(c)
return c:IsAbleToGrave() and c:IsType(TYPE_EFFECT) and c:GetDefense() == c:GetAttack()
end
function s.acop(e, tp, eg, ep, ev, re, r, rp)
local tc = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_MZONE, 0, 1, 1, nil, e:GetHandler(), tp):GetFirst()
Duel.MoveSequence(e:GetHandler(), tc:GetSequence())
if
Duel.IsExistingMatchingCard(s.effilter, tp, LOCATION_DECK, 0, 1, nil) and
Duel.SelectYesNo(tp, aux.Stringid(id, 1))
then
local g = Duel.SelectMatchingCard(tp, s.effilter, tp, LOCATION_DECK, 0, 1, 1, nil)
if Duel.SendtoGrave(g, REASON_EFFECT) > 0 then
local cid = tc:CopyEffect(g:GetFirst():GetOriginalCodeRule(), RESET_EVENT + RESETS_STANDARD, 1)
end
end
end
function s.gemtg(e, c)
return c:IsCode(33711504) and e:GetHandler():GetLinkedGroup():IsContains(c)
end
\ No newline at end of file
--稳重的龙之子 柯拉尔
local m=33711504
local cm=_G["c"..m]
local gl=0x144a
function cm.initial_effect(c)
aux.EnableDualAttribute(c)
--Special Summon
local e1 = Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetCondition(aux.IsDualState)
e1:SetTarget(cm.cttg)
e1:SetOperation(cm.ctop)
c:RegisterEffect(e1)
end
function cm.filter(c)
return c:IsFaceup()
end
function cm.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) 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)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,gl)
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
if tc:AddCounter(gl,1) then
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_SPECIAL_SUMMON)
e0:SetDescription(aux.Stringid(m,1))
e0:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e0:SetCode(EVENT_LEAVE_FIELD)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_LEAVE)
e0:SetCondition(cm.spcon)
e0:SetTarget(cm.sptg)
e0:SetOperation(cm.spop)
tc:RegisterEffect(e0)
end
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(gl)>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function cm.spfilter(c,e,tp,code1,code2)
return c:IsCode(code1,code2) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local code1,code2=e:GetHandler():GetCode()
if Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp,code1,code2) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local spg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil,e,tp,code1,code2)
Duel.SpecialSummon(spg,0,tp,tp,true,false)
end
e:Reset()
end
\ No newline at end of file
--神秘守护的继承
local s = c33711505
local id = 33711505
function s.initial_effect(c)
--Activate
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.accon)
e1:SetOperation(s.acop)
c:RegisterEffect(e1)
--Link Spell
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_LINK_SPELL_KOISHI)
e2:SetValue(LINK_MARKER_TOP_RIGHT)
c:RegisterEffect(e2)
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_REMAIN_FIELD)
c:RegisterEffect(e3)
--Gemini status
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE, 0)
e4:SetTarget(s.gemtg)
e4:SetCode(EFFECT_DUAL_STATUS)
c:RegisterEffect(e4)
end
function s.cfilter(c, oc, tp)
if not (c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:GetDefense() < c:GetAttack()) then
return false
end
local g = c:GetColumnGroup()
return g:FilterCount(
function(c, tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_SZONE)
end,
nil,
tp
) == 0 or g:IsContains(oc)
end
function s.accon(e, tp, eg, ep, ev, re, r, rp)
return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_MZONE, 0, 1, nil, e:GetHandler(), tp)
end
function s.effilter(c)
return c:IsAbleToGrave() and c:GetDefense() < c:GetAttack()
end
function s.acop(e, tp, eg, ep, ev, re, r, rp)
local c=e:GetHandler()
local tc = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_MZONE, 0, 1, 1, nil, e:GetHandler(), tp):GetFirst()
Duel.MoveSequence(e:GetHandler(), tc:GetSequence())
if
Duel.IsExistingMatchingCard(s.effilter, tp, LOCATION_DECK, 0, 1, nil) and
Duel.SelectYesNo(tp, aux.Stringid(id, 1))
then
local g = Duel.SelectMatchingCard(tp, s.effilter, tp, LOCATION_DECK, 0, 1, 1, nil)
if Duel.SendtoGrave(g, REASON_EFFECT) > 0 then
local og=Duel.GetOperatedGroup()
if og:GetCount()>0 and og:GetFirst():IsLocation(LOCATION_GRAVE) then
local ac=og:GetFirst()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_UPDATE_ATTACK)
e0:SetValue(ac:GetTextAttack())
e0:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(ac:GetTextDefense)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
end
function s.gemtg(e, c)
return c:IsCode(33711504) and e:GetHandler():GetLinkedGroup():IsContains(c)
end
\ No newline at end of file
--稳重的龙之子 柯拉尔
local m=33711506
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.EnableDualAttribute(c)
--Special Summon
local e1 = Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetCondition(aux.IsDualState)
e1:SetTarget(cm.cttg)
e1:SetOperation(cm.ctop)
c:RegisterEffect(e1)
end
function cm.thfilter(c,tp)
return c:IsControler(tp) and c:IsAbleToHand()
end
function cm.filter(c)
local ct=c:GetColumnGroup():FilterCount(cm.thfilter,nil,1-tp)
return ct>0 and c:IsAbleToHand()
end
function cm.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) 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)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc and tc:IsRelateToEffect(e) then
if Duel.SendtoHand(tc,tp,REASON_EFFECT)~=0 then
local thg=c:GetColumnGroup():Filter(cm.thfilter,nil,1-tp)
Duel.SendtoHand(thg,nil,REASON_EFFECT)
end
end
end
\ No newline at end of file
--水晶魔法小妖精 艾尼斯
local m=33711507
local cm=_G["c"..m]
function cm.initial_effect(c)
--activate from your hand or Mzone
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(66570171,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetCondition(cm.con)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
--to deck reverse()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_REMOVED)
e2:SetCountLimit(1)
e2:SetCondition(cm.lpcon)
e2:SetOperation(cm.lpop)
c:RegisterEffect(e2)
--Damage Plus
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CHANGE_DAMAGE)
e3:SetRange(LOCATION_DECK)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(0,1)
e3:SetCondition(cm.damcon)
e3:SetValue(cm.val)
c:RegisterEffect(e3)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
Duel.Remove(c,POS_FACEUP,REASON_COST)
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function cm.con(e,tp)
return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)>5
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetOperation(cm.operation)
Duel.RegisterEffect(e1,tp)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local d1=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
local d2=Duel.GetFieldGroupCount(1-tp,LOCATION_ONFIELD,0)
if d1>d2 then
Duel.Recover(tp,1200,REASON_EFFECT)
elseif d1<d2 then
Duel.Damage(1-tp,600,REASON_EFFECT)
else
Duel.SetLP(tp,Duel.GetLP(tp)*2)
Duel.SetLP(1-tp,Duel.GetLP(1-tp)*2)
end
end
function cm.lpcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetFlagEffect(m)>0 and c:IsAbleToDeck()
end
function cm.lpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.DisableShuffleCheck()
Duel.SendtoDeck(c,tp,0,REASON_EFFECT)
c:ReverseInDeck()
end
end
function cm.damcon(e)
local tp=e:GetHandlerPlayer()
local g=Duel.GetDecktopGroup(tp,1)
return g:IsContains(e:GetHandler()) and c:IsFaceup()
end
function cm.val(e)
return dam*2
end
\ No newline at end of file
--七色之魂
local m=33711601
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--maintain
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetOperation(cm.mtop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.negcon)
e2:SetOperation(cm.negop)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(cm.cost)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
--Skip Phase
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1)
e4:SetCost(cm.skipcost)
e4:SetTarget(cm.skiptg)
e4:SetOperation(cm.skipop)
c:RegisterEffect(e4)
end
function cm.remfilter(c,tp)
return c:IsAbleToRemove(tp,POS_FACEDOWN,REASON_COST)
end
function cm.typefilter(c)
if c:GetType()&(TYPE_SPELL+TYPE_TRAP)~=0 then
return c:GetType()&(TYPE_SPELL+TYPE_TRAP)
elseif c:GetType()&(TYPE_NORMAL+TYPE_RITUAL+TYPE_FUSION+TYPE_XYZ+TYPE_SYNCHRO+TYPE_LINK)~=0 then
return c:GetType()&(TYPE_NORMAL+TYPE_RITUAL+TYPE_FUSION+TYPE_XYZ+TYPE_SYNCHRO+TYPE_LINK)
else
return TYPE_EFFECT
end
end
function cm.typefilter1(c,tc)
return cm.typefilter(c)==cm.typefilter(tc)
end
function cm.gfilter(g)
return g:GetClassCount(cm.typefilter)==#g
end
function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.remfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,nil)
local sg=Group.CreateGroup()
if g:GetClassCount(cm.typefilter)>=9 then
for i=1,7 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc then
sg:AddCard(tc)
g:Remove(cm.typefilter1,nil,tc)
end
end
Duel.Remove(sg,POS_FACEDOWN,REASON_COST)
else
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and Duel.IsChainDisablable(ev) and Duel.GetFlagEffect(tp,m)==0
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(m,4)) then
Duel.NegateEffect(ev)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.rvfilter(c)
return not c:IsPublic() and c:IsCode(83764718)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.rvfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local rg=Duel.SelectMatchingCard(tp,cm.rvfilter,tp,LOCATION_HAND,0,1,nil)
Duel.ConfirmCards(1-tp,rc)
end
function cm.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.HintSelection(tc)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function cm.skipcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.remfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,nil)
if chk==0 then return c:IsAbleToRemove(tp,POS_FACEDOWN,REASON_COST) and g:GetClassCount(cm.typefilter)>=9 end
local sg=Group.CreateGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
for i=1,9 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc then
sg:AddCard(tc)
g:Remove(cm.typefilter1,nil,tc)
end
end
sg:AddCard(c)
Duel.Remove(sg,POS_FACEDOWN,REASON_COST)
end
function cm.skiptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(1-tp,EFFECT_SKIP_TURN) end
end
function cm.skipop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_SKIP_TURN)
e1:SetTargetRange(0,1)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--真贱胜负
local m=33711603
local cm=_G["c"..m]
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.atktg1)
e1:SetOperation(cm.atkop)
c:RegisterEffect(e1)
end
cm.toss_coin=true
function cm.atktg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,1-tp,1)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local flag=false
local flag_1=false
local t_flag_1=true
local t_flag_2=true
local tossp=1-tp
local num=0
while (flag==false and flag_1==false) do
tossp=1-tossp
num=num+1
Duel.Hint(HINT_SELECTMSG,tossp,HINTMSG_COIN)
local coin=Duel.AnnounceCoin(1-tossp)
local coin_1=Duel.AnnounceCoin(tossp)
local res=Duel.TossCoin(tossp,1)
local res_1=Duel.TossCoin(1-tossp,1)
if coin==res then
Duel.Damage(1-tossp,500*num,REASON_EFFECT)
t_flag_1=false
else
flag=true
end
if coin_1==res_1 then
Duel.Damage(tossp,500*num,REASON_EFFECT)
t_flag_2=false
else
flag_1=true
end
if t_flag_1==false and Duel.SelectYesNo(1-tossp,aux.Stringid(m,2)) then
flag=false
t_flag_2=true
end
if t_flag_2==false and Duel.SelectYesNo(tossp,aux.Stringid(m,2)) then
flag_1=false
end
t_flag_1=true
t_flag_2=true
end
end
\ No newline at end of file
--平衡的护卫兽
local m=33711701
local cm=_G["c"..m]
function cm.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(cm.eqtg)
e1:SetOperation(cm.eqop)
c:RegisterEffect(e1)
--unequip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--equip effect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_SET_BASE_DEFENSE)
e3:SetValue(cm.val)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_SET_BASE_ATTACK)
c:RegisterEffect(e4)
--negate
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_EQUIP+EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAIN_SOLVING)
e5:SetOperation(cm.negop)
c:RegisterEffect(e5)
--to hand
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(m,2))
e6:SetCategory(CATEGORY_TOHAND)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_GRAVE)
e6:SetCondition(aux.exccon)
e6:SetCost(cm.thcost)
e6:SetTarget(cm.thtg)
e6:SetOperation(cm.thop)
c:RegisterEffect(e6)
end
function cm.filter(c)
local ct1,ct2=c:GetUnionCount()
return c:IsFaceup() and ct2==0
end
function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return e:GetHandler():GetFlagEffect(m)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
c:RegisterFlagEffect(m,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if not tc:IsRelateToEffect(e) or not cm.filter(tc) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
aux.SetUnionState(c)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(m)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
c:RegisterFlagEffect(m,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)
end
function cm.val(e,c)
return (c:GetTextAttack()+c:GetTextDefense())/2
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
if re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if g and g:IsContains(e:GetHandler()) and Duel.SelectYesNo(e:GetHandlerPlayer(),aux.Stringid(m,1)) then
if Duel.Damage(e:GetHandlerPlayer(),1000,REASON_EFFECT) then
Duel.NegateEffect(ev)
end
end
end
end
function cm.thcost(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 cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
\ No newline at end of file
--深层思考
local m=33711702
local cm=_G["c"..m]
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_HAND)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(cm.discon)
e2:SetOperation(cm.disop)
c:RegisterEffect(e2)
--leav effect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetOperation(cm.tdop)
c:RegisterEffect(e3)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(tp,3)
if chk==0 then return Duel.CheckLPCost(tp,800) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local num=Duel.GetMatchingGroupCount(Card.IsAbleToRemove,tp,LOCATION_DECK,0,nil)
local lp=Duel.GetLP(tp)
local m=math.floor(math.min(lp,4000)/800)
if m>num then
m=num
end
local t={}
for i=1,m do
t[i]=i*800
end
local ac=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,ac)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_DECK,0,ac/800,ac/800,nil)
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
end
function cm.remfilter(c)
return c:GetFlagEffect(m)<1
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local sg=eg:Filter(cm.remfilter,nil)
return sg:GetCount()>0
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local num=Duel.Remove(eg:Filter(cm.remfilter,nil),POS_FACEDOWN,REASON_RULE)
if num<1 then return end
local tg=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
local sg=tg:Filter(Card.IsAbleToHand,nil)
if sg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=sg:RandomSelect(tp,1)
local tc=tg:GetFirst()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TOHAND,0,0)
Duel.SendtoHand(tc,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(e:GetHandlerPlayer(),500*Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_REMOVED,0,nil),REASON_EFFECT)
end
\ No newline at end of file
--激叫早
local m=33711704
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_HAND,1,nil)and Duel.GetMatchingGroupCount(nil,tp,LOCATION_MZONE,0,nil)>0 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,1-tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,1-tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,0,0)
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,1-tp,true,false)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local num=Duel.GetMatchingGroupCount(nil,tp,LOCATION_MZONE,0,nil)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
if num<ft then ft = num end
if Duel.IsPlayerAffectedByEffect(1-tp,59822133) then ft=1 end
if num==0 then return end
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_HAND,nil)
Duel.ConfirmCards(tp,g)
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
local a=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.spfilter,1-tp,LOCATION_HAND,0,1,nil,e,tp)
local op=1
if a then
op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
else
op=Duel.SelectOption(tp,aux.Stringid(m,2))+1
end
local sg=g:Filter(cm.spfilter,nil,e,tp)
local tdg=g:Filter(Card.IsType,nil,TYPE_MONSTER)
if op==0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local sg1=sg:Select(1-tp,ft,ft,nil)
if Duel.SpecialSummon(sg1,0,1-tp,1-tp,true,false,POS_FACEUP)~=0 then
local lv=sg1:GetSum(Card.GetLevel)
Duel.Damage(1-tp,lv*500,REASON_EFFECT)
else
Duel.Damage(1-tp,3000,REASON_EFFECT)
end
else
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK)
local sg1=sg:Select(1-tp,ft,ft,nil)
if Duel.SendtoDeck(sg1,nil,2,REASON_RULE)~=0 then
local og=Duel.GetOperatedGroup()
local lv=sg1:GetSum(Card.GetLevel)
Duel.Damage(tp,lv*500,REASON_EFFECT)
else
Duel.Damage(1-tp,3000,REASON_EFFECT)
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