Commit d6ab1ea8 authored by wind2009's avatar wind2009

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

parents 4b94ac80 519bb607
...@@ -13,7 +13,7 @@ function c11508758.initial_effect(c) ...@@ -13,7 +13,7 @@ function c11508758.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c11508758.ctlcon(e,tp,eg,ep,ev,re,r,rp) function c11508758.ctlcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()~=nil return Duel.GetAttackTarget()~=nil and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>=2
end end
function c11508758.filter(c) function c11508758.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsControlerCanBeChanged() and c:IsAttackable() return c:IsPosition(POS_FACEUP_ATTACK) and c:IsControlerCanBeChanged() and c:IsAttackable()
......
...@@ -57,14 +57,14 @@ function c1683982.atktg(e,c) ...@@ -57,14 +57,14 @@ function c1683982.atktg(e,c)
return not c:IsRace(RACE_REPTILE) return not c:IsRace(RACE_REPTILE)
end end
function c1683982.cfilter(c,tp) function c1683982.cfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) return c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousRaceOnField()&RACE_REPTILE~=0
and c:GetPreviousRaceOnField()&RACE_REPTILE~=0 and c:IsPreviousPosition(POS_FACEUP)
end end
function c1683982.regcon(e,tp,eg,ep,ev,re,r,rp) function c1683982.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c1683982.cfilter,1,nil,tp) return eg:IsExists(c1683982.cfilter,1,nil,tp)
end end
function c1683982.cfilter2(c,tp) function c1683982.cfilter2(c,tp)
return not c:IsReason(REASON_BATTLE) and c1683982.cfilter(c,tp) return not c:IsReason(REASON_BATTLE) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
and c:GetPreviousRaceOnField()&RACE_REPTILE~=0 and c:IsRace(RACE_REPTILE) and c:IsPreviousPosition(POS_FACEUP)
end end
function c1683982.regcon2(e,tp,eg,ep,ev,re,r,rp) function c1683982.regcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c1683982.cfilter2,1,nil,tp) return eg:IsExists(c1683982.cfilter2,1,nil,tp)
......
...@@ -39,7 +39,7 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -39,7 +39,7 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function s.thop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if #g>0 then if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
......
...@@ -27,7 +27,7 @@ function c29177818.initial_effect(c) ...@@ -27,7 +27,7 @@ function c29177818.initial_effect(c)
end end
function c29177818.cfilter(c,tp) function c29177818.cfilter(c,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) and c:IsPreviousPosition(POS_FACEUP) return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(tp) and c:IsPreviousPosition(POS_FACEUP)
and bit.band(c:GetPreviousRaceOnField(),RACE_PLANT)>0 and bit.band(c:GetPreviousRaceOnField(),RACE_PLANT)>0 and c:IsRace(RACE_PLANT)
end end
function c29177818.spcon(e,tp,eg,ep,ev,re,r,rp) function c29177818.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c29177818.cfilter,1,nil,tp) return eg:IsExists(c29177818.cfilter,1,nil,tp)
......
...@@ -70,7 +70,7 @@ end ...@@ -70,7 +70,7 @@ end
function s.cfilter(c,tp,lc) function s.cfilter(c,tp,lc)
local seq=c:GetPreviousSequence() local seq=c:GetPreviousSequence()
if c:IsPreviousControler(1-tp) then seq=seq+16 end if c:IsPreviousControler(1-tp) then seq=seq+16 end
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousRaceOnField()&RACE_DINOSAUR>0 return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousRaceOnField()&RACE_DINOSAUR>0 and c:IsRace(RACE_DINOSAUR)
and c:IsPreviousLocation(LOCATION_MZONE) and bit.extract(lc:GetLinkedZone(),seq)>0 and c:IsPreviousLocation(LOCATION_MZONE) and bit.extract(lc:GetLinkedZone(),seq)>0
end end
function s.drcon(e,tp,eg,ep,ev,re,r,rp) function s.drcon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -69,15 +69,18 @@ end ...@@ -69,15 +69,18 @@ end
function s.splimit(e,c) function s.splimit(e,c)
return not c:IsSetCard(0x1a2) and c:IsLocation(LOCATION_EXTRA) return not c:IsSetCard(0x1a2) and c:IsLocation(LOCATION_EXTRA)
end end
function s.setfilter(c) function s.setfilter(c,ct)
return c:IsSetCard(0x1a2) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() return c:IsSetCard(0x1a2) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable() and (ct>0 or c:IsType(TYPE_FIELD))
end end
function s.target2(e,tp,eg,ep,ev,re,r,rp,chk) function s.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil) end local ct=Duel.GetLocationCount(tp,LOCATION_SZONE)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsLocation(LOCATION_SZONE) then ct=ct-1 end
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil,ct) end
end end
function s.activate2(e,tp,eg,ep,ev,re,r,rp) function s.activate2(e,tp,eg,ep,ev,re,r,rp)
ct=Duel.GetLocationCount(tp,LOCATION_SZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil,ct)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst()) Duel.SSet(tp,g:GetFirst())
end end
......
...@@ -17,7 +17,7 @@ function c78540593.descon(e,tp,eg,ep,ev,re,r,rp) ...@@ -17,7 +17,7 @@ function c78540593.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
return eg:GetCount()==1 and tc:IsReason(REASON_DESTROY) and tc:IsReason(REASON_BATTLE+REASON_EFFECT) return eg:GetCount()==1 and tc:IsReason(REASON_DESTROY) and tc:IsReason(REASON_BATTLE+REASON_EFFECT)
and tc:IsPreviousLocation(LOCATION_MZONE) and tc:IsPreviousControler(tp) and tc:IsPreviousLocation(LOCATION_MZONE) and tc:IsPreviousControler(tp)
and bit.band(tc:GetPreviousRaceOnField(),RACE_PLANT)~=0 and bit.band(tc:GetPreviousRaceOnField(),RACE_PLANT)~=0 and tc:IsRace(RACE_PLANT)
end end
function c78540593.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c78540593.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end
......
...@@ -28,7 +28,7 @@ function c80839052.initial_effect(c) ...@@ -28,7 +28,7 @@ function c80839052.initial_effect(c)
end end
function c80839052.spfilter(c,tp) function c80839052.spfilter(c,tp)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp)
and (c:GetPreviousRaceOnField()&RACE_ROCK)>0 and (c:GetPreviousRaceOnField()&RACE_ROCK)>0 and c:IsRace(RACE_ROCK)
end end
function c80839052.spcon(e,tp,eg,ep,ev,re,r,rp) function c80839052.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c80839052.spfilter,1,nil,tp) return eg:IsExists(c80839052.spfilter,1,nil,tp)
......
...@@ -35,7 +35,7 @@ end ...@@ -35,7 +35,7 @@ end
c90307498.material_setcode=0x8 c90307498.material_setcode=0x8
function c90307498.damcon(e,tp,eg,ep,ev,re,r,rp) function c90307498.damcon(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget() local bc=e:GetHandler():GetBattleTarget()
return bc and bc:IsControler(1-tp) return bc and bc:IsControler(1-tp) and bc:GetAttack()>0
end end
function c90307498.damtg(e,tp,eg,ep,ev,re,r,rp,chk) function c90307498.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
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