Commit 77e476cb authored by salix5's avatar salix5

Merge pull request #1074 from DailyShana/patch-1

new
parents 9fdf3fe4 28827f9d
--Mischief of the Gnomes
function c164710.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0)
e1:SetOperation(c164710.activate)
c:RegisterEffect(e1)
--lv
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetHintTiming(0,0x1c0)
e2:SetCost(c164710.lvcost)
e2:SetOperation(c164710.lvop)
c:RegisterEffect(e2)
end
function c164710.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
e1:SetValue(-1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c164710.lvcost(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)
end
function c164710.lvop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
e1:SetValue(-1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
--U.A. Blockbacker
function c34614289.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,34614289)
e1:SetCondition(c34614289.spcon)
e1:SetOperation(c34614289.spop)
c:RegisterEffect(e1)
--position change
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c34614289.postg)
e2:SetOperation(c34614289.posop)
c:RegisterEffect(e2)
end
function c34614289.spfilter(c)
return c:IsFaceup() and c:IsSetCard(0xb2) and not c:IsCode(34614289) and c:IsAbleToHandAsCost()
end
function c34614289.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c34614289.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function c34614289.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c34614289.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_COST)
end
function c34614289.filter(c,sp)
return c:GetSummonPlayer()==sp
end
function c34614289.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c34614289.filter,1,nil,1-tp) end
local g=eg:Filter(c34614289.filter,nil,1-tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
end
function c34614289.posop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local tc=g:GetFirst()
while tc do
if Duel.ChangePosition(tc,POS_FACEUP_DEFENCE,POS_FACEUP_DEFENCE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)~=0 then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
tc=g:GetNext()
end
end
--Malacoda, Netherlord of the Burning Abyss
function c35330871.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(c35330871.splimit)
c:RegisterEffect(e1)
--atk & def down
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP+0x1c0)
e2:SetCountLimit(1)
e2:SetCondition(c35330871.atkcon)
e2:SetCost(c35330871.atkcost)
e2:SetTarget(c35330871.atktg)
e2:SetOperation(c35330871.atkop)
c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCondition(c35330871.tgcon)
e3:SetTarget(c35330871.tgtg)
e3:SetOperation(c35330871.tgop)
c:RegisterEffect(e3)
end
function c35330871.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_RITUAL)==SUMMON_TYPE_RITUAL
end
function c35330871.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c35330871.cfilter(c)
return c:IsSetCard(0xb1) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c35330871.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c35330871.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c35330871.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
e:SetLabelObject(g:GetFirst())
end
function c35330871.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end
function c35330871.atkop(e,tp,eg,ep,ev,re,r,rp)
local cc=e:GetLabelObject()
local atk=cc:GetAttack()
local def=cc:GetDefence()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END)
e1:SetValue(-atk)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENCE)
e2:SetValue(-def)
tc:RegisterEffect(e2)
end
end
function c35330871.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c35330871.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsAbleToGrave() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c35330871.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
--Farfa, Malebranche of the Burning Abyss
function c36553319.initial_effect(c)
--self destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SELF_DESTROY)
e1:SetCondition(c36553319.sdcon)
c:RegisterEffect(e1)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(36553319,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,36553319)
e2:SetCondition(c36553319.sscon)
e2:SetTarget(c36553319.sstg)
e2:SetOperation(c36553319.ssop)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(36553319,1))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,36553319)
e3:SetCondition(c36553319.rmcon)
e3:SetTarget(c36553319.rmtg)
e3:SetOperation(c36553319.rmop)
c:RegisterEffect(e3)
end
function c36553319.sdfilter(c)
return not c:IsFaceup() or not c:IsSetCard(0xb1)
end
function c36553319.sdcon(e)
return Duel.IsExistingMatchingCard(c36553319.sdfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c36553319.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c36553319.sscon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c36553319.filter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c36553319.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c36553319.ssop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c36553319.filter,tp,LOCATION_ONFIELD,0,1,nil) then return end
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c36553319.rmcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c36553319.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c36553319.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,tc:GetPosition(),REASON_EFFECT+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(tc)
e1:SetCountLimit(1)
e1:SetOperation(c36553319.retop)
Duel.RegisterEffect(e1,tp)
end
end
function c36553319.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
--U.A. Turnover Tactics
function c61613388.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,61613388+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c61613388.condition)
e1:SetTarget(c61613388.target)
e1:SetOperation(c61613388.activate)
c:RegisterEffect(e1)
end
function c61613388.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xb2)
end
function c61613388.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c61613388.cfilter,tp,LOCATION_MZONE,0,nil)
return g:GetClassCount(Card.GetCode)>=2
end
function c61613388.filter(c,e,tp)
return c:IsSetCard(0xb2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c61613388.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(c61613388.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c61613388.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)
Duel.ShuffleDeck(tp)
local ct1=Duel.GetOperatedGroup():FilterCount(Card.IsControler,nil,tp)
local ct2=Duel.GetOperatedGroup():FilterCount(Card.IsControler,nil,1-tp)
if ct1>Duel.GetLocationCount(tp,LOCATION_MZONE) then ct1=Duel.GetLocationCount(tp,LOCATION_MZONE) end
if ct2>Duel.GetLocationCount(1-tp,LOCATION_MZONE) then ct2=Duel.GetLocationCount(1-tp,LOCATION_MZONE) end
if ct1<=0 then return end
local g=Duel.GetMatchingGroup(c61613388.filter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()==0 then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,sg:GetFirst():GetCode())
ct1=ct1-1
while ct1>0 and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(61613388,0)) do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,g1:GetFirst():GetCode())
sg:Merge(g1)
ct1=ct1-1
end
local sc=sg:GetFirst()
while sc do
if Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
sc:RegisterEffect(e1)
end
sc=sg:GetNext()
end
Duel.SpecialSummonComplete()
if ct2>0 and Duel.IsExistingMatchingCard(Card.IsCanBeSpecialSummoned,tp,0,LOCATION_DECK,1,nil,e,0,1-tp,false,false)
and Duel.SelectYesNo(1-tp,aux.Stringid(61613388,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local sg2=Duel.SelectMatchingCard(1-tp,Card.IsCanBeSpecialSummoned,tp,0,LOCATION_DECK,1,ct2,nil,e,0,1-tp,false,false)
if sg2:GetCount()>0 then
Duel.SpecialSummon(sg2,0,1-tp,1-tp,false,false,POS_FACEUP)
end
end
end
--Good & Evil in the Burning Abyss
function c62835876.initial_effect(c)
aux.AddRitualProcGreater(c,aux.FilterBoolFunction(Card.IsCode,35330871))
--search
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,62835876)
e1:SetCondition(c62835876.thcon)
e1:SetCost(c62835876.thcost)
e1:SetTarget(c62835876.thtg)
e1:SetOperation(c62835876.thop)
c:RegisterEffect(e1)
end
function c62835876.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetHandler():GetTurnID()
end
function c62835876.cfilter(c)
return c:IsSetCard(0xb1) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c62835876.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c62835876.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
Duel.DiscardHand(tp,c62835876.cfilter,1,1,REASON_COST,nil)
end
function c62835876.filter(c)
return c:IsSetCard(0xb1) and c:IsAbleToHand()
end
function c62835876.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c62835876.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c62835876.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c62835876.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--Libic, Malebranche of the Burning Abyss
function c62957424.initial_effect(c)
--self destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SELF_DESTROY)
e1:SetCondition(c62957424.sdcon)
c:RegisterEffect(e1)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(62957424,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,62957424)
e2:SetCondition(c62957424.sscon)
e2:SetTarget(c62957424.sstg)
e2:SetOperation(c62957424.ssop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(62957424,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,62957424)
e3:SetCondition(c62957424.spcon)
e3:SetTarget(c62957424.sptg)
e3:SetOperation(c62957424.spop)
c:RegisterEffect(e3)
end
function c62957424.sdfilter(c)
return not c:IsFaceup() or not c:IsSetCard(0xb1)
end
function c62957424.sdcon(e)
return Duel.IsExistingMatchingCard(c62957424.sdfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c62957424.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c62957424.sscon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c62957424.filter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c62957424.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c62957424.ssop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c62957424.filter,tp,LOCATION_ONFIELD,0,1,nil) then return end
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c62957424.spcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c62957424.spfilter(c,e,tp)
return c:GetLevel()==3 and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_FIEND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c62957424.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c62957424.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c62957424.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c62957424.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
end
--Dragoons of Draconia
function c73779005.initial_effect(c)
--pendulum summon
aux.AddPendulumProcedure(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLED)
e2:SetRange(LOCATION_PZONE)
e2:SetCountLimit(1)
e2:SetCondition(c73779005.thcon)
e2:SetTarget(c73779005.thtg)
e2:SetOperation(c73779005.thop)
c:RegisterEffect(e2)
end
function c73779005.thcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if not d then return false end
if d:IsControler(tp) then a,d=d,a end
if a:IsType(TYPE_NORMAL)
and not a:IsStatus(STATUS_BATTLE_DESTROYED) and d:IsStatus(STATUS_BATTLE_DESTROYED) then
return true
else return false end
end
function c73779005.filter(c)
return c:IsType(TYPE_NORMAL) and c:IsLevelAbove(4) and c:IsAbleToHand()
end
function c73779005.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c73779005.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c73779005.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c73779005.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--Cagna, Malebranche of the Burning Abyss
function c9342162.initial_effect(c)
--self destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SELF_DESTROY)
e1:SetCondition(c9342162.sdcon)
c:RegisterEffect(e1)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9342162,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,9342162)
e2:SetCondition(c9342162.sscon)
e2:SetTarget(c9342162.sstg)
e2:SetOperation(c9342162.ssop)
c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(9342162,1))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,9342162)
e3:SetCondition(c9342162.tgcon)
e3:SetTarget(c9342162.tgtg)
e3:SetOperation(c9342162.tgop)
c:RegisterEffect(e3)
end
function c9342162.sdfilter(c)
return not c:IsFaceup() or not c:IsSetCard(0xb1)
end
function c9342162.sdcon(e)
return Duel.IsExistingMatchingCard(c9342162.sdfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c9342162.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c9342162.sscon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c9342162.filter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c9342162.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c9342162.ssop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c9342162.filter,tp,LOCATION_ONFIELD,0,1,nil) then return end
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c9342162.tgcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c9342162.tgfilter(c)
return c:IsSetCard(0xb1) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGrave()
end
function c9342162.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9342162.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c9342162.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c9342162.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--U.A. Playmaker
function c98229575.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,98229575)
e1:SetCondition(c98229575.spcon)
e1:SetOperation(c98229575.spop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c98229575.atkcon)
e2:SetOperation(c98229575.atkop)
c:RegisterEffect(e2)
end
function c98229575.spfilter(c)
return c:IsFaceup() and c:IsSetCard(0xb2) and not c:IsCode(98229575) and c:IsAbleToHandAsCost()
end
function c98229575.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c98229575.spfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function c98229575.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c98229575.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_COST)
end
function c98229575.atkcon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at:IsSetCard(0xb2) and at:IsControler(tp) and at~=e:GetHandler()
end
function c98229575.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local at=Duel.GetAttacker()
if at:IsFaceup() and at:IsRelateToBattle() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-800)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetValue(800)
at:RegisterEffect(e2)
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