Commit 1008ab21 authored by salix5's avatar salix5

Card.IsOriginalCodeRule()

parent 53a2b666
...@@ -31,8 +31,7 @@ function c10000040.initial_effect(c) ...@@ -31,8 +31,7 @@ function c10000040.initial_effect(c)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c10000040.spfilter(c,code) function c10000040.spfilter(c,code)
local code1,code2=c:GetOriginalCodeRule() return c:IsOriginalCodeRule(code)
return code1==code or code2==code
end end
function c10000040.spcon(e,c) function c10000040.spcon(e,c)
if c==nil then return true end if c==nil then return true end
......
...@@ -50,11 +50,11 @@ function c11163040.filter(c,e,tp) ...@@ -50,11 +50,11 @@ function c11163040.filter(c,e,tp)
and Duel.IsExistingMatchingCard(c11163040.chkfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetControler(),c:GetOriginalCodeRule()) and Duel.IsExistingMatchingCard(c11163040.chkfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetControler(),c:GetOriginalCodeRule())
end end
function c11163040.chkfilter(c,e,tp,cc,code) function c11163040.chkfilter(c,e,tp,cc,code)
return c:IsSetCard(0xd3) and c:GetOriginalCodeRule()~=code and return c:IsSetCard(0xd3) and not c:IsOriginalCodeRule(code) and
not c:IsHasEffect(EFFECT_REVIVE_LIMIT) and Duel.IsPlayerCanSpecialSummon(tp,0,POS_FACEUP,cc,c) not c:IsHasEffect(EFFECT_REVIVE_LIMIT) and Duel.IsPlayerCanSpecialSummon(tp,0,POS_FACEUP,cc,c)
end end
function c11163040.spfilter(c,e,tp,cc,code) function c11163040.spfilter(c,e,tp,cc,code)
return c:IsSetCard(0xd3) and c:GetOriginalCodeRule()~=code and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,cc) return c:IsSetCard(0xd3) and not c:IsOriginalCodeRule(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,cc)
end end
function c11163040.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c11163040.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c11163040.filter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and c11163040.filter(chkc,e,tp) end
......
...@@ -20,12 +20,11 @@ function c20513882.cfilter(c,tp) ...@@ -20,12 +20,11 @@ function c20513882.cfilter(c,tp)
and Duel.IsExistingMatchingCard(c20513882.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,c) and Duel.IsExistingMatchingCard(c20513882.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,c)
end end
function c20513882.thfilter(c,tc) function c20513882.thfilter(c,tc)
local code1,code2=tc:GetOriginalCode()
return c:IsType(TYPE_MONSTER) return c:IsType(TYPE_MONSTER)
and c:GetOriginalLevel()==tc:GetOriginalLevel() and c:GetOriginalLevel()==tc:GetOriginalLevel()
and c:GetOriginalRace()==tc:GetOriginalRace() and c:GetOriginalRace()==tc:GetOriginalRace()
and c:GetOriginalAttribute()==tc:GetOriginalAttribute() and c:GetOriginalAttribute()==tc:GetOriginalAttribute()
and c:GetOriginalCode()~=code1 and c:GetOriginalCode()~=code2 and not c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
and c:IsAbleToHand() and c:IsAbleToHand()
end end
function c20513882.target(e,tp,eg,ep,ev,re,r,rp,chk) function c20513882.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -29,7 +29,7 @@ function c24224830.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,7 +29,7 @@ function c24224830.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE) e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c24224830.distg) e1:SetTarget(c24224830.distg)
e1:SetLabel(tc:GetOriginalCode()) e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END,2) e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -37,20 +37,18 @@ function c24224830.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -37,20 +37,18 @@ function c24224830.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EVENT_CHAIN_SOLVING) e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetCondition(c24224830.discon) e2:SetCondition(c24224830.discon)
e2:SetOperation(c24224830.disop) e2:SetOperation(c24224830.disop)
e2:SetLabel(tc:GetOriginalCode()) e2:SetLabelObject(tc)
e2:SetReset(RESET_PHASE+PHASE_END,2) e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
end end
end end
function c24224830.distg(e,c) function c24224830.distg(e,c)
local code=e:GetLabel() local tc=e:GetLabelObject()
local code1,code2=c:GetOriginalCodeRule() return c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
return code1==code or code2==code
end end
function c24224830.discon(e,tp,eg,ep,ev,re,r,rp) function c24224830.discon(e,tp,eg,ep,ev,re,r,rp)
local code=e:GetLabel() local tc=e:GetLabelObject()
local code1,code2=re:GetHandler():GetOriginalCodeRule() return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsOriginalCodeRule(tc:GetOriginalCodeRule())
return re:IsActiveType(TYPE_MONSTER) and (code1==code or code2==code)
end end
function c24224830.disop(e,tp,eg,ep,ev,re,r,rp) function c24224830.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev) Duel.NegateEffect(ev)
......
...@@ -25,7 +25,8 @@ function c41803903.thfilter(c,e,tp) ...@@ -25,7 +25,8 @@ function c41803903.thfilter(c,e,tp)
end end
function c41803903.spfilter(c,e,tp,hc) function c41803903.spfilter(c,e,tp,hc)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsSetCard(0x10ec) return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsSetCard(0x10ec)
and c:GetOriginalCode()~=hc:GetOriginalCode() and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and not c:IsOriginalCodeRule(hc:GetOriginalCodeRule())
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
and Duel.GetLocationCountFromEx(tp,tp,hc,c)>0 and Duel.GetLocationCountFromEx(tp,tp,hc,c)>0
end end
function c41803903.target(e,tp,eg,ep,ev,re,r,rp,chk) function c41803903.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -42,5 +42,5 @@ end ...@@ -42,5 +42,5 @@ end
function c7403341.aclimit(e,re,tp) function c7403341.aclimit(e,re,tp)
local c=re:GetHandler() local c=re:GetHandler()
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
return c:GetOriginalCode()==tc:GetOriginalCode() and not c:IsImmuneToEffect(e) return c:IsOriginalCodeRule(tc:GetOriginalCodeRule()) and not c:IsImmuneToEffect(e)
end end
...@@ -26,7 +26,7 @@ end ...@@ -26,7 +26,7 @@ end
function c8608979.filter2(c,tc,e,tp) function c8608979.filter2(c,tc,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:GetOriginalRace()==tc:GetOriginalRace() and c:GetOriginalRace()==tc:GetOriginalRace()
and c:GetOriginalCode()~=tc:GetOriginalCode() and not c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
end end
function c8608979.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c8608979.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsFaceup() and chkc:IsLocation(LOCATION_MZONE) and c8608979.filter1(chkc,e,tp) end if chkc then return chkc:IsFaceup() and chkc:IsLocation(LOCATION_MZONE) and c8608979.filter1(chkc,e,tp) end
......
...@@ -17,15 +17,14 @@ function c9581215.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -17,15 +17,14 @@ function c9581215.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end end
function c9581215.rmfilter(c,p,code) function c9581215.rmfilter(c,p,tc)
return c:IsAbleToRemove(p) and c:IsCode(code) return c:IsAbleToRemove(p) and c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
end end
function c9581215.activate(e,tp,eg,ep,ev,re,r,rp) function c9581215.activate(e,tp,eg,ep,ev,re,r,rp)
if not Duel.NegateEffect(ev) then return end if not Duel.NegateEffect(ev) then return end
Duel.BreakEffect() Duel.BreakEffect()
local sel=1 local sel=1
local code=eg:GetFirst():GetCode() local g=Duel.GetMatchingGroup(c9581215.rmfilter,tp,0,LOCATION_HAND+LOCATION_DECK,nil,1-tp,eg:GetFirst())
local g=Duel.GetMatchingGroup(c9581215.rmfilter,tp,0,LOCATION_HAND+LOCATION_DECK,nil,1-tp,code)
local tg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil) local tg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(9581215,0)) Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(9581215,0))
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -327,7 +327,7 @@ EFFECT_CANNOT_DISABLE_SPSUMMON =27 --特殊召唤不会无效 ...@@ -327,7 +327,7 @@ EFFECT_CANNOT_DISABLE_SPSUMMON =27 --特殊召唤不会无效
EFFECT_SET_SUMMON_COUNT_LIMIT =28 --限制每回合放置怪兽次数 EFFECT_SET_SUMMON_COUNT_LIMIT =28 --限制每回合放置怪兽次数
EFFECT_EXTRA_SUMMON_COUNT =29 --增加召唤(通常召唤)次数 EFFECT_EXTRA_SUMMON_COUNT =29 --增加召唤(通常召唤)次数
EFFECT_SPSUMMON_CONDITION =30 --特殊召唤条件 EFFECT_SPSUMMON_CONDITION =30 --特殊召唤条件
EFFECT_REVIVE_LIMIT =31 --有苏生限制的怪獸 EFFECT_REVIVE_LIMIT =31 --有苏生限制的怪獸(Card.EnableReviveLimit())
EFFECT_SUMMON_PROC =32 --召唤规则效果 EFFECT_SUMMON_PROC =32 --召唤规则效果
EFFECT_LIMIT_SUMMON_PROC =33 --召唤规则限制 EFFECT_LIMIT_SUMMON_PROC =33 --召唤规则限制
EFFECT_SPSUMMON_PROC =34 --特殊召唤规则 EFFECT_SPSUMMON_PROC =34 --特殊召唤规则
...@@ -517,7 +517,7 @@ EFFECT_CANNOT_SELECT_BATTLE_TARGET =332 --對手不能選擇為攻擊對象 ...@@ -517,7 +517,7 @@ EFFECT_CANNOT_SELECT_BATTLE_TARGET =332 --對手不能選擇為攻擊對象
EFFECT_CANNOT_SELECT_EFFECT_TARGET =333 --對手不能選擇為效果對象 EFFECT_CANNOT_SELECT_EFFECT_TARGET =333 --對手不能選擇為效果對象
EFFECT_ADD_SETCODE =334 --视为「XX」字段的效果 EFFECT_ADD_SETCODE =334 --视为「XX」字段的效果
EFFECT_NO_EFFECT_DAMAGE =335 --玩家已受到"效果傷害變成0"的效果影響 EFFECT_NO_EFFECT_DAMAGE =335 --玩家已受到"效果傷害變成0"的效果影響
EFFECT_UNSUMMONABLE_CARD =336 --不能通常召唤的怪獸 EFFECT_UNSUMMONABLE_CARD =336 --不能通常召唤的怪獸(Card.EnableReviveLimit())
EFFECT_DISABLE_CHAIN_FIELD =337 --N/A EFFECT_DISABLE_CHAIN_FIELD =337 --N/A
EFFECT_DISCARD_COST_CHANGE =338 --反制陷阱捨棄手牌的代價改變(解放之阿里阿德涅) EFFECT_DISCARD_COST_CHANGE =338 --反制陷阱捨棄手牌的代價改變(解放之阿里阿德涅)
EFFECT_HAND_SYNCHRO =339 --用手牌的怪獸當作同步素材 EFFECT_HAND_SYNCHRO =339 --用手牌的怪獸當作同步素材
......
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