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