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

fix

parent 65897eec
...@@ -65,7 +65,7 @@ function cm.tdfilter(c) ...@@ -65,7 +65,7 @@ function cm.tdfilter(c)
return c:IsAbleToDeckAsCost() and tama.tamas_isExistElement(c,TAMA_ELEMENT_LIFE) return c:IsAbleToDeckAsCost() and tama.tamas_isExistElement(c,TAMA_ELEMENT_LIFE)
end end
function cm.spfilter(c,sg,e,tp) function cm.spfilter(c,sg,e,tp)
return c:IsType(TYPE_MONSTER) and tama.tamas_isExistElement(c,TAMA_ELEMENT_LIFE) and sg:GetSum(tamas_getElementCount,TAMA_ELEMENT_LIFE)>=tamas_getElementCount(c,TAMA_ELEMENT_LIFE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsType(TYPE_MONSTER) and tama.tamas_isExistElement(c,TAMA_ELEMENT_LIFE) and sg:GetSum(tama.tamas_getElementCount,TAMA_ELEMENT_LIFE)>=tama.tamas_getElementCount(c,TAMA_ELEMENT_LIFE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.spcost1(e,tp,eg,ep,ev,re,r,rp,chk) function cm.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
......
...@@ -69,10 +69,11 @@ end ...@@ -69,10 +69,11 @@ end
function cm.valop(e,tp,eg,ep,ev,re,r,rp) function cm.valop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsSummonType(SUMMON_TYPE_LINK) then return end if not c:IsSummonType(SUMMON_TYPE_LINK) then return end
local tc=c:GetMaterial():GetFirst()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK) e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(c:GetMaterial():GetFirst():GetAttack()) e1:SetValue(tc:GetPreviousAttackOnField())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
......
...@@ -48,12 +48,12 @@ function c29010014.ctfil(c) ...@@ -48,12 +48,12 @@ function c29010014.ctfil(c)
return c:IsSetCard(0x87af) and c:IsAbleToDeckAsCost() return c:IsSetCard(0x87af) and c:IsAbleToDeckAsCost()
end end
function c29010014.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c29010014.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29010014.ctfil,tp,LOCATION_GRAVE,0,2,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c29010014.ctfil,tp,LOCATION_GRAVE,0,2,e:GetHandler()) end
local g=Duel.SelectMatchingCard(tp,c29010014.ctfil,tp,LOCATION_GRAVE,0,2,2,nil) local g=Duel.SelectMatchingCard(tp,c29010014.ctfil,tp,LOCATION_GRAVE,0,2,2,e:GetHandler())
Duel.SendtoDeck(g,tp,2,REASON_COST) Duel.SendtoDeck(g,tp,2,REASON_COST)
end end
function c29010014.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c29010014.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,22702055) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_GRAVE)
end end
function c29010014.spop(e,tp,eg,ep,ev,re,r,rp) function c29010014.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -12,7 +12,7 @@ function c33401302.initial_effect(c) ...@@ -12,7 +12,7 @@ function c33401302.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,33401302) e2:SetCountLimit(1,33401302)
e2:SetCondition(c33401302.spcon) e2:SetCondition(c33401302.spcon)
e2:SetTarget(c33401302.sptg) e2:SetTarget(c33401302.sptg)
......
...@@ -31,28 +31,25 @@ function cm.seqcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -31,28 +31,25 @@ function cm.seqcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(e:GetHandler(),REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end end
function cm.chkfilter1(c,e,tp) function cm.chkfilter1(c,e,tp)
return (not c:IsSetCard(0xc342)) and c:IsSetCard(0x341) and c:IsType(TYPE_MONSTER) and Duel.IsPlayerCanSpecialSummon(tp,0,POS_FACEUP,1-tp,c) return (not c:IsSetCard(0xc342)) and c:IsSetCard(0x341) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
end end
function cm.chkfilter2(c,tp) function cm.chkfilter2(c,tp)
return c:IsSetCard(0x341) and c:IsType(TYPE_FIELD) and (c:IsAbleToHand() or c:GetActivateEffect():IsActivatable(tp)) return c:IsSetCard(0x341) and c:IsType(TYPE_FIELD) and (c:IsAbleToHand() or c:GetActivateEffect():IsActivatable(tp))
end end
function cm.seqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.seqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsOnField() end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_FZONE,0,1,nil,0x341) and Duel.IsExistingMatchingCard(cm.chkfilter1,tp,LOCATION_DECK+LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) and Duel.IsExistingMatchingCard(cm.chkfilter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingTarget(Card.IsSetCard,tp,LOCATION_FZONE,0,1,nil,0x341) and Duel.IsExistingMatchingCard(cm.chkfilter1,tp,LOCATION_DECK+LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) and Duel.IsExistingMatchingCard(cm.chkfilter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,nil,LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,nil,LOCATION_DECK+LOCATION_GRAVE)
end end
function cm.seqop(e,tp,eg,ep,ev,re,r,rp) function cm.seqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local sg=Duel.GetMatchingGroup(cm.chkfilter1,tp,LOCATION_DECK+LOCATION_GRAVE,LOCATION_GRAVE,nil,e,tp) local sg=Duel.GetMatchingGroup(cm.chkfilter1,tp,LOCATION_DECK+LOCATION_GRAVE,LOCATION_GRAVE,nil,e,tp)
if sg:GetCount()>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then if sg:GetCount()>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=sg:Select(tp,1,1,nil) local g1=sg:Select(tp,1,1,nil)
local tc1=g1:GetFirst() local tc1=g1:GetFirst()
Duel.SpecialSummon(tc1,0,tp,1-tp,false,false,POS_FACEUP) if Duel.SpecialSummonStep(tc1,0,tp,1-tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
...@@ -62,35 +59,38 @@ local c=e:GetHandler() ...@@ -62,35 +59,38 @@ local c=e:GetHandler()
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc1:RegisterEffect(e2) tc1:RegisterEffect(e2)
end if Duel.IsExistingMatchingCard(cm.chkfilter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) then
if Duel.IsExistingMatchingCard(cm.chkfilter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) then Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2))
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2)) local g=Duel.SelectMatchingCard(tp,cm.chkfilter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp)
local g=Duel.SelectMatchingCard(tp,cm.chkfilter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp) local tc=g:GetFirst()
local tc=g:GetFirst() if tc then
if tc then local te=tc:GetActivateEffect()
local te=tc:GetActivateEffect() local b1=tc:IsAbleToHand()
local b1=tc:IsAbleToHand() local b2=tc:GetActivateEffect():IsActivatable(tp)
local b2=tc:GetActivateEffect():IsActivatable(tp) if b1 and (not b2 or Duel.SelectOption(tp,1190,1150)==0) then
if b1 and (not b2 or Duel.SelectOption(tp,1190,1150)==0) then Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,tc)
Duel.ConfirmCards(1-tp,tc) else
else local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0) if fc then
if fc then Duel.SendtoGrave(fc,REASON_RULE)
Duel.SendtoGrave(fc,REASON_RULE) Duel.BreakEffect()
Duel.BreakEffect() end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then
cost(te,tep,eg,ep,ev,re,r,rp,1)
end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
end end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true) Duel.SpecialSummonComplete()
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end end
end end
end
end end
function cm.filter(c,e,tp,re) function cm.filter(c,e,tp,re)
return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) return c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsReason(REASON_EFFECT+REASON_BATTLE) and c:IsReason(REASON_EFFECT+REASON_BATTLE)
...@@ -110,5 +110,5 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -110,5 +110,5 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end end
\ No newline at end of file
...@@ -21,7 +21,7 @@ function cm.cfilter(c,tp) ...@@ -21,7 +21,7 @@ function cm.cfilter(c,tp)
return c:GetPreviousControler()==tp return c:GetPreviousControler()==tp
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp) and Duel.GetTurnPlayer()~=tp return not eg:IsExists(cm.cfilter,1,nil,tp) and Duel.GetTurnPlayer()~=tp
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -40,25 +40,26 @@ function c79029534.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -40,25 +40,26 @@ function c79029534.operation(e,tp,eg,ep,ev,re,r,rp)
if g:FilterCount(Card.IsAbleToRemove,nil)<=0 then return end if g:FilterCount(Card.IsAbleToRemove,nil)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,1,1,nil):GetFirst() local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,1,1,nil):GetFirst()
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) then if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) then
Duel.BreakEffect() Duel.BreakEffect()
local flag=0 local flag=0
if tc:IsType(TYPE_FUSION) then flag=bit.bor(flag,TYPE_FUSION) end if tc:IsType(TYPE_FUSION) then flag=bit.bor(flag,TYPE_FUSION) end
if tc:IsType(TYPE_SYNCHRO) then flag=bit.bor(flag,TYPE_SYNCHRO) end if tc:IsType(TYPE_SYNCHRO) then flag=bit.bor(flag,TYPE_SYNCHRO) end
if tc:IsType(TYPE_XYZ) then flag=bit.bor(flag,TYPE_XYZ) end if tc:IsType(TYPE_XYZ) then flag=bit.bor(flag,TYPE_XYZ) end
if tc:IsType(TYPE_PENDULUM) then flag=bit.bor(flag,TYPE_PENDULUM) end if tc:IsType(TYPE_PENDULUM) then flag=bit.bor(flag,TYPE_PENDULUM) end
if tc:IsType(TYPE_LINK) then flag=bit.bor(flag,TYPE_LINK) end if tc:IsType(TYPE_LINK) then flag=bit.bor(flag,TYPE_LINK) end
e:SetLabel(flag) e:SetLabel(flag)
local flag=e:GetLabel() local flag=e:GetLabel()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(0,LOCATION_MZONE) e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(c79029534.distg) e1:SetTarget(c79029534.distg)
e1:SetLabel(flag) e1:SetLabel(flag)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end
end end
function c79029534.distg(e,c) function c79029534.distg(e,c)
return c:IsType(e:GetLabel()) return c:IsType(e:GetLabel())
...@@ -87,5 +88,3 @@ function c79029534.dcop(e,tp,eg,ep,ev,re,r,rp) ...@@ -87,5 +88,3 @@ function c79029534.dcop(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(1) e2:SetValue(1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
...@@ -162,16 +162,16 @@ function cm.thcon2(e,tp,eg,ep,ev,re,r,rp) ...@@ -162,16 +162,16 @@ function cm.thcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp) return c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp)
end end
function cm.thfilter(c) function cm.thfilter2(c)
return c:IsSetCard(0xcc30) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() return c:IsSetCard(0xcc30) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end end
function cm.thtg2(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thtg2(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.thfilter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
function cm.thop2(e,tp,eg,ep,ev,re,r,rp) function cm.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) 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,cm.thfilter2,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
......
...@@ -36,7 +36,8 @@ function cm.initial_effect(c) ...@@ -36,7 +36,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c) local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK) e5:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
e5:SetType(EFFECT_TYPE_IGNITION) e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET) e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetRange(LOCATION_GRAVE) e5:SetRange(LOCATION_GRAVE)
e5:SetCountLimit(1,m+100000000) e5:SetCountLimit(1,m+100000000)
......
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