Commit 1efd44c0 authored by wind2009's avatar wind2009

Fix ミラーバリア

parent 914419f2
Pipeline #41679 canceled with stages
in 8 seconds
...@@ -4,20 +4,20 @@ function s.initial_effect(c) ...@@ -4,20 +4,20 @@ function s.initial_effect(c)
aux.AddCodeList(c,100255002) aux.AddCodeList(c,100255002)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(TIMING_ATTACK+TIMING_END_PHASE)
e1:SetCost(s.cost) e1:SetCost(s.cost)
e1:SetTarget(s.target) e1:SetTarget(s.target)
e1:SetOperation(s.operation) e1:SetOperation(s.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--to hand --to hand
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED) e2:SetCode(EVENT_DESTROYED)
...@@ -62,52 +62,56 @@ end ...@@ -62,52 +62,56 @@ end
function s.operation(e,tp,eg,ep,ev,re,r,rp) function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return end if not c:IsLocation(LOCATION_SZONE) then return end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end if not c:IsRelateToChain() or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then if c:IsRelateToChain() and tc:IsFaceup() then
Duel.Equip(tp,c,tc) Duel.Equip(tp,c,tc)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2)) e1:SetDescription(aux.Stringid(id,2))
e1:SetCategory(CATEGORY_DESTROY) e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_SZONE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.atkcon) e1:SetRange(LOCATION_SZONE)
e1:SetCost(s.atkcost) e1:SetHintTiming(TIMING_BATTLE_PHASE)
e1:SetOperation(s.atkop) e1:SetCondition(s.descon)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Equip limit --Equip limit
local e3=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT) e2:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(1) e2:SetLabelObject(tc)
e3:SetValue(s.eqlimit) e2:SetValue(s.eqlimit)
e3:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e3) c:RegisterEffect(e2)
else else
c:CancelToGrave(false) c:CancelToGrave(false)
end end
end end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp) function s.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler():GetEquipTarget() local c=e:GetHandler():GetEquipTarget()
local bc=c:GetBattleTarget() return (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE)
return bc and not c:IsStatus(STATUS_CHAINING)
end end
function s.atkcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler() if chkc then return false end
if chk==0 then return c:GetFlagEffect(id)==0 end local c=e:GetHandler():GetEquipTarget()
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1) local bc=c:GetBattleTarget()
if chk==0 then return bc and bc:IsRelateToBattle() end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,bc,1,0,0)
end end
function s.atkop(e,tp,eg,ep,ev,re,r,rp) function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler():GetEquipTarget() local c=e:GetHandler():GetEquipTarget()
local bc=c:GetBattleTarget() local bc=c:GetBattleTarget()
if c:IsRelateToBattle() and c:IsFaceup() and bc:IsRelateToBattle() then if c:IsRelateToBattle() and c:IsFaceup()
and bc:IsRelateToBattle() and bc:IsControler(1-tp) and bc:IsType(TYPE_MONSTER) then
Duel.Destroy(bc,REASON_EFFECT) Duel.Destroy(bc,REASON_EFFECT)
end end
end end
function s.eqlimit(e,c) function s.eqlimit(e,c)
return e:GetHandler():GetEquipTarget()==c or c:IsControler(e:GetHandlerPlayer()) return c==e:GetLabelObject()
end end
function s.filter(c) function s.filter(c)
return c:IsCode(100255002) and c:IsAbleToHand() return c:IsCode(100255002) and c:IsAbleToHand()
......
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