Commit 74942b8c authored by Nemo Ma's avatar Nemo Ma

Effect Change

2 Anifriends cards
parent d9eff121
No preview for this file type
......@@ -66,33 +66,38 @@ function cm.rop(e,tp)
end
function cm.ttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,1,nil,tp,LOCATION_DECK)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 end
--Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,1,nil,tp,LOCATION_DECK)
end
function cm.rfilter2(c)
return c:IsSetCard(0x442) and c:IsAttackAbove(0)
end
function cm.top(e,tp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<1 then return end
local ac=0
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,5))
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 then
ac=Duel.AnnounceNumber(tp,1,2,3)
elseif Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 then
ac=Duel.AnnounceNumber(tp,1,2)
elseif Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 then
ac=Duel.AnnounceNumber(tp,1)
end
local tg=Duel.GetDecktopGroup(tp,ac)
if Duel.SendtoGrave(tg,REASON_EFFECT)~=0 then
local g=Duel.GetOperatedGroup()
local sg=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<3 then return end
--local ac=0
--Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,5))
--if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 then
-- ac=Duel.AnnounceNumber(tp,1,2,3)
--elseif Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 then
-- ac=Duel.AnnounceNumber(tp,1,2)
--elseif Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 then
--ac=Duel.AnnounceNumber(tp,1)
--end
local sg=Duel.GetDecktopGroup(tp,3)
Duel.ConfirmDecktop(tp,3)
--local sg=tg:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
Duel.BreakEffect()
if sg:GetClassCount(Card.GetCode)==#sg and sg:IsExists(cm.rfilter2,1,nil) then
local rg=sg:Filter(cm.rfilter2,nil)
Duel.Recover(tp,rg:GetSum(Card.GetAttack),REASON_EFFECT)
elseif sg:GetClassCount(Card.GetCode)<#sg then
Duel.Damage(tp,#sg*2000,REASON_EFFECT)
Duel.Damage(tp,2000,REASON_EFFECT)
end
if sg:GetCount()>0 then
if Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4))==0 then
Duel.SendtoDeck(sg,nil,SEQ_DECKTOP,REASON_EFFECT)
else
Duel.SendtoDeck(sg,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
end
end
end
\ No newline at end of file
......@@ -63,48 +63,48 @@ function cm.rop(e,tp)
end
end
function cm.ttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>14 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,1,nil,tp,LOCATION_DECK)
end
function cm.rfilter2(c)
return c:IsSetCard(0x442)
end
function cm.top(e,tp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<1 then return end
local ac=0
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,5))
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 then
ac=Duel.AnnounceNumber(tp,1,2,3)
elseif Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 then
ac=Duel.AnnounceNumber(tp,1,2)
elseif Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 then
ac=Duel.AnnounceNumber(tp,1)
end
local tg=Duel.GetDecktopGroup(tp,ac)
if Duel.SendtoGrave(tg,REASON_EFFECT)~=0 then
local g=Duel.GetOperatedGroup()
local sg=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<15 then return end
--local ac=0
--Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,5))
--if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 then
--ac=Duel.AnnounceNumber(tp,1,2,3)
--elseif Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 then
--ac=Duel.AnnounceNumber(tp,1,2)
--elseif Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 then
--ac=Duel.AnnounceNumber(tp,1)
--end
local sg=Duel.GetDecktopGroup(tp,15)
Duel.ConfirmDecktop(tp,15)
--if Duel.SendtoGrave(tg,REASON_EFFECT)~=0 then
--local g=Duel.GetOperatedGroup()
--local sg=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
Duel.BreakEffect()
if sg:GetClassCount(Card.GetCode)==#sg then
local rct=sg:FilterCount(cm.rfilter2,nil)
local num=Duel.GetMatchingGroupCount(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,nil)
if rct==0 or num==0 then return end
if rct>num then rct=num end
if not Duel.SelectYesNo(tp,aux.Stringid(9910024,0)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,rct,nil)
if sg1:GetCount()>0 then
Duel.SendtoHand(sg1,nil,REASON_EFFECT)
if sg:GetClassCount(Card.GetCode)==#sg and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
local ac=Duel.AnnounceNumber(tp,1,2,3)
local gg=sg:RandomSelect(tp,ac)
if Duel.SendtoGrave(gg,REASON_EFFECT)~=0 then
local thg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_MZONE,nil)
local num=math.min(#thg,ac)
local tg=thg:Select(tp,num,num,nil)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
end
elseif sg:GetClassCount(Card.GetCode)<#sg then
local num=Duel.GetMatchingGroupCount(Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil)
if num<1 then return end
if num>#sg then num=#sg end
local num=math.min(Duel.GetMatchingGroupCount(Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,nil),3)
--if num<1 then return end
--if num>#sg then num=#sg end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg1=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_ONFIELD+LOCATION_HAND,0,num,num,nil)
if sg1:GetCount()>0 then
Duel.SendtoGrave(sg1,REASON_EFFECT)
end
end
end
--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