Commit a5b353ec authored by POLYMER's avatar POLYMER

fix

parent e74eb1e2
...@@ -48,7 +48,7 @@ function c11561016.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -48,7 +48,7 @@ function c11561016.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(sg,nil,SEQ_DECKTOP,REASON_EFFECT) Duel.SendtoDeck(sg,nil,SEQ_DECKTOP,REASON_EFFECT)
g:Merge(sg) g:Merge(sg)
Duel.SortDecktop(tp,tp,ct) Duel.SortDecktop(tp,tp,ct)
if #sg>=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) and Duel.IsPlayerCanDraw(tp,1) then if #sg>=math.ceil(Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)/2) and Duel.IsPlayerCanDraw(tp,1) then
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
Duel.BreakEffect() Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
...@@ -56,3 +56,4 @@ function c11561016.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -56,3 +56,4 @@ function c11561016.regop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
RACE_PLANT
\ No newline at end of file
...@@ -31,7 +31,7 @@ function s.initial_effect(c) ...@@ -31,7 +31,7 @@ function s.initial_effect(c)
--Tohand(0x01) --Tohand(0x01)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2)) e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND) e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD) e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DELAY)
......
...@@ -15,7 +15,7 @@ function s.initial_effect(c) ...@@ -15,7 +15,7 @@ function s.initial_effect(c)
--TdOrSum(c) --TdOrSum(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_TO_HAND) e2:SetCode(EVENT_TO_HAND)
...@@ -66,7 +66,9 @@ function s.toscon(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,7 +66,9 @@ function s.toscon(e,tp,eg,ep,ev,re,r,rp)
end end
function s.tostg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tostg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeck() or c:IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return c:IsAbleToDeck()
or (c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCount(tp,0x04)>0) end
if c:IsAbleToDeck() then if c:IsAbleToDeck() then
Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,c,1,0,0)
end end
...@@ -82,6 +84,7 @@ function s.tosop(e,tp,eg,ep,ev,re,r,rp) ...@@ -82,6 +84,7 @@ function s.tosop(e,tp,eg,ep,ev,re,r,rp)
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
local b1=c:IsAbleToDeck() local b1=c:IsAbleToDeck()
local b2=c:IsCanBeSpecialSummoned(e,0,tp,false,false) local b2=c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCount(tp,0x04)>0
local op=0 local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3)) if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))
elseif b1 then op=0 elseif b1 then op=0
...@@ -89,7 +92,7 @@ function s.tosop(e,tp,eg,ep,ev,re,r,rp) ...@@ -89,7 +92,7 @@ function s.tosop(e,tp,eg,ep,ev,re,r,rp)
else return end else return end
if op==0 then if op==0 then
local g=Duel.GetMatchingGroup(s.spfi2ter,tp,0x02,0,nil,e,tp) local g=Duel.GetMatchingGroup(s.spfi2ter,tp,0x02,0,nil,e,tp)
if Duel.SendtoDeck(c,nil,1,0x40)>0 and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then if Duel.SendtoDeck(c,nil,1,0x40)>0 and #g>0 and Duel.GetLocationCount(tp,0x04)>0 and Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
Duel.Hint(3,tp,509) Duel.Hint(3,tp,509)
local tc=g:Select(tp,1,1,nil) local tc=g:Select(tp,1,1,nil)
if tc then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end if tc then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end
......
...@@ -12,6 +12,7 @@ function s.initial_effect(c) ...@@ -12,6 +12,7 @@ function s.initial_effect(c)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetCondition(s.discon) e1:SetCondition(s.discon)
e1:SetCost(s.discost) e1:SetCost(s.discost)
e1:SetTarget(s.distg)
e1:SetOperation(s.disop) e1:SetOperation(s.disop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--SpSum(c) --SpSum(c)
......
...@@ -317,6 +317,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -317,6 +317,7 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) 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) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 then if #g>0 then
......
...@@ -58,7 +58,7 @@ function s.repop(e,tp,eg,ep,ev,re,r,rp) ...@@ -58,7 +58,7 @@ function s.repop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function s.filter(c,tp) function s.filter(c,tp)
return c:IsSetCard(0x5a7d) and not c:IsCode(id) and c:IsType(TYPE_MONSTER) and not c:IsForbidden() and c:CheckUniqueOnField(tp) return c:IsSetCard(0x5a7d) and not c:IsCode(id) and c:IsType(TYPE_MONSTER) and not c:IsForbidden() and c:CheckUniqueOnField(tp) and c:IsFaceupEx()
end end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk) function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,tp) if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,tp)
......
...@@ -9,7 +9,7 @@ function s.initial_effect(c) ...@@ -9,7 +9,7 @@ function s.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target) e1:SetTarget(s.target1)
e1:SetOperation(s.activate) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -19,7 +19,7 @@ function s.initial_effect(c) ...@@ -19,7 +19,7 @@ function s.initial_effect(c)
e2:SetCode(EVENT_DESTROYED) e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id) e2:SetCountLimit(1,id)
e2:SetTarget(s.target) e2:SetTarget(s.target2)
e2:SetOperation(s.op2) e2:SetOperation(s.op2)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--act in set turn --act in set turn
...@@ -44,7 +44,7 @@ end ...@@ -44,7 +44,7 @@ end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsSetCard(0x5a7d) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x5a7d) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.target1(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,0,e:GetHandler()) local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,0,e:GetHandler())
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
...@@ -53,6 +53,10 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -53,6 +53,10 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
end end
function s.target2(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_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp) function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
......
...@@ -42,6 +42,8 @@ function c22348467.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -42,6 +42,8 @@ function c22348467.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end if chk==0 then return Duel.GetMZoneCount(tp)>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)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
function c22348467.xyzfilter(c) function c22348467.xyzfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsXyzSummonable(nil) return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsXyzSummonable(nil)
......
...@@ -60,15 +60,23 @@ end ...@@ -60,15 +60,23 @@ end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk) function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local loc=c:GetFlagEffectLabel(id) local loc=c:GetFlagEffectLabel(id)
if chk==0 then return (bit.band(loc,LOCATION_HAND)==0 or Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_HAND,1,nil)) if chk==0 then return loc and (bit.band(loc,LOCATION_HAND)==0 or Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_HAND,1,nil))
and (bit.band(loc,LOCATION_MZONE)==0 or Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,nil)) and (bit.band(loc,LOCATION_MZONE)==0 or Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,nil))
and (bit.band(loc,LOCATION_GRAVE)==0 or Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,1,nil)) and (bit.band(loc,LOCATION_GRAVE)==0 or Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,1,nil))
and (bit.band(loc,LOCATION_REMOVED)==0 or Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_REMOVED,1,nil)) end and (bit.band(loc,LOCATION_REMOVED)==0 or Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_REMOVED,1,nil)) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND+LOCATION_REMOVED) local td_loc=0
if bit.band(loc,LOCATION_HAND)==0 then td_loc=td_loc+LOCATION_HAND end
if bit.band(loc,LOCATION_MZONE)==0 then td_loc=td_loc+LOCATION_ONFIELD end
if bit.band(loc,LOCATION_GRAVE)==0 then td_loc=td_loc+LOCATION_GRAVE end
if bit.band(loc,LOCATION_REMOVED)==0 then td_loc=td_loc+REMOVED end
e:SetLabel(td_loc)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,td_loc)
end end
function s.tdop(e,tp,eg,ep,ev,re,r,rp) function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local loc=c:GetFlagEffectLabel(id) local loc=c:GetLabel()
if not loc then return end
if loc==0 then return end
local g1=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_HAND,nil) local g1=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_HAND,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,nil) local g2=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,nil)
local g3=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,nil) local g3=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,nil)
......
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