Commit 2b8e99bb authored by nanahira's avatar nanahira

prescripts

parent 682fd4a5
--サモン・ソーサレス
--Summon Sorceress
--Script by nekrozar
function c100200140.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.NOT(aux.FilterBoolFunction(Card.IsLinkType,TYPE_TOKEN)),2,99,c100200140.lcheck)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100200140,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(c100200140.spcon1)
e1:SetTarget(c100200140.sptg1)
e1:SetOperation(c100200140.spop1)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100200140,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100200140)
e2:SetTarget(c100200140.sptg2)
e2:SetOperation(c100200140.spop2)
c:RegisterEffect(e2)
end
function c100200140.lcheck(g)
return g:GetClassCount(Card.GetRace)==1
end
function c100200140.spcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100200140.spfilter1(c,e,tp,zone)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp,zone)
end
function c100200140.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
local zone=e:GetHandler():GetLinkedZone(1-tp)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
and Duel.IsExistingMatchingCard(c100200140.spfilter1,tp,LOCATION_HAND,0,1,nil,e,tp,zone) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100200140.spop1(e,tp,eg,ep,ev,re,r,rp)
local zone=e:GetHandler():GetLinkedZone(1-tp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100200140.spfilter1,tp,LOCATION_HAND,0,1,1,nil,e,tp,zone)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE,zone)
end
end
function c100200140.spfilter2(c,e,tp,lg)
return c:IsFaceup() and lg:IsContains(c) and Duel.IsExistingMatchingCard(c100200140.spfilter3,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetRace())
end
function c100200140.spfilter3(c,e,tp,rac)
return c:IsRace(rac)
and (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) or c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp))
end
function c100200140.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local zone={}
zone[0]=c:GetLinkedZone(0)
zone[1]=c:GetLinkedZone(1)
local lg=c:GetLinkedGroup()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100200140.spfilter2(chkc,e,tp,lg) end
if chk==0 then return (Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone[tp])>0
or Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone[1-tp])>0)
and Duel.IsExistingTarget(c100200140.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp,lg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c100200140.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp,lg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100200140.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
local zone={}
zone[0]=c:GetLinkedZone(0)
zone[1]=c:GetLinkedZone(1)
if Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone[tp])<=0
and Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone[1-tp])<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100200140.spfilter3,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetRace())
local tc=g:GetFirst()
if tc then
local sump=tp
if tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp,zone[1-tp])
and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,tp,zone[tp]) or Duel.SelectYesNo(tp,aux.Stringid(100200140,2))) then
sump=1-tp
end
if Duel.SpecialSummon(tc,0,tp,sump,false,false,POS_FACEUP_DEFENSE,zone[sump])~=0 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
end
end
--トリックスター・キャロベイン
--Trickstar Carobein
--Script by nekrozar
function c100200141.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100200141,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100200141)
e1:SetCondition(c100200141.spcon)
e1:SetTarget(c100200141.sptg)
e1:SetOperation(c100200141.spop)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100200141,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetCountLimit(1,100200141)
e2:SetCondition(c100200141.atkcon)
e2:SetCost(c100200141.atkcost)
e2:SetOperation(c100200141.atkop)
c:RegisterEffect(e2)
end
function c100200141.cfilter(c)
return c:IsFacedown() or not c:IsSetCard(0xfb)
end
function c100200141.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c100200141.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100200141.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 c100200141.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100200141.atkcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
if ph~=PHASE_DAMAGE or Duel.IsDamageCalculated() then return false end
local tc=Duel.GetAttacker()
if tc:IsControler(1-tp) then tc=Duel.GetAttackTarget() end
e:SetLabelObject(tc)
return tc and tc:IsSetCard(0xfb) and tc:IsRelateToBattle() and Duel.GetAttackTarget()~=nil
end
function c100200141.atkcost(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 c100200141.atkop(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetLabelObject()
if tc:IsRelateToBattle() and tc:IsFaceup() and tc:IsControler(tp) then
local atk=tc:GetBaseAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--ジェムナイト・ファントムルーツ
--Gem-Knight Phantom Roots
--Script by nekrozar
function c100223016.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x47),2,2)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100223016,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,100223016)
e1:SetCondition(c100223016.thcon)
e1:SetTarget(c100223016.thtg)
e1:SetOperation(c100223016.thop)
c:RegisterEffect(e1)
--fusion summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100223016,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100223116)
e2:SetCost(c100223016.spcost)
e2:SetTarget(c100223016.sptg)
e2:SetOperation(c100223016.spop)
c:RegisterEffect(e2)
end
function c100223016.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100223016.thfilter(c)
return c:IsSetCard(0x1047) and c:IsAbleToHand()
end
function c100223016.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100223016.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100223016.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100223016.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 c100223016.spcost(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 c100223016.filter0(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c100223016.filter1(c,e)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and not c:IsImmuneToEffect(e) and c:IsAbleToDeck()
end
function c100223016.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x1047) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c100223016.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(c100223016.filter0,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local res=Duel.IsExistingMatchingCard(c100223016.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c100223016.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100223016.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local chkf=tp
local mg1=Duel.GetMatchingGroup(c100223016.filter1,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
local sg1=Duel.GetMatchingGroup(c100223016.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c100223016.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoDeck(mat1,nil,2,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,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc:CompleteProcedure()
end
end
--甲虫装機 ピコファレーナ
--Inzektor Picofarena
--Scripted by Eerie Code
function c100223026.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_INSECT),2,2)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100223026,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,100223026)
e1:SetCondition(c100223026.eqcon)
e1:SetCost(c100223026.eqcost)
e1:SetTarget(c100223026.eqtg)
e1:SetOperation(c100223026.eqop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100223026,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100223126)
e2:SetTarget(c100223026.drtg)
e2:SetOperation(c100223026.drop)
c:RegisterEffect(e2)
end
function c100223026.eqcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100223026.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c100223026.filter(c)
return c:IsFaceup() and c:IsRace(RACE_INSECT)
end
function c100223026.eqfilter(c,tp)
return c:IsRace(RACE_INSECT) and c:CheckUniqueOnField(tp) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c100223026.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c100223026.filter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(c100223026.filter,tp,LOCATION_MZONE,0,1,c)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c100223026.eqfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c100223026.filter,tp,LOCATION_MZONE,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
end
function c100223026.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local ec=Duel.SelectMatchingCard(tp,c100223026.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if ec then
Duel.Equip(tp,tc,ec,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c100223026.eqlimit2)
e1:SetLabelObject(ec)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(500)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e3)
end
end
function c100223026.eqlimit2(e,c)
return c==e:GetLabelObject()
end
function c100223026.tdfilter(c)
return c:IsRace(RACE_INSECT) and c:IsAbleToDeck()
end
function c100223026.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100223026.tdfilter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c100223026.tdfilter,tp,LOCATION_GRAVE,0,3,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c100223026.tdfilter,tp,LOCATION_GRAVE,0,3,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100223026.drop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()<=0 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct>0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--魔導原典 クロウリー
--Crowley the Origin of Prophecy
--Scripted by Eerie Code
function c100223036.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),2,2)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100223036,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,100223036)
e1:SetCondition(c100223036.thcon)
e1:SetTarget(c100223036.thtg)
e1:SetOperation(c100223036.thop)
c:RegisterEffect(e1)
--decrease tribute
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100223036,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_HAND,0)
e2:SetCountLimit(1)
e2:SetCondition(c100223036.ntcon)
e2:SetTarget(c100223036.nttg)
c:RegisterEffect(e2)
end
function c100223036.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100223036.thfilter(c)
return c:IsSetCard(0x106e) and c:IsAbleToHand()
end
function c100223036.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local dg=Duel.GetMatchingGroup(c100223036.thfilter,tp,LOCATION_DECK,0,nil)
return dg:GetClassCount(Card.GetCode)>=3
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100223036.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100223036.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetClassCount(Card.GetCode)>=3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,sg1:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg2=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,sg2:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg3=g:Select(tp,1,1,nil)
sg1:Merge(sg2)
sg1:Merge(sg3)
Duel.ConfirmCards(1-tp,sg1)
local cg=sg:RandomSelect(1-tp,1)
local tc=cg:GetFirst()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ShuffleDeck(tp)
end
end
function c100223036.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c100223036.nttg(e,c)
return c:IsLevelAbove(5) and c:IsRace(RACE_SPELLCASTER)
end
--シャドール・ネフィリム
--Shaddoll Construct
--Scripted by Eerie Code
function c100223056.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_FLIP),2,2)
--fusion summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100223056,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100223056)
e1:SetTarget(c100223056.sptg)
e1:SetOperation(c100223056.spop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100223056,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100223056+100)
e2:SetTarget(c100223056.sptg2)
e2:SetOperation(c100223056.spop2)
c:RegisterEffect(e2)
end
function c100223056.spfilter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c100223056.spfilter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x9d) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c100223056.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(c100223056.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c100223056.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100223056.spop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c100223056.spfilter1,nil,e)
local sg1=Duel.GetMatchingGroup(c100223056.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c100223056.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function c100223056.cfilter(c,tp)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsSetCard(0x9d) and c:IsAbleToGraveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function c100223056.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c100223056.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100223056.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectMatchingCard(tp,c100223056.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil,tp)
local tc=tg:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE)
and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--X・HERO ワンダー・ドライバー
--Xtra HERO Wonder Driver
--Scripted by Eerie Code
function c100224002.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x8),2,2)
--set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100224002,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,100224002)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c100224002.setcon)
e1:SetTarget(c100224002.settg)
e1:SetOperation(c100224002.setop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c100224002.spcon)
e3:SetTarget(c100224002.sptg)
e3:SetOperation(c100224002.spop)
c:RegisterEffect(e3)
end
function c100224002.setcfilter(c,tp,lg)
return c:IsFaceup() and c:IsControler(tp) and c:IsSetCard(0x8) and lg:IsContains(c)
end
function c100224002.setcon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup()
return eg:IsExists(c100224002.setcfilter,1,nil,tp,lg)
end
function c100224002.setfilter(c)
return ((c:IsType(TYPE_SPELL) and c:IsSetCard(0x46)) or (c:IsType(TYPE_QUICKPLAY) and c:IsSetCard(0xa5))) and c:IsSSetable()
end
function c100224002.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100224002.setfilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,c100224002.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function c100224002.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsSSetable() then
Duel.SSet(tp,tc)
Duel.ConfirmCards(1-tp,tc)
end
end
function c100224002.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_BATTLE)
or (rp==1-tp and c:IsReason(REASON_DESTROY) and c:GetPreviousControler()==tp)
end
function c100224002.spfilter(c,e,tp)
return c:IsSetCard(0x8) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100224002.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100224002.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100224002.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,c100224002.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--白闘気一角
--White Aura Monokeros
--Script by nekrozar
function c100224004.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_WATER),aux.NonTuner(nil),1)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100224004,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,100224004)
e1:SetCondition(c100224004.spcon1)
e1:SetTarget(c100224004.sptg1)
e1:SetOperation(c100224004.spop1)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100224004,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(c100224004.spcon2)
e2:SetCost(c100224004.spcost2)
e2:SetTarget(c100224004.sptg2)
e2:SetOperation(c100224004.spop2)
c:RegisterEffect(e2)
end
function c100224004.spcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c100224004.spfilter(c,e,tp)
return c:IsRace(RACE_FISH) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100224004.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100224004.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100224004.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100224004.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100224004.spop1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c100224004.spcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function c100224004.cfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c100224004.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100224004.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c100224004.cfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c100224004.sptg2(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 c100224004.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetValue(TYPE_TUNER)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
Duel.SpecialSummonComplete()
end
end
--白の救済
--White Salvation
--Scripted by Eerie Code
function c100224007.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--add to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100224007,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,100224007)
e2:SetTarget(c100224007.thtg)
e2:SetOperation(c100224007.thop)
c:RegisterEffect(e2)
--to hand or special summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c100224007.condition)
e3:SetTarget(c100224007.target)
e3:SetOperation(c100224007.operation)
c:RegisterEffect(e3)
end
function c100224007.thfilter(c)
return c:IsRace(RACE_FISH) and c:IsAbleToHand()
end
function c100224007.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c100224007.thfilter(c) end
if chk==0 then return Duel.IsExistingTarget(c100224007.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c100224007.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c100224007.thop(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 c100224007.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsReason(REASON_DESTROY)
and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp
end
function c100224007.filter(c,e,tp)
return c:IsRace(RACE_FISH) and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
function c100224007.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100224007.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c100224007.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(100224007,1))
local g=Duel.SelectMatchingCard(tp,c100224007.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local sc=g:GetFirst()
if sc then
if sc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (not sc:IsAbleToHand() or Duel.SelectYesNo(tp,aux.Stringid(100224007,2))) then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoHand(sc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sc)
end
end
end
end
--白の咆哮
--White Howling
--Scripted by Eerie Code
function c100224010.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c100224010.condition)
e1:SetTarget(c100224010.target)
e1:SetOperation(c100224010.activate)
c:RegisterEffect(e1)
end
function c100224010.cfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER)
end
function c100224010.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100224010.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100224010.filter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToRemove()
end
function c100224010.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and c100224010.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100224010.filter,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c100224010.filter,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c100224010.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0
and tc:IsLocation(LOCATION_REMOVED) then
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetTargetRange(0,LOCATION_SZONE)
e2:SetTarget(c100224010.distg)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
--disable effect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(c100224010.disop)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
end
function c100224010.distg(e,c)
return c:IsType(TYPE_SPELL)
end
function c100224010.disop(e,tp,eg,ep,ev,re,r,rp)
local loc,p=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_PLAYER)
if loc==LOCATION_SZONE and p~=tp and re:IsActiveType(TYPE_SPELL) then
Duel.NegateEffect(ev)
end
end
--ガベージコレクター
--Garbage Collector
--Scripted by Eerie Code
function c100333002.initial_effect(c)
--bounce and summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100333002,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100333002)
e1:SetTarget(c100333002.target)
e1:SetOperation(c100333002.operation)
c:RegisterEffect(e1)
end
function c100333002.thfilter(c,e,tp)
return c:IsFaceup() and c:IsRace(RACE_CYBERSE)
and Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c100333002.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c)
end
function c100333002.spfilter(c,e,tp,tc)
return c:IsRace(RACE_CYBERSE) and c:IsLevel(tc:GetLevel())
and not c:IsCode(tc:GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100333002.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c100333002.thfilter(chkc,e,tp) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(c100333002.thfilter,tp,LOCATION_MZONE,0,1,c,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c100333002.thfilter,tp,LOCATION_MZONE,0,1,1,c,e,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100333002.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100333002.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc)
if g:GetCount()~=0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--シーアーカイバー
--Sea Archiver
--Script by nekrozar
function c100333003.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100333003,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,100333003)
e1:SetCondition(c100333003.spcon)
e1:SetTarget(c100333003.sptg)
e1:SetOperation(c100333003.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function c100333003.cfilter(c,g)
return g:IsContains(c)
end
function c100333003.spcon(e,tp,eg,ep,ev,re,r,rp)
local lg1=Duel.GetLinkedGroup(tp,1,1)
local lg2=Duel.GetLinkedGroup(1-tp,1,1)
lg1:Merge(lg2)
return lg1 and eg:IsExists(c100333003.cfilter,1,nil,lg1)
end
function c100333003.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 c100333003.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 e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_EVENT+0x47e0000)
c:RegisterEffect(e1,true)
end
end
--フレイム・バッファロー
--Flame Buffalo
function c100333004.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100333004,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100333004)
e1:SetCondition(c100333004.condition)
e1:SetTarget(c100333004.target)
e1:SetOperation(c100333004.operation)
c:RegisterEffect(e1)
end
function c100333004.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousPosition(POS_FACEUP) and not e:GetHandler():IsLocation(LOCATION_DECK)
end
function c100333004.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_CYBERSE) and c:IsDiscardable()
end
function c100333004.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100333004.tgfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.IsPlayerCanDraw(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c100333004.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,c100333004.tgfilter,1,1,REASON_EFFECT+REASON_DISCARD)~=0 then
Duel.Draw(tp,2,REASON_EFFECT)
end
end
--レディ・デバッガー
--Lady Debugger
function c100333005.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100333005,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,100333005)
e1:SetTarget(c100333005.tg)
e1:SetOperation(c100333005.op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
function c100333005.filter(c)
return c:IsLevelBelow(3) and c:IsRace(RACE_CYBERSE) and c:IsAbleToHand()
end
function c100333005.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100333005.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100333005.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100333005.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
--セグメンタル・ドラゴン
--Segmental Dragon
--Script by nekrozar
function c100333008.initial_effect(c)
--summon & set with no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100333008,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c100333008.ntcon)
e1:SetOperation(c100333008.ntop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_PROC)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100333008,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetHintTiming(0,0x1e0)
e3:SetCondition(c100333008.descon)
e3:SetTarget(c100333008.destg)
e3:SetOperation(c100333008.desop)
c:RegisterEffect(e3)
end
function c100333008.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c100333008.ntop(e,tp,eg,ep,ev,re,r,rp,c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1300)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
e2:SetValue(1200)
c:RegisterEffect(e2)
end
function c100333008.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_NORMAL)
end
function c100333008.desfilter(c,atk)
return c:IsFaceup() and c:IsAttackBelow(atk) and c:GetSequence()<5
end
function c100333008.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c100333008.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,c:GetAttack()) end
local g=Duel.GetMatchingGroup(c100333008.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,c,c:GetAttack())
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c100333008.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local atk=c:GetAttack()
if Duel.Destroy(c,REASON_EFFECT)~=0 then
local g=Duel.GetMatchingGroup(c100333008.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,atk)
Duel.Destroy(g,REASON_EFFECT)
end
end
end
--サイバネット・ストーム
--Cynet Storm
--Scripted by Eerie Code
--Prototype, requires a core update for full implementation
function c100333022.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atk/def up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(aux.TargetBoolFunction(Card.IsLinkState))
e2:SetValue(500)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--cannot disable summon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e4:SetRange(LOCATION_FZONE)
e4:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_SET_AVAILABLE)
e4:SetTarget(aux.TargetBoolFunction(Card.IsSummonType,SUMMON_TYPE_LINK))
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100333022,0))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_DAMAGE)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e5:SetRange(LOCATION_FZONE)
e5:SetCondition(c100333022.spcon)
e5:SetTarget(c100333022.sptg)
e5:SetOperation(c100333022.spop)
c:RegisterEffect(e5)
end
function c100333022.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and ev>=2000
end
function c100333022.spfilter(c,e,tp)
return c:IsFacedown() and c:IsType(TYPE_LINK) and Duel.GetLocationCountFromEx(tp,tp,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100333022.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100333022.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100333022.spop(e,tp,eg,ep,ev,re,r,rp)
--prototype, to be replaced with the appropriate core functions
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_EXTRA,0,nil)
if g:GetCount()==0 or Duel.GetLocationCountFromEx(tp)<=0 then return end
local tc=g:RandomSelect(tp,1):GetFirst()
if tc then
Duel.ConfirmCards(PLAYER_ALL,tc)
if tc:IsType(TYPE_LINK) and Duel.GetLocationCountFromEx(tp,tp,tc)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--トラフィックゴースト
--Traffic Ghost
--Script by nekrozar
function c100333041.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,3,3)
end
--LANフォリンクス
--LAN Pholinks
--Script by nekrozar
function c100333042.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,2,2)
end
--トリックスター・ヒヨス
--Trickstar Nightshade
--Script by nekrozar
function c101004006.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004006,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCountLimit(1,101004006)
e1:SetCondition(c101004006.spcon)
e1:SetTarget(c101004006.sptg)
e1:SetOperation(c101004006.spop)
c:RegisterEffect(e1)
end
function c101004006.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK and c:GetReasonCard():IsSetCard(0xfb)
end
function c101004006.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 c101004006.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 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
--トリックスター・マンドレイク
--Trickstar Mandrake
--Script by nekrozar
function c101004007.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004007,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,101004007)
e1:SetCondition(c101004007.spcon)
e1:SetTarget(c101004007.sptg)
e1:SetOperation(c101004007.spop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004007,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCountLimit(1,101004107)
e2:SetCondition(c101004007.descon)
e2:SetTarget(c101004007.destg)
e2:SetOperation(c101004007.desop)
c:RegisterEffect(e2)
end
function c101004007.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function c101004007.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,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101004007.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_DEFENSE)~=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 c101004007.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and r==REASON_LINK and c:GetReasonCard():IsSetCard(0xfb)
end
function c101004007.lkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function c101004007.desfilter(c,g)
return g:IsContains(c)
end
function c101004007.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Group.CreateGroup()
local lg=Duel.GetMatchingGroup(c101004007.lkfilter,tp,0,LOCATION_MZONE,nil)
for tc in aux.Next(lg) do
tg:Merge(tc:GetLinkedGroup())
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101004007.desfilter(chkc,tg) end
if chk==0 then return Duel.IsExistingTarget(c101004007.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c101004007.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101004007.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--剛鬼マンジロック
--Gouki Octostretch
function c101004009.initial_effect(c)
--half damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004009,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetCondition(c101004009.damcon)
e1:SetCost(c101004009.damcost)
e1:SetOperation(c101004009.damop)
c:RegisterEffect(e1)
--half damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004009,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCondition(aux.damcon1)
e2:SetCost(c101004009.damcost)
e2:SetOperation(c101004009.operation)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004009,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:SetCountLimit(1,101004009)
e3:SetCondition(c101004009.thcon)
e3:SetTarget(c101004009.thtg)
e3:SetOperation(c101004009.thop)
c:RegisterEffect(e3)
end
function c101004009.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetBattleDamage(tp)>0 and Duel.GetAttacker()~=tp
end
function c101004009.damcost(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 c101004009.damop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetOperation(c101004009.dop)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
function c101004009.dop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(tp,math.ceil(ev/2))
end
function c101004009.operation(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
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:SetLabel(cid)
e1:SetValue(c101004009.damcon2)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
end
function c101004009.damcon2(e,re,val,r,rp,rc)
local cc=Duel.GetCurrentChain()
if cc==0 or bit.band(r,REASON_EFFECT)==0 then return end
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
return cid==e:GetLabel() and math.ceil(val/2) or val
end
function c101004009.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c101004009.thfilter(c)
return c:IsSetCard(0xfc) and not c:IsCode(101004009) and c:IsAbleToHand()
end
function c101004009.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101004009.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101004009.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101004009.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
--剛鬼ハッグベア
-- Gouki Hugbear
function c101004010.initial_effect(c)
--atk down
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetDescription(aux.Stringid(101004010,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,101004010)
e1:SetTarget(c101004010.atktg)
e1:SetOperation(c101004010.atkop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c101004010.atkcon)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101004010,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,101004010+100)
e3:SetCondition(c101004010.thcon)
e3:SetTarget(c101004010.thtg)
e3:SetOperation(c101004010.thop)
c:RegisterEffect(e3)
end
function c101004010.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and aux.nzatk(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.nzatk,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.nzatk,tp,0,LOCATION_MZONE,1,1,nil)
end
function c101004010.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(math.ceil(tc:GetBaseAttack()/2))
tc:RegisterEffect(e1)
end
end
function c101004010.atkcon(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetHandler():IsSetCard(0xfc)
end
function c101004010.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c101004010.thfilter(c)
return c:IsSetCard(0xfc) and not c:IsCode(101004010) and c:IsAbleToHand()
end
function c101004010.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101004010.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101004010.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101004010.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
--トリックスター・ベラマドンナ
--Trickstar Bella Madonna
--Script by nekrozar
function c101004038.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xfb),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:SetCondition(c101004038.imcon)
e1:SetValue(c101004038.immval)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101004038,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101004038)
e2:SetCondition(c101004038.damcon)
e2:SetTarget(c101004038.damtg)
e2:SetOperation(c101004038.damop)
c:RegisterEffect(e2)
end
function c101004038.imcon(e)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_LINK) and c:GetLinkedGroupCount()==0
end
function c101004038.immval(e,te)
return te:GetOwner()~=e:GetHandler() and te:IsActivated()
end
function c101004038.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetLinkedGroupCount()==0
end
function c101004038.damfilter(c)
return c:IsSetCard(0xfb) and c:IsType(TYPE_MONSTER)
end
function c101004038.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101004038.damfilter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.GetMatchingGroup(c101004038.damfilter,tp,LOCATION_GRAVE,0,nil)
local dam=g:GetClassCount(Card.GetCode)*200
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function c101004038.damop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetMatchingGroup(c101004038.damfilter,tp,LOCATION_GRAVE,0,nil)
local dam=g:GetClassCount(Card.GetCode)*200
Duel.Damage(p,dam,REASON_EFFECT)
end
--剛鬼ザ・マスター・オーガ
--Gouki The Master Ogre
--Script by nekrozar
function c101004041.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xfc),2)
c:EnableReviveLimit()
--disable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101004041,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,0x1c0)
e1:SetCountLimit(1)
e1:SetCost(c101004041.discost)
e1:SetTarget(c101004041.distg)
e1:SetOperation(c101004041.disop)
c:RegisterEffect(e1)
--attack all
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ATTACK_ALL)
e2:SetValue(1)
c:RegisterEffect(e2)
--attack limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e3:SetCondition(c101004041.atcon)
e3:SetValue(c101004041.atlimit)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e4:SetCondition(c101004041.atcon)
c:RegisterEffect(e4)
end
function c101004041.discost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c101004041.costfilter(c,g)
return c:IsFaceup() and c:IsSetCard(0xfc) and g:IsContains(c) and c:IsAbleToHandAsCost()
end
function c101004041.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local lg=e:GetHandler():GetLinkedGroup()
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and aux.disfilter1(chkc) end
if chk==0 then
if e:GetLabel()==1 then
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c101004041.costfilter,tp,LOCATION_MZONE,0,1,nil,lg)
and Duel.IsExistingTarget(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil)
else return false end
end
e:SetLabel(0)
local rt=Duel.GetTargetCount(aux.disfilter1,tp,0,LOCATION_ONFIELD,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local cg=Duel.SelectMatchingCard(tp,c101004041.costfilter,tp,LOCATION_MZONE,0,1,rt,nil,lg)
local ct=cg:GetCount()
Duel.SendtoHand(cg,nil,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,aux.disfilter1,tp,0,LOCATION_ONFIELD,ct,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
end
function c101004041.disfilter(c,e)
return ((c:IsFaceup() and not c:IsDisabled()) or c:IsType(TYPE_TRAPMONSTER)) and c:IsRelateToEffect(e)
end
function c101004041.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c101004041.disfilter,nil,e)
local tc=g:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
tc=g:GetNext()
end
end
function c101004041.atcon(e)
return Duel.IsExistingMatchingCard(Card.IsFaceup,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil)
end
function c101004041.atlimit(e,c)
local g=Duel.GetMatchingGroup(Card.IsFaceup,e:GetHandlerPlayer(),0,LOCATION_MZONE,nil)
local tg=g:GetMaxGroup(Card.GetAttack)
return not tg:IsContains(c) or c:IsFacedown()
end
--剛鬼フェイスターン
--Gouki Face Turn
function c101004056.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101004056+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101004056.target)
e1:SetOperation(c101004056.activate)
c:RegisterEffect(e1)
end
function c101004056.desfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xfc) and Duel.GetMZoneCount(tp,c)>0
end
function c101004056.spfilter(c,e,tp)
return c:IsSetCard(0xfc) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101004056.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c101004056.desfilter,tp,LOCATION_ONFIELD,0,1,nil,tp)
and Duel.IsExistingTarget(c101004056.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c101004056.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(tp,c101004056.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g2,1,0,0)
e:SetLabelObject(g1:GetFirst())
end
function c101004056.activate(e,tp,eg,ep,ev,re,r,rp)
local tc1,tc2=Duel.GetFirstTarget()
if tc1~=e:GetLabelObject() then tc1,tc2=tc2,tc1 end
if tc1:IsControler(tp) and tc1:IsRelateToEffect(e) and Duel.Destroy(tc1,REASON_EFFECT)>0 and tc2:IsRelateToEffect(e) then
Duel.SpecialSummon(tc2,0,tp,tp,false,false,POS_FACEUP)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment