Commit 24e414ff authored by TanakaKotoha's avatar TanakaKotoha

tnndx

parent 12a4e953
...@@ -32,7 +32,7 @@ function c21520129.initial_effect(c) ...@@ -32,7 +32,7 @@ function c21520129.initial_effect(c)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1) e4:SetCountLimit(1)
e4:SetCondition(c21520129.condition) e4:SetCondition(c21520129.condition)
e4:SetCost(c21520129.cost) -- e4:SetCost(c21520129.cost)
e4:SetTarget(c21520129.target) e4:SetTarget(c21520129.target)
e4:SetOperation(c21520129.operation) e4:SetOperation(c21520129.operation)
c:RegisterEffect(e4) c:RegisterEffect(e4)
...@@ -53,7 +53,7 @@ end ...@@ -53,7 +53,7 @@ end
function c21520129.condition(e,tp,eg,ep,ev,re,r,rp) function c21520129.condition(e,tp,eg,ep,ev,re,r,rp)
local sel=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) local sel=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
local opp=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND) local opp=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
return sel>opp and Duel.GetActivityCount(tp,ACTIVITY_BATTLE_PHASE)==0 return sel>opp --and Duel.GetActivityCount(tp,ACTIVITY_BATTLE_PHASE)==0
end end
function c21520129.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c21520129.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCurrentPhase()==PHASE_MAIN1 end if chk==0 then return Duel.GetCurrentPhase()==PHASE_MAIN1 end
......
...@@ -17,8 +17,8 @@ function cm.initial_effect(c) ...@@ -17,8 +17,8 @@ function cm.initial_effect(c)
e2:SetDescription(aux.Stringid(m,1)) e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_TO_GRAVE) e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m+1) e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.spcon) e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg) e2:SetTarget(cm.sptg)
...@@ -26,7 +26,7 @@ function cm.initial_effect(c) ...@@ -26,7 +26,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.gvfilter(c) function cm.gvfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAbleToGrave() return c:IsFaceup() and c:IsRace(RACE_MACHINE)
end end
function cm.spfilter(c) function cm.spfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAbleToHand() and c:IsLevelBelow(3) return c:IsRace(RACE_MACHINE) and c:IsAbleToHand() and c:IsLevelBelow(3)
...@@ -34,10 +34,10 @@ end ...@@ -34,10 +34,10 @@ end
function cm.gvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.gvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.gvfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.gvfilter(chkc) end
if chk==0 then return ft>-1 and Duel.IsExistingTarget(cm.gvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) if chk==0 then return ft>-1 and Duel.IsExistingTarget(cm.gvfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil) end and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,cm.gvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,cm.gvfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
...@@ -54,20 +54,19 @@ function cm.gvop(e,tp,eg,ep,ev,re,r,rp) ...@@ -54,20 +54,19 @@ function cm.gvop(e,tp,eg,ep,ev,re,r,rp)
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 e:GetHandler():IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_MONSTER) return e:GetHandler():IsReason(REASON_COST) and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_MONSTER)
and re:GetHandler():IsAttribute(ATTRIBUTE_DARK) and re:GetHandler():IsAttribute(ATTRIBUTE_DARK)
end end
function cm.spfilter(c,e,tp) function cm.spfilter0(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsLevelBelow(3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsRace(RACE_MACHINE) and c:IsLevelBelow(3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.spfilter(chkc,e,tp) end if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter0,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
if chk==0 then return true end
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil) then if Duel.IsExistingMatchingCard(cm.spfilter0,tp,LOCATION_GRAVE,0,1,nil,e,tp) then
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) local g=Duel.SelectMatchingCard(tp,cm.spfilter0,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
end end
\ No newline at end of file
...@@ -40,6 +40,7 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -40,6 +40,7 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_ONFIELD)
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAbleToHand() and c:IsLocation(LOCATION_GRAVE) then if c:IsAbleToHand() and c:IsLocation(LOCATION_GRAVE) then
Duel.SendtoHand(c,nil,REASON_EFFECT) Duel.SendtoHand(c,nil,REASON_EFFECT)
end end
......
...@@ -47,10 +47,10 @@ function cm.atkfilter(c) ...@@ -47,10 +47,10 @@ function cm.atkfilter(c)
return c:IsFaceup() and c:IsSummonType(SUMMON_TYPE_NORMAL) return c:IsFaceup() and c:IsSummonType(SUMMON_TYPE_NORMAL)
end end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.atkfilter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.atkfilter(chkc) and c:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(cm.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(cm.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local g=Duel.SelectTarget(tp,cm.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,cm.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp) function cm.atkop(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