name: 穿孔虫
card_text: このカードが相手ライフに戦闘ダメージを与えた時、自分のデッキに存在する自分の「寄生虫パラサイド」1枚をデッキの一番上に置く事ができる。
external_ids: local CARD_ID_0 = 27911549 --寄生虫パラサイド
  
lua: local CARD_ID_0 = 27911549 --寄生虫パラサイド
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--search
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_BATTLE_DAMAGE)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return ep == 1 - tp
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsCode, tp, LOCATION_DECK, 0, 1, nil, CARD_ID_0) and Duel.GetFieldGroupCount(tp, LOCATION_DECK, 0) > 1
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 1))
  	local g = Duel.SelectMatchingCard(tp, Card.IsCode, tp, LOCATION_DECK, 0, 1, 1, nil, CARD_ID_0)
  	local tc = g:GetFirst()
  	if tc then
  		Duel.ShuffleDeck(tp)
  		Duel.MoveSequence(tc, SEQ_DECKTOP)
  		Duel.ConfirmDecktop(tp, 1)
  	end
  end
  
  
source_text: 穿孔虫
  このカードが相手ライフに戦闘ダメージを与えた時、自分のデッキに存在する自分の「寄生虫パラサイド」1枚をデッキの一番上に置く事ができる。
target_text: -- 穿孔虫
  local CARD_ID_0 = 27911549 --寄生虫パラサイド
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--search
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_O)
  	e1:SetCode(EVENT_BATTLE_DAMAGE)
  	e1:SetCondition(s.condition)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.condition(e, tp, eg, ep, ev, re, r, rp)
  	return ep == 1 - tp
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(Card.IsCode, tp, LOCATION_DECK, 0, 1, nil, CARD_ID_0) and Duel.GetFieldGroupCount(tp, LOCATION_DECK, 0) > 1
  	end
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(id, 1))
  	local g = Duel.SelectMatchingCard(tp, Card.IsCode, tp, LOCATION_DECK, 0, 1, 1, nil, CARD_ID_0)
  	local tc = g:GetFirst()
  	if tc then
  		Duel.ShuffleDeck(tp)
  		Duel.MoveSequence(tc, SEQ_DECKTOP)
  		Duel.ConfirmDecktop(tp, 1)
  	end
  end
  
  