Commit 494323c9 authored by 花桃白音's avatar 花桃白音

del 18018720 --use NotAllowed cardname

parent 3638f11c
No preview for this file type
--和平使者
local s,id,o=GetID()
function s.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2,nil,nil,99)
c:EnableReviveLimit()
--material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(s.mttg)
e1:SetOperation(s.mtop)
c:RegisterEffect(e1)
end
function s.mtfilter(c,e)
return c:IsLocation(LOCATION_HAND) and c:IsCanOverlay() and not (e and c:IsImmuneToEffect(e))
end
function s.thfilter(c,tp)
return c:IsType(TYPE_MONSTER)
and c:IsAbleToHand()
end
function s.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local hp=Duel.GetTurnPlayer()
if chk==0 then
if hp==tp then
return c:IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(s.mtfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
else
return c:IsType(TYPE_XYZ)
and c:GetOverlayGroup():IsExists(s.thfilter,1,nil,tp)
end
end
end
function s.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local hp=Duel.GetTurnPlayer()
if not c:IsRelateToEffect(e) then return end
if hp==tp then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,s.mtfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,e)
if g:GetCount()>0 then
local mg=g:GetFirst():GetOverlayGroup()
if mg:GetCount()>0 then
Duel.SendtoGrave(mg,REASON_RULE)
end
Duel.Overlay(c,g)
end
else
local mg=c:GetOverlayGroup():Filter(s.thfilter,nil,tp)
if mg:GetCount() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local bc=mg:Select(tp,1,1,nil):GetFirst()
if Duel.SendtoHand(bc,nil,REASON_EFFECT)>0
and bc:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,bc)
Duel.ShuffleHand(tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and bc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.SpecialSummon(bc,0,tp,tp,false,false,POS_FACEUP)
local dam=bc:GetAttack()
Duel.Damage(1-tp,dam,REASON_DRAW)
end
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