Commit d1f86a65 authored by mercury233's avatar mercury233

update scripts

parent 52b9c2a2
...@@ -7,7 +7,7 @@ function c100227002.initial_effect(c) ...@@ -7,7 +7,7 @@ function c100227002.initial_effect(c)
e1:SetCategory(CATEGORY_DICE+CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_DICE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,100227002) e1:SetCountLimit(1,100227002+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c100227002.cost) e1:SetCost(c100227002.cost)
e1:SetTarget(c100227002.target) e1:SetTarget(c100227002.target)
e1:SetOperation(c100227002.activate) e1:SetOperation(c100227002.activate)
......
...@@ -19,7 +19,7 @@ function c100227020.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -19,7 +19,7 @@ function c100227020.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c100227020.target(e,tp,eg,ep,ev,re,r,rp,chk) function c100227020.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD) local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>ct and Duel.IsPlayerCanDiscardDeck(tp,ct) if chk==0 then return ct>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>ct and Duel.IsPlayerCanDiscardDeck(tp,ct)
and Duel.IsPlayerCanDraw(tp,1) end and Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,ct) Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
...@@ -32,21 +32,22 @@ function c100227020.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -32,21 +32,22 @@ function c100227020.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,1,REASON_EFFECT)~=0 then if Duel.Draw(tp,1,REASON_EFFECT)~=0 then
local tc=Duel.GetOperatedGroup():GetFirst() local tc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-tp,tc) Duel.ConfirmCards(1-tp,tc)
Duel.ShuffleHand(tp)
if tc:IsCode(100227020) then if tc:IsCode(100227020) then
if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e)) local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
Duel.Destroy(sg,REASON_EFFECT) Duel.Destroy(sg,REASON_EFFECT)
local tg=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_GRAVE) local tg=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_GRAVE)
if #tg>0 then if tg:GetCount()>0 then
Duel.BreakEffect() Duel.BreakEffect()
local dam=#tg*2000 local dam=tg:GetCount()*2000
Duel.Damage(1-tp,dam,REASON_EFFECT) Duel.Damage(1-tp,dam,REASON_EFFECT)
end end
end end
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local dg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,0,ct2,ct2,nil) local dg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToDeck),tp,LOCATION_GRAVE,0,ct2,ct2,nil)
if #dg>0 then if dg:GetCount()>0 then
Duel.SendtoDeck(dg,nil,2,REASON_EFFECT) Duel.SendtoDeck(dg,nil,2,REASON_EFFECT)
end end
end end
......
...@@ -47,13 +47,15 @@ end ...@@ -47,13 +47,15 @@ end
function c100227030.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c100227030.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,c)>0 if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,c)>0
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c100227030.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) end and Duel.IsExistingMatchingCard(c100227030.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function c100227030.spop(e,tp,eg,ep,ev,re,r,rp) function c100227030.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if Duel.GetLocationCountFromEx(tp,tp,c)>0 and c:IsFaceup() if Duel.GetLocationCountFromEx(tp,tp,c)>0 and c:IsFaceup()
and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e) then and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c100227030.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c) local g=Duel.SelectMatchingCard(tp,c100227030.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -29,10 +29,10 @@ function c100227035.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,10 +29,10 @@ function c100227035.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end end
function c100227035.filter(c,e,tp) function c100227035.filter(c,e,tp)
return c:IsSetCard(0x48) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x48) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c100227035.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c100227035.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c100227035.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c100227035.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.IsExistingTarget(c100227035.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.IsPlayerCanDraw(tp,1) end and Duel.IsPlayerCanDraw(tp,1) 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