Commit 8a937806 authored by Nemo Ma's avatar Nemo Ma

fix

parent 754920d3
This diff is collapsed.
...@@ -118,7 +118,7 @@ function cm.operation0(e,tp,eg,ep,ev,re,r,rp) ...@@ -118,7 +118,7 @@ function cm.operation0(e,tp,eg,ep,ev,re,r,rp)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetRange(LOCATION_FZONE) e1:SetRange(LOCATION_FZONE)
e1:SetOperation(cm.tgop) e1:SetOperation(cm.tgop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,4) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:SetTurnCounter(0) c:SetTurnCounter(0)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
......
...@@ -18,11 +18,18 @@ function cm.initial_effect(c) ...@@ -18,11 +18,18 @@ function cm.initial_effect(c)
e2:SetCondition(cm.thcon) e2:SetCondition(cm.thcon)
e2:SetOperation(cm.thop) e2:SetOperation(cm.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_SPSUMMON_PROC_G)
e5:SetRange(LOCATION_DECK)
e5:SetCondition(cm.thcon)
c:RegisterEffect(e5)
end end
function cm.filter(c) function cm.filter(c)
return c:IsAbleToDeckAsCost() and not c:IsCode(m) return c:IsAbleToDeckAsCost() and not c:IsCode(m)
end end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp) function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
return Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and e:GetHandler():IsAbleToHand() and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) return Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and e:GetHandler():IsAbleToHand() and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -14,10 +14,16 @@ function cm.initial_effect(c) ...@@ -14,10 +14,16 @@ function cm.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCountLimit(1,m) e2:SetCountLimit(1,m)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_DECK) e2:SetRange(LOCATION_DECK+LOCATION_HAND)
e2:SetCondition(cm.thcon) e2:SetCondition(cm.thcon)
e2:SetOperation(cm.thop) e2:SetOperation(cm.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_SPSUMMON_PROC_G)
e5:SetRange(LOCATION_DECK)
e5:SetCondition(cm.thcon)
c:RegisterEffect(e5)
end end
function cm.filter(c) function cm.filter(c)
return c:IsAbleToDeckAsCost() return c:IsAbleToDeckAsCost()
...@@ -25,13 +31,22 @@ end ...@@ -25,13 +31,22 @@ end
function cm.filter2(c) function cm.filter2(c)
return c:IsAbleToHand() and c:IsCode(m) return c:IsAbleToHand() and c:IsCode(m)
end end
function cm.fselect(g)
return g:IsExists(Card.IsCode,1,nil,m)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp) function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and e:GetHandler():IsAbleToHand() and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) local tp=e:GetHandlerPlayer()
return Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()==0 and (e:GetHandler():IsAbleToHand() or (e:GetHandler():IsLocation(LOCATION_HAND) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil))) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,2,2,nil) local g=Group.CreateGroup()
Duel.ConfirmCards(1-tp,g) if Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK,0,1,nil) then
g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,2,2,nil)
else
local sg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_HAND,0,nil)
g=sg:SelectSubGroup(tp,cm.fselect,false,2,2)
end
if Duel.SendtoDeck(g,nil,2,REASON_COST)>0 then if Duel.SendtoDeck(g,nil,2,REASON_COST)>0 then
local tg=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_DECK,0,1,2,nil) local tg=Duel.SelectMatchingCard(tp,cm.filter2,tp,LOCATION_DECK,0,1,2,nil)
Duel.SendtoHand(tg,nil,REASON_RULE) Duel.SendtoHand(tg,nil,REASON_RULE)
......
...@@ -46,6 +46,6 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -46,6 +46,6 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m) e1:SetCode(EVENT_CUSTOM+m)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) local g=eg:Filter(cm.filter,1,nil) Duel.SendtoDeck(g,nil,2,REASON_RULE) end) e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) local g=eg:Filter(cm.filter,1,nil,e) Duel.SendtoDeck(g,nil,2,REASON_RULE) end)
Duel.RegisterEffect(e1,0) Duel.RegisterEffect(e1,0)
end end
\ No newline at end of file
...@@ -78,7 +78,7 @@ function c22348084.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -78,7 +78,7 @@ function c22348084.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EFFECT_CHANGE_CODE) e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(22348080) e1:SetValue(22348080)
e1:SetReset(RESET_PHASE+RESETS_STANDARD+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
tc=g:GetNext() tc=g:GetNext()
end end
......
...@@ -45,7 +45,7 @@ function c22348123.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,7 +45,7 @@ function c22348123.spop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(22348123,2)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(22348123,2))
local g=Duel.SelectMatchingCard(tp,c22348123.rfilter,tp,LOCATION_REMOVED,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c22348123.rfilter,tp,LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT+REASON_RETURN)>0 then if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT+REASON_RETURN)>0 then
Duel.BreakEffect() Duel.BreakEffect()
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
...@@ -55,7 +55,7 @@ function c22348123.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,7 +55,7 @@ function c22348123.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetTargetRange(1,1) e1:SetTargetRange(1,1)
e1:SetValue(1) e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
end end
end end
...@@ -71,6 +71,7 @@ function c22348123.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -71,6 +71,7 @@ function c22348123.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return tc and tc:IsFaceup() and tc:IsAbleToGrave() and tc:IsCanBeEffectTarget(e) if chk==0 then return tc and tc:IsFaceup() and tc:IsAbleToGrave() and tc:IsCanBeEffectTarget(e)
and Duel.IsExistingMatchingCard(c22348123.filter,tp,LOCATION_DECK,0,1,nil,tp,tc:GetCode()) end and Duel.IsExistingMatchingCard(c22348123.filter,tp,LOCATION_DECK,0,1,nil,tp,tc:GetCode()) end
Duel.SetTargetCard(tc) Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,0,1,0,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,tc,1,0,0)
end end
function c22348123.operation(e,tp,eg,ep,ev,re,r,rp) function c22348123.operation(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -22,9 +22,9 @@ function s.initial_effect(c) ...@@ -22,9 +22,9 @@ function s.initial_effect(c)
--effect gain --effect gain
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE) e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_SET_AVAILABLE)
e5:SetCode(EVENT_ADJUST) e5:SetCode(EVENT_ADJUST)
e5:SetRange(LOCATION_MZONE) e5:SetRange(0xff)
e5:SetOperation(s.effop) e5:SetOperation(s.effop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
end end
...@@ -82,14 +82,14 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp) ...@@ -82,14 +82,14 @@ function s.effop(e,tp,eg,ep,ev,re,r,rp)
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0) local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
local c=e:GetHandler() local c=e:GetHandler()
if not fc or fc:IsFacedown() or not fc:IsSetCard(0xe2) then return false end if not fc or fc:IsFacedown() or not fc:IsSetCard(0xe2) then return false end
if c:IsDisabled() and s.check[c] and #s.check[c]>0 then if (not c:IsLocation(LOCATION_MZONE) or c:IsFacedown() or c:IsDisabled()) and s.check[c] and #s.check[c]>0 then
local exg=Group.CreateGroup() local exg=Group.CreateGroup()
for tc,cid in pairs(s.check[c]) do for tc,cid in pairs(s.check[c]) do
if tc and cid then fc:ResetEffect(s.check[c][tc],RESET_COPY) end if tc and cid then fc:ResetEffect(s.check[c][tc],RESET_COPY) end
end end
s.check[c]={} s.check[c]={}
end end
if c:IsDisabled() then return false end if (not c:IsLocation(LOCATION_MZONE) or c:IsFacedown() or c:IsDisabled()) then return false end
if not e:GetLabelObject() or e:GetLabelObject()~=fc then if not e:GetLabelObject() or e:GetLabelObject()~=fc then
s.check[c]={} s.check[c]={}
e:SetLabelObject(fc) e:SetLabelObject(fc)
......
...@@ -14,7 +14,6 @@ function c91030001.initial_effect(c) ...@@ -14,7 +14,6 @@ function c91030001.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetCondition(cm.con)
e1:SetTarget(cm.atttg) e1:SetTarget(cm.atttg)
e1:SetOperation(cm.attop) e1:SetOperation(cm.attop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
...@@ -40,7 +39,10 @@ function cm.lcheck(c) ...@@ -40,7 +39,10 @@ function cm.lcheck(c)
end end
--e2 --e2
function cm.con(e) function cm.con(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_EXTRA,0)==0 return Duel.GetCustomActivityCount(91030001,tp,ACTIVITY_SPSUMMON)==0
end
function cm.attfilter(c)
return c:IsFaceup() and not c:IsRace(RACE_MACHINE)
end end
function cm.atttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.atttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.attfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.attfilter(chkc) end
...@@ -58,9 +60,20 @@ function cm.attop(e,tp,eg,ep,ev,re,r,rp) ...@@ -58,9 +60,20 @@ function cm.attop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(cm.damval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.damval(e,re,val,r,rp,rc)
return math.floor(val/2)
end end
function cm.cpfilter(c) function cm.cpfilter(c)
return (c:GetType()==TYPE_SPELL) and (c:IsSetCard(0x1093)or c:IsCode(3659803)or c:IsCode(37630732)) and c:IsAbleToGraveAsCost() return (c:GetType()==TYPE_SPELL) and (c:IsSetCard(0x93)or c:IsCode(3659803)or c:IsCode(37630732)) and c:IsAbleToGraveAsCost()
and c:CheckActivateEffect(true,true,false)~=nil and c:CheckActivateEffect(true,true,false)~=nil
end end
function cm.cpcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -47,7 +47,7 @@ function c98920107.posfilter(c) ...@@ -47,7 +47,7 @@ function c98920107.posfilter(c)
return c:IsFaceup() and c:IsCanChangePosition() return c:IsFaceup() and c:IsCanChangePosition()
end end
function c98920107.postg(e,tp,eg,ep,ev,re,r,rp,chk) function c98920107.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c98920107.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end if chk==0 then return true end
local g=Duel.GetMatchingGroup(c98920107.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler()) local g=Duel.GetMatchingGroup(c98920107.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end end
......
...@@ -59,10 +59,10 @@ function c98920315.filter(c) ...@@ -59,10 +59,10 @@ function c98920315.filter(c)
return c:IsSetCard(0x119) and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x119) and c:IsType(TYPE_MONSTER)
end end
function c98920315.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function c98920315.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c98920315.filter,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(c98920315.cfilter,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
end end
function c98920315.cfilter(c,tc) function c98920315.cfilter(c,tc)
return c:IsType(TYPE_LINK) and not c:IsCode(tc:GetLinkCode()) return c:IsSetCard(0x119) and not c:IsCode(tc:GetCode())
end end
function c98920315.tgop(e,tp,eg,ep,ev,re,r,rp) function c98920315.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
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