Commit 20723e45 authored by 未闻皂名's avatar 未闻皂名

2025/2/9 种族变更相关调整

parent f70ef33e
Pipeline #33048 passed with stages
in 16 minutes and 56 seconds
......@@ -189,6 +189,31 @@ function RushDuel.IsCanAttachDisableContinuous(card)
return RushDuel.IsHasContinuousEffect(card) and not card:IsHasEffect(EFFECT_DISABLE)
end
-- 条件: 可以被改变种族
function RushDuel.IsCanChangeRace(card, race)
local effects = {card:IsHasEffect(EFFECT_CHANGE_RACE)}
local curret = card:GetOriginalRace()
local active = nil
for i, effect in ipairs(effects) do
local value = effect:GetValue()
if value ~= curret or effect:GetLabel() == FLAG_ATTACH_EFFECT then
curret = value
active = effect
end
end
-- 被改变了种族
if active then
if active:GetLabel() ~= FLAG_ATTACH_EFFECT then
-- 不是赋予类效果,可以随便更改
return true
else
return not card:IsRace(curret)
end
else
return not card:IsRace(race)
end
end
-- 条件: 是否可以使用双重解放
function RushDuel.IsCanDoubleTribute(card, target)
local effects = {card:IsHasEffect(EFFECT_DOUBLE_TRIBUTE)}
......
......@@ -16,7 +16,7 @@ function cm.costfilter(c,e,tp)
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,c:GetRace())
end
function cm.filter(c,race)
return c:IsFaceup() and not c:IsRace(race)
return c:IsFaceup() and RD.IsCanChangeRace(c,race)
end
cm.cost=RD.CostShowHand(cm.costfilter,1,1,function(g)
return g:GetFirst():GetRace()
......
......@@ -19,7 +19,7 @@ function cm.costfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.filter(c)
return c:IsFaceup() and not c:IsRace(RACE_SPELLCASTER)
return c:IsFaceup() and RD.IsCanChangeRace(c,RACE_SPELLCASTER)
end
cm.cost=RD.CostSendGraveToDeck(cm.costfilter,1,1)
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -18,7 +18,7 @@ function cm.confilter(c)
return c:IsFaceup() and c:IsRace(RACE_INSECT)
end
function cm.filter(c)
return c:IsFaceup() and not c:IsRace(RACE_INSECT)
return c:IsFaceup() and RD.IsCanChangeRace(c,RACE_INSECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
......
......@@ -25,7 +25,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
RD.SelectAndDoAction(aux.Stringid(m,1),Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil,function(g)
local tc=g:GetFirst()
RD.AttachAtkDef(e,tc,-300,0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
if not tc:IsRace(RACE_INSECT) and Duel.SelectEffectYesNo(tp,tc,aux.Stringid(m,2)) then
if RD.IsCanChangeRace(tc,RACE_INSECT) and Duel.SelectEffectYesNo(tp,tc,aux.Stringid(m,2)) then
Duel.BreakEffect()
RD.ChangeRace(e,tc,RACE_INSECT,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
end
......
......@@ -15,7 +15,7 @@ function cm.initial_effect(c)
end
--Race Change
function cm.filter(c)
return c:IsFaceup() and not c:IsRace(RACE_INSECT)
return c:IsFaceup() and RD.IsCanChangeRace(c,RACE_INSECT)
end
function cm.exfilter(c)
return c:IsPosition(POS_FACEUP_DEFENSE)
......
......@@ -27,8 +27,8 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
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 b1=RD.IsCanChangeRace(tc,RACE_FIEND)
local b2=RD.IsCanChangeRace(tc,race)
local op=aux.SelectFromOptions(tp,{b1,aux.Stringid(m,1)},{b2,aux.Stringid(m,2)})
if op==1 then
RD.ChangeRace(e,tc,RACE_FIEND,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
......
......@@ -19,7 +19,7 @@ function cm.confilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_INSECT)
end
function cm.exfilter(c)
return c:IsFaceup() and not c:IsRace(RACE_INSECT)
return c:IsFaceup() and RD.IsCanChangeRace(c,RACE_INSECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
......
......@@ -19,7 +19,7 @@ function cm.confilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_INSECT)
end
function cm.exfilter(c)
return c:IsFaceup() and not c:IsRace(RACE_INSECT)
return c:IsFaceup() and RD.IsCanChangeRace(c,RACE_INSECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
......
......@@ -19,7 +19,7 @@ function cm.confilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_INSECT)
end
function cm.exfilter(c)
return c:IsFaceup() and not c:IsRace(RACE_INSECT)
return c:IsFaceup() and RD.IsCanChangeRace(c,RACE_INSECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
......
......@@ -21,7 +21,7 @@ function cm.filter(c)
return c:IsFaceup() and c:IsLevelAbove(3)
end
function cm.exfilter(c)
return c:IsFaceup() and not c:IsRace(RACE_INSECT)
return c:IsFaceup() and RD.IsCanChangeRace(c,RACE_INSECT)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
......
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