Commit bb1bf2e4 authored by Nemo Ma's avatar Nemo Ma

wd 250629

parent 6cf971fe
......@@ -41,6 +41,11 @@
130002004 0
130002005 0
#WILD, I say WILD, WAHAHA
11451820 0
11591300 0
7429581 0
7429843 0
91300104 0
4058 0
575513 0
700021 0
......
No preview for this file type
expansions/pics/91300102.jpg

90.3 KB | W: | H:

expansions/pics/91300102.jpg

94.8 KB | W: | H:

expansions/pics/91300102.jpg
expansions/pics/91300102.jpg
expansions/pics/91300102.jpg
expansions/pics/91300102.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/91300103.jpg

99.3 KB | W: | H:

expansions/pics/91300103.jpg

81.3 KB | W: | H:

expansions/pics/91300103.jpg
expansions/pics/91300103.jpg
expansions/pics/91300103.jpg
expansions/pics/91300103.jpg
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
--文明自灭游戏
function c11591300.initial_effect(c)
--check
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PREDRAW)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCountLimit(1,11591300+EFFECT_COUNT_CODE_DUEL)
--e1:SetCondition(c11591300.condition)
e1:SetOperation(c11591300.operation)
c:RegisterEffect(e1)
end
function c11591300.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.Hint(HINT_CARD,0,11591300)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCondition(c11591300.lkcon)
e1:SetOperation(c11591300.lkop)
Duel.RegisterEffect(e1,tp)
end
function c11591300.lkcon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp and re:IsHasType(EFFECT_TYPE_ACTIONS)
end
function c11591300.lkop(e,tp,eg,ep,ev,re,r,rp)
local WIN_REASON_CIVILISATION_EXTINCTION_GAME = 0x81
Duel.Hint(HINT_CARD,0,11591300)
if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)==0 then
Duel.Win(1-tp,WIN_REASON_CIVILISATION_EXTINCTION_GAME)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,Card.IsLinkSummonable,tp,LOCATION_EXTRA,0,1,1,nil,nil):GetFirst()
if sc then
Duel.LinkSummon(tp,sc,nil)
else
Duel.Win(1-tp,WIN_REASON_CIVILISATION_EXTINCTION_GAME)
end
end
end
--冲锋型神威骑士
function c24501001.initial_effect(c)
--to grave
--spsummon-self
local e1=Effect.CreateEffect(c)
e1:SetHintTiming(TIMING_DRAW_PHASE)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e1:SetDescription(aux.Stringid(24501001,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c24501001.tgcost)
e1:SetTarget(c24501001.tgtg)
e1:SetOperation(c24501001.tgop)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCost(c24501001.cost)
e1:SetTarget(c24501001.sptg)
e1:SetOperation(c24501001.spop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetDescription(aux.Stringid(24501001,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND+LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCost(c24501001.cost)
e2:SetTarget(c24501001.destg)
e2:SetOperation(c24501001.desop)
c:RegisterEffect(e2)
--to deck
--deckdes
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TODECK+CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(c24501001.tdcon)
e3:SetTarget(c24501001.tdtg)
e3:SetOperation(c24501001.tdop)
e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e3:SetCondition(c24501001.tgcon)
e3:SetTarget(c24501001.tgtg)
e3:SetOperation(c24501001.tgop)
c:RegisterEffect(e3)
end
--tg
function c24501001.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
function c24501001.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c24501001.tgfilter(c)
return c:IsSetCard(0x501) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
function c24501001.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c24501001.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24501001.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c24501001.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c24501001.tgfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) and Duel.IsPlayerCanDiscardDeck(tp,3) and Duel.SelectYesNo(tp,aux.Stringid(24501001,0)) then
function c24501001.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.IsPlayerCanDiscardDeck(tp,2) and Duel.SelectYesNo(tp,aux.Stringid(24501001,2)) then
Duel.BreakEffect()
Duel.DiscardDeck(tp,3,REASON_EFFECT)
Duel.DiscardDeck(tp,2,REASON_EFFECT)
end
end
function c24501001.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,1,0,0)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD)
end
function c24501001.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil):GetFirst()
if not tc then return end
Duel.HintSelection(Group.FromCards(tc))
if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tc=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil):GetFirst()
if not tc then return end
Duel.HintSelection(Group.FromCards(tc))
if Duel.SendtoGrave(tc,REASON_EFFECT)==0 or not tc:IsLocation(LOCATION_GRAVE) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(c24501001.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c24501001.tdcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetActivateLocation()==LOCATION_GRAVE and re:GetHandler()~=e:GetHandler()
function c24501001.aclimit(e,re,tp)
local c=re:GetHandler()
local tc=e:GetLabelObject()
return c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
end
function c24501001.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,tp,LOCATION_GRAVE)
function c24501001.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c24501001.tdop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKBOTTOM,REASON_EFFECT)~=0 and Duel.IsPlayerCanDiscardDeck(tp,3) and Duel.SelectYesNo(tp,aux.Stringid(24501001,0)) then
Duel.BreakEffect()
Duel.DiscardDeck(tp,3,REASON_EFFECT)
function c24501001.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,3)
end
function c24501001.thfilter(c)
return c:IsSetCard(0x501) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and aux.NecroValleyFilter()(c)
end
function c24501001.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(1-tp,3,REASON_EFFECT)--if Duel.DiscardDeck(1-tp,3,REASON_EFFECT)==0 then return end
local og=Duel.GetOperatedGroup()
local g=og:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
--if #g==0 then return end
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
if Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)>=5 and Duel.IsExistingMatchingCard(c24501001.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(24501001,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,c24501001.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
......@@ -5,104 +5,109 @@ function c24501003.initial_effect(c)
c:EnableReviveLimit()
--set
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(c24501003.setcon)
e1:SetTarget(c24501003.settg)
e1:SetOperation(c24501003.setop)
e1:SetOperation(c24501003.regop)
c:RegisterEffect(e1)
--destroy
--spsummon
local ge2=Effect.CreateEffect(c)
ge2:SetDescription(aux.Stringid(24501003,0))
ge2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
ge2:SetType(EFFECT_TYPE_QUICK_O)
ge2:SetCode(EVENT_FREE_CHAIN)
ge2:SetRange(LOCATION_GRAVE)
ge2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
ge2:SetTarget(c24501003.sptg)
ge2:SetOperation(c24501003.spop)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c24501003.cost)
e2:SetTarget(c24501003.destg)
e2:SetOperation(c24501003.desop)
e2:SetTargetRange(LOCATION_GRAVE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x501))
e2:SetLabelObject(ge2)
c:RegisterEffect(e2)
--spsummon
--search
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetDescription(aux.Stringid(24501003,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetTarget(c24501003.sptg)
e3:SetOperation(c24501003.spop)
e3:SetTarget(c24501003.thtg)
e3:SetOperation(c24501003.thop)
c:RegisterEffect(e3)
end
function c24501003.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
function c24501003.regop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetTurnPlayer()==tp and 2 or 1
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TO_HAND)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_GRAVE))
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,ct)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_TO_DECK)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(0,1)
e3:SetTarget(c24501003.splimit)
e3:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,ct)
Duel.RegisterEffect(e3,tp)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e4,tp)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
Duel.RegisterEffect(e5,tp)
end
function c24501003.setfilter(c,tp)
return c:IsCode(24501035) and not c:IsForbidden() or Duel.GetFieldGroupCount(tp,LOCATION_FZONE,0)>0 and c:IsSetCard(0x501) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:IsLocation(LOCATION_GRAVE)
function c24501003.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return Duel.IsExistingMatchingCard(Card.IsCode,e:GetOwnerPlayer(),0,LOCATION_GRAVE,1,nil,c:GetCode())
end
function c24501003.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24501003.setfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end
function c24501003.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c24501003.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,c24501003.setfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if not tc then return end
if tc:IsType(TYPE_FIELD) then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
function c24501003.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(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(24501003,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,1,nil):GetFirst()
if not tc then return end
Duel.HintSelection(Group.FromCards(tc))
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function c24501003.tdfilter(c)
return c:IsSetCard(0x501) and c:IsAbleToDeckAsCost()
end
function c24501003.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24501003.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c24501003.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_COST)
end
function c24501003.chkfilter(c)
return c:IsSetCard(0x501) and c:IsFaceup()
function c24501003.thfilter(c)
return c:IsSetCard(0x501) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c24501003.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(c24501003.chkfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)>0 and Duel.GetFlagEffect(tp,24501003)<ct end
Duel.RegisterFlagEffect(tp,24501003,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,1-tp,LOCATION_ONFIELD)
end
function c24501003.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
if #g==0 then return end
local sg=g:RandomSelect(tp,1)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
function c24501003.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) then e:SetLabel(1) else e:SetLabel(0) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c24501003.spfilter(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsLevelAbove(1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c24501003.gcheck(sg,lv)
return sg:FilterCount(Card.IsType,nil,TYPE_TUNER)==1 and sg:GetSum(Card.GetLevel)==lv
end
function c24501003.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetMZoneCount(tp)
local g=Duel.GetMatchingGroup(c24501003.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133) and ft>=2
and #g>0 and g:CheckSubGroup(c24501003.gcheck,2,ft,e:GetHandler():GetLevel()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_GRAVE)
return c:IsSetCard(0x501) and not c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and aux.NecroValleyFilter()(c)
end
function c24501003.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetMZoneCount(tp)
if not e:GetHandler():IsRelateToEffect(e) or ft<2 or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
local g=Duel.GetMatchingGroup(c24501003.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c24501003.gcheck,false,2,ft,e:GetHandler():GetLevel())
if #sg>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
function c24501003.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c24501003.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
if e:GetLabel()==1 and Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(c24501003.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(24501003,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,c24501003.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
......@@ -3,102 +3,145 @@ function c24501006.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsRace,RACE_MACHINE),1)
c:EnableReviveLimit()
--set
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(c24501006.setcon)
e1:SetTarget(c24501006.settg)
e1:SetOperation(c24501006.setop)
e1:SetOperation(c24501006.regop)
c:RegisterEffect(e1)
--damage
--set
local ge2=Effect.CreateEffect(c)
ge2:SetDescription(aux.Stringid(24501006,0))
ge2:SetCategory(CATEGORY_DISABLE)
ge2:SetType(EFFECT_TYPE_QUICK_O)
ge2:SetCode(EVENT_FREE_CHAIN)
ge2:SetRange(LOCATION_GRAVE)
ge2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
ge2:SetTarget(c24501006.settg)
ge2:SetOperation(c24501006.setop)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c24501006.cost)
e2:SetTarget(c24501006.damtg)
e2:SetOperation(c24501006.damop)
e2:SetTargetRange(LOCATION_GRAVE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x501))
e2:SetLabelObject(ge2)
c:RegisterEffect(e2)
--spsummon
--search
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetDescription(aux.Stringid(24501006,2))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetTarget(c24501006.sptg)
e3:SetOperation(c24501006.spop)
e3:SetTarget(c24501006.thtg)
e3:SetOperation(c24501006.thop)
c:RegisterEffect(e3)
end
function c24501006.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
function c24501006.regop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetTurnPlayer()==tp and 2 or 1
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_REMOVE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetTarget(c24501006.rmlimit)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,ct)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetOperation(c24501006.disop)
e2:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,ct)
Duel.RegisterEffect(e2,tp)
end
function c24501006.setfilter(c,tp)
return c:IsCode(24501035) and not c:IsForbidden() or Duel.GetFieldGroupCount(tp,LOCATION_FZONE,0)>0 and c:IsSetCard(0x501) and not c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:IsLocation(LOCATION_GRAVE)
function c24501006.rmlimit(e,c,rp,r,re)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(1-e:GetHandlerPlayer())
end
function c24501006.disop(e,tp,eg,ep,ev,re,r,rp)
local code=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_CODE)
if Duel.IsExistingMatchingCard(Card.IsCode,tp,0,LOCATION_GRAVE,1,nil,code) then
Duel.Hint(HINT_CARD,0,24501006)
Duel.NegateEffect(ev)
end
end
function c24501006.splimit(e,c)
return c:IsLocation(LOCATION_GRAVE)
end
function c24501006.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24501006.setfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c24501006.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,c24501006.setfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if not tc then return end
if tc:IsType(TYPE_FIELD) then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SSet(tp,c)~=0 then
if c:IsType(TYPE_QUICKPLAY) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
if c:IsType(TYPE_TRAP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
if Duel.IsExistingMatchingCard(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(24501006,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local tc=Duel.SelectMatchingCard(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil):GetFirst()
if not tc then return end
Duel.HintSelection(Group.FromCards(tc))
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
else
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
function c24501006.tdfilter(c)
return c:IsSetCard(0x501) and c:IsAbleToDeckAsCost()
function c24501006.thfilter(c)
return c:IsSetCard(0x501) and not c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c24501006.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24501006.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c24501006.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_COST)
end
function c24501006.chkfilter(c)
return c:IsSetCard(0x501) and c:IsFaceup()
end
function c24501006.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(c24501006.chkfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return Duel.GetFlagEffect(tp,24501006)<ct end
Duel.RegisterFlagEffect(tp,24501006,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,700)
end
function c24501006.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,700,REASON_EFFECT)
function c24501006.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) then e:SetLabel(1) else e:SetLabel(0) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c24501006.spfilter(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsLevelAbove(1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c24501006.gcheck(sg,lv)
return sg:FilterCount(Card.IsType,nil,TYPE_TUNER)==1 and sg:GetSum(Card.GetLevel)==lv
return c:IsSetCard(0x501) and not c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and aux.NecroValleyFilter()(c)
end
function c24501006.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetMZoneCount(tp)
local g=Duel.GetMatchingGroup(c24501006.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133) and ft>=2
and #g>0 and g:CheckSubGroup(c24501006.gcheck,2,ft,e:GetHandler():GetLevel()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_GRAVE)
end
function c24501006.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetMZoneCount(tp)
if not e:GetHandler():IsRelateToEffect(e) or ft<2 or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
local g=Duel.GetMatchingGroup(c24501006.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c24501006.gcheck,false,2,ft,e:GetHandler():GetLevel())
if #sg>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
function c24501006.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c24501006.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
if e:GetLabel()==1 and Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(c24501006.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(24501006,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,c24501006.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
......@@ -2,39 +2,43 @@
function c24501010.initial_effect(c)
--spsummon-self
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetDescription(aux.Stringid(24501010,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c24501010.condition)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCost(c24501010.cost)
e1:SetTarget(c24501010.sptg)
e1:SetOperation(c24501010.spop)
c:RegisterEffect(e1)
--search
--synchro
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
--e2:SetCondition(c24501010.condition)
e2:SetTarget(c24501010.thtg)
e2:SetOperation(c24501010.thop)
e2:SetDescription(aux.Stringid(24501010,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND+LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCost(c24501010.cost)
e2:SetTarget(c24501010.sytg)
e2:SetOperation(c24501010.syop)
c:RegisterEffect(e2)
--deckdes
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DECKDES+CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e3:SetCondition(c24501010.tgcon)
e3:SetTarget(c24501010.tgtg)
e3:SetOperation(c24501010.tgop)
c:RegisterEffect(e3)
end
function c24501010.chkfilter(c)
return c:IsSetCard(0x501) and c:IsFaceupEx()
end
function c24501010.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c24501010.chkfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil)
function c24501010.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c24501010.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -43,51 +47,51 @@ function c24501010.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c24501010.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetMZoneCount(tp)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.IsPlayerCanDiscardDeck(tp,2) and Duel.SelectYesNo(tp,aux.Stringid(24501010,2)) then
Duel.BreakEffect()
Duel.DiscardDeck(tp,2,REASON_EFFECT)
end
end
function c24501010.thfilter(c)
return c:IsSetCard(0x501) and c:IsAbleToHand()
function c24501010.mfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceupEx()
end
function c24501010.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24501010.thfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
function c24501010.sytg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(c24501010.mfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil,mg) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c24501010.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,c24501010.thfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c)
end
end
function c24501010.syop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(c24501010.mfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,1,nil,nil,mg)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg)
end
function c24501010.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c24501010.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,3)
end
function c24501010.gthfilter(c)
function c24501010.thfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAbleToHand() and aux.NecroValleyFilter()(c)
end
function c24501010.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(tp,3,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) and Duel.IsExistingMatchingCard(c24501010.gthfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(24501010,0)) then
Duel.BreakEffect()
Duel.DiscardDeck(1-tp,3,REASON_EFFECT)--if Duel.DiscardDeck(1-tp,3,REASON_EFFECT)==0 then return end
local og=Duel.GetOperatedGroup()
local g=og:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
--if #g==0 then return end
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
if Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)>=5 and Duel.IsExistingMatchingCard(c24501010.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(24501010,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,c24501010.gthfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if tg:GetCount()>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
end
local tg=Duel.SelectMatchingCard(tp,c24501010.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
--远程型神威骑士
function c24501013.initial_effect(c)
--to grave
--spsummon-self
local e1=Effect.CreateEffect(c)
e1:SetHintTiming(TIMING_DRAW_PHASE)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e1:SetDescription(aux.Stringid(24501013,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c24501013.tgcost)
e1:SetTarget(c24501013.tgtg)
e1:SetOperation(c24501013.tgop)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCost(c24501013.cost)
e1:SetTarget(c24501013.sptg)
e1:SetOperation(c24501013.spop)
c:RegisterEffect(e1)
--destroy
--disable
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(c24501013.destg)
e2:SetOperation(c24501013.desop)
e2:SetDescription(aux.Stringid(24501013,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND+LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCost(c24501013.cost)
e2:SetTarget(c24501013.distg)
e2:SetOperation(c24501013.disop)
c:RegisterEffect(e2)
--to deck
--deckdes
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TODECK+CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(c24501013.tdcon)
e3:SetTarget(c24501013.tdtg)
e3:SetOperation(c24501013.tdop)
e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e3:SetCondition(c24501013.tgcon)
e3:SetTarget(c24501013.tgtg)
e3:SetOperation(c24501013.tgop)
c:RegisterEffect(e3)
end
--1
function c24501013.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
function c24501013.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c24501013.tgfilter(c)
return c:IsSetCard(0x501) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGrave()
function c24501013.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c24501013.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24501013.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c24501013.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c24501013.tgfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) and Duel.IsPlayerCanDiscardDeck(tp,3) and Duel.SelectYesNo(tp,aux.Stringid(24501013,0)) then
function c24501013.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.IsPlayerCanDiscardDeck(tp,2) and Duel.SelectYesNo(tp,aux.Stringid(24501013,2)) then
Duel.BreakEffect()
Duel.DiscardDeck(tp,3,REASON_EFFECT)
Duel.DiscardDeck(tp,2,REASON_EFFECT)
end
end
--2
function c24501013.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP) end
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
function c24501013.mfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceupEx()
end
function c24501013.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD)
end
function c24501013.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,TYPE_SPELL+TYPE_TRAP)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
function c24501013.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil):GetFirst()
if not tc then return end
Duel.HintSelection(Group.FromCards(tc))
if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local tc=Duel.SelectMatchingCard(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil):GetFirst()
if not tc then return end
Duel.HintSelection(Group.FromCards(tc))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
function c24501013.tdcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetActivateLocation()==LOCATION_GRAVE and re:GetHandler()~=e:GetHandler()
function c24501013.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c24501013.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,tp,LOCATION_GRAVE)
function c24501013.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,3)
end
function c24501013.tdop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKBOTTOM,REASON_EFFECT)~=0 and Duel.IsPlayerCanDiscardDeck(tp,3) and Duel.SelectYesNo(tp,aux.Stringid(24501013,0)) then
Duel.BreakEffect()
Duel.DiscardDeck(tp,3,REASON_EFFECT)
function c24501013.thfilter(c)
return c:IsSetCard(0x501) and not c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and aux.NecroValleyFilter()(c)
end
function c24501013.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(1-tp,3,REASON_EFFECT)--if Duel.DiscardDeck(1-tp,3,REASON_EFFECT)==0 then return end
local og=Duel.GetOperatedGroup()
local g=og:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
--if #g==0 then return end
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
if Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)>=5 and Duel.IsExistingMatchingCard(c24501013.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(24501013,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,c24501013.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
......@@ -2,44 +2,43 @@
function c24501015.initial_effect(c)
--spsummon-self
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
--e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetDescription(aux.Stringid(24501015,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c24501015.spcon)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCost(c24501015.cost)
e1:SetTarget(c24501015.sptg)
e1:SetOperation(c24501015.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_DECK)
e2:SetCountLimit(1,24501015)
--synchro
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(24501015,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND+LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCost(c24501015.cost)
e2:SetTarget(c24501015.sytg)
e2:SetOperation(c24501015.syop)
c:RegisterEffect(e2)
--set
--deckdes
local e3=Effect.CreateEffect(c)
--e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetTarget(c24501015.settg)
e3:SetOperation(c24501015.setop)
e3:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e3:SetCondition(c24501015.tgcon)
e3:SetTarget(c24501015.tgtg)
e3:SetOperation(c24501015.tgop)
c:RegisterEffect(e3)
--to grave
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetTarget(c24501015.tgtg)
e4:SetOperation(c24501015.tgop)
c:RegisterEffect(e4)
end
-- 1
function c24501015.chkfilter(c)
return c:IsLevelAbove(8) and c:IsSetCard(0x501) and c:IsFaceup()
end
function c24501015.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c24501015.chkfilter,tp,LOCATION_MZONE,0,1,nil)
function c24501015.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c24501015.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -48,49 +47,51 @@ function c24501015.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c24501015.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetMZoneCount(tp)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.IsPlayerCanDiscardDeck(tp,2) and Duel.SelectYesNo(tp,aux.Stringid(24501015,2)) then
Duel.BreakEffect()
Duel.DiscardDeck(tp,2,REASON_EFFECT)
end
end
-- 2
function c24501015.tffilter(c,tp)
return c:IsSetCard(0x501) and c:IsType(TYPE_CONTINUOUS) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
function c24501015.mfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceupEx()
end
function c24501015.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c24501015.tffilter,tp,LOCATION_DECK,0,1,nil,tp) end
function c24501015.sytg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(c24501015.mfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil,mg) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c24501015.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
local g=Duel.GetMatchingGroup(c24501015.tffilter,tp,LOCATION_DECK,0,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tg=g:SelectSubGroup(tp,aux.dncheck,false,1,math.min(ft,2))
if #tg==0 then return end
for tc in aux.Next(tg) do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
local c=e:GetHandler()
local sg=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,c)
if sg:GetCount()>0 and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsFaceup() and Duel.SelectYesNo(tp,aux.Stringid(24501015,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=sg:Select(tp,1,1,nil):GetFirst()
Duel.SynchroSummon(tp,sc,c)
end
function c24501015.syop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(c24501015.mfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,1,nil,nil,mg)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg)
end
function c24501015.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
-- 3
function c24501015.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,3)
end
function c24501015.thfilter(c)
return c:IsSetCard(0x501) and c:IsAbleToHand() and aux.NecroValleyFilter()(c)
end
function c24501015.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(tp,3,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) and Duel.IsExistingMatchingCard(c24501015.tffilter,tp,LOCATION_GRAVE,0,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(24501015,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,c24501015.tffilter,tp,LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.DiscardDeck(1-tp,3,REASON_EFFECT)--if Duel.DiscardDeck(1-tp,3,REASON_EFFECT)==0 then return end
local og=Duel.GetOperatedGroup()
local g=og:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
--if #g==0 then return end
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
if Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)>=5 and Duel.IsExistingMatchingCard(c24501015.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(24501015,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,c24501015.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
......@@ -9,59 +9,76 @@ function c24501017.initial_effect(c)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON+CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION+CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
--e1:SetCost(c24501017.cost)
e1:SetCost(c24501017.cost)
e1:SetTarget(c24501017.target)
e1:SetOperation(c24501017.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetDescription(aux.Stringid(24501017,2))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(c24501017.thcost)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
--e2:SetCost(c24501017.thcost)
e2:SetTarget(c24501017.thtg)
e2:SetOperation(c24501017.thop)
c:RegisterEffect(e2)
end
function c24501017.exfilter(c)
return c:IsCode(24501036) and c:IsFaceup()
return c:IsSetCard(0x501) and c:IsType(TYPE_SYNCHRO) and c:IsFaceup()
end
function c24501017.excondition(e)
return Duel.IsExistingMatchingCard(c24501017.exfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function c24501017.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,1,c,tp)
Duel.SendtoGrave(g,REASON_COST)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,2) end
Duel.DiscardDeck(tp,2,REASON_COST)
end
function c24501017.cfilter(c,e,tp,chk)
return (c:IsSetCard(0x501) and Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) or (c:IsSetCard(0x501) and c:IsType(TYPE_MONSTER) or chk and c:IsRace(RACE_MACHINE)) and c:IsAbleToHand()
function c24501017.spfilter(c,e,tp)
return c:IsSetCard(0x501) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c24501017.thfilter(c)
return c:IsSetCard(0x501) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and aux.NecroValleyFilter()(c)
end
function c24501017.checkfilter(c)
return c:IsSetCard(0x501) and c:IsFaceup()
function c24501017.tgfilter(c)
return c:IsSetCard(0x501) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c24501017.target(e,tp,eg,ep,ev,re,r,rp,chk)
local check=Duel.IsExistingMatchingCard(c24501017.checkfilter,tp,LOCATION_MZONE,0,1,nil)
if chk==0 then return
Duel.IsExistingMatchingCard(c24501017.cfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp,check)
end
if chk==0 then return Duel.IsExistingMatchingCard(c24501017.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c24501017.activate(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.IsExistingMatchingCard(c24501017.checkfilter,tp,LOCATION_MZONE,0,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c24501017.cfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp,check):GetFirst()
if not (sc:IsSetCard(0x501) and Duel.GetMZoneCount(tp)>0 and sc:IsCanBeSpecialSummoned(e,0,tp,false,false)) and sc:IsAbleToHand() or Duel.SelectOption(tp,1190,1152)==0 then
Duel.SendtoHand(sc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sc)
else
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c24501017.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if not sc or Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)==0 then return end
local b1=Duel.IsExistingMatchingCard(c24501017.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c24501017.tgfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil)
if not (b1 or b2) or Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)<5 then return end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(24501017,2)},
{b2,aux.Stringid(24501017,3)},
{true,aux.Stringid(24501017,4)})
if op==1 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,c24501017.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil):GetFirst()
if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
elseif op==2 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c24501017.tgfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,2,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
function c24501017.tdfilter(c)
......@@ -73,23 +90,20 @@ function c24501017.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,c24501017.tdfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_COST)
end
function c24501017.tgfilter2(c)
return c:IsSetCard(0x501) and c:IsFaceupEx() and c:IsAbleToGrave()
end
function c24501017.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
if chk==0 then return Duel.IsExistingMatchingCard(c24501017.tgfilter2,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) and e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c24501017.thfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAbleToHand()
end
function c24501017.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c24501017.tgfilter2,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
if #g==0 then return end
Duel.HintSelection(g)
if Duel.SendtoGrave(g,REASON_EFFECT)==0 or not g:GetFirst():IsLocation(LOCATION_GRAVE) then return end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.SendtoHand(c,nil,REASON_EFFECT)==0 then return end
Duel.ConfirmCards(1-tp,c)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c24501017.thfilter),tp,LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(24501017,1)) then
Duel.BreakEffect()
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 c24501019.initial_effect(c)
--act in hand
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(24501019,2))
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCondition(c24501019.handcon)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c24501019.condition)
e1:SetTarget(c24501019.target)
e1:SetOperation(c24501019.activate)
c:RegisterEffect(e1)
--set
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(24501019,0))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCost(c24501019.cost)
e2:SetTarget(c24501019.settg)
e2:SetOperation(c24501019.setop)
--e2:SetCost(c24501019.cost)
e2:SetTarget(c24501019.thtg)
e2:SetOperation(c24501019.thop)
c:RegisterEffect(e2)
end
function c24501019.handcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_GRAVE,0)>=5
end
function c24501019.chkfilter(c)
return c:IsSetCard(0x501) and c:IsFaceup()
return c:IsCode(24501025) and c:IsFaceup()
end
function c24501019.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c24501019.chkfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsChainNegatable(ev) and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE))
return Duel.IsExistingMatchingCard(c24501019.chkfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c24501019.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND+LOCATION_ONFIELD)
if chk==0 then return #g>0 and Duel.IsPlayerCanDraw(1-tp) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0)
end
function c24501019.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND+LOCATION_ONFIELD)
if #g==0 then return end
local ct=Duel.SendtoGrave(g,REASON_RULE)
if ct==0 or g:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)==0 then return end
Duel.BreakEffect()
Duel.Draw(1-tp,ct,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
for tc in aux.Next(og) do
if tc:IsLocation(LOCATION_GRAVE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(c24501019.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function c24501019.aclimit(e,re,tp)
local c=re:GetHandler()
local tc=e:GetLabelObject()
return c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
end
function c24501019.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,3) end
Duel.DiscardDeck(tp,3,REASON_COST)
end
function c24501019.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)
function c24501019.tgfilter2(c)
return c:IsSetCard(0x501) and c:IsFaceupEx() and c:IsAbleToGrave()
end
function c24501019.setop(e,tp,eg,ep,ev,re,r,rp)
function c24501019.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24501019.tgfilter2,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) and e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c24501019.thfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAbleToHand()
end
function c24501019.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c24501019.tgfilter2,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
if #g==0 then return end
Duel.HintSelection(g)
if Duel.SendtoGrave(g,REASON_EFFECT)==0 or not g:GetFirst():IsLocation(LOCATION_GRAVE) then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SSet(tp,c)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(24501019,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
if not c:IsRelateToEffect(e) or Duel.SendtoHand(c,nil,REASON_EFFECT)==0 then return end
Duel.ConfirmCards(1-tp,c)
end
......@@ -7,126 +7,108 @@ function c24501021.initial_effect(c)
e0:SetCondition(c24501021.excondition)
e0:SetDescription(aux.Stringid(24501021,0))
c:RegisterEffect(e0)
--Activate1
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(24501021,1))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION+CATEGORY_SPECIAL_SUMMON)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c24501021.sytg)
e1:SetOperation(c24501021.syop)
e1:SetCost(c24501021.cost)
e1:SetTarget(c24501021.target)
e1:SetOperation(c24501021.activate)
c:RegisterEffect(e1)
--Activate2
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(24501021,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetDescription(1190)
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c24501021.sptg)
e2:SetOperation(c24501021.spop)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
--e2:SetCost(c24501021.thcost)
e2:SetTarget(c24501021.thtg)
e2:SetOperation(c24501021.thop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(c24501021.cost)
e3:SetTarget(c24501021.thtg)
e3:SetOperation(c24501021.thop)
c:RegisterEffect(e3)
end
function c24501021.exfilter(c)
return c:IsCode(24501036) and c:IsFaceup()
return c:IsSetCard(0x501) and c:IsType(TYPE_SYNCHRO) and c:IsFaceup()
end
function c24501021.excondition(e)
return Duel.IsExistingMatchingCard(c24501021.exfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function c24501021.tdfilter(c)
return (c:IsRace(RACE_MACHINE) or c:IsType(TYPE_TUNER)) and c:IsLevelAbove(1) and c:IsAbleToDeck()
end
function c24501021.gcheck(sg,e,tp)
return sg:FilterCount(Card.IsType,nil,TYPE_TUNER)==1 and sg:IsExists(Card.IsSetCard,1,nil,0x501) and Duel.IsExistingMatchingCard(c24501021.syfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,sg:GetSum(Card.GetLevel))
end
function c24501021.syfilter(c,e,tp,lv)
return c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false) and c:IsLevel(lv)
and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_SYNCHRO) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c24501021.sytg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c24501021.tdfilter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return #g>0 and g:CheckSubGroup(c24501021.gcheck,2,#g,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c24501021.syop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c24501021.tdfilter,tp,LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=g:SelectSubGroup(tp,c24501021.gcheck,false,2,#g,e,tp)
if #tg==0 then return end
local lv=tg:GetSum(Card.GetLevel)
aux.PlaceCardsOnDeckBottom(tp,tg,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,c24501021.syfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lv):GetFirst()
if sc then
Duel.SpecialSummon(sc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
function c24501021.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,2) end
Duel.DiscardDeck(tp,2,REASON_COST)
end
function c24501021.tgsfilter(c,e,tp)
return c:IsSetCard(0x501) and c:IsType(TYPE_SYNCHRO) and c:IsAbleToGrave()
and Duel.IsExistingMatchingCard(c24501021.spfilter1,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,c)
end
function c24501021.spfilter1(c,e,tp,tc)
return c:IsRace(RACE_MACHINE) and c:IsLevelBelow(tc:GetLevel()) and Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c24501021.tgnfilter(c,tp)
return c:IsSetCard(0x501) and c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_SYNCHRO) and c:IsFaceupEx() and c:IsAbleToGrave() and Duel.GetLocationCountFromEx(tp,tp,c,TYPE_SYNCHRO)>0
end
function c24501021.spfilter2(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c24501021.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c24501021.tgsfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(c24501021.tgnfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,tp) and Duel.IsExistingMatchingCard(c24501021.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp)
if chk==0 then return (b1 or b2) end
--Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
end
function c24501021.activate(e,tp,eg,ep,ev,re,r,rp)
--if Duel.DiscardDeck(tp,2,REASON_EFFECT)==0 then return end
--local g=Duel.GetOperatedGroup()
--if g:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)==0 then return end
local b1=Duel.IsExistingMatchingCard(c24501021.tgsfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(c24501021.tgnfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,tp) and Duel.IsExistingMatchingCard(c24501021.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp)
local b3=b1 and b2 and Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)>=5
if not (b1 or b2) then return end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(24501021,1)},
{b2,aux.Stringid(24501021,2)},
{b3,aux.Stringid(24501021,3)})
if op~=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c24501021.tgsfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if not tc or Duel.SendtoGrave(tc,REASON_EFFECT)==0 or not tc:IsLocation(LOCATION_GRAVE) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,c24501021.spfilter1,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp,tc):GetFirst()
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c24501021.tfilter(c,e,tp)
return c:IsSetCard(0x501) and c:IsType(TYPE_SYNCHRO) and c:IsFaceup()
and Duel.IsExistingMatchingCard(c24501021.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetLevel())
end
function c24501021.spfilter(c,e,tp,lv)
return c:IsType(TYPE_SYNCHRO) and c:IsLevel(lv) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
end
function c24501021.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c24501021.tfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c24501021.tfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c24501021.tfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c24501021.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if op~=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c24501021.tgnfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,tp):GetFirst()
if not tc or Duel.SendtoGrave(tc,REASON_EFFECT)==0 or not tc:IsLocation(LOCATION_GRAVE) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,c24501021.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetLevel()):GetFirst()
local sc=Duel.SelectMatchingCard(tp,c24501021.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if sc then
sc:SetMaterial(nil)
if Duel.SpecialSummon(sc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)>0 then
sc:CompleteProcedure()
end
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c24501021.costfilter(c)
return c:IsSetCard(0x501) and c:IsAbleToDeckAsCost()
end
function c24501021.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24501021.costfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c24501021.costfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_COST)
function c24501021.tgfilter2(c)
return c:IsSetCard(0x501) and c:IsFaceupEx() and c:IsAbleToGrave()
end
function c24501021.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
if chk==0 then return Duel.IsExistingMatchingCard(c24501021.tgfilter2,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) and e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c24501021.tdfilter2(c)
return c:IsRace(RACE_MACHINE) and c:IsAbleToDeck()
function c24501021.thfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAbleToHand()
end
function c24501021.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c24501021.tgfilter2,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
if #g==0 then return end
Duel.HintSelection(g)
if Duel.SendtoGrave(g,REASON_EFFECT)==0 or not g:GetFirst():IsLocation(LOCATION_GRAVE) then return end
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.SendtoHand(c,nil,REASON_EFFECT)==0 then return end
Duel.ConfirmCards(1-tp,c)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c24501021.tdfilter2),tp,LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(24501021,3)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoDeck(sg,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
end
end
--防护型神威骑士
function c24501023.initial_effect(c)
--special summon
--spsummon-self
local e1=Effect.CreateEffect(c)
e1:SetHintTiming(TIMING_DRAW_PHASE,TIMING_DRAW_PHASE+TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetDescription(aux.Stringid(24501023,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c24501023.spcost)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCost(c24501023.cost)
e1:SetTarget(c24501023.sptg)
e1:SetOperation(c24501023.spop)
c:RegisterEffect(e1)
--recover
--position
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(c24501023.rectg)
e2:SetOperation(c24501023.recop)
e2:SetDescription(aux.Stringid(24501023,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND+LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCost(c24501023.cost)
e2:SetTarget(c24501023.postg)
e2:SetOperation(c24501023.posop)
c:RegisterEffect(e2)
--spsummon-self
--deckdes
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_GRAVE)
--e3:SetCountLimit(1)
e3:SetCondition(c24501023.spscon)
e3:SetTarget(c24501023.spstg)
e3:SetOperation(c24501023.spsop)
e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e3:SetCondition(c24501023.tgcon)
e3:SetTarget(c24501023.tgtg)
e3:SetOperation(c24501023.tgop)
c:RegisterEffect(e3)
end
--1
function c24501023.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c24501023.spfilter(c,e,tp)
return c:IsSetCard(0x501) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function c24501023.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c24501023.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(c24501023.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,e:GetHandler(),e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
local c=e:GetHandler()
if chk==0 then return Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c24501023.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,c24501023.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.IsPlayerCanDiscardDeck(tp,2) and Duel.SelectYesNo(tp,aux.Stringid(24501023,2)) then
Duel.BreakEffect()
Duel.DiscardDeck(tp,2,REASON_EFFECT)
end
end
function c24501023.sfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c24501023.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(c24501023.sfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD)
end
function c24501023.posop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil):GetFirst()
if not tc then return end
Duel.HintSelection(Group.FromCards(tc))
if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local tc=Duel.SelectMatchingCard(tp,c24501023.sfilter,tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
if not tc then return end
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
sc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
tc:RegisterEffect(e1)
end
end
--2
function c24501023.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function c24501023.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)
function c24501023.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c24501023.spscon(e,tp,eg,ep,ev,re,r,rp)
return re:GetActivateLocation()==LOCATION_GRAVE and re:GetHandler()~=e:GetHandler()
end
function c24501023.spstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
function c24501023.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,3)
end
function c24501023.spofilter(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsType(TYPE_TUNER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function c24501023.tgfilter(c)
return c:IsSetCard(0x501) and c:IsAbleToHand()-- and aux.NecroValleyFilter()(c)
end
function c24501023.spsop(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.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(c24501023.spofilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(24501023,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,c24501023.spofilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
function c24501023.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(1-tp,3,REASON_EFFECT)--if Duel.DiscardDeck(1-tp,3,REASON_EFFECT)==0 then return end
local og=Duel.GetOperatedGroup()
local g=og:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
--if #g==0 then return end
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
if Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)>=5 and Duel.IsExistingMatchingCard(c24501023.tgfilter,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(24501023,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectMatchingCard(tp,c24501023.tgfilter,tp,LOCATION_DECK,0,1,2,nil)
Duel.SendtoGrave(tg,REASON_EFFECT)
end
end
This diff is collapsed.
......@@ -5,121 +5,134 @@ function c24501035.initial_effect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--immune
--set
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_FZONE)
e1:SetTargetRange(LOCATION_MZONE+LOCATION_SZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x501))
e1:SetValue(c24501035.efilter)
e1:SetDescription(aux.Stringid(24501035,3))
e1:SetHintTiming(TIMING_DRAW_PHASE)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
--e1:SetTarget(c24501035.settg)
e1:SetOperation(c24501035.setop)
c:RegisterEffect(e1)
--cannot remove
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_REMOVE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
--c:RegisterEffect(e2)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(1,1)
e2:SetTarget(c24501035.efilter)
c:RegisterEffect(e2)
--cannot target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(LOCATION_ONFIELD+LOCATION_GRAVE,0)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetValue(aux.indoval)
c:RegisterEffect(e3)
--to grave
--indes
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(24501035,0))
e4:SetCategory(CATEGORY_DECKDES+CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_CUSTOM+24501035)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e4:SetCondition(c24501035.tgcon)
e4:SetTarget(c24501035.tgtg)
e4:SetOperation(c24501035.tgop)
e4:SetTargetRange(LOCATION_ONFIELD,0)
e4:SetValue(1)
c:RegisterEffect(e4)
aux.RegisterMergedDelayedEvent(c,24501035,EVENT_SPSUMMON_SUCCESS)
--to deck
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(24501035,2))
e5:SetCategory(CATEGORY_TODECK)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
--e5:SetCategory(CATEGORY_TODECK)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_FZONE)
e5:SetCondition(c24501035.tdcon)
e5:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e5:SetTarget(c24501035.tdtg)
e5:SetOperation(c24501035.tdop)
c:RegisterEffect(e5)
end
function c24501035.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer() and re:IsActivated()
end
function c24501035.tfilter(c,tp)
local lv=c:GetLevel()
return c:IsType(TYPE_SYNCHRO) and c:IsFaceup() and c:IsSummonLocation(LOCATION_EXTRA)
and lv>=2 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=math.floor(lv/2)
end
function c24501035.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c24501035.tfilter,1,nil,tp)
end
function c24501035.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=eg:Filter(c24501035.tfilter,nil,tp)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and aux.IsInGroup(chkc,g) end
if chk==0 then return Duel.IsExistingTarget(aux.IsInGroup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,g) and Duel.IsPlayerCanDiscardDeck(tp,1) end
local sg
if g:GetCount()==1 then
sg=g:Clone()
Duel.SetTargetCard(sg)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
sg=Duel.SelectTarget(tp,aux.IsInGroup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,g)
function c24501035.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,1)
end
function c24501035.thfilter(c)
return c:IsSetCard(0x501) and c:IsAbleToHand()
end
function c24501035.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsLevelAbove(2) then
local lv=tc:GetLevel()
Duel.DiscardDeck(tp,math.floor(lv/2),REASON_EFFECT)
if Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c24501035.thfilter),tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(24501035,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,c24501035.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
Duel.MoveToField(c,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
if Duel.IsPlayerCanDiscardDeck(tp,2) and Duel.SelectYesNo(tp,aux.Stringid(24501035,0)) then
Duel.BreakEffect()
Duel.DiscardDeck(tp,2,REASON_EFFECT)
end
end
function c24501035.tdcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSetCard,1,nil,0x501)
function c24501035.efilter(e,c,rp,r,re)
return r&REASON_EFFECT>0
end
function c24501035.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,0,1,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c24501035.tffilter(c,tp)
return c:IsSetCard(0x501) and c:IsType(TYPE_CONTINUOUS) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
function c24501035.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil)
local b2=Duel.IsExistingMatchingCard(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND+0x30,0,1,nil) and (b1 or b2) end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(24501035,1)},
{b2,aux.Stringid(24501035,2)})
e:SetLabel(op)
if op==1 then
e:SetCategory(CATEGORY_TODECK+CATEGORY_TOGRAVE)
else
e:SetCategory(CATEGORY_TODECK+CATEGORY_DISABLE+CATEGORY_DESTROY)
end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
end
function c24501035.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetsRelateToChain()
if #g>0 and aux.PlaceCardsOnDeckBottom(tp,g)~=0 and Duel.IsExistingMatchingCard(c24501035.tffilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(24501035,3)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,c24501035.tffilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if tg:GetCount()==0 then return end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,1,nil):GetFirst()
if not tc then return end
Duel.HintSelection(Group.FromCards(tc))
if Duel.SendtoGrave(tc,REASON_EFFECT)==0 or not tc:IsLocation(LOCATION_GRAVE) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(c24501035.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tc=Duel.SelectMatchingCard(tp,aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,1,nil):GetFirst()
if not tc then return end
Duel.HintSelection(Group.FromCards(tc))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
Duel.AdjustInstantly()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
if Duel.Destroy(tc,REASON_EFFECT)==0 or not tc:IsLocation(LOCATION_GRAVE) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(c24501035.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c24501035.aclimit(e,re,tp)
local c=re:GetHandler()
local tc=e:GetLabelObject()
return c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
end
......@@ -7,101 +7,173 @@ function c24501036.initial_effect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetValue(c24501036.splimit)
c:RegisterEffect(e0)
--set
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(24501036,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CAN_FORBIDDEN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,24501036)
e1:SetCost(c24501036.setcost)
e1:SetTarget(c24501036.settg)
e1:SetOperation(c24501036.setop)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetCost(c24501036.cost)
e1:SetTarget(c24501036.sptg)
e1:SetOperation(c24501036.spop)
c:RegisterEffect(e1)
--synchro
--to hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2:SetValue(TYPE_SYNCHRO)
e2:SetDescription(aux.Stringid(24501036,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CAN_FORBIDDEN)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCost(c24501036.cost)
e2:SetTarget(c24501036.thtg)
e2:SetOperation(c24501036.thop)
c:RegisterEffect(e2)
--spsummon
--to grave(field)
local e0=Effect.CreateEffect(c)
--e0:SetDescription(aux.Stringid(24501036,3))
e0:SetCategory(CATEGORY_TOHAND)
e0:SetType(EFFECT_TYPE_QUICK_O)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CAN_FORBIDDEN)
e0:SetRange(LOCATION_MZONE)
e0:SetCountLimit(1)
--e0:SetCost(c24501036.cost)
e0:SetTarget(c24501036.ftgtg)
e0:SetOperation(c24501036.ftgop)
c:RegisterEffect(e0)
--deckdes
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(24501036,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetTarget(c24501036.sptg)
e3:SetOperation(c24501036.spop)
e3:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES+CATEGORY_DISABLE+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e3:SetCondition(c24501036.tgcon)
e3:SetTarget(c24501036.tgtg)
e3:SetOperation(c24501036.tgop)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(4,EFFECT_COUNT_CODE_CHAIN)
e4:SetCondition(c24501036.descon)
e4:SetCost(c24501036.cost)
e4:SetTarget(c24501036.destg)
e4:SetOperation(c24501036.desop)
c:RegisterEffect(e4)
end
function c24501036.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
function c24501036.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
Duel.ConfirmCards(1-tp,e:GetHandler())
end
function c24501036.stfilter(c,tp)
return c:IsCode(24501035) and c:IsType(TYPE_FIELD) and not c:IsForbidden() and c:CheckUniqueOnField(tp)
end
function c24501036.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24501036.stfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp) end
function c24501036.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function c24501036.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c24501036.stfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
end
function c24501036.chkfilter(c)
return c:IsSetCard(0x505) and not c:IsPublic()
end
function c24501036.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
if chk==0 then return Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(c24501036.chkfilter,tp,LOCATION_HAND,0,1,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c24501036.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c24501036.chkfilter,tp,LOCATION_HAND,0,1,1,aux.ExceptThisCard(e))
if g:GetCount()==0 then return end
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetMZoneCount(tp)>0 then
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c24501036.descon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return rp==1-tp and (LOCATION_HAND+LOCATION_ONFIELD)&loc~=0
function c24501036.thfilter(c)
return c:IsSetCard(0x505) and c:IsAbleToHand() and c:IsFaceupEx()
end
function c24501036.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeckAsCost,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeckAsCost,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_COST)
function c24501036.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24501036.thfilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE)
end
function c24501036.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return re:GetHandler():IsRelateToEffect(re) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,re:GetHandler(),1,0,0)
function c24501036.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c24501036.thfilter),tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,nil):GetFirst()
if tc then
Duel.HintSelection(Group.FromCards(tc))
if Duel.SendtoHand(tc,nil,REASON_EFFECT)==0 or not tc:IsLocation(LOCATION_HAND) then return end
Duel.ConfirmCards(1-tp,tc)
if not Duel.IsExistingMatchingCard(c24501036.thfilter,tp,LOCATION_DECK,0,1,nil) or not Duel.SelectYesNo(tp,aux.Stringid(24501036,2)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,c24501036.thfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
end
function c24501036.desop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
function c24501036.ftgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,nil)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NOT(Card.IsPublic),tp,LOCATION_HAND,0,1,nil) and g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c24501036.ftgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.NOT(Card.IsPublic),tp,LOCATION_HAND,0,nil)
local fg=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()==0 or fg:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local cg=g:SelectSubGroup(tp,aux.dncheck,false,1,#fg)
Duel.ConfirmCards(1-tp,cg)
Duel.ShuffleHand(tp)
local tg=fg:Select(tp,#cg,#cg,nil)
Duel.HintSelection(tg)
local ct=Duel.SendtoGrave(tg,REASON_EFFECT)
if ct==0 or tg:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE) then return end
local og=Duel.GetOperatedGroup()
for tc in aux.Next(og) do
if tc:IsLocation(LOCATION_GRAVE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(c24501036.aclimit)
e1:SetLabelObject(tc)
--e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function c24501036.aclimit(e,re,tp)
local c=re:GetHandler()
local tc=e:GetLabelObject()
return c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
end
function c24501036.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function c24501036.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,3)
end
function c24501036.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(1-tp,3,REASON_EFFECT)--if Duel.DiscardDeck(1-tp,3,REASON_EFFECT)==0 then return end
local og=Duel.GetOperatedGroup()
local g=og:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
--if #g==0 then return end
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
if Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,0)>=5 and Duel.IsExistingMatchingCard(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(24501036,4)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tc=Duel.SelectMatchingCard(tp,aux.NegateAnyFilter,tp,LOCATION_ONFIELD,0,1,1,nil):GetFirst()
if not tc then return end
Duel.HintSelection(Group.FromCards(tc))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
Duel.AdjustInstantly()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
end
end
This diff is collapsed.
......@@ -6,12 +6,10 @@ function s.initial_effect(c)
aux.AddSynchroMixProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_SPELLCASTER),nil,nil,s.matfilter1,1,99)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetTargetRange(0xff,0)
e1:SetTarget(s.etarget)
e1:SetValue(s.efilter)
c:RegisterEffect(e1)
local e3=e1:Clone()
......@@ -45,9 +43,6 @@ end
function s.matfilter1(c)
return c:GetOriginalType()&TYPE_SPELL~=0
end
function s.etarget(e,c)
return c:IsSetCard(0x854)
end
function s.efilter(e,re)
return not re:GetOwner():IsSetCard(0x854)
end
......
......@@ -36,7 +36,7 @@ end
function s.desfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
function s.desfilter2(c)
function s.desfilter2(c,e)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsRelateToEffect(e)
end
function s.actcon(e)
......
--星间魔法集束
local s,id,o=GetID()
function s.initial_effect(c)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e0:SetCondition(s.actcon)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMINGS_CHECK_MONSTER+TIMING_DAMAGE_STEP)
e1:SetCondition(aux.dscon)
e1:SetTarget(s.atktg)
e1:SetOperation(s.atkactivate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_GRAVE)
e3:SetTargetRange(1,1)
e3:SetLabelObject(e2)
e3:SetTarget(function(e,te,tp)return te==e:GetLabelObject()end)
e3:SetOperation(s.costop)
c:RegisterEffect(e3)
end
function s.confilter(c)
return c:IsCode(91300100) and c:IsFaceup()
end
function s.desfilter(c,e)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsCanBeEffectTarget(e)
end
function s.actcon(e)
return Duel.IsExistingMatchingCard(s.confilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function s.spfilter(c,e,tp)
local b1=c:GetOriginalType()&TYPE_MONSTER>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
local b2=c:GetOriginalType()&TYPE_MONSTER==0 and Duel.IsPlayerCanSpecialSummonMonster(tp,c:GetCode(),nil,TYPE_MONSTER+TYPE_EFFECT,0,0,0,0,0,POS_FACEUP) and c:IsCanBeSpecialSummoned(e,0,tp,true,true,POS_FACEUP)
return b1 or b2
end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.desfilter,tp,LOCATION_ONFIELD,0,c,e)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_ONFIELD) and s.desfilter(chkc,e) end
if chk==0 then return #g>0 end
local tg1=Duel.SelectMatchingCard(tp,s.desfilter,tp,LOCATION_ONFIELD,0,1,#g,c,e)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local sg=tg1:Filter(s.spfilter,nil,e,tp)
if #sg>0 then
if #sg>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=sg:Select(tp,ft,ft,nil)
end
local tg=sg:GetFirst()
while tg do
if tg:GetOriginalType()&TYPE_MONSTER==0 then
local e1=Effect.CreateEffect(tg)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_EFFECT+TYPE_MONSTER)
e1:SetReset(RESET_EVENT+0x47c0000)
tg:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_REMOVE_RACE)
e2:SetValue(RACE_ALL)
tg:RegisterEffect(e2,true)
local e3=e1:Clone()
e3:SetCode(EFFECT_REMOVE_ATTRIBUTE)
e3:SetValue(0xff)
tg:RegisterEffect(e3,true)
local e4=e1:Clone()
e4:SetCode(EFFECT_SET_BASE_ATTACK)
e4:SetValue(0)
tg:RegisterEffect(e4,true)
local e5=e1:Clone()
e5:SetCode(EFFECT_SET_BASE_DEFENSE)
e5:SetValue(0)
tg:RegisterEffect(e5,true)
tg:SetStatus(STATUS_NO_LEVEL,true)
cregister=Card.RegisterEffect
Card.RegisterEffect=function(card,effect,flag)
if effect:IsActivated() then
local eff=effect:Clone()
if eff:GetRange()&(LOCATION_SZONE+LOCATION_PZONE+LOCATION_FZONE)>0 then
eff:SetRange(LOCATION_MZONE)
end
if eff:IsHasType(EFFECT_TYPE_ACTIVATE) then
eff:SetType(EFFECT_TYPE_QUICK_O)
if not eff:GetOperation() then return end
end
return cregister(card,eff,flag)
end
return cregister(card,effect,flag)
end
s.proeffects={}
s.cloneeffects={}
local _SetProperty=Effect.SetProperty
local _Clone=Effect.Clone
Effect.SetProperty=function(pe,prop1,prop2)
if not prop2 then prop2=0 end
if prop1&EFFECT_FLAG_UNCOPYABLE~=0 then
s.proeffects[pe]={prop1,prop2}
prop1=prop1&(~EFFECT_FLAG_UNCOPYABLE)
else
s.proeffects[pe]=nil
end
return _SetProperty(pe,prop1,prop2)
end
Effect.Clone=function(pe)
local ce=_Clone(pe)
s.cloneeffects[ce]=true
if s.proeffects[pe] then
s.proeffects[ce]=s.proeffects[pe]
end
return ce
end
tg:ReplaceEffect(tg:GetOriginalCode(),RESET_EVENT+0x47c0000)
tg:SetStatus(STATUS_EFFECT_REPLACED,false)
Effect.SetProperty=_SetProperty
Effect.Clone=_Clone
for ke,vp in pairs(s.proeffects) do
local prop1,prop2=table.unpack(vp)
ke:SetProperty(prop1|EFFECT_FLAG_UNCOPYABLE,prop2)
end
Card.RegisterEffect=cregister
else
local e1=Effect.CreateEffect(tg)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ADD_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_EFFECT)
e1:SetReset(RESET_EVENT+0x47c0000)
tg:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_REMOVE_TYPE)
e2:SetValue(TYPE_NORMAL)
tg:RegisterEffect(e2,true)
local e4=e1:Clone()
e4:SetCode(EFFECT_SET_BASE_ATTACK)
e4:SetValue(0)
tg:RegisterEffect(e4,true)
local e5=e1:Clone()
e5:SetCode(EFFECT_SET_BASE_DEFENSE)
e5:SetValue(0)
tg:RegisterEffect(e5,true)
end
--aclimit
local ge0=Effect.CreateEffect(tg)
ge0:SetType(EFFECT_TYPE_FIELD)
ge0:SetCode(EFFECT_ACTIVATE_COST)
ge0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
ge0:SetRange(LOCATION_MZONE)
ge0:SetTargetRange(1,1)
ge0:SetTarget(s.actarget1)
ge0:SetOperation(s.costop1)
ge0:SetReset(RESET_EVENT+0x47c0000)
tg:RegisterEffect(ge0,true)
tg=sg:GetNext()
end
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP)
end
Duel.SetTargetCard(tg1)
end
function s.actarget1(e,te,tp)
e:SetLabelObject(te)
return te:GetHandler()==e:GetHandler()
end
function s.costop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
local op=te:GetOperation()
local res=false
local tab=getmetatable(te:GetHandler())
for _,f in pairs(tab) do
if f and f==op then res=true end
end
if res then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,1)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_EVENT+0x47c0000)
c:RegisterEffect(e1,true)
end
end
function s.aclimit(e,te,tp)
if te:GetHandler()~=e:GetHandler() then return false end
local op=te:GetOperation()
local res=false
local tab=getmetatable(te:GetHandler())
for _,f in pairs(tab) do
if f and f==op then res=true end
end
return res
end
function s.atkactivate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local dg=g:Filter(Card.IsRelateToEffect,nil,e)
for dc in aux.Next(dg) do
local tg=dc:GetColumnGroup():Filter(Card.IsLocation,nil,LOCATION_MZONE)
for tc in aux.Next(tg) do
local preatk=tc:GetAttack()
local dec=Duel.GetMatchingGroupCount(function(c) return c:IsSetCard(0x854) and c:IsFaceup() end,tp,LOCATION_ONFIELD,0,nil)*800
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-dec)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local postatk=tc:GetAttack()
local decatk=preatk-postatk
if decatk>=0 and decatk<dec then Duel.Damage(1-tp,dec-decatk,REASON_EFFECT) end
end
end
end
function s.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local tc=te:GetHandler()
local tp=te:GetHandlerPlayer()
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
tc:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(s.rsop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
end
function s.rsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_REDIRECT)
e2:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e2)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
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