Commit 143a549a authored by POLYMER's avatar POLYMER

fix

parent 75800c47
......@@ -20,63 +20,63 @@ function c75075620.initial_effect(c)
c:RegisterEffect(e2)
end
-- 1
function c75075620.filter0(c)
return c:IsSetCard(0x5754) and c:IsType(TYPE_MONSTER)
end
function c75075620.filter1(c,e,tp)
return c:IsSetCard(0x5754) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c75075620.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(function(c)
return c:IsSetCard(0x5754) and c:IsType(TYPE_MONSTER)
end),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil)
or Duel.IsExistingMatchingCard(function(c)
return c:IsSetCard(0x5754) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil)
or Duel.GetFieldGroupCount(tp,LOCATION_FZONE,LOCATION_FZONE)>0
end
local options={}
local op_desc={}
if Duel.IsExistingMatchingCard(aux.NecroValleyFilter(function(c)
return c:IsSetCard(0x5754) and c:IsType(TYPE_MONSTER)
end),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) then
table.insert(options,0)
table.insert(op_desc,aux.Stringid(75075620,0))
end
if Duel.IsExistingMatchingCard(function(c)
return c:IsSetCard(0x5754) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,nil) then
table.insert(options,1)
table.insert(op_desc,aux.Stringid(75075620,1))
end
if Duel.GetFieldGroupCount(tp,LOCATION_FZONE,LOCATION_FZONE)>0 then
table.insert(options,2)
table.insert(op_desc,aux.Stringid(75075620,2))
end
if #options==0 then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
local sel= Duel.SelectOption(tp,table.unpack(op_desc))
e:SetLabel(options[sel+1])
return true
if chk==0 then
return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c75075620.filter0),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil)
or Duel.IsExistingMatchingCard(c75075620.filter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp)
or Duel.GetFieldGroupCount(tp,LOCATION_FZONE,LOCATION_FZONE)>0
end
local options={}
local op_desc={}
if Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c75075620.filter0),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) then
table.insert(options,0)
table.insert(op_desc,aux.Stringid(75075620,0))
end
if Duel.IsExistingMatchingCard(c75075620.filter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) then
table.insert(options,1)
table.insert(op_desc,aux.Stringid(75075620,1))
end
if Duel.GetFieldGroupCount(tp,LOCATION_FZONE,LOCATION_FZONE)>0 then
table.insert(options,2)
table.insert(op_desc,aux.Stringid(75075620,2))
end
if #options==0 then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
local sel= Duel.SelectOption(tp,table.unpack(op_desc))
e:SetLabel(options[sel+1])
return true
end
function c75075620.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local op=e:GetLabel()
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(function(c) return c:IsSetCard(0x5754) and c:IsType(TYPE_MONSTER) end),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
elseif op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.GetMatchingGroup(function(c) return c:IsSetCard(0x5754) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
elseif op==2 then
local fg=Duel.GetFieldGroup(tp,LOCATION_FZONE,LOCATION_FZONE)
local ct=Duel.Destroy(fg,REASON_EFFECT)
if ct>0 then
Duel.Draw(tp,ct,REASON_EFFECT)
end
end
local c=e:GetHandler()
local op=e:GetLabel()
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c75075620.filter0),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,nil)
if g:GetCount()>0 then
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
elseif op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.GetMatchingGroup(c75075620.filter1,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
if g:GetCount()>0 then
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
elseif op==2 then
local fg=Duel.GetFieldGroup(tp,LOCATION_FZONE,LOCATION_FZONE)
local ct=Duel.Destroy(fg,REASON_EFFECT)
if ct>0 then
Duel.Draw(tp,ct,REASON_EFFECT)
end
end
end
-- 2
function c75075620.filter2(c,tp)
......
......@@ -79,10 +79,10 @@ function s.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function s.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x40) and c:IsAbleToHand()
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x40) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
......@@ -130,17 +130,16 @@ function s.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
if Duel.GetMatchingGroupCount(Card.IsSetCard,tp,LOCATION_REMOVED,0,nil,0x40)>=3 then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
end
function s.drcfilter(c)
return c:IsFaceup() and c:IsSetCard(0x40)
end
function s.spop1(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)>0 and Duel.IsPlayerCanDraw(tp,1)
and Duel.GetMatchingGroupCount(Card.IsSetCard,tp,LOCATION_REMOVED,0,nil,0x40)>=3
and Duel.GetMatchingGroupCount(s.drcfilter,tp,LOCATION_REMOVED,0,nil)>=3
and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
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