Commit 7079d436 authored by TanakaKotoha's avatar TanakaKotoha

lbw

parent aa6ab354
No preview for this file type
......@@ -102,7 +102,7 @@ function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function cm.thfilter(c,tp)
......
......@@ -36,10 +36,10 @@ function cm.initial_effect(c)
c:RegisterEffect(e2)
end
function cm.thfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3fad) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function cm.thfilter1(c)
return c:IsSetCard(0x3fad) and c:IsAbleToHand()
return c:IsSetCard(0x3fad) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_EXTRA,0,1,nil) or ( not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_EXTRA,0,1,nil) and Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_DECK,0,1,nil) ) end
......
......@@ -3,7 +3,8 @@ local m=12045012
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.EnablePendulumAttribute(c)
c:EnableCounterPermit(0x1)
--Pendulum Summon
c:EnableCounterPermit(0x1,LOCATION_PZONE+LOCATION_MZONE)
--destroy & summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
......
......@@ -47,6 +47,9 @@ function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetCategory(CATEGORY_TOEXTRA)
end
end
function cm.filter1(c)
return c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_PENDULUM)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
......
......@@ -16,7 +16,7 @@ function cm.initial_effect(c)
e1:SetCondition(cm.atkcon)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
c:RegisterEffect(e1)
--disable special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
......@@ -26,7 +26,7 @@ function cm.initial_effect(c)
e2:SetCost(cm.discost)
e2:SetTarget(cm.distg)
e2:SetOperation(cm.disop)
c:RegisterEffect(e2)
c:RegisterEffect(e2)
--inactivatable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
......@@ -36,7 +36,7 @@ function cm.initial_effect(c)
function(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
return te:IsActiveType(TYPE_MONSTER) and c:GetCounter(0x1)>0 and tc:IsLocation(LOCATION_ONFIELD) )
return te:IsActiveType(TYPE_MONSTER) and e:GetHandler():GetCounter(0x1)>0 and tc:IsLocation(LOCATION_ONFIELD)
end)
c:RegisterEffect(e3)
end
......@@ -76,11 +76,13 @@ function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoHand(e:GetHandler(),nil,REASON_COST)
e:GetLabel(tt)
end
function cm.filter(c)
return c:IsCanAddCounter(0x1,1)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()==0 then return end
local tc=g:GetFirst()
......
......@@ -28,7 +28,6 @@ function cm.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.thcon)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
......@@ -68,9 +67,6 @@ function cm.actop(e,tp,eg,ep,ev,re,r,rp)
c:AddCounter(0x1,lv)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.thfilter(c)
return c:IsSetCard(0x3fad) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
......
......@@ -30,7 +30,7 @@ function cm.initial_effect(c)
e3:SetCondition(cm.thcon1)
e3:SetTarget(cm.thtg1)
e3:SetOperation(cm.thop1)
c:RegisterEffect(e1)
c:RegisterEffect(e3)
--counter2
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
......@@ -74,7 +74,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
c:AddCounter(0x1,ct)
end
end
function cm.cfilter(c,ec)
function cm.cfilter1(c,ec)
if not c:IsRace(RACE_SPELLCASTER) then return false end
if c:IsLocation(LOCATION_MZONE) then
return ec:GetLinkedGroup():IsContains(c)
......@@ -83,7 +83,7 @@ function cm.cfilter(c,ec)
end
end
function cm.thcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,e:GetHandler())
return eg:IsExists(cm.cfilter1,1,nil,e:GetHandler())
end
function cm.filter(c)
return c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_PENDULUM)
......
......@@ -49,8 +49,8 @@ end
function cm.nmfilter(c,code)
return c:IsCode(code) and c:IsAbleToDeck()
end
function cm.dfilter(c)
return c:IsAbleToDeck() and Duel.IsExistingTarget(cm.nmfilter,tp,LOCATION_GRAVE,0,1,c,c:GetCode())
function cm.dfilter(c,mc)
return c:IsAbleToDeck() and Duel.IsExistingTarget(cm.nmfilter,tp,LOCATION_GRAVE,0,1,Group.FromCards(c,mc),c:GetCode())
end
function cm.gilter(g)
return not aux.dncheck(g)
......@@ -59,10 +59,11 @@ function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.dfilter(chkc) end
local c=e:GetHandler()
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(cm.dfilter,tp,LOCATION_GRAVE,0,3,c) end
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_GRAVE,0,nil)
and Duel.IsExistingTarget(cm.dfilter,tp,LOCATION_GRAVE,0,1,c,c) end
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_GRAVE,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tt=g:SelectTarget(tp,cm.gilter,2,2,nil)
local tt=g:SelectSubGroup(tp,cm.gilter,true,2,2)
Duel.SetTargetCard(tt)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,3,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
......
--梅杜希亚娜
function c17061430.initial_effect(c)
local m=17061440
local cm=_G["c"..m]
function cm.initial_effect(c)
--summon limit
local ea=Effect.CreateEffect(c)
ea:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
ea:SetType(EFFECT_TYPE_SINGLE)
ea:SetCode(EFFECT_CANNOT_SUMMON)
c:RegisterEffect(ea)
local eb=ea:Clone()
eb:SetCode(EFFECT_CANNOT_MSET)
c:RegisterEffect(eb)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--attack twice
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e4:SetValue(2)
c:RegisterEffect(e4)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLED)
e1:SetCondition(cm.con)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
e:SetLabelObject(bc)
return bc and bc:IsStatus(STATUS_OPPO_BATTLE) and bc:IsRelateToBattle()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabelObject():IsAbleToRemove() end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetLabelObject(),1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetLabelObject()
if bc:IsRelateToBattle() and bc:IsControler(1-tp) then
Duel.Destroy(bc,REASON_EFFECT)
end
end
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