Commit dc0dc6ca authored by mercury233's avatar mercury233

rm

parent 5b8cac94
#created by ...
#main
100410001
100410002
100410003
100410004
100410005
100410006
100410009
100410010
100410011
100410014
100410015
100410016
100410023
100410024
100410025
100410026
100410027
100410028
100410029
100410030
100410031
100410038
100410039
#extra
100410007
100410008
100410017
100410018
100410019
100410020
100410021
100410022
100410032
100410033
100410034
100410035
100410036
100410037
!side
#The first line is used for comment #The first line is used for comment
!counter 0x4a 运动员指示物 !counter 0x4a 运动员指示物
!setname 0x11e 危险! Danger!
!setname 0x11f 奈芙提斯 ネフティス
!setname 0x120 调皮宝贝 プランキッズ
!setname 0x121 魔妖
!setname 0x228 女武神 !setname 0x228 女武神
--超装甲兵器ロボ ブラックアイアンG
--Super Armored Robot Weapon - Black Iron "C"
--Script by dest
function c100204007.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100204007,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100204007)
e1:SetTarget(c100204007.sptg)
e1:SetOperation(c100204007.spop)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100204007,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100204007+100)
e2:SetCost(c100204007.descost)
e2:SetTarget(c100204007.destg)
e2:SetOperation(c100204007.desop)
c:RegisterEffect(e2)
end
function c100204007.eqfilter(c,tp)
return c:IsRace(RACE_INSECT) and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,2,c,c:GetCode()) and c:CheckUniqueOnField(tp)
end
function c100204007.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100204007.eqfilter(chkc,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c100204007.eqfilter,tp,LOCATION_GRAVE,0,1,nil,tp)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
local ct=math.min((Duel.GetLocationCount(tp,LOCATION_SZONE)),3)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c100204007.eqfilter,tp,LOCATION_GRAVE,0,1,ct,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100204007.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if ft<g:GetCount() then return end
Duel.BreakEffect()
for tc in aux.Next(g) do
Duel.Equip(tp,tc,c,false)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c100204007.eqlimit)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(100204007,RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
function c100204007.eqlimit(e,c)
return e:GetOwner()==c
end
function c100204007.tgfilter(c,tp)
return c:GetFlagEffect(100204007)~=0 and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c100204007.desfilter,tp,0,LOCATION_MZONE,1,nil,c:GetTextAttack())
end
function c100204007.desfilter(c,atk)
return c:IsFaceup() and c:IsAttackAbove(atk)
end
function c100204007.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetEquipGroup():IsExists(c100204007.tgfilter,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=e:GetHandler():GetEquipGroup():FilterSelect(tp,c100204007.tgfilter,1,1,nil,tp)
e:SetLabel(g:GetFirst():GetTextAttack())
Duel.SendtoGrave(g,REASON_COST)
end
function c100204007.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c100204007.desfilter,tp,0,LOCATION_MZONE,nil,e:GetLabel())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c100204007.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100204007.desfilter,tp,0,LOCATION_MZONE,nil,e:GetLabel())
Duel.Destroy(g,REASON_EFFECT)
end
--ネフティスの悟り手
--Enlightened of Nephthys
function c100410001.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410001,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,100410001)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c100410001.sptg)
e1:SetOperation(c100410001.spop)
c:RegisterEffect(e1)
--reg special summon (self)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetOperation(c100410001.spr)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100410001,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,100410101)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetCondition(c100410001.spcon2)
e3:SetTarget(c100410001.sptg2)
e3:SetOperation(c100410001.spop2)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c100410001.filter(c,e,tp)
return c:IsSetCard(0x11f) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100410001.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100410001.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c100410001.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100410001.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100410001.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,1,nil)
if #g==0 then return end
local tc=Duel.GetFirstTarget()
if Duel.Destroy(g,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e)
and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
end
function c100410001.spr(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if bit.band(r,0x41)~=0x41 then return end
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then
e:SetLabel(Duel.GetTurnCount())
c:RegisterFlagEffect(100410001,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,2)
else
e:SetLabel(0)
c:RegisterFlagEffect(100410001,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
end
function c100410001.spcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and tp==Duel.GetTurnPlayer() and c:GetFlagEffect(100410001)>0
end
function c100410001.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
c:ResetFlagEffect(100410001)
end
function c100410001.spop2(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
--ネフティスの祈り手
--Prayer of Nephthys
function c100410002.initial_effect(c)
--search monster
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410002,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,100410002)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c100410002.thtg)
e1:SetOperation(c100410002.thop)
c:RegisterEffect(e1)
--reg search s/t
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetOperation(c100410002.spr)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100410002,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,100410102)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetCondition(c100410002.thcon2)
e3:SetTarget(c100410002.thtg2)
e3:SetOperation(c100410002.thop2)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c100410002.filter(c,e,tp)
return c:IsSetCard(0x11f) and c:IsType(TYPE_MONSTER) and not c:IsCode(100410002) and c:IsAbleToHand()
end
function c100410002.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100410002.filter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100410002.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,1,nil)
if dg:GetCount()==0 then return end
if Duel.Destroy(dg,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100410002.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
end
function c100410002.spr(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if bit.band(r,0x41)~=0x41 then return end
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then
e:SetLabel(Duel.GetTurnCount())
c:RegisterFlagEffect(100410002,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,2)
else
e:SetLabel(0)
c:RegisterFlagEffect(100410002,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
end
function c100410002.thfilter(c,e,tp)
return c:IsSetCard(0x11f) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c100410002.thcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and tp==Duel.GetTurnPlayer() and c:GetFlagEffect(100410002)>0
end
function c100410002.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c100410002.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
c:ResetFlagEffect(100410002)
end
function c100410002.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100410002.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
--ネフティスの語り手
--Speaker of Nephthys
function c100410003.initial_effect(c)
--to hand (on field eff)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410003,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,100410003)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c100410003.thtg)
e1:SetOperation(c100410003.thop)
c:RegisterEffect(e1)
--reg to hand (GY eff)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetOperation(c100410003.spr)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100410003,1))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,100410103)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetCondition(c100410003.thcon2)
e3:SetTarget(c100410003.thtg2)
e3:SetOperation(c100410003.thop2)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c100410003.filter(c)
return c:IsSetCard(0x11f) and c:IsAbleToHand() and not c:IsCode(100410003)
end
function c100410003.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100410003.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100410003.filter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c100410003.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c100410003.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()==0 then return end
local tc=Duel.GetFirstTarget()
if Duel.Destroy(g,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c100410003.spr(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if bit.band(r,0x41)~=0x41 then return end
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then
e:SetLabel(Duel.GetTurnCount())
c:RegisterFlagEffect(100410003,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,2)
else
e:SetLabel(0)
c:RegisterFlagEffect(100410003,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
end
function c100410003.thcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and tp==Duel.GetTurnPlayer() and c:GetFlagEffect(100410003)>0
end
function c100410003.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c100410003.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
c:ResetFlagEffect(100410003)
end
function c100410003.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100410003.filter),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
--ネフティスの護り手
--Protector of Nephthys
function c100410004.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410004,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,100410004)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c100410004.sptg)
e1:SetOperation(c100410004.spop)
c:RegisterEffect(e1)
--reg destroy (deck)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetOperation(c100410004.spr)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100410004,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,100410104)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetCondition(c100410004.descon)
e3:SetTarget(c100410004.destg)
e3:SetOperation(c100410004.desop)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c100410004.spfilter(c,e,tp)
return c:IsSetCard(0x11f) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(100410004)
end
function c100410004.filter(c,e,tp)
return Duel.IsExistingMatchingCard(c100410004.spfilter,tp,LOCATION_HAND,0,1,c,e,tp)
end
function c100410004.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100410004.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100410004.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c100410004.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if #g==0 then return end
if Duel.Destroy(g,REASON_EFFECT)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,c100410004.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g2:GetCount()>0 then
Duel.SpecialSummon(g2,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c100410004.spr(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if bit.band(r,0x41)~=0x41 then return end
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then
e:SetLabel(Duel.GetTurnCount())
c:RegisterFlagEffect(100410004,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,2)
else
e:SetLabel(0)
c:RegisterFlagEffect(100410004,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
end
function c100410004.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and tp==Duel.GetTurnPlayer() and c:GetFlagEffect(100410004)>0
end
function c100410004.desfilter(c)
return c:IsSetCard(0x11f) and c:IsType(TYPE_MONSTER) and not c:IsCode(100410004)
end
function c100410004.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c100410004.desfilter,tp,LOCATION_DECK,0,1,nil) end
local g=Duel.GetMatchingGroup(c100410004.desfilter,tp,LOCATION_DECK,0,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
c:ResetFlagEffect(100410004)
end
function c100410004.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c100410004.desfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
--ネフティスの祀り手
--Avatar of Nephthys
--Scripted by Eerie Code
function c100410005.initial_effect(c)
c:EnableReviveLimit()
--spsummon (deck)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410005,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100410005)
e1:SetCondition(c100410005.spcon1)
e1:SetTarget(c100410005.sptg1)
e1:SetOperation(c100410005.spop1)
c:RegisterEffect(e1)
--spsummon (hand)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100410005,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100410005+100)
e2:SetTarget(c100410005.sptg2)
e2:SetOperation(c100410005.spop2)
c:RegisterEffect(e2)
end
function c100410005.spcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL)
end
function c100410005.spfilter(c,e,tp)
return c:IsSetCard(0x11f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100410005.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100410005.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100410005.spop1(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_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetOperation(c100410005.desop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100410005.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100410005.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
function c100410005.sptg2(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)
and Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_HAND,0,1,nil,0x11f) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c100410005.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_HAND,0,1,1,nil,0x11f)
if #g>0 and Duel.Destroy(g,REASON_EFFECT)>0
and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--ネフティスの蒼凰神
--Sacred Blue Phoenix of Nephthys
--Scripted by Eerie Code
function c100410006.initial_effect(c)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100410006)
e1:SetTarget(c100410006.destg)
e1:SetOperation(c100410006.desop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetOperation(c100410006.spr)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100410006,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_GRAVE)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetCountLimit(1,100410006+100)
e3:SetCondition(c100410006.spcon)
e3:SetTarget(c100410006.sptg)
e3:SetOperation(c100410006.spop)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c100410006.desfilter(c)
return c:IsSetCard(0x11f) and (c:IsFaceup() or not c:IsOnField())
end
function c100410006.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100410006.desfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,2,0,0)
end
function c100410006.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100410006.desfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
local og=Duel.GetFieldGroup(tp,0,LOCATION_MZONE)
if #g*#og==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,#og,nil)
local oc=Duel.Destroy(sg,REASON_EFFECT)
if oc==0 then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg2=og:Select(tp,oc,oc,nil)
Duel.Destroy(sg2,REASON_EFFECT)
end
function c100410006.spr(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsReason(REASON_DESTROY)) then return end
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then
e:SetLabel(Duel.GetTurnCount())
c:RegisterFlagEffect(100410006,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,2)
else
e:SetLabel(0)
c:RegisterFlagEffect(100410006,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
end
function c100410006.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and tp==Duel.GetTurnPlayer() and c:GetFlagEffect(100410006)>0
end
function c100410006.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
c:ResetFlagEffect(100410006)
end
function c100410006.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--守護神-ネフティス
--Sacred Guardian - Nephthys
--Scripted by Eerie Code
function c100410007.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x11f),2,2)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410007,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,100410007)
e1:SetCondition(c100410007.condition)
e1:SetTarget(c100410007.target)
c:RegisterEffect(e1)
end
function c100410007.condition(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100410007.thfilter1(c)
return c:IsLevel(8) and c:IsRace(RACE_WINDBEAST) and c:IsAbleToHand()
end
function c100410007.thfilter2(c)
return c:IsType(TYPE_SPELL) and c:IsType(TYPE_RITUAL) and c:IsAbleToHand()
end
function c100410007.desfilter(c,e,tp,g)
return c:IsFaceup() and c:IsSetCard(0x11f) and g:IsContains(c) and Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c100410007.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,c)
end
function c100410007.spfilter(c,e,tp,dc)
return c:IsSetCard(0x11f) and c:GetOriginalCode()~=dc:GetOriginalCode() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100410007.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c100410007.thfilter1,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c100410007.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp,e:GetHandler():GetLinkedGroup())
if chk==0 then return b1 or b2 end
local op=-1
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(100410007,1),aux.Stringid(100410007,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(100410007,1))
else
op=Duel.SelectOption(tp,aux.Stringid(100410007,2))+1
end
if op==0 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e:SetOperation(c100410007.thop)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
elseif op==1 then
e:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e:SetOperation(c100410007.desop)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
else
e:SetCategory(0)
e:SetOperation(nil)
end
end
function c100410007.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100410007.thfilter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
local g2=Duel.GetMatchingGroup(aux.NecroValleyFilter(c100410007.thfilter2),tp,LOCATION_GRAVE,0,nil)
if g2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(100410007,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg2=g2:Select(tp,1,1,nil)
Duel.SendtoHand(sg2,nil,REASON_EFFECT)
end
end
end
function c100410007.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lg=e:GetHandler():GetLinkedGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dc=Duel.SelectMatchingCard(tp,c100410007.desfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp,lg):GetFirst()
if dc and Duel.Destroy(dc,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100410007.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp,dc):GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
end
end
--焔凰神-ネフティス
--Nephthys the Blazing Sacred Phoenix
--Script by nekrozar
function c100410008.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,99,c100410008.lcheck)
c:EnableReviveLimit()
--effect gain
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(c100410008.regcon)
e1:SetOperation(c100410008.regop)
c:RegisterEffect(e1)
--cannot select battle target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCondition(c100410008.atcon)
e2:SetValue(c100410008.atlimit)
c:RegisterEffect(e2)
end
function c100410008.lcheck(g,lc)
return g:IsExists(Card.IsLinkType,1,nil,TYPE_RITUAL)
end
function c100410008.regcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100410008.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetMaterial():FilterCount(Card.IsLinkType,nil,TYPE_RITUAL)
if ct>=1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(100410008,0))
end
if ct>=2 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(1200)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetValue(1)
c:RegisterEffect(e3)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(100410008,1))
end
if ct==3 then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(1200)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e5:SetRange(LOCATION_MZONE)
e5:SetValue(1)
c:RegisterEffect(e5)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(100410008,2))
end
end
function c100410008.atcon(e)
return e:GetHandler():GetSequence()>4
end
function c100410008.atlimit(e,c)
return c:IsFaceup() and c:IsSetCard(0x11f) and c:GetSequence()<5
end
--ネフティスの輪廻
--Rebirth of Nephthys
function c100410009.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c100410009.target)
e1:SetOperation(c100410009.activate)
c:RegisterEffect(e1)
end
c100410009.fit_monster={100410005,100410006}
function c100410009.filter(c,e,tp,m,ft)
if not c:IsSetCard(0x11f) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if ft>0 then
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
else
return mg:IsExists(c100410009.filterF,1,nil,tp,mg,c)
end
end
function c100410009.filterF(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end
function c100410009.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(c100410009.filter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c100410009.mfilter(c)
return c:IsCode(100410005) or c:IsCode(100410006)
end
function c100410009.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c100410009.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft)
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
local mat=nil
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,c100410009.filterF,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
mat:Merge(mat2)
end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
if mat:IsExists(c100410009.mfilter,1,nil) and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(100410009,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,1,e:GetHandler())
Duel.Destroy(sg,REASON_EFFECT)
end
end
end
--ネフティスの希望
--Hope of Nephthys
function c100410010.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100410010+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100410010.target)
e1:SetOperation(c100410010.activate)
c:RegisterEffect(e1)
end
function c100410010.filter(c)
return c:IsFaceup() and c:IsSetCard(0x11f)
end
function c100410010.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c100410010.filter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
and Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c100410010.filter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0)
end
function c100410010.activate(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:GetCount()>0 then
Duel.Destroy(tg,REASON_EFFECT)
end
end
--ネフティスの覚醒
--Awakening of Nephthys
function c100410011.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(c100410011.condition)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x11f))
e2:SetValue(300)
c:RegisterEffect(e2)
--spaw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100410011,0))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,100410011)
e3:SetCondition(c100410011.spcon)
e3:SetTarget(c100410011.sptg)
e3:SetOperation(c100410011.spop)
c:RegisterEffect(e3)
end
function c100410011.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c100410011.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_SZONE) and c:IsPreviousPosition(POS_FACEUP)
and c:IsReason(REASON_DESTROY) and c:IsReason(REASON_EFFECT)
end
function c100410011.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100410011.spfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE)
end
function c100410011.spfilter(c,e,tp)
return c:IsSetCard(0x11f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100410011.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(c100410011.spfilter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,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
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(100410011,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c100410011.descon)
e1:SetOperation(c100410011.desop)
Duel.RegisterEffect(e1,tp)
end
end
function c100410011.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(100410011)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c100410011.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetLabelObject(),REASON_EFFECT)
end
--プランキッズ・パルス
--Prankids Pulse
function c100410014.initial_effect(c)
--indes
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100410014)
e1:SetCondition(c100410014.tgcon)
e1:SetTarget(c100410014.tgtg)
e1:SetOperation(c100410014.tgop)
c:RegisterEffect(e1)
end
function c100410014.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
return c:IsLocation(LOCATION_GRAVE) and rc:IsSetCard(0x120) and r&REASON_FUSION+REASON_LINK~=0
end
function c100410014.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100410014.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_DECK+LOCATION_HAND)
end
function c100410014.tgfilter(c)
return c:IsSetCard(0x120) and c:IsAbleToGrave() and not c:IsCode(100410014)
end
function c100410014.spfilter(c,e,tp)
return c:IsSetCard(0x120) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and not c:IsCode(100410014)
end
function c100410014.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100410014.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
local g2=Duel.GetMatchingGroup(c100410014.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,g:GetFirst(),e,tp)
if #g>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 and g:GetFirst():IsLocation(LOCATION_GRAVE)
and #g2>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(100410014,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g2:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--プランキッズ・ランプ
--Prankids Ramp
function c100410015.initial_effect(c)
--damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100410015)
e1:SetCondition(c100410015.damcon)
e1:SetTarget(c100410015.damtg)
e1:SetOperation(c100410015.damop)
c:RegisterEffect(e1)
end
function c100410015.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
return c:IsLocation(LOCATION_GRAVE) and rc:IsSetCard(0x120) and r&REASON_FUSION+REASON_LINK~=0
end
function c100410015.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_DECK+LOCATION_HAND)
end
function c100410015.spfilter(c,e,tp)
return c:IsSetCard(0x120) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and not c:IsCode(100410015)
end
function c100410015.damop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c100410015.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil,e,tp)
if Duel.Damage(1-tp,500,REASON_EFFECT)~=0 and #g>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(100410015,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--プランキッズ・ドロップ
--Prankids Drop
function c100410016.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100410016)
e1:SetCondition(c100410016.reccon)
e1:SetTarget(c100410016.rectg)
e1:SetOperation(c100410016.recop)
c:RegisterEffect(e1)
end
function c100410016.reccon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
return c:IsLocation(LOCATION_GRAVE) and rc:IsSetCard(0x120) and r&REASON_FUSION+REASON_LINK~=0
end
function c100410016.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_DECK+LOCATION_HAND)
end
function c100410016.spfilter(c,e,tp)
return c:IsSetCard(0x120) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and not c:IsCode(100410016)
end
function c100410016.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local g=Duel.GetMatchingGroup(c100410016.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil,e,tp)
if Duel.Recover(p,d,REASON_EFFECT)~=0 and #g>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(100410016,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--プランキッズ・ロケット
--Prankids Rocket
--Scripted by Eerie Code
function c100410017.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x120),2,true)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410017,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100410017)
e1:SetCondition(c100410017.atkcon)
e1:SetOperation(c100410017.atkop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100410017,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100410017+100)
e2:SetCost(c100410017.spcost)
e2:SetTarget(c100410017.sptg)
e2:SetOperation(c100410017.spop)
c:RegisterEffect(e2)
end
function c100410017.atkcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c100410017.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local atk=c:GetAttack()
if not c:IsRelateToEffect(e) or atk<1000 then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
if not c:IsHasEffect(EFFECT_REVERSE_UPDATE) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DIRECT_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end
function c100410017.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c100410017.spfilter(c,e,tp)
return c:IsSetCard(0x120) and not c:IsType(TYPE_FUSION)
and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100410017.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(c100410017.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and g:GetClassCount(Card.GetCode)>=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,g1:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=g:Select(tp,1,1,nil)
g1:Merge(g2)
Duel.SetTargetCard(g1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,2,0,0)
end
function c100410017.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g=tg:Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()==0 or ft<=0 or (g:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133)) then return end
if ft<g:GetCount() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=g:Select(tp,ft,ft,nil)
end
local tc=g:GetFirst()
while tc do
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
end
--プランキッズ・ウェザー
--Prankids Weather
--Scripted by Eerie Code
function c100410018.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x120),2,true)
--actlimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,1)
e1:SetValue(c100410018.aclimit)
e1:SetCondition(c100410018.actcon)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100410018,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100410018)
e2:SetCondition(c100410018.spcon)
e2:SetCost(c100410018.spcost)
e2:SetTarget(c100410018.sptg)
e2:SetOperation(c100410018.spop)
c:RegisterEffect(e2)
end
function c100410018.aclimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e)
end
function c100410018.actcon(e)
local a=Duel.GetAttacker()
return a and a:IsControler(e:GetHandlerPlayer()) and a:IsSetCard(0x120)
end
function c100410018.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c100410018.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c100410018.spfilter(c,e,tp)
return c:IsSetCard(0x120) and not c:IsType(TYPE_FUSION)
and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100410018.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(c100410018.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>1 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and g:GetClassCount(Card.GetCode)>=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,g1:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=g:Select(tp,1,1,nil)
g1:Merge(g2)
Duel.SetTargetCard(g1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,2,0,0)
end
function c100410018.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g=tg:Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()==0 or ft<=0 or (g:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133)) then return end
if ft<g:GetCount() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=g:Select(tp,ft,ft,nil)
end
local tc=g:GetFirst()
while tc do
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
end
--プランキッズ・ハウスバトラー
--Prankids House Battle Butler
function c100410019.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCode3(c,100410014,100410015,100410016,true,true)
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.fuslimit)
c:RegisterEffect(e0)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410019,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c100410019.descost)
e1:SetTarget(c100410019.destg)
e1:SetOperation(c100410019.desop)
c:RegisterEffect(e1)
--spsum
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100410019,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,100410019)
e2:SetCondition(c100410019.spcon)
e2:SetTarget(c100410019.sptg)
e2:SetOperation(c100410019.spop)
c:RegisterEffect(e2)
end
function c100410019.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c100410019.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0,nil)
end
function c100410019.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
Duel.Destroy(g,REASON_EFFECT)
end
function c100410019.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:GetPreviousControler()==tp
end
function c100410019.spfilter(c,e,tp)
return not c:IsType(TYPE_FUSION) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100410019.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c100410019.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100410019.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100410019.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100410019.spop(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--プランキッズ・ドゥードゥル
--Prankids Doodle
--Script by dest
function c100410020.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x120),2)
c:EnableReviveLimit()
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410020,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,100410020)
e1:SetCondition(c100410020.thcon)
e1:SetTarget(c100410020.thtg)
e1:SetOperation(c100410020.thop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100410020,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100410020+100)
e2:SetCost(c100410020.thcost)
e2:SetTarget(c100410020.thtg2)
e2:SetOperation(c100410020.thop2)
c:RegisterEffect(e2)
end
function c100410020.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c100410020.thfilter(c)
return c:IsSetCard(0x120) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c100410020.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100410020.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c100410020.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100410020.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 c100410020.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c100410020.thfilter2(c,e,tp)
return c:IsSetCard(0x120) and not c:IsType(TYPE_LINK)
and c:IsCanBeEffectTarget(e) and c:IsAbleToHand()
end
function c100410020.thtg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(c100410020.thfilter2,tp,LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return g:GetClassCount(Card.GetCode)>=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,g1:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g2=g:Select(tp,1,1,nil)
g1:Merge(g2)
Duel.SetTargetCard(g1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g1,2,0,0)
end
function c100410020.thop2(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.SendtoHand(g,nil,REASON_EFFECT)
end
end
--プランキッズ・バウワウ
--Prankids Bowwow
--Script by Kedy
function c100410021.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x120),2,2)
--atk gain
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c100410021.atktg)
e1:SetValue(1000)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100410021,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100410021)
e2:SetCondition(c100410021.thcon)
e2:SetCost(c100410021.thcost)
e2:SetTarget(c100410021.thtg)
e2:SetOperation(c100410021.thop)
c:RegisterEffect(e2)
end
function c100410021.atktg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c) and c:IsSetCard(0x120)
end
function c100410021.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function c100410021.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c100410021.thfilter(c,e)
return c:IsSetCard(0x120) and not c:IsType(TYPE_LINK)
and c:IsCanBeEffectTarget(e) and c:IsAbleToHand()
end
function c100410021.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local g=Duel.GetMatchingGroup(c100410021.thfilter,tp,LOCATION_GRAVE,0,nil,e)
if chk==0 then return g:GetClassCount(Card.GetCode)>=2 end
local sg=Group.CreateGroup()
for i=1,2 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,g1:GetFirst():GetCode())
sg:Merge(g1)
end
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,#sg,0,0)
end
function c100410021.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c100410021.indtg)
e1:SetValue(aux.indoval)
Duel.RegisterEffect(e1,tp)
end
function c100410021.indtg(e,c)
return c:IsSetCard(0x120)
end
--プランキッズ・ロアゴン
--Prankids Roargon
function c100410022.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x120),2)
c:EnableReviveLimit()
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.lnklimit)
c:RegisterEffect(e0)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410022,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c100410022.descost)
e1:SetTarget(c100410022.destg)
e1:SetOperation(c100410022.desop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100410022,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,100410022)
e2:SetCondition(c100410022.thcon)
e2:SetTarget(c100410022.thtg)
e2:SetOperation(c100410022.thop)
c:RegisterEffect(e2)
end
function c100410022.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c100410022.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c100410022.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100410022.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local sg=Duel.GetMatchingGroup(c100410022.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c100410022.desop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c100410022.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
function c100410022.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:GetPreviousControler()==tp
end
function c100410022.thfilter(c)
return not c:IsType(TYPE_LINK) and c:IsAbleToHand()
end
function c100410022.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100410022.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c100410022.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c100410022.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c100410022.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--プランキッズ・ハウス
--Prankids House
--Script by dest
function c100410023.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100410023+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c100410023.activate)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100410023,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetCondition(c100410023.atkcon)
e2:SetTarget(c100410023.atktg)
e2:SetOperation(c100410023.atkop)
c:RegisterEffect(e2)
--atkdown
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100410023,2))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetCondition(c100410023.atkcon2)
e3:SetTarget(c100410023.atktg2)
e3:SetOperation(c100410023.atkop2)
c:RegisterEffect(e3)
end
function c100410023.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x120) and c:IsAbleToHand()
end
function c100410023.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c100410023.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(100410023,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c100410023.cfilter(c,tp,sumt)
return c:IsFaceup() and c:IsSetCard(0x120) and c:IsSummonType(sumt) and c:GetSummonPlayer()==tp
end
function c100410023.atkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100410023.cfilter,1,nil,tp,SUMMON_TYPE_FUSION)
end
function c100410023.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
end
function c100410023.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(500)
tc:RegisterEffect(e1)
end
end
function c100410023.atkcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100410023.cfilter,1,nil,tp,SUMMON_TYPE_LINK)
end
function c100410023.atktg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end
function c100410023.atkop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-500)
tc:RegisterEffect(e1)
end
end
--プランキッズ・プランク
--Prankids Prank
--Scripted by Eerie Code
function c100410024.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--token
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100410024,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,100410024)
e2:SetCost(c100410024.tkcost)
e2:SetTarget(c100410024.tktg)
e2:SetOperation(c100410024.tkop)
c:RegisterEffect(e2)
--shuffle & draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(100410024,1))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,100410024+100)
e3:SetCondition(c100410024.drcon)
e3:SetTarget(c100410024.drtg)
e3:SetOperation(c100410024.drop)
c:RegisterEffect(e3)
end
function c100410024.cfilter(c)
return c:IsSetCard(0x120) and c:IsDiscardable()
end
function c100410024.tkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100410024.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c100410024.cfilter,1,1,REASON_COST+REASON_DISCARD)
end
function c100410024.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,100410024+100,0x120,0x4011,0,0,1,RACE_PYRO,ATTRIBUTE_FIRE,POS_FACEUP) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
end
function c100410024.tkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,100410024+100,0x120,0x4011,0,0,1,RACE_PYRO,ATTRIBUTE_FIRE,POS_FACEUP) then return end
local token=Duel.CreateToken(tp,100410024+100)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
token:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
function c100410024.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c100410024.tdfilter(c)
return c:IsSetCard(0x120) and not c:IsCode(100410024) and c:IsAbleToDeck()
end
function c100410024.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100410024.tdfilter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c100410024.tdfilter,tp,LOCATION_GRAVE,0,3,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c100410024.tdfilter,tp,LOCATION_GRAVE,0,3,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c100410024.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=3 then return end
Duel.SendtoDeck(tg,nil,0,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>0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--プランキッズの大暴走
--Prankids on the Loose
function c100410025.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCondition(c100410025.condition)
e1:SetTarget(c100410025.target)
e1:SetOperation(c100410025.activate)
c:RegisterEffect(e1)
end
function c100410025.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c100410025.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c100410025.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x120) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c100410025.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(c100410025.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,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(c100410025.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100410025.activate(e,tp,eg,ep,ev,re,r,rp)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c100410025.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
end
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c100410025.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c100410025.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
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(c100410025.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,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 mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
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,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function c100410025.splimit(e,c)
return not c:IsSetCard(0x120)
end
--プランキッズの大作戦
--Prankids Super Scheme
--Scripted by Eerie Code
function c100410026.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--link
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCountLimit(1,100410026)
e2:SetCondition(c100410026.lkcon)
e2:SetTarget(c100410026.lktg)
e2:SetOperation(c100410026.lkop)
c:RegisterEffect(e2)
--shuffle
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TODECK+CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,100410026+100)
e3:SetCondition(c100410026.atkcon)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c100410026.atktg)
e3:SetOperation(c100410026.atkop)
c:RegisterEffect(e3)
end
function c100410026.lkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c100410026.matfilter(c)
return c:IsFaceup() and c:IsSetCard(0x120)
end
function c100410026.lkfilter(c)
return c:IsSetCard(0x120) and c:IsType(TYPE_LINK) and c:IsSpecialSummonable(SUMMON_TYPE_LINK)
end
function c100410026.lktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local el={}
local mg=Duel.GetMatchingGroup(c100410026.matfilter,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,mg)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
tc:RegisterEffect(e1)
table.insert(el,e1)
end
local res=Duel.IsExistingMatchingCard(c100410026.lkfilter,tp,LOCATION_EXTRA,0,1,nil)
for _,e in ipairs(el) do
e:Reset()
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c100410026.lkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local el={}
local mg=Duel.GetMatchingGroup(c100410026.matfilter,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,mg)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
tc:RegisterEffect(e1)
table.insert(el,e1)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xg=Duel.SelectMatchingCard(tp,c100410026.lkfilter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=xg:GetFirst()
if tc then
Duel.SpecialSummonRule(tp,tc,SUMMON_TYPE_LINK)
end
for _,e in ipairs(el) do
e:Reset()
end
end
function c100410026.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp)
end
function c100410026.tdfilter(c)
return c:IsSetCard(0x120) and c:IsAbleToDeck()
end
function c100410026.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100410026.tdfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
end
function c100410026.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
local g=Duel.GetMatchingGroup(c100410026.tdfilter,tp,LOCATION_GRAVE,0,nil)
if #g==0 then return end
local ct=math.min(#g,math.floor(tc:GetAttack()/100))
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(tp,1,ct,nil)
if Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)==0 then return end
local ct=Duel.GetOperatedGroup():GetCount()
if tc:IsFaceup() and tc:IsRelateToBattle() and ct>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct*-100)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
--麗の魔妖-妲姫
--Beautiful Mayakashi – Dakki
function c100410027.initial_effect(c)
c:SetUniqueOnField(1,0,100410027)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410027,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c100410027.spcon)
e1:SetCost(c100410027.spcost)
e1:SetTarget(c100410027.sptg)
e1:SetOperation(c100410027.spop)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(100410027,ACTIVITY_SPSUMMON,c100410027.counterfilter)
end
function c100410027.counterfilter(c)
return c:GetSummonLocation()~=LOCATION_EXTRA or c:IsSetCard(0x121)
end
function c100410027.cfilter(c,tp)
return c:IsSetCard(0x121) and c:GetSummonLocation()==LOCATION_EXTRA and c:IsControler(tp)
end
function c100410027.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100410027.cfilter,1,nil,tp)
end
function c100410027.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(100410027,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(c100410027.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100410027.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,POS_FACEUP) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100410027.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100410027.splimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0x121)
end
--毒の魔妖-束脛
--Poison Mayakashi – Tsukahagi
--Scripted by AlphaKretin
function c100410028.initial_effect(c)
c:SetUniqueOnField(1,0,100410028)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410028,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DESTROYED)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c100410028.spcon)
e1:SetCost(c100410028.spcost)
e1:SetTarget(c100410028.sptg)
e1:SetOperation(c100410028.spop)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(100410028,ACTIVITY_SPSUMMON,c100410028.counterfilter)
end
function c100410028.counterfilter(c)
return c:GetSummonLocation()~=LOCATION_EXTRA or c:IsSetCard(0x121)
end
function c100410028.cfilter(c,tp,rp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsSetCard(0x121) and not c:IsCode(100410028)
and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp
and (c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT)))
end
function c100410028.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100410028.cfilter,1,nil,tp,rp)
end
function c100410028.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(100410028,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(c100410028.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c100410028.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,POS_FACEUP) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c100410028.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100410028.splimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0x121)
end
--翼の魔妖-波旬
--Winged Mayakashi - Hajun
--scripted by Naim
function c100410029.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410029,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100410029)
e1:SetTarget(c100410029.sptg)
e1:SetOperation(c100410029.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--spsummon limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(c100410029.sslimit)
c:RegisterEffect(e3)
end
function c100410029.filter(c,e,tp)
return c:IsSetCard(0x121) and not c:IsCode(100410029) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c100410029.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c100410029.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c100410029.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,c100410029.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
function c100410029.sslimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0x121)
end
--轍の魔妖-俥夫
--Rickshaw Mayakashi – Shafu
function c100410030.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410030,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,100410030)
e1:SetTarget(c100410030.sptg)
e1:SetOperation(c100410030.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--spsummon limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(c100410030.sumlimit)
c:RegisterEffect(e3)
end
function c100410030.spfilter(c,e,tp)
return c:IsSetCard(0x121) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and not c:IsCode(100410030)
end
function c100410030.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c100410030.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100410030.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c100410030.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c100410030.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
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:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
function c100410030.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0x121)
end
--骸の魔妖-夜叉
--Skeleton Mayakashi - Yasha
--Scripted by AlphaKretin
function c100410031.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410031,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,100410031)
e1:SetCost(c100410031.spcost)
e1:SetTarget(c100410031.sptg)
e1:SetOperation(c100410031.spop)
c:RegisterEffect(e1)
--spsummon limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(c100410031.sslimit)
c:RegisterEffect(e2)
end
function c100410031.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x121) and c:IsDiscardable()
end
function c100410031.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100410031.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c100410031.cfilter,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
end
function c100410031.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 c100410031.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c100410031.sslimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0x121)
end
--轍の魔妖-朧車
--Rickshaw Mayakashi - Oboroguruma
function c100410032.initial_effect(c)
c:SetUniqueOnField(1,0,100410032)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--battle immune
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410032,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,100410032)
e1:SetCondition(c100410032.condition)
e1:SetOperation(c100410032.operation)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100410032,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100410132)
e2:SetCondition(c100410032.spcon)
e2:SetTarget(c100410032.sptg)
e2:SetOperation(c100410032.spop)
c:RegisterEffect(e2)
end
function c100410032.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_GRAVE
end
function c100410032.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(1)
Duel.RegisterEffect(e1,tp)
end
function c100410032.spfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:GetPreviousTypeOnField()&TYPE_SYNCHRO~=0
and c:GetOriginalLevel()==5 and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c100410032.spcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c100410032.spfilter,1,nil,tp)
end
function c100410032.rmfilter(c)
return c:IsAbleToRemove() and c:IsRace(RACE_ZOMBIE)
end
function c100410032.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)
and Duel.IsExistingMatchingCard(c100410032.rmfilter,tp,LOCATION_GRAVE,0,1,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
end
function c100410032.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100410032.rmfilter),tp,LOCATION_GRAVE,0,1,1,c)
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--毒の魔妖-土蜘蛛
--Poison Mayakashi - Tsuchigumo
function c100410033.initial_effect(c)
c:SetUniqueOnField(1,0,100410033)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--deckdes
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410033,0))
e1:SetCategory(CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,100410033)
e1:SetCondition(c100410033.condition)
e1:SetTarget(c100410033.target)
e1:SetOperation(c100410033.operation)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100410033,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100410133)
e2:SetCondition(c100410033.spcon)
e2:SetTarget(c100410033.sptg)
e2:SetOperation(c100410033.spop)
c:RegisterEffect(e2)
end
function c100410033.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_GRAVE
end
function c100410033.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,3) and Duel.IsPlayerCanDiscardDeck(1-tp,3) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,PLAYER_ALL,3)
end
function c100410033.operation(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetDecktopGroup(tp,3)
local g2=Duel.GetDecktopGroup(1-tp,3)
g1:Merge(g2)
Duel.DisableShuffleCheck()
Duel.SendtoGrave(g1,REASON_EFFECT)
end
function c100410033.spfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:GetPreviousTypeOnField()&TYPE_SYNCHRO~=0
and c:GetOriginalLevel()==7 and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c100410033.spcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c100410033.spfilter,1,nil,tp)
end
function c100410033.rmfilter(c)
return c:IsAbleToRemove() and c:IsRace(RACE_ZOMBIE)
end
function c100410033.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)
and Duel.IsExistingMatchingCard(c100410033.rmfilter,tp,LOCATION_GRAVE,0,1,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
end
function c100410033.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100410033.rmfilter),tp,LOCATION_GRAVE,0,1,1,c)
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--翼の魔妖-天狗
--Winged Mayakashi - Tengu
function c100410034.initial_effect(c)
c:SetUniqueOnField(1,0,100410034)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410034,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,100410034)
e1:SetCondition(c100410034.condition)
e1:SetTarget(c100410034.target)
e1:SetOperation(c100410034.operation)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100410034,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100410134)
e2:SetCondition(c100410034.spcon)
e2:SetTarget(c100410034.sptg)
e2:SetOperation(c100410034.spop)
c:RegisterEffect(e2)
end
function c100410034.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_GRAVE
end
function c100410034.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsType,tp,0,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100410034.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,Card.IsType,tp,0,LOCATION_ONFIELD,1,1,nil,TYPE_SPELL+TYPE_TRAP)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
function c100410034.spfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:GetPreviousTypeOnField()&TYPE_SYNCHRO~=0
and c:GetOriginalLevel()==9 and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c100410034.spcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c100410034.spfilter,1,nil,tp)
end
function c100410034.rmfilter(c)
return c:IsAbleToRemove() and c:IsRace(RACE_ZOMBIE)
end
function c100410034.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)
and Duel.IsExistingMatchingCard(c100410034.rmfilter,tp,LOCATION_GRAVE,0,1,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
end
function c100410034.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100410034.rmfilter),tp,LOCATION_GRAVE,0,1,1,c)
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--麗の魔妖-妖狐
--Beautiful Mayakashi – Youko
function c100410035.initial_effect(c)
c:SetUniqueOnField(1,0,100410035)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410035,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,100410035)
e1:SetCondition(c100410035.condition)
e1:SetTarget(c100410035.target)
e1:SetOperation(c100410035.operation)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100410035,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100410135)
e2:SetCondition(c100410035.spcon)
e2:SetTarget(c100410035.sptg)
e2:SetOperation(c100410035.spop)
c:RegisterEffect(e2)
end
function c100410035.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_GRAVE
end
function c100410035.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c100410035.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
function c100410035.spfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:GetPreviousTypeOnField()&TYPE_SYNCHRO~=0
and c:GetOriginalLevel()==11 and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c100410035.spcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c100410035.spfilter,1,nil,tp)
end
function c100410035.rmfilter(c)
return c:IsAbleToRemove() and c:IsRace(RACE_ZOMBIE)
end
function c100410035.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)
and Duel.IsExistingMatchingCard(c100410035.rmfilter,tp,LOCATION_GRAVE,0,1,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
end
function c100410035.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100410035.rmfilter),tp,LOCATION_GRAVE,0,1,1,c)
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--骸の魔妖-餓者髑髏
--Skeleton Mayakashi - Gashadokuro
function c100410036.initial_effect(c)
c:SetUniqueOnField(1,0,100410036)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--immune
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100410036,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,100410036)
e1:SetCondition(c100410036.condition)
e1:SetOperation(c100410036.operation)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100410036,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,100410136)
e2:SetCondition(c100410036.spcon)
e2:SetTarget(c100410036.sptg)
e2:SetOperation(c100410036.spop)
c:RegisterEffect(e2)
end
function c100410036.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousLocation()==LOCATION_GRAVE
end
function c100410036.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c100410036.imfilter)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
function c100410036.imfilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function c100410036.spfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:GetPreviousTypeOnField()&TYPE_LINK~=0
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c100410036.spcon(e,tp,eg,ep,ev,re,r,rp)
return not eg:IsContains(e:GetHandler()) and eg:IsExists(c100410036.spfilter,1,nil,tp)
end
function c100410036.rmfilter(c)
return c:IsAbleToRemove() and c:IsRace(RACE_ZOMBIE)
end
function c100410036.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)
and Duel.IsExistingMatchingCard(c100410036.rmfilter,tp,LOCATION_GRAVE,0,1,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
end
function c100410036.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c100410036.rmfilter),tp,LOCATION_GRAVE,0,1,1,c)
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--氷の魔妖-雪女
--Icicle Mayakashi - Yukionna
function c100410037.initial_effect(c)
c:SetUniqueOnField(1,0,100410037)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x121),2,2)
--untargetable
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_BATTLE_TARGET)
e1:SetCondition(c100410037.imcon)
e1:SetValue(aux.imval1)
c:RegisterEffect(e1)
--atk/def down
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(100410037,0))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,100410037)
e2:SetCondition(c100410037.atkcon)
e2:SetTarget(c100410037.atktg)
e2:SetOperation(c100410037.atkop)
c:RegisterEffect(e2)
end
function c100410037.imfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SYNCHRO)
end
function c100410037.imcon(e)
return e:GetHandler():GetLinkedGroup():IsExists(c100410037.imfilter,1,nil)
end
function c100410037.atkfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousTypeOnField()&TYPE_SYNCHRO~=0
and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)
end
function c100410037.atkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c100410037.atkfilter,1,nil,tp)
end
function c100410037.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsFaceup() and chkc:IsLocation(LOCATION_MZONE) end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c100410037.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(math.ceil(tc:GetAttack()/2))
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
e2:SetValue(math.ceil(tc:GetDefense()/2))
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
--魔妖廻天
--Mayakashi Revolt
function c100410038.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100410038+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c100410038.target)
e1:SetOperation(c100410038.activate)
c:RegisterEffect(e1)
end
function c100410038.filter(c)
return c:IsSetCard(0x121) and not c:IsCode(100410038) and (c:IsAbleToHand() or c:IsAbleToGrave())
end
function c100410038.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100410038.filter,tp,LOCATION_DECK,0,1,nil) end
end
function c100410038.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c100410038.filter,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.SelectYesNo(tp,aux.Stringid(100410038,0))) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
--魔妖変生
--Return of the Mayakashi
function c100410039.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,100410039+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c100410039.cost)
e1:SetTarget(c100410039.target)
e1:SetOperation(c100410039.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(100410039,ACTIVITY_SPSUMMON,c100410039.counterfilter)
end
function c100410039.counterfilter(c)
return c:GetSummonLocation()~=LOCATION_EXTRA or c:IsSetCard(0x121)
end
function c100410039.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(100410039,tp,ACTIVITY_SPSUMMON)==0 and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
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:SetLabelObject(e)
e1:SetTarget(c100410039.splimit)
Duel.RegisterEffect(e1,tp)
end
function c100410039.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0x121)
end
function c100410039.spfilter(c,e,tp)
return c:IsSetCard(0x121) and (c:IsFaceup() or not c:IsLocation(LOCATION_REMOVED)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c100410039.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c100410039.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c100410039.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectTarget(tp,c100410039.spfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,1,0,0)
end
function c100410039.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetValue(aux.tgoval)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
--Contact Gate
--Script by dest
function c101005000.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101005000+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c101005000.cost)
e1:SetTarget(c101005000.target)
e1:SetOperation(c101005000.activate)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005000,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_DECK)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c101005000.spcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c101005000.sptg)
e2:SetOperation(c101005000.spop)
c:RegisterEffect(e2)
end
function c101005000.cfilter1(c,e,tp)
return c:IsSetCard(0x1f) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c101005000.cfilter2,tp,LOCATION_GRAVE,0,1,c,e,tp,c)
end
function c101005000.cfilter2(c,e,tp,tc)
if c:IsCode(tc:GetCode()) then return false end
local sg=Group.FromCards(tc,c)
local g=Duel.GetMatchingGroup(c101005000.spfilter1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,sg,e,tp)
return c:IsSetCard(0x1f) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() and g:GetClassCount(Card.GetCode)>1
end
function c101005000.spfilter1(c,e,tp)
return c:IsSetCard(0x1f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005000.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005000.cfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,c101005000.cfilter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,c101005000.cfilter2,tp,LOCATION_GRAVE,0,1,1,g1:GetFirst(),e,tp,g1:GetFirst())
g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
end
function c101005000.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c101005000.spfilter1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and g:GetClassCount(Card.GetCode)>1 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function c101005000.activate(e,tp,eg,ep,ev,re,r,rp)
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:SetTargetRange(1,0)
e1:SetTarget(c101005000.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 then return end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c101005000.spfilter1),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
if g:GetClassCount(Card.GetCode)>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,sg1:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=g:Select(tp,1,1,nil)
sg1:Merge(sg2)
Duel.SpecialSummon(sg1,0,tp,tp,false,false,POS_FACEUP)
end
end
function c101005000.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_EXTRA)
end
function c101005000.confilter(c,tp)
return aux.IsMaterialListCode(c,89943723) and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsLocation(LOCATION_EXTRA)
end
function c101005000.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101005000.confilter,1,nil,tp)
end
function c101005000.spfilter2(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x1f) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005000.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101005000.spfilter2,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end
function c101005000.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,c101005000.spfilter2,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--Pinpoint Landing
function c101005081.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_SELF_TOGRAVE)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005081,0))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,101005081)
e2:SetCondition(c101005081.condition)
e2:SetTarget(c101005081.target)
e2:SetOperation(c101005081.operation)
c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_SELF_TOGRAVE)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c101005081.tgcon)
c:RegisterEffect(e3)
end
function c101005081.filter(c,tp)
return c:IsPreviousLocation(LOCATION_HAND) and c:IsControler(tp)
end
function c101005081.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c101005081.filter,1,nil,tp) and #eg==1
end
function c101005081.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c101005081.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)~=0 then
e:GetHandler():RegisterFlagEffect(101005081,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DRAW,0,1)
end
end
function c101005081.tgcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_END
and e:GetHandler():GetFlagEffect(101005081)==0
end
--Danger! Bigfoot!
--Script by dest
function c101005082.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005082,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c101005082.spcost)
e1:SetTarget(c101005082.sptg)
e1:SetOperation(c101005082.spop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005082,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DISCARD)
e2:SetCountLimit(1,101005082)
e2:SetTarget(c101005082.destg)
e2:SetOperation(c101005082.desop)
c:RegisterEffect(e2)
end
function c101005082.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c101005082.spfilter(c,e,tp)
return c:IsCode(101005082) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005082.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c101005082.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function c101005082.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if g:GetCount()<=0 then return end
local tc=g:RandomSelect(1-tp,1):GetFirst()
if Duel.SendtoGrave(tc,REASON_DISCARD+REASON_EFFECT)~=0 and not tc:IsCode(101005082)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local spg=Duel.GetMatchingGroup(c101005082.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
if spg:GetCount()<=0 then return end
local sg=spg:GetFirst()
if spg:GetCount()~=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=spg:Select(tp,1,1,nil)
end
Duel.BreakEffect()
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c101005082.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c101005082.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
--Danger! Nessie!
--Script by dest
function c101005083.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005083,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c101005083.spcost)
e1:SetTarget(c101005083.sptg)
e1:SetOperation(c101005083.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005083,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DISCARD)
e2:SetCountLimit(1,101005083)
e2:SetTarget(c101005083.thtg)
e2:SetOperation(c101005083.thop)
c:RegisterEffect(e2)
end
function c101005083.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c101005083.spfilter(c,e,tp)
return c:IsCode(101005083) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005083.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c101005083.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function c101005083.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if g:GetCount()<=0 then return end
local tc=g:RandomSelect(1-tp,1):GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_DISCARD+REASON_EFFECT)~=0 and not tc:IsCode(101005083)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local spg=Duel.GetMatchingGroup(c101005083.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
if spg:GetCount()<=0 then return end
local sg=spg:GetFirst()
if spg:GetCount()~=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=spg:Select(tp,1,1,nil)
end
Duel.BreakEffect()
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c101005083.thfilter(c)
return c:IsSetCard(0x11e) and not c:IsCode(101005083) and c:IsAbleToHand()
end
function c101005083.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c101005083.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c101005083.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c101005083.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
--Danger! Chupacabra!
--Script by dest
function c101005084.initial_effect(c)
--special summon (self)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005084,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c101005084.spcost)
e1:SetTarget(c101005084.sptg)
e1:SetOperation(c101005084.spop)
c:RegisterEffect(e1)
--special summon (grave)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005084,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DISCARD)
e2:SetCountLimit(1,101005084)
e2:SetTarget(c101005084.sptg2)
e2:SetOperation(c101005084.spop2)
c:RegisterEffect(e2)
end
function c101005084.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c101005084.spfilter(c,e,tp)
return c:IsCode(101005084) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005084.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c101005084.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function c101005084.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if g:GetCount()<=0 then return end
local tc=g:RandomSelect(1-tp,1):GetFirst()
if Duel.SendtoGrave(tc,REASON_DISCARD+REASON_EFFECT)~=0 and not tc:IsCode(101005084)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local spg=Duel.GetMatchingGroup(c101005084.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
if spg:GetCount()<=0 then return end
local sg=spg:GetFirst()
if spg:GetCount()~=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=spg:Select(tp,1,1,nil)
end
Duel.BreakEffect()
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c101005084.spfilter2(c,e,tp)
return c:IsSetCard(0x11e) and not c:IsCode(101005084) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005084.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c101005084.spfilter2(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c101005084.spfilter2,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c101005084.spfilter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c101005084.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
--Danger!? Jackalope?
--Script by dest
function c101005085.initial_effect(c)
--special summon (self)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005085,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_HANDES+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(c101005085.spcost)
e1:SetTarget(c101005085.sptg)
e1:SetOperation(c101005085.spop)
c:RegisterEffect(e1)
--special summon (deck)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005085,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DISCARD)
e2:SetCountLimit(1,101005085)
e2:SetTarget(c101005085.sptg2)
e2:SetOperation(c101005085.spop2)
c:RegisterEffect(e2)
end
function c101005085.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c101005085.spfilter(c,e,tp)
return c:IsCode(101005085) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c101005085.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c101005085.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function c101005085.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if g:GetCount()<=0 then return end
local tc=g:RandomSelect(1-tp,1):GetFirst()
if Duel.SendtoGrave(tc,REASON_DISCARD+REASON_EFFECT)~=0 and not tc:IsCode(101005085)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local spg=Duel.GetMatchingGroup(c101005085.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
if spg:GetCount()<=0 then return end
local sg=spg:GetFirst()
if spg:GetCount()~=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
sg=spg:Select(tp,1,1,nil)
end
Duel.BreakEffect()
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c101005085.spfilter2(c,e,tp)
return c:IsSetCard(0x11e) and not c:IsCode(101005085) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c101005085.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101005085.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c101005085.spop2(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,c101005085.spfilter2,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
--Realm of Danger!
--Script by dest
function c101005086.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c101005086.target)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
--eff gain/direct attack/cannot be battle target
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101005086,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetTarget(c101005086.efftg)
e3:SetOperation(c101005086.effop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DIRECT_ATTACK)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetTarget(c101005086.tgtg)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_IGNORE_BATTLE_TARGET)
c:RegisterEffect(e5)
end
function c101005086.target(e,c)
return c:IsSetCard(0x11e) and c:IsStatus(STATUS_SPSUMMON_TURN)
end
function c101005086.filter(c)
return c:IsFaceup() and c:IsSetCard(0x11e)
end
function c101005086.efftg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c101005086.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101005086.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c101005086.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c101005086.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc)
end
end
function c101005086.tgtg(e,c)
return e:GetHandler():IsHasCardTarget(c)
end
--Danger! Zone
--Script by dest
function c101005087.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,101005087+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c101005087.target)
e1:SetOperation(c101005087.activate)
c:RegisterEffect(e1)
end
function c101005087.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,3) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(3)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,3)
end
function c101005087.filter(c)
return not c:IsSetCard(0x11e)
end
function c101005087.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)==3 then
Duel.ShuffleHand(p)
Duel.BreakEffect()
local g=Duel.GetFieldGroup(p,LOCATION_HAND,0)
if g:IsExists(Card.IsSetCard,1,nil,0x11e) then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_DISCARD)
local g1=g:Select(p,1,1,nil)
if g1:GetFirst():IsSetCard(0x11e) then
g:RemoveCard(g1:GetFirst())
else
g:Remove(c101005087.filter,nil)
end
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_DISCARD)
local g2=g:Select(p,1,1,nil)
g1:Merge(g2)
Duel.SendtoGrave(g1,REASON_DISCARD+REASON_EFFECT)
else
Duel.ConfirmCards(1-p,g)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end
end
--Noble Knight Custennin
--Script by nekrozar
function c101005088.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,101005088)
e1:SetCondition(c101005088.sprcon)
c:RegisterEffect(e1)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(c101005088.effcon)
e2:SetOperation(c101005088.effop)
c:RegisterEffect(e2)
end
function c101005088.sprfilter(c)
return c:IsFaceup() and c:IsSetCard(0x207a) and c:GetType()==TYPE_SPELL+TYPE_EQUIP
end
function c101005088.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c101005088.sprfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function c101005088.effcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_SYNCHRO+REASON_XYZ+REASON_LINK)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c101005088.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(rc)
e1:SetDescription(aux.Stringid(101005088,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c101005088.sumcon)
e1:SetTarget(c101005088.sumtg)
e1:SetOperation(c101005088.sumop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
if not rc:IsType(TYPE_EFFECT) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
end
end
function c101005088.sumcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,101005088)==0
end
function c101005088.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanSummon(tp) end
end
function c101005088.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x107a))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetTargetRange(1,0)
e2:SetTarget(c101005088.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,101005088,RESET_PHASE+PHASE_END,0,1)
end
function c101005088.splimit(e,c)
return not c:IsSetCard(0x107a) and c:IsLocation(LOCATION_EXTRA)
end
--Sacred Noble Knight of King Custennin
--Script by nekrozar
function c101005089.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x107a),4,2,nil,nil,99)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005089,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,101005089)
e1:SetCost(c101005089.thcost)
e1:SetTarget(c101005089.thtg)
e1:SetOperation(c101005089.thop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(101005089,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c101005089.spcon)
e2:SetTarget(c101005089.sptg)
e2:SetOperation(c101005089.spop)
c:RegisterEffect(e2)
end
function c101005089.thcost(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
local rt=math.min(Duel.GetTargetCount(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,nil),c:GetOverlayCount())
c:RemoveOverlayCard(tp,1,rt,REASON_COST)
local ct=Duel.GetOperatedGroup():GetCount()
e:SetLabel(ct)
end
function c101005089.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
local ct=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local tg=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,ct,ct,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tg,ct,0,0)
end
function c101005089.thop(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if rg:GetCount()>0 then
Duel.SendtoHand(rg,nil,REASON_EFFECT)
end
end
function c101005089.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function c101005089.spfilter(c,e,tp)
return c:IsSetCard(0x107a) and not c:IsCode(101005089) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c101005089.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c101005089.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c101005089.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCountFromEx(tp)<=0 or not aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_XMATERIAL) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c101005089.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)~=0 and c:IsRelateToEffect(e) then
Duel.Overlay(g:GetFirst(),Group.FromCards(c))
end
end
--Noble Knight Pellinore
--Script by nekrozar
function c101005090.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(101005090,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c101005090.destg)
e1:SetOperation(c101005090.desop)
c:RegisterEffect(e1)
end
function c101005090.desfilter(c,g)
return c:IsFaceup() and c:IsSetCard(0x207a) and g:IsContains(c)
end
function c101005090.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=e:GetHandler():GetEquipGroup()
if chkc then return false end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c101005090.desfilter,tp,LOCATION_SZONE,0,1,nil,g)
and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c101005090.desfilter,tp,LOCATION_SZONE,0,1,1,nil,g)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c101005090.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--Noble Arms - Clarent
--Script by nekrozar
function c101005091.initial_effect(c)
c:SetUniqueOnField(1,0,101005091)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c101005091.target)
e1:SetOperation(c101005091.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(c101005091.eqlimit)
c:RegisterEffect(e2)
--direct attack
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(101005091,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c101005091.dircon)
e3:SetCost(c101005091.dircost)
e3:SetOperation(c101005091.dirop)
c:RegisterEffect(e3)
--equip
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(101005091,1))
e4:SetCategory(CATEGORY_EQUIP)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,101005091)
e4:SetCondition(c101005091.eqcon)
e4:SetTarget(c101005091.eqtg)
e4:SetOperation(c101005091.operation)
c:RegisterEffect(e4)
end
function c101005091.eqlimit(e,c)
return c:IsRace(RACE_WARRIOR)
end
function c101005091.eqfilter1(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR)
end
function c101005091.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c101005091.eqfilter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(c101005091.eqfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c101005091.eqfilter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c101005091.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and c:CheckUniqueOnField(tp) then
Duel.Equip(tp,c,tc)
end
end
function c101005091.dircon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function c101005091.dircost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c101005091.dirop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local ec=c:GetEquipTarget()
if not ec then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
ec:RegisterEffect(e1)
end
function c101005091.eqcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and c:IsReason(REASON_DESTROY) and c:CheckUniqueOnField(tp)
end
function c101005091.eqfilter2(c)
return c:IsFaceup() and c:IsSetCard(0x107a) and c:IsRace(RACE_WARRIOR)
end
function c101005091.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c101005091.eqfilter2(chkc) end
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c101005091.eqfilter2,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c101005091.eqfilter2,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment