Commit ecfc84a0 authored by Tachibana's avatar Tachibana

Merge branch 'master' of git.mycard.moe:alstroemeria-silentlove/ygopro-222DIY-cards

parents f188b9be d174295a
Pipeline #15302 passed with stages
in 28 minutes and 34 seconds
--传说之魂 诚信
local m=33350003
local cm=_G["c"..m]
function c33350003.initial_effect(c)
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,0))
e0:SetCategory(CATEGORY_TOGRAVE+CATEGORY_ATKCHANGE)
e0:SetType(EFFECT_TYPE_IGNITION)
e0:SetProperty(EFFECT_FLAG_CARD_TARGET)
e0:SetRange(LOCATION_MZONE)
e0:SetCountLimit(4)
e0:SetCondition(cm.conditon1)
e0:SetTarget(cm.target)
e0:SetOperation(cm.operation1)
c:RegisterEffect(e0)
local e1=e0:Clone()
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
local cm,m,o=GetID()
function cm.initial_effect(c)
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,0))
e0:SetCategory(CATEGORY_TOGRAVE+CATEGORY_ATKCHANGE)
e0:SetType(EFFECT_TYPE_IGNITION)
e0:SetProperty(EFFECT_FLAG_CARD_TARGET)
e0:SetRange(LOCATION_MZONE)
e0:SetCondition(cm.conditon1)
e0:SetTarget(cm.target)
e0:SetOperation(cm.operation1(200))
c:RegisterEffect(e0)
local e1=e0:Clone()
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP,TIMING_DAMAGE_STEP+TIMING_END_PHASE)
e1:SetHintTiming(TIMING_DAMAGE_STEP+TIMING_DAMAGE_STEP+TIMING_END_PHASE)
e1:SetCondition(cm.conditon2)
e1:SetOperation(cm.operation2)
e1:SetOperation(cm.operation1(400))
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_XMATERIAL)
......@@ -28,7 +26,7 @@ function c33350003.initial_effect(c)
e2:SetCondition(cm.condition)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
......@@ -37,103 +35,54 @@ function c33350003.initial_effect(c)
c:RegisterEffect(e3)
end
cm.setname="TaleSouls"
function cm.tgfilter(c)
return c:IsFaceup()
end
function cm.spfilter(c,e,tp)
return c:IsCode(33350001) and c:IsFaceup()
end
function cm.conditon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil,e,tp)
return not Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil,e,tp)
end
function cm.conditon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil,e,tp)
return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil,e,tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local op=0
local preatk=tc:GetAttack()
local seq=nil
if tc:GetSequence()>0 and Duel.CheckLocation(tc:GetControler(),LOCATION_MZONE,tc:GetSequence()-1) and tc:GetSequence()<4 and Duel.CheckLocation(tc:GetControler(),LOCATION_MZONE,tc:GetSequence()+1)
then op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
elseif tc:GetSequence()>0 and Duel.CheckLocation(tc:GetControler(),LOCATION_MZONE,tc:GetSequence()-1) then op=Duel.SelectOption(tp,aux.Stringid(m,0))
elseif tc:GetSequence()<4 and Duel.CheckLocation(tc:GetControler(),LOCATION_MZONE,tc:GetSequence()+1) then op=Duel.SelectOption(tp,aux.Stringid(m,0))+1
else return end
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if op==0 then
for i=4,0,-1 do
if Duel.CheckLocation(tc:GetControler(),LOCATION_MZONE,i) then
seq=i
end
end
end
if op==1 then
for i=0,4,1 do
if Duel.CheckLocation(tc:GetControler(),LOCATION_MZONE,i) then
seq=i
end
end
end
Duel.MoveSequence(tc,seq)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-200)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
Duel.BreakEffect()
if preatk~=0 and tc:IsAttack(0) then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and e:GetHandler():GetFlagEffect(m)<4 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
local preatk=tc:GetAttack()
local seq=nil
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if op==0 and Duel.CheckLocation(tc:GetControler(),LOCATION_MZONE,tc:GetSequence()-1) and tc:GetSequence()~=0 then
for i=4,0,-1 do
if Duel.CheckLocation(tc:GetControler(),LOCATION_MZONE,i) then
seq=i
end
end
end
if op==1 and Duel.CheckLocation(tc:GetControler(),LOCATION_MZONE,tc:GetSequence()+1) and tc:GetSequence()~=4 then
for i=0,4,1 do
if Duel.CheckLocation(tc:GetControler(),LOCATION_MZONE,i) then
seq=i
end
end
end
Duel.MoveSequence(tc,seq)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-400)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if preatk~=0 and tc:IsAttack(0) then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function cm.operation1(val)
return function(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not (tc:IsRelateToEffect(e) and tc:IsFaceup()) then return end
local op={}
local os={}
local n=math.abs(e:GetHandler():GetControler()-tc:GetControler())
if tc:GetSequence()>0 and Duel.CheckLocation(tc:GetControler(),4,tc:GetSequence()-1) then op[1]=aux.Stringid(m,n);os[1]=4 end
if tc:GetSequence()<4 and Duel.CheckLocation(tc:GetControler(),4,tc:GetSequence()+1) then op[#op+1]=aux.Stringid(m,math.abs(n-1));os[#os+1]=0 end
if #op==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
op = #op==1 and os[1] or os[Duel.SelectOption(tp,table.unpack(op))+1]
for i=0,4,1 do
if Duel.CheckLocation(tc:GetControler(),LOCATION_MZONE,math.abs(op-i)) then
os=math.abs(op-i)
end
end
Duel.MoveSequence(tc,os)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if not tc:IsAttack(0) then return end
Duel.BreakEffect()
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
--效果1
function cm.condition(e)
local c=e:GetHandler()
local c=e:GetHandler()
return c.setname=="TaleSouls"
end
end
\ No newline at end of file
......@@ -24,7 +24,7 @@ function c33350005.initial_effect(c)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,LOCATION_MZONE)
e4:SetTargetRange(0,1)
e4:SetCondition(cm.actcon)
e4:SetValue(cm.atlimit)
c:RegisterEffect(e4)
......@@ -79,17 +79,15 @@ end
--效果1
function cm.atlimit(e,re)
local tc=re:GetHandler()
return tc:IsLocation(LOCATION_MZONE) and re:IsActiveType(TYPE_MONSTER) and e:GetHandler():GetColumnGroup():IsContains(tc) and tc:IsAttackBelow(e:GetHandler():GetAttack())
return tc:IsLocation(LOCATION_MZONE) and e:GetHandler():GetColumnGroup():IsContains(tc) and tc:IsAttackBelow(e:GetHandler():GetAttack())
end
function cm.actcon(e,tp)
return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil,e,tp)
return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil,e,tp)
end
function cm.spfilter(c,e,tp)
return c:IsCode(33350001) and c:IsFaceup()
end
function cm.attack(e,c)
local ct1=aux.GetColumn(e:GetHandler())
local ct2=aux.GetColumn(c)
if not ct1 or not ct2 then return false end
return math.abs(ct1-ct2)==0
if not c:IsFaceup() then return end
return e:GetHandler():GetColumnGroup():IsContains(c) and c:IsAttackBelow(e:GetHandler():GetAttack())
end
\ No newline at end of file
......@@ -4,7 +4,7 @@ local cm=_G["c"..m]
function c33350011.initial_effect(c)
c:EnableReviveLimit()
aux.AddXyzProcedure(c,cm.mfilter,1,6,cm.xyzop,aux.Stringid(m,0))
local e1=Effect.CreateEffect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
......@@ -13,7 +13,7 @@ function c33350011.initial_effect(c)
e1:SetTarget(cm.efftg)
e1:SetOperation(cm.effop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
......@@ -21,7 +21,7 @@ function c33350011.initial_effect(c)
e2:SetCondition(cm.imcon)
e2:SetValue(cm.efilter)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_DEFCHANGE+CATEGORY_ATKCHANGE+CATEGORY_DAMAGE+CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_IGNITION)
......@@ -36,11 +36,11 @@ cm.setname="TaleSouls"
function cm.mfilter(c,xyzc)
return c.setname=="TaleSouls" and c:IsLevel(1)
end
function cm.spfilter(c,e,tp)
return c:IsCode(33350007) and c:IsFaceup()
function cm.spfilter(c)
return c:IsCode(33350007) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
function cm.xyzop(c,e,tp)
return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil,e,tp) and c:IsFaceup() and c:IsCode(33350010)
function cm.xyzop(c)
return Duel.IsExistingMatchingCard(cm.spfilter,c:GetControler(),LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil) and c:IsFaceup() and c:IsCode(33350010)
end
--叠放要求
function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -57,7 +57,7 @@ function cm.tgfilter(c)
return c:IsCanOverlay() and c.setname=="TaleSouls"
end
function cm.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local c=e:GetHandler()
local mat=c:GetOverlayGroup()
if chk==0 then local g=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_REMOVED,0,nil)
g:Merge(mat)
......@@ -65,10 +65,10 @@ function cm.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function cm.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=e:GetHandler():GetOverlayCount()
local mat=e:GetHandler():GetOverlayGroup()
local g=Duel.GetMatchingGroup(cm.ofilter,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_REMOVED,0,nil,e)
g:Merge(mat)
local sg=e:GetHandler():GetOverlayCount()
local mat=e:GetHandler():GetOverlayGroup()
local g=Duel.GetMatchingGroup(cm.ofilter,tp,LOCATION_GRAVE+LOCATION_DECK+LOCATION_REMOVED,0,nil,e)
g:Merge(mat)
if g:GetClassCount(Card.GetCode)<6 or g:GetClassCount(Card.GetOriginalCodeRule)<6 then
Duel.SendtoGrave(c,REASON_EFFECT)
else
......@@ -76,9 +76,9 @@ function cm.effop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tg1=g:SelectSubGroup(tp,cm.gselect,false,6,6,mat)
Duel.Overlay(c,tg1)
if e:GetHandler():GetOverlayCount()~=6 then
Duel.SendtoGrave(c,REASON_EFFECT)
end
if e:GetHandler():GetOverlayCount()~=6 then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
end
......
......@@ -7,19 +7,20 @@ function c33350012.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.actcost)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_LEAVE_GRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(cm.regcon1)
e2:SetTarget(cm.ovtg)
e2:SetOperation(cm.ovop)
e2:SetCondition(cm.con2(cm.f2))
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2(cm.f2))
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(cm.regcon2)
e3:SetCondition(cm.con2(cm.f3))
e3:SetOperation(cm.op2(cm.f3))
c:RegisterEffect(e3)
end
cm.setname="TaleSouls"
......@@ -32,59 +33,49 @@ function cm.actcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,cm.acfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
--发动cost
function cm.cfilter1(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousPosition(POS_FACEUP) and c.setname=="TaleSouls"
--e2
function cm.f2(c,tp)
return c:IsPreviousControler(tp) and c.setname=="TaleSouls" and c:IsLocation(LOCATION_GRAVE)
end
function cm.filter(c)
return c:IsFaceup() and c.setname=="TaleSouls" and c:IsLevelAbove(0)
end
function cm.xfilter(c)
return c:IsFaceup() and c:IsLevelAbove(0)
end
function cm.regcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter1,1,nil,tp)
end
function cm.cfilter2(c,tp)
return not c:IsReason(REASON_BATTLE) and cm.cfilter1(c,tp)
end
function cm.regcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter2,1,nil,tp)
end
function cm.cfilter(c,e,tp)
return c:IsPreviousControler(tp) and c.setname=="TaleSouls"
function cm.con2(f)
return function(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(f,1,nil,tp)
end
end
function cm.ovtg(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
if chk==0 then return eg:Filter(Card.IsAbleToHand,nil,e):GetCount()>0 end
if chk==0 then return eg:Filter(Card.IsAbleToHand,nil,e):GetCount()>0 and Duel.GetFlagEffect(tp,m)==0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.RegisterFlagEffect(tp,m,RESET_CHAIN,0,1)
end
function cm.ovop(e,tp,eg,ep,ev,re,r,rp)
local b1= eg:Filter(cm.cfilter,nil,e,tp)
local b2=eg:Filter(cm.cfilter,nil,e,tp)
local op=0
if b1 and b2 and Duel.IsExistingMatchingCard(cm.xfilter,tp,0,LOCATION_MZONE,1,nil) then op=Duel.SelectOption(1-tp,aux.Stringid(m,0),aux.Stringid(m,1))
elseif b1 then op=Duel.SelectOption(1-tp,aux.Stringid(m,0))
elseif b2 and Duel.IsExistingMatchingCard(cm.xfilter,tp,0,LOCATION_MZONE,1,nil) then op=Duel.SelectOption(1-tp,aux.Stringid(m,1))+1
else return end
if op==0 then
Duel.SendtoHand(eg:Filter(cm.cfilter,nil,e,tp),nil,REASON_EFFECT)
Duel.Draw(1-tp,1,REASON_EFFECT)
Duel.ConfirmCards(1-tp,eg)
elseif op==1 then
local g=Duel.GetMatchingGroup(cm.xfilter,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
function cm.op2(f)
return function(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(f,nil,tp)
local b1=g:IsExists(Card.IsAbleToHand,1,nil) and Duel.IsPlayerCanDraw(1-tp,1)
local b2=g:IsExists(Card.IsAbleToRemove,1,nil) and Duel.GetFieldGroup(tp,0,LOCATION_MZONE):Filter(Card.IsFaceup,nil):IsExists(Card.IsLevelAbove,1,nil,0)
local op
if b1 and b2 then op=Duel.SelectOption(1-tp,aux.Stringid(m,0),aux.Stringid(m,1))
elseif b1 then op=Duel.SelectOption(1-tp,aux.Stringid(m,0))
elseif b2 then op=Duel.SelectOption(1-tp,aux.Stringid(m,1))+1
else return end
if op==0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,Duel.GetOperatedGroup())
Duel.Draw(1-tp,1,REASON_EFFECT)
elseif op==1 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 then
g=Duel.GetFieldGroup(tp,0,LOCATION_MZONE):Filter(Card.IsFaceup,nil):Filter(Card.IsLevelAbove,nil,0)
for tc in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
end
--e3
function cm.f3(c,tp)
return c:IsPreviousControler(tp) and c:IsReason(REASON_EFFECT) and c.setname=="TaleSouls"
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