Commit a060e60a authored by salix5's avatar salix5

fix カードガード

https://www.db.yugioh-card.com/yugiohdb/faq_search.action?ope=4&cid=8526
■『1ターンに1度、このカードに乗っているガードカウンターを1つ取り除き、このカード以外の自分フィールド上に表側表示で存在するカード1枚にガードカウンターを1つ置く事ができる。選択したカードが破壊される場合、代わりにガードカウンターを1つ取り除く』効果は起動効果です。(この効果を発動する際に、コストとして、このカードに置かれているガードカウンターを1つ取り除きます。自分フィールドに表側表示で存在するカード1枚を対象に取る効果です。)
parent 419f7c95
......@@ -28,6 +28,7 @@ function c4694209.initial_effect(c)
e4:SetCountLimit(1)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCost(c4694209.addccost2)
e4:SetTarget(c4694209.addct2)
e4:SetOperation(c4694209.addc2)
c:RegisterEffect(e4)
......@@ -44,17 +45,18 @@ end
function c4694209.attackup(e,c)
return c:GetCounter(0x1021)*300
end
function c4694209.addccost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1021,1,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x1021,1,REASON_COST)
end
function c4694209.addct2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and chkc:IsCanAddCounter(0x1021,1) end
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1021,1,REASON_EFFECT)
and Duel.IsExistingTarget(Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,1,e:GetHandler(),0x1021,1) end
if chk==0 then return Duel.IsExistingTarget(Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,1,e:GetHandler(),0x1021,1) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(4694209,1))
Duel.SelectTarget(tp,Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler(),0x1021,1)
end
function c4694209.addc2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetCounter(0x1021)==0 then return end
c:RemoveCounter(tp,0x1021,1,REASON_EFFECT)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
tc:AddCounter(0x1021,1)
......
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