Commit fbd28cc3 authored by POLYMER's avatar POLYMER

fix

parent 85efaffe
No preview for this file type
......@@ -6,13 +6,13 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x11e0)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(m,0))
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(cm.condition)
e2:SetCost(cm.cost)
c:RegisterEffect(e2)
......
......@@ -222,6 +222,15 @@ function cm.mvop(e,tp,eg,ep,ev,re,r,rp,opt,lab)
fc:ReplaceEffect(m,RESET_EVENT+RESETS_STANDARD,1)
cm.initial_effect=ini
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(1,1)
e1:SetValue(function(e,te) return te:GetHandler()==e:GetHandler() and not te:IsHasProperty(EFFECT_FLAG_COPY) and (te:GetCode()~=EVENT_FREE_CHAIN or te:GetType()&(~0x10a)>0) end)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
fc:RegisterEffect(e1,true)
Duel.HintSelection(Group.FromCards(fc))
Duel.Hint(HINT_CODE,tp,code)
fc:SetHint(CHINT_CARD,code)
......@@ -237,7 +246,7 @@ function cm.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function cm.filter2(c,e,tp,mg,f,chkf)
if not (c:IsType(TYPE_FUSION) and c:IsHasEffect(m) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
if not (c:IsType(TYPE_FUSION) and c:IsHasEffect(m) and c:IsCode(m) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
aux.FCheckAdditional=cm.fcheck
local res=c:CheckFusionMaterial(mg,nil,chkf)
aux.FCheckAdditional=nil
......
......@@ -8,6 +8,7 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
......@@ -56,24 +57,27 @@ function cm.filter2(c,ec,sc)
return cm.filter(c,ec) and cm.fieldid(c)==cm.fieldid(sc) and c:IsAbleToRemoveAsCost() and ((c:GetType()&TYPE_QUICKPLAY>0 and c:CheckActivateEffect(true,true,false)~=nil) or (c:GetType()&TYPE_TRAP>0 and c:CheckActivateEffect(false,true,false)~=nil))
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
--e:SetLabel(1)
return true
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local hg=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,0,nil)
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
if not e:IsCostChecked() or #hg==0 then return false end
--e:SetLabel(0)
local c=e:GetHandler()
if c:GetFlagEffect(m)==0 then return end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_GRAVE,0,nil,e:GetHandler())
if #g<=Duel.GetCurrentChain() then return end
local ct=math.min(#g,Duel.GetCurrentChain()+1)
if c:IsFaceup() and not c:IsStatus(STATUS_EFFECT_ENABLED) then ct=math.min(#g,Duel.GetCurrentChain()) end
local maxc=g:GetMaxGroup(cm.fieldid):GetFirst()
for i=1,ct do
maxc=g:GetMaxGroup(cm.fieldid):GetFirst()
g:RemoveCard(maxc)
end
local sg=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_GRAVE,0,nil,e:GetHandler(),maxc)
--Debug.Message(ct..#sg)
return #sg>0
end
e:SetLabel(0)
......@@ -98,6 +102,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,hg,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -107,8 +112,11 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
if c:IsRelateToEffect(e) and c:IsAbleToHand() and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,0,nil)
if #g>0 then --and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
g=g:Select(tp,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -146,7 +146,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local e6=e2:Clone()
e6:SetCode(m)
tc:RegisterEffect(e6,true)
local e1=Effect.CreateEffect(c)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
......
--方舟骑士-卡涅莉安
c29000876.named_with_Arknight=1
function c29000876.initial_effect(c)
aux.AddCodeList(c,29065532)
c:EnableReviveLimit()
--special summon
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_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,29000876)
e2:SetTarget(c29000876.sptg2)
e2:SetOperation(c29000876.spop2)
c:RegisterEffect(e2)
c29000876.summon_effect=e2
--atkpos
--change atk and defs
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29000876,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetCondition(c29000876.cona)
e1:SetValue(c29000876.aval)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(29000876,0))
e3:SetCategory(CATEGORY_DEFCHANGE)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_BASE_DEFENSE)
e3:SetCondition(c29000876.cona)
e3:SetValue(c29000876.dval)
c:RegisterEffect(e3)
--attack all
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_ATTACK_ALL)
e4:SetCondition(c29000876.cona)
e4:SetValue(1)
c:RegisterEffect(e4)
--deopos
--cannot be target
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetCondition(c29000876.cond)
e5:SetTarget(c29000876.tgtg)
e5:SetValue(1)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e6:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e6:SetValue(aux.tgoval)
c:RegisterEffect(e6)
end
function c29000876.tgtg(e,c)
return c~=e:GetHandler()
end
function c29000876.aval(e,c)
local c=e:GetHandler()
local atk=c:GetTextDefense()
return atk
end
function c29000876.dval(e,c)
local c=e:GetHandler()
local def=c:GetTextAttack()
return def
end
function c29000876.cona(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsAttackPos()
end
function c29000876.cond(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsDefensePos()
end
function c29000876.spfilter(c,e,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c29000876.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c29000876.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c29000876.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c29000876.spfilter),tp,LOCATION_HAND+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
\ No newline at end of file
--方舟骑士-凯尔希·残余
c29038040.named_with_Arknight=1
function c29038040.initial_effect(c)
aux.AddCodeList(c,29065500,29065502,29065578)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(423585,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1,29038040)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c29038040.sptg)
e3:SetOperation(c29038040.spop)
c:RegisterEffect(e3)
--atk
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetCountLimit(1,29038041)
e2:SetCondition(c29038040.atkcon)
e2:SetTarget(c29038040.atktg)
e2:SetOperation(c29038040.atkop)
c:RegisterEffect(e2)
end
function c29038040.filter(c,e,tp)
return (c:IsCode(c,29065500,29065502,29065578) or aux.IsCodeListed(c,29065500) or aux.IsCodeListed(c,29065502) or aux.IsCodeListed(c,29065578)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c29038040.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c29038040.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c29038040.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,c29038040.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c29038040.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
end
function c29038040.atkfilter(c)
return c:IsFaceup() and c:IsCode(29065578)
end
function c29038040.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c29038040.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function c29038040.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,c29038040.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.HintSelection(g)
local tc=g:GetFirst()
if tc then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(tc:GetAttack()*2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetValue(1)
e2:SetCondition(c29038040.actcon)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
function c29038040.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
......@@ -2,116 +2,116 @@
local m=89387010
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x35),2,2)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(aux.NOT(cm.thcon))
e1:SetCost(cm.thcost)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(m,1))
e2:SetCost(cm.thcost2)
e2:SetTarget(cm.thtg2)
e2:SetOperation(cm.thop2)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCondition(cm.thcon)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCondition(cm.thcon)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,m+100000000)
e5:SetCondition(cm.spcon)
e5:SetTarget(cm.sptg)
e5:SetOperation(cm.spop)
c:RegisterEffect(e5)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x35),2,2)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(aux.NOT(cm.thcon))
e1:SetCost(cm.thcost)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(m,1))
e2:SetCost(cm.thcost2)
e2:SetTarget(cm.thtg2)
e2:SetOperation(cm.thop2)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCondition(cm.thcon)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCondition(cm.thcon)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e5:SetCode(EVENT_DESTROYED)
e5:SetCountLimit(1,m+100000000)
e5:SetCondition(cm.spcon)
e5:SetTarget(cm.sptg)
e5:SetOperation(cm.spop)
c:RegisterEffect(e5)
end
function cm.costfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsType(TYPE_MONSTER) and c:IsDiscardable()
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsType(TYPE_MONSTER) and c:IsDiscardable()
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,cm.costfilter,1,1,REASON_DISCARD+REASON_COST)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,cm.costfilter,1,1,REASON_DISCARD+REASON_COST)
end
function cm.thfilter(c)
return c:IsSetCard(0x35) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
return c:IsSetCard(0x35) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.costfilter2(c)
return cm.costfilter(c) and c:IsSetCard(0x35)
return cm.costfilter(c) and c:IsSetCard(0x35)
end
function cm.thcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter2,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,cm.costfilter2,1,1,REASON_DISCARD+REASON_COST)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter2,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,cm.costfilter2,1,1,REASON_DISCARD+REASON_COST)
end
function cm.thfilter2(c)
return c:IsCode(18282103,26704411,29905795,44155002,55277252,56399890,82888408,89194103,90616316,94845226,83039608) and c:IsAbleToHand() and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,c)
return c:IsCode(18282103,26704411,29905795,44155002,55277252,56399890,82888408,89194103,90616316,94845226,83039608,68897338) and c:IsAbleToHand() and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,c)
end
function cm.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function cm.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter2,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,g)
if not sg or sg:GetCount()==0 then return end
g:Merge(sg)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter2,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,g)
if not sg or sg:GetCount()==0 then return end
g:Merge(sg)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.lkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x35) and c:IsType(TYPE_SYNCHRO)
return c:IsFaceup() and c:IsSetCard(0x35) and c:IsType(TYPE_SYNCHRO)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetLinkedGroup():IsExists(cm.lkfilter,1,nil)
return e:GetHandler():GetLinkedGroup():IsExists(cm.lkfilter,1,nil)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x35) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsSetCard(0x35) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment