Commit 23a09d25 authored by nekrozar's avatar nekrozar Committed by mercury233

fix&update Rampaging Rhynos, Blasting Fuse and so on (#889)

parent 2f703e8e
...@@ -52,6 +52,6 @@ function c3784434.atkcon(e) ...@@ -52,6 +52,6 @@ function c3784434.atkcon(e)
local c=e:GetHandler() local c=e:GetHandler()
local at=Duel.GetAttackTarget() local at=Duel.GetAttackTarget()
if (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL) and Duel.GetAttacker()==c and at then if (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL) and Duel.GetAttacker()==c and at then
return aux.checksamecolumn(c,at) return c:GetColumnGroup():IsContains(at)
else return false end else return false end
end end
...@@ -55,14 +55,15 @@ function c39188539.seqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -55,14 +55,15 @@ function c39188539.seqop(e,tp,eg,ep,ev,re,r,rp)
Duel.MoveSequence(c,nseq) Duel.MoveSequence(c,nseq)
end end
end end
function c39188539.filter(c,sc) function c39188539.filter(c,g)
return aux.checksamecolumn(c,sc) and c:IsAbleToHand() return g:IsContains(c) and c:IsAbleToHand()
end end
function c39188539.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c39188539.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c39188539.filter(chkc,e:GetHandler()) end local cg=e:GetHandler():GetColumnGroup()
if chk==0 then return Duel.IsExistingTarget(c39188539.filter,tp,0,LOCATION_ONFIELD,1,nil,e:GetHandler()) end if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c39188539.filter(chkc,cg) end
if chk==0 then return Duel.IsExistingTarget(c39188539.filter,tp,0,LOCATION_ONFIELD,1,nil,cg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c39188539.filter,tp,0,LOCATION_ONFIELD,1,1,nil,e:GetHandler()) local g=Duel.SelectTarget(tp,c39188539.filter,tp,0,LOCATION_ONFIELD,1,1,nil,cg)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end end
function c39188539.thop(e,tp,eg,ep,ev,re,r,rp) function c39188539.thop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -12,7 +12,7 @@ function c59687381.initial_effect(c) ...@@ -12,7 +12,7 @@ function c59687381.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE) e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_FZONE) e1:SetRange(LOCATION_FZONE)
e1:SetTargetRange(LOCATION_SZONE,0) e1:SetTargetRange(LOCATION_SZONE,0)
e1:SetTarget(c59687381.filter) e1:SetTarget(c59687381.tgtg)
e1:SetValue(aux.tgoval) e1:SetValue(aux.tgoval)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
...@@ -27,8 +27,11 @@ function c59687381.initial_effect(c) ...@@ -27,8 +27,11 @@ function c59687381.initial_effect(c)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c59687381.filter(e,c) function c59687381.tgfilter(c,tp)
return c:GetSequence()<5 and Duel.GetFieldCard(c:GetControler(),LOCATION_MZONE,c:GetSequence()) return c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5
end
function c59687381.tgtg(e,c)
return c:GetSequence()<5 and c:GetColumnGroup():FilterCount(c59687381.tgfilter,nil,c:GetControler())>0
end end
function c59687381.tgvalue(e,re,rp) function c59687381.tgvalue(e,re,rp)
return rp~=e:GetHandlerPlayer() return rp~=e:GetHandlerPlayer()
......
...@@ -45,6 +45,5 @@ function c76573247.seqop(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,6 +45,5 @@ function c76573247.seqop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c76573247.dircon(e) function c76573247.dircon(e)
local tp=e:GetHandlerPlayer() return e:GetHandler():GetColumnGroup():FilterCount(Card.IsControler,nil,1-e:GetHandlerPlayer())==0
return not Duel.IsExistingMatchingCard(aux.checksamecolumn,tp,0,LOCATION_ONFIELD,1,nil,e:GetHandler())
end end
...@@ -12,18 +12,15 @@ function c99788587.initial_effect(c) ...@@ -12,18 +12,15 @@ function c99788587.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c99788587.condition(e,tp,eg,ep,ev,re,r,rp) function c99788587.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() return e:GetHandler():IsAllColumn()
return Duel.GetMatchingGroupCount(aux.checksamecolumn,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,c,true)==3
end end
function c99788587.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c99788587.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end if chk==0 then return true end
local c=e:GetHandler() local g=e:GetHandler():GetColumnGroup()
local g=Duel.GetMatchingGroup(aux.checksamecolumn,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,c,true)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end end
function c99788587.activate(e,tp,eg,ep,ev,re,r,rp) function c99788587.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local g=e:GetHandler():GetColumnGroup()
local g=Duel.GetMatchingGroup(aux.checksamecolumn,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,c,true)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
end end
......
...@@ -1383,26 +1383,3 @@ function Auxiliary.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -1383,26 +1383,3 @@ function Auxiliary.bfgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end end
--Checks whether 2 cards are on the same column
--skip_ex is optional, indicates whether the Extra Monster Zone should be ignored (used in Blasting Fuse)
function Auxiliary.checksamecolumn(c1,c2,skip_ex)
if not c1 or not c1:IsOnField() or not c2 or not c2:IsOnField() then return false end
if c1==c2 then return false end
local s1=c1:GetSequence()
local s2=c2:GetSequence()
if (c1:IsLocation(LOCATION_SZONE) and s1>=5)
or (c2:IsLocation(LOCATION_SZONE) and s2>=5) then return false end
if c1:GetControler()==c2:GetControler() then
if skip_ex then
return s2==s1
else
return s2==s1 or (s1==1 and s2==5) or (s1==3 and s2==6)
end
else
if skip_ex then
return s2==4-s1
else
return s2==4-s1 or (s1==1 and s2==6) or (s1==3 and s2==5)
end
end
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