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

2022/4/29 新增:异画七星道魔术师,钢击龙调整

parent bb23f7d0
Pipeline #12122 passed with stages
in 4 minutes and 32 seconds
No preview for this file type
No preview for this file type
......@@ -4,18 +4,23 @@ RushDuel = RushDuel or {}
-- 内部方法: 检测效果范围是否覆盖
function RushDuel._private_check_effect_values(value, values, decode)
local attach, attachs = {decode(value)}, {}
local start = 2
local count = #attach
for i = 1, count do
for i = start, count do
attach[i] = attach[i] or 0
attachs[i] = 0
end
for _, val in ipairs(values) do
local _attach = {decode(val)}
for i = 1, count do
attachs[i] = attachs[i] | (_attach[i] or 0)
if _attach[1] then
-- 忽略判定
else
for i = start, count do
attachs[i] = attachs[i] | (_attach[i] or 0)
end
end
end
for i = 1, count do
for i = start, count do
if (attachs[i] | attach[i]) ~= attachs[i] then
return true
end
......@@ -130,7 +135,7 @@ function RushDuel.IsCanAttachDoubleTribute(card, value)
local values = RushDuel.GetEffectValues(card, EFFECT_DOUBLE_TRIBUTE)
return RushDuel._private_check_effect_values(value, values, function(val)
if val == 1 then
return {RACE_ALL, ATTRIBUTE_ALL}
return {false, RACE_ALL, ATTRIBUTE_ALL}
else
return val(nil)
end
......@@ -145,7 +150,7 @@ function RushDuel.IsCanAttachEffectIndes(card, value)
local values = RushDuel.GetEffectValues(card, EFFECT_INDESTRUCTABLE_EFFECT)
return RushDuel._private_check_effect_values(value, values, function(val)
if val == 1 then
return {TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP, TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP}
return {false, TYPE_MONSTER + TYPE_SPELL + TYPE_TRAP, TYPE_MONSTER + TYPE_SPELL + TYPE_TRAP}
else
return val(nil)
end
......
......@@ -2,22 +2,22 @@
RushDuel = RushDuel or {}
-- 效果值: 双重解放 属性/种族
function RushDuel.ValueDoubleTribute(attribute, race)
function RushDuel.ValueDoubleTribute(attribute, race, ignore)
return function(e, c)
if e == nil then
return attribute, race
return ignore, attribute, race
end
return (attribute == nil or c:IsAttribute(attribute)) and (race == nil or c:IsRace(race))
end
end
-- 效果值: 效果破坏抗性 抵抗类型
function RushDuel.ValueEffectIndesType(self_type, opponent_type)
function RushDuel.ValueEffectIndesType(self_type, opponent_type, ignore)
local s_type = self_type or 0
local o_type = opponent_type or 0
return function(e, re, rp)
if e == nil then
return s_type, o_type
return ignore, s_type, o_type
end
local tp = e:GetHandlerPlayer()
if rp == tp then
......
......@@ -13,6 +13,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
--Attack Twice
cm.indval=RD.ValueEffectIndesType(0,TYPE_TRAP,true)
function cm.costfilter(c)
return c:IsLevelAbove(7) and c:IsRace(RACE_DRAGON) and c:IsAbleToGraveAsCost()
end
......@@ -25,14 +26,11 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if c:IsFaceup() and c:IsRelateToEffect(e) then
local reset=RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END
RD.AttachBattleIndes(e,c,1,aux.Stringid(m,1),reset)
RD.AttachEffectIndes(e,c,cm.efilter,aux.Stringid(m,2),reset)
RD.AttachEffectIndes(e,c,cm.indval,aux.Stringid(m,2),reset)
local e1=RD.AttachExtraAttackMonster(e,c,1,aux.Stringid(m,3),reset)
e1:SetCondition(cm.atkcon)
end
end
function cm.efilter(e,re,rp)
return rp==1-e:GetHandlerPlayer() and re:IsActiveType(TYPE_TRAP)
end
function cm.atkcon(e)
return e:GetHandler():GetAttackedGroupCount()>0
end
\ No newline at end of file
local m=120217009
local cm=_G["c"..m]
cm.name="七星道魔术师"
function cm.initial_effect(c)
--Atk Up
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
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
--Atk Up
function cm.filter(c)
return c:IsType(TYPE_MONSTER)
end
cm.cost=RD.CostSendDeckTopToGrave(1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil) end
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.filter,tp,LOCATION_GRAVE,0,nil)
local atk=g:GetClassCount(Card.GetAttribute)*300
RD.AttachAtkDef(e,c,atk,0,RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
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