Commit fad4061f authored by TanakaKotoha's avatar TanakaKotoha

lbw

parent 7079d436
No preview for this file type
......@@ -9,14 +9,25 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetCondition(cm.atkcon)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e12=Effect.CreateEffect(c)
e12:SetDescription(aux.Stringid(m,1))
e12:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetCode(EVENT_CHAINING)
e12:SetRange(LOCATION_HAND)
e12:SetCountLimit(1,m)
e12:SetCondition(cm.tgcon)
e12:SetCost(cm.cost)
e12:SetTarget(cm.target)
e12:SetOperation(cm.operation)
c:RegisterEffect(e12)
--disable special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
......@@ -40,6 +51,12 @@ function cm.initial_effect(c)
end)
c:RegisterEffect(e3)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHandAsCost,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tt=Duel.SelectMatchingCard(tp,Card.IsAbleToHandAsCost,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoHand(tt,nil,REASON_COST)
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget()
return Duel.GetAttacker():IsControler(1-tp) and at:IsControler(tp) and at:IsFaceup() and at:IsRace(RACE_SPELLCASTER)
......@@ -52,12 +69,6 @@ function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:IsExists(cm.cfilter,1,nil,tp)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHandAsCost,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tt=Duel.SelectMatchingCard(tp,Card.IsAbleToHandAsCost,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoHand(tt,nil,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return cm.thfilter(chkc,tp) end
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
......@@ -67,7 +78,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
c:AddCounter(0x1,1)
c:AddCounter(0x1,3)
end
end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -22,19 +22,19 @@ function cm.initial_effect(c)
e2:SetOperation(cm.drop)
c:RegisterEffect(e2)
end
function cm.filter(c)
function cm.filter(c,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_MONSTER) and not c:IsPublic() and Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK,0,1,nil,c:GetTextAttack(),c:GetTextDefense())
end
function cm.filter1(c,atk,def)
return c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:GetAttack()==atk and c:GetDefense()==def
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,tp)
if g:GetCount()>0 then
Duel.ConfirmCards(1-tp,g)
local tc=g:GetFirst()
......@@ -69,10 +69,14 @@ function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=2 then return end
local c=e:GetHandler()
Duel.SendtoDeck(tg+c,nil,2,REASON_EFFECT)
Duel.ShuffleDeck(tp)
Duel.SendtoDeck(tg+c,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==3 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -76,7 +76,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(0,LOCATION_ONFIELD)
e1:SetTargetRange(0,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_DECK+LOCATION_EXTRA+LOCATION_HAND)
e1:SetTarget(cm.distg)
e1:SetLabelObject(tc2)
e1:SetReset(RESET_PHASE+PHASE_END)
......@@ -105,7 +105,7 @@ function cm.distg(e,c)
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsOriginalCodeRule(tc:GetOriginalCodeRule())
return re:GetHandler():IsOriginalCodeRule(tc:GetOriginalCodeRule())
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
......
......@@ -52,7 +52,7 @@ function cm.recop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetCondition(cm.descon0)
e1:SetTarget(cm.descon0)
e1:SetOperation(cm.disop)
e1:SetLabel(e)
Duel.RegisterEffect(e1,tp)
......
......@@ -73,7 +73,7 @@ end
function cm.reccon4(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFlagEffect(e:GetHandlerPlayer(),m)
local tg=Duel.GetMatchingGroup(cm.atkfilter0,1-tp,LOCATION_MZONE,0,nil)
return tg>0 and ct>0
return #tg>0 and ct>0
end
function cm.remop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -23,7 +23,7 @@ function cm.initial_effect(c)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(cm.atktg1)
e3:SetOperation(cm.operation)
e3:SetOperation(cm.atkop1)
c:RegisterEffect(e3)
end
--
......
......@@ -25,6 +25,7 @@ function c81046011.initial_effect(c)
c:RegisterEffect(e2)
end
function c81046011.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
local cg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,nil)
return cg:GetCount()>7 and cg:GetClassCount(Card.GetCode)==cg:GetCount()
......
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