Commit 1e636a4b authored by gg123gg's avatar gg123gg Committed by GitHub

Add files via upload

parent 483bc0d8
......@@ -2,7 +2,7 @@
local m=17045002
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x57f2)
c:EnableCounterPermit(0x17f2)
--pendulum summon
aux.EnablePendulumAttribute(c)
--spsummon
......@@ -92,19 +92,19 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
if c:IsCanAddCounter(0x57f2,1) then
c:AddCounter(0x57f2,1)
if c:IsCanAddCounter(0x17f2,1) then
c:AddCounter(0x17f2,1)
end
end
function cm.atkval(e,c)
return Duel.GetCounter(0,1,1,0x57f2)*500
return Duel.GetCounter(0,1,1,0x17f2)*500
end
function cm.indtg(e,c)
return c:GetCounter(0x57f2)>0
return c:GetCounter(0x17f2)>0
end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x57f2,1,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x57f2,1,REASON_COST)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x17f2,1,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x17f2,1,REASON_COST)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -138,8 +138,8 @@ function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_MZONE,0)
if c:IsRelateToEffect(e) then g:AddCard(c) end
for tc in aux.Next(g) do
if tc:IsCanAddCounter(0x57f2,1) then
tc:AddCounter(0x57f2,1)
if tc:IsCanAddCounter(0x17f2,1) then
tc:AddCounter(0x17f2,1)
end
end
end
\ No newline at end of file
......@@ -2,7 +2,7 @@
local m=17050001
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x37f2,LOCATION_PZONE+LOCATION_MZONE)
c:EnableCounterPermit(0x7f3,LOCATION_PZONE+LOCATION_MZONE)
--pendulum summon
aux.EnablePendulumAttribute(c)
--summon with 3 tribute
......@@ -142,11 +142,11 @@ end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
c:AddCounter(0x37f2,1)
c:AddCounter(0x7f3,1)
end
end
function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0x37f2)>=e:GetLabel()
return e:GetHandler():GetCounter(0x7f3)>=e:GetLabel()
end
function cm.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
......
......@@ -8,7 +8,7 @@ function cm.initial_effect(c)
aux.AddContactFusionProcedure(c,Card.IsReleasable,LOCATION_MZONE+LOCATION_PZONE,0,Duel.Release,REASON_COST+REASON_MATERIAL)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17060854,0))
e1:SetDescription(aux.Stringid(17060893,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
......@@ -20,7 +20,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17060864,1))
e2:SetDescription(aux.Stringid(17060893,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
......@@ -61,32 +61,29 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local tc=g:Select(1-tp,1,1,nil):GetFirst()
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
local c=e:GetHandler()
local fid=c:GetFieldID()
local e1=Effect.CreateEffect(c)
tc:RegisterFlagEffect(17060893,RESET_EVENT+RESETS_STANDARD,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:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetCondition(cm.retcon)
e1:SetOperation(cm.retop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
tc:RegisterFlagEffect(17060854,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(17060854)==e:GetLabel() then
return true
else
if tc:GetFlagEffect(17060893)==0 then
e:Reset()
return false
else
return Duel.GetTurnPlayer()==1-tp
end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.SendtoHand(tc,1-tp,REASON_EFFECT)
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
--创造之匙
function c75646600.initial_effect(c)
aux.AddCodeList(c,75646600)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c75646600.condition)
e1:SetTarget(c75646600.target)
e1:SetOperation(c75646600.activate)
c:RegisterEffect(e1)
end
function c75646600.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=10000
end
function c75646600.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(aux.FALSE)
end
end
function c75646600.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLP(tp)>10000 then return end
Duel.Hint(HINT_MUSIC,0,aux.Stringid(75646600,0))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_INACTIVATE)
e1:SetValue(c75646600.effectfilter)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_DISEFFECT)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_DEFENSE_ATTACK)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c75646600.intg)
e3:SetValue(1)
Duel.RegisterEffect(e3,tp)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
e4:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_SET_AVAILABLE)
e4:SetTarget(c75646600.spintg)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
Duel.RegisterEffect(e5,tp)
Duel.RegisterFlagEffect(tp,75646600,0,0,1)
end
function c75646600.intg(e,c)
return c:IsSetCard(0x2c5)
end
function c75646600.effectfilter(e,ct)
local p=e:GetOwner():GetControler()
local te,tp=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
return p==tp and aux.IsCodeListed(te:GetHandler(),75646600)
end
function c75646600.spintg(e,c)
return aux.IsCodeListed(c,75646600)
--创造之匙
function c75646600.initial_effect(c)
aux.AddCodeList(c,75646600)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c75646600.condition)
e1:SetTarget(c75646600.target)
e1:SetOperation(c75646600.activate)
c:RegisterEffect(e1)
end
function c75646600.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=500
end
function c75646600.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(aux.FALSE)
end
end
function c75646600.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLP(tp)>500 then return end
Duel.Hint(HINT_MUSIC,0,aux.Stringid(75646600,0))
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_INACTIVATE)
e1:SetValue(c75646600.effectfilter)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_DISEFFECT)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_DEFENSE_ATTACK)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c75646600.intg)
e3:SetValue(1)
Duel.RegisterEffect(e3,tp)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_DISABLE_SUMMON)
e4:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_SET_AVAILABLE)
e4:SetTarget(c75646600.spintg)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
Duel.RegisterEffect(e5,tp)
Duel.RegisterFlagEffect(tp,75646600,0,0,1)
end
function c75646600.intg(e,c)
return c:IsSetCard(0x2c5)
end
function c75646600.effectfilter(e,ct)
local p=e:GetOwner():GetControler()
local te,tp=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
return p==tp and aux.IsCodeListed(te:GetHandler(),75646600)
end
function c75646600.spintg(e,c)
return aux.IsCodeListed(c,75646600)
end
\ No newline at end of file
--博士 伊瑟琳
function c75646601.initial_effect(c)
aux.AddCodeList(c,75646600)
--search
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,75646601)
e1:SetTarget(c75646601.thtg)
e1:SetOperation(c75646601.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--Recover
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(75646008,0))
e3:SetCategory(CATEGORY_RECOVER+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_HAND)
e3:SetCost(c75646601.recost)
e3:SetTarget(c75646601.retg)
e3:SetOperation(c75646601.reop)
c:RegisterEffect(e3)
end
function c75646601.thfilter(c)
return c:IsSetCard(0x2c5) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c75646601.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c75646601.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c75646601.spfilter(c,e,tp)
return aux.IsCodeListed(c,75646600) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c75646601.thop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c75646601.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
if Duel.GetFlagEffect(tp,75646600)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(75646601,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c75646601.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function c75646601.cfilter1(c,e,tp)
if c:IsLocation(LOCATION_HAND) then return c==e:GetHandler() and c:IsDiscardable() end
return c:IsAbleToRemoveAsCost() and c:IsHasEffect(75646628,tp)
end
function c75646601.cfilter2(c,tp)
if c:IsLocation(LOCATION_HAND) then return aux.IsCodeListed(c,75646600) and c:IsDiscardable() end
return c:IsAbleToRemoveAsCost() and c:IsHasEffect(75646628,tp)
end
function c75646601.recost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c75646601.cfilter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return g and Duel.IsExistingMatchingCard(c75646601.cfilter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,g:GetFirst(),tp) end
local g1=Duel.GetMatchingGroup(c75646601.cfilter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,tp)
if not g1:IsExists(Card.IsHasEffect,1,nil,75646628,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local dg=g1:Select(tp,1,1,c)
dg:AddCard(c)
if dg:GetFirst():IsCode(75646600) then e:SetLabel(1) end
Duel.SendtoGrave(dg,REASON_DISCARD+REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local dc=Duel.SelectMatchingCard(tp,c75646601.cfilter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
local dg=Duel.SelectMatchingCard(tp,c75646601.cfilter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,dc,tp)
dg:AddCard(dc)
local tc=dg:GetFirst()
while tc do
local te=tc:IsHasEffect(75646628,tp)
if te then
e:SetLabel(1)
Duel.Remove(tc,POS_FACEUP,REASON_COST)
else
if tc:IsCode(75646600) then e:SetLabel(1) end
Duel.SendtoGrave(tc,REASON_DISCARD+REASON_COST)
end
tc=dg:GetNext()
end
end
end
function c75646601.retg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function c75646601.reop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
if (e:GetLabel()==1 or Duel.GetFlagEffect(tp,75646600)~=0) and Duel.IsPlayerCanDraw(tp,2) and Duel.SelectYesNo(tp,aux.Stringid(75646601,3)) then
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
--博士 伊瑟琳
function c75646601.initial_effect(c)
aux.AddCodeList(c,75646600)
--search
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,75646601)
e1:SetTarget(c75646601.thtg)
e1:SetOperation(c75646601.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--Recover
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(75646008,0))
e3:SetCategory(CATEGORY_RECOVER+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_HAND)
e3:SetCost(c75646601.recost)
e3:SetTarget(c75646601.retg)
e3:SetOperation(c75646601.reop)
c:RegisterEffect(e3)
end
function c75646601.thfilter(c)
return c:IsSetCard(0x2c5) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c75646601.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c75646601.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c75646601.spfilter(c,e,tp)
return aux.IsCodeListed(c,75646600) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c75646601.thop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c75646601.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
if Duel.GetFlagEffect(tp,75646600)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(75646601,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c75646601.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function c75646601.cfilter1(c,e,tp)
if c:IsLocation(LOCATION_HAND) then return c==e:GetHandler() and c:IsDiscardable() end
return c:IsAbleToRemoveAsCost() and c:IsHasEffect(75646628,tp)
end
function c75646601.cfilter2(c,tp)
if c:IsLocation(LOCATION_HAND) then return aux.IsCodeListed(c,75646600) and c:IsDiscardable() end
return c:IsAbleToRemoveAsCost() and c:IsHasEffect(75646628,tp)
end
function c75646601.recost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c75646601.cfilter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
if chk==0 then return g and Duel.IsExistingMatchingCard(c75646601.cfilter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,g:GetFirst(),tp) end
local g1=Duel.GetMatchingGroup(c75646601.cfilter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,tp)
if not g1:IsExists(Card.IsHasEffect,1,nil,75646628,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local dg=g1:Select(tp,1,1,c)
if dg:GetFirst():IsCode(75646600) then e:SetLabel(1) end
dg:AddCard(c)
Duel.SendtoGrave(dg,REASON_DISCARD+REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local dc=Duel.SelectMatchingCard(tp,c75646601.cfilter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
local dg=Duel.SelectMatchingCard(tp,c75646601.cfilter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,dc,tp)
dg:AddCard(dc)
local tc=dg:GetFirst()
while tc do
local te=tc:IsHasEffect(75646628,tp)
if te then
e:SetLabel(1)
Duel.Remove(tc,POS_FACEUP,REASON_COST)
else
if tc:IsCode(75646600) then e:SetLabel(1) end
Duel.SendtoGrave(tc,REASON_DISCARD+REASON_COST)
end
tc=dg:GetNext()
end
end
end
function c75646601.retg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function c75646601.reop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
if (e:GetLabel()==1 or Duel.GetFlagEffect(tp,75646600)~=0) and Duel.IsPlayerCanDraw(tp,2) and Duel.SelectYesNo(tp,aux.Stringid(75646601,3)) then
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
end
\ No newline at end of file
--片翼
function c75646621.initial_effect(c)
aux.AddCodeList(c,75646600)
--end battle phase
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(75646621,3))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c75646621.condition)
e1:SetCost(c75646621.cost)
e1:SetTarget(c75646621.target)
e1:SetOperation(c75646621.operation)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(75646621,4))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,75646621)
e2:SetTarget(c75646621.thtg)
e2:SetOperation(c75646621.thop)
c:RegisterEffect(e2)
end
function c75646621.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():GetControler()~=tp
end
function c75646621.costfilter(c,tp)
if c:IsLocation(LOCATION_HAND) then return c:IsDiscardable() end
return c:IsAbleToRemoveAsCost() and c:IsHasEffect(75646628,tp)
end
function c75646621.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c75646621.costfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,e:GetHandler(),tp) end
local g=Duel.GetMatchingGroup(c75646621.costfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,e:GetHandler(),tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local tc=g:Select(tp,1,1,e:GetHandler()):GetFirst()
local te=tc:IsHasEffect(75646628,tp)
if te then
e:SetLabel(1)
Duel.Remove(tc,POS_FACEUP,REASON_COST)
else
if tc:IsCode(75646600) then e:SetLabel(1) end
Duel.SendtoGrave(tc,REASON_COST+REASON_DISCARD)
end
end
function c75646621.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c75646621.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),2)
if (e:GetLabel()==1 or Duel.GetFlagEffect(tp,75646600)>0) and ft>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,75646622,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_EARTH,POS_FACEUP_DEFENSE)
and Duel.SelectYesNo(tp,aux.Stringid(75646621,0)) then
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local ct=1
if ft>1 then
local num={}
local i=1
while i<=ft do
num[i]=i
i=i+1
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(75646621,1))
ct=Duel.AnnounceNumber(tp,table.unpack(num))
end
repeat
local token=Duel.CreateToken(tp,75646622)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
ct=ct-1
until ct==0
end
end
end
function c75646621.cfilter(c,e,tp)
return aux.IsCodeListed(c,75646600) and c:IsControler(tp)
and c:IsCanBeEffectTarget(e) and c:IsAbleToHand()
end
function c75646621.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c75646621.cfilter(chkc,e,tp) end
if chk==0 then return eg:IsExists(c75646621.cfilter,1,nil,e,tp) and not eg:IsContains(e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=eg:FilterSelect(tp,c75646621.cfilter,1,1,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c75646621.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and (tc:IsCode(75646600) or Duel.GetFlagEffect(tp,75646600)>0) and Duel.SelectYesNo(tp,aux.Stringid(75646621,2)) and c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
elseif c:IsRelateToEffect(e) and c:IsAbleToDeck() then
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end
end
--片翼
function c75646621.initial_effect(c)
aux.AddCodeList(c,75646600)
--end battle phase
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(75646621,3))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c75646621.condition)
e1:SetCost(c75646621.cost)
e1:SetTarget(c75646621.target)
e1:SetOperation(c75646621.operation)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(75646621,4))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,75646621)
e2:SetTarget(c75646621.thtg)
e2:SetOperation(c75646621.thop)
c:RegisterEffect(e2)
end
function c75646621.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():GetControler()~=tp
end
function c75646621.costfilter(c,tp)
if c:IsLocation(LOCATION_HAND) then return c:IsDiscardable() end
return c:IsAbleToRemoveAsCost() and c:IsHasEffect(75646628,tp)
end
function c75646621.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c75646621.costfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,e:GetHandler(),tp) end
local g=Duel.GetMatchingGroup(c75646621.costfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,e:GetHandler(),tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local tc=g:Select(tp,1,1,e:GetHandler()):GetFirst()
local te=tc:IsHasEffect(75646628,tp)
if te then
e:SetLabel(1)
Duel.Remove(tc,POS_FACEUP,REASON_COST)
else
if tc:IsCode(75646600) then e:SetLabel(1) end
Duel.SendtoGrave(tc,REASON_COST+REASON_DISCARD)
end
end
function c75646621.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c75646621.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1)
local ft=math.min((Duel.GetLocationCount(tp,LOCATION_MZONE)),2)
if (e:GetLabel()==1 or Duel.GetFlagEffect(tp,75646600)>0) and ft>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,75646622,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_EARTH,POS_FACEUP_DEFENSE)
and Duel.SelectYesNo(tp,aux.Stringid(75646621,0)) then
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local ct=1
if ft>1 then
local num={}
local i=1
while i<=ft do
num[i]=i
i=i+1
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(75646621,1))
ct=Duel.AnnounceNumber(tp,table.unpack(num))
end
repeat
local token=Duel.CreateToken(tp,75646622)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
ct=ct-1
until ct==0
Duel.SpecialSummonComplete()
end
end
end
function c75646621.cfilter(c,e,tp)
return aux.IsCodeListed(c,75646600) and c:IsControler(tp)
and c:IsCanBeEffectTarget(e) and c:IsAbleToHand()
end
function c75646621.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) and c75646621.cfilter(chkc,e,tp) end
if chk==0 then return eg:IsExists(c75646621.cfilter,1,nil,e,tp) and not eg:IsContains(e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=eg:FilterSelect(tp,c75646621.cfilter,1,1,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c75646621.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 and (tc:IsCode(75646600) or Duel.GetFlagEffect(tp,75646600)>0) and Duel.SelectYesNo(tp,aux.Stringid(75646621,2)) and c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
elseif c:IsRelateToEffect(e) and c:IsAbleToDeck() then
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end
end
end
\ No newline at end of file
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