Commit 0523dc0a authored by wind2009's avatar wind2009

Merge remote-tracking branch '233/patch-sync-workaround' into master

parents aef63c29 da8dba6a
...@@ -59,7 +59,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -59,7 +59,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
e1:SetCode(EFFECT_CHANGE_CODE) e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(38033121) e1:SetValue(38033121)
e1:SetReset(RESET_EVENT+0xff0000) e1:SetReset(RESET_EVENT+0xfe0000)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.thfilter(c) function s.thfilter(c)
......
...@@ -62,8 +62,8 @@ function c42158279.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -62,8 +62,8 @@ function c42158279.activate(e,tp,eg,ep,ev,re,r,rp)
tc:CompleteProcedure() tc:CompleteProcedure()
end end
end end
function c42158279.thfilter(c) function c42158279.thfilter(c,e)
return c:IsSetCard(0x145) and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x145) and c:IsType(TYPE_MONSTER) and c:IsCanBeEffectTarget(e)
end end
function c42158279.fselect(g) function c42158279.fselect(g)
return aux.dlvcheck(g) and g:IsExists(c42158279.fcheck,1,nil,g) return aux.dlvcheck(g) and g:IsExists(c42158279.fcheck,1,nil,g)
...@@ -75,8 +75,8 @@ function c42158279.fcheck2(c) ...@@ -75,8 +75,8 @@ function c42158279.fcheck2(c)
return c:IsAbleToDeck() return c:IsAbleToDeck()
end end
function c42158279.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c42158279.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c42158279.thfilter,tp,LOCATION_GRAVE,0,nil)
if chkc then return false end if chkc then return false end
local g=Duel.GetMatchingGroup(c42158279.thfilter,tp,LOCATION_GRAVE,0,nil,e)
if chk==0 then return g:CheckSubGroup(c42158279.fselect,2,2) end if chk==0 then return g:CheckSubGroup(c42158279.fselect,2,2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sg=g:SelectSubGroup(tp,c42158279.fselect,false,2,2) local sg=g:SelectSubGroup(tp,c42158279.fselect,false,2,2)
......
...@@ -29,17 +29,11 @@ function c45675980.initial_effect(c) ...@@ -29,17 +29,11 @@ function c45675980.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c45675980.syncheck(g,tp,syncard) function c45675980.syncheck(g,tp,syncard)
return aux.SynMixHandCheck(g,tp,syncard) and syncard:IsSynchroSummonable(nil,g,#g-1,#g-1) return g:IsExists(Card.IsRace,1,nil,RACE_DRAGON)
end and aux.SynMixHandCheck(g,tp,syncard) and syncard:IsSynchroSummonable(nil,g,#g-1,#g-1)
function c45675980.syncheckaddition(syncard)
return function(g)
if not g:IsExists(Card.IsRace,1,nil,RACE_DRAGON) then return false end
local sumlv=g:GetSum(Auxiliary.GetMinSynchroLevel,syncard)
return sumlv<=syncard:GetLevel()
end
end end
function c45675980.spfilter(c,tp,mg) function c45675980.spfilter(c,tp,mg)
aux.GCheckAdditional=c45675980.syncheckaddition(c) aux.GCheckAdditional=aux.SynGroupCheckLevelAddition(c)
local res=mg:CheckSubGroup(c45675980.syncheck,2,#mg,tp,c) local res=mg:CheckSubGroup(c45675980.syncheck,2,#mg,tp,c)
aux.GCheckAdditional=nil aux.GCheckAdditional=nil
return res return res
......
...@@ -66,7 +66,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,7 +66,7 @@ function s.thop(e,tp,eg,ep,ev,re,r,rp)
end end
function s.aclimit(e,re) function s.aclimit(e,re)
local rc=re:GetHandler() local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and rc:IsLevelAbove(5) and rc:IsSummonLocation(LOCATION_EXTRA) return re:IsActiveType(TYPE_MONSTER) and rc:IsLevelAbove(5) and rc:IsLocation(LOCATION_MZONE) and rc:IsSummonLocation(LOCATION_EXTRA)
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
......
...@@ -25,6 +25,7 @@ function s.initial_effect(c) ...@@ -25,6 +25,7 @@ function s.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_DESTROYED) e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,id+o) e2:SetCountLimit(1,id+o)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg) e2:SetTarget(s.sptg)
e2:SetOperation(s.spop) e2:SetOperation(s.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -56,6 +57,9 @@ function s.deop(e,tp,eg,ep,ev,re,r,rp) ...@@ -56,6 +57,9 @@ function s.deop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsLevelBelow(5) and c:IsRace(RACE_MACHINE) return c:IsLevelBelow(5) and c:IsRace(RACE_MACHINE)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
......
...@@ -441,6 +441,12 @@ function Auxiliary.TuneMagicianCheckAdditionalX(ecode) ...@@ -441,6 +441,12 @@ function Auxiliary.TuneMagicianCheckAdditionalX(ecode)
return not g:IsExists(Auxiliary.TuneMagicianCheckX,1,nil,g,ecode) return not g:IsExists(Auxiliary.TuneMagicianCheckX,1,nil,g,ecode)
end end
end end
function Auxiliary.SynGroupCheckLevelAddition(syncard)
return function(g)
local sumlv=g:GetSum(Auxiliary.GetMinSynchroLevel,syncard)
return sumlv<=syncard:GetLevel()
end
end
--Xyz Summon --Xyz Summon
function Auxiliary.XyzAlterFilter(c,alterf,xyzc,e,tp,alterop) function Auxiliary.XyzAlterFilter(c,alterf,xyzc,e,tp,alterop)
......
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