Commit 62d9f7b4 authored by nekrozar's avatar nekrozar

fix CHIM-EN

parent ae4fae7a
...@@ -11,48 +11,27 @@ function c25964547.initial_effect(c) ...@@ -11,48 +11,27 @@ function c25964547.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c25964547.cfilter1(c,tp) function c25964547.cfilter1(c,tp)
return c:IsCode(74665651) and not c:IsForbidden() and ((c:CheckUniqueOnField(tp) return c:IsCode(74665651,1050355) and c:CheckUniqueOnField(tp) and not c:IsForbidden()
and Duel.IsExistingMatchingCard(c25964547.cfilter2,tp,LOCATION_HAND+LOCATION_DECK,0,1,c,1-tp)) and Duel.IsExistingMatchingCard(c25964547.cfilter2,tp,LOCATION_HAND+LOCATION_DECK,0,1,c,tp,c:GetCode())
or (c:CheckUniqueOnField(1-tp)
and Duel.IsExistingMatchingCard(c25964547.cfilter2,tp,LOCATION_HAND+LOCATION_DECK,0,1,c,tp)))
end end
function c25964547.cfilter2(c,p) function c25964547.cfilter2(c,tp,code)
return c:IsCode(1050355) and c:CheckUniqueOnField(p) and not c:IsForbidden() return c:IsCode(74665651,1050355) and not c:IsCode(code) and c:CheckUniqueOnField(1-tp) and not c:IsForbidden()
end end
function c25964547.target(e,tp,eg,ep,ev,re,r,rp,chk) function c25964547.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c25964547.cfilter1,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,tp) end if chk==0 then return Duel.IsExistingMatchingCard(c25964547.cfilter1,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,tp) end
end end
function c25964547.activate(e,tp,eg,ep,ev,re,r,rp) function c25964547.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(c25964547.cfilter1,tp,LOCATION_HAND+LOCATION_DECK,0,nil,tp) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25964547,0))
local b1=g1:IsExists(Card.CheckUniqueOnField,1,nil,tp) local g1=Duel.SelectMatchingCard(tp,c25964547.cfilter1,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,tp)
local b2=g1:IsExists(Card.CheckUniqueOnField,1,nil,1-tp) local tc1=g1:GetFirst()
if not b1 and not b2 then return end if not tc1 then return end
local g2=Duel.GetMatchingGroup(c25964547.cfilter2,tp,LOCATION_HAND+LOCATION_DECK,0,nil,tp) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25964547,1))
local g3=Duel.GetMatchingGroup(c25964547.cfilter2,tp,LOCATION_HAND+LOCATION_DECK,0,nil,1-tp) local g2=Duel.SelectMatchingCard(tp,c25964547.cfilter1,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,tp,tc1:GetCode())
local tg1=nil local tc2=g2:GetFirst()
local tg2=nil if Duel.MoveToField(tc1,tp,tp,LOCATION_SZONE,POS_FACEUP,false) then
if b1 and not b2 then if Duel.MoveToField(tc2,tp,1-tp,LOCATION_SZONE,POS_FACEUP,false) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25964547,0)) tc2:SetStatus(STATUS_EFFECT_ENABLED,true)
tg1=g1:Select(tp,1,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25964547,1)) tc1:SetStatus(STATUS_EFFECT_ENABLED,true)
tg2=g3:Select(tp,1,1,nil)
end end
if not b1 and b2 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25964547,0))
tg1=g2:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25964547,1))
tg2=g1:Select(tp,1,1,nil)
end
if b1 and b2 then
local g=g1:Clone()
g:Merge(g2)
g:Merge(g3)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25964547,0))
tg1=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,tg1:GetFirst():GetCode())
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(25964547,1))
tg2=g:Select(tp,1,1,nil)
end
Duel.MoveToField(tg1:GetFirst(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.MoveToField(tg2:GetFirst(),tp,1-tp,LOCATION_SZONE,POS_FACEUP,true)
end end
--Oneiros, the Dream Mirror Erlking --Oneiros, the Dream Mirror Erlking
function c35187185.initial_effect(c) function c35187185.initial_effect(c)
--fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c35187185.ffilter,2,true) aux.AddFusionProcFunRep(c,c35187185.ffilter,2,true)
--attribute --attribute
...@@ -65,7 +66,8 @@ function c35187185.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -65,7 +66,8 @@ function c35187185.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetPreviousControler()==tp and rp==1-tp return e:GetHandler():GetPreviousControler()==tp and rp==1-tp
end end
function c35187185.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c35187185.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c35187185.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c35187185.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function c35187185.spop(e,tp,eg,ep,ev,re,r,rp) function c35187185.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -35,23 +35,24 @@ function c37021315.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -35,23 +35,24 @@ function c37021315.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
c:RegisterFlagEffect(37021315,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) c:RegisterFlagEffect(37021315,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end end
function c37021315.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(37021315)
end
function c37021315.spcon(e,tp,eg,ep,ev,re,r,rp) function c37021315.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(37021315)>0 return e:GetHandler():GetFlagEffect(37021315)>0
end end
function c37021315.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c37021315.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_GRAVE)
end end
function c37021315.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(37021315)
end
function c37021315.spop(e,tp,eg,ep,ev,re,r,rp) function c37021315.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c37021315.cfilter),tp,LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c37021315.cfilter),tp,LOCATION_GRAVE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(37021315,0)) then and Duel.SelectYesNo(tp,aux.Stringid(37021315,1)) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c37021315.cfilter),tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c37021315.cfilter),tp,LOCATION_GRAVE,0,1,1,nil)
......
...@@ -21,11 +21,8 @@ function c61459246.initial_effect(c) ...@@ -21,11 +21,8 @@ function c61459246.initial_effect(c)
e2:SetOperation(c61459246.activate2) e2:SetOperation(c61459246.activate2)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c61459246.cfilter1(c)
return c:IsFaceup() and c:IsCode(74665651)
end
function c61459246.condition1(e,tp,eg,ep,ev,re,r,rp) function c61459246.condition1(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) and rp==1-tp and Duel.IsExistingMatchingCard(c61459246.cfilter1,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) and rp==1-tp and Duel.IsEnvironment(74665651,PLAYER_ALL,LOCATION_FZONE)
end end
function c61459246.target1(e,tp,eg,ep,ev,re,r,rp,chk) function c61459246.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
...@@ -39,11 +36,8 @@ function c61459246.activate1(e,tp,eg,ep,ev,re,r,rp) ...@@ -39,11 +36,8 @@ function c61459246.activate1(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(eg,REASON_EFFECT) Duel.Destroy(eg,REASON_EFFECT)
end end
end end
function c61459246.cfilter2(c)
return c:IsFaceup() and c:IsCode(1050355)
end
function c61459246.condition2(e,tp,eg,ep,ev,re,r,rp) function c61459246.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and rp==1-tp and Duel.IsExistingMatchingCard(c61459246.cfilter2,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) return Duel.GetCurrentChain()==0 and rp==1-tp and Duel.IsEnvironment(1050355,PLAYER_ALL,LOCATION_FZONE)
end end
function c61459246.target2(e,tp,eg,ep,ev,re,r,rp,chk) function c61459246.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -43,15 +43,9 @@ function c62171834.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,15 +43,9 @@ function c62171834.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
end end
end end
function c62171834.ufilter(c) function c62171834.upcon(e)
return c:IsFaceup() and c:IsCode(74665651) return Duel.IsEnvironment(74665651,PLAYER_ALL,LOCATION_FZONE)
end end
function c62171834.upcon(e,tp) function c62171834.downcon(e)
return Duel.IsExistingMatchingCard(c62171834.ufilter,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) return Duel.IsEnvironment(1050355,PLAYER_ALL,LOCATION_FZONE)
end
function c62171834.dfilter(c)
return c:IsFaceup() and c:IsCode(1050355)
end
function c62171834.downcon(e,tp)
return Duel.IsExistingMatchingCard(c62171834.dfilter,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
end end
...@@ -27,15 +27,16 @@ function c62393472.initial_effect(c) ...@@ -27,15 +27,16 @@ function c62393472.initial_effect(c)
e2:SetOperation(c62393472.spop2) e2:SetOperation(c62393472.spop2)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c62393472.spfilter1(c,e,tp)
return c:IsSetCard(0x131) and c:IsLevelBelow(8) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and not c:IsCode(62393472)
end
function c62393472.spcon1(e,tp,eg,ep,ev,re,r,rp) function c62393472.spcon1(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsSetCard(0x131) and re:IsActiveType(TYPE_MONSTER) return re:GetHandler():IsSetCard(0x131) and re:IsActiveType(TYPE_MONSTER)
end end
function c62393472.spfilter1(c,e,tp)
return c:IsSetCard(0x131) and c:IsLevelBelow(8) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and not c:IsCode(62393472)
end
function c62393472.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c62393472.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c62393472.spfilter1(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c62393472.spfilter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c62393472.spfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c62393472.spfilter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c62393472.spfilter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c62393472.spfilter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
...@@ -46,22 +47,22 @@ function c62393472.spop1(e,tp,eg,ep,ev,re,r,rp) ...@@ -46,22 +47,22 @@ function c62393472.spop1(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end end
end end
function c62393472.cfilter(c)
return c:IsFaceup() and c:IsCode(1050355)
end
function c62393472.spfilter2(c,e,tp)
return c:IsCode(99792080) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c62393472.spcon2(e,tp,eg,ep,ev,re,r,rp) function c62393472.spcon2(e,tp,eg,ep,ev,re,r,rp)
return ((Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE) or Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.IsExistingMatchingCard(c62393472.cfilter,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) local ph=Duel.GetCurrentPhase()
return (ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2)
and Duel.IsEnvironment(1050355,PLAYER_ALL,LOCATION_FZONE)
end end
function c62393472.spcost2(e,tp,eg,ep,ev,re,r,rp,chk) function c62393472.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsReleasable() and Duel.GetMZoneCount(tp,c)>0 end if chk==0 then return c:IsReleasable() end
Duel.Release(c,REASON_COST) Duel.Release(c,REASON_COST)
end end
function c62393472.spfilter2(c,e,tp)
return c:IsCode(99792080) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c62393472.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function c62393472.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c62393472.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c62393472.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c62393472.spop2(e,tp,eg,ep,ev,re,r,rp) function c62393472.spop2(e,tp,eg,ep,ev,re,r,rp)
......
--Desert Locusts --Desert Locusts
function c63410069.initial_effect(c) function c63410069.initial_effect(c)
--synchro summon
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1) aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
--discard --discard
...@@ -32,9 +33,8 @@ function c63410069.diccon(e,tp,eg,ep,ev,re,r,rp) ...@@ -32,9 +33,8 @@ function c63410069.diccon(e,tp,eg,ep,ev,re,r,rp)
end end
function c63410069.dictg(e,tp,eg,ep,ev,re,r,rp,chk) function c63410069.dictg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.SetTargetPlayer(0)
Duel.SetTargetParam(1) Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,0,1) Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,Duel.GetTurnPlayer(),1)
end end
function c63410069.dicop(e,tp,eg,ep,ev,re,r,rp) function c63410069.dicop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetTurnPlayer() local p=Duel.GetTurnPlayer()
...@@ -42,7 +42,7 @@ function c63410069.dicop(e,tp,eg,ep,ev,re,r,rp) ...@@ -42,7 +42,7 @@ function c63410069.dicop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(p,LOCATION_HAND,0) local g=Duel.GetFieldGroup(p,LOCATION_HAND,0)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_DISCARD) Duel.Hint(HINT_SELECTMSG,p,HINTMSG_DISCARD)
sg=g:Select(p,1,1,nil) local sg=g:Select(p,1,1,nil)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD) Duel.SendtoGrave(sg,REASON_EFFECT+REASON_DISCARD)
end end
end end
......
...@@ -11,16 +11,17 @@ function c90814668.initial_effect(c) ...@@ -11,16 +11,17 @@ function c90814668.initial_effect(c)
e1:SetOperation(c90814668.activate) e1:SetOperation(c90814668.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c90814668.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function c90814668.cfilter(c,e,tp) function c90814668.cfilter(c,e,tp)
return c:IsType(TYPE_EFFECT) and Duel.IsExistingMatchingCard(c90814668.spfilter,tp,LOCATION_GRAVE,0,1,c,e,tp,c:GetOriginalRace(),c:GetOriginalAttribute()) and Duel.GetMZoneCount(tp,c)>0 return c:IsType(TYPE_EFFECT) and Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c90814668.spfilter,tp,LOCATION_GRAVE,0,1,c,e,tp,c:GetOriginalRace(),c:GetOriginalAttribute())
end end
function c90814668.spfilter(c,e,tp,race,att) function c90814668.spfilter(c,e,tp,race,att)
return c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetOriginalRace()==race and c:GetOriginalAttribute()==att return c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_EFFECT) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetOriginalRace()==race and c:GetOriginalAttribute()==att
end end
function c90814668.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function c90814668.target(e,tp,eg,ep,ev,re,r,rp,chk) function c90814668.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
if e:GetLabel()~=100 then return false end if e:GetLabel()~=100 then return false end
...@@ -29,17 +30,13 @@ function c90814668.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -29,17 +30,13 @@ function c90814668.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectReleaseGroup(tp,c90814668.cfilter,1,1,nil,e,tp) local g=Duel.SelectReleaseGroup(tp,c90814668.cfilter,1,1,nil,e,tp)
e:SetLabel(g:GetFirst():GetRank(),g:GetFirst():GetOriginalRace(),g:GetFirst():GetOriginalAttribute())
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
g:KeepAlive()
e:SetLabelObject(g:GetFirst())
e:SetLabel(0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end end
function c90814668.activate(e,tp,eg,ep,ev,re,r,rp) function c90814668.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=e:GetLabelObject() local race,att=e:GetLabel()
local race=tc:GetOriginalRace()
local att=tc:GetOriginalAttribute()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c90814668.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp,race,att) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c90814668.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp,race,att)
if g:GetCount()>0 then if g:GetCount()>0 then
......
...@@ -20,22 +20,16 @@ end ...@@ -20,22 +20,16 @@ end
function c98570539.filter2(c,e,tp,m,f,chkf) function c98570539.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x131) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf) return c:IsType(TYPE_FUSION) and c:IsSetCard(0x131) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end end
function c98570539.cfilter1(c)
return c:IsFaceup() and c:IsCode(74665651)
end
function c98570539.cfilter2(c)
return c:IsFaceup() and c:IsCode(1050355)
end
function c98570539.target(e,tp,eg,ep,ev,re,r,rp,chk) function c98570539.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil) local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
local mg2=nil local mg2=nil
if Duel.IsExistingMatchingCard(c98570539.cfilter1,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) then if Duel.IsEnvironment(74665651,PLAYER_ALL,LOCATION_FZONE) then
mg2=Duel.GetFusionMaterial(tp):Filter(Card.IsLocation,nil,LOCATION_HAND) mg2=Duel.GetFusionMaterial(tp):Filter(Card.IsLocation,nil,LOCATION_HAND)
mg1:Merge(mg2) mg1:Merge(mg2)
end end
if Duel.IsExistingMatchingCard(c98570539.cfilter2,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) then if Duel.IsEnvironment(1050355,PLAYER_ALL,LOCATION_FZONE) then
mg2=Duel.GetMatchingGroup(c98570539.filter0,tp,LOCATION_GRAVE,0,nil) mg2=Duel.GetMatchingGroup(c98570539.filter0,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2) mg1:Merge(mg2)
end end
...@@ -58,11 +52,11 @@ function c98570539.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -58,11 +52,11 @@ function c98570539.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil):Filter(c98570539.filter1,nil,e) local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil):Filter(c98570539.filter1,nil,e)
local mg2=nil local mg2=nil
if Duel.IsExistingMatchingCard(c98570539.cfilter1,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) then if Duel.IsEnvironment(74665651,PLAYER_ALL,LOCATION_FZONE) then
mg2=Duel.GetFusionMaterial(tp):Filter(Card.IsLocation,nil,LOCATION_HAND) mg2=Duel.GetFusionMaterial(tp):Filter(Card.IsLocation,nil,LOCATION_HAND)
mg1:Merge(mg2) mg1:Merge(mg2)
end end
if Duel.IsExistingMatchingCard(c98570539.cfilter2,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) then if Duel.IsEnvironment(1050355,PLAYER_ALL,LOCATION_FZONE) then
mg2=Duel.GetMatchingGroup(c98570539.filter0,tp,LOCATION_GRAVE,0,nil) mg2=Duel.GetMatchingGroup(c98570539.filter0,tp,LOCATION_GRAVE,0,nil)
mg1:Merge(mg2) mg1:Merge(mg2)
end end
......
...@@ -26,7 +26,7 @@ function c99792080.initial_effect(c) ...@@ -26,7 +26,7 @@ function c99792080.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c99792080.dircon(e,tp,eg,ep,ev,re,r,rp) function c99792080.dircon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsSetCard(0x131) and re:IsActiveType(TYPE_MONSTER) return re:GetHandler():IsSetCard(0x131) and re:IsActiveType(TYPE_MONSTER) and Duel.IsAbleToEnterBP()
end end
function c99792080.dirop(e,tp,eg,ep,ev,re,r,rp) function c99792080.dirop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -38,22 +38,22 @@ function c99792080.dirop(e,tp,eg,ep,ev,re,r,rp) ...@@ -38,22 +38,22 @@ function c99792080.dirop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
end end
function c99792080.cfilter(c)
return c:IsFaceup() and c:IsCode(74665651)
end
function c99792080.spfilter(c,e,tp)
return c:IsCode(62393472) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c99792080.spcon(e,tp,eg,ep,ev,re,r,rp) function c99792080.spcon(e,tp,eg,ep,ev,re,r,rp)
return ((Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE) or Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.IsExistingMatchingCard(c99792080.cfilter,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil) local ph=Duel.GetCurrentPhase()
return (ph==PHASE_MAIN1 or (ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE) or ph==PHASE_MAIN2)
and Duel.IsEnvironment(74665651,PLAYER_ALL,LOCATION_FZONE)
end end
function c99792080.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c99792080.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsReleasable() and Duel.GetMZoneCount(tp,c)>0 end if chk==0 then return c:IsReleasable() end
Duel.Release(c,REASON_COST) Duel.Release(c,REASON_COST)
end end
function c99792080.spfilter(c,e,tp)
return c:IsCode(62393472) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c99792080.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c99792080.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c99792080.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end if chk==0 then return Duel.GetMZoneCount(tp,c)>0
and Duel.IsExistingMatchingCard(c99792080.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
function c99792080.spop(e,tp,eg,ep,ev,re,r,rp) function c99792080.spop(e,tp,eg,ep,ev,re,r,rp)
......
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