Commit 9d7810e4 authored by Chen Bill's avatar Chen Bill Committed by GitHub

24PP (#2309)

* 24PP

* card name

* fix トイ・ボックス

* fix 集いし光

* typos

* Fix 未来の柱-キアノス (#2355)

* format

* add set_as_spell for トイ・ボックス

* fix

* fix トイ・ボックス (#2489)

* Fix トイ・タンク & トイ・ソルジャー (#2485)

* fix 漆黒の太陽 (#2571)

* fix

* fix エレクトロ・ガンナー

* Fix トイ・ボックス (#2641)

* newline

---------
Co-authored-by: wind2009's avatarWind2009-Louse <wind.jackey@qq.com>
Co-authored-by: mercury233's avatarmercury233 <me@mercury233.me>
Co-authored-by: default avatar想象力很好的毛虫 <71340108+Crescent0v0@users.noreply.github.com>
Co-authored-by: default avatar八宫一月 <135235980+kiritosoft@users.noreply.github.com>
parent 7c76a81d
--紅蓮王 フレイム・クライム
local s,id,o=GetID()
function s.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--damage
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.damcon)
e2:SetOperation(s.damop)
c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetCountLimit(1,id+o*2)
e3:SetCondition(s.tgcon)
e3:SetTarget(s.tgtg)
e3:SetOperation(s.tgop)
c:RegisterEffect(e3)
end
function s.scfilter(c)
return c:IsType(TYPE_TUNER) and c:IsRace(RACE_FIEND) and c:IsFaceup()
end
function s.ocfilter(c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsFaceup()
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then return false end
return Duel.IsExistingMatchingCard(s.scfilter,tp,LOCATION_MZONE,0,1,nil)
or Duel.IsExistingMatchingCard(s.ocfilter,tp,0,LOCATION_MZONE,1,nil)
end
function s.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 s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.afilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsFaceup()
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.afilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.afilter,tp,LOCATION_MZONE,0,nil)
local dam=g:GetClassCount(Card.GetCode)*400
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
end
function s.tgfilter(c)
return c:GetType()==TYPE_TRAP and c:IsAbleToGrave()
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--未来の柱-キアノス
local s,id,o=GetID()
function s.initial_effect(c)
--special summon(self)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,id)
e1:SetRange(LOCATION_HAND)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--special summon (deck and grave)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.sptg2)
e2:SetOperation(s.spop2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_ACTION+CATEGORY_GRAVE_SPSUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_GRAVE)
e4:SetCost(aux.bfgcost)
e4:SetCountLimit(1,id+o*2)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
end
function s.costfilter(c)
return c:IsType(TYPE_SPELL) and c:IsDiscardable()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,s.costfilter,1,1,REASON_COST+REASON_DISCARD)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function s.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 s.spfilter(c,e,tp)
return c:IsCode(37351133) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK+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
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(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.splimit(e,c)
return not c:IsRace(RACE_MACHINE) and c:IsLocation(LOCATION_EXTRA)
end
function s.thfilter(c,e,tp)
return c:IsCode(37351133) and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false)) and c:IsFaceupEx()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp):GetFirst()
if tc then
if 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
--電極獣カチオン
function c21291696.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21291696,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,21291696)
e1:SetTarget(c21291696.thtg)
e1:SetOperation(c21291696.thop)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21291696,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,21291696+1)
e2:SetTarget(c21291696.lvtg)
e2:SetOperation(c21291696.lvop)
c:RegisterEffect(e2)
end
function c21291696.thfilter(c)
return c:IsCode(58680635) and c:IsAbleToHand()
end
function c21291696.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c21291696.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c21291696.sumfilter(c)
return c:IsSummonable(true,nil) and c:IsRace(RACE_THUNDER) and c:IsLevelBelow(4)
end
function c21291696.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c21291696.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
if Duel.IsExistingMatchingCard(c21291696.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(21291696,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sg=Duel.SelectMatchingCard(tp,c21291696.sumfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if sg:GetCount()>0 then
Duel.Summon(tp,sg:GetFirst(),true,nil)
end
end
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c21291696.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c21291696.splimit(e,c)
return not (c:IsType(TYPE_XYZ) and c:IsAttribute(ATTRIBUTE_LIGHT)) and c:IsLocation(LOCATION_EXTRA)
end
function c21291696.lvfilter(c,lv)
return c:IsFaceup() and c:IsRace(RACE_THUNDER) and not c:IsLevel(lv) and c:IsLevelAbove(1)
end
function c21291696.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local lv=e:GetHandler():GetLevel()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c21291696.lvfilter(chkc,lv) end
if chk==0 then return Duel.IsExistingTarget(c21291696.lvfilter,tp,LOCATION_MZONE,0,1,nil,lv) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c21291696.lvfilter,tp,LOCATION_MZONE,0,1,1,nil,lv)
end
function c21291696.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(tc:GetLevel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--白の循環礁
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--to deck and spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id+o)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.tdtg)
e2:SetOperation(s.tdop)
c:RegisterEffect(e2)
end
function s.filter(c,e,tp,check)
local check2=check and Duel.GetMZoneCount(tp,c)>0
return c:IsRace(RACE_FISH) and c:IsFaceup()
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,e,tp,check2,c:GetCode())
end
function s.thfilter(c,e,tp,check,code)
return c:IsCode(code) and (c:IsAbleToHand() or check and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
function s.spcfilter(c)
return c:IsRace(RACE_FISH) and c:IsType(TYPE_SYNCHRO) and c:IsFaceup()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local check=Duel.IsExistingMatchingCard(s.spcfilter,tp,LOCATION_MZONE,0,1,nil)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc,e,tp,check) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil,e,tp,check) end
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp,check)
if check then e:SetLabel(1) else e:SetLabel(0) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local code=tc:GetCode()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRace(RACE_FISH)
and Duel.Destroy(tc,REASON_EFFECT)>0 then
local check=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetLabel()==1
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sc=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,check,code):GetFirst()
if not sc then return end
if check and sc:IsCanBeSpecialSummoned(e,0,tp,false,false) and (not sc:IsAbleToHand() or Duel.SelectOption(tp,1190,1152)==1) then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.SendtoHand(sc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sc)
end
end
end
function s.tgfilter(c,e,tp)
return c:IsCanBeEffectTarget(e) and c:IsRace(RACE_FISH)
and c:IsAbleToDeck() or c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.tdfilter1(c,g,e,tp)
return c:IsAbleToDeck() and g:IsExists(Card.IsCanBeSpecialSummoned,1,c,e,0,tp,false,false)
end
function s.fselect(g,e,tp)
return g:GetClassCount(Card.GetCode)==1 and g:IsExists(s.tdfilter1,1,nil,g,e,tp)
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chkc then return false end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and g:CheckSubGroup(s.fselect,2,2,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg=g:SelectSubGroup(tp,s.fselect,false,2,2,e,tp)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain()
if #g~=2 then return end
local exg=nil
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
exg=g:Filter(Card.IsCanBeSpecialSummoned,nil,e,0,tp,false,false)
if #exg==2 then exg=nil end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local dc=g:FilterSelect(tp,Card.IsAbleToDeck,1,1,exg):GetFirst()
if not dc then return end
g:RemoveCard(dc)
Duel.SendtoDeck(dc,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
if dc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--シンクロ・クリード
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsType(TYPE_SYNCHRO) and c:IsFaceup()
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function s.target(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 s.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)>0 and Duel.IsPlayerCanDraw(p,1)
and Duel.GetMatchingGroupCount(s.filter,p,LOCATION_MZONE,LOCATION_MZONE,nil)>=3
and Duel.SelectYesNo(p,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.Draw(p,1,REASON_EFFECT)
end
end
--トイ・ボックス
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetTarget(s.sttg)
e2:SetOperation(s.stop)
c:RegisterEffect(e2)
--destroy facedown
local e3=e2:Clone()
e3:SetDescription(aux.Stringid(id,1))
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
--destroy monster
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetCountLimit(1)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(s.dmcon)
e4:SetCost(s.dmcost)
e4:SetTarget(s.dmtg)
e4:SetOperation(s.dmop)
c:RegisterEffect(e4)
end
function s.stfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x1a8) and c:IsSSetable()
and c.set_as_spell and c:IsFaceupEx()
end
function s.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.stfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end
end
function s.stop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local ct=math.min(Duel.GetLocationCount(tp,LOCATION_SZONE),2)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.stfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_MZONE+LOCATION_GRAVE,0,1,ct,nil)
Duel.SSet(tp,g)
end
function s.desfilter(c)
return c:GetSequence()<5
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_SZONE,0,nil)
if g:GetCount()>0 then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_SZONE,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,2,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
end
function s.dmcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function s.cfilter(c,tp)
return c:IsFacedown() and c:IsAbleToGraveAsCost()
end
function s.dmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_ONFIELD,0,1,1,c,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function s.dmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ac=Duel.GetAttacker()
if chk==0 then return ac:IsOnField() end
Duel.SetTargetCard(ac)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,ac,1,0,0)
end
function s.dmop(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetFirstTarget()
if ac:IsRelateToEffect(e) and ac:IsControler(1-tp) and ac:IsType(TYPE_MONSTER) then
Duel.Destroy(ac,REASON_EFFECT)
end
end
--ディーヴジャン
function c42427230.initial_effect(c)
--token
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(42427230,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,42427230)
e1:SetCost(c42427230.spcost)
e1:SetTarget(c42427230.sptg)
e1:SetOperation(c42427230.spop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(42427230,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,42427231)
e2:SetTarget(c42427230.destg)
e2:SetOperation(c42427230.desop)
c:RegisterEffect(e2)
end
function c42427230.cfilter(c,tp)
return (c:IsControler(tp) or c:IsFaceup()) and c:IsCode(42427230)
end
function c42427230.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetMatchingGroup(c42427230.cfilter,tp,LOCATION_MZONE,0,nil,tp)
if chk==0 then return rg:GetCount()==rg:FilterCount(Card.IsReleasable,nil)
and rg:GetCount()~=0 and Duel.GetMZoneCount(tp,rg)>0 end
local ct=Duel.Release(rg,REASON_COST)*2
e:SetLabel(ct)
end
function c42427230.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSpecialSummonMonster(tp,42427231,0,TYPES_TOKEN_MONSTER,200,200,1,RACE_MACHINE,ATTRIBUTE_FIRE) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c42427230.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=e:GetLabel()
if ft>0 and ct>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,42427231,0,TYPES_TOKEN_MONSTER,200,200,1,RACE_MACHINE,ATTRIBUTE_FIRE) then
local count=math.min(ft,ct)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then count=1 end
if count>1 then
local num={}
local i=1
while i<=count do
num[i]=i
i=i+1
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(42427230,2))
count=Duel.AnnounceNumber(tp,table.unpack(num))
end
for i=1,count do
local token=Duel.CreateToken(tp,42427231)
if Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(42427230,3))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetLabel(tp)
e1:SetOperation(c42427230.damop)
token:RegisterEffect(e1,true)
end
end
Duel.SpecialSummonComplete()
end
end
function c42427230.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p=e:GetLabel()
if c:IsReason(REASON_DESTROY) then
Duel.Damage(1-p,500,REASON_EFFECT)
end
e:Reset()
end
function c42427230.desfilter(c)
return c:IsFaceup() and c:IsType(TYPE_TOKEN)
end
function c42427230.desfilter2(c,e)
return c42427230.desfilter(c) and c:IsCanBeEffectTarget(e)
end
function c42427230.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c42427230.desfilter(chkc) end
local g=Duel.GetMatchingGroup(c42427230.desfilter2,tp,LOCATION_ONFIELD,0,nil,e)
if chk==0 then return g:GetCount()~=0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,g:GetCount(),nil)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c42427230.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()~=0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--閃刀姫-アザレア・テンペランス
local s,id,o=GetID()
function s.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,3,s.lcheck)
c:EnableReviveLimit()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetRange(LOCATION_EXTRA)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(aux.linklimit)
c:RegisterEffect(e1)
--Equip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id+o)
e2:SetCost(s.eqcost)
e2:SetTarget(s.eqtg)
e2:SetOperation(s.eqop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_DESTROYED)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
function s.lcheck(g,lc)
return g:IsExists(Card.IsLinkType,1,nil,TYPE_LINK)
end
function s.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToRemoveAsCost()
end
function s.eqcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.eqfilter(c)
return c:IsFaceup() and c:IsAttackBelow(2500) and c:IsAbleToChangeControler()
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and s.eqfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(s.eqfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,s.eqfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.Equip(tp,tc,c,false) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(s.eqlimit)
tc:RegisterEffect(e1)
end
end
function s.eqlimit(e,c)
return e:GetOwner()==c
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x115) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function s.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,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,aux.ExceptThisCard(e),e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--白の仲裁
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--change a target into a tuner
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
--defense position
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.dfcon)
e2:SetCost(s.dfcost)
e2:SetTarget(s.dftg)
e2:SetOperation(s.dfop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,id+o*2)
e3:SetCondition(s.spcon1)
e3:SetCost(s.spcost)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(s.spcon2)
c:RegisterEffect(e4)
end
function s.filter(c)
return c:IsRace(RACE_FISH) and c:IsFaceup() and not c:IsType(TYPE_TUNER)
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(TYPE_TUNER)
tc:RegisterEffect(e1)
end
end
function s.dfcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function s.dfilter(c)
return c:IsRace(RACE_FISH) and c:IsDiscardable(REASON_COST+REASON_DISCARD)
end
function s.dfcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.dfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,s.dfilter,1,1,REASON_COST+REASON_DISCARD,nil)
end
function s.posfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsCanChangePosition()
end
function s.dftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.posfilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(s.posfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function s.dfop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.posfilter,tp,0,LOCATION_MZONE,nil)
if #g>0 then
Duel.ChangePosition(g,POS_FACEUP_DEFENSE)
end
end
function s.cfilter(c,tp)
return c:IsPreviousControler(tp) and c:GetPreviousRaceOnField()&RACE_FISH~=0 and c:IsReason(REASON_BATTLE)
end
function s.cfilter2(c,tp)
return not c:IsReason(REASON_BATTLE) and c:IsPreviousControler(tp) and s.check(c)
end
function s.check(c)
if c:IsPreviousLocation(LOCATION_MZONE) then
return c:GetPreviousRaceOnField()&RACE_FISH~=0 and c:IsRace(RACE_FISH)
else
return c:IsRace(RACE_FISH) and not c:IsPreviousLocation(LOCATION_ONFIELD)
end
end
function s.spcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter2,1,nil,tp)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and c:IsStatus(STATUS_EFFECT_ENABLED) end
Duel.SendtoGrave(c,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsRace(RACE_FISH) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function s.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,s.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
......@@ -34,6 +34,7 @@ function c58132856.initial_effect(c)
e4:SetOperation(c58132856.desop)
c:RegisterEffect(e4)
end
c58132856.set_as_spell=true
function c58132856.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsPreviousLocation(LOCATION_SZONE) and c:IsPreviousPosition(POS_FACEDOWN)
......
--電極獣アニオン
function c58680635.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(58680635,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,58680635)
e1:SetTarget(c58680635.lvtg)
e1:SetOperation(c58680635.lvop)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(58680635,1))
e2:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,58680635+1)
e2:SetTarget(c58680635.drtg)
e2:SetOperation(c58680635.drop)
c:RegisterEffect(e2)
end
function c58680635.thfilter(c)
return c:IsCode(20802187) and c:IsAbleToHand()
end
function c58680635.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return not c:IsLevel(4) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c58680635.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and not c:IsLevel(4) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(4)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
if c:IsLevel(4) and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c58680635.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(58680635,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c58680635.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
end
function c58680635.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and chkc:IsAbleToGrave() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,1,c) and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,1,1,c)
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c58680635.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local g=Group.FromCards(c,tc)
if Duel.SendtoGrave(g,REASON_EFFECT)>0 and g:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)==2 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
--トイ・ソルジャー
local s,id,o=GetID()
function s.initial_effect(c)
--Set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MONSTER_SSET)
e1:SetValue(TYPE_SPELL)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
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,id)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetCountLimit(1,id+o)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end
s.set_as_spell=true
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_SZONE) and c:IsPreviousPosition(POS_FACEDOWN)
end
function s.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 s.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function s.thfilter(c,check)
return c:IsAbleToHand()
and (c:IsCode(24878656) or (check and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsLevel(4)))
end
function s.checkfilter(c)
return c:IsFaceup() and c:IsCode(24878656)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local check=Duel.IsExistingMatchingCard(s.checkfilter,tp,LOCATION_ONFIELD,0,1,nil)
return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,check)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.IsExistingMatchingCard(s.checkfilter,tp,LOCATION_ONFIELD,0,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,check)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--集いし光
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCost(s.descost)
e2:SetTarget(s.destg)
e2:SetOperation(s.desop)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(s.filter))
e3:SetValue(s.val)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetCountLimit(1)
e4:SetCondition(s.negcon)
e4:SetOperation(s.negop)
c:RegisterEffect(e4)
end
function s.cfilter(c)
return (c:IsSetCard(0xc2) or c:IsLevel(7,8) and c:IsRace(RACE_DRAGON))
and c:IsType(TYPE_SYNCHRO) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_GRAVE,0,1,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_MZONE,0,1,1,nil)
local g2=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
end
function s.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(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.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
function s.filter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsType(TYPE_MONSTER) and c:IsLevelAbove(7)
end
function s.val(e,c)
return Duel.GetMatchingGroupCount(s.filter,e:GetHandlerPlayer(),LOCATION_REMOVED,0,nil)*400
end
function s.negfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO) and c:IsType(TYPE_MONSTER)
end
function s.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.IsExistingMatchingCard(s.negfilter,tp,LOCATION_REMOVED,0,1,nil)
end
function s.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateAttack()
end
--トイ・タンク
local s,id,o=GetID()
function s.initial_effect(c)
--Set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MONSTER_SSET)
e1:SetValue(TYPE_SPELL)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(69925461,0))
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,id)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--release & spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(69925461,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id+o)
e3:SetCost(s.spcost)
e3:SetTarget(s.sptg1)
e3:SetOperation(s.spop1)
c:RegisterEffect(e3)
end
s.set_as_spell=true
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_SZONE) and c:IsPreviousPosition(POS_FACEDOWN)
end
function s.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 s.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function s.spfilter(c,e,tp,check)
return c:IsLevelBelow(6) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (c:IsLocation(LOCATION_HAND) or (check and not c:IsCode(69925461)))
end
function s.checkfilter(c)
return c:IsFaceup() and c:IsCode(24878656)
end
function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local check=Duel.IsExistingMatchingCard(s.checkfilter,tp,LOCATION_ONFIELD,0,1,nil)
return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp,check)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function s.spop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local check=Duel.IsExistingMatchingCard(s.checkfilter,tp,LOCATION_ONFIELD,0,1,nil)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp,check)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--石油採掘
function c74055055.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(74055055,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,74055055+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c74055055.target)
e1:SetOperation(c74055055.activate)
c:RegisterEffect(e1)
end
function c74055055.filter(c,e)
return c:IsType(TYPE_MONSTER) and c:IsLevelBelow(4) and c:IsAttribute(ATTRIBUTE_FIRE)
and c:IsAbleToHand() and c:IsCanBeEffectTarget(e)
end
function c74055055.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c74055055.filter(chkc,e) end
local g=Duel.GetMatchingGroup(c74055055.filter,tp,LOCATION_GRAVE,0,nil,e)
if chk==0 then return g:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,2)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,sg:GetCount(),0,0)
end
function c74055055.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
end
end
--シンクロ・パニック
function c83962752.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(83962752,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DESTROYED)
e1:SetCondition(c83962752.condition)
e1:SetTarget(c83962752.target)
e1:SetOperation(c83962752.activate)
c:RegisterEffect(e1)
--summon limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetTarget(c83962752.splimit)
c:RegisterEffect(e2)
end
function c83962752.spcfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelAbove(1)
end
function c83962752.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsType(TYPE_SYNCHRO)
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c83962752.gcheck(g,tp,ec)
return g:FilterCount(Card.IsType,nil,TYPE_TUNER)==1 and g:GetSum(Card.GetLevel)==ec:GetLevel()
end
function c83962752.tgfilter(c,e,tp,ct)
local g=Duel.GetMatchingGroup(c83962752.spcfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
return c:IsCanBeEffectTarget(e) and c:IsLevelAbove(1) and g:CheckSubGroup(c83962752.gcheck,2,ct,tp,c)
end
function c83962752.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c83962752.cfilter,1,nil,tp)
end
function c83962752.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE)
local mg=eg:Filter(c83962752.cfilter,nil,tp):Filter(c83962752.tgfilter,nil,e,tp,ct)
if chk==0 then return mg:GetCount()>0 and not Duel.IsPlayerAffectedByEffect(tp,59822133) end
local g=mg
if mg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
g=mg:Select(tp,1,1,nil)
end
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(c83962752.descon)
e1:SetOperation(c83962752.desop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,3)
c:SetTurnCounter(0)
c:RegisterEffect(e1)
end
function c83962752.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(c83962752.spcfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
if tc:IsRelateToEffect(e) and g:CheckSubGroup(c83962752.gcheck,2,ct,tp,tc) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c83962752.gcheck,false,2,ct,tp,tc)
local sc=sg:GetFirst()
while sc do
Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(83962752,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
sc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
sc:RegisterEffect(e2)
sc=sg:GetNext()
end
Duel.SpecialSummonComplete()
end
end
function c83962752.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c83962752.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct==3 then
Duel.Destroy(c,REASON_RULE)
end
end
function c83962752.splimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_SYNCHRO)==SUMMON_TYPE_SYNCHRO
end
--エレクトロ・ガンナー
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1)
e3:SetCondition(s.atkcon)
e3:SetTarget(s.atktg)
e3:SetOperation(s.atkop)
c:RegisterEffect(e3)
end
function s.spfilter(c,tp)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsSummonPlayer(tp) and c:IsFaceup()
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.spfilter,1,nil,tp)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.tgfilter(c)
return c:IsRace(RACE_PYRO) and c:IsLevel(8) and c:IsAbleToGrave()
end
function s.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
and Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function s.atkfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsFaceup()
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.atkfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(300)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--サクリファイス・ランクアップ
function c94185340.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(94185340,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,94185340+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c94185340.target)
e1:SetOperation(c94185340.activate)
c:RegisterEffect(e1)
end
function c94185340.filter1(c,e,tp)
local rk=c:GetRank()
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetOverlayCount()>=2
and Duel.IsExistingMatchingCard(c94185340.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,rk+1)
end
function c94185340.filter2(c,e,tp,rk)
return c:IsRank(rk) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c94185340.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c94185340.filter1(chkc,e,tp) end
if chk==0 then return Duel.IsPlayerCanRemove(tp)
and Duel.IsExistingTarget(c94185340.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c94185340.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c94185340.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local g=tc:GetOverlayGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g:FilterSelect(tp,Card.IsAbleToRemove,2,2,nil,POS_FACEUP)
if #rg>0 and Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)==2 and tc:IsFaceup() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c94185340.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetRank()+1)
local sc=sg:GetFirst()
if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(94185340,1))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
sc:RegisterEffect(e1)
end
Duel.SpecialSummonComplete()
end
end
--地縛共振
function c95207988.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(95207988,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,95207988)
e2:SetCondition(c95207988.damcon)
e2:SetTarget(c95207988.damtg)
e2:SetOperation(c95207988.damop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(95207988,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BE_BATTLE_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,95207988+1)
e3:SetCondition(c95207988.descon)
e3:SetTarget(c95207988.destg)
e3:SetOperation(c95207988.desop)
c:RegisterEffect(e3)
end
function c95207988.cfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonLocation(LOCATION_EXTRA)
and not c:IsType(TYPE_TOKEN)
and c:IsReason(REASON_EFFECT)
end
function c95207988.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c95207988.cfilter,1,nil,tp)
end
function c95207988.tgfilter(c,e)
return c:IsCanBeEffectTarget(e) and not c:IsAttack(0)
end
function c95207988.damtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local mg=eg:Filter(c95207988.cfilter,nil,tp):Filter(c95207988.tgfilter,nil,e)
if chkc then return mg:IsContains(chkc) end
if chk==0 then return mg:GetCount()>0 end
local g=mg
if mg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
g=mg:Select(tp,1,1,nil)
end
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,0)
end
function c95207988.damop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Damage(tp,tc:GetAttack()/2,REASON_EFFECT,true)
Duel.Damage(1-tp,tc:GetAttack()/2,REASON_EFFECT,true)
Duel.RDComplete()
end
end
function c95207988.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return tc:IsControler(tp) and tc:IsFaceup() and tc:IsAttribute(ATTRIBUTE_DARK)
and tc:IsType(TYPE_SYNCHRO) and tc:IsSummonLocation(LOCATION_EXTRA)
end
function c95207988.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c95207988.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
--漆黒の太陽
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--reccover
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1,id)
e2:SetCondition(s.reccon)
e2:SetTarget(s.rectg)
e2:SetOperation(s.recop)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_CUSTOM+id)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,id+o)
e3:SetTarget(s.autg)
e3:SetOperation(s.auop)
c:RegisterEffect(e3)
aux.RegisterMergedDelayedEvent(c,id,EVENT_SPSUMMON_SUCCESS)
--back to hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_CUSTOM+id+o)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1,id+o*2)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
aux.RegisterMergedDelayedEvent(c,id+o,EVENT_DISCARD)
end
function s.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousControler(tp)
and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
end
function s.reccon(e,tp,eg,ep,ev,re,r,rp)
local dg=eg:Filter(s.cfilter,nil,tp)
local atk=dg:GetSum(Card.GetTextAttack)
e:SetLabel(atk)
return atk>0
end
function s.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,e:GetLabel())
end
function s.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
function s.aufilter(c,tp,e)
return c:IsFaceup() and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_GRAVE)
and c:IsLocation(LOCATION_MZONE) and (not e or c:IsCanBeEffectTarget(e))
end
function s.autg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=eg:Filter(s.aufilter,nil,tp,e)
if chkc then return g:IsContains(chkc) end
if chk==0 then return #g>0 end
local tg=g:Clone()
if #g>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
tg=g:Select(tp,1,1,nil)
end
Duel.SetTargetCard(tg)
end
function s.auop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetTargetsRelateToChain():GetFirst()
if tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function s.thfilter(c,e,tp)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsPreviousControler(tp)
and c:IsPreviousLocation(LOCATION_HAND) and c:IsReason(REASON_DISCARD)
and c:IsCanBeEffectTarget(e) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:FilterCount(s.thfilter,nil,e,tp)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg
if #eg==1 then
tg=eg:Clone()
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
tg=eg:FilterSelect(tp,s.thfilter,1,1,nil,e,tp)
end
Duel.SetTargetCard(tg)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tg,1,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
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