Commit 51442f48 authored by salix5's avatar salix5

EFFECT_DISCARD_COST_CHANGE

parent 38e537b6
......@@ -15,7 +15,7 @@ function c29735721.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c29735721.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.IsPlayerAffectedByEffect(tp,98301564) then return true end
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_DISCARD_COST_CHANGE) then return true end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,2,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,2,2,REASON_COST+REASON_DISCARD)
end
......
......@@ -15,7 +15,7 @@ function c49010598.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function c49010598.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.IsPlayerAffectedByEffect(tp,98301564) then return true end
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_DISCARD_COST_CHANGE) then return true end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
......
......@@ -21,7 +21,7 @@ function c55256016.condition(e,tp,eg,ep,ev,re,r,rp)
return ex and tg~=nil and tc+tg:FilterCount(c55256016.cfilter,nil)-tg:GetCount()>0
end
function c55256016.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.IsPlayerAffectedByEffect(tp,98301564) then return true end
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_DISCARD_COST_CHANGE) then return true end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
......
......@@ -21,7 +21,7 @@ function c56993276.cfilter(c)
return c:IsSetCard(0xe) and c:IsType(TYPE_MONSTER) and c:IsDiscardable()
end
function c56993276.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.IsPlayerAffectedByEffect(tp,98301564) then return true end
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_DISCARD_COST_CHANGE) then return true end
if chk==0 then return Duel.IsExistingMatchingCard(c56993276.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c56993276.cfilter,1,1,REASON_COST+REASON_DISCARD,nil)
end
......
......@@ -18,7 +18,7 @@ function c58851034.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsDiscardable()
end
function c58851034.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.IsPlayerAffectedByEffect(tp,98301564) then return true end
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_DISCARD_COST_CHANGE) then return true end
if chk==0 then return Duel.IsExistingMatchingCard(c58851034.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c58851034.cfilter,1,1,REASON_COST+REASON_DISCARD,nil)
end
......
......@@ -15,7 +15,7 @@ function c77414722.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
end
function c77414722.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.IsPlayerAffectedByEffect(tp,98301564) then return true end
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_DISCARD_COST_CHANGE) then return true end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
......
......@@ -7,11 +7,6 @@ function c98301564.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Cost Change
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
......@@ -21,6 +16,14 @@ function c98301564.initial_effect(c)
e2:SetTargetRange(1,0)
e2:SetValue(c98301564.costchange)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISCARD_COST_CHANGE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_PZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
......
......@@ -17,7 +17,7 @@ function c98956134.condition(e,tp,eg,ep,ev,re,r,rp)
return ex and tg~=nil and tc+tg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)-tg:GetCount()>0
end
function c98956134.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.IsPlayerAffectedByEffect(tp,98301564) then return true end
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_DISCARD_COST_CHANGE) then return true end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
......
......@@ -481,6 +481,7 @@ EFFECT_ADD_SETCODE =334 --规则上视为「XX」字段
EFFECT_NO_EFFECT_DAMAGE =335 --玩家已受到"效果傷害變成0"的效果影響
EFFECT_UNSUMMONABLE_CARD =336 --不能通常召唤的怪獸
EFFECT_DISABLE_CHAIN_FIELD =337 --連鎖串中場上發動的效果無效(Duel.NegateRelatedChain())
EFFECT_DISCARD_COST_CHANGE =338 --反制陷阱捨棄手牌的代價改變(解放之阿里阿德涅)
--下面是诱发效果的诱发事件、时点 (如果是TYPE_SINGLE则自己发生以下事件后触发,如果TYPE_FIELD则场上任何卡发生以下事件都触发)
EVENT_STARTUP =1000 --游戏开始时
......
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