Commit 198942d4 authored by Nemo Ma's avatar Nemo Ma

fix

parent 6b3513c0
......@@ -53,9 +53,9 @@ function c114824019.sumop(e,tp,eg,ep,ev,re,r,rp)
if not c:IsRelateToEffect(e) then return end
local s1=c:IsSummonable(false,nil)
local s2=c:IsMSetable(false,nil)
if (s1 and s2 and Duel.SelectPosition(tp,c,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or not s2 then
if (s1 and s2 and Duel.SelectPosition(tp,c,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or (s1 and not s2) then
Duel.Summon(tp,c,false,nil)
else
elseif s2 then
Duel.MSet(tp,c,false,nil)
end
end
\ No newline at end of file
--方舟骑士-临光
--方舟骑士-蜜莓
c115023.named_with_Arknight=1
function c115023.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_STANDBY_PHASE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,115023)
e1:SetTarget(c115023.sptg1)
e1:SetOperation(c115023.spop1)
c:RegisterEffect(e1)
c115023.summon_effect=e1
--SpecialSummon
e1:SetCost(c115023.idcost)
e1:SetTarget(c115023.idtg)
e1:SetOperation(c115023.idop)
c:RegisterEffect(e1)
--XDestroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_HAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,115024)
e2:SetCondition(c115023.spcon)
e2:SetTarget(c115023.sptg)
e2:SetOperation(c115023.spop)
c:RegisterEffect(e2)
end
function c115023.cfilter2(c,tp)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD)
and c:GetPreviousControler()==tp and c:IsPreviousPosition(POS_FACEUP)
end
function c115023.spcon(e,tp,eg,ep,ev,re,r,rp)
if eg:IsContains(e:GetHandler()) then return false end
return eg:IsExists(c115023.cfilter2,1,nil,tp)
end
function c115023.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,800)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,215023)
e2:SetTarget(c115023.xdtg)
e2:SetOperation(c115023.xdop)
c:RegisterEffect(e2)
--SpecialSummon P
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,315023)
e3:SetCondition(c115023.pspcon)
e3:SetTarget(c115023.psptg)
e3:SetOperation(c115023.pspop)
c:RegisterEffect(e3)
end
function c115023.spop(e,tp,eg,ep,ev,re,r,rp)
function c115023.idcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) then
Duel.BreakEffect()
Duel.Recover(tp,800,REASON_EFFECT)
end
end
function c115023.spfil(c,e,tp)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_PENDULUM) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c115023.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c115023.spfil,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c115023.spop1(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c115023.idfil(c)
return c:IsFaceup() and (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
end
function c115023.idtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c115023.idfil,tp,LOCATION_MZONE,0,1,nil) end
end
function c115023.idop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c115023.spfil,tp,LOCATION_DECK,0,nil,e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or g:GetCount()<=0 then return end
local sg=g:Select(tp,1,1,nil)
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) then
--
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_TRIGGER)
e2:SetProperty(EFFECT_FLAG_IGNORE_RANGE)
e2:SetTarget(c115023.actfilter)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
local g=Duel.GetMatchingGroup(c115023.idfil,tp,LOCATION_MZONE,0,nil)
if g:GetCount()>0 then
local sg=g:Select(tp,1,2,nil)
local tc=sg:GetFirst()
while tc do
--immune
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(115023,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(c115023.efilter)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
end
function c115023.efilter(e,te)
if te:GetHandlerPlayer()==e:GetHandlerPlayer() or not te:IsActivated() then return false end
if not te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return true end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
return not g or not g:IsContains(e:GetHandler())
end
function c115023.actfilter(e,c)
return c:GetControler()==e:GetHandlerPlayer() and not (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_MONSTER)
end
\ No newline at end of file
function c115023.xdtg(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 and not e:GetHandler():IsLocation(LOCATION_EXTRA)) or Duel.GetLocationCountFromEx(tp,tp,nil,e:GetHandler())>0) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c115023.xdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and ((Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and not c:IsLocation(LOCATION_EXTRA)) or Duel.GetLocationCountFromEx(tp,tp,nil,e:GetHandler())>0) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c115023.pspcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(nil,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c115023.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
local sc=Duel.GetFirstMatchingCard(nil,tp,LOCATION_PZONE,0,e:GetHandler())
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetTargetCard(sc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sc,1,0,0)
end
function c115023.pspfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
end
function c115023.pspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
if Duel.IsExistingMatchingCard(c115023.pspfil,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(115023,0)) then
local sg=Duel.SelectMatchingCard(tp,c115023.pspfil,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
--方舟骑士-瑕光
--方舟骑士-华法琳
c115025.named_with_Arknight=1
function c115025.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,115025)
e1:SetCost(c115025.thcost)
e1:SetTarget(c115025.thtg)
e1:SetOperation(c115025.thop)
c:RegisterEffect(e1)
--set
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_RECOVER)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,115026)
e3:SetCondition(c115025.stcon)
e3:SetTarget(c115025.sttg)
e3:SetOperation(c115025.stop)
--XDestroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,215025)
e2:SetTarget(c115025.xdtg)
e2:SetOperation(c115025.xdop)
c:RegisterEffect(e2)
--SpecialSummon P
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,315025)
e3:SetCondition(c115025.pspcon)
e3:SetTarget(c115025.psptg)
e3:SetOperation(c115025.pspop)
c:RegisterEffect(e3)
end
function c115025.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
function c115025.pspcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(nil,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c115025.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
local sc=Duel.GetFirstMatchingCard(nil,tp,LOCATION_PZONE,0,e:GetHandler())
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetTargetCard(sc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sc,1,0,0)
end
function c115025.pthfil(c)
return c:IsAbleToHand() and c:IsType(TYPE_PENDULUM) and (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
end
function c115025.pspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
if Duel.IsExistingMatchingCard(c115025.pthfil,tp,LOCATION_DECK,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(115025,0)) then
local sg=Duel.SelectMatchingCard(tp,c115025.pthfil,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
end
function c115025.xdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c115025.xdop(e,tp,eg,ep,ev,re,r,rp,chk)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c115025.atkcon)
e1:SetOperation(c115025.atkop)
if Duel.GetTurnPlayer()==tp then
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
else
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
end
Duel.RegisterEffect(e1,tp)
end
function c115025.thfil(c)
return c:IsAbleToHand() and (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_MONSTER) and c:IsType(TYPE_PENDULUM)
function c115025.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.GetTurnPlayer()==tp and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
end
function c115025.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c115025.thfil,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
end
function c115025.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c115025.thfil,tp,LOCATION_DECK,0,nil)
if g:GetCount()<=0 then return end
local tg=g:Select(tp,1,1,nil)
Duel.SendtoHand(tg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
local tc=tg:GetFirst()
Duel.Recover(tp,tc:GetAttack()/2,REASON_EFFECT)
end
function c115025.stfil(c)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)) and c:IsType(TYPE_PENDULUM) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function c115025.stcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c115025.xgfilter,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c115025.xgfilter(c)
return c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight)
end
function c115025.sttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c115025.xgfilter,tp,LOCATION_PZONE,0,1,nil) and ep==tp and (re:GetHandler():IsSetCard(0x87af) or (_G["c"..re:GetHandler():GetCode()] and _G["c"..re:GetHandler():GetCode()].named_with_Arknight)) and Duel.IsExistingMatchingCard(c115025.stfil,tp,LOCATION_DECK,0,2,nil) end
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,2,tp,LOCATION_PZONE)
end
function c115025.stop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g1=Duel.GetMatchingGroup(c115025.stfil,tp,LOCATION_DECK,0,nil)
if Duel.Destroy(g,REASON_EFFECT) and g1:GetCount()>1 then
local tg=g1:Select(tp,2,2,nil)
local tc=tg:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
tc=tg:GetNext()
function c115025.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,115025)
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(tc:GetAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
end
\ No newline at end of file
end
--不畏苦暗 临光-辉耀使徒
--方舟骑士-临光
c115039.named_with_Arknight=1
function c115039.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSynchroType,TYPE_PENDULUM),aux.NonTuner(Card.IsSynchroType,TYPE_PENDULUM),1,1)
c:EnableReviveLimit()
--P atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_PZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c115039.atktg)
e1:SetValue(800)
--pendulum summon
aux.EnablePendulumAttribute(c)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,115039)
e1:SetTarget(c115039.sptg)
e1:SetOperation(c115039.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,115039)
e3:SetCondition(c115039.spcon)
e3:SetTarget(c115039.sptg)
e3:SetOperation(c115039.spop)
--SpecialSummon P
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,315039)
e3:SetCondition(c115039.pspcon)
e3:SetTarget(c115039.psptg)
e3:SetOperation(c115039.pspop)
c:RegisterEffect(e3)
--code
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_CHANGE_CODE)
e4:SetRange(LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_EXTRA)
e4:SetCondition(c115039.codecon)
e4:SetValue(115023)
c:RegisterEffect(e4)
--negate
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_NEGATE+CATEGORY_TODECK)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_CHAINING)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(c115039.negcon)
e5:SetCost(c115039.negcost)
e5:SetTarget(c115039.negtg)
e5:SetOperation(c115039.negop)
c:RegisterEffect(e5)
--pendulum
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_LEAVE_FIELD)
e6:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e6:SetCondition(c115039.pencon)
e6:SetTarget(c115039.pentg)
e6:SetOperation(c115039.penop)
c:RegisterEffect(e6)
end
function c115039.atktg(e,c)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
end
function c115039.cfilter(c,tp,rp)
return (c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_DESTROY)))
and (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp)
end
function c115039.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c115039.cfilter,1,nil,tp,rp)
end
function c115039.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 c115039.spop(e,tp,eg,ep,ev,re,r,rp)
end
function c115039.spfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsType(TYPE_PENDULUM) and (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
end
function c115039.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSummonLocation(LOCATION_EXTRA) and Duel.IsExistingMatchingCard(c115039.spfil,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c115039.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c115039.spfil,tp,LOCATION_DECK,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_FACEUP)
end
end
function c115039.pspcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(nil,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c115039.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
local sc=Duel.GetFirstMatchingCard(nil,tp,LOCATION_PZONE,0,e:GetHandler())
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetTargetCard(sc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sc,1,0,0)
end
function c115039.pspfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
end
function c115039.pspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c115039.codecon(e)
local c=e:GetHandler()
return c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()
end
function c115039.negfilter(c,tp)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE)) and c:IsControler(tp)
end
function c115039.negcon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not Duel.IsChainNegatable(ev) then return false end
local ex,tg1,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
local tg2=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
local b1=not (re:IsHasCategory(CATEGORY_NEGATE) and Duel.GetChainInfo(ev-1,CHAININFO_TRIGGERING_EFFECT):IsHasType(EFFECT_TYPE_ACTIVATE)) and ex and tg1~=nil and tc+tg1:FilterCount(Card.IsOnField,nil)-tg1:GetCount()>0
local b2=re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and tg2 and tg2:IsExists(c115039.negfilter,1,nil,tp)
return b1 or b2
end
function c115039.tdfilter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsAbleToDeckAsCost()
and (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
end
function c115039.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c115039.tdfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c115039.tdfilter,tp,LOCATION_EXTRA,0,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function c115039.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_TODECK,eg,1,0,0)
end
end
function c115039.negop(e,tp,eg,ep,ev,re,r,rp)
local ec=re:GetHandler()
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
ec:CancelToGrave()
Duel.SendtoDeck(ec,nil,2,REASON_EFFECT)
end
end
function c115039.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c:IsReason(REASON_BATTLE) or (c:GetReasonPlayer()==1-tp and c:IsReason(REASON_EFFECT) and c:IsPreviousControler(tp))) and c:IsPreviousPosition(POS_FACEUP)
end
function c115039.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function c115039.penop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return false end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
if Duel.IsExistingMatchingCard(c115039.pspfil,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(115039,0)) then
local sg=Duel.SelectMatchingCard(tp,c115039.pspfil,tp,LOCATION_HAND,0,1,1,nil,e,tp)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
--耀骑士 临光-烁夜之刃
--方舟骑士-临光·耀骑士
c115043.named_with_Arknight=1
function c115043.initial_effect(c)
aux.EnablePendulumAttribute(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.ritlimit)
--pendulum summon
aux.EnablePendulumAttribute(c)
--change effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c115043.cecon)
e1:SetOperation(c115043.ceop)
c:RegisterEffect(e1)
--immune
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_PZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c115043.imtg)
e2:SetValue(1)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c115043.indcon)
e2:SetValue(c115043.indct)
c:RegisterEffect(e2)
--destroy & search
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,115043)
e3:SetTarget(c115043.thtg)
e3:SetOperation(c115043.thop)
--SpecialSummon P
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,315043)
e3:SetCondition(c115043.pspcon)
e3:SetTarget(c115043.psptg)
e3:SetOperation(c115043.pspop)
c:RegisterEffect(e3)
--change
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DISABLE+CATEGORY_COUNTER)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c115043.chcon)
e4:SetOperation(c115043.chop)
c:RegisterEffect(e4)
--indes
--material check
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_NO_TURN_RESET)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e5:SetCountLimit(4)
e5:SetValue(c115043.valcon)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetCondition(c115043.matcon)
e5:SetOperation(c115043.matop)
c:RegisterEffect(e5)
--material check
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e6:SetCode(EVENT_SPSUMMON_SUCCESS)
e6:SetCondition(c115043.matcon)
e6:SetOperation(c115043.matop)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_MATERIAL_CHECK)
e6:SetValue(c115043.valcheck)
e6:SetLabelObject(e5)
c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_MATERIAL_CHECK)
e7:SetValue(c115043.valcheck)
e7:SetLabelObject(e6)
c:RegisterEffect(e7)
end
function c115043.mat_filter(c)
return not c:IsLevel(11)
end
function c115043.imtg(e,c)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
end
function c115043.thfilter(c)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function c115043.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
function c115043.cecon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if chk==0 then return c:IsDestructable() and Duel.IsExistingMatchingCard(c115043.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c115043.thop(e,tp,eg,ep,ev,re,r,rp)
return c:GetFlagEffect(115043)~=0 and c:GetFlagEffect(215043)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,115046,nil,TYPES_TOKEN_MONSTER,0,2000,6,RACE_WARRIOR,ATTRIBUTE_LIGHT)
end
function c115043.ceop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c115043.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
if c:GetFlagEffect(215043)==0 and Duel.SelectYesNo(tp,aux.Stringid(115043,0)) then
Duel.Hint(HINT_CARD,0,115043)
c:RegisterFlagEffect(215043,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c115043.repop)
end
end
function c115043.indcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(115043)~=0
end
function c115043.indct(e,re,r,rp)
if bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 then
return 4
else return 0 end
end
function c115043.mfilter(c)
return not c:IsOriginalCodeRule(115023,115039)
function c115043.repop(e,tp,eg,ep,ev,re,r,rp)
local token=Duel.CreateToken(tp,115046)
Duel.SpecialSummon(token,0,1-tp,tp,false,false,POS_FACEUP)
end
function c115043.pspcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(nil,tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function c115043.gthfil(c)
return c:IsType(TYPE_PENDULUM) and (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
end
function c115043.pgck(g)
return g:FilterCount(Card.IsCode,nil,115045)==1 and g:FilterCount(c115043.gthfil,nil)==1
end
function c115043.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
local cg=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_DECK,0,nil)
local sc=Duel.GetFirstMatchingCard(nil,tp,LOCATION_PZONE,0,e:GetHandler())
if chk==0 then return cg:CheckSubGroup(c115043.pgck,2,2) end
local dg=Group.FromCards(sc,e:GetHandler())
Duel.SetTargetCard(dg)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,2,0,0)
end
function c115043.pthfil(c)
return c:IsAbleToHand() and c:IsType(TYPE_PENDULUM) and (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
end
function c115043.pspop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local cg=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_DECK,0,nil)
if g:FilterCount(Card.IsRelateToEffect,nil,e)==2 and Duel.Destroy(g,REASON_EFFECT)==2 and cg:CheckSubGroup(c115043.pgck,2,2) then
local sg=cg:SelectSubGroup(tp,c115043.pgck,false,2,2)
Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c115043.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) and e:GetLabel()==1
end
function c115043.mfilter(c)
return c:IsOriginalCodeRule(115039)
end
function c115043.matop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(115043,RESET_EVENT+RESETS_STANDARD,0,1)
e:GetHandler():RegisterFlagEffect(115043,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(115043,1))
end
function c115043.valcheck(e,c)
local g=c:GetMaterial()
if g:GetCount()>0 and not g:IsExists(c115043.mfilter,1,nil) then
if g:GetCount()>0 and g:IsExists(c115043.mfilter,1,nil) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
function c115043.chcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler():GetFlagEffect(115043)>0 and e:GetHandler():GetFlagEffect(115044)<=0
end
function c115043.chop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,115046,0,TYPES_TOKEN_MONSTER,0,2000,11,RACE_WARRIOR,ATTRIBUTE_LIGHT,POS_FACEUP,1-tp) then return end
Duel.HintSelection(Group.FromCards(c))
if Duel.SelectYesNo(tp,aux.Stringid(115043,0)) then
Duel.Hint(HINT_CARD,0,115043)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c115043.repop)
c:RegisterFlagEffect(115044,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function c115043.repop(e,tp,eg,ep,ev,re,r,rp)
local token=Duel.CreateToken(tp,115046)
Duel.SpecialSummon(token,0,1-tp,tp,false,false,POS_FACEUP)
end
function c115043.valcon(e,re,r,rp)
return (bit.band(r,REASON_BATTLE)~=0 or (bit.band(r,REASON_EFFECT)~=0 and rp==1-e:GetHandlerPlayer()))
and e:GetHandler():GetFlagEffect(115043)>0
end
--方舟骑士追逐黎明
c115045.named_with_Arknight=1
function c115045.initial_effect(c)
aux.AddCodeList(c,115043)
--Activate
......@@ -8,40 +9,30 @@ function c115045.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,115045+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c115045.target)
e1:SetOperation(c115045.operation)
e1:SetOperation(c115045.activate)
c:RegisterEffect(e1)
end
function c115045.exfilter0(c)
return (c:IsSetCard(0x87af) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Arknight))
and c:IsType(TYPE_PENDULUM) and c:IsFaceup() and c:IsLevelAbove(1) and c:IsAbleToGrave()
end
function c115045.filter(c)
return c:GetOriginalCode()==115043 and (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
function c115045.filter(c,e,tp)
return c:IsCode(115043) and (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
end
function c115045.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
local sg=nil
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE) then
sg=Duel.GetMatchingGroup(c115045.exfilter0,tp,LOCATION_EXTRA,0,nil)
end
return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,nil,c115045.filter,e,tp,mg,sg,Card.GetLevel,"Greater")
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsType,nil,TYPE_PENDULUM)
local mg2=nil
return Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,nil,c115045.filter,e,tp,mg,mg2,Card.GetLevel,"Greater")
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c115045.operation(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp)
local sg=nil
if Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)<Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE) then
sg=Duel.GetMatchingGroup(c115045.exfilter0,tp,LOCATION_EXTRA,0,nil)
end
function c115045.activate(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsType,nil,TYPE_PENDULUM)
local mg2=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,1,nil,c115045.filter,e,tp,mg,sg,Card.GetLevel,"Greater")
local tg=Duel.SelectMatchingCard(tp,aux.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,1,nil,c115045.filter,e,tp,mg,mg2,Card.GetLevel,"Greater")
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if sg then
mg:Merge(sg)
if mg2 then
mg:Merge(mg2)
end
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
......@@ -54,12 +45,17 @@ function c115045.operation(e,tp,eg,ep,ev,re,r,rp)
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat)
local mat2=mat:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
mat:Sub(mat2)
Duel.ReleaseRitualMaterial(mat)
Duel.SendtoGrave(mat2,REASON_EFFECT+REASON_MATERIAL+REASON_RITUAL)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
......@@ -48,7 +48,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(tp,600,REASON_EFFECT)
Duel.Damage(1-tp,600,REASON_EFFECT)
if e:GetLabel()==1 then
Duel.Draw(tp,2,REASON_EFFECT)
end
......
......@@ -44,9 +44,9 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tc1=nil
if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 and Duel.SelectYesNo(1-tp,aux.Stringid(m,1)) then
Duel.DiscardHand(1-tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD)
tc1=e:GetOperatedGroup()
tc1=Duel.GetOperatedGroup()
hb=false
if not hb and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.SelectYesNo(1-tp,aux.Stringid(m,2)) then
if not hb and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.DiscardHand(tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD)
hb=true
end
......
......@@ -65,6 +65,7 @@ end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
local ec=e:GetHandler():GetEquipTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local ct=tama.cosmicBattleship_getCoreLevel(ec)
local e1=Effect.CreateEffect(c)
......
......@@ -68,7 +68,7 @@ end
--e2
function c33200958.thfilter(c)
return c:IsSetCard(0x632a) and c:IsAbleToHand()
return c:IsSetCard(0x632a) and c:IsAbleToHand() and not c:IsCode(33200958)
end
function c33200958.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33200958.thfilter,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_DECK,0,1,e:GetHandler()) end
......
......@@ -14,18 +14,18 @@ function cm.initial_effect(c)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--destroy
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m+10000000)
e2:SetCost(cm.cost)
e2:SetTarget(cm.target)
e2:SetOperation(cm.activate)
e2:SetCondition(cm.negcon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.negtg)
e2:SetOperation(cm.negop)
c:RegisterEffect(e2)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -47,23 +47,24 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST)
function cm.tfilter(c,tp)
return c:IsControler(tp) and c:IsFaceup() and c:IsAttack(3950)
end
function cm.filter(c)
return c:IsFaceup()
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:IsExists(cm.tfilter,1,nil,tp) and Duel.IsChainDisablable(ev)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Destroy(tc,REASON_EFFECT)
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
......@@ -26,7 +26,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e6)
end
function cm.dscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) and Duel.IsExistingMatchingCard(Card.IsOnField,tp,0,LOCATION_MZONE,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST,nil)
end
function cm.dsop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -67,8 +67,7 @@ function c9910315.negcon(e,tp,eg,ep,ev,re,r,rp)
local g=c:GetEquipGroup()
return g:IsExists(c9910315.cfilter,1,nil) and rp==1-tp
and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_MZONE
and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev) and not Duel.IsChainDisabled(ev)
and c:GetFlagEffect(9910315)==0
and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev) and c:GetFlagEffect(9910315)==0
end
function c9910315.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(9910315,0)) then
......
......@@ -50,8 +50,7 @@ end
function c9910432.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c9910432.cfilter,tp,LOCATION_MZONE,0,1,nil)
and rp==1-tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
and Duel.IsChainDisablable(ev) and not Duel.IsChainDisabled(ev)
and e:GetHandler():GetFlagEffect(9910432)<=0
and Duel.IsChainDisablable(ev) and e:GetHandler():GetFlagEffect(9910432)<=0
end
function c9910432.negop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
......
......@@ -43,7 +43,7 @@ function c9910909.negcon1(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,LOCATION_MZONE)
local sg=g:Filter(Card.IsFaceup,nil)
return sg and sg:GetClassCount(Card.GetRace)>=3 and rp==1-tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
and Duel.IsChainDisablable(ev) and not Duel.IsChainDisabled(ev) and Duel.GetFlagEffect(tp,9910909)==0
and Duel.IsChainDisablable(ev) and Duel.GetFlagEffect(tp,9910909)==0
end
function c9910909.negop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectEffectYesNo(tp,aux.Stringid(9910909,0)) then
......@@ -62,8 +62,7 @@ function c9910909.negcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.IsExistingMatchingCard(c9910909.cfilter,tp,LOCATION_MZONE,0,1,c)
and rp==1-tp and Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)==LOCATION_MZONE
and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev) and not Duel.IsChainDisabled(ev)
and c:GetFlagEffect(9910910)==0
and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev) and c:GetFlagEffect(9910910)==0
end
function c9910909.negop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(9910909,1)) then
......
......@@ -83,7 +83,7 @@ function c9910973.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=g2:Select(tp,1,1,nil):GetFirst()
if tc then loc=loc-tc:GetLocation() end
if tc and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)~=0 then
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.RaiseEvent(e:GetHandler(),EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
g=Duel.GetMatchingGroup(c9910973.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,tp)
if Duel.IsExistingMatchingCard(c9910973.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,g) then
......
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