Commit 734157c2 authored by wind2009's avatar wind2009

Fix The League of Uniform Nomenclature Strikes

parent c1be5c58
Pipeline #28754 failed with stages
in 41 seconds
......@@ -14,10 +14,10 @@ function s.initial_effect(c)
end
function s.filter(c,tp)
local code=c:GetOriginalCode()
return c:IsFaceup() and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_HAND,0,2,nil,code)
return c:IsFaceup() and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_HAND,0,2,nil,code,tp)
end
function s.eqfilter(c,code)
return c:IsOriginalCodeRule(code) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
function s.eqfilter(c,code,tp)
return c:IsOriginalCodeRule(code) and c:IsType(TYPE_MONSTER) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc,tp) end
......@@ -32,15 +32,17 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local code=tc:GetOriginalCode()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_SZONE)>1
and Duel.GetMatchingGroupCount(aux.NecroValleyFilter(s.eqfilter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,nil,tc:GetOriginalCode())>1 then
and Duel.GetMatchingGroupCount(aux.NecroValleyFilter(s.eqfilter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,nil,code,tp)>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.eqfilter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,2,2,nil,tc:GetOriginalCode())
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.eqfilter),tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,2,2,nil,code,tp)
if #g<2 then return end
local ec=g:GetFirst()
while ec do
if Duel.Equip(tp,ec,tc) then
--equip limit
ec:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,0,id)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
......@@ -49,13 +51,6 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(s.eqlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
ec:RegisterEffect(e1)
Duel.RegisterFlagEffect(tp,id,0,0,1)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetOperation(s.desop)
e4:SetReset(RESET_EVENT+RESET_OVERLAY+RESET_TOFIELD)
ec:RegisterEffect(e4)
end
ec=g:GetNext()
end
......@@ -86,13 +81,9 @@ end
function s.splimit(e,c)
return c:GetOriginalRace()&e:GetLabel()==0
end
function s.chkcon(e,c)
local tp=e:GetOwner():GetControler()
return Duel.GetFlagEffect(tp,id)==2
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
e:Reset()
Duel.ResetFlagEffect(tp,id)
function s.chkcon(e)
local c=e:GetHandler()
return c:GetEquipGroup():Filter(Card.GetFlagEffect,nil,id):GetCount()>=2
end
function s.eqlimit(e,c)
return c==e:GetLabelObject()
......
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