代码拉取完成,页面将自动刷新
--エレメントセイバー・ラパウィラ
function c18214905.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(18214905,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c18214905.negcon)
e1:SetCost(c18214905.negcost)
e1:SetTarget(c18214905.negtg)
e1:SetOperation(c18214905.negop)
c:RegisterEffect(e1)
--att change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(18214905,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetTarget(c18214905.atttg)
e2:SetOperation(c18214905.attop)
c:RegisterEffect(e2)
end
function c18214905.negcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c18214905.costfilter(c)
return c:IsSetCard(0x400d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c18214905.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
local fg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,61557074)}) do
fg:AddCard(pe:GetHandler())
end
local loc=LOCATION_HAND
if fg:GetCount()>0 then loc=LOCATION_HAND+LOCATION_DECK end
if chk==0 then return Duel.IsExistingMatchingCard(c18214905.costfilter,tp,loc,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc=Duel.SelectMatchingCard(tp,c18214905.costfilter,tp,loc,0,1,1,nil):GetFirst()
if tc:IsLocation(LOCATION_DECK) then
local fc=nil
if fg:GetCount()==1 then
fc=fg:GetFirst()
else
fc=fg:Select(tp,1,1,nil)
end
Duel.Hint(HINT_CARD,0,fc:GetCode())
fc:RegisterFlagEffect(61557074,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0)
end
Duel.SendtoGrave(tc,REASON_COST)
end
function c18214905.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c18214905.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c18214905.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local att=Duel.AnnounceAttribute(tp,1,0xff-e:GetHandler():GetAttribute())
e:SetLabel(att)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,tp,LOCATION_GRAVE)
end
function c18214905.attop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。