Commit d1acb798 authored by Nemo Ma's avatar Nemo Ma

tama card fix

parent 0fdc029e
...@@ -92,7 +92,7 @@ function cm.setfilter1(c,e,tp) ...@@ -92,7 +92,7 @@ function cm.setfilter1(c,e,tp)
return not c:IsType(TYPE_MONSTER) and ((c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and c:IsSSetable()) return not c:IsType(TYPE_MONSTER) and ((c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and c:IsSSetable())
end end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.setfilter(chkc) end if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.setfilter(chkc,e,tp) end
if chk==0 then return if chk==0 then return
(not Duel.IsExistingMatchingCard(cm.setfilter1,tp,0,LOCATION_GRAVE,1,nil,e,tp) or Duel.IsPlayerAffectedByEffect(tp,59822133)) (not Duel.IsExistingMatchingCard(cm.setfilter1,tp,0,LOCATION_GRAVE,1,nil,e,tp) or Duel.IsPlayerAffectedByEffect(tp,59822133))
and Duel.IsExistingTarget(cm.setfilter,tp,0,LOCATION_GRAVE,2,nil,e,tp) and Duel.IsExistingTarget(cm.setfilter,tp,0,LOCATION_GRAVE,2,nil,e,tp)
...@@ -104,7 +104,7 @@ function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -104,7 +104,7 @@ function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SelectTarget(tp,cm.setfilter1,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SelectTarget(tp,cm.setfilter1,tp,LOCATION_GRAVE,0,1,1,nil)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,cm.setfilter,tp,LOCATION_GRAVE,0,ft,ft,nil) local g=Duel.SelectTarget(tp,cm.setfilter,tp,LOCATION_GRAVE,0,ft,ft,nil,e,tp)
local sg=g:Filter(Card.IsType,nil,TYPE_MONSTER) local sg=g:Filter(Card.IsType,nil,TYPE_MONSTER)
local cat=e:GetCategory() local cat=e:GetCategory()
if sg:GetCount()>0 then if sg:GetCount()>0 then
......
...@@ -32,12 +32,12 @@ function cm.rmfilter(c) ...@@ -32,12 +32,12 @@ function cm.rmfilter(c)
return c:IsSetCard(0x356) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() return c:IsSetCard(0x356) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_REMOVED,0)>0 and Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_DECK,0,1,nil) end if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_REMOVED,LOCATION_REMOVED)>0 and Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_REMOVED) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_REMOVED,0) local g=Duel.GetFieldGroup(tp,LOCATION_REMOVED,LOCATION_REMOVED)
if g:GetCount()<=0 then return end if g:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=g:Select(tp,1,2,nil) local g1=g:Select(tp,1,2,nil)
......
...@@ -94,7 +94,7 @@ function cm.smop(e,tp,eg,ep,ev,re,r,rp) ...@@ -94,7 +94,7 @@ function cm.smop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local el={{13254031,1},{13254031,2},{13254033,1},{13254034,1},{13254035,1},{13254036,1}} local el={{13254031,1},{13254032,1},{13254033,1},{13254034,1},{13254035,1},{13254036,1}}
local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el) local mg=tama.tamas_checkGroupElements(Duel.GetFieldGroup(tp,LOCATION_GRAVE,0),el)
local sg=Group.CreateGroup() local sg=Group.CreateGroup()
if chk==0 then if chk==0 then
......
...@@ -39,24 +39,24 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -39,24 +39,24 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local sg=g:Filter(cm.filter,nil) local sg=g:Filter(cm.filter,nil)
if sg:GetCount()<=0 then return end if sg:GetCount()<=0 then return end
Duel.DisableShuffleCheck() Duel.DisableShuffleCheck()
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REVEAL) Duel.SendtoGrave(sg,REASON_EFFECT+REASON_REVEAL)
local sg1=Duel.GetOperatedGroup() local sg1=Duel.GetOperatedGroup()
local sg2=sg1:Clone() local sg2=sg1:Clone()
if sg1:GetCount()>0 then if sg1:GetCount()>0 then
if sg1:GetSum(tama.tamas_getElements,13254033)>0 and Duel.IsPlayerCanDiscardDeck(tp,2) then if sg1:GetSum(tama.tamas_getElementCount,13254033)>0 and Duel.IsPlayerCanDiscardDeck(tp,2) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.ShuffleDeck(tp) Duel.ShuffleDeck(tp)
Duel.DiscardDeck(tp,2,REASON_EFFECT) Duel.DiscardDeck(tp,2,REASON_EFFECT)
sg2:Merge(Duel.GetOperatedGroup()) sg2:Merge(Duel.GetOperatedGroup())
end end
if sg1:GetSum(tama.tamas_getElements,13254031)>0 and Duel.IsPlayerCanDraw(tp,1) then if sg1:GetSum(tama.tamas_getElementCount,13254031)>0 and Duel.IsPlayerCanDraw(tp,1) then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
Duel.ShuffleHand(tp) Duel.ShuffleHand(tp)
Duel.DiscardHand(tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD) Duel.DiscardHand(tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD)
sg2:Merge(Duel.GetOperatedGroup()) sg2:Merge(Duel.GetOperatedGroup())
end end
if sg1:GetSum(tama.tamas_getElements,13254036)>0 and sg2:IsExists(cm.filter2,1,nil) then if sg1:GetSum(tama.tamas_getElementCount,13254036)>0 and sg2:IsExists(cm.filter2,1,nil) then
local sg3=sg2:Filter(cm.filter2,nil) local sg3=sg2:Filter(cm.filter2,nil)
local ct=sg3:GetCount() local ct=sg3:GetCount()
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -31,7 +31,7 @@ function cm.initial_effect(c) ...@@ -31,7 +31,7 @@ function cm.initial_effect(c)
end end
function cm.tdfilter(c) function cm.tdfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckAsCost() and Duel.IsExistingMatchingCard(cm.tdfilter,tp,0,LOCATION_DECK,1,nil,c) return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckAsCost() and Duel.IsExistingMatchingCard(cm.thfilter,tp,0,LOCATION_DECK,1,nil,c)
end end
function cm.thfilter(c,tc) function cm.thfilter(c,tc)
return c:IsSetCard(0x3356) and c:IsType(TYPE_MONSTER) and tama.tamas_checkElementsEmpty(tama.tamas_getElements(c) and tama.tamas_checkCardElementsGreater(tc,c) and c:IsAbleToHand() return c:IsSetCard(0x3356) and c:IsType(TYPE_MONSTER) and tama.tamas_checkElementsEmpty(tama.tamas_getElements(c) and tama.tamas_checkCardElementsGreater(tc,c) and c:IsAbleToHand()
...@@ -66,7 +66,9 @@ function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -66,7 +66,9 @@ function cm.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter1,tp,LOCATION_HAND,0,2,nil) end if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter1,tp,LOCATION_HAND,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.tdfilter1,tp,LOCATION_HAND,0,1,2,nil) local g=Duel.SelectMatchingCard(tp,cm.tdfilter1,tp,LOCATION_HAND,0,1,2,nil)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,2,REASON_COST) Duel.SendtoDeck(g,nil,2,REASON_COST)
e:SetLabel(g:GetCount())
end end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end if chk==0 then return 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