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,m,o=GetID()
local cm=_G["c"..m] function cm.initial_effect(c)
function c33350003.initial_effect(c)
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,0)) e0:SetDescription(aux.Stringid(m,0))
e0:SetCategory(CATEGORY_TOGRAVE+CATEGORY_ATKCHANGE) e0:SetCategory(CATEGORY_TOGRAVE+CATEGORY_ATKCHANGE)
e0:SetType(EFFECT_TYPE_IGNITION) e0:SetType(EFFECT_TYPE_IGNITION)
e0:SetProperty(EFFECT_FLAG_CARD_TARGET) e0:SetProperty(EFFECT_FLAG_CARD_TARGET)
e0:SetRange(LOCATION_MZONE) e0:SetRange(LOCATION_MZONE)
e0:SetCountLimit(4)
e0:SetCondition(cm.conditon1) e0:SetCondition(cm.conditon1)
e0:SetTarget(cm.target) e0:SetTarget(cm.target)
e0:SetOperation(cm.operation1) e0:SetOperation(cm.operation1(200))
c:RegisterEffect(e0) c:RegisterEffect(e0)
local e1=e0:Clone() local e1=e0:Clone()
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN) 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:SetCondition(cm.conditon2)
e1:SetOperation(cm.operation2) e1:SetOperation(cm.operation1(400))
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_XMATERIAL) e2:SetType(EFFECT_TYPE_XMATERIAL)
...@@ -37,9 +35,6 @@ function c33350003.initial_effect(c) ...@@ -37,9 +35,6 @@ function c33350003.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
cm.setname="TaleSouls" cm.setname="TaleSouls"
function cm.tgfilter(c)
return c:IsFaceup()
end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsCode(33350001) and c:IsFaceup() return c:IsCode(33350001) and c:IsFaceup()
end end
...@@ -50,90 +45,44 @@ function cm.conditon2(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,90 +45,44 @@ 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 end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) 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 chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) 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) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0) 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.operation1(e,tp,eg,ep,ev,re,r,rp) function cm.operation1(val)
local c=e:GetHandler() return function(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local op=0 if not (tc:IsRelateToEffect(e) and tc:IsFaceup()) then return end
local preatk=tc:GetAttack() local op={}
local seq=nil local os={}
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) local n=math.abs(e:GetHandler():GetControler()-tc:GetControler())
then op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1)) if tc:GetSequence()>0 and Duel.CheckLocation(tc:GetControler(),4,tc:GetSequence()-1) then op[1]=aux.Stringid(m,n);os[1]=4 end
elseif tc:GetSequence()>0 and Duel.CheckLocation(tc:GetControler(),LOCATION_MZONE,tc:GetSequence()-1) then op=Duel.SelectOption(tp,aux.Stringid(m,0)) 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
elseif tc:GetSequence()<4 and Duel.CheckLocation(tc:GetControler(),LOCATION_MZONE,tc:GetSequence()+1) then op=Duel.SelectOption(tp,aux.Stringid(m,0))+1 if #op==0 then return end
else return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
if tc:IsRelateToEffect(e) and tc:IsFaceup() then op = #op==1 and os[1] or os[Duel.SelectOption(tp,table.unpack(op))+1]
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 for i=0,4,1 do
if Duel.CheckLocation(tc:GetControler(),LOCATION_MZONE,i) then if Duel.CheckLocation(tc:GetControler(),LOCATION_MZONE,math.abs(op-i)) then
seq=i os=math.abs(op-i)
end
end end
end end
Duel.MoveSequence(tc,seq) Duel.MoveSequence(tc,os)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-200) e1:SetValue(-val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
if not tc:IsAttack(0) then return end
Duel.BreakEffect() Duel.BreakEffect()
if preatk~=0 and tc:IsAttack(0) then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
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) Duel.SendtoGrave(tc,REASON_EFFECT)
end end
end
end end
--效果1 --效果1
function cm.condition(e) function cm.condition(e)
local c=e:GetHandler() local c=e:GetHandler()
return c.setname=="TaleSouls" return c.setname=="TaleSouls"
end end
\ No newline at end of file
...@@ -24,7 +24,7 @@ function c33350005.initial_effect(c) ...@@ -24,7 +24,7 @@ function c33350005.initial_effect(c)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_ACTIVATE) e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,LOCATION_MZONE) e4:SetTargetRange(0,1)
e4:SetCondition(cm.actcon) e4:SetCondition(cm.actcon)
e4:SetValue(cm.atlimit) e4:SetValue(cm.atlimit)
c:RegisterEffect(e4) c:RegisterEffect(e4)
...@@ -79,7 +79,7 @@ end ...@@ -79,7 +79,7 @@ end
--效果1 --效果1
function cm.atlimit(e,re) function cm.atlimit(e,re)
local tc=re:GetHandler() 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 end
function cm.actcon(e,tp) 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)
...@@ -88,8 +88,6 @@ function cm.spfilter(c,e,tp) ...@@ -88,8 +88,6 @@ function cm.spfilter(c,e,tp)
return c:IsCode(33350001) and c:IsFaceup() return c:IsCode(33350001) and c:IsFaceup()
end end
function cm.attack(e,c) function cm.attack(e,c)
local ct1=aux.GetColumn(e:GetHandler()) if not c:IsFaceup() then return end
local ct2=aux.GetColumn(c) return e:GetHandler():GetColumnGroup():IsContains(c) and c:IsAttackBelow(e:GetHandler():GetAttack())
if not ct1 or not ct2 then return false end
return math.abs(ct1-ct2)==0
end end
\ No newline at end of file
...@@ -36,11 +36,11 @@ cm.setname="TaleSouls" ...@@ -36,11 +36,11 @@ cm.setname="TaleSouls"
function cm.mfilter(c,xyzc) function cm.mfilter(c,xyzc)
return c.setname=="TaleSouls" and c:IsLevel(1) return c.setname=="TaleSouls" and c:IsLevel(1)
end end
function cm.spfilter(c,e,tp) function cm.spfilter(c)
return c:IsCode(33350007) and c:IsFaceup() return c:IsCode(33350007) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end end
function cm.xyzop(c,e,tp) function cm.xyzop(c)
return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil,e,tp) and c:IsFaceup() and c:IsCode(33350010) return Duel.IsExistingMatchingCard(cm.spfilter,c:GetControler(),LOCATION_REMOVED+LOCATION_GRAVE,0,1,nil) and c:IsFaceup() and c:IsCode(33350010)
end end
--叠放要求 --叠放要求
function cm.effcon(e,tp,eg,ep,ev,re,r,rp) function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -13,13 +13,14 @@ function c33350012.initial_effect(c) ...@@ -13,13 +13,14 @@ function c33350012.initial_effect(c)
e2:SetCode(EVENT_BATTLE_DESTROYED) e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(cm.regcon1) e2:SetCondition(cm.con2(cm.f2))
e2:SetTarget(cm.ovtg) e2:SetTarget(cm.tg2)
e2:SetOperation(cm.ovop) e2:SetOperation(cm.op2(cm.f2))
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone() local e3=e2:Clone()
e3:SetCode(EVENT_TO_GRAVE) e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(cm.regcon2) e3:SetCondition(cm.con2(cm.f3))
e3:SetOperation(cm.op2(cm.f3))
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
cm.setname="TaleSouls" cm.setname="TaleSouls"
...@@ -32,59 +33,49 @@ function cm.actcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -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) local g=Duel.SelectMatchingCard(tp,cm.acfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
--发动cost --e2
function cm.cfilter1(c,tp) function cm.f2(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) return c:IsPreviousControler(tp) and c.setname=="TaleSouls" and c:IsLocation(LOCATION_GRAVE)
and c:IsPreviousPosition(POS_FACEUP) and c.setname=="TaleSouls"
end end
function cm.filter(c) function cm.con2(f)
return c:IsFaceup() and c.setname=="TaleSouls" and c:IsLevelAbove(0) return function(e,tp,eg,ep,ev,re,r,rp)
end return eg:IsExists(f,1,nil,tp)
function cm.xfilter(c) end
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"
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() 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_TOHAND,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.RegisterFlagEffect(tp,m,RESET_CHAIN,0,1)
end end
function cm.ovop(e,tp,eg,ep,ev,re,r,rp) function cm.op2(f)
local b1= eg:Filter(cm.cfilter,nil,e,tp) return function(e,tp,eg,ep,ev,re,r,rp)
local b2=eg:Filter(cm.cfilter,nil,e,tp) local g=eg:Filter(f,nil,tp)
local op=0 local b1=g:IsExists(Card.IsAbleToHand,1,nil) and Duel.IsPlayerCanDraw(1-tp,1)
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)) 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 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 elseif b2 then op=Duel.SelectOption(1-tp,aux.Stringid(m,1))+1
else return end else return end
if op==0 then if op==0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
Duel.SendtoHand(eg:Filter(cm.cfilter,nil,e,tp),nil,REASON_EFFECT) Duel.ConfirmCards(1-tp,Duel.GetOperatedGroup())
Duel.Draw(1-tp,1,REASON_EFFECT) Duel.Draw(1-tp,1,REASON_EFFECT)
Duel.ConfirmCards(1-tp,eg) elseif op==1 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)>0 then
elseif op==1 then g=Duel.GetFieldGroup(tp,0,LOCATION_MZONE):Filter(Card.IsFaceup,nil):Filter(Card.IsLevelAbove,nil,0)
local g=Duel.GetMatchingGroup(cm.xfilter,tp,0,LOCATION_MZONE,nil) for tc in aux.Next(g) do
local tc=g:GetFirst()
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
while tc do
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1) e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
tc=g:GetNext()
end end
end end
end
end
--e3
function cm.f3(c,tp)
return c:IsPreviousControler(tp) and c:IsReason(REASON_EFFECT) and c.setname=="TaleSouls"
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