Commit ca3b5882 authored by mercury233's avatar mercury233

update scripts

parent 2d5a77d8
--海晶乙女マンダリン
--Scripted by nekrozar
function c101010002.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101010002,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,101010002)
e1:SetCondition(c101010002.spcon)
e1:SetTarget(c101010002.sptg)
e1:SetOperation(c101010002.spop)
c:RegisterEffect(e1)
end
function c101010002.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x12b)
end
function c101010002.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c101010002.cfilter,tp,LOCATION_MZONE,0,2,nil)
end
function c101010002.spfilter(c,e,tp,ec)
local zone=bit.band(c:GetLinkedZone(tp),0x1f)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsType(TYPE_LINK) and zone>0 and ec:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c101010002.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101010002.spfilter(chkc,e,tp,c) end
if chk==0 then return Duel.IsExistingTarget(c101010002.spfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101010002.spfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp,c)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101010002.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local zone=bit.band(tc:GetLinkedZone(tp),0x1f)
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP,zone)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
end
--海晶乙女クラウンテイル
--Scripted by nekrozar
function c101010003.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101010003,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101010003)
e1:SetCondition(c101010003.spcon)
e1:SetCost(c101010003.spcost)
e1:SetTarget(c101010003.sptg)
e1:SetOperation(c101010003.spop)
c:RegisterEffect(e1)
--battle damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101010003,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_START)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101010103)
e2:SetCondition(c101010003.damcon1)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101010003.damtg1)
e2:SetOperation(c101010003.damop1)
c:RegisterEffect(e2)
end
function c101010003.spcon(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return a and d and a:IsRelateToBattle() and d:IsRelateToBattle()
end
function c101010003.costfilter(c)
return c:IsSetCard(0x12b) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c101010003.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c101010003.costfilter,tp,LOCATION_HAND,0,1,c) end
Duel.DiscardHand(tp,c101010003.costfilter,1,1,REASON_COST,c)
end
function c101010003.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101010003.spop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetOperation(c101010003.damop2)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
end
function c101010003.damop2(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(tp,math.ceil(ev/2))
end
function c101010003.damcon1(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
return a and a:IsControler(1-tp)
end
function c101010003.damfilter(c)
return c:IsSetCard(0x12b) and c:IsType(TYPE_LINK)
end
function c101010003.damtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101010003.damfilter,tp,LOCATION_GRAVE,0,1,nil) end
end
function c101010003.damop1(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetCondition(c101010003.damcon3)
e1:SetOperation(c101010003.damop3)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c101010003.damcon3(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c101010003.damfilter,tp,LOCATION_GRAVE,0,nil)
local ct=g:GetSum(Card.GetLink)*1000
return Duel.GetBattleDamage(tp)<=ct
end
function c101010003.damop2(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(tp,0)
end
--海晶乙女ブルータン
--Scripted by nekrozar
function c101010004.initial_effect(c)
--tograve
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101010004,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,101010004)
e1:SetTarget(c101010004.tgtg)
e1:SetOperation(c101010004.tgop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--mill
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101010004,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCountLimit(1,101010104)
e3:SetCondition(c101010004.thcon)
e3:SetTarget(c101010004.thtg)
e3:SetOperation(c101010004.thop)
c:RegisterEffect(e3)
end
function c101010004.tgfilter(c)
return c:IsSetCard(0x12b) and c:IsType(TYPE_MONSTER) and not c:IsCode(101010004) and c:IsAbleToGrave()
end
function c101010004.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101010004.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c101010004.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101010004.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c101010004.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK and c:GetReasonCard():IsAttribute(ATTRIBUTE_WATER)
end
function c101010004.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function c101010004.thfilter(c)
return c:IsSetCard(0x12b) and c:IsAbleToHand()
end
function c101010004.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3)
if g:GetCount()>0 then
if g:IsExists(c101010004.thfilter,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(101010004,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,c101010004.thfilter,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
end
Duel.ShuffleDeck(tp)
end
end
--破械童子アルハ
--Scripted by nekrozar
function c101010008.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101010008,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101010008)
e1:SetTarget(c101010008.destg)
e1:SetOperation(c101010008.desop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101010008,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,101010108)
e2:SetCondition(c101010008.spcon)
e2:SetTarget(c101010008.sptg)
e2:SetOperation(c101010008.spop)
c:RegisterEffect(e2)
end
function c101010008.desfilter(c,tp)
return Duel.GetMZoneCount(tp,c)>0
end
function c101010008.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c101010008.desfilter(chkc,tp) end
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c101010008.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c101010008.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101010008.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c101010008.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c101010008.splimit(e,c)
return not c:IsRace(RACE_FIEND)
end
function c101010008.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and not re:GetHandler():IsCode(101010008))) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c101010008.spfilter(c,e,tp)
return c:IsSetCard(0x230) and not c:IsCode(101010008) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101010008.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101010008.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c101010008.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,c101010008.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--破械童子ラキア
--Scripted by nekrozar
function c101010009.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101010009,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101010009)
e1:SetTarget(c101010009.destg)
e1:SetOperation(c101010009.desop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101010009,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,101010109)
e2:SetCondition(c101010009.spcon)
e2:SetTarget(c101010009.sptg)
e2:SetOperation(c101010009.spop)
c:RegisterEffect(e2)
end
function c101010009.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101010009.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c101010009.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c101010009.splimit(e,c)
return not c:IsRace(RACE_FIEND)
end
function c101010009.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and not re:GetHandler():IsCode(101010009))) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c101010009.spfilter(c,e,tp)
return c:IsSetCard(0x230) and not c:IsCode(101010009) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101010009.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101010009.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c101010009.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,c101010009.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--破械神の禍霊
--
--Script by mercury233
function c101010010.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c101010010.atkval)
c:RegisterEffect(e1)
--link summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101010010,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101010010)
e2:SetTarget(c101010010.target)
e2:SetOperation(c101010010.operation)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101010010,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,101010010+100)
e3:SetCondition(c101010010.spcon)
e3:SetTarget(c101010010.sptg)
e3:SetOperation(c101010010.spop)
c:RegisterEffect(e3)
end
function c101010010.atkval(e,c)
return Duel.GetMatchingGroupCount(Card.IsSetCard,c:GetControler(),LOCATION_GRAVE,0,nil,0x230)*300
end
function c101010010.tgfilter(c,tp,ec)
local mg=Group.FromCards(ec,c)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c101010010.lfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
end
function c101010010.lfilter(c,mg)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsLinkSummonable(mg,2,2)
end
function c101010010.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c101010010.tgfilter,tp,0,LOCATION_MZONE,1,nil,tp,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101010010.tgfilter,tp,0,LOCATION_MZONE,1,1,nil,tp,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c101010010.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp)
and tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsControler(1-tp) and not tc:IsImmuneToEffect(e) then
local mg=Group.FromCards(c,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101010010.lfilter,tp,LOCATION_EXTRA,0,1,1,nil,mg)
local lc=g:GetFirst()
if lc then
Duel.LinkSummon(tp,lc,mg,2,2)
end
end
end
function c101010010.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c101010010.spfilter(c,e,tp)
return c:IsSetCard(0x230) and not c:IsCode(101010010) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101010010.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101010010.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101010010.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101010010.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101010010.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--海晶乙女クリスタルハート
--Scripted by nekrozar
function c101010040.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkAttribute,ATTRIBUTE_WATER),2,2)
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c101010040.immcon1)
e1:SetValue(c101010040.efilter1)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCondition(c101010040.immcon2)
e2:SetTarget(c101010040.immtg2)
e2:SetValue(c101010040.efilter2)
c:RegisterEffect(e2)
--indestructable
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101010040,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BE_BATTLE_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c101010040.indcon)
e3:SetCost(c101010040.indcost)
e3:SetTarget(c101010040.indtg)
e3:SetOperation(c101010040.indop)
c:RegisterEffect(e3)
end
function c101010040.immcon1(e)
return e:GetHandler():GetSequence()>4
end
function c101010040.efilter1(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and te:IsActiveType(TYPE_MONSTER)
end
function c101010040.immcon2(e)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL) and e:GetHandler():GetBattleTarget()
end
function c101010040.immtg2(e,c)
return c==e:GetHandler():GetBattleTarget()
end
function c101010040.efilter2(e,te)
return e:GetHandler()~=te:GetOwner()
end
function c101010040.indcon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget()
if not at then return false end
local c=e:GetHandler()
if at==c then return true end
local lg=c:GetLinkedGroup()
return at and at:IsControler(tp) and at:IsFaceup() and at:IsSetCard(0x12b) and lg:IsContains(at)
end
function c101010040.costfilter(c)
return c:IsSetCard(0x12b) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c101010040.indcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101010040.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c101010040.costfilter,1,1,REASON_COST)
end
function c101010040.indtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.GetAttackTarget():CreateEffectRelation(e)
end
function c101010040.indop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local at=Duel.GetAttackTarget()
if at:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
at:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e3:SetOperation(c101010040.damop)
e3:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e3,tp)
end
end
function c101010040.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(tp,0)
end
--海晶乙女ワンダーハート
--Scripted by nekrozar
function c101010041.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkAttribute,ATTRIBUTE_WATER),2)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101010041,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c101010041.spcon1)
e1:SetCost(c101010041.spcost1)
e1:SetTarget(c101010041.sptg1)
e1:SetOperation(c101010041.spop1)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101010041,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(c101010041.spcon2)
e2:SetTarget(c101010041.sptg2)
e2:SetOperation(c101010041.spop2)
c:RegisterEffect(e2)
end
function c101010041.spcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetBattleTarget()~=nil
end
function c101010041.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(101010041)==0 end
c:RegisterFlagEffect(101010041,RESET_CHAIN,0,1)
end
function c101010041.spfilter1(c,e,tp,ec)
return c:IsSetCard(0x12b) and c:GetEquipTarget()==ec and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101010041.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101010041.spfilter1,tp,LOCATION_SZONE,0,1,nil,e,tp,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE)
end
function c101010041.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101010041.spfilter1,tp,LOCATION_SZONE,0,1,1,nil,e,tp,c)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local fid=c:GetFieldID()
c:RegisterFlagEffect(101010041,RESET_EVENT+RESETS_STANDARD,0,1,fid)
tc:RegisterFlagEffect(101010041,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c101010041.eqcon(c))
e1:SetOperation(c101010041.eqop(c))
Duel.RegisterEffect(e1,tp)
end
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
tc:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e3:SetOperation(c101010041.damop)
e3:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e3,tp)
end
end
function c101010041.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(tp,0)
end
function c101010041.eqcon(mc)
return
function (e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if mc:GetFlagEffectLabel(101010041)~=e:GetLabel() or tc:GetFlagEffectLabel(101010041)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
end
function c101010041.eqop(mc)
return
function (e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if Duel.Equip(tp,tc,mc)==0 then return end
local e1=Effect.CreateEffect(mc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetValue(c101010041.eqlimit)
e1:SetLabelObject(mc)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function c101010041.eqlimit(e,c)
return e:GetLabelObject()==c
end
function c101010041.spcon2(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and e:GetHandler():GetPreviousControler()==tp
end
function c101010041.spfilter2(c,e,tp)
return c:IsSetCard(0x12b) and c:IsLinkBelow(3) and c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101010041.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c101010041.spfilter2),tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c101010041.spop2(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,aux.NecroValleyFilter(c101010041.spfilter2),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--海晶乙女シーエンジェル
--Scripted by nekrozar
function c101010042.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c101010042.mfilter,1,1)
c:EnableReviveLimit()
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c101010042.condition)
e1:SetOperation(c101010042.regop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101010042,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,101010042)
e2:SetCondition(c101010042.condition)
e2:SetTarget(c101010042.thtg)
e2:SetOperation(c101010042.thop)
c:RegisterEffect(e2)
end
function c101010042.mfilter(c)
return c:IsLevelBelow(4) and c:IsLinkSetCard(0x12b)
end
function c101010042.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c101010042.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c101010042.splimit)
Duel.RegisterEffect(e1,tp)
end
function c101010042.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsCode(101010042) and bit.band(sumtype,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function c101010042.thfilter(c)
return c:IsSetCard(0x12b) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c101010042.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101010042.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101010042.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101010042.thfilter,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
--破械神ラギア
--Scripted by nekrozar
function c101010043.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,2,c101010043.lcheck)
c:EnableReviveLimit()
--link summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101010043,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101010043)
e1:SetCondition(c101010043.condition)
e1:SetTarget(c101010043.target)
e1:SetOperation(c101010043.operation)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101010043,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,101010143)
e2:SetCondition(c101010043.thcon)
e2:SetTarget(c101010043.thtg)
e2:SetOperation(c101010043.thop)
c:RegisterEffect(e2)
end
function c101010043.lcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x1230)
end
function c101010043.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c101010043.tgfilter(c,tp,ec)
local mg=Group.FromCards(ec,c)
return c:IsFaceup() and c:IsSummonType(SUMMON_TYPE_SPECIAL) and Duel.IsExistingMatchingCard(c101010043.lfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
end
function c101010043.lfilter(c,mg)
return c:IsAttribute(ATTRIBUTE_DARK) and not c:IsCode(101010043) and c:IsLinkSummonable(mg,2,2)
end
function c101010043.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c101010043.tgfilter,tp,0,LOCATION_MZONE,1,nil,tp,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101010043.tgfilter,tp,0,LOCATION_MZONE,1,1,nil,tp,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c101010043.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp)
and tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsControler(1-tp) and not tc:IsImmuneToEffect(e) then
local mg=Group.FromCards(c,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101010043.lfilter,tp,LOCATION_EXTRA,0,1,1,nil,mg)
local lc=g:GetFirst()
if lc then
Duel.LinkSummon(tp,lc,mg,2,2)
end
end
end
function c101010043.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c101010043.thfilter(c)
return c:IsRace(RACE_FIEND) and not c:IsCode(101010043) and c:IsAbleToHand()
end
function c101010043.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101010043.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101010043.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101010043.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101010043.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--破械神アルバ
--Scripted by nekrozar
function c101010044.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,99,c101010044.lcheck)
c:EnableReviveLimit()
--link summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101010044,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101010044)
e1:SetTarget(c101010044.target)
e1:SetOperation(c101010044.operation)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101010044,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,101010144)
e2:SetCondition(c101010044.thcon)
e2:SetTarget(c101010044.thtg)
e2:SetOperation(c101010044.thop)
c:RegisterEffect(e2)
end
function c101010044.lcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x1230)
end
function c101010044.tgfilter(c,tp,ec)
local mg=Group.FromCards(ec,c)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c101010044.lfilter,tp,LOCATION_EXTRA,0,1,nil,mg)
end
function c101010044.lfilter(c,mg)
return c:IsAttribute(ATTRIBUTE_DARK) and not c:IsCode(101010044) and c:IsLinkSummonable(mg,2,2)
end
function c101010044.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c101010044.tgfilter,tp,0,LOCATION_MZONE,1,nil,tp,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101010044.tgfilter,tp,0,LOCATION_MZONE,1,1,nil,tp,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c101010044.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp)
and tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsControler(1-tp) and not tc:IsImmuneToEffect(e) then
local mg=Group.FromCards(c,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101010044.lfilter,tp,LOCATION_EXTRA,0,1,1,nil,mg)
local lc=g:GetFirst()
if lc then
Duel.LinkSummon(tp,lc,mg,2,2)
end
end
end
function c101010044.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c101010044.thfilter(c)
return c:IsRace(RACE_FIEND) and not c:IsCode(101010044) and c:IsAbleToHand()
end
function c101010044.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101010044.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101010044.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101010044.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101010044.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--破械雙王神ライゴウ
--Scripted by nekrozar
function c101010045.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,99,c101010045.lcheck)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101010045,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_DESTROYED)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101010045)
e1:SetCondition(c101010045.descon1)
e1:SetTarget(c101010045.destg)
e1:SetOperation(c101010045.desop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101010045,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101010145)
e2:SetTarget(c101010045.destg)
e2:SetOperation(c101010045.desop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101010045,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,101010245)
e3:SetTarget(c101010045.destg)
e3:SetOperation(c101010045.desop)
c:RegisterEffect(e3)
end
function c101010045.lcheck(g)
return g:IsExists(Card.IsLinkType,1,nil,TYPE_LINK)
end
function c101010045.cfilter(c,re,tp)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_EFFECT) and not re:GetHandler():IsCode(101010045)
end
function c101010045.descon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101010045.cfilter,1,nil,re,tp)
end
function c101010045.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101010045.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--海晶乙女の闘海
--Scripted by nekrozar
function c101010053.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x12b))
e2:SetValue(c101010053.atkval)
c:RegisterEffect(e2)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c101010053.immtg)
e3:SetValue(c101010053.efilter)
c:RegisterEffect(e3)
--equip
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101010053,0))
e4:SetCategory(CATEGORY_EQUIP)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c101010053.eqcon)
e4:SetTarget(c101010053.eqtg)
e4:SetOperation(c101010053.eqop)
c:RegisterEffect(e4)
if not c101010053.global_check then
c101010053.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE)
ge1:SetCode(EFFECT_MATERIAL_CHECK)
ge1:SetValue(c101010053.valcheck)
Duel.RegisterEffect(ge1,0)
end
end
function c101010053.valcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(Card.IsLinkCode,1,nil,101010040) then
c:RegisterFlagEffect(101010053,RESET_EVENT+0x4fe0000,0,1)
end
end
function c101010053.atkval(e,c)
return 200+c:GetEquipGroup():FilterCount(Card.IsSetCard,nil,0x12b)*600
end
function c101010053.immtg(e,c)
return c:GetSequence()>4 and c:IsSummonType(SUMMON_TYPE_LINK) and c:GetFlagEffect(101010053)~=0
end
function c101010053.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function c101010053.cfilter(c,tp)
return c:GetSummonPlayer()==tp and c:GetSequence()>4 and c:IsSetCard(0x12b) and c:IsType(TYPE_LINK) and c:IsSummonType(SUMMON_TYPE_LINK)
end
function c101010053.eqcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101010053.cfilter,1,nil,tp)
end
function c101010053.eqfilter(c)
return c:IsSetCard(0x12b) and c:IsType(TYPE_LINK) and not c:IsForbidden()
end
function c101010053.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c101010053.eqfilter,tp,LOCATION_GRAVE,0,1,nil) end
eg:GetFirst():CreateEffectRelation(e)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE)
end
function c101010053.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_SZONE)),3)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c101010053.eqfilter),tp,LOCATION_GRAVE,0,nil)
if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) or ft<=0 or g:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ft)
if sg and sg:GetCount()>0 then
local sc=sg:GetFirst()
while sc do
Duel.Equip(tp,sc,tc,false,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetLabelObject(tc)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c101010053.eqlimit)
sc:RegisterEffect(e1)
sc=sg:GetNext()
end
Duel.EquipComplete()
end
end
function c101010053.eqlimit(e,c)
return e:GetLabelObject()==c
end
--雙王の械
--Scripted by nekrozar
function c101010054.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101010054,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101010054)
e1:SetTarget(c101010054.target)
e1:SetOperation(c101010054.activate)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101010054,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,101010154)
e2:SetCondition(c101010054.spcon)
e2:SetTarget(c101010054.sptg)
e2:SetOperation(c101010054.spop)
c:RegisterEffect(e2)
end
function c101010054.filter(c)
return c:IsSetCard(0x230) and c:IsAbleToHand()
end
function c101010054.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101010054.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101010054.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101010054.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
function c101010054.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function c101010054.spfilter(c,e,tp)
return c:IsSetCard(0x230) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101010054.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101010054.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101010054.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,c101010054.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--破械神の慟哭
--Scripted by nekrozar
function c101010055.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101010055,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,101010055)
e2:SetCondition(c101010055.descon)
e2:SetTarget(c101010055.destg)
e2:SetOperation(c101010055.desop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101010055,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,101010155)
e3:SetCondition(c101010055.spcon)
e3:SetTarget(c101010055.sptg)
e3:SetOperation(c101010055.spop)
c:RegisterEffect(e3)
end
function c101010055.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x230) and c:IsSummonType(SUMMON_TYPE_LINK) and c:GetSummonPlayer()==tp
end
function c101010055.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101010055.cfilter,1,nil,tp)
end
function c101010055.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101010055.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not e:GetHandler():IsRelateToEffect(e) then return end
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c101010055.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function c101010055.spfilter(c,e,tp)
return c:IsSetCard(0x230) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101010055.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101010055.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101010055.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,c101010055.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--海晶乙女雪花
--Scripted by nekrozar
function c101010067.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_DESTROYED)
e1:SetCountLimit(1,101010067+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101010067.target)
e1:SetOperation(c101010067.activate)
c:RegisterEffect(e1)
end
function c101010067.spfilter1(c,e,tp)
local lk=c:GetLink()
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
and c:IsPreviousSetCard(0x12b) and bit.band(c:GetPreviousTypeOnField(),TYPE_LINK)~=0
and c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c:IsCanBeEffectTarget(e)
and lk>0 and Duel.IsExistingMatchingCard(c101010067.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,lk)
end
function c101010067.spfilter2(c,e,tp,lk)
return c:IsSetCard(0x12b) and c:IsLink(lk-1) and c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_LINK,tp,false,false)
end
function c101010067.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c101010067.spfilter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_LMATERIAL)
and eg:IsExists(c101010067.spfilter1,1,nil,e,tp) end
if eg:GetCount()==1 then
Duel.SetTargetCard(eg)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=eg:FilterSelect(tp,c101010067.spfilter1,1,1,nil,e,tp)
Duel.SetTargetCard(g)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c101010067.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or Duel.GetLocationCountFromEx(tp)<=0 or not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_LMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101010067.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetLink())
local tc=g:GetFirst()
if not tc then return end
if Duel.SpecialSummon(tc,SUMMON_TYPE_LINK,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c101010067.immcon)
e1:SetValue(c101010067.efilter)
e1:SetOwnerPlayer(tp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
tc:CompleteProcedure()
end
end
function c101010067.immcon(e)
return e:GetHandler():IsControler(e:GetOwnerPlayer())
end
function c101010067.efilter(e,te)
return e:GetOwnerPlayer()~=te:GetOwnerPlayer()
end
--海晶乙女瀑布
--Scripted by nekrozar
function c101010068.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(c101010068.condition)
e1:SetCost(c101010068.cost)
e1:SetTarget(c101010068.target)
e1:SetOperation(c101010068.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c101010068.handcon)
c:RegisterEffect(e2)
end
function c101010068.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c101010068.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c101010068.costfilter(c)
return c:IsFaceup() and c:IsSetCard(0x12b) and c:IsType(TYPE_LINK) and c:IsLinkAbove(1) and c:IsAbleToRemoveAsCost()
end
function c101010068.fselect(g,tp)
return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,g)
end
function c101010068.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c101010068.costfilter,tp,LOCATION_MZONE,0,nil)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return g:CheckSubGroup(c101010068.fselect,1,99,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g:SelectSubGroup(tp,c101010068.fselect,false,1,99,tp)
local ct=rg:GetSum(Card.GetLink)
e:SetLabel(ct)
local tct=1
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then tct=2 end
local tc=rg:GetFirst()
while tc do
if Duel.Remove(tc,POS_FACEUP,REASON_COST+REASON_TEMPORARY)~=0 then
tc:RegisterFlagEffect(101010068,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,tct)
end
tc=rg:GetNext()
end
rg:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabelObject(rg)
e1:SetCondition(c101010068.retcon)
e1:SetOperation(c101010068.retop)
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
e1:SetValue(Duel.GetTurnCount())
else
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
e1:SetValue(0)
end
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c101010068.retfilter(c)
return c:GetFlagEffect(101010068)~=0
end
function c101010068.retcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp or Duel.GetTurnCount()==e:GetValue() then return false end
return e:GetLabelObject():IsExists(c101010068.retfilter,1,nil)
end
function c101010068.retop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject():Filter(c101010068.retfilter,nil)
local tc=g:GetFirst()
while tc do
Duel.ReturnToField(tc)
tc=g:GetNext()
end
end
function c101010068.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local ct=e:GetLabel()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct*300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c101010068.hcfilter(c)
return c:IsFaceup() and c:IsSetCard(0x12b) and c:IsLinkAbove(3)
end
function c101010068.handcon(e)
return Duel.IsExistingMatchingCard(c101010068.hcfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
--破械唱導
--Scripted by nekrozar
function c101010069.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101010069,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,101010069)
e1:SetTarget(c101010069.target)
e1:SetOperation(c101010069.activate)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101010069,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,101010169)
e2:SetCondition(c101010069.spcon)
e2:SetTarget(c101010069.sptg)
e2:SetOperation(c101010069.spop)
c:RegisterEffect(e2)
end
function c101010069.desfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x230)
and Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
function c101010069.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c101010069.desfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c101010069.desfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,g1:GetFirst())
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0)
end
function c101010069.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()==2 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
function c101010069.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function c101010069.spfilter(c,e,tp)
return c:IsSetCard(0x230) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101010069.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101010069.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101010069.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,c101010069.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--破械雙極
--Scripted by nekrozar
function c101010070.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101010070,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,101010070)
e1:SetTarget(c101010070.target)
e1:SetOperation(c101010070.activate)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101010070,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,101010170)
e2:SetCondition(c101010070.spcon)
e2:SetTarget(c101010070.sptg)
e2:SetOperation(c101010070.spop)
c:RegisterEffect(e2)
end
function c101010070.filter(c,e,tp)
return c:IsSetCard(0x230) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101010070.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101010070.filter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c101010070.activate(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,aux.NecroValleyFilter(c101010070.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101010070.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function c101010070.spfilter(c,e,tp)
return c:IsSetCard(0x230) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101010070.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101010070.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101010070.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,c101010070.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
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