Commit ac52ac82 authored by salix5's avatar salix5

remove bit.band, bit.bor

parent e2402fc5
......@@ -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()
......
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -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