Commit 6d6029bc authored by nanahira's avatar nanahira

restrict activate zone when placing pendulum cards

parent 34ff9d0b
......@@ -5,15 +5,29 @@ function c14733538.initial_effect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOEXTRA)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_LIMIT_ZONE)
e1:SetCountLimit(1,14733538+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c14733538.target)
e1:SetOperation(c14733538.activate)
e1:SetValue(c14733538.zones)
c:RegisterEffect(e1)
end
function c14733538.filter(c,e,tp,b1,setcode)
return c:IsSetCard(setcode) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
and (b1 or c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
function c14733538.zones(e,tp,eg,ep,ev,re,r,rp)
local zone=0xff
local p0=Duel.CheckLocation(tp,LOCATION_PZONE,0)
local p1=Duel.CheckLocation(tp,LOCATION_PZONE,1)
local sp=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c14733538.filter,tp,LOCATION_DECK,0,1,nil,e,tp,false,0xc7)
and Duel.IsExistingMatchingCard(c14733538.filter,tp,LOCATION_DECK,0,1,nil,e,tp,false,0xda)
if p0==p1 or sp then return zone end
if p0 then zone=zone-0x1 end
if p1 then zone=zone-0x10 end
return zone
end
function c14733538.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -4,11 +4,16 @@ function c61884774.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_LIMIT_ZONE)
e1:SetCondition(c61884774.condition)
e1:SetTarget(c61884774.target)
e1:SetOperation(c61884774.activate)
e1:SetValue(c61884774.zones)
c:RegisterEffect(e1)
end
function c61884774.zones(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c61884774.thfilter,tp,LOCATION_DECK,0,1,nil) and 0xff or 0xe
end
function c61884774.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
......
......@@ -283,7 +283,7 @@ EFFECT_FLAG_OWNER_RELATE =0x1000000 --持續成為對象
EFFECT_FLAG_AVAILABLE_BD =0x2000000 --战斗破坏确定时效果也适用(纳祭之魔 地狱战士)
EFFECT_FLAG_CLIENT_HINT =0x4000000 --客户端提示
EFFECT_FLAG_CHAIN_UNIQUE =0x8000000 --N/A
EFFECT_FLAG_NAGA =0x10000000 --N/A
EFFECT_FLAG_LIMIT_ZONE =0x10000000 --限制魔法·陷阱卡可以发动的区域
EFFECT_FLAG_COF =0x20000000 --N/A
EFFECT_FLAG_CVAL_CHECK =0x40000000 --N/A
EFFECT_FLAG_IMMEDIATELY_APPLY =0x80000000 --卡在发动时效果就立即适用(卡通王國)
......
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