Commit bc416d38 authored by mercury233's avatar mercury233

update

parent e67f52af
#created by ...
#main
101106001
101106018
101106028
101106030
101106070
101106071
101106076
101106003
101106004
101106005
......@@ -51,6 +58,8 @@
101106202
101106203
#extra
101106039
101106050
101106041
101106042
101106038
......
......@@ -4,3 +4,4 @@
!setname 0x4158 圣种
!setname 0x26c 冰水
!setname 0x26d 相剑
!setname 0x26e 拓扑
--ヴァレット・キャリバー
--Rokket Caliber
--scripted by XyLeN
function c101106001.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)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101106001+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c101106001.spcon)
e1:SetValue(c101106001.spval)
c:RegisterEffect(e1)
--spsummon 2
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101106001,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101106001+100)
e2:SetCost(c101106001.spcost2)
e2:SetTarget(c101106001.sptg2)
e2:SetOperation(c101106001.spop2)
c:RegisterEffect(e2)
end
function c101106001.linkedfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_LINK)
end
function c101106001.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c101106001.linkedfilter,tp,LOCATION_MZONE,0,nil)
if g:GetCount()<=0 then return false end
local zone=0
local tc=g:GetFirst()
while tc do
zone=bit.bor(zone,tc:GetLinkedZone(tp))
tc=g:GetNext()
end
zone=bit.band(zone,0x1f)
return zone and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function c101106001.spval(e,c)
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(c101106001.linkedfilter,tp,LOCATION_MZONE,0,nil)
if g:GetCount()<=0 then return end
local zone=0
local tc=g:GetFirst()
while tc do
zone=bit.bor(zone,tc:GetLinkedZone(tp))
tc=g:GetNext()
end
zone=bit.band(zone,0x1f)
return 0,zone
end
function c101106001.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReleasable() end
Duel.Release(c,REASON_COST)
end
function c101106001.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_DRAGON+RACE_MACHINE)
and not c:IsCode(101106001) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101106001.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c101106001.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c101106001.spop2(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,c101106001.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--D-HERO ディナイアルガイ
--
--Script by mercury233
function c101106018.initial_effect(c)
--to deck top
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101106018,0))
e1:SetCategory(CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,101106018)
e1:SetTarget(c101106018.tdtg)
e1:SetOperation(c101106018.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(101106018,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,101106018+100+EFFECT_COUNT_CODE_DUEL)
e3:SetCondition(c101106018.spcon)
e3:SetTarget(c101106018.sptg)
e3:SetOperation(c101106018.spop)
c:RegisterEffect(e3)
end
function c101106018.tdfilter(c,tp)
return c:IsType(TYPE_MONSTER) and not c:IsExtraDeckMonster() and c:IsSetCard(0xc008)
and (not c:IsLocation(LOCATION_REMOVED) or c:IsFaceup())
and (not c:IsLocation(LOCATION_DECK) or Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1)
end
function c101106018.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(c101106018.tdfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,tp)
end
end
function c101106018.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(101106018,2))
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101106018.tdfilter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,tp)
local tc=g:GetFirst()
if tc then
if not tc:IsLocation(LOCATION_DECK) then
Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)
end
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
Duel.ConfirmDecktop(tp,1)
end
end
function c101106018.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0xc008) and not c:IsCode(101106018)
end
function c101106018.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c101106018.cfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil)
end
function c101106018.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 c101106018.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--マシンナーズ・ルインフォース
--
--Script by starvevenom
function c101106028.initial_effect(c)
c:EnableReviveLimit()
--special summon 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)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c101106028.hspcon)
e2:SetOperation(c101106028.hspop)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101106028,0))
e3:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,101106028)
e3:SetCost(c101106028.negcost)
e3:SetCondition(c101106028.negcon)
e3:SetTarget(c101106028.negtg)
e3:SetOperation(c101106028.negop)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101106028,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_DESTROYED)
e4:SetCountLimit(1,101106028+100)
e4:SetCondition(c101106028.spcon)
e4:SetTarget(c101106028.sptg)
e4:SetOperation(c101106028.spop)
c:RegisterEffect(e4)
end
function c101106028.hspfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c101106028.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return false end
local g=Duel.GetMatchingGroup(c101106028.hspfilter,tp,LOCATION_GRAVE,0,c)
return g:CheckWithSumGreater(Card.GetLevel,12)
end
function c101106028.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(c101106028.hspfilter,tp,LOCATION_GRAVE,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local mg=g:SelectWithSumGreater(tp,Card.GetLevel,12)
Duel.Remove(mg,POS_FACEUP,REASON_COST)
end
function c101106028.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function c101106028.negcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
if not (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) then return false end
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and rp==1-tp
end
function c101106028.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c101106028.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) then
Duel.SetLP(1-tp,math.ceil(Duel.GetLP(1-tp)/2))
end
end
function c101106028.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c101106028.spfilter(c,e,tp)
return c:IsSetCard(0x36) and c:IsType(TYPE_MONSTER) and c:IsLevelAbove(1)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101106028.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101106028.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end
function c101106028.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),3)
local lv=12
local tg=Duel.GetMatchingGroup(c101106028.spfilter,tp,LOCATION_REMOVED,0,nil,e,tp)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Group.CreateGroup()
while tg:GetCount()>0 and ft>0 and lv>0 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=tg:Select(tp,1,1,nil)
local tc=sg:GetFirst()
g:Merge(sg)
ft=ft-1
lv=lv-tc:GetLevel()
tg:Remove(Card.IsLevelAbove,nil,lv+1)
tg:RemoveCard(tc)
end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
--天獄の王
--
--Script by mercury233
function c101106030.initial_effect(c)
--public
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101106030,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101106030)
e1:SetTarget(c101106030.target)
e1:SetOperation(c101106030.operation)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101106030,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_HAND)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,101106030)
e2:SetCondition(c101106030.spcon)
e2:SetTarget(c101106030.sptg)
e2:SetOperation(c101106030.spop)
c:RegisterEffect(e2)
end
function c101106030.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c101106030.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local fid=c:GetFieldID()
c:RegisterFlagEffect(101106030,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e2:SetLabel(fid)
e2:SetLabelObject(c)
e2:SetCondition(c101106030.indcon)
e2:SetTarget(c101106030.indtg)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
Duel.RegisterEffect(e2,tp)
end
function c101106030.indcon(e)
local c=e:GetLabelObject()
return c:GetFlagEffectLabel(101106030)==e:GetLabel()
end
function c101106030.indtg(e,c)
return c:IsFacedown()
end
function c101106030.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
and not re:GetHandler():IsStatus(STATUS_ACT_FROM_HAND)
end
function c101106030.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
if c:IsPublic() then
e:SetLabel(1)
else
e:SetLabel(0)
end
end
function c101106030.setfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c101106030.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local g=Duel.GetMatchingGroup(c101106030.setfilter,tp,LOCATION_DECK,0,nil)
if e:GetLabel()==1 and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(101106030,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=g:Select(tp,1,1,nil)
Duel.SSet(tp,sg)
local tc=sg:GetFirst()
tc:RegisterFlagEffect(101106030,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(Duel.GetTurnCount()+1)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetCondition(c101106030.rmcon)
e1:SetOperation(c101106030.rmop)
Duel.RegisterEffect(e1,tp)
end
end
end
function c101106030.rmcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(101106030)~=0 then
return Duel.GetTurnCount()==e:GetLabel()
else
e:Reset()
return false
end
end
function c101106030.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
--D-HERO デストロイフェニックスガイ
--
--Script by mercury233
function c101106039.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,c101106039.matfilter,aux.FilterBoolFunction(Card.IsFusionSetCard,0xc008),true)
--atkdown
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(c101106039.atkval)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101106039,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,101106039)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetTarget(c101106039.destg)
e2:SetOperation(c101106039.desop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101106039,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,101106039+100)
e3:SetCondition(c101106039.regcon)
e3:SetOperation(c101106039.regop)
c:RegisterEffect(e3)
end
function c101106039.matfilter(c)
return c:IsFusionSetCard(0x8) and c:IsLevelAbove(6)
end
function c101106039.atkval(e,c)
return Duel.GetMatchingGroupCount(Card.IsSetCard,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,0x8)*-200
end
function c101106039.desfilter1(c)
return Duel.IsExistingMatchingCard(nil,0,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c)
end
function c101106039.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101106039.desfilter1,tp,LOCATION_ONFIELD,0,1,nil) end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,0,0)
end
function c101106039.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectMatchingCard(tp,c101106039.desfilter1,tp,LOCATION_ONFIELD,0,1,1,nil)
if not g1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,g1)
g1:Merge(g2)
Duel.HintSelection(g1)
Duel.Destroy(g1,REASON_EFFECT)
end
function c101106039.regcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c101106039.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c101106039.spcon)
e1:SetOperation(c101106039.spop)
if Duel.GetCurrentPhase()==PHASE_STANDBY then
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
else
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
end
Duel.RegisterEffect(e1,tp)
end
function c101106039.spfilter(c,e,tp)
return c:IsSetCard(0xc008) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101106039.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101106039.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
end
function c101106039.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,101106039)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101106039.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--ヴァレルコード・ドラゴン
--
--Script by starvevenom
function c101106050.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2)
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c101106050.immcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c101106050.regcon)
e2:SetOperation(c101106050.regop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_MATERIAL_CHECK)
e3:SetValue(c101106050.valcheck)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_HANDES+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLE_START)
e4:SetCountLimit(1,101106050)
e4:SetCondition(c101106050.descon)
e4:SetTarget(c101106050.destg)
e4:SetOperation(c101106050.desop)
c:RegisterEffect(e4)
--remove and spsummon
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_GRAVE)
e5:SetCountLimit(1,101106050+100)
e5:SetCost(aux.bfgcost)
e5:SetTarget(c101106050.rmtg)
e5:SetOperation(c101106050.rmop)
c:RegisterEffect(e5)
end
function c101106050.immcon(e)
local tp=e:GetHandlerPlayer()
local lg1=Duel.GetLinkedGroup(tp,1,1)
local lg2=Duel.GetLinkedGroup(1-tp,1,1)
lg1:Merge(lg2)
return lg1 and lg1:IsContains(e:GetHandler())
end
function c101106050.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and e:GetLabel()==1
end
function c101106050.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(101106050,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(101106050,1))
end
function c101106050.valcheck(e,c)
local g=c:GetMaterial()
if g:GetCount()==3 then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
function c101106050.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(101106050)~=0
end
function c101106050.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0,nil)
end
function c101106050.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
function c101106050.rmfilter(c,e,tp,check)
return c:IsFaceup() and c:IsAttackAbove(3000) and c:IsAttribute(ATTRIBUTE_DARK)
and (check or Duel.IsExistingMatchingCard(c101106050.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c))
end
function c101106050.spfilter(c,e,tp,tc)
if not (c:IsSetCard(0x26e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) then return false end
if c:IsLocation(LOCATION_EXTRA) then
return Duel.GetLocationCountFromEx(tp,tp,tc,c)>0
else
return Duel.GetMZoneCount(tp)>0
end
end
function c101106050.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101106050.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp) end
local g=Duel.GetMatchingGroup(c101106050.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp,false)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA+LOCATION_GRAVE)
end
function c101106050.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg=Duel.SelectMatchingCard(tp,c101106050.rmfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp,true)
local tc=tg:GetFirst()
if not tc then return end
Duel.HintSelection(tg)
if Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101106050.spfilter),tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,tp,nil)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--リローデッド・シリンダー
--Reloaded Cylinder
--scripted by XyLeN
function c101106070.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_BATTLE_START)
e1:SetTarget(c101106070.target)
e1:SetOperation(c101106070.activate)
c:RegisterEffect(e1)
--inflict double damage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101106070,0))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetCountLimit(1,101106070)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetCondition(c101106070.ddcon)
e3:SetOperation(c101106070.ddop)
c:RegisterEffect(e3)
end
function c101106070.setfilter(c)
return c:IsCode(62279055) and c:IsSSetable()
end
function c101106070.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101106070.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function c101106070.checkfilter(c,tp)
return c:IsPreviousLocation(LOCATION_DECK)
end
function c101106070.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c101106070.setfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.SSet(tp,g:GetFirst())
local og=Duel.GetOperatedGroup()
if og:IsExists(c101106070.checkfilter,1,nil,tp) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
g:GetFirst():RegisterEffect(e1)
end
end
end
function c101106070.ddcon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp and re and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsCode(62279055)
end
function c101106070.ddop(e,tp,eg,ep,ev,re,r,rp)
--becomes doubled
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetLabel(cid)
e1:SetValue(c101106070.damval)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
end
function c101106070.damval(e,re,val,r,rp,rc)
local cc=Duel.GetCurrentChain()
if cc==0 or bit.band(r,REASON_EFFECT)==0 then return val end
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if cid~=e:GetLabel() then return val end
return val*2
end
--デトネーション・コード
--
--Script by starvevenom
function c101106071.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1,101106071)
e2:SetCondition(c101106071.spcon)
e2:SetTarget(c101106071.sptg)
e2:SetOperation(c101106071.spop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_REMOVE)
e3:SetOperation(c101106071.spreg)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101106071,1))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_REMOVED)
e4:SetCode(EVENT_PHASE+PHASE_STANDBY)
e4:SetCountLimit(1,101106071+100)
e4:SetCondition(c101106071.setcon)
e4:SetTarget(c101106071.settg)
e4:SetOperation(c101106071.setop)
e4:SetLabelObject(e3)
c:RegisterEffect(e4)
end
function c101106071.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK) and c:IsSetCard(0x26e)
end
function c101106071.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c101106071.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c101106071.spfilter(c,e,tp)
return c:IsRace(RACE_DRAGON+RACE_MACHINE+RACE_CYBERSE) and c:IsAttribute(ATTRIBUTE_DARK)
and not c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101106071.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c101106071.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101106071.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101106071.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101106071.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
function c101106071.spreg(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsPreviousLocation(LOCATION_SZONE) then
e:SetLabel(Duel.GetTurnCount()+1)
e:GetHandler():RegisterFlagEffect(101106071,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
end
end
function c101106071.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetLabel()==Duel.GetTurnCount() and e:GetHandler():GetFlagEffect(101106071)>0
end
function c101106071.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c101106071.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SSet(tp,c)
end
end
--ブレイク・ザ・デステニー
--
--Script by mercury233
function c101106076.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101106076,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMING_STANDBY_PHASE)
e1:SetCountLimit(1,101106076)
e1:SetTarget(c101106076.destg)
e1:SetOperation(c101106076.desop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101106076,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1,101106076)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101106076.thtg)
e2:SetOperation(c101106076.thop)
c:RegisterEffect(e2)
end
if Auxiliary.AddSetNameMonsterList==nil then
function Auxiliary.AddSetNameMonsterList(c,...)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end
if c.setcode_monster_list==nil then
local mt=getmetatable(c)
mt.setcode_monster_list={}
for i,scode in ipairs{...} do
mt.setcode_monster_list[i]=scode
end
else
for i,scode in ipairs{...} do
c.setcode_monster_list[i]=scode
end
end
end
function Auxiliary.IsSetNameMonsterListed(c,setcode)
if not c.setcode_monster_list then return false end
for i,scode in ipairs(c.setcode_monster_list) do
if setcode&0xfff==scode&0xfff and setcode&scode==setcode then return true end
end
return false
end
end
function c101106076.desfilter(c)
return c:IsFaceup() and (c:IsCode(76263644) or c:IsSetCard(0xc008) and c:IsLevelAbove(8))
end
function c101106076.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101106076.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101106076.desfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c101106076.desfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101106076.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SKIP_M1)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
if Duel.GetTurnPlayer()==1-tp and Duel.GetCurrentPhase()==PHASE_MAIN1 then
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c101106076.turncon)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,2)
else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
end
Duel.RegisterEffect(e1,tp)
end
end
function c101106076.turncon(e)
return Duel.GetTurnCount()~=e:GetLabel()
end
function c101106076.thfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() and not c:IsCode(101106076)
and (aux.IsCodeListed(c,76263644) or aux.IsSetNameMonsterListed(c,0xc008))
end
function c101106076.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101106076.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101106076.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101106076.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
--D-タクティクス
function c48032131.initial_effect(c)
aux.AddCodeList(c,76263644)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--attack
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(48032131,0))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1,48032131)
e2:SetTarget(c48032131.adtg)
e2:SetOperation(c48032131.adop)
c:RegisterEffect(e2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(48032131,1))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,48032132)
e3:SetCondition(c48032131.rmcon)
e3:SetTarget(c48032131.rmtg)
e3:SetOperation(c48032131.rmop)
c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1,48032133)
e4:SetCondition(c48032131.thcon)
e4:SetTarget(c48032131.thtg)
e4:SetOperation(c48032131.thop)
c:RegisterEffect(e4)
end
function c48032131.adfilter(c)
return c:IsFaceup() and c:IsSetCard(0x8)
end
function c48032131.adtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c48032131.adfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function c48032131.adop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c48032131.adfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(400)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
function c48032131.cfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and (c:IsCode(76263644) or c:IsLevelAbove(8) and c:IsSetCard(0xc008))
end
function c48032131.rmcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c48032131.cfilter,1,nil,tp)
end
function c48032131.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
end
function c48032131.rmop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
local opt=0
if g1:GetCount()>0 and g2:GetCount()>0 then
opt=Duel.SelectOption(tp,aux.Stringid(48032131,2),aux.Stringid(48032131,3))
elseif g1:GetCount()>0 then
opt=0
elseif g2:GetCount()>0 then
opt=1
else
return
end
local sg=nil
if opt==0 then
sg=g1:RandomSelect(tp,1)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
sg=g2:Select(tp,1,1,nil)
end
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
function c48032131.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_SZONE)
end
function c48032131.thfilter(c)
return c:IsSetCard(0xc008) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c48032131.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c48032131.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c48032131.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c48032131.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
--D-フォース
function c6186304.initial_effect(c)
aux.AddSetNameMonsterList(c,0xc008)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c6186304.activate)
c:RegisterEffect(e1)
--draw skip
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_DRAW)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
e2:SetCondition(c6186304.skipcon)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_DRAW_COUNT)
e3:SetValue(0)
c:RegisterEffect(e3)
--cannot be target
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(LOCATION_ONFIELD,0)
e4:SetCondition(c6186304.condition)
e4:SetValue(aux.tgoval)
c:RegisterEffect(e4)
--atkup
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_UPDATE_ATTACK)
e5:SetRange(LOCATION_SZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetTarget(aux.TargetBoolFunction(Card.IsCode,83965310))
e5:SetValue(c6186304.atkval)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e6:SetValue(aux.indoval)
c:RegisterEffect(e6)
local e7=e5:Clone()
e7:SetCode(EFFECT_EXTRA_ATTACK)
e7:SetValue(1)
c:RegisterEffect(e7)
end
if Auxiliary.AddSetNameMonsterList==nil then
function Auxiliary.AddSetNameMonsterList(c,...)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end
if c.setcode_monster_list==nil then
local mt=getmetatable(c)
mt.setcode_monster_list={}
for i,scode in ipairs{...} do
mt.setcode_monster_list[i]=scode
end
else
for i,scode in ipairs{...} do
c.setcode_monster_list[i]=scode
end
end
end
function Auxiliary.IsSetNameMonsterListed(c,setcode)
if not c.setcode_monster_list then return false end
for i,scode in ipairs(c.setcode_monster_list) do
if setcode&0xfff==scode&0xfff and setcode&scode==setcode then return true end
end
return false
end
end
function c6186304.thfilter(c)
return c:IsCode(83965310) and c:IsAbleToHand()
end
function c6186304.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c6186304.thfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(6186304,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 c6186304.cfilter(c)
return c:IsFaceup() and c:IsCode(83965310)
end
function c6186304.condition(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(c6186304.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c6186304.skipcon(e)
return c6186304.condition(e) and Duel.GetCurrentPhase()==PHASE_DRAW
end
function c6186304.atkval(e,c)
return Duel.GetMatchingGroupCount(Card.IsType,0,LOCATION_GRAVE,LOCATION_GRAVE,nil,TYPE_MONSTER)*100
end
--幽獄の時計塔
function c75041269.initial_effect(c)
aux.AddCodeList(c,76263644)
c:EnableCounterPermit(0x1b)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--add counter
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(75041269,0))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCondition(c75041269.ctcon)
e2:SetOperation(c75041269.ctop)
c:RegisterEffect(e2)
--avoid battle damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(1,0)
e3:SetCondition(c75041269.dcon)
c:RegisterEffect(e3)
--spsummon
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(c75041269.regop)
c:RegisterEffect(e0)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(75041269,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c75041269.spcon)
e4:SetTarget(c75041269.sptg)
e4:SetOperation(c75041269.spop)
e4:SetLabelObject(e0)
c:RegisterEffect(e4)
end
function c75041269.dcon(e)
return e:GetHandler():GetCounter(0x1b)>=4
end
function c75041269.ctcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c75041269.ctop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x1b,1)
end
function c75041269.regop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetCounter(0x1b)>=4 then
e:SetLabel(1)
else
e:SetLabel(0)
end
end
function c75041269.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and e:GetLabelObject():GetLabel()==1
end
function c75041269.spfilter(c,e,tp)
return c:IsCode(40591390) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c75041269.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_HAND+LOCATION_DECK)
end
function c75041269.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,c75041269.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()~=0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
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