Commit 59b4b454 authored by wind2009's avatar wind2009

Fix H-C マグナム・エクスカリバー

parent 1bab7523
Pipeline #33198 passed with stages
in 1 minute and 55 seconds
No preview for this file type
--H-C マグナム・エクスカリバー
--HC マグナム・エクスカリバー
local s,id,o=GetID()
function s.initial_effect(c)
--xyz summon
......@@ -19,31 +19,33 @@ function s.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_EQUIP)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_MAIN_END)
e2:SetCountLimit(1)
e2:SetCondition(s.eqcon)
e2:SetTarget(s.eqtg)
e2:SetOperation(s.eqop)
c:RegisterEffect(e2)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.tdtg)
e2:SetOperation(s.tdop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(aux.bfgcost)
e3:SetTarget(s.tdtg)
e3:SetOperation(s.tdop)
c:RegisterEffect(e3)
end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetBattleTarget()~=nil
end
function s.atkcost(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)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -57,6 +59,9 @@ function s.atkop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1)
end
end
function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsMainPhase()
end
function s.eqfilter(c)
return c:IsFaceup()
end
......@@ -64,7 +69,7 @@ function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.eqfilter(chkc) and e:GetHandler()~=chkc end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
......@@ -72,7 +77,7 @@ function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and c:IsControler(tp) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or not tc:IsLocation(LOCATION_MZONE) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not tc:IsLocation(LOCATION_MZONE) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
......@@ -103,13 +108,14 @@ function s.tdfilter(c)
return c:IsRace(RACE_WARRIOR) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_GRAVE,0,3,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_GRAVE,0,3,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.tdfilter),tp,LOCATION_GRAVE,0,3,3,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
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