Debian Codegraph @

units/radar/unit-radar.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 -- radar.lua - Define the radar unit.
11 --
12 -- (c) Copyright 2004-2005 by Fran�is 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-radar", {
30 Still = {"frame 0", "wait 4", "frame 1", "wait 4", "frame 2", "wait 4",
31 "frame 3", "wait 4", "frame 4", "wait 4", "frame 5", "wait 4",
32 "frame 6", "wait 4", "frame 7", "wait 4", },
33 Death = {"unbreakable begin", "frame 0", "wait 1", "frame 1", "wait 10",
34 "frame 1", "unbreakable end", "wait 10", },
35 })
36
37 DefineIcon({
38 Name = "icon-radar",
39 Size = {46, 38},
40 Frame = 0,
41 File = "units/radar/radar_i.png"})
42
43 DefineIcon({
44 Name = "icon-radar_b",
45 Size = {46, 38},
46 Frame = 0,
47 File = "units/radar/radar_i.png"})
48
49 MakeSound("radar-selected", GetCurrentLuaPath().."/sfx_rdar.select.wav")
50 MakeSound("radar-ready", GetCurrentLuaPath().."/radar.completed.wav")
51 MakeSound("radar-help", GetCurrentLuaPath().."/radar.underattack.wav")
52
53 DefineConstruction("construction-radar", {
54 Constructions = {
55 {Percent = 0, File = "main", Frame = 11},
56 {Percent = 50, File = "main", Frame = 10},
57 }
58 })
59
60 DefineUnitType("unit-radar", {
61 Name = "Radar",
62 Image = {"file", "units/radar/radar.png", "size", {64, 64}},
63 Offset = {12, -16},
64 Shadow = {"file", "units/radar/radar_s.png", "size", {64, 64}},
65 Animations = "animations-radar",
66 Icon = "icon-radar",
67 EnergyValue = 1000,
68 MagmaValue = 500,
69 RepairHp = 1,
70 Construction = "construction-radar",
71 HitPoints = 5,
72 DrawLevel = 25,
73 TileSize = {1, 1},
74 BoxSize = {32, 28},
75 SightRange = 3,
76 Armor = 0,
77 BasicDamage = 0,
78 PiercingDamage = 0,
79 Missile = "missile-none",
80 Priority = 20,
81 AnnoyComputerFactor = 65,
82 Points = 10,
83 ExplodeWhenKilled = "missile-64x64-explosion",
84 Corpse = "radar_destroyed",
85 Type = "land",
86 Building = true,
87 VisibleUnderFog = true,
88 NumDirections = 1,
89 RadarRange = 40,
90 CanHarvestFrom = true,
91 Sounds = {
92 "selected", "radar-selected",
93 "ready", "radar-ready",
94 "help", "radar-help"
95 }
96 })
97
98 DefineUnitType("radar_destroyed", {
99 Name = "RadarWreck",
100 Image = {"file", "units/radar/radar.png", "size", {64, 64}},
101 Animations = "animations-radar",
102 Icon = "icon-cancel",
103 HitPoints = 999,
104 DrawLevel = 10,
105 TileSize = {1, 1},
106 BoxSize = {28, 28},
107 SightRange = 1,
108 BasicDamage = 0,
109 PiercingDamage = 0,
110 Missile = "missile-none",
111 Priority = 0,
112 Type = "land",
113 Building = true,
114 Vanishes = true
115 })
116
117 DefineAllow("unit-radar", AllowAll)
118
119 DefineButton({
120 Pos = 4, Level = 1, Icon = "icon-radar_b", Action = "build",
121 Value = "unit-radar", Hint = "BUILD ~!RADAR",
122 ForUnit = {"unit-engineer"}})
123
124
125