Commit bbb84d26 authored by mercury233's avatar mercury233

update scripts

parent 8cd703ca
--鎧竜-アームド・ドラゴン-
--
--Script by pyrQ
function c100200195.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCondition(aux.bdocon)
e1:SetTarget(c100200195.sptg)
e1:SetOperation(c100200195.spop)
c:RegisterEffect(e1)
end
function c100200195.spfilter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_WIND) and c:IsLevelBelow(5)
and not c:IsCode(100200195) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100200195.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100200195.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 c100200195.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,c100200195.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
--cannot atk directly this turn
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
--破魔のカラス天狗
--
--script by pyrQ
function c100200196.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100200196)
e1:SetCondition(c100200196.descon1)
e1:SetTarget(c100200196.destg)
e1:SetOperation(c100200196.desop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c100200196.descon2)
c:RegisterEffect(e2)
end
function c100200196.descon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousControler(tp) and c:IsReason(REASON_DESTROY)
and c:IsReason(REASON_EFFECT) and rp==1-tp
end
function c100200196.descon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonLocation(LOCATION_GRAVE)
end
function c100200196.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsAttackPos() and chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(Card.IsAttackPos,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsAttackPos,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100200196.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
--陰魔羅鬼
--
--script by pyrQ
function c100200197.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100200197)
e1:SetCondition(c100200197.drcon1)
e1:SetTarget(c100200197.drtg)
e1:SetOperation(c100200197.drop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c100200197.drcon2)
c:RegisterEffect(e2)
end
function c100200197.drcon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousControler(tp) and c:IsReason(REASON_DESTROY)
and c:IsReason(REASON_EFFECT) and rp==1-tp
end
function c100200197.drcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonLocation(LOCATION_GRAVE)
end
function c100200197.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100200197.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
......@@ -29,12 +29,15 @@ function c100277001.initial_effect(c)
e2:SetValue(c100277001.mtval)
c:RegisterEffect(e2)
--
if not c100277001.global_check then
c100277001.global_check=true
if not aux.fus_mat_hack_check then
aux.fus_mat_hack_check=true
function aux.fus_mat_hack_exmat_filter(c)
return c:IsHasEffect(EFFECT_EXTRA_FUSION_MATERIAL,c:GetControler())
end
_GetFusionMaterial=Duel.GetFusionMaterial
function Duel.GetFusionMaterial(tp)
local g=_GetFusionMaterial(tp)
local exg=Duel.GetMatchingGroup(Card.IsHasEffect,tp,LOCATION_GRAVE,0,nil,EFFECT_EXTRA_FUSION_MATERIAL)
local exg=Duel.GetMatchingGroup(aux.fus_mat_hack_exmat_filter,tp,LOCATION_GRAVE,0,nil)
return g+exg
end
_SendtoGrave=Duel.SendtoGrave
......@@ -44,6 +47,11 @@ function c100277001.initial_effect(c)
end
local rg=tg:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
tg:Sub(rg)
local tc=rg:Filter(aux.fus_mat_hack_exmat_filter,nil):GetFirst()
if tc then
local te=tc:IsHasEffect(EFFECT_EXTRA_FUSION_MATERIAL,tc:GetControler())
te:UseCountLimit(tc:GetControler())
end
local ct1=_SendtoGrave(tg,reason)
local ct2=Duel.Remove(rg,POS_FACEUP,reason)
return ct1+ct2
......
--サイバー・ダーク・キメラ
--not fully implemented
--Scripted by mallu11
function c100341002.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100341002,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100341002)
e1:SetCost(c100341002.thcost)
e1:SetTarget(c100341002.thtg)
e1:SetOperation(c100341002.thop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100341002,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,100341102)
e2:SetTarget(c100341002.tgtg)
e2:SetOperation(c100341002.tgop)
c:RegisterEffect(e2)
--
if not aux.fus_mat_hack_check then
aux.fus_mat_hack_check=true
function aux.fus_mat_hack_exmat_filter(c)
return c:IsHasEffect(EFFECT_EXTRA_FUSION_MATERIAL,c:GetControler())
end
_GetFusionMaterial=Duel.GetFusionMaterial
function Duel.GetFusionMaterial(tp)
local g=_GetFusionMaterial(tp)
local exg=Duel.GetMatchingGroup(aux.fus_mat_hack_exmat_filter,tp,LOCATION_GRAVE,0,nil)
return g+exg
end
_SendtoGrave=Duel.SendtoGrave
function Duel.SendtoGrave(tg,reason)
if reason~=REASON_EFFECT+REASON_MATERIAL+REASON_FUSION or Auxiliary.GetValueType(tg)~="Group" then
return _SendtoGrave(tg,reason)
end
local rg=tg:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
tg:Sub(rg)
local tc=rg:Filter(aux.fus_mat_hack_exmat_filter,nil):GetFirst()
if tc then
local te=tc:IsHasEffect(EFFECT_EXTRA_FUSION_MATERIAL,tc:GetControler())
te:UseCountLimit(tc:GetControler())
end
local ct1=_SendtoGrave(tg,reason)
local ct2=Duel.Remove(rg,POS_FACEUP,reason)
return ct1+ct2
end
end
end
function c100341002.costfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDiscardable()
end
function c100341002.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100341002.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c100341002.costfilter,1,1,REASON_COST+REASON_DISCARD,nil)
end
function c100341002.thfilter(c)
return c:IsCode(37630732) and c:IsAbleToHand()
end
function c100341002.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100341002.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100341002.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100341002.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(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(0xff,0xff)
e1:SetTarget(c100341002.limittg)
e1:SetValue(c100341002.fuslimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(100341002,2))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_EXTRA_FUSION_MATERIAL)
e2:SetTargetRange(LOCATION_GRAVE,0)
e2:SetCountLimit(1,100341202)
e2:SetTarget(c100341002.mttg)
e2:SetValue(c100341002.fuslimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c100341002.limittg(e,c)
return not (c:IsRace(RACE_DRAGON+RACE_MACHINE) and c:IsSetCard(0x93))
end
function c100341002.fuslimit(e,c,sumtype)
if not c then return false end
return c:IsControler(e:GetHandlerPlayer())
end
function c100341002.mttg(e,c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c100341002.tgfilter(c,tp)
return c:IsSetCard(0x4093) and c:IsType(TYPE_MONSTER)
and not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,c:GetCode()) and c:IsAbleToGrave()
end
function c100341002.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100341002.tgfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c100341002.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100341002.tgfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--鎧皇竜-サイバー・ダーク・エンド・ドラゴン
--Scripted by mallu11
function c100341051.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode2(c,40418351,1546123,true,true)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.fuslimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c100341051.hspcon)
e2:SetOperation(c100341051.hspop)
c:RegisterEffect(e2)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(c100341051.efilter)
c:RegisterEffect(e3)
--equip
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(100341051,0))
e4:SetCategory(CATEGORY_EQUIP)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c100341051.eqtg)
e4:SetOperation(c100341051.eqop)
c:RegisterEffect(e4)
--multi attack
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_EXTRA_ATTACK)
e5:SetValue(c100341051.atkval)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_CANNOT_ATTACK)
e6:SetCondition(c100341051.atkcon)
c:RegisterEffect(e6)
end
function c100341051.eqspfilter(c)
return c:IsFaceup() and c:IsCode(1546123)
end
function c100341051.hspfilter(c,tp,sc)
return c:IsLevelBelow(10) and c:IsSetCard(0x4093) and c:IsFusionType(TYPE_FUSION)
and c:IsControler(tp) and c:GetEquipGroup():IsExists(c100341051.eqspfilter,1,nil) and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0 and c:IsCanBeFusionMaterial(sc,SUMMON_TYPE_SPECIAL)
end
function c100341051.hspcon(e,c)
if c==nil then return true end
return Duel.CheckReleaseGroup(c:GetControler(),c100341051.hspfilter,1,nil,c:GetControler(),c)
end
function c100341051.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,c100341051.hspfilter,1,1,nil,tp,c)
c:SetMaterial(g)
Duel.Release(g,REASON_COST)
end
function c100341051.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetHandlerPlayer() and re:IsActivated()
end
function c100341051.eqfilter(c,tp)
return c:IsType(TYPE_MONSTER) and (c:IsControler(tp) or c:IsAbleToChangeControler())
end
function c100341051.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c100341051.eqfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,PLAYER_ALL,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,PLAYER_ALL,LOCATION_GRAVE)
end
function c100341051.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsFaceup() and c:IsRelateToEffect(e)) then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100341051.eqfilter),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,tp)
local tc=g:GetFirst()
if tc then
if not Duel.Equip(tp,tc,c) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetLabelObject(c)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c100341051.eqlimit)
tc:RegisterEffect(e1)
end
end
function c100341051.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c100341051.atkval(e,c)
return e:GetHandler():GetEquipCount()-1
end
function c100341051.atkcon(e)
return e:GetHandler():GetEquipCount()==0
end
--サイバネティック・ホライゾン
--Scripted by mallu11
function c100341053.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100341053+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c100341053.cost)
e1:SetTarget(c100341053.target)
e1:SetOperation(c100341053.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(100341053,ACTIVITY_SPSUMMON,c100341053.counterfilter)
end
function c100341053.counterfilter(c)
return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsRace(RACE_MACHINE)
end
function c100341053.costfilter(c)
return c:IsRace(RACE_DRAGON+RACE_MACHINE) and c:IsSetCard(0x93) and c:IsAbleToGraveAsCost()
end
function c100341053.thfilter(c)
return c:IsRace(RACE_DRAGON+RACE_MACHINE) and c:IsSetCard(0x93) and c:IsAbleToHand()
end
function c100341053.fselect(g,tp)
local sg=g:Clone()
local res=true
for c in aux.Next(sg) do
res=res and not sg:IsExists(Card.IsAttribute,1,c,c:GetAttribute())
end
return g:GetClassCount(Card.GetLocation)==g:GetCount() and res and Duel.IsExistingMatchingCard(c100341053.thfilter,tp,LOCATION_DECK,0,1,g)
end
function c100341053.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c100341053.costfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
if chk==0 then return Duel.GetCustomActivityCount(100341053,tp,ACTIVITY_SPSUMMON)==0 and g:CheckSubGroup(c100341053.fselect,2,2,tp) 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(c100341053.splimit)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,c100341053.fselect,false,2,2,tp)
Duel.SendtoGrave(sg,REASON_COST)
end
function c100341053.splimit(e,c)
return c:IsLocation(LOCATION_EXTRA) and not c:IsRace(RACE_MACHINE)
end
function c100341053.tgfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsSetCard(0x93) and c:IsType(TYPE_FUSION) and c:IsAbleToGrave()
end
function c100341053.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100341053.thfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(c100341053.tgfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
end
function c100341053.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,c100341053.thfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100341053.tgfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
--喜劇のデスピアン
--
--Script by XyLeN
function c101105004.initial_effect(c)
--disable effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105004,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101105004)
e1:SetCondition(c101105004.discon)
e1:SetCost(c101105004.discost)
e1:SetTarget(c101105004.distg)
e1:SetOperation(c101105004.disop)
c:RegisterEffect(e1)
--special summon itself
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105004,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101105004)
e2:SetCost(c101105004.spcost)
e2:SetTarget(c101105004.sptg)
e2:SetOperation(c101105004.spop)
c:RegisterEffect(e2)
end
function c101105004.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x269) and c:IsControler(tp) and c:IsOnField()
end
function c101105004.discon(e,tp,eg,ep,ev,re,r,rp)
if not (rp==1-tp and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET)) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:IsExists(c101105004.cfilter,nil,tp) and Duel.IsChainDisablable(ev)
end
function c101105004.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c101105004.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not re:GetHandler():IsStatus(STATUS_DISABLED) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c101105004.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c101105004.rfilter(c,tp)
return c:IsType(TYPE_FUSION) and (c:IsControler(tp) or c:IsFaceup()) and Duel.GetMZoneCount(tp,c)>0
end
function c101105004.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c101105004.rfilter,1,nil,tp) end
local rg=Duel.SelectReleaseGroup(tp,c101105004.rfilter,1,1,nil,tp)
Duel.Release(rg,REASON_COST)
end
function c101105004.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 c101105004.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
--悲劇のデスピアン
--
--Script by XyLeN
function c101105005.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105005,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,101105005)
e1:SetCondition(c101105005.thcon)
e1:SetTarget(c101105005.thtg)
e1:SetOperation(c101105005.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_REMOVE)
c:RegisterEffect(e2)
--set to your field
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101105005,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,101105005)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c101105005.settg)
e3:SetOperation(c101105005.setop)
c:RegisterEffect(e3)
end
function c101105005.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function c101105005.thfilter(c)
return c:IsSetCard(0x269) and not c:IsCode(101105005) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c101105005.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105005.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101105005.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101105005.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c101105005.setfilter(c)
return c:IsSetCard(0x15d) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c101105005.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101105005.setfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101105005.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,c101105005.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function c101105005.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SSet(tp,tc)
end
end
--デスピアの導化アルベル
--
--Script by XyLeN
function c101105006.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105006,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,101105006)
e1:SetTarget(c101105006.thtg)
e1:SetOperation(c101105006.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPUMMON_SUCCESS)
c:RegisterEffect(e2)
--special summon & disable
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101105006,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,101105006)
e3:SetCondition(c101105006.spcon)
e3:SetTarget(c101105006.sptg)
e3:SetOperation(c101105006.spop)
c:RegisterEffect(e3)
end
function c101105006.thfilter(c)
return c:IsSetCard(0x15d) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c101105006.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105006.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101105006.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101105006.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c101105006.cfilter(c,tp,rp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and bit.band(c:GetPreviousTypeOnField(),TYPE_FUSION)~=0
and (c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT)))
end
function c101105006.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101105006.cfilter,1,nil,tp,rp) and not eg:IsContains(e:GetHandler())
end
function c101105006.disfilter(c)
return c:IsFaceup() and not c:IsDisabled() and c:IsType(TYPE_EFFECT)
end
function c101105006.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c101105006.disfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101105006.disfilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c101105006.disfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101105006.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
end
--デスピアの大導劇神
--
--Script by XyLeN
function c101105007.initial_effect(c)
--disable effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105007,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101105007)
e1:SetCondition(c101105007.discon)
e1:SetTarget(c101105007.distg)
e1:SetOperation(c101105007.disop)
c:RegisterEffect(e1)
--special summon itself
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105007,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCountLimit(1,101105007+100)
e2:SetCondition(c101105007.spcon)
e2:SetTarget(c101105007.sptg)
e2:SetOperation(c101105007.spop)
c:RegisterEffect(e2)
end
function c101105007.cfilter(c)
return c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK) and c:IsFaceup()
end
function c101105007.discon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101105007.cfilter,1,nil)
end
function c101105007.disfilter(c)
return c:IsFaceup() and not c:IsDisabled() and c:IsType(TYPE_EFFECT)
end
function c101105007.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101105007.disfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101105007.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,c101105007.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c101105007.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
function c101105007.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_HAND+LOCATION_ONFIELD)
and c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and r==REASON_FUSION
end
function c101105007.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 c101105007.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
--いくらの軍貫
--Roe Suship
--scripted by XyleN5967
function c101105012.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101105012)
e1:SetCondition(c101105012.sprcon)
c:RegisterEffect(e1)
--to hand or special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105012,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101105012+100)
e2:SetTarget(c101105012.target)
e2:SetOperation(c101105012.operation)
c:RegisterEffect(e2)
end
function c101105012.sprfilter(c)
return c:IsFaceup() and c:IsCode(101105011)
end
function c101105012.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101105012.sprfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c101105012.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3 end
end
function c101105012.filter(c,e,tp)
return c:IsCode(101105011) and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
function c101105012.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,3)
if #g<3 then return end
Duel.ConfirmDecktop(tp,3)
local tg=g:Filter(c101105012.filter,nil,e,tp)
if #tg>0 and Duel.SelectYesNo(tp,aux.Stringid(101105012,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg=tg:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if tc:IsAbleToHand() and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) or Duel.SelectOption(tp,1190,1152)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--機巧菟-稻羽之淤岐素
--
--Script by XyleN5967
function c101105015.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105015,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c101105015.sptg)
e1:SetOperation(c101105015.spop)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105015,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetCountLimit(1,id)
e2:SetTarget(c101105015.atktg)
e2:SetOperation(c101105015.atkop)
c:RegisterEffect(e2)
end
if Auxiliary.AtkEqualsDef==nil then
function Auxiliary.AtkEqualsDef(c)
if not c:IsType(TYPE_MONSTER) or c:IsType(TYPE_LINK) then return false end
if c:GetAttack()~=c:GetDefense() then return false end
return c:IsLocation(LOCATION_MZONE) or c:GetTextAttack()>=0 and c:GetTextDefense()>=0
end
end
function c101105015.spfilter(c,e,tp)
return aux.AtkEqualsDef(c) and c:IsRace(RACE_MACHINE)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101105015.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101105015.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c101105015.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101105015.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_DEFENSE)
end
end
function c101105015.atkfilter(c)
return c:IsFaceup() and aux.AtkEqualsDef(c) and c:IsRace(RACE_MACHINE)
end
function c101105015.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c101105015.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101105015.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c101105015.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c101105015.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 atk=0
local g=Duel.GetMatchingGroup(c101105015.atkfilter,tp,LOCATION_MZONE,0,nil)
if g:GetCount()>0 then atk=g:GetSum(Card.GetBaseAttack) end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c101105015.ftarget)
e3:SetLabel(tc:GetFieldID())
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
end
function c101105015.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
--機巧鳥-常世宇受賣長鳴
--
--Script by XyleN5967
function c101105016.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105016,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101105016)
e1:SetCost(c101105016.spcost)
e1:SetTarget(c101105016.sptg)
e1:SetOperation(c101105016.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105016,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetCountLimit(1,101105016+100)
e2:SetTarget(c101105016.thtg)
e2:SetOperation(c101105016.thop)
c:RegisterEffect(e2)
end
if Auxiliary.AtkEqualsDef==nil then
function Auxiliary.AtkEqualsDef(c)
if not c:IsType(TYPE_MONSTER) or c:IsType(TYPE_LINK) then return false end
if c:GetAttack()~=c:GetDefense() then return false end
return c:IsLocation(LOCATION_MZONE) or c:GetTextAttack()>=0 and c:GetTextDefense()>=0
end
end
function c101105016.costfilter(c,e,tp)
return aux.AtkEqualsDef(c) and c:IsRace(RACE_MACHINE) and c:GetLevel()>1
and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup())
and Duel.IsExistingMatchingCard(c101105016.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetLevel())
end
function c101105016.spfilter(c,e,tp,lv)
return aux.AtkEqualsDef(c) and c:IsRace(RACE_MACHINE)
and c:GetLevel()<lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101105016.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c101105016.costfilter,1,nil,e,tp) end
local sg=Duel.SelectReleaseGroup(tp,c101105016.costfilter,1,1,nil,e,tp)
e:SetLabel(sg:GetFirst():GetLevel())
Duel.Release(sg,REASON_COST)
end
function c101105016.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101105016.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101105016.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,e:GetLabel())
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
function c101105016.thfilter(c)
return c:IsFacedown() and aux.AtkEqualsDef(c)
and c:IsRace(RACE_MACHINE) and c:IsAbleToHand()
end
function c101105016.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105016.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
end
function c101105016.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101105016.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--機巧蛙-磐盾多邇具久
--
--Script by XyleN5967
function c101105017.initial_effect(c)
--to deck top
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105017,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,101105017)
e1:SetTarget(c101105017.tdtg)
e1:SetOperation(c101105017.tdop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--revive
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101105017,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,101105017+100)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c101105017.sptg)
e3:SetOperation(c101105017.spop)
c:RegisterEffect(e3)
end
if Auxiliary.AtkEqualsDef==nil then
function Auxiliary.AtkEqualsDef(c)
if not c:IsType(TYPE_MONSTER) or c:IsType(TYPE_LINK) then return false end
if c:GetAttack()~=c:GetDefense() then return false end
return c:IsLocation(LOCATION_MZONE) or c:GetTextAttack()>=0 and c:GetTextDefense()>=0
end
end
function c101105017.tdfilter(c)
return aux.AtkEqualsDef(c) and c:IsRace(RACE_MACHINE)
end
function c101105017.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105017.tdfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 end
end
function c101105017.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101105017,2))
local g=Duel.SelectMatchingCard(tp,c101105017.tdfilter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
Duel.ConfirmDecktop(tp,1)
end
end
function c101105017.spfilter(c,e,tp)
return c:IsRace(RACE_MACHINE) and aux.AtkEqualsDef(c)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101105017.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101105017.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101105017.spfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101105017.spfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101105017.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--機巧猪-伊服岐雹荒神
--
--Script by XyleN5967
function c101105018.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105018,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101105018)
e1:SetCondition(c101105018.spcon)
e1:SetTarget(c101105018.sptg)
e1:SetOperation(c101105018.spop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105018,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101105018+100)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101105018.tgtg)
e2:SetOperation(c101105018.tgop)
c:RegisterEffect(e2)
end
if Auxiliary.AtkEqualsDef==nil then
function Auxiliary.AtkEqualsDef(c)
if not c:IsType(TYPE_MONSTER) or c:IsType(TYPE_LINK) then return false end
if c:GetAttack()~=c:GetDefense() then return false end
return c:IsLocation(LOCATION_MZONE) or c:GetTextAttack()>=0 and c:GetTextDefense()>=0
end
end
function c101105018.cfilter(c)
return c:IsFaceup() and aux.AtkEqualsDef(c) and c:IsRace(RACE_MACHINE)
end
function c101105018.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c101105018.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c101105018.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 c101105018.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 c101105018.tcfilter(c,tp)
local lv=c:GetLevel()
return c:IsFaceup() and lv>0 and aux.AtkEqualsDef(c)
and Duel.IsExistingMatchingCard(c101105018.tgfilter,tp,LOCATION_DECK,0,1,nil,lv)
end
function c101105018.tgfilter(c,lv)
return aux.AtkEqualsDef(c) and c:GetLevel()<lv
and c:IsRace(RACE_MACHINE) and c:IsAbleToGrave()
end
function c101105018.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101105018.tcfilter(chkc,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101105018.tcfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c101105018.tcfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c101105018.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,c101105018.tgfilter,tp,LOCATION_DECK,0,1,1,nil,tc:GetLevel())
if sg:GetCount()>0 and Duel.SendtoGrave(sg,REASON_EFFECT)~=0 then
local atk=sg:GetFirst():GetLevel()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk*100)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
end
end
--驚楽園の助手 <Delia>
--scripted by XyleN5967
function c101105020.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105020,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101105020)
e1:SetCost(c101105020.spcost)
e1:SetTarget(c101105020.sptg)
e1:SetOperation(c101105020.spop)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105020,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101105020+100)
e2:SetCost(c101105020.setcost)
e2:SetTarget(c101105020.settg)
e2:SetOperation(c101105020.setop)
c:RegisterEffect(e2)
end
function c101105020.cfilter(c)
return c:IsSetCard(0x15c) and c:IsType(TYPE_TRAP) and not c:IsPublic()
end
function c101105020.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105020.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c101105020.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function c101105020.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,1,0,0)
end
function c101105020.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 c101105020.costfilter(c,ft)
return (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsType(TYPE_TRAP) and c:IsSetCard(0x15c) and c:IsAbleToGraveAsCost()
and (ft>0 or c:IsOnField() and ft>-1)
end
function c101105020.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return Duel.IsExistingMatchingCard(c101105020.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,ft) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c101105020.costfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil,ft)
Duel.SendtoGrave(g,REASON_COST)
end
function c101105020.setfilter(c,chk)
return c:IsSetCard(0x15c) and c:IsType(TYPE_TRAP) and c:IsSSetable(chk)
end
function c101105020.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105020.setfilter,tp,LOCATION_DECK,0,1,nil,true) end
end
function c101105020.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c101105020.setfilter,tp,LOCATION_DECK,0,1,1,nil,false)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst())
end
end
--エーリアン・バスター
--
--Script by XyleN5967
function c101105021.initial_effect(c)
--add counter
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105021,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,101105021)
e1:SetTarget(c101105021.cttg)
e1:SetOperation(c101105021.ctop)
c:RegisterEffect(e1)
--destroy with counter
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105021,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101105021+100)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101105021.destg)
e2:SetOperation(c101105021.desop)
c:RegisterEffect(e2)
end
c101105021.counter_add_list={0x100e}
function c101105021.ctfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER)
end
function c101105021.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c101105021.ctfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101105021.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
local g=Duel.SelectTarget(tp,c101105021.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0)
end
function c101105021.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
tc:AddCounter(0x100e,2)
end
end
function c101105021.desfilter(c)
return c:GetCounter(0x100e)>0
end
function c101105021.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c101105021.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101105021.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c101105021.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101105021.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
--森の聖獣 カルピポニカ
--
--Script by XyLeN
function c101105022.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105022,0))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,101105022)
e1:SetCondition(c101105022.spcon)
e1:SetTarget(c101105022.sptg)
e1:SetOperation(c101105022.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105022,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,101105022+100)
e2:SetTarget(c101105022.thtg)
e2:SetOperation(c101105022.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c101105022.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function c101105022.tdfilter(c)
return c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST+RACE_INSECT+RACE_PLANT)
end
function c101105022.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c101105022.tdfilter,tp,LOCATION_GRAVE,0,e:GetHandler()):Filter(Card.IsCanBeEffectTarget,nil,e)
if chkc then return false end
if chk==0 then return g:CheckSubGroup(aux.drccheck,2,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:SelectSubGroup(tp,aux.drccheck,false,2,2)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TODECK,sg,sg:GetCount(),0,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c101105022.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()<=0 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101105022.thfilter(c)
return c:IsSetCard(0x1268,0x2268) and c:IsType(TYPE_MONSTER) and not c:IsCode(101105022) and c:IsAbleToHand()
end
function c101105022.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105022.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101105022.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101105022.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 XyLeN
function c101105023.initial_effect(c)
--indestructable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105023,0))
e1:SetCategory(CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_START)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c101105023.indescon)
e1:SetCost(c101105023.indescost)
e1:SetTarget(c101105023.indestg)
e1:SetOperation(c101105023.indesop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105023,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_START)
e2:SetCost(c101105023.descost)
e2:SetTarget(c101105023.destg)
e2:SetOperation(c101105023.desop)
c:RegisterEffect(e2)
end
function c101105023.indescon(e,tp,eg,ep,ev,re,r,rp)
local a,d=Duel.GetBattleMonster(tp)
e:SetLabelObject(a)
return a and d and a:IsFaceup() and a:IsType(TYPE_NORMAL)
end
function c101105023.indescost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c101105023.indestg(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.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function c101105023.indesop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local a=e:GetLabelObject()
if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)>0 and a
and a:IsRelateToBattle() and a:IsControler(tp) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
a:RegisterEffect(e1)
end
end
function c101105023.cfilter(c)
return c:IsType(TYPE_NORMAL) and not c:IsPublic()
end
function c101105023.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105023.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c101105023.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function c101105023.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetHandler():GetBattleTarget()
if chk==0 then return tc and tc:IsControler(1-tp) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
end
function c101105023.desop(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)>0 then
local tc=e:GetHandler():GetBattleTarget()
if tc:IsRelateToBattle() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
--木花咲弥
--
--Script by Kohana Sonogami
function c101105027.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101105027+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c101105027.sprcon)
c:RegisterEffect(e1)
--spirit return
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(c101105027.retreg)
c:RegisterEffect(e2)
--act limit
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101105026,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c101105027.acttg)
e3:SetOperation(c101105027.actop)
c:RegisterEffect(e3)
end
function c101105027.sprfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPIRIT)
end
function c101105027.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101105027.sprfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c101105027.retreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(1104)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.SpiritReturnConditionForced)
e1:SetTarget(c101105027.rettg)
e1:SetOperation(c101105027.retop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(aux.SpiritReturnConditionOptional)
c:RegisterEffect(e2)
end
function c101105027.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return true
else
return e:GetHandler():IsAbleToHand()
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c101105027.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function c101105027.cfilter(c)
return c:IsType(TYPE_SPIRIT) and c:IsFaceup()
end
function c101105027.acttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101105027.cfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101105027.cfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c101105027.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c101105027.actop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--絆醒師セームベル
--
--script by REIKAI
function c101105030.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105030,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,101105030)
e1:SetCondition(c101105030.spcon)
e1:SetTarget(c101105030.sptg)
e1:SetOperation(c101105030.spop)
c:RegisterEffect(e1)
--SpecialSummon_Hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105030,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101105030+100)
e2:SetCondition(c101105030.spcon2)
e2:SetTarget(c101105030.sptg2)
e2:SetOperation(c101105030.spop2)
c:RegisterEffect(e2)
end
function c101105030.filter(c,mc)
return c:IsLevel(mc:GetLevel())
end
function c101105030.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c101105030.filter,tp,LOCATION_PZONE,0,1,e:GetHandler(),e:GetHandler())
end
function c101105030.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
local tc=Duel.GetFirstMatchingCard(c101105030.filter,tp,LOCATION_PZONE,0,c,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c101105030.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstMatchingCard(nil,tp,LOCATION_PZONE,0,c)
if tc and Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101105030.cfilter(c,tp)
return c:IsControler(tp)
end
function c101105030.spcon2(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c101105030.cfilter,1,nil,tp)
end
function c101105030.spfilter2(c,e,tp,tc)
return c:IsLevel(tc:GetLevel()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101105030.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 Duel.IsExistingMatchingCard(c101105030.spfilter2,tp,LOCATION_HAND,0,1,nil,e,tp,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c101105030.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c101105030.spfilter2,tp,LOCATION_HAND,0,1,1,nil,e,tp,c)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
--エアロピΞ
--scripted by XyLeN
function c101105031.initial_effect(c)
--sequence & move
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105031,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMING_END_PHASE+TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101105031)
e1:SetTarget(c101105031.seqtg)
e1:SetOperation(c101105031.seqop)
c:RegisterEffect(e1)
--atk & def down
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetValue(c101105031.atkval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
end
function c101105031.seqfilter(c,e,tp)
local g=e:GetHandler():GetColumnGroup()
if not (c:IsFaceup() and g:IsContains(c) and c:IsCanAddCounter(0x1162,1)) then return false end
for i=0,4 do
local s1=Duel.CheckLocation(tp,LOCATION_MZONE,i)
local s2=Duel.CheckLocation(1-tp,LOCATION_MZONE,4-i)
if s1 and s2 then return true end
end
return false
end
function c101105031.seqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c101105031.seqfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101105031.seqfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c101105031.seqfilter,tp,0,LOCATION_MZONE,1,1,nil,e,tp)
end
function c101105031.seqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or c:IsControler(1-tp) or c:IsImmuneToEffect(e)
or not tc:IsRelateToEffect(e) or tc:IsControler(tp) or tc:IsImmuneToEffect(e) then return end
local filter=0
for i=0,4 do
local s1=Duel.CheckLocation(tp,LOCATION_MZONE,i)
local s2=Duel.CheckLocation(1-tp,LOCATION_MZONE,4-i)
if s1 and s2 then
filter=filter|2^i
end
end
if filter==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local flag=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,~filter)
local seq1=math.log(flag,2)
local seq2=4-math.log(flag,2)
if Duel.MoveSequence(c,seq1)~=0 then
Duel.MoveSequence(tc,seq2)
if tc:IsFaceup() then
Duel.BreakEffect()
tc:AddCounter(0x1162,1)
end
end
end
function c101105031.atkval(e,c)
return c:GetCounter(0x1162)*-200
end
--魔鍵銃-バトスバスター
--Magikey - Bastosbuster
--scripted by XyleN5967
function c101105032.initial_effect(c)
c:EnableReviveLimit()
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105032,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,101105032)
e1:SetCondition(c101105032.srcon)
e1:SetTarget(c101105032.srtg)
e1:SetOperation(c101105032.srop)
c:RegisterEffect(e1)
--disable & draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105032,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DISABLE+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c101105032.discon)
e2:SetTarget(c101105032.distg)
e2:SetOperation(c101105032.disop)
c:RegisterEffect(e2)
end
function c101105032.srcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c101105032.srfilter(c)
return c:IsSetCard(0x266) and c:IsAbleToHand()
end
function c101105032.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105032.srfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101105032.srop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101105032.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 c101105032.cfilter(c,attr)
return (c:IsType(TYPE_NORMAL) or c:IsSetCard(0x266)) and c:IsAttribute(attr)
end
function c101105032.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
e:SetLabelObject(tc)
return tc and tc:IsFaceup() and tc:IsControler(1-tp) and tc:IsType(TYPE_MONSTER) and not tc:IsStatus(STATUS_DISABLED)
and Duel.IsExistingMatchingCard(c101105032.cfilter,tp,LOCATION_GRAVE,0,1,nil,tc:GetAttribute())
end
function c101105032.distg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=e:GetLabelObject()
if chk==0 then return Duel.IsPlayerCanDraw(tp)
and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c101105032.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetLabelObject()
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(p,Card.IsAbleToDeck,p,LOCATION_HAND,0,1,63,nil)
if g:GetCount()==0 then return end
if Duel.SendtoDeck(g,nil,1,REASON_EFFECT)~=0 and tc and tc:IsRelateToBattle() and tc:IsControler(1-tp)
and not tc:IsStatus(STATUS_DISABLED) and not tc:IsImmuneToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
tc:RegisterEffect(e2)
Duel.BreakEffect()
Duel.Draw(p,g:GetCount(),REASON_EFFECT)
end
end
--魔鍵砲-ガレスヴェート
--
--script by REIKAI
function c101105033.initial_effect(c)
c:EnableReviveLimit()
--different attr check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_MATERIAL_CHECK)
e0:SetValue(c101105033.valcheck)
c:RegisterEffect(e0)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c101105033.atkval)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105033,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101105033)
e2:SetCondition(c101105033.condition)
e2:SetTarget(c101105033.target)
e2:SetOperation(c101105033.activate)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(c101105033.matcon)
e3:SetOperation(c101105033.matop)
c:RegisterEffect(e3)
e0:SetLabelObject(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101105033,1))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,101105033+100)
e4:SetCondition(c101105033.thcon)
e4:SetTarget(c101105033.thtg)
e4:SetOperation(c101105033.thop)
c:RegisterEffect(e4)
end
function c101105033.atkval(e,c)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_MONSTER)
return g:GetClassCount(Card.GetAttribute)*300
end
function c101105033.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) and e:GetLabel()==1
end
function c101105033.matop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(101105033,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(101105033,2))
end
function c101105033.attfilter(c)
return c:GetAttribute()>0
end
function c101105033.valcheck(e,c)
local mg=c:GetMaterial()
local fg=mg:Filter(c101105033.attfilter,nil)
if fg:GetClassCount(Card.GetAttribute)>1 then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
function c101105033.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev) and e:GetHandler():GetFlagEffect(101105033)>0
and Duel.IsExistingMatchingCard(Card.IsAttribute,tp,LOCATION_GRAVE,0,1,nil,re:GetHandler():GetAttribute())
end
function c101105033.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c101105033.activate(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 c101105033.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_RITUAL)
end
function c101105033.thfilter(c,tp)
return c:IsSetCard(0x266) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c101105033.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105033.thfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101105033.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=Duel.SelectMatchingCard(tp,c101105033.thfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
if hg:GetCount()>0 then
Duel.SendtoHand(hg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,hg)
end
end
--デスピアン・クエリティス
--
--Script by XyLeN
function c101105034.initial_effect(c)
--fusion summon
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x269),c101105034.matfilter,true)
--atk change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105034,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101105034)
e1:SetCondition(c101105034.atkcon)
e1:SetTarget(c101105034.atktg)
e1:SetOperation(c101105034.atkop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105034,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,101105034+100)
e2:SetCondition(c101105034.thcon)
e2:SetTarget(c101105034.thtg)
e2:SetOperation(c101105034.thop)
c:RegisterEffect(e2)
end
function c101105034.matfilter(c)
return c:IsFusionAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_DARK)
end
function c101105034.atkcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c101105034.atkfilter(c)
return c:IsFaceup() and not (c:IsLevelAbove(8) and c:IsType(TYPE_FUSION))
end
function c101105034.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105034.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function c101105034.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c101105034.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local tc=g:GetFirst()
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c101105034.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_MZONE)
end
function c101105034.thfilter(c,e,tp,check)
return c:IsSetCard(0x269) and c:IsType(TYPE_MONSTER) or c:IsCode(68468459)
and (c:IsAbleToHand() or check and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
function c101105034.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local check=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.IsExistingMatchingCard(c101105034.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp,check) end
end
function c101105034.thop(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c101105034.thfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,check)
local tc=g:GetFirst()
if tc then
if tc:IsAbleToHand() and (not (check and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)) or Duel.SelectOption(tp,1190,1152)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--デスピアン・プロスケニオン
--
--Scripted by Rimi-Chan
function c101105035.initial_effect(c)
--fusion procedure
c:EnableReviveLimit()
aux.AddFusionProcMix(c,false,true,aux.FilterBoolFunction(Card.IsFusionSetCard,0x269),c101105035.matfilter1,c101105035.matfilter2,nil)
--special summon or banish
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105035,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCountLimit(1,101105035)
e1:SetCondition(c101105035.effcon)
e1:SetTarget(c101105035.efftg)
e1:SetOperation(c101105035.effop)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105035,1))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCountLimit(1,101105035+100)
e2:SetCondition(aux.bdocon)
e2:SetTarget(c101105035.damtg)
e2:SetOperation(c101105035.damop)
c:RegisterEffect(e2)
end
function c101105035.matfilter1(c)
return c:IsFusionAttribute(ATTRIBUTE_LIGHT)
end
function c101105035.matfilter2(c)
return c:IsFusionAttribute(ATTRIBUTE_DARK)
end
function c101105035.effcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c101105035.rmfilter(c,e,tp)
return c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK) and (c:IsAbleToRemove() or c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
function c101105035.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and c101105035.rmfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c101105035.rmfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c101105035.rmfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
end
function c101105035.effop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if aux.NecroValleyNegateCheck(tc) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (not tc:IsAbleToRemove() or Duel.SelectOption(tp,1192,1152)==1) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
end
function c101105035.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
local dam=bc:GetBaseAttack()
if bc:GetBaseAttack()<bc:GetBaseDefense() then dam=bc:GetBaseDefense() end
if chk==0 then return dam>0 end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end
function c101105035.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
--魔鍵召獣-アンシャラボラス
--
--script by REIKAI
function c101105036.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x266),c101105036.ffilter,true)
--fusion success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105036,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,101105036)
e1:SetCondition(c101105036.thcon)
e1:SetTarget(c101105036.thtg)
e1:SetOperation(c101105036.thop)
c:RegisterEffect(e1)
--Position
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105036,1))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetTarget(c101105036.sptg)
e2:SetOperation(c101105036.spop)
c:RegisterEffect(e2)
--Battle remove
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_BATTLE_DESTROY_REDIRECT)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e3)
end
function c101105036.ffilter(c)
return c:IsFusionType(TYPE_NORMAL) and not c:IsType(TYPE_TOKEN)
end
function c101105036.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c101105036.thfilter(c)
return c:IsCode(101105056) and c:IsAbleToHand()
end
function c101105036.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105036.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
end
function c101105036.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101105036.thfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
function c101105036.filter(c,tp)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsCanChangePosition()
and Duel.IsExistingMatchingCard(c101105036.gfilter,tp,LOCATION_GRAVE,0,1,nil,c:GetAttribute())
end
function c101105036.gfilter(c,att)
return c:IsAttribute(att) and (c:IsType(TYPE_NORMAL) or c:IsSetCard(0x266))
end
function c101105036.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c101105036.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c101105036.filter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUPATTACK)
local g=Duel.SelectTarget(tp,c101105036.filter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c101105036.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if tc:IsRelateToEffect(e) and tc:IsPosition(POS_FACEUP_ATTACK) and Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(-1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
--魔鍵召竜-アンドラビムス
--
--script by REIKAI
function c101105037.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,c101105037.mtfilter,c101105037.mtfilter2,true)
--different attr check
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_MATERIAL_CHECK)
e0:SetValue(c101105037.valcheck)
c:RegisterEffect(e0)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c101105037.limcon)
e1:SetOperation(c101105037.limop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_CHAIN_END)
e2:SetOperation(c101105037.limop2)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101105037,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c101105037.destg)
e3:SetOperation(c101105037.desop)
c:RegisterEffect(e3)
--Draw
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(c101105037.drcon)
e4:SetTarget(c101105037.drtg)
e4:SetOperation(c101105037.drop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetCondition(c101105037.matcon)
e5:SetOperation(c101105037.matop)
c:RegisterEffect(e5)
e0:SetLabelObject(e5)
end
function c101105037.mtfilter(c)
return c:IsFusionSetCard(0x266) and c:IsFusionType(TYPE_EFFECT)
end
function c101105037.mtfilter2(c)
return c:IsFusionType(TYPE_NORMAL) and not c:IsType(TYPE_TOKEN)
end
function c101105037.attfilter(c,rc)
return c:GetAttribute()>0
end
function c101105037.valcheck(e,c)
local mg=c:GetMaterial()
local fg=mg:Filter(c101105037.attfilter,nil,c)
if fg:GetClassCount(Card.GetAttribute)==2 then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
function c101105037.limcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c101105037.limop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()==0 then
Duel.SetChainLimitTillChainEnd(c101105037.chlimit)
elseif Duel.GetCurrentChain()==1 then
e:GetHandler():RegisterFlagEffect(101105037,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function c101105037.limop2(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(101105037)~=0 then
Duel.SetChainLimitTillChainEnd(c101105037.chlimit)
end
e:GetHandler():ResetFlagEffect(101105037)
end
function c101105037.chlimit(e,ep,tp)
return tp==ep
end
function c101105037.ckfilter(c,tp)
return (c:IsType(TYPE_NORMAL) or c:IsSetCard(0x266))
and Duel.IsExistingMatchingCard(c101105037.desfilter,tp,0,LOCATION_MZONE,1,nil,c:GetAttribute())
end
function c101105037.desfilter(c,at)
return c:IsFaceup() and c:IsAttribute(at)
end
function c101105037.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101105037.ckfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c101105037.ckfilter,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c101105037.ckfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
local tc=g:GetFirst()
local tg=Duel.GetMatchingGroup(c101105037.desfilter,tp,0,LOCATION_MZONE,nil,tc:GetAttribute())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,tg:GetCount(),0,0)
end
function c101105037.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local g=Duel.GetMatchingGroup(c101105037.desfilter,tp,0,LOCATION_MZONE,nil,tc:GetAttribute())
Duel.Destroy(g,REASON_EFFECT)
end
end
function c101105037.drfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
and Duel.IsExistingMatchingCard(Card.IsAttribute,tp,0,LOCATION_GRAVE,1,nil,c:GetAttribute())
end
function c101105037.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101105037.drfilter,1,nil,1-tp)
end
function c101105037.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function c101105037.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c101105037.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION) and e:GetLabel()==1
end
function c101105037.matop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(101105037,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(101105037,2))
end
--無の畢竟 オールヴェイン
function c101105038.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionType,TYPE_NORMAL),2,true)
end
--星風狼ウォルフライエ
--Scripted by mallu11
function c101105041.initial_effect(c)
c:SetUniqueOnField(1,0,101105041)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--attack up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(aux.chainreg)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(c101105041.atkop)
c:RegisterEffect(e2)
--to deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101105041,0))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCountLimit(1)
e3:SetCondition(c101105041.tdcon)
e3:SetTarget(c101105041.tdtg)
e3:SetOperation(c101105041.tdop)
c:RegisterEffect(e3)
end
function c101105041.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetAttack()<4000 and re:GetHandler()~=c and re:IsActiveType(TYPE_MONSTER) and c:GetFlagEffect(1)>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
end
function c101105041.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsAttackAbove(4000)
end
function c101105041.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_MZONE,nil)
if chk==0 then return c:IsAbleToDeck() and g:GetCount()>0 end
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c101105041.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
g:AddCard(c)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end
end
--弩級軍貫-いくら型一番艦
--Dreadnought Suship – Roe-class First Wardish
--scripted by XyleN5967
function c101105043.initial_effect(c)
--xyz procedure
aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
--apply the effect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105043,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,101105043)
e1:SetCondition(c101105043.effcon)
e1:SetTarget(c101105043.efftg)
e1:SetOperation(c101105043.effop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105043,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c101105043.descon)
e2:SetTarget(c101105043.destg)
e2:SetOperation(c101105043.desop)
c:RegisterEffect(e2)
end
function c101105043.effcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function c101105043.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local chk1=c:GetMaterial():FilterCount(Card.IsCode,nil,101105011)>0
local chk2=c:GetMaterial():FilterCount(Card.IsCode,nil,101105012)>0
if chk==0 then return (chk1 and Duel.IsPlayerCanDraw(tp,1) or chk2) end
if chk1 then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
end
function c101105043.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chk1=c:GetMaterial():FilterCount(Card.IsCode,nil,101105011)>0
local chk2=c:GetMaterial():FilterCount(Card.IsCode,nil,101105012)>0
if chk1 then
Duel.Draw(tp,1,REASON_EFFECT)
end
if chk2 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
function c101105043.descon(e,tp,eg,ep,ev,re,r,rp)
local rc=eg:GetFirst()
return ep~=tp and rc:IsControler(tp) and rc:IsSetCard(0x267) and rc:IsSummonLocation(LOCATION_EXTRA)
end
function c101105043.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101105043.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
--黒熔龍騎ヴォルニゲシュ
--
--Script by XyleN5967
function c101105045.initial_effect(c)
--xyz procedure
aux.AddXyzProcedure(c,nil,7,2)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105045,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetCondition(c101105045.nomatcon)
e1:SetCost(c101105045.descost)
e1:SetTarget(c101105045.destg)
e1:SetOperation(c101105045.desop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(c101105045.matcon)
c:RegisterEffect(e2)
end
function c101105045.nomatcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return not c:GetOverlayGroup():IsExists(Card.IsRace,1,nil,RACE_DRAGON)
end
function c101105045.matcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetOverlayGroup():IsExists(Card.IsRace,1,nil,RACE_DRAGON)
end
function c101105045.descost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,2,REASON_COST) and c:GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
c:RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c101105045.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101105045.checkfilter(c)
return c:GetPreviousTypeOnField()&TYPE_MONSTER~=0
end
function c101105045.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Destroy(tc,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
if og:IsExists(c101105045.checkfilter,1,nil) and #g>0
and Duel.SelectYesNo(tp,aux.Stringid(101105045,1)) then
if tc:IsType(TYPE_XYZ) then atk=tc:GetOriginalRank() else atk=tc:GetOriginalLevel() end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101105045,2))
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
local tc=sg:GetFirst()
if tc then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk*300)
e1:SetReset(RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e1)
end
end
end
end
--告天子竜パイレン
--Script by XyLeN
function c101105046.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,6,2)
--indestructable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
e1:SetCondition(c101105046.indescon)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101105046,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,101105046)
e3:SetCost(c101105046.spcost)
e3:SetTarget(c101105046.sptg)
e3:SetOperation(c101105046.spop)
c:RegisterEffect(e3)
end
function c101105046.indesfilter(c)
return c:IsSummonLocation(LOCATION_GRAVE) and (c:IsFacedown() or not c:IsCode(101105046))
end
function c101105046.indescon(e)
return Duel.IsExistingMatchingCard(c101105046.indesfilter,e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function c101105046.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c101105046.spfilter(c,e,tp)
return c:IsLevelBelow(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101105046.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101105046.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101105046.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101105046.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101105046.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--宇宙鋏ゼロオル
--
--Script by XyleN5967
function c101105047.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_REPTILE),2)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105047,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,101105047)
e1:SetCondition(c101105047.thcon)
e1:SetTarget(c101105047.thtg)
e1:SetOperation(c101105047.thop)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105047,1))
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101105047+100)
e2:SetCost(c101105047.sumcost)
e2:SetTarget(c101105047.sumtg)
e2:SetOperation(c101105047.sumop)
c:RegisterEffect(e2)
--act limit & def position
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_POSITION)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetTarget(c101105047.actg)
e3:SetValue(POS_FACEUP_DEFENSE)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_TRIGGER)
e4:SetValue(aux.TRUE)
c:RegisterEffect(e4)
end
function c101105047.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c101105047.thfilter(c)
return aux.IsCounterAdded(c,0x100e) and c:IsAbleToHand()
end
function c101105047.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105047.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101105047.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101105047.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c101105047.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x100e,2,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x100e,2,REASON_COST)
end
function c101105047.sumfilter(c)
return c:IsRace(RACE_REPTILE) and c:IsSummonable(true,nil)
end
function c101105047.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105047.sumfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c101105047.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c101105047.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc and tc:IsRace(RACE_REPTILE) and tc:IsSummonable(true,nil) then
Duel.Summon(tp,tc,true,nil)
end
end
function c101105047.actg(e,c)
return c:IsFaceup() and c:GetCounter(0x100e)>0
end
--烙印劇城デスピア
--
--Script by XyLeN
function c101105053.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--fusion summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105053,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,101105053)
e2:SetTarget(c101105053.fustg)
e2:SetOperation(c101105053.fusop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101105053,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,101105053+100)
e3:SetCondition(c101105053.spcon)
e3:SetTarget(c101105053.sptg)
e3:SetOperation(c101105053.spop)
c:RegisterEffect(e3)
end
function c101105053.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c101105053.filter2(c,e,tp,m,f,chkf)
return c:IsLevelAbove(8) and c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c101105053.fustg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(c101105053.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c101105053.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c101105053.fusop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c101105053.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c101105053.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c101105053.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function c101105053.cfilter(c,tp,rp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp)
and c:GetPreviousRaceOnField()&RACE_FAIRY~=0 and c:GetPreviousTypeOnField()&TYPE_FUSION==0
and (c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT)))
end
function c101105053.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101105053.cfilter,1,nil,tp,rp)
end
function c101105053.spfilter(c,e,tp)
return c:IsType(TYPE_FUSION) and c:IsLevelAbove(8) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101105053.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101105053.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101105053.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101105053.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101105053.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--烙印開幕
--
--Scripted by Rimi-Chan
function c101105054.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101105054)
e1:SetTarget(c101105054.target)
e1:SetOperation(c101105054.activate)
c:RegisterEffect(e1)
--avoid destruction
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101105054+100)
e2:SetTarget(c101105054.reptg)
e2:SetValue(c101105054.repval)
e2:SetOperation(c101105054.repop)
c:RegisterEffect(e2)
end
function c101105054.selfilter(c,e,tp,check)
return c:IsSetCard(0x269) and c:IsType(TYPE_MONSTER)
and (c:IsAbleToHand() or check and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE))
end
function c101105054.target(e,tp,eg,ep,ev,re,r,rp,chk)
local check=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c101105054.selfilter,tp,LOCATION_DECK,0,1,nil,check) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function c101105054.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)~=0 then
Duel.BreakEffect()
local check=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c101105054.selfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,check)
local tc=g:GetFirst()
if check and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (not tc:IsAbleToHand() or Duel.SelectOption(tp,1190,1152)==1) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c101105054.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c101105054.splimit(e,c)
return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_FUSION)
end
function c101105054.repfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_MZONE)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c101105054.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(c101105054.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c101105054.repval(e,c)
return c101105054.repfilter(c,e:GetHandlerPlayer())
end
function c101105054.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
--魔鍵-マフテア
--
--Script by mercury233
function c101105056.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c101105056.target)
e1:SetOperation(c101105056.activate)
c:RegisterEffect(e1)
end
function c101105056.exconfilter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL)
end
function c101105056.excon(tp)
return Duel.IsExistingMatchingCard(c101105056.exconfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c101105056.ffilter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c101105056.ffilter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x266) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c101105056.fexfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end
function c101105056.rfilter(c,e,tp)
return c:IsSetCard(0x266)
end
function c101105056.rexfilter(c)
return c:IsType(TYPE_NORMAL) and c:IsLevelAbove(1) and c:IsAbleToGrave()
end
function c101105056.frcheck(tp,sg,fc)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<=1
end
function c101105056.gcheck(sg)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<=1
end
function c101105056.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local fmg1=Duel.GetFusionMaterial(tp)
if c101105056.excon(tp) then
local fmg2=Duel.GetMatchingGroup(c101105056.fexfilter,tp,LOCATION_DECK,0,nil)
if fmg2:GetCount()>0 then
fmg1:Merge(fmg2)
aux.FCheckAdditional=c101105056.frcheck
aux.GCheckAdditional=c101105056.gcheck
end
end
local res=Duel.IsExistingMatchingCard(c101105056.ffilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,fmg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local fmg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c101105056.ffilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,fmg3,mf,chkf)
end
end
if not res then
local rmg1=Duel.GetRitualMaterial(tp)
local rmg2
if c101105056.excon(tp) then
rmg2=Duel.GetMatchingGroup(c101105056.rexfilter,tp,LOCATION_DECK,0,nil)
end
aux.RCheckAdditional=c101105056.frcheck
aux.RGCheckAdditional=c101105056.rgcheck
res=Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,1,nil,c101105056.rfilter,e,tp,rmg1,rmg2,Card.GetLevel,"Greater")
aux.RCheckAdditional=nil
aux.RGCheckAdditional=nil
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_EXTRA)
end
function c101105056.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local fmg1=Duel.GetFusionMaterial(tp):Filter(c101105056.ffilter1,nil,e)
local exmat=false
if c101105056.excon(tp) then
local fmg2=Duel.GetMatchingGroup(c101105056.fexfilter,tp,LOCATION_DECK,0,nil)
if fmg2:GetCount()>0 then
fmg1:Merge(fmg2)
exmat=true
end
end
if exmat then
aux.FCheckAdditional=c101105056.frcheck
aux.GCheckAdditional=c101105056.gcheck
end
local fsg1=Duel.GetMatchingGroup(c101105056.ffilter2,tp,LOCATION_EXTRA,0,nil,e,tp,fmg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
local fmg3=nil
local fsg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
fmg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
fsg2=Duel.GetMatchingGroup(c101105056.ffilter2,tp,LOCATION_EXTRA,0,nil,e,tp,fmg3,mf,chkf)
end
local rmg1=Duel.GetRitualMaterial(tp)
local rmg2
if c101105056.excon(tp) then
rmg2=Duel.GetMatchingGroup(c101105056.rexfilter,tp,LOCATION_DECK,0,nil)
end
aux.RCheckAdditional=c101105056.frcheck
aux.RGCheckAdditional=c101105056.rgcheck
local rsg=Duel.GetMatchingGroup(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,nil,c101105056.rfilter,e,tp,rmg1,rmg2,Card.GetLevel,"Greater")
local off=1
local ops={}
local opval={}
if fsg1:GetCount()>0 or (fsg2~=nil and fsg2:GetCount()>0) then
ops[off]=aux.Stringid(101105056,0)
opval[off-1]=1
off=off+1
end
if rsg:GetCount()>0 then
ops[off]=aux.Stringid(101105056,1)
opval[off-1]=2
off=off+1
end
if off==1 then return end
local op=Duel.SelectOption(tp,table.unpack(ops))
if opval[op]==1 then
local sg=fsg1:Clone()
if fsg2 then sg:Merge(fsg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=sg:Select(tp,1,1,nil):GetFirst()
fmg1:RemoveCard(tc)
if fsg1:IsContains(tc) and (fsg2==nil or not fsg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
if exmat then
aux.FCheckAdditional=c101105056.frcheck
aux.GCheckAdditional=c101105056.gcheck
end
local mat1=Duel.SelectFusionMaterial(tp,tc,fmg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,fmg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=rsg:Select(tp,1,1,nil):GetFirst()
aux.RCheckAdditional=c101105056.frcheck
aux.RGCheckAdditional=c101105056.rgcheck
local rmg=rmg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if rmg2 then rmg:Merge(rmg2) end
if tc.mat_filter then
rmg=rmg:Filter(tc.mat_filter,tc,tp)
else
rmg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=rmg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then
aux.RCheckAdditional=nil
aux.RGCheckAdditional=nil
return
end
tc:SetMaterial(mat)
local dmat=mat:Filter(Card.IsLocation,nil,LOCATION_DECK)
if dmat:GetCount()>0 then
mat:Sub(dmat)
Duel.SendtoGrave(dmat,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
end
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
aux.RCheckAdditional=nil
aux.RGCheckAdditional=nil
end
end
--魔鍵施解
--Magikey - Unsealing
--scripted by XyleN5967
function c101105057.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101105057+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c101105057.activate)
c:RegisterEffect(e1)
--indestructable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c101105057.indtg)
e2:SetValue(c101105057.indct)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101105057,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,101105057+100)
e3:SetTarget(c101105057.thtg)
e3:SetOperation(c101105057.thop)
c:RegisterEffect(e3)
end
function c101105057.filter(c)
return c:IsSetCard(0x266) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c101105057.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c101105057.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(101105057,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c101105057.indtg(e,c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL) and not c:IsType(TYPE_TOKEN)
end
function c101105057.indct(e,re,r,rp)
if bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 then
return 1
else return 0 end
end
function c101105057.thfilter(c)
return c:IsCode(101105056) and c:IsAbleToHand()
end
function c101105057.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c101105057.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function c101105057.thop(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetFirstMatchingCard(c101105057.thfilter,tp,LOCATION_DECK,0,nil)
if tg and Duel.SendtoHand(tg,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,tg)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoDeck(sg,nil,1,REASON_EFFECT)
end
end
--軍貫処『海せん』
--
--Script by mercury233
function c101105058.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--to deck top
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105058,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetCondition(c101105058.dtcon)
e2:SetTarget(c101105058.dttg)
e2:SetOperation(c101105058.dtop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--pay and spsummon
local e4=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101105058,2))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1)
e4:SetCondition(c101105058.spcon)
e4:SetTarget(c101105058.sptg)
e4:SetOperation(c101105058.spop)
c:RegisterEffect(e4)
end
function c101105058.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x267) and c:IsSummonPlayer(tp)
end
function c101105058.dtcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101105058.cfilter,1,nil,tp)
end
function c101105058.dttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1
and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,nil,0x267) end
end
function c101105058.dtop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101105058,1))
local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK,0,1,1,nil,0x267)
local tc=g:GetFirst()
if tc then
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
Duel.ConfirmDecktop(tp,1)
end
end
function c101105058.cfilter2(c,tp)
return c:IsSummonLocation(LOCATION_EXTRA) and c:IsPreviousSetCard(0x267) and c:GetReasonPlayer()==1-tp
and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
end
function c101105058.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101105058.cfilter2,1,nil,tp)
end
function c101105058.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tg=eg:Filter(c101105058.cfilter2,nil,tp)
local def=tg:GetSum(Card.GetPreviousDefenseOnField)
e:SetLabel(def)
end
function c101105058.spfilter(c,e,tp)
return c:IsCode(101105011) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(c101105058.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function c101105058.xyzfilter(c,e,tp,mc)
return c:IsSetCard(0x267) and mc:IsCanBeXyzMaterial(c) and c:IsType(TYPE_XYZ)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c101105058.spop(e,tp,eg,ep,ev,re,r,rp)
local def=math.min(e:GetLabel(),Duel.GetLP(1-tp))
if def==0 then return end
Duel.PayLPCost(1-tp,def)
if Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c101105058.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(101105058,3)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g1=Duel.SelectMatchingCard(tp,c101105058.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,c101105058.xyzfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,g1:GetFirst())
local tc=g2:GetFirst()
tc:SetMaterial(g1)
Duel.Overlay(tc,g1)
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
--機巧伝-神使記紀図
--
--Script by XyleN5967
function c101105060.initial_effect(c)
c:EnableCounterPermit(0x161,LOCATION_FZONE)
--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(101105060,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,101105060)
e2:SetTarget(c101105060.thtg)
e2:SetOperation(c101105060.thop)
c:RegisterEffect(e2)
--counter
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_FZONE)
e3:SetCondition(c101105060.countercon)
e3:SetOperation(c101105060.counterop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e4)
--act limit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_TRIGGER)
e5:SetRange(LOCATION_FZONE)
e5:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e5:SetCondition(c101105060.actlimitcon)
e5:SetTarget(c101105060.actlimittg)
c:RegisterEffect(e5)
end
if Auxiliary.AtkEqualsDef==nil then
function Auxiliary.AtkEqualsDef(c)
if not c:IsType(TYPE_MONSTER) or c:IsType(TYPE_LINK) then return false end
if c:GetAttack()~=c:GetDefense() then return false end
return c:IsLocation(LOCATION_MZONE) or c:GetTextAttack()>=0 and c:GetTextDefense()>=0
end
end
function c101105060.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=3 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function c101105060.thfilter(c)
return aux.AtkEqualsDef(c) and c:IsRace(RACE_MACHINE) and c:IsAbleToHand()
end
function c101105060.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<3 then return end
Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3)
if g:GetCount()>0 then
Duel.DisableShuffleCheck()
if g:IsExists(c101105060.thfilter,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(101105060,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:FilterSelect(tp,c101105060.thfilter,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
g:Sub(sg)
end
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT+REASON_REVEAL)
end
end
function c101105060.cfilter(c)
return aux.AtkEqualsDef(c) and c:IsRace(RACE_MACHINE) and c:IsFaceup()
end
function c101105060.countercon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101105060.cfilter,1,nil)
end
function c101105060.counterop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x161,1)
end
function c101105060.actlimitcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0x161)>=10
end
function c101105060.actlimittg(e,c)
return c:GetAttack()~=c:GetDefense()
end
--古代遺跡の静粛
--
--Script by mercury233
function c101105063.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105063,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_MOVE)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,101105063)
e2:SetCondition(c101105063.thcon)
e2:SetTarget(c101105063.thtg)
e2:SetOperation(c101105063.thop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101105063,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,101105063+100)
e3:SetCondition(c101105063.spcon)
e3:SetTarget(c101105063.sptg)
e3:SetOperation(c101105063.spop)
c:RegisterEffect(e3)
end
function c101105063.cfilter(c)
return c:IsLocation(LOCATION_SZONE) and c:GetSequence()==5 and c:IsType(TYPE_FIELD) and c:IsFaceup()
end
function c101105063.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101105063.cfilter,1,nil) and not eg:IsContains(e:GetHandler())
end
function c101105063.thfilter(c)
return c:IsSetCard(0xe2) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsCode(101105063) and c:IsAbleToHand()
end
function c101105063.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105063.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101105063.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101105063.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c101105063.desfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousRaceOnField()&RACE_ROCK~=0
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c101105063.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101105063.desfilter,1,nil,tp)
end
function c101105063.spfilter(c,e,tp,eg)
return c:IsSetCard(0xe2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not eg:IsExists(Card.IsCode,1,nil,c:GetCode())
end
function c101105063.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=eg:Filter(c101105063.desfilter,nil,tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101105063.filter,tp,LOCATION_DECK,0,1,nil,e,tp,g)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101105063.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=eg:Filter(c101105063.desfilter,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c101105063.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,g)
if tg:GetCount()>0 then
Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP)
end
end
--二量合成
--
--Script by mercury233
function c101105064.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101105064,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101105064)
e1:SetTarget(c101105064.target)
e1:SetOperation(c101105064.activate)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105064,3))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,101105064+100)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101105064.atktg)
e2:SetOperation(c101105064.atkop)
c:RegisterEffect(e2)
end
function c101105064.thfilter1(c)
return c:IsCode(65959844) and c:IsAbleToHand()
end
function c101105064.thfilter2(c)
return c:IsCode(25669282) and c:IsAbleToHand()
end
function c101105064.thfilter3(c)
return c:IsSetCard(0xeb) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c101105064.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c101105064.thfilter1,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c101105064.thfilter2,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(c101105064.thfilter3,tp,LOCATION_DECK,0,1,nil)
if chk==0 then return b1 or b2 end
local off=1
local ops={}
local opval={}
if b1 then
ops[off]=aux.Stringid(101105064,1)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(101105064,2)
opval[off-1]=2
off=off+1
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
local op=Duel.SelectOption(tp,table.unpack(ops))
local res=opval[op]
e:SetLabel(res)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,res,tp,LOCATION_DECK)
end
function c101105064.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101105064.thfilter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
else
if Duel.IsExistingMatchingCard(c101105064.thfilter2,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(c101105064.thfilter3,tp,LOCATION_DECK,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=Duel.SelectMatchingCard(tp,c101105064.thfilter2,tp,LOCATION_DECK,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(tp,c101105064.thfilter3,tp,LOCATION_DECK,0,1,1,nil)
g1:Merge(g2)
Duel.SendtoHand(g1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g1)
end
end
end
function c101105064.tgfilter(c,e)
return c:IsFaceup() and c:IsCanBeEffectTarget(e)
end
function c101105064.atkfilter(c)
return c:GetAttack()>0 and c:GetBaseAttack()>0
end
function c101105064.tgcheck(g)
return g:IsExists(Card.IsDualState,1,nil) and g:IsExists(c101105064.atkfilter,1,nil)
end
function c101105064.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(c101105064.tgfilter,tp,LOCATION_MZONE,0,nil,e)
if chk==0 then return g:CheckSubGroup(c101105064.tgcheck,2,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sg=g:SelectSubGroup(tp,c101105064.tgcheck,false,2,2)
Duel.SetTargetCard(sg)
end
function c101105064.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e):Filter(Card.IsFaceup,nil)
if #g<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101105064,4))
local g1=g:FilterSelect(tp,c101105064.atkfilter,1,1,nil)
if #g1<1 then return end
local tc1=g1:GetFirst()
local tc2=(g-g1):GetFirst()
if tc1:IsImmuneToEffect(e) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(0)
tc1:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(tc1:GetBaseAttack())
tc2:RegisterEffect(e2)
end
--高尚儀式術
--
--Script by mercury233
function c101105065.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101105065+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101105065.target)
e1:SetOperation(c101105065.activate)
c:RegisterEffect(e1)
end
function c101105065.matfilter(c)
return c:IsType(TYPE_NORMAL) and not c:IsLocation(LOCATION_MZONE)
end
function c101105065.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp):Filter(c101105065.matfilter,nil)
return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_DECK,0,1,nil,nil,e,tp,mg,nil,Card.GetLevel,"Equal")
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101105065.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp):Filter(c101105065.matfilter,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_DECK,0,1,1,nil,nil,e,tp,mg,nil,Card.GetLevel,"Equal")
local tc=g:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Equal")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Equal")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
if Duel.SpecialSummonStep(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP) then
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(101105065,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c101105065.tdcon)
e1:SetOperation(c101105065.tdop)
Duel.RegisterEffect(e1,tp)
tc:CompleteProcedure()
end
Duel.SpecialSummonComplete()
end
end
function c101105065.tdcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=1-tp then return false end
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(101105065)==e:GetLabel() then
return true
else
e:Reset()
return false
end
end
function c101105065.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
--簡素融合
function c101105066.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101105066+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c101105066.cost)
e1:SetTarget(c101105066.target)
e1:SetOperation(c101105066.activate)
c:RegisterEffect(e1)
end
function c101105066.cost(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 c101105066.filter(c,e,tp)
return c:IsType(TYPE_FUSION) and not c:IsType(TYPE_EFFECT) and c:IsLevelBelow(6) and c:CheckFusionMaterial()
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c101105066.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL)
and Duel.IsExistingMatchingCard(c101105066.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c101105066.activate(e,tp,eg,ep,ev,re,r,rp)
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101105066.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if not tc then return end
tc:SetMaterial(nil)
if Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
tc:RegisterFlagEffect(101105066,RESET_EVENT+RESETS_STANDARD,0,1)
tc:CompleteProcedure()
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetLabelObject(tc)
e2:SetCondition(c101105066.descon)
e2:SetOperation(c101105066.desop)
Duel.RegisterEffect(e2,tp)
end
end
function c101105066.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(101105066)~=0 then
return true
else
e:Reset()
return false
end
end
function c101105066.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT)
end
--ペンデュラム・トレジャー
--
--Script by XyLeN
function c101105068.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOEXTRA)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101105068+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101105068.target)
e1:SetOperation(c101105068.activate)
c:RegisterEffect(e1)
end
function c101105068.filter(c)
return c:IsType(TYPE_PENDULUM)
end
function c101105068.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101105068.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,nil,1,tp,LOCATION_DECK)
end
function c101105068.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101105068,0))
local g=Duel.SelectMatchingCard(tp,c101105068.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoExtraP(g,tp,REASON_EFFECT)
end
end
--繋がれし魔鍵
--
--Script by mercury233
function c101105072.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(c101105072.target)
e1:SetOperation(c101105072.activate)
c:RegisterEffect(e1)
end
function c101105072.thfilter(c)
return (c:IsType(TYPE_NORMAL) or c:IsSetCard(0x266)) and c:IsAbleToHand()
end
function c101105072.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101105072.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101105072.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c101105072.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c101105072.ffilter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c101105072.ffilter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x266) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false,POS_FACEUP_DEFENSE) and c:CheckFusionMaterial(m,nil,chkf)
end
function c101105072.rfilter(c,e,tp)
return c:IsSetCard(0x266) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true,POS_FACEUP_DEFENSE)
end
function c101105072.activate(e,tp,eg,ep,ev,re,r,rp)
local th=Duel.GetFirstTarget()
if not th:IsRelateToEffect(e) or Duel.SendtoHand(th,nil,REASON_EFFECT)==0 or not th:IsLocation(LOCATION_HAND) then return end
local chkf=tp
local fmg1=Duel.GetFusionMaterial(tp):Filter(c101105072.ffilter1,nil,e)
local fsg1=Duel.GetMatchingGroup(c101105072.ffilter2,tp,LOCATION_EXTRA,0,nil,e,tp,fmg1,nil,chkf)
local fmg2=nil
local fsg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
fmg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
fsg2=Duel.GetMatchingGroup(c101105072.ffilter2,tp,LOCATION_EXTRA,0,nil,e,tp,fmg2,mf,chkf)
end
local rmg1=Duel.GetRitualMaterial(tp)
local rsg=Duel.GetMatchingGroup(aux.RitualUltimateFilter,tp,LOCATION_HAND,0,nil,c101105072.rfilter,e,tp,rmg1,nil,Card.GetLevel,"Greater")
local off=1
local ops={}
local opval={}
ops[off]=aux.Stringid(101105072,0)
opval[off-1]=0
off=off+1
if fsg1:GetCount()>0 or (fsg2~=nil and fsg2:GetCount()>0) then
ops[off]=aux.Stringid(101105072,1)
opval[off-1]=1
off=off+1
end
if rsg:GetCount()>0 then
ops[off]=aux.Stringid(101105072,2)
opval[off-1]=2
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
if opval[op]==1 then
Duel.BreakEffect()
local sg=fsg1:Clone()
if fsg2 then sg:Merge(fsg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=sg:Select(tp,1,1,nil):GetFirst()
fmg1:RemoveCard(tc)
if fsg1:IsContains(tc) and (fsg2==nil or not fsg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,fmg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP_DEFENSE)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,fmg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
elseif opval[op]==2 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=rsg:Select(tp,1,1,nil):GetFirst()
local rmg=rmg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc.mat_filter then
rmg=rmg:Filter(tc.mat_filter,tc,tp)
else
rmg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=rmg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP_DEFENSE)
tc:CompleteProcedure()
end
end
--魔鍵錠-解-
--Magikey Unlocked
--scripted by XyleN5967
function c101105073.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,101105073+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c101105073.condition)
e1:SetTarget(c101105073.target)
e1:SetOperation(c101105073.activate)
c:RegisterEffect(e1)
end
function c101105073.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x266) and (c:IsType(TYPE_RITUAL) or c:IsSummonLocation(LOCATION_EXTRA))
end
function c101105073.condition(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(c101105073.cfilter,tp,LOCATION_MZONE,0,1,nil) then return false end
return ep~=tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c101105073.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c101105073.attfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER)
end
function c101105073.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.NegateActivation(ev)~=0 and re:GetHandler():IsRelateToEffect(re) and Duel.Destroy(eg,REASON_EFFECT)
and Duel.SelectYesNo(tp,aux.Stringid(101105073,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local attr=Duel.AnnounceAttribute(tp,1,ATTRIBUTE_ALL)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(attr)
Duel.RegisterEffect(e1,tp)
end
end
--きまぐれ軍貫握り
--
--Script by XyleN5967
function c101105074.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c101105074.cost)
e1:SetTarget(c101105074.target)
e1:SetOperation(c101105074.activate)
c:RegisterEffect(e1)
--to deck & draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105074,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101105074.tdtg)
e2:SetOperation(c101105074.tdop)
c:RegisterEffect(e2)
end
function c101105074.cfilter(c)
return c:IsCode(101105011) and not c:IsPublic()
end
function c101105074.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c101105074.cfilter,tp,LOCATION_HAND,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(101105074,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=g:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp)
e:SetLabel(1)
else
e:SetLabel(0)
end
end
function c101105074.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x267) and c:IsAbleToHand()
end
function c101105074.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c101105074.thfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then return g:GetCount()>=3 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function c101105074.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c101105074.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>=3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sg=g:Select(tp,3,3,nil)
Duel.ConfirmCards(1-tp,sg)
local p=1-tp
if e:GetLabel()==1 then p=tp end
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
local tg=sg:Select(p,1,1,nil)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function c101105074.tdfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x267) and c:IsAbleToDeck()
end
function c101105074.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101105074.tdfilter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.IsExistingTarget(c101105074.tdfilter,tp,LOCATION_GRAVE,0,3,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c101105074.tdfilter,tp,LOCATION_GRAVE,0,3,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c101105074.tdop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)==0 then return end
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct>0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--A・∀・VV
--
--Script by XyleN5967
function c101105076.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:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(c101105076.cost)
e1:SetTarget(c101105076.target)
e1:SetOperation(c101105076.operation)
c:RegisterEffect(e1)
--negate attack
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101105076,0))
e2:SetCategory(CATEGORY_CONTROL)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(c101105076.nacon)
e2:SetTarget(c101105076.natg)
e2:SetOperation(c101105076.naop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101105076,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c101105076.thcon)
e3:SetTarget(c101105076.thtg)
e3:SetOperation(c101105076.thop)
c:RegisterEffect(e3)
end
function c101105076.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_REMAIN_FIELD)
e1:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_DISABLED)
e2:SetOperation(c101105076.tgop)
e2:SetLabel(cid)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
function c101105076.tgop(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
if cid~=e:GetLabel() then return end
if e:GetOwner():IsRelateToChain(ev) then
e:GetOwner():CancelToGrave(false)
end
end
function c101105076.filter(c,tp)
return c:IsFaceup() and (c:IsSetCard(0x15b) or c:IsControler(1-tp))
end
function c101105076.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101105076.filter(chkc,tp) end
if chk==0 then return e:IsHasType(EFFECT_TYPE_ACTIVATE)
and Duel.IsExistingTarget(c101105076.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c101105076.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c101105076.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if c:IsRelateToEffect(e) and not c:IsStatus(STATUS_LEAVE_CONFIRMED) then
Duel.Equip(tp,c,tc)
--eqlimit
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(c101105076.eqlimit)
c:RegisterEffect(e1)
end
elseif c:IsRelateToEffect(e) and not c:IsStatus(STATUS_LEAVE_CONFIRMED) then
c:CancelToGrave(false)
end
end
function c101105076.eqlimit(e,c)
return c:IsSetCard(0x15b) or c:IsControler(1-e:GetHandlerPlayer())
end
function c101105076.nacon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
local ec=e:GetHandler():GetEquipTarget()
return at:GetControler()~=tp and ec and ec:IsControler(tp)
end
function c101105076.natg(e,tp,eg,ep,ev,re,r,rp,chk)
local ec=e:GetHandler():GetEquipTarget()
if chk==0 then return ec and ec:IsControlerCanBeChanged() end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,ec,1,0,0)
end
function c101105076.naop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local ec=e:GetHandler():GetEquipTarget()
if Duel.NegateAttack()~=0 and ec then
Duel.GetControl(ec,1-tp,PHASE_BATTLE,1)
end
end
function c101105076.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=e:GetHandler():GetEquipTarget()
local rc=re:GetHandler()
return ec and ec:IsControler(1-tp) and ec==rc and re:IsActiveType(TYPE_MONSTER)
end
function c101105076.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ec=e:GetHandler():GetEquipTarget()
if chk==0 then return ec and ec:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,ec,1,0,0)
end
function c101105076.thop(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
if ec and ec:IsAbleToHand() then
Duel.SendtoHand(ec,nil,REASON_EFFECT)
end
end
--エーリアン・ドッグ
function c15475415.initial_effect(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(15475415,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c15475415.spcon)
e1:SetTarget(c15475415.sptg)
e1:SetOperation(c15475415.spop)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(15475415,1))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c15475415.ctcon)
e2:SetOperation(c15475415.ctop)
c:RegisterEffect(e2)
end
c15475415.counter_add_list={0x100e}
function c15475415.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and eg:GetFirst():IsSetCard(0xc)
end
function c15475415.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 c15475415.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,SUMMON_VALUE_SELF,tp,tp,false,false,POS_FACEUP)
end
function c15475415.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF
end
function c15475415.ctop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsCanAddCounter,tp,0,LOCATION_MZONE,nil,0x100e,1)
if g:GetCount()==0 then return end
for i=1,2 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local sg=g:Select(tp,1,1,nil)
sg:GetFirst():AddCounter(0x100e,1)
end
end
--侵食細胞「A」
function c2561846.initial_effect(c)
--counter
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c2561846.target)
e1:SetOperation(c2561846.operation)
c:RegisterEffect(e1)
end
c2561846.counter_add_list={0x100e}
function c2561846.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsCanAddCounter(0x100e,1) end
if chk==0 then return Duel.IsExistingTarget(Card.IsCanAddCounter,tp,0,LOCATION_MZONE,1,nil,0x100e,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsCanAddCounter,tp,0,LOCATION_MZONE,1,1,nil,0x100e,1)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,g,1,0x100e,1)
end
function c2561846.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsControler(1-tp) then
tc:AddCounter(0x100e,1)
end
end
--エーリアン・スカル
function c25920413.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP,1)
e1:SetCondition(c25920413.spcon)
e1:SetOperation(c25920413.spop)
e1:SetValue(SUMMON_VALUE_SELF)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(25920413,0))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c25920413.ctcon)
e2:SetOperation(c25920413.ctop)
c:RegisterEffect(e2)
--atk def
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetCondition(c25920413.adcon)
e3:SetTarget(c25920413.adtg)
e3:SetValue(c25920413.adval)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e4)
end
function c25920413.spfilter(c)
return c:IsLevelBelow(3) and c:IsFaceup() and c:IsReleasable()
end
function c25920413.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)==0
and Duel.IsExistingMatchingCard(c25920413.spfilter,tp,0,LOCATION_MZONE,1,nil)
end
function c25920413.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(c:GetControler(),c25920413.spfilter,c:GetControler(),0,LOCATION_MZONE,1,1,nil)
Duel.Release(g,REASON_COST)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e2,tp)
end
c25920413.counter_add_list={0x100e}
function c25920413.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF
end
function c25920413.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() then
c:AddCounter(0x100e,1)
end
end
function c25920413.adcon(e)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and Duel.GetAttackTarget()
end
function c25920413.adtg(e,c)
local bc=c:GetBattleTarget()
return bc and c:GetCounter(0x100e)~=0 and bc:IsSetCard(0xc)
end
function c25920413.adval(e,c)
return c:GetCounter(0x100e)*-300
end
--「A」細胞増殖装置
function c34541863.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(34541863,0))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetCondition(c34541863.condition)
e2:SetTarget(c34541863.target)
e2:SetOperation(c34541863.operation)
c:RegisterEffect(e2)
end
c34541863.counter_add_list={0x100e}
function c34541863.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c34541863.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsCanAddCounter(0x100e,1) end
if chk==0 then return Duel.IsExistingTarget(Card.IsCanAddCounter,tp,0,LOCATION_MZONE,1,nil,0x100e,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsCanAddCounter,tp,0,LOCATION_MZONE,1,1,nil,0x100e,1)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,g,1,0x100e,1)
end
function c34541863.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
tc:AddCounter(0x100e,1)
end
end
--惑星汚染ウイルス
function c39163598.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e1)
e1:SetCost(c39163598.cost)
e1:SetTarget(c39163598.target)
e1:SetOperation(c39163598.activate)
c:RegisterEffect(e1)
end
c39163598.counter_add_list={0x100e}
function c39163598.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsSetCard,1,nil,0xc) end
local g=Duel.SelectReleaseGroup(tp,Card.IsSetCard,1,1,nil,0xc)
Duel.Release(g,REASON_COST)
end
function c39163598.tgfilter(c)
return c:IsFaceup() and c:GetCounter(0x100e)==0
end
function c39163598.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c39163598.tgfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c39163598.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c39163598.tgfilter,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetOperation(c39163598.ctop1)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,3)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetOperation(c39163598.ctop2)
Duel.RegisterEffect(e3,tp)
end
function c39163598.ctop1(e,tp,eg,ep,ev,re,r,rp)
if ep~=tp then
eg:GetFirst():AddCounter(0x100e,1)
end
end
function c39163598.ctop2(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsFaceup() and tc:IsSummonPlayer(1-tp) then
tc:AddCounter(0x100e,1)
end
tc=eg:GetNext()
end
end
--宇宙獣ガンギル
function c51192573.initial_effect(c)
--summon with 1 tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(51192573,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c51192573.otcon)
e1:SetOperation(c51192573.otop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(51192573,1))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c51192573.cttg)
e2:SetOperation(c51192573.ctop)
c:RegisterEffect(e2)
--atk def
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetCondition(c51192573.adcon)
e3:SetTarget(c51192573.adtg)
e3:SetValue(c51192573.adval)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e4)
end
c51192573.counter_add_list={0x100e}
function c51192573.otfilter(c,tp)
return c:GetOwner()==tp
end
function c51192573.otcon(e,c,minc)
if c==nil then return true end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c51192573.otfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,1-tp)
return c:IsLevelAbove(7) and minc<=1 and Duel.CheckTribute(c,1,1,mg)
end
function c51192573.otop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c51192573.otfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,1-tp)
local sg=Duel.SelectTribute(tp,c,1,1,mg)
c:SetMaterial(sg)
Duel.Release(sg,REASON_SUMMON+REASON_MATERIAL)
end
function c51192573.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsCanAddCounter(0x100e,1) end
if chk==0 then return Duel.IsExistingTarget(Card.IsCanAddCounter,tp,0,LOCATION_MZONE,1,nil,0x100e,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsCanAddCounter,tp,0,LOCATION_MZONE,1,1,nil,0x100e,1)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,g,1,0x100e,1)
end
function c51192573.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
tc:AddCounter(0x100e,1)
end
end
function c51192573.adcon(e)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and Duel.GetAttackTarget()
end
function c51192573.adtg(e,c)
local bc=c:GetBattleTarget()
return bc and c:GetCounter(0x100e)~=0 and bc:IsSetCard(0xc)
end
function c51192573.adval(e,c)
return c:GetCounter(0x100e)*-300
end
--エーリアン・グレイ
function c62437709.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetTarget(c62437709.target)
e1:SetOperation(c62437709.operation)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_FLIP)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(c62437709.flop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(62437709,0))
e3:SetCategory(CATEGORY_DRAW)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_BATTLE_DESTROYED)
e3:SetCondition(c62437709.drcon)
e3:SetTarget(c62437709.drtg)
e3:SetOperation(c62437709.drop)
c:RegisterEffect(e3)
--atk def
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetCondition(c62437709.adcon)
e4:SetTarget(c62437709.adtg)
e4:SetValue(c62437709.adval)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e5)
end
c62437709.counter_add_list={0x100e}
function c62437709.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,g,1,0x100e,1)
end
function c62437709.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
tc:AddCounter(0x100e,1)
end
end
function c62437709.flop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(62437709,RESET_EVENT+0x17a0000,0,0)
end
function c62437709.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
and e:GetHandler():GetFlagEffect(62437709)~=0
end
function c62437709.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c62437709.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c62437709.adcon(e)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and Duel.GetAttackTarget()
end
function c62437709.adtg(e,c)
local bc=c:GetBattleTarget()
return bc and c:GetCounter(0x100e)~=0 and bc:IsSetCard(0xc)
end
function c62437709.adval(e,c)
return c:GetCounter(0x100e)*-300
end
--エーリアン・リベンジャー
function c63253763.initial_effect(c)
c:SetUniqueOnField(1,0,63253763)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c63253763.spcon)
e1:SetOperation(c63253763.spop)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(63253763,0))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c63253763.cttg)
e2:SetOperation(c63253763.ctop)
c:RegisterEffect(e2)
--atk def
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetCondition(c63253763.adcon)
e3:SetTarget(c63253763.adtg)
e3:SetValue(c63253763.adval)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e4)
end
c63253763.counter_add_list={0x100e}
function c63253763.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsCanRemoveCounter(c:GetControler(),1,1,0x100e,2,REASON_COST)
end
function c63253763.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.RemoveCounter(tp,1,1,0x100e,2,REASON_COST)
end
function c63253763.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCanAddCounter,tp,0,LOCATION_MZONE,1,nil,0x100e,1) end
end
function c63253763.ctop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsCanAddCounter,tp,0,LOCATION_MZONE,nil,0x100e,1)
local tc=g:GetFirst()
while tc do
tc:AddCounter(0x100e,1)
tc=g:GetNext()
end
end
function c63253763.adcon(e)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and Duel.GetAttackTarget()
end
function c63253763.adtg(e,c)
local bc=c:GetBattleTarget()
return bc and c:GetCounter(0x100e)~=0 and bc:IsSetCard(0xc)
end
function c63253763.adval(e,c)
return c:GetCounter(0x100e)*-300
end
--エーリアン・キッズ
function c64160836.initial_effect(c)
--counter
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(c64160836.ctop)
c:RegisterEffect(e1)
--atk def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetCondition(c64160836.adcon)
e2:SetTarget(c64160836.adtg)
e2:SetValue(c64160836.adval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
end
c64160836.counter_add_list={0x100e}
function c64160836.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsFaceup() and tc:IsControler(1-tp) then
tc:AddCounter(0x100e,1)
end
tc=eg:GetNext()
end
end
function c64160836.adcon(e)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and Duel.GetAttackTarget()
end
function c64160836.adtg(e,c)
local bc=c:GetBattleTarget()
return bc and c:GetCounter(0x100e)~=0 and bc:IsSetCard(0xc)
end
function c64160836.adval(e,c)
return c:GetCounter(0x100e)*-300
end
--「A」細胞培養装置
function c64163367.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--counter1
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_REMOVE_COUNTER+0x100e)
e2:SetOperation(c64163367.ctop1)
c:RegisterEffect(e2)
--counter2
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_LEAVE_FIELD_P)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetOperation(c64163367.regop)
c:RegisterEffect(e0)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(64163367,0))
e3:SetCategory(CATEGORY_COUNTER)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_DESTROYED)
e3:SetCondition(c64163367.ctcon2)
e3:SetOperation(c64163367.ctop2)
e3:SetLabelObject(e0)
c:RegisterEffect(e3)
end
c64163367.counter_add_list={0x100e}
function c64163367.ctop1(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x100e,1)
end
function c64163367.regop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetHandler():GetCounter(0x100e)
e:SetLabel(ct)
end
function c64163367.ctcon2(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabelObject():GetLabel()
e:SetLabel(ct)
return ct>0
end
function c64163367.ctop2(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()==0 then return end
for i=1,ct do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
local sg=g:Select(tp,1,1,nil)
sg:GetFirst():AddCounter(0x100e,1)
end
end
--宇宙砦ゴルガー
function c68319538.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsCode,652362),aux.NonTuner(Card.IsSetCard,0xc),1)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(68319538,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c68319538.target)
e1:SetOperation(c68319538.operation)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(68319538,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c68319538.descost)
e2:SetTarget(c68319538.destg)
e2:SetOperation(c68319538.desop)
c:RegisterEffect(e2)
end
c68319538.counter_add_list={0x100e}
function c68319538.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c68319538.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c68319538.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c68319538.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingMatchingCard(Card.IsCanAddCounter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,0x100e,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c68319538.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,16,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c68319538.operation(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local rg=tg:Filter(Card.IsRelateToEffect,nil,e)
Duel.SendtoHand(rg,nil,REASON_EFFECT)
local ct=rg:FilterCount(Card.IsLocation,nil,LOCATION_HAND)
local g=Duel.GetMatchingGroup(Card.IsCanAddCounter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,0x100e,1)
if ct==0 or g:GetCount()==0 then return end
for i=1,ct do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
local sg=g:Select(tp,1,1,nil)
sg:GetFirst():AddCounter(0x100e,1)
end
end
function c68319538.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x100e,2,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x100e,2,REASON_COST)
end
function c68319538.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c68319538.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
--「A」細胞散布爆弾
function c73262676.initial_effect(c)
--counter
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c73262676.target)
e1:SetOperation(c73262676.operation)
c:RegisterEffect(e1)
end
c73262676.counter_add_list={0x100e}
function c73262676.filter(c)
return c:IsFaceup() and c:IsSetCard(0xc) and c:GetLevel()>0
end
function c73262676.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c73262676.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c73262676.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsCanAddCounter,tp,0,LOCATION_MZONE,1,nil,0x100e,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c73262676.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c73262676.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local lv=tc:GetLevel()
if Duel.Destroy(tc,REASON_EFFECT)==0 then return end
local g=Duel.GetMatchingGroup(Card.IsCanAddCounter,tp,0,LOCATION_MZONE,nil,0x100e,1)
if g:GetCount()==0 then return end
for i=1,lv do
local sg=g:Select(tp,1,1,nil)
sg:GetFirst():AddCounter(0x100e,1)
end
end
end
--エーリアン・ソルジャー M/フレーム
function c74974229.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkRace,RACE_REPTILE),2,2)
--add counter
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74974229,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,74974229)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(c74974229.ctcost)
e1:SetTarget(c74974229.cttg)
e1:SetOperation(c74974229.ctop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(74974229,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,74974230)
e2:SetCondition(c74974229.spcon)
e2:SetTarget(c74974229.sptg)
e2:SetOperation(c74974229.spop)
c:RegisterEffect(e2)
end
c74974229.counter_add_list={0x100e}
function c74974229.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsLevelAbove(1) and c:IsDiscardable()
end
function c74974229.ctcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74974229.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c74974229.costfilter,tp,LOCATION_HAND,0,1,1,nil)
e:SetLabel(g:GetFirst():GetOriginalLevel())
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c74974229.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCanAddCounter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,0x100e,1) end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,e:GetLabel(),0,0x100e)
end
function c74974229.ctop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
local g=Duel.GetMatchingGroup(Card.IsCanAddCounter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,0x100e,1)
if g:GetCount()==0 then return end
for i=1,ct do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
local sg=g:Select(tp,1,1,nil)
sg:GetFirst():AddCounter(0x100e,1)
end
end
function c74974229.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function c74974229.spfilter(c,e,tp)
return c:IsRace(RACE_REPTILE) and not c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c74974229.ctfilter(c)
return c:GetCounter(0x100e)>0
end
function c74974229.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c74974229.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(c74974229.ctfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c74974229.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c74974229.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp)
local ct=Duel.GetMatchingGroupCount(c74974229.ctfilter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()==0 or ct==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,math.min(ft,ct))
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
--「A」細胞組み換え装置
function c91231901.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c91231901.target)
e1:SetOperation(c91231901.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(91231901,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c91231901.thtg)
e2:SetOperation(c91231901.thop)
c:RegisterEffect(e2)
end
c91231901.counter_add_list={0x100e}
function c91231901.filter(c)
return c:GetLevel()>0 and c:IsSetCard(0xc) and c:IsAbleToGrave()
end
function c91231901.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsCanAddCounter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,0x100e,1)
and Duel.IsExistingMatchingCard(c91231901.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsCanAddCounter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,0x100e,1)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,g,1,0x100e,1)
end
function c91231901.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c91231901.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
local sg=g:GetFirst()
if Duel.SendtoGrave(g,REASON_EFFECT)~=0 and sg:IsLocation(LOCATION_GRAVE) then
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
tc:AddCounter(0x100e,sg:GetLevel())
end
end
end
end
function c91231901.thfilter(c)
return c:IsSetCard(0xc) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c91231901.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c91231901.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c91231901.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c91231901.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--エーリアン・ウォリアー
function c98719226.initial_effect(c)
--counter
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98719226,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c98719226.ctcon)
e1:SetOperation(c98719226.ctop)
c:RegisterEffect(e1)
--atk def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetCondition(c98719226.adcon)
e2:SetTarget(c98719226.adtg)
e2:SetValue(c98719226.adval)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
end
c98719226.counter_add_list={0x100e}
function c98719226.ctcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c98719226.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetReasonCard()
if tc:IsFaceup() and tc:IsRelateToBattle() then
tc:AddCounter(0x100e,2)
end
end
function c98719226.adcon(e)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and Duel.GetAttackTarget()
end
function c98719226.adtg(e,c)
local bc=c:GetBattleTarget()
return bc and c:GetCounter(0x100e)~=0 and bc:IsSetCard(0xc)
end
function c98719226.adval(e,c)
return c:GetCounter(0x100e)*-300
end
--古代遺跡コードA
function c99342953.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(c99342953.ctcon)
e2:SetOperation(c99342953.ctop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(99342953,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCost(c99342953.spcost)
e3:SetTarget(c99342953.sptg)
e3:SetOperation(c99342953.spop)
c:RegisterEffect(e3)
end
c99342953.counter_add_list={0x100e}
function c99342953.ctfilter(c)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousSetCard(0xc)
end
function c99342953.ctcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c99342953.ctfilter,1,nil)
end
function c99342953.ctop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x100e,1)
end
function c99342953.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x100e,2,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x100e,2,REASON_COST)
end
function c99342953.filter(c,e,tp)
return c:IsSetCard(0xc) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c99342953.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c99342953.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c99342953.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c99342953.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c99342953.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment