Commit 1f65fe82 authored by mercury233's avatar mercury233

add scripts SD41

parent ece0b9e9
--サイバーダーク・インヴェイジョン
function c1157683.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1157683,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetTarget(c1157683.eqtg)
e1:SetOperation(c1157683.eqop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1157683,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCost(c1157683.descost)
e2:SetTarget(c1157683.destg)
e2:SetOperation(c1157683.desop)
c:RegisterEffect(e2)
end
function c1157683.eqfilter(c,tp)
return c:IsSetCard(0x4093) and c:IsFaceup() and c:IsType(TYPE_EFFECT)
and Duel.IsExistingMatchingCard(c1157683.eqfilter2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
end
function c1157683.eqfilter2(c)
return c:IsRace(RACE_DRAGON+RACE_MACHINE) and not c:IsForbidden()
end
function c1157683.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c1157683.eqfilter(chkc,tp) end
if chk==0 then return Duel.GetFlagEffect(tp,1157683)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c1157683.eqfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RegisterFlagEffect(tp,1157683,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c1157683.eqfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
end
function c1157683.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c1157683.eqfilter2),tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,ec,tp)
local ec=g:GetFirst()
if not ec or not Duel.Equip(tp,ec,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c1157683.eqlimit)
e1:SetLabelObject(tc)
ec:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(1000)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
ec:RegisterEffect(e2)
end
end
function c1157683.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c1157683.cfilter(c)
return c:IsFaceup() and c:GetEquipTarget() and c:GetEquipTarget():IsRace(RACE_MACHINE) and c:IsAbleToGraveAsCost()
end
function c1157683.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c1157683.cfilter,tp,LOCATION_SZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c1157683.cfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c1157683.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,1157684)==0
and Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.RegisterFlagEffect(tp,1157684,RESET_PHASE+PHASE_END,0,1)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c1157683.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
...@@ -43,8 +43,9 @@ function c18967507.eqfilter(c,tp) ...@@ -43,8 +43,9 @@ function c18967507.eqfilter(c,tp)
return c:IsRace(RACE_DRAGON+RACE_MACHINE) and c:CheckUniqueOnField(tp) and not c:IsForbidden() return c:IsRace(RACE_DRAGON+RACE_MACHINE) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end end
function c18967507.eqtg(e,tp,eg,ep,ev,re,r,rp,chk) function c18967507.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local loc=Duel.IsPlayerAffectedByEffect(tp,64753988) and LOCATION_GRAVE or 0
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c18967507.eqfilter,tp,LOCATION_GRAVE,0,1,nil,tp) end and Duel.IsExistingMatchingCard(c18967507.eqfilter,tp,LOCATION_GRAVE,loc,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
end end
...@@ -52,8 +53,9 @@ function c18967507.eqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,8 +53,9 @@ function c18967507.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
local loc=Duel.IsPlayerAffectedByEffect(tp,64753988) and LOCATION_GRAVE or 0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c18967507.eqfilter),tp,LOCATION_GRAVE,0,1,1,nil,tp) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c18967507.eqfilter),tp,LOCATION_GRAVE,loc,1,1,nil,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
if not Duel.Equip(tp,tc,c) then return end if not Duel.Equip(tp,tc,c) then return end
......
...@@ -26,10 +26,11 @@ function c3019642.filter(c) ...@@ -26,10 +26,11 @@ function c3019642.filter(c)
return c:IsLevelBelow(3) and c:IsRace(RACE_DRAGON) and not c:IsForbidden() return c:IsLevelBelow(3) and c:IsRace(RACE_DRAGON) and not c:IsForbidden()
end end
function c3019642.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c3019642.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c3019642.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and (chkc:IsControler(tp) or Duel.IsPlayerAffectedByEffect(tp,64753988)) and c3019642.filter(chkc) end
if chk==0 then return true end if chk==0 then return true end
local loc=Duel.IsPlayerAffectedByEffect(tp,64753988) and LOCATION_GRAVE or 0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c3019642.filter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,c3019642.filter,tp,LOCATION_GRAVE,loc,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end end
......
--エターナル・サイバー
function c32768230.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOEXTRA+CATEGORY_GRAVE_ACTION+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,32768230)
e1:SetTarget(c32768230.target)
e1:SetOperation(c32768230.activate)
c:RegisterEffect(e1)
--destroy replace
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,32768231)
e2:SetTarget(c32768230.reptg)
e2:SetValue(c32768230.repval)
e2:SetOperation(c32768230.repop)
c:RegisterEffect(e2)
end
function c32768230.spfilter(c,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return c:IsSetCard(0x93) and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_FUSION)
and (c:IsAbleToExtra() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,false)))
end
function c32768230.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c32768230.spfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c32768230.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c32768230.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
end
function c32768230.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if tc:IsRelateToEffect(e) then
if aux.NecroValleyNegateCheck(tc) then return end
if ft>0 and tc:IsCanBeSpecialSummoned(e,0,tp,true,false)
and (not tc:IsAbleToExtra() or Duel.SelectOption(tp,aux.Stringid(32768230,0),1152)==1) then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
else
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
end
function c32768230.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x93) and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_FUSION)
and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function c32768230.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(c32768230.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c32768230.repval(e,c)
return c32768230.repfilter(c,e:GetHandlerPlayer())
end
function c32768230.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
--鎧皇竜-サイバー・ダーク・エンド・ドラゴン
function c37542782.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(c37542782.hspcon)
e2:SetOperation(c37542782.hspop)
c:RegisterEffect(e2)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(c37542782.efilter)
c:RegisterEffect(e3)
--equip
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(37542782,0))
e4:SetCategory(CATEGORY_EQUIP)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c37542782.eqtg)
e4:SetOperation(c37542782.eqop)
c:RegisterEffect(e4)
--multi attack
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_EXTRA_ATTACK)
e5:SetValue(c37542782.atkval)
c:RegisterEffect(e5)
end
function c37542782.eqspfilter(c)
return c:IsFaceup() and c:IsCode(1546123)
end
function c37542782.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(c37542782.eqspfilter,1,nil) and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0 and c:IsCanBeFusionMaterial(sc,SUMMON_TYPE_SPECIAL)
end
function c37542782.hspcon(e,c)
if c==nil then return true end
return Duel.CheckReleaseGroup(c:GetControler(),c37542782.hspfilter,1,nil,c:GetControler(),c)
end
function c37542782.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,c37542782.hspfilter,1,1,nil,tp,c)
c:SetMaterial(g)
Duel.Release(g,REASON_COST)
end
function c37542782.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetHandlerPlayer() and re:IsActivated()
end
function c37542782.eqfilter(c,tp)
return c:IsType(TYPE_MONSTER) and (c:IsControler(tp) or c:IsAbleToChangeControler())
end
function c37542782.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c37542782.eqfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function c37542782.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(c37542782.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(c37542782.eqlimit)
tc:RegisterEffect(e1)
end
end
function c37542782.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c37542782.atkval(e,c)
return e:GetHandler():GetEquipCount()-1
end
...@@ -33,10 +33,11 @@ function c40418351.filter(c) ...@@ -33,10 +33,11 @@ function c40418351.filter(c)
return c:IsRace(RACE_DRAGON) and not c:IsForbidden() return c:IsRace(RACE_DRAGON) and not c:IsForbidden()
end end
function c40418351.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c40418351.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c40418351.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and (chkc:IsControler(tp) or Duel.IsPlayerAffectedByEffect(tp,64753988)) and c40418351.filter(chkc) end
if chk==0 then return true end if chk==0 then return true end
local loc=Duel.IsPlayerAffectedByEffect(tp,64753988) and LOCATION_GRAVE or 0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c40418351.filter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,c40418351.filter,tp,LOCATION_GRAVE,loc,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end end
......
...@@ -20,10 +20,11 @@ function c41230939.filter(c) ...@@ -20,10 +20,11 @@ function c41230939.filter(c)
return c:IsLevelBelow(3) and c:IsRace(RACE_DRAGON) and not c:IsForbidden() return c:IsLevelBelow(3) and c:IsRace(RACE_DRAGON) and not c:IsForbidden()
end end
function c41230939.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c41230939.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c41230939.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and (chkc:IsControler(tp) or Duel.IsPlayerAffectedByEffect(tp,64753988)) and c41230939.filter(chkc) end
if chk==0 then return true end if chk==0 then return true end
local loc=Duel.IsPlayerAffectedByEffect(tp,64753988) and LOCATION_GRAVE or 0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c41230939.filter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,c41230939.filter,tp,LOCATION_GRAVE,loc,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end end
......
--サイバー・ダーク・キメラ
--not fully implemented
function c5370235.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(5370235,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,5370235)
e1:SetCost(c5370235.thcost)
e1:SetTarget(c5370235.thtg)
e1:SetOperation(c5370235.thop)
c:RegisterEffect(e1)
--to grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(5370235,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,5370236)
e2:SetTarget(c5370235.tgtg)
e2:SetOperation(c5370235.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
_SendtoGrave=Duel.SendtoGrave
function Duel.SendtoGrave(tg,reason)
if reason~=REASON_EFFECT+REASON_MATERIAL+REASON_FUSION or aux.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 c5370235.costfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDiscardable()
end
function c5370235.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c5370235.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c5370235.costfilter,1,1,REASON_COST+REASON_DISCARD,nil)
end
function c5370235.thfilter(c)
return c:IsCode(37630732) and c:IsAbleToHand()
end
function c5370235.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c5370235.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c5370235.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c5370235.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(c5370235.limittg)
e1:SetValue(c5370235.fuslimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(5370235,2))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_EXTRA_FUSION_MATERIAL)
e2:SetTargetRange(LOCATION_GRAVE,0)
--e2:SetCountLimit(1,5370237)
e2:SetTarget(c5370235.mttg)
e2:SetValue(c5370235.fuslimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c5370235.limittg(e,c)
return not (c:IsRace(RACE_DRAGON+RACE_MACHINE) and c:IsSetCard(0x93))
end
function c5370235.fuslimit(e,c,sumtype)
if not c then return false end
return c:IsControler(e:GetHandlerPlayer())
end
function c5370235.mttg(e,c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c5370235.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 c5370235.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c5370235.tgfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c5370235.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c5370235.tgfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--サイバネティック・ホライゾン
function c63031396.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,63031396+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c63031396.cost)
e1:SetTarget(c63031396.target)
e1:SetOperation(c63031396.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(63031396,ACTIVITY_SPSUMMON,c63031396.counterfilter)
end
function c63031396.counterfilter(c)
return not c:IsSummonLocation(LOCATION_EXTRA) or c:IsRace(RACE_MACHINE)
end
function c63031396.costfilter(c)
return c:IsRace(RACE_DRAGON+RACE_MACHINE) and c:IsSetCard(0x93) and c:IsAbleToGraveAsCost()
end
function c63031396.thfilter(c)
return c:IsRace(RACE_DRAGON+RACE_MACHINE) and c:IsSetCard(0x93) and c:IsAbleToHand()
end
function c63031396.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(c63031396.thfilter,tp,LOCATION_DECK,0,1,g)
end
function c63031396.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c63031396.costfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
if chk==0 then return Duel.GetCustomActivityCount(63031396,tp,ACTIVITY_SPSUMMON)==0
and g:CheckSubGroup(c63031396.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(c63031396.splimit)
Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,c63031396.fselect,false,2,2,tp)
Duel.SendtoGrave(sg,REASON_COST)
end
function c63031396.splimit(e,c)
return c:IsLocation(LOCATION_EXTRA) and not c:IsRace(RACE_MACHINE)
end
function c63031396.tgfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsSetCard(0x93) and c:IsType(TYPE_FUSION) and c:IsAbleToGrave()
end
function c63031396.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c63031396.thfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(c63031396.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 c63031396.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,c63031396.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,c63031396.tgfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
--サイバーダーク・ワールド
function c64753988.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,64753988+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c64753988.activate)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(64753988,0))
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,64753989)
e2:SetTarget(c64753988.sumtg)
e2:SetOperation(c64753988.sumop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(64753988)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(1,0)
c:RegisterEffect(e3)
end
function c64753988.filter(c,tp)
return c:IsSetCard(0x4093) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
and not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,c:GetCode())
end
function c64753988.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c64753988.filter,tp,LOCATION_DECK,0,nil,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(64753988,1)) 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 c64753988.sumfilter(c)
return c:IsSetCard(0x4093) and c:IsSummonable(true,nil)
end
function c64753988.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c64753988.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c64753988.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c64753988.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
...@@ -29,10 +29,11 @@ function c77625948.filter(c) ...@@ -29,10 +29,11 @@ function c77625948.filter(c)
return c:IsLevelBelow(3) and c:IsRace(RACE_DRAGON) and not c:IsForbidden() return c:IsLevelBelow(3) and c:IsRace(RACE_DRAGON) and not c:IsForbidden()
end end
function c77625948.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c77625948.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c77625948.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and (chkc:IsControler(tp) or Duel.IsPlayerAffectedByEffect(tp,64753988)) and c77625948.filter(chkc) end
if chk==0 then return true end if chk==0 then return true end
local loc=Duel.IsPlayerAffectedByEffect(tp,64753988) and LOCATION_GRAVE or 0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c77625948.filter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,c77625948.filter,tp,LOCATION_GRAVE,loc,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end end
......
--アタッチメント・サイバーン
function c79875526.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(79875526,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetTarget(c79875526.eqtg)
e1:SetOperation(c79875526.eqop)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(600)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(79875526,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,79875526)
e3:SetCondition(c79875526.spcon)
e3:SetTarget(c79875526.sptg)
e3:SetOperation(c79875526.spop)
c:RegisterEffect(e3)
end
function c79875526.filter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON+RACE_MACHINE) and c:IsSetCard(0x93)
end
function c79875526.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c79875526.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and e:GetHandler():CheckUniqueOnField(tp)
and Duel.IsExistingTarget(c79875526.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c79875526.filter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
end
function c79875526.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc) then return end
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(c79875526.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
end
function c79875526.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c79875526.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_SZONE) and not c:IsReason(REASON_LOST_TARGET)
end
function c79875526.spfilter(c,e,tp)
return c:IsRace(RACE_DRAGON+RACE_MACHINE) and c:IsSetCard(0x93) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c79875526.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c79875526.spfilter(chkc,e,tp) and chkc~=c end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c79875526.spfilter,tp,LOCATION_GRAVE,0,1,c,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c79875526.spfilter,tp,LOCATION_GRAVE,0,1,1,c,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c79875526.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
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