Commit 40d98b5a authored by 未闻皂名's avatar 未闻皂名

2025/2/3 新增:KP20新卡

parent a47337a8
Pipeline #32936 passed with stages
in 10 minutes and 52 seconds
No preview for this file type
No preview for this file type
local m=120277024
local cm=_G["c"..m]
cm.name="卡片防御士"
function cm.initial_effect(c)
--Cannot To Hand & Deck & Extra
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TO_HAND_EFFECT)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetCondition(cm.indcon)
e1:SetTarget(cm.indtg)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_TO_DECK_EFFECT)
c:RegisterEffect(e2)
--Atk Up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(cm.atkcon)
e3:SetTarget(cm.atktg)
e3:SetValue(1000)
c:RegisterEffect(e3)
--Continuous Effect
RD.AddContinuousEffect(c,e1,e2,e3)
end
--Cannot To Hand & Deck & Extra
function cm.indcon(e)
return Duel.GetTurnPlayer()~=e:GetHandlerPlayer()
end
function cm.indtg(e,c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
--Atk Up
function cm.atkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_NORMAL+TYPE_FUSION) and c:IsRace(RACE_WARRIOR)
end
function cm.atkcon(e)
return Duel.IsExistingMatchingCard(cm.atkfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function cm.atktg(e,c)
return c:IsFaceup()
end
\ No newline at end of file
......@@ -8,22 +8,28 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.limcon)
e1:SetOperation(cm.limop)
e1:SetOperation(cm.limop1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--Level Up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_LEVEL)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_END)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(cm.target)
e3:SetValue(2)
e3:SetOperation(cm.limop2)
c:RegisterEffect(e3)
--Level Up
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_UPDATE_LEVEL)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetTarget(cm.target)
e4:SetValue(2)
c:RegisterEffect(e4)
--Continuous Effect
RD.AddContinuousEffect(c,e1,e2,e3)
RD.AddContinuousEffect(c,e1,e2,e3,e4)
end
--Cannot Activate
function cm.limfilter(c,tp)
......@@ -32,12 +38,33 @@ end
function cm.limcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.limfilter,1,nil,tp)
end
function cm.limop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetChainLimitTillChainEnd(cm.chainlm)
function cm.limop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()==0 then
Duel.SetChainLimitTillChainEnd(cm.chainlm)
elseif Duel.GetCurrentChain()==1 then
local c=e:GetHandler()
c:RegisterFlagEffect(20277030,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(cm.resetop)
Duel.RegisterEffect(e1,tp)
end
end
function cm.limop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(20277030)~=0 then
Duel.SetChainLimitTillChainEnd(cm.chainlm)
end
c:ResetFlagEffect(20277030)
end
function cm.chainlm(e,ep,tp)
return not (ep~=tp and e:GetHandler():IsType(TYPE_TRAP) and e:IsHasType(EFFECT_TYPE_ACTIVATE))
end
function cm.resetop(e)
e:GetHandler():ResetFlagEffect(20277030)
e:Reset()
end
--Level Up
function cm.target(e,c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_BEAST)
......
local m=120277063
local cm=_G["c"..m]
cm.name="魔力动物爵士"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
--Activate
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp
end
function cm.filter(c,e,tp)
if c:IsControler(tp) then
return c:IsFaceup() and c:IsLevelAbove(1)
and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_BEAST)
else
return c:IsFaceup() and c:IsLevelAbove(1)
and RD.IsCanChangePosition(c,e,tp,REASON_EFFECT) and c:IsCanTurnSet()
end
end
function cm.exfilter(c,tc)
return c:GetLevel()<tc:GetLevel()
end
function cm.check(g,tp)
if g:FilterCount(Card.IsControler,nil,tp)~=1 then return false end
local tc=g:Filter(Card.IsControler,nil,tp):GetFirst()
return g:FilterCount(cm.exfilter,tc,tc)==(g:GetCount()-1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e,tp)
if chk==0 then return g:CheckSubGroup(cm.check,2,3,tp) end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local filter=RD.Filter(cm.filter,e,tp)
local check=RD.Check(cm.check,tp)
RD.SelectGroupAndDoAction(aux.Stringid(m,1),filter,check,tp,LOCATION_MZONE,LOCATION_MZONE,2,3,nil,function(g)
local sg=g:Filter(Card.IsControler,nil,1-tp)
RD.ChangePosition(sg,POS_FACEDOWN_DEFENSE)
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