Debian Codegraph @

units/destroyer/unit-destroyer.lua

raw
1 -- ____ _ __
2 -- / __ )____ _____ | | / /___ ___________
3 -- / __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
4 -- / /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
5 -- /_____/\____/____/ |__/|__/\__,_/_/ /____/
6 --
7 -- A futuristic real-time strategy game.
8 -- This file is part of Bos Wars.
9 --
10 -- unit-destroyer.lua - Define the destroyer unit.
11 --
12 -- (c) Copyright 2005-2012 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-destroyer", {
30 Still = {"frame 0", "wait 1", },
31 Move = {"unbreakable begin", "frame 0", "move 2", "wait 1",
32 "frame 0", "move 2", "wait 1", "frame 0", "move 2", "wait 1",
33 "frame 0", "move 2", "wait 1", "frame 0", "move 2", "wait 1",
34 "frame 0", "move 2", "wait 1", "frame 0", "move 2", "wait 1",
35 "frame 0", "move 2", "wait 1", "frame 0", "move 2", "wait 1",
36 "frame 0", "move 2", "wait 1", "frame 0", "move 2", "wait 1",
37 "frame 0", "move 2", "wait 1", "frame 0", "move 2", "wait 1",
38 "frame 0", "move 2", "wait 1", "frame 0", "move 2", "wait 1",
39 "frame 0", "move 2", "unbreakable end", "wait 1", },
40 Attack = {"unbreakable begin", "frame 0", "wait 2",
41 "sound bazoo-attack", "attack", "wait 4",
42 "sound bazoo-attack", "attack", "wait 4",
43 "wait 70",
44 "unbreakable end", "wait 1", },
45 })
46
47 DefineIcon({
48 Name = "icon-destroyer",
49 Size = {46, 38},
50 Frame = 0,
51 File = "units/destroyer/destroyer_i.png"})
52
53 MakeSound("destroyer-selected", GetCurrentLuaPath().."/destroyer.select.wav")
54 MakeSound("destroyer-acknowledge", GetCurrentLuaPath().."/destroyer.action.wav")
55 MakeSound("destroyer-dead", GetCurrentLuaPath().."/destroyer.die.wav")
56 MakeSound("destroyer-ready", GetCurrentLuaPath().."/destroyer.ready.wav")
57 MakeSound("destroyer-help", GetCurrentLuaPath().."/destroyer.underattack.wav")
58
59 DefineUnitType("unit-destroyer", {
60 Name = "Destroyer",
61 Image = {"file", "units/destroyer/destroyer.png", "size", {128, 96}},
62 Animations = "animations-destroyer",
63 Icon = "icon-destroyer",
64 EnergyValue = 600,
65 MagmaValue = 300,
66 RepairHp = 1,
67 HitPoints = 40,
68 DrawLevel = 25,
69 TileSize = {2, 2},
70 BoxSize = {96, 96},
71 SightRange = 8,
72 Armor = 10,
73 BasicDamage = 5,
74 PiercingDamage = 30,
75 Priority = 10,
76 AnnoyComputerFactor = 65,
77 Points = 15,
78 ExplodeWhenKilled = "missile-64x64-explosion",
79 Type = "naval",
80 AllowTerrainShallowWater = false,
81 ComputerReactionRange = 10,
82 PersonReactionRange = 10,
83 RightMouseAction = "attack",
84 SelectableByRectangle = true,
85 CanAttack = true,
86 CanTargetLand = true,
87 CanTargetAir = true,
88 CanTargetSea = true,
89 NumDirections = 8,
90 Missile = "missile-bazoo",
91 MaxAttackRange = 6,
92 Sounds = {
93 "ready", "destroyer-ready",
94 "acknowledge", "destroyer-acknowledge",
95 "selected", "destroyer-selected",
96 "help", "destroyer-help",
97 "dead", "destroyer-dead",
98 }
99 })
100
101 DefineAllow("unit-destroyer", AllowAll)
102
103 DefineButton({
104 Pos = 3, Level = 0, Icon = "icon-destroyer", Action = "train-unit",
105 Value = "unit-destroyer", Hint = "BUILD ~!Destroyer",
106 ForUnit = {"unit-shipyard"}})
107
108 DefineCommonButtons({"unit-destroyer"})
109
110
111