Commit 0b81b296 authored by wind2009's avatar wind2009

Merge remote-tracking branch 'upstream/SUDA' into master

parents 1593badf cd017715
...@@ -43,7 +43,7 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,7 +43,7 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.setcon(e,tp,eg,ep,ev,re,r,rp) function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 return r&(REASON_EFFECT+REASON_BATTLE)~=0
end end
function s.setfilter(c) function s.setfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
......
...@@ -66,7 +66,7 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,7 +66,7 @@ function s.tgop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.eqfilter(c) function s.eqfilter(c)
return c:IsFaceup() and c:IsSetCard(0x1b0) and bit.band(c:GetType(),TYPE_SPELL+TYPE_EQUIP)==TYPE_SPELL+TYPE_EQUIP return c:IsFaceup() and c:IsSetCard(0x1b0) and c:IsAllTypes(TYPE_SPELL+TYPE_EQUIP)
end end
function s.imcon(e) function s.imcon(e)
local sg=e:GetHandler():GetEquipGroup() local sg=e:GetHandler():GetEquipGroup()
......
...@@ -47,12 +47,12 @@ function s.spfilter(c,e,tp) ...@@ -47,12 +47,12 @@ function s.spfilter(c,e,tp)
return c:IsSetCard(0x5) and c:IsLevel(10) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) return c:IsSetCard(0x5) and c:IsLevel(10) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end end
function s.thfilter(c) function s.thfilter(c)
return c.toss_coin and c:IsAbleToHand() return c:IsEffectProperty(aux.EffectCategoryFilter(CATEGORY_COIN)) and c:IsAbleToHand()
end end
function s.coinop(e,tp,eg,ep,ev,re,r,rp) function s.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local res=-1 local res=-1
if c:IsHasEffect(73206827) then if Duel.IsPlayerAffectedByEffect(tp,73206827) then
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp)
local b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) local b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
if b1 and not b2 then if b1 and not b2 then
...@@ -90,5 +90,5 @@ function s.condition(e) ...@@ -90,5 +90,5 @@ function s.condition(e)
end end
function s.aclimit(e,re,tp) function s.aclimit(e,re,tp)
local loc=re:GetActivateLocation() local loc=re:GetActivateLocation()
return bit.band(loc,LOCATION_ONFIELD)~=0 and re:IsActiveType(TYPE_MONSTER) return loc&LOCATION_ONFIELD~=0 and re:IsActiveType(TYPE_MONSTER)
end end
...@@ -30,9 +30,9 @@ function s.checkzone(tp) ...@@ -30,9 +30,9 @@ function s.checkzone(tp)
local zone=0 local zone=0
local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
for tc in aux.Next(g) do for tc in aux.Next(g) do
zone=bit.bor(zone,tc:GetLinkedZone(tp)) zone=zone|tc:GetLinkedZone(tp)
end end
return bit.band(zone,0x1f) return zone&0x1f
end end
function s.spcon(e,c) function s.spcon(e,c)
if c==nil then return true end if c==nil then return true end
......
...@@ -2,14 +2,6 @@ ...@@ -2,14 +2,6 @@
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
--Traitor_chaining_effect
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetCode(EVENT_ADJUST)
e0:SetRange(0xff)
e0:SetOperation(s.adjustop)
c:RegisterEffect(e0)
--special summon condition --special summon condition
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -19,7 +11,7 @@ function s.initial_effect(c) ...@@ -19,7 +11,7 @@ function s.initial_effect(c)
--spsummon --spsummon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC) e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE) e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
...@@ -58,38 +50,11 @@ function s.initial_effect(c) ...@@ -58,38 +50,11 @@ function s.initial_effect(c)
e8:SetValue(s.efilter) e8:SetValue(s.efilter)
c:RegisterEffect(e8) c:RegisterEffect(e8)
end end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp) function s.quick_filter(e)
if not s.globle_check then return e:GetCode()==EVENT_CHAINING and e:IsHasType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_QUICK_F) and e:IsHasRange(LOCATION_HAND+LOCATION_MZONE)
s.globle_check=true
s.Traitor_RegisterEffect=Card.RegisterEffect
function Card.RegisterEffect(Card_c,Effect_e,bool)
if Effect_e:GetType() and bit.band(Effect_e:GetType(),EFFECT_TYPE_QUICK_O+EFFECT_TYPE_QUICK_F)~=0 then
if Effect_e:GetCode() and Effect_e:GetCode()==EVENT_CHAINING then
Card_c:RegisterFlagEffect(id,0,0,1)
end
end
if bool then
s.Traitor_RegisterEffect(Card_c,Effect_e,bool)
else
s.Traitor_RegisterEffect(Card_c,Effect_e,false)
end
end
local rg=Duel.GetMatchingGroup(Card.IsType,tp,0xff,0xff,nil,TYPE_MONSTER)
for tc in aux.Next(rg) do
if tc.initial_effect then
local Traitor_initial_effect=s.initial_effect
s.initial_effect=function() end
tc:ReplaceEffect(id,0)
s.initial_effect=Traitor_initial_effect
tc.initial_effect(tc)
end
end
Card.RegisterEffect=s.Traitor_RegisterEffect
end
end end
function s.cfilter(c) function s.cfilter(c)
return (c:GetFlagEffect(id)>0 or c.Traitor_chaining_effect) and bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER return c:IsOriginalEffectProperty(s.quick_filter) and c:GetOriginalType()&TYPE_MONSTER==TYPE_MONSTER and c:IsFaceupEx()
and c:IsFaceupEx()
end end
function s.spcon(e,c) function s.spcon(e,c)
if c==nil then return true end if c==nil then return true end
......
...@@ -60,8 +60,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,8 +60,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.cfilter(c,tp) function s.cfilter(c,tp)
return bit.band(c:GetType(),TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS return c:IsAllTypes(TYPE_TRAP+TYPE_CONTINUOUS) and c:IsPreviousLocation(LOCATION_SZONE) and c:IsControler(tp)
and c:IsPreviousLocation(LOCATION_SZONE) and c:IsControler(tp)
end end
function s.damcon(e,tp,eg,ep,ev,re,r,rp) function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp) return eg:IsExists(s.cfilter,1,nil,tp)
...@@ -75,8 +74,7 @@ function s.cfilter2(c) ...@@ -75,8 +74,7 @@ function s.cfilter2(c)
end end
function s.discon(e,tp,eg,ep,ev,re,r,rp) function s.discon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler() local rc=re:GetHandler()
return bit.band(rc:GetType(),TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS return rc:IsAllTypes(TYPE_TRAP+TYPE_CONTINUOUS) and re:GetActivateLocation()==LOCATION_MZONE
and re:GetActivateLocation()==LOCATION_MZONE
and Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_REMOVED,0,1,nil) and Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_REMOVED,0,1,nil)
end end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -39,7 +39,7 @@ function s.initial_effect(c) ...@@ -39,7 +39,7 @@ function s.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function s.mfilter(ft,lv,race,att) function s.mfilter(ft,lv,race,att)
return ft==1 and lv>=5 and bit.band(race,RACE_WARRIOR)==RACE_WARRIOR return ft==1 and lv>=5 and race&RACE_WARRIOR~=0
end end
s.Metallization_material=s.mfilter s.Metallization_material=s.mfilter
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -48,7 +48,7 @@ function s.indtg(e,c) ...@@ -48,7 +48,7 @@ function s.indtg(e,c)
return c:IsSetCard(0xea) return c:IsSetCard(0xea)
end end
function s.indct(e,re,r,rp) function s.indct(e,re,r,rp)
if bit.band(r,REASON_BATTLE)~=0 then if r&REASON_BATTLE~=0 then
return 1 return 1
else return 0 end else return 0 end
end end
......
...@@ -106,7 +106,7 @@ end ...@@ -106,7 +106,7 @@ end
function s.coinop(e,tp,eg,ep,ev,re,r,rp) function s.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local res=-1 local res=-1
if c:IsHasEffect(73206827) then if Duel.IsPlayerAffectedByEffect(tp,73206827) then
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
local b2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) local b2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp)
if b1 and not b2 then if b1 and not b2 then
......
...@@ -31,7 +31,7 @@ function s.initial_effect(c) ...@@ -31,7 +31,7 @@ function s.initial_effect(c)
end end
s.toss_coin=true s.toss_coin=true
function s.cfilter(c) function s.cfilter(c)
return c:IsFaceup() and c.toss_coin return c:IsFaceup() and c:IsEffectProperty(aux.EffectCategoryFilter(CATEGORY_COIN))
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
...@@ -52,7 +52,7 @@ function s.cointg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -52,7 +52,7 @@ function s.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end end
function s.setfilter(c) function s.setfilter(c)
return c:IsType(TYPE_SPELL) and c:IsSSetable() and c.toss_coin return c:IsType(TYPE_SPELL) and c:IsSSetable() and c:IsEffectProperty(aux.EffectCategoryFilter(CATEGORY_COIN))
end end
function s.desfilter(c) function s.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:GetSequence()<5 return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:GetSequence()<5
...@@ -60,7 +60,7 @@ end ...@@ -60,7 +60,7 @@ end
function s.coinop(e,tp,eg,ep,ev,re,r,rp) function s.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local res=-1 local res=-1
if c:IsHasEffect(73206827) then if Duel.IsPlayerAffectedByEffect(tp,73206827) then
local b1=Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) local b1=Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil) local b2=Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil)
if b1 and not b2 then if b1 and not b2 then
......
...@@ -28,7 +28,7 @@ end ...@@ -28,7 +28,7 @@ end
function s.cfilter(c,re) function s.cfilter(c,re)
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP)
and c:IsReason(REASON_COST) and re:IsActivated() and c:IsReason(REASON_COST) and re:IsActivated()
and (not c:IsPreviousLocation(LOCATION_ONFIELD) or bit.band(c:GetPreviousTypeOnField(),TYPE_SPELL+TYPE_TRAP)~=0) and (not c:IsPreviousLocation(LOCATION_ONFIELD) or c:GetPreviousTypeOnField()&(TYPE_SPELL+TYPE_TRAP)~=0)
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,re) return eg:IsExists(s.cfilter,1,nil,re)
......
...@@ -38,9 +38,7 @@ function s.thcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,9 +38,7 @@ function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end end
function s.cfilter(c) function s.cfilter(c)
return c:IsFaceup() return c:IsFaceup() and c:IsAllTypes(TYPE_SPELL+TYPE_CONTINUOUS) and c:IsAbleToGraveAsCost()
and bit.band(c:GetType(),TYPE_SPELL+TYPE_CONTINUOUS)==TYPE_SPELL+TYPE_CONTINUOUS
and c:IsAbleToGraveAsCost()
end end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil) end
......
...@@ -61,7 +61,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,7 +61,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_SYNCHRO) and bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 return c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_SYNCHRO) and r&(REASON_EFFECT+REASON_BATTLE)~=0
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsFaceupEx() and c:IsSetCard(0xea) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsFaceupEx() and c:IsSetCard(0xea) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -28,7 +28,7 @@ function s.initial_effect(c) ...@@ -28,7 +28,7 @@ function s.initial_effect(c)
end end
s.toss_coin=true s.toss_coin=true
function s.thfilter(c) function s.thfilter(c)
return not c:IsCode(id) and c.toss_coin and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return not c:IsCode(id) and c:IsEffectProperty(aux.EffectCategoryFilter(CATEGORY_COIN)) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
......
...@@ -49,7 +49,7 @@ function s.acop(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,7 +49,7 @@ function s.acop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp) function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 return r&(REASON_EFFECT+REASON_BATTLE)~=0
end end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
......
...@@ -39,8 +39,7 @@ function s.mfilter2(c) ...@@ -39,8 +39,7 @@ function s.mfilter2(c)
return c:IsRace(RACE_ILLUSION) return c:IsRace(RACE_ILLUSION)
end end
function s.sprfilter(c) function s.sprfilter(c)
return bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER return c:GetOriginalType()&TYPE_MONSTER~=0 and c:IsFaceup() and c:IsAbleToGraveAsCost()
and c:IsFaceup() and c:IsAbleToGraveAsCost()
end end
function s.sgchk(g,tp,sc) function s.sgchk(g,tp,sc)
return Duel.GetLocationCountFromEx(tp,tp,g,sc)>0 return Duel.GetLocationCountFromEx(tp,tp,g,sc)>0
......
...@@ -66,7 +66,7 @@ end ...@@ -66,7 +66,7 @@ end
function s.cfilter2(c,tp,se) function s.cfilter2(c,tp,se)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) return c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp)
and bit.band(c:GetPreviousAttributeOnField(),ATTRIBUTE_WATER)~=0 and c:GetPreviousAttributeOnField()&ATTRIBUTE_WATER~=0
and c:IsPreviousLocation(LOCATION_MZONE) and (se==nil or c:GetReasonEffect()~=se) and c:IsPreviousLocation(LOCATION_MZONE) and (se==nil or c:GetReasonEffect()~=se)
end end
function s.thcon(e,tp,eg,ep,ev,re,r,rp) function s.thcon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -32,7 +32,7 @@ function s.initial_effect(c) ...@@ -32,7 +32,7 @@ function s.initial_effect(c)
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND+LOCATION_ONFIELD) and e:GetHandler():IsPreviousControler(tp) return e:GetHandler():IsPreviousLocation(LOCATION_HAND+LOCATION_ONFIELD) and e:GetHandler():IsPreviousControler(tp)
and re and re:IsActivated() and bit.band(r,REASON_EFFECT)==REASON_EFFECT and re and re:IsActivated() and r&REASON_EFFECT~=0
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -49,7 +49,7 @@ function s.acop(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,7 +49,7 @@ function s.acop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 return r&(REASON_EFFECT+REASON_BATTLE)~=0
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -45,7 +45,7 @@ function s.indfilter(e,c) ...@@ -45,7 +45,7 @@ function s.indfilter(e,c)
return c:IsRace(RACE_WARRIOR) return c:IsRace(RACE_WARRIOR)
end end
function s.cfilter(c) function s.cfilter(c)
return c:IsFaceupEx() and bit.band(c:GetType(),TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS return c:IsFaceupEx() and c:IsAllTypes(TYPE_TRAP+TYPE_CONTINUOUS)
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp) function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
......
...@@ -34,8 +34,7 @@ function s.initial_effect(c) ...@@ -34,8 +34,7 @@ function s.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function s.cfilter(c) function s.cfilter(c)
return bit.band(c:GetType(),TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS return c:IsAllTypes(TYPE_TRAP+TYPE_CONTINUOUS) and c:IsFaceup()
and c:IsFaceup()
end end
function s.atkcon(e,tp,eg,ep,ev,re,r,rp) function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil) return Duel.GetTurnPlayer()~=tp and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_ONFIELD,0,1,nil)
...@@ -69,7 +68,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -69,7 +68,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
end end
function s.actop(e,tp,eg,ep,ev,re,r,rp) function s.actop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler() local rc=re:GetHandler()
if bit.band(rc:GetType(),TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS and ep==tp then if rc:IsAllTypes(TYPE_TRAP+TYPE_CONTINUOUS) and ep==tp then
Duel.SetChainLimit(s.chainlm) Duel.SetChainLimit(s.chainlm)
end end
end end
...@@ -78,7 +77,7 @@ function s.chainlm(e,rp,tp) ...@@ -78,7 +77,7 @@ function s.chainlm(e,rp,tp)
end end
function s.setfilter(c,tp) function s.setfilter(c,tp)
return c:IsSetCard(0x1c1) and c:CheckUniqueOnField(tp) and not c:IsForbidden() return c:IsSetCard(0x1c1) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
and bit.band(c:GetType(),TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS and c:IsAllTypes(TYPE_TRAP+TYPE_CONTINUOUS)
end end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.setfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil,tp) local g=Duel.GetMatchingGroup(s.setfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil,tp)
......
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