Commit 5ac7e80e authored by mercury233's avatar mercury233

update scripts

parent e5e93c3c
...@@ -42,7 +42,7 @@ function c100200149.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,7 +42,7 @@ function c100200149.regop(e,tp,eg,ep,ev,re,r,rp)
end end
function c100200149.valcheck(e,c) function c100200149.valcheck(e,c)
local g=c:GetMaterial() local g=c:GetMaterial()
if g:GetClassCount(Card.GetCode)==g:GetCount() and g:IsExists(Card.IsLinkAttribute,2,nil,ATTRIBUTE_DARK) then if g:GetClassCount(Card.GetLinkCode)==g:GetCount() and g:IsExists(Card.IsLinkAttribute,2,nil,ATTRIBUTE_DARK) then
e:GetLabelObject():SetLabel(1) e:GetLabelObject():SetLabel(1)
else else
e:GetLabelObject():SetLabel(0) e:GetLabelObject():SetLabel(0)
......
...@@ -22,6 +22,16 @@ function c100231010.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -22,6 +22,16 @@ function c100231010.target(e,tp,eg,ep,ev,re,r,rp,chk)
or ct==3 or ct==4 or ct==3 or ct==4
or (ct==5 and Duel.IsExistingMatchingCard(c100231010.spfilter,tp,LOCATION_DECK,0,1,nil)) or (ct==5 and Duel.IsExistingMatchingCard(c100231010.spfilter,tp,LOCATION_DECK,0,1,nil))
or (ct==6 and Duel.IsExistingMatchingCard(c100231010.desfilter,tp,0,LOCATION_MZONE,1,nil)) end or (ct==6 and Duel.IsExistingMatchingCard(c100231010.desfilter,tp,0,LOCATION_MZONE,1,nil)) end
if ct==3 then
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1500)
elseif ct==4 then
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,2000)
elseif ct==5 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
elseif ct==6 then
local g=Duel.GetMatchingGroup(c100231010.desfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
end end
function c100231010.spfilter(c,e,tp) function c100231010.spfilter(c,e,tp)
return c:IsAttackAbove(2500) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsAttackAbove(2500) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -20,7 +20,7 @@ function c100334042.initial_effect(c) ...@@ -20,7 +20,7 @@ function c100334042.initial_effect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD) e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,100334043) e2:SetCountLimit(1,100334042)
e2:SetCondition(c100334042.spcon) e2:SetCondition(c100334042.spcon)
e2:SetTarget(c100334042.sptg) e2:SetTarget(c100334042.sptg)
e2:SetOperation(c100334042.spop) e2:SetOperation(c100334042.spop)
...@@ -39,7 +39,7 @@ end ...@@ -39,7 +39,7 @@ end
function c100334042.spfilter(c,e,tp) function c100334042.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevelBelow(4) and c:IsRace(RACE_CYBERSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c100334042.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c100334042.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100334042.spfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100334042.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100334042.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingTarget(c100334042.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
......
--青き眼の激臨
--Rampage with Eyes of Blue
--Script by dest
function c100409004.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCost(c100409004.cost)
e1:SetTarget(c100409004.target)
e1:SetOperation(c100409004.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(100409004,ACTIVITY_SUMMON,c100409004.counterfilter)
Duel.AddCustomActivityCounter(100409004,ACTIVITY_SPSUMMON,c100409004.counterfilter)
end
c100409004.card_code_list={89631139}
function c100409004.counterfilter(c)
return c:IsCode(89631139)
end
function c100409004.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(100409004,tp,ACTIVITY_SUMMON)==0
and Duel.GetCustomActivityCount(100409004,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c100409004.splimit)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
end
function c100409004.splimit(e,c)
return not c:IsCode(89631139)
end
function c100409004.spfilter(c,e,tp)
return c:IsCode(89631139) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100409004.rmfilter(c)
return c:IsAbleToRemove() and not c:IsType(TYPE_TOKEN)
end
function c100409004.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100409004.rmfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(c100409004.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and g:GetCount()>0 and Duel.GetMZoneCount(tp,g)>0 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100409004.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100409004.rmfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
if Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)>0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if ft>3 then ft=3 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c100409004.spfilter,tp,LOCATION_DECK,0,1,ft,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--エターナル・エヴォリューション・バースト
--Eternal Evolution Burst
--Script by dest
function c100409015.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(c100409015.target)
e1:SetOperation(c100409015.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetValue(c100409015.eqlimit)
c:RegisterEffect(e2)
--activate limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(0,1)
e3:SetCondition(c100409015.actcon)
e3:SetValue(c100409015.actlimit)
c:RegisterEffect(e3)
--chain attack
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(20007374,0))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DAMAGE_STEP_END)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(c100409015.cacon)
e4:SetCost(c100409015.cacost)
e4:SetTarget(c100409015.catg)
e4:SetOperation(c100409015.caop)
c:RegisterEffect(e4)
if not c100409015.global_check then
c100409015.global_check=true
c100409015[0]=0
c100409015[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetOperation(c100409015.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c100409015.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c100409015.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:GetFlagEffect(100409015)==0 then
c100409015[ep]=c100409015[ep]+1
tc:RegisterFlagEffect(100409015,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function c100409015.clear(e,tp,eg,ep,ev,re,r,rp)
c100409015[0]=0
c100409015[1]=0
end
function c100409015.eqlimit(e,c)
return c:IsRace(RACE_MACHINE) and c:IsType(TYPE_FUSION)
end
function c100409015.eqfilter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_FUSION)
end
function c100409015.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c100409015.eqfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100409015.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c100409015.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c100409015.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 c100409015.actcon(e)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()==e:GetHandler():GetControler() and ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function c100409015.actlimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e)
end
function c100409015.cacon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler():GetEquipTarget() and Duel.GetAttackTarget()~=nil
end
function c100409015.cafilter(c)
return c:IsSetCard(0x1093) and c:IsAbleToRemoveAsCost()
end
function c100409015.cacost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c100409015.cafilter,tp,LOCATION_GRAVE,0,1,nil)
and (c100409015[tp]==0 or c:GetEquipTarget():GetFlagEffect(100409015)~=0) end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c100409015.ftarget)
e1:SetLabel(c:GetEquipTarget():GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c100409015.cafilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c100409015.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c100409015.catg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetEquipTarget():IsChainAttackable(0,true) end
end
function c100409015.caop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetEquipTarget()
if not ec:IsRelateToBattle() then return end
Duel.ChainAttack()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_BATTLE+PHASE_DAMAGE_CAL)
ec:RegisterEffect(e1)
end
--グローウィング・ボウガン
--Glowing Bowgun
--Script by dest
function c100409026.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(c100409026.target)
e1:SetOperation(c100409026.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetValue(c100409026.eqlimit)
c:RegisterEffect(e2)
--atk/def up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(500)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UPDATE_DEFENSE)
e4:SetValue(500)
c:RegisterEffect(e4)
--discard
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100409026,0))
e5:SetCategory(CATEGORY_HANDES)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_BATTLE_DESTROYING)
e5:SetRange(LOCATION_SZONE)
e5:SetCountLimit(1,100409026)
e5:SetTarget(c100409026.destg)
e5:SetOperation(c100409026.desop)
c:RegisterEffect(e5)
--tohand
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(100409026,1))
e6:SetCategory(CATEGORY_TOHAND)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCode(EVENT_TO_GRAVE)
e6:SetCountLimit(1,100409026+100)
e6:SetCondition(c100409026.retcon)
e6:SetTarget(c100409026.rettg)
e6:SetOperation(c100409026.retop)
c:RegisterEffect(e6)
end
function c100409026.eqlimit(e,c)
return c:IsSetCard(0x33)
end
function c100409026.eqfilter(c)
return c:IsFaceup() and c:IsSetCard(0x33)
end
function c100409026.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c100409026.eqfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100409026.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c100409026.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c100409026.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 c100409026.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_HANDES,0,0,1-tp,1)
end
function c100409026.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND,nil)
if g:GetCount()==0 then return end
local sg=g:RandomSelect(1-tp,1)
Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT)
end
function c100409026.retcon(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_SYNCHRO)
end
function c100409026.rettg(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 c100409026.retop(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
--フォトン・オービタル
--Photon Orbital
--Script by dest
function c100409036.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100409036,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetTarget(c100409036.eqtg)
e1:SetOperation(c100409036.eqop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100409036,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,100409036)
e2:SetCondition(c100409036.thcon)
e2:SetCost(c100409036.thcost)
e2:SetTarget(c100409036.thtg)
e2:SetOperation(c100409036.thop)
c:RegisterEffect(e2)
end
function c100409036.filter(c)
return c:IsFaceup() and (c:IsSetCard(0x55) or c:IsSetCard(0x7b))
end
function c100409036.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc~=c and c100409036.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c100409036.filter,tp,LOCATION_MZONE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c100409036.filter,tp,LOCATION_MZONE,0,1,1,c)
end
function c100409036.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not tc:IsControler(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
Duel.Equip(tp,c,tc,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c100409036.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(500)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
--Indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e3)
end
function c100409036.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c100409036.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetEquipTarget()
end
function c100409036.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c100409036.thfilter(c)
return (c:IsSetCard(0x55) or c:IsSetCard(0x7b)) and c:IsType(TYPE_MONSTER) and not c:IsCode(100409036) and c:IsAbleToHand()
end
function c100409036.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409036.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100409036.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100409036.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
--魔界劇団-メロー・マドンナ
--Abyss Actor - Mellow Madonna
--Script by dest
function c100409045.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100409045,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,100409045)
e1:SetCost(c100409045.thcost)
e1:SetTarget(c100409045.thtg)
e1:SetOperation(c100409045.thop)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c100409045.val)
c:RegisterEffect(e2)
--spsummon (self)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100409045,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYED)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,100409045+100)
e3:SetCondition(c100409045.spcon)
e3:SetTarget(c100409045.sptg)
e3:SetOperation(c100409045.spop)
c:RegisterEffect(e3)
--spsummon (deck)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetOperation(aux.chainreg)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100409045,2))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_CHAIN_SOLVING)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,100409045+200)
e5:SetCondition(c100409045.spcon2)
e5:SetTarget(c100409045.sptg2)
e5:SetOperation(c100409045.spop2)
c:RegisterEffect(e5)
end
function c100409045.thcost(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 c100409045.thfilter(c)
return c:IsSetCard(0x10ec) and not c:IsCode(100409045) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c100409045.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409045.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100409045.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100409045.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
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c100409045.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100409045.splimit(e,c)
return not (c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM))
end
function c100409045.valfilter(c)
return c:IsSetCard(0x20ec) and c:IsType(TYPE_SPELL)
end
function c100409045.val(e,c)
return Duel.GetMatchingGroupCount(c100409045.valfilter,c:GetControler(),LOCATION_GRAVE,0,nil)*100
end
function c100409045.cfilter(c,tp)
return c:IsType(TYPE_PENDULUM) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
end
function c100409045.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100409045.cfilter,1,nil,tp)
end
function c100409045.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 c100409045.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c100409045.spcon2(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL)and re:GetHandler():IsSetCard(0x20ec) and e:GetHandler():GetFlagEffect(1)>0
end
function c100409045.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100409045.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100409045.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100409045.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100409045.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local fid=c:GetFieldID()
tc:RegisterFlagEffect(100409045,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c100409045.thcon2)
e1:SetOperation(c100409045.thop2)
Duel.RegisterEffect(e1,tp)
end
end
function c100409045.thcon2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(100409045)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c100409045.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetLabelObject(),nil,REASON_EFFECT)
end
--魔界劇団-コミック・リリーフ
--Abyss Actor - Comic Relief
--Scripted by ahtelel
function c100409046.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--control
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100409046,0))
e1:SetCategory(CATEGORY_CONTROL+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,100409046)
e1:SetTarget(c100409046.cttg)
e1:SetOperation(c100409046.ctop)
c:RegisterEffect(e1)
--avoid damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_NO_BATTLE_DAMAGE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e3:SetValue(1)
c:RegisterEffect(e3)
--control
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100409046,1))
e4:SetCategory(CATEGORY_CONTROL)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE+PHASE_STANDBY)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c100409046.ctcon)
e4:SetTarget(c100409046.cttg2)
e4:SetOperation(c100409046.ctop2)
c:RegisterEffect(e4)
--destroy
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100409046,2))
e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_CONTROL_CHANGED)
e5:SetCountLimit(1)
e5:SetTarget(c100409046.destg)
e5:SetOperation(c100409046.desop)
c:RegisterEffect(e5)
end
function c100409046.ctfilter(c)
return c:IsFaceup() and c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM) and c:IsAbleToChangeControler()
end
function c100409046.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,nil)
and Duel.IsExistingTarget(c100409046.ctfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g1=Duel.SelectTarget(tp,Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g2=Duel.SelectTarget(tp,c100409046.ctfilter,tp,LOCATION_MZONE,0,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g1,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c100409046.ctop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local a=g:GetFirst()
local b=g:GetNext()
if a:IsRelateToEffect(e) and b:IsRelateToEffect(e) and Duel.SwapControl(a,b)~=0 then
Duel.BreakEffect()
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
function c100409046.ctcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c100409046.cttg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0)
end
function c100409046.ctop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.GetControl(c,1-tp)
end
end
function c100409046.desfilter(c)
return c:IsFacedown() and c:IsType(TYPE_SPELL) and c:IsSetCard(0x20ec)
end
function c100409046.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,e:GetHandler():GetOwner(),LOCATION_SZONE)
end
function c100409046.desop(e,tp,eg,ep,ev,re,r,rp)
local p=e:GetHandler():GetOwner()
local g=Duel.GetMatchingGroup(c100409046.desfilter,p,LOCATION_SZONE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(p,aux.Stringid(100409046,3)) then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_DESTROY)
local sg=g:Select(p,1,1,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
end
--魔界台本「ロマンティック・テラー」
--Abyss Script - Romantic Teller
--Scripted by Eerie Code
function c100409047.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100409047+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100409047.target)
e1:SetOperation(c100409047.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(c100409047.setcon)
e2:SetTarget(c100409047.settg)
e2:SetOperation(c100409047.setop)
c:RegisterEffect(e2)
end
function c100409047.thfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsSetCard(0x10ec) and c:IsAbleToHand()
and Duel.IsExistingMatchingCard(c100409047.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function c100409047.spfilter(c,e,tp,hc)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsSetCard(0x10ec)
and c:GetOriginalCode()~=hc:GetOriginalCode() and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
and Duel.GetLocationCountFromEx(tp,tp,c,hc)>0
end
function c100409047.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409047.thfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100409047.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local hc=Duel.SelectMatchingCard(tp,c100409047.thfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp):GetFirst()
if hc and Duel.SendtoHand(hc,nil,REASON_EFFECT)~=0 and hc:IsLocation(LOCATION_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100409047.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,hc)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
end
function c100409047.filter2(c)
return c:IsSetCard(0x10ec) and c:IsFaceup() and c:IsType(TYPE_PENDULUM)
end
function c100409047.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and rp==1-tp and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
and Duel.IsExistingMatchingCard(c100409047.filter2,tp,LOCATION_EXTRA,0,1,nil)
end
function c100409047.setfilter(c)
return c:IsSetCard(0x20ec) and c:IsType(TYPE_SPELL) and c:IsSSetable()
end
function c100409047.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409047.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c100409047.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100409047.setfilter,tp,LOCATION_DECK,0,nil)
local ct=math.min(Duel.GetLocationCount(tp,LOCATION_SZONE),g:GetCount())
if ct<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,1,ct,nil)
Duel.SSet(tp,sg)
Duel.ConfirmCards(1-tp,sg)
end
--魔界劇場「ファンタスティックシアター」
--Abyss Playhouse – Fantastic Theater
--Scripted by ahtelel
function c100409048.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100409048,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,100409048)
e2:SetCost(c100409048.thcost)
e2:SetTarget(c100409048.thtg)
e2:SetOperation(c100409048.thop)
c:RegisterEffect(e2)
--change effect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetCondition(c100409048.chcon1)
e3:SetOperation(c100409048.chop1)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_ACTIVATING)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1,100409148)
e4:SetCondition(c100409048.chcon2)
e4:SetOperation(c100409048.chop2)
c:RegisterEffect(e4)
end
function c100409048.cfilter(c)
return c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM) and not c:IsPublic()
end
function c100409048.cfilter2(c,tp)
return c:IsSetCard(0x20ec) and c:IsType(TYPE_SPELL) and not c:IsPublic()
and Duel.IsExistingMatchingCard(c100409048.cfilter3,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function c100409048.cfilter3(c,code)
return c:IsSetCard(0x20ec) and c:IsType(TYPE_SPELL) and not c:IsCode(code) and c:IsAbleToHand()
end
function c100409048.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409048.cfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c100409048.cfilter2,tp,LOCATION_HAND,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g1=Duel.SelectMatchingCard(tp,c100409048.cfilter,tp,LOCATION_HAND,0,1,1,nil)
local g2=Duel.SelectMatchingCard(tp,c100409048.cfilter2,tp,LOCATION_HAND,0,1,1,nil,tp)
e:SetLabel(g2:GetFirst():GetCode())
g1:Merge(g2)
Duel.ConfirmCards(1-tp,g1)
Duel.ShuffleHand(tp)
end
function c100409048.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100409048.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100409048.cfilter3,tp,LOCATION_DECK,0,1,1,nil,e:GetLabel())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c100409048.chcon1(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsActiveType(TYPE_MONSTER)
and Duel.IsExistingMatchingCard(c100409048.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100409048.chop1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():RegisterFlagEffect(100409048,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c100409048.confilter(c)
return c:IsFaceup() and c:IsSetCard(0x10ec) and c:IsSummonType(SUMMON_TYPE_PENDULUM)
end
function c100409048.chcon2(e,tp,eg,ep,ev,re,r,rp)
return ev==1 and e:GetHandler():GetFlagEffect(100409048)>0
and Duel.IsExistingMatchingCard(c100409048.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100409048.chop2(e,tp,eg,ep,ev,re,r,rp)
return Duel.ChangeChainOperation(1,c100409048.repop)
end
function c100409048.desfilter(c)
return c:IsFacedown() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c100409048.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c100409048.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
--魔界劇団のカーテンコール
--Abyss Actors Curtain Call
--Scripted by Eerie Code
function c100409049.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100409049+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c100409049.condition)
e1:SetTarget(c100409049.target)
e1:SetOperation(c100409049.activate)
c:RegisterEffect(e1)
--activity check
Duel.AddCustomActivityCounter(100409049,ACTIVITY_CHAIN,c100409049.chainfilter)
end
function c100409049.chainfilter(re,tp,cid)
return not (re:IsActiveType(TYPE_SPELL) and re:GetHandler():IsSetCard(0x20ec))
end
function c100409049.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(100409049,tp,ACTIVITY_CHAIN)>0
end
function c100409049.thfilter(c)
return c:IsFaceup() and c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c100409049.spfilter(c,e,tp)
return c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100409049.ctfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSetCard(0x20ec)
end
function c100409049.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100409049.ctfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingMatchingCard(c100409049.thfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100409049.activate(e,tp,eg,ep,ev,re,r,rp)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c100409049.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
local ct=Duel.GetMatchingGroupCount(c100409049.ctfilter,tp,LOCATION_GRAVE,0,nil)
if ct<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=Duel.SelectMatchingCard(tp,c100409049.thfilter,tp,LOCATION_EXTRA,0,1,ct,nil)
if hg:GetCount()>0 and Duel.SendtoHand(hg,nil,REASON_EFFECT)~=0 then
local sct=Duel.GetOperatedGroup():FilterCount(Card.IsControler,nil,tp)
local sg=Duel.GetMatchingGroup(c100409049.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),sg:GetCount())
if sct>0 and ft>0 and Duel.SelectYesNo(tp,aux.Stringid(100409049,0)) then
Duel.BreakEffect()
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Group.CreateGroup()
repeat
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=sg:Select(tp,1,1,nil):GetFirst()
g:AddCard(tc)
sg:Remove(Card.IsCode,nil,tc:GetCode())
until sct==g:GetCount() or ft==g:GetCount() or not Duel.SelectYesNo(tp,210)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c100409049.splimit(e,c)
return not (c:IsSetCard(0x10ec) and c:IsType(TYPE_PENDULUM))
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