Commit b0b6e070 authored by 未闻皂名's avatar 未闻皂名

2023/11/22 新增:王家魔族新卡

parent 1212f1d0
Pipeline #24120 passed with stages
in 8 minutes and 2 seconds
No preview for this file type
No preview for this file type
local m=120254002
local cm=_G["c"..m]
cm.name="王家魔族·重金属歌手"
function cm.initial_effect(c)
--Tribute
RD.CreateAdvanceCheck(c,cm.tricheck,1,20130031)
--Destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Tribute
function cm.tricheck(c)
return c:IsLevelAbove(5)
end
--Destroy
function cm.desfilter(c)
return c:IsFaceup() and c:IsLevelBelow(8)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return RD.IsSummonTurn(c) and c:GetFlagEffect(20130031)~=0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.desfilter,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_MZONE,nil)
local sg=g:GetMinGroup(Card.GetLevel)
if sg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=sg:Select(tp,1,1,nil)
Duel.HintSelection(dg)
local tc=dg:GetFirst()
RD.AttachAtkDef(e,c,tc:GetAttack(),0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
\ No newline at end of file
local m=120254017
local cm=_G["c"..m]
cm.name="王家魔族·革新歌手"
function cm.initial_effect(c)
--Tribute
RD.CreateAdvanceCheck(c,cm.tricheck,1,20254017)
--Destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Tribute
function cm.tricheck(c)
return c:IsLevelAbove(5)
end
--Destroy
function cm.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return RD.IsSummonTurn(c) and c:GetFlagEffect(20254017)~=0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(cm.filter,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_DESTROY,cm.filter,tp,0,LOCATION_ONFIELD,1,1,nil,function(g)
if Duel.Destroy(g,REASON_EFFECT)~=0 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,Card.IsFacedown,tp,0,LOCATION_ONFIELD,1,1,nil,function(sg)
Duel.Destroy(sg,REASON_EFFECT)
end)
end
end)
if Duel.GetFlagEffect(tp,m)~=0 then return end
RD.CreateRaceCannotAttackEffect(e,aux.Stringid(m,2),RACE_ALL-RACE_FIEND,tp,1,0,RESET_PHASE+PHASE_END)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
\ No newline at end of file
local m=120254074
local cm=_G["c"..m]
cm.name="王家魔族·垃圾摇滚歌手"
function cm.initial_effect(c)
--Damage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Damage
function cm.exfilter(c)
return c:IsPosition(POS_FACEUP_DEFENSE) and c:IsLevelAbove(7) and c:IsRace(RACE_FIEND)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>9
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAttackPos() and RD.IsCanChangePosition(c) end
RD.ChangePosition(c,POS_FACEUP_DEFENSE)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
RD.Damage(1-tp,500)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.Damage()~=0 and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanDraw(aux.Stringid(m,1),tp,1)
end
end
\ No newline at end of file
local m=120254078
local cm=_G["c"..m]
cm.name="王家魔族·守护者乐手"
function cm.initial_effect(c)
--Extra Tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Extra Tribute
cm.trival=RD.ValueDoubleTribute(nil,RACE_FIEND)
function cm.confilter(c)
return c:IsFaceup() and c:IsLevelAbove(7)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,0,LOCATION_MZONE,1,nil)
and RD.IsCanAttachDoubleTribute(e:GetHandler(),cm.trival)
end
cm.cost=RD.CostSendDeckTopToGrave(1)
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
RD.AttachDoubleTribute(e,c,cm.trival,aux.Stringid(m,1),RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
if Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>1 then
RD.AttachLevel(e,c,1,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
end
end
end
\ No newline at end of file
local m=120254083
local cm=_G["c"..m]
cm.name="王之贪婪"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_POSITION+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.costfilter1(c)
return c:IsLevelAbove(5) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FIEND) and c:IsAbleToGraveAsCost()
end
function cm.costfilter2(c)
return c:IsLevelAbove(7) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FIEND) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.costcheck(g)
return (g:GetCount()==1 and g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)==1)
or (g:GetCount()==3 and g:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)==3)
end
function cm.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FIEND) and RD.IsCanChangePosition(c)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetMatchingGroup(cm.costfilter1,tp,LOCATION_HAND,0,nil)
local g2=Duel.GetMatchingGroup(cm.costfilter2,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return g1:GetCount()>0 or g2:GetCount()>2 end
local sg
if g1:GetCount()<1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
sg=g2:Select(tp,3,3,nil)
elseif g2:GetCount()<3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
sg=g1:Select(tp,1,1,nil)
else
g1:Merge(g2)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1))
sg=g1:SelectSubGroup(tp,cm.costcheck,false,1,3)
end
if sg:GetCount()==1 then
Duel.SendtoGrave(sg,REASON_COST)
else
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_POSCHANGE,cm.filter,tp,LOCATION_MZONE,0,1,1,nil,function(g)
if RD.ChangePosition(g,POS_FACEUP_DEFENSE)~=0 then
RD.CanDraw(aux.Stringid(m,2),tp,2,true)
end
end)
end
\ No newline at end of file
local m=120254088
local cm=_G["c"..m]
cm.name="王之权威"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
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.ctfilter(c)
return c:IsFaceup() and c:IsLevelAbove(5) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_FIEND)
end
function cm.filter(c)
return c:IsFaceup() and c:IsLevelAbove(4) and c:IsType(TYPE_EFFECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and eg:IsExists(cm.confilter,1,nil,1-tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.ctfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(cm.ctfilter,tp,LOCATION_MZONE,0,nil)
RD.SelectAndDoAction(aux.Stringid(m,1),cm.filter,tp,0,LOCATION_MZONE,1,ct,nil,function(g)
g:ForEach(function(tc)
local e1=RD.AttachCannotTrigger(e,tc,aux.Stringid(m,2),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
local e2=RD.AttachCannotTribute(e,tc,cm.sumlimit,aux.Stringid(m,3),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetLabel(tp)
end)
end)
end
function cm.sumlimit(e,c)
return e:GetHandlerPlayer()~=e:GetLabel()
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