name: Left-Hand
card_text: If this card is Special Summoned from the GY: This card's Level becomes 4. You can only use each of the following effects of "Left-Hand Shark" once per turn. If you control "Right-Hand Shark", and this card is in your hand or GY: You can Special Summon this card, but banish it when it leaves the field. An Xyz Monster that was Summoned using only WATER monsters as material, including this card on the field, gains this effect.
  ● This card cannot be destroyed by card effects.
external_ids: local CARD_ID_1 = 11845050 --Right-Hand Shark
  
lua: local CARD_ID_1 = 11845050 --Right-Hand Shark
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND + LOCATION_GRAVE)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--lv
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetCondition(s.lvcon)
  	e2:SetOperation(s.lvop)
  	c:RegisterEffect(e2)
  	--effect gain
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e3:SetCode(EVENT_BE_MATERIAL)
  	e3:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
  	e3:SetCountLimit(1, id + 1)
  	e3:SetCondition(s.effcon)
  	e3:SetOperation(s.effop)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_1)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_ONFIELD, 0, 1, nil)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) ~= 0 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
  		e1:SetValue(LOCATION_REMOVED)
  		e1:SetReset(RESET_EVENT + RESETS_REDIRECT)
  		c:RegisterEffect(e1, true)
  	end
  end
  function s.lvcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonLocation(LOCATION_GRAVE)
  end
  function s.lvop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and c:IsFaceup() then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CHANGE_LEVEL)
  		e1:SetValue(4)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  		c:RegisterEffect(e1)
  	end
  end
  function s.cfilter2(c)
  	return not c:IsAttribute(ATTRIBUTE_WATER)
  end
  function s.effcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local mg = c:GetReasonCard():GetMaterial()
  	return r == REASON_XYZ and c:IsPreviousLocation(LOCATION_ONFIELD) and not mg:IsExists(s.cfilter2, 1, nil) and mg:FilterCount(Card.IsXyzType, nil, TYPE_MONSTER) == mg:GetCount()
  end
  function s.effop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local rc = c:GetReasonCard()
  	local e1 = Effect.CreateEffect(rc)
  	e1:SetDescription(aux.Stringid(id, 2))
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e1:SetValue(1)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  	rc:RegisterEffect(e1, true)
  	if not rc:IsType(TYPE_EFFECT) then
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_SINGLE)
  		e2:SetCode(EFFECT_ADD_TYPE)
  		e2:SetValue(TYPE_EFFECT)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  		rc:RegisterEffect(e2, true)
  	end
  end
  
  
source_text: Left-Hand
  If this card is Special Summoned from the GY: This card's Level becomes 4. You can only use each of the following effects of "Left-Hand Shark" once per turn. If you control "Right-Hand Shark", and this card is in your hand or GY: You can Special Summon this card, but banish it when it leaves the field. An Xyz Monster that was Summoned using only WATER monsters as material, including this card on the field, gains this effect.
  ● This card cannot be destroyed by card effects.
target_text: -- Left-Hand
  local CARD_ID_1 = 11845050 --Right-Hand Shark
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--special summon
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e1:SetType(EFFECT_TYPE_IGNITION)
  	e1:SetRange(LOCATION_HAND + LOCATION_GRAVE)
  	e1:SetCountLimit(1, id)
  	e1:SetCondition(s.spcon)
  	e1:SetTarget(s.sptg)
  	e1:SetOperation(s.spop)
  	c:RegisterEffect(e1)
  	--lv
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 1))
  	e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetCondition(s.lvcon)
  	e2:SetOperation(s.lvop)
  	c:RegisterEffect(e2)
  	--effect gain
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
  	e3:SetCode(EVENT_BE_MATERIAL)
  	e3:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
  	e3:SetCountLimit(1, id + 1)
  	e3:SetCondition(s.effcon)
  	e3:SetOperation(s.effop)
  	c:RegisterEffect(e3)
  end
  function s.cfilter(c)
  	return c:IsFaceup() and c:IsCode(CARD_ID_1)
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_ONFIELD, 0, 1, nil)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP) ~= 0 then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  		e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
  		e1:SetValue(LOCATION_REMOVED)
  		e1:SetReset(RESET_EVENT + RESETS_REDIRECT)
  		c:RegisterEffect(e1, true)
  	end
  end
  function s.lvcon(e, tp, eg, ep, ev, re, r, rp)
  	return e:GetHandler():IsSummonLocation(LOCATION_GRAVE)
  end
  function s.lvop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) and c:IsFaceup() then
  		local e1 = Effect.CreateEffect(c)
  		e1:SetType(EFFECT_TYPE_SINGLE)
  		e1:SetCode(EFFECT_CHANGE_LEVEL)
  		e1:SetValue(4)
  		e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_DISABLE)
  		c:RegisterEffect(e1)
  	end
  end
  function s.cfilter2(c)
  	return not c:IsAttribute(ATTRIBUTE_WATER)
  end
  function s.effcon(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local mg = c:GetReasonCard():GetMaterial()
  	return r == REASON_XYZ and c:IsPreviousLocation(LOCATION_ONFIELD) and not mg:IsExists(s.cfilter2, 1, nil) and mg:FilterCount(Card.IsXyzType, nil, TYPE_MONSTER) == mg:GetCount()
  end
  function s.effop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	local rc = c:GetReasonCard()
  	local e1 = Effect.CreateEffect(rc)
  	e1:SetDescription(aux.Stringid(id, 2))
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
  	e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
  	e1:SetValue(1)
  	e1:SetReset(RESET_EVENT + RESETS_STANDARD)
  	rc:RegisterEffect(e1, true)
  	if not rc:IsType(TYPE_EFFECT) then
  		local e2 = Effect.CreateEffect(c)
  		e2:SetType(EFFECT_TYPE_SINGLE)
  		e2:SetCode(EFFECT_ADD_TYPE)
  		e2:SetValue(TYPE_EFFECT)
  		e2:SetReset(RESET_EVENT + RESETS_STANDARD)
  		rc:RegisterEffect(e2, true)
  	end
  end
  
  