Commit 7b3699ef authored by 未闻皂名's avatar 未闻皂名

2024/10/7 新增:LGP2新卡

parent f2684b5d
Pipeline #30240 passed with stages
in 11 minutes and 14 seconds
No preview for this file type
......@@ -190,3 +190,20 @@ function RushDuel.CanSelectGroup(player, desc, hint, group, min, max)
return nil
end
end
-- 让玩家从多个卡名中宣言一个
function RushDuel.AnnounceCodes(player, codes)
if #codes == 0 then
return nil
end
local afilter = {codes[1], OPCODE_ISCODE}
if #codes > 1 then
for i = 2, #codes do
table.insert(afilter, codes[i])
table.insert(afilter, OPCODE_ISCODE)
table.insert(afilter, OPCODE_OR)
end
end
Duel.Hint(HINT_SELECTMSG, player, HINTMSG_CODE)
return Duel.AnnounceCard(player, table.unpack(afilter))
end
......@@ -2,19 +2,22 @@
RushDuel = RushDuel or {}
-- 内部方法: 生成融合素材的函数
function RushDuel._private_make_fusion_material(card, sub, insf, mat, ...)
function RushDuel._private_make_fusion_material(card, sub, insf, mat, codes, ...)
local fun = {}
local unspecified = false
for _, val in ipairs {...} do
local val_type = type(val)
if val_type == "number" then
table.insert(fun, RushDuel._private_make_fusion_material_code(val))
if not mat[val] then
mat[val] = true
table.insert(codes, val)
end
elseif val_type == "function" then
table.insert(fun, RushDuel._private_make_fusion_material_func(val))
unspecified = true
elseif val_type == "table" then
local funs = RushDuel._private_make_fusion_material(card, sub, insf, mat, table.unpack(val))
local funs = RushDuel._private_make_fusion_material(card, sub, insf, mat, codes, table.unpack(val))
table.insert(fun, RushDuel._private_make_fusion_material_mix(funs))
end
end
......@@ -48,7 +51,7 @@ function RushDuel._private_make_fusion_material_mix(funs)
end
-- 内部方法: 添加融合素材数据
function RushDuel._private_set_fusion_material_data(card, mat, min, max, unspecified)
function RushDuel._private_set_fusion_material_data(card, mat, min, max, unspecified, codes)
local mt = getmetatable(card)
-- 卡名记述的素材
if mt.material == nil then
......@@ -62,6 +65,10 @@ function RushDuel._private_set_fusion_material_data(card, mat, min, max, unspeci
if unspecified ~= nil then
mt.unspecified_funsion = unspecified
end
-- 素材的卡名
if codes ~= nil then
mt.material_codes = codes
end
end
-- 内部方法: 创建融合效果
......@@ -94,8 +101,9 @@ function RushDuel.AddFusionProcedure(card, sub, insf, ...)
end
-- 有卡名记述的融合素材
local mat = {}
local funs, unspecified = RushDuel._private_make_fusion_material(card, sub, insf, mat, table.unpack(vals))
RushDuel._private_set_fusion_material_data(card, mat, #funs, #funs, unspecified)
local codes = {}
local funs, unspecified = RushDuel._private_make_fusion_material(card, sub, insf, mat, codes, table.unpack(vals))
RushDuel._private_set_fusion_material_data(card, mat, #funs, #funs, unspecified, codes)
local checker = RushDuel.FusionProcedureChecker(RushDuel.FusionProcedureCheckStart, nil)
return RushDuel._private_create_fusion_effect(card, insf, sub, checker, #funs, #funs, table.unpack(funs))
end
......@@ -152,6 +160,11 @@ function RushDuel.SetFusionMaterial(card, codes, min, max)
RushDuel._private_set_fusion_material_data(card, mat, min, max)
end
-- 获取融合素材的卡名
function RushDuel.GetFusionMaterialCodes(card)
return card.material_codes or {}
end
-- 融合手续 - 检测
function RushDuel.FusionProcedureChecker(condition, checker)
return function(sg, tp, fc, sub, chkfnf, ...)
......
......@@ -380,12 +380,17 @@ function RushDuel.DecreaseSummonTribute(card, condition, value)
local e1 = Effect.CreateEffect(card)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DECREASE_TRIBUTE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_SINGLE_RANGE)
if condition then
e1:SetCondition(condition)
end
e1:SetRange(LOCATION_HAND)
e1:SetValue(value or 0x1)
e1:SetValue(RushDuel.DecreaseSummonValue(value or 0x1))
card:RegisterEffect(e1)
return e1
end
function RushDuel.DecreaseSummonValue(value)
return function(e, c)
return value, 1
end
end
local m=120271011
local list={120271014,120271013}
local cm=_G["c"..m]
cm.name="古代的齿车冠"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Discard Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Discard Deck
function cm.confilter1(c)
return c:IsRace(RACE_MACHINE)
end
function cm.confilter2(c)
return c:IsType(TYPE_MONSTER) and not cm.confilter1(c)
end
function cm.thfilter(c)
return c:IsCode(list[1],list[2]) and c:IsAbleToHand()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler())
and Duel.IsExistingMatchingCard(cm.confilter1,tp,LOCATION_GRAVE,0,1,nil)
and not Duel.IsExistingMatchingCard(cm.confilter2,tp,LOCATION_GRAVE,0,1,nil)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardDeck(tp,2,REASON_EFFECT)~=0 then
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_ATOHAND,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil,function(g)
Duel.BreakEffect()
RD.SendToHandAndExists(g,1-tp)
end)
end
end
\ No newline at end of file
local m=120271018
local list={120196006,120271027}
local cm=_G["c"..m]
cm.name="钢铁徽章之美杜莎明星"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
local e1,e2=RD.CreateMultiChooseEffect(c,nil,cm.cost,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e2:SetCategory(CATEGORY_DESTROY)
end
--Multi-Choose Effect
function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost()
end
cm.cost=RD.CostSendGraveToDeckBottom(cm.costfilter,1,1)
--Cannot Trigger
function cm.setfilter(c)
return c:IsFacedown() and c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsHasEffect(EFFECT_CANNOT_TRIGGER)
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.setfilter,tp,0,LOCATION_ONFIELD,1,nil) end
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_FACEDOWN,cm.filter,tp,0,LOCATION_ONFIELD,1,1,nil,function(g)
RD.AttachCannotTrigger(e,g:GetFirst(),aux.Stringid(m,3),RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
end)
end
--Destroy
function cm.desfilter(c)
return c:IsFaceup() and c:IsRace(RACE_FIEND)
end
function cm.target2(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.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_DESTROY,cm.desfilter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
Duel.Destroy(g,REASON_EFFECT)
end)
end
\ No newline at end of file
local m=120271019
local list={120196006,120271026}
local cm=_G["c"..m]
cm.name="钢铁徽章之格尼乌斯明星"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Fusion Material
RD.AddFusionProcedure(c,list[1],list[2])
--Multi-Choose Effect
local e1,e2=RD.CreateMultiChooseEffect(c,cm.condition,nil,aux.Stringid(m,1),cm.target1,cm.operation1,aux.Stringid(m,2),cm.target2,cm.operation2)
e1:SetCategory(CATEGORY_DRAW)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_GRAVE_ACTION+CATEGORY_DAMAGE)
end
--Multi-Choose Effect
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>9
end
--Draw
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
RD.TargetDraw(tp,1)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
RD.Draw()
end
--To Deck
function cm.tdfilter(c)
return c:IsRace(RACE_ROCK) and c:IsAbleToDeck()
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter,tp,0,LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,0,LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1400)
end
function cm.operation2(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(HINTMSG_TODECK,aux.NecroValleyFilter(cm.tdfilter),tp,0,LOCATION_GRAVE,1,6,nil,function(g)
if RD.SendToDeckAndExists(g) then
Duel.BreakEffect()
Duel.Damage(1-tp,1400,REASON_EFFECT)
end
end)
end
\ No newline at end of file
local m=120271026
local cm=_G["c"..m]
cm.name="吸引石人"
function cm.initial_effect(c)
--Discard Deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Discard Deck
function cm.costfilter(c,e,tp)
return not c:IsPublic() and c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_LIGHT)
and RD.IsDefense(c,500)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RD.IsSummonTurn(e:GetHandler())
end
cm.cost=RD.CostShowHand(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if RD.SendDeckTopToGraveAndExists(tp,2) then
RD.CanDamage(aux.Stringid(m,1),tp,500,true)
end
end
\ No newline at end of file
local m=120271027
local cm=_G["c"..m]
cm.name="邪心球师"
function cm.initial_effect(c)
--Change Race
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.cost)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Activate
function cm.costfilter(c,e,tp)
return not c:IsPublic() and c:IsAttribute(ATTRIBUTE_LIGHT) and RD.IsDefense(c,500)
and Duel.IsExistingMatchingCard(cm.filter,tp,0,LOCATION_MZONE,1,nil,c:GetRace())
end
function cm.filter(c,race)
return c:IsFaceup() and (not c:IsRace(race) or not c:IsRace(RACE_FIEND))
end
cm.cost=RD.CostShowHand(cm.costfilter,1,1,function(g)
return g:GetFirst():GetRace()
end)
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local race=e:GetLabel()
local filter=RD.Filter(cm.filter,race)
RD.SelectAndDoAction(aux.Stringid(m,1),filter,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local tc=g:GetFirst()
local b1=not tc:IsRace(RACE_FIEND)
local b2=not tc:IsRace(race)
local op=aux.SelectFromOptions(tp,{b1,aux.Stringid(m,1)},{b2,aux.Stringid(m,2)})
if op==1 then
RD.ChangeRace(e,c,RACE_FIEND,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
if op==2 then
RD.ChangeRace(e,c,race,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
end)
end
\ No newline at end of file
local m=120271028
local cm=_G["c"..m]
cm.name="幻想面具大师"
function cm.initial_effect(c)
--Change Code
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Change Code
function cm.costfilter(c)
local codes=RD.GetFusionMaterialCodes(c)
return c:IsType(TYPE_FUSION) and c:IsLevel(9) and c:IsRace(RACE_CYBORG) and #codes>0
end
cm.cost=RD.CostShowExtra(cm.costfilter,1,1,nil,Group.GetFirst)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetLabelObject()
local codes=RD.GetFusionMaterialCodes(tc)
local ac=RD.AnnounceCodes(tp,codes)
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
RD.ChangeCode(e,c,ac,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
end
\ No newline at end of file
local m=120271037
local list={120196050}
local cm=_G["c"..m]
cm.name="虚钢演机明星"
function cm.initial_effect(c)
RD.AddCodeList(c,list)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.filter(c)
return ((c:IsType(TYPE_NORMAL) and c:IsAttribute(ATTRIBUTE_LIGHT) and RD.IsDefense(c,500))
or c:IsCode(list[1])) and c:IsAbleToGrave()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>3 end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<4 then return end
local sg,g=RD.RevealDeckTopAndCanSelect(tp,4,aux.Stringid(m,1),HINTMSG_TOGRAVE,cm.filter,1,1)
local draw=false
if sg:GetCount()>0 then
Duel.DisableShuffleCheck()
if Duel.SendtoGrave(sg,REASON_EFFECT)~=0 then
draw=Duel.GetOperatedGroup():IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE)
end
end
local ct=g:GetCount()
if ct>0 then
Duel.SortDecktop(tp,tp,ct)
RD.SendDeckTopToBottom(tp,ct)
end
if draw then
RD.CanDraw(aux.Stringid(m,2),tp,1)
end
end
\ No newline at end of file
local m=120271040
local cm=_G["c"..m]
cm.name="虚钢演机急转"
function cm.initial_effect(c)
--Activate
local e1=RD.CreateFusionEffect(c,cm.matfilter,cm.spfilter,cm.exfilter,LOCATION_GRAVE,0,nil,RD.FusionToDeck,nil,cm.operation)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(cm.condition)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
--Activate
function cm.matfilter(c)
return c:IsOnField() and c:IsAbleToDeck()
end
function cm.spfilter(c)
return c:IsRace(RACE_CYBORG)
end
function cm.exfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck()
end
function cm.desfilter(c)
return c:IsFaceup() and c:IsLevelBelow(8)
end
function cm.confilter(c,tp)
return c:GetSummonPlayer()==tp
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.confilter,1,nil,1-tp)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp,mat,fc)
RD.CanSelectAndDoAction(aux.Stringid(m,1),HINTMSG_DESTROY,cm.desfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
Duel.Destroy(sg,REASON_EFFECT)
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