Commit 24e414ff authored by TanakaKotoha's avatar TanakaKotoha

tnndx

parent 12a4e953
......@@ -32,7 +32,7 @@ function c21520129.initial_effect(c)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c21520129.condition)
e4:SetCost(c21520129.cost)
-- e4:SetCost(c21520129.cost)
e4:SetTarget(c21520129.target)
e4:SetOperation(c21520129.operation)
c:RegisterEffect(e4)
......@@ -53,7 +53,7 @@ end
function c21520129.condition(e,tp,eg,ep,ev,re,r,rp)
local sel=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
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
function c21520129.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCurrentPhase()==PHASE_MAIN1 end
......
......@@ -17,8 +17,8 @@ function cm.initial_effect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
......@@ -26,7 +26,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2)
end
function cm.gvfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAbleToGrave()
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
end
function cm.spfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAbleToHand() and c:IsLevelBelow(3)
......@@ -34,10 +34,10 @@ end
function cm.gvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
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
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_TOHAND,nil,1,tp,LOCATION_DECK)
end
......@@ -54,20 +54,19 @@ function cm.gvop(e,tp,eg,ep,ev,re,r,rp)
end
------
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)
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)
end
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 true end
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter0,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
end
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)
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)
end
end
\ No newline at end of file
......@@ -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)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAbleToHand() and c:IsLocation(LOCATION_GRAVE) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
......
......@@ -47,10 +47,10 @@ function cm.atkfilter(c)
return c:IsFaceup() and c:IsSummonType(SUMMON_TYPE_NORMAL)
end
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 chk==0 then return Duel.IsExistingTarget(cm.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) 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,0,1,nil) end
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
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
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