Commit 2cb529e5 authored by mercury233's avatar mercury233

rm

parent 59466567
......@@ -14,54 +14,19 @@
101108034
101108052
101108069
100200209
100285004
100343031
100343032
100426001
100426002
100426005
100426006
100426007
100426017
100285001
100343001
100343002
100343003
100343020
100426031
100426032
100426035
100426036
100426037
100426016
100426018
100426019
100426020
100426021
100426022
100284001
100284002
100284003
#extra
100426004
100285003
100343041
100343042
100426033
100426003
100426034
100283001
!side
101106000
101106081
101106082
101106083
101106084
101106085
101106086
101106087
101106088
101106089
101106090
101106091
#The first line is used for comment
!counter 0x15f 指示物(逐渐削减的生命)
!setname 0x1083 人偶 パペット
!setname 0x275 海龙神 リバイアサン
!setname 0x276 潜海 シー・ステルス
!setname 0x277 七皇 セブンス
!setname 0x278 异晶人的 バリアンズ
--海神の依代
--
--Script by Trishula9 & mercury233
function c100200209.initial_effect(c)
aux.AddCodeList(c,22702055)
--choose effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100200209,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,100200209)
e1:SetTarget(c100200209.target)
e1:SetOperation(c100200209.operation)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100200209+100)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c100200209.thtg)
e2:SetOperation(c100200209.thop)
c:RegisterEffect(e2)
end
function c100200209.tgfilter(c,e,tp,ec,spchk)
return c:IsAttribute(ATTRIBUTE_WATER)
and (c:IsLevelAbove(1) and ec:IsLevelAbove(1) and (not c:IsLevel(ec:GetLevel()) or not c:IsCode(ec:GetCode()))
or spchk and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE))
end
function c100200209.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local spchk=Duel.IsEnvironment(22702055) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c100200209.tgfilter(chkc,e,tp,c,spchk) end
if chk==0 then return Duel.IsExistingTarget(c100200209.tgfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,c,spchk) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100200209.tgfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,c,spchk)
end
function c100200209.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local b1=tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) and c:IsFaceup() and c:IsLevelAbove(1)
and tc:IsLevelAbove(1) and (not c:IsLevel(tc:GetLevel()) or not c:IsCode(tc:GetCode()))
local b2=tc:IsRelateToEffect(e) and Duel.IsEnvironment(22702055) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and aux.NecroValleyFilter()(tc) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
if b1 or b2 then
local s
if b1 and b2 then
s=Duel.SelectOption(tp,aux.Stringid(100200209,1),aux.Stringid(100200209,2))
elseif b1 then
s=Duel.SelectOption(tp,aux.Stringid(100200209,1))
else
s=Duel.SelectOption(tp,aux.Stringid(100200209,2))+1
end
if s==0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(tc:GetCode())
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetValue(tc:GetLevel())
c:RegisterEffect(e2)
end
if s==1 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c100200209.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100200209.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsAttribute(ATTRIBUTE_WATER)
end
function c100200209.thfilter(c)
return c:IsCode(22702055) and c:IsAbleToHand()
end
function c100200209.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100200209.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100200209.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c100200209.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c100200209.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
--天翔ける騎士
--
--Script by Trishula9
function c100283001.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100283001)
e1:SetCost(c100283001.spcost)
e1:SetTarget(c100283001.sptg)
e1:SetOperation(c100283001.spop)
c:RegisterEffect(e1)
--overlay
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100283001+100)
e2:SetOperation(aux.exccon)
e2:SetTarget(c100283001.ovtg)
e2:SetOperation(c100283001.ovop)
c:RegisterEffect(e2)
end
function c100283001.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c100283001.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100283001.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100283001.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100283001.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,c100283001.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100283001.ovfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FAIRY) and c:IsLevel(4) and c:IsCanOverlay() and c:IsFaceup()
end
function c100283001.ovtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100283001.ovfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100283001.ovfilter,tp,LOCATION_MZONE,0,1,nil)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c100283001.ovfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100283001.ovop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0
and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Overlay(c,Group.FromCards(tc))
end
end
--アビス・シャーク
--
--Script by Trishula9 & mercury233
function c100426001.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100426001)
e1:SetCondition(c100426001.spcon)
e1:SetTarget(c100426001.sptg)
e1:SetOperation(c100426001.spop)
c:RegisterEffect(e1)
--xyzlv
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_XYZ_LEVEL)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c100426001.xyzlv)
e2:SetLabel(3)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetLabel(4)
c:RegisterEffect(e3)
end
function c100426001.spfilter(c)
return not c:IsAttribute(ATTRIBUTE_WATER) or c:IsFacedown()
end
function c100426001.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0
and not Duel.IsExistingMatchingCard(c100426001.spfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100426001.thfilter(c)
return not c:IsCode(100426001) and c:IsLevelAbove(3) and c:IsLevelBelow(5) and c:IsRace(RACE_FISH) and c:IsAbleToHand()
end
function c100426001.sptg(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)
and Duel.IsExistingMatchingCard(c100426001.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100426001.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local g=Duel.GetMatchingGroup(c100426001.thfilter,tp,LOCATION_DECK,0,nil)
if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
if #sg>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c100426001.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetCondition(c100426001.damcon)
e2:SetValue(DOUBLE_DAMAGE)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c100426001.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsAttribute(ATTRIBUTE_WATER)
end
function c100426001.damcon(e)
local tp=e:GetHandlerPlayer()
local a,d=Duel.GetBattleMonster(tp)
if a and d and a:GetControler()==tp and a:IsSetCard(0x48) and a:IsStatus(STATUS_OPPO_BATTLE)
and Duel.GetFlagEffect(tp,100426001)==0 then
Duel.RegisterFlagEffect(tp,100426001,RESET_PHASE+PHASE_END,0,1)
return true
end
return false
end
function c100426001.xyzlv(e,c,rc)
if rc:IsSetCard(0x48) then
return c:GetLevel()+0x10000*e:GetLabel()
else
return c:GetLevel()
end
end
--クリスタル・シャーク
--
--Script by Trishula9
function c100426002.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,100426002)
e1:SetTarget(c100426002.sptg)
e1:SetOperation(c100426002.spop)
c:RegisterEffect(e1)
--xyzlv
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_XYZ_LEVEL)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c100426002.xyzlv)
e2:SetLabel(3)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetLabel(4)
c:RegisterEffect(e3)
end
function c100426002.spfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsFaceup()
end
function c100426002.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c100426002.spfilter(chkc) end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(c100426002.spfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100426002.spfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c100426002.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
if tc:IsRelateToEffect(e) and tc:IsFaceup() and not tc:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-tc:GetAttack()/2)
tc:RegisterEffect(e1)
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_REDIRECT)
e2:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e2,true)
end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetReset(RESET_PHASE+PHASE_END)
e3:SetTarget(c100426002.splimit)
Duel.RegisterEffect(e3,tp)
end
function c100426002.splimit(e,c)
return not c:IsType(TYPE_XYZ) and c:IsLocation(LOCATION_EXTRA)
end
function c100426002.xyzlv(e,c,rc)
if rc:IsSetCard(0x48) then
return c:GetLevel()+0x10000*e:GetLabel()
else
return c:GetLevel()
end
end
\ No newline at end of file
--N·As·H Knight
--
--Script by Trishula9
function c100426003.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,5,2)
c:EnableReviveLimit()
--battle indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetCondition(c100426003.indcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--overlay
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100426003,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100426003)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCondition(c100426003.ovcon)
e2:SetCost(c100426003.ovcost)
e2:SetTarget(c100426003.ovtg)
e2:SetOperation(c100426003.ovop)
c:RegisterEffect(e2)
end
function c100426003.indfilter(c)
return c:IsSetCard(0x48) and c:IsFaceup()
end
function c100426003.indcon(e)
return Duel.IsExistingMatchingCard(c100426003.indfilter,0,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function c100426003.ovcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c100426003.ovcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c100426003.ovfilter(c,sc)
local m=_G["c"..c:GetCode()]
if not m then return false end
local no=m.xyz_number
return no and no>=101 and no<=107 and c:IsSetCard(0x48) and c:IsType(TYPE_XYZ) and c:IsCanBeXyzMaterial(sc)
end
function c100426003.ovtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100426003.ovfilter,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
end
function c100426003.ovfilter2(c)
return c:IsFaceup() and c:IsCanOverlay()
end
function c100426003.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg=Duel.SelectMatchingCard(tp,c100426003.ovfilter,tp,LOCATION_EXTRA,0,1,1,nil,c)
if #mg==0 then return end
Duel.Overlay(c,mg)
local g=Duel.GetMatchingGroup(c100426003.ovfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,c)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(100426003,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tg=g:Select(tp,1,1,nil)
Duel.HintSelection(tg)
local tc=tg:GetFirst()
if not tc:IsImmuneToEffect(e) then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(c,tg)
end
end
end
--CX-N·As·Ch Knight
--
--Script by Trishula9
function c100426004.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,6,3,c100426004.ovfilter,aux.Stringid(100426004,0))
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
c:RegisterEffect(e1)
--xyz spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100426004)
e2:SetCost(c100426004.spcost)
e2:SetTarget(c100426004.sptg)
e2:SetOperation(c100426004.spop)
c:RegisterEffect(e2)
end
function c100426004.ovfilter(c)
return c:IsCode(100426003) and c:IsFaceup()
end
function c100426004.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c100426004.spfilter(c,e,tp,mc)
local m=_G["c"..c:GetCode()]
if not m then return false end
local no=m.xyz_number
return no and no>=101 and no<=107 and c:IsSetCard(0x48) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c100426004.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c100426004.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100426004.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100426004.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local sc=g:GetFirst()
if sc then
local mg=c:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(c))
Duel.Overlay(sc,Group.FromCards(c))
if Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)~=0 then
sc:CompleteProcedure()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabelObject(sc)
e1:SetCondition(c100426004.descon)
e1:SetOperation(c100426004.desop)
if Duel.GetTurnPlayer()==1-tp and Duel.GetCurrentPhase()==PHASE_END then
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,2)
e1:SetLabel(Duel.GetTurnCount())
sc:RegisterFlagEffect(100426004,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,0,2)
else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e1:SetLabel(0)
sc:RegisterFlagEffect(100426004,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,0,1)
end
Duel.RegisterEffect(e1,tp)
end
end
end
end
function c100426004.descon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp or Duel.GetTurnCount()==e:GetLabel() then return false end
return e:GetLabelObject():GetFlagEffect(100426004)>0
end
function c100426004.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetLabelObject(),REASON_EFFECT)
end
--バリアンズ・カオス・ドロー
--
--Script by Trishula9
function c100426005.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DRAW)
e1:SetCondition(c100426005.regcon)
e1:SetOperation(c100426005.regop)
c:RegisterEffect(e1)
--copy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100426005,1))
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(c100426005.condition)
e2:SetCost(c100426005.cpcost)
e2:SetTarget(c100426005.cptg)
e2:SetOperation(c100426005.cpop)
c:RegisterEffect(e2)
--xyz summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100426005,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_ACTIVATE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCondition(c100426005.condition)
e3:SetTarget(c100426005.xyztg)
e3:SetOperation(c100426005.xyzop)
c:RegisterEffect(e3)
end
function c100426005.regcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetFlagEffect(tp,100426005)==0 and Duel.GetCurrentPhase()==PHASE_DRAW and c:IsReason(REASON_RULE)
end
function c100426005.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SelectYesNo(tp,aux.Stringid(100426005,0)) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_MAIN1)
c:RegisterEffect(e1)
c:RegisterFlagEffect(100426005,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_MAIN1,EFFECT_FLAG_CLIENT_HINT,1,0,66)
end
end
function c100426005.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 and e:GetHandler():GetFlagEffect(100426005)~=0
end
function c100426005.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
end
function c100426005.cpfilter(c)
return c:GetType()==TYPE_SPELL and c:IsSetCard(0x277) and c:IsAbleToGraveAsCost()
and c:CheckActivateEffect(true,true,false)~=nil
end
function c100426005.cptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c100426005.cpfilter,tp,LOCATION_DECK,0,1,nil)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100426005.cpfilter,tp,LOCATION_DECK,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(true,true,true)
Duel.SendtoGrave(g,REASON_COST)
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
end
function c100426005.cpop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
function c100426005.filter1(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100426005.filter2(c)
return c:IsFaceup() and c:IsLevelAbove(1)
end
function c100426005.fselect(sg,tp)
local mg=Duel.GetMatchingGroup(c100426005.filter2,tp,LOCATION_MZONE,0,nil)
mg:Merge(sg)
return mg:CheckSubGroup(c100426005.matfilter,1,#mg,tp,sg)
end
function c100426005.matfilter(sg,tp,g)
if sg:Filter(aux.IsInGroup,nil,g):GetCount()~=g:GetCount() then return false end
return Duel.IsExistingMatchingCard(c100426005.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,sg)
end
function c100426005.xyzfilter(c,mg)
return c:IsSetCard(0x48) and c:IsXyzSummonable(mg,#mg,#mg)
end
function c100426005.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(c100426005.filter1,tp,LOCATION_DECK,0,nil,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>2 then ft=2 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and mg:CheckSubGroup(c100426005.fselect,1,ft,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function c100426005.xyzop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if not Duel.IsPlayerCanSpecialSummonCount(tp,2) or ft<=0 then return end
if ft>2 then ft=2 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local mg=Duel.GetMatchingGroup(c100426005.filter1,tp,LOCATION_DECK,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=mg:SelectSubGroup(tp,c100426005.fselect,false,1,ft,tp)
if not g then return end
local tc=g:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
if g:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<#g then return end
local exg=Duel.GetMatchingGroup(c100426005.xyzfilter2,tp,LOCATION_EXTRA,0,nil)
local xyzg=exg:Filter(c100426005.ovfilter,nil,tp,g)
if xyzg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xyz=xyzg:Select(tp,1,1,nil):GetFirst()
local fg=Duel.GetMatchingGroup(c100426005.filter2,tp,LOCATION_MZONE,0,nil)
local sg=fg:SelectSubGroup(tp,c100426005.gselect,false,1,7,xyz,g)
Duel.XyzSummon(tp,xyz,sg)
end
end
function c100426005.xyzfilter2(c)
return c:IsSetCard(0x48)
end
function c100426005.ovfilter(c,tp,sg)
local mg=Duel.GetMatchingGroup(c100426005.filter2,tp,LOCATION_MZONE,0,nil)
mg:Merge(sg)
return mg:CheckSubGroup(c100426005.gselect,1,#mg,c,sg)
end
function c100426005.gselect(sg,c,g)
if sg:Filter(aux.IsInGroup,nil,g):GetCount()~=g:GetCount() then return false end
return c:IsXyzSummonable(sg,#sg,#sg)
end
--七皇昇格
--
--Script by Trishula9
function c100426006.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100426006,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100426006)
e1:SetTarget(c100426006.target)
e1:SetOperation(c100426006.operation)
c:RegisterEffect(e1)
--copy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100426006,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100426006+100)
e2:SetCondition(c100426006.cpcon)
e2:SetCost(c100426006.cpcost)
e2:SetTarget(c100426006.cptg)
e2:SetOperation(c100426006.cpop)
c:RegisterEffect(e2)
end
function c100426006.filter(c)
return (not c:IsCode(100426006) and (c:IsSetCard(0x277) or c:IsCode(57734012)) and c:IsType(TYPE_SPELL+TYPE_TRAP))
or ((c:IsSetCard(0x278) or c:IsCode(47660516,92365601)) and c:IsType(TYPE_SPELL+TYPE_TRAP))
or (c:IsSetCard(0x95) and c:IsType(TYPE_QUICKPLAY))
end
function c100426006.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100426006.filter,tp,LOCATION_DECK,0,1,nil) end
end
function c100426006.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c100426006.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
if tc:IsAbleToHand() and Duel.SelectOption(tp,1190,aux.Stringid(100426006,0))==0 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
Duel.ConfirmDecktop(tp,1)
end
end
end
function c100426006.cfilter(c)
return c:IsSummonLocation(LOCATION_EXTRA)
end
function c100426006.cpcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100426006.cfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c100426006.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c100426006.cpfilter(c)
return c:GetType()&TYPE_SPELL==TYPE_SPELL and c:IsSetCard(0x95) and c:IsAbleToGraveAsCost()
and c:CheckActivateEffect(true,true,false)~=nil
end
function c100426006.cptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return c:IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(c100426006.cpfilter,tp,LOCATION_HAND,0,1,nil)
end
e:SetLabel(0)
Duel.Remove(c,POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100426006.cpfilter,tp,LOCATION_HAND,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(true,true,true)
Duel.SendtoGrave(g,REASON_COST)
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
end
function c100426006.cpop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
--不朽の七皇
--
--Script by Trishula9
function c100426007.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--choose
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,100426007)
e2:SetTarget(c100426007.target)
e2:SetOperation(c100426007.operation)
c:RegisterEffect(e2)
end
function c100426007.filter(c)
local m=_G["c"..c:GetCode()]
if not m then return false end
local no=m.xyz_number
return no and no>=101 and no<=107 and c:IsSetCard(0x48) and c:IsType(TYPE_XYZ)
end
function c100426007.cfilter(c)
if not c:IsType(TYPE_XYZ) then return false end
if c100426007.filter(c) then return true end
local g=c:GetOverlayGroup()
return g:IsExists(c100426007.filter,1,nil)
end
function c100426007.disfilter(c,atk)
return aux.NegateMonsterFilter(c) and c:IsAttackBelow(atk)
end
function c100426007.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100426007.cfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100426007.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c100426007.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
local s=0
local b1=Duel.IsExistingMatchingCard(c100426007.disfilter,tp,0,LOCATION_MZONE,1,nil,tc:GetAttack())
local b2=tc:GetOverlayGroup():GetCount()>0
if b1 and not b2 then
s=Duel.SelectOption(tp,aux.Stringid(100426007,0))
end
if not b1 and b2 then
s=Duel.SelectOption(tp,aux.Stringid(100426007,1))+1
end
if b1 and b2 then
s=Duel.SelectOption(tp,aux.Stringid(100426007,0),aux.Stringid(100426007,1))
end
e:SetLabel(s)
if s==0 then
e:SetCategory(0)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
end
end
function c100426007.operation(e,tp,eg,ep,ev,re,r,rp)
local s=e:GetLabel()
local tc=Duel.GetFirstTarget()
if s==0 then
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
local sg=Duel.GetMatchingGroup(c100426007.disfilter,tp,0,LOCATION_MZONE,nil,tc:GetAttack())
if sg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local sc=sg:Select(tp,1,1,nil):GetFirst()
if sc and not sc:IsImmuneToEffect(e) then
Duel.NegateRelatedChain(sc,RESET_TURN_SET)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
sc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
sc:RegisterEffect(e2)
end
end
end
if s==1 then
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local og=tc:GetOverlayGroup()
if og:GetCount()>0 and Duel.SendtoGrave(og,REASON_EFFECT)>0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c100426007.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(100426007,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local ng=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100426007.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if ng:GetCount()>0 then
Duel.BreakEffect()
Duel.SpecialSummon(ng,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
end
function c100426007.spfilter(c,e,tp)
return c:IsType(TYPE_XYZ) and c:IsSetCard(0x48) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
--大要塞クジラ
--
--Script by JustFish
function c100426016.initial_effect(c)
aux.AddCodeList(c,22702055)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100426016,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100426016)
e1:SetCondition(c100426016.dacon)
e1:SetTarget(c100426016.datg)
e1:SetOperation(c100426016.daop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100426016,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_BATTLE_START)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100426016+100)
e2:SetCondition(c100426016.descon)
e2:SetTarget(c100426016.destg)
e2:SetOperation(c100426016.desop)
c:RegisterEffect(e2)
--Special Summon or tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100426016,2))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES+CATEGORY_GRAVE_SPSUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,100426016+200)
e3:SetCondition(c100426016.spcon)
e3:SetTarget(c100426016.sptg)
e3:SetOperation(c100426016.spop)
c:RegisterEffect(e3)
end
function c100426016.dacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP() and Duel.IsEnvironment(22702055)
end
function c100426016.datg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,100426016)==0 end
end
function c100426016.daop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c100426016.target)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,100426016,RESET_PHASE+PHASE_END,0,1)
end
function c100426016.target(e,c)
return c:IsAttribute(ATTRIBUTE_WATER)
end
function c100426016.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE and Duel.GetTurnPlayer()==1-tp
end
function c100426016.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) 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_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100426016.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
function c100426016.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 c100426016.spfilter(c,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_WATER) and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))
end
function c100426016.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100426016.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c100426016.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100426016.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tc=g:GetFirst()
if tc then
if tc:IsAbleToHand() and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) or ft<=0 or Duel.SelectOption(tp,1190,1152)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--海竜神-リバイアサン
--
--Script by Trishula9
function c100426017.initial_effect(c)
aux.AddCodeList(c,22702055)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100426017)
e1:SetTarget(c100426017.thtg)
e1:SetOperation(c100426017.thop)
c:RegisterEffect(e1)
--adjust
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c100426017.condition)
e2:SetOperation(c100426017.adjustop)
c:RegisterEffect(e2)
--cannot summon,spsummon,flipsummon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCondition(c100426017.condition)
e3:SetTargetRange(1,1)
e3:SetTarget(c100426017.sumlimit)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_SUMMON)
c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
c:RegisterEffect(e5)
end
c100426017[0]=0
c100426017[1]=0
function c100426017.thfilter(c)
return (c:IsCode(22702055) or c:IsSetCard(0x275,0x276) and c:IsType(TYPE_SPELL+TYPE_TRAP) or c:IsCode(82685480,98804359,19089195)) and c:IsAbleToHand()
end
function c100426017.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100426017.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100426017.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100426017.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
function c100426017.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(22702055)
end
function c100426017.sumlimit(e,c,sump,sumtype,sumpos,targetp)
if sumpos and bit.band(sumpos,POS_FACEDOWN)>0 then return false end
return not c:IsAttribute(ATTRIBUTE_WATER) and c100426017[targetp or sump]==1
end
function c100426017.wtfilter(c)
return not c:IsAttribute(ATTRIBUTE_WATER) and c:IsFaceup()
end
function c100426017.rmfilter(c,at)
return c:GetAttribute()==at
end
function c100426017.tgselect(sg,g)
return #(g-sg)==1 and not sg:IsExists(c100426017.rmfilter,1,nil,ATTRIBUTE_WATER)
end
function c100426017.adjustop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL then return end
local g1=Duel.GetMatchingGroup(c100426017.wtfilter,tp,LOCATION_MZONE,0,nil)
local g2=Duel.GetMatchingGroup(c100426017.wtfilter,tp,0,LOCATION_MZONE,nil)
local c=e:GetHandler()
if g1:GetCount()==0 then c100426017[tp]=0
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g1:SelectSubGroup(tp,c100426017.tgselect,false,#g1-1,#g1-1,g1)
if sg then
g1:Sub(g1-sg)
else
g1:Sub(g1)
end
c100426017[tp]=1
end
if g2:GetCount()==0 then c100426017[1-tp]=0
else
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local sg=g2:SelectSubGroup(1-tp,c100426017.tgselect,false,#g2-1,#g2-1,g2)
if sg then
g2:Sub(g2-sg)
else
g2:Sub(g2)
end
c100426017[1-tp]=1
end
g1:Merge(g2)
if g1:GetCount()>0 then
Duel.SendtoGrave(g1,REASON_RULE)
Duel.Readjust()
end
end
--デス・クラーケン
--
--Script by JustFish
function c100426018.initial_effect(c)
aux.AddCodeList(c,22702055)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100426018,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,100426018)
e1:SetCondition(c100426018.spcon)
e1:SetTarget(c100426018.sptg)
e1:SetOperation(c100426018.spop)
c:RegisterEffect(e1)
--NegateAttack
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100426018,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCountLimit(1,100426018+100)
e2:SetCondition(c100426018.thcon)
e2:SetTarget(c100426018.thtg)
e2:SetOperation(c100426018.thop)
c:RegisterEffect(e2)
end
function c100426018.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(22702055)
end
function c100426018.thfilter(c)
return c:IsFaceup() and not c:IsCode(100426018) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToHand()
end
function c100426018.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c100426018.thfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectTarget(tp,c100426018.thfilter,tp,LOCATION_MZONE,0,1,1,nil)
e:SetLabelObject(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g2,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100426018.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local hc=e:GetLabelObject()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local tc=g:GetFirst()
if tc==hc then tc=g:GetNext() end
if hc:IsRelateToEffect(e) and hc:IsControler(tp)
and Duel.SendtoHand(hc,nil,REASON_EFFECT)~=0 and hc:IsLocation(LOCATION_HAND)
and tc:IsRelateToEffect(e) and tc:IsControler(1-tp) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
function c100426018.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function c100426018.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c100426018.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)>0 and c:IsLocation(LOCATION_HAND) then
Duel.NegateAttack()
end
end
--電気海月-フィサリア-
--
--Script by JustFish
function c100426019.initial_effect(c)
aux.AddCodeList(c,22702055)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100426019,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100426019)
e1:SetCost(c100426019.spcost)
e1:SetTarget(c100426019.sptg)
e1:SetOperation(c100426019.spop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100426019,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetCountLimit(1,100426019+100)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c100426019.discon)
e2:SetTarget(c100426019.distg)
e2:SetOperation(c100426019.disop)
c:RegisterEffect(e2)
end
function c100426019.cfilter(c)
return c:IsCode(22702055) and c:IsAbleToGraveAsCost() and (not c:IsOnField() or c:IsFaceup())
end
function c100426019.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100426019.cfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100426019.cfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c100426019.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100426019.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100426019.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100426019.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100426019.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100426019.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(22702055)
and ep==1-tp and re:IsActiveType(TYPE_SPELL+TYPE_MONSTER) and Duel.IsChainDisablable(ev)
end
function c100426019.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c100426019.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.NegateEffect(ev) and c:IsRelateToEffect(e) and c:IsFaceup()
and Duel.SelectYesNo(tp,aux.Stringid(100426019,2)) then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(600)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
end
end
--魚群探知機
--
--Script by JustFish
function c100426020.initial_effect(c)
aux.AddCodeList(c,22702055)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100426020+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100426020.target)
e1:SetOperation(c100426020.activate)
c:RegisterEffect(e1)
end
function c100426020.filter(c)
return c:IsAbleToHand() and c:IsLevelBelow(7)
and (aux.IsCodeListed(c,22702055) or (c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_WATER)))
end
function c100426020.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100426020.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100426020.spfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100426020.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100426020.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
if Duel.IsEnvironment(22702055) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100426020.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(100426020,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c100426020.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--潜海奇襲II
--
--Script by JustFish
function c100426021.initial_effect(c)
aux.AddCodeList(c,22702055)
--code
aux.EnableChangeCode(c,22702055,LOCATION_SZONE+LOCATION_GRAVE)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--cannot be target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_SZONE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c100426021.eftg)
e1:SetValue(c100426021.efilter)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100426021,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,100426021)
e2:SetTarget(c100426021.sptg)
e2:SetOperation(c100426021.spop)
c:RegisterEffect(e2)
end
function c100426021.eftg(e,c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER)
end
function c100426021.efilter(e,re,rp)
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and rc:IsControler(1-e:GetHandlerPlayer()) and not rc:IsAttribute(ATTRIBUTE_WATER)
end
function c100426021.spfilter(c,e,tp)
return (aux.IsCodeListed(c,22702055) or (c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_WATER)))
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100426021.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100426021.spfilter,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 c100426021.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100426021.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)~=0 then
local fid=c:GetFieldID()
tc:RegisterFlagEffect(100426021,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c100426021.descon)
e1:SetOperation(c100426021.desop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c100426021.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return tc:GetFlagEffectLabel(100426021)==e:GetLabel()
end
function c100426021.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT)
end
--暗岩の海竜神
--
--Script by JustFish
function c100426022.initial_effect(c)
aux.AddCodeList(c,22702055)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100426022+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCost(c100426022.cost)
e1:SetTarget(c100426022.target)
e1:SetOperation(c100426022.activate)
c:RegisterEffect(e1)
end
function c100426022.cfilter(c)
return c:IsCode(22702055) and c:IsAbleToGraveAsCost() and c:IsFaceup()
end
function c100426022.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100426022.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100426022.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c100426022.spfilter(c,e,tp)
return (aux.IsCodeListed(c,22702055) or (c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_WATER)))
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100426022.spfilter1(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsLevelBelow(6) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100426022.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100426022.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 c100426022.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=math.min(2,(Duel.GetLocationCount(tp,LOCATION_MZONE)))
if ft>0 then
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local tg=Duel.GetMatchingGroup(c100426022.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=tg:SelectSubGroup(tp,aux.dncheck,false,1,ft)
if g1 then
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g2=Duel.GetMatchingGroup(c100426022.spfilter1,tp,LOCATION_HAND+LOCATION_DECK,0,nil,e,tp)
if ft1>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
if ft1>0 and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,1,nil)
and #g2>0 and Duel.SelectYesNo(tp,aux.Stringid(100426022,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g3=g2:Select(tp,1,ft1,nil)
if g3 then
Duel.SpecialSummon(g3,0,tp,tp,false,false,POS_FACEUP)
end
end
end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
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(c100426022.splimit)
if Duel.GetTurnPlayer()==tp then
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end
Duel.RegisterEffect(e1,tp)
end
end
function c100426022.splimit(e,c)
return not c:IsAttribute(ATTRIBUTE_WATER)
end
--海晶乙女スプリンガール
--
--Script by JustFish
function c100426031.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100426031,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100426031)
e1:SetCost(c100426031.spcost)
e1:SetTarget(c100426031.sptg)
e1:SetOperation(c100426031.spop)
c:RegisterEffect(e1)
--mill
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100426031,1))
e2:SetCategory(CATEGORY_DECKDES+CATEGORY_TOGRAVE+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCountLimit(1,100426031+100)
e2:SetCondition(c100426031.tgcon)
e2:SetTarget(c100426031.tgtg)
e2:SetOperation(c100426031.tgop)
c:RegisterEffect(e2)
end
function c100426031.cfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x12b)
end
function c100426031.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100426031.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,c100426031.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c100426031.sptg(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 c100426031.spop(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)
end
end
function c100426031.tgcon(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 c100426031.ctfilter(c)
return c:IsFaceup() and c:IsSetCard(0x12b)
end
function c100426031.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(c100426031.ctfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return ct>0 and Duel.IsPlayerCanDiscardDeck(tp,ct) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,ct)
end
function c100426031.ctfilter2(c)
return c:IsLocation(LOCATION_GRAVE) and c:IsSetCard(0x12b)
end
function c100426031.tgop(e,tp,eg,ep,ev,re,r,rp)
local ct1=Duel.GetMatchingGroupCount(c100426031.ctfilter,tp,LOCATION_MZONE,0,nil)
if ct1>0 then
if Duel.DiscardDeck(tp,ct1,REASON_EFFECT)~=0 then
local og=Duel.GetOperatedGroup()
local ct2=og:FilterCount(c100426031.ctfilter2,nil)
if ct2>0 then
Duel.Damage(1-tp,ct2*200,REASON_EFFECT)
end
end
end
end
--海晶乙女スリーピーメイデン
--
--Script by JustFish
function c100426032.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100426032,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100426032)
e1:SetTarget(c100426032.sptg)
e1:SetOperation(c100426032.spop)
c:RegisterEffect(e1)
--equip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100426032,1))
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100426032+100)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c100426032.eqtg)
e2:SetOperation(c100426032.eqop)
c:RegisterEffect(e2)
end
function c100426032.filter(c)
return c:IsFaceup() and c:IsSetCard(0x12b)
end
function c100426032.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c100426032.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100426032.filter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100426032.filter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c100426032.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and c:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
c:SetCardTarget(tc)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_TARGET)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(aux.indoval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
function c100426032.tgfilter(c)
return c:IsFaceup() and c:IsSetCard(0x12b) and c:IsType(TYPE_LINK)
end
function c100426032.eqfilter(c)
return c:IsSetCard(0x12b) and c:IsType(TYPE_LINK) and not c:IsForbidden()
end
function c100426032.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100426032.tgfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c100426032.tgfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c100426032.eqfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c100426032.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_GRAVE)
end
function c100426032.eqop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100426032.eqfilter),tp,LOCATION_GRAVE,0,1,1,nil)
local ec=g:GetFirst()
if ec then
if not Duel.Equip(tp,ec,tc) then return end
--equip limit
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetLabelObject(tc)
e1:SetValue(c100426032.eqlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
ec:RegisterEffect(e1)
end
end
end
function c100426032.eqlimit(e,c)
return c==e:GetLabelObject()
end
--海晶乙女コーラルトライアング
--
--Script by Trishula9
function c100426033.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x12b),2)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100426033)
e1:SetCost(c100426033.thcost)
e1:SetTarget(c100426033.thtg)
e1:SetOperation(c100426033.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100426033+100)
e2:SetCondition(c100426033.spcon)
e2:SetCost(c100426033.spcost)
e2:SetTarget(c100426033.sptg)
e2:SetOperation(c100426033.spop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(100426033,ACTIVITY_SPSUMMON,c100426033.counterfilter)
end
function c100426033.counterfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER)
end
function c100426033.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(100426033,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c100426033.splimit)
Duel.RegisterEffect(e1,tp)
end
function c100426033.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsAttribute(ATTRIBUTE_WATER)
end
function c100426033.costfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost()
end
function c100426033.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c100426033.cost(e,tp,eg,ep,ev,re,r,rp,0)
and Duel.IsExistingMatchingCard(c100426033.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100426033.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
c100426033.cost(e,tp,eg,ep,ev,re,r,rp,1)
end
function c100426033.thfilter(c)
return c:IsSetCard(0x12b) and c:IsType(TYPE_TRAP) and c:IsAbleToHand()
end
function c100426033.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100426033.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100426033.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100426033.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
function c100426033.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
end
function c100426033.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c100426033.cost(e,tp,eg,ep,ev,re,r,rp,0)
and e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
c100426033.cost(e,tp,eg,ep,ev,re,r,rp,1)
end
function c100426033.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100426033.fselect(sg)
return sg:GetSum(Card.GetLink)==3
end
function c100426033.gcheck(sg)
return sg:GetSum(Card.GetLink)<=3
end
function c100426033.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(c100426033.spfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e,tp)
if chk==0 then
if ft<=0 then return false end
aux.GCheckAdditional=c100426033.gcheck
local res=g:CheckSubGroup(c100426033.fselect,1,ft)
aux.GCheckAdditional=nil
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c100426033.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if ft>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c100426033.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
aux.GCheckAdditional=c100426033.gcheck
local sg=g:SelectSubGroup(tp,c100426033.fselect,false,1,ft)
aux.GCheckAdditional=nil
if sg then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
--海晶乙女アクア・アルゴノート
--
--Script by JustFish
function c100426034.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkAttribute,ATTRIBUTE_WATER),2,4)
c:EnableReviveLimit()
--atk limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetCondition(c100426034.atlcon)
e1:SetValue(c100426034.atlimit)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100426034,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100426034)
e2:SetTarget(c100426034.thtg)
e2:SetOperation(c100426034.thop)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100426034,1))
e3:SetCategory(CATEGORY_DISABLE+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetCountLimit(1,100426034+100)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c100426034.discon)
e3:SetTarget(c100426034.distg)
e3:SetOperation(c100426034.disop)
c:RegisterEffect(e3)
end
function c100426034.atlcon(e)
return e:GetHandler():GetSequence()>4
end
function c100426034.atlimit(e,c)
return c~=e:GetHandler()
end
function c100426034.thfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToHand()
end
function c100426034.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c100426034.thfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectTarget(tp,c100426034.thfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g2=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,2,0,0)
end
function c100426034.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
end
end
function c100426034.discon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return Duel.GetTurnPlayer()==1-tp and bit.band(loc,LOCATION_SZONE)~=0
and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainDisablable(ev)
end
function c100426034.spfilter(c,e,tp,ec)
return c:IsSetCard(0x12b) and c:GetEquipTarget()==ec and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100426034.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100426034.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c100426034.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100426034.spfilter,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
Duel.NegateEffect(ev)
end
end
\ No newline at end of file
--海晶乙女の潜逅
--
--Script by JustFish
function c100426035.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100426035+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100426035.target)
e1:SetOperation(c100426035.activate)
c:RegisterEffect(e1)
end
function c100426035.spfilter(c,e,tp)
return c:IsSetCard(0x12b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsType(TYPE_LINK)
end
function c100426035.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100426035.spfilter(chkc,e,tp) end
local b1=Duel.IsExistingTarget(c100426035.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(c100426035.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.IsEnvironment(91027843,tp,LOCATION_FZONE)
if chk==0 then return (b1 or b2) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(100426035,0),aux.Stringid(100426035,1))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(100426035,0))
else
op=Duel.SelectOption(tp,aux.Stringid(100426035,1))+1
end
e:SetLabel(op)
if op==0 then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100426035.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
else
e:SetProperty(0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
end
function c100426035.activate(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==0 then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
else
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100426035.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
end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
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(c100426035.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c100426035.splimit(e,c)
return not c:IsAttribute(ATTRIBUTE_WATER)
end
--海晶乙女環流
--
--Script by JustFish
function c100426036.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOEXTRA+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetTarget(c100426036.target)
e1:SetOperation(c100426036.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(c100426036.handcon)
c:RegisterEffect(e2)
end
function c100426036.texfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_LINK) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToExtra()
and Duel.IsExistingMatchingCard(c100426036.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function c100426036.spfilter(c,e,tp,rc)
return c:IsSetCard(0x12b) and c:IsType(TYPE_LINK) and c:IsLink(rc:GetLink()) and not c:IsCode(rc:GetCode())
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_LINK,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,rc,c)>0
end
function c100426036.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100426036.texfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c100426036.texfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
Duel.SelectTarget(tp,c100426036.texfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100426036.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_EXTRA) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100426036.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc)
local sc=g:GetFirst()
if sc then
sc:SetMaterial(nil)
if Duel.SpecialSummon(sc,SUMMON_TYPE_LINK,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
sc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
sc:RegisterEffect(e2,true)
sc:CompleteProcedure()
end
end
end
end
function c100426036.hcfilter(c)
return c:IsFaceup() and c:IsSetCard(0x12b) and c:IsLinkAbove(3)
end
function c100426036.handcon(e)
return Duel.IsExistingMatchingCard(c100426036.hcfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
--海晶乙女渦輪
--
--Script by JustFish
function c100426037.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCountLimit(1,100426037+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100426037.target)
e1:SetOperation(c100426037.activate)
c:RegisterEffect(e1)
--extra attack
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.bpcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c100426037.attg)
e2:SetOperation(c100426037.atop)
c:RegisterEffect(e2)
end
function c100426037.spfilter(c,e,tp)
return c:IsCode(67712104) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (c:IsLocation(LOCATION_GRAVE) and Duel.GetMZoneCount(tp)>0
or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0)
end
function c100426037.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100426037.spfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_EXTRA)
end
function c100426037.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c100426037.spfilter),tp,LOCATION_GRAVE+LOCATION_EXTRA,0,nil,e,tp)
if Duel.NegateAttack() and #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100426037.tgfilter(c)
return c:IsFaceup() and c:IsSetCard(0x12b) and c:IsType(TYPE_LINK) and c:IsLinkAbove(2)
end
function c100426037.attg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100426037.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100426037.tgfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100426037.tgfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c100426037.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(tc:GetLink()-1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_NO_BATTLE_DAMAGE)
e2:SetCondition(c100426037.damcon)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetOwnerPlayer(tp)
tc:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e3:SetCondition(c100426037.damcon2)
e3:SetValue(1)
tc:RegisterEffect(e3)
end
end
function c100426037.damcon(e)
return e:GetHandlerPlayer()==e:GetOwnerPlayer()
end
function c100426037.damcon2(e)
return 1-e:GetHandlerPlayer()==e:GetOwnerPlayer()
end
--Heritage of the Light
--script by Raye
function c101106000.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101106000,0))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,101106000)
e2:SetCondition(c101106000.drcon)
e2:SetTarget(c101106000.drtg)
e2:SetOperation(c101106000.drop)
c:RegisterEffect(e2)
end
function c101106000.typfilter(c,sumtype)
return c:IsFaceup() and c:GetType()&sumtype>0
end
function c101106000.cfilter(c,tp)
local sumtype=bit.band(c:GetType(),TYPE_RITUAL|TYPE_FUSION|TYPE_SYNCHRO|TYPE_XYZ)
return c:IsFaceup()
and (c:IsSummonType(SUMMON_TYPE_RITUAL) or c:IsSummonType(SUMMON_TYPE_FUSION)
or c:IsSummonType(SUMMON_TYPE_SYNCHRO) or c:IsSummonType(SUMMON_TYPE_XYZ))
and Duel.IsExistingMatchingCard(c101106000.typfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,sumtype)
end
function c101106000.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101106000.cfilter,1,nil,tp)
end
function c101106000.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c101106000.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--Night Sword Serpent
--Scripted by: XGlitchy30
function c101106081.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101106081,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,101106081)
e1:SetCondition(c101106081.spcon)
e1:SetTarget(c101106081.sptg)
e1:SetOperation(c101106081.spop)
c:RegisterEffect(e1)
end
function c101106081.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function c101106081.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101106081.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
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_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
--D.D. Assault Carrier
--script by Raye
function c101106082.initial_effect(c)
--attack cost
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ATTACK_COST)
e1:SetCost(c101106082.atcost)
e1:SetOperation(c101106082.atop)
c:RegisterEffect(e1)
--sp summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101106082,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,101106082)
e2:SetCondition(c101106082.spcon)
e2:SetTarget(c101106082.sptg)
e2:SetOperation(c101106082.spop)
c:RegisterEffect(e2)
end
function c101106082.atcost(e,c,tp)
return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,0,1,nil)
end
function c101106082.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c101106082.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_REMOVED,0,nil)==3
end
function c101106082.sptg(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 c101106082.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--Abyss Keeper
--Scripted by: XGlitchy30
function c101106083.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkAttribute,ATTRIBUTE_WATER),2,2)
c:EnableReviveLimit()
--cannot link material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetCondition(c101106083.linkcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101106083,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,101106083)
e2:SetCondition(c101106083.condition)
e2:SetTarget(c101106083.target)
e2:SetOperation(c101106083.operation)
c:RegisterEffect(e2)
--banish
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101106083,1))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,101106083+100)
e3:SetTarget(c101106083.rmtg)
e3:SetOperation(c101106083.rmop)
c:RegisterEffect(e3)
end
function c101106083.linkcon(e)
local c=e:GetHandler()
return c:IsStatus(STATUS_SPSUMMON_TURN) and c:IsSummonType(SUMMON_TYPE_LINK)
end
function c101106083.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c101106083.filter(c,e,tp,zone)
return c:IsRace(RACE_FISH) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c101106083.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local zone=e:GetHandler():GetLinkedZone(tp)
return Duel.IsExistingMatchingCard(c101106083.filter,tp,LOCATION_HAND,0,1,nil,e,tp,zone)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c101106083.operation(e,tp,eg,ep,ev,re,r,rp)
local zone=e:GetHandler():GetLinkedZone(tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101106083.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,zone)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP,zone)
end
end
end
function c101106083.rmfilter(c,tp)
return c:IsFaceup() and c:IsRace(RACE_FISH) and c:IsAbleToRemove()
and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,c)
end
function c101106083.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c101106083.rmfilter,tp,LOCATION_MZONE,0,1,e:GetHandler(),tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectTarget(tp,c101106083.rmfilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler(),tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,g1)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g1,#g1,0,0)
end
function c101106083.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if #g>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
--Apex Predation
--Scripted by: XGlitchy30
function c101106084.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101106084,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101106084+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(c101106084.condition)
e1:SetTarget(c101106084.target)
e1:SetOperation(c101106084.activate)
c:RegisterEffect(e1)
end
function c101106084.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsSummonType,tp,LOCATION_MZONE,0,1,nil,SUMMON_TYPE_NORMAL)
end
function c101106084.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsSummonType,tp,LOCATION_MZONE,LOCATION_MZONE,nil,SUMMON_TYPE_SPECIAL)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
end
function c101106084.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
local ct=(Duel.GetTurnPlayer()==tp) and 2 or 1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,ct)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e2,tp)
end
local g=Duel.GetMatchingGroup(Card.IsSummonType,tp,LOCATION_MZONE,LOCATION_MZONE,nil,SUMMON_TYPE_SPECIAL)
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--Beetrooper Assault Roller
--Scripted by: XGlitchy30
function c101106085.initial_effect(c)
--spsummon proc
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,101106085+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c101106085.spcon)
e1:SetOperation(c101106085.spop)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(c101106085.atkup)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYED)
e3:SetCountLimit(1,101106085+100)
e3:SetTarget(c101106085.sctg)
e3:SetOperation(c101106085.scop)
c:RegisterEffect(e3)
end
function c101106085.spcostfilter1(c)
return c:IsAbleToRemoveAsCost() and c:IsRace(RACE_INSECT)
end
function c101106085.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
if Duel.GetMZoneCount(tp)<=0 then return false end
local g=Duel.GetMatchingGroup(c101106085.spcostfilter1,tp,LOCATION_GRAVE,0,nil)
return #g>0
end
function c101106085.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c101106085.spcostfilter1,tp,LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
if #sg>0 then
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
end
function c101106085.atkfilter(c)
return c:IsFaceup() and c:IsRace(RACE_INSECT)
end
function c101106085.atkup(e,c)
return Duel.GetMatchingGroupCount(c101106085.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,e:GetHandler())*200
end
function c101106085.filter(c)
return c:IsSetCard(0x170) and c:IsType(TYPE_MONSTER) and not c:IsCode(101106085) and c:IsAbleToHand()
end
function c101106085.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101106085.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101106085.scop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101106085.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
--Beetrooper Light Flapper
--Scripted by: XGlitchy30
function c101106086.initial_effect(c)
--add
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101106086,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,101106086)
e1:SetTarget(c101106086.thtg)
e1:SetOperation(c101106086.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101106086,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,101106086+100)
e3:SetCondition(c101106086.atkcon)
e3:SetTarget(c101106086.atktg)
e3:SetOperation(c101106086.atkop)
c:RegisterEffect(e3)
end
function c101106086.thfilter(c,e)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x170) and c:IsAbleToHand()
and (not c:IsLocation(LOCATION_REMOVED) or c:IsFaceup()) and c:IsCanBeEffectTarget(e)
end
function c101106086.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c101106086.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
if chk==0 then return g:GetClassCount(Card.GetCode)>=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=g:SelectSubGroup(tp,aux.dncheck,false,2,2)
Duel.SetTargetCard(g1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,#g1,0,0)
end
function c101106086.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
local tg=g:Filter(c101106086.check,nil,tp)
if #tg<=0 then return end
Duel.ConfirmCards(1-tp,tg)
local code_table={}
for tc in aux.Next(tg) do
local codes={tc:GetCode()}
for i=1,#codes do
table.insert(code_table,codes[i])
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetLabel(table.unpack(code_table))
e1:SetValue(c101106086.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c101106086.check(c)
return c:IsLocation(LOCATION_HAND) and c:IsControler(tp)
end
function c101106086.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel())
end
function c101106086.atkcon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at:GetControler()~=tp
end
function c101106086.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function c101106086.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)>0 and c:IsLocation(LOCATION_HAND) then
Duel.NegateAttack()
end
end
--Heavy Beetrooper Mighty Neptune
--Scripted by: XGlitchy30
function c101106087.initial_effect(c)
c:EnableReviveLimit()
--spsummon proc
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c101106087.sprcon)
e1:SetOperation(c101106087.sprop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101106087,0))
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,101106087)
e2:SetCondition(c101106087.spcon)
e2:SetTarget(c101106087.sptg)
e2:SetOperation(c101106087.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
--ATK boost
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101106087,1))
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c101106087.atktg)
e4:SetOperation(c101106087.atkop)
c:RegisterEffect(e4)
end
function c101106087.sprfilter(c)
return c:IsFaceup() and c:IsRace(RACE_INSECT) and c:IsAbleToDeckAsCost()
end
function c101106087.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101106087.sprfilter,tp,LOCATION_REMOVED,0,3,nil)
end
function c101106087.sprop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c101106087.sprfilter,tp,LOCATION_REMOVED,0,3,3,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function c101106087.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
and c:IsReason(REASON_EFFECT) and rp==1-tp and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c101106087.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101106087.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101106087.atkfilter(c)
return c:IsFaceup() and c:IsRace(RACE_INSECT)
end
function c101106087.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c101106087.atkfilter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c101106087.atkfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c101106087.atkfilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
end
function c101106087.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
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:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1000)
tc:RegisterEffect(e1)
end
end
--Ultra Beetrooper Absolute Hercules
--script by Raye
function c101106088.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsRace,RACE_INSECT),4,true)
--unaffected
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(c101106088.regcon)
e1:SetOperation(c101106088.regop)
c:RegisterEffect(e1)
--sp summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101106088,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetCountLimit(1,101106088)
e2:SetTarget(c101106088.sptg)
e2:SetOperation(c101106088.spop)
c:RegisterEffect(e2)
end
function c101106088.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c101106088.regop(e,tp,eg,ep,ev,re,r,rp)
--unaffected handle after it was summoned
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c101106088.efilter)
if Duel.GetTurnPlayer()==tp then
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,1)
end
e:GetHandler():RegisterEffect(e1)
end
function c101106088.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function c101106088.spfilter(c,e,tp)
return c:IsRace(RACE_INSECT) and c:IsAttackBelow(3000) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101106088.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101106088.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101106088.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101106088.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101106088.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
--Beetrooper Descent
--Scripted by: XGlitchy30
function c101106089.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101106089+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101106089.target)
e1:SetOperation(c101106089.activate)
c:RegisterEffect(e1)
end
function c101106089.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,64213018,0x170,TYPES_TOKEN_MONSTER,1000,1000,3,RACE_INSECT,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
end
function c101106089.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,64213018,0x170,TYPES_TOKEN_MONSTER,1000,1000,3,RACE_INSECT,ATTRIBUTE_EARTH) then return end
local token=Duel.CreateToken(tp,101106089+100)
local ec=aux.ExceptThisCard(e)
if Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)>0
and Duel.IsExistingMatchingCard(c101106089.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c101106089.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ec)
and Duel.SelectYesNo(tp,aux.Stringid(101106089,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=Duel.SelectMatchingCard(tp,c101106089.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,ec)
Duel.BreakEffect()
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
end
function c101106089.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_INSECT) and c:IsAttackAbove(3000)
end
function c101106089.dfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
--Beetrooper Landing
--Scripted by: XGlitchy30
function c101106090.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetDescription(aux.Stringid(101106090,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c101106090.target)
e1:SetOperation(c101106090.activate)
c:RegisterEffect(e1)
--recycle
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101106090,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101106090)
e2:SetCondition(aux.exccon)
e2:SetCost(c101106090.thcost)
e2:SetTarget(c101106090.thtg)
e2:SetOperation(c101106090.thop)
c:RegisterEffect(e2)
end
function c101106090.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c101106090.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_INSECT) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c101106090.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(c101106090.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c101106090.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c101106090.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c101106090.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c101106090.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c101106090.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2,SUMMON_TYPE_FUSION)
end
tc:CompleteProcedure()
end
end
function c101106090.cfilter(c)
return c:IsRace(RACE_INSECT) and c:IsAbleToRemoveAsCost()
end
function c101106090.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101106090.cfilter,tp,LOCATION_GRAVE,0,2,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101106090.cfilter,tp,LOCATION_GRAVE,0,2,2,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c101106090.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function c101106090.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
--Beetrooper Squad
--Scripted by: XGlitchy30
function c101106091.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101106091,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,101106091+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c101106091.cost)
e1:SetTarget(c101106091.target)
e1:SetOperation(c101106091.activate)
c:RegisterEffect(e1)
end
function c101106091.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c101106091.cfilter(c,tp)
return c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_TOKEN) and c:IsRace(RACE_INSECT) and c:GetBaseAttack()>=1000
and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
end
function c101106091.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,c101106091.cfilter,1,nil,tp)
and Duel.IsPlayerCanSpecialSummonMonster(tp,64213018,0x170,TYPES_TOKEN_MONSTER,1000,1000,3,RACE_INSECT,ATTRIBUTE_EARTH)
end
local g=Duel.SelectReleaseGroup(tp,c101106091.cfilter,1,1,nil,tp)
local atk=g:GetFirst():GetBaseAttack()
Duel.Release(g,REASON_COST)
e:SetLabel(math.floor(atk/1000))
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
end
function c101106091.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,64213018,0x170,TYPES_TOKEN_MONSTER,1000,1000,3,RACE_INSECT,ATTRIBUTE_EARTH) then return end
local ct=(Duel.IsPlayerAffectedByEffect(tp,59822133)) and 1 or math.min(ft,e:GetLabel())
local range={}
for i=1,ct do
table.insert(range,i)
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101106091,1))
local n=Duel.AnnounceNumber(tp,table.unpack(range))
local sg=Group.CreateGroup()
for i=1,n do
local token=Duel.CreateToken(tp,101106091+100)
sg:AddCard(token)
end
if #sg<=0 then return end
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
--海竜神-ネオダイダロス
function c10485110.initial_effect(c)
aux.AddCodeList(c,22702055)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c10485110.spcon)
e2:SetOperation(c10485110.spop)
c:RegisterEffect(e2)
--tograve
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10485110,0))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c10485110.cost)
e3:SetTarget(c10485110.target)
e3:SetOperation(c10485110.operation)
c:RegisterEffect(e3)
end
function c10485110.spcon(e,c)
if c==nil then return true end
return Duel.CheckReleaseGroup(c:GetControler(),Card.IsCode,1,nil,37721209)
end
function c10485110.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,nil,37721209)
Duel.Release(g,REASON_COST)
end
function c10485110.cfilter(c)
return c:IsFaceup() and c:IsCode(22702055) and c:IsAbleToGraveAsCost()
end
function c10485110.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10485110.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c10485110.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c10485110.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0xe,0xe,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0xe,0xe,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function c10485110.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0xe,0xe,aux.ExceptThisCard(e))
Duel.SendtoGrave(g,REASON_EFFECT)
end
--海神の巫女
function c17214465.initial_effect(c)
aux.AddCodeList(c,22702055)
--field
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CHANGE_ENVIRONMENT)
e1:SetValue(22702055)
c:RegisterEffect(e1)
end
--竜巻海流壁
function c18605135.initial_effect(c)
aux.AddCodeList(c,22702055)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c18605135.actcon)
c:RegisterEffect(e1)
--avoid battle damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetCondition(c18605135.abdcon)
c:RegisterEffect(e2)
--self destroy
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EFFECT_SELF_DESTROY)
e3:SetCondition(c18605135.sdcon)
c:RegisterEffect(e3)
end
function c18605135.check()
return Duel.IsEnvironment(22702055)
end
function c18605135.actcon(e,tp,eg,ep,ev,re,r,rp)
return c18605135.check()
end
function c18605135.abdcon(e)
local at=Duel.GetAttackTarget()
return c18605135.check() and (at==nil or at:IsAttackPos() or Duel.GetAttacker():GetAttack()>at:GetDefense())
end
function c18605135.sdcon(e)
return not c18605135.check()
end
--潜海奇襲
function c19089195.initial_effect(c)
aux.AddCodeList(c,22702055)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c19089195.activate)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(19089195,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetCondition(c19089195.econ)
e2:SetCost(c19089195.remcost)
e2:SetOperation(c19089195.remop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(19089195,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_BATTLE_START)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c19089195.descon)
e3:SetTarget(c19089195.destg)
e3:SetOperation(c19089195.desop)
c:RegisterEffect(e3)
end
function c19089195.filter(c,tp)
return c:IsCode(22702055) and (c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
and c:GetActivateEffect() and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function c19089195.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c19089195.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(19089195,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c19089195.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
local field=tc:IsType(TYPE_FIELD)
if field then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
else
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
if field then
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
end
end
function c19089195.econ(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(22702055)
end
function c19089195.costfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToRemoveAsCost()
end
function c19089195.remcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c19089195.costfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c19089195.costfilter,tp,LOCATION_MZONE,0,1,1,nil)
if Duel.Remove(g,POS_FACEUP,REASON_COST+REASON_TEMPORARY)~=0 then
local rc=g:GetFirst()
if rc:IsType(TYPE_TOKEN) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(rc)
e1:SetCountLimit(1)
e1:SetOperation(c19089195.retop)
Duel.RegisterEffect(e1,tp)
end
end
function c19089195.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
function c19089195.remop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_SPELL+TYPE_TRAP))
e1:SetValue(aux.indoval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c19089195.descon(e,tp,eg,ep,ev,re,r,rp)
if not c19089195.econ(e,tp,eg,ep,ev,re,r,rp) then return false end
local tc=Duel.GetAttacker()
local bc=Duel.GetAttackTarget()
if not bc then return false end
if tc:IsControler(1-tp) then tc,bc=bc,tc end
if tc:IsFaceup() and tc:GetOriginalLevel()>=5 and tc:IsAttribute(ATTRIBUTE_WATER) then
e:SetLabelObject(bc)
return true
else return false end
end
function c19089195.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local bc=e:GetLabelObject()
Duel.SetOperationInfo(0,CATEGORY_DESTROY,bc,1,0,0)
end
function c19089195.desop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetLabelObject()
if bc:IsRelateToBattle() then
Duel.Destroy(bc,REASON_EFFECT)
end
end
--伝説のフィッシャーマン二世
function c19801646.initial_effect(c)
aux.AddCodeList(c,22702055)
--code
aux.EnableChangeCode(c,3643300,LOCATION_MZONE+LOCATION_GRAVE)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c19801646.econ)
e2:SetValue(c19801646.efilter)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(19801646,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET)
e3:SetCondition(c19801646.thcon)
e3:SetTarget(c19801646.thtg)
e3:SetOperation(c19801646.thop)
c:RegisterEffect(e3)
end
function c19801646.efilter(e,te)
return te:IsActiveType(TYPE_MONSTER) and te:GetOwner()~=e:GetOwner()
end
function c19801646.econ(e)
return Duel.IsEnvironment(22702055)
end
function c19801646.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsReason(REASON_BATTLE) or (c:GetReasonPlayer()==1-tp and c:IsReason(REASON_EFFECT)))
and c:IsPreviousPosition(POS_FACEUP)
end
function c19801646.thfilter(c)
return c:IsLevel(7) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToHand()
end
function c19801646.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c19801646.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c19801646.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c19801646.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
--深海の戦士
function c24128274.initial_effect(c)
aux.AddCodeList(c,22702055)
--immune spell
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c24128274.econ)
e1:SetValue(c24128274.efilter)
c:RegisterEffect(e1)
end
function c24128274.econ(e)
return Duel.IsEnvironment(22702055)
end
function c24128274.efilter(e,te)
return te:IsActiveType(TYPE_SPELL)
end
--マーメイド・ナイト
function c24435369.initial_effect(c)
aux.AddCodeList(c,22702055)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetCondition(c24435369.dircon)
e1:SetValue(1)
c:RegisterEffect(e1)
end
function c24435369.dircon(e)
return Duel.IsEnvironment(22702055)
end
--幻煌龍の戦渦
function c34302287.initial_effect(c)
aux.AddCodeList(c,22702055)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(c34302287.condition)
e1:SetTarget(c34302287.target)
e1:SetOperation(c34302287.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(c34302287.handcon)
c:RegisterEffect(e2)
--equip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(34302287,0))
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c34302287.eqtg)
e3:SetOperation(c34302287.eqop)
c:RegisterEffect(e3)
end
function c34302287.cfilter(c)
return c:IsFacedown() or not c:IsType(TYPE_NORMAL)
end
function c34302287.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0
and not Duel.IsExistingMatchingCard(c34302287.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c34302287.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c34302287.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c34302287.handcon(e)
return Duel.IsEnvironment(22702055)
end
function c34302287.efilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_NORMAL)
and Duel.IsExistingMatchingCard(c34302287.eqfilter,tp,LOCATION_SZONE,0,1,nil,c)
end
function c34302287.eqfilter(c,tc)
return c:IsFaceup() and c:IsType(TYPE_EQUIP) and c:IsSetCard(0xfa) and c:CheckEquipTarget(tc)
end
function c34302287.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c34302287.efilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c34302287.efilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c34302287.efilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
end
function c34302287.eqop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c34302287.eqfilter,tp,LOCATION_SZONE,0,nil,tc)
local eq=g:GetFirst()
while eq do
Duel.Equip(tp,eq,tc,true,true)
eq=g:GetNext()
end
Duel.EquipComplete()
end
--伝説のフィッシャーマン
function c3643300.initial_effect(c)
aux.AddCodeList(c,22702055)
--immune spell
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c3643300.econ)
e1:SetValue(c3643300.efilter)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_IGNORE_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c3643300.econ)
e2:SetValue(aux.imval1)
c:RegisterEffect(e2)
end
function c3643300.econ(e)
return Duel.IsEnvironment(22702055)
end
function c3643300.efilter(e,te)
return te:IsActiveType(TYPE_SPELL)
end
--海竜-ダイダロス
function c37721209.initial_effect(c)
aux.AddCodeList(c,22702055)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(37721209,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c37721209.cost)
e1:SetTarget(c37721209.target)
e1:SetOperation(c37721209.operation)
c:RegisterEffect(e1)
end
function c37721209.cfilter(c)
return c:IsFaceup() and c:IsCode(22702055) and c:IsAbleToGraveAsCost()
end
function c37721209.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c37721209.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c37721209.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c37721209.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c37721209.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(g,REASON_EFFECT)
end
--忘却の海底神殿
function c43889633.initial_effect(c)
aux.AddCodeList(c,22702055)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--instant(chain)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(43889633,1))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetTarget(c43889633.target)
e2:SetOperation(c43889633.operation)
c:RegisterEffect(e2)
--code
aux.EnableChangeCode(c,22702055)
end
function c43889633.filter(c)
return c:IsFaceup() and c:IsLevelBelow(4) and c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA) and c:IsAbleToRemove()
end
function c43889633.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c43889633.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c43889633.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c43889633.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c43889633.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_REMOVED) then
tc:RegisterFlagEffect(43889634,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_SELF_TURN,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(43889633,2))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_SZONE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetCondition(c43889633.spcon)
e1:SetTarget(c43889633.sptg)
e1:SetOperation(c43889633.spop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_SELF_TURN)
e:GetHandler():RegisterEffect(e1)
end
end
function c43889633.spcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return tc and tc:GetFlagEffect(43889634)~=0 and Duel.GetTurnPlayer()==tp
end
function c43889633.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetLabelObject()
Duel.SetTargetCard(tc)
e:SetLabelObject(nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0)
end
function c43889633.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--幻煌龍の浸渦
function c61397885.initial_effect(c)
aux.AddCodeList(c,22702055)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE+CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP+TIMINGS_CHECK_MONSTER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c61397885.condition)
e1:SetTarget(c61397885.target)
e1:SetOperation(c61397885.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(c61397885.handcon)
c:RegisterEffect(e2)
--equip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(61397885,0))
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c61397885.eqtg)
e3:SetOperation(c61397885.eqop)
c:RegisterEffect(e3)
end
function c61397885.cfilter(c)
return c:IsFacedown() or not c:IsType(TYPE_NORMAL)
end
function c61397885.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0
and not Duel.IsExistingMatchingCard(c61397885.cfilter,tp,LOCATION_MZONE,0,1,nil)
and aux.dscon()
end
function c61397885.mfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end
function c61397885.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c61397885.mfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c61397885.mfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c61397885.mfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c61397885.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(-1000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_DISABLE_EFFECT)
e4:SetValue(RESET_TURN_SET)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e4)
end
end
function c61397885.handcon(e)
return Duel.IsEnvironment(22702055)
end
function c61397885.efilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_NORMAL)
and Duel.IsExistingMatchingCard(c61397885.eqfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,c)
end
function c61397885.eqfilter(c,tc)
return c:IsType(TYPE_EQUIP) and c:IsSetCard(0xfa) and c:CheckEquipTarget(tc)
end
function c61397885.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c61397885.efilter(chkc,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c61397885.efilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c61397885.efilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
end
function c61397885.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c61397885.eqfilter),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,tc)
local eq=g:GetFirst()
if eq then
Duel.Equip(tp,eq,tc)
end
end
--水陸両用バグロス MK-3
function c64342551.initial_effect(c)
aux.AddCodeList(c,22702055)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetCondition(c64342551.dircon)
c:RegisterEffect(e1)
end
function c64342551.dircon(e)
return Duel.IsEnvironment(22702055)
end
--コダロス
function c65496056.initial_effect(c)
aux.AddCodeList(c,22702055)
--send to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(65496056,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c65496056.cost)
e1:SetTarget(c65496056.target)
e1:SetOperation(c65496056.operation)
c:RegisterEffect(e1)
end
function c65496056.cfilter(c)
return c:IsFaceup() and c:IsCode(22702055) and c:IsAbleToGraveAsCost()
end
function c65496056.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c65496056.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c65496056.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c65496056.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsAbleToGrave() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function c65496056.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoGrave(g,REASON_EFFECT)
end
--海竜神の怒り
function c82685480.initial_effect(c)
aux.AddCodeList(c,22702055)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,82685480+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(c82685480.condition)
e1:SetTarget(c82685480.target)
e1:SetOperation(c82685480.activate)
c:RegisterEffect(e1)
end
function c82685480.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(22702055)
end
function c82685480.filter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:GetOriginalLevel()>=5
end
function c82685480.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) end
local ct=Duel.GetMatchingGroupCount(c82685480.filter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return ct>0 and Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c82685480.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()==0 then return end
if Duel.Destroy(g,REASON_EFFECT)==0 then return end
local val=0
local og=Duel.GetOperatedGroup()
local tc=og:GetFirst()
while tc do
val=val|aux.SequenceToGlobal(tc:GetPreviousControler(),LOCATION_MZONE,tc:GetPreviousSequence())
tc=og:GetNext()
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE_FIELD)
e1:SetValue(val)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
--魚雷魚
function c90337190.initial_effect(c)
aux.AddCodeList(c,22702055)
--immune spell
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c90337190.econ)
e1:SetValue(c90337190.efilter)
c:RegisterEffect(e1)
end
function c90337190.econ(e)
return Duel.IsEnvironment(22702055)
end
function c90337190.efilter(e,te)
return te:IsActiveType(TYPE_SPELL)
end
--砲弾ヤリ貝
function c95614612.initial_effect(c)
aux.AddCodeList(c,22702055)
--immune spell
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c95614612.econ)
e1:SetValue(c95614612.efilter)
c:RegisterEffect(e1)
end
function c95614612.econ(e)
return Duel.IsEnvironment(22702055)
end
function c95614612.efilter(e,te)
return te:IsActiveType(TYPE_SPELL)
end
--アビストローム
function c97697447.initial_effect(c)
aux.AddCodeList(c,22702055)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c97697447.cost)
e1:SetTarget(c97697447.target)
e1:SetOperation(c97697447.activate)
c:RegisterEffect(e1)
end
function c97697447.cfilter(c)
return c:IsFaceup() and c:IsCode(22702055)
end
function c97697447.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
local g=Duel.GetMatchingGroup(c97697447.cfilter,tp,LOCATION_ONFIELD,0,nil)
if chk==0 then return g:GetCount()>0 and g:FilterCount(Card.IsAbleToGraveAsCost,nil)==g:GetCount() end
Duel.SendtoGrave(g,REASON_COST)
end
function c97697447.filter(c,tp)
return (c:IsFacedown() or c:IsControler(1-tp) or not c:IsCode(22702055)) and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c97697447.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then
return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler(),TYPE_SPELL+TYPE_TRAP)
end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c97697447.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler(),tp)
end
e:SetLabel(0)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler(),TYPE_SPELL+TYPE_TRAP)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function c97697447.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e),TYPE_SPELL+TYPE_TRAP)
Duel.SendtoGrave(g,REASON_EFFECT)
end
--幻煌龍の天渦
function c97795930.initial_effect(c)
aux.AddCodeList(c,22702055)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c97795930.target)
e1:SetOperation(c97795930.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(c97795930.handcon)
c:RegisterEffect(e2)
--destroy replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_GRAVE)
e3:SetTarget(c97795930.reptg)
e3:SetValue(c97795930.repval)
e3:SetOperation(c97795930.repop)
c:RegisterEffect(e3)
end
function c97795930.filter(c)
return c:IsFaceup() and c:IsCode(56649609)
end
function c97795930.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c97795930.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c97795930.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c97795930.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c97795930.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:GetFlagEffect(97795931)>0 then return end
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
tc:RegisterFlagEffect(97795931,RESET_EVENT+RESETS_STANDARD,0,0)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(c97795930.wincon)
e1:SetOperation(c97795930.winop)
e1:SetOwnerPlayer(tp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function c97795930.winfilter(c)
return c:IsSetCard(0xfa) and c:IsType(TYPE_EQUIP)
end
function c97795930.wincon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetEquipGroup():Filter(c97795930.winfilter,nil)
return aux.bdocon(e,tp,eg,ep,ev,re,r,rp) and g:GetClassCount(Card.GetCode)>2 and c:GetBattleTarget():IsType(TYPE_EFFECT)
and c:GetControler()==e:GetOwnerPlayer()
end
function c97795930.winop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(97795930,RESET_EVENT+RESETS_STANDARD,0,0)
if c:GetFlagEffect(97795930)>2 then
local WIN_REASON_CELESTIAL_WHIRLPOOL=0x1c
Duel.Win(tp,WIN_REASON_CELESTIAL_WHIRLPOOL)
end
end
function c97795930.handcon(e)
return Duel.IsEnvironment(22702055)
end
function c97795930.repfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and c:IsLocation(LOCATION_MZONE)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function c97795930.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(c97795930.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c97795930.repval(e,c)
return c97795930.repfilter(c,e:GetHandlerPlayer())
end
function c97795930.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
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