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)
end
end
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
function s.setfilter(c)
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)
end
end
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
function s.imcon(e)
local sg=e:GetHandler():GetEquipGroup()
......
......@@ -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)
end
function s.thfilter(c)
return c.toss_coin and c:IsAbleToHand()
return c:IsEffectProperty(aux.EffectCategoryFilter(CATEGORY_COIN)) and c:IsAbleToHand()
end
function s.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
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 b2=Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
if b1 and not b2 then
......@@ -90,5 +90,5 @@ function s.condition(e)
end
function s.aclimit(e,re,tp)
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
......@@ -30,9 +30,9 @@ function s.checkzone(tp)
local zone=0
local g=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
for tc in aux.Next(g) do
zone=bit.bor(zone,tc:GetLinkedZone(tp))
zone=zone|tc:GetLinkedZone(tp)
end
return bit.band(zone,0x1f)
return zone&0x1f
end
function s.spcon(e,c)
if c==nil then return true end
......
......@@ -2,14 +2,6 @@
local s,id,o=GetID()
function s.initial_effect(c)
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
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -19,7 +11,7 @@ function s.initial_effect(c)
--spsummon
local e2=Effect.CreateEffect(c)
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:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
......@@ -58,38 +50,11 @@ function s.initial_effect(c)
e8:SetValue(s.efilter)
c:RegisterEffect(e8)
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
if not s.globle_check then
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
function s.quick_filter(e)
return e:GetCode()==EVENT_CHAINING and e:IsHasType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_QUICK_F) and e:IsHasRange(LOCATION_HAND+LOCATION_MZONE)
end
function s.cfilter(c)
return (c:GetFlagEffect(id)>0 or c.Traitor_chaining_effect) and bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER
and c:IsFaceupEx()
return c:IsOriginalEffectProperty(s.quick_filter) and c:GetOriginalType()&TYPE_MONSTER==TYPE_MONSTER and c:IsFaceupEx()
end
function s.spcon(e,c)
if c==nil then return true end
......
......@@ -60,8 +60,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.cfilter(c,tp)
return bit.band(c:GetType(),TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS
and c:IsPreviousLocation(LOCATION_SZONE) and c:IsControler(tp)
return c:IsAllTypes(TYPE_TRAP+TYPE_CONTINUOUS) and c:IsPreviousLocation(LOCATION_SZONE) and c:IsControler(tp)
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
......@@ -75,8 +74,7 @@ function s.cfilter2(c)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return bit.band(rc:GetType(),TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS
and re:GetActivateLocation()==LOCATION_MZONE
return rc:IsAllTypes(TYPE_TRAP+TYPE_CONTINUOUS) and re:GetActivateLocation()==LOCATION_MZONE
and Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_REMOVED,0,1,nil)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -39,7 +39,7 @@ function s.initial_effect(c)
c:RegisterEffect(e3)
end
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
s.Metallization_material=s.mfilter
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -48,7 +48,7 @@ function s.indtg(e,c)
return c:IsSetCard(0xea)
end
function s.indct(e,re,r,rp)
if bit.band(r,REASON_BATTLE)~=0 then
if r&REASON_BATTLE~=0 then
return 1
else return 0 end
end
......
......@@ -106,7 +106,7 @@ end
function s.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
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 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
......
......@@ -31,7 +31,7 @@ function s.initial_effect(c)
end
s.toss_coin=true
function s.cfilter(c)
return c:IsFaceup() and c.toss_coin
return c:IsFaceup() and c:IsEffectProperty(aux.EffectCategoryFilter(CATEGORY_COIN))
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
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)
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
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
function s.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:GetSequence()<5
......@@ -60,7 +60,7 @@ end
function s.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
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 b2=Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil)
if b1 and not b2 then
......
......@@ -28,7 +28,7 @@ end
function s.cfilter(c,re)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
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
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,re)
......
......@@ -38,9 +38,7 @@ function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function s.cfilter(c)
return c:IsFaceup()
and bit.band(c:GetType(),TYPE_SPELL+TYPE_CONTINUOUS)==TYPE_SPELL+TYPE_CONTINUOUS
and c:IsAbleToGraveAsCost()
return c:IsFaceup() and c:IsAllTypes(TYPE_SPELL+TYPE_CONTINUOUS) and c:IsAbleToGraveAsCost()
end
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
......
......@@ -61,7 +61,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
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
function s.spfilter(c,e,tp)
return c:IsFaceupEx() and c:IsSetCard(0xea) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -28,7 +28,7 @@ function s.initial_effect(c)
end
s.toss_coin=true
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
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
......
......@@ -49,7 +49,7 @@ function s.acop(e,tp,eg,ep,ev,re,r,rp)
end
end
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
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
......
......@@ -39,8 +39,7 @@ function s.mfilter2(c)
return c:IsRace(RACE_ILLUSION)
end
function s.sprfilter(c)
return bit.band(c:GetOriginalType(),TYPE_MONSTER)==TYPE_MONSTER
and c:IsFaceup() and c:IsAbleToGraveAsCost()
return c:GetOriginalType()&TYPE_MONSTER~=0 and c:IsFaceup() and c:IsAbleToGraveAsCost()
end
function s.sgchk(g,tp,sc)
return Duel.GetLocationCountFromEx(tp,tp,g,sc)>0
......
......@@ -66,7 +66,7 @@ end
function s.cfilter2(c,tp,se)
return c:IsReason(REASON_BATTLE+REASON_EFFECT)
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)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -32,7 +32,7 @@ function s.initial_effect(c)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
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
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -49,7 +49,7 @@ function s.acop(e,tp,eg,ep,ev,re,r,rp)
end
end
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
function s.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -45,7 +45,7 @@ function s.indfilter(e,c)
return c:IsRace(RACE_WARRIOR)
end
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
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
......
......@@ -34,8 +34,7 @@ function s.initial_effect(c)
c:RegisterEffect(e3)
end
function s.cfilter(c)
return bit.band(c:GetType(),TYPE_TRAP+TYPE_CONTINUOUS)==TYPE_TRAP+TYPE_CONTINUOUS
and c:IsFaceup()
return c:IsAllTypes(TYPE_TRAP+TYPE_CONTINUOUS) and c:IsFaceup()
end
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)
......@@ -69,7 +68,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
end
function s.actop(e,tp,eg,ep,ev,re,r,rp)
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)
end
end
......@@ -78,7 +77,7 @@ function s.chainlm(e,rp,tp)
end
function s.setfilter(c,tp)
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
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)
......
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