Commit a9a7572e authored by 未闻皂名's avatar 未闻皂名
parents fed371f9 93a779ff
Pipeline #41292 passed with stages
in 9 minutes and 6 seconds
No preview for this file type
...@@ -160,7 +160,7 @@ function RushDuel.SelectAndToHandOrSpecialSummon(hint, filter, tp, s_range, o_ra ...@@ -160,7 +160,7 @@ function RushDuel.SelectAndToHandOrSpecialSummon(hint, filter, tp, s_range, o_ra
end end
return RushDuel.SendToHandAndExists(tc, e, tp, REASON_EFFECT) return RushDuel.SendToHandAndExists(tc, e, tp, REASON_EFFECT)
else else
return RushDuel._special_summon(tc, e, tp, pos, break_effect, target_player) return RushDuel._special_summon(tc, e, tp, pos, break_effect, target_player)~=0
end end
end, e, tp) end, e, tp)
end end
...@@ -175,7 +175,7 @@ function RushDuel.CanSelectAndToHandOrSpecialSummon(desc, hint, filter, tp, s_ra ...@@ -175,7 +175,7 @@ function RushDuel.CanSelectAndToHandOrSpecialSummon(desc, hint, filter, tp, s_ra
end end
return RushDuel.SendToHandAndExists(tc, e, tp, REASON_EFFECT) return RushDuel.SendToHandAndExists(tc, e, tp, REASON_EFFECT)
else else
return RushDuel._special_summon(tc, e, tp, pos, break_effect, target_player) return RushDuel._special_summon(tc, e, tp, pos, break_effect, target_player)~=0
end end
end, e, tp) end, e, tp)
end end
......
...@@ -124,14 +124,9 @@ function RushDuel.IsCanBeDoubleFusionMaterial(card, code) ...@@ -124,14 +124,9 @@ function RushDuel.IsCanBeDoubleFusionMaterial(card, code)
return false return false
end end
-- 条件: 可以宣言融合素材的卡名 -- 条件: 可以宣言融合素材的卡名
function RushDuel.IsCanAnnounceFusionMaterialCode(card, code) function RushDuel.IsCanAnnounceFusionMaterialCode(card, target)
local mats = card.material or {} local codes = RushDuel.GetAnnouncableFusionMaterialCodes(card, target)
local codes = card.material_codes or {} return #codes > 0
local count = #codes
if code ~= nil and mats[code] then
count = count - 1
end
return count > 0
end end
-- 条件: 位置变化前的控制者 -- 条件: 位置变化前的控制者
......
...@@ -111,12 +111,12 @@ function RushDuel.SetFusionMaterialData(card, codes, min, max) ...@@ -111,12 +111,12 @@ function RushDuel.SetFusionMaterialData(card, codes, min, max)
local mt = getmetatable(card) local mt = getmetatable(card)
-- 卡名记述的素材 -- 卡名记述的素材
if codes ~= nil then if codes ~= nil then
RushDuel.AddCodeList(card, codes)
local mat = {} local mat = {}
for _, code in ipairs(codes) do for _, code in ipairs(codes) do
mat[code] = true mat[code] = true
end end
mt.material = mat mt.material = mat
mt.material_codes = codes
end end
-- 素材的数量 -- 素材的数量
if mt.material_count == nil then if mt.material_count == nil then
...@@ -574,14 +574,21 @@ function RushDuel.FusionToDeckBottom(tp, mat) ...@@ -574,14 +574,21 @@ function RushDuel.FusionToDeckBottom(tp, mat)
Auxiliary.PlaceCardsOnDeckBottom(tp, mat, REASON_EFFECT + REASON_MATERIAL + REASON_FUSION) Auxiliary.PlaceCardsOnDeckBottom(tp, mat, REASON_EFFECT + REASON_MATERIAL + REASON_FUSION)
end end
-- 获取融合素材的卡名 -- 获取可以宣言的融合素材的卡名
function RushDuel.GetFusionMaterialCodes(card) function RushDuel.GetAnnouncableFusionMaterialCodes(card, target)
return card.material_codes or {} local codes = {}
local code = card:GetCode()
for code, _ in pairs(target.material or {}) do
if not card:IsCode(code) then
table.insert(codes, code)
end
end
return codes
end end
-- 宣言融合素材的卡名 -- 宣言融合素材的卡名
function RushDuel.AnnounceFusionMaterialCode(player, card) function RushDuel.AnnounceFusionMaterialCode(player, card, target)
local codes = card.material_codes or {} local codes = RushDuel.GetAnnouncableFusionMaterialCodes(card, target)
if #codes > 0 then if #codes > 0 then
return RushDuel.AnnounceCodes(player, codes) return RushDuel.AnnounceCodes(player, codes)
else else
......
...@@ -14,13 +14,13 @@ end ...@@ -14,13 +14,13 @@ end
--Change Code --Change Code
function cm.costfilter(c,e) function cm.costfilter(c,e)
return c:IsType(TYPE_FUSION) and c:IsLevel(9) and c:IsRace(RACE_CYBORG) return c:IsType(TYPE_FUSION) and c:IsLevel(9) and c:IsRace(RACE_CYBORG)
and RD.IsCanAnnounceFusionMaterialCode(c,e:GetHandler():GetCode()) and RD.IsCanAnnounceFusionMaterialCode(e:GetHandler(),c)
end end
cm.cost=RD.CostShowExtra(cm.costfilter,1,1,nil,Group.GetFirst) cm.cost=RD.CostShowExtra(cm.costfilter,1,1,nil,Group.GetFirst)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
local ac=RD.AnnounceFusionMaterialCode(tp,tc) local ac=RD.AnnounceFusionMaterialCode(tp,e:GetHandler(),tc)
Duel.SetTargetParam(ac) Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0) Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end end
......
...@@ -13,13 +13,13 @@ function cm.initial_effect(c) ...@@ -13,13 +13,13 @@ function cm.initial_effect(c)
end end
--Change Code --Change Code
function cm.costfilter(c,e) function cm.costfilter(c,e)
return c:IsType(TYPE_FUSION) and RD.IsCanAnnounceFusionMaterialCode(c,e:GetHandler():GetCode()) return c:IsType(TYPE_FUSION) and RD.IsCanAnnounceFusionMaterialCode(e:GetHandler(),c)
end end
cm.cost=RD.CostShowExtra(cm.costfilter,1,1,nil,Group.GetFirst) cm.cost=RD.CostShowExtra(cm.costfilter,1,1,nil,Group.GetFirst)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
local ac=RD.AnnounceFusionMaterialCode(tp,tc) local ac=RD.AnnounceFusionMaterialCode(tp,e:GetHandler(),tc)
Duel.SetTargetParam(ac) Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0) Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end end
......
...@@ -16,13 +16,13 @@ end ...@@ -16,13 +16,13 @@ end
--Fusion Code --Fusion Code
function cm.costfilter(c,e) function cm.costfilter(c,e)
return c:IsType(TYPE_FUSION) and c:IsLevel(9) and c:IsRace(RACE_GALAXY) return c:IsType(TYPE_FUSION) and c:IsLevel(9) and c:IsRace(RACE_GALAXY)
and RD.IsCanAnnounceFusionMaterialCode(c,e:GetHandler():GetCode()) and RD.IsCanAnnounceFusionMaterialCode(e:GetHandler(),c)
end end
cm.cost=RD.CostShowExtra(cm.costfilter,1,1,nil,Group.GetFirst) cm.cost=RD.CostShowExtra(cm.costfilter,1,1,nil,Group.GetFirst)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
local ac=RD.AnnounceFusionMaterialCode(tp,tc) local ac=RD.AnnounceFusionMaterialCode(tp,e:GetHandler(),tc)
Duel.SetTargetParam(ac) Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0) Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end end
......
...@@ -38,9 +38,8 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -38,9 +38,8 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local res=RD.SelectAndToHandOrSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,nil,e,POS_FACEUP) if RD.SelectAndToHandOrSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,nil,e,POS_FACEUP)
if res==false or res==0 then return end and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanSelectAndDoAction(aux.Stringid(m,2),HINTMSG_RTOHAND,cm.thfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg) RD.CanSelectAndDoAction(aux.Stringid(m,2),HINTMSG_RTOHAND,cm.thfilter,tp,0,LOCATION_MZONE,1,1,nil,function(sg)
Duel.BreakEffect() Duel.BreakEffect()
RD.SendToHandAndExists(sg,e,tp,REASON_EFFECT) RD.SendToHandAndExists(sg,e,tp,REASON_EFFECT)
......
...@@ -14,13 +14,13 @@ end ...@@ -14,13 +14,13 @@ end
--Change Code --Change Code
function cm.costfilter(c,e) function cm.costfilter(c,e)
return c:IsType(TYPE_FUSION) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_SPELLCASTER) return c:IsType(TYPE_FUSION) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_SPELLCASTER)
and RD.IsDefense(c,2100) and RD.IsCanAnnounceFusionMaterialCode(c,e:GetHandler():GetCode()) and RD.IsDefense(c,2100) and RD.IsCanAnnounceFusionMaterialCode(e:GetHandler(),c)
end end
cm.cost=RD.CostShowExtra(cm.costfilter,1,1,nil,Group.GetFirst) cm.cost=RD.CostShowExtra(cm.costfilter,1,1,nil,Group.GetFirst)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
local ac=RD.AnnounceFusionMaterialCode(tp,tc) local ac=RD.AnnounceFusionMaterialCode(tp,e:GetHandler(),tc)
Duel.SetTargetParam(ac) Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0) Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end end
......
...@@ -32,9 +32,8 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -32,9 +32,8 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local res=RD.SelectAndToHandOrSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,nil,e,POS_FACEUP) if RD.SelectAndToHandOrSpecialSummon(aux.Stringid(m,1),aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,nil,e,POS_FACEUP)
if res==false or res==0 then return end and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
if Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_MZONE,0,1,nil) then
RD.CanSendOpponentHandToGrave(aux.Stringid(m,1),tp,aux.Stringid(m,2),1,1,true) RD.CanSendOpponentHandToGrave(aux.Stringid(m,1),tp,aux.Stringid(m,2),1,1,true)
end end
end end
\ No newline at end of file
...@@ -52,7 +52,7 @@ end ...@@ -52,7 +52,7 @@ end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP) RD.SelectAndSpecialSummon(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,POS_FACEUP)
if Duel.GetFlagEffect(tp,m)~=0 then return end if Duel.GetFlagEffect(tp,m)~=0 then return end
RD.CreateCannotActivateEffect(e,aux.Stringid(m,1),cm.aclimit,tp,1,0,RESET_PHASE+PHASE_END) RD.CreateCannotActivateEffect(e,aux.Stringid(m,2),cm.aclimit,tp,1,0,RESET_PHASE+PHASE_END)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end end
function cm.aclimit(e,re,tp) function cm.aclimit(e,re,tp)
......
...@@ -14,13 +14,13 @@ end ...@@ -14,13 +14,13 @@ end
--Change Code --Change Code
function cm.costfilter(c,e) function cm.costfilter(c,e)
return c:IsType(TYPE_FUSION) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_HYDRAGON) return c:IsType(TYPE_FUSION) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_HYDRAGON)
and RD.IsCanAnnounceFusionMaterialCode(c,e:GetHandler():GetCode()) and RD.IsCanAnnounceFusionMaterialCode(e:GetHandler(),c)
end end
cm.cost=RD.CostShowExtra(cm.costfilter,1,1,nil,Group.GetFirst) cm.cost=RD.CostShowExtra(cm.costfilter,1,1,nil,Group.GetFirst)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
local ac=RD.AnnounceFusionMaterialCode(tp,tc) local ac=RD.AnnounceFusionMaterialCode(tp,e:GetHandler(),tc)
Duel.SetTargetParam(ac) Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0) Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end end
......
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