--__________         __    __  .__           ___________
--\______   \_____ _/  |__/  |_|  |   ____   \_   _____/__________
-- |    |  _/\__  \\   __\   __\  | _/ __ \   |    __)/  _ \_  __ \
-- |    |   \ / __ \|  |  |  | |  |_\  ___/   |     \(  <_> )  | \/
-- |______  /(____  /__|  |__| |____/\___  >  \___  / \____/|__|
--        \/      \/                     \/       \/
--   _____                     .___.__
--  /     \ _____    ____    __| _/|__| ____  ___________
-- /  \ /  \\__  \  /    \  / __ | |  |/ ___\/  _ \_  __ \
--/    Y    \/ __ \|   |  \/ /_/ | |  \  \__(  <_> )  | \/
--\____|__  (____  /___|  /\____ | |__|\___  >____/|__|
--        \/     \/     \/      \/         \/

--      missiles.lua - Missiles
--
--      (c) Copyright 2005 by Kimmo Merikivi
--
--      This program is free software; you can redistribute it and/or modify
--      it under the terms of the GNU General Public License as published by
--      the Free Software Foundation; either version 2 of the License, or
--      (at your option) any later version.
--  
--      This program is distributed in the hope that it will be useful,
--      but WITHOUT ANY WARRANTY; without even the implied warranty of
--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--      GNU General Public License for more details.
--  
--      You should have received a copy of the GNU General Public License
--      along with this program; if not, write to the Free Software
--      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
DefineMissileType("missile-death-ray",
  { File = "missiles/death-ray.png", Size = {32, 32}, Frames = 5, NumDirections = 5,
  ImpactSound = "fireball hit",
  DrawLevel = 50, Class = "missile-class-point-to-point-bounce", NumBounces = 5, Sleep = 1, Speed = 16, Range = 1,
  ImpactMissile = "missile-explosion" } )

DefineMissileType("missile-fire-breath",
  { File = "missiles/dragon_fire_small.png", Size = {320, 320}, Frames = 0, NumDirections = 5,
  ImpactSound = "fireball hit",
  DrawLevel = 50, Class = "missile-class-point-to-point-bounce", NumBounces = 3, Sleep = 2, Speed = 16, Range = 1,
  ImpactMissile = "missile-explosion" } )


DefineMissileType("missile-catapult-rock",
  { File = "missiles/catapult_rock.png", Size = {32, 32}, Frames = 15, NumDirections = 5,
  ImpactSound = "explosion",
  DrawLevel = 50, Class = "missile-class-parabolic", Sleep = 1, Speed = 16, Range = 2,
  ImpactMissile = "missile-impact", SplashFactor = 4 } )

DefineMissileType("missile-arrow",
  { File = "missiles/arrow.png", Size = {40, 40}, Frames = 5, NumDirections = 5,
  DrawLevel = 50, ImpactSound = "bow hit",
  Class = "missile-class-point-to-point", Sleep = 1, Speed = 26, Range = 0 } )

DefineMissileType("missile-spear",
  { File = "missiles/spear.png", Size = {64, 64}, Frames = 5, NumDirections = 5,
  DrawLevel = 50, ImpactSound = "bow hit",
  Class = "missile-class-point-to-point", Sleep = 1, Speed = 50, Range = 0 } )

DefineMissileType("missile-ballista",
  { File = "missiles/ballista.png", Size = {80, 80}, Frames = 5, NumDirections = 5,
  DrawLevel = 50, ImpactSound = "bow hit",
  Class = "missile-class-point-to-point", Sleep = 1, Speed = 20, Range = 0 } )

DefineMissileType("missile-tux",
  { File = "missiles/tux.png", Size = {40, 40}, Frames = 5, NumDirections = 5,
  ImpactSound = "explosion",
  DrawLevel = 50, Class = "missile-class-point-to-point", Sleep = 1, Speed = 16, Range = 1,
  ImpactMissile = "missile-impact" } )

DefineMissileType("missile-small-fire",
  { File = "missiles/small_fire.png", Size = {32, 48}, Frames = 6, NumDirections = 1,
  DrawLevel = 45, Class = "missile-class-fire", Sleep = 8, Speed = 16, Range = 1 } )

DefineMissileType("missile-big-fire",
  { File = "missiles/big_fire.png", Size = {48, 48}, Frames = 15, NumDirections = 1,
  DrawLevel = 45, Class = "missile-class-fire", Sleep = 2, Speed = 16, Range = 1 } )

DefineMissileType("missile-impact",
  { File = "missiles/ballista-catapult_impact.png", Size = {48, 48}, Frames = 10, NumDirections = 1,
  DrawLevel = 50, Class = "missile-class-stay", Sleep = 1, Speed = 16, Range = 1 } )

DefineMissileType("missile-normal-spell",
  { File = "missiles/normal_spell.png", Size = {32, 32}, Frames = 6, NumDirections = 1,
  DrawLevel = 50, Class = "missile-class-stay", Sleep = 5, Speed = 0, Range = 1 } )

DefineMissileType("missile-explosion",
  { File = "missiles/explosion.png", Size = {64, 64}, Frames = 20, NumDirections = 1,
  DrawLevel = 50, Class = "missile-class-stay", Sleep = 1, Speed = 16, Range = 1 } )

DefineMissileType("missile-green-cross",
  { File = "missiles/green_cross.png", Size = {32, 32}, Frames = 4, NumDirections = 1,
  DrawLevel = 150, Class = "missile-class-cycle-once", Sleep = 1, Speed = 16, Range = 1 } )

DefineMissileType("missile-red-cross",
  { File = "missiles/red_cross.png", Size = {32, 32}, Frames = 4, NumDirections = 1,
  DrawLevel = 5, Class = "missile-class-cycle-once", Sleep = 1, Speed = 16, Range = 1 } )

DefineMissileType("missile-none",
  { Size = {32, 32}, DrawLevel = 50,
  Class = "missile-class-none", Sleep = 1, Speed = 16, Range = 1 } )

DefineMissileType("missile-hit",
  { Size = {15, 15}, DrawLevel = 150,
  Class = "missile-class-hit", Sleep = 1, Speed = 1, Range = 16 } )

DefineBurningBuilding(
  {"percent", 0, "missile", "missile-big-fire"},
  {"percent", 50, "missile", "missile-small-fire"},
  {"percent", 75 } -- no missile
)

DefineMissileType("missile-healing-effect",
  { File = "missiles/healing.png", Size = {48, 48}, Frames = 10, NumDirections = 1,
  DrawLevel = 50, Class = "missile-class-stay", Sleep = 1, Speed = 16, Range = 1 } )
