name: 波動キャノン
card_text: 1:魔法&罠ゾーンの表側表示のこのカードを墓地へ送って発動できる。
  このカードの発動後に経過した自分スタンバイフェイズの数×1000ダメージを相手に与える。
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.reset)
  	c:RegisterEffect(e1)
  	--damage
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DAMAGE)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCost(s.cost)
  	e2:SetTarget(s.tg)
  	e2:SetOperation(s.op)
  	c:RegisterEffect(e2)
  	--turn
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e3:SetCode(EVENT_PHASE_START + PHASE_STANDBY)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetOperation(s.turncount)
  	c:RegisterEffect(e3)
  end
  function s.turncount(e, tp, eg, ep, ev, re, r, rp)
  	if tp ~= Duel.GetTurnPlayer() then
  		return
  	end
  	local c = e:GetHandler()
  	local ct = c:GetTurnCounter()
  	ct = ct + 1
  	c:SetTurnCounter(ct)
  end
  function s.reset(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	e:GetHandler():SetTurnCounter(0)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToGraveAsCost()
  	end
  	Duel.SendtoGrave(e:GetHandler(), REASON_COST)
  end
  function s.tg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:GetTurnCounter() > 0
  	end
  	local dam = c:GetTurnCounter() * 1000
  	Duel.SetTargetPlayer(1 - tp)
  	Duel.SetTargetParam(dam)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, dam)
  end
  function s.op(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Damage(p, d, REASON_EFFECT)
  end
  
  
source_text: 波動キャノン
  1:魔法&罠ゾーンの表側表示のこのカードを墓地へ送って発動できる。
  このカードの発動後に経過した自分スタンバイフェイズの数×1000ダメージを相手に与える。
target_text: -- 波動キャノン
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--Activate
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_FREE_CHAIN)
  	e1:SetTarget(s.reset)
  	c:RegisterEffect(e1)
  	--damage
  	local e2 = Effect.CreateEffect(c)
  	e2:SetDescription(aux.Stringid(id, 0))
  	e2:SetCategory(CATEGORY_DAMAGE)
  	e2:SetType(EFFECT_TYPE_IGNITION)
  	e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
  	e2:SetRange(LOCATION_SZONE)
  	e2:SetCost(s.cost)
  	e2:SetTarget(s.tg)
  	e2:SetOperation(s.op)
  	c:RegisterEffect(e2)
  	--turn
  	local e3 = Effect.CreateEffect(c)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
  	e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
  	e3:SetCode(EVENT_PHASE_START + PHASE_STANDBY)
  	e3:SetRange(LOCATION_SZONE)
  	e3:SetOperation(s.turncount)
  	c:RegisterEffect(e3)
  end
  function s.turncount(e, tp, eg, ep, ev, re, r, rp)
  	if tp ~= Duel.GetTurnPlayer() then
  		return
  	end
  	local c = e:GetHandler()
  	local ct = c:GetTurnCounter()
  	ct = ct + 1
  	c:SetTurnCounter(ct)
  end
  function s.reset(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	e:GetHandler():SetTurnCounter(0)
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return e:GetHandler():IsAbleToGraveAsCost()
  	end
  	Duel.SendtoGrave(e:GetHandler(), REASON_COST)
  end
  function s.tg(e, tp, eg, ep, ev, re, r, rp, chk)
  	local c = e:GetHandler()
  	if chk == 0 then
  		return c:GetTurnCounter() > 0
  	end
  	local dam = c:GetTurnCounter() * 1000
  	Duel.SetTargetPlayer(1 - tp)
  	Duel.SetTargetParam(dam)
  	Duel.SetOperationInfo(0, CATEGORY_DAMAGE, nil, 0, 1 - tp, dam)
  end
  function s.op(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	Duel.Damage(p, d, REASON_EFFECT)
  end
  
  