Commit 219b5498 authored by mercury233's avatar mercury233

update scripts

parent a5ca21a2
--L・G・D
--Scripted by mallu11
function c100257001.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,5,5)
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.lnklimit)
c:RegisterEffect(e0)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100257001,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(c100257001.descon)
e1:SetTarget(c100257001.destg)
e1:SetOperation(c100257001.desop)
c:RegisterEffect(e1)
--immume
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c100257001.efilter)
c:RegisterEffect(e2)
--indes battle
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(c100257001.indes)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100257001,1))
e4:SetCategory(CATEGORY_REMOVE+CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c100257001.rmcon)
e4:SetTarget(c100257001.rmtg)
e4:SetOperation(c100257001.rmop)
c:RegisterEffect(e4)
end
function c100257001.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function c100257001.indes(e,c)
return c:IsAttribute(ATTRIBUTE_DARK+ATTRIBUTE_EARTH+ATTRIBUTE_WATER+ATTRIBUTE_FIRE+ATTRIBUTE_WIND)
end
function c100257001.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetMaterial()
local tc=g:GetFirst()
local res=true
while tc do
for i,att in ipairs({ATTRIBUTE_DARK,ATTRIBUTE_EARTH,ATTRIBUTE_WATER,ATTRIBUTE_FIRE,ATTRIBUTE_WIND}) do
if bit.band(tc:GetLinkAttribute(),att)==att then
c:RegisterFlagEffect(100256901+100*i,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
tc=g:GetNext()
end
for i=1,5 do
res=res and (c:GetFlagEffect(100256901+100*i)>0)
end
return c:IsSummonType(SUMMON_TYPE_LINK) and res
end
function c100257001.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c100257001.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
function c100257001.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function c100257001.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,5,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
end
function c100257001.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local res=true
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_GRAVE,0,nil)
if g:GetCount()>=5 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE,0,5,5,nil)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
local tc=sg:GetFirst()
while tc do
res=res and tc:IsLocation(LOCATION_REMOVED)
tc=sg:GetNext()
end
else res=false end
if res==false and c:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
--神聖魔皇后セレーネ
--Scripted by mallu11
function c100257036.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,nil,2,3,c100257036.lcheck)
c:EnableCounterPermit(0x1)
--add counter
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100257036,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c100257036.ctcon)
e1:SetOperation(c100257036.ctop)
c:RegisterEffect(e1)
--can not be attack 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_BATTLE_TARGET)
e2:SetCondition(c100257036.atcon)
e2:SetValue(aux.imval1)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100257036,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e3:SetCountLimit(1)
e3:SetCondition(c100257036.spcon)
e3:SetCost(c100257036.spcost)
e3:SetTarget(c100257036.sptg)
e3:SetOperation(c100257036.spop)
c:RegisterEffect(e3)
end
function c100257036.lcheck(g,lc)
return g:IsExists(Card.IsLinkRace,1,nil,RACE_SPELLCASTER)
end
function c100257036.atfilter(c)
return c:IsFaceup() and c:IsSetCard(0x12a)
end
function c100257036.atcon(e)
return Duel.IsExistingMatchingCard(c100257036.atfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
function c100257036.ctfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL)
end
function c100257036.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100257036.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local loc=LOCATION_ONFIELD+LOCATION_GRAVE
local g=Duel.GetMatchingGroup(c100257036.ctfilter,tp,loc,loc,nil)
if g:GetCount()>0 then
c:AddCounter(0x1,g:GetCount())
end
end
function c100257036.spfilter(c,e,tp,zone)
return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,tp,zone)
end
function c100257036.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c100257036.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1,3,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x1,3,REASON_COST)
end
function c100257036.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local zone=bit.band(e:GetHandler():GetLinkedZone(tp),0x1f)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100257036.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,zone) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c100257036.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local zone=bit.band(e:GetHandler():GetLinkedZone(tp),0x1f)
if zone==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100257036.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,zone)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE,zone)
end
end
--捕食植物ヴェルテ・アナコンダ
--Scripted by mallu11
function c100257071.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2)
--change attribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100257071,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100257071)
e1:SetTarget(c100257071.atttg)
e1:SetOperation(c100257071.attop)
c:RegisterEffect(e1)
--copy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100257071,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100257171)
e2:SetCost(c100257071.cpcost)
e2:SetTarget(c100257071.cptg)
e2:SetOperation(c100257071.cpop)
c:RegisterEffect(e2)
end
function c100257071.attfilter(c)
return c:IsFaceup() and not c:IsAttribute(ATTRIBUTE_DARK)
end
function c100257071.atttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c100257071.attfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100257071.attfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c100257071.attfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c100257071.attop(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_CHANGE_ATTRIBUTE)
e1:SetValue(ATTRIBUTE_DARK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c100257071.cpfilter(c)
return (c:GetType()==TYPE_SPELL or c:IsType(TYPE_QUICKPLAY)) and c:IsSetCard(0x46) and c:IsAbleToGraveAsCost()
and c:CheckActivateEffect(false,true,false)~=nil
end
function c100257071.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
end
function c100257071.cptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return Duel.CheckLPCost(tp,2000) and Duel.IsExistingMatchingCard(c100257071.cpfilter,tp,LOCATION_DECK,0,1,nil)
end
e:SetLabel(0)
Duel.PayLPCost(tp,2000)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100257071.cpfilter,tp,LOCATION_DECK,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true)
Duel.SendtoGrave(g,REASON_COST)
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
end
function c100257071.cpop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if te then
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
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:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
--超魔導竜騎士-ドラグーン・オブ・レッドアイズ
--Scripted by mallu11
function c100259001.initial_effect(c)
aux.AddFusionProcCodeFun(c,46986414,c100259001.mfilter,1,true,true)
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100259001,0))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c100259001.descon)
e3:SetTarget(c100259001.destg)
e3:SetOperation(c100259001.desop)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100259001,1))
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c100259001.discon)
e4:SetCost(c100259001.discost)
e4:SetTarget(c100259001.distg)
e4:SetOperation(c100259001.disop)
c:RegisterEffect(e4)
end
c100259001.material_setcode=0x3b
function c100259001.mfilter(c)
return c:IsFusionCode(74677422) or (c:IsRace(RACE_DRAGON) and c:IsFusionType(TYPE_EFFECT))
end
function c100259001.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=c:GetMaterial()
local ct=g:FilterCount(Card.IsFusionType,nil,TYPE_NORMAL)
e:SetLabel(ct)
return ct>0
end
function c100259001.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=e:GetLabel()
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) and c:GetFlagEffect(100259001)~=ct end
c:RegisterFlagEffect(100259001,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
function c100259001.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
local atk=g:GetFirst():GetTextAttack()
if atk<0 then atk=0 end
Duel.HintSelection(g)
if Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
end
function c100259001.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function c100259001.discost(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.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c100259001.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c100259001.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
--E・HERO ネオス・クルーガー
--Scripted by mallu11
function c100259009.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,89943723,78371393,true,true)
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.fuslimit)
c:RegisterEffect(e0)
--damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100259009,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_CONFIRM)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c100259009.damcon)
e1:SetTarget(c100259009.damtg)
e1:SetOperation(c100259009.damop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100259009,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,100259009)
e2:SetCondition(c100259009.spcon)
e2:SetTarget(c100259009.sptg)
e2:SetOperation(c100259009.spop)
c:RegisterEffect(e2)
end
c100259009.material_setcode=0x8
c100259009.card_code_list={89943723}
c100259009.neos_fusion=true
function c100259009.damcon(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
return bc and bc:IsControler(1-tp)
end
function c100259009.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,e:GetHandler():GetBattleTarget():GetAttack())
end
function c100259009.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
if tc and tc:IsFaceup() and tc:IsControler(1-tp) and tc:IsRelateToBattle() then
local atk=tc:GetAttack()
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
function c100259009.spfilter(c,e,tp)
return c:IsCode(5126490) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c100259009.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp
and (c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT)))
end
function c100259009.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c100259009.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c100259009.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100259009.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
--シューティング・スター・ドラゴン・TG-EX
--Scripted by mallu11
function c100259017.initial_effect(c)
c:EnableReviveLimit()
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSynchroType,TYPE_SYNCHRO),aux.NonTuner(Card.IsSynchroType,TYPE_SYNCHRO),1)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100259017,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c100259017.discon)
e1:SetCost(c100259017.discost)
e1:SetTarget(c100259017.distg)
e1:SetOperation(c100259017.disop)
c:RegisterEffect(e1)
--disable attack
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100259017,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100259017)
e2:SetCondition(c100259017.atkcon)
e2:SetOperation(c100259017.atkop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100259017,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,100259117)
e3:SetCondition(c100259017.spcon)
e3:SetCost(c100259017.spcost)
e3:SetTarget(c100259017.sptg)
e3:SetOperation(c100259017.spop)
c:RegisterEffect(e3)
end
function c100259017.tfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
function c100259017.disfilter(c)
return c:IsType(TYPE_TUNER) and c:IsAbleToRemoveAsCost()
end
function c100259017.discon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and tg:IsExists(c100259017.tfilter,1,nil,tp) and Duel.IsChainNegatable(ev)
end
function c100259017.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100259017.disfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c100259017.disfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c100259017.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c100259017.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c100259017.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function c100259017.atkop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack()
end
function c100259017.spfilter(c,tp)
return c:IsType(TYPE_SYNCHRO) and Duel.GetMZoneCount(tp,c)>0
end
function c100259017.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function c100259017.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c100259017.spfilter,2,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c100259017.spfilter,2,2,nil,tp)
Duel.Release(g,REASON_COST)
end
function c100259017.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100259017.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--E・HERO サンライザー
--Scripted by mallu11
function c100423012.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c100423012.ffilter,2,true)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.fuslimit)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100423012,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100423012)
e2:SetTarget(c100423012.srtg)
e2:SetOperation(c100423012.srop)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetValue(c100423012.val)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100423012,1))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,100423112)
e4:SetCondition(c100423012.descon)
e4:SetTarget(c100423012.destg)
e4:SetOperation(c100423012.desop)
c:RegisterEffect(e4)
end
function c100423012.ffilter(c,fc,sub,mg,sg)
return c:IsFusionSetCard(0x8) and (not sg or not sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute()))
end
function c100423012.srfilter(c)
return c:IsCode(45906428) and c:IsAbleToHand()
end
function c100423012.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100423012.srfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100423012.srop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100423012.srfilter,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 c100423012.val(e,c)
local g=Duel.GetFieldGroup(e:GetHandlerPlayer(),LOCATION_MZONE,0)
local sg=g:Filter(Card.IsFaceup,nil)
return sg:GetClassCount(Card.GetAttribute)*200
end
function c100423012.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=Duel.GetAttacker()
local tc=Duel.GetAttackTarget()
if not ac:IsControler(tp) then ac,tc=tc,ac end
return ac and ac:IsControler(tp) and ac:IsFaceup() and ac:IsSetCard(0x8) and ac~=c
end
function c100423012.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100423012.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
--フェイバリット・ヒーロー
--Scripted by mallu11
function c100423015.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(c100423015.target)
e1:SetOperation(c100423015.operation)
c:RegisterEffect(e1)
--equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(c100423015.eqlimit)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(c100423015.atkval)
e3:SetCondition(c100423015.atkcon)
c:RegisterEffect(e3)
--effect target
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetValue(aux.tgoval)
e4:SetCondition(c100423015.atkcon)
c:RegisterEffect(e4)
--activate field
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(100423015,0))
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e5:SetRange(LOCATION_SZONE)
e5:SetCountLimit(1)
e5:SetTarget(c100423015.acttg)
e5:SetOperation(c100423015.actop)
c:RegisterEffect(e5)
--chain atk
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(100423015,1))
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_BATTLE_DESTROYING)
e6:SetRange(LOCATION_SZONE)
e6:SetCondition(c100423015.chacon)
e6:SetCost(c100423015.chacost)
e6:SetOperation(c100423015.chaop)
c:RegisterEffect(e6)
end
function c100423015.eqfilter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and c:IsSetCard(0x8)
end
function c100423015.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c100423015.eqfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100423015.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c100423015.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c100423015.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and c100423015.eqfilter(tc) then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c100423015.eqlimit(e,c)
return c:IsLevelAbove(5) and c:IsSetCard(0x8)
end
function c100423015.atkval(e,c)
return e:GetHandler():GetEquipTarget():GetBaseDefense()
end
function c100423015.atkcon(e)
return Duel.IsExistingMatchingCard(aux.TRUE,e:GetHandlerPlayer(),LOCATION_FZONE,0,1,nil)
end
function c100423015.actfilter(c,tp)
return c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function c100423015.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100423015.actfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,tp) end
if not Duel.CheckPhaseActivity() then e:SetLabel(1) else e:SetLabel(0) end
end
function c100423015.actop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(100423015,2))
if e:GetLabel()==1 then Duel.RegisterFlagEffect(tp,100423015,RESET_CHAIN,0,1) end
local g=Duel.SelectMatchingCard(tp,c100423015.actfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,tp)
Duel.ResetFlagEffect(tp,100423015)
local tc=g:GetFirst()
if tc then
local te=tc:GetActivateEffect()
if e:GetLabel()==1 then Duel.RegisterFlagEffect(tp,100423015,RESET_CHAIN,0,1) end
local b=te:IsActivatable(tp,true,true)
if b then
Duel.ResetFlagEffect(tp,100423015)
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
end
function c100423015.chacon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
return Duel.GetAttacker()==ec and ec:IsRelateToBattle() and ec:IsStatus(STATUS_OPPO_BATTLE)
end
function c100423015.chacost(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 c100423015.chaop(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetPreviousEquipTarget()
if ec:IsChainAttackable() then
Duel.ChainAttack()
end
end
--マジスタリー・アルケミスト
--Scripted by mallu11
function c100423016.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,100423016+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c100423016.cost)
e1:SetTarget(c100423016.target)
e1:SetOperation(c100423016.activate)
c:RegisterEffect(e1)
end
function c100423016.cfilter(c,tp)
return (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsSetCard(0x8) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() and Duel.GetMZoneCount(tp,c)>0
end
function c100423016.spfilter(c,e,tp)
return c:IsSetCard(0x8) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c100423016.fselect(g,e,tp)
if Duel.IsExistingTarget(c100423016.spfilter,tp,LOCATION_GRAVE,0,1,g,e,tp) then
Duel.SetSelectedCard(g)
return true
else return false end
end
function c100423016.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100423016.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil,tp)
if chk==0 then return g:CheckSubGroup(c100423016.fselect,4,4,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,c100423016.fselect,false,4,4,e,tp)
local b1=sg:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_EARTH)
local b2=sg:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WATER)
local b3=sg:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_FIRE)
local b4=sg:IsExists(Card.IsAttribute,1,nil,ATTRIBUTE_WIND)
if b1 and b2 and b3 and b4 then
e:SetLabel(1)
else
e:SetLabel(0)
end
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c100423016.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100423016.spfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c100423016.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100423016.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100423016.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)~=0 and e:GetLabel()==1 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(tc:GetBaseAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)
local gc=g:GetFirst()
while gc do
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
gc:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
gc:RegisterEffect(e3)
gc=g:GetNext()
end
end
end
--サテライト・ウォリアー
--Scripted by mallu11
function c100423023.initial_effect(c)
c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsSynchroType,TYPE_SYNCHRO),1)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100423023,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100423023)
e1:SetCondition(c100423023.descon)
e1:SetTarget(c100423023.destg)
e1:SetOperation(c100423023.desop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100423023,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100423123)
e2:SetCondition(c100423023.spcon)
e2:SetTarget(c100423023.sptg)
e2:SetOperation(c100423023.spop)
c:RegisterEffect(e2)
end
c100423023.synmat_syn=true
function c100423023.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c100423023.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_GRAVE,0,1,nil,TYPE_SYNCHRO) and Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
local gc=Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SYNCHRO)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,gc,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c100423023.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local ct=Duel.Destroy(tg,REASON_EFFECT)
if ct~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct*1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
function c100423023.spfilter(c,e,tp)
return c:IsLevelBelow(8) and c:IsSetCard(0x66,0x1017,0xa3) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100423023.fselect(g)
if g:GetClassCount(Card.GetCode)==g:GetCount() then
Duel.SetSelectedCard(g)
return true
else return false end
end
function c100423023.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c100423023.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c100423023.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_GRAVE)
end
function c100423023.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c100423023.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
local mz=Duel.GetLocationCount(tp,LOCATION_MZONE)
if mz<=0 or g:GetCount()<=0 then return end
local count=math.min(mz,3)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then count=1 end
local sg=g:SelectSubGroup(tp,c100423023.fselect,false,1,count)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
--サテライト・シンクロン
--Scripted by mallu11
function c100423025.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100423025,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100423025)
e1:SetCondition(c100423025.spcon)
e1:SetTarget(c100423025.sptg)
e1:SetOperation(c100423025.spop)
c:RegisterEffect(e1)
--level
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100423025,1))
e2:SetCategory(CATEGORY_LVCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100423125)
e2:SetCondition(c100423025.lvcon)
e2:SetTarget(c100423025.lvtg)
e2:SetOperation(c100423025.lvop)
c:RegisterEffect(e2)
end
function c100423025.spfilter(c,tp)
return c:GetSummonLocation()==LOCATION_GRAVE and c:GetPreviousControler()==tp
end
function c100423025.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100423025.spfilter,1,nil,tp)
end
function c100423025.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c100423025.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100423025.lvfilter(c)
return c:IsFaceup() and c:IsOriginalSetCard(0x66,0x1017,0xa3) and c:IsType(TYPE_SYNCHRO)
end
function c100423025.lvcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100423025.lvfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil)
end
function c100423025.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsLevelAbove(1) and not c:IsLevel(4) end
end
function c100423025.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(4)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--くず鉄のシグナル
--Scripted by mallu11
function c100423027.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCountLimit(1,100423027+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c100423027.condition)
e1:SetTarget(c100423027.target)
e1:SetOperation(c100423027.activate)
c:RegisterEffect(e1)
end
function c100423027.filter(c)
return c.synmat_syn and c:IsFaceup()
end
function c100423027.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100423027.filter,tp,LOCATION_MZONE,0,1,nil) and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev) and rp==1-tp
end
function c100423027.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c100423027.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsCanTurnSet() then
Duel.BreakEffect()
c:CancelToGrave()
Duel.ChangePosition(c,POS_FACEDOWN)
Duel.RaiseEvent(c,EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
end
end
--ガガガガマジシャン
--Scripted by mallu11
function c100423034.initial_effect(c)
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,4,2)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100423034,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100423034)
e1:SetCost(c100423034.spcost)
e1:SetTarget(c100423034.sptg)
e1:SetOperation(c100423034.spop)
c:RegisterEffect(e1)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100423034,1))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(c100423034.atkcon)
e2:SetCost(c100423034.atkcost)
e2:SetTarget(c100423034.atktg)
e2:SetOperation(c100423034.atkop)
c:RegisterEffect(e2)
end
function c100423034.spfilter(c,e,tp)
return c:IsType(TYPE_XYZ) and not c:IsCode(100423034) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100423034.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c100423034.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100423034.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c100423034.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100423034.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100423034.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
end
function c100423034.atkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and not (c:GetAttack()==4000 and (c:IsDisabled() or not c:IsType(TYPE_EFFECT)))
end
function c100423034.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSetCard(0x207f) and c:IsType(TYPE_XYZ)
end
function c100423034.atkcost(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 c100423034.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100423034.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100423034.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c100423034.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c100423034.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(4000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
--ドドドドワーフ-GG
--Scripted by mallu11
function c100423036.initial_effect(c)
--spsummon1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100423036,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100423036)
e1:SetTarget(c100423036.sptg1)
e1:SetOperation(c100423036.spop1)
c:RegisterEffect(e1)
--spsummon2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100423036,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100423136)
e2:SetCondition(c100423036.spcon2)
e2:SetTarget(c100423036.sptg2)
e2:SetOperation(c100423036.spop2)
c:RegisterEffect(e2)
end
function c100423036.spfilter(c,e,tp)
return c:IsSetCard(0x8f,0x54) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100423036.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c100423036.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100423036.spop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100423036.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100423036.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x59,0x82) and not c:IsCode(100423036)
end
function c100423036.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100423036.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c100423036.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c100423036.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(c,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e1,true)
Duel.SpecialSummonComplete()
end
end
--フューチャー・ドライブ
--Scripted by mallu11
function c100423038.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,100423038+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100423038.target)
e1:SetOperation(c100423038.activate)
c:RegisterEffect(e1)
end
function c100423038.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x207f)
end
function c100423038.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c100423038.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100423038.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c100423038.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c100423038.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not (tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsControler(tp)) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ATTACK_ALL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_START)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetOperation(c100423038.disop)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e3:SetTarget(c100423038.distg)
tc:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_BATTLE_DESTROYING)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e5:SetCondition(aux.bdocon)
e5:SetOperation(c100423038.damop)
tc:RegisterEffect(e5)
end
function c100423038.disop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
if not bc then return end
bc:RegisterFlagEffect(100423038,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE,0,1)
end
function c100423038.distg(e,c)
return c:GetFlagEffect(100423038)~=0
end
function c100423038.damop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
if not bc then return end
local dam=bc:GetBaseAttack()
if dam<0 then dam=0 end
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
--EM天空の魔術師
--Scripted by mallu11
function c100423045.initial_effect(c)
aux.EnablePendulumAttribute(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100423045,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DESTROYED)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,100423045)
e1:SetCondition(c100423045.spcon)
e1:SetTarget(c100423045.sptg)
e1:SetOperation(c100423045.spop)
c:RegisterEffect(e1)
--monster effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100423045,1))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100423145)
e2:SetCondition(c100423045.mecon)
e2:SetTarget(c100423045.metg)
e2:SetOperation(c100423045.meop)
c:RegisterEffect(e2)
if not c100423045.global_check then
c100423045.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
ge1:SetLabel(100423045)
ge1:SetOperation(aux.sumreg)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
ge2:SetLabel(100423045)
Duel.RegisterEffect(ge2,0)
end
end
function c100423045.spfilter(c,tp,rp)
return (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and rp==1-tp)) and c:IsPreviousLocation(LOCATION_MZONE)
and c:GetPreviousControler()==tp and c:GetSummonLocation()==LOCATION_EXTRA
and c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ) and c:IsFaceup()
end
function c100423045.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()==1 and eg:IsExists(c100423045.spfilter,1,nil,tp,rp)
end
function c100423045.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ec=eg:GetFirst()
if chk==0 then return (ec:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)
or (ec:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp)>0) end
Duel.SetTargetCard(ec)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,ec,1,0,0)
end
function c100423045.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=Duel.GetFirstTarget()
if ec:IsRelateToEffect(e) and Duel.SpecialSummon(ec,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.BreakEffect()
Duel.Destroy(c,REASON_EFFECT)
end
end
function c100423045.mefilter1(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
end
function c100423045.mefilter2(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM)
end
function c100423045.thfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c100423045.mecon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(100423045)>0
end
function c100423045.metg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100423045.mefilter1,tp,LOCATION_MZONE,0,1,e:GetHandler())
or (Duel.IsExistingMatchingCard(c100423045.mefilter2,tp,LOCATION_MZONE,0,1,e:GetHandler())
and Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_DECK,0,1,nil,TYPE_PENDULUM)) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100423045.meop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c100423045.mefilter1,tp,LOCATION_MZONE,0,c)
local b1=g:IsExists(Card.IsType,1,c,TYPE_FUSION)
local b2=g:IsExists(Card.IsType,1,c,TYPE_SYNCHRO)
local b3=g:IsExists(Card.IsType,1,c,TYPE_XYZ)
local b4=Duel.IsExistingMatchingCard(c100423045.mefilter2,tp,LOCATION_MZONE,0,1,e:GetHandler())
and Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_DECK,0,1,nil,TYPE_PENDULUM)
if b1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
if b2 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetValue(c100423045.actlimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
if b3 then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetValue(c:GetBaseAttack()*2)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
end
if b4 then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetCountLimit(1)
e4:SetCondition(c100423045.thcon)
e4:SetOperation(c100423045.thop)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
end
function c100423045.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER)
end
function c100423045.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c100423045.thfilter,tp,LOCATION_DECK,0,1,nil)
end
function c100423045.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,100423045)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100423045.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
--スマイル・アクション
--Scripted by mallu11
function c100423048.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c100423048.activate)
c:RegisterEffect(e1)
--disable attack
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_HANDES)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_FZONE)
e2:SetTarget(c100423048.atktg)
e2:SetOperation(c100423048.atkop)
c:RegisterEffect(e2)
e1:SetLabelObject(e2)
end
function c100423048.rmfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToRemove()
end
function c100423048.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g1=Duel.GetMatchingGroup(c100423048.rmfilter,tp,LOCATION_GRAVE,0,nil)
local g2=Duel.GetMatchingGroup(c100423048.rmfilter,tp,0,LOCATION_GRAVE,nil)
local sg=Group.CreateGroup()
if g1:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(100423048,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg1=g1:Select(tp,1,5,nil)
sg:Merge(sg1)
end
if g2:GetCount()>0 and Duel.SelectYesNo(1-tp,aux.Stringid(100423048,0)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local sg2=g2:Select(1-tp,1,5,nil)
sg:Merge(sg2)
end
if sg:GetCount()>0 then
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
local rg=sg:Filter(Card.IsLocation,nil,LOCATION_REMOVED)
rg:KeepAlive()
e:GetLabelObject():SetLabelObject(rg)
local rc=rg:GetFirst()
while rc do
rc:RegisterFlagEffect(100423048,RESET_EVENT+RESETS_STANDARD,0,1)
rc=rg:GetNext()
end
end
end
function c100423048.thfilter(c,p)
return c:GetFlagEffect(100423048)>0 and c:IsControler(p) and c:IsAbleToHand()
end
function c100423048.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,1-rp,LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,1,1-rp,LOCATION_HAND)
end
function c100423048.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject():Filter(c100423048.thfilter,nil,1-rp)
if g:GetCount()>0 and Duel.SelectYesNo(1-rp,aux.Stringid(100423048,1)) then
local flag=false
local sg=g:RandomSelect(rp,1)
local sc=sg:GetFirst()
if Duel.SendtoHand(sc,nil,REASON_EFFECT)~=0 and sc:IsLocation(LOCATION_HAND) and sc:IsControler(1-rp) then
Duel.ConfirmCards(rp,sc)
if sc:IsDiscardable() and Duel.SelectYesNo(1-rp,aux.Stringid(100423048,2)) then
flag=true
Duel.BreakEffect()
Duel.SendtoGrave(sc,REASON_EFFECT+REASON_DISCARD)
Duel.NegateAttack()
end
end
if flag==false then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(c100423048.damval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,1-rp)
end
end
end
function c100423048.damval(e,re,dam,r,rp,rc)
if bit.band(r,REASON_BATTLE)~=0 then
return dam*2
else return dam end
end
--ペンデュラム・ディメンション
--Scripted by mallu11
function c100423049.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c100423049.spcon)
e2:SetTarget(c100423049.sptg)
e2:SetOperation(c100423049.spop)
c:RegisterEffect(e2)
end
function c100423049.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ) and c:GetMaterial():IsExists(Card.IsType,1,nil,TYPE_PENDULUM)
end
function c100423049.tgfilter1(c,e,tp,eg)
return eg:IsContains(c) and c:IsFaceup() and c:IsType(TYPE_FUSION) and Duel.IsExistingMatchingCard(c100423049.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetOriginalLevel())
end
function c100423049.spfilter1(c,e,tp,lv)
return c:GetOriginalLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100423049.tgfilter2(c,tp,eg)
return eg:IsContains(c) and c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and Duel.IsExistingMatchingCard(c100423049.spfilter2,tp,LOCATION_DECK,0,1,nil)
end
function c100423049.spfilter2(c)
return c:IsCode(24094653) and c:IsAbleToHand()
end
function c100423049.tgfilter3(c,tp,eg)
return eg:IsContains(c) and c:IsFaceup() and c:IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(c100423049.spfilter3,tp,LOCATION_DECK,0,1,nil,c:GetRank())
end
function c100423049.spfilter3(c,rank)
return c:IsType(TYPE_TUNER) and c:GetLevel()<=rank and c:IsAbleToHand()
end
function c100423049.tgfilter4(c,e,tp,eg)
return eg:IsContains(c) and c:IsFaceup() and c:IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(c100423049.spfilter4,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetRank())
end
function c100423049.spfilter4(c,e,tp,rank)
return c:IsType(TYPE_TUNER) and c:GetLevel()<=rank and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100423049.spfilter5(c,e,tp,rank)
return c:IsType(TYPE_TUNER) and c:GetLevel()<=rank and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
function c100423049.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp and eg:IsExists(c100423049.cfilter,1,nil)
end
function c100423049.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local mz=Duel.GetLocationCount(tp,LOCATION_MZONE)
local b1=Duel.GetFlagEffect(tp,100423049)==0 and Duel.IsExistingMatchingCard(c100423049.tgfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp,eg) and mz>0
local b2=Duel.GetFlagEffect(tp,100423149)==0 and Duel.IsExistingMatchingCard(c100423049.tgfilter2,tp,LOCATION_MZONE,0,1,nil,tp,eg)
local b3=Duel.GetFlagEffect(tp,100423249)==0 and (Duel.IsExistingMatchingCard(c100423049.tgfilter3,tp,LOCATION_MZONE,0,1,nil,tp,eg)
or (Duel.IsExistingMatchingCard(c100423049.tgfilter4,tp,LOCATION_MZONE,0,1,nil,e,tp,eg) and mz>0))
if chk==0 then return b1 or b2 or b3 end
Duel.SetTargetCard(eg)
if b1 or b3 then
e:SetLabel(1)
local cat=e:GetCategory()
e:SetCategory(bit.bor(cat,CATEGORY_SPECIAL_SUMMON))
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
if b2 or b3 then
e:SetLabel(2)
local cat=e:GetCategory()
e:SetCategory(bit.bor(cat,CATEGORY_SEARCH+CATEGORY_TOHAND))
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
if b3 then
e:SetLabel(3)
end
end
function c100423049.spop(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local s=0
local mz=Duel.GetLocationCount(tp,LOCATION_MZONE)
if op==1 then
if Duel.GetFlagEffect(tp,100423049)~=0 then return end
Duel.RegisterFlagEffect(tp,100423049,RESET_PHASE+PHASE_END,0,1)
if mz<=0 then return end
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local lv=tc:GetOriginalLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100423049.spfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp,lv)
local gc=g:GetFirst()
if gc and Duel.SpecialSummonStep(gc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
gc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
gc:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
end
end
if op==2 then
if Duel.GetFlagEffect(tp,100423149)~=0 then return end
Duel.RegisterFlagEffect(tp,100423149,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100423049.spfilter2,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
if op==3 then
if Duel.GetFlagEffect(tp,100423249)~=0 then return end
Duel.RegisterFlagEffect(tp,100423249,RESET_PHASE+PHASE_END,0,1)
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local rank=tc:GetRank()
if mz<=0 then
local g=Duel.SelectMatchingCard(tp,c100423049.spfilter3,tp,LOCATION_DECK,0,1,1,nil,rank)
if g:GetCount()>0 then
local gc=g:GetFirst()
e:SetLabelObject(gc)
s=Duel.SelectOption(tp,1190)
end
else
local g=Duel.SelectMatchingCard(tp,c100423049.spfilter5,tp,LOCATION_DECK,0,1,1,nil,e,tp,rank)
if g:GetCount()>0 then
local gc=g:GetFirst()
e:SetLabelObject(gc)
local b1=gc:IsAbleToHand()
local b2=gc:IsCanBeSpecialSummoned(e,0,tp,false,false)
if b1 and not b2 then
s=Duel.SelectOption(tp,1190)
end
if not b1 and b2 then
s=Duel.SelectOption(tp,1152)+1
end
if b1 and b2 then
s=Duel.SelectOption(tp,1190,1152)
end
end
end
local gc=e:GetLabelObject()
if s==0 then
Duel.SendtoHand(gc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,gc)
end
if s==1 then
Duel.SpecialSummon(gc,0,tp,tp,false,false,POS_FACEUP)
end
end
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