Lifeless
When this card is Summoned: You can send 1 Fish monster from your Deck to the GY, except "Lifeless Leaffish". You can banish this card from your GY, then target 3 Fish monsters in your GY; shuffle those monsters into your Deck, then draw 1 card. You can only use each effect of "Lifeless Leaffish" once per turn.
local s, id, o = GetID()
function s.initial_effect(c)
	--to grave
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_TOGRAVE)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e1:SetCode(EVENT_SUMMON_SUCCESS)
	e1:SetCountLimit(1, id)
	e1:SetTarget(s.target)
	e1:SetOperation(s.operation)
	c:RegisterEffect(e1)
	local e2 = e1:Clone()
	e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
	c:RegisterEffect(e2)
	local e3 = e1:Clone()
	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
	c:RegisterEffect(e3)
	--draw
	local e4 = Effect.CreateEffect(c)
	e4:SetDescription(aux.Stringid(id, 1))
	e4:SetCategory(CATEGORY_TODECK + CATEGORY_DRAW)
	e4:SetType(EFFECT_TYPE_IGNITION)
	e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e4:SetRange(LOCATION_GRAVE)
	e4:SetCountLimit(1, id + 1)
	e4:SetCost(aux.bfgcost)
	e4:SetTarget(s.drtg)
	e4:SetOperation(s.drop)
	c:RegisterEffect(e4)
end
function s.tgfilter(c)
	return c:IsRace(RACE_FISH) and not c:IsCode(id) and c:IsAbleToGrave()
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(s.tgfilter, tp, LOCATION_DECK, 0, 1, nil)
	end
	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_DECK)
end
function s.operation(e, tp, eg, ep, ev, re, r, rp)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
	local g = Duel.SelectMatchingCard(tp, s.tgfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
	if g:GetCount() > 0 then
		Duel.SendtoGrave(g, REASON_EFFECT)
	end
end
function s.tdfilter(c)
	return c:IsRace(RACE_FISH) and c:IsAbleToDeck()
end
function s.drtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return false
	end
	if chk == 0 then
		return Duel.IsPlayerCanDraw(tp, 1) and Duel.IsExistingTarget(s.tdfilter, tp, LOCATION_GRAVE, 0, 3, e:GetHandler())
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
	local g = Duel.SelectTarget(tp, s.tdfilter, tp, LOCATION_GRAVE, 0, 3, 3, nil)
	Duel.SetOperationInfo(0, CATEGORY_TODECK, g, 3, 0, 0)
	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 1)
end
function s.drop(e, tp, eg, ep, ev, re, r, rp)
	local tg = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
	if tg:GetCount() <= 0 then
		return
	end
	Duel.SendtoDeck(tg, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
	local g = Duel.GetOperatedGroup()
	if g:IsExists(Card.IsLocation, 1, nil, LOCATION_DECK) then
		Duel.ShuffleDeck(tp)
	end
	if g:IsExists(Card.IsLocation, 1, nil, LOCATION_DECK + LOCATION_EXTRA) then
		Duel.BreakEffect()
		Duel.Draw(tp, 1, REASON_EFFECT)
	end
end


Lifeless
When this card is Summoned: You can send 1 Fish monster from your Deck to the GY, except "Lifeless Leaffish". You can banish this card from your GY, then target 3 Fish monsters in your GY; shuffle those monsters into your Deck, then draw 1 card. You can only use each effect of "Lifeless Leaffish" once per turn.
-- Lifeless
local s, id, o = GetID()
function s.initial_effect(c)
	--to grave
	local e1 = Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id, 0))
	e1:SetCategory(CATEGORY_TOGRAVE)
	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
	e1:SetCode(EVENT_SUMMON_SUCCESS)
	e1:SetCountLimit(1, id)
	e1:SetTarget(s.target)
	e1:SetOperation(s.operation)
	c:RegisterEffect(e1)
	local e2 = e1:Clone()
	e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
	c:RegisterEffect(e2)
	local e3 = e1:Clone()
	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
	c:RegisterEffect(e3)
	--draw
	local e4 = Effect.CreateEffect(c)
	e4:SetDescription(aux.Stringid(id, 1))
	e4:SetCategory(CATEGORY_TODECK + CATEGORY_DRAW)
	e4:SetType(EFFECT_TYPE_IGNITION)
	e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
	e4:SetRange(LOCATION_GRAVE)
	e4:SetCountLimit(1, id + 1)
	e4:SetCost(aux.bfgcost)
	e4:SetTarget(s.drtg)
	e4:SetOperation(s.drop)
	c:RegisterEffect(e4)
end
function s.tgfilter(c)
	return c:IsRace(RACE_FISH) and not c:IsCode(id) and c:IsAbleToGrave()
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.IsExistingMatchingCard(s.tgfilter, tp, LOCATION_DECK, 0, 1, nil)
	end
	Duel.SetOperationInfo(0, CATEGORY_TOGRAVE, nil, 1, tp, LOCATION_DECK)
end
function s.operation(e, tp, eg, ep, ev, re, r, rp)
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOGRAVE)
	local g = Duel.SelectMatchingCard(tp, s.tgfilter, tp, LOCATION_DECK, 0, 1, 1, nil)
	if g:GetCount() > 0 then
		Duel.SendtoGrave(g, REASON_EFFECT)
	end
end
function s.tdfilter(c)
	return c:IsRace(RACE_FISH) and c:IsAbleToDeck()
end
function s.drtg(e, tp, eg, ep, ev, re, r, rp, chk, chkc)
	if chkc then
		return false
	end
	if chk == 0 then
		return Duel.IsPlayerCanDraw(tp, 1) and Duel.IsExistingTarget(s.tdfilter, tp, LOCATION_GRAVE, 0, 3, e:GetHandler())
	end
	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TODECK)
	local g = Duel.SelectTarget(tp, s.tdfilter, tp, LOCATION_GRAVE, 0, 3, 3, nil)
	Duel.SetOperationInfo(0, CATEGORY_TODECK, g, 3, 0, 0)
	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 1)
end
function s.drop(e, tp, eg, ep, ev, re, r, rp)
	local tg = Duel.GetChainInfo(0, CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect, nil, e)
	if tg:GetCount() <= 0 then
		return
	end
	Duel.SendtoDeck(tg, nil, SEQ_DECKSHUFFLE, REASON_EFFECT)
	local g = Duel.GetOperatedGroup()
	if g:IsExists(Card.IsLocation, 1, nil, LOCATION_DECK) then
		Duel.ShuffleDeck(tp)
	end
	if g:IsExists(Card.IsLocation, 1, nil, LOCATION_DECK + LOCATION_EXTRA) then
		Duel.BreakEffect()
		Duel.Draw(tp, 1, REASON_EFFECT)
	end
end

