Commit d58e2f71 authored by TanakaKotoha's avatar TanakaKotoha

lua fix

parent 336e0a9b
...@@ -50,7 +50,7 @@ function c12008030.spfilter1(c,e,tp) ...@@ -50,7 +50,7 @@ function c12008030.spfilter1(c,e,tp)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end end
function c12008030.spfilter2(c,e,tp,mc,level) function c12008030.spfilter2(c,e,tp,mc,level)
return c:IsType(TYPE_XYZ) and c:GetLevel()==level and mc:IsCanBeXyzMaterial(c) return c:IsType(TYPE_XYZ) and c:GetRank==level and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end end
function c12008030.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c12008030.sptg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
--靜儀式 青の博物館 --靜儀式 青の博物館
function c12010037.initial_effect(c) function c12010037.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,12008011+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,12010037+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c12010037.activate) e1:SetOperation(c12010037.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon --special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12010037,1)) e1:SetDescription(aux.Stringid(12010037,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetRange(LOCATION_FZONE) e1:SetRange(LOCATION_FZONE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_HAND) e1:SetCode(EVENT_TO_HAND)
e1:SetTarget(c12010037.sptg) e1:SetTarget(c12010037.sptg)
e1:SetOperation(c12010037.spop) e1:SetOperation(c12010037.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12010037,2)) e1:SetDescription(aux.Stringid(12010037,2))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetRange(LOCATION_FZONE) e1:SetRange(LOCATION_FZONE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_HAND) e1:SetCode(EVENT_TO_HAND)
e1:SetTarget(c12010037.sptg1) e1:SetTarget(c12010037.sptg1)
e1:SetOperation(c12010037.spop1) e1:SetOperation(c12010037.spop1)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c12010037.thfilter(c) function c12010037.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xfbb) and c:IsAbleToHand() return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xfbb) and c:IsAbleToHand()
end end
function c12010037.activate(e,tp,eg,ep,ev,re,r,rp) function c12010037.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c12010037.thfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(c12010037.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(12010037,0)) then if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(12010037,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT) Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
end end
end end
function c12010037.filter(c,tp) function c12010037.filter(c,tp)
return c:IsType(TYPE_TRAP) and (c:IsType(TYPE_CONTINUOUS) or c:IsType(TYPE_COUNTER)) and c:IsControler(tp) and not c:IsPublic() return c:IsType(TYPE_TRAP) and (c:IsType(TYPE_CONTINUOUS) or c:IsType(TYPE_COUNTER)) and c:IsControler(tp) and not c:IsPublic()
and c:IsPreviousLocation(LOCATION_DECK) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_DECK) and c:GetPreviousControler()==tp
end end
function c12010037.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c12010037.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and eg:IsExists(c12010037.filter,1,nil,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and eg:IsExists(c12010037.filter,1,nil,tp) end
local g=eg:Filter(c12010037.filter,nil,tp) local g=eg:Filter(c12010037.filter,nil,tp)
if g:GetCount()==1 then if g:GetCount()==1 then
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
Duel.SetTargetCard(g) Duel.SetTargetCard(g)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
Duel.SetTargetCard(sg) Duel.SetTargetCard(sg)
end end
end end
function c12010037.spop(e,tp,eg,ep,ev,re,r,rp) function c12010037.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SSet(tp,tc) Duel.SSet(tp,tc)
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN) e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
end end
function c12010037.filter1(c,tp) function c12010037.filter1(c,tp)
return c:IsType(TYPE_SPELL) and c:IsType(TYPE_CONTINUOUS+TYPE_FIELD) and c:IsSetCard(0xfbc) and c:IsControler(tp) and not c:IsPublic() return c:IsType(TYPE_SPELL) and c:IsType(TYPE_CONTINUOUS+TYPE_FIELD) and c:IsSetCard(0xfbc) and c:IsControler(tp) and not c:IsPublic()
and c:IsPreviousLocation(LOCATION_DECK) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_DECK) and c:GetPreviousControler()==tp
end end
function c12010037.sptg1(e,tp,eg,ep,ev,re,r,rp,chk) function c12010037.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and eg:IsExists(c12010037.filter1,1,nil,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and eg:IsExists(c12010037.filter1,1,nil,tp) end
local g=eg:Filter(c12010037.filter1,nil,tp) local g=eg:Filter(c12010037.filter1,nil,tp)
if g:GetCount()==1 then if g:GetCount()==1 then
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
Duel.SetTargetCard(g) Duel.SetTargetCard(g)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
Duel.ConfirmCards(1-tp,sg) Duel.ConfirmCards(1-tp,sg)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
Duel.SetTargetCard(sg) Duel.SetTargetCard(sg)
end end
end end
function c12010037.spop1(e,tp,eg,ep,ev,re,r,rp) function c12010037.spop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.RaiseEvent(tc,EVENT_CHAIN_SOLVED,tc:GetActivateEffect(),0,tp,tp,Duel.GetCurrentChain()) Duel.RaiseEvent(tc,EVENT_CHAIN_SOLVED,tc:GetActivateEffect(),0,tp,tp,Duel.GetCurrentChain())
end 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