Commit b5e5e022 authored by wind2009's avatar wind2009

Fix 共闘闘君

parent c182e00d
Pipeline #28801 passed with stages
in 1 minute and 1 second
...@@ -10,6 +10,7 @@ function s.initial_effect(c) ...@@ -10,6 +10,7 @@ function s.initial_effect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id) e2:SetCountLimit(1,id)
e2:SetCost(s.atkcost) e2:SetCost(s.atkcost)
...@@ -50,20 +51,17 @@ function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -50,20 +51,17 @@ function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
return true return true
end end
function s.costfilter(c,tp) function s.costfilter(c,tp)
return c:IsType(TYPE_TOKEN) and Duel.IsExistingTarget(s.matfilter1,tp,LOCATION_MZONE,0,1,c,tp,Group.FromCards(c)) return c:IsType(TYPE_TOKEN) and Duel.IsExistingTarget(s.matfilter1,tp,LOCATION_MZONE,0,1,c)
end end
function s.matfilter1(c,tp,g) function s.matfilter1(c)
local sg=g:Clone()
sg:AddCard(c)
return c:IsFaceup() and c:IsAttack(0) return c:IsFaceup() and c:IsAttack(0)
end end
function s.fselect(g,tp) function s.fselect(g,tp)
return Duel.IsExistingTarget(s.matfilter1,tp,LOCATION_MZONE,0,1,g,tp,g) return Duel.IsExistingTarget(s.matfilter1,tp,LOCATION_MZONE,0,1,g)
and Duel.CheckReleaseGroup(tp,aux.IsInGroup,#g,nil,g) and Duel.CheckReleaseGroup(tp,aux.IsInGroup,#g,nil,g)
end end
function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=e:GetLabelObject() if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.matfilter1(chkc) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.matfilter1(chkc,tp,g) end
if chk==0 then if chk==0 then
if e:GetLabel()~=100 then return false end if e:GetLabel()~=100 then return false end
return Duel.CheckReleaseGroup(tp,s.costfilter,1,nil,tp) return Duel.CheckReleaseGroup(tp,s.costfilter,1,nil,tp)
...@@ -71,13 +69,11 @@ function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -71,13 +69,11 @@ function s.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local rg=Duel.GetReleaseGroup(tp):Filter(s.costfilter,nil,tp) local rg=Duel.GetReleaseGroup(tp):Filter(s.costfilter,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,s.fselect,false,1,rg:GetCount(),tp) local sg=rg:SelectSubGroup(tp,s.fselect,false,1,rg:GetCount(),tp)
sg:KeepAlive()
e:SetLabelObject(sg)
aux.UseExtraReleaseCount(sg,tp) aux.UseExtraReleaseCount(sg,tp)
local ct=Duel.Release(sg,REASON_COST) local ct=Duel.Release(sg,REASON_COST)
e:SetLabel(ct) e:SetLabel(ct)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,s.matfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp,sg) Duel.SelectTarget(tp,s.matfilter1,tp,LOCATION_MZONE,0,1,1,nil)
end end
function s.atkop(e,tp,eg,ep,ev,re,r,rp) function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
...@@ -88,7 +84,7 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -88,7 +84,7 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(e:GetLabel()*1000) e1:SetValue(e:GetLabel()*1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
if e:GetLabel()>1 then if not tc:IsHasEffect(EFFECT_REVERSE_UPDATE) and e:GetLabel()>1 then
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
......
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