Commit db08a7f0 authored by POLYMER's avatar POLYMER

fix

parent 32a9632a
...@@ -225,9 +225,9 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp) ...@@ -225,9 +225,9 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local te=e:GetLabelObject() local te=e:GetLabelObject()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.GetReleaseGroup(tp):Filter(cm.rfilter,nil) local g=Duel.GetReleaseGroup(tp,false,REASON_MATERIAL):Filter(cm.rfilter,nil)
local sg=g:SelectSubGroup(tp,cm.fselect,false,1,#g,tp,c) local sg=g:SelectSubGroup(tp,cm.fselect,false,1,#g,tp,c)
Duel.Release(sg,REASON_COST) Duel.Release(sg,REASON_MATERIAL)
Duel.BreakEffect() Duel.BreakEffect()
Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,false) Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,false)
cm.activate_sequence[te]=c:GetSequence() cm.activate_sequence[te]=c:GetSequence()
......
...@@ -45,7 +45,7 @@ function cm.costcon(e) ...@@ -45,7 +45,7 @@ function cm.costcon(e)
return true return true
end end
function cm.costchk(e,te,tp) function cm.costchk(e,te,tp)
return Duel.IsExistingMatchingCard(Card.IsReleasable,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(Card.IsReleasable,tp,LOCATION_MZONE,0,1,nil,REASON_RULE)
end end
function cm.costtg(e,te,tp) function cm.costtg(e,te,tp)
e:SetLabelObject(te) e:SetLabelObject(te)
......
...@@ -98,6 +98,7 @@ function cm.condition4(e,tp,eg,ep,ev,re,r,rp) ...@@ -98,6 +98,7 @@ function cm.condition4(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.operation4(e,tp,eg,ep,ev,re,r,rp) function cm.operation4(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():ResetFlagEffect(m) e:GetHandler():ResetFlagEffect(m)
--Duel.Hint(24,0,aux.Stringid(m,0))
--effect phase end --effect phase end
local e3=Effect.CreateEffect(e:GetHandler()) local e3=Effect.CreateEffect(e:GetHandler())
e3:SetDescription(aux.Stringid(m,0)) e3:SetDescription(aux.Stringid(m,0))
...@@ -111,13 +112,13 @@ function cm.operation4(e,tp,eg,ep,ev,re,r,rp) ...@@ -111,13 +112,13 @@ function cm.operation4(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.condition3(e,tp,eg,ep,ev,re,r,rp) function cm.condition3(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,1-tp,LOCATION_MZONE+LOCATION_HAND,0,nil,TYPE_MONSTER) local g=Duel.GetMatchingGroup(Card.IsType,1-tp,LOCATION_MZONE+LOCATION_HAND,0,nil,TYPE_MONSTER)
g=g:Filter(Card.IsReleasable,nil) g=g:Filter(Card.IsReleasable,nil,REASON_RULE)
return #g>0 and cm[tp]>0 return #g>0 and cm[tp]>0
end end
function cm.operation3(e,tp,eg,ep,ev,re,r,rp) function cm.operation3(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local g=Duel.GetMatchingGroup(Card.IsType,1-tp,LOCATION_MZONE+LOCATION_HAND,0,nil,TYPE_MONSTER) local g=Duel.GetMatchingGroup(Card.IsType,1-tp,LOCATION_MZONE+LOCATION_HAND,0,nil,TYPE_MONSTER)
g=g:Filter(Card.IsReleasable,nil) g=g:Filter(Card.IsReleasable,nil,REASON_RULE)
local count=math.min(#g,cm[tp]) local count=math.min(#g,cm[tp])
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_RELEASE)
local g2=g:Select(1-tp,count,count,nil) local g2=g:Select(1-tp,count,count,nil)
......
...@@ -42,7 +42,7 @@ function cm.initial_effect(c) ...@@ -42,7 +42,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function cm.filter1(c,tp) function cm.filter1(c,tp)
return c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0 return c:IsReleasable(REASON_SPSUMMON) and Duel.GetMZoneCount(1-tp,c,tp)>0
end end
function cm.filter2(c) function cm.filter2(c)
return aux.IsCodeListed(c,99518961) and c:IsType(TYPE_MONSTER) and c:IsFaceup() return aux.IsCodeListed(c,99518961) and c:IsType(TYPE_MONSTER) and c:IsFaceup()
......
--珂拉琪的拼图箱庭 --珂拉琪的拼图箱庭
local m=11451528 local cm,m=GetID()
local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -80,7 +79,7 @@ function cm.recon(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,7 +79,7 @@ function cm.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1 and (e:GetHandler():GetFlagEffect(m)>0 or (ep~=tp and e:GetCode()~=EVENT_CHAIN_NEGATED)) return Duel.GetCurrentChain()==1 and (e:GetHandler():GetFlagEffect(m)>0 or (ep~=tp and e:GetCode()~=EVENT_CHAIN_NEGATED))
end end
function cm.reop(e,tp,eg,ep,ev,re,r,rp) function cm.reop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsReleasable,tp,LOCATION_ONFIELD,0,e:GetHandler()) local g=Duel.GetMatchingGroup(Card.IsReleasable,tp,LOCATION_ONFIELD,0,e:GetHandler(),REASON_RULE)
if #g==0 then return end if #g==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
......
...@@ -39,7 +39,7 @@ function cm.dptcheck(g) ...@@ -39,7 +39,7 @@ function cm.dptcheck(g)
return g:GetClassCount(Card.GetLevel)==#g return g:GetClassCount(Card.GetLevel)==#g
end end
function cm.cfilter(c) function cm.cfilter(c)
return c:IsLevelAbove(1) and c:IsReleasable() return c:IsLevelAbove(1) and c:IsReleasable(REASON_MATERIAL)
end end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp) function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil) local mg=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil)
...@@ -52,7 +52,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +52,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local tg=mg:SelectSubGroup(tp,cm.dptcheck,true,2,99) local tg=mg:SelectSubGroup(tp,cm.dptcheck,true,2,99)
if tg and #tg>0 then if tg and #tg>0 then
c:SetMaterial(tg) c:SetMaterial(tg)
Duel.Release(tg,REASON_COST+REASON_MATERIAL) Duel.Release(tg,REASON_MATERIAL)
Duel.BreakEffect() Duel.BreakEffect()
Duel.SSet(tp,c) Duel.SSet(tp,c)
end end
......
...@@ -4,16 +4,15 @@ local cm=_G["c"..m] ...@@ -4,16 +4,15 @@ local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
aux.AddCodeList(c,60002134) aux.AddCodeList(c,60002134)
--Special Summon --Special Summon
local e4=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1)) e3:SetDescription(aux.Stringid(m,1))
e4:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_LEAVE_FIELD) e3:SetCode(EVENT_LEAVE_FIELD)
e4:SetCondition(cm.sumcon) e3:SetTarget(cm.sumtg)
e4:SetTarget(cm.sumtg) e3:SetOperation(cm.sumop)
e4:SetOperation(cm.sumop) c:RegisterEffect(e3)
c:RegisterEffect(e4)
--to hand --to hand
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
...@@ -29,7 +28,7 @@ function cm.initial_effect(c) ...@@ -29,7 +28,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.sumcon(e,tp,eg,ep,ev,re,r,rp) function cm.sumcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) return e:GetHandler():IsPreviousPosition(POS_FACEUP) --and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
return c:IsCode(60002137) and c:IsAbleToHand() return c:IsCode(60002137) and c:IsAbleToHand()
......
...@@ -72,7 +72,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -72,7 +72,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
Duel.Release(c,REASON_EFFECT) Duel.Release(c,REASON_EFFECT)
local op=e:GetLabel() local op=e:GetLabel()
if op==0 then if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
...@@ -85,7 +85,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -85,7 +85,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,true,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,true,true,POS_FACEUP)
end end
elseif op==1 then elseif op==2 then
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
...@@ -93,7 +93,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -93,7 +93,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,true,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,true,true,POS_FACEUP)
end end
elseif op==2 then elseif op==3 then
Duel.Recover(tp,2000,REASON_EFFECT) Duel.Recover(tp,2000,REASON_EFFECT)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
...@@ -52,7 +52,7 @@ function cm.eqlimit(e,c) ...@@ -52,7 +52,7 @@ function cm.eqlimit(e,c)
end end
function cm.cttg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return e:GetHandler():GetFlagEffect(m)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return e:GetHandler():GetFlagEffect(m)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,0,0,LOCATION_MZONE) Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,0,0,LOCATION_MZONE)
c:RegisterFlagEffect(m,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1) c:RegisterFlagEffect(m,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end end
......
...@@ -24,7 +24,7 @@ end ...@@ -24,7 +24,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK,0,nil) local tc=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_DECK,0,nil):Select(tp,1,1,nil)
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetCode(EFFECT_CHANGE_TYPE)
......
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