Commit 4cb92944 authored by mallu11's avatar mallu11 Committed by GitHub

fix サイバー・リペア・プラント (#1637)

* fix サイバー・リペア・プラント

* Update c86686671.lua
parent 2ab27976
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
function c86686671.initial_effect(c) function c86686671.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,86686671+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,86686671+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c86686671.condition) e1:SetCondition(c86686671.condition)
...@@ -22,11 +20,7 @@ function c86686671.filter2(c) ...@@ -22,11 +20,7 @@ function c86686671.filter2(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToDeck() return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToDeck()
end end
function c86686671.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c86686671.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c86686671.filter2(chkc) end
if e:GetLabel()~=0 then
return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c86686671.filter2(chkc)
else return false end
end
local b1=Duel.IsExistingMatchingCard(c86686671.filter1,tp,LOCATION_DECK,0,1,nil) local b1=Duel.IsExistingMatchingCard(c86686671.filter1,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingTarget(c86686671.filter2,tp,LOCATION_GRAVE,0,1,nil) local b2=Duel.IsExistingTarget(c86686671.filter2,tp,LOCATION_GRAVE,0,1,nil)
if chk==0 then return b1 or b2 end if chk==0 then return b1 or b2 end
...@@ -48,24 +42,33 @@ function c86686671.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -48,24 +42,33 @@ function c86686671.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,c86686671.filter2,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,c86686671.filter2,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
e:SetProperty(EFFECT_FLAG_CARD_TARGET) e:SetProperty(EFFECT_FLAG_CARD_TARGET)
if op==1 then
e:SetCategory(CATEGORY_TODECK)
else
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TODECK)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
else else
e:SetProperty(0) e:SetProperty(0)
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end end
end end
function c86686671.activate(e,tp,eg,ep,ev,re,r,rp) function c86686671.activate(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel() local op=e:GetLabel()
local res=0
if op~=1 then if op~=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c86686671.filter1,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c86686671.filter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) res=Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
if op~=0 then if op~=0 then
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
if op==2 then Duel.BreakEffect() end if op==2 and res~=0 then Duel.BreakEffect() end
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT) Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end end
end 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