Commit b3f01c2e authored by zengsxing's avatar zengsxing

add 101303078

parent 9ddda2cc
Pipeline #41060 passed with stages
in 4 minutes and 18 seconds
No preview for this file type
--武器庫整理
local s,id,o=GetID()
function s.initial_effect(c)
--send
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetTarget(s.tgtg)
e1:SetOperation(s.tgop)
c:RegisterEffect(e1)
--equip
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.eqtg)
e2:SetOperation(s.eqop)
c:RegisterEffect(e2)
end
function s.tgfilter(c)
return c:IsType(TYPE_EQUIP) and c:IsAbleToGrave()
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.GetMatchingGroup(s.tgfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 then
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,2)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
function s.mfilter(c)
return c:IsFaceup() and Duel.IsExistingMatchingCard(Card.CheckEquipTarget,c:GetControler(),LOCATION_GRAVE+LOCATION_HAND,0,1,nil,c)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.mfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.mfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,s.mfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_GRAVE)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local ct=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ct>2 then ct=2 end
if tc:IsRelateToChain() and tc:IsFaceup() and ct>0 then
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.CheckEquipTarget),tp,LOCATION_GRAVE+LOCATION_HAND,0,nil,tc)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ct)
for ec in aux.Next(sg) do
Duel.Equip(tp,ec,tc,true,true)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e1:SetValue(aux.ChangeBattleDamage(1,HALF_DAMAGE))
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
ec:RegisterEffect(e1,true)
end
Duel.EquipComplete()
end
end
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