Commit c301e7e0 authored by mercury233's avatar mercury233

update scripts

parent b961b090
--闇鋼龍 ダークネスメタル
--Darkness Metal, the Dark Steel Dragon
--Scripted by Eerie Code
function c100200148.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,nil,c100200148.spcheck)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100200148,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,100200148)
e1:SetTarget(c100200148.sptg)
e1:SetOperation(c100200148.spop)
c:RegisterEffect(e1)
end
function c100200148.spcheck(g)
return g:GetClassCount(Card.GetLinkRace)==1
and g:GetClassCount(Card.GetLinkAttribute)==1
end
function c100200148.filter(c,e,tp,zone)
return (c:IsFaceup() or not c:IsLocation(LOCATION_REMOVED)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,tp,zone)
end
function c100200148.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local zone=bit.band(e:GetHandler():GetLinkedZone(tp),0x1f)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and c100200148.filter(chkc,e,tp,zone) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100200148.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp,zone) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100200148.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp,zone)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100200148.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local zone=bit.band(c:GetLinkedZone(tp),0x1f)
if tc and tc:IsRelateToEffect(e) and zone~=0
and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE,zone) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0xfe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0xfe0000)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+0x47e0000)
e3:SetValue(LOCATION_DECKBOT)
tc:RegisterEffect(e3)
end
Duel.SpecialSummonComplete()
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetTargetRange(1,0)
e4:SetTarget(c100200148.splimit)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
function c100200148.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsType(TYPE_LINK)
end
--飛行エレファント
--Flying Elephant
--Scripted by Eerie Code
function c100227003.initial_effect(c)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetCountLimit(1)
e1:SetValue(c100227003.valcon)
c:RegisterEffect(e1)
--add win effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c100227003.effcon)
e2:SetOperation(c100227003.effop)
c:RegisterEffect(e2)
end
function c100227003.valcon(e,re,r,rp)
local res=false
if bit.band(r,REASON_EFFECT)~=0 and rp~=e:GetHandlerPlayer() then
res=true
e:GetHandler():RegisterFlagEffect(100227003,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
return res
end
function c100227003.effcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(100227003)~=0
end
function c100227003.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100227003,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c100227003.wincon)
e1:SetOperation(c100227003.winop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END+RESET_SELF_TURN)
c:RegisterEffect(e1)
end
function c100227003.wincon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.GetAttackTarget()==nil
end
function c100227003.winop(e,tp,eg,ep,ev,re,r,rp)
local WIN_REASON_FLYING_ELEPHANT=0x1d
Duel.Win(tp,WIN_REASON_FLYING_ELEPHANT)
end
--シンデレラ
--Cinderella
--Script by dest
function c100227004.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100227004,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,100227004)
e1:SetTarget(c100227004.target)
e1:SetOperation(c100227004.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--equip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100227004,2))
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCondition(c100227004.eqcon)
e3:SetTarget(c100227004.eqtg)
e3:SetOperation(c100227004.eqop)
c:RegisterEffect(e3)
end
c100227004.card_code_list={100227010}
function c100227004.filter(c,e,tp)
return c:IsCode(100227005) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100227004.efilter(c,ec)
return c:IsCode(100227011) and c:CheckEquipTarget(ec)
end
function c100227004.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100227004.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 c100227004.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100227004.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0
and Duel.IsEnvironment(100227010) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c100227004.efilter,tp,LOCATION_DECK,0,1,nil,c)
and c:IsRelateToEffect(e) and c:IsFaceup() and Duel.SelectYesNo(tp,aux.Stringid(100227004,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local eqg=Duel.SelectMatchingCard(tp,c100227004.efilter,tp,LOCATION_DECK,0,1,1,nil,c)
Duel.Equip(tp,eqg:GetFirst(),c)
end
end
function c100227004.eqcon(e,tp,eg,ep,ev,re,r,rp,chk)
return ep~=tp and Duel.GetAttackTarget()==nil
end
function c100227004.eqfilter(c,tc,tp)
return c:IsCode(100227011) and tc:GetEquipGroup():IsContains(c)
and Duel.IsExistingTarget(c100227004.eqtfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,tc,c)
end
function c100227004.eqtfilter(c,ec)
return c:IsFaceup() and ec:CheckEquipTarget(c)
end
function c100227004.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(c100227004.eqfilter,tp,LOCATION_SZONE,0,1,nil,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc=Duel.SelectTarget(tp,c100227004.eqfilter,tp,LOCATION_SZONE,0,1,1,nil,c,tp):GetFirst()
e:SetLabelObject(tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c100227004.eqtfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c,tc)
end
function c100227004.eqop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:GetFirst()
local sc=g:GetNext()
if tc:IsFacedown() or not tc:IsRelateToEffect(e)
or sc:IsFacedown() or not sc:IsRelateToEffect(e) then return end
local ec=e:GetLabelObject()
if tc==ec then tc=sc end
Duel.Equip(tp,ec,tc)
end
--カボチャの馬車
--Pumpkin Carriage
--Script by dest
function c100227005.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsCode,100227004))
c:RegisterEffect(e1)
--indes/untarget
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetTarget(c100227005.indtg)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetValue(1)
c:RegisterEffect(e3)
end
c100227005.card_code_list={100227010}
function c100227005.indtg(e,c)
return c:IsFaceup() and c:IsCode(100227010)
end
--鉄のハンス
--Iron Hans
--Script by dest
function c100227006.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100227006,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100227006)
e1:SetTarget(c100227006.sptg)
e1:SetOperation(c100227006.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--atk up
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetCondition(c100227006.atkcon)
e4:SetValue(c100227006.value)
c:RegisterEffect(e4)
end
c100227006.card_code_list={100227010}
function c100227006.filter(c,e,tp)
return c:IsCode(100227007) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100227006.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100227006.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100227006.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100227006.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
if not Duel.IsEnvironment(100227010) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c100227006.splimit)
Duel.RegisterEffect(e1,tp)
end
end
function c100227006.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA)
end
function c100227006.atkcon(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.IsEnvironment(100227010)
end
function c100227006.atkfilter(c)
return c:IsFaceup() and c:IsCode(100227007)
end
function c100227006.value(e,c)
return Duel.GetMatchingGroupCount(c100227006.filter,c:GetControler(),LOCATION_ONFIELD,0,nil)*1000
end
--鉄の騎士
--Iron Knight
--Script by dest
function c100227007.initial_effect(c)
--atk down
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetCondition(c100227007.atkcon)
e1:SetValue(-1000)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100227007,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetCountLimit(1,100227007)
e2:SetTarget(c100227007.thtg)
e2:SetOperation(c100227007.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c100227007.thcon)
c:RegisterEffect(e3)
end
c100227007.card_code_list={100227010}
function c100227007.filter(c)
return c:IsFaceup() and c:IsCode(100227006)
end
function c100227007.atkcon(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.IsExistingMatchingCard(c100227007.filter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c100227007.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c100227007.thfilter(c)
return (c:IsCode(100227006) or (Duel.IsEnvironment(100227010) and c:IsRace(RACE_WARRIOR))) and c:IsAbleToHand()
end
function c100227007.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100227007.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100227007.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100227007.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
--怪鳥グライフ
--Glife the Phantom Bird
--Script by dest
function c100227008.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100227008,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c100227008.thcost)
e1:SetTarget(c100227008.thtg)
e1:SetOperation(c100227008.thop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100227008,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100227008)
e2:SetTarget(c100227008.destg)
e2:SetOperation(c100227008.desop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
c100227008.card_code_list={100227010}
function c100227008.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c100227008.thfilter(c)
return c:IsCode(100227010) and c:IsAbleToHand()
end
function c100227008.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c100227008.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100227008.thop(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetFirstMatchingCard(c100227008.thfilter,tp,LOCATION_DECK,0,nil)
if tg then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function c100227008.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c100227008.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_SZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100227008.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
--ヘクサ・トルーデ
--Hexe Trude
--Script by dest
function c100227009.initial_effect(c)
--summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100227009,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c100227009.ntcon)
c:RegisterEffect(e1)
--destroy and multi attack
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100227009,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(c100227009.descon)
e2:SetTarget(c100227009.destg)
e2:SetOperation(c100227009.desop)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100227009,2))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCondition(aux.bdocon)
e3:SetTarget(c100227009.atktg)
e3:SetOperation(c100227009.atkop)
c:RegisterEffect(e3)
end
c100227009.card_code_list={100227010}
function c100227009.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:GetLevel()>4 and Duel.IsEnvironment(100227010)
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c100227009.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsEnvironment(100227010)
end
function c100227009.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100227009.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c100227009.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsFaceup() and chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function c100227009.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(400)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
--シュトロームベルクの金の城
--Golden Castle of Stromberg
--Script by dest
function c100227010.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--maintain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_FZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1)
e2:SetCondition(c100227010.mtcon)
e2:SetOperation(c100227010.mtop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100227010,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,100227010)
e3:SetCost(c100227010.spcost)
e3:SetTarget(c100227010.sptg)
e3:SetOperation(c100227010.spop)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100227010,1))
e4:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetRange(LOCATION_FZONE)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetCondition(c100227010.atkcon)
e4:SetTarget(c100227010.atktg)
e4:SetOperation(c100227010.atkop)
c:RegisterEffect(e4)
end
function c100227010.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c100227010.mtop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,10)
if g:FilterCount(Card.IsAbleToRemoveAsCost,nil)==10 then
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
else
Duel.Destroy(e:GetHandler(),REASON_COST)
end
end
function c100227010.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)==0 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_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e2,tp)
end
function c100227010.spfilter(c,e,tp)
return aux.IsCodeListed(c,100227010) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100227010.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100227010.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100227010.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100227010.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100227010.atkcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function c100227010.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=Duel.GetAttacker()
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,tc:GetAttack()/2)
end
function c100227010.atkop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetAttacker()
local atk=math.ceil(tc:GetAttack()/2)
if tc:IsRelateToEffect(e) and not tc:IsStatus(STATUS_ATTACK_CANCELED) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
--ガラスの靴
--Glass Slippers
--Script by dest
function c100227011.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c100227011.target)
e1:SetOperation(c100227011.operation)
c:RegisterEffect(e1)
--Atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(c100227011.value)
c:RegisterEffect(e2)
--cannot attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_CANNOT_ATTACK)
e3:SetCondition(c100227011.atcon)
c:RegisterEffect(e3)
--equip
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100227011,0))
e4:SetCategory(CATEGORY_EQUIP)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,100227011)
e4:SetCondition(c100227011.eqcon)
e4:SetTarget(c100227011.eqtg)
e4:SetOperation(c100227011.operation)
c:RegisterEffect(e4)
end
function c100227011.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 c100227011.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 c100227011.value(e,c)
local ec=e:GetHandler():GetEquipTarget()
if ec:IsRace(RACE_FAIRY) then
return 1000
else
return -1000
end
end
function c100227011.atcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
return ec and not ec:IsRace(RACE_FAIRY)
end
function c100227011.eqcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget()
return c:IsReason(REASON_LOST_TARGET) and ec:IsReason(REASON_DESTROY)
end
function c100227011.eqfilter(c)
return c:IsFaceup() and c:IsCode(100227004)
end
function c100227011.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100227011.eqfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c100227011.eqfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c100227011.eqfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
--鉄の檻
--Iron Cage
--Script by dest
function c100227012.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100227012+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100227012.target)
e1:SetOperation(c100227012.operation)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100227012,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1)
e2:SetCondition(c100227012.spcon)
e2:SetTarget(c100227012.sptg)
e2:SetOperation(c100227012.spop)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end
function c100227012.target(e,tp,eg,ep,ev,re,r,rp,chk)
local loc=0
if Duel.IsEnvironment(100227010) then
loc=LOCATION_MZONE
end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_MZONE,loc,1,nil) end
end
function c100227012.operation(e,tp,eg,ep,ev,re,r,rp)
local loc=0
if Duel.IsEnvironment(100227010) then
loc=LOCATION_MZONE
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_MZONE,loc,1,1,nil):GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
tc:RegisterFlagEffect(100227012,RESET_EVENT+0x1fe0000,0,0)
e:SetLabelObject(tc)
end
end
function c100227012.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c100227012.filter(c,e,tp)
return c==e:GetLabelObject():GetLabelObject() and c:GetFlagEffect(100227012)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100227012.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c100227012.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100227012.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100227012.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100227012.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--エマージェンシー・サイバー
--Emergency Cyber
--Script by dest
function c100227016.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100227016+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100227016.target)
e1:SetOperation(c100227016.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CHAIN_NEGATED)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c100227016.thcon)
e2:SetCost(c100227016.thcost)
e2:SetTarget(c100227016.thtg)
e2:SetOperation(c100227016.thop)
c:RegisterEffect(e2)
end
function c100227016.filter(c)
return ((c:IsSetCard(0x1093) and c:IsType(TYPE_MONSTER)) or (c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_MACHINE) and not c:IsSummonableCard()))
and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c100227016.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c100227016.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100227016.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100227016.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c100227016.thcon(e,tp,eg,ep,ev,re,r,rp)
local de,dp=Duel.GetChainInfo(ev,CHAININFO_DISABLE_REASON,CHAININFO_DISABLE_PLAYER)
return rp==tp and de and dp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and e:GetHandler()==re:GetHandler()
end
function c100227016.thcost(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 c100227016.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c100227016.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
--ボーン・フロム・ドラコニス
--Born from Draconis
--Script by dest
function c100227017.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(c100227017.cost)
e1:SetTarget(c100227017.target)
e1:SetOperation(c100227017.activate)
c:RegisterEffect(e1)
end
function c100227017.cfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_MACHINE) and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
and c:IsAbleToRemoveAsCost()
end
function c100227017.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100227017.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil)
if chk==0 then return g:GetCount()>0 and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(c100227017.splimit)
e1:SetLabelObject(e)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetLabel(g:GetCount())
end
function c100227017.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return se~=e:GetLabelObject()
end
function c100227017.spfilter(c,e,tp)
return c:IsLevelAbove(6) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_MACHINE)
and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c100227017.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100227017.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100227017.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100227017.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP) then
local val=e:GetLabel()*500
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c100227017.efilter)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_ATTACK)
e2:SetValue(val)
e2:SetReset(RESET_EVENT+0xfe0000)
tc:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_SET_DEFENSE)
tc:RegisterEffect(e3)
end
Duel.SpecialSummonComplete()
end
function c100227017.efilter(e,re)
return e:GetHandler()~=re:GetHandler()
end
...@@ -35,7 +35,7 @@ function c100227020.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -35,7 +35,7 @@ function c100227020.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
if tc:IsCode(100227020) then if tc:IsCode(100227020) then
if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler()) local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT) Duel.Destroy(sg,REASON_EFFECT)
local tg=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_GRAVE) local tg=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_GRAVE)
if tg:GetCount()>0 then if tg:GetCount()>0 then
......
...@@ -7,13 +7,14 @@ function c100227027.initial_effect(c) ...@@ -7,13 +7,14 @@ function c100227027.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--insd via destroy replace (workaround) --indes
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_NO_TURN_RESET)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetTarget(c100227027.reptg) e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetCountLimit(1)
e2:SetValue(c100227027.valcon)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--draw --draw
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
...@@ -41,11 +42,8 @@ function c100227027.initial_effect(c) ...@@ -41,11 +42,8 @@ function c100227027.initial_effect(c)
e4:SetOperation(c100227027.tdop) e4:SetOperation(c100227027.tdop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c100227027.reptg(e,tp,eg,ep,ev,re,r,rp,chk) function c100227027.valcon(e,re,r,rp)
local c=e:GetHandler() return bit.band(r,REASON_EFFECT)~=0 and rp~=e:GetHandlerPlayer()
if chk==0 then return e:GetHandler():IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp and e:GetHandler():GetFlagEffect(100227127)==0 end
c:RegisterFlagEffect(100227127,RESET_EVENT+0x1fe0000,0,1)
return true
end end
function c100227027.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c100227027.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -11,11 +11,12 @@ function c100227028.initial_effect(c) ...@@ -11,11 +11,12 @@ function c100227028.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--indes --indes
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetTarget(c100227028.reptg) e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetCountLimit(1)
e2:SetValue(c100227028.valcon)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--spsummon --spsummon
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
...@@ -42,11 +43,8 @@ function c100227028.initial_effect(c) ...@@ -42,11 +43,8 @@ function c100227028.initial_effect(c)
e4:SetOperation(c100227028.tdop) e4:SetOperation(c100227028.tdop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c100227028.reptg(e,tp,eg,ep,ev,re,r,rp,chk) function c100227028.valcon(e,re,r,rp)
local c=e:GetHandler() return bit.band(r,REASON_EFFECT)~=0 and rp~=e:GetHandlerPlayer()
if chk==0 then return e:GetHandler():IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp and e:GetHandler():GetFlagEffect(100227128)==0 end
c:RegisterFlagEffect(100227128,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
return true
end end
function c100227028.acfilter(c) function c100227028.acfilter(c)
return c:IsFaceup() and c:IsCode(100227027) and c:IsAbleToGraveAsCost() return c:IsFaceup() and c:IsCode(100227027) and c:IsAbleToGraveAsCost()
......
--No.67 パラダイスマッシャー
--Number 67: Paradicesmasher
--Script by nekrozar
function c100227031.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,5,2,nil,nil,99)
c:EnableReviveLimit()
--dice
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100227031,0))
e1:SetCategory(CATEGORY_DICE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c100227031.dccon)
e1:SetCost(c100227031.dccost)
e1:SetTarget(c100227031.dctg)
e1:SetOperation(c100227031.dcop)
c:RegisterEffect(e1)
--dice
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TOSS_DICE_NEGATE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c100227031.dicecon)
e2:SetOperation(c100227031.diceop)
c:RegisterEffect(e2)
end
c100227031.xyz_number=67
function c100227031.dccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1
end
function c100227031.dccost(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 c100227031.dctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,PLAYER_ALL,2)
end
function c100227031.dcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local d1,d2,d3,d4=Duel.TossDice(tp,2,2)
if d1+d2>d3+d4 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(c100227031.actlimit)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2:SetTargetRange(1,0)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
elseif d1+d2<d3+d4 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(c100227031.actlimit)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2:SetTargetRange(0,1)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
end
end
function c100227031.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not re:GetHandler():IsImmuneToEffect(e)
end
function c100227031.dicecon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetOverlayCount()>0 and c:GetFlagEffect(100227031)~=0
end
function c100227031.diceop(e,tp,eg,ep,ev,re,r,rp)
local cc=Duel.GetCurrentChain()
local cid=Duel.GetChainInfo(cc,CHAININFO_CHAIN_ID)
if c100227031[0]~=cid and Duel.SelectYesNo(tp,aux.Stringid(100227031,1)) then
Duel.Hint(HINT_CARD,0,100227031)
e:GetHandler():RegisterFlagEffect(100227031,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
local dc={Duel.GetDiceResult()}
local ac=1
local ct=bit.band(ev,0xff)+bit.rshift(ev,16)
if ct>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(100227031,2))
local val,idx=Duel.AnnounceNumber(tp,table.unpack(dc,1,ct))
ac=idx+1
end
dc[ac]=7
Duel.SetDiceResult(table.unpack(dc))
c100227031[0]=cid
end
end
--ハイバネーション・ドラゴン
--Hibernation Dragon
--Script by nekrozar
function c100227041.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100227041,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,100227041)
e1:SetTarget(c100227041.thtg)
e1:SetOperation(c100227041.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100227041,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,100227141)
e3:SetCondition(c100227041.spcon)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c100227041.sptg)
e3:SetOperation(c100227041.spop)
c:RegisterEffect(e3)
end
function c100227041.thfilter(c)
return c:IsLevelBelow(4) and c:IsRace(RACE_DRAGON) and c:IsAbleToHand()
end
function c100227041.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c100227041.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100227041.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c100227041.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c100227041.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c100227041.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
function c100227041.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c100227041.cfilter,tp,LOCATION_MZONE,0,1,nil) and aux.exccon(e)
end
function c100227041.spfilter(c,e,tp)
return c:IsType(TYPE_LINK) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100227041.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c100227041.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100227041.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100227041.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100227041.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
--トリガー・ヴルム
--Triggering Wurm
--Script by nekrozar
function c100227042.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100227042,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,100227042)
e1:SetCondition(c100227042.spcon)
e1:SetTarget(c100227042.sptg)
e1:SetOperation(c100227042.spop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100227042,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,100227142)
e2:SetCondition(c100227042.drcon)
e2:SetTarget(c100227042.drtg)
e2:SetOperation(c100227042.drop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
end
function c100227042.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():IsAttribute(ATTRIBUTE_DARK)
end
function c100227042.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local zone=bit.band(c:GetReasonCard():GetLinkedZone(tp),0x1f)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK,tp,zone) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c100227042.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local zone=bit.band(c:GetReasonCard():GetLinkedZone(tp),0x1f)
if c:IsRelateToEffect(e) and zone~=0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_ATTACK,zone)
end
end
function c100227042.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT) and re:IsActiveType(TYPE_LINK)
end
function c100227042.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 c100227042.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
--トポロジック・ガンブラー・ドラゴン --トポロジック・ガンブラー・ドラゴン
--Topologic Gamble Dragon --Topologic Gamble Dragon
--not fully implemented(need update ocgcore)
--https://github.com/Fluorohydride/ygopro-core/pull/139
function c100227043.initial_effect(c) function c100227043.initial_effect(c)
--link summon --link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2) aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2)
...@@ -29,31 +27,6 @@ function c100227043.initial_effect(c) ...@@ -29,31 +27,6 @@ function c100227043.initial_effect(c)
e2:SetTarget(c100227043.hdtg2) e2:SetTarget(c100227043.hdtg2)
e2:SetOperation(c100227043.hdop2) e2:SetOperation(c100227043.hdop2)
c:RegisterEffect(e2) c:RegisterEffect(e2)
if not Card.IsExtraLinked then
function Duel.GetExtraLinkedGroup(tp)
local card1=Duel.GetFieldCard(tp,LOCATION_MZONE,1)
local card2=Duel.GetFieldCard(tp,LOCATION_MZONE,2)
local card3=Duel.GetFieldCard(tp,LOCATION_MZONE,3)
local card5=Duel.GetFieldCard(tp,LOCATION_MZONE,5)
local card6=Duel.GetFieldCard(tp,LOCATION_MZONE,6)
if not card1 or not card2 or not card3 or not card5 or not card6 then return nil end
if bit.band(card1:GetMutualLinkedZone(),0x24)~=0x24 then return nil end
if bit.band(card2:GetMutualLinkedZone(),0xa)~=0xa then return nil end
if bit.band(card3:GetMutualLinkedZone(),0x44)~=0x44 then return nil end
if bit.band(card5:GetMutualLinkedZone(),0x2)~=0x2 then return nil end
if bit.band(card6:GetMutualLinkedZone(),0x8)~=0x8 then return nil end
local elg=Group:FromCards(card1,card2,card3,card5,card6)
local card0=Duel.GetFieldCard(tp,LOCATION_MZONE,0)
local card4=Duel.GetFieldCard(tp,LOCATION_MZONE,4)
if card0 and bit.band(card0:GetMutualLinkedZone(),0x2)==0x2 then elg:AddCard(card0) end
if card4 and bit.band(card4:GetMutualLinkedZone(),0x8)==0x8 then elg:AddCard(card4) end
return elg
end
function Card.IsExtraLinked(c)
local elg=Duel.GetExtraLinkedGroup(c:GetControler())
return elg and elg:IsContains(c)
end
end
end end
function c100227043.cfilter(c,zone) function c100227043.cfilter(c,zone)
local seq=c:GetSequence() local seq=c:GetSequence()
...@@ -80,7 +53,7 @@ function c100227043.hdop(e,tp,eg,ep,ev,re,r,rp) ...@@ -80,7 +53,7 @@ function c100227043.hdop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardHand(1-tp,nil,ct3,ct3,REASON_EFFECT+REASON_DISCARD) Duel.DiscardHand(1-tp,nil,ct3,ct3,REASON_EFFECT+REASON_DISCARD)
end end
function c100227043.hdcon2(e) function c100227043.hdcon2(e)
return e:GetHandler():IsExtraLinked() return e:GetHandler():IsExtraLinkState()
end end
function c100227043.hdtg2(e,tp,eg,ep,ev,re,r,rp,chk) function c100227043.hdtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)>0 end if chk==0 then return Duel.GetFieldGroupCount(1-tp,LOCATION_HAND,0)>0 end
......
--マズルフラッシュ・ドラゴン
--Flash Charge Dragon
--Script by mercury233
--not fully implemented
function c100227045.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_DRAGON),2)
--zone limit
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100227045,0))
e3:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCondition(c100227045.descon)
e3:SetTarget(c100227045.destg)
e3:SetOperation(c100227045.desop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
--negate
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100227045,1))
e5:SetCategory(CATEGORY_NEGATE)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_CHAINING)
e5:SetRange(LOCATION_MZONE)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e5:SetCondition(c100227045.negcon)
e5:SetCost(c100227045.negcost)
e5:SetTarget(c100227045.negtg)
e5:SetOperation(c100227045.negop)
c:RegisterEffect(e5)
end
function c100227045.cfilter(c,ec)
if c:IsLocation(LOCATION_MZONE) then
return ec:GetLinkedGroup():IsContains(c)
else
return bit.band(ec:GetLinkedZone(c:GetPreviousControler()),bit.lshift(0x1,c:GetPreviousSequence()))~=0
end
end
function c100227045.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100227045.cfilter,1,nil,e:GetHandler())
end
function c100227045.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=e:GetHandler():GetLinkedGroup()
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function c100227045.desop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetHandler():GetLinkedGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tg=g:Select(tp,1,1,nil)
if tg:GetCount()>0 then
Duel.HintSelection(tg)
if Duel.Destroy(tg,REASON_EFFECT)>0 then
Duel.Damage(1-tp,500,REASON_EFFECT)
end
end
end
function c100227045.negcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and tg:IsContains(c) and Duel.IsChainNegatable(ev)
end
function c100227045.costfilter(c)
return not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function c100227045.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100227045.costfilter,1,nil) end
local g=Duel.SelectReleaseGroup(tp,c100227045.costfilter,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c100227045.negtg(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)
end
function c100227045.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsRelateToEffect(re) then
Duel.SendtoGrave(eg,REASON_EFFECT)
end
end
--氷獄龍 トリシューラ
--Trishula, the Ice Prison Dragon
--Script by dest
function c100228001.initial_effect(c)
--fusion summon
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c100228001.ffilter,3,false)
--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)
--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(c100228001.spcon)
e2:SetOperation(c100228001.spop)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100228001,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,100228001)
e3:SetCondition(c100228001.remcon)
e3:SetTarget(c100228001.remtg)
e3:SetOperation(c100228001.remop)
c:RegisterEffect(e3)
end
function c100228001.ffilter(c,fc,sub,mg,sg)
return c:IsLocation(LOCATION_MZONE+LOCATION_HAND) and not sg or not sg:IsExists(Card.IsFusionCode,1,c,c:GetFusionCode())
end
function c100228001.cfilter(c,fc)
return c:IsAbleToRemoveAsCost() and c:IsCanBeFusionMaterial(fc)
end
function c100228001.fselect(c,tp,mg,sg)
sg:AddCard(c)
local res=false
if sg:GetCount()<3 then
res=mg:IsExists(c100228001.fselect,1,sg,tp,mg,sg)
elseif Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
res=sg:GetClassCount(Card.GetFusionCode)==3
end
sg:RemoveCard(c)
return res
end
function c100228001.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c100228001.cfilter,tp,LOCATION_MZONE,0,nil,c)
local sg=Group.CreateGroup()
return mg:IsExists(c100228001.fselect,1,nil,tp,mg,sg)
end
function c100228001.spop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c100228001.cfilter,tp,LOCATION_MZONE,0,nil,c)
local sg=Group.CreateGroup()
while sg:GetCount()<3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=mg:FilterSelect(tp,c100228001.fselect,1,1,sg,tp,mg,sg)
sg:Merge(g)
end
c:SetMaterial(sg)
Duel.Remove(sg,POS_FACEUP,REASON_COST+REASON_FUSION+REASON_MATERIAL)
end
function c100228001.mfilter(c)
return not c:IsRace(RACE_DRAGON)
end
function c100228001.remcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=c:GetMaterial()
return c:IsSummonType(SUMMON_TYPE_FUSION) and not mg:IsExists(c100228001.mfilter,1,nil)
end
function c100228001.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_DECK,1,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_DECK+LOCATION_EXTRA)
end
function c100228001.remop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetDecktopGroup(1-tp,1)
local g3=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,nil)
if g1:GetCount()>0 and g2:GetCount()>0 and g3:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg1=g1:Select(tp,1,1,nil)
Duel.ConfirmDecktop(1-tp,1)
local sg2=g2:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg3=g3:Select(tp,1,1,nil)
sg1:Merge(sg2)
sg1:Merge(sg3)
Duel.Remove(sg1,POS_FACEUP,REASON_EFFECT)
end
end
--熾天龍 ジャッジメント
--Judgment, the Seraphic Dragon
--Script by dest
function c100228002.initial_effect(c)
--synchro summon
aux.AddSynchroMixProcedure(c,aux.Tuner(nil),nil,nil,aux.NonTuner(nil),1,99,c100228002.syncheck)
c:EnableReviveLimit()
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100228002,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c100228002.condition)
e2:SetCost(c100228002.cost)
e2:SetTarget(c100228002.target)
e2:SetOperation(c100228002.operation)
c:RegisterEffect(e2)
--discard deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100228002,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCategory(CATEGORY_REMOVE)
e3:SetCountLimit(1)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c100228002.condition2)
e3:SetTarget(c100228002.target2)
e3:SetOperation(c100228002.operation2)
c:RegisterEffect(e3)
end
function c100228002.syncheck(g)
return g:GetClassCount(Card.GetAttribute)==1
end
function c100228002.condition(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_TUNER)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) and g:GetClassCount(Card.GetCode)>3
end
function c100228002.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function c100228002.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c100228002.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c100228002.splimit)
Duel.RegisterEffect(e1,tp)
end
function c100228002.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsRace(RACE_DRAGON)
end
function c100228002.condition2(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c100228002.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local rg=Duel.GetDecktopGroup(tp,4)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rg,4,0,0)
end
function c100228002.operation2(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.GetDecktopGroup(tp,4)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end
--撃滅龍 ダーク・アームド
--Dark Armed, the Annihilation Dragon
--Script by dest
function c100228003.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,7,2,c100228003.ovfilter,aux.Stringid(100228003,0),99,c100228003.xyzop)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100228003,1))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c100228003.cost)
e1:SetTarget(c100228003.target)
e1:SetOperation(c100228003.activate)
c:RegisterEffect(e1)
end
function c100228003.ovfilter(c)
if Duel.GetMatchingGroupCount(Card.IsAttribute,c:GetControler(),LOCATION_GRAVE,0,nil,ATTRIBUTE_DARK)~=5 then return false end
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsLevelAbove(5)
end
function c100228003.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,100228003)==0 end
Duel.RegisterFlagEffect(tp,100228003,RESET_PHASE+PHASE_END,0,1)
end
function c100228003.costfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToRemoveAsCost()
end
function c100228003.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c100228003.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_GRAVE)
end
function c100228003.activate(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_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToRemove),tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
end
...@@ -32,7 +32,7 @@ function c100228004.initial_effect(c) ...@@ -32,7 +32,7 @@ function c100228004.initial_effect(c)
e3:SetCondition(c100228004.spcon) e3:SetCondition(c100228004.spcon)
e3:SetOperation(c100228004.spop) e3:SetOperation(c100228004.spop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--gy and damage --to grave and damage
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100228004,1)) e4:SetDescription(aux.Stringid(100228004,1))
e4:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DAMAGE) e4:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DAMAGE)
...@@ -70,7 +70,7 @@ end ...@@ -70,7 +70,7 @@ end
function c100228004.thop(e,tp,eg,ep,ev,re,r,rp) function c100228004.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 then if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
end end
end end
......
--青眼の混沌龍
--Blue-Eyes Chaos Dragon
--Script by nekrozar
function c100409001.initial_effect(c)
c:EnableReviveLimit()
--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.ritlimit)
c:RegisterEffect(e1)
--cannot target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(aux.indoval)
c:RegisterEffect(e3)
--position
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100409001,0))
e4:SetCategory(CATEGORY_POSITION)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetCondition(c100409001.poscon)
e4:SetTarget(c100409001.postg)
e4:SetOperation(c100409001.posop)
c:RegisterEffect(e4)
end
function c100409001.poscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=c:GetMaterial()
return c:GetSummonType()==SUMMON_TYPE_RITUAL and mg:IsExists(Card.IsCode,1,nil,89631139)
end
function c100409001.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsCanChangePosition,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c100409001.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(Card.IsCanChangePosition,tp,0,LOCATION_MZONE,nil)
local tc=tg:GetFirst()
while tc do
if Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(0)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
tc=tg:GetNext()
end
if c:IsRelateToEffect(e) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_PIERCE)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
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