| 1 |
-- ____ _ __ |
| 2 |
-- / __ )____ _____ | | / /___ ___________ |
| 3 |
-- / __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/ |
| 4 |
-- / /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ ) |
| 5 |
-- /_____/\____/____/ |__/|__/\__,_/_/ /____/ |
| 6 |
-- |
| 7 |
-- A futuristic real-time strategy game. |
| 8 |
-- This file is part of Bos Wars. |
| 9 |
-- |
| 10 |
-- unit-chopper.lua - Define the chopper 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-chopper", { |
| 30 |
Still = {"frame 0", "wait 10", "frame 0", "wait 10", "frame 0", "wait 600", |
| 31 |
"frame 0", "wait 10", "frame 0", "wait 300", |
| 32 |
"rotate 1", "wait 10",}, |
| 33 |
Move = {"unbreakable begin", "frame 10", "move 2", "wait 1", |
| 34 |
"frame 10", "move 2", "wait 1", "frame 10", "move 2", "wait 1", |
| 35 |
"frame 5", "move 2", "wait 1", "frame 5", "move 2", "wait 1", |
| 36 |
"frame 10", "move 2", "wait 1", "frame 10", "move 2", "wait 1", |
| 37 |
"frame 5", "move 2", "wait 1", "frame 5", "move 2", "wait 1", |
| 38 |
"frame 10", "move 2", "wait 1", "frame 10", "move 2", "wait 1", |
| 39 |
"frame 5", "move 2", "wait 1", "frame 5", "move 2", "wait 1", |
| 40 |
"frame 10", "move 2", "wait 1", "frame 10", "move 2", "wait 1", |
| 41 |
"frame 5", "move 2", "unbreakable end", "wait 1", }, |
| 42 |
Attack = {"unbreakable begin", "frame 0", "wait 4", |
| 43 |
"frame 5", "sound bazoo-attack", "attack", "wait 1", |
| 44 |
"frame 0", "wait 2", |
| 45 |
"frame 5", "attack", "wait 1", |
| 46 |
"frame 0", "wait 59", "unbreakable end", "wait 1", }, |
| 47 |
Death = {"unbreakable begin", "frame 10", "wait 5", "frame 15", |
| 48 |
"wait 5", "frame 20", "unbreakable end", "wait 20", }, |
| 49 |
}) |
| 50 |
|
| 51 |
DefineIcon({ |
| 52 |
Name = "icon-chopper", |
| 53 |
Size = {46, 38}, |
| 54 |
Frame = 0, |
| 55 |
File = "units/chopper/ico_chopper.png"}) |
| 56 |
|
| 57 |
MakeSound("chopper-ready", GetCurrentLuaPath().."/chopper.ready.wav") |
| 58 |
MakeSound("chopper-help", GetCurrentLuaPath().."/chopper.underattack.wav") |
| 59 |
|
| 60 |
DefineUnitType("unit-chopper", { |
| 61 |
Name = "Chopper", |
| 62 |
Image = {"file", "units/chopper/unit_chopper.png", "size", {128,128}}, |
| 63 |
Shadow = {"file", "units/chopper/unit_chopper_s.png", "size", {128, 128}, "offset", {5,128}}, |
| 64 |
Animations = "animations-chopper", |
| 65 |
Icon = "icon-chopper", |
| 66 |
EnergyValue = 7000, |
| 67 |
MagmaValue = 3000, |
| 68 |
HitPoints = 50, |
| 69 |
DrawLevel = 125, |
| 70 |
TileSize = {1, 1}, |
| 71 |
BoxSize = {64, 64}, |
| 72 |
SightRange = 7, |
| 73 |
Armor = 20, |
| 74 |
BasicDamage = 5, |
| 75 |
PiercingDamage = 30, |
| 76 |
Missile = "missile-bazoo", |
| 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 = 7, |
| 92 |
Sounds = { |
| 93 |
"selected", "grenadier-selected", |
| 94 |
"acknowledge", "grenadier-acknowledge", |
| 95 |
"ready", "chopper-ready", |
| 96 |
"help", "chopper-help" |
| 97 |
} |
| 98 |
}) |
| 99 |
|
| 100 |
DefineAllow("unit-chopper", AllowAll) |
| 101 |
|
| 102 |
DefineButton({ |
| 103 |
Pos = 3, Level = 0, Icon = "icon-chopper", Action = "train-unit", |
| 104 |
Value = "unit-chopper", Hint = "BUILD ~!CHOPPER", |
| 105 |
ForUnit = {"unit-aircraftfactory"}}) |
| 106 |
|
| 107 |
DefineCommonButtons({"unit-chopper"}) |
| 108 |
|
| 109 |
|
| 110 |
|