Commit 55ea842d authored by wind2009's avatar wind2009

Update Fish and Bids

parent 063f359e
......@@ -23,47 +23,33 @@ end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 and not Duel.CheckPhaseActivity()
end
function s.filter1(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_FISH) and
(c:IsAbleToGrave() and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_DECK,0,1,c)
or c:IsAbleToRemove() and Duel.IsExistingMatchingCard(s.filter3,tp,LOCATION_DECK,0,1,c))
function s.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_FISH)
end
function s.filter2(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_FISH) and c:IsAbleToGrave()
end
function s.filter3(c)
return c:IsType(TYPE_MONSTER) and c:IsRace(RACE_FISH) and c:IsAbleToRemove()
function s.gcheck(g)
return #g==2 and (g:FilterCount(Card.IsAbleToGrave,nil)==2 or g:FilterCount(Card.IsAbleToRemove,nil)==2)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_DECK,0,1,nil,tp) end
local dg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil)
if chk==0 then return dg:CheckSubGroup(s.gcheck,2,2) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil,1-tp)
if #g>1 and Duel.SelectYesNo(1-tp,aux.Stringid(id,0)) then
if #g>1 and Duel.SelectYesNo(1-tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_REMOVE)
local tc=g:Select(1-tp,2,2,nil)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
return
end
local g1=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_DECK,0,nil,tp)
if g1:GetCount()>0 then
local dg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil)
if dg:CheckSubGroup(s.gcheck,2,2) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg1=g1:Select(tp,1,1,nil)
if sg1:GetFirst():IsAbleToGrave() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg2=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_DECK,0,1,1,sg1:GetFirst())
sg1:Merge(sg2)
if not sg1:GetFirst():IsAbleToRemove() or not sg2:GetFirst():IsAbleToRemove() or Duel.SelectOption(tp,1191,1192)==0 then
Duel.SendtoGrave(sg1,REASON_EFFECT)
else
Duel.Remove(sg1,POS_FACEUP,REASON_EFFECT)
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local sg2=Duel.SelectMatchingCard(tp,s.filter3,tp,LOCATION_DECK,0,1,1,sg1:GetFirst())
sg1:Merge(sg2)
local sg1=dg:SelectSubGroup(tp,s.gcheck,false,2,2)
if sg1:GetFirst():IsAbleToGrave() and not sg1:GetFirst():IsAbleToRemove() or Duel.SelectOption(tp,1191,1192)==0 then
Duel.SendtoGrave(sg1,REASON_EFFECT)
elseif sg1:GetFirst():IsAbleToRemove() then
Duel.Remove(sg1,POS_FACEUP,REASON_EFFECT)
end
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