Commit eb13dddd authored by Nemo Ma's avatar Nemo Ma

remove 光波龙

parent 3bf52289
......@@ -1765,9 +1765,9 @@
#210613
33405100 0
9300315 0
30003030 1
30003040 1
30003050 1
30003030 0
30003040 0
30003050 0
30005015 0
65020201 0
65010087 0
......@@ -4259,7 +4259,7 @@
25000105 0
25000403 0
14824018 0
###WILDEST
#WILDEST
90700071 0
90700072 0
90700059 0
......
No preview for this file type
--离子炮龙-地型
function c12057600.initial_effect(c)
--to hand and remove
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_DECKDES+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,12057600)
e1:SetCondition(c12057600.thrcon)
e1:SetCost(c12057600.thrcost)
e1:SetTarget(c12057600.thrtg)
e1:SetOperation(c12057600.throp)
c:RegisterEffect(e1)
--Equip
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,02057600)
e2:SetTarget(c12057600.eqtg)
e2:SetOperation(c12057600.eqop)
c:RegisterEffect(e2)
end
function c12057600.thrcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:GetHandler():IsType(TYPE_MONSTER) and re:GetHandler():IsAttackAbove(1800)
end
function c12057600.thrcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.ConfirmCards(1-tp,e:GetHandler())
end
function c12057600.thfil(c)
return c:IsAbleToHand() and c:IsType(TYPE_TUNER) and c:IsLevelAbove(5)
end
function c12057600.thrtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057600.thfil,tp,LOCATION_DECK,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND)
end
function c12057600.throp(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057600.thfil,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then
local sg=g:Select(tp,1,1,nil)
if Duel.SendtoHand(sg,tp,REASON_EFFECT)==0 then return end
Duel.ConfirmCards(1-tp,sg)
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,nil) then
Duel.BreakEffect()
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
tc:RegisterFlagEffect(12057600,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetRange(LOCATION_REMOVED)
e1:SetCondition(c12057600.retcon)
e1:SetOperation(c12057600.retop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e1,true)
end
end
end
function c12057600.retcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler()
return tc:GetFlagEffect(12057600)==0
end
function c12057600.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler()
Duel.SendtoHand(tc,tp,REASON_EFFECT)
end
function c12057600.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
end
function c12057600.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c12057600.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
--atk def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(500)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e3)
end
function c12057600.eqlimit(e,c)
return c==e:GetLabelObject()
end
--离子炮龙-暗型
function c12057601.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsLevelAbove,7),aux.NonTuner(nil),1)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
--immune
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetRange(LOCATION_MZONE)
e6:SetCode(EFFECT_IMMUNE_EFFECT)
e6:SetValue(c12057601.efilter)
c:RegisterEffect(e6)
--Equip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057601,0))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,12057601)
e2:SetCondition(c12057601.eqcon)
e2:SetTarget(c12057601.eqtg)
e2:SetOperation(c12057601.eqop)
c:RegisterEffect(e2)
--Destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12057601,1))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,22057601)
e3:SetCondition(c12057601.tdcon)
e3:SetTarget(c12057601.tdtg)
e3:SetOperation(c12057601.tdop)
c:RegisterEffect(e3)
end
function c12057601.efilter(e,te)
return te:IsActiveType(TYPE_SPELL)
end
function c12057601.eqcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER)
end
function c12057601.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return re:GetHandler():IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,re:GetHandler(),1,1-tp,0)
end
function c12057601.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=re:GetHandler()
if tc:IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEDOWN,REASON_EFFECT)
end
end
function c12057601.tdcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c12057601.tdtg(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 c12057601.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local x,p=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM,CHAININFO_TARGET_PLAYER)
Duel.Draw(p,x,REASON_EFFECT)
end
--战源龙 彩虹希望
function c12057602.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c12057602.intg)
e1:SetValue(c12057602.indct)
c:RegisterEffect(e1)
--atk def
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,12057602)
e2:SetCondition(c12057602.adcon)
e2:SetTarget(c12057602.adtg)
e2:SetOperation(c12057602.adop)
c:RegisterEffect(e2)
--remove and recover
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_REMOVE+CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,02057602)
e3:SetCondition(c12057602.rrcon)
e3:SetTarget(c12057602.rrtg)
e3:SetOperation(c12057602.rrop)
c:RegisterEffect(e3)
end
function c12057602.intg(e,c)
return c:IsRace(RACE_DRAGON+RACE_WARRIOR+RACE_MACHINE+RACE_SPELLCASTER+RACE_WYRM)
end
function c12057602.indct(e,re,r,rp)
if bit.band(r,REASON_EFFECT)~=0 then
return 1
else return 0 end
end
function c12057602.adcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c12057602.adtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsLevelAbove,tp,0,LOCATION_MZONE,1,nil,1) end
end
function c12057602.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsLevelAbove,tp,0,LOCATION_MZONE,nil,1)
if g:GetCount()>0 then
local tc=g:GetFirst()
while tc do
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(-8)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(-2900)
tc:RegisterEffect(e2)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(-2900)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
end
function c12057602.rrcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,1,nil,TYPE_FUSION)
end
function c12057602.rrtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1900)
end
function c12057602.rrop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,nil)
if g:GetCount()>0 then
local sg=g:Select(tp,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
Duel.Recover(tp,1900,REASON_EFFECT)
end
end
--月夜龙 恶魔之主
function c12057603.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunFunRep(c,aux.FilterBoolFunction(Card.IsDefenseAbove,2800),aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON+RACE_WARRIOR+RACE_WYRM+RACE_SPELLCASTER+RACE_MACHINE),2,2,true)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
--def atk
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DEFCHANGE+CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c12057603.datg)
e3:SetOperation(c12057603.daop)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_CHAIN_NEGATED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,12057603)
e4:SetCondition(c12057603.rmcon1)
e4:SetTarget(c12057603.rmtg)
e4:SetOperation(c12057603.rmop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_CHAIN_DISABLED)
c:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetCode(EVENT_LEAVE_FIELD)
e6:SetCondition(c12057603.rmcon2)
c:RegisterEffect(e6)
end
function c12057603.datg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c12057603.daop(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_UPDATE_DEFENSE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetValue(1500)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(-1500)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c12057603.rmcon1(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsControler(tp) and re:GetActivateLocation()==LOCATION_MZONE
end
function c12057603.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_ONFIELD+LOCATION_GRAVE)
end
function c12057603.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
if g:GetCount()>0 then
local sg=g:Select(tp,1,2,nil)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
end
end
function c12057603.ckfil(c,tp)
return c:GetReasonPlayer()~=tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp
end
function c12057603.rmcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c12057603.ckfil,1,nil,tp)
end
--幻星龙 星云烟尘
function c12057604.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--cannot remove
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_REMOVE)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetCondition(c12057604.crcon)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c12057604.thcon)
e2:SetTarget(c12057604.thtg)
e2:SetOperation(c12057604.thop)
c:RegisterEffect(e2)
end
function c12057604.crcon(e)
return Duel.GetCurrentPhase()~=PHASE_MAIN2
end
function c12057604.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)) and c:IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c12057604.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_REMOVED)
end
function c12057604.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if g:GetCount()>0 then
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
end
end
--电光兽 饥饿犬
function c12057605.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TO_HAND)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_DRAW)
e2:SetTargetRange(1,1)
c:RegisterEffect(e2)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCountLimit(1,12057605)
e2:SetTarget(c12057605.tdtg)
e2:SetOperation(c12057605.tdop)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,02057605)
e3:SetCondition(aux.exccon)
e3:SetCost(c12057605.spcost)
e3:SetTarget(c12057605.sptg)
e3:SetOperation(c12057605.spop)
c:RegisterEffect(e3)
end
function c12057605.actlimit(e,re,tp)
return re:GetHandler():GetTurnID()==Duel.GetTurnCount() and re:GetHandler():IsLocation(LOCATION_HAND)
end
function c12057605.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if chk==0 then return bc:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,bc,1,1-tp,LOCATION_MZONE)
end
function c12057605.tdop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc:IsRelateToBattle() then
Duel.SendtoHand(bc,nil,REASON_EFFECT)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
function c12057605.ctfil(c)
return c:IsAbleToRemoveAsCost() and c:GetBaseAttack()>=2000
end
function c12057605.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057605.ctfil,tp,LOCATION_GRAVE,0,2,e:GetHandler()) end
local g=Duel.SelectMatchingCard(tp,c12057605.ctfil,tp,LOCATION_GRAVE,0,2,2,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c12057605.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_GRAVE)
end
function c12057605.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--和平天使艾蕾娜
function c12057606.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--change damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(0)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
c:RegisterEffect(e2)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057606,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE+CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,12057606)
e2:SetCondition(c12057606.discon)
e2:SetTarget(c12057606.distg)
e2:SetOperation(c12057606.disop)
c:RegisterEffect(e2)
--to deck and recover
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TODECK+CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,02057606)
e3:SetTarget(c12057606.tdrtg)
e3:SetOperation(c12057606.tdrop)
c:RegisterEffect(e3)
end
function c12057606.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and re:GetHandler():IsAttackAbove(1600) and re:IsActiveType(TYPE_MONSTER)
end
function c12057606.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
end
function c12057606.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
Duel.Recover(tp,re:GetHandler():GetAttack(),REASON_EFFECT)
end
function c12057606.tdrtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,2,nil,0,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,nil,tp,3000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,0,nil,1-tp,3000)
end
function c12057606.tdrop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g1=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,0,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,nil)
if g1:GetCount()>0 and g2:GetCount()>0 then
local sg1=g1:Select(1-tp,1,1,nil)
local sg2=g2:Select(tp,1,1,nil)
sg1:Merge(sg2)
if Duel.SendtoDeck(sg1,nil,2,REASON_EFFECT)==2 then
Duel.BreakEffect()
Duel.Recover(tp,3000,REASON_EFFECT,true)
Duel.Recover(1-tp,3000,REASON_EFFECT,true)
Duel.RDComplete()
end
end
end
--超传导暴龙
function c12057608.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c12057608.incost)
e1:SetTarget(c12057608.intg)
e1:SetOperation(c12057608.inop)
c:RegisterEffect(e1)
--attack all
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ATTACK_ALL)
e2:SetValue(1)
c:RegisterEffect(e2)
--pierce
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e3)
end
function c12057608.ctfil(c)
return c:IsReleasable() and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,c)
end
function c12057608.incost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057608.ctfil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.SelectMatchingCard(tp,c12057608.ctfil,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c12057608.intg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c12057608.inop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local tc=g:Select(tp,1,1,nil):GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c12057608.efilter)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
--atk def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
end
end
function c12057608.efilter(e,re)
return re:GetOwner()~=e:GetOwner()
end
--龙源邪灵-幽暗龙
function c12057609.initial_effect(c)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,12057609)
e1:SetTarget(c12057609.sptg1)
e1:SetOperation(c12057609.spop1)
c:RegisterEffect(e1)
--pos
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_POSITION+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c12057609.postg)
e2:SetOperation(c12057609.posop)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,02057609)
e3:SetTarget(c12057609.sptg2)
e3:SetOperation(c12057609.spop2)
c:RegisterEffect(e3)
end
function c12057609.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,0,1,nil) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c12057609.spop1(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c12057609.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function c12057609.posop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local tc=g:Select(tp,1,1,nil):GetFirst()
if Duel.ChangePosition(tc,POS_FACEUP_DEFENSE)~=0 and Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(12057609,0)) then
local dg=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
function c12057609.spfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function c12057609.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057609.spfil,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1 and rp==1-tp end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c12057609.spop2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057609.spfil,tp,LOCATION_GRAVE,0,nil,e,tp)
if g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
end
end
--战源猎人 龙骑双子
function c12057611.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,c12057611.mfilter1,c12057611.mfilter2,true)
--attribute
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_ADD_RACE)
e0:SetRange(0xff)
e0:SetValue(RACE_WARRIOR)
c:RegisterEffect(e0)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c12057611.immcon1)
e1:SetValue(c12057611.efilter1)
c:RegisterEffect(e1)
--pos
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057611,0))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c12057611.postg1)
e2:SetOperation(c12057611.posop1)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057611,1))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c12057611.postg2)
e2:SetOperation(c12057611.posop2)
c:RegisterEffect(e2)
--repeat attack
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12057611,2))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_START)
e3:SetCountLimit(1,12057611)
e3:SetTarget(c12057611.thtg)
e3:SetOperation(c12057611.thop)
c:RegisterEffect(e3)
end
function c12057611.mfilter1(c)
return c:IsAttackAbove(1500) and c:IsRace(RACE_WARRIOR)
end
function c12057611.mfilter2(c)
return c:IsDefenseAbove(1800) and c:IsRace(RACE_DRAGON)
end
function c12057611.immcon1(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function c12057611.efilter1(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function c12057611.posfil1(c)
return c:IsFaceup()
end
function c12057611.postg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057611.posfil1,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and e:GetHandler():GetFlagEffect(12057611)==0 end
e:GetHandler():RegisterFlagEffect(12057611,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c12057611.posop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057611.posfil1,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
function c12057611.posfil2(c)
return c:IsDefensePos()
end
function c12057611.postg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057611.posfil2,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and e:GetHandler():GetFlagEffect(12057611)==0 end
e:GetHandler():RegisterFlagEffect(12057611,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c12057611.posop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057611.posfil2,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.ChangePosition(tc,POS_FACEUP_ATTACK)
end
end
function c12057611.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if chk==0 then return tc and tc:IsAbleToRemove() and tc:IsDefensePos() end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tc,1,0,0)
end
function c12057611.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if c==tc then tc=Duel.GetAttackTarget() end
if tc and tc:IsRelateToBattle() then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
if c:IsRelateToEffect(e) and c:IsChainAttackable() then
Duel.ChainAttack()
end
end
--战源龙 骑龙
function c12057612.initial_effect(c)
--attribute
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_ADD_RACE)
e0:SetRange(0xff)
e0:SetValue(RACE_WARRIOR)
c:RegisterEffect(e0)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,12057612)
e1:SetCost(c12057612.spcost)
e1:SetTarget(c12057612.sptg)
e1:SetOperation(c12057612.spop)
c:RegisterEffect(e1)
--fusion
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,12057612+EFFECT_COUNT_CODE_DUEL)
e2:SetCondition(c12057612.fucon)
e2:SetTarget(c12057612.futg)
e2:SetOperation(c12057612.fuop)
c:RegisterEffect(e2)
end
function c12057612.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1500) end
Duel.PayLPCost(tp,1500)
end
function c12057612.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_MZONE,0,1,nil,RACE_DRAGON+RACE_WARRIOR) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND)
end
function c12057612.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c12057612.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c12057612.splimit(e,c)
return (not c:IsType(TYPE_FUSION) and not c:IsType(TYPE_SYNCHRO)) and c:IsLocation(LOCATION_EXTRA)
end
function c12057612.fucon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,1,nil,TYPE_SYNCHRO) and re:GetHandler():IsAttackAbove(2800) and rp==1-tp
end
function c12057612.spfilter1(c,e)
return c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function c12057612.spfilter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf) and c:IsLevelBelow(8)
end
function c12057612.futg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp,LOCATION_GRAVE+LOCATION_REMOVED)
local res=Duel.IsExistingMatchingCard(c12057612.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c12057612.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c12057612.fuop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
local mg1=Duel.GetFusionMaterial(tp,LOCATION_GRAVE+LOCATION_REMOVED):Filter(c12057612.spfilter1,nil,e)
local sg1=Duel.GetMatchingGroup(c12057612.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c,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(c12057612.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c,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,c,chkf)
tc:SetMaterial(mat1)
Duel.SendtoDeck(mat1,nil,2,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,c,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
--龙源精灵-太阳龙
function c12057613.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,c12057613.mfilter,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057613,1))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,12057613)
e1:SetCondition(c12057613.tgcon)
e1:SetTarget(c12057613.tgtg)
e1:SetOperation(c12057613.tgop)
c:RegisterEffect(e1)
--pos
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12057613,2))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,22057613)
e3:SetTarget(c12057613.postg)
e3:SetOperation(c12057613.posop)
c:RegisterEffect(e3)
--SpecialSummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(12057613,3))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,02057613)
e4:SetTarget(c12057613.sptg2)
e4:SetOperation(c12057613.spop2)
c:RegisterEffect(e4)
end
function c12057613.mfilter(c)
return c:IsLevelAbove(4) and c:IsRace(RACE_DRAGON) and c:IsType(TYPE_TUNER)
end
function c12057613.tgfil(c)
return c:IsAbleToGrave() and c:IsDefenseAbove(2000) and c:IsRace(RACE_DRAGON)
end
function c12057613.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057613.tgfil,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c12057613.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057613.tgfil,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
if g:GetCount()>0 then
local dg=g:Select(tp,1,1,nil)
Duel.SendtoGrave(dg,REASON_EFFECT)
end
end
function c12057613.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsType,1,nil,TYPE_SYNCHRO) or eg:IsContains(e:GetHandler())
end
function c12057613.posfil(c)
return c:IsFaceup() and c:IsAttackAbove(2000)
end
function c12057613.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057613.posfil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function c12057613.posop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057613.posfil,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
function c12057613.spfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function c12057613.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057613.spfil,tp,LOCATION_REMOVED,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1 and rp==1-tp end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end
function c12057613.spop2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057613.spfil,tp,LOCATION_REMOVED,0,nil,e,tp)
if g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local sg=g:Select(tp,1,1,nil)
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)~=0 then
Duel.BreakEffect()
Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)
end
end
end
--教导的黑龙公主
function c12057801.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_WYRM+RACE_SPELLCASTER),aux.NonTuner(Card.IsRace,RACE_WYRM+RACE_SPELLCASTER),1)
c:EnableReviveLimit()
--set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057801,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,12057801)
e1:SetTarget(c12057801.settg)
e1:SetOperation(c12057801.setop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057801,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_NO_TURN_RESET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,22057801)
e2:SetCondition(c12057801.discon)
e2:SetTarget(c12057801.distg)
e2:SetOperation(c12057801.disop)
c:RegisterEffect(e2)
end
function c12057801.setfilter(c)
return c:IsSetCard(0x145) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c12057801.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057801.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c12057801.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c12057801.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst())
end
end
function c12057801.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and re:IsActiveType(TYPE_MONSTER)
end
function c12057801.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c12057801.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--出击的妖眼相剑师
function c12057802.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057802,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,12057802)
e1:SetCondition(c12057802.spcon)
e1:SetCost(c12057802.spcost)
e1:SetTarget(c12057802.sptg)
e1:SetOperation(c12057802.spop)
c:RegisterEffect(e1)
--lv and sp
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,22057802)
e2:SetTarget(c12057802.lstg)
e2:SetOperation(c12057802.lsop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c12057802.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_WYRM)
end
function c12057802.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c12057802.cfilter,tp,LOCATION_MZONE,0,1,nil) or Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function c12057802.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
end
function c12057802.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 c12057802.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 c12057802.lstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c12057802.spfil(c,e,tp)
return c:IsSetCard(0x145,0x16b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c12057802.lsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local op=0
op=Duel.SelectOption(tp,aux.Stringid(12057802,0),aux.Stringid(12057802,1))
if op==0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
elseif op==1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(-2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
if Duel.IsExistingMatchingCard(c12057802.spfil,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(12057802,3)) then
local sg=Duel.SelectMatchingCard(tp,c12057802.spfil,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--教导的魅惑魔女
function c12057803.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,c12057803.fmfil1,aux.FilterBoolFunction(Card.IsFusionSetCard,0x145),true)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057803,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,12057803)
e1:SetTarget(c12057803.rmtg)
e1:SetOperation(c12057803.rmop)
c:RegisterEffect(e1)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057803,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_NO_TURN_RESET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,22057803)
e2:SetCondition(c12057803.discon)
e2:SetTarget(c12057803.distg)
e2:SetOperation(c12057803.disop)
c:RegisterEffect(e2)
--lv
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,32057803)
e3:SetTarget(c12057803.lvtg)
e3:SetOperation(c12057803.lvop)
c:RegisterEffect(e3)
end
function c12057803.fmfil1(c)
return c:IsFusionSetCard(0x145,0x16b)
end
function c12057803.rmfilter(c)
return c:IsSetCard(0x145,0x16b) and c:IsAbleToRemove()
end
function c12057803.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057803.rmfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function c12057803.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c12057803.rmfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function c12057803.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c12057803.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c12057803.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c12057803.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c12057803.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local lv=Duel.AnnounceLevel(tp,1,4,1,3)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c12057803.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c12057803.splimit(e,c)
return not c:IsSetCard(0x145) and not c:IsSetCard(0x16b) and c:IsLocation(LOCATION_EXTRA)
end
--强者的邀约
function c12057804.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,12057804)
e1:SetCost(c12057804.accost)
e1:SetTarget(c12057804.actg)
e1:SetOperation(c12057804.acop)
c:RegisterEffect(e1)
--xx
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057804,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,22057804)
e1:SetCondition(c12057804.xxcon)
e1:SetTarget(c12057804.xxtg)
e1:SetOperation(c12057804.xxop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_REMOVE)
c:RegisterEffect(e2)
end
function c12057804.ctfil(c)
return c:IsSetCard(0x145,0x16b) and (c:IsAbleToGraveAsCost() or c:IsAbleToRemoveAsCost())
end
function c12057804.accost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057804.ctfil,tp,LOCATION_DECK,0,1,nil) end
local tc=Duel.SelectMatchingCard(tp,c12057804.ctfil,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
local op=3
local b1=tc:IsAbleToGraveAsCost()
local b2=tc:IsAbleToRemoveAsCost()
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(12057804,0),aux.Stringid(12057804,1))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(12057804,0))
elseif b2 then
op=Duel.SelectOption(tp,aux.Stringid(12057804,1))+1
end
if op==0 then
Duel.SendtoGrave(tc,REASON_COST)
elseif op==1 then
Duel.Remove(tc,POS_FACEUP,REASON_COST)
end
end
function c12057804.actg(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)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
end
function c12057804.acop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
if Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,nil) then
Duel.BreakEffect()
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end
function c12057804.xxcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_EFFECT) and rp==1-tp
end
function c12057804.xxtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c12057804.xxop(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:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(Duel.GetTurnCount()+1)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetCondition(c12057804.thcon)
e1:SetOperation(c12057804.thop)
Duel.RegisterEffect(e1,tp)
end
function c12057804.thfil(c)
return c:IsCode(30680659,52947044) and c:IsAbleToHand()
end
function c12057804.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==e:GetLabel() and Duel.IsExistingMatchingCard(c12057804.thfil,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil)
end
function c12057804.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_CARD,0,12057804)
local g=Duel.SelectMatchingCard(tp,c12057804.thfil,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
--裁决的指引
function c12057805.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057805,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--double
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057805,1))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,12057805)
e1:SetCondition(c12057805.condition)
e1:SetTarget(c12057805.target)
e1:SetOperation(c12057805.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
c:RegisterEffect(e2)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057805,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,22057805)
e2:SetCondition(c12057805.setcon)
e2:SetTarget(c12057805.settg)
e2:SetOperation(c12057805.setop)
c:RegisterEffect(e2)
end
function c12057805.ckfil(c)
return c:IsSetCard(0x145,0x16b) and c:IsFaceup()
end
function c12057805.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and Duel.IsExistingMatchingCard(c12057805.ckfil,tp,LOCATION_MZONE,0,1,nil)
end
function c12057805.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return re:GetHandler():IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
function c12057805.operation(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
function c12057805.setfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsRace(RACE_WYRM) and c:IsType(TYPE_SYNCHRO+TYPE_XYZ+TYPE_FUSION+TYPE_PENDULUM+TYPE_LINK)
end
function c12057805.setcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c12057805.setfilter,1,nil,tp)
end
function c12057805.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c12057805.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SSet(tp,c)
end
end
--教导的相剑圣骑兵
function c12057807.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_WYRM+RACE_SPELLCASTER),aux.NonTuner(Card.IsRace,RACE_WYRM+RACE_SPELLCASTER),1)
c:EnableReviveLimit()
--attribute
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_CANNOT_DISABLE)
e0:SetCode(EFFECT_ADD_RACE)
e0:SetValue(RACE_SPELLCASTER)
e0:SetRange(0xff)
c:RegisterEffect(e0)
--double
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057807,1))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DAMAGE+CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,12057807)
e1:SetCondition(c12057807.condition)
e1:SetTarget(c12057807.target)
e1:SetOperation(c12057807.operation)
c:RegisterEffect(e1)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057807,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetCountLimit(1,22057807)
e2:SetCondition(c12057807.rmcon)
e2:SetTarget(c12057807.rmtg)
e2:SetOperation(c12057807.rmop)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--damage val
local e5=e3:Clone()
e5:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
c:RegisterEffect(e5)
end
function c12057807.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function c12057807.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return re:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,1-tp,1500)
end
function c12057807.operation(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SendtoDeck(eg,nil,2,REASON_EFFECT)
Duel.Damage(1-tp,1500,REASON_EFFECT)
end
end
function c12057807.rmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
e:SetLabelObject(bc)
return c==Duel.GetAttacker() and bc and c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsOnField() and bc:IsRelateToBattle()
end
function c12057807.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetLabelObject(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,1-tp,1500)
end
function c12057807.rmop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetLabelObject()
if bc:IsRelateToBattle() and bc:IsControler(1-tp) then
Duel.SendtoDeck(bc,nil,2,REASON_EFFECT+REASON_RULE)
Duel.Damage(1-tp,1500,REASON_EFFECT)
end
end
--教导的蛇妖 琉莎
function c12057808.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2)
c:EnableReviveLimit()
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057808,3))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,12057808)
e1:SetCost(c12057808.spcost)
e1:SetTarget(c12057808.sptg)
e1:SetOperation(c12057808.spop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057808,4))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2:SetCountLimit(1,22057808)
e2:SetCost(c12057808.idcost)
e2:SetTarget(c12057808.idtg)
e2:SetOperation(c12057808.idop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(12057808,ACTIVITY_SPSUMMON,c12057808.counterfilter)
end
function c12057808.counterfilter(c)
return not c:IsSummonLocation(LOCATION_EXTRA) or (c:IsSetCard(0x145) or c:IsSetCard(0x16b))
end
function c12057808.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(12057808,tp,ACTIVITY_SPSUMMON)==0 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
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(c12057808.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c12057808.splimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0x145) and not c:IsSetCard(0x16b)
end
function c12057808.spfil(c,e,tp)
return c:IsSetCard(0x145,0x16b) and c:IsLevelBelow(6) and (c:IsAbleToHand() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0))
end
function c12057808.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057808.spfil,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c12057808.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057808.spfil,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>0 then
local tc=g:Select(tp,1,1,nil):GetFirst()
local op=3
local b1=tc:IsAbleToHand()
local b2=tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(12057808,1),aux.Stringid(12057808,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(12057808,1))
elseif b2 then
op=Duel.SelectOption(tp,aux.Stringid(12057808,2))+1
end
if op==0 then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
elseif op==1 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
--to grave
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetCondition(c12057808.tgcon)
e2:SetOperation(c12057808.tgop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c12057808.tgfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x145,0x16b) and c:IsAbleToGrave()
end
function c12057808.tgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c12057808.tgfilter,tp,LOCATION_DECK,0,1,nil)
end
function c12057808.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,12057808)
local g=Duel.GetMatchingGroup(c12057808.tgfilter,tp,LOCATION_DECK,0,nil)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
function c12057808.idcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(12057808,tp,ACTIVITY_SPSUMMON)==0 and e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
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(c12057808.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c12057808.idtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c12057808.idop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--cannot be target
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057808,5))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c12057808.tgtg)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
function c12057808.tgtg(e,c)
return c:IsType(TYPE_SYNCHRO)
end
--教导的团聚
function c12057809.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057809,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,12057809)
e1:SetTarget(c12057809.sptg)
e1:SetOperation(c12057809.spop)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057809,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,12057809)
e2:SetCondition(c12057809.xhpcon)
e2:SetCost(aux.bfgcost)
e2:SetOperation(c12057809.xhpop)
c:RegisterEffect(e2)
end
function c12057809.mfilter0(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end
function c12057809.mfilter1(c,e)
return not c:IsImmuneToEffect(e)
end
function c12057809.mfilter2(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave() and not c:IsImmuneToEffect(e)
end
function c12057809.spfilter1(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_SPELLCASTER) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c12057809.spfilter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsLevelBelow(7) and c:IsRace(RACE_SPELLCASTER) and c:IsSetCard(0x145) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c12057809.fcheck(tp,sg,fc)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<=1
end
function c12057809.gcheck(sg)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK)<=1
end
function c12057809.sptg(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(c12057809.spfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if res then return true end
local mg2=Duel.GetMatchingGroup(c12057809.mfilter0,tp,LOCATION_DECK,0,nil)
mg2:Merge(mg1)
aux.FCheckAdditional=c12057809.fcheck
aux.GCheckAdditional=c12057809.gcheck
res=Duel.IsExistingMatchingCard(c12057809.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,nil,chkf)
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c12057809.spfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c12057809.spop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c12057809.mfilter1,nil,e)
local sg1=Duel.GetMatchingGroup(c12057809.spfilter1,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=Duel.GetMatchingGroup(c12057809.mfilter2,tp,LOCATION_DECK,0,nil,e)
mg2:Merge(mg1)
local sg2=Duel.GetMatchingGroup(c12057809.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,nil,chkf)
sg1:Merge(sg2)
aux.FCheckAdditional=c12057809.fcheck
aux.GCheckAdditional=c12057809.gcheck
local mg3=nil
local sg3=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg3=Duel.GetMatchingGroup(c12057809.spfilter1,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg3~=nil and sg3:GetCount()>0) then
local sg=sg1:Clone()
if sg3 then sg:Merge(sg3) 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 (sg3==nil or not sg3:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
if tc:IsSetCard(0x145) and tc:IsLevelBelow(7) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat2)
Duel.SendtoGrave(mat2,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
end
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat)
end
tc:CompleteProcedure()
aux.FCheckAdditional=nil
aux.GCheckAdditional=nil
end
end
function c12057809.sfilter(c,tp)
return c:IsSetCard(0x145,0x16b) and c:IsPreviousControler(tp) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_MZONE)
end
function c12057809.xhpcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c12057809.sfilter,1,nil,tp)
end
function c12057809.xhpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetCondition(c12057809.hspcon)
e1:SetOperation(c12057809.hspop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c12057809.hspfilter(c,e,tp)
return c:IsLevelBelow(6) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c12057809.hspcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c12057809.hspfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp)
end
function c12057809.hspop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,12057809)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c12057809.hspfilter),tp,LOCATION_GRAVE+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
--教导的蛟龙神
function c12057810.initial_effect(c)
--nontuner
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(0xff)
e0:SetCode(EFFECT_NONTUNER)
e0:SetValue(c12057810.tnval)
c:RegisterEffect(e0)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057810,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,12057810)
e1:SetTarget(c12057810.sptg)
e1:SetOperation(c12057810.spop)
c:RegisterEffect(e1)
--t or p
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(12057810,1))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,32057810)
e4:SetCost(aux.bfgcost)
e4:SetTarget(c12057810.xthtg)
e4:SetOperation(c12057810.xthop)
c:RegisterEffect(e4)
end
function c12057810.tnval(e,c)
return e:GetHandler():IsControler(c:GetControler())
end
function c12057810.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_REMOVED)
end
function c12057810.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if g:GetCount()<=0 then return end
local dg=g:Select(tp,1,1,nil)
if Duel.SendtoDeck(dg,nil,2,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c12057810.xthtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetTurnPlayer()==1-tp and Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil) end
Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
end
function c12057810.xthop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
--教导的神使 龙雅
function c12057811.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,c12057811.mfilter,c12057811.xyzcheck,2,2)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.xyzlimit)
c:RegisterEffect(e1)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c12057811.immcon1)
e1:SetValue(c12057811.efilter1)
c:RegisterEffect(e1)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetCondition(c12057811.immcon1)
c:RegisterEffect(e1)
--Negate
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY+CATEGORY_DAMAGE)
e2:SetDescription(aux.Stringid(12057811,0))
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,12057811)
e2:SetCondition(c12057811.discon)
e2:SetCost(c12057811.discost)
e2:SetTarget(c12057811.distg)
e2:SetOperation(c12057811.disop)
c:RegisterEffect(e2)
--xx
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12057811,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(1,22057811)
e3:SetCondition(c12057811.xxcon)
e3:SetTarget(c12057811.xxtg)
e3:SetOperation(c12057811.xxop)
c:RegisterEffect(e3)
end
function c12057811.mfilter(c,xyzc)
return c:GetSummonLocation()==LOCATION_EXTRA and c:IsSetCard(0x145,0x16b)
end
function c12057811.xyzcheck(g)
return true
end
function c12057811.immcon1(e)
return e:GetHandler():GetOverlayCount()>0
end
function c12057811.efilter1(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and te:IsActiveType(TYPE_MONSTER)
end
function c12057811.discon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not Duel.IsChainNegatable(ev) then return false end
if not re:IsActiveType(TYPE_MONSTER) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
return re:IsHasCategory(CATEGORY_SPECIAL_SUMMON)
end
function c12057811.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c12057811.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,1-tp,1500)
end
end
function c12057811.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re)
and Duel.Destroy(eg,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,1500,REASON_EFFECT)
end
end
function c12057811.xxcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP)
and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp and c:IsSummonType(SUMMON_TYPE_XYZ)
end
function c12057811.tdfil(c)
return c:IsAbleToDeck() and (c:IsFaceup() or not c:IsLocation(LOCATION_EXTRA))
end
function c12057811.xxtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057811.tdfil,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,1,nil) end
local g=Duel.GetMatchingGroup(c12057811.tdfil,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c12057811.xxop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057811.tdfil,tp,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_EXTRA,nil)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
--change damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(0)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
end
--教导的魔女 安娜
function c12057812.initial_effect(c)
--nontuner
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(0xff)
e0:SetCode(EFFECT_NONTUNER)
e0:SetValue(c12057812.tnval)
c:RegisterEffect(e0)
--set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057812,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,12057812)
e1:SetOperation(c12057812.setop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057812,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,22057812)
e2:SetTarget(c12057812.sptg)
e2:SetOperation(c12057812.spop)
c:RegisterEffect(e2)
end
function c12057812.tnval(e,c)
return e:GetHandler():IsControler(c:GetControler())
end
function c12057812.setfilter(c)
return c:IsSetCard(0x145,0x16b) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c12057812.setop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetCondition(c12057812.xstcon)
e1:SetOperation(c12057812.xstop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c12057812.xstcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c12057812.setfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil)
end
function c12057812.xstop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,12057812)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c12057812.setfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst())
end
end
function c12057812.filter(c,e,tp)
return c:IsSetCard(0x145,0x16b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c12057812.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c12057812.filter,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
end
function c12057812.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,c12057812.filter,tp,LOCATION_HAND+LOCATION_GRAVE+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
--教导的佣兵 鹿卡
function c12057813.initial_effect(c)
--attribute
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_CANNOT_DISABLE)
e0:SetCode(EFFECT_ADD_RACE)
e0:SetValue(RACE_WYRM)
e0:SetRange(0xff)
c:RegisterEffect(e0)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c12057813.spcon)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057813,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,12057813)
e2:SetTarget(c12057813.sptg)
e2:SetOperation(c12057813.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c12057813.spcon(e,c)
if c==nil then return true end
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,0)<=2
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c12057813.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsSetCard(0x145,0x16b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c12057813.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c12057813.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c12057813.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,c12057813.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and 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_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
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,true)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3,true)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3,true)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3,true)
end
Duel.SpecialSummonComplete()
end
--勇者的奇袭
function c12057814.initial_effect(c)
--activate
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(11711438,0))
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--r and d
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057814,1))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,12057814)
e1:SetCondition(c12057814.radcon)
e1:SetTarget(c12057814.radtg)
e1:SetOperation(c12057814.radop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e2)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057814,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,22057814)
e2:SetCondition(c12057814.setcon)
e2:SetTarget(c12057814.settg)
e2:SetOperation(c12057814.setop)
c:RegisterEffect(e2)
end
function c12057814.setfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsRace(RACE_WYRM) and c:IsType(TYPE_SYNCHRO+TYPE_XYZ+TYPE_FUSION+TYPE_PENDULUM+TYPE_LINK)
end
function c12057814.setcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c12057814.setfilter,1,nil,tp)
end
function c12057814.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c12057814.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SSet(tp,c)
end
end
function c12057814.radfilter(c)
return c:IsFaceup() and c:IsSetCard(0x145,0x16b)
end
function c12057814.radcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c12057814.radfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c12057814.radtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,0,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,1-tp,1000)
end
function c12057814.radop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
if g:GetCount()<=0 then return end
local dg=g:Select(tp,1,2,nil)
if Duel.Remove(dg,POS_FACEUP,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.Damage(1-tp,1000,REASON_EFFECT)
end
end
end
--教导的大魔术师
function c12057816.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,c12057816.fmfil1,c12057816.fmfil2,true)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c12057816.splimit)
c:RegisterEffect(e1)
--Damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(aux.chainreg)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(c12057816.daop)
c:RegisterEffect(e3)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12057816,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,12057816)
e3:SetCondition(c12057816.regcon)
e3:SetOperation(c12057816.regop)
c:RegisterEffect(e3)
--t and s
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOEXTRA+CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,22057816)
e4:SetTarget(c12057816.tastg)
e4:SetOperation(c12057816.tasop)
c:RegisterEffect(e4)
end
function c12057816.fmfil1(c)
return c:IsFusionType(TYPE_SYNCHRO+TYPE_FUSION+TYPE_XYZ)
end
function c12057816.fmfil2(c)
return c:IsDefenseAbove(3000)
end
function c12057816.splimit(e,se,sp,st)
local sc=se:GetHandler()
local lb1,lb2=se:GetLabel()
return (sc and sc==e:GetHandler()) or st&SUMMON_TYPE_FUSION==SUMMON_TYPE_FUSION or (lb2 and lb2==12057816)
end
function c12057816.daop(e,tp,eg,ep,ev,re,r,rp)
if rp==1-tp and e:GetHandler():GetFlagEffect(1)>0 then
Duel.Hint(HINT_CARD,0,12057816)
Duel.Damage(1-tp,150,REASON_EFFECT)
end
end
function c12057816.regcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function c12057816.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(12057816,2))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c12057816.spcon)
e1:SetOperation(c12057816.spop)
if Duel.GetCurrentPhase()<=PHASE_STANDBY then
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
else
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
end
Duel.RegisterEffect(e1,tp)
end
function c12057816.spfilter(c,e,tp)
return c:IsSetCard(0x145) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c12057816.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c12057816.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
end
function c12057816.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,12057816)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c12057816.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c12057816.tastg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,1,e:GetHandler()) and e:GetHandler():IsAbleToExtra() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED)
end
function c12057816.tasop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,e:GetHandler())
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,2,REASON_EFFECT)~=0 and g:GetCount()>0 then
local sg=g:Select(tp,1,1,nil)
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(12057816,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount(),12057816)
e1:SetCondition(c12057816.xspcon)
e1:SetOperation(c12057816.xspop)
if Duel.GetCurrentPhase()<=PHASE_STANDBY then
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
else
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
end
Duel.RegisterEffect(e1,tp)
end
function c12057816.xspfilter(c,e,tp)
return c:IsLevelBelow(8) and c:IsType(TYPE_FUSION) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)
end
function c12057816.xspcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c12057816.xspfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
end
function c12057816.xspop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,12057816)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c12057816.xspfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
g:GetFirst():CompleteProcedure()
end
end
--教导的慵懒美人
function c12057817.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--tg or rm
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057817,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,12057817)
e1:SetTarget(c12057817.tortg)
e1:SetOperation(c12057817.torop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057817,2))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,22057817)
e2:SetCondition(c12057817.thcon)
e2:SetTarget(c12057817.thtg)
e2:SetOperation(c12057817.thop)
c:RegisterEffect(e2)
end
function c12057817.torfil(c)
return c:IsSetCard(0x145,0x16b) and (c:IsAbleToGrave() or c:IsAbleToRemove())
end
function c12057817.tortg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057817.torfil,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function c12057817.torop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057817.torfil,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil)
if g:GetCount()<=0 then return end
local tc=g:Select(tp,1,1,nil):GetFirst()
local op=3
local b1=tc:IsAbleToGrave()
local b2=tc:IsAbleToRemove()
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(12057817,0),aux.Stringid(12057817,1))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(12057817,0))
elseif b2 then
op=Duel.SelectOption(tp,aux.Stringid(12057817,1))+1
end
if op==0 then
Duel.SendtoGrave(tc,REASON_EFFECT)
elseif op==1 then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function c12057817.thcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function c12057817.thfil(c)
return c:IsAbleToHand() and c:IsSetCard(0x145,0x16b)
end
function c12057817.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057817.thfil,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c12057817.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057817.thfil,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
--教导的狱天神
function c12057818.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_WYRM+RACE_SPELLCASTER),aux.NonTuner(Card.IsRace,RACE_WYRM+RACE_SPELLCASTER),1)
c:EnableReviveLimit()
--attribute
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_CANNOT_DISABLE)
e0:SetCode(EFFECT_ADD_RACE)
e0:SetValue(RACE_WYRM)
e0:SetRange(0xff)
c:RegisterEffect(e0)
--remove and damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057818,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,12057818)
e1:SetTarget(c12057818.radtg)
e1:SetOperation(c12057818.radop)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057818,1))
e2:SetCategory(CATEGORY_TOEXTRA+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,22057818)
e2:SetCondition(c12057818.spcon)
e2:SetTarget(c12057818.sptg)
e2:SetOperation(c12057818.spop)
c:RegisterEffect(e2)
end
function c12057818.radtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,1-tp,1200)
end
function c12057818.radop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
if g:GetCount()<=0 then return end
local sg=g:Select(tp,1,3,nil)
if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,1200,REASON_EFFECT)
end
end
function c12057818.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER)
end
function c12057818.spfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x145,0x16b)
end
function c12057818.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() and Duel.IsExistingMatchingCard(c12057818.spfil,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) and Duel.GetMZoneCount(tp,e:GetHandler())>0 end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c12057818.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,0,REASON_EFFECT)~=0 then
local g=Duel.GetMatchingGroup(c12057818.spfil,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
if g:GetCount()<=0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
local mg=Duel.GetMatchingGroup(Card.IsCanBeSynchroMaterial,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local tc=mg:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_MATERIAL)
e1:SetReset(RESET_CHAIN)
tc:RegisterEffect(e1)
tc=mg:GetNext()
end
local cg=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil,mg)
if cg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(12057818,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=cg:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg)
end
end
end
--教导的猎龙人 塞西
function c12057819.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--attribute
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_CANNOT_DISABLE)
e0:SetCode(EFFECT_ADD_RACE)
e0:SetValue(RACE_WYRM)
e0:SetRange(0xff)
c:RegisterEffect(e0)
--Damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057819,0))
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,12057819)
e1:SetTarget(c12057819.datg)
e1:SetOperation(c12057819.daop)
c:RegisterEffect(e1)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057819,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,22057819)
e2:SetCost(c12057819.tdcost)
e2:SetTarget(c12057819.tdtg)
e2:SetOperation(c12057819.tdop)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12057819,0))
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_REMOVE)
e3:SetCountLimit(1,32057819)
e3:SetTarget(c12057819.dstg)
e3:SetOperation(c12057819.dsop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_TO_GRAVE)
c:RegisterEffect(e4)
end
function c12057819.datg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(600)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,1-tp,600)
end
function c12057819.daop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
local tc=g:Select(tp,1,1,nil):GetFirst()
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e2)
end
end
function c12057819.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
if Duel.Remove(c,0,REASON_COST+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(c)
e1:SetCountLimit(1)
e1:SetOperation(c12057819.retop)
Duel.RegisterEffect(e1,tp)
end
end
function c12057819.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
function c12057819.tdfil(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToDeck()
end
function c12057819.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c12057819.tdfil,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
local g=Duel.SelectTarget(tp,c12057819.tdfil,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c12057819.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
function c12057819.negfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and aux.NegateAnyFilter(c) and c:IsFaceup()
end
function c12057819.dstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c12057819.dsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--cannot trigger
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_TRIGGER)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_SZONE)
e3:SetTarget(c12057819.distg)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function c12057819.distg(e,c)
return c:IsFacedown()
end
--教导的渊龙神
function c12057820.initial_effect(c)
--nontuner
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(0xff)
e0:SetCode(EFFECT_NONTUNER)
e0:SetValue(c12057820.tnval)
c:RegisterEffect(e0)
--equip
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,12057820)
e1:SetTarget(c12057820.eqtg)
e1:SetOperation(c12057820.eqop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e3:SetCountLimit(1,22057820)
e3:SetCost(c12057820.spcost)
e3:SetTarget(c12057820.sptg)
e3:SetOperation(c12057820.spop)
c:RegisterEffect(e3)
end
function c12057820.tnval(e,c)
return e:GetHandler():IsControler(c:GetControler())
end
function c12057820.filter(c)
return c:IsSetCard(0x145,0x16b) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsForbidden()
end
function c12057820.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c12057820.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c12057820.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c12057820.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,c)
local tc=g:GetFirst()
if tc then
if not Duel.Equip(tp,tc,c) then return end
--Add Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c12057820.eqlimit)
tc:RegisterEffect(e1)
end
end
function c12057820.eqlimit(e,c)
return e:GetOwner()==c
end
function c12057820.ctfil(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemoveAsCost()
end
function c12057820.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057820.ctfil,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c12057820.ctfil,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c12057820.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c12057820.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
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(c12057820.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c12057820.splimit(e,c)
return not c:IsType(TYPE_SYNCHRO) and not c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_EXTRA)
end
--教导的魔剑士 维兹
function c12057821.initial_effect(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,12057821)
e1:SetCondition(c12057821.discon)
e1:SetCost(aux.bfgcost)
e1:SetTarget(c12057821.distg)
e1:SetOperation(c12057821.disop)
c:RegisterEffect(e1)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,32057821)
e3:SetCost(c12057821.atkcost)
e3:SetTarget(c12057821.atktg)
e3:SetOperation(c12057821.atkop)
c:RegisterEffect(e3)
end
function c12057821.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and bit.band(re:GetActivateLocation(),LOCATION_HAND+LOCATION_GRAVE)~=0 and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
end
function c12057821.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_ONFIELD,0,1,nil,0x145,0x16b) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c12057821.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
end
function c12057821.ctfil(c)
return c:IsSetCard(0x145,0x16b) and c:IsAbleToRemoveAsCost()
end
function c12057821.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057821.ctfil,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_ONFIELD,0,1,e:GetHandler()) end
local g=Duel.SelectMatchingCard(tp,c12057821.ctfil,tp,LOCATION_HAND+LOCATION_GRAVE+LOCATION_ONFIELD,0,1,1,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c12057821.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c12057821.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e1)
end
end
--访问码语姬
function c12057822.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,99,c12057822.lcheck)
c:EnableReviveLimit()
--cannot disable spsummon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCondition(c12057822.effcon)
c:RegisterEffect(e0)
--atk def
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057822,0))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,12057822)
e1:SetTarget(c12057822.aktg)
e1:SetOperation(c12057822.akop)
c:RegisterEffect(e1)
--extra attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EXTRA_ATTACK)
e3:SetValue(1)
c:RegisterEffect(e3)
--to grave
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(12057822,1))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1,22057822)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetRange(LOCATION_MZONE)
e4:SetCost(c12057822.cost)
e4:SetTarget(c12057822.tgtg)
e4:SetOperation(c12057822.tgop)
c:RegisterEffect(e4)
end
function c12057822.lcheck(g)
return g:IsExists(Card.IsLinkType,1,nil,TYPE_RITUAL+TYPE_SYNCHRO+TYPE_FUSION+TYPE_XYZ+TYPE_PENDULUM)
end
function c12057822.effcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c12057822.aktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,nil,1,1-tp,LOCATION_MZONE)
Duel.SetChainLimit(c12057822.chainlm)
end
function c12057822.chainlm(e,ep,tp)
return tp==ep
end
function c12057822.akop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetValue(0)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e4)
if tc:GetAttack()~=0 or tc:GetDefense()~=0 then
Duel.SendtoDeck(tc,nil,2,REASON_RULE)
end
tc=sg:GetNext()
end
end
end
function c12057822.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
if Duel.Remove(c,0,REASON_COST+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(c)
e1:SetCountLimit(1)
e1:SetOperation(c12057822.retop)
Duel.RegisterEffect(e1,tp)
end
end
function c12057822.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end
function c12057822.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,LOCATION_ONFIELD)
end
function c12057822.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
if g:GetCount()>0 then
local dg=g:Select(tp,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
end
--战源的殿堂
function c12057823.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,12057823)
e1:SetOperation(c12057823.activate)
c:RegisterEffect(e1)
--Remove
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_FZONE)
e2:SetTarget(c12057823.rmtg)
e2:SetOperation(c12057823.rmop)
c:RegisterEffect(e2)
--fusion
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_FUSION_SUMMON+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_REMOVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,22057823)
e3:SetCost(c12057823.fucost)
e3:SetTarget(c12057823.futg)
e3:SetOperation(c12057823.fuop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_TO_GRAVE)
c:RegisterEffect(e4)
end
function c12057823.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and ((c:IsLocation(LOCATION_REMOVED+LOCATION_GRAVE) and c:IsRace(RACE_WARRIOR)) or (c:IsLocation(LOCATION_DECK) and c:IsRace(RACE_WARRIOR) and c:IsType(TYPE_NORMAL)))
end
function c12057823.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c12057823.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED+LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(12057823,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 c12057823.txfil(c,e,tp)
return c:IsControler(tp) and c:IsType(TYPE_SYNCHRO+TYPE_XYZ+TYPE_FUSION)
end
function c12057823.gck(g,e,tp)
return g:IsExists(c12057823.txfil,1,nil,e,tp)
end
function c12057823.xxfil(c,e,tp)
return c:IsCanBeEffectTarget(e) and c:IsAbleToRemove()
end
function c12057823.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c12057823.xxfil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,e,tp)
if chk==0 then return g:CheckSubGroup(c12057823.gck,2,2,e,tp) end
local dg=g:SelectSubGroup(tp,c12057823.gck,false,2,2,e,tp)
Duel.HintSelection(dg)
Duel.SetTargetCard(dg)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,dg,2,0,0)
end
function c12057823.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local dg=g:Filter(Card.IsRelateToEffect,nil,e)
if dg:GetCount()>0 then
Duel.Remove(dg,POS_FACEUP,REASON_EFFECT)
end
end
function c12057823.fucost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeckAsCost,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeckAsCost,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function c12057823.filter0(c)
return (c:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck()
end
function c12057823.filter1(c,e)
return (c:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND) or c:IsFaceup()) and c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function c12057823.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false,POS_FACEUP_DEFENSE) and c:CheckFusionMaterial(m,nil,chkf)
end
function c12057823.futg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(c12057823.filter0,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND+LOCATION_REMOVED,0,nil)
local res=Duel.IsExistingMatchingCard(c12057823.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c12057823.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND+LOCATION_REMOVED)
end
function c12057823.fuop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c12057823.filter1),tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND+LOCATION_REMOVED,0,nil,e)
local sg1=Duel.GetMatchingGroup(c12057823.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c12057823.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat=Duel.SelectFusionMaterial(tp,tc,mg,nil,chkf)
tc:SetMaterial(mat)
if mat:IsExists(Card.IsFacedown,1,nil) then
local cg=mat:Filter(Card.IsFacedown,nil)
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(mat,nil,2,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
end
--基因窃取兽
function c12057824.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--race and lv
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057824,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,12057824)
e1:SetTarget(c12057824.ratg)
e1:SetOperation(c12057824.raop)
c:RegisterEffect(e1)
--code
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057824,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2:SetCountLimit(1,22057824)
e2:SetTarget(c12057824.cdtg)
e2:SetOperation(c12057824.cdop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(12057824,ACTIVITY_SPSUMMON,c12057824.counterfilter)
end
function c12057824.counterfilter(c)
return not c:IsLocation(LOCATION_EXTRA)
end
function c12057824.ratg(e,tp,eg,ep,ev,re,r,rp,chk,ckhc)
if chk==0 then return true end
local lv=Duel.AnnounceLevel(tp)
local rc=Duel.AnnounceRace(tp,1,RACE_ALL)
e:SetLabel(lv,rc)
end
function c12057824.raop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lv,rc=e:GetLabel()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetValue(rc)
c:RegisterEffect(e2)
end
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:SetLabel(c12057824.getsummoncount(tp))
e2:SetTarget(c12057824.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c12057824.getsummoncount(tp)
return Duel.GetCustomActivityCount(12057824,tp,ACTIVITY_SPSUMMON)
end
function c12057824.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c12057824.getsummoncount(sump)>e:GetLabel() and c:IsLocation(LOCATION_EXTRA)
end
function c12057824.cdtg(e,tp,eg,ep,ev,re,r,rp,chk,ckhc)
if chk==0 then return true end
local code=Duel.AnnounceCard(tp)
e:SetLabel(code)
end
function c12057824.cdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local code=e:GetLabel()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e1:SetValue(code)
e1:SetReset(RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
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(c12057824.xsplimit1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,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(c12057824.xsplimit2)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,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:SetLabel(c12057824.getsummoncount(tp))
e2:SetTarget(c12057824.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetTargetRange(1,0)
e4:SetValue(c12057824.actlimit)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end
function c12057824.xsplimit1(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_GRAVE+LOCATION_DECK)
end
function c12057824.xsplimit2(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_FUSION) and not c:IsType(TYPE_SYNCHRO)
end
function c12057824.actlimit(e,re,tp)
return re:GetHandler():IsLocation(LOCATION_GRAVE)
end
--龙源机兵 红莲零
function c12057825.initial_effect(c)
--synchro summon
aux.AddSynchroMixProcedure(c,aux.Tuner(nil),aux.Tuner(nil),nil,aux.NonTuner(nil),2,99)
c:EnableReviveLimit()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e1:SetValue(1)
c:RegisterEffect(e1)
--cannot release
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_UNRELEASABLE_SUM)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(12057825,1))
e4:SetCategory(CATEGORY_NEGATE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_CANNOT_INACTIVATE)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,12057825)
e4:SetCondition(c12057825.discon)
e4:SetTarget(c12057825.distg)
e4:SetOperation(c12057825.disop)
c:RegisterEffect(e4)
--
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(12057825,1))
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e5:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,22057825)
e5:SetCondition(c12057825.atkcon2)
e5:SetCost(c12057825.atkcost2)
e5:SetOperation(c12057825.atkop2)
c:RegisterEffect(e5)
end
function c12057825.discon(e,tp,eg,ep,ev,re,r,rp)
return (bit.band(re:GetCategory(),CATEGORY_REMOVE)~=0 or bit.band(re:GetCategory(),CATEGORY_TOGRAVE)~=0) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function c12057825.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function c12057825.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(12057825,0)) then
local dg=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,1,1,nil)
Duel.SendtoHand(dg,nil,REASON_EFFECT)
end
end
function c12057825.atkcost2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(12057825)==0 end
c:RegisterFlagEffect(12057825,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end
function c12057825.atkcon2(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return d and a:GetControler()~=d:GetControler()
end
function c12057825.atkop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
local sc,tc=Duel.GetBattleMonster(tp)
if a:IsFaceup() and a:IsRelateToBattle() and d:IsFaceup() and d:IsRelateToBattle() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetValue(0)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e4)
end
end
--离子炮龙-风型
function c12057826.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_END_PHASE+TIMINGS_CHECK_MONSTER)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,12057826)
e3:SetTarget(c12057826.sptg)
e3:SetOperation(c12057826.spop)
c:RegisterEffect(e3)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12057826,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_REMOVE)
e3:SetCountLimit(1,22057826)
e3:SetTarget(c12057826.regtg)
e3:SetOperation(c12057826.regop)
c:RegisterEffect(e3)
--cannot release
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e4:SetRange(0xff)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e5:SetValue(c12057826.fuslimit)
c:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e6)
local e7=e4:Clone()
e7:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e7)
--pierce
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetCode(EFFECT_PIERCE)
e8:SetValue(DOUBLE_DAMAGE)
c:RegisterEffect(e8)
if not c12057826.global_check then
c12057826.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c12057826.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c12057826.gckfil(c)
return c:IsSummonLocation(LOCATION_EXTRA)
end
function c12057826.checkop(e,tp,eg,ep,ev,re,r,rp)
local dg=eg:Filter(c12057826.gckfil,nil)
local tc=dg:GetFirst()
while tc do
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),12057826,RESET_PHASE+PHASE_END,0,1)
tc=dg:GetNext()
end
end
function c12057826.fuslimit(e,c,sumtype)
return sumtype==SUMMON_TYPE_FUSION
end
function c12057826.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsCanChangePosition()
end
function c12057826.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0,nil)<Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE,nil) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFlagEffect(tp,12057826)<=1 end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CHANGE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(0,1)
e3:SetValue(0)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
local e4=e3:Clone()
e4:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
local g=Duel.GetMatchingGroup(c12057826.filter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
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:SetLabel(c12057826.getsummoncount(tp))
e2:SetTarget(c12057826.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c12057826.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local g=Duel.GetMatchingGroup(c12057826.filter,tp,0,LOCATION_MZONE,nil)
Duel.ChangePosition(g,POS_FACEUP_DEFENSE)
end
end
function c12057826.regtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetFlagEffect(tp,12057826)<=1 end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CHANGE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(0,1)
e3:SetValue(0)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
local e4=e3:Clone()
e4:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,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:SetLabel(c12057826.getsummoncount(tp))
e2:SetTarget(c12057826.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c12057826.getsummoncount(tp)
return Duel.GetCustomActivityCount(12057826,tp,ACTIVITY_SPSUMMON)
end
function c12057826.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c12057826.getsummoncount(sump)>e:GetLabel() and c:IsLocation(LOCATION_EXTRA)
end
function c12057826.regop(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_BATTLE_START)
e1:SetRange(LOCATION_REMOVED)
e1:SetCountLimit(1)
e1:SetCondition(c12057826.xspcon)
e1:SetOperation(c12057826.xspop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
c:RegisterEffect(e1)
end
function c12057826.xspcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetTurnPlayer()~=tp and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c12057826.xspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_CARD,0,12057826)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
local g=Duel.GetMatchingGroup(c12057826.filter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.ChangePosition(g,POS_FACEUP_DEFENSE)
end
end
--龙源的弃徒
function c12057827.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c12057827.ffilter,2,true)
--attribute
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_CANNOT_DISABLE)
e0:SetCode(EFFECT_ADD_RACE)
e0:SetValue(RACE_DRAGON)
e0:SetRange(0xff)
c:RegisterEffect(e0)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_CANNOT_DISABLE)
e0:SetCode(EFFECT_ADD_RACE)
e0:SetValue(RACE_WARRIOR)
e0:SetRange(0xff)
c:RegisterEffect(e0)
--rmpos
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057827,3))
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,12057827)
e1:SetCode(EVENT_CHANGE_POS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(c12057827.rpcon)
e1:SetTarget(c12057827.rptg)
e1:SetOperation(c12057827.rpop)
c:RegisterEffect(e1)
--flip
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057827,4))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,22057827)
e2:SetTarget(c12057827.sptg)
e2:SetOperation(c12057827.spop)
c:RegisterEffect(e2)
end
function c12057827.ffilter(c)
return c:IsPosition(POS_FACEDOWN_DEFENSE) and c:IsOnField()
end
function c12057827.cfilter(c)
local np=c:GetPosition()
local pp=c:GetPreviousPosition()
return ((np<3 and pp>3) or (pp<3 and np>3))
end
function c12057827.rpcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c12057827.cfilter,1,nil)
end
function c12057827.rmfil(c)
return c:IsAbleToRemove() and Duel.IsExistingMatchingCard(Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function c12057827.rptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057827.rmfil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,LOCATION_MZONE)
end
function c12057827.rpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057827.rmfil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,e,tp)
if g:GetCount()<=0 then return end
local tc=g:Select(tp,1,1,nil):GetFirst()
if Duel.Remove(tc,0,REASON_EFFECT) then
local sc=Duel.SelectMatchingCard(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst()
local op=3
local ad=0
local dd=0
if sc:IsPosition(POS_FACEUP_DEFENSE+POS_FACEDOWN_ATTACK) then
op=Duel.SelectOption(tp,aux.Stringid(12057827,1),aux.Stringid(12057827,2))
if op==0 then
ad=POS_FACEDOWN_DEFENSE
du=POS_FACEDOWN_DEFENSE
else
ad=POS_FACEUP_ATTACK
du=POS_FACEUP_ATTACK
end
end
if op==3 then
ad=POS_FACEDOWN_ATTACK
du=POS_FACEUP_DEFENSE
end
Duel.ChangePosition(sc,POS_FACEDOWN_DEFENSE,ad,du,POS_FACEUP_ATTACK)
end
end
function c12057827.spfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c12057827.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057827.spfil,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c12057827.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057827.spfil,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,nil,e,tp)
if g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
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)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(2)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3,true)
local lv=Duel.AnnounceLevel(tp,2,3)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(lv)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
end
end
--惊诧魔术
function c12057828.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,12057828)
e1:SetTarget(c12057828.actg)
e1:SetOperation(c12057828.acop)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057828,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,22057828)
e2:SetCondition(c12057828.hspcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c12057828.sptg)
e2:SetOperation(c12057828.spop)
c:RegisterEffect(e2)
--act in hand
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e3:SetCondition(c12057828.handcon)
c:RegisterEffect(e3)
end
function c12057828.xckfil(c)
return c:IsFaceup() and c:IsDefenseAbove(3000)
end
function c12057828.handcon(e)
return Duel.IsExistingMatchingCard(c12057828.xckfil,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c12057828.filter1(c,e)
return not c:IsImmuneToEffect(e) and c:IsAbleToDeck()
end
function c12057828.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c12057828.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(Card.IsCanChangePosition,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.SelectTarget(tp,Card.IsCanChangePosition,tp,LOCATION_MZONE,0,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,2,0,0)
end
function c12057828.acop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local dg=g:Filter(Card.IsRelateToEffect,nil,e)
if dg:GetCount()<=0 then return end
local tc=dg:GetFirst()
while tc do
local op=3
local ad=0
local dd=0
if tc:IsPosition(POS_FACEUP_DEFENSE+POS_FACEDOWN_ATTACK) then
op=Duel.SelectOption(tp,aux.Stringid(12057828,1),aux.Stringid(12057828,2))
if op==0 then
ad=POS_FACEDOWN_DEFENSE
du=POS_FACEDOWN_DEFENSE
else
ad=POS_FACEUP_ATTACK
du=POS_FACEUP_ATTACK
end
end
if op==3 then
ad=POS_FACEDOWN_ATTACK
du=POS_FACEUP_DEFENSE
end
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE,ad,du,POS_FACEUP_ATTACK)
tc=dg:GetNext()
end
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(c12057828.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(c12057828.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
if not res then return end
if not Duel.SelectYesNo(tp,aux.Stringid(12057828,3)) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(c12057828.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c12057828.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(c12057828.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.SendtoDeck(mat1,nil,2,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP_DEFENSE)
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 c12057828.hspcon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at:GetControler()~=tp and Duel.GetAttackTarget()==nil
end
function c12057828.spfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.IsExistingMatchingCard(c12057828.stfil,tp,LOCATION_GRAVE,0,1,nil,e,tp)
end
function c12057828.stfil(c,e,tp)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and Duel.IsPlayerCanSpecialSummonMonster(tp,c:GetCode(),nil,TYPE_MONSTER+TYPE_NORMAL,0,0,0,0,0,POS_FACEDOWN_DEFENSE) and c:IsCanBeSpecialSummoned(e,0,tp,true,true,POS_FACEDOWN_DEFENSE)
end
function c12057828.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 and Duel.IsExistingMatchingCard(c12057828.spfil,tp,LOCATION_GRAVE,0,1,c,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE)
end
function c12057828.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g1=Duel.GetMatchingGroup(c12057828.spfil,tp,LOCATION_GRAVE,0,nil,e,tp)
local g2=Duel.GetMatchingGroup(c12057828.stfil,tp,LOCATION_GRAVE,0,c,e,tp)
if g1:GetCount()<=0 or g2:GetCount()<=0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local tc1=g1:Select(tp,1,1,nil):GetFirst()
local tc2=g2:Select(tp,1,1,nil):GetFirst()
Duel.SpecialSummon(tc1,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
local e1=Effect.CreateEffect(tc2)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_NORMAL+TYPE_MONSTER)
e1:SetReset(RESET_EVENT+0x47c0000)
tc2:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_REMOVE_RACE)
e2:SetValue(RACE_ALL)
tc2:RegisterEffect(e2,true)
local e3=e1:Clone()
e3:SetCode(EFFECT_REMOVE_ATTRIBUTE)
e3:SetValue(0xff)
tc2:RegisterEffect(e3,true)
local e4=e1:Clone()
e4:SetCode(EFFECT_SET_BASE_ATTACK)
e4:SetValue(0)
tc2:RegisterEffect(e4,true)
local e5=e1:Clone()
e5:SetCode(EFFECT_SET_BASE_DEFENSE)
e5:SetValue(0)
tc2:RegisterEffect(e5,true)
tc2:SetStatus(STATUS_NO_LEVEL,true)
Duel.SpecialSummon(tc2,0,tp,tp,true,true,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,Group.FromCards(tc1,tc2))
local ng=Group.FromCards(tc1,tc2)
Duel.ShuffleSetCard(ng)
end
--离子炮狼
function c12057829.initial_effect(c)
--nontuner
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(0xff)
e0:SetCode(EFFECT_NONTUNER)
e0:SetValue(c12057829.tnval)
c:RegisterEffect(e0)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,12057829)
e1:SetTarget(c12057829.xthtg)
e1:SetOperation(c12057829.xthop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057829,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,22057829)
e2:SetCost(c12057829.thcost)
e2:SetTarget(c12057829.thtg)
e2:SetOperation(c12057829.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c12057829.tnval(e,c)
return e:GetHandler():IsControler(c:GetControler())
end
function c12057829.ctfil(c)
return c:IsAbleToRemoveAsCost()
end
function c12057829.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057829.ctfil,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c12057829.ctfil,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c12057829.thfilter(c)
return (c:IsAttack(2800) or c:IsDefense(2800)) and c:IsAbleToHand()
end
function c12057829.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057829.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c12057829.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c12057829.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 c12057829.xthfil(c)
return c:IsAttackBelow(2000) and c:IsAbleToHand()
end
function c12057829.xthtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rp==1-tp and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1 and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsExistingMatchingCard(c12057829.xthfil,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,0,LOCATION_MZONE)
end
function c12057829.xthop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057829.xthfil,tp,0,LOCATION_MZONE,nil)
if c:IsRelateToEffect(e) and g:GetCount()>0 then
local dg=g:Select(tp,1,1,nil)
dg:AddCard(c)
Duel.SendtoHand(dg,nil,REASON_EFFECT)
end
end
--战源的龙型杀手
function c12057830.initial_effect(c)
--nontuner
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(0xff)
e0:SetCode(EFFECT_NONTUNER)
e0:SetValue(c12057830.tnval)
c:RegisterEffect(e0)
--pos
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,12057830)
e1:SetTarget(c12057830.pstg)
e1:SetOperation(c12057830.psop)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057829,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES+CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,22057829)
e2:SetTarget(c12057830.sptg)
e2:SetOperation(c12057830.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c12057830.tnval(e,c)
return e:GetHandler():IsControler(c:GetControler())
end
function c12057830.pstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return e:GetHandler():IsAbleToDeck() and Duel.IsExistingTarget(Card.IsCanChangePosition,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.SelectTarget(tp,Card.IsCanChangePosition,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c12057830.psop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end
function c12057830.spfilter(c,e,tp)
return c:IsSetCard(0xac2,0x3ac1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and not c:IsCode(12057830)
end
function c12057830.cpfil(c)
return c:IsCanChangePosition() and not c:IsPosition(POS_FACEDOWN_DEFENSE)
end
function c12057830.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057830.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c12057830.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.SelectMatchingCard(tp,c12057830.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,g)
local g1=Duel.GetMatchingGroup(c12057830.cpfil,tp,LOCATION_MZONE,0,nil)
if g1:GetCount()<=0 then return end
Duel.BreakEffect()
local tc=g1:Select(tp,1,1,nil):GetFirst()
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
--战源的人型杀手
function c12057831.initial_effect(c)
--nontuner
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(0xff)
e0:SetCode(EFFECT_NONTUNER)
e0:SetValue(c12057831.tnval)
c:RegisterEffect(e0)
--sp and pos
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,12057831)
e1:SetCost(aux.bfgcost)
e1:SetTarget(c12057831.sptg)
e1:SetOperation(c12057831.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_REMOVE)
c:RegisterEffect(e2)
--pos
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_POSITION+CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1,22057831)
e3:SetTarget(c12057831.pstg)
e3:SetOperation(c12057831.psop)
c:RegisterEffect(e3)
end
function c12057831.tnval(e,c)
return e:GetHandler():IsControler(c:GetControler())
end
function c12057831.spfilter(c,e,tp)
return c:IsSetCard(0xac2,0x3ac1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and not c:IsCode(12057831)
end
function c12057831.cpfil(c)
return c:IsCanChangePosition()
end
function c12057831.ckfil(c,e,tp)
return c:IsPreviousControler(tp) and c:GetReasonPlayer()==1-tp and c:IsReason(REASON_EFFECT) and c:IsType(TYPE_MONSTER)
end
function c12057831.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c12057831.ckfil,1,nil,e,tp) and Duel.IsExistingMatchingCard(c12057831.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,tp,LOCATION_MZONE)
end
function c12057831.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c12057831.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,g)
local g1=Duel.GetMatchingGroup(c12057831.cpfil,tp,LOCATION_MZONE,0,nil)
if g1:GetCount()<=0 then return end
Duel.BreakEffect()
local sc=g1:Select(tp,1,1,nil):GetFirst()
local op=3
local ad=0
local dd=0
if sc:IsPosition(POS_FACEUP_DEFENSE+POS_FACEDOWN_ATTACK) then
op=Duel.SelectOption(tp,aux.Stringid(12057827,1),aux.Stringid(12057827,2))
if op==0 then
ad=POS_FACEDOWN_DEFENSE
du=POS_FACEDOWN_DEFENSE
else
ad=POS_FACEUP_ATTACK
du=POS_FACEUP_ATTACK
end
end
if op==3 then
ad=POS_FACEDOWN_ATTACK
du=POS_FACEUP_DEFENSE
end
Duel.ChangePosition(sc,POS_FACEDOWN_DEFENSE,ad,du,POS_FACEUP_ATTACK)
end
end
function c12057831.xcpfil(c)
return c:IsCanChangePosition() and c:IsFaceup()
end
function c12057831.pstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return e:GetHandler():IsAbleToDeck() and Duel.IsExistingTarget(c12057831.xcpfil,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.SelectTarget(tp,c12057831.cpfil,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c12057831.psop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
local op=3
local ad=0
local dd=0
if tc:IsPosition(POS_FACEUP_DEFENSE+POS_FACEDOWN_ATTACK) then
op=Duel.SelectOption(tp,aux.Stringid(12057827,1),aux.Stringid(12057827,2))
if op==0 then
ad=POS_FACEDOWN_DEFENSE
du=POS_FACEDOWN_DEFENSE
else
ad=POS_FACEUP_ATTACK
du=POS_FACEUP_ATTACK
end
end
if op==3 then
ad=POS_FACEDOWN_ATTACK
du=POS_FACEUP_DEFENSE
end
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE,ad,du,POS_FACEUP_ATTACK)
end
end
--战源的羽衣
function c12057832.initial_effect(c)
--nontuner
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(0xff)
e0:SetCode(EFFECT_NONTUNER)
e0:SetValue(c12057832.tnval)
c:RegisterEffect(e0)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_CANNOT_DISABLE)
e0:SetCode(EFFECT_ADD_RACE)
e0:SetValue(RACE_WARRIOR)
e0:SetRange(0xff)
c:RegisterEffect(e0)
--Equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057832,1))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,12057832)
e1:SetCondition(c12057832.eqcon)
e1:SetTarget(c12057832.eqtg)
e1:SetOperation(c12057832.eqop)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057832,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_REMOVED)
e2:SetCountLimit(1,22057832)
e2:SetTarget(c12057832.sptg)
e2:SetOperation(c12057832.spop)
c:RegisterEffect(e2)
end
function c12057832.tnval(e,c)
return e:GetHandler():IsControler(c:GetControler())
end
function c12057832.eqcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end
function c12057832.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(Card.IsRace,tp,LOCATION_MZONE,0,1,nil,RACE_DRAGON+RACE_WARRIOR) end
local g=Duel.SelectTarget(tp,Card.IsRace,tp,LOCATION_MZONE,0,1,1,nil,RACE_DRAGON+RACE_WARRIOR)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c12057832.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
for i=1,ev do
local te,tgp=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
if tgp~=tp then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c12057832.efilter)
e1:SetLabelObject(te)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
e1:SetOwnerPlayer(tp)
tc:RegisterEffect(e1)
end
end
if c:IsRelateToEffect(e) and Duel.Equip(tp,c,tc) then
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetLabelObject(tc)
e1:SetValue(c12057832.eqlimit)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(300)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
end
end
end
function c12057832.efilter(e,re)
return re==e:GetLabelObject()
end
function c12057832.eqlimit(e,c)
return e:GetLabelObject()==c
end
function c12057832.ckfil(c,e,tp)
return c:GetReasonPlayer()==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp)
end
function c12057832.spfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsRace(RACE_DRAGON+RACE_WARRIOR) and c:IsLevelBelow(4)
end
function c12057832.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c12057832.ckfil,1,nil,e,tp) and Duel.IsExistingMatchingCard(c12057832.spfil,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c12057832.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057832.spfil,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
if c:IsRelateToEffect(e) and g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 then
local sg=g:Select(tp,1,1,nil)
sg:AddCard(c)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
local tc=sg:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_REMOVE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,1)
e1:SetTarget(c12057832.rmlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12057832,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e3)
tc=sg:GetNext()
end
end
end
function c12057832.rmlimit(e,c,tp,r)
return c==e:GetHandler() and r==REASON_EFFECT
end
--龙源的尸骸怨念
function c12057840.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c12057840.ffilter,2,true)
--attribute
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_CANNOT_DISABLE)
e0:SetCode(EFFECT_ADD_RACE)
e0:SetValue(RACE_DRAGON)
e0:SetRange(0xff)
c:RegisterEffect(e0)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_CANNOT_DISABLE)
e0:SetCode(EFFECT_ADD_RACE)
e0:SetValue(RACE_WARRIOR)
e0:SetRange(0xff)
c:RegisterEffect(e0)
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c12057840.atkval)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetCondition(c12057840.immcon)
e2:SetValue(c12057840.efilter)
c:RegisterEffect(e2)
--SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12057840,3))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,12057840)
e3:SetTarget(c12057840.sptg)
e3:SetOperation(c12057840.spop)
c:RegisterEffect(e3)
--Set
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(12057840,1))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_BATTLE)
e4:SetCountLimit(1,22057840)
e4:SetRange(LOCATION_MZONE)
e4:SetTarget(c12057840.sttg)
e4:SetOperation(c12057840.stop)
c:RegisterEffect(e4)
end
function c12057840.ffilter(c)
return c:IsPosition(POS_FACEDOWN_DEFENSE) and c:IsOnField()
end
function c12057840.atkval(e,c)
local tp=e:GetHandlerPlayer()
return Duel.GetMatchingGroupCount(Card.IsFacedown,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)*800
end
function c12057840.immcon(e)
local tp=e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(Card.IsPosition,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,POS_FACEDOWN_DEFENSE)
end
function c12057840.efilter(e,te)
local tc=te:GetHandler()
return tc:IsAttackBelow(3000) and tc~=e:GetHandler()
end
function c12057840.spfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function c12057840.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
local b2=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)<Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if chk==0 then return (b1 or b2) and Duel.IsExistingMatchingCard(c12057840.spfil,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c12057840.cpfil(c)
return c:IsCanChangePosition() and not c:IsPosition(POS_FACEDOWN_DEFENSE)
end
function c12057840.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057840.spfil,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,nil,e,tp)
if g:GetCount()>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,sg)
if Duel.IsExistingMatchingCard(c12057840.cpfil,tp,0,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(12057840,0)) then
local tc=Duel.SelectMatchingCard(tp,c12057840.cpfil,tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
end
function c12057840.stfil(c)
return c:IsSSetable(true) and Duel.GetLocationCount(c:GetOwner(),LOCATION_SZONE)>0
end
function c12057840.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetTurnPlayer()==tp and Duel.IsExistingMatchingCard(c12057840.stfil,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,1,nil) end
end
function c12057840.stop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057840.stfil,tp,LOCATION_GRAVE+LOCATION_REMOVED,LOCATION_GRAVE+LOCATION_REMOVED,nil)
if g:GetCount()>0 then
local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.SSet(tp,tc,tc:GetOwner())
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12057840,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_SZONE)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_REMOVE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(1,1)
e3:SetTarget(c12057840.rmlimit)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EFFECT_UNRELEASABLE_SUM)
e4:SetValue(1)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UNRELEASABLE_NONSUM)
tc:RegisterEffect(e5)
end
end
function c12057840.rmlimit(e,c,tp,r)
return c==e:GetHandler() and r==REASON_EFFECT
end
--龙源的离子盾
function c12057841.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,12057841)
e1:SetCost(c12057841.accost)
e1:SetTarget(c12057841.actg)
e1:SetOperation(c12057841.acop)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,22057841)
e2:SetCondition(aux.exccon)
e2:SetTarget(c12057841.reptg)
e2:SetValue(c12057841.repval)
e2:SetOperation(c12057841.repop)
c:RegisterEffect(e2)
if not c12057841.global_check then
c12057841.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SSET)
ge1:SetOperation(c12057841.checkop)
Duel.RegisterEffect(ge1,0)
end
Duel.AddCustomActivityCounter(12057841,ACTIVITY_SPSUMMON,c12057841.counterfilter)
end
function c12057841.counterfilter(c)
return not c:IsLocation(LOCATION_EXTRA)
end
function c12057841.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(rp,12057841,RESET_PHASE+PHASE_END,0,1)
end
function c12057841.accost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(12057841,tp,ACTIVITY_SPSUMMON)==0 and Duel.GetFlagEffect(tp,12057841)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c12057841.splimit)
Duel.RegisterEffect(e1,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SSET)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
end
function c12057841.splimit(e,c)
return c:IsLocation(LOCATION_EXTRA)
end
function c12057841.srfil(c,e,tp)
return (c:IsAbleToGrave() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0)) and ((c:IsLevelBelow(4) and c:IsRace(RACE_DRAGON)) or (c:IsDefenseBelow(1900) and c:IsRace(RACE_MACHINE)))
end
function c12057841.actg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12057841.srfil,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c12057841.acop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12057841.srfil,tp,LOCATION_HAND+LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>0 then
local tc=g:Select(tp,1,1,nil):GetFirst()
local op=3
local b1=tc:IsAbleToGrave()
local b2=tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(12057841,0),aux.Stringid(12057841,1))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(12057841,0))
elseif b2 then
op=Duel.SelectOption(tp,aux.Stringid(12057841,1))+1
end
if op==0 then
Duel.SendtoGrave(tc,REASON_EFFECT)
elseif op==1 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
end
function c12057841.repfilter(c,tp)
return c:IsOnField() and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function c12057841.rmfil(c)
return (c:IsAttack(2800) or c:IsDefense(2800)) and c:IsAbleToRemove()
end
function c12057841.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() and eg:IsExists(c12057841.repfilter,1,nil,tp) and Duel.IsExistingMatchingCard(c12057841.rmfil,tp,LOCATION_DECK,0,1,nil) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c12057841.repval(e,c)
return c12057841.repfilter(c,e:GetHandlerPlayer())
end
function c12057841.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_EFFECT)
local g=Duel.SelectMatchingCard(tp,c12057841.rmfil,tp,LOCATION_DECK,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
--战源者 玫瑰少女
function c35300145.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON),aux.NonTuner(Card.IsRace,RACE_WARRIOR),1)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(35300145,0))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,35300145)
e1:SetTarget(c35300145.target)
e1:SetOperation(c35300145.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(35300145,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_NO_TURN_RESET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c35300145.discon)
e2:SetTarget(c35300145.distg)
e2:SetOperation(c35300145.disop)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(35300145,2))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,15300145)
e2:SetCondition(c35300145.discon2)
e2:SetTarget(c35300145.distg2)
e2:SetOperation(c35300145.disop2)
c:RegisterEffect(e2)
end
function c35300145.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToDeck() and c:IsFaceup()
end
function c35300145.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and c35300145.filter(chkc) end
if chk==0 then return Duel.IsPlayerCanDraw(tp,1)
and Duel.IsExistingTarget(c35300145.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c35300145.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c35300145.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,2,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)
if ct==1 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function c35300145.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function c35300145.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
end
function c35300145.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
function c35300145.discon2(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and rp==1-tp
end
function c35300145.distg2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanTurnSet() end
Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,0,0)
end
function c35300145.disop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)
end
end
This diff is collapsed.
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