Commit 7c62cfd4 authored by mercury233's avatar mercury233

update new card

parent 5064ffc6
Pipeline #8393 passed with stages
in 1 minute and 56 seconds
#created by ... #created by ...
#main #main
100282037
101108027 101108027
101108063 101108063
100287006 100287006
......
--Zektrike Kou-Ou
--
--script by Raye & mercury233
function c100282037.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(100282037,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100282037+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c100282037.cost)
e1:SetTarget(c100282037.optg)
e1:SetOperation(c100282037.opop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(100282037,1))
e2:SetCategory(CATEGORY_EQUIP)
e2:SetTarget(c100282037.eqtg)
e2:SetOperation(c100282037.eqop)
c:RegisterEffect(e2)
end
function c100282037.tgcostfilter(c)
return c:IsSetCard(0x56) and c:IsAbleToGraveAsCost() and (c:IsLocation(LOCATION_HAND) or c:IsFaceup())
end
function c100282037.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100282037.tgcostfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c100282037.tgcostfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
end
function c100282037.opfilter(c,e,tp,spchk,eqchk)
return c:IsSetCard(0x56) and c:IsType(TYPE_MONSTER)
and (spchk and c:IsCanBeSpecialSummoned(e,0,tp,false,false) or eqchk and c:CheckUniqueOnField(tp) and not c:IsForbidden())
end
function c100282037.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x56)
end
function c100282037.optg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local spchk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local eqchk=Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c100282037.cfilter,tp,LOCATION_MZONE,0,1,nil)
return Duel.IsExistingMatchingCard(c100282037.opfilter,tp,LOCATION_DECK,0,1,nil,e,tp,spchk,eqchk)
end
end
function c100282037.opop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local spchk=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local eqchk=Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c100282037.cfilter,tp,LOCATION_MZONE,0,1,nil)
local g=Duel.SelectMatchingCard(tp,c100282037.opfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,spchk,eqchk)
local tc=g:GetFirst()
if tc then
if tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and spchk
and (not eqchk or Duel.SelectOption(tp,1152,aux.Stringid(100282037,2))==0) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local sg=Duel.SelectMatchingCard(tp,c100282037.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
local sc=sg:GetFirst()
if sc then
if not Duel.Equip(tp,tc,sc) then return end
--equip limit
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetLabelObject(sc)
e1:SetValue(c100282037.eqlimit)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
end
function c100282037.eqfilter(c,tp)
return c:IsSetCard(0x56) and c:IsType(TYPE_EQUIP) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
and Duel.IsExistingMatchingCard(c100282037.tgfilter,tp,LOCATION_MZONE,0,1,nil,c)
end
function c100282037.tgfilter(c,eqc)
return c:IsFaceup() and c:IsSetCard(0x56) and eqc:CheckEquipTarget(c)
end
function c100282037.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c100282037.eqfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK)
end
function c100282037.eqop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local ec=Duel.SelectMatchingCard(tp,c100282037.eqfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if ec then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc=Duel.SelectMatchingCard(tp,c100282037.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,ec):GetFirst()
Duel.Equip(tp,ec,tc)
end
end
end
function c100282037.eqlimit(e,c)
return c==e:GetLabelObject()
end
...@@ -77,6 +77,7 @@ function c100286006.thtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -77,6 +77,7 @@ function c100286006.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c100286006.adfilter,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c100286006.adfilter,tp,0,LOCATION_MZONE,1,nil) end
end end
function c100286006.thop(e,tp,eg,ep,ev,re,r,rp) function c100286006.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local atk=e:GetLabel() local atk=e:GetLabel()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
...@@ -93,4 +94,4 @@ function c100286006.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -93,4 +94,4 @@ function c100286006.thop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
tc=g:GetNext() tc=g:GetNext()
end end
end end
\ No newline at end of file
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