Commit 177ef958 authored by nanahira's avatar nanahira

predata

parent d7f526b2
--セキュリティ・ドラゴン
--Security Dragon
--Scripted by Eerie Code
function c100200139.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,2,2)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100200139,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_NO_TURN_RESET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c100200139.thcon)
e1:SetCost(c100200139.thcost)
e1:SetTarget(c100200139.thtg)
e1:SetOperation(c100200139.thop)
c:RegisterEffect(e1)
end
function c100200139.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetMutualLinkedGroupCount()>0
end
function c100200139.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,100200139)==0 end
Duel.RegisterFlagEffect(tp,100200139,RESET_PHASE+PHASE_END,0,1)
end
function c100200139.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
c:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(100200139,1))
end
function c100200139.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
--ファイヤーオパールヘッド
--Fire Opalhead
--Script by nekrozar
function c100230007.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
end
--沼地のドロゴン
--Mudragon of the Swamp
--Script by nekrozar
function c100230008.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c100230008.ffilter,2,true)
--cannot be target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c100230008.tglimit)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
--att change
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100230008,0))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c100230008.atttg)
e3:SetOperation(c100230008.attop)
c:RegisterEffect(e3)
end
function c100230008.ffilter(c,fc,sub,mg,sg)
return not sg or sg:FilterCount(aux.TRUE,c)==0 or sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute()) or not sg:IsExists(Card.IsRace,1,c,c:GetRace())
end
function c100230008.tglimit(e,c)
return c:IsAttribute(e:GetHandler():GetAttribute())
end
function c100230008.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,563)
local aat=Duel.AnnounceAttribute(tp,1,0xff-e:GetHandler():GetAttribute())
e:SetLabel(aat)
end
function c100230008.attop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--武力の軍奏
--Tin Musical Battlemech
--Script by nekrozar
function c100230009.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100230009,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,100230009)
e1:SetCondition(c100230009.spcon)
e1:SetTarget(c100230009.sptg)
e1:SetOperation(c100230009.spop)
c:RegisterEffect(e1)
--add tuner
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c100230009.tncon)
e2:SetOperation(c100230009.tnop)
c:RegisterEffect(e2)
end
function c100230009.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c100230009.spfilter(c,e,tp)
return c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100230009.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100230009.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100230009.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100230009.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100230009.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
function c100230009.tncon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO
end
function c100230009.tnop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetValue(TYPE_TUNER)
e1:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e1)
end
--キキナガシ風鳥
--Disdainful Bird of Paradise
--Script by nekrozar
function c100230010.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,1,2)
c:EnableReviveLimit()
--immune
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:SetValue(c100230010.efilter)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100230010,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c100230010.indcost)
e2:SetOperation(c100230010.indop)
c:RegisterEffect(e2)
end
function c100230010.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function c100230010.indcost(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 c100230010.indop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
c:RegisterEffect(e2)
end
end
--リンクルベル
--Linklebell
--Script by nekrozar
function c100230011.initial_effect(c)
c:EnableReviveLimit()
--link summon
aux.AddLinkProcedure(c,nil,2,2)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_COST)
e1:SetCost(c100230011.spcost)
c:RegisterEffect(e1)
end
function c100230011.spcost(e,c,tp,st)
if bit.band(st,SUMMON_TYPE_LINK)~=SUMMON_TYPE_LINK then return true end
return Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)-Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)>=3
end
--ミレニアム・アイズ・イリュージョニスト
--Millennium-Eyes Illusionist
function c100407001.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100407001,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100407001)
e1:SetCost(c100407001.eqcost)
e1:SetTarget(c100407001.eqtg)
e1:SetOperation(c100407001.eqop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100407001,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100407001+100)
e2:SetCondition(c100407001.thcon)
e2:SetTarget(c100407001.thtg)
e2:SetOperation(c100407001.thop)
c:RegisterEffect(e2)
end
function c100407001.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c100407001.filter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsAbleToChangeControler()
end
function c100407001.eqfilter(c)
local m=_G["c"..c:GetCode()]
return c:IsFaceup() and ((c:IsSetCard(0x20a) and c:IsType(TYPE_FUSION)) or c:IsCode(64631466,63519819)) and m.CanEquipMonster(c)
end
function c100407001.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c100407001.filter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c100407001.filter,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(c100407001.eqfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c100407001.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c100407001.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc1=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c100407001.eqfilter,tp,LOCATION_MZONE,0,1,1,nil)
local tc2=g:GetFirst()
if not tc2 then return end
local m=_G["c"..tc2:GetCode()]
if tc1:IsFaceup() and tc1:IsRelateToEffect(e) and tc1:IsControler(1-tp) then
m.EquipMonster(tc2,tp,tc1)
end
end
function c100407001.thfilter(c,e)
return (c:IsSetCard(0x20a) and c:IsType(TYPE_FUSION)) or c:IsCode(64631466,63519819)
end
function c100407001.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100407001.thfilter,1,nil)
end
function c100407001.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c100407001.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
--幻想魔術師・ノー・フェイス
--Magical Illusionist Faceless Mage
--Scripted by Eerie Code
function c100407002.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DESTROYED)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,100407002)
e1:SetCondition(c100407002.spcon1)
e1:SetTarget(c100407002.sptg1)
e1:SetOperation(c100407002.spop1)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,100407002+100)
e2:SetCondition(c100407002.spcon2)
e2:SetTarget(c100407002.sptg2)
e2:SetOperation(c100407002.spop2)
c:RegisterEffect(e2)
end
function c100407002.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT)
and ((c:IsPreviousSetCard(0x20a) and bit.band(c:GetPreviousTypeOnField(),TYPE_FUSION)~=0)
or c:GetPreviousCodeOnField()==64631466 or c:GetPreviousCodeOnField()==63519819))
and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
end
function c100407002.spcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100407002.cfilter,1,nil,tp)
end
function c100407002.sptg1(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 c100407002.spop1(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 c100407002.spcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c100407002.filter(c,e,tp)
return ((c:IsSetCard(0x20a) and c:IsType(TYPE_FUSION)) or c:IsCode(64631466,63519819))
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100407002.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100407002.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100407002.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100407002.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100407002.spop2(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
--ミレニアム・アイズ・サクリファイス
--Millennium-Eyes Restrict
function c100407003.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,64631466,aux.FilterBoolFunction(Card.IsFusionType,TYPE_EFFECT),1,true,true)
--Equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100407003,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1)
e1:SetCondition(c100407003.eqcon)
e1:SetTarget(c100407003.eqtg)
e1:SetOperation(c100407003.eqop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c100407003.atkval)
c:RegisterEffect(e2)
-- def
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
e3:SetValue(c100407003.defval)
c:RegisterEffect(e3)
--disable
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DISABLE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetTarget(c100407003.distg)
c:RegisterEffect(e4)
--atk limit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_ATTACK)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e5:SetTarget(c100407003.distg)
c:RegisterEffect(e5)
end
function c100407003.CanEquipMonster(c)
return true
end
function c100407003.eqcon(e,tp,eg,ep,ev,re,r,rp,chk)
return ep~=tp and re:IsActiveType(TYPE_MONSTER)
end
function c100407003.eqfilter(c)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsType(TYPE_EFFECT) and c:IsAbleToChangeControler()
end
function c100407003.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and chkc:IsControler(1-tp) and c100407003.eqfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c100407003.eqfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c100407003.eqfilter,tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c100407003.eqlimit(e,c)
return e:GetOwner()==c
end
function c100407003.EquipMonster(c,tp,tc)
if not Duel.Equip(tp,tc,c,false) then return end
--Add Equip limit
tc:RegisterFlagEffect(100407003,RESET_EVENT+0x1fe0000,0,0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c100407003.eqlimit)
tc:RegisterEffect(e1)
end
function c100407003.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsType(TYPE_MONSTER) and tc:IsControler(1-tp) then
if c:IsFaceup() and c:IsRelateToEffect(e) then
c100407003.EquipMonster(c,tp,tc)
else Duel.SendtoGrave(tc,REASON_EFFECT) end
end
end
function c100407003.atkval(e,c)
local atk=0
local g=c:GetEquipGroup()
local tc=g:GetFirst()
while tc do
if tc:GetFlagEffect(100407003)~=0 and tc:IsFaceup() and tc:GetAttack()>=0 then
atk=atk+tc:GetAttack()
end
tc=g:GetNext()
end
return atk
end
function c100407003.defval(e,c)
local atk=0
local g=c:GetEquipGroup()
local tc=g:GetFirst()
while tc do
if tc:GetFlagEffect(100407003)~=0 and tc:IsFaceup() and tc:GetDefense()>=0 then
atk=atk+tc:GetDefense()
end
tc=g:GetNext()
end
return atk
end
function c100407003.disfilter(c)
return c:IsFaceup() and c:GetFlagEffect(100407003)~=0
end
function c100407003.distg(e,c)
local g=e:GetHandler():GetEquipGroup():Filter(c100407003.disfilter,nil)
return c:IsFaceup() and g:IsExists(Card.IsCode,1,nil,c:GetCode())
end
--サクリファイス・フュージョン
--Relinquished Fusion
function c100407004.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c100407004.target)
e1:SetOperation(c100407004.activate)
c:RegisterEffect(e1)
--equip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100407004,0))
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(c100407004.eqcost)
e2:SetTarget(c100407004.eqtg)
e2:SetOperation(c100407004.eqop)
c:RegisterEffect(e2)
end
function c100407004.filter0(c)
return c:IsAbleToRemove()
end
function c100407004.filter1(c,e)
return c:IsAbleToRemove() and not c:IsImmuneToEffect(e)
end
function c100407004.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c)) and (c:IsSetCard(0x20a) or c:IsCode(63519819))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c100407004.filter3(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToRemove()
end
function c100407004.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c100407004.filter0,nil)
local mg2=Duel.GetMatchingGroup(c100407004.filter3,tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
local res=Duel.IsExistingMatchingCard(c100407004.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 mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c100407004.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100407004.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c100407004.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(c100407004.filter3,tp,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,0,nil)
mg1:Merge(mg2)
local sg1=Duel.GetMatchingGroup(c100407004.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c100407004.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,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.Remove(mat1,POS_FACEUP,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,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function c100407004.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c100407004.filter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsAbleToChangeControler()
end
function c100407004.eqfilter(c)
local m=_G["c"..c:GetCode()]
return c:IsFaceup() and (c:IsSetCard(0x20a) or c:IsCode(64631466,63519819)) and m.CanEquipMonster(c)
end
function c100407004.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100407004.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100407004.filter,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingMatchingCard(c100407004.eqfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c100407004.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c100407004.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc1=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c100407004.eqfilter,tp,LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 then
local tc2=g:GetFirst()
local m=_G["c"..tc2:GetCode()]
if tc1:IsFaceup() and tc1:IsRelateToEffect(e) and tc1:IsControler(1-tp) and tc2 then
m.EquipMonster(tc2,tp,tc1)
end
end
end
--寄生虫パラノイド
--Parasite Paranoid
--Scripted by Eerie Code
function c100407007.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100407007,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100407007)
e1:SetTarget(c100407007.eqtg)
e1:SetOperation(c100407007.eqop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100407007,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c100407007.spcon)
e2:SetTarget(c100407007.sptg)
e2:SetOperation(c100407007.spop)
c:RegisterEffect(e2)
end
function c100407007.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c100407007.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
Duel.Equip(tp,c,tc,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c100407007.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
--race
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetValue(RACE_INSECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
--cannot attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e3:SetValue(c100407007.atlimit)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3)
--disable
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetRange(LOCATION_SZONE)
e4:SetLabelObject(tc)
e4:SetCondition(c100407007.discon)
e4:SetOperation(c100407007.disop)
e4:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e4)
end
function c100407007.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c100407007.atlimit(e,c)
return c:IsRace(RACE_INSECT)
end
function c100407007.disfilter(c)
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsRace(RACE_INSECT)
end
function c100407007.discon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local rc=re:GetHandler()
if not tc or rc~=tc then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:IsExists(c100407007.disfilter,1,nil) and Duel.IsChainNegatable(ev)
end
function c100407007.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c100407007.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_SZONE)
end
function c100407007.spfilter(c,e,tp)
return c:IsRace(RACE_INSECT) and c:IsLevelAbove(7) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c100407007.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100407007.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100407007.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,c100407007.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
--究極変異態・インセクト女王
--Ultimately Mutated Insect Queen
--Scripted by Eerie Code
function c100407008.initial_effect(c)
c:EnableUnsummonable()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c100407008.splimit)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(c100407008.indcon)
e2:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_INSECT))
e2:SetValue(c100407008.indval)
c:RegisterEffect(e2)
--cannot be target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(c100407008.indcon)
e3:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_INSECT))
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--chain attack
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100407008,0))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DAMAGE_STEP_END)
e4:SetCondition(c100407008.atcon)
e4:SetCost(c100407008.atcost)
e4:SetOperation(c100407008.atop)
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(91512835,1))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EVENT_PHASE+PHASE_END)
e5:SetCountLimit(1)
e5:SetTarget(c100407008.sptg)
e5:SetOperation(c100407008.spop)
c:RegisterEffect(e5)
end
function c100407008.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
function c100407008.indfilter(c)
return c:IsFaceup() and c:IsRace(RACE_INSECT)
end
function c100407008.indcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100407008.indfilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
end
function c100407008.indval(e,re,rp)
return rp~=e:GetHandlerPlayer()
end
function c100407008.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetAttacker()==c and c:IsChainAttackable(0,true)
end
function c100407008.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,e:GetHandler()) end
local g=Duel.SelectReleaseGroup(tp,nil,1,1,e:GetHandler())
Duel.Release(g,REASON_COST)
end
function c100407008.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToBattle() then return end
Duel.ChainAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE+PHASE_DAMAGE_CAL)
c:RegisterEffect(e1)
end
function c100407008.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,91512836,0,0x4011,100,100,1,RACE_INSECT,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c100407008.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,91512836,0,0x4011,100,100,1,RACE_INSECT,ATTRIBUTE_EARTH) then return end
local token=Duel.CreateToken(tp,91512836)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
--超進化の繭
--Super Cocoon of Evolution
--Scripted by Eerie Code
function c100407009.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c100407009.target)
e1:SetOperation(c100407009.activate)
c:RegisterEffect(e1)
--shuffle and draw
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,100407009)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c100407009.tdtg)
e2:SetOperation(c100407009.tdop)
c:RegisterEffect(e2)
end
function c100407009.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_INSECT) and c:IsReleasableByEffect()
and c:GetEquipCount()>0
end
function c100407009.filter(c,e,tp)
return c:IsRace(RACE_INSECT) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c100407009.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local loc=LOCATION_MZONE
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then loc=0 end
return Duel.IsExistingMatchingCard(c100407009.cfilter,tp,LOCATION_MZONE,loc,1,nil)
and Duel.IsExistingMatchingCard(c100407009.filter,tp,LOCATION_DECK,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100407009.activate(e,tp,eg,ep,ev,re,r,rp)
local loc=LOCATION_MZONE
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then loc=0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c100407009.cfilter,tp,LOCATION_MZONE,loc,1,1,nil)
if g:GetCount()>0 and Duel.Release(g,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c100407009.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP)
end
end
end
function c100407009.tdfilter(c)
return c:IsRace(RACE_INSECT) and c:IsAbleToDeck()
end
function c100407009.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c100407009.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100407009.tdfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c100407009.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100407009.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)
if tc:IsLocation(LOCATION_DECK) then Duel.ShuffleDeck(tp) end
if tc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--BM-4 ボムスパイダー
--BM-4 Bomb Spider
--Scripted by Eerie Code
function c100407014.initial_effect(c)
--Destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100407014,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c100407014.destg)
e1:SetOperation(c100407014.desop)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100407014,1))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100407014)
e2:SetCondition(c100407014.damcon1)
e2:SetTarget(c100407014.damtg)
e2:SetOperation(c100407014.damop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c100407014.damcon2)
c:RegisterEffect(e3)
end
function c100407014.desfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_DARK)
end
function c100407014.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c100407014.desfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c100407014.desfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0)
end
function c100407014.desop(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.Destroy(tg,REASON_EFFECT)
end
end
function c100407014.damcon1(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local bc=tc:GetBattleTarget()
return tc:GetPreviousControler()~=tp and tc:IsLocation(LOCATION_GRAVE)
and bc:IsControler(tp) and bc:GetOriginalAttribute()==ATTRIBUTE_DARK and bc:GetOriginalRace()==RACE_MACHINE
end
function c100407014.damfilter1(c,tp)
return c:IsReason(REASON_EFFECT) and c:IsReason(REASON_DESTROY) and c:IsLocation(LOCATION_GRAVE) and c:GetPreviousControler()~=tp
end
function c100407014.damcon2(e,tp,eg,ep,ev,re,r,rp)
if not re then return false end
local rc=re:GetHandler()
return rc:IsControler(tp) and rc:GetOriginalAttribute()==ATTRIBUTE_DARK
and rc:GetOriginalRace()==RACE_MACHINE
and eg:IsExists(c100407014.damfilter1,1,nil,tp)
end
function c100407014.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
function c100407014.damfilter2(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsReason(REASON_DESTROY) and c:IsLocation(LOCATION_GRAVE) and c:GetPreviousControler()~=tp
end
function c100407014.damop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c100407014.damfilter2,nil,tp)
if g:GetCount()>0 then
if g:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
g=g:Select(tp,1,1,nil)
end
Duel.Damage(1-tp,math.ceil(g:GetFirst():GetBaseAttack()/2),REASON_EFFECT)
end
end
-- デスペラード・リボルバー・ドラゴン
--Desperado Barrel Dragon
function c100407015.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100407015,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_DESTROYED)
e1:SetCondition(c100407015.condition)
e1:SetTarget(c100407015.target)
e1:SetOperation(c100407015.operation)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100407015,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_COIN+CATEGORY_DRAW)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c100407015.descon)
e2:SetCost(c100407015.descost)
e2:SetTarget(c100407015.destg)
e2:SetOperation(c100407015.desop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100407015,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetTarget(c100407015.thtg)
e3:SetOperation(c100407015.thop)
c:RegisterEffect(e3)
end
c100407015.toss_coin=true
function c100407015.filter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and bit.band(c:GetPreviousRaceOnField(),RACE_MACHINE)~=0
and bit.band(c:GetPreviousAttributeOnField(),ATTRIBUTE_DARK)~=0 and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
end
function c100407015.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100407015.filter,1,nil,tp)
end
function c100407015.target(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 c100407015.operation(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
function c100407015.descon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE)
end
function c100407015.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function c100407015.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,3)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100407015.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()==0 then return end
local c1,c2,c3=Duel.TossCoin(tp,3)
local ct=c1+c2+c3
if ct==0 then return end
if ct>g:GetCount() then ct=g:GetCount() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,ct,nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
if c1+c2+c3==3 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function c100407015.thfilter(c)
return c.toss_coin and c:IsType(TYPE_MONSTER) and c:IsLevelBelow(7) and c:IsAbleToHand()
end
function c100407015.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100407015.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100407015.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100407015.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
--銃砲撃
--Gun Cannon Shot
--Script by nekrozar
function c100407017.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--coin
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c100407017.regcon)
e2:SetOperation(c100407017.regop)
c:RegisterEffect(e2)
--coin result
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100407017,0))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(c100407017.coincon1)
e3:SetCost(aux.bfgcost)
e3:SetOperation(c100407017.coinop1)
c:RegisterEffect(e3)
end
function c100407017.regcon(e,tp,eg,ep,ev,re,r,rp)
local ex=Duel.GetOperationInfo(ev,CATEGORY_COIN)
return ex
end
function c100407017.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TOSS_COIN)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(c100407017.effcon)
e1:SetOperation(c100407017.effop)
e1:SetLabelObject(re)
e1:SetReset(RESET_EVENT+0x1fc0000+RESET_CHAIN)
c:RegisterEffect(e1)
end
function c100407017.effcon(e,tp,eg,ep,ev,re,r,rp)
return re==e:GetLabelObject()
end
function c100407017.effop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,100407017)
local ct=0
local res={Duel.GetCoinResult()}
for i=1,ev do
if res[i]==1 then
ct=ct+1
end
end
if ct>0 then
Duel.Damage(1-tp,500,REASON_EFFECT)
end
if ct>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
if ct>2 then
local hg=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if hg:GetCount()>0 then
Duel.ConfirmCards(tp,hg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local sg=hg:Select(tp,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD)
Duel.ShuffleHand(1-tp)
end
end
end
function c100407017.coincon1(e,tp,eg,ep,ev,re,r,rp)
local ex,eg,et,cp,ct=Duel.GetOperationInfo(ev,CATEGORY_COIN)
if ex and ct>1 then
e:SetLabelObject(re)
return true
else return false end
end
function c100407017.coinop1(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_TOSS_COIN_NEGATE)
e1:SetCountLimit(1)
e1:SetCondition(c100407017.coincon2)
e1:SetOperation(c100407017.coinop2)
e1:SetLabelObject(e:GetLabelObject())
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
end
function c100407017.coincon2(e,tp,eg,ep,ev,re,r,rp)
return re==e:GetLabelObject()
end
function c100407017.coinop2(e,tp,eg,ep,ev,re,r,rp)
local res={Duel.GetCoinResult()}
local ct=ev
for i=1,ct do
res[i]=1
end
Duel.SetCoinResult(table.unpack(res))
end
--アームド・ドラゴン・カタパルトキャノン
--Armed Dragon Catapult Cannon
--Scripted by Eerie Code
function c100407021.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,84243274,73879377,true,true)
--spsummon condition
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(c100407021.splimit)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c100407021.spcon)
e2:SetOperation(c100407021.spop)
c:RegisterEffect(e2)
--cannot activate
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,1)
e3:SetValue(c100407021.aclimit)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100407021,0))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetHintTiming(0,0x1e0)
e4:SetCondition(c100407021.rmcon)
e4:SetCost(c100407021.rmcost)
e4:SetTarget(c100407021.rmtg)
e4:SetOperation(c100407021.rmop)
c:RegisterEffect(e4)
if not c100407021.global_flag then
c100407021.global_flag=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c100407021.regop)
Duel.RegisterEffect(ge1,0)
end
end
function c100407021.regop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
if tc:IsCode(84243274) then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),100407021,0,0,0)
elseif tc:IsCode(73879377) then
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),100407021+100,0,0,0)
end
end
end
function c100407021.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c100407021.cfilter(c)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsFusionCode(84243274,73879377) and c:IsAbleToRemoveAsCost()
end
function c100407021.fcheck(c,sg,g,code,...)
if not c:IsFusionCode(code) then return false end
if ... then
g:AddCard(c)
local res=sg:IsExists(c100407021.fcheck,1,g,sg,g,...)
g:RemoveCard(c)
return res
else return true end
end
function c100407021.fselect(c,tp,mg,sg,...)
sg:AddCard(c)
local res=false
if sg:GetCount()<3 then
res=mg:IsExists(c100407021.fselect,1,sg,tp,mg,sg,...)
elseif Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
local g=Group.CreateGroup()
res=sg:IsExists(c100407021.fcheck,1,nil,sg,g,...)
end
sg:RemoveCard(c)
return res
end
function c100407021.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c100407021.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
return Duel.GetFlagEffect(tp,100407021)>0 and Duel.GetFlagEffect(tp,100407021+100)>0
and mg:IsExists(c100407021.fselect,1,nil,tp,mg,sg,84243274,73879377)
end
function c100407021.spop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c100407021.cfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
local sg=Group.CreateGroup()
while sg:GetCount()<3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=mg:FilterSelect(tp,c100407021.fselect,1,1,sg,tp,mg,sg,84243274,73879377)
sg:Merge(g)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c100407021.acfilter(c,code)
return c:IsFaceup() and c:IsCode(code)
end
function c100407021.aclimit(e,re,tp)
return Duel.IsExistingMatchingCard(c100407021.acfilter,e:GetHandlerPlayer(),LOCATION_REMOVED,LOCATION_REMOVED,1,nil,re:GetHandler():GetCode())
and not re:GetHandler():IsImmuneToEffect(e)
end
function c100407021.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c100407021.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c100407021.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c100407021.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
--古代の機械超巨人
--Megaton Ancient Gear Golem
--Scripted by Eerie Code
function c100407031.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x7),3,true)
--multi attack
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(c100407031.condition)
e1:SetOperation(c100407031.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(c100407031.valcheck)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--actlimit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,1)
e3:SetValue(c100407031.aclimit)
e3:SetCondition(c100407031.actcon)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100407031,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCondition(c100407031.spcon)
e4:SetTarget(c100407031.sptg)
e4:SetOperation(c100407031.spop)
c:RegisterEffect(e4)
end
function c100407031.valcheck(e,c)
e:GetLabelObject():SetLabel(c:GetMaterial():FilterCount(Card.IsCode,nil,83104731,95735217))
end
function c100407031.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c100407031.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabel()
if ct>=2 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100407031,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(ct-1)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
end
end
function c100407031.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c100407031.actcon(e)
return Duel.GetAttacker()==e:GetHandler()
end
function c100407031.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_FUSION) and c:GetReasonPlayer()~=tp
and c:IsReason(REASON_EFFECT) and c:IsPreviousPosition(POS_FACEUP)
end
function c100407031.spfilter(c,e,tp)
return c:IsCode(12652643) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c100407031.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(c100407031.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100407031.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100407031.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
--古代の機械融合
--Ancient Gear Fusion
--Scripted by Eerie Code
function c100407032.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c100407032.target)
e1:SetOperation(c100407032.activate)
c:RegisterEffect(e1)
end
function c100407032.fcheck(tp,sg,fc,mg)
if sg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
return sg:IsExists(c100407032.filterchk,1,nil) end
return true
end
function c100407032.filterchk(c)
return c:IsFaceup() and c:IsCode(83104731,95735217) and c:IsOnField()
end
function c100407032.filter0(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end
function c100407032.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c100407032.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x7) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c100407032.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetFusionMaterial(tp)
local mg2=Duel.GetMatchingGroup(c100407032.filter0,tp,LOCATION_DECK,0,nil)
if mg2:GetCount()>0 then
mg:Merge(mg2)
aux.FCheckAdditional=c100407032.fcheck
end
local res=Duel.IsExistingMatchingCard(c100407032.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
aux.FCheckAdditional=nil
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c100407032.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
end
function c100407032.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c100407032.filter1,nil,e)
local mg2=Duel.GetMatchingGroup(c100407032.filter0,tp,LOCATION_DECK,0,nil)
if mg2:GetCount()>0 then
mg1:Merge(mg2)
aux.FCheckAdditional=c100407032.fcheck
end
local sg1=Duel.GetMatchingGroup(c100407032.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
aux.FCheckAdditional=nil
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(c100407032.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
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 not tc then return end
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
aux.FCheckAdditional=c100407032.fcheck
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
aux.FCheckAdditional=nil
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)
end
tc:CompleteProcedure()
end
--究極宝玉神 レインボー・オーバー・ドラゴン
--Ultimate Crystal God Rainbow Over Dragon
--Scripted by Eerie Code
function c100407037.initial_effect(c)
--fusion summon
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x1034),7,true)
--spsummon condition
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.fuslimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c100407037.hspcon)
e2:SetOperation(c100407037.hspop)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetDescription(aux.Stringid(100407037,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(c100407037.atkcost)
e3:SetOperation(c100407037.atkop)
c:RegisterEffect(e3)
--to deck
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100407037,1))
e4:SetCategory(CATEGORY_TODECK)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c100407037.tdcon)
e4:SetCost(c100407037.tdcost)
e4:SetTarget(c100407037.tdtg)
e4:SetOperation(c100407037.tdop)
c:RegisterEffect(e4)
end
function c100407037.hspfilter(c,tp,sc)
return c:IsSetCard(0x2034) and c:GetLevel()==10 and c:IsControler(tp) and Duel.GetLocationCountFromEx(tp,tp,sc,c)>0
end
function c100407037.hspcon(e,c)
if c==nil then return true end
return Duel.CheckReleaseGroup(c:GetControler(),c100407037.hspfilter,1,nil,c:GetControler(),c)
end
function c100407037.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,c100407037.hspfilter,1,1,nil,tp,c)
Duel.Release(g,REASON_COST)
end
function c100407037.cfilter(c)
return c:IsSetCard(0x1034) and c:GetAttack()>0 and c:IsAbleToRemoveAsCost()
end
function c100407037.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100407037.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c100407037.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetLabel(g:GetFirst():GetAttack())
end
function c100407037.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c100407037.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c100407037.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c100407037.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c100407037.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
--虹の架け橋
--Rainbow Bridge
--Scripted by Eerie Code
function c100407038.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c100407038.target)
e1:SetOperation(c100407038.activate)
c:RegisterEffect(e1)
end
function c100407038.filter(c)
return c:IsSetCard(0x34) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c100407038.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100407038.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100407038.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100407038.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
--究極宝玉陣
--Ultimate Crystal Formation
--Scripted by Eerie Code
function c100407040.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c100407040.condition)
e1:SetCost(c100407040.cost)
e1:SetTarget(c100407040.target)
e1:SetOperation(c100407040.activate)
c:RegisterEffect(e1)
--place
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c100407040.plcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c100407040.pltg)
e2:SetOperation(c100407040.plop)
c:RegisterEffect(e2)
end
function c100407040.confilter(c,tp)
return c:IsPreviousSetCard(0x1034) and c:GetPreviousControler()==tp
end
function c100407040.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100407040.confilter,1,nil,tp)
end
function c100407040.cfilter(c)
return c:IsSetCard(0x1034) and (c:IsFaceup() or not c:IsLocation(LOCATION_ONFIELD)) and c:IsAbleToGraveAsCost()
end
function c100407040.exfilter(c,tp)
return Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c))>0
end
function c100407040.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100407040.cfilter,tp,LOCATION_ONFIELD+LOCATION_HAND+LOCATION_DECK,0,nil)
if chk==0 then return g:GetClassCount(Card.GetCode)>=7
and (Duel.GetLocationCountFromEx(tp)>0 or g:IsExists(c100407040.exfilter,1,nil,tp)) end
local rg=Group.CreateGroup()
local ft=Duel.GetLocationCountFromEx(tp)
for i=1,7 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=nil
if ft<1 then
tc=g:FilterSelect(tp,c100407040.exfilter,1,1,nil,tp):GetFirst()
ft=1
else
tc=g:Select(tp,1,1,nil):GetFirst()
end
if tc then
rg:AddCard(tc)
g:Remove(Card.IsCode,nil,tc:GetCode())
end
end
Duel.SendtoGrave(rg,REASON_COST)
end
function c100407040.filter(c,e,tp)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x2034) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)
end
function c100407040.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100407040.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100407040.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100407040.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
end
end
function c100407040.plcfilter(c,tp)
return c:IsPreviousSetCard(0x2034) and c:GetPreviousControler()==tp
and c:IsPreviousPosition(POS_FACEUP) and c:GetReasonPlayer()~=tp
and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE)
end
function c100407040.plcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100407040.plcfilter,1,nil,tp)
end
function c100407040.plfilter(c)
return c:IsSetCard(0x1034) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c100407040.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c100407040.plfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,LOCATION_GRAVE)
end
function c100407040.plop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ft<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,c100407040.plfilter,tp,LOCATION_GRAVE,0,1,ft,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
Duel.RaiseEvent(g,EVENT_CUSTOM+47408488,e,0,tp,0,0)
end
end
--Hallowhallow
--Script by nekrozar
function c101002000.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--level
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101002000,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetTarget(c101002000.lvtg)
e1:SetOperation(c101002000.lvop)
c:RegisterEffect(e1)
end
function c101002000.lvfilter(c)
return c:IsFaceup() and c:GetLevel()>0
end
function c101002000.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101002000.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101002000.lvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101002000.lvfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c101002000.lvop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local dc=Duel.TossDice(tp,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(dc)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--Samurai Destroyer
--Scripted by Eerie Code
function c101002081.initial_effect(c)
--synchro summon
c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(),1)
--actlimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,1)
e1:SetValue(c101002081.aclimit)
e1:SetCondition(c101002081.con)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c101002081.con)
e2:SetOperation(c101002081.disop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_BE_BATTLE_TARGET)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101002081,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetCondition(c101002081.spcon)
e4:SetTarget(c101002081.sptg)
e4:SetOperation(c101002081.spop)
c:RegisterEffect(e4)
end
function c101002081.aclimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e)
end
function c101002081.con(e)
local c=e:GetHandler()
return Duel.GetAttacker()==c or Duel.GetAttackTarget()==c
end
function c101002081.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttackTarget()
if not tc then return end
if tc:IsControler(tp) then tc=Duel.GetAttacker() end
c:CreateRelation(tc,RESET_EVENT+0x1fe0000)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetCondition(c101002081.discon2)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetCondition(c101002081.discon2)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
tc:RegisterEffect(e2)
end
function c101002081.discon2(e)
return e:GetOwner():IsRelateToCard(e:GetHandler())
end
function c101002081.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp~=tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp
end
function c101002081.filter(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101002081.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101002081.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101002081.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101002081.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101002081.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
--Vendread Chimera
--Scripted by Eerie Code
function c101002082.initial_effect(c)
c:EnableReviveLimit()
--Negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101002082,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101002082)
e1:SetCondition(c101002082.condition)
e1:SetCost(c101002082.cost)
e1:SetTarget(c101002082.target)
e1:SetOperation(c101002082.operation)
c:RegisterEffect(e1)
--atk/def
local e2=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101002082,1))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_RELEASE)
e2:SetCountLimit(1,101002082+100)
e2:SetCondition(c101002082.atkcon)
e2:SetOperation(c101002082.atkop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
end
function c101002082.condition(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not Duel.IsChainNegatable(ev) then return false end
if re:IsHasCategory(CATEGORY_NEGATE)
and Duel.GetChainInfo(ev-1,CHAININFO_TRIGGERING_EFFECT):IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
return ex and tg~=nil and tc+tg:FilterCount(Card.IsOnField,nil)-tg:GetCount()>0
end
function c101002082.cfilter(c)
return c:IsRace(RACE_ZOMBIE) and c:IsAbleToRemoveAsCost()
end
function c101002082.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101002082.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101002082.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,REASON_COST)
end
function c101002082.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c101002082.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c101002082.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_RITUAL)
end
function c101002082.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetValue(-500)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
end
end
--Vendread Strix
--Scripted by Eerie Code
function c101002083.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,101002083)
e1:SetCost(c101002083.spcost)
e1:SetTarget(c101002083.sptg)
e1:SetOperation(c101002083.spop)
c:RegisterEffect(e1)
--gain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c101002083.mtcon)
e2:SetOperation(c101002083.mtop)
c:RegisterEffect(e2)
end
function c101002083.spcfilter(c)
return c:IsSetCard(0x106) and not c:IsPublic()
end
function c101002083.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101002083.spcfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local cg=Duel.SelectMatchingCard(tp,c101002083.spcfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,cg)
Duel.ShuffleHand(tp)
end
function c101002083.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 c101002083.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 or not c:IsRelateToEffect(e) then return end
if 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+0x47e0000)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
end
end
function c101002083.mtcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_RITUAL and e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c101002083.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,101002083)~=0 then return end
local c=e:GetHandler()
local g=eg:Filter(Card.IsSetCard,nil,0x106)
local rc=g:GetFirst()
if not rc then return end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101002083,1))
e1:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLED)
e1:SetTarget(c101002083.drtg)
e1:SetOperation(c101002083.drop)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_ADD_TYPE)
e3:SetValue(TYPE_EFFECT)
e3:SetReset(RESET_EVENT+0x1fe0000)
rc:RegisterEffect(e3,true)
end
rc:RegisterFlagEffect(0,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(101002083,2))
Duel.RegisterFlagEffect(tp,101002083,RESET_PHASE+PHASE_END,0,1)
end
function c101002083.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c101002083.drop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,1,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
end
end
--Vendread Nights
--Scripted by Eerie Code
function c101002084.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101002084,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,101002084)
e2:SetCost(c101002084.thcost)
e2:SetTarget(c101002084.thtg)
e2:SetOperation(c101002084.thop)
c:RegisterEffect(e2)
--chain attack
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101002084,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_FZONE)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetCondition(c101002084.atcon)
e3:SetCost(c101002084.atcost)
e3:SetOperation(c101002084.atop)
c:RegisterEffect(e3)
end
function c101002084.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c101002084.thfilter(c)
return c:IsSetCard(0x106) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c101002084.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101002084.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101002084.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101002084.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 c101002084.atcon(e,tp,eg,ep,ev,re,r,rp)
local ec=eg:GetFirst()
local bc=ec:GetBattleTarget()
e:SetLabelObject(ec)
return bc and bc:IsType(TYPE_MONSTER) and ec:IsChainAttackable(2,true) and ec:IsStatus(STATUS_OPPO_BATTLE)
end
function c101002084.atcfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x106) and c:IsAbleToRemoveAsCost()
end
function c101002084.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101002084.atcfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101002084.atcfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c101002084.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=e:GetLabelObject()
if not ec or not ec:IsRelateToBattle() then return end
Duel.ChainAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_BATTLE)
ec:RegisterEffect(e1)
end
--Vendread Reunion
--Scripted by Eerie Code
function c101002085.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c101002085.cost)
e1:SetTarget(c101002085.target)
e1:SetOperation(c101002085.activate)
c:RegisterEffect(e1)
end
function c101002085.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c101002085.cfilter(c,e,tp,ft,bs)
if c:IsSetCard(0x106) and c:IsType(TYPE_RITUAL)
and not c:IsPublic() and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then
local lv=c:GetLevel()
local g=Duel.GetMatchingGroup(c101002085.filter,tp,LOCATION_REMOVED,0,nil,e,tp)
return g:GetCount()>0 and g:IsExists(c101002085.spfilter,1,nil,lv,ft,g,Group.CreateGroup(),bs)
else return false end
end
function c101002085.filter(c,e,tp)
return c:IsFaceup() and c:IsLevelAbove(1) and c:IsSetCard(0x106)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function c101002085.spfilter(c,lv,ft,g,sg,bs)
if ft==0 then return false end
local sg2=sg:Clone()
sg2:AddCard(c)
local nlv=lv-c:GetLevel()
local g2=g:Clone()
g2:Remove(Card.IsCode,nil,c:GetCode())
return nlv>=0 and (nlv==0 or (not bs and g2:IsExists(c101002085.spfilter,1,nil,nlv,ft-1,g2,sg2,bs)))
end
function c101002085.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local bs=Duel.IsPlayerAffectedByEffect(tp,59822133)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
if not Duel.IsPlayerCanSpecialSummonCount(tp,2) then return end
return Duel.IsExistingMatchingCard(c101002085.cfilter,tp,LOCATION_HAND,0,1,nil,e,tp,ft,bs)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local tc=Duel.SelectMatchingCard(tp,c101002085.cfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,ft,bs):GetFirst()
Duel.ConfirmCards(1-tp,tc)
Duel.ShuffleHand(tp)
e:SetLabelObject(tc)
tc:CreateEffectRelation(e)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end
function c101002085.activate(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetLabelObject()
if not rc or not rc:IsRelateToEffect(e) or not rc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
or not Duel.IsPlayerCanSpecialSummonCount(tp,2) then return false end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local bs=Duel.IsPlayerAffectedByEffect(tp,59822133)
local lv=rc:GetLevel()
local g=Duel.GetMatchingGroup(c101002085.filter,tp,LOCATION_REMOVED,0,nil,e,tp)
local sg=Group.CreateGroup()
while g:GetCount()>0 and ft>0 and lv>0 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=g:FilterSelect(tp,c101002085.spfilter,1,1,nil,lv,ft,g,sg,bs):GetFirst()
sg:AddCard(sc)
g:Remove(Card.IsCode,nil,sc:GetCode())
lv=lv-sc:GetLevel()
ft=ft-1
end
if sg:GetCount()==0 then return end
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)==sg:GetCount() then
local og=Duel.GetOperatedGroup()
Duel.ConfirmCards(1-tp,og)
Duel.BreakEffect()
if Duel.Release(og,REASON_EFFECT+REASON_RITUAL+REASON_MATERIAL)==og:GetCount() then
Duel.SpecialSummon(rc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
end
end
end
--F.A. Whip Crosser
--Scripted by Eerie Code
function c101002086.initial_effect(c)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c101002086.atkval)
c:RegisterEffect(e1)
--activate cost
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ACTIVATE_COST)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetCost(c101002086.costchk)
e2:SetTarget(c101002086.costtg)
e2:SetOperation(c101002086.costop)
c:RegisterEffect(e2)
--accumulate
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(0x10000000+101002086)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(0,1)
c:RegisterEffect(e3)
--lv up
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101002086,0))
e4:SetCategory(CATEGORY_LVCHANGE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c101002086.lvcon)
e4:SetOperation(c101002086.lvop)
c:RegisterEffect(e4)
--discard limit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,1)
e5:SetCode(EFFECT_CANNOT_DISCARD_HAND)
e5:SetCondition(c101002086.excon)
e5:SetValue(1)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_CANNOT_TO_GRAVE_AS_COST)
e6:SetRange(LOCATION_MZONE)
e6:SetTargetRange(0,LOCATION_HAND)
e6:SetCondition(c101002086.excon)
e6:SetValue(1)
c:RegisterEffect(e6)
end
function c101002086.atkval(e,c)
return c:GetLevel()*300
end
function c101002086.lvcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsSetCard(0x107) and e:GetHandler():GetFlagEffect(1)>0
end
function c101002086.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
function c101002086.costchk(e,te_or_c,tp)
local ct=Duel.GetFlagEffect(tp,101002086)
return Duel.CheckLPCost(tp,ct*300)
end
function c101002086.costtg(e,te,tp)
if not te:IsActiveType(TYPE_MONSTER) then return false end
local tc=te:GetHandler()
local lv=e:GetHandler():GetLevel()
if tc:GetRank()>0 then
return tc:GetOriginalRank()<lv
elseif tc:GetLevel()>0 then
return tc:GetOriginalLevel()<lv
else return false end
end
function c101002086.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(tp,300)
end
function c101002086.excon(e)
return e:GetHandler():IsLevelAbove(7)
end
--F.A. Turbo Charger
--Scripted by Eerie Code
function c101002087.initial_effect(c)
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c101002087.atkval)
c:RegisterEffect(e1)
--untargetable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetTarget(c101002087.atglimit)
e2:SetValue(c101002087.atlimit)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c101002087.tglimit)
e3:SetValue(c101002087.tgval)
c:RegisterEffect(e3)
--lv up
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAINING)
e0:SetRange(LOCATION_MZONE)
e0:SetOperation(aux.chainreg)
c:RegisterEffect(e0)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101002087,0))
e4:SetCategory(CATEGORY_LVCHANGE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c101002087.lvcon)
e4:SetOperation(c101002087.lvop)
c:RegisterEffect(e4)
--actlimit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetCode(EFFECT_CANNOT_ACTIVATE)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(0,1)
e5:SetValue(c101002087.aclimit)
e5:SetCondition(c101002087.actcon)
c:RegisterEffect(e5)
end
function c101002087.atkval(e,c)
return c:GetLevel()*300
end
function c101002087.atglimit(e,c)
local lv=e:GetHandler():GetLevel()
if c:GetRank()>0 then
return c:GetOriginalRank()<lv
elseif c:GetLevel()>0 then
return c:GetOriginalLevel()<lv
else return false end
end
function c101002087.atlimit(e,c)
return c~=e:GetHandler()
end
function c101002087.tgval(e,re,rp)
if not aux.tgoval(e,re,rp) then return end
local c=re:GetHandler()
local lv=e:GetHandler():GetLevel()
if c:GetRank()>0 then
return c:GetOriginalRank()<lv
elseif c:GetLevel()>0 then
return c:GetOriginalLevel()<lv
else return false end
end
function c101002087.lvcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:GetHandler():IsSetCard(0x107) and e:GetHandler():GetFlagEffect(1)>0
end
function c101002087.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
function c101002087.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsImmuneToEffect(e)
end
function c101002087.actcon(e)
if not e:GetHandler():IsLevelAbove(7) then return false end
local a=Duel.GetAttacker()
local d=a:GetBattleTarget()
if a:IsControler(1-tp) then a,d=d,a end
return a and a:IsSetCard(0x107)
end
--F.A. Off-Road Grand Prix
--Scripted by Eerie Code
function c101002088.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--lv up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_LEVEL)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x107))
e2:SetValue(2)
e2:SetCondition(c101002088.lvcon)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101002088,0))
e3:SetCategory(CATEGORY_HANDES)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYED)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,101002088)
e3:SetCondition(c101002088.descon)
e3:SetTarget(c101002088.destarg)
e3:SetOperation(c101002088.desop)
c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101002088,1))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,101002088+100)
e4:SetCondition(c101002088.thcon2)
e4:SetTarget(c101002088.thtg2)
e4:SetOperation(c101002088.thop2)
c:RegisterEffect(e4)
end
function c101002088.lvcon(e)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c101002088.cfilter(c,tp)
return c:GetPreviousControler()==tp and c:IsPreviousSetCard(0x107)
end
function c101002088.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101002088.cfilter,1,nil,tp)
end
function c101002088.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_HANDES,0,0,1-tp,1)
end
function c101002088.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND,nil)
if g:GetCount()==0 then return end
local sg=g:RandomSelect(1-tp,1)
Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT)
end
function c101002088.thcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
end
function c101002088.thfilter2(c)
return c:IsSetCard(0x107) and not c:IsCode(101002088) and c:IsAbleToHand()
end
function c101002088.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101002088.thfilter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101002088.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101002088.thfilter2,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
--F.A. Pit Stop
--Scripted by Eerie Code
function c101002089.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_LVCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101002089)
e1:SetTarget(c101002089.target)
e1:SetOperation(c101002089.activate)
c:RegisterEffect(e1)
--spsummon
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,101002089+100)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101002089.sptg)
e2:SetOperation(c101002089.spop)
c:RegisterEffect(e2)
end
function c101002089.filter(c)
return c:IsFaceup() and c:IsSetCard(0x107) and c:IsLevelAbove(3)
end
function c101002089.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101002089.filter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c101002089.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.SelectTarget(tp,c101002089.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetTargetPlayer(tp)
local ct=Duel.GetMatchingGroupCount(Card.IsCode,tp,LOCATION_GRAVE,0,nil,101002089)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct+1)
end
function c101002089.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local d=Duel.GetMatchingGroupCount(Card.IsCode,p,LOCATION_GRAVE,0,nil,101002089)+1
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsLevelAbove(3) and not tc:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-2)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
Duel.Draw(p,d,REASON_EFFECT)
end
end
function c101002089.spfilter(c,e,tp)
return c:IsSetCard(0x107) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101002089.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101002089.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101002089.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101002089.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101002089.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
--ガーディアンの力
--Power of the Guardian
--Script by nekrozar
function c101003060.initial_effect(c)
function c1118137.initial_effect(c)
c:EnableCounterPermit(0x1)
--Activate
local e1=Effect.CreateEffect(c)
......@@ -9,25 +9,25 @@ function c101003060.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c101003060.target)
e1:SetOperation(c101003060.operation)
e1:SetTarget(c1118137.target)
e1:SetOperation(c1118137.operation)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101003060,0))
e2:SetDescription(aux.Stringid(1118137,0))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c101003060.ctcon)
e2:SetTarget(c101003060.cttg)
e2:SetOperation(c101003060.ctop)
e2:SetCondition(c1118137.ctcon)
e2:SetTarget(c1118137.cttg)
e2:SetOperation(c1118137.ctop)
c:RegisterEffect(e2)
--atk/def
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(c101003060.atkval)
e3:SetValue(c1118137.atkval)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
......@@ -36,8 +36,8 @@ function c101003060.initial_effect(c)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_EQUIP)
e5:SetCode(EFFECT_DESTROY_REPLACE)
e5:SetTarget(c101003060.desreptg)
e5:SetOperation(c101003060.desrepop)
e5:SetTarget(c1118137.desreptg)
e5:SetOperation(c1118137.desrepop)
c:RegisterEffect(e5)
--Equip limit
local e6=Effect.CreateEffect(c)
......@@ -47,36 +47,36 @@ function c101003060.initial_effect(c)
e6:SetValue(1)
c:RegisterEffect(e6)
end
function c101003060.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c1118137.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c101003060.operation(e,tp,eg,ep,ev,re,r,rp)
function c1118137.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c101003060.ctcon(e,tp,eg,ep,ev,re,r,rp)
function c1118137.ctcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetEquipTarget()
return Duel.GetAttacker()==tc or Duel.GetAttackTarget()==tc
end
function c101003060.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
function c1118137.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x1)
end
function c101003060.ctop(e,tp,eg,ep,ev,re,r,rp)
function c1118137.ctop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x1,1)
end
end
function c101003060.atkval(e,c)
function c1118137.atkval(e,c)
return e:GetHandler():GetCounter(0x1)*500
end
function c101003060.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
function c1118137.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tg=c:GetEquipTarget()
if chk==0 then return not c:IsStatus(STATUS_DESTROY_CONFIRMED)
......@@ -84,6 +84,6 @@ function c101003060.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
and Duel.IsCanRemoveCounter(tp,1,0,0x1,1,REASON_EFFECT) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function c101003060.desrepop(e,tp,eg,ep,ev,re,r,rp)
function c1118137.desrepop(e,tp,eg,ep,ev,re,r,rp)
Duel.RemoveCounter(tp,1,0,0x1,1,REASON_EFFECT+REASON_REPLACE)
end
--ベクター・スケア・デーモン
--Vector Square Archfiend
--Script by nekrozar
function c101003040.initial_effect(c)
function c13452889.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_CYBERSE),2)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101003040,0))
e1:SetDescription(aux.Stringid(13452889,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(aux.bdogcon)
e1:SetCost(c4709881.spcost)
e1:SetTarget(c101003040.sptg)
e1:SetOperation(c101003040.spop)
e1:SetCost(c13452889.spcost)
e1:SetTarget(c13452889.sptg)
e1:SetOperation(c13452889.spop)
c:RegisterEffect(e1)
end
function c101003040.cfilter(c,tp,g,zone)
function c13452889.cfilter(c,tp,g,zone)
return g:IsContains(c) and (Duel.CheckLocation(c:GetControler(),LOCATION_MZONE,c:GetSequence(),true)
or Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0)
end
function c101003040.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
function c13452889.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local lg=c:GetLinkedGroup()
local zone=bit.rshift(c:GetLinkedZone(),16)
if chk==0 then return Duel.CheckReleaseGroup(tp,c101003040.cfilter,1,nil,tp,lg,zone) end
local g=Duel.SelectReleaseGroup(tp,c101003040.cfilter,1,1,nil,tp,lg,zone)
local zone=c:GetLinkedZone(1-tp)
if chk==0 then return Duel.CheckReleaseGroup(tp,c13452889.cfilter,1,nil,tp,lg,zone) end
local g=Duel.SelectReleaseGroup(tp,c13452889.cfilter,1,1,nil,tp,lg,zone)
Duel.Release(g,REASON_COST)
end
function c101003040.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function c13452889.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
local zone1=bit.band(c:GetLinkedZone(),0x1f)
local zone2=bit.rshift(c:GetLinkedZone(),16)
local zone1=c:GetLinkedZone(tp)
local zone2=c:GetLinkedZone(1-tp)
if chk==0 then return c:GetLinkedZone()~=0
and (bc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone1,true))
or (bc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp,zone2)) end
Duel.SetTargetCard(bc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,bc,1,0,0)
end
function c101003040.spop(e,tp,eg,ep,ev,re,r,rp)
function c13452889.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:GetLinkedZone()~=0 and tc:IsRelateToEffect(e) then
local zone1=bit.band(c:GetLinkedZone(),0x1f)
local zone2=bit.rshift(c:GetLinkedZone(),16)
local zone1=c:GetLinkedZone(tp)
local zone2=c:GetLinkedZone(1-tp)
if tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone1)
and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp,zone2) or Duel.SelectYesNo(tp,aux.Stringid(101003040,1))) then
and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp,zone2) or Duel.SelectYesNo(tp,aux.Stringid(13452889,1))) then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP,zone1)
else
if Duel.SpecialSummon(g,0,tp,1-tp,false,false,POS_FACEUP,zone2)~=0
......
--副話術士クララ&ルーシカ
--Ventriloquists Clara & Lucika
--Script by nekrozar
function c101003049.initial_effect(c)
function c1482001.initial_effect(c)
c:EnableReviveLimit()
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsSummonType,SUMMON_TYPE_NORMAL),1,1)
......@@ -9,10 +9,10 @@ function c101003049.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_COST)
e1:SetCost(c101003049.spcost)
e1:SetCost(c1482001.spcost)
c:RegisterEffect(e1)
end
function c101003049.spcost(e,c,tp,st)
function c1482001.spcost(e,c,tp,st)
if bit.band(st,SUMMON_TYPE_LINK)~=SUMMON_TYPE_LINK then return true end
return Duel.GetCurrentPhase()==PHASE_MAIN2
end
--オルターガイスト・ヘクスティア
--Altergeist Hextia
--Scripted by Eerie Code
function c101003046.initial_effect(c)
function c1508649.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x103),2,2)
--atk
......@@ -10,80 +10,80 @@ function c101003046.initial_effect(c)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c101003046.atkval)
e1:SetValue(c1508649.atkval)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101003046,0))
e2:SetDescription(aux.Stringid(1508649,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c101003046.discon)
e2:SetCost(c101003046.discost)
e2:SetTarget(c101003046.distg)
e2:SetOperation(c101003046.disop)
e2:SetCondition(c1508649.discon)
e2:SetCost(c1508649.discost)
e2:SetTarget(c1508649.distg)
e2:SetOperation(c1508649.disop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101003046,1))
e3:SetDescription(aux.Stringid(1508649,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,101003046)
e3:SetCondition(c101003046.thcon)
e3:SetTarget(c101003046.thtg)
e3:SetOperation(c101003046.thop)
e3:SetCountLimit(1,1508649)
e3:SetCondition(c1508649.thcon)
e3:SetTarget(c1508649.thtg)
e3:SetOperation(c1508649.thop)
c:RegisterEffect(e3)
end
function c101003046.atkfilter(c)
function c1508649.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x103) and c:GetBaseAttack()>=0
end
function c101003046.atkval(e,c)
local lg=c:GetLinkedGroup():Filter(c101003046.atkfilter,nil)
function c1508649.atkval(e,c)
local lg=c:GetLinkedGroup():Filter(c1508649.atkfilter,nil)
return lg:GetSum(Card.GetBaseAttack)
end
function c101003046.discon(e,tp,eg,ep,ev,re,r,rp)
function c1508649.discon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainNegatable(ev)
end
function c101003046.cfilter(c,g)
function c1508649.cfilter(c,g)
return c:IsFaceup() and c:IsSetCard(0x103)
and g:IsContains(c) and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c101003046.discost(e,tp,eg,ep,ev,re,r,rp,chk)
function c1508649.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local lg=e:GetHandler():GetLinkedGroup()
if chk==0 then return Duel.CheckReleaseGroup(tp,c101003046.cfilter,1,nil,lg) end
local g=Duel.SelectReleaseGroup(tp,c101003046.cfilter,1,1,nil,lg)
if chk==0 then return Duel.CheckReleaseGroup(tp,c1508649.cfilter,1,nil,lg) end
local g=Duel.SelectReleaseGroup(tp,c1508649.cfilter,1,1,nil,lg)
Duel.Release(g,REASON_COST)
end
function c101003046.distg(e,tp,eg,ep,ev,re,r,rp,chk)
function c1508649.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c101003046.disop(e,tp,eg,ep,ev,re,r,rp)
function c1508649.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c101003046.thcon(e,tp,eg,ep,ev,re,r,rp)
function c1508649.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c101003046.thfilter(c)
function c1508649.thfilter(c)
return c:IsSetCard(0x103) and c:IsAbleToHand()
end
function c101003046.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003046.thfilter,tp,LOCATION_DECK,0,1,nil) end
function c1508649.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c1508649.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101003046.thop(e,tp,eg,ep,ev,re,r,rp)
function c1508649.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101003046.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c1508649.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
......
--インスペクト・ボーダー
--Inspect Boarder
--Script by nekrozar
function c101003035.initial_effect(c)
function c15397015.initial_effect(c)
--summon limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetCondition(c101003035.sumcon)
e1:SetCondition(c15397015.sumcon)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
......@@ -17,13 +17,13 @@ function c101003035.initial_effect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(c101003035.aclimit1)
e2:SetOperation(c15397015.aclimit1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_NEGATED)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(c101003035.aclimit2)
e3:SetOperation(c15397015.aclimit2)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
......@@ -31,55 +31,55 @@ function c101003035.initial_effect(c)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(1,0)
e4:SetCondition(c101003035.econ1)
e4:SetValue(c101003035.elimit)
e4:SetCondition(c15397015.econ1)
e4:SetValue(c15397015.elimit)
c:RegisterEffect(e4)
local e5=e2:Clone()
e5:SetOperation(c101003035.aclimit3)
e5:SetOperation(c15397015.aclimit3)
c:RegisterEffect(e5)
local e6=e3:Clone()
e6:SetOperation(c101003035.aclimit4)
e6:SetOperation(c15397015.aclimit4)
c:RegisterEffect(e6)
local e7=e4:Clone()
e7:SetCondition(c101003035.econ2)
e7:SetCondition(c15397015.econ2)
e7:SetTargetRange(0,1)
c:RegisterEffect(e7)
end
function c101003035.sumcon(e)
function c15397015.sumcon(e)
return Duel.GetFieldGroupCount(e:GetHandler():IsControler(),LOCATION_MZONE,0)>0
end
function c101003035.cfilter(c)
function c15397015.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION+TYPE_RITUAL+TYPE_SYNCHRO+TYPE_XYZ+TYPE_PENDULUM+TYPE_LINK)
end
function c101003035.typecount(c)
function c15397015.typecount(c)
return bit.band(c:GetType(),TYPE_FUSION+TYPE_RITUAL+TYPE_SYNCHRO+TYPE_XYZ+TYPE_PENDULUM+TYPE_LINK)
end
function c101003035.aclimit1(e,tp,eg,ep,ev,re,r,rp)
function c15397015.aclimit1(e,tp,eg,ep,ev,re,r,rp)
if ep~=tp or not re:IsActiveType(TYPE_MONSTER) then return end
e:GetHandler():RegisterFlagEffect(101003035,RESET_EVENT+0x3ff0000+RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(15397015,RESET_EVENT+0x3ff0000+RESET_PHASE+PHASE_END,0,1)
end
function c101003035.aclimit2(e,tp,eg,ep,ev,re,r,rp)
function c15397015.aclimit2(e,tp,eg,ep,ev,re,r,rp)
if ep~=tp or not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
e:GetHandler():ResetFlagEffect(101003035)
e:GetHandler():ResetFlagEffect(15397015)
end
function c101003035.econ1(e)
local g=Duel.GetMatchingGroup(c101003035.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil)
local ct=g:GetClassCount(c101003035.typecount)
return e:GetHandler():GetFlagEffect(101003035)<ct
function c15397015.econ1(e)
local g=Duel.GetMatchingGroup(c15397015.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil)
local ct=g:GetClassCount(c15397015.typecount)
return e:GetHandler():GetFlagEffect(15397015)<ct
end
function c101003035.aclimit3(e,tp,eg,ep,ev,re,r,rp)
function c15397015.aclimit3(e,tp,eg,ep,ev,re,r,rp)
if ep==tp or not re:IsActiveType(TYPE_MONSTER) then return end
e:GetHandler():RegisterFlagEffect(101003135,RESET_EVENT+0x3ff0000+RESET_PHASE+PHASE_END,0,1)
e:GetHandler():RegisterFlagEffect(15397016,RESET_EVENT+0x3ff0000+RESET_PHASE+PHASE_END,0,1)
end
function c101003035.aclimit4(e,tp,eg,ep,ev,re,r,rp)
function c15397015.aclimit4(e,tp,eg,ep,ev,re,r,rp)
if ep==tp or not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
e:GetHandler():ResetFlagEffect(101003135)
e:GetHandler():ResetFlagEffect(15397016)
end
function c101003035.econ2(e)
local g=Duel.GetMatchingGroup(c101003035.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil)
local ct=g:GetClassCount(c101003035.typecount)
return e:GetHandler():GetFlagEffect(101003135)<ct
function c15397015.econ2(e)
local g=Duel.GetMatchingGroup(c15397015.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil)
local ct=g:GetClassCount(c15397015.typecount)
return e:GetHandler():GetFlagEffect(15397016)<ct
end
function c101003035.elimit(e,re,tp)
function c15397015.elimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsImmuneToEffect(e)
end
--魅幽鳥
--Mikuratori
--Script by nekrozar
function c101003032.initial_effect(c)
function c15419596.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c101003032.atkcon)
e1:SetCondition(c15419596.atkcon)
e1:SetValue(1000)
c:RegisterEffect(e1)
local e2=e1:Clone()
......@@ -20,7 +20,7 @@ function c101003032.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c101003032.eacon)
e3:SetCondition(c15419596.eacon)
e3:SetValue(1)
c:RegisterEffect(e3)
--cannot target
......@@ -29,7 +29,7 @@ function c101003032.initial_effect(c)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c101003032.indcon)
e4:SetCondition(c15419596.indcon)
e4:SetValue(aux.tgoval)
c:RegisterEffect(e4)
--indes
......@@ -38,8 +38,8 @@ function c101003032.initial_effect(c)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(c101003032.indcon)
e5:SetValue(c101003032.indval)
e5:SetCondition(c15419596.indcon)
e5:SetValue(c15419596.indval)
c:RegisterEffect(e5)
--cannot activate
local e6=Effect.CreateEffect(c)
......@@ -48,27 +48,27 @@ function c101003032.initial_effect(c)
e6:SetCode(EFFECT_CANNOT_ACTIVATE)
e6:SetRange(LOCATION_MZONE)
e6:SetTargetRange(1,1)
e6:SetCondition(c101003032.actcon)
e6:SetValue(c101003032.aclimit)
e6:SetCondition(c15419596.actcon)
e6:SetValue(c15419596.aclimit)
c:RegisterEffect(e6)
end
function c101003032.atkcon(e)
function c15419596.atkcon(e)
return e:GetHandler():GetSequence()==0
end
function c101003032.eacon(e)
function c15419596.eacon(e)
return e:GetHandler():GetSequence()==4
end
function c101003032.indcon(e)
function c15419596.indcon(e)
return e:GetHandler():GetSequence()==2
end
function c101003032.indval(e,re,tp)
function c15419596.indval(e,re,tp)
return tp~=e:GetHandlerPlayer()
end
function c101003032.actcon(e)
function c15419596.actcon(e)
local c=e:GetHandler()
return c:GetSequence()==1 or c:GetSequence()==3
end
function c101003032.aclimit(e,re,tp)
function c15419596.aclimit(e,re,tp)
local tc=re:GetHandler()
return tc:IsLocation(LOCATION_MZONE) and re:IsActiveType(TYPE_MONSTER) and e:GetHandler():GetColumnGroup():IsContains(tc) and not tc:IsImmuneToEffect(e)
end
--屈強の釣り師
--Angrappler
--Script by nekrozar
function c101003029.initial_effect(c)
function c16632144.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101003029,0))
e1:SetDescription(aux.Stringid(16632144,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c101003029.spcon)
e1:SetTarget(c101003029.sptg)
e1:SetOperation(c101003029.spop)
e1:SetCondition(c16632144.spcon)
e1:SetTarget(c16632144.sptg)
e1:SetOperation(c16632144.spop)
c:RegisterEffect(e1)
end
function c101003029.spcon(e,tp,eg,ep,ev,re,r,rp)
function c16632144.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.GetAttackTarget()==nil
end
function c101003029.spfilter(c,e,tp)
function c16632144.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101003029.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101003029.spfilter(chkc,e,tp) end
function c16632144.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c16632144.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101003029.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
and Duel.IsExistingTarget(c16632144.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101003029.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local g=Duel.SelectTarget(tp,c16632144.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101003029.spop(e,tp,eg,ep,ev,re,r,rp)
function c16632144.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_DEFENSE)
......
--蒼穹の機界騎士
--Mekk-Knight of the Blue Sky
--Scripted by Eerie Code
function c101003014.initial_effect(c)
function c20537097.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101003014)
e1:SetCondition(c101003014.hspcon)
e1:SetValue(c101003014.hspval)
e1:SetCountLimit(1,20537097)
e1:SetCondition(c20537097.hspcon)
e1:SetValue(c20537097.hspval)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101003014,0))
e2:SetDescription(aux.Stringid(20537097,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,101003014+100)
e2:SetTarget(c101003014.thtg)
e2:SetOperation(c101003014.thop)
e2:SetCountLimit(1,20537098)
e2:SetTarget(c20537097.thtg)
e2:SetOperation(c20537097.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c101003014.thcon)
e3:SetCondition(c20537097.thcon)
c:RegisterEffect(e3)
end
function c101003014.cfilter(c)
function c20537097.cfilter(c)
return c:GetColumnGroupCount()>0
end
function c101003014.getzone(tp)
function c20537097.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=0
local lg=Duel.GetMatchingGroup(c101003014.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local lg=Duel.GetMatchingGroup(c20537097.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
if tc:IsControler(tp) then
zone=bit.bor(zone,bit.band(tc:GetColumnZone(LOCATION_MZONE),0xff))
else
zone=bit.bor(zone,bit.rshift(bit.band(tc:GetColumnZone(LOCATION_MZONE),0xff0000),16))
end
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tc:GetControler()))
end
return zone
end
function c101003014.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=c101003014.getzone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c101003014.hspval(e,c)
function c20537097.hspval(e,c)
local tp=c:GetControler()
return 0,c101003014.getzone(tp)
local zone=0
local lg=Duel.GetMatchingGroup(c20537097.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tc:GetControler()))
end
return 0,zone
end
function c101003014.thcon(e,tp,eg,ep,ev,re,r,rp)
function c20537097.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function c101003014.thfilter(c)
return c:IsSetCard(0x20c) and c:IsType(TYPE_MONSTER) and not c:IsCode(101003014) and c:IsAbleToHand()
function c20537097.thfilter(c)
return c:IsSetCard(0x10c) and c:IsType(TYPE_MONSTER) and not c:IsCode(20537097) and c:IsAbleToHand()
end
function c101003014.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c101003014.thfilter,tp,LOCATION_DECK,0,nil)
function c20537097.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c20537097.thfilter,tp,LOCATION_DECK,0,nil)
local ct=e:GetHandler():GetColumnGroup():FilterCount(Card.IsControler,nil,1-tp)
if chk==0 then return ct>0 and g:GetClassCount(Card.GetCode)>=ct end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,ct,tp,LOCATION_DECK)
end
function c101003014.thop(e,tp,eg,ep,ev,re,r,rp)
function c20537097.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c101003014.thfilter,tp,LOCATION_DECK,0,nil)
local g=Duel.GetMatchingGroup(c20537097.thfilter,tp,LOCATION_DECK,0,nil)
local ct=e:GetHandler():GetColumnGroup():FilterCount(Card.IsControler,nil,1-tp)
if ct<=0 or g:GetClassCount(Card.GetCode)<ct then return end
local hg=Group.CreateGroup()
......
--フリック・クラウン
--Flick Clown
--Script by nekrozar
function c101003004.initial_effect(c)
function c209710.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101003004,0))
e1:SetDescription(aux.Stringid(209710,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101003004)
e1:SetCondition(c101003004.drcon)
e1:SetCost(c101003004.drcost)
e1:SetTarget(c101003004.drtg)
e1:SetOperation(c101003004.drop)
e1:SetCountLimit(1,209710)
e1:SetCondition(c209710.drcon)
e1:SetCost(c209710.drcost)
e1:SetTarget(c209710.drtg)
e1:SetOperation(c209710.drop)
c:RegisterEffect(e1)
end
function c101003004.cfilter(c)
function c209710.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_CYBERSE)
end
function c101003004.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c101003004.cfilter,tp,LOCATION_MZONE,0,2,e:GetHandler())
function c209710.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c209710.cfilter,tp,LOCATION_MZONE,0,2,e:GetHandler())
and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c101003004.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
function c209710.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c101003004.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
function c209710.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 c101003004.drop(e,tp,eg,ep,ev,re,r,rp)
function c209710.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
--セキュア・ガードナー
--Security Gardna
--Script by nekrozar
function c101003043.initial_effect(c)
c:SetUniqueOnField(1,0,101003043)
function c2220237.initial_effect(c)
c:SetUniqueOnField(1,0,2220237)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c101003043.matfilter,1,1)
aux.AddLinkProcedure(c,c2220237.matfilter,1,1)
--cannot link material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -17,7 +17,7 @@ function c101003043.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(c101003043.regop)
e2:SetOperation(c2220237.regop)
c:RegisterEffect(e2)
--damage reduce
local e3=Effect.CreateEffect(c)
......@@ -26,20 +26,20 @@ function c101003043.initial_effect(c)
e3:SetCode(EFFECT_CHANGE_DAMAGE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(1,0)
e3:SetValue(c101003043.damval2)
e3:SetValue(c2220237.damval2)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e4:SetCondition(c101003043.damcon)
e4:SetCondition(c2220237.damcon)
c:RegisterEffect(e4)
end
function c101003043.regop(e,tp,eg,ep,ev,re,r,rp)
function c2220237.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c101003043.damval1)
e1:SetValue(c2220237.damval1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
......@@ -47,21 +47,21 @@ function c101003043.regop(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c101003043.matfilter(c)
function c2220237.matfilter(c)
return c:IsRace(RACE_CYBERSE) and c:IsLinkType(TYPE_LINK)
end
function c101003043.damval1(e,re,val,r,rp,rc)
function c2220237.damval1(e,re,val,r,rp,rc)
if bit.band(r,REASON_EFFECT)~=0 then return 0
else return val end
end
function c101003043.damval2(e,re,val,r,rp,rc)
function c2220237.damval2(e,re,val,r,rp,rc)
local c=e:GetHandler()
if bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 and c:GetFlagEffect(101003043)==0 then
c:RegisterFlagEffect(101003043,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
if bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 and c:GetFlagEffect(2220237)==0 then
c:RegisterFlagEffect(2220237,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
return 0
end
return val
end
function c101003043.damcon(e)
return e:GetHandler():GetFlagEffect(101003043)==0
function c2220237.damcon(e)
return e:GetHandler():GetFlagEffect(2220237)==0
end
--センサー万別
--Sensor Differentiation
--Scripted by Eerie Code and edo9300
function c24207889.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c0)
e1:SetTarget(c24207889.acttg)
e1:SetOperation(c24207889.actop)
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_SZONE)
e2:SetOperation(c24207889.adjustop)
c:RegisterEffect(e2)
--cannot summon,spsummon,flipsummon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,1)
e4:SetTarget(c24207889.sumlimit)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_CANNOT_SUMMON)
c:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
c:RegisterEffect(e6)
end
c24207889[0]=nil
c24207889[1]=nil
function c24207889.sumlimit(e,c,sump,sumtype,sumpos,targetp)
if sumpos and bit.band(sumpos,POS_FACEDOWN)>0 then return false end
local tp=sump
if targetp then tp=targetp end
return Duel.IsExistingMatchingCard(c24207889.rmfilter,tp,LOCATION_MZONE,0,1,nil,c:GetRace())
end
function c24207889.rmfilter(c,rc)
return c:IsFaceup() and c:IsRace(rc)
end
function c24207889.filter(c,g,pg)
if pg:IsContains(c) then return false end
local rc=c:GetRace()
return g:IsExists(Card.IsRace,1,c,rc) or pg:IsExists(Card.IsRace,1,c,rc)
end
function c24207889.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
c24207889[0]=Group.CreateGroup()
c24207889[0]:KeepAlive()
c24207889[1]=Group.CreateGroup()
c24207889[1]:KeepAlive()
end
function c24207889.actop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local g=Duel.GetMatchingGroup(Card.IsFaceup,p,LOCATION_MZONE,0,nil)
local race=1
while bit.band(RACE_ALL,race)~=0 do
local rg=g:Filter(Card.IsRace,nil,race)
local rc=rg:GetCount()
if rc>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local dg=rg:Select(p,rc-1,rc-1,nil)
Duel.SendtoGrave(dg,REASON_EFFECT)
local g=Duel.GetMatchingGroup(Card.IsFaceup,p,LOCATION_MZONE,0,nil)
end
race=race*2
end
end
end
function c24207889.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 c=e:GetHandler()
if c:GetFlagEffect(24207889)==0 then
c:RegisterFlagEffect(24207889,RESET_EVENT+0x1ff0000,0,1)
c24207889[0]:Clear()
c24207889[1]:Clear()
end
for p=0,1 do
local pg=c24207889[p]
local g=Duel.GetMatchingGroup(Card.IsFaceup,p,LOCATION_MZONE,0,nil)
local dg=g:Filter(c24207889.filter,nil,g,pg)
if dg:GetCount()==0 or Duel.SendtoGrave(dg,REASON_EFFECT)==0 then
pg:Clear()
pg:Merge(g)
pg:Sub(dg)
else
g=Duel.GetMatchingGroup(Card.IsFaceup,p,LOCATION_MZONE,0,nil)
pg:Clear()
pg:Merge(g)
pg:Sub(dg)
Duel.Readjust()
end
end
end
--魔導変換
--Magical Burst
--Scripted by Eerie Code
function c101003073.initial_effect(c)
function c24429467.initial_effect(c)
c:EnableCounterPermit(0x1)
--Activate
local e1=Effect.CreateEffect(c)
......@@ -20,7 +20,7 @@ function c101003073.initial_effect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_SZONE)
e3:SetOperation(c101003073.acop)
e3:SetOperation(c24429467.acop)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
......@@ -28,37 +28,37 @@ function c101003073.initial_effect(c)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,101003073)
e4:SetCondition(c101003073.thcon)
e4:SetCost(c101003073.thcost)
e4:SetTarget(c101003073.thtg)
e4:SetOperation(c101003073.thop)
e4:SetCountLimit(1,24429467)
e4:SetCondition(c24429467.thcon)
e4:SetCost(c24429467.thcost)
e4:SetTarget(c24429467.thtg)
e4:SetOperation(c24429467.thop)
c:RegisterEffect(e4)
end
function c101003073.acop(e,tp,eg,ep,ev,re,r,rp)
function c24429467.acop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_PLAYER)
local c=e:GetHandler()
if re:IsActiveType(TYPE_MONSTER) and p~=tp and c:GetFlagEffect(1)>0 then
c:AddCounter(0x1,1)
end
end
function c101003073.thcon(e,tp,eg,ep,ev,re,r,rp)
function c24429467.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0x1)>=6
end
function c101003073.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
function c24429467.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c101003073.thfilter(c)
function c24429467.thfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c101003073.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003073.thfilter,tp,LOCATION_DECK,0,1,nil) end
function c24429467.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24429467.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101003073.thop(e,tp,eg,ep,ev,re,r,rp)
function c24429467.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101003073.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c24429467.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
......
--天火の牢獄
--Fire Prison
--Script by nekrozar
function c101003052.initial_effect(c)
function c269510.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
......@@ -23,7 +23,7 @@ function c101003052.initial_effect(c)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(1,1)
e3:SetTarget(c101003052.splimit)
e3:SetTarget(c269510.splimit)
c:RegisterEffect(e3)
--cannot attack
local e4=Effect.CreateEffect(c)
......@@ -31,15 +31,15 @@ function c101003052.initial_effect(c)
e4:SetCode(EFFECT_CANNOT_ATTACK)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetTarget(c101003052.atktg)
e4:SetTarget(c269510.atktg)
c:RegisterEffect(e4)
--disable
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAIN_SOLVING)
e5:SetRange(LOCATION_FZONE)
e5:SetCondition(c101003052.discon)
e5:SetOperation(c101003052.disop)
e5:SetCondition(c269510.discon)
e5:SetOperation(c269510.disop)
c:RegisterEffect(e5)
--cannot attack
local e6=Effect.CreateEffect(c)
......@@ -47,8 +47,8 @@ function c101003052.initial_effect(c)
e6:SetCode(EFFECT_CANNOT_ATTACK)
e6:SetRange(LOCATION_FZONE)
e6:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e6:SetCondition(c101003052.limcon)
e6:SetTarget(c101003052.atlimit)
e6:SetCondition(c269510.limcon)
e6:SetTarget(c269510.atlimit)
c:RegisterEffect(e6)
--cannot be battle target
local e7=Effect.CreateEffect(c)
......@@ -56,8 +56,8 @@ function c101003052.initial_effect(c)
e7:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e7:SetRange(LOCATION_FZONE)
e7:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e7:SetCondition(c101003052.limcon)
e7:SetValue(c101003052.atlimit)
e7:SetCondition(c269510.limcon)
e7:SetValue(c269510.atlimit)
c:RegisterEffect(e7)
--cannot be effect target
local e8=Effect.CreateEffect(c)
......@@ -66,36 +66,36 @@ function c101003052.initial_effect(c)
e8:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e8:SetRange(LOCATION_FZONE)
e8:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e8:SetCondition(c101003052.limcon)
e8:SetCondition(c269510.limcon)
e8:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_CYBERSE))
e8:SetValue(1)
c:RegisterEffect(e8)
end
function c101003052.limfilter(c)
function c269510.limfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function c101003052.splimit(e,c,tp,sumtp,sumpos)
local g=Duel.GetMatchingGroup(c101003052.limfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
function c269510.splimit(e,c,tp,sumtp,sumpos)
local g=Duel.GetMatchingGroup(c269510.limfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()<=0 then return false end
local mg,lk=g:GetMinGroup(Card.GetLink)
return lk>c:GetLink() and bit.band(sumtp,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function c101003052.atktg(e,c)
function c269510.atktg(e,c)
return not c:IsType(TYPE_LINK)
end
function c101003052.cfilter(c)
function c269510.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_LINK)
end
function c101003052.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(c101003052.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)>1
function c269510.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(c269510.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)>1
and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsRace(RACE_CYBERSE)
end
function c101003052.disop(e,tp,eg,ep,ev,re,r,rp)
function c269510.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c101003052.limcon(e)
return Duel.GetMatchingGroupCount(c101003052.cfilter,e:GetHandler():GetControler(),LOCATION_MZONE,LOCATION_MZONE,nil)>1
function c269510.limcon(e)
return Duel.GetMatchingGroupCount(c269510.cfilter,e:GetHandler():GetControler(),LOCATION_MZONE,LOCATION_MZONE,nil)>1
end
function c101003052.atlimit(e,c)
function c269510.atlimit(e,c)
return c:IsFaceup() and c:IsRace(RACE_CYBERSE)
end
--魔導獣 キングジャッカル
--Mythical Beast King Jackal
--Scripted by Eerie Code
function c101003102.initial_effect(c)
function c27354732.initial_effect(c)
aux.EnablePendulumAttribute(c)
c:EnableCounterPermit(0x1)
--destroy & summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101003102,0))
e1:SetDescription(aux.Stringid(27354732,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,101003102)
e1:SetCondition(c101003102.spcon)
e1:SetTarget(c101003102.sptg)
e1:SetOperation(c101003102.spop)
e1:SetCountLimit(1,27354732)
e1:SetCondition(c27354732.spcon)
e1:SetTarget(c27354732.sptg)
e1:SetOperation(c27354732.spop)
c:RegisterEffect(e1)
--add counter
local e2=Effect.CreateEffect(c)
......@@ -28,70 +28,70 @@ function c101003102.initial_effect(c)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(c101003102.acop)
e3:SetOperation(c27354732.acop)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101003102,1))
e4:SetDescription(aux.Stringid(27354732,1))
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c101003102.condition)
e4:SetCost(c101003102.cost)
e4:SetTarget(c101003102.target)
e4:SetOperation(c101003102.operation)
e4:SetCondition(c27354732.condition)
e4:SetCost(c27354732.cost)
e4:SetTarget(c27354732.target)
e4:SetOperation(c27354732.operation)
c:RegisterEffect(e1)
end
function c101003102.spcon(e,tp,eg,ep,ev,re,r,rp)
function c27354732.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)
end
function c101003102.spfilter(c,e,tp)
return c:IsSetCard(0x209) and c:IsFaceup() and c:IsType(TYPE_PENDULUM)
and not c:IsCode(101003102) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function c27354732.spfilter(c,e,tp)
return c:IsSetCard(0x10d) and c:IsFaceup() and c:IsType(TYPE_PENDULUM)
and not c:IsCode(27354732) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101003102.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function c27354732.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDestructable() and Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingTarget(c101003102.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
and Duel.IsExistingTarget(c27354732.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c101003102.spop(e,tp,eg,ep,ev,re,r,rp)
function c27354732.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 then
if Duel.GetLocationCountFromEx(tp)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101003102.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,c27354732.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c101003102.acop(e,tp,eg,ep,ev,re,r,rp)
function c27354732.acop(e,tp,eg,ep,ev,re,r,rp)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and e:GetHandler():GetFlagEffect(1)>0 then
e:GetHandler():AddCounter(0x1,1)
end
end
function c101003102.condition(e,tp,eg,ep,ev,re,r,rp)
function c27354732.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
return rp~=tp and re:IsActiveType(TYPE_MONSTER) and not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function c101003102.cost(e,tp,eg,ep,ev,re,r,rp,chk)
function c27354732.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x1,2,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x1,2,REASON_COST)
end
function c101003102.target(e,tp,eg,ep,ev,re,r,rp,chk)
function c27354732.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c101003102.operation(e,tp,eg,ep,ev,re,r,rp)
function c27354732.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
......
--魔導獣 ガルーダ
--Mythical Beast Garuda
--Scripted by Eerie Code
function c101003023.initial_effect(c)
function c28570310.initial_effect(c)
aux.EnablePendulumAttribute(c)
c:EnableCounterPermit(0x1)
--destroy & counter
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101003023,0))
e1:SetDescription(aux.Stringid(28570310,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,101003023)
e1:SetCondition(c101003023.descon)
e1:SetTarget(c101003023.destg)
e1:SetOperation(c101003023.desop)
e1:SetCountLimit(1,28570310)
e1:SetCondition(c28570310.descon)
e1:SetTarget(c28570310.destg)
e1:SetOperation(c28570310.desop)
c:RegisterEffect(e1)
--add counter
local e2=Effect.CreateEffect(c)
......@@ -29,29 +29,29 @@ function c101003023.initial_effect(c)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(c101003023.acop)
e3:SetOperation(c28570310.acop)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101003023,1))
e4:SetDescription(aux.Stringid(28570310,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetRange(LOCATION_HAND)
e4:SetCountLimit(1,101003023+100)
e4:SetCondition(c101003023.spcon)
e4:SetCost(c101003023.spcost)
e4:SetTarget(c101003023.sptg)
e4:SetOperation(c101003023.spop)
e4:SetCountLimit(1,28570311)
e4:SetCondition(c28570310.spcon)
e4:SetCost(c28570310.spcost)
e4:SetTarget(c28570310.sptg)
e4:SetOperation(c28570310.spop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
end
function c101003023.descon(e,tp,eg,ep,ev,re,r,rp)
function c28570310.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)
end
function c101003023.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c28570310.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc~=c and chkc:IsType(TYPE_SPELL+TYPE_TRAP) end
if chk==0 then return c:IsDestructable()
......@@ -61,7 +61,7 @@ function c101003023.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c101003023.desop(e,tp,eg,ep,ev,re,r,rp)
function c28570310.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
......@@ -69,30 +69,30 @@ function c101003023.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(g,REASON_EFFECT)
end
end
function c101003023.acop(e,tp,eg,ep,ev,re,r,rp)
function c28570310.acop(e,tp,eg,ep,ev,re,r,rp)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and e:GetHandler():GetFlagEffect(1)>0 then
e:GetHandler():AddCounter(0x1,1)
end
end
function c101003023.cfilter(c,tp)
function c28570310.cfilter(c,tp)
return c:GetSummonPlayer()==tp
end
function c101003023.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101003023.cfilter,1,nil,1-tp)
function c28570310.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c28570310.cfilter,1,nil,1-tp)
end
function c101003023.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
function c28570310.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x1,3,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x1,3,REASON_COST)
end
function c101003023.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function c28570310.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=eg:Filter(c101003023.cfilter,1,nil,1-tp):Filter(Card.IsAbleToHand,nil)
local g=eg:Filter(c28570310.cfilter,1,nil,1-tp):Filter(Card.IsAbleToHand,nil)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c101003023.spop(e,tp,eg,ep,ev,re,r,rp)
function c28570310.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=eg:Filter(Card.IsControler,nil,1-tp):Filter(Card.IsAbleToHand,nil)
......
--紫宵の機界騎士
--Mekk-Knight of the Purple Dusk
--Scripted by Eerie Code
function c101003020.initial_effect(c)
function c28692962.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101003020)
e1:SetCondition(c101003020.hspcon)
e1:SetValue(c101003020.hspval)
e1:SetCountLimit(1,28692962)
e1:SetCondition(c28692962.hspcon)
e1:SetValue(c28692962.hspval)
c:RegisterEffect(e1)
--banish & search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101003020,0))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetDescription(aux.Stringid(28692962,0))
e2:SetCategory(CATEGORY_REMOVE+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101003020+100)
e2:SetTarget(c101003020.thtg)
e2:SetOperation(c101003020.thop)
e2:SetCountLimit(1,28692963)
e2:SetTarget(c28692962.thtg)
e2:SetOperation(c28692962.thop)
c:RegisterEffect(e2)
end
function c101003020.cfilter(c)
function c28692962.cfilter(c)
return c:GetColumnGroupCount()>0
end
function c101003020.getzone(tp)
function c28692962.getzone(tp)
local zone=0
local lg=Duel.GetMatchingGroup(c101003020.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local lg=Duel.GetMatchingGroup(c28692962.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
if tc:IsControler(tp) then
zone=bit.bor(zone,bit.band(tc:GetColumnZone(LOCATION_MZONE),0xff))
......@@ -40,32 +40,32 @@ function c101003020.getzone(tp)
end
return zone
end
function c101003020.hspcon(e,c)
function c28692962.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=c101003020.getzone(tp)
local zone=c28692962.getzone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c101003020.hspval(e,c)
function c28692962.hspval(e,c)
local tp=c:GetControler()
return 0,c101003020.getzone(tp)
return 0,c28692962.getzone(tp)
end
function c101003020.rmfilter(c)
return c:IsFaceup() and c:IsSetCard(0x20c) and c:IsAbleToRemove()
function c28692962.rmfilter(c)
return c:IsFaceup() and c:IsSetCard(0x10c) and c:IsAbleToRemove()
end
function c101003020.thfilter(c)
return c:IsSetCard(0x20c) and c:IsType(TYPE_MONSTER) and not c:IsCode(101003020) and c:IsAbleToHand()
function c28692962.thfilter(c)
return c:IsSetCard(0x10c) and c:IsType(TYPE_MONSTER) and not c:IsCode(28692962) and c:IsAbleToHand()
end
function c101003020.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101003020.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101003020.rmfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c101003020.thfilter,tp,LOCATION_DECK,0,1,nil) end
function c28692962.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c28692962.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c28692962.rmfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c28692962.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c101003020.rmfilter,tp,LOCATION_MZONE,0,1,1,nil)
local g=Duel.SelectTarget(tp,c28692962.rmfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101003020.thop(e,tp,eg,ep,ev,re,r,rp)
function c28692962.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0
and tc:IsLocation(LOCATION_REMOVED) then
......@@ -76,8 +76,8 @@ function c101003020.thop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetLabelObject(tc)
e1:SetCountLimit(1)
e1:SetCondition(c101003020.retcon)
e1:SetOperation(c101003020.retop)
e1:SetCondition(c28692962.retcon)
e1:SetOperation(c28692962.retop)
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
e1:SetValue(Duel.GetTurnCount())
......@@ -86,20 +86,20 @@ function c101003020.thop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(0)
end
Duel.RegisterEffect(e1,tp)
tc:RegisterFlagEffect(101003020,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,ct)
tc:RegisterFlagEffect(28692962,RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,ct)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101003020.thfilter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c28692962.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
end
function c101003020.retcon(e,tp,eg,ep,ev,re,r,rp)
function c28692962.retcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp or Duel.GetTurnCount()==e:GetValue() then return false end
return e:GetLabelObject():GetFlagEffect(101003020)~=0
return e:GetLabelObject():GetFlagEffect(28692962)~=0
end
function c101003020.retop(e,tp,eg,ep,ev,re,r,rp)
function c28692962.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.ReturnToField(tc)
end
--一撃離脱
--Parthian Shot
--Script by nekrozar
function c101003079.initial_effect(c)
function c29185231.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_BATTLE_END)
e1:SetCondition(c101003079.condition)
e1:SetOperation(c101003079.activate)
e1:SetCondition(c29185231.condition)
e1:SetOperation(c29185231.activate)
c:RegisterEffect(e1)
end
function c101003079.condition(e,tp,eg,ep,ev,re,r,rp)
function c29185231.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_BATTLE
end
function c101003079.activate(e,tp,eg,ep,ev,re,r,rp)
function c29185231.activate(e,tp,eg,ep,ev,re,r,rp)
local turnp=Duel.GetTurnPlayer()
Duel.SkipPhase(turnp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(turnp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
......
--星遺物へと至る鍵
--Key to World Legacy
--Script by nekrozar
function c101003057.initial_effect(c)
function c2930675.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c101003057.target)
e1:SetTarget(c2930675.target)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c101003057.discon)
e2:SetOperation(c101003057.disop)
e2:SetCondition(c2930675.discon)
e2:SetOperation(c2930675.disop)
c:RegisterEffect(e2)
end
function c101003057.thfilter(c)
return ((c:IsSetCard(0x20c) and c:IsType(TYPE_MONSTER)) or c:IsSetCard(0xfe)) and c:IsAbleToHand()
function c2930675.thfilter(c)
return ((c:IsSetCard(0x10c) and c:IsType(TYPE_MONSTER)) or c:IsSetCard(0xfe)) and c:IsFaceup() and c:IsAbleToHand()
end
function c101003057.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c101003057.thfilter(chkc) end
function c2930675.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c2930675.thfilter(chkc) end
if chk==0 then return true end
if Duel.IsExistingTarget(c101003057.thfilter,tp,LOCATION_REMOVED,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(101003057,0)) then
if Duel.IsExistingTarget(c2930675.thfilter,tp,LOCATION_REMOVED,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(2930675,0)) then
e:SetCategory(CATEGORY_TOHAND)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
e:SetOperation(c101003057.activate)
e:SetOperation(c2930675.activate)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101003057.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
local g=Duel.SelectTarget(tp,c2930675.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
else
e:SetCategory(0)
......@@ -37,19 +37,19 @@ function c101003057.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetOperation(nil)
end
end
function c101003057.activate(e,tp,eg,ep,ev,re,r,rp)
function c2930675.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c101003057.cfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsSetCard(0x20c)
function c2930675.cfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsSetCard(0x10c)
end
function c101003057.discon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_TRAP) and re:GetHandler():GetColumnGroup():FilterCount(c101003057.cfilter,nil,tp)>0
function c2930675.discon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_TRAP) and re:GetHandler():GetColumnGroup():FilterCount(c2930675.cfilter,nil,tp)>0
end
function c101003057.disop(e,tp,eg,ep,ev,re,r,rp)
function c2930675.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
--黄華の機界騎士
--Mekk-Knight of the Yellow Bloom
--Scripted by Eerie Code
function c101003017.initial_effect(c)
function c29415459.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101003017)
e1:SetCondition(c101003017.hspcon)
e1:SetValue(c101003017.hspval)
e1:SetCountLimit(1,29415459)
e1:SetCondition(c29415459.hspcon)
e1:SetValue(c29415459.hspval)
c:RegisterEffect(e1)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101003017,0))
e3:SetDescription(aux.Stringid(29415459,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c101003017.cost)
e3:SetTarget(c101003017.target)
e3:SetOperation(c101003017.operation)
e3:SetCost(c29415459.cost)
e3:SetTarget(c29415459.target)
e3:SetOperation(c29415459.operation)
c:RegisterEffect(e3)
end
function c101003017.cfilter(c)
function c29415459.cfilter(c)
return c:GetColumnGroupCount()>0
end
function c101003017.getzone(tp)
function c29415459.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=0
local lg=Duel.GetMatchingGroup(c101003017.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local lg=Duel.GetMatchingGroup(c29415459.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
if tc:IsControler(tp) then
zone=bit.bor(zone,bit.band(tc:GetColumnZone(LOCATION_MZONE),0xff))
else
zone=bit.bor(zone,bit.rshift(bit.band(tc:GetColumnZone(LOCATION_MZONE),0xff0000),16))
end
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tc:GetControler()))
end
return zone
end
function c101003017.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=c101003017.getzone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c101003017.hspval(e,c)
function c29415459.hspval(e,c)
local tp=c:GetControler()
return 0,c101003017.getzone(tp)
local zone=0
local lg=Duel.GetMatchingGroup(c29415459.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tc:GetControler()))
end
return 0,zone
end
function c101003017.costfilter(c)
return c:IsSetCard(0x20c) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
function c29415459.costfilter(c)
return c:IsSetCard(0x10c) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c101003017.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003017.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
function c29415459.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29415459.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c101003017.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c29415459.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c101003017.filter(c,g)
function c29415459.filter(c,g)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and g:IsContains(c)
end
function c101003017.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c29415459.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local cg=e:GetHandler():GetColumnGroup()
if chkc then return c101003017.filter(chkc,cg) and chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(c101003017.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,cg) end
if chkc then return c29415459.filter(chkc,cg) and chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(c29415459.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,cg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c101003017.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,cg)
local g=Duel.SelectTarget(tp,c29415459.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,cg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101003017.operation(e,tp,eg,ep,ev,re,r,rp)
function c29415459.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
......
--魔法の歯車
function c313513.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:SetCost(c313513.cost)
e1:SetTarget(c313513.target)
e1:SetOperation(c313513.activate)
c:RegisterEffect(e1)
end
c313513.card_code_list={83104731}
function c313513.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x7) and c:IsAbleToGraveAsCost()
end
function c313513.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft+1
local tg=Duel.GetMatchingGroup(c313513.cfilter,tp,LOCATION_ONFIELD,0,nil)
if chk==0 then
e:SetLabel(1)
return ct<=3 and tg:GetCount()>=3
and (ct<=0 or tg:IsExists(Card.IsLocation,ct,nil,LOCATION_MZONE))
end
local g=nil
if ct>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
g=tg:FilterSelect(tp,Card.IsLocation,ct,ct,nil,LOCATION_MZONE)
if ct<3 then
tg:Sub(g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=tg:Select(tp,3-ct,3-ct,nil)
g:Merge(g2)
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
g=tg:Select(tp,3,3,nil)
end
Duel.SendtoGrave(g,REASON_COST)
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetReset(RESET_SELF_TURN+RESET_PHASE+PHASE_END,2)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e2,tp)
end
function c313513.filter(c,e,tp)
return c:IsCode(83104731) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c313513.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c313513.filter,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 c313513.dfilter(c)
return c:IsFacedown() or c:GetCode()~=83104731
end
function c313513.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
local ct=0
if ft==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c313513.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
ct=Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,c313513.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g1:GetCount()>0 and Duel.SpecialSummonStep(g1:GetFirst(),0,tp,tp,true,false,POS_FACEUP) then ct=ct+1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,c313513.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g2:GetCount()>0 and Duel.SpecialSummonStep(g2:GetFirst(),0,tp,tp,true,false,POS_FACEUP) then ct=ct+1 end
Duel.SpecialSummonComplete()
end
if ct>0 then
local dg=Duel.GetMatchingGroup(c313513.dfilter,tp,LOCATION_MZONE,0,nil)
if dg:GetCount()>0 then
Duel.BreakEffect()
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
--ティンダングル・ハウンド
--Tindangle Hound
function c101003011.initial_effect(c)
function c31759689.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101003011,0))
e1:SetDescription(aux.Stringid(31759689,0))
e1:SetCategory(CATEGORY_POSITION+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c101003011.target)
e1:SetOperation(c101003011.operation)
e1:SetTarget(c31759689.target)
e1:SetOperation(c31759689.operation)
c:RegisterEffect(e1)
--atk down
local e2=Effect.CreateEffect(c)
......@@ -16,30 +16,30 @@ function c101003011.initial_effect(c)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetValue(c101003011.val)
e2:SetValue(c31759689.val)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101003011,1))
e3:SetDescription(aux.Stringid(31759689,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCategory(CATEGORY_POSITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c101003011.poscon)
e3:SetTarget(c101003011.postg)
e3:SetOperation(c101003011.posop)
e3:SetCondition(c31759689.poscon)
e3:SetTarget(c31759689.postg)
e3:SetOperation(c31759689.posop)
c:RegisterEffect(e3)
end
function c101003011.filter(c)
function c31759689.filter(c)
return c:IsFaceup() and c:IsCanTurnSet() and c:GetBaseAttack()>0
end
function c101003011.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101003011.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101003011.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
function c31759689.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c31759689.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c31759689.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101003011.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler())
Duel.SelectTarget(tp,c31759689.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler())
end
function c101003011.operation(e,tp,eg,ep,ev,re,r,rp)
function c31759689.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and c:IsRelateToEffect(e) and c:IsFaceup() then
......@@ -53,23 +53,23 @@ function c101003011.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
function c101003011.val(e,c)
function c31759689.val(e,c)
return c:GetLinkedGroupCount()*-1000
end
function c101003011.poscon(e,tp,eg,ep,ev,re,r,rp)
function c31759689.poscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function c101003011.posfilter(c)
function c31759689.posfilter(c)
return c:IsFacedown() and c:IsCanChangePosition()
end
function c101003011.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101003011.posfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101003011.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
function c31759689.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c31759689.posfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c31759689.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
Duel.SelectTarget(tp,c101003011.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SelectTarget(tp,c31759689.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c101003011.posop(e,tp,eg,ep,ev,re,r,rp)
function c31759689.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)
......
--メタルヴァレット・ドラゴン
--Metalrokket Dragon
--Scripted by Eerie Code
function c101003008.initial_effect(c)
function c32472237.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101003008,0))
e1:SetDescription(aux.Stringid(32472237,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101003008)
e1:SetCondition(c101003008.descon)
e1:SetTarget(c101003008.destg)
e1:SetOperation(c101003008.desop)
e1:SetCountLimit(1,32472237)
e1:SetCondition(c32472237.descon)
e1:SetTarget(c32472237.destg)
e1:SetOperation(c32472237.desop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetOperation(c101003008.regop)
e2:SetOperation(c32472237.regop)
c:RegisterEffect(e2)
end
function c101003008.descon(e,tp,eg,ep,ev,re,r,rp)
function c32472237.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or not g:IsContains(c) then return false end
return re:IsActiveType(TYPE_LINK)
end
function c101003008.desfilter(c,g)
function c32472237.desfilter(c,g)
return g:IsContains(c)
end
function c101003008.destg(e,tp,eg,ep,ev,re,r,rp,chk)
function c32472237.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local cg=c:GetColumnGroup():Filter(Card.IsControler,nil,1-tp)
if chk==0 then return c:IsDestructable() and cg:GetCount()>0 end
cg:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c101003008.desop(e,tp,eg,ep,ev,re,r,rp)
function c32472237.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cg=c:GetColumnGroup():Filter(Card.IsControler,nil,1-tp)
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0 and cg:GetCount()>0 then
......@@ -47,34 +47,34 @@ function c101003008.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(cg,REASON_EFFECT)
end
end
function c101003008.regop(e,tp,eg,ep,ev,re,r,rp)
function c32472237.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_ONFIELD) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101003008,1))
e1:SetDescription(aux.Stringid(32472237,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1,101003008+100)
e1:SetCountLimit(1,32472238)
e1:SetRange(LOCATION_GRAVE)
e1:SetTarget(c101003008.sptg)
e1:SetOperation(c101003008.spop)
e1:SetTarget(c32472237.sptg)
e1:SetOperation(c32472237.spop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c101003008.spfilter(c,e,tp)
return c:IsSetCard(0x102) and not c:IsCode(101003008) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function c32472237.spfilter(c,e,tp)
return c:IsSetCard(0x102) and not c:IsCode(32472237) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101003008.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function c32472237.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101003008.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
and Duel.IsExistingMatchingCard(c32472237.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101003008.spop(e,tp,eg,ep,ev,re,r,rp)
function c32472237.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,c101003008.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,c32472237.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
......
--オルターガイスト・マテリアリゼーション
--Altergeist Materialization
--Scripted by Eerie Code
function c101003070.initial_effect(c)
function c35146019.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:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c101003070.target)
e1:SetOperation(c101003070.operation)
e1:SetTarget(c35146019.target)
e1:SetOperation(c35146019.operation)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetOperation(c101003070.desop)
e2:SetOperation(c35146019.desop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
......@@ -24,28 +24,28 @@ function c101003070.initial_effect(c)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,101003070)
e3:SetCountLimit(1,35146019)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c101003070.thtg)
e3:SetOperation(c101003070.thop)
e3:SetTarget(c35146019.thtg)
e3:SetOperation(c35146019.thop)
c:RegisterEffect(e3)
end
function c101003070.spfilter(c,e,tp)
function c35146019.spfilter(c,e,tp)
return c:IsSetCard(0x103) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
end
function c101003070.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101003070.spfilter(chkc,e,tp) end
function c35146019.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c35146019.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101003070.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
and Duel.IsExistingTarget(c35146019.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101003070.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local g=Duel.SelectTarget(tp,c35146019.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c101003070.eqlimit(e,c)
function c35146019.eqlimit(e,c)
return e:GetLabelObject()==c
end
function c101003070.operation(e,tp,eg,ep,ev,re,r,rp)
function c35146019.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
......@@ -58,29 +58,29 @@ function c101003070.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c101003070.eqlimit)
e1:SetValue(c35146019.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
end
end
function c101003070.desop(e,tp,eg,ep,ev,re,r,rp)
function c35146019.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c101003070.thfilter(c)
function c35146019.thfilter(c)
return c:IsType(TYPE_TRAP) and c:IsSetCard(0x103) and c:IsAbleToHand()
end
function c101003070.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101003070.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101003070.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
function c35146019.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c35146019.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c35146019.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101003070.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
local g=Duel.SelectTarget(tp,c35146019.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101003070.thop(e,tp,eg,ep,ev,re,r,rp)
function c35146019.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
......
--星遺物が刻む傷痕
--Wounds Carved on the World Legacy
--Script by nekrozar
function c101003056.initial_effect(c)
function c35546670.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
......@@ -12,7 +12,7 @@ function c101003056.initial_effect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x20c))
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x10c))
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetValue(300)
c:RegisterEffect(e2)
......@@ -21,50 +21,50 @@ function c101003056.initial_effect(c)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101003056,0))
e4:SetDescription(aux.Stringid(35546670,0))
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1)
e4:SetCost(c101003056.drcost)
e4:SetTarget(c101003056.drtg)
e4:SetOperation(c101003056.drop)
e4:SetCost(c35546670.drcost)
e4:SetTarget(c35546670.drtg)
e4:SetOperation(c35546670.drop)
c:RegisterEffect(e4)
--to grave
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(101003056,1))
e5:SetDescription(aux.Stringid(35546670,1))
e5:SetCategory(CATEGORY_TOGRAVE)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_FZONE)
e5:SetCost(c101003056.tgcost)
e5:SetTarget(c101003056.tgtg)
e5:SetOperation(c101003056.tgop)
e5:SetCost(c35546670.tgcost)
e5:SetTarget(c35546670.tgtg)
e5:SetOperation(c35546670.tgop)
c:RegisterEffect(e5)
end
function c101003056.costfilter1(c)
return ((c:IsSetCard(0x20c) and c:IsType(TYPE_MONSTER)) or c:IsSetCard(0xfe)) and c:IsDiscardable()
function c35546670.costfilter1(c)
return ((c:IsSetCard(0x10c) and c:IsType(TYPE_MONSTER)) or c:IsSetCard(0xfe)) and c:IsDiscardable()
end
function c101003056.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003056.costfilter1,tp,LOCATION_HAND,0,1,nil) end
function c35546670.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c35546670.costfilter1,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.DiscardHand(tp,c101003056.costfilter1,1,1,REASON_DISCARD+REASON_COST)
Duel.DiscardHand(tp,c35546670.costfilter1,1,1,REASON_DISCARD+REASON_COST)
end
function c101003056.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
function c35546670.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 c101003056.drop(e,tp,eg,ep,ev,re,r,rp)
function c35546670.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c101003056.costfilter2(c)
return c:IsSetCard(0x20c) and c:IsType(TYPE_MONSTER) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsAbleToRemoveAsCost()
function c35546670.costfilter2(c)
return c:IsSetCard(0x10c) and c:IsType(TYPE_MONSTER) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsAbleToRemoveAsCost()
end
function c101003056.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c101003056.costfilter2,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
function c35546670.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c35546670.costfilter2,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
if chk==0 then return g:GetClassCount(Card.GetCode)>=8 end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
local rg=Group.CreateGroup()
......@@ -76,12 +76,12 @@ function c101003056.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
function c101003056.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
function c35546670.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_HAND+LOCATION_EXTRA,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_HAND+LOCATION_EXTRA,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function c101003056.tgop(e,tp,eg,ep,ev,re,r,rp)
function c35546670.tgop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_HAND+LOCATION_EXTRA,nil)
Duel.SendtoGrave(g,REASON_EFFECT)
......
--サイバネット・リフレッシュ
--Cynet Refresh
--Scripted by Eerie Code
function c101003067.initial_effect(c)
function c36368606.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c101003067.condition)
e1:SetTarget(c101003067.target)
e1:SetOperation(c101003067.activate)
e1:SetCondition(c36368606.condition)
e1:SetTarget(c36368606.target)
e1:SetOperation(c36368606.activate)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c101003067.immcon)
e2:SetCondition(c36368606.immcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101003067.immtg)
e2:SetOperation(c101003067.immop)
e2:SetTarget(c36368606.immtg)
e2:SetOperation(c36368606.immop)
c:RegisterEffect(e2)
end
function c101003067.condition(e,tp,eg,ep,ev,re,r,rp)
function c36368606.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and Duel.GetAttacker():IsRace(RACE_CYBERSE)
end
function c101003067.desfilter(c)
function c36368606.desfilter(c)
return c:GetSequence()<5
end
function c101003067.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c101003067.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
function c36368606.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c36368606.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c101003067.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c101003067.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
function c36368606.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c36368606.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
local og=Duel.GetOperatedGroup()
og:KeepAlive()
......@@ -44,16 +44,16 @@ function c101003067.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(og)
e1:SetOperation(c101003067.spop)
e1:SetOperation(c36368606.spop)
Duel.RegisterEffect(e1,tp)
end
end
function c101003067.spfilter(c,e,tp)
function c36368606.spfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_LINK) and c:IsLocation(LOCATION_GRAVE)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,c:GetControler())
end
function c101003067.spop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject():Filter(c101003067.spfilter,nil,e,tp)
function c36368606.spop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject():Filter(c36368606.spfilter,nil,e,tp)
if g:GetCount()==0 then return end
for p=0,1 do
local tg=g:Filter(Card.IsControler,nil,p)
......@@ -67,17 +67,17 @@ function c101003067.spop(e,tp,eg,ep,ev,re,r,rp)
end
Duel.SpecialSummonComplete()
end
function c101003067.immcon(e,tp,eg,ep,ev,re,r,rp)
function c36368606.immcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_MONSTER)
end
function c101003067.immfilter(c)
function c36368606.immfilter(c)
return c:IsFaceup() and c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_LINK)
end
function c101003067.immtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003067.immfilter,tp,LOCATION_MZONE,0,1,nil) end
function c36368606.immtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c36368606.immfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function c101003067.immop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c101003067.immfilter,tp,LOCATION_MZONE,0,nil)
function c36368606.immop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c36368606.immfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -85,12 +85,12 @@ function c101003067.immop(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c101003067.efilter)
e1:SetValue(c36368606.efilter)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
function c101003067.efilter(e,te)
function c36368606.efilter(e,te)
return te:GetOwner()~=e:GetHandler()
end
--リボルブート・セクター
--Revolve Boot Sector
--Scripted by Eerie Code
function c101003053.initial_effect(c)
function c36668118.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
......@@ -21,60 +21,60 @@ function c101003053.initial_effect(c)
c:RegisterEffect(e3)
--special summon (hand)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101003053,0))
e4:SetDescription(aux.Stringid(36668118,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1,101003053)
e4:SetTarget(c101003053.sptg1)
e4:SetOperation(c101003053.spop1)
e4:SetCountLimit(1,36668118)
e4:SetTarget(c36668118.sptg1)
e4:SetOperation(c36668118.spop1)
c:RegisterEffect(e4)
--special summon (GY)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(101003053,1))
e5:SetDescription(aux.Stringid(36668118,1))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_FZONE)
e5:SetCountLimit(1,101003053)
e5:SetCondition(c101003053.spcon)
e5:SetTarget(c101003053.sptg2)
e5:SetOperation(c101003053.spop2)
e5:SetCountLimit(1,36668118)
e5:SetCondition(c36668118.spcon)
e5:SetTarget(c36668118.sptg2)
e5:SetOperation(c36668118.spop2)
c:RegisterEffect(e5)
end
function c101003053.spfilter(c,e,tp)
function c36668118.spfilter(c,e,tp)
return c:IsSetCard(0x102) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101003053.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
function c36668118.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101003053.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
and Duel.IsExistingMatchingCard(c36668118.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c101003053.spop1(e,tp,eg,ep,ev,re,r,rp)
function c36668118.spop1(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(c101003053.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
local g=Duel.GetMatchingGroup(c36668118.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
if ft<1 or g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,sg:GetFirst():GetCode())
if ft>1 and g:GetCount()>0 and not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.SelectYesNo(tp,aux.Stringid(101003053,2)) then
if ft>1 and g:GetCount()>0 and not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.SelectYesNo(tp,aux.Stringid(36668118,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=g:Select(tp,1,1,nil)
sg:AddCard(sg2:GetFirst())
end
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101003053.spcon(e,tp,eg,ep,ev,re,r,rp)
function c36668118.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
end
function c101003053.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
function c36668118.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101003053.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
and Duel.IsExistingMatchingCard(c36668118.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c101003053.spop2(e,tp,eg,ep,ev,re,r,rp)
function c36668118.spop2(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)-Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c101003053.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c36668118.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
if ft<1 or ct<1 or g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
......@@ -82,7 +82,7 @@ function c101003053.spop2(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerAffectedByEffect(tp,59822133) then
ft=ft-1
ct=ct-1
while ft>0 and ct>0 and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(101003053,2)) do
while ft>0 and ct>0 and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(36668118,2)) do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=g:Select(tp,1,1,nil)
sg:AddCard(sg2:GetFirst())
......
--ビットルーパー
--Bitrooper
--Scripted by Eerie Code
function c101003005.initial_effect(c)
function c36694815.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101003005)
e1:SetCost(c101003005.spcost)
e1:SetTarget(c101003005.sptg)
e1:SetOperation(c101003005.spop)
e1:SetCountLimit(1,36694815)
e1:SetCost(c36694815.spcost)
e1:SetTarget(c36694815.sptg)
e1:SetOperation(c36694815.spop)
c:RegisterEffect(e1)
end
function c101003005.cfilter(c)
function c36694815.cfilter(c)
return c:IsLevelBelow(2) and c:IsAbleToGraveAsCost()
end
function c101003005.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
function c36694815.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c101003005.cfilter,tp,LOCATION_HAND,0,1,c) end
if chk==0 then return Duel.IsExistingMatchingCard(c36694815.cfilter,tp,LOCATION_HAND,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101003005.cfilter,tp,LOCATION_HAND,0,1,1,c)
local g=Duel.SelectMatchingCard(tp,c36694815.cfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST)
end
function c101003005.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
function c36694815.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 c101003005.spop(e,tp,eg,ep,ev,re,r,rp)
function c36694815.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)
......
--アスポート
--Asport
--Scripted by Eerie Code
function c101003064.initial_effect(c)
function c37480144.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c101003064.target)
e1:SetOperation(c101003064.activate)
e1:SetTarget(c37480144.target)
e1:SetOperation(c37480144.activate)
c:RegisterEffect(e1)
end
function c101003064.filter(c)
function c37480144.filter(c)
return c:GetSequence()<5
end
function c101003064.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101003064.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101003064.filter,tp,LOCATION_MZONE,0,1,nil)
function c37480144.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c37480144.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c37480144.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101003064,0))
Duel.SelectTarget(tp,c101003064.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(37480144,0))
Duel.SelectTarget(tp,c37480144.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c101003064.activate(e,tp,eg,ep,ev,re,r,rp)
function c37480144.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,571)
......
--デスマニア・デビル
--Desmania Devil
--Scripted by Eerie Code
function c101003033.initial_effect(c)
function c42908201.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101003033,0))
e1:SetDescription(aux.Stringid(42908201,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(aux.bdocon)
e1:SetTarget(c101003033.target)
e1:SetOperation(c101003033.operation)
e1:SetTarget(c42908201.target)
e1:SetOperation(c42908201.operation)
c:RegisterEffect(e1)
end
function c101003033.filter(c)
function c42908201.filter(c)
return c:IsLevelBelow(4) and c:IsRace(RACE_BEAST) and c:IsAbleToHand()
end
function c101003033.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101003033.filter,tp,LOCATION_DECK,0,1,nil) end
function c42908201.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c42908201.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101003033.operation(e,tp,eg,ep,ev,re,r,rp)
function c42908201.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101003033.filter,tp,LOCATION_DECK,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c42908201.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
......
This diff is collapsed.
This diff is collapsed.
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