Commit c76d1b66 authored by VanillaSalt's avatar VanillaSalt

new

parent a1150fb5
--ギャラクシーアイズ FA・フォトン・ドラゴン
function c39030163.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,8),3,c39030163.ovfilter,aux.Stringid(39030163,0))
c:EnableReviveLimit()
--material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(39030163,1))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1)
e1:SetTarget(c39030163.mttg)
e1:SetOperation(c39030163.mtop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(39030163,2))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetCost(c39030163.descost)
e2:SetTarget(c39030163.destg)
e2:SetOperation(c39030163.desop)
c:RegisterEffect(e2)
end
function c39030163.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0x107b) and c:IsType(TYPE_XYZ) and not c:IsCode(39030163)
end
function c39030163.mttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=e:GetHandler():GetEquipGroup()
if chkc then return g:IsContains(chkc) and chkc:IsCanBeEffectTarget(e) end
if chk==0 then return g:IsExists(Card.IsCanBeEffectTarget,1,nil,e) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local tg=g:FilterSelect(tp,Card.IsCanBeEffectTarget,1,2,nil,e)
Duel.SetTargetCard(tg)
end
function c39030163.mtfilter(c,e)
return c:IsRelateToEffect(e) and not c:IsImmuneToEffect(e)
end
function c39030163.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c39030163.mtfilter,nil,e)
if g:GetCount()>0 then
Duel.Overlay(c,g)
end
end
function c39030163.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c39030163.desfilter(c)
return c:IsFaceup() and c:IsDestructable()
end
function c39030163.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c39030163.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c39030163.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c39030163.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c39030163.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--DDD反骨王レオニダス
function c92536468.initial_effect(c)
--pendulum summon
aux.AddPendulumProcedure(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--reverse damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_PZONE)
e2:SetCode(EVENT_DAMAGE)
e2:SetCondition(c92536468.effcon)
e2:SetTarget(c92536468.revtg)
e2:SetOperation(c92536468.revop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_HAND)
e3:SetCode(EVENT_DAMAGE)
e3:SetCondition(c92536468.effcon)
e3:SetTarget(c92536468.sptg)
e3:SetOperation(c92536468.spop)
c:RegisterEffect(e3)
--avoid damage
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CHANGE_DAMAGE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(1,0)
e4:SetValue(c92536468.damval)
c:RegisterEffect(e4)
end
function c92536468.effcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and bit.band(r,REASON_EFFECT)~=0
end
function c92536468.revtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDestructable(e) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c92536468.revop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_REVERSE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetValue(c92536468.revval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c92536468.revval(e,re,r,rp,rc)
return bit.band(r,REASON_EFFECT)~=0
end
function c92536468.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ev)
end
function c92536468.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
Duel.Recover(tp,ev,REASON_EFFECT)
end
end
function c92536468.damval(e,re,val,r,rp,rc)
if bit.band(r,REASON_EFFECT)~=0 then return 0 end
return val
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