Commit cec38509 authored by POLYMER's avatar POLYMER

fix

parent e8ca000a
......@@ -36,7 +36,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetOperation(cm.aclimit)
e2:SetReset(RESET_PHASE+PHASE_END)
--Duel.RegisterEffect(e2,tp)
if c:IsRelateToEffect(e) then
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and c:IsRelateToEffect(e) then
Duel.BreakEffect()
c:CancelToGrave()
Duel.SendtoHand(c,1-tp,REASON_EFFECT)
......
......@@ -143,16 +143,27 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return ft>0 and Duel.GetFlagEffect(tp,11451902)>0 end
Duel.ResetFlagEffect(tp,11451902)
--change code
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetProperty(EFFECT_FLAG_OATH)
e3:SetTargetRange(0xff,0xff)
e3:SetTarget(function(e,c) return Duel.IsExistingMatchingCard(Card.IsOriginalCodeRule,0,LOCATION_GRAVE,LOCATION_GRAVE,1,c,table.unpack({c:GetOriginalCodeRule()})) end)
e3:SetValue(function(e,c) return c:GetSequence()*0xfff+c:GetTurnID()*0xff+c:GetFieldID()*0xf+c:GetOriginalCode()+c:GetRealFieldID() end)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetOperation(function(e)
if Duel.GetFlagEffect(1,11451901)==0 and Duel.GetCurrentChain()==e:GetLabel() then
--change code
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_REPEAT+EFFECT_FLAG_DELAY+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_OATH,EFFECT_FLAG2_WICKED)
e3:SetTargetRange(0xff,0xff)
e3:SetTarget(function(e,c) return Duel.IsExistingMatchingCard(Card.IsOriginalCodeRule,0,LOCATION_GRAVE,LOCATION_GRAVE,1,c,table.unpack({c:GetOriginalCodeRule()})) end)
e3:SetValue(function(e,c) return 0x527+c:GetFieldID() end)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
Duel.RegisterFlagEffect(1,11451901,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end)
e1:SetReset(RESET_CHAIN)
e1:SetLabel(Duel.GetCurrentChain())
Duel.RegisterEffect(e1,tp)
end
function cm.cpcost2(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
......@@ -239,14 +250,17 @@ function cm.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(m)==0 end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function cm.cpfilter0(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end
function cm.cpfilter(c)
return c:IsFaceup() and c:IsRace(RACE_CYBERSE)
return c:IsFaceup() and c:IsRace(RACE_CYBERSE) and c:IsLevel(1)
end
function cm.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(cm.cpfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(cm.cpfilter,tp,LOCATION_GRAVE,0,1,nil) end
if chk==0 then return Duel.IsExistingTarget(cm.cpfilter0,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingTarget(cm.cpfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.cpfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SelectTarget(tp,cm.cpfilter0,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SelectTarget(tp,cm.cpfilter,tp,LOCATION_GRAVE,0,1,1,nil)
end
function cm.cpop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -27,6 +27,7 @@ function cm.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_HAND)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(cm.con)
e2:SetCost(cm.spcost)
e2:SetOperation(cm.spop)
......@@ -56,7 +57,7 @@ function cm.cfilter1(c,tp)
end
function cm.cfilter2(c,tp,ec)
if not c:IsControler(tp) or c:IsPublic() or not c:IsLocation(LOCATION_HAND) then return end
local eset={ec:IsHasEffect(0x20000000+m)}
local eset={ec:IsHasEffect(EFFECT_FLAG_EFFECT+m)}
for _,te in pairs(eset) do
if te:GetLabel()&c:GetType()>0 then return false end
end
......@@ -96,7 +97,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
e2:SetLabel(e:GetLabel())
e2:SetLabelObject(e3)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(0x20000000+m)
e2:SetCode(EFFECT_FLAG_EFFECT+m)
e2:SetCondition(function(e) return e:GetLabelObject():GetLabel()<100 end)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
......
......@@ -13,7 +13,7 @@ function c12869025.initial_effect(c)
--link as level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
--e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_ALLOW_SYNCHRO_KOISHI)
e2:SetValue(function(e,c)
return e:GetHandler():GetLink()
......
......@@ -12,7 +12,7 @@ function c12869030.initial_effect(c)
--link as level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
--e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_ALLOW_SYNCHRO_KOISHI)
e2:SetValue(function(e,c)
return e:GetHandler():GetLink()
......
......@@ -12,7 +12,7 @@ function c12869035.initial_effect(c)
--link as level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
--e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_ALLOW_SYNCHRO_KOISHI)
e2:SetValue(function(e,c)
return e:GetHandler():GetLink()
......
......@@ -12,7 +12,7 @@ function c12869040.initial_effect(c)
--link as level
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
--e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_ALLOW_SYNCHRO_KOISHI)
e2:SetValue(function(e,c)
return e:GetHandler():GetLink()
......
......@@ -99,9 +99,11 @@ end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
if c:IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
end
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then Duel.SSet(tp,c) end
if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) then Duel.SSet(tp,c) end
end
\ No newline at end of file
......@@ -90,11 +90,13 @@ end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
if c:IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
end
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then Duel.SSet(tp,c) end
if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) then Duel.SSet(tp,c) end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,4))
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -154,11 +154,13 @@ end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
if c:IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
end
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then Duel.SSet(tp,c) end
if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) then Duel.SSet(tp,c) end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,4))
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -65,11 +65,13 @@ end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
if c:IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
end
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then Duel.SSet(tp,c) end
if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) then Duel.SSet(tp,c) end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,4))
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -104,7 +104,7 @@ function s.thfilter(c,fid)
return false
end
function s.filter(c,e,tp)
if not (c:IsType(TYPE_LINK) and c:IsLinkAbove(2) and c:IsFaceup()) then return false end
if not (c:IsType(TYPE_LINK) and c:IsSetCard(0x186) and c:IsLinkAbove(2) and c:IsFaceup()) then return false end
if not SNNM.IsInTable(c:GetOriginalCode(),s.codetable) then
Duel.DisableActionCheck(true)
Duel.CreateToken(tp,c:GetOriginalCode())
......
......@@ -78,7 +78,7 @@ function c65010517.op(e,tp,eg,ep,ev,re,r,rp)
--accumulate
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetCode(0x10000000+65010517)
e7:SetCode(EFFECT_FLAG_EFFECT+65010517)
e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e7:SetReset(RESET_PHASE+PHASE_END)
e7:SetTargetRange(0,1)
......
......@@ -73,6 +73,7 @@ function c75011026.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
local b1=true
local b2=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil)
local b3=b2 and ct>=2
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(75011026,1)},
{b2,aux.Stringid(75011026,2)},
......
......@@ -6,7 +6,6 @@ function c76029021.initial_effect(c)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetCountLimit(1,76029021)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(c76029021.incost)
e1:SetTarget(c76029021.intg)
e1:SetOperation(c76029021.inop)
......@@ -18,7 +17,7 @@ function c76029021.initial_effect(c)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,76029021)
e2:SetCountLimit(1,16029021)
e2:SetTarget(c76029021.sptg)
e2:SetOperation(c76029021.spop)
c:RegisterEffect(e2)
......@@ -28,26 +27,21 @@ function c76029021.initial_effect(c)
end
c76029021.named_with_Kazimierz=true
function c76029021.ctfil(c)
return c.named_with_Kazimierz and c:IsReleasable() and Duel.IsExistingTarget(c76029021.tgfil,tp,LOCATION_MZONE,0,1,c)
end
function c76029021.tgfil(c)
return c:IsRace(RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsFaceup()
return c.named_with_Kazimierz and c:IsReleasable() and Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_MZONE,0,1,c,RACE_BEASTWARRIOR+RACE_WINDBEAST)
end
function c76029021.incost(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c76029021.tgfil(chkc) end
if chk==0 then return Duel.IsExistingMatchingCard(c76029021.ctfil,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c76029021.ctfil,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c76029021.intg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rp==1-tp and Duel.IsExistingTarget(c76029021.tgfil,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c76029021.tgfil,tp,LOCATION_MZONE,0,1,1,nil)
if chk==0 then return rp==1-tp end
end
function c76029021.inop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsRace,tp,LOCATION_MZONE,0,nil,RACE_BEASTWARRIOR+RACE_WINDBEAST)
if g:GetCount()>0 then
local tc=g:Select(tp,1,1,nil):GetFirst()
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -18,7 +18,7 @@ function c76029023.initial_effect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCountLimit(1,76029023)
e3:SetCountLimit(1,16029023)
e3:SetCondition(c76029023.thcon)
e3:SetTarget(c76029023.thtg)
e3:SetOperation(c76029023.thop)
......
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