Commit 40a3dd3d authored by Nemo Ma's avatar Nemo Ma

upd 240811

parent b0c0abea
No preview for this file type
expansions/pics/12847513.jpg

37.1 KB | W: | H:

expansions/pics/12847513.jpg

37.1 KB | W: | H:

expansions/pics/12847513.jpg
expansions/pics/12847513.jpg
expansions/pics/12847513.jpg
expansions/pics/12847513.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/75000001.jpg

56.4 KB | W: | H:

expansions/pics/75000001.jpg

16 KB | W: | H:

expansions/pics/75000001.jpg
expansions/pics/75000001.jpg
expansions/pics/75000001.jpg
expansions/pics/75000001.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/75000002.jpg

55.1 KB | W: | H:

expansions/pics/75000002.jpg

15.8 KB | W: | H:

expansions/pics/75000002.jpg
expansions/pics/75000002.jpg
expansions/pics/75000002.jpg
expansions/pics/75000002.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/75000003.jpg

57.5 KB | W: | H:

expansions/pics/75000003.jpg

16.6 KB | W: | H:

expansions/pics/75000003.jpg
expansions/pics/75000003.jpg
expansions/pics/75000003.jpg
expansions/pics/75000003.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/75000005.jpg

53.4 KB | W: | H:

expansions/pics/75000005.jpg

15.2 KB | W: | H:

expansions/pics/75000005.jpg
expansions/pics/75000005.jpg
expansions/pics/75000005.jpg
expansions/pics/75000005.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/88800030.jpg

202 KB | W: | H:

expansions/pics/88800030.jpg

11.8 KB | W: | H:

expansions/pics/88800030.jpg
expansions/pics/88800030.jpg
expansions/pics/88800030.jpg
expansions/pics/88800030.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/9910710.jpg

51.2 KB | W: | H:

expansions/pics/9910710.jpg

48.6 KB | W: | H:

expansions/pics/9910710.jpg
expansions/pics/9910710.jpg
expansions/pics/9910710.jpg
expansions/pics/9910710.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/9910724.jpg

11 KB | W: | H:

expansions/pics/9910724.jpg

47.9 KB | W: | H:

expansions/pics/9910724.jpg
expansions/pics/9910724.jpg
expansions/pics/9910724.jpg
expansions/pics/9910724.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/9910741.jpg

43.2 KB | W: | H:

expansions/pics/9910741.jpg

43.2 KB | W: | H:

expansions/pics/9910741.jpg
expansions/pics/9910741.jpg
expansions/pics/9910741.jpg
expansions/pics/9910741.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/9910743.jpg

12.7 KB | W: | H:

expansions/pics/9910743.jpg

52.7 KB | W: | H:

expansions/pics/9910743.jpg
expansions/pics/9910743.jpg
expansions/pics/9910743.jpg
expansions/pics/9910743.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/9910745.jpg

12.8 KB | W: | H:

expansions/pics/9910745.jpg

53.5 KB | W: | H:

expansions/pics/9910745.jpg
expansions/pics/9910745.jpg
expansions/pics/9910745.jpg
expansions/pics/9910745.jpg
  • 2-up
  • Swipe
  • Onion skin
function c10111104.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10111104,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_LEAVE_DECK)
e1:SetCountLimit(1,10111104)
e1:SetCondition(c10111104.atkcon)
e1:SetTarget(c10111104.sptg)
e1:SetOperation(c10111104.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10111104,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,101111040)
e2:SetTarget(c10111104.thtg)
e2:SetOperation(c10111104.thop)
c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10111104,0))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,101111040)
e3:SetCondition(c10111104.tgcon)
e3:SetTarget(c10111104.tgtg)
e3:SetOperation(c10111104.tgop)
c:RegisterEffect(e3)
end
function c10111104.atkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_EXTRA)
end
function c10111104.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c10111104.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
end
end
function c10111104.thfilter(c)
return c:IsSetCard(0x45) and c:IsType(TYPE_MONSTER) and not c:IsCode(10111104) and c:IsAbleToHand()
end
function c10111104.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10111104.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c10111104.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c10111104.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c10111104.tgcfilter(c,tp)
return c:IsFaceup() and c:IsRace(RACE_FIEND) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsControler(tp)
end
function c10111104.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg and eg:IsExists(c10111104.tgcfilter,1,e:GetHandler(),tp)
end
function c10111104.tgfilter(c)
return c:IsRace(RACE_FIEND) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToGrave()
end
function c10111104.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10111104.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c10111104.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c10111104.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
\ No newline at end of file
function c10111105.initial_effect(c)
--to gravee
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c10111105.tg4)
e1:SetOperation(c10111105.op4)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetDescription(aux.Stringid(10111105,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(4,10111105)
e2:SetTarget(c10111105.tdtg)
e2:SetOperation(c10111105.tdop)
c:RegisterEffect(e2)
end
function c10111105.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local token1=Duel.CreateToken(tp,10111106)
local token2=Duel.CreateToken(tp,10111107)
local token3=Duel.CreateToken(tp,10111108)
local token4=Duel.CreateToken(tp,10111109)
local token5=Duel.CreateToken(tp,10111106)
local token6=Duel.CreateToken(tp,10111107)
local token7=Duel.CreateToken(tp,10111108)
local token8=Duel.CreateToken(tp,10111109)
local g=Group.CreateGroup()
g:AddCard(token1)
g:AddCard(token2)
g:AddCard(token3)
g:AddCard(token4)
g:AddCard(token5)
g:AddCard(token6)
g:AddCard(token7)
g:AddCard(token8)
g:KeepAlive()
e:SetLabelObject(g)
end
function c10111105.op4(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if g and g:GetCount()>0 then
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c10111105.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c10111105.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_DECK) then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
function c10111106.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10111106,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DRAW)
e1:SetCost(c10111106.spcost)
e1:SetTarget(c10111106.sptg)
e1:SetOperation(c10111106.spop)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10111106,1))
e2:SetCategory(CATEGORY_REMOVE+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,10111106)
e2:SetCondition(c10111106.rmcon)
e2:SetTarget(c10111106.rmtg)
e2:SetOperation(c10111106.rmop)
c:RegisterEffect(e2)
--Gain ATK
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(c10111106.atkval)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(10111106,1))
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,101111060)
e4:SetCondition(c10111106.drcon)
e4:SetTarget(c10111106.drtg)
e4:SetOperation(c10111106.drop)
c:RegisterEffect(e4)
end
function c10111106.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c10111106.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c10111106.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c10111106.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c10111106.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c10111106.cfilter1(c,tp)
return c:IsControler(tp) and c:IsType(TYPE_MONSTER)
end
function c10111106.rmcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c10111106.cfilter1,1,nil,1-tp)
end
function c10111106.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil)
and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c10111106.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_REMOVED) then
Duel.Draw(tp,1,REASON_EFFECT)
end
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c10111106.atkval(e,c)
return Duel.GetMatchingGroupCount(Card.IsType,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,TYPE_MONSTER)*400
end
function c10111106.drcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_DESTROY)~=0 and e:GetHandler():IsPreviousControler(tp)
and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c10111106.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c10111106.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
function c10111107.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10111107,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DRAW)
e1:SetCost(c10111107.spcost)
e1:SetTarget(c10111107.sptg)
e1:SetOperation(c10111107.spop)
c:RegisterEffect(e1)
--attack up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10111107,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_START)
e2:SetCountLimit(1)
e2:SetCondition(c10111107.condition)
e2:SetOperation(c10111107.atkop)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10111107,3))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,10111107)
e3:SetTarget(c10111107.drtg)
e3:SetOperation(c10111107.drop)
c:RegisterEffect(e3)
--chain attack
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DAMAGE_STEP_END)
e4:SetCountLimit(1,101111070)
e4:SetCondition(c10111107.atcon)
e4:SetTarget(c10111107.attg)
e4:SetOperation(c10111107.atop)
c:RegisterEffect(e4)
end
function c10111107.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c10111107.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c10111107.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c10111107.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsRelateToBattle()
end
function c10111107.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)-Duel.GetFieldGroupCount(tp,0,LOCATION_DECK+LOCATION_HAND+LOCATION_ONFIELD)
if c:IsRelateToEffect(e) and c:IsFaceup() and ct>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
e1:SetValue(ct*200)
c:RegisterEffect(e1)
end
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c10111107.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c10111107.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c10111107.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetAttacker()==c and c:IsChainAttackable(0)
end
function c10111107.attg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c10111107.atop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
Duel.ChainAttack()
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
function c10111108.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10111108,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DRAW)
e1:SetCost(c10111108.spcost)
e1:SetTarget(c10111108.sptg)
e1:SetOperation(c10111108.spop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,10111108)
e2:SetTarget(c10111108.drtg)
e2:SetOperation(c10111108.drop)
c:RegisterEffect(e2)
--todeck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10111108,1))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetTarget(c10111108.tdtg)
e3:SetOperation(c10111108.tdop)
c:RegisterEffect(e3)
--Activate
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,101111080)
e4:SetCost(c10111108.cost)
e4:SetTarget(c10111108.target)
e4:SetOperation(c10111108.activate)
c:RegisterEffect(e4)
end
function c10111108.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c10111108.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c10111108.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c10111108.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c10111108.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
Duel.BreakEffect()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_MONSTER))
e1:SetValue(800)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.Clone(e1)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
Duel.RegisterEffect(e2,tp)
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c10111108.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c10111108.tdop(e,tp,eg,ep,ev,re,r,rp)
local token1=Duel.CreateToken(tp,10111105)
local g=Group.CreateGroup()
g:AddCard(token1)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c10111108.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function c10111108.filter(c)
return not c:IsCode(10111108) and c:IsAbleToDeck()
end
function c10111108.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c10111108.filter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c10111108.filter,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c10111108.filter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c10111108.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if tg:FilterCount(Card.IsRelateToEffect,nil,e)~=2 then return end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==2 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
function c10111109.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10111109,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DRAW)
e1:SetCost(c10111109.spcost)
e1:SetTarget(c10111109.sptg)
e1:SetOperation(c10111109.spop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,10111109)
e2:SetTarget(c10111109.drtg)
e2:SetOperation(c10111109.drop)
c:RegisterEffect(e2)
--炸卡
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10111109,1))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(TIMING_END_PHASE,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c10111109.destg)
e3:SetOperation(c10111109.desop)
c:RegisterEffect(e3)
--atk
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(10111109,2))
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,101111090)
e4:SetCost(c10111109.cost)
e4:SetTarget(c10111109.atktg)
e4:SetOperation(c10111109.atkop)
c:RegisterEffect(e4)
end
function c10111109.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c10111109.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c10111109.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c10111109.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c10111109.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
Duel.BreakEffect()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_MONSTER))
e1:SetValue(-800)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.Clone(e1)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
Duel.RegisterEffect(e2,tp)
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c10111109.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c10111109.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c10111109.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function c10111109.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.nzatk,tp,0,LOCATION_MZONE,1,nil) end
end
function c10111109.atkop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=Duel.SelectMatchingCard(tp,aux.nzatk,tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
if tc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(-1600)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
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(1,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
function c10111110.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c10111110.spcon)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10111110,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,10111110)
e2:SetTarget(c10111110.settg)
e2:SetOperation(c10111110.setop)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,101111100)
e3:SetCondition(c10111110.thcon)
e3:SetTarget(c10111110.thtg)
e3:SetOperation(c10111110.thop)
c:RegisterEffect(e3)
if not c10111110.global_check then
c10111110.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TO_GRAVE)
ge1:SetOperation(c10111110.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c10111110.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xa008)
end
function c10111110.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and
Duel.IsExistingMatchingCard(c10111110.cfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function c10111110.setfilter(c)
return c:IsSetCard(0xa5) and c:IsType(TYPE_SPELL)
end
function c10111110.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10111110.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function c10111110.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c10111110.setfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then
if tc:IsType(TYPE_QUICKPLAY) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
if tc: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)
tc:RegisterEffect(e1)
end
end
end
function c10111110.checkfilter(c,tp)
return c:IsSetCard(0xa008) and c:IsType(TYPE_MONSTER) and c:IsControler(tp)
end
function c10111110.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(c10111110.checkfilter,1,nil,0) then Duel.RegisterFlagEffect(0,id,RESET_PHASE+PHASE_END,0,1) end
if eg:IsExists(c10111110.checkfilter,1,nil,1) then Duel.RegisterFlagEffect(1,id,RESET_PHASE+PHASE_END,0,1) end
end
function c10111110.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)>0
end
function c10111110.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c10111110.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
\ No newline at end of file
function c10111111.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10111111,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_HAND)
e1:SetCountLimit(1,10111111)
e1:SetCondition(c10111111.thcon)
e1:SetTarget(c10111111.thtg)
e1:SetOperation(c10111111.thop)
c:RegisterEffect(e1)
--假面英雄来辣
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetDescription(aux.Stringid(10111111,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCountLimit(1,101111110)
e2:SetCondition(c10111111.condition)
e2:SetCost(c10111111.cost2)
e2:SetTarget(c10111111.sptg)
e2:SetOperation(c10111111.spop)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10111111,0))
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(c10111111.negcon)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c10111111.negtg)
e3:SetOperation(c10111111.negop)
c:RegisterEffect(e3)
end
function c10111111.thcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_DRAW)
and e:GetHandler():IsPreviousLocation(LOCATION_DECK+LOCATION_GRAVE)
end
function c10111111.filter(c)
return c:IsSetCard(0xa5) and c:IsType(TYPE_SPELL)
and c:IsAbleToHand()
end
function c10111111.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10111111.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c10111111.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c10111111.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c10111111.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
if not at:IsControler(tp) then at=Duel.GetAttackTarget() end
return at and at:IsControler(tp) and at:IsFaceup() and at:IsSetCard(0x8)
end
function c10111111.cost2(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 c10111111.spfilter(c,e,tp)
return c:IsSetCard(0xa008) and c:IsType(TYPE_MONSTER) and c:IsLevelBelow(8) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function c10111111.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(c10111111.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c10111111.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c10111111.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
g:GetFirst():CompleteProcedure()
end
end
function c10111111.tfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsFaceup() and c:IsSetCard(0x8)
end
function c10111111.negcon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:IsExists(c10111111.tfilter,1,nil,tp) and Duel.IsChainDisablable(ev)
end
function c10111111.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c10111111.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
\ No newline at end of file
--traveler with infinite saga --traveler with infinite saga
--21.04.10 --21.04.10
local m=11451406 local cm,m=GetID()
local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--activate --activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -21,7 +20,7 @@ end ...@@ -21,7 +20,7 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local tgp=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_PLAYER) local tgp=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_PLAYER)
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and (not tgp or tgp~=tp) return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and (not tgp or tgp~=tp) --and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil)
end end
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
...@@ -33,7 +32,20 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -33,7 +32,20 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(tp,1) Duel.ConfirmDecktop(tp,1)
Duel.MoveSequence(tc,1) Duel.MoveSequence(tc,1)
if not cm.filter(tc,tp) then if not cm.filter(tc,tp) then
local tg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_HAND,0,nil) Duel.ShuffleDeck(tp)
local ph=Duel.GetCurrentPhase()
if ph>PHASE_MAIN1 and ph<PHASE_MAIN2 then ph=PHASE_BATTLE end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_TRIGGER)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+ph)
c:RegisterEffect(e2)
--[[local tg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_HAND,0,nil)
local sg=tg:RandomSelect(tp,1) local sg=tg:RandomSelect(tp,1)
if Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)>0 then if Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)>0 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -42,7 +54,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,7 +54,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(1500) e1:SetValue(1500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end--]]
else else
if tc:IsType(TYPE_FIELD) then if tc:IsType(TYPE_FIELD) then
local te=tc:GetActivateEffect() local te=tc:GetActivateEffect()
......
--食大食食大食蚁兽蚁兽螳螂 --食大食食大食蚁兽蚁兽螳螂
local m=11451476 local cm,m=GetID()
local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--cannot special summon --cannot special summon
...@@ -75,7 +74,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -75,7 +74,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
local sg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0) local sg=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
if #sg>0 and sg:FilterCount(cm.filter,nil)==#sg and Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_DECK,0,1,nil) and Duel.GetFlagEffect(tp,m)==0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then if #sg>0 and sg:FilterCount(cm.filter,nil)==#sg and Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_DECK,0,1,nil) and Duel.GetFlagEffect(tp,m)==0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.BreakEffect() --Duel.BreakEffect()
local tg=Duel.SelectMatchingCard(tp,cm.setfilter,tp,LOCATION_DECK,0,1,1,nil) local tg=Duel.SelectMatchingCard(tp,cm.setfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SSet(tp,tg) Duel.SSet(tp,tg)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
......
...@@ -85,7 +85,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -85,7 +85,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.repop(e,tp,eg,ep,ev,re,r,rp) function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_PLAYER_TARGET,1,0,aux.Stringid(m,5)) Duel.RegisterFlagEffect(1-tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_PLAYER_TARGET,1,0,aux.Stringid(m,5))
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,5)) e1:SetDescription(aux.Stringid(m,5))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
...@@ -103,7 +103,7 @@ function cm.discon(e,tp,eg,ep,ev,re,r,rp) ...@@ -103,7 +103,7 @@ function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return loc&LOCATION_ONFIELD>0 and p~=tp return loc&LOCATION_ONFIELD>0 and p~=tp
end end
function cm.disop(e,tp,eg,ep,ev,re,r,rp) function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.ResetFlagEffect(tp,m) Duel.ResetFlagEffect(1-tp,m)
Duel.NegateEffect(ev) Duel.NegateEffect(ev)
e:SetProperty(0) e:SetProperty(0)
e:Reset() e:Reset()
......
...@@ -285,7 +285,8 @@ function cm.operation6(e,tp,eg,ep,ev,re,r,rp) ...@@ -285,7 +285,8 @@ function cm.operation6(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
local tg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_HAND,nil) local tg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_HAND,nil)
if #tg>0 then if #tg>0 then
local sg=tg:RandomSelect(1-tp,1) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK)
local sg=tg:Select(1-tp,1,1,nil)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT) Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end end
Duel.RaiseEvent(e:GetHandler(),11451676,e,0,tp,tp,Duel.GetCurrentChain()) Duel.RaiseEvent(e:GetHandler(),11451676,e,0,tp,tp,Duel.GetCurrentChain())
......
...@@ -42,8 +42,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,8 +42,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 and c:IsRelateToEffect(e) and c:IsAbleToDeck() then if tc and Duel.SSet(tp,tc)~=0 and c:IsRelateToEffect(e) and c:IsAbleToDeck() then
if KOISHI_CHECK then if KOISHI_CHECK then
c:SetEntityCode(m+10,true) c:SetEntityCode(m+48,true)
c:ReplaceEffect(m+10,0) c:ReplaceEffect(m+48,0)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.matfilter,2,2) aux.AddLinkProcedure(c,cm.matfilter,2,2)
local loc=c:GetLocation() local loc=c:GetLocation()
...@@ -52,7 +52,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +52,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,loc,0) local g=Duel.GetFieldGroup(tp,loc,0)
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g)
else else
local token=Duel.CreateToken(tp,m+10) Duel.Remove(c,POS_FACEDOWN,REASON_RULE)
local token=Duel.CreateToken(tp,m+48)
Duel.SendtoDeck(token,nil,2,REASON_EFFECT) Duel.SendtoDeck(token,nil,2,REASON_EFFECT)
Duel.ConfirmCards(1-tp,token) Duel.ConfirmCards(1-tp,token)
--change code --change code
...@@ -60,7 +61,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,7 +61,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_CODE) e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE) e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetValue(m+10) e3:SetValue(m+48)
token:RegisterEffect(e3) token:RegisterEffect(e3)
end end
end end
......
...@@ -42,8 +42,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,8 +42,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 and c:IsRelateToEffect(e) and c:IsAbleToDeck() then if tc and Duel.SSet(tp,tc)~=0 and c:IsRelateToEffect(e) and c:IsAbleToDeck() then
if KOISHI_CHECK then if KOISHI_CHECK then
c:SetEntityCode(m+10,true) c:SetEntityCode(m+48,true)
c:ReplaceEffect(m+10,0) c:ReplaceEffect(m+48,0)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),4,2) aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),4,2)
local loc=c:GetLocation() local loc=c:GetLocation()
...@@ -52,7 +52,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +52,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,loc,0) local g=Duel.GetFieldGroup(tp,loc,0)
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g)
else else
local token=Duel.CreateToken(tp,m+10) Duel.Remove(c,POS_FACEDOWN,REASON_RULE)
local token=Duel.CreateToken(tp,m+48)
Duel.SendtoDeck(token,nil,2,REASON_EFFECT) Duel.SendtoDeck(token,nil,2,REASON_EFFECT)
Duel.ConfirmCards(1-tp,token) Duel.ConfirmCards(1-tp,token)
--change code --change code
...@@ -60,7 +61,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,7 +61,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_CODE) e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE) e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetValue(m+10) e3:SetValue(m+48)
token:RegisterEffect(e3) token:RegisterEffect(e3)
end end
end end
......
...@@ -42,8 +42,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,8 +42,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 and c:IsRelateToEffect(e) and c:IsAbleToDeck() then if tc and Duel.SSet(tp,tc)~=0 and c:IsRelateToEffect(e) and c:IsAbleToDeck() then
if KOISHI_CHECK then if KOISHI_CHECK then
c:SetEntityCode(m+10,true) c:SetEntityCode(m+48,true)
c:ReplaceEffect(m+10,0) c:ReplaceEffect(m+48,0)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1,1) aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1,1)
local loc=c:GetLocation() local loc=c:GetLocation()
...@@ -52,7 +52,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +52,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,loc,0) local g=Duel.GetFieldGroup(tp,loc,0)
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g)
else else
local token=Duel.CreateToken(tp,m+10) Duel.Remove(c,POS_FACEDOWN,REASON_RULE)
local token=Duel.CreateToken(tp,m+48)
Duel.SendtoDeck(token,nil,2,REASON_EFFECT) Duel.SendtoDeck(token,nil,2,REASON_EFFECT)
Duel.ConfirmCards(1-tp,token) Duel.ConfirmCards(1-tp,token)
--change code --change code
...@@ -60,7 +61,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,7 +61,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_CODE) e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE) e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetValue(m+10) e3:SetValue(m+48)
token:RegisterEffect(e3) token:RegisterEffect(e3)
end end
end end
......
...@@ -42,8 +42,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,8 +42,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 and c:IsRelateToEffect(e) and c:IsAbleToDeck() then if tc and Duel.SSet(tp,tc)~=0 and c:IsRelateToEffect(e) and c:IsAbleToDeck() then
if KOISHI_CHECK then if KOISHI_CHECK then
c:SetEntityCode(m+10,true) c:SetEntityCode(m+48,true)
c:ReplaceEffect(m+10,0) c:ReplaceEffect(m+48,0)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsRace,RACE_FAIRY),aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),true) aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsRace,RACE_FAIRY),aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),true)
local loc=c:GetLocation() local loc=c:GetLocation()
...@@ -52,7 +52,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +52,8 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,loc,0) local g=Duel.GetFieldGroup(tp,loc,0)
Duel.ConfirmCards(tp,g) Duel.ConfirmCards(tp,g)
else else
local token=Duel.CreateToken(tp,m+10) Duel.Remove(c,POS_FACEDOWN,REASON_RULE)
local token=Duel.CreateToken(tp,m+48)
Duel.SendtoDeck(token,nil,2,REASON_EFFECT) Duel.SendtoDeck(token,nil,2,REASON_EFFECT)
Duel.ConfirmCards(1-tp,token) Duel.ConfirmCards(1-tp,token)
--change code --change code
...@@ -60,7 +61,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,7 +61,7 @@ function cm.setop(e,tp,eg,ep,ev,re,r,rp)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_CODE) e3:SetCode(EFFECT_CHANGE_CODE)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE) e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetValue(m+10) e3:SetValue(m+48)
token:RegisterEffect(e3) token:RegisterEffect(e3)
end end
end end
......
--烬羽的残迹·珍妮丽丝
local cm,m=GetID()
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.matfilter,2,2)
--effect
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function cm.kfilter(c)
return c:IsFaceup() and c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,nil,1,2,c)
Duel.Release(g,REASON_COST)
g=g:Filter(cm.kfilter,nil)
g:ForEach(Card.RegisterFlagEffect,m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,0))
g:KeepAlive()
e:SetLabelObject(g)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=e:GetLabelObject()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetLabelObject(g)
e1:SetCondition(cm.retcon)
e1:SetOperation(cm.retop)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==1
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g or aux.GetValueType(g)~="Group" then return end
local tg=g:Filter(aux.NecroValleyFilter(cm.spfilter),nil,e,tp)
local tg1=tg:Filter(Card.IsLocation,nil,LOCATION_GRAVE+LOCATION_REMOVED)
local tg2=tg:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
local ft=Duel.GetUsableMZoneCount(tp)
g:DeleteGroup()
if ft<=0 or #tg==0 then return end
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
if ect and ect<ft2 then ft2=ect end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if ft1>0 then ft1=1 end
if ft2>0 then ft2=1 end
ft=1
end
if ft1<#tg1 then
if ft1>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
tg1=tg1:Select(tp,ft1,ft1,nil)
else
tg1:Clear()
end
end
if ft2<#tg2 then
if ft2>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
tg2=tg2:Select(tp,ft2,ft2,nil)
else
tg2:Clear()
end
end
tg=tg1+tg2
if ft<#tg then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
tg=tg:Select(tp,ft,ft,nil)
end
Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP)
end
function cm.spfilter(c,e,tp)
return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetFlagEffect(m)>0
end
\ No newline at end of file
--烬羽的祈梦·琼诺贝兹
local cm,m=GetID()
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),4,2)
--effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_HAND)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.cfilter(c,tp)
return c:IsControler(tp)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,1-tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsType(TYPE_XYZ) and c:GetOverlayCount()<2 end
Duel.SetTargetCard(eg)
end
function cm.filter(c,e,tp)
return c:IsRelateToEffect(e) and cm.cfilter(c,tp)
end
function cm.rmfilter(c,g)
return c:IsAbleToRemove() and g:IsExists(Card.IsCode,1,nil,c:GetCode())
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dg=eg:Filter(cm.filter,nil,e,1-tp)
if #dg>0 and c:IsRelateToEffect(e) and c:IsType(TYPE_XYZ) and c:GetOverlayCount()<2 then
local ct=math.min(2-c:GetOverlayCount(),#dg)
local tg=dg:Select(1-tp,ct,ct,nil)
Duel.Overlay(c,tg)
Duel.ShuffleHand(1-tp)
end
end
\ No newline at end of file
--烬羽的逐焰·瑾维尼拉
local cm,m=GetID()
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1,1)
--effect
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCountLimit(1)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function cm.filter(c,e)
return c:IsAbleToHand() and c:IsCanBeEffectTarget(e)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g1=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,nil,e)
local g2=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_GRAVE,nil,e)
if chk==0 then return #g1>0 and #g2>0 end
local mac=1
if #g1>=2 and #g2>=2 then mac=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,mac,nil)
local g2=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_GRAVE,#g1,#g1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,#g1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
end
end
\ No newline at end of file
--烬羽的悲响·珞克莉尔
local cm,m=GetID()
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsRace,RACE_FAIRY),aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),true)
--effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(cm.condition)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.matfilter(c)
return c:IsLinkRace(RACE_FAIRY)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
for i=1,Duel.GetCurrentChain() do
local tgp=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_PLAYER)
if tgp~=tp then return true end
end
return false
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
for i=1,Duel.GetCurrentChain() do
local tgp,te,cid=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_EFFECT,CHAININFO_CHAIN_ID)
if tgp~=tp then
local op=te:GetOperation()
te:SetOperation(cm.repop(op,cid))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCountLimit(1)
e1:SetLabel(i)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==e:GetLabel() end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) re:SetOperation(op) end)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
--[[local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetOperation(cm.ngop)
e1:SetReset(RESET_CHAIN)
e1:SetLabel(i)
Duel.RegisterEffect(e1,tp)--]]
end
end
end
function cm.ngop(e,tp,eg,ep,ev,re,r,rp)
if ev==e:GetLabel() and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)<Duel.GetFieldGroupCount(tp,0,LOCATION_HAND) then
Duel.ChangeChainOperation(0,cm.repop(re:GetOperation()))
end
end
function cm.repop(_op,cid)
return function(e,tp,eg,ep,ev,re,r,rp)
e:SetOperation(_op)
local cid2=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if cid==cid2 and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>Duel.GetFieldGroupCount(tp,0,LOCATION_HAND) then return end
_op(e,tp,eg,ep,ev,re,r,rp)
end
end
\ No newline at end of file
...@@ -39,7 +39,7 @@ function cm.initial_effect(c) ...@@ -39,7 +39,7 @@ function cm.initial_effect(c)
e5:SetCode(EFFECT_ADD_CODE) e5:SetCode(EFFECT_ADD_CODE)
e5:SetTargetRange(0,LOCATION_ONFIELD) e5:SetTargetRange(0,LOCATION_ONFIELD)
e5:SetCondition(function(e) return e:GetHandler():GetSequence()<5 end) e5:SetCondition(function(e) return e:GetHandler():GetSequence()<5 end)
e5:SetTarget(function(e,c) return aux.GetColumn(c) and math.abs(aux.GetColumn(c)-aux.GetColumn(e:GetHandler()))==1 end) e5:SetTarget(function(e,c) return aux.GetColumn(c) and math.abs(aux.GetColumn(c)-aux.GetColumn(e:GetHandler()))==0 end)
e5:SetValue(11451631) e5:SetValue(11451631)
e5:SetRange(LOCATION_SZONE) e5:SetRange(LOCATION_SZONE)
c:RegisterEffect(e5) c:RegisterEffect(e5)
......
...@@ -116,11 +116,11 @@ end ...@@ -116,11 +116,11 @@ end
function c11579812.imcon(e) function c11579812.imcon(e)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
return Duel.GetLP(tp)<=Duel.GetLP(1-tp) and e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) return Duel.GetLP(tp)<Duel.GetLP(1-tp) and e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end end
function c11579812.atcon(e) function c11579812.atcon(e)
local tp=e:GetHandlerPlayer() local tp=e:GetHandlerPlayer()
return Duel.GetLP(tp)<=Duel.GetLP(1-tp) return Duel.GetLP(tp)<Duel.GetLP(1-tp)
end end
function c11579812.val(e,c) function c11579812.val(e,c)
return Duel.GetLP(1-c:GetControler())-Duel.GetLP(c:GetControler()) return Duel.GetLP(1-c:GetControler())-Duel.GetLP(c:GetControler())
......
...@@ -3,7 +3,7 @@ function c11579814.initial_effect(c) ...@@ -3,7 +3,7 @@ function c11579814.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DETACH_EVENT) Duel.EnableGlobalFlag(GLOBALFLAG_DETACH_EVENT)
--xyz summon --xyz summon
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,function(c,xyzc) return c:IsRank(2) or c:IsLink(2) end,nil,2,99) aux.AddXyzProcedureLevelFree(c,function(c,xyzc) return c:IsSetCard(0x180) end,nil,2,99)
--atk --atk
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -84,7 +84,7 @@ function c11579814.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -84,7 +84,7 @@ function c11579814.regop(e,tp,eg,ep,ev,re,r,rp)
c:ResetFlagEffect(code) c:ResetFlagEffect(code)
end end
function c11579814.ovcon(e,tp,eg,ep,ev,re,r,rp) function c11579814.ovcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsControler,1,nil,tp) return eg:IsExists(Card.IsControler,1,nil,tp) and eg:IsExists(Card.IsLocation,1,nil,LOCATION_MZONE)
end end
function c11579814.ovfil(c) function c11579814.ovfil(c)
return c:IsCanOverlay() return c:IsCanOverlay()
...@@ -100,7 +100,11 @@ function c11579814.ovop(e,tp,eg,ep,ev,re,r,rp) ...@@ -100,7 +100,11 @@ function c11579814.ovop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c11579814.ovfil,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,e:GetHandler()) local g=Duel.GetMatchingGroup(c11579814.ovfil,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,e:GetHandler())
if c:IsRelateToEffect(e) and g:CheckSubGroup(c11579814.ovgck,2,2) then if c:IsRelateToEffect(e) and g:CheckSubGroup(c11579814.ovgck,2,2) then
local og=g:SelectSubGroup(tp,c11579814.ovgck,false,2,2) local og=g:SelectSubGroup(tp,c11579814.ovgck,false,2,2)
local oog=og:GetFirst():GetOverlayGroup()
if oog:GetCount()>0 then
Duel.SendtoGrave(oog,REASON_RULE)
end
Duel.Overlay(c,og) Duel.Overlay(c,og)
end end
end end
......
--祝你幸福 丰川祥子
local m=12847087
local cm=_G["c"..m]
cm.code=12847087
cm.side_code=12847088
function cm.initial_effect(c)
--synchro summon
c:EnableReviveLimit()
aux.AddSynchroMixProcedure(c,cm.matfilter1,nil,nil,nil,1,99)
--summon success
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetOperation(cm.sumsuc)
c:RegisterEffect(e0)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetCondition(cm.con2)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e2:SetCondition(cm.con2)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e3:SetCondition(cm.con2)
e3:SetValue(1)
c:RegisterEffect(e3)
--disable
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCountLimit(1,m)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.con1)
e2:SetTarget(cm.distg)
e2:SetOperation(cm.disop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_MATERIAL_CHECK)
e3:SetValue(cm.valcheck)
c:RegisterEffect(e3)
--
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,m+200)
e5:SetCode(EVENT_CUSTOM+m)
e5:SetOperation(cm.setop)
c:RegisterEffect(e5)
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m+100)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCondition(cm.condition)
e4:SetOperation(cm.operation)
--c:RegisterEffect(e4)
--
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1,m+300)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetCondition(cm.con2)
e6:SetTarget(cm.distg2)
e6:SetOperation(cm.operation2)
c:RegisterEffect(e6)
if not cm.Side_Check then
cm.Side_Check=true
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_ADJUST)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCondition(cm.backon)
e0:SetOperation(cm.backop)
Duel.RegisterEffect(e0,tp)
end
end
function cm.matfilter1(c,syncard)
return c:IsTuner(syncard) or c:IsLevel(3)
end
function cm.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(m,0))
end
function cm.con1(e)
return e:GetHandler():GetFlagEffect(16100000)==0
end
function cm.con2(e)
return e:GetHandler():GetFlagEffect(16100000)>0
end
function cm.checkitside(c)
return c.code and c.side_code and c:GetFlagEffect(16100000)==0 and c:GetOriginalCode()==c.side_code
end
function cm.backon(e,tp,eg,ep,ev,re,r,rp)
local dg=Duel.GetMatchingGroup(cm.checkitside,tp,0x7f,0x7f,nil)
return dg:GetCount()>0
end
function cm.backop(e,tp,eg,ep,ev,re,r,rp)
local dg=Duel.GetMatchingGroup(cm.checkitside,tp,0x7f,0x7f,nil)
for c in aux.Next(dg) do
local tcode=c.code
c:SetEntityCode(tcode)
if c:IsFacedown() then
Duel.ConfirmCards(1-tp,Group.FromCards(c))
end
c:ReplaceEffect(tcode,0,0)
Duel.Hint(HINT_CARD,0,tcode)
if c:IsLocation(LOCATION_HAND) then
local sp=c:GetControler()
Duel.ShuffleHand(sp)
end
end
Duel.Readjust()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(cm.discheck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)>=3 and e:GetHandler():GetFlagEffect(16100000)==0 and e:GetHandler():GetFlagEffect(16100001)==0
end
function cm.discheck(c)
return c:IsFaceup() and c:IsDisabled()
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.discheck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local num=Duel.SendtoGrave(g,REASON_EFFECT)
if num>0 then
local atk=num*1000
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
c:RegisterEffect(e2)
end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(16100000)==0 then
Duel.Hint(HINT_CARD,0,12847088)
local sidecode=c.side_code
c:SetEntityCode(sidecode)
c:RegisterFlagEffect(16100000,RESET_EVENT+0x7e0000,0,0)
Duel.Hint(24,0,aux.Stringid(m+1,0))
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,re,r,rp,ep,0)
end
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(16100001,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,0)
local dg=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,0,LOCATION_MZONE,nil)
if c:GetFlagEffect(16100000)>0 then
local tc=dg:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_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:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
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:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
tc=dg:GetNext()
end
Duel.Hint(HINT_CARD,0,12847087)
local g=c:GetOverlayGroup()
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
local sidecode=c.code
c:SetEntityCode(code)
c:ResetFlagEffect(16100000)
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,re,r,rp,ep,0)
end
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local ct=0
if c:GetFlagEffectLabel(m) then ct=c:GetFlagEffectLabel(m) end
if chkc then return chkc:IsOnField() and aux.NegateAnyFilter(chkc) end
if chk==0 then return ct>0 and Duel.IsExistingTarget(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and c:GetFlagEffect(16100000)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,ct,0,0)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local dg=Duel.GetTargetsRelateToChain()
local tc=dg:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_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:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
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:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
tc=dg:GetNext()
end
end
function cm.distg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(aux.NegateAnyFilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,#g,0,0)
end
function cm.valcheck(e,c)
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,0,1,c:GetMaterial():FilterCount(Card.IsLevel,nil,3))
end
--宇宙·埃列什基伽勒
local m=12847098
local cm=_G["c"..m]
cm.code=12847098
cm.side_code=12847099
function cm.initial_effect(c)
c:EnableCounterPermit(0xa7f)
c:SetCounterLimit(0xa7f,64)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),3)
c:EnableReviveLimit()
--summon success
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetOperation(cm.sumsuc)
c:RegisterEffect(e0)
local e0_1=Effect.CreateEffect(c)
e0_1:SetType(EFFECT_TYPE_SINGLE)
e0_1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0_1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e0_1:SetCondition(cm.con2)
e0_1:SetValue(1)
c:RegisterEffect(e0_1)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetCondition(cm.con2)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
--link summon limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(aux.linklimit)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_ACTIVATE_CONDITION)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--remove
local e2_1=Effect.CreateEffect(c)
e2_1:SetDescription(aux.Stringid(m,0))
e2_1:SetCategory(CATEGORY_REMOVE+CATEGORY_ATKCHANGE)
e2_1:SetType(EFFECT_TYPE_QUICK_O)
e2_1:SetRange(LOCATION_MZONE)
e2_1:SetCountLimit(1,m)
e2_1:SetCode(EVENT_FREE_CHAIN)
e2_1:SetCondition(cm.con2)
e2_1:SetTarget(cm.remtg)
e2_1:SetOperation(cm.remop)
c:RegisterEffect(e2_1)
--attackup
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.con)
e3:SetValue(cm.attackup)
c:RegisterEffect(e3)
--immune
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cm.imcon)
e4:SetValue(cm.efilter)
c:RegisterEffect(e4)
--change
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,1))
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(cm.con)
e5:SetCost(cm.chcost)
e5:SetTarget(cm.chtg)
e5:SetOperation(cm.chop)
c:RegisterEffect(e5)
if not cm.Side_Check then
cm.Side_Check=true
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_ADJUST)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCondition(cm.backon)
e0:SetOperation(cm.backop)
Duel.RegisterEffect(e0,tp)
end
end
function cm.checkitside(c)
return c.code and c.side_code and c:GetFlagEffect(16100000)==0 and c:GetOriginalCode()==c.side_code
end
function cm.backon(e,tp,eg,ep,ev,re,r,rp)
local dg=Duel.GetMatchingGroup(cm.checkitside,tp,0x7f,0x7f,nil)
return dg:GetCount()>0
end
function cm.backop(e,tp,eg,ep,ev,re,r,rp)
local dg=Duel.GetMatchingGroup(cm.checkitside,tp,0x7f,0x7f,nil)
for c in aux.Next(dg) do
local tcode=c.code
c:SetEntityCode(tcode)
if c:IsFacedown() then
Duel.ConfirmCards(1-tp,Group.FromCards(c))
end
c:ReplaceEffect(tcode,0,0)
Duel.Hint(HINT_CARD,0,tcode)
if c:IsLocation(LOCATION_HAND) then
local sp=c:GetControler()
Duel.ShuffleHand(sp)
end
end
Duel.Readjust()
end
function cm.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(24,0,aux.Stringid(m,14))
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==tp and re:GetHandler()~=e:GetHandler() and e:GetHandler():GetFlagEffect(16100000)==0 and Duel.GetFlagEffect(tp,m)<10
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanAddCounter(0xa7f,1) end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:AddCounter(0xa7f,1)
local num=Duel.GetRandomNumber(2,13)
Duel.Hint(24,0,aux.Stringid(m,num))
end
function cm.attackup(e,c)
return c:GetCounter(0xa7f)*200
end
function cm.imcon(e)
return e:GetHandler():IsAttackAbove(4000) and e:GetHandler():GetFlagEffect(16100000)==0
end
function cm.con(e)
return e:GetHandler():GetFlagEffect(16100000)==0
end
function cm.con2(e)
return e:GetHandler():GetFlagEffect(16100000)>0
end
function cm.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer() and re:IsActivated()
end
function cm.chcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanRemoveCounter(tp,0xa7f,10,REASON_COST) end
c:RemoveCounter(tp,0xa7f,10,REASON_COST)
end
function cm.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(16100000)==0 then
Duel.Hint(HINT_CARD,0,12847099)
local sidecode=c.side_code
c:SetEntityCode(sidecode)
c:RegisterFlagEffect(16100000,RESET_EVENT+0x7e0000,0,0)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m+1,5))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_INACTIVATE)
e3:SetValue(cm.effectfilter)
e3:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e3,tp)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_DISEFFECT)
Duel.RegisterEffect(e4,tp)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m+1,5))
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetTargetRange(1,0)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
Duel.RegisterEffect(e4,tp)
Duel.Hint(24,0,aux.Stringid(m+1,0))
end
end
function cm.effectfilter(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
local label=e:GetLabel()
return te:GetHandler():IsCode(m+1)
end
function cm.remtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) and c:GetFlagEffect(16100000)>0 end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function cm.remop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,nil)
Duel.Hint(24,0,aux.Stringid(m+1,1))
Duel.Hint(24,0,aux.Stringid(m+1,2))
for i=1,1 do
Duel.Hint(HINT_CARD,0,12847097)
end
if Duel.Remove(g1,POS_FACEUP,REASON_EFFECT)~=0 and c:GetFlagEffect(16100000)>0 then
Duel.Hint(HINT_CARD,0,12847098)
local sidecode=c.code
c:SetEntityCode(sidecode)
c:ResetFlagEffect(16100000)
Duel.AdjustAll()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
local tc=Duel.SelectMatchingCard(tp,cm.ccheck,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
tc:AddCounter(0xa7f,5)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(-2000)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function cm.ccheck(c)
return c:IsCode(m) and c:IsCanAddCounter(0xa7f,5)
end
\ No newline at end of file
--太空·埃列什基伽勒
local m=12847099
local cm=_G["c"..m]
cm.code=12847098
cm.side_code=12847099
function cm.initial_effect(c)
end
...@@ -76,10 +76,10 @@ function cm.tgcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -76,10 +76,10 @@ function cm.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToRemove() end if chkc then return chkc:IsOnField() and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingTarget(function(ec) return ec:IsFaceup() and ec:IsAbleToRemove() end,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,function(ec) return ec:IsFaceup() and ec:IsAbleToRemove() end,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,2,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,2,tp,LOCATION_DECK)
end end
......
local s,id=GetID()
function c13000757.initial_effect(c)
--synchro summon
c:SetSPSummonOnce(13000757)
local e0=s.AddLinkProcedure(c,s.filter,3,5)
c:EnableReviveLimit()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(13000757,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e3:SetCondition(s.descon)
--e3:SetCost(s.cost)
e3:SetTarget(s.sptg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
end
s.num=0
function s.AddLinkProcedure(c,f,min,max,gf)
if max==nil then max=c:GetLink() end
local e1=Effect.CreateEffect(c)
e1:SetDescription(1166)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(s.LinkCondition(f,min,max,gf))
e1:SetTarget(s.LinkTarget(f,min,max,gf))
e1:SetOperation(s.LinkOperation(f,min,max,gf))
e1:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e1)
return e1
end
function s.LinkCondition(f,minct,maxct,gf)
return function(e,c,og,lmat,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local minc=minct
local maxc=maxct
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local tp=c:GetControler()
local mg=nil
if og then
mg=og:Filter(Auxiliary.LConditionFilter,nil,f,c,e)
else
mg=Auxiliary.GetLinkMaterials(tp,f,c,e)
local mg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local mg3=Duel.GetMatchingGroup(s.filter,tp,LOCATION_SZONE,0,nil)
mg:Merge(mg2)
mg:Merge(mg3)
end
if lmat~=nil then
if not Auxiliary.LConditionFilter(lmat,f,c,e) then return false end
mg:AddCard(lmat)
end
local fg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_LMATERIAL)
if fg:IsExists(Auxiliary.MustMaterialCounterFilter,1,nil,mg) then return false end
Duel.SetSelectedCard(fg)
return mg:CheckSubGroup(Auxiliary.LCheckGoal,minc,maxc,tp,c,gf,lmat)
end
end
function s.LinkTarget(f,minct,maxct,gf)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,lmat,min,max)
local minc=minct
local maxc=maxct
if min then
if min>minc then minc=min end
if max<maxc then maxc=max end
if minc>maxc then return false end
end
local mg=nil
if og then
mg=og:Filter(Auxiliary.LConditionFilter,nil,f,c,e)
else
mg=Auxiliary.GetLinkMaterials(tp,f,c,e)
local mg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local mg3=Duel.GetMatchingGroup(s.filter,tp,LOCATION_SZONE,0,nil)
mg:Merge(mg2)
mg:Merge(mg3)
end
if lmat~=nil then
if not Auxiliary.LConditionFilter(lmat,f,c,e) then return false end
mg:AddCard(lmat)
end
local fg=Duel.GetMustMaterial(tp,EFFECT_MUST_BE_LMATERIAL)
Duel.SetSelectedCard(fg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local cancel=Duel.IsSummonCancelable()
local sg=mg:SelectSubGroup(tp,s.LCheckGoal,cancel,minc,maxc,tp,c,gf,lmat)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
end
function s.LCheckGoal(sg,tp,lc,gf,lmat)
return sg:CheckWithSumEqual(Auxiliary.GetLinkCount,lc:GetLink(),#sg,#sg)
and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0 and (not gf or gf(sg,lc,tp))
and not sg:IsExists(Auxiliary.LUncompatibilityFilter,1,nil,sg,lc,tp)
and (not lmat or sg:IsContains(lmat)) and sg:FilterCount(s.link,nil)<=2
end
function s.link(c)
return c:IsFacedown() and c:IsLocation(LOCATION_MZONE)
end
function s.LinkOperation(f,minct,maxct,gf)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,lmat,min,max)
local g=e:GetLabelObject()
c:SetMaterial(g)
Auxiliary.LExtraMaterialCount(g,c,tp)
Duel.SendtoGrave(g,REASON_MATERIAL+REASON_LINK)
g:DeleteGroup()
end
end
function s.chainlm(e,ep,tp)
return tp==ep
end
function s.filter(c)
return bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0
end
function s.filter2(c,tp)
return c:IsFacedown()
end
function s.mattg(e,c,tp)
return bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0
end
function s.matval(e,lc,mg,c,tp)
if e:GetHandler()~=lc then return false,nil end
return true,true
end
function s.matval2(e,lc,mg,c,tp)
if e:GetHandler()~=lc then return false,nil end
return true,not mg or not mg:IsExists(s.filter2,1,nil,tp)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE+LOCATION_GRAVE,LOCATION_MZONE+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local aa=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil,tp)
if e:GetHandler():GetFlagEffect(13000757)>0 then Duel.SetChainLimit(s.chainlm) end
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
s.num=s.num+1
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(s.atkval)
e2:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e2)
if Duel.SelectYesNo(tp,aux.Stringid(13000757,0)) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
if not tc:IsLocation(LOCATION_REMOVED) then
local aa=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,3,nil)
Duel.SendtoDeck(aa,nil,0,REASON_EFFECT)
end
end
end
function s.atkval(e,c)
return s.num*500
end
function s.cfilter(c,tp)
return c:IsPreviousControler(tp)
and c:GetReasonPlayer()==1-tp and c:IsSummonLocation(LOCATION_EXTRA)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
local c=e:GetHandler()
local a=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,0,1,1,nil):GetFirst()
if Duel.Destroy(a,REASON_COST)~0 and a:IsSummonLocation(LOCATION_EXTRA) then
c:RegisterFlagEffect(13000757,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
local c=e:GetHandler()
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
if e:GetHandler():GetFlagEffect(13000757)>0 then Duel.SetChainLimit(s.chainlm) end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--念力跃冲者
function c49811325.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(49811325,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,49811325)
e1:SetCost(c49811325.spcost)
e1:SetTarget(c49811325.sptg)
e1:SetOperation(c49811325.spop)
c:RegisterEffect(e1)
--tograve
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(49811325,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOEXTRA)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_PAY_LPCOST)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,49811326)
e2:SetCondition(c49811325.tgcon)
e2:SetCost(c49811325.tgcost)
e2:SetTarget(c49811325.tgtg)
e2:SetOperation(c49811325.tgop)
c:RegisterEffect(e2)
end
function c49811325.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReleasable() and Duel.GetMZoneCount(tp,c)>1 end
Duel.Release(c,REASON_COST)
end
function c49811325.filter(c,e,tp)
return c:IsCode(52430902) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c49811325.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsExistingMatchingCard(c49811325.filter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.IsPlayerCanSpecialSummonMonster(tp,49811326,0,TYPES_TOKEN_MONSTER,100,100,2,RACE_PSYCHO,ATTRIBUTE_EARTH,POS_FACEUP)end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
end
function c49811325.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c49811325.filter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,49811326,0,TYPES_TOKEN_MONSTER,100,100,2,RACE_PSYCHO,ATTRIBUTE_EARTH,POS_FACEUP) then return end
local token=Duel.CreateToken(tp,49811326)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
end
function c49811325.tgcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function c49811325.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(49811325)==0 end
c:RegisterFlagEffect(49811325,RESET_CHAIN,0,1)
end
function c49811325.tgfilter(c)
return c:IsType(TYPE_SYNCHRO) and c:IsAbleToGrave()
end
function c49811325.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c49811325.tgfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,tp,LOCATION_GRAVE)
end
function c49811325.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c49811325.tgfilter,tp,LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)>0 then
Duel.SendtoDeck(e:GetHandler(),nil,0,REASON_EFFECT)
end
end
\ No newline at end of file
--时空指挥主脑
function c49811327.initial_effect(c)
aux.AddMaterialCodeList(c,47126872)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_PSYCHO),aux.FilterBoolFunction(Card.IsCode,47126872),1,1)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(49811327,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,49811327)
e1:SetCost(c49811327.thcost)
e1:SetCondition(c49811327.thcon)
e1:SetTarget(c49811327.thtg)
e1:SetOperation(c49811327.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(49811327,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,49811328)
e2:SetCondition(c49811327.thcon2)
e2:SetTarget(c49811327.thtg2)
e2:SetOperation(c49811327.thop2)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(49811327,ACTIVITY_SPSUMMON,c49811327.counterfilter)
end
function c49811327.counterfilter(c)
return c:IsRace(RACE_PSYCHO) or c:IsSummonLocation(LOCATION_EXTRA)
end
function c49811327.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(49811327,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c49811327.splimit)
Duel.RegisterEffect(e1,tp)
end
function c49811327.splimit(e,c)
return not c:IsRace(RACE_PSYCHO) and not c:IsLocation(LOCATION_EXTRA)
end
function c49811327.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c49811327.thfilter(c)
return c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and c:IsAbleToHand()
end
function c49811327.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c49811327.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c49811327.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c49811327.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c49811327.thcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c49811327.thfilter2(c)
return c:IsRace(RACE_PSYCHO) and not c:IsSummonableCard() and c:IsAbleToHand()
end
function c49811327.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c49811327.thfilter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c49811327.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c49811327.thfilter2),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--暂念模拟器
function c49811329.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c49811329.cost)
e1:SetTarget(c49811329.target)
e1:SetOperation(c49811329.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c49811329.thtg)
e2:SetOperation(c49811329.thop)
c:RegisterEffect(e2)
end
function c49811329.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c49811329.filter(c,e,tp)
return c:IsLevelBelow(3) and c:IsRace(RACE_PSYCHO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c49811329.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c49811329.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_MZONE)
end
function c49811329.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c49811329.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function c49811329.thfilter(c)
return c:IsRace(RACE_PSYCHO) and c:IsAbleToHand()
end
function c49811329.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c49811329.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function c49811329.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c49811329.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
if sg:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
end
\ No newline at end of file
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,53761005)
c:SetUniqueOnField(1,0,id)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.descon1)
e1:SetCost(s.descost)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(s.descon2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DETACH_MATERIAL)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(s.actg)
e3:SetOperation(s.acop)
c:RegisterEffect(e3)
end
function s.descon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,id)
end
function s.descon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,id)
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and Duel.IsExistingMatchingCard(Card.IsCanOverlay,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,Card.IsCanOverlay,tp,LOCATION_HAND,0,1,1,nil)
Duel.Overlay(e:GetHandler(),g)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) and c:GetFlagEffect(id)==0 end
c:RegisterFlagEffect(id,RESET_CHAIN,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desfilter(c,seq)
local sseq=c:GetSequence()
if c:IsLocation(LOCATION_SZONE) then return sseq<5 and sseq==seq end
if sseq<5 then return math.abs(sseq-seq)==1 end
if sseq>=5 then return sseq==5 and seq==1 or sseq==6 and seq==3 end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local dg=Group.CreateGroup()
if tc:IsFaceup() then
local res=tc:GetAttack()>0
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-400)
tc:RegisterEffect(e1)
if res and tc:GetAttack()<=0 then dg:AddCard(tc) end
else dg:AddCard(tc) end
local cg=Group.__add(Duel.GetMatchingGroup(s.desfilter,tp,0,LOCATION_ONFIELD,tc,tc:GetSequence()),tc)
for ac in aux.Next(cg) do
if ac:IsType(TYPE_MONSTER) and ac:IsFaceup() then
local atk=ac:GetAttack()
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(-800)
ac:RegisterEffect(e2)
if atk>0 and ac:GetAttack()<=0 then dg:AddCard(ac) end
else dg:AddCard(ac) end
end
if #dg>0 then Duel.Destroy(dg,REASON_EFFECT) end
end
function s.acfilter(c,tp)
return c:IsCode(id+4) and c:GetType()==0x20002 and c:GetActivateEffect():IsActivatable(tp)
end
function s.actg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.acfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) end
end
function s.acop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,s.acfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,73734821,te,0,tp,tp,Duel.GetCurrentChain())
end
end
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,53761005)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE)
e1:SetCondition(s.con1)
e1:SetCost(s.cost)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(s.con2)
c:RegisterEffect(e2)
end
function s.con1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,id)
end
function s.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,id)
end
function s.costfilter(c)
return c:IsCode(53761005) and c:IsAbleToGraveAsCost()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST)
local b2=Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_DECK,0,1,nil)
if chk==0 then return b1 or b2 end
local sel=aux.SelectFromOptions(tp,{b1,aux.Stringid(id,1)},{b2,aux.Stringid(id,2)})
if sel==1 then Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST) else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
end
function s.adfilter(c)
return c:IsFaceup() and c:GetSequence()<5
end
function s.ovfilter(c,e,tp,ce)
return (not ce or not c:IsImmuneToEffect(ce)) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c)
end
function s.spfilter(c,e,tp,mc)
return c:IsCode(53761001) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if Duel.GetFlagEffect(tp,id)==0 then Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1) end
local flag=Duel.GetFlagEffectLabel(tp,id)
local b1=c:IsLocation(LOCATION_HAND) and bit.band(flag,0x1)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
local b2=c:IsLocation(LOCATION_MZONE) and bit.band(flag,0x2)==0 and Duel.IsExistingMatchingCard(s.adfilter,tp,0,LOCATION_MZONE,1,nil)
local b3=c:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and bit.band(flag,0x4)==0 and Duel.IsExistingMatchingCard(s.ovfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,nil)
if chk==0 then return (b1 or b2 or b3) and c:GetFlagEffect(id)==0 end
c:RegisterFlagEffect(id,RESET_CHAIN,0,1)
local op=0
if not c:IsLocation(LOCATION_MZONE) then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
if c:IsLocation(LOCATION_HAND) then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetFlagEffectLabel(tp,id,flag|0x1)
op=op|0x1
else
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0x40)
Duel.SetFlagEffectLabel(tp,id,flag|0x4)
op=op|0x4
end
else
local sel=aux.SelectFromOptions(tp,{b2,aux.Stringid(id,3)},{b3,aux.Stringid(id,4)},{b2 and b3,aux.Stringid(id,5)})
if sel==1 then
e:SetCategory(0)
Duel.SetFlagEffectLabel(tp,id,flag|0x2)
op=op|0x2
elseif sel==2 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetFlagEffectLabel(tp,id,flag|0x4)
op=op|0x4
elseif sel==3 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetFlagEffectLabel(tp,id,flag|0x6)
op=op|0x6
end
end
Duel.SetTargetParam(op)
end
function s.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local op=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local res=0
if op&0x1~=0 and c:IsRelateToEffect(e) then res=Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) end
local tg=Duel.GetMatchingGroup(s.adfilter,tp,0,LOCATION_MZONE,nil)
if op&0x2~=0 and #tg>0 then
if res~=0 then Duel.BreakEffect() end
res=res+1
for tc in aux.Next(tg) do
local atk=tc:GetAttack()
local def=tc:GetDefense()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(math.ceil(atk/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(math.ceil(def/2))
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
if op&0x4~=0 and Duel.IsExistingMatchingCard(s.ovfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,e) then
if res~=0 then Duel.BreakEffect() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tc=Duel.SelectMatchingCard(tp,s.ovfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp,e):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc):GetFirst()
if not sc then return end
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then Duel.Overlay(sc,mg) end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,53761005)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.con1)
e1:SetCost(s.cost)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(s.con2)
c:RegisterEffect(e2)
end
function s.con1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,id)
end
function s.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,id)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST) end
Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST)
end
function s.spfilter(c,e,tp)
return aux.IsCodeListed(c,53761005) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=c:IsLocation(LOCATION_HAND+LOCATION_MZONE) and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil)
local b2=c:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp)
if chk==0 then return b1 or b2 end
local sel=aux.SelectFromOptions(tp,{b1,aux.Stringid(id,1)},{b2,aux.Stringid(id,2)},{b1 and b2,aux.Stringid(id,3)})
if sel==1 then
e:SetCategory(CATEGORY_DISABLE)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,1-tp,LOCATION_MZONE)
elseif sel==2 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
elseif sel==3 then
e:SetCategory(CATEGORY_DISABLE+CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,1-tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
e:SetLabel(sel)
end
function s.mvfilter(c,tp)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE,PLAYER_NONE,0)
return c:IsControler(1-tp) and (c:GetSequence()<5 or ft>1)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local res
if e:GetLabel()~=2 then
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,2,nil)
for tc in aux.Next(g) do
res=true
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)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_ATTACK)
tc:RegisterEffect(e3)
Duel.AdjustInstantly(c)
end
if res and Duel.GetLocationCount(1-tp,LOCATION_MZONE,PLAYER_NONE,0)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
local sg=g:Filter(s.mvfilter,nil,tp)
local sg1=sg:Clone()
if #sg>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,5))
sg1=sg:Select(tp,1,1,nil)
end
if #sg1>0 then
Duel.HintSelection(sg1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s1=Duel.SelectDisableField(tp,1,0,LOCATION_MZONE,0)
local nseq1=math.log(bit.rshift(s1,16),2)
Duel.MoveSequence(sg1:GetFirst(),nseq1)
local sg2=Group.__sub(sg,sg1)
if #sg2>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE,PLAYER_NONE,0)>0 then
Duel.HintSelection(sg2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s2=Duel.SelectDisableField(tp,1,0,LOCATION_MZONE,0)
local nseq2=math.log(bit.rshift(s2,16),2)
Duel.MoveSequence(sg2:GetFirst(),nseq2)
end
end
end
end
if e:GetLabel()~=1 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if res then Duel.BreakEffect() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end
end
end
local s,id,o=GetID()
function s.initial_effect(c)
aux.AddCodeList(c,53761001,53761005)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.con1)
e1:SetCost(s.cost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(s.con2)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_POSITION)
e3:SetTarget(s.postg)
e3:SetOperation(s.posop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e4:SetCondition(s.con2)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,4))
e5:SetCategory(CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e5:SetCountLimit(1,id+50)
e5:SetCondition(s.tscon)
e5:SetTarget(s.tstg)
e5:SetOperation(s.tsop)
c:RegisterEffect(e5)
end
function s.con1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,id)
end
function s.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,id)
end
function s.costfilter(c)
return c:IsCode(53761005) and c:IsAbleToGraveAsCost()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST)
local b2=Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_DECK,0,1,nil)
if chk==0 then return b1 or b2 end
local sel=aux.SelectFromOptions(tp,{b1,aux.Stringid(id,2)},{b2,aux.Stringid(id,3)})
if sel==1 then Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST) else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
end
function s.spfilter(c,e,tp,mc)
return c:IsCode(53761001) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if c:IsFaceup() and c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local sc=g:GetFirst()
if sc then
local mg=c:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(c))
Duel.Overlay(sc,Group.FromCards(c))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
end
function s.posfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function s.postg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function s.posop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSITION)
local g=Duel.SelectMatchingCard(tp,s.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE) end
end
function s.tscon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_OVERLAY)
end
function s.tstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand()
or (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)) end
end
function s.tsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if aux.NecroValleyNegateCheck(c) then return end
if not aux.NecroValleyFilter()(c) then return end
local b1=c:IsAbleToHand()
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
local op=aux.SelectFromOptions(tp,{b1,1190},{b2,1152})
if op==1 then
Duel.SendtoHand(c,nil,REASON_EFFECT)
elseif op==2 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
local s,id,o=GetID()
function s.initial_effect(c)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetOperation(s.acop)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(73734821)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(s.con)
e1:SetCost(s.cost)
e1:SetTarget(s.tg)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
end
function s.acop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(e:GetHandler(),73734821,e,0,tp,tp,Duel.GetCurrentChain())
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return re and re:GetHandler()==e:GetHandler()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeckAsCost() end
Duel.SendtoDeck(c,nil,SEQ_DECKBOTTOM,REASON_COST)
end
function s.hgfilter(c)
return c:IsType(TYPE_MONSTER) and aux.IsCodeListed(c,id) and (c:IsAbleToHand() or c:IsAbleToGrave())
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil)
local b2=Duel.GetOverlayGroup(tp,1,0):IsExists(Card.IsSSetable,1,nil)
local b3=Duel.IsExistingMatchingCard(s.hgfilter,tp,LOCATION_DECK,0,1,nil)
if chk==0 then return true end
local sel=aux.SelectFromOptions(tp,{b1,aux.Stringid(id,1)},{b2,aux.Stringid(id,2)},{b3,aux.Stringid(id,3)},{true,aux.Stringid(id,4)})
e:SetLabel(sel)
if sel==1 then
e:SetCategory(CATEGORY_REMOVE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_GRAVE)
elseif sel==2 then
e:SetCategory(CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_OVERLAY)
elseif sel==3 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE+CATEGORY_DECKDES)
elseif sel==4 then
e:SetCategory(CATEGORY_ATKCHANGE)
getmetatable(e:GetHandler()).announce_filter={53761001,OPCODE_ISCODE,53761002,OPCODE_ISCODE,OPCODE_OR,53761003,OPCODE_ISCODE,OPCODE_OR,53761004,OPCODE_ISCODE,OPCODE_OR}
local ac=Duel.AnnounceCard(tp,table.unpack(getmetatable(e:GetHandler()).announce_filter))
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
if #rg>0 then Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) end
elseif op==2 then
local og=Duel.GetOverlayGroup(tp,1,0):Filter(Card.IsSSetable,nil)
if og:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local sg=og:Select(tp,1,1,nil)
Duel.SSet(tp,sg:GetFirst())
end
elseif op==3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,s.hgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()<=0 then return end
local tc=g:GetFirst()
if tc:IsAbleToHand() and (not tc:IsAbleToGrave() or Duel.SelectOption(tp,1190,1191)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else Duel.SendtoGrave(tc,REASON_EFFECT) end
elseif op==4 then
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsOriginalCodeRule,ac))
e1:SetValue(400)
Duel.RegisterEffect(e1,tp)
local e1_1=e1:Clone()
e1_1:SetCode(EFFECT_UPDATE_DEFENSE)
Duel.RegisterEffect(e1_1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(ac)
e2:SetTargetRange(1,0)
Duel.RegisterEffect(e2,tp)
end
end
\ No newline at end of file
--魔之行进
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,2)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local sel=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
if sel==0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.xyzcon)
e1:SetOperation(s.xyzop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
elseif sel==1 then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e2:SetTarget(s.rmtarget)
e2:SetValue(LOCATION_DECKSHF)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
end
function s.filter(c,sp)
return c:IsSummonPlayer(sp) and c:IsSummonType(SUMMON_TYPE_XYZ)
end
function s.xyzcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.filter,1,nil,1-tp) and Duel.GetFlagEffect(tp,id+1)==0
end
function s.xyzop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
local g=eg:Filter(s.filter,nil,1-tp)
for tc in aux.Next(g) do
local ct=tc:GetOverlayCount()
tc:RemoveOverlayCard(tp,ct,ct,REASON_EFFECT)
end
Duel.RegisterFlagEffect(tp,id+1,RESET_PHASE+PHASE_END,0,1)
end
function s.rmtarget(e,c)
return bit.band(c:GetReason(),REASON_FUSION+REASON_MATERIAL)==REASON_FUSION+REASON_MATERIAL
end
function s.thfilter1(c,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_DECK,0,1,nil,c:GetCode())
end
function s.thfilter2(c,code)
return c:IsCode(code) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_ONFIELD) and s.thfilter1(chkc,tp) end
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 and Duel.IsExistingTarget(s.thfilter1,tp,LOCATION_ONFIELD,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.thfilter1,tp,LOCATION_ONFIELD,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,2)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter2,tp,LOCATION_DECK,0,1,1,nil,tc:GetCode())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.sumlimit)
e1:SetLabel(g:GetFirst():GetCode())
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
end
end
function s.sumlimit(e,c)
return c:IsCode(e:GetLabel())
end
function s.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel())
end
\ No newline at end of file
--奥法集装士『万物生灵』
local cm,m,o=GetID()
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(60010095,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(c60010095.spcon)
e1:SetTarget(c60010095.sptg)
e1:SetOperation(c60010095.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60010095,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c60010095.cfmcon)
e2:SetTarget(c60010095.cfmtg)
e2:SetOperation(c60010095.cfmop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(60010095,5))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,60010095)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(c60010095.tg)
e3:SetOperation(c60010095.op)
c:RegisterEffect(e3)
end
function c60010095.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c60010095.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelAbove(1)
end
function c60010095.gcheck(sg)
return sg:GetSum(Card.GetLevel)<=5
end
function c60010095.fselect(g,tp,c)
return g:CheckWithSumEqual(Card.GetLevel,5,g:GetCount(),g:GetCount()) and Duel.GetLocationCount(tp,LOCATION_MZONE)>g:GetCount()
end
function c60010095.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c60010095.spfilter,tp,LOCATION_HAND,0,c,e,tp)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE))+1,g:GetCount())
if chk==0 then
if ft<=0 then return false end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
aux.GCheckAdditional=c60010095.gcheck
local res=g:CheckSubGroup(c60010095.fselect,1,ft,tp,e:GetHandler())
aux.GCheckAdditional=nil
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c60010095.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.SpecialSummonStep(c,SUMMON_TYPE_RITUAL,tp,tp,false,false,POS_FACEUP) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local g=Duel.GetMatchingGroup(c60010095.spfilter,tp,LOCATION_HAND,0,c,e,tp)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),g:GetCount())
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
aux.GCheckAdditional=c60010095.gcheck
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c60010095.fselect,false,1,ft,tp,nil)
aux.GCheckAdditional=nil
if sg then
local tc=sg:GetFirst()
while tc do
if tc:IsSetCard(0x632) and tc:IsType(TYPE_RITUAL+TYPE_MONSTER) then
Duel.SpecialSummonStep(tc,SUMMON_TYPE_RITUAL,tp,tp,false,false,POS_FACEUP)
else
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
end
tc=sg:GetNext()
end
end
Duel.SpecialSummonComplete()
end
end
--
function c60010095.cfmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c60010095.cfmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 end
end
function c60010095.cfmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=3 then return end
if Duel.ConfirmDecktop(tp,3)~=0 then
local g=Duel.GetDecktopGroup(tp,3)
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
e:GetHandler():RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
e:GetHandler():RegisterFlagEffect(60010096,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,3))
end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
e:GetHandler():RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,4))
end
if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,c,0x632) then
local gg=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,1,c,0x632):GetFirst()
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
gg:RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
gg:RegisterFlagEffect(60010096,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,3))
end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
gg:RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,4))
end
end
end
Duel.ShuffleDeck(tp)
end
function c60010095.thfilter(c)
return c:IsSetCard(0x632) and c:IsAbleToHand() and bit.band(c:GetType(),TYPE_RITUAL+TYPE_MONSTER)==TYPE_RITUAL+TYPE_MONSTER and not c:IsCode(60010095)
end
function c60010095.setfilter(c)
return c:IsSetCard(0x632) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c60010095.thfilter1(c)
return c:IsAbleToHand() and c:IsFaceup()
end
function c60010095.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return (Card.GetFlagEffect(c,60010095)~=0 and Duel.IsExistingMatchingCard(c60010095.thfilter,tp,LOCATION_GRAVE,0,1,nil)) or (Card.GetFlagEffect(c,60010096)~=0 and Duel.IsExistingMatchingCard(c60010095.setfilter,tp,LOCATION_DECK,0,1,nil)) or (Card.GetFlagEffect(c,60010097)~=0 and Duel.IsExistingMatchingCard(c60010095.thfilter1,tp,0,LOCATION_MZONE,1,nil)) end
--Duel.GetFlagEffect(c,67200810)==1
end
function c60010095.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Card.GetFlagEffect(c,60010095)~=0 and Duel.IsExistingMatchingCard(c60010095.thfilter,tp,LOCATION_GRAVE,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectMatchingCard(tp,c60010095.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if g1:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g1)
end
end
if Card.GetFlagEffect(c,60010096)~=0 and Duel.IsExistingMatchingCard(c60010095.setfilter,tp,LOCATION_DECK,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g2=Duel.SelectMatchingCard(tp,c60010095.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if g2:GetCount()>0 then
Duel.SSet(tp,g2:GetFirst())
end
end
if Card.GetFlagEffect(c,60010097)~=0 and Duel.IsExistingMatchingCard(c60010095.thfilter1,tp,0,LOCATION_MZONE,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g3=Duel.SelectMatchingCard(tp,c60010095.thfilter1,tp,0,LOCATION_MZONE,1,1,nil)
if g3:GetCount()>0 then
Duel.SendtoHand(g3,nil,REASON_EFFECT)
end
end
end
--奥法集装士『风华乱舞』
function c60010096.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(60010096,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(c60010096.spcon)
e1:SetTarget(c60010096.sptg)
e1:SetOperation(c60010096.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60010096,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c60010096.cfmcon)
e2:SetTarget(c60010096.cfmtg)
e2:SetOperation(c60010096.cfmop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(60010096,5))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,60010096)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(c60010096.tg)
e3:SetOperation(c60010096.op)
c:RegisterEffect(e3)
end
function c60010096.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c60010096.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelAbove(1)
end
function c60010096.gcheck(sg)
return sg:GetSum(Card.GetLevel)<=5
end
function c60010096.fselect(g,tp,c)
return g:CheckWithSumEqual(Card.GetLevel,5,g:GetCount(),g:GetCount()) and Duel.GetLocationCount(tp,LOCATION_MZONE)>g:GetCount()
end
function c60010096.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c60010096.spfilter,tp,LOCATION_HAND,0,c,e,tp)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE))+1,g:GetCount())
if chk==0 then
if ft<=0 then return false end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
aux.GCheckAdditional=c60010096.gcheck
local res=g:CheckSubGroup(c60010096.fselect,1,ft,tp,e:GetHandler())
aux.GCheckAdditional=nil
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c60010096.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.SpecialSummonStep(c,SUMMON_TYPE_RITUAL,tp,tp,false,false,POS_FACEUP) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local g=Duel.GetMatchingGroup(c60010096.spfilter,tp,LOCATION_HAND,0,c,e,tp)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),g:GetCount())
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
aux.GCheckAdditional=c60010096.gcheck
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c60010096.fselect,false,1,ft,tp,nil)
aux.GCheckAdditional=nil
if sg then
local tc=sg:GetFirst()
while tc do
if tc:IsSetCard(0x632) and tc:IsType(TYPE_RITUAL+TYPE_MONSTER) then
Duel.SpecialSummonStep(tc,SUMMON_TYPE_RITUAL,tp,tp,false,false,POS_FACEUP)
else
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
end
tc=sg:GetNext()
end
end
Duel.SpecialSummonComplete()
end
end
--
function c60010096.cfmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c60010096.cfmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 end
end
function c60010096.cfmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=3 then return end
if Duel.ConfirmDecktop(tp,3)~=0 then
local g=Duel.GetDecktopGroup(tp,3)
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
e:GetHandler():RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
e:GetHandler():RegisterFlagEffect(60010096,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,3))
end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
e:GetHandler():RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,4))
end
if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,c,0x632) then
local gg=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,1,c,0x632):GetFirst()
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
gg:RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
gg:RegisterFlagEffect(60010096,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,3))
end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
gg:RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,4))
end
end
end
Duel.ShuffleDeck(tp)
end
function c60010096.thfilter(c)
return c:IsSetCard(0x632) and c:IsAbleToHand() and bit.band(c:GetType(),TYPE_RITUAL+TYPE_MONSTER)==TYPE_RITUAL+TYPE_MONSTER and not c:IsCode(60010096)
end
function c60010096.setfilter(c)
return c:IsSetCard(0x632) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c60010096.thfilter1(c)
return c:IsAbleToHand() and c:IsFaceup()
end
function c60010096.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return (Card.GetFlagEffect(c,60010095)~=0 and Duel.IsPlayerCanDraw(tp,1)) or (Card.GetFlagEffect(c,60010096)~=0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0) or (Card.GetFlagEffect(c,60010097)~=0) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c60010096.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Card.GetFlagEffect(c,60010095)~=0 and Duel.IsPlayerCanDraw(tp,1) then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
if Card.GetFlagEffect(c,60010096)~=0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 then
if Duel.ConfirmDecktop(tp,1)~=0 then
local g=Duel.GetDecktopGroup(tp,1)
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
e:GetHandler():RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
e:GetHandler():RegisterFlagEffect(60010096,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,3))
end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
e:GetHandler():RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,4))
end
end
Duel.ShuffleDeck(tp)
end
if Card.GetFlagEffect(c,60010097)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_RITUAL+TYPE_MONSTER))
e1:SetValue(c60010096.efilter)
if Duel.GetCurrentPhase()==PHASE_MAIN1 then
e1:SetReset(RESET_PHASE+PHASE_MAIN1)
Duel.RegisterFlagEffect(tp,60010096,RESET_PHASE+PHASE_MAIN1,0,1)
else
e1:SetReset(RESET_PHASE+PHASE_MAIN2)
Duel.RegisterFlagEffect(tp,60010096,RESET_PHASE+PHASE_MAIN2,0,1)
end
Duel.RegisterEffect(e1,tp)
end
end
function c60010096.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer() and re:IsActivated()
end
--奥法集装士『归根何处』
function c60010097.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(60010097,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(c60010097.spcon)
e1:SetTarget(c60010097.sptg)
e1:SetOperation(c60010097.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60010097,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c60010097.cfmcon)
e2:SetTarget(c60010097.cfmtg)
e2:SetOperation(c60010097.cfmop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(60010097,5))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,60010097)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(c60010097.tg)
e3:SetOperation(c60010097.op)
c:RegisterEffect(e3)
end
function c60010097.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c60010097.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelAbove(1)
end
function c60010097.gcheck(sg)
return sg:GetSum(Card.GetLevel)<=5
end
function c60010097.fselect(g,tp,c)
return g:CheckWithSumEqual(Card.GetLevel,5,g:GetCount(),g:GetCount()) and Duel.GetLocationCount(tp,LOCATION_MZONE)>g:GetCount()
end
function c60010097.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c60010097.spfilter,tp,LOCATION_HAND,0,c,e,tp)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE))+1,g:GetCount())
if chk==0 then
if ft<=0 then return false end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
aux.GCheckAdditional=c60010097.gcheck
local res=g:CheckSubGroup(c60010097.fselect,1,ft,tp,e:GetHandler())
aux.GCheckAdditional=nil
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c60010097.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.SpecialSummonStep(c,SUMMON_TYPE_RITUAL,tp,tp,false,false,POS_FACEUP) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local g=Duel.GetMatchingGroup(c60010097.spfilter,tp,LOCATION_HAND,0,c,e,tp)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),g:GetCount())
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
aux.GCheckAdditional=c60010097.gcheck
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c60010097.fselect,false,1,ft,tp,nil)
aux.GCheckAdditional=nil
if sg then
local tc=sg:GetFirst()
while tc do
if tc:IsSetCard(0x632) and tc:IsType(TYPE_RITUAL+TYPE_MONSTER) then
Duel.SpecialSummonStep(tc,SUMMON_TYPE_RITUAL,tp,tp,false,false,POS_FACEUP)
else
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
end
tc=sg:GetNext()
end
end
Duel.SpecialSummonComplete()
end
end
--
function c60010097.cfmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c60010097.cfmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 end
end
function c60010097.cfmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=3 then return end
if Duel.ConfirmDecktop(tp,3)~=0 then
local g=Duel.GetDecktopGroup(tp,3)
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
e:GetHandler():RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
e:GetHandler():RegisterFlagEffect(60010096,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,3))
end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
e:GetHandler():RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,4))
end
if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,c,0x632) then
local gg=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,1,c,0x632):GetFirst()
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
gg:RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
gg:RegisterFlagEffect(60010096,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,3))
end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
gg:RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,4))
end
end
end
Duel.ShuffleDeck(tp)
end
function c60010097.thfilter(c)
return c:IsSetCard(0x632) and c:IsAbleToHand() and bit.band(c:GetType(),TYPE_RITUAL+TYPE_MONSTER)==TYPE_RITUAL+TYPE_MONSTER and not c:IsCode(60010097)
end
function c60010097.setfilter(c)
return c:IsSetCard(0x632) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c60010097.thfilter1(c)
return c:IsAbleToHand() and c:IsFaceup()
end
function c60010097.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return (Card.GetFlagEffect(c,60010095)~=0) or (Card.GetFlagEffect(c,60010096)~=0 and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)) or (Card.GetFlagEffect(c,60010097)~=0 and Duel.IsExistingMatchingCard(c60010097.thfilter,tp,LOCATION_DECK,0,1,nil)) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1500)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1500)
end
function c60010097.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Card.GetFlagEffect(c,60010095)~=0 then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
if Card.GetFlagEffect(c,60010096)~=0 and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local gq=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #gq>0 then
Duel.HintSelection(gq)
Duel.Destroy(gq,REASON_EFFECT)
end
end
if Card.GetFlagEffect(c,60010097)~=0 and Duel.IsExistingMatchingCard(c60010097.thfilter,tp,LOCATION_DECK,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c60010097.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
--奥法集装士『追月霜华』
function c60010098.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(60010098,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCondition(c60010098.spcon)
e1:SetTarget(c60010098.sptg)
e1:SetOperation(c60010098.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60010098,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c60010098.cfmcon)
e2:SetTarget(c60010098.cfmtg)
e2:SetOperation(c60010098.cfmop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(60010098,5))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,60010098)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(c60010098.tg)
e3:SetOperation(c60010098.op)
c:RegisterEffect(e3)
end
function c60010098.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c60010098.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsLevelAbove(1)
end
function c60010098.gcheck(sg)
return sg:GetSum(Card.GetLevel)<=5
end
function c60010098.fselect(g,tp,c)
return g:CheckWithSumEqual(Card.GetLevel,5,g:GetCount(),g:GetCount()) and Duel.GetLocationCount(tp,LOCATION_MZONE)>g:GetCount()
end
function c60010098.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c60010098.spfilter,tp,LOCATION_HAND,0,c,e,tp)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE))+1,g:GetCount())
if chk==0 then
if ft<=0 then return false end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
aux.GCheckAdditional=c60010098.gcheck
local res=g:CheckSubGroup(c60010098.fselect,1,ft,tp,e:GetHandler())
aux.GCheckAdditional=nil
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c60010098.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.SpecialSummonStep(c,SUMMON_TYPE_RITUAL,tp,tp,false,false,POS_FACEUP) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local g=Duel.GetMatchingGroup(c60010098.spfilter,tp,LOCATION_HAND,0,c,e,tp)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),g:GetCount())
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
aux.GCheckAdditional=c60010098.gcheck
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,c60010098.fselect,false,1,ft,tp,nil)
aux.GCheckAdditional=nil
if sg then
local tc=sg:GetFirst()
while tc do
if tc:IsSetCard(0x632) and tc:IsType(TYPE_RITUAL+TYPE_MONSTER) then
Duel.SpecialSummonStep(tc,SUMMON_TYPE_RITUAL,tp,tp,false,false,POS_FACEUP)
else
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
end
tc=sg:GetNext()
end
end
Duel.SpecialSummonComplete()
end
end
--
function c60010098.cfmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c60010098.cfmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 end
end
function c60010098.cfmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=3 then return end
if Duel.ConfirmDecktop(tp,3)~=0 then
local g=Duel.GetDecktopGroup(tp,3)
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
e:GetHandler():RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
e:GetHandler():RegisterFlagEffect(60010096,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,3))
end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
e:GetHandler():RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,4))
end
if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,c,0x632) then
local gg=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,1,c,0x632):GetFirst()
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
gg:RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
gg:RegisterFlagEffect(60010096,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,3))
end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
gg:RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,4))
end
end
end
Duel.ShuffleDeck(tp)
end
function c60010098.thfilter(c)
return c:IsSetCard(0x632) and c:IsAbleToHand() and bit.band(c:GetType(),TYPE_RITUAL+TYPE_MONSTER)==TYPE_RITUAL+TYPE_MONSTER and not c:IsCode(60010098)
end
function c60010098.setfilter(c)
return c:IsSetCard(0x632) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c60010098.thfilter1(c)
return c:IsAbleToHand() and c:IsFaceupEx()
end
function c60010098.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return (Card.GetFlagEffect(c,60010095)~=0 and Duel.IsExistingMatchingCard(c60010098.setfilter,tp,LOCATION_GRAVE,0,1,nil)) or (Card.GetFlagEffect(c,60010096)~=0 and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_HAND,1,nil)) or (Card.GetFlagEffect(c,60010097)~=0 and Duel.IsExistingMatchingCard(Card.IsFaceupEx,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil)) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1500)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1500)
end
function c60010098.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Card.GetFlagEffect(c,60010095)~=0 and Duel.IsExistingMatchingCard(c60010098.setfilter,tp,LOCATION_GRAVE,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g2=Duel.SelectMatchingCard(tp,c60010095.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if g2:GetCount()>0 then
Duel.SSet(tp,g2:GetFirst())
end
end
if Card.GetFlagEffect(c,60010096)~=0 and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_HAND,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local gq=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local gq1=Duel.SelectMatchingCard(1-tp,Card.IsAbleToDeck,1-tp,0,LOCATION_HAND,1,1,nil)
gq:Merge(gq1)
if #gq>0 then
Duel.HintSelection(gq)
Duel.SendtoDeck(gq,nil,2,REASON_EFFECT)
end
end
if Card.GetFlagEffect(c,60010097)~=0 and Duel.IsExistingMatchingCard(Card.IsFaceupEx,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceupEx(),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
--奥法集装士『太阳天道』
function c60010099.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(60010099,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c60010099.thcost)
e1:SetTarget(c60010099.thtg)
e1:SetOperation(c60010099.thop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60010099,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_REMOVE+CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c60010099.discon)
e2:SetTarget(c60010099.distg)
e2:SetOperation(c60010099.disop)
c:RegisterEffect(e2)
end
function c60010099.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c60010099.thfilter(c)
return c:IsSetCard(0x632) and c:IsAbleToHand() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c60010099.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c60010099.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c60010099.thop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetFirstMatchingCard(c60010099.thfilter,tp,LOCATION_DECK,0,nil)
if tg then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
--
function c60010099.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and Card.GetFlagEffect(c,60010095)~=0 and Card.GetFlagEffect(c,60010096)~=0 and Card.GetFlagEffect(c,60010097)~=0 and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function c60010099.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c60010099.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.NegateActivation(ev)~=0 then
local b2=Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local b3=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
local op=aux.SelectFromOptions(tp,aux.Stringid(60010099,2),{b2,aux.Stringid(60010099,3)},{b3,aux.Stringid(60010099,4)})
if op==1 then
Card.ResetFlagEffect(c,60010095)
Duel.Recover(tp,1000,REASON_EFFECT)
end
if op==2 then
Card.ResetFlagEffect(c,60010096)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
if op==3 then
Card.ResetFlagEffect(c,60010097)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g1:GetCount()>0 then
Duel.HintSelection(g1)
Duel.Destroy(g1,REASON_EFFECT)
end
end
end
end
--奥法博览厅
function c60010100.initial_effect(c)
--act in hand
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(60010100,0))
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCondition(c60010100.handcon)
c:RegisterEffect(e0)
--activate
local e1=Effect.CreateEffect(c)
--e1:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
--e1:SetCountLimit(1,60010100+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c60010100.cfmop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60010100,0))
--e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
--e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c60010100.condition)
--e2:SetTarget(c60010100.target)
e2:SetOperation(c60010100.operation)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e3)
if not c60010100.global_check then
c60010100.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c60010100.spcheckop)
Duel.RegisterEffect(ge1,0)
end
end
function c60010100.spcheckop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local p1=false
local p2=false
while tc do
if tc:IsSummonPlayer(0) and tc:IsSummonType(SUMMON_TYPE_RITUAL) and tc:IsSetCard(0x632) then p1=true else p2=true end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,60010100,RESET_PHASE+PHASE_END,0,1) end
if p2 then Duel.RegisterFlagEffect(1,60010100,RESET_PHASE+PHASE_END,0,1) end
end
function c60010100.handcon(e)
return Duel.GetFlagEffect(tp,60010100)~=0
end
--
function c60010100.cfmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=3 then return end
if Duel.ConfirmDecktop(tp,3)~=0 then
local g=Duel.GetDecktopGroup(tp,3)
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
e:GetHandler():RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
e:GetHandler():RegisterFlagEffect(60010096,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,3))
end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
e:GetHandler():RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,4))
end
end
end
--
function c60010100.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x632)
end
function c60010100.condition(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c60010100.cfilter,1,nil)
end
function c60010100.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=eg:GetFirst()
while tc do
if Card.GetFlagEffect(c,60010095)~=0 then
e:GetHandler():RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
if Card.GetFlagEffect(c,60010096)~=0 then
e:GetHandler():RegisterFlagEffect(60010096,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
if Card.GetFlagEffect(c,60010097)~=0 then
e:GetHandler():RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
tc=eg:GetNext()
end
end
--元素创想
function c60010101.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c60010101.cfmop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60010101,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c60010101.thcon)
e2:SetTarget(c60010101.thtg)
e2:SetOperation(c60010101.thop)
c:RegisterEffect(e2)
end
--
function c60010101.cfmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=3 then return end
if Duel.ConfirmDecktop(tp,3)~=0 then
local g=Duel.GetDecktopGroup(tp,3)
if g:IsExists(Card.IsType,1,nil,TYPE_MONSTER) then
e:GetHandler():RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
if g:IsExists(Card.IsType,1,nil,TYPE_SPELL) then
e:GetHandler():RegisterFlagEffect(60010096,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,3))
end
if g:IsExists(Card.IsType,1,nil,TYPE_TRAP) then
e:GetHandler():RegisterFlagEffect(60010097,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,4))
end
end
end
--
function c60010101.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Card.GetFlagEffect(c,60010095)~=0 and Card.GetFlagEffect(c,60010096)~=0 and Card.GetFlagEffect(c,60010097)~=0
end
function c60010101.thfilter(c)
return c:IsSetCard(0x632) and c:IsAbleToHand()
end
function c60010101.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGrave() and Duel.IsExistingMatchingCard(c60010101.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil) end
end
function c60010101.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SendtoGrave(c,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c60010101.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(60010101,0)) then
Duel.BreakEffect()
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
end
--快速施法
function c60010102.initial_effect(c)
--act in hand
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(60010102,0))
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e0:SetCondition(c60010102.handcon)
c:RegisterEffect(e0)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c60010102.cfmtg)
e1:SetOperation(c60010102.cfmop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60010102,1))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c60010102.sptg)
e2:SetOperation(c60010102.spop)
c:RegisterEffect(e2)
end
function c60010102.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x632) and c:IsType(TYPE_RITUAL)
end
function c60010102.handcon(e)
return Duel.IsExistingMatchingCard(c60010102.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
--
function c60010102.cfmfilter(c)
return c:IsFaceup() and c:IsSetCard(0x632)
end
function c60010102.cfmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c60010102.cfmfilter,tp,LOCATION_ONFIELD,0,1,c) end
end
function c60010102.cfmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.SelectMatchingCard(tp,c60010102.cfmfilter,tp,LOCATION_ONFIELD,0,1,1,c)
if g:GetCount()>0 then
local tg=g:GetFirst()
tg:RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
tg:RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
tg:RegisterFlagEffect(60010095,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(60010095,2))
end
end
--
function c60010102.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c60010102.spop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
\ No newline at end of file
--奥法集装士『路难寻』
function c60010103.initial_effect(c)
--disable and destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_SZONE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCondition(c60010103.condition)
e1:SetOperation(c60010103.disop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60010103,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
--e2:SetCountLimit(1)
--e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c60010103.condition)
e2:SetTarget(c60010103.target)
e2:SetOperation(c60010103.activate)
c:RegisterEffect(e2)
if not c60010103.global_check1 then
c60010103.global_check1=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SSET)
ge1:SetOperation(c60010103.checkop)
Duel.RegisterEffect(ge1,0)
end
if not c60010103.global_check then
c60010103.global_check=true
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
ge2:SetOperation(c60010103.spcheckop)
Duel.RegisterEffect(ge2,0)
end
end
--
function c60010103.spcheckop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local p1=false
local p2=false
while tc do
if tc:IsSummonPlayer(0) and tc:IsSummonType(SUMMON_TYPE_RITUAL) and tc:IsSetCard(0x632) then p1=true else p2=true end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,60010103,RESET_PHASE+PHASE_END,0,1) end
if p2 then Duel.RegisterFlagEffect(1,60010103,RESET_PHASE+PHASE_END,0,1) end
end
function c60010103.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(0,60010102,RESET_PHASE+PHASE_END,0,1)
end
--
function c60010103.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,60010103)~=0 and Duel.GetFlagEffect(tp,60010102)~=0
end
function c60010103.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SelectYesNo(tp,aux.Stringid(60010103,0)) then
local dg=Group.CreateGroup()
for i=1,ev do
local te,tgp=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
if tgp~=tp and (te:IsActiveType(TYPE_MONSTER) or te:IsHasType(EFFECT_TYPE_ACTIVATE)) then
local tc=te:GetHandler()
if tc:IsRelateToEffect(e) and tc:IsRelateToEffect(te) then
dg:AddCard(tc)
end
end
end
local gg=Group.Select(dg,tp,1,dg:GetCount(),e:GetHandler())
local gg1=gg:GetFirst()
while gg do
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c60010103.distg)
e1:SetLabelObject(gg1)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetCondition(c60010103.discon)
e2:SetOperation(c60010103.disop)
e2:SetLabelObject(gg1)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
gg1=gg:GetNext()
end
end
Duel.SendtoGrave(c,REASON_EFFECT)
end
function c60010103.distg(e,c)
local tc=e:GetLabelObject()
return c:IsOriginalCodeRule(tc:GetOriginalCodeRule()) and (c:IsType(TYPE_EFFECT) or c:GetOriginalType()&TYPE_EFFECT~=0)
end
function c60010103.discon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsOriginalCodeRule(tc:GetOriginalCodeRule())
end
function c60010103.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c60010103.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c60010103.confilter,tp,LOCATION_PZONE,0,1,nil)
and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and rp==1-tp
end
function c60010103.tdfilter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsAbleToDeck()
end
function c60010103.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c60010103.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x632))
e1:SetValue(c60010103.efilter)
e1:SetLabelObject(re)
e1:SetReset(RESET_EVENT+RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
end
function c60010103.efilter(e,re)
return re==e:GetLabelObject()
end
--奥法集装士『燃灯火』
function c60010104.initial_effect(c)
--disable and destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_SZONE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCondition(c60010104.discon)
e1:SetOperation(c60010104.disop)
c:RegisterEffect(e1)
--Activate
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(c60010104.condition)
e2:SetTarget(aux.nbtg)
e2:SetOperation(c60010104.activate)
c:RegisterEffect(e2)
if not c60010104.global_check1 then
c60010104.global_check1=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SSET)
ge1:SetOperation(c60010104.checkop)
Duel.RegisterEffect(ge1,0)
end
if not c60010104.global_check then
c60010104.global_check=true
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
ge2:SetOperation(c60010104.spcheckop)
Duel.RegisterEffect(ge2,0)
end
end
function c60010104.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x632)
end
function c60010104.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c60010104.cfilter,tp,LOCATION_MZONE,0,1,nil)
and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
end
function c60010104.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler()
if Duel.NegateActivation(ev) and tc:IsRelateToEffect(re) and Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)~=0
and tc:IsLocation(LOCATION_REMOVED) and not tc:IsReason(REASON_REDIRECT) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(c60010104.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
end
function c60010104.aclimit(e,re,tp)
local c=re:GetHandler()
local tc=e:GetLabelObject()
return c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
end
--
function c60010104.spcheckop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local p1=false
local p2=false
while tc do
if tc:IsSummonPlayer(0) and tc:IsSummonType(SUMMON_TYPE_RITUAL) and tc:IsSetCard(0x632) then p1=true else p2=true end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,60010104,RESET_PHASE+PHASE_END,0,1) end
if p2 then Duel.RegisterFlagEffect(1,60010104,RESET_PHASE+PHASE_END,0,1) end
end
function c60010104.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(0,60010102,RESET_PHASE+PHASE_END,0,1)
end
--
function c60010104.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,60010104)~=0 and Duel.GetFlagEffect(tp,60010102)~=0
end
function c60010104.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cc=Duel.GetCurrentChain()
if Duel.IsExistingMatchingCard(c60010104.thfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(60010104,0)) then
local gg=Duel.GetFieldGroup(c60010104.thfilter,tp,LOCATION_GRAVE,0,nil)
if gg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c60010104.thfilter,tp,LOCATION_GRAVE,0,1,cc,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
Duel.SendtoGrave(c,REASON_EFFECT)
end
\ No newline at end of file
--奥法集装士『今昔月』
function c60010105.initial_effect(c)
--disable and destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_SZONE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCondition(c60010105.condition)
e1:SetOperation(c60010105.disop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c60010105.atktg)
e2:SetValue(500)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_FZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e3:SetCountLimit(1)
e3:SetCondition(c60010105.thcon)
e3:SetTarget(c60010105.thtg)
e3:SetOperation(c60010105.thop)
c:RegisterEffect(e3)
if not c60010105.global_check1 then
c60010105.global_check1=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SSET)
ge1:SetOperation(c60010105.checkop)
Duel.RegisterEffect(ge1,0)
end
if not c60010105.global_check then
c60010105.global_check=true
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
ge2:SetOperation(c60010105.spcheckop)
Duel.RegisterEffect(ge2,0)
end
end
function c60010105.atktg(e,c)
return c:IsType(TYPE_RITUAL)
end
--
function c60010105.thcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c60010105.thfilter(c)
return c:IsSetCard(0x632) and c:IsAbleToHand()
end
function c60010105.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c60010105.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function c60010105.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c60010105.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--
function c60010105.spcheckop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local p1=false
local p2=false
while tc do
if tc:IsSummonPlayer(0) and tc:IsSummonType(SUMMON_TYPE_RITUAL) and tc:IsSetCard(0x632) then p1=true else p2=true end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,60010105,RESET_PHASE+PHASE_END,0,1) end
if p2 then Duel.RegisterFlagEffect(1,60010105,RESET_PHASE+PHASE_END,0,1) end
end
function c60010105.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(0,60010102,RESET_PHASE+PHASE_END,0,1)
end
--
function c60010105.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,60010105)~=0 and Duel.GetFlagEffect(tp,60010102)~=0
end
function c60010105.thfilter1(c)
return c:IsFaceup() and c:IsAbleToHand()
end
function c60010105.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsExistingMatchingCard(c60010105.thfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(60010105,0)) then
local gg=Duel.GetFieldGroup(c60010105.thfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if gg:GetCount()>0 then
Duel.SendtoHand(gg,nil,REASON_EFFECT)
end
end
Duel.Exile(c,REASON_EFFECT)
Duel.MoveToField(c,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
end
function c60010105.distg(e,c)
local tc=e:GetLabelObject()
return c:IsOriginalCodeRule(tc:GetOriginalCodeRule()) and (c:IsType(TYPE_EFFECT) or c:GetOriginalType()&TYPE_EFFECT~=0)
end
function c60010105.discon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsOriginalCodeRule(tc:GetOriginalCodeRule())
end
function c60010105.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c60010105.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c60010105.confilter,tp,LOCATION_PZONE,0,1,nil)
and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and rp==1-tp
end
function c60010105.tdfilter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsAbleToDeck()
end
function c60010105.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c60010105.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x632))
e1:SetValue(c60010105.efilter)
e1:SetLabelObject(re)
e1:SetReset(RESET_EVENT+RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
end
function c60010105.efilter(e,re)
return re==e:GetLabelObject()
end
--贝洛伯格-永屹坚城-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.deftg)
e2:SetValue(cm.defval)
c:RegisterEffect(e2)
--switch locations
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DRAW+CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END+TIMING_END_PHASE)
e3:SetTarget(cm.chtg)
e3:SetOperation(cm.chop)
c:RegisterEffect(e3)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(50,m)
e3:SetCondition(cm.regcon)
e3:SetOperation(cm.regop)
c:RegisterEffect(e3)
end
function cm.deftg(e,c)
return c:IsPosition(POS_FACEUP_DEFENSE)
end
function cm.defval(e,c)
local num=Duel.GetCounter(c:GetControler(),LOCATION_ONFIELD,0,0x629)
return num*500
end
function cm.chfilter(c)
return aux.TRUE
end
function cm.gcheck(g)
return g:GetClassCount(Card.GetControler)==1
end
function cm.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.chfilter,tp,LOCATION_ONFIELD,0,c)
if chk==0 then return g:CheckSubGroup(cm.gcheck,2,2) and Duel.IsPlayerCanDraw(tp,1) end
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.chfilter,tp,LOCATION_ONFIELD,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,cm.gcheck,false,2,2)
if sg and #sg==2 then
Duel.SendtoGrave(sg,REASON_EFFECT)
if #Duel.GetOperatedGroup()==2 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
return #g~=0 and #g==#g:Filter(Card.IsPosition,nil,POS_DEFENSE)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(c,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
local te=c:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=c:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(c,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
--佩拉-至远雪原-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--summon success
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_COUNTER)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e11:SetCode(EVENT_SUMMON_SUCCESS)
e11:SetTarget(cm.tg)
e11:SetOperation(cm.op)
c:RegisterEffect(e11)
local e2=e11:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.cgcon)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.ctfil(c)
return c:IsCode(60010143) and c:IsFaceup()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x629)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
if e:GetHandler():AddCounter(0x629,1)~=0 and Duel.IsExistingMatchingCard(cm.ctfil,tp,LOCATION_FZONE,0,1,nil) then
local g=Duel.GetMatchingGroup(cm.ctfil,tp,LOCATION_FZONE,0,nil)
if #g==0 then return end
for c in aux.Next(g) do
c:AddCounter(0x629,1)
end
end
end
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.spfil(c,tuner)
local g=Duel.GetMatchingGroup(Card.IsPosition,tp,LOCATION_MZONE,0,nil,POS_FACEUP_DEFENSE):RemoveCard(tuner)
return c:IsSynchroSummonable(tuner,g)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING)
and Duel.IsExistingMatchingCard(cm.spfil,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetMatchingGroup(cm.spfil,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)
local lg=Duel.GetMatchingGroup(Card.IsPosition,tp,LOCATION_MZONE,0,nil,POS_FACEUP_DEFENSE):RemoveCard(c)
Duel.SynchroSummon(tp,sg:GetFirst(),c,lg)
end
end
function cm.cgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)~=0
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local i=400
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
i=800
end
for c in aux.Next(Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-i)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-i)
c:RegisterEffect(e1)
end
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
Duel.Damage(1-tp,200,REASON_EFFECT)
end
end
\ No newline at end of file
--晚安与睡颜
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,4,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,4,REASON_COST)
end
function cm.filter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--杰帕德-不屈之盾-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
aux.AddSynchroProcedure(c,cm.synfilter,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--summon success
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_COUNTER)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
e11:SetTarget(cm.tg)
e11:SetOperation(cm.op)
c:RegisterEffect(e11)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--target/atk protection
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetValue(cm.atlimit)
c:RegisterEffect(e2)
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_MZONE)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetTarget(cm.tglimit)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetCondition(cm.icon)
e3:SetTarget(cm.indtg)
e3:SetValue(cm.efilter)
c:RegisterEffect(e3)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.synfilter(c)
return c:GetCounter(0x629)>0
end
function cm.ctfil(c)
return c:IsCode(60010143) and c:IsFaceup()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x629)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
if e:GetHandler():AddCounter(0x629,1)~=0 and Duel.IsExistingMatchingCard(cm.ctfil,tp,LOCATION_FZONE,0,1,nil) then
local g=Duel.GetMatchingGroup(cm.ctfil,tp,LOCATION_FZONE,0,nil)
if #g==0 then return end
for c in aux.Next(g) do
c:AddCounter(0x629,1)
end
end
end
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.atlimit(e,c)
return c~=e:GetHandler()
end
function cm.tglimit(e,c)
return c~=e:GetHandler()
end
function cm.icon(e)
local tp=e:GetHandlerPlayer()
return Duel.IsPlayerAffectedByEffect(tp,m+1)
end
function cm.indtg(e,c)
return c:IsFaceup() and c:GetCounter(0x629)>0
end
function cm.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer() and re:IsActivated()
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(300)
e:GetHandler():RegisterEffect(e1)
end
\ No newline at end of file
--制胜的瞬间
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,1,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,1,REASON_COST)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil) end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--布洛妮娅-存护之志-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
c:SetUniqueOnField(1,0,m)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(50,m)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
--Debug.Message(Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)-c:GetCounter(0x629))
local nnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)-c:GetCounter(0x629)
if cm.cnum~=nnum then
cm.cnum=nnum
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsCanRemoveCounter(tp,1,0,0x629,1,REASON_EFFECT)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
c:AddCounter(0x629,1)
end
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local i=1
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
i=2
end
e:GetHandler():AddCounter(0x629,i)
end
\ No newline at end of file
--但战斗还未结束
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,12,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,12,REASON_COST)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.rcon)
e1:SetOperation(cm.rop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.sfil(c)
return c:GetFlagEffect(m)~=0
end
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(cm.sfil,tp,LOCATION_HAND,0,nil)
return #g==0 and Duel.GetFlagEffect(tp,m)<10
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.Draw(tp,1,REASON_EFFECT)~=0 then
local tc=Duel.GetOperatedGroup():GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
Duel.RegisterFlagEffect(tp,m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
--希儿-蝶立锋锷-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.cgcon)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m)
e3:SetCost(cm.spcost)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function cm.plfilter(c)
return Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsFaceup()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
local g=Duel.GetMatchingGroup(cm.plfilter,tp,LOCATION_ONFIELD,0,nil)
for c in aux.Next(g) do
c:AddCounter(0x629,1)
end
end
end
function cm.filter(c)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsAbleToHand()
end
function cm.cgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) and c:IsAbleToGrave()
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,3,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,3,REASON_COST)
end
function cm.spcfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_ONFIELD) and not c:IsCode(m)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
return eg:IsExists(cm.spcfilter,1,nil,tp)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
\ No newline at end of file
--于夜色中
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.filter(c,e,tp)
return c:IsCode(m-1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,6,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,6,REASON_COST)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--希露瓦-永动强音-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,cm.matfilter,2,true)
--summon success
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_COUNTER)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
e11:SetTarget(cm.tg)
e11:SetOperation(cm.op)
c:RegisterEffect(e11)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.cgcon)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.matfilter(c)
return c:GetBaseAttack()==0
end
function cm.ctfil(c)
return c:IsCode(60010143) and c:IsFaceup()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x629)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
if e:GetHandler():AddCounter(0x629,1)~=0 and Duel.IsExistingMatchingCard(cm.ctfil,tp,LOCATION_FZONE,0,1,nil) then
local g=Duel.GetMatchingGroup(cm.ctfil,tp,LOCATION_FZONE,0,nil)
if #g==0 then return end
for c in aux.Next(g) do
c:AddCounter(0x629,1)
end
end
end
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT)
local num=Duel.GetOperatedGroup()
if num~=0 then
c:AddCounter(0x629,num)
end
end
function cm.cgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) and (Duel.GetFlagEffect(tp,m)<3 or (Duel.GetFlagEffect(tp,m)<5 and Duel.IsPlayerAffectedByEffect(tp,m+1)))
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
if #g~=0 then
Duel.Destroy(g,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,m,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
\ No newline at end of file
--别让世界静下来
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,5,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,5,REASON_COST)
end
function cm.filter0(c)
return (c:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck()
end
function cm.filter1(c,e)
return (c:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function cm.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:GetBaseAttack()==0 and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(cm.filter0,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
local res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.filter1),tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat=Duel.SelectFusionMaterial(tp,tc,mg,nil,chkf)
tc:SetMaterial(mat)
if mat:IsExists(Card.IsFacedown,1,nil) then
local cg=mat:Filter(Card.IsFacedown,nil)
Duel.ConfirmCards(1-tp,cg)
end
if mat:Filter(cm.cfilter,nil):GetCount()>0 then
local cg=mat:Filter(cm.cfilter,nil)
Duel.HintSelection(cg)
end
Duel.SendtoDeck(mat,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function cm.cfilter(c)
return c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) or (c:IsLocation(LOCATION_MZONE) and c:IsFaceup())
end
\ No newline at end of file
--克拉拉-长久陪伴-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.cgcon)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.thfilter(c)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.cgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerCanDraw(tp,1)
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,1,REASON_EFFECT)==0 then return end
local tc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-tp,tc)
if tc:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,tc) and tc:IsType(TYPE_MONSTER) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=g:Select(tp,1,1,nil):GetFirst()
if Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1,true)
end
end
else
Duel.BreakEffect()
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_DISCARD)
end
Duel.ShuffleHand(tp)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerAffectedByEffect(tp,m+1)
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,c)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_SPSUMMON+REASON_DISCARD)
end
\ No newline at end of file
--无可取代的东西
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,8,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,8,REASON_COST)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return #Duel.GetDecktopGroup(1-tp,5)==5 end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetDecktopGroup(1-tp,5)
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
--虎克-冒险集结-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:SetSPSummonOnce(m)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.mfilter,1)
--summon success
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_COUNTER)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
e11:SetTarget(cm.tg)
e11:SetOperation(cm.op)
c:RegisterEffect(e11)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.cgcon)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(cm.drcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.drtg)
e2:SetOperation(cm.drop)
c:RegisterEffect(e2)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.mfilter(c)
return c:GetCounter(0x629)>0
end
function cm.ctfil(c)
return c:IsCode(60010143) and c:IsFaceup()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x629)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
if e:GetHandler():AddCounter(0x629,1)~=0 and Duel.IsExistingMatchingCard(cm.ctfil,tp,LOCATION_FZONE,0,1,nil) then
local g=Duel.GetMatchingGroup(cm.ctfil,tp,LOCATION_FZONE,0,nil)
if #g==0 then return end
for c in aux.Next(g) do
c:AddCounter(0x629,1)
end
end
end
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.filter(c,e,tp)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.cgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and c:IsAbleToGrave()
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (Duel.GetTurnCount()~=c:GetTurnID() or c:IsReason(REASON_RETURN)) and Duel.IsPlayerAffectedByEffect(tp,m+1)
end
function cm.drfilter(c,e)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsAbleToDeck() and c:IsCanBeEffectTarget(e)
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(cm.drfilter,tp,LOCATION_GRAVE,0,e:GetHandler(),e)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and g:GetClassCount(Card.GetCode)>4 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
aux.GCheckAdditional=aux.dncheck
local sg=g:SelectSubGroup(tp,aux.TRUE,false,5,5)
aux.GCheckAdditional=nil
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,5,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=5 then return end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==5 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
--鼹鼠党欢迎你
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,1,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,1,REASON_COST)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,1000,REASON_EFFECT)
end
--玲可-至远雪原-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,4,2)
--summon success
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_COUNTER)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e11:SetCode(EVENT_SPSUMMON_SUCCESS)
e11:SetTarget(cm.tg)
e11:SetOperation(cm.op)
c:RegisterEffect(e11)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,m)
e2:SetCost(cm.spcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.ctfil(c)
return c:IsCode(60010143) and c:IsFaceup()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x629)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
if e:GetHandler():AddCounter(0x629,1)~=0 and Duel.IsExistingMatchingCard(cm.ctfil,tp,LOCATION_FZONE,0,1,nil) then
local g=Duel.GetMatchingGroup(cm.ctfil,tp,LOCATION_FZONE,0,nil)
if #g==0 then return end
for c in aux.Next(g) do
c:AddCounter(0x629,1)
end
end
end
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.rmfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.filter(c,e,tp)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.rmfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.rmfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,cm.rmfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local i=400
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
i=800
end
Duel.Recover(tp,i,REASON_EFFECT)
end
\ No newline at end of file
--暖夜不会漫长
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,2,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,2,REASON_COST)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--娜塔莎-遍世仁心-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--summon success
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_COUNTER)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e11:SetCode(EVENT_SUMMON_SUCCESS)
e11:SetTarget(cm.tg)
e11:SetOperation(cm.op)
c:RegisterEffect(e11)
local e2=e11:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.rthtg)
e3:SetOperation(cm.rthop)
c:RegisterEffect(e3)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.cgcon)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.ctfil(c)
return c:IsCode(60010143) and c:IsFaceup()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x629)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local u=1
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
u=3
end
if e:GetHandler():IsRelateToEffect(e) then
if e:GetHandler():AddCounter(0x629,u)~=0 and Duel.IsExistingMatchingCard(cm.ctfil,tp,LOCATION_FZONE,0,1,nil) then
local g=Duel.GetMatchingGroup(cm.ctfil,tp,LOCATION_FZONE,0,nil)
if #g==0 then return end
for c in aux.Next(g) do
c:AddCounter(0x629,u)
end
end
end
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.rthfilter(c)
return c:IsAbleToHand() and c:GetCounter(0x629)>0
end
function cm.rthtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(cm.rthfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
and Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectTarget(tp,cm.rthfilter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g2=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,g1:GetCount(),0,LOCATION_ONFIELD)
end
function cm.rthop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g=tg:Filter(Card.IsRelateToEffect,nil,e)
local ctable={}
for tc in aux.Next(g) do
if tc:IsControler(tp) then
ctable[tc]=tc:GetCounter(0x629)
end
end
Duel.SendtoHand(g,nil,REASON_EFFECT)
local og=Duel.GetOperatedGroup()
local ct=0
for tc,num in pairs(ctable) do
if og:IsContains(tc) and tc:IsLocation(LOCATION_HAND) then
ct=ct+num
end
end
if ct>0 then
Duel.BreakEffect()
e:GetHandler():AddCounter(0x629,ct)
end
end
function cm.cgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerCanDiscardDeck(tp,1)
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.DiscardDeck(tp,1,REASON_EFFECT)
end
--一场术后对话
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,6,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,6,REASON_COST)
end
function cm.filter(c,e,tp)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and c:IsAbleToGrave()
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--卢卡-不休争斗-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--summon success
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_COUNTER)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e11:SetCode(EVENT_SUMMON_SUCCESS)
e11:SetTarget(cm.tg)
e11:SetOperation(cm.op)
c:RegisterEffect(e11)
local e2=e11:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--attack twice
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e4:SetCondition(cm.atkcon)
e4:SetValue(1)
c:RegisterEffect(e4)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetValue(1)
e2:SetCondition(cm.actcon)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.cnum then
cm.cnum=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(cm.cnum)
local c=e:GetHandler()
local i=c:GetControler()
if cm.cnum~=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629) then
cm.cnum=Duel.GetCounter(i,LOCATION_ONFIELD,0,0x629)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,i,i,0)
end
end
function cm.ctfil(c)
return c:IsCode(60010143) and c:IsFaceup()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x629)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local u=1
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
u=3
end
if e:GetHandler():IsRelateToEffect(e) then
if e:GetHandler():AddCounter(0x629,u)~=0 and Duel.IsExistingMatchingCard(cm.ctfil,tp,LOCATION_FZONE,0,1,nil) then
local g=Duel.GetMatchingGroup(cm.ctfil,tp,LOCATION_FZONE,0,nil)
if #g==0 then return end
for c in aux.Next(g) do
c:AddCounter(0x629,u)
end
end
end
if e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsLocation(LOCATION_MZONE) and not e:GetHandler():IsPosition(POS_FACEUP_DEFENSE) then
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
end
function cm.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local i=1
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
i=2
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(Duel.GetCounter(tp,LOCATION_ONFIELD,0,0x629)*100)
e:GetHandler():RegisterEffect(e1)
end
function cm.atkcon(e)
local tp=e:GetHandlerPlayer()
return Duel.IsPlayerAffectedByEffect(tp,m+1)
end
\ No newline at end of file
--决心如汗珠般闪耀
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_POSITION+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,5,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,5,REASON_COST)
end
function cm.filter(c)
return c:IsType(TYPE_MONSTER) and not c:IsPosition(POS_FACEUP_ATTACK)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
end
--桑博-假面幻想-
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--defense attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(cm.desreptg)
e2:SetValue(cm.desrepval)
e2:SetOperation(cm.desrepop)
c:RegisterEffect(e2)
end
function cm.spfilter(c,e,tp)
return c:IsCanHaveCounter(0x629) and Duel.IsCanAddCounter(tp,0x629,1,c) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.IsCanRemoveCounter(tp,1,0,0x629,3,REASON_COST)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
if Duel.RemoveCounter(tp,1,0,0x629,3,REASON_COST)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
end
function cm.repfilter(c,tp)
return c:IsControler(tp) and c:IsOnField() and (c:IsPosition(POS_FACEUP_DEFENSE) or c:IsLocation(LOCATION_SZONE))
and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function cm.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function cm.desrepval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.desrepop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(e:GetHandlerPlayer(),m)<3 then
Duel.Draw(e:GetHandlerPlayer(),1,REASON_EFFECT)
Duel.RegisterFlagEffect(e:GetHandlerPlayer(),m,RESET_PHASE+PHASE_END,0,1)
end
if Duel.IsPlayerAffectedByEffect(tp,m+1) then
c:AddCounter(0x629,1)
end
Duel.Hint(HINT_CARD,0,m)
end
\ No newline at end of file
--猎物的视线
local cm,m,o=GetID()
function cm.initial_effect(c)
c:EnableCounterPermit(0x629,LOCATION_ONFIELD)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(m)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--destory
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_POSITION+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x629,1)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x629,3,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x629,3,REASON_COST)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetTargetRange(0,1)
e3:SetValue(cm.aclimit2)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function cm.aclimit2(e,re,tp)
return re:GetActivateLocation()==LOCATION_GRAVE or re:GetActivateLocation()==LOCATION_HAND
end
\ No newline at end of file
--星-存护-
local cm,m,o=GetID()
function cm.initial_effect(c)
for i=0,0xffff do
c:EnableCounterPermit(i,LOCATION_ONFIELD)
end
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_HAND)
e3:SetCountLimit(1,m)
e3:SetCondition(cm.condition)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
--target/atk protection
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetCondition(cm.atcon)
e2:SetValue(cm.atlimit)
c:RegisterEffect(e2)
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_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(cm.atcon)
e3:SetTarget(cm.tglimit)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ADJUST)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CUSTOM+m)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(cm.cgop)
c:RegisterEffect(e1)
end
if not cm.preservationcheck then
cm.lastcounter=0
cm.counterchange=0
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p=c:GetControler()
local counternum=0
for i=0,0xffff do
counternum=counternum+Duel.GetCounter(p,LOCATION_ONFIELD,0,i)
end
if cm.lastcounter~=counternum then
cm.counterchange=math.abs(cm.lastcounter-counternum)
cm.lastcounter=counternum
Duel.RaiseEvent(c,EVENT_CUSTOM+m,nil,0,p,p,0)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)>=5 and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_FZONE,0,1,nil)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.operation(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_DEFENSE)~=0 then
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_ADJUST)
e1:SetCondition(cm.levelchangecon)
e1:SetOperation(cm.levelchangeop)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
for i=0,0xffff do
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetRange(LOCATION_MZONE)
e0:SetCode(EVENT_ADJUST)
e0:SetLabel(i)
e0:SetCondition(cm.countercon)
e0:SetOperation(cm.counterop)
e0:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e0)
end
end
end
function cm.levelchangecon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetLevel()~=math.min(Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil),13)
end
function cm.levelchangeop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lv=math.min(Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil),13)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
end
function cm.countercon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local i=e:GetLabel()
local tf=false
if Duel.GetCounter(tp,LOCATION_ONFIELD,0,i)~=c:GetCounter(i) and c:GetCounter(i)~=c:GetLevel() and Duel.GetCounter(tp,LOCATION_ONFIELD,0,i)~=0 then
tf=true
end
return tf
end
function cm.counterop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local i=e:GetLabel()
local lv=c:GetLevel()
local ct=c:GetCounter(i)
if ct>lv then
c:RemoveCounter(tp,i,ct-lv,REASON_RULE)
elseif ct<lv then
c:AddCounter(i,lv-ct)
Debug.Message(i)
end
end
function cm.atcon(e)
return e:GetHandler():GetDefense()~=0
end
function cm.atlimit(e,c)
return c~=e:GetHandler()
end
function cm.tglimit(e,c)
return c~=e:GetHandler()
end
function cm.cgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(cm.counterchange*400)
c:RegisterEffect(e1)
Duel.Recover(tp,cm.counterchange*400,REASON_EFFECT)
end
--驾驭纹章之力 琉迩 --驾驭纹章之力 琉迩
function c75000002.initial_effect(c) function c75000002.initial_effect(c)
aux.AddCodeList(c,75000001)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,75000001,c75000002.ffilter,1,true,true) aux.AddFusionProcCodeFun(c,75000001,c75000002.ffilter,1,true,true)
......
--救世神龙 传承琉迩 --救世神龙 传承琉迩
function c75000003.initial_effect(c) function c75000003.initial_effect(c)
aux.AddCodeList(c,75000001)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcCode2FunRep(c,21159309,75000001,aux.FilterBoolFunction(Card.IsFusionSetCard,0x751),1,1,true,true) aux.AddFusionProcCode2FunRep(c,21159309,75000001,aux.FilterBoolFunction(Card.IsFusionSetCard,0x751),1,1,true,true)
......
--连结的绊炎 传承:琉迩
local m=75000007
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,75000001)
aux.AddFusionProcCodeFunRep(c,75000001,c75000007.ffilter,1,127,true,true)
--material check
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c75000007.matcon)
e1:SetOperation(c75000007.matop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(c75000007.valcheck)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--SetCard
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(75000007,0))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c75000007.efcon2)
e3:SetTarget(c75000007.sttg)
e3:SetOperation(c75000007.stop)
c:RegisterEffect(e3)
--atk up
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c75000007.efcon3)
e4:SetValue(c75000007.atkval)
c:RegisterEffect(e4)
local e41=Effect.CreateEffect(c)
e41:SetType(EFFECT_TYPE_SINGLE)
e41:SetCode(EFFECT_UPDATE_DEFENSE)
e41:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e41:SetRange(LOCATION_MZONE)
e41:SetCondition(c75000007.efcon3)
e41:SetValue(c75000007.atkval)
c:RegisterEffect(e41)
--special summon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(75000007,1))
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetCountLimit(1)
e5:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(c75000007.efcon4)
e5:SetTarget(c75000007.sptg)
e5:SetOperation(c75000007.spop)
c:RegisterEffect(e5)
--spsummon
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_ATKCHANGE)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_TO_GRAVE)
e6:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e6:SetCountLimit(1,75000007+EFFECT_COUNT_CODE_DUEL)
e6:SetCondition(c75000007.sp4con)
e6:SetTarget(c75000007.sp4tg)
e6:SetOperation(c75000007.sp4op)
c:RegisterEffect(e6)
end
function c75000007.sp4con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_FUSION)-- and c:GetReasonPlayer()==1-tp
end
function c75000007.sp4tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,LOCATION_EXTRA)
end
function c75000007.sp4op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) then return end
c:SetMaterial(nil)
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(math.floor(Duel.GetLP(tp)/2))
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e2:SetValue(math.floor(Duel.GetLP(tp)/2))
c:RegisterEffect(e2)
c:RegisterFlagEffect(75000007,RESET_EVENT+RESETS_STANDARD,0,1,4)
c:RegisterFlagEffect(75000010,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,1,aux.Stringid(75000007,5))
end
end
function c75000007.efcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffectLabel(75000007) and e:GetHandler():GetFlagEffectLabel(75000007)>1
end
function c75000007.efcon3(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffectLabel(75000007) and e:GetHandler():GetFlagEffectLabel(75000007)>2
end
function c75000007.efcon4(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffectLabel(75000007) and e:GetHandler():GetFlagEffectLabel(75000007)>3 and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
function c75000007.ffilter(c,fc,sub,mg,sg)
return aux.IsCodeListed(c,75000001)
end
function c75000007.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION) and e:GetLabel()>0
end
function c75000007.matop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(75000007,RESET_EVENT+RESETS_STANDARD,0,1,e:GetLabel())
if e:GetLabel()==2 then
e:GetHandler():RegisterFlagEffect(75000008,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,1,aux.Stringid(75000007,3))
elseif e:GetLabel()==3 then
e:GetHandler():RegisterFlagEffect(75000009,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,1,aux.Stringid(75000007,4))
elseif e:GetLabel()>3 then
e:GetHandler():RegisterFlagEffect(75000010,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,1,aux.Stringid(75000007,5))
end
end
function c75000007.valcheck(e,c)
local g=c:GetMaterial()
local ct=g:GetClassCount(Card.GetFusionAttribute)
e:GetLabelObject():SetLabel(ct)
end
function c75000007.setfilter(c)
return c:IsSetCard(0x75a) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c75000007.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c75000007.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function c75000007.stop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c75000007.setfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(75000007,6))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function c75000007.atkval(e,c)
return Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil):GetClassCount(Card.GetAttribute)*400
end
function c75000007.spfilter(c,e,tp)
return aux.IsCodeListed(c,75000001) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and ((Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsLocation(LOCATION_EXTRA)) or (not c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0))
end
function c75000007.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c75000007.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED+LOCATION_GRAVE)
end
function c75000007.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c75000007.spfilter),tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--花园护卫 阿尔弗雷德
local m=75000010
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,75000001)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,75000010)
e1:SetTarget(c75000010.thtg)
e1:SetOperation(c75000010.thop)
c:RegisterEffect(e1)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e2:SetCondition(c75000010.efcon)
e2:SetOperation(c75000010.efop)
c:RegisterEffect(e2)
end
function c75000010.thfilter(c)
return aux.IsCodeListed(c,75000001) and c:IsType(TYPE_MONSTER) and c:IsFaceupEx() and c:IsAbleToHand()
end
function c75000010.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED+LOCATION_GRAVE) and chkc:IsControler(tp) and c75000010.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c75000010.thfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c75000010.thfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c75000010.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
function c75000010.efcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(r,REASON_FUSION)~=0 and c:GetReasonCard():IsRace(RACE_DRAGON)
end
function c75000010.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
--defup
local e1=Effect.CreateEffect(rc)
e1:SetDescription(aux.Stringid(75000010,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1600)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(rc)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(c75000010.indval)
e2:SetOwnerPlayer(ep)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
if not rc:IsType(TYPE_EFFECT) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_ADD_TYPE)
e3:SetValue(TYPE_EFFECT)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e3,true)
end
end
function c75000010.indval(e,re,rp)
return rp==1-e:GetOwnerPlayer()
end
--欢愉皇女 锡利奴
local m=75000011
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,75000001)
--tograve
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(75000011,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,75000011)
e1:SetTarget(c75000011.tdtg)
e1:SetOperation(c75000011.tdop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--effect gain
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e3:SetCondition(c75000011.efcon)
e3:SetOperation(c75000011.efop)
c:RegisterEffect(e3)
end
function c75000011.tdfilter(c)
return aux.IsCodeListed(c,75000001) and c:IsAbleToGrave()
end
function c75000011.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,_,exc)
if chk==0 then return Duel.IsExistingMatchingCard(c75000011.tdfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function c75000011.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c75000011.tdfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 then
local tc=Duel.GetOperatedGroup():GetFirst()
if tc:IsPreviousLocation(LOCATION_HAND) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c75000011.efcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(r,REASON_FUSION)~=0 and c:GetReasonCard():IsRace(RACE_DRAGON)
end
function c75000011.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
--negate
local e1=Effect.CreateEffect(rc)
e1:SetDescription(aux.Stringid(75000011,2))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c75000011.reccon)
e1:SetOperation(c75000011.recop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_ADD_TYPE)
e3:SetValue(TYPE_EFFECT)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e3,true)
end
end
function c75000011.reccon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==re:GetHandler()
end
function c75000011.recop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,75000011)
Duel.Recover(tp,700,REASON_EFFECT)
end
--善良的龙 贝迩
local m=75000013
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,75000001)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(75000013,1))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,75000013)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c75000013.sptg)
e1:SetOperation(c75000013.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(75000013,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,75001013)
e2:SetCondition(c75000013.thcon)
e2:SetTarget(c75000013.thtg)
e2:SetOperation(c75000013.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
end
function c75000013.filter(c)
return (aux.IsCodeListed(c,75000001) or c:IsCode(75000001)) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c75000013.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c75000013.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c75000013.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c75000013.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c75000013.spfilter(c,e,tp)
return (aux.IsCodeListed(c,75000001) or c:IsCode(75000001)) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c75000013.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
local tg=Duel.GetMatchingGroup(c75000013.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
if tg:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(75000013,3)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=tg:Select(tp,1,1,nil)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c75000013.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT+REASON_REDIRECT)
end
function c75000013.thfilter(c)
return aux.IsCodeListed(c,75000001) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c75000013.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c75000013.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c75000013.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c75000013.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--勇往直前的黑铁 帝亚曼德
local m=75000015
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,75000001)
--cannot target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetValue(1)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(aux.indoval)
c:RegisterEffect(e2)
--atk
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_START)
e3:SetCountLimit(1,75000015)
e3:SetCondition(c75000015.atkcon)
e3:SetOperation(c75000015.atkop)
c:RegisterEffect(e3)
--effect gain
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BE_MATERIAL)
e4:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e4:SetCondition(c75000015.efcon)
e4:SetOperation(c75000015.efop)
c:RegisterEffect(e4)
end
function c75000015.efcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(r,REASON_FUSION)~=0 and c:GetReasonCard():IsRace(RACE_DRAGON)
end
function c75000015.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
--defup
local e1=Effect.CreateEffect(rc)
e1:SetDescription(aux.Stringid(75000015,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_ADD_TYPE)
e3:SetValue(TYPE_EFFECT)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e3,true)
end
end
function c75000015.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (Duel.GetAttacker()==c or Duel.GetAttackTarget()==c)
end
function c75000015.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Card.ResetFlagEffect(c,75000015)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(math.floor(c:GetDefense()/2))
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(c75000015.operation)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
c:RegisterFlagEffect(75000015,RESET_EVENT+RESETS_STANDARD,0,1,0)
end
end
function c75000015.operation(e,tp,eg,ep,ev,re,r,rp)
if ep~=tp and e:GetHandler():GetFlagEffect(75000015)>0 then
Duel.Recover(tp,700,REASON_EFFECT)
end
Card.ResetFlagEffect(e:GetHandler(),75000015)
end
--流风回雪 响心艾比
local m=75000016
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,75000001)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,75000016+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c75000016.hspcon)
e1:SetValue(c75000016.hspval)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,75010016)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c75000016.sptg)
e2:SetOperation(c75000016.spop)
c:RegisterEffect(e2)
--effect gain
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e3:SetCondition(c75000016.efcon)
e3:SetOperation(c75000016.efop)
c:RegisterEffect(e3)
end
function c75000016.efcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(r,REASON_FUSION)~=0 and c:GetReasonCard():IsRace(RACE_DRAGON)
end
function c75000016.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
--negate
local e1=Effect.CreateEffect(rc)
e1:SetDescription(aux.Stringid(75000016,2))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EVENT_BATTLE_START)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c75000016.reccon)
e1:SetOperation(c75000016.recop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_ADD_TYPE)
e3:SetValue(TYPE_EFFECT)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e3,true)
end
end
function c75000016.reccon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsRelateToBattle()
end
function c75000016.recop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetBattleTarget()
if tc and tc:IsFaceup() then
Duel.Damage(1-tp,math.floor(tc:GetBaseAttack()/4),REASON_EFFECT)
end
end
function c75000016.cfilter(c)
return (aux.IsCodeListed(c,75000001) or c:IsCode(75000001)) and c:IsFaceup()
end
function c75000016.getzone(tp)
local zone=0
local g=Duel.GetMatchingGroup(c75000016.cfilter,tp,LOCATION_MZONE,0,nil)
for tc in aux.Next(g) do
local seq=tc:GetSequence()
if seq==5 or seq==6 then
zone=zone|(1<<aux.MZoneSequence(seq))
else
if seq>0 then zone=zone|(1<<(seq-1)) end
if seq<4 then zone=zone|(1<<(seq+1)) end
end
end
return zone
end
function c75000016.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=c75000016.getzone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c75000016.hspval(e,c)
local tp=c:GetControler()
return 0,c75000016.getzone(tp)
end
function c75000016.spfilter(c,e,tp,zone)
return (aux.IsCodeListed(c,75000001) or c:IsCode(75000001)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
function c75000016.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local zone=0
local seq=e:GetHandler():GetSequence()
if seq==5 or seq==6 then
zone=zone|(1<<aux.MZoneSequence(seq))
else
if seq>0 then zone=zone|(1<<(seq-1)) end
if seq<4 then zone=zone|(1<<(seq+1)) end
end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c75000016.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,zone) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c75000016.spop(e,tp,eg,ep,ev,re,r,rp)
local zone=0
local seq=e:GetHandler():GetSequence()
if seq==5 or seq==6 then
zone=zone|(1<<aux.MZoneSequence(seq))
else
if seq>0 then zone=zone|(1<<(seq-1)) end
if seq<4 then zone=zone|(1<<(seq+1)) end
end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c75000016.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,zone)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP,zone)
end
end
--神龙团结
local m=75000020
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,75000001)
c:SetUniqueOnField(1,0,75000001)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--recover
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(75000020,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c75000020.spccon)
e2:SetTarget(c75000020.spctg)
e2:SetOperation(c75000020.spcop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c75000020.SPcfilter(c,tp)
return c:IsFaceup() and c:IsSummonPlayer(tp) and c:IsSetCard(0x751)
end
function c75000020.spccon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c75000020.SPcfilter,1,nil,tp)
end
function c75000020.filter(c,att)
return c:IsFaceup() and c:IsAttribute(att)
end
function c75000020.spfilter(c,e,tp)
return aux.IsCodeListed(c,75000001) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and not Duel.IsExistingMatchingCard(c75000020.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil,c:GetAttribute())
end
function c75000020.spctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c75000020.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c75000020.spcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c75000020.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 then
local att=g:GetFirst():GetAttribute()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetTargetRange(1,0)
e0:SetTarget(c75000020.splimit)
e0:SetLabel(att)
e0:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e0,tp)
end
end
end
function c75000020.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsAttribute(e:GetLabel()) and se and se:GetHandler():IsCode(75000020)
end
--神速迴避
local m=75000021
local cm=_G["c"..m]
function cm.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(3,75000021)
e1:SetTarget(c75000021.target)
e1:SetOperation(c75000021.activate)
c:RegisterEffect(e1)
end
function c75000021.tgfilter(c,e,tp)
return c:IsFaceup() and ((c:IsType(TYPE_EFFECT) and c:IsCanAddCounter(0x75a1,1) and c:IsRace(RACE_DRAGON)) or not c:IsRace(RACE_DRAGON))
end
function c75000021.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c75000021.tgfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c75000021.tgfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c75000021.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
if g:GetFirst():IsRace(RACE_DRAGON) then
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x75a1)
end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(c75000021.chainlm)
end
end
function c75000021.chainlm(re,rp,tp)
return re:GetHandler():IsSetCard(0x75a)
end
function c75000021.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_REMOVE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetTarget(c75000021.rmlimit)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
tc:RegisterEffect(e2)
if tc:IsRace(RACE_DRAGON) and tc:IsCanAddCounter(0x75a1,1) then
tc:AddCounter(0x75a1,1)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_NEGATE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetCondition(c75000021.discon)
e3:SetCost(c75000021.discost)
e3:SetOperation(c75000021.disop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
end
end
function c75000021.rmlimit(e,c,tp,r,re)
return c==e:GetHandler() and r&REASON_EFFECT>0
end
function c75000021.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if rp==tp then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and tg:IsContains(c) and Duel.IsChainNegatable(ev)
end
function c75000021.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x75a1,1,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x75a1,1,REASON_COST)
end
function c75000021.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
end
--神速追击
local m=75000022
local cm=_G["c"..m]
function cm.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(3,75000021)
e1:SetTarget(c75000022.target)
e1:SetOperation(c75000022.activate)
c:RegisterEffect(e1)
end
function c75000022.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and Card.IsFaceup(chkc) end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(c75000022.chainlm)
end
end
function c75000022.chainlm(re,rp,tp)
return re:GetHandler():IsSetCard(0x75a)
end
function c75000022.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(700)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
if tc:IsRace(RACE_DRAGON) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetOperation(c75000022.dmop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
end
end
function c75000022.dmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,75000022)
Duel.Damage(1-tp,math.floor(ev/2),REASON_EFFECT)
end
--纹章!结合!
local m=75000023
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,75000001)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,75000023+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c75000023.target)
e1:SetOperation(c75000023.activate)
c:RegisterEffect(e1)
end
c75000023.fusion_effect=true
function c75000023.filter0(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end
function c75000023.filter1(c,e)
return not c:IsImmuneToEffect(e) and c:IsAbleToGrave()
end
function c75000023.filter(c)
return c:IsAbleToGrave()
end
function c75000023.filter2(c,e,tp,m,f,chkf)
if not (c:IsType(TYPE_FUSION) and aux.IsMaterialListCode(c,75000001) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
aux.FCheckAdditional=c.ttl_fusion_check or c75000023.frcheck
local res=c:CheckFusionMaterial(m,nil,chkf)
aux.FCheckAdditional=nil
return res
end
function c75000023.frcheck(tp,sg,fc)
return sg:IsExists(Card.IsFusionCode,1,nil,75000001)
end
function c75000023.fcheck(ct)
return function(tp,sg,fc)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<=ct
end
end
function c75000023.gcheck(ct)
return function(sg)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<=ct
end
end
function c75000023.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c75000023.filter,nil)
local mg2=Duel.GetMatchingGroup(c75000023.filter0,tp,LOCATION_DECK,0,nil)
local ct=Duel.GetMatchingGroupCount(aux.TRUE,tp,0,LOCATION_MZONE,nil)+1
if mg2:GetCount()>0 and mg1:GetCount()+ct>1 then
mg1:Merge(mg2)
aux.FCheckAdditional=c75000023.fcheck(ct)
aux.GCheckAdditional=c75000023.gcheck(ct)
end
local res=Duel.IsExistingMatchingCard(c75000023.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c75000023.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c75000023.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(aux.TRUE,tp,0,LOCATION_MZONE,nil)+1
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c75000023.filter1,nil,e)
local exmat=false
local mg2=Duel.GetMatchingGroup(c75000023.filter0,tp,LOCATION_DECK,0,nil)
if mg2:GetCount()>0 then
mg1:Merge(mg2)
exmat=true
end
if exmat then
aux.FCheckAdditional=c75000023.fcheck(ct)
aux.GCheckAdditional=c75000023.gcheck(ct)
end
local sg1=Duel.GetMatchingGroup(c75000023.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c75000023.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
mg1:RemoveCard(tc)
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
if exmat then
aux.FCheckAdditional=c75000023.fcheck(ct)
aux.GCheckAdditional=c75000023.gcheck(ct)
end
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
--极超助手·阿炽
local s,id,o=GetID()
function s.initial_effect(c)
s.sp(c)
s.sp2(c)
s.sp3(c)
end
function s.sp3(c)
--spsummon2
local e1=Effect.CreateEffect(c)
e1:SetDescription(1169)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,id+514)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.fcheck(tp,sg,fc)
return sg:FilterCount(Card.IsRace,nil,RACE_THUNDER+RACE_AQUA)~=0
end
function s.gcheck(sg)
return sg:FilterCount(Card.IsRace,nil,RACE_THUNDER+RACE_AQUA)~=0
end
function s.filter0(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function s.filter1(c,e)
return c:IsLocation(LOCATION_GRAVE) and not c:IsImmuneToEffect(e)
end
function s.filter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(s.filter0,tp,LOCATION_GRAVE,0,nil,e)
aux.FCheckAdditional=s.fcheck
aux.GCheckAdditional=s.gcheck
local res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
local mg1=Duel.GetMatchingGroup(s.filter0,tp,LOCATION_GRAVE,0,nil,e)
aux.FCheckAdditional=s.fcheck
aux.GCheckAdditional=s.gcheck
local sg1=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
aux.FCheckAdditional=s.fcheck
aux.GCheckAdditional=s.gcheck
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,c,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
tc:SetMaterial(mat1)
Duel.SendtoDeck(mat1,nil,SEQ_DECKSHUFFLE,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,c,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function s.sp2(c)
--spsummon2
local e1=Effect.CreateEffect(c)
e1:SetDescription(2)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id+114)
e1:SetTarget(s.sptg2)
e1:SetOperation(s.spop2)
c:RegisterEffect(e1)
end
function s.spfilter(c,e,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_THUNDER+RACE_AQUA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end
end
function s.sp(c)
--spsummon1
local e1=Effect.CreateEffect(c)
e1:SetDescription(2)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.spcon1)
e1:SetTarget(s.sptg1)
e1:SetOperation(s.spop1)
c:RegisterEffect(e1)
end
function s.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
function c88800029.initial_effect(c) function c88800029.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88880029,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
...@@ -12,6 +13,7 @@ function c88800029.initial_effect(c) ...@@ -12,6 +13,7 @@ function c88800029.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--activate --activate
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88880029,1))
e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
......
...@@ -25,6 +25,7 @@ function s.initial_effect(c) ...@@ -25,6 +25,7 @@ function s.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--SpecialSummon --SpecialSummon
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION) e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_FZONE) e4:SetRange(LOCATION_FZONE)
...@@ -32,6 +33,16 @@ function s.initial_effect(c) ...@@ -32,6 +33,16 @@ function s.initial_effect(c)
e4:SetTarget(s.sptg) e4:SetTarget(s.sptg)
e4:SetOperation(s.spop) e4:SetOperation(s.spop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--SpecialSummon
local e5=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_FZONE)
e5:SetCountLimit(1,id)
e5:SetTarget(s.tdtg)
e5:SetOperation(s.tdop)
c:RegisterEffect(e5)
end end
function s.atktg(e,c) function s.atktg(e,c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_WARRIOR) return c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_WARRIOR)
...@@ -51,4 +62,20 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,4 +62,20 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
end
function s.tdfilter(c)
return c:IsSetCard(0xc02) and c:IsAbleToDeck()
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and s.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,s.tdfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,5,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end end
\ No newline at end of file
...@@ -18,11 +18,10 @@ function s.initial_effect(c) ...@@ -18,11 +18,10 @@ function s.initial_effect(c)
e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN) e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND) e3:SetRange(LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,id+o) e3:SetCountLimit(1,id+o)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCost(s.cost1) e3:SetCost(s.cost1)
e3:SetCondition(s.spcon) e3:SetCondition(s.spcon)
e3:SetTarget(s.rmtg3)
e3:SetOperation(s.rmop3) e3:SetOperation(s.rmop3)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
...@@ -33,7 +32,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -33,7 +32,7 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp) function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local a,at=Duel.GetBattleMonster(tp) local a,at=Duel.GetBattleMonster(tp)
return a and at and at:GetAttack()>0 and (a:IsType(TYPE_FUSION) and a:IsSetCard(0xc06)) return a and at and at:GetAttack()>0 and (a:IsType(TYPE_MONSTER) and a:IsSetCard(0xc06))
end end
function s.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
local a,at=Duel.GetBattleMonster(tp) local a,at=Duel.GetBattleMonster(tp)
...@@ -41,7 +40,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -41,7 +40,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(at:GetAttack()) e1:SetValue(at:GetAttack())
a:RegisterEffect(e1) a:RegisterEffect(e1)
end end
...@@ -51,22 +50,22 @@ function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -51,22 +50,22 @@ function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD) Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end end
function s.cfilter(c) function s.cfilter(c)
return c:IsFacedown() or not c:IsSetCard(0xc06) return c:IsSetCard(0xc06) and c:IsType(TYPE_MONSTER)
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
return g:GetCount()>0 and not g:IsExists(s.cfilter,1,nil)
end
function s.rmtg3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,1-tp,LOCATION_GRAVE)
end end
function s.rmop3(e,tp,eg,ep,ev,re,r,rp) function s.rmop3(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local e1=Effect.CreateEffect(e:GetHandler())
if tc:IsRelateToEffect(e) then local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
local tg=g:Filter(Card.IsType,nil,TYPE_TRAP+TYPE_SPELL)
if tg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=tg:Select(tp,1,1,nil)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
end
Duel.ShuffleHand(1-tp)
end end
end end
--山田组首领 幽幽子
local s,id,o=GetID()
function s.initial_effect(c)
--return and spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCondition(c88881047.spcon)
e1:SetTarget(c88881047.sptg)
e1:SetOperation(c88881047.spop)
c:RegisterEffect(e1)
--negate
local e3=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_NEGATE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,id)
e3:SetCondition(c88881047.negcon)
e3:SetCost(c88881047.negcost)
e3:SetTarget(c88881047.negtg)
e3:SetOperation(c88881047.negop)
c:RegisterEffect(e3)
--battle indes
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e0:SetRange(LOCATION_MZONE)
e0:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e0:SetValue(1)
c:RegisterEffect(e0)
end
function c88881047.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c88881047.spfilter(c,tp)
return c:IsCode(88800033) and c:IsFaceup() and c:IsAbleToHand()
and Duel.GetMZoneCount(tp,c)>0
end
function c88881047.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c88881047.spfilter(chkc,tp) end
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c88881047.spfilter,tp,LOCATION_MZONE,0,1,nil,tp)
and Duel.GetFlagEffect(tp,88881047)==0 end
Duel.RegisterFlagEffect(tp,88881047,RESET_CHAIN,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c88881047.spfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c88881047.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToChain() and Duel.SendtoHand(tc,nil,REASON_EFFECT)>0
and tc:IsLocation(LOCATION_HAND) and c:IsRelateToChain() then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c88881047.negcon(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end
function c88881047.negfilter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToDeckAsCost()
end
function c88881047.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88881047.negfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c88881047.negfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SendtoDeck(g,nil,1,REASON_COST)
end
function c88881047.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c88881047.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
end
\ No newline at end of file
--山田组管家 渡边
local s,id,o=GetID()
function s.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,s.mfilter,s.xyzcheck,2,99)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e3:SetCountLimit(1,id)
e3:SetCost(s.spcost)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
function s.mfilter(c,xyzc)
return c:IsXyzType(TYPE_MONSTER) and c:IsXyzLevel(xyzc,4)
end
function s.xyzcheck(g)
return g:IsExists(Card.IsSetCard,1,nil,0xc02)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_COST) and re:IsActivated() and re:IsActiveType(TYPE_XYZ)
and c:IsPreviousLocation(LOCATION_OVERLAY)
end
function s.thfilter(c)
return c:IsSetCard(0xc02) or c:IsCode(88800029) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.xyzfilter(c,e,tp,mc)
return c:IsRank(8) and c:IsRace(RACE_WARRIOR) and c:IsType(TYPE_XYZ)
and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(s.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.xfilter(c)
return c:IsSetCard(0xc02) and c:IsCanOverlay()
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.xyzfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local tc=g:GetFirst()
if tc then
local mg=c:GetOverlayGroup()
if mg:GetCount()>0 then
Duel.Overlay(tc,mg)
end
tc:SetMaterial(Group.FromCards(c))
Duel.Overlay(tc,Group.FromCards(c))
if Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)~=0 then
if Duel.IsExistingMatchingCard(s.xfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,s.xfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1, 1,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.Overlay(tc,g)
end
end
tc:CompleteProcedure()
end
end
end
end
\ No newline at end of file
--山田组首领 山田秀·天都教父
function c88881049.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,c88881049.mfilter,nil,2,2)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
--material
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetHintTiming(0,TIMING_END_PHASE+TIMING_EQUIP)
e3:SetCountLimit(1)
e3:SetCost(c88881049.cost)
e3:SetCondition(c88881049.rmcon)
e3:SetTarget(c88881049.target)
e3:SetOperation(c88881049.operation)
c:RegisterEffect(e3)
--atkdown
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,LOCATION_MZONE)
e4:SetValue(c88881049.atkval)
c:RegisterEffect(e4)
--atkup
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetCode(EFFECT_UPDATE_ATTACK)
e6:SetRange(LOCATION_MZONE)
e6:SetValue(c88881049.val)
c:RegisterEffect(e6)
end
function c88881049.mfilter(c)
return c:IsSetCard(0xc02) and c:IsRank(4)
end
function c88881049.atkval(e,c)
return Duel.GetMatchingGroupCount(Card.IsSetCard,e:GetHandler():GetControler(),LOCATION_REMOVED+LOCATION_GRAVE,0,nil,0xc02)*-300
end
function c88881049.val(e,c)
return Duel.GetMatchingGroupCount(Card.IsSetCard,c:GetControler(),LOCATION_REMOVED+LOCATION_GRAVE,0,nil,0xc02)*300
end
function c88881049.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c88881049.filter(c)
return c:IsCanOverlay()
end
function c88881049.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(88881049)==0
end
function c88881049.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,0,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP+TYPE_MONSTER) end
end
function c88881049.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local g=Duel.SelectMatchingCard(tp,Card.IsType,tp,0,LOCATION_ONFIELD,1,1,nil,TYPE_SPELL+TYPE_TRAP+TYPE_MONSTER)
if g:GetCount()>0 then
Duel.Overlay(c,g)
c:RegisterFlagEffect(88881049,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
end
end
end
\ No newline at end of file
--太平道祖 南华老仙
local s,id,o=GetID()
function s.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,6,2,nil,nil,99)
--splimit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e0:SetRange(LOCATION_MZONE)
e0:SetTargetRange(1,0)
e0:SetTarget(s.splimit)
c:RegisterEffect(e0)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,1)
e1:SetCondition(s.spcon1)
e1:SetTarget(s.splimit)
c:RegisterEffect(e1)
--activate limit
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_DRAW_PHASE+TIMING_END_PHASE)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(s.cost)
e2:SetTarget(s.damtg)
e2:SetOperation(s.damop)
c:RegisterEffect(e2)
--activate limit
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_DRAW_PHASE+TIMING_END_PHASE)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(s.cost1)
e3:SetTarget(s.target1)
e3:SetOperation(s.activate1)
c:RegisterEffect(e3)
end
function s.cxfilter(c)
return c:IsFaceup() and c:IsSetCard(0xc00) and not c:IsCode(id)
end
function s.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cxfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.splimit(e,c,sump,sumtype,sumpos,targetp)
return not c:IsSetCard(0xc00) and c:IsLocation(LOCATION_EXTRA)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(360)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,360)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function s.filter(c,e,tp)
return c:IsSetCard(0xc00) and not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,c:GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.activate1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
...@@ -6,8 +6,9 @@ function s.initial_effect(c) ...@@ -6,8 +6,9 @@ function s.initial_effect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SEARCH+CATEGORY_TOHAND) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(s.cost) e1:SetCost(s.cost)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
...@@ -75,7 +76,7 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -75,7 +76,7 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
......
--乱世巨星
local s,id,o=GetID()
function s.initial_effect(c)
--control
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_CONTROL+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--change name
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_ADD_CODE)
e2:SetRange(LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_ONFIELD)
e2:SetValue(88800029)
c:RegisterEffect(e2)
end
function s.thfilter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR) and c:IsAttribute(ATTRIBUTE_DARK)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g1=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g2=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g2,1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local _,hg=Duel.GetOperationInfo(0,CATEGORY_TOHAND)
local hc=hg:GetFirst()
local chk=hc:IsSetCard(0xc02)
if hc:IsControler(tp) and hc:IsRelateToEffect(e)
and Duel.SendtoHand(hc,nil,REASON_EFFECT)>0 and hc:IsLocation(LOCATION_HAND) then
local _,tg=Duel.GetOperationInfo(0,CATEGORY_CONTROL)
local tc=tg:GetFirst()
if tc:IsControler(1-tp) and tc:IsRelateToEffect(e)
and Duel.GetControl(tc,tp)>0 and not chk then
local fid=c:GetFieldID()
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabelObject(tc)
e1:SetLabel(fid)
e1:SetCondition(s.thcon)
e1:SetOperation(s.thop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(id)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetLabelObject(),nil,REASON_EFFECT)
end
local m=88881943
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c,true)
--splimit
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DRAW+CATEGORY_REMOVE+CATEGORY_HANDES)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_PZONE)
e4:SetCountLimit(1,m)
e4:SetTarget(cm.sptg)
e4:SetOperation(cm.spop)
c:RegisterEffect(e4)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_PZONE)
e1:SetCost(cm.spcon)
e1:SetTarget(cm.ssptg)
e1:SetOperation(cm.sspop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,m+1)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--destroy
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_DESTROY)
e0:SetType(EFFECT_TYPE_IGNITION)
e0:SetProperty(EFFECT_FLAG_CARD_TARGET)
e0:SetRange(LOCATION_MZONE)
e0:SetCountLimit(1)
e0:SetTarget(cm.destg)
e0:SetOperation(cm.desop)
c:RegisterEffect(e0)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanRemove(tp) and Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
Duel.ShuffleHand(p)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(p,Card.IsType,p,LOCATION_HAND,0,1,1,nil,TYPE_PENDULUM)
local tg=g:GetFirst()
if tg then
if Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)==0 then
Duel.ConfirmCards(1-p,tg)
Duel.ShuffleHand(p)
end
else
local sg=Duel.GetFieldGroup(p,LOCATION_HAND,0)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
function cm.cfilter1(c,tp)
return c:IsType(TYPE_PENDULUM) and c:IsSummonPlayer(tp)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter1,1,nil,tp)
end
function cm.ssptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.sspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.thfilter(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
and (c:IsType(TYPE_MONSTER) and c:IsType(TYPE_PENDULUM)) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and cm.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,cm.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
\ No newline at end of file
--远古造物 莱尼 --远古造物 顶囊
dofile("expansions/script/c9910700.lua") dofile("expansions/script/c9910700.lua")
function c9910710.initial_effect(c) function c9910710.initial_effect(c)
--special summon --special summon
...@@ -37,7 +37,7 @@ function c9910710.thcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -37,7 +37,7 @@ function c9910710.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(e:GetHandler(),REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end end
function c9910710.thfilter(c) function c9910710.thfilter(c)
return c:IsSetCard(0xc950) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand() return c:IsSetCard(0xc950) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end end
function c9910710.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function c9910710.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9910710.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c9910710.thfilter,tp,LOCATION_DECK,0,1,nil) end
......
--远古造物 丽蛉 --远古造物 梅森铰链虫
dofile("expansions/script/c9910700.lua") dofile("expansions/script/c9910700.lua")
function c9910724.initial_effect(c) function c9910724.initial_effect(c)
--special summon --special summon
...@@ -49,9 +49,10 @@ function c9910724.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,9 +49,10 @@ function c9910724.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c9910724.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c9910724.cfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
if not tc then return end if not tc then return end
Duel.BreakEffect()
if tc:IsAbleToHand() and (not tc:IsAbleToGrave() or Duel.SelectOption(tp,1104,1191)==0) then if tc:IsAbleToHand() and (not tc:IsAbleToGrave() or Duel.SelectOption(tp,1104,1191)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
else else
Duel.SendtoGrave(tc,REASON_EFFECT) Duel.SendtoGrave(tc,REASON_EFFECT)
end end
end end
......
...@@ -24,7 +24,7 @@ function c9910741.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -24,7 +24,7 @@ function c9910741.spcon(e,tp,eg,ep,ev,re,r,rp)
and (c:IsLocation(LOCATION_HAND) or (not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainDisablable(ev))) and (c:IsLocation(LOCATION_HAND) or (not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainDisablable(ev)))
end end
function c9910741.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c9910741.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1) e:SetLabel(100)
return true return true
end end
function c9910741.cfilter(c,b1,b2,tp,rc) function c9910741.cfilter(c,b1,b2,tp,rc)
...@@ -40,7 +40,7 @@ function c9910741.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -40,7 +40,7 @@ function c9910741.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local b2=c:IsLocation(LOCATION_ONFIELD) local b2=c:IsLocation(LOCATION_ONFIELD)
local b3=Duel.IsExistingMatchingCard(c9910741.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,g,b1,b2,tp,rc) local b3=Duel.IsExistingMatchingCard(c9910741.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,g,b1,b2,tp,rc)
if chk==0 then if chk==0 then
if e:GetLabel()~=0 then if e:GetLabel()==100 then
e:SetLabel(0) e:SetLabel(0)
return b0 and b3 return b0 and b3
else else
...@@ -52,27 +52,16 @@ function c9910741.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -52,27 +52,16 @@ function c9910741.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,c9910741.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,g,b1,b2,tp,rc) local rg=Duel.SelectMatchingCard(tp,c9910741.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,g,b1,b2,tp,rc)
rg:AddCard(rc) rg:AddCard(rc)
local cg=rg:Filter(Card.IsFacedown,nil)
Duel.ConfirmCards(1-tp,cg)
Duel.Remove(rg,POS_FACEUP,REASON_COST) Duel.Remove(rg,POS_FACEUP,REASON_COST)
end end
local off=1 if c:IsLocation(LOCATION_HAND) then
local ops={} e:SetLabel(1)
local opval={}
if b1 then
ops[off]=aux.Stringid(9910741,0)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(9910741,1)
opval[off-1]=2
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
e:SetLabel(opval[op])
if opval[op]==1 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON) e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
else elseif c:IsLocation(LOCATION_MZONE) then
e:SetLabel(2)
e:SetCategory(CATEGORY_DISABLE) e:SetCategory(CATEGORY_DISABLE)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end end
...@@ -83,7 +72,7 @@ function c9910741.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -83,7 +72,7 @@ function c9910741.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummon(e:GetHandler(),0,tp,tp,true,false,POS_FACEUP)
end end
else elseif sel==2 then
Duel.NegateEffect(ev) Duel.NegateEffect(ev)
end end
end end
...@@ -5,7 +5,7 @@ function c9910743.initial_effect(c) ...@@ -5,7 +5,7 @@ function c9910743.initial_effect(c)
QutryYgzw.AddTgFlag(c) QutryYgzw.AddTgFlag(c)
--special summon --special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE) e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,9910743) e1:SetCountLimit(1,9910743)
...@@ -20,20 +20,19 @@ function c9910743.initial_effect(c) ...@@ -20,20 +20,19 @@ function c9910743.initial_effect(c)
e2:SetCode(9910743) e2:SetCode(9910743)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0) e2:SetTargetRange(1,0)
e2:SetCondition(c9910743.condition)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c9910743.cfilter(c,ft) function c9910743.cfilter(c,tp)
return c:IsSetCard(0xc950) and bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0 and c:IsAbleToGraveAsCost() return c:IsSetCard(0xc950) and bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0 and c:IsAbleToGraveAsCost()
and (ft>0 or c:GetSequence()<5) and Duel.GetMZoneCount(tp,c)>0
end end
function c9910743.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c9910743.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local c=e:GetHandler()
local loc=LOCATION_HAND+LOCATION_ONFIELD if chk==0 then return Duel.IsExistingMatchingCard(c9910743.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,c,tp) end
if ft==0 then loc=LOCATION_MZONE end
if chk==0 then return ft>-1 and Duel.IsExistingMatchingCard(c9910743.cfilter,tp,loc,0,1,e:GetHandler(),ft) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c9910743.cfilter,tp,loc,0,1,1,e:GetHandler(),ft) local g=Duel.SelectMatchingCard(tp,c9910743.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,c,tp)
local cg=g:Filter(Card.IsFacedown,nil)
Duel.ConfirmCards(1-tp,cg)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
function c9910743.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c9910743.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -42,34 +41,13 @@ function c9910743.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -42,34 +41,13 @@ function c9910743.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c9910743.spop(e,tp,eg,ep,ev,re,r,rp) function c9910743.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 and c:IsSummonLocation(LOCATION_GRAVE) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetCountLimit(1) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCondition(c9910743.thcon) e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetOperation(c9910743.thop) e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_PHASE+PHASE_END) c:RegisterEffect(e1,true)
Duel.RegisterEffect(e1,tp)
end
end
function c9910743.thfilter(c)
return c:IsSetCard(0xc950) and not c:IsCode(9910743) and c:IsAbleToHand()
end
function c9910743.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c9910743.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil)
end
function c9910743.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(9910743,0)) then
Duel.Hint(HINT_CARD,0,9910743)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c9910743.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end end
end end
function c9910743.condition(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL) and e:GetHandler():IsSummonLocation(LOCATION_HAND)
end
...@@ -32,10 +32,10 @@ function c9910745.initial_effect(c) ...@@ -32,10 +32,10 @@ function c9910745.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c9910745.cfilter0(c) function c9910745.cfilter0(c)
return c:IsFaceup() and c:IsSetCard(0xc950) and not c:IsAttribute(ATTRIBUTE_DARK) return c:IsFaceup() and c:IsSetCard(0xc950)
end end
function c9910745.spcon(e,tp,eg,ep,ev,re,r,rp) function c9910745.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c9910745.cfilter0,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c9910745.cfilter0,tp,LOCATION_ONFIELD,0,1,nil)
end end
function c9910745.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c9910745.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
...@@ -55,6 +55,8 @@ function c9910745.thcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -55,6 +55,8 @@ function c9910745.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9910745.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c9910745.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c9910745.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c9910745.cfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
local cg=g:Filter(Card.IsFacedown,nil)
Duel.ConfirmCards(1-tp,cg)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
function c9910745.thfilter(c) function c9910745.thfilter(c)
...@@ -76,7 +78,7 @@ function c9910745.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -76,7 +78,7 @@ function c9910745.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9910745,0)) e1:SetDescription(aux.Stringid(9910745,0))
e1:SetCategory(CATEGORY_TODECK) e1:SetCategory(CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_GRAVE) e1:SetRange(LOCATION_GRAVE)
...@@ -87,21 +89,18 @@ function c9910745.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -87,21 +89,18 @@ function c9910745.regop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c9910745.setfilter(c) function c9910745.setfilter(c)
return c:IsSetCard(0xc950) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() return c:IsSetCard(0xc950) and c:IsType(TYPE_TRAP) and c:IsSSetable()
end end
function c9910745.settg(e,tp,eg,ep,ev,re,r,rp,chk) function c9910745.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9910745.setfilter,tp,LOCATION_DECK,0,1,nil) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil,REASON_EFFECT)
and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) end and Duel.IsExistingMatchingCard(c9910745.setfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end end
function c9910745.setop(e,tp,eg,ep,ev,re,r,rp) function c9910745.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT+REASON_DISCARD,nil,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c9910745.setfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c9910745.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 and Duel.SSet(tp,g)>0 then if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.SSet(tp,g)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
if #sg>0 then
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end end
end end
--风暴突击队 轰鸣长矛手
function c9911430.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
--extra attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EXTRA_ATTACK)
e3:SetValue(1)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_BATTLED)
e4:SetCondition(c9911430.spcon)
e4:SetTarget(c9911430.sptg)
e4:SetOperation(c9911430.spop)
c:RegisterEffect(e4)
end
function c9911430.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetAttacker()==c and c:GetAttackAnnouncedCount()>=2
end
function c9911430.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c9911430.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c9911430.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c9911430.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c9911430.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0
and c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=math.ceil(tc:GetAttack()/2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
e1:SetValue(atk)
c:RegisterEffect(e1)
if atk>0 and not tc:IsHasEffect(EFFECT_REVERSE_UPDATE) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EXTRA_ATTACK)
e2:SetValue(2)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end
end
end
...@@ -1303,6 +1303,7 @@ ...@@ -1303,6 +1303,7 @@
!setname 0xaf1b 影潜者 !setname 0xaf1b 影潜者
!setname 0xcf1b 王冠圣域 !setname 0xcf1b 王冠圣域
!setname 0x3a7b 璇姬 !setname 0x3a7b 璇姬
!counter 0xa7f 好感指示物
#TYGOC Submissions #TYGOC Submissions
......
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