Commit cc38c59e authored by POLYMER's avatar POLYMER

fix

parent f9accda4
......@@ -19,6 +19,7 @@ function cm.initial_effect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m+1)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
......
......@@ -43,26 +43,25 @@ function cm.initial_effect(c)
c:RegisterEffect(e3)
end
function cm.srcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.fit1,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.fit1,tp,LOCATION_HAND,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,cm.fit1,tp,LOCATION_HAND,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,cm.fit1,tp,LOCATION_HAND,0,1,1,nil,tp)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
e:SetLabel(g:GetFirst():GetAttribute())
end
function cm.fit1(c,tp)
return not c:IsPublic() and Duel.IsExistingMatchingCard(cm.fit2,tp,LOCATION_DECK,0,1,nil,c:GetAttribute())
return not c:IsPublic() and c:IsType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(cm.fit2,tp,LOCATION_DECK,0,1,nil,c:GetAttribute())
end
function cm.fit2(c,attr)
return c:IsAttribute() and c:IsAbleToHand() and c:IsSetCard(0xa450)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(attr) and c:IsAbleToHand() and c:IsSetCard(0xa450)
end
function cm.srfilter(c,att)
return c:IsSetCard(0xa450) and c:IsAttribute(att) and c:IsAbleToHand()
end
function cm.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
local attr=e:GetLabel()
if chk==0 then
return Duel.IsExistingMatchingCard(cm.fit2,tp,LOCATION_DECK,0,1,nil,attr)
return true
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......@@ -70,7 +69,7 @@ function cm.fit(c)
return (c:IsAbleToGrave() or c:IsAbleToRemove())
end
function cm.srop(e,tp,eg,ep,ev,re,r,rp)
local att=e:GetLabel()
local attr=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,cm.srfilter,tp,LOCATION_DECK,0,1,1,nil,attr)
if #sg>0 and Duel.SendtoHand(sg,nil,REASON_EFFECT)>0 then
......@@ -79,7 +78,7 @@ function cm.srop(e,tp,eg,ep,ev,re,r,rp)
if #dg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tg=dg:Select(tp,1,1,nil)
local tc=g:GetFirst()
local tc=tg:GetFirst()
if tc and tc:IsAbleToGrave() and (not tc:IsAbleToRemove() or Duel.SelectOption(tp,1191,1192)==0) then
Duel.SendtoGrave(tc,REASON_EFFECT)
else
......
......@@ -26,6 +26,7 @@ function cm.initial_effect(c)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.negcon1)
e3:SetCost(cm.negcost)
e3:SetTarget(cm.negtg1)
......@@ -38,6 +39,7 @@ function cm.initial_effect(c)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m)
e4:SetCondition(cm.negcon2)
e4:SetCost(cm.negcost)
e4:SetTarget(cm.negtg2)
......@@ -50,6 +52,7 @@ function cm.initial_effect(c)
e5:SetCode(EVENT_CHAINING)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,m)
e5:SetCondition(cm.negcon3)
e5:SetCost(cm.negcost)
e5:SetTarget(cm.negtg3)
......@@ -61,7 +64,7 @@ function cm.initial_effect(c)
e6:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_GRAVE)
e6:SetCountLimit(1,m)
e6:SetCountLimit(1,m+1)
e6:SetCost(cm.adcost)
e6:SetTarget(cm.adtg)
e6:SetOperation(cm.adop)
......
......@@ -25,6 +25,7 @@ function cm.initial_effect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.syncon1)
e3:SetTarget(cm.syntg)
e3:SetOperation(cm.synop)
......@@ -36,6 +37,7 @@ function cm.initial_effect(c)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cm.descon)
e4:SetCountLimit(1,m)
e4:SetTarget(cm.destg)
e4:SetOperation(cm.desop)
c:RegisterEffect(e4)
......@@ -53,7 +55,7 @@ function cm.initial_effect(c)
e6:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_GRAVE)
e6:SetCountLimit(1,m)
e6:SetCountLimit(1,m+1)
e6:SetCost(cm.thcost)
e6:SetTarget(cm.thtg)
e6:SetOperation(cm.thop)
......
......@@ -30,8 +30,7 @@ function cm.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.thcon1)
e3:SetTarget(cm.thtg1)
......@@ -43,6 +42,7 @@ function cm.initial_effect(c)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m)
e4:SetCondition(cm.thcon2)
e4:SetTarget(cm.thtg2)
e4:SetOperation(cm.thop2)
......@@ -53,6 +53,7 @@ function cm.initial_effect(c)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,m)
e5:SetCondition(cm.rmcon)
e5:SetTarget(cm.rmtg)
e5:SetOperation(cm.rmop)
......@@ -63,7 +64,7 @@ function cm.initial_effect(c)
e6:SetCategory(CATEGORY_TOGRAVE)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_GRAVE)
e6:SetCountLimit(1,m)
e6:SetCountLimit(1,m+1)
e6:SetCost(cm.gvcost)
e6:SetTarget(cm.gvtg)
e6:SetOperation(cm.gvop)
......@@ -147,7 +148,7 @@ function cm.thcon2(e,tp,eg,ep,ev,re,r,rp)
return c:IsAttackAbove(2000) and Duel.GetTurnPlayer()==1-tp
end
function cm.thfilter2(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsAbleToHand()
return c:IsAbleToHand()
end
function cm.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
......@@ -163,33 +164,27 @@ function cm.thop2(e,tp,eg,ep,ev,re,r,rp)
end
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsAttackAbove(3000) and (Duel.GetTurnPlayer()==tp or Duel.GetTurnPlayer()==1-tp)
and not c:IsHasEffect(EFFECT_CANNOT_USE_AS_COST)
return c:IsAttackAbove(3000)
and e:GetHandler():GetFlagEffect(m)==0
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_EXTRA)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
if g:GetCount()==0 then return end
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:FilterSelect(tp,Card.IsAbleToRemove,1,1,nil)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
Duel.ShuffleExtra(1-tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_USE_AS_COST)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.costlimit)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
function cm.costlimit(e,re,tp)
return re:GetHandler()==e:GetHandler() and re:IsHasType(EFFECT_TYPE_ACTIVATE)
if c:IsRelateToEffect(e) then
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
end
end
function cm.gvcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
......
......@@ -115,8 +115,11 @@ function cm.descon(e, tp, eg, ep, ev, re, r, rp)
end
function cm.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 end
local c = e:GetHandler()
if chk == 0 then
return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and
c:IsCanBeSpecialSummoned(e, 0, tp, false, false)
end
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, c, 1, 0, 0)
end
......
This diff is collapsed.
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