| 1 |
-- ____ _ __ |
| 2 |
-- / __ )____ _____ | | / /___ ___________ |
| 3 |
-- / __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/ |
| 4 |
-- / /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ ) |
| 5 |
-- /_____/\____/____/ |__/|__/\__,_/_/ /____/ |
| 6 |
-- |
| 7 |
-- A futuristic real-time strategy game. |
| 8 |
-- This file is part of Bos Wars. |
| 9 |
-- |
| 10 |
-- unit-jet.lua - Define the jet unit. |
| 11 |
-- |
| 12 |
-- (c) Copyright 2005-2010 by Francois Beerten. |
| 13 |
-- |
| 14 |
-- This program is free software; you can redistribute it and/or modify |
| 15 |
-- it under the terms of the GNU General Public License as published by |
| 16 |
-- the Free Software Foundation; either version 2 of the License, or |
| 17 |
-- (at your option) any later version. |
| 18 |
-- |
| 19 |
-- This program is distributed in the hope that it will be useful, |
| 20 |
-- but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 |
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 |
-- GNU General Public License for more details. |
| 23 |
-- |
| 24 |
-- You should have received a copy of the GNU General Public License |
| 25 |
-- along with this program; if not, write to the Free Software |
| 26 |
-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 27 |
-- |
| 28 |
|
| 29 |
DefineAnimations("animations-jet", { |
| 30 |
Still = {"frame 0", "wait 1", }, |
| 31 |
Attack = {"unbreakable begin", |
| 32 |
"frame 0", "wait 1", "attack", "sound assault-attack", |
| 33 |
"frame 0", "wait 1", "frame 0","wait 15", |
| 34 |
"unbreakable end", "wait 1", }, |
| 35 |
Move = {"unbreakable begin", |
| 36 |
"frame 5", "move 5", "wait 1", "frame 5", "move 4", "wait 1", |
| 37 |
"frame 5", "move 5", "wait 1", "frame 5", "move 4", "wait 1", |
| 38 |
"frame 5", "move 4", "wait 1", "frame 5", "move 5", "wait 1", |
| 39 |
"frame 5", "move 5", "wait 1", |
| 40 |
"unbreakable end", "wait 1", }, |
| 41 |
Death = {"unbreakable begin", "frame 0", "wait 15","unbreakable end", "wait 1",}, |
| 42 |
}) |
| 43 |
|
| 44 |
DefineIcon({ |
| 45 |
Name = "icon-jet", |
| 46 |
Size = {46, 38}, |
| 47 |
Frame = 0, |
| 48 |
File = "units/jet/ico_jet.png"}) |
| 49 |
|
| 50 |
DefineMissileType("missile-jet", { |
| 51 |
File = "units/jet/missile.png", |
| 52 |
Size = {96, 96}, Frames = 5, NumDirections = 8, |
| 53 |
ImpactSound = "rocket-impact", DrawLevel = 150, |
| 54 |
Class = "missile-class-point-to-point", Sleep = 1, Speed = 16, Range = 16}) |
| 55 |
|
| 56 |
MakeSound("jet-ready", GetCurrentLuaPath().."/jet.ready.wav") |
| 57 |
MakeSound("jet-help", GetCurrentLuaPath().."/jet.underattack.wav") |
| 58 |
|
| 59 |
DefineUnitType("unit-jet", { |
| 60 |
Name = "Jet fighter", |
| 61 |
Image = {"file", "units/jet/unit_jet.png", "size", {128, 128}}, |
| 62 |
Shadow = {"file", "units/jet/unit_jet_s.png", "size", {128, 128}, |
| 63 |
"offset", {5, 128}}, |
| 64 |
Animations = "animations-jet", |
| 65 |
Icon = "icon-jet", |
| 66 |
EnergyValue = 8000, |
| 67 |
MagmaValue = 3000, |
| 68 |
HitPoints = 50, |
| 69 |
DrawLevel = 125, |
| 70 |
TileSize = {3, 3}, |
| 71 |
BoxSize = {96, 96}, |
| 72 |
SightRange = 7, |
| 73 |
Armor = 20, |
| 74 |
BasicDamage = 5, |
| 75 |
PiercingDamage = 30, |
| 76 |
Missile = "missile-jet", |
| 77 |
Priority = 20, |
| 78 |
AnnoyComputerFactor = 65, |
| 79 |
Points = 15, |
| 80 |
ExplodeWhenKilled = "missile-64x64-explosion", |
| 81 |
Type = "fly", |
| 82 |
ComputerReactionRange = 10, |
| 83 |
PersonReactionRange = 10, |
| 84 |
RightMouseAction = "attack", |
| 85 |
SelectableByRectangle = true, |
| 86 |
CanAttack = true, |
| 87 |
CanTargetLand = true, |
| 88 |
CanTargetAir = true, |
| 89 |
CanTargetSea = true, |
| 90 |
NumDirections = 8, |
| 91 |
MaxAttackRange = 5, |
| 92 |
Sounds = { |
| 93 |
"selected", "grenadier-selected", |
| 94 |
"acknowledge", "grenadier-acknowledge", |
| 95 |
"ready", "jet-ready", |
| 96 |
"help", "jet-help" |
| 97 |
} |
| 98 |
}) |
| 99 |
|
| 100 |
DefineAllow("unit-jet", AllowAll) |
| 101 |
|
| 102 |
|
| 103 |
DefineButton({ |
| 104 |
Pos = 1, Level = 0, Icon = "icon-jet", Action = "train-unit", |
| 105 |
Value = "unit-jet", Hint = "BUILD ~!JET FIGHTER", |
| 106 |
ForUnit = {"unit-aircraftfactory"}}) |
| 107 |
|
| 108 |
DefineCommonButtons({"unit-jet"}) |
| 109 |
|
| 110 |
|
| 111 |
|