Commit a81d1c18 authored by Nemo Ma's avatar Nemo Ma

fix

parent 871092cd
......@@ -27,8 +27,8 @@ function cm.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(cm.eqtg)
e3:SetOperation(cm.eqop)
......@@ -38,7 +38,7 @@ function cm.initial_effect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DISABLE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e4:SetTarget(cm.distg)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
......@@ -103,25 +103,30 @@ function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFieldGroupCount(ep,LOCATION_DECK,0)>0 and Duel.SelectEffectYesNo(tp,c) then
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>0 and Duel.SelectEffectYesNo(tp,c) then
Duel.Hint(HINT_CARD,0,m)
c:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1,0,0)
local ct={}
local ct1,ct2={},{}
local ctg=Group.CreateGroup()
for i=5,1,-1 do
if Duel.GetFieldGroupCount(ep,LOCATION_DECK,0)>=i then
table.insert(ct,i)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=i then
table.insert(ct1,i)
end
if Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>=i then
table.insert(ct2,i)
end
end
if #ct==1 then
Duel.ConfirmDecktop(ep,ct[1])
else
if #ct1~=0 or #ct2~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local ac1=Duel.AnnounceNumber(tp,table.unpack(ct1))
Duel.ConfirmDecktop(tp,ac1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local ac=Duel.AnnounceNumber(tp,table.unpack(ct))
Duel.ConfirmDecktop(ep,ac)
ctg=Duel.GetDecktopGroup(ep,ac)
local ac2=Duel.AnnounceNumber(tp,table.unpack(ct2))
Duel.ConfirmDecktop(1-tp,ac2)
ctg:Merge(Duel.GetDecktopGroup(tp,ac1))
ctg:Merge(Duel.GetDecktopGroup(1-tp,ac2))
end
local tc=ctg:FilterSelect(tp,Card.IsAbleToChangeControler,1,1,nil):GetFirst()
local tc=ctg:Select(tp,1,1,nil):GetFirst()
if Duel.Equip(tp,tc,c,true) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -27,8 +27,8 @@ function cm.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(cm.eqtg)
e3:SetOperation(cm.eqop)
......@@ -38,7 +38,7 @@ function cm.initial_effect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DISABLE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e4:SetTarget(cm.distg)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
......@@ -111,25 +111,30 @@ function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFieldGroupCount(ep,LOCATION_DECK,0)>0 and Duel.SelectEffectYesNo(tp,c) then
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>0 and Duel.SelectEffectYesNo(tp,c) then
Duel.Hint(HINT_CARD,0,m)
c:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1,0,0)
local ct={}
local ct1,ct2={},{}
local ctg=Group.CreateGroup()
for i=7,1,-1 do
if Duel.GetFieldGroupCount(ep,LOCATION_DECK,0)>=i then
table.insert(ct,i)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=i then
table.insert(ct1,i)
end
if Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>=i then
table.insert(ct2,i)
end
end
if #ct==1 then
Duel.ConfirmDecktop(ep,ct[1])
else
if #ct1~=0 or #ct2~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local ac1=Duel.AnnounceNumber(tp,table.unpack(ct1))
Duel.ConfirmDecktop(tp,ac1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local ac=Duel.AnnounceNumber(tp,table.unpack(ct))
Duel.ConfirmDecktop(ep,ac)
ctg=Duel.GetDecktopGroup(ep,ac)
local ac2=Duel.AnnounceNumber(tp,table.unpack(ct2))
Duel.ConfirmDecktop(1-tp,ac2)
ctg:Merge(Duel.GetDecktopGroup(tp,ac1))
ctg:Merge(Duel.GetDecktopGroup(1-tp,ac2))
end
local tc=ctg:FilterSelect(tp,Card.IsAbleToChangeControler,1,1,nil):GetFirst()
local tc=ctg:Select(tp,1,1,nil):GetFirst()
if Duel.Equip(tp,tc,c,true) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -166,21 +171,21 @@ end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function cm.gyeqf(c)
return c:IsControlerCanBeChanged()
function cm.gyeqfilter(c,tp)
return c:IsControlerCanBeChanged() or c:IsControler(tp)
end
function cm.gyeqcon(e,tp,eg,ep,ev,re,r,rp)
return eg and eg:IsExists(aux.NecroValleyFilter(aux.TRUE),1,nil)
return eg and eg:IsExists(aux.NecroValleyFilter(cm.gyeqfilter),1,nil,tp)
end
function cm.gyeqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and not c:IsStatus(STATUS_BATTLE_DESTROYED) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,eg,1,0,0)
end
function cm.gyeqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SelectEffectYesNo(tp,c) then
Duel.Hint(HINT_CARD,0,m)
local tc=eg:FilterSelect(tp,Card.IsAbleToChangeControler,1,1,nil):GetFirst()
local tc=eg:FilterSelect(tp,cm.gyeqfilter,1,1,nil,tp):GetFirst()
if Duel.Equip(tp,tc,c,true) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -27,7 +27,7 @@ function cm.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(cm.eqtg)
......@@ -38,7 +38,7 @@ function cm.initial_effect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DISABLE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e4:SetTarget(cm.distg)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
......@@ -111,25 +111,30 @@ function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFieldGroupCount(ep,LOCATION_DECK,0)>0 and Duel.SelectEffectYesNo(tp,c) then
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>0 and Duel.SelectEffectYesNo(tp,c) then
Duel.Hint(HINT_CARD,0,m)
c:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1,0,0)
local ct={}
local ct1,ct2={},{}
local ctg=Group.CreateGroup()
for i=9,1,-1 do
if Duel.GetFieldGroupCount(ep,LOCATION_DECK,0)>=i then
table.insert(ct,i)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=i then
table.insert(ct1,i)
end
if Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>=i then
table.insert(ct2,i)
end
end
if #ct==1 then
Duel.ConfirmDecktop(ep,ct[1])
else
if #ct1~=0 or #ct2~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local ac1=Duel.AnnounceNumber(tp,table.unpack(ct1))
Duel.ConfirmDecktop(tp,ac1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local ac=Duel.AnnounceNumber(tp,table.unpack(ct))
Duel.ConfirmDecktop(ep,ac)
ctg=Duel.GetDecktopGroup(ep,ac)
local ac2=Duel.AnnounceNumber(tp,table.unpack(ct2))
Duel.ConfirmDecktop(1-tp,ac2)
ctg:Merge(Duel.GetDecktopGroup(tp,ac1))
ctg:Merge(Duel.GetDecktopGroup(1-tp,ac2))
end
local tc=ctg:FilterSelect(tp,Card.IsAbleToChangeControler,1,1,nil):GetFirst()
local tc=ctg:Select(tp,1,1,nil):GetFirst()
if Duel.Equip(tp,tc,c,true) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -166,21 +171,21 @@ end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function cm.gyeqf(c)
return c:IsControlerCanBeChanged()
function cm.gyeqfilter(c,tp)
return c:IsControlerCanBeChanged() or c:IsControler(tp)
end
function cm.gyeqcon(e,tp,eg,ep,ev,re,r,rp)
return eg and eg:IsExists(aux.NecroValleyFilter(aux.TRUE),1,nil)
return eg and eg:IsExists(aux.NecroValleyFilter(cm.gyeqfilter),1,nil,tp)
end
function cm.gyeqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and not c:IsStatus(STATUS_BATTLE_DESTROYED) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,eg,1,0,0)
end
function cm.gyeqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SelectEffectYesNo(tp,c) then
Duel.Hint(HINT_CARD,0,m)
local tc=eg:FilterSelect(tp,Card.IsAbleToChangeControler,1,1,nil):GetFirst()
local tc=eg:FilterSelect(tp,cm.gyeqfilter,1,1,nil,tp):GetFirst()
if Duel.Equip(tp,tc,c,true) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -27,8 +27,8 @@ function cm.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(cm.eqtg)
e3:SetOperation(cm.eqop)
......@@ -38,7 +38,7 @@ function cm.initial_effect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DISABLE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e4:SetTarget(cm.distg)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
......@@ -64,6 +64,16 @@ function cm.initial_effect(c)
e6:SetCondition(cm.epcon)
e6:SetOperation(cm.epop)
c:RegisterEffect(e6)
--draw count
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetCode(EFFECT_DRAW_COUNT)
e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e7:SetRange(LOCATION_MZONE)
e7:SetTargetRange(1,1)
e7:SetCondition(cm.drcon)
e7:SetValue(0)
c:RegisterEffect(e7)
end
cm.lvup={14000204,14000206}
cm.lvdn={14000200,14000201,14000202,14000203,14000204}
......@@ -104,14 +114,17 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.ctfilter(c,tp)
return c:IsControler(tp) or c:IsAbleToChangeControler()
end
function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and re:GetHandler()~=c and c:GetFlagEffect(m)<5 and not c:IsStatus(STATUS_BATTLE_DESTROYED) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,eg,1,0,0)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(Card.IsControlerCanBeChanged,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_EXTRA,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_EXTRA,c)
local tg=Duel.GetMatchingGroup(cm.ctfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_EXTRA,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_EXTRA,c,tp)
if #tg>0 and Duel.SelectEffectYesNo(tp,c) then
Duel.Hint(HINT_CARD,0,m)
c:RegisterFlagEffect(m,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1,0,0)
......@@ -177,4 +190,8 @@ function cm.epop(e,tp,eg,ep,ev,re,r,rp)
if dg3 and #dg3>0 then
Duel.SendtoGrave(dg3,REASON_RULE)
end
end
function cm.drcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 or Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)==0
end
\ No newline at end of file
......@@ -14,7 +14,7 @@ function cm.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(cm.mtcon)
......@@ -43,7 +43,7 @@ function cm.splimit(e,se,sp,st)
return Duel.GetFlagEffect(tp,14000205)>0
end
function cm.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
return Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_END
end
function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
local WIN_REASON_WORLDEATER=0x24
......
......@@ -13,8 +13,8 @@ function cm.initial_effect(c)
e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_TUNER))
c:RegisterEffect(e1)
local e3=e1:Clone()
e1:SetCode(EFFECT_EXTRA_SET_COUNT)
c:RegisterEffect(e1)
e3:SetCode(EFFECT_EXTRA_SET_COUNT)
c:RegisterEffect(e3)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
......
......@@ -4,7 +4,7 @@ local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(,0))
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
......@@ -12,9 +12,9 @@ function cm.initial_effect(c)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--to hand
--disable
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(5043010,0))
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_NO_TURN_RESET)
e2:SetRange(LOCATION_MZONE)
......
......@@ -51,7 +51,7 @@ function c9910440.discost(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c9910440.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and aux.disfilter1(chkc) end
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and aux.disfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.disfilter1,tp,0,LOCATION_ONFIELD,1,1,nil)
......
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