Commit fb7d75ae authored by Nemo Ma's avatar Nemo Ma

fix

parent f50c6a91
......@@ -3,13 +3,17 @@ function c10105510.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkAttribute,ATTRIBUTE_EARTH),2,2,c10105510.lcheck)
c:EnableReviveLimit()
--disable spsummon
--tohand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetDescription(aux.Stringid(10105510,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,10105510)
e1:SetCondition(c10105510.thcon)
e1:SetTarget(c10105510.thtg)
e1:SetOperation(c10105510.thop)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
......@@ -32,6 +36,24 @@ end
function c10105510.cfilter(c)
return c:IsSetCard(0x7ccd) and c:IsFaceup()
end
function c10105510.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c10105510.thfilter(c)
return c:IsSetCard(0x7ccd) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c10105510.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10105510.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c10105510.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c10105510.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c10105510.negcon(e,tp,eg,ep,ev,re,r,rp)
return aux.exccon(e) and Duel.IsExistingMatchingCard(c10105510.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
......
......@@ -14,6 +14,7 @@ function cm.initial_effect(c)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetValue(11451480)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
......@@ -43,7 +44,7 @@ function cm.check(e,tp,eg,ep,ev,re,r,rp)
local g2=Group.CreateGroup()
for tc in aux.Next(eg) do
local te=tc:GetReasonEffect()
if te and te:GetHandler():IsSetCard(0x97f) and tc:IsReason(REASON_EFFECT) then return end
if te and (te:GetHandler():IsSetCard(0x97f) or te:GetValue()==11451480) and tc:IsReason(REASON_EFFECT) then return end
if tc:GetReasonPlayer()==0 and tc:GetOwner()==0 then
g1:AddCard(tc)
elseif tc:GetReasonPlayer()==1 and tc:GetOwner()==1 then
......
......@@ -15,6 +15,7 @@ function cm.initial_effect(c)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetValue(11451480)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
......@@ -45,7 +46,7 @@ function cm.check(e,tp,eg,ep,ev,re,r,rp)
local g2=Group.CreateGroup()
for tc in aux.Next(eg) do
local te=tc:GetReasonEffect()
if te and te:GetHandler():IsSetCard(0x97f) and tc:IsReason(REASON_EFFECT) then return end
if te and (te:GetHandler():IsSetCard(0x97f) or te:GetValue()==11451480) and tc:IsReason(REASON_EFFECT) then return end
if tc:GetReasonPlayer()==0 and tc:GetControler()==0 then
g1:AddCard(tc)
elseif tc:GetReasonPlayer()==1 and tc:GetControler()==1 then
......
......@@ -14,6 +14,7 @@ function cm.initial_effect(c)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_EVENT_PLAYER)
e1:SetCode(EVENT_CHAINING)
e1:SetValue(11451480)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
......@@ -32,7 +33,7 @@ function cm.initial_effect(c)
end
cm.rkdn={11451579}
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not re:GetHandler():IsSetCard(0x97f)
return not re:GetHandler():IsSetCard(0x97f) and not re:GetValue()==11451480
end
function cm.filter(c,re)
return c:IsCanOverlay() and c:IsRelateToEffect(re)
......
......@@ -32,7 +32,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=math.floor(Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)/2)
local ct=math.ceil(Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)/2)
if ct<1 then return end
local g=Duel.GetDecktopGroup(tp,ct)
Duel.ConfirmCards(tp,g)
......
......@@ -130,7 +130,7 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
for i=1,Duel.GetCurrentChain() do
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
if tc:IsRelateToEffect(te) and tc:IsAbleToHand() then g:AddCard(tc) end
if tc:IsRelateToEffect(te) and tc:IsAbleToHand() and not (tc:IsLocation(LOCATION_HAND) or (tc:IsLocation(LOCATION_EXTRA) and tc:IsFacedown())) then g:AddCard(tc) end
end
return #g>0
end
......@@ -138,7 +138,7 @@ function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
for i=1,Duel.GetCurrentChain() do
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
if tc:IsRelateToEffect(te) and tc:IsAbleToHand() then g:AddCard(tc) end
if tc:IsRelateToEffect(te) and tc:IsAbleToHand() and not (tc:IsLocation(LOCATION_HAND) or (tc:IsLocation(LOCATION_EXTRA) and tc:IsFacedown())) then g:AddCard(tc) end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
......@@ -148,7 +148,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
while type(cm[i])=="table" do
local te,tf,cid=table.unpack(cm[i])
local tc=te:GetHandler()
if ((i<=Duel.GetCurrentChain() and tc:IsRelateToEffect(te)) or (i>Duel.GetCurrentChain() and tf and tc:GetRealFieldID()==cid)) and tc:IsAbleToHand() then g:AddCard(tc) end
if ((i<=Duel.GetCurrentChain() and tc:IsRelateToEffect(te)) or (i>Duel.GetCurrentChain() and tf and tc:GetRealFieldID()==cid)) and tc:IsAbleToHand() and not (tc:IsLocation(LOCATION_HAND) or (tc:IsLocation(LOCATION_EXTRA) and tc:IsFacedown())) then g:AddCard(tc) end
i=i+1
end
if #g>0 then
......
......@@ -7,7 +7,7 @@ function c13909436.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,13909436)
e1:SetCondition(c13909436.spcon)
......
......@@ -31,12 +31,12 @@ function cm.thfilter(c)
return c:IsSetCard(0x1cae) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsAttribute(ATTRIBUTE_LIGHT)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
......
......@@ -74,8 +74,8 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Release(g,REASON_COST)
end
function cm.indtg(e,c)
local dcount=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
return c:IsRace(RACE_WARRIOR) and c:IsLevelBelow(7) and (not c:IsLocation(LOCATION_DECK) or c:GetSequence()==dcount-1)
local dcount=Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_DECK,0)
return c:IsRace(RACE_WARRIOR) and c:IsLevelBelow(7) and (not c:IsLocation(LOCATION_DECK) or c:GetSequence()==dcount-1)
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
......@@ -108,4 +108,3 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
Duel.MoveSequence(tc,1)
end
end
......@@ -104,6 +104,6 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.MoveSequence(tg,0)
tg=rg:GetNext()
end
Duel.SortDecktop(tp,tp,rg)
Duel.SortDecktop(tp,tp,#rg)
end
end
......@@ -9,7 +9,7 @@ end
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(cm.condition)
......@@ -40,19 +40,23 @@ function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:SetCategory(CATEGORY_NEGATE)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_ONFIELD and re:GetHandler():IsRelateToEffect(re)
and not re:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then
e:SetCategory(CATEGORY_NEGATE+CATEGORY_TODECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,eg,1,0,0)
local rc=re:GetHandler()
if rc:IsRelateToEffect(re) and rc:IsOnField() then
local g=rc:GetColumnGroup()
g:AddCard(rc)
g=g:Filter(cm.tdfilter,nil,1-tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,#g,0,0)
end
end
function cm.gyfilter(c,g)
return g:IsContains(c)
function cm.tdfilter(c,tp)
return c:IsControler(tp) and c:IsAbleToDeck() and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_ONFIELD
and re:GetHandler():IsRelateToEffect(re) and not re:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then
local g=Duel.GetMatchingGroup(cm.gyfilter,tp,0,LOCATION_ONFIELD,nil,re:GetHandler():GetColumnGroup())
local rc=re:GetHandler()
if Duel.NegateActivation(ev) and rc:IsRelateToEffect(re) and rc:IsOnField() then
local g=rc:GetColumnGroup()
g:AddCard(rc)
g=g:Filter(cm.tdfilter,nil,1-tp)
Duel.BreakEffect()
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
......
......@@ -35,13 +35,10 @@ end
function cm.thfilter(c)
return cm.linkjoker(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.filter(c)
return c:IsFacedown() and c:IsType(TYPE_MONSTER)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
e:SetLabel(0)
if Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_ONFIELD,1,nil) then e:SetLabel(1) end
if Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_MZONE,1,nil) then e:SetLabel(1) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -61,7 +61,7 @@ function cm.rmcfilter(c)
return not c:IsType(TYPE_LINK)
end
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and Duel.IsExistingMatchingCard(cm.rmcfilter,c:GetControler(),0,LOCATION_EXTRA,1,nil)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and Duel.IsExistingMatchingCard(cm.rmcfilter,e:GetHandler():GetControler(),0,LOCATION_EXTRA,1,nil)
end
function cm.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_ATTACK) and not c:IsType(TYPE_LINK)
......
......@@ -51,7 +51,7 @@ function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and re:GetActivateLocation()==LOCATION_MZONE and Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,0,nil)==0
end
function cm.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsReleasableByEffect() and cm.Revenger(c) and c:IsCode(m)
return c:IsType(TYPE_MONSTER) and c:IsReleasableByEffect() and cm.Revenger(c) and not c:IsCode(m)
end
function cm.spfilter(c,e,tp)
return cm.Revenger(c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......@@ -92,7 +92,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==1 and gg:GetCount()>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local tc=sg:Select(tp,1,1,nil)
local tc=gg:Select(tp,1,1,nil)
if tc:IsRelateToEffect(e) then
Duel.GetControl(tc,tp,PHASE_END,1)
end
......
......@@ -105,7 +105,7 @@ function cm.repop(e,tp,eg,ep,ev,re,r,rp)
local dis=1<<tc:GetPreviousSequence()
if dis&SNNM.DisMZone(tp)>0 then return end
local zone=dis
if tp==1 then dis=((dis&0xffff)<<16)|((dis>>16)&0xffff) end
if tc:GetPreviousControler()==1 then dis=((dis&0xffff)<<16)|((dis>>16)&0xffff) end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE_FIELD)
......@@ -128,7 +128,7 @@ function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
if not tc or tc:GetFlagEffect(m)==0 then
e:Reset()
return false
else return Duel.CheckLocation(tp,LOCATION_MZONE,math.log(dis,2)) end
else return Duel.CheckLocation(tc:GetPreviousControler(),LOCATION_MZONE,math.log(dis,2)) end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
......
......@@ -7,6 +7,7 @@ function c60000004.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(c60000004.discon)
e1:SetCost(c60000004.discost)
e1:SetTarget(c60000004.distg)
......@@ -15,15 +16,14 @@ function c60000004.initial_effect(c)
end
function c60000004.discon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return ep~=tp and Duel.IsChainDisablable(ev) and loc==LOCATION_GRAVE
return ep~=tp and loc==LOCATION_GRAVE
end
function c60000004.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c60000004.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not re:GetHandler():IsStatus(STATUS_DISABLED) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
if chk==0 then return Duel.GetFlagEffect(tp,60000004)==0 end
end
function c60000004.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -37,4 +37,6 @@ function c60000004.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,60000004,RESET_PHASE+PHASE_END,0,0)
end
function c60000004.aclimit(e,re,tp)
return re:GetActivateLocation()==LOCATION_GRAVE
end
......@@ -8,7 +8,7 @@ function c67210101.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
--e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_HAND+LOCATION_EXTRA)
e2:SetCountLimit(1,67210101)
e2:SetCondition(c67210101.spcon)
......
......@@ -2,7 +2,7 @@
function c67210104.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
......
......@@ -55,7 +55,7 @@ function c67210107.op(e,tp,eg,ep,ev,re,r,rp)
end
--
function c67210107.pfilter(c)
return c:IsSetCard(0x67e) and c:IsAbleToHand()
return c:IsSetCard(0x67e) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function c67210107.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c67210107.pfilter,tp,LOCATION_DECK,0,1,nil) 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