| 1 |
-- ____ _ __ |
| 2 |
-- / __ )____ _____ | | / /___ ___________ |
| 3 |
-- / __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/ |
| 4 |
-- / /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ ) |
| 5 |
-- /_____/\____/____/ |__/|__/\__,_/_/ /____/ |
| 6 |
-- |
| 7 |
-- A futuristic real-time strategy game. |
| 8 |
-- This file is part of Bos Wars. |
| 9 |
-- |
| 10 |
-- camera.lua - Define the camera unit. |
| 11 |
-- |
| 12 |
-- (c) Copyright 2004-2007 by gorm. |
| 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-cam", { |
| 30 |
Still = {"frame 0", "wait 2", "frame 1", "wait 2", "frame 2", "wait 2", |
| 31 |
"frame 3", "wait 2", "frame 4", "wait 2", "frame 5", "wait 2", |
| 32 |
"frame 6", "wait 2", "frame 7", "wait 2", "frame 8", "wait 2", |
| 33 |
"frame 9", "wait 2", "frame 10", "wait 2", "frame 11", "wait 2", |
| 34 |
"frame 12", "wait 2", "frame 13", "wait 2", "frame 14", "wait 2", |
| 35 |
"frame 15", "wait 2", }, |
| 36 |
Death = {"unbreakable begin", "frame 0", "unbreakable end", "wait 1", }, |
| 37 |
}) |
| 38 |
|
| 39 |
|
| 40 |
DefineAnimations("animations-dead_cam", { |
| 41 |
Death = {"unbreakable begin", "frame 0", "wait 2000", |
| 42 |
"frame 1", "unbreakable end", "wait 200", }, |
| 43 |
}) |
| 44 |
|
| 45 |
DefineIcon({ |
| 46 |
Name = "icon-cam", |
| 47 |
Size = {46, 38}, |
| 48 |
Frame = 0, |
| 49 |
File = "units/camera/camera_i.png"}) |
| 50 |
|
| 51 |
DefineIcon({ |
| 52 |
Name = "icon-cam_b", |
| 53 |
Size = {46, 38}, |
| 54 |
Frame = 0, |
| 55 |
File = "units/camera/camera_i.png"}) |
| 56 |
|
| 57 |
MakeSound("camera-selected", "units/camera/sfx_camera.select.wav") |
| 58 |
MakeSound("camera-ready", GetCurrentLuaPath().."/camera.completed.wav") |
| 59 |
MakeSound("camera-help", GetCurrentLuaPath().."/camera.underattack.wav") |
| 60 |
|
| 61 |
DefineConstruction("construction-cam", { |
| 62 |
Constructions = { |
| 63 |
{Percent = 0, File = "main", Frame = 16}, |
| 64 |
{Percent = 20, File = "main", Frame = 17}, |
| 65 |
{Percent = 30, File = "main", Frame = 18}, |
| 66 |
{Percent = 40, File = "main", Frame = 19}, |
| 67 |
{Percent = 50, File = "main", Frame = 20}, |
| 68 |
{Percent = 60, File = "main", Frame = 21}, |
| 69 |
{Percent = 80, File = "main", Frame = 22}, |
| 70 |
{Percent = 90, File = "main", Frame = 23} |
| 71 |
} |
| 72 |
}) |
| 73 |
|
| 74 |
DefineUnitType("unit-cam", { |
| 75 |
Name = "Camera", |
| 76 |
Image = {"file", "units/camera/camera.png", "size", {32, 64}}, |
| 77 |
Offset = {0, -16}, |
| 78 |
Shadow = {"file", "units/camera/camera_s.png", "size", {64, 64}, "offset", {16,0}}, |
| 79 |
Animations = "animations-cam", |
| 80 |
Icon = "icon-cam", |
| 81 |
EnergyValue = 800, |
| 82 |
MagmaValue = 300, |
| 83 |
RepairHp = 1, |
| 84 |
Construction = "construction-cam", |
| 85 |
HitPoints = 5, |
| 86 |
DrawLevel = 25, |
| 87 |
TileSize = {1, 1}, |
| 88 |
BoxSize = {28, 28}, |
| 89 |
SightRange = 15, |
| 90 |
Armor = 0, |
| 91 |
BasicDamage = 0, |
| 92 |
PiercingDamage = 0, |
| 93 |
Missile = "missile-none", |
| 94 |
Priority = 20, |
| 95 |
AnnoyComputerFactor = 65, |
| 96 |
Points = 10, |
| 97 |
ExplodeWhenKilled = "missile-64x64-explosion", |
| 98 |
Corpse = "camera_destroyed", |
| 99 |
Type = "land", |
| 100 |
Building = true, |
| 101 |
VisibleUnderFog = true, |
| 102 |
CanHarvestFrom = true, |
| 103 |
Sounds = {"selected", "camera-selected", |
| 104 |
"ready", "camera-ready", |
| 105 |
"help", "camera-help" |
| 106 |
} |
| 107 |
}) |
| 108 |
|
| 109 |
DefineUnitType("camera_destroyed", { |
| 110 |
Name = "CameraCrater", |
| 111 |
Image = {"file", "units/camera/camera_c.png", "size", {32, 64}}, |
| 112 |
Animations = "animations-dead_cam", |
| 113 |
Icon = "icon-cancel", |
| 114 |
HitPoints = 999, |
| 115 |
DrawLevel = 10, |
| 116 |
TileSize = {1, 1}, |
| 117 |
BoxSize = {28, 28}, |
| 118 |
SightRange = 1, |
| 119 |
BasicDamage = 0, |
| 120 |
PiercingDamage = 0, |
| 121 |
Missile = "missile-none", |
| 122 |
Priority = 0, |
| 123 |
Type = "land", |
| 124 |
Building = true, |
| 125 |
Vanishes = true |
| 126 |
}) |
| 127 |
|
| 128 |
DefineAllow("unit-cam", AllowAll) |
| 129 |
|
| 130 |
DefineButton({ |
| 131 |
Pos = 5, Level = 1, Icon = "icon-cam_b", Action = "build", |
| 132 |
Value = "unit-cam", Hint = "BUILD ~!CAMERA", |
| 133 |
ForUnit = {"unit-engineer"}}) |
| 134 |
|
| 135 |
|
| 136 |
|