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

2021/12/05 兼容新版本的ygopro,改写1回合1次规则的判定

parent a6c8ad4d
Pipeline #7491 passed with stages
in 3 minutes and 43 seconds
......@@ -8,6 +8,7 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetLabel(m)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
......
......@@ -8,6 +8,7 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetLabel(m)
e1:SetCondition(RushDuel.IsMaximumMode)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
......
......@@ -8,6 +8,7 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetLabel(m)
e1:SetCondition(RushDuel.IsMaximumMode)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
......
......@@ -8,6 +8,7 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetLabel(m)
e1:SetCondition(RushDuel.IsMaximumMode)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
......
......@@ -8,6 +8,7 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetLabel(m)
e1:SetCondition(RushDuel.IsMaximumMode)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
......
......@@ -8,6 +8,8 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetLabel(m)
e1:SetCondition(RushDuel.IsMaximumMode)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
......
......@@ -8,6 +8,7 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetLabel(m)
e1:SetCondition(RushDuel.IsMaximumMode)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
......
......@@ -8,6 +8,7 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetLabel(m)
e1:SetCondition(RushDuel.IsMaximumMode)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
......
......@@ -8,6 +8,7 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetLabel(m)
e1:SetCondition(RushDuel.IsMaximumMode)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
......
......@@ -7,19 +7,23 @@ function cm.initial_effect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(RushDuel.IsMaximumMode)
e1:SetLabel(m)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--Multiple Attack
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return RushDuel.IsMaximumMode(e) and Duel.IsAbleToEnterBP()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.DiscardDeck(tp,1,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsAbleToEnterBP() end
if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -8,6 +8,8 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetLabel(m)
e1:SetCondition(RushDuel.IsMaximumMode)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
......
......@@ -116,11 +116,19 @@ end
--Once Per Turn
function RushDuel.ActivateLimit(e,re,tp)
local code=re:GetOwner():GetCode()
if re:GetType()&EFFECT_TYPE_XMATERIAL==EFFECT_TYPE_XMATERIAL then
--Maximum L/R Effect
code=re:GetLabel()
end
return re:GetHandler():GetFlagEffect(code)~=0
end
function RushDuel.ActivateCount(e,tp,eg,ep,ev,re,r,rp)
local te=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT)
local code=te:GetOwner():GetCode()
if te:GetType()&EFFECT_TYPE_XMATERIAL==EFFECT_TYPE_XMATERIAL then
--Maximum L/R Effect
code=te:GetLabel()
end
te:GetHandler():RegisterFlagEffect(code,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
--Legend
......
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