Commit 77b96408 authored by Nemo Ma's avatar Nemo Ma

fix

parent 5ed567e7
......@@ -58,6 +58,13 @@ function cm.initial_effect(c)
e4:SetValue(LOCATION_DECKBOT)
e4:SetCondition(function(e,c) return Duel.GetTurnCount()%4==0 end)
c:RegisterEffect(e4)
local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e10:SetRange(LOCATION_FZONE)
e10:SetCode(EVENT_TO_DECK)
e10:SetCondition(function(e,c) return Duel.GetTurnCount()%4==0 end)
e10:SetOperation(cm.sortop)
c:RegisterEffect(e10)
--cannot be destroyed
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
......@@ -134,4 +141,29 @@ function cm.setlimit(e,c,tp)
end
function cm.actlimit(e,re,tp)
return re:IsActiveType(TYPE_FIELD) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cm.sfilter(c,loc,p)
return c:IsReason(REASON_REDIRECT) and c:IsLocation(loc) and (not p or c:IsControler(p))
function cm.sortop(e,tp,eg,ep,ev,re,r,rp)
local tp=Duel.GetTurnPlayer()
local g=eg:Filter(cm.sfilter,nil,LOCATION_DECK)
local mg={}
mg[1]=g:Filter(cm.sfilter,nil,LOCATION_DECK,tp)
mg[2]=g:Filter(cm.sfilter,nil,LOCATION_DECK,1-tp)
for i=1,2 do
if #mg[i]>1 then
local p=tp
if i>1 then p=1-tp end
for i=1,#mg[i] do
local mgx=Duel.GetDecktopGroup(p,1)
Duel.MoveSequence(mgx:GetFirst(),SEQ_DECKTOP)
end
Duel.SortDecktop(tp,p,#mg[i])
for i=1,#mg[i] do
local mgx=Duel.GetDecktopGroup(p,1)
Duel.MoveSequence(mgx:GetFirst(),SEQ_DECKBOTTOM)
end
end
end
end
\ No newline at end of file
......@@ -70,7 +70,7 @@ function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
if tc:IsFaceup() and (tc:GetAttack()==0 or (tc:GetDefense()==0 and not tc:IsType(TYPE_LINK))) then
if tc:IsFaceup() and (tc:GetAttack()==0 and (tc:GetDefense()==0 and not tc:IsType(TYPE_LINK))) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -60,11 +60,11 @@ end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c)
return g:CheckSubGroup(aux.mzctcheck,1,1,tp)
end
function cm.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=g:SelectSubGroup(tp,aux.mzctcheck,true,1,1,tp)
if sg then
......@@ -140,5 +140,5 @@ function cm.acop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1,true)
end
function cm.bgmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(11,0,aux.Stringid(m,4))
Duel.Hint(HINT_MUSIC,0,aux.Stringid(m,4))
end
......@@ -60,11 +60,11 @@ end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c)
return g:CheckSubGroup(aux.mzctcheck,2,2,tp)
end
function cm.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=g:SelectSubGroup(tp,aux.mzctcheck,true,2,2,tp)
if sg then
......@@ -124,5 +124,5 @@ function cm.acop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1,true)
end
function cm.bgmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(11,0,aux.Stringid(m,4))
Duel.Hint(HINT_MUSIC,0,aux.Stringid(m,4))
end
......@@ -63,7 +63,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
fop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.eftg(e,c)
return e:GetHandler():GetEquipGroup():IsContains(c) and c:IsSetCard(0x9354)
return e:GetHandler():GetEquipGroup():IsContains(c) and c:IsSetCard(0x5354)
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
if bit.band(r,REASON_EFFECT)<=0 then return false end
......
......@@ -45,7 +45,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,m)>0 then return end
Duel.RegisterFlagEffect(tp,m,0,EFFECT_FLAG_CLIENT_HINT,1,aux.Stringid(m,1))
Duel.RegisterFlagEffect(tp,m,0,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
......
......@@ -65,13 +65,13 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local t2=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil):GetCount()>0
if chk==0 then return t1 or t2 end
local op=0
local m={}
local n={}
local m1={}
local n1={}
local ct=1
if t1 then m[ct]=aux.Stringid(m,2) n[ct]=1 ct=ct+1 end
if t2 then m[ct]=aux.Stringid(m,3) n[ct]=2 ct=ct+1 end
local sp=Duel.SelectOption(tp,table.unpack(m))
op=n[sp+1]
if t1 then m1[ct]=aux.Stringid(m,2) n1[ct]=1 ct=ct+1 end
if t2 then m1[ct]=aux.Stringid(m,3) n1[ct]=2 ct=ct+1 end
local sp=Duel.SelectOption(tp,table.unpack(m1))
op=n1[sp+1]
e:SetLabel(op)
if op==1 then
......
......@@ -82,9 +82,10 @@ function cm.caop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
end
function cm.acfilter(c,typ)
return c:IsFaceup() and bit.band(c:GetType(),typ)~=0 and not c:IsSetCard(0x157)
return c:IsFaceup() and bit.band(c:GetType(),typ)~=0
end
function cm.aclimit(e,re,tp)
if re:GetHandler():IsSetCard(0x157) then return false end
if re:IsActiveType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(cm.acfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil,TYPE_MONSTER) then return true end
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and Duel.IsExistingMatchingCard(cm.acfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil,TYPE_SPELL) then return true end
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_TRAP) and Duel.IsExistingMatchingCard(cm.acfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil,TYPE_TRAP) then return true end
......
......@@ -6,10 +6,9 @@ function c40008539.initial_effect(c)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(40008539,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,40008539)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c40008539.spcost)
e2:SetTarget(c40008539.sptg)
......@@ -35,30 +34,39 @@ function c40008539.cfilter(c,e,tp,zone)
and Duel.IsExistingMatchingCard(c40008539.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetOriginalRace())
end
function c40008539.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then e:SetLabel(1) return true end
end
function c40008539.spfilter(c,e,tp)
return c:IsSetCard(0x114) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c40008539.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local zone=c:GetLinkedZone(tp)
if chk==0 then return Duel.IsExistingMatchingCard(c40008539.cfilter,tp,LOCATION_MZONE,0,1,c,e,tp,zone) end
if chk==0 then
if e:GetLabel()==0 or not Duel.IsExistingMatchingCard(c40008539.cfilter,tp,LOCATION_MZONE,0,1,c,e,tp,zone) then return false end
local g=Duel.GetMatchingGroup(c40008539.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
return #g>0
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c40008539.cfilter,tp,LOCATION_MZONE,0,1,1,c,e,tp,zone)
Duel.SendtoHand(g,nil,REASON_COST)
e:SetLabelObject(g:GetFirst())
end
function c40008539.spfilter(c,e,tp,race)
return c:IsSetCard(0x114) and c:GetOriginalRace()~=race and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c40008539.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local cc=e:GetLabelObject()
if chkc then return chkc:IsLocation(LOCATION_DECK) and chkc:IsControler(tp)
and chkc~=cc and c40008539.spfilter(chkc,e,tp,cc:GetOriginalRace()) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c40008539.spfilter,tp,LOCATION_DECK,0,1,1,cc,e,tp,cc:GetOriginalRace())
local zone=e:GetHandler():GetLinkedZone(tp)
local g=Duel.GetMatchingGroup(c40008539.spfilter,tp,LOCATION_DECK,0,cc,e,tp,cc:GetOriginalRace(),zone)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c40008539.spfilter2(c,e,tp,race,zone)
return c:IsSetCard(0x114) and c:GetOriginalRace()~=race and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp)
end
function c40008539.spop(e,tp,eg,ep,ev,re,r,rp)
local zone=e:GetHandler():GetLinkedZone(tp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone)
local cc=e:GetLabelObject()
if e:GetHandler():IsRelateToEffect(e) then
local zone=e:GetHandler():GetLinkedZone(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c40008539.spfilter2,tp,LOCATION_DECK,0,1,1,cc,e,tp,cc:GetOriginalRace(),zone)
Duel.SpecialSummon(g:GetFirst(),0,tp,tp,false,false,POS_FACEUP,zone)
end
end
function c40008539.spcon2(e,tp,eg,ep,ev,re,r,rp)
......
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