name: Harpie's
card_text: 3 Level 4 WIND monsters
  This card's effects can only be applied/resolved while it has material. This card can attack your opponent directly. Your opponent cannot target any "Harpie" monsters with effects or for attacks. During each of your End Phases: Detach 1 material from this card.
external_ids: local SETCARD_ID_0 = 0x64 --Harpie
  
lua: local SETCARD_ID_0 = 0x64 --Harpie
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, aux.FilterBoolFunction(Card.IsAttribute, ATTRIBUTE_WIND), 4, 3)
  	c:EnableReviveLimit()
  	--direct attack
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_DIRECT_ATTACK)
  	e1:SetCondition(s.effcon)
  	c:RegisterEffect(e1)
  	--cannot be target
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(0, LOCATION_MZONE)
  	e2:SetCondition(s.effcon)
  	e2:SetValue(s.atlimit)
  	c:RegisterEffect(e2)
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e3:SetProperty(EFFECT_FLAG_IGNORE_RANGE + EFFECT_FLAG_IGNORE_IMMUNE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTarget(s.efftg)
  	e3:SetCondition(s.effcon)
  	e3:SetValue(aux.tgoval)
  	c:RegisterEffect(e3)
  	--remove material
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e4:SetCode(EVENT_PHASE + PHASE_END)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetCountLimit(1)
  	e4:SetCondition(s.rmcon)
  	e4:SetOperation(s.rmop)
  	c:RegisterEffect(e4)
  end
  function s.effcon(e)
  	return e:GetHandler():GetOverlayCount() > 0
  end
  function s.efftg(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER)
  end
  function s.atlimit(e, c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.rmcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp
  end
  function s.rmop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:GetOverlayCount() > 0 then
  		c:RemoveOverlayCard(tp, 1, 1, REASON_EFFECT)
  	end
  end
  
  
source_text: Harpie's
  3 Level 4 WIND monsters
  This card's effects can only be applied/resolved while it has material. This card can attack your opponent directly. Your opponent cannot target any "Harpie" monsters with effects or for attacks. During each of your End Phases: Detach 1 material from this card.
target_text: -- Harpie's
  local SETCARD_ID_0 = 0x64 --Harpie
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--xyz summon
  	aux.AddXyzProcedure(c, aux.FilterBoolFunction(Card.IsAttribute, ATTRIBUTE_WIND), 4, 3)
  	c:EnableReviveLimit()
  	--direct attack
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetCode(EFFECT_DIRECT_ATTACK)
  	e1:SetCondition(s.effcon)
  	c:RegisterEffect(e1)
  	--cannot be target
  	local e2 = Effect.CreateEffect(c)
  	e2:SetType(EFFECT_TYPE_FIELD)
  	e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
  	e2:SetRange(LOCATION_MZONE)
  	e2:SetTargetRange(0, LOCATION_MZONE)
  	e2:SetCondition(s.effcon)
  	e2:SetValue(s.atlimit)
  	c:RegisterEffect(e2)
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD)
  	e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
  	e3:SetProperty(EFFECT_FLAG_IGNORE_RANGE + EFFECT_FLAG_IGNORE_IMMUNE)
  	e3:SetRange(LOCATION_MZONE)
  	e3:SetTarget(s.efftg)
  	e3:SetCondition(s.effcon)
  	e3:SetValue(aux.tgoval)
  	c:RegisterEffect(e3)
  	--remove material
  	local e4 = Effect.CreateEffect(c)
  	e4:SetDescription(aux.Stringid(id, 0))
  	e4:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_F)
  	e4:SetCode(EVENT_PHASE + PHASE_END)
  	e4:SetRange(LOCATION_MZONE)
  	e4:SetCountLimit(1)
  	e4:SetCondition(s.rmcon)
  	e4:SetOperation(s.rmop)
  	c:RegisterEffect(e4)
  end
  function s.effcon(e)
  	return e:GetHandler():GetOverlayCount() > 0
  end
  function s.efftg(e, c)
  	return c:IsSetCard(SETCARD_ID_0) and c:IsType(TYPE_MONSTER)
  end
  function s.atlimit(e, c)
  	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
  end
  function s.rmcon(e, tp, eg, ep, ev, re, r, rp)
  	return Duel.GetTurnPlayer() == tp
  end
  function s.rmop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:GetOverlayCount() > 0 then
  		c:RemoveOverlayCard(tp, 1, 1, REASON_EFFECT)
  	end
  end
  
  