Commit 0c33633d authored by wind2009's avatar wind2009

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

parents 9d60d885 f77806eb
......@@ -8,6 +8,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetCondition(aux.MimighoulFlipCondition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
......@@ -42,25 +43,23 @@ function s.spfilter(c,e,tp)
return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then
local tg=Duel.GetDecktopGroup(tp,3)
if #tg==0 then return end
Duel.DisableShuffleCheck()
if Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
if #g>0 then
Duel.BreakEffect()
Duel.SpecialSummon(g:GetFirst(),0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
end
end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local tg=Duel.GetDecktopGroup(tp,3)
if #tg==0 then return end
Duel.DisableShuffleCheck()
if Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)>0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_REMOVED,0,1,nil,e,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
if #g>0 then
Duel.BreakEffect()
Duel.GetControl(c,1-tp)
Duel.SpecialSummon(g:GetFirst(),0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
end
end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.GetControl(c,1-tp)
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -9,7 +9,7 @@ function c31386180.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetCondition(c31386180.incon)
e1:SetCondition(c31386180.condition)
e1:SetValue(1)
c:RegisterEffect(e1)
--destroy
......@@ -21,7 +21,6 @@ function c31386180.initial_effect(c)
e2:SetCode(EVENT_PHASE+PHASE_BATTLE)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c31386180.descon)
e2:SetTarget(c31386180.destg)
e2:SetOperation(c31386180.desop)
c:RegisterEffect(e2)
......@@ -36,21 +35,18 @@ function c31386180.initial_effect(c)
e3:SetOperation(c31386180.rmop)
c:RegisterEffect(e3)
end
function c31386180.incon(e)
function c31386180.condition(e)
return e:GetHandler():GetOverlayCount()>0
end
function c31386180.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetBattledGroupCount()>0
end
function c31386180.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c31386180.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetOverlayCount()==0 then return end
if not c31386180.condition(e) then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsControler(1-tp) then
Duel.Destroy(tc,REASON_EFFECT)
......@@ -60,8 +56,7 @@ function c31386180.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c31386180.rmop(e,tp,eg,ep,ev,re,r,rp)
if not c31386180.condition(e) then return end
local c=e:GetHandler()
if c:GetOverlayCount()>0 then
c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)
end
c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)
end
......@@ -25,7 +25,7 @@ function c50366775.cfilter(c,tc)
return c:IsType(TYPE_LINK) and not c:IsCode(tc:GetLinkCode())
end
function c50366775.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50366775.filter,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
if chk==0 then return Duel.IsExistingMatchingCard(c50366775.cfilter,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
end
function c50366775.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -8,6 +8,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetCondition(aux.MimighoulFlipCondition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
......@@ -43,21 +44,19 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,1)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then
Duel.Draw(1-tp,1,REASON_EFFECT)
local tg1=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if tg1:GetCount()>0 then
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc1=tg1:Select(tp,1,1,nil):GetFirst()
Duel.BreakEffect()
Duel.SendtoGrave(tc1,REASON_EFFECT)
end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.GetControl(c,1-tp)
end
Duel.Draw(1-tp,1,REASON_EFFECT)
local tg1=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
if tg1:GetCount()>0 then
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tc1=tg1:Select(tp,1,1,nil):GetFirst()
Duel.BreakEffect()
Duel.SendtoGrave(tc1,REASON_EFFECT)
end
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.GetControl(c,1-tp)
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -36,6 +36,7 @@ function s.initial_effect(c)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,id+o*2)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
......@@ -76,6 +77,9 @@ function s.dsop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1)
end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function s.filter(c,e,tp)
return c:IsSetCard(0x81) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
......@@ -90,5 +94,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_GRAVE,0,1,e:GetLabel(),nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -22,7 +22,7 @@ function c7672244.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c7672244.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
if tc:IsRelateToEffect(e) then
Duel.GetControl(tc,1-tp,PHASE_END,1)
end
end
......@@ -8,6 +8,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetCondition(aux.MimighoulFlipCondition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
......@@ -46,14 +47,12 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) then
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil)
Duel.Destroy(g,REASON_EFFECT)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.GetControl(c,1-tp)
end
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil)
Duel.Destroy(g,REASON_EFFECT)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.GetControl(c,1-tp)
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -1772,3 +1772,7 @@ end
function Auxiliary.DimensionalFissureTarget(e,c)
return c:GetOriginalType()&TYPE_MONSTER>0 and not c:IsLocation(LOCATION_OVERLAY) and not c:IsType(TYPE_SPELL+TYPE_TRAP)
end
--
function Auxiliary.MimighoulFlipCondition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsMainPhase()
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