Debian Codegraph @

units/biggunturret/unit-biggunturret.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-biggunturret.lua - Define the big gun turret unit.
11 --
12 -- (c) Copyright 2004-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-biggunturret", {
30 Still = {"frame 5", "wait 1", },
31 Attack = {"unbreakable begin", "frame 10", "wait 1", "frame 15", "sound gturret-attack", "attack", "wait 1",
32 "frame 20", "unbreakable end", "wait 1", },
33 Death = {"unbreakable begin", "frame 10", "unbreakable end", "wait 50", },
34 })
35
36 DefineIcon({
37 Name = "icon-biggunturret",
38 Size = {46, 38},
39 Frame = 0,
40 File = "units/biggunturret/gturret_i.png"})
41
42 DefineIcon({
43 Name = "icon-biggunturret_b",
44 Size = {46, 38},
45 Frame = 0,
46 File = "units/biggunturret/gturret_i.png"})
47
48 DefineConstruction("construction-biggunturret", {
49 Constructions = {
50 {Percent = 0, File = "main", Frame = 0},
51 {Percent = 10, File = "main", Frame = 0},
52 {Percent = 20, File = "main", Frame = 1},
53 {Percent = 30, File = "main", Frame = 2},
54 {Percent = 40, File = "main", Frame = 3},
55 {Percent = 50, File = "main", Frame = 4},
56 {Percent = 60, File = "main", Frame = 5},
57 {Percent = 70, File = "main", Frame = 6},
58 {Percent = 80, File = "main", Frame = 7},
59 {Percent = 90, File = "main", Frame = 7}
60 }
61 })
62
63 DefineUnitType("unit-biggunturret", {
64 Name = "Big gun Turret",
65 Image = {"file", "units/biggunturret/gturret.png", "size", {96, 96}},
66 Shadow = {"file", "units/biggunturret/gturret_s.png", "size", {96, 96}},
67 Animations = "animations-biggunturret",
68 Icon = "icon-biggunturret",
69 EnergyValue = 8000,
70 MagmaValue = 2000,
71 RepairHp = 20,
72 Construction = "construction-biggunturret",
73 HitPoints = 260,
74 DrawLevel = 25,
75 TileSize = {2, 2},
76 BoxSize = {60, 60},
77 SightRange = 6,
78 ComputerReactionRange = 6,
79 PersonReactionRange = 6,
80 Armor = 10,
81 BasicDamage = 8,
82 PiercingDamage = 1,
83 MaxAttackRange = 6,
84 Missile = "missile-none",
85 Priority = 20,
86 AnnoyComputerFactor = 45,
87 Points = 100,
88 ExplodeWhenKilled = "missile-160x128-explosion",
89 RightMouseAction = "attack",
90 CanAttack = true,
91 CanTargetLand = true,
92 CanTargetAir = true,
93 CanTargetSea = true,
94 NumDirections = 8,
95 Corpse = "build-dead-biggunturret",
96 Type = "land",
97 Building = true,
98 VisibleUnderFog = true,
99 CanHarvestFrom = true,
100 })
101
102 DefineAnimations("animations-dead-biggunturret", {
103 Death = {"unbreakable begin", "wait 1", "frame 0", "wait 2000",
104 "frame 1", "wait 200", "frame 2", "wait 200", "frame 2", "wait 1",
105 "unbreakable end", "wait 1", },
106 })
107
108 DefineUnitType("build-dead-biggunturret", {
109 Name = "GturretCrater",
110 Image = {"file", "units/gturret/gturret_c.png", "size", {96, 96}},
111 Animations = "animations-dead-biggunturret",
112 Icon = "icon-cancel",
113 HitPoints = 999,
114 DrawLevel = 10,
115 TileSize = {2, 2},
116 BoxSize = {220, 156},
117 SightRange = 1,
118 BasicDamage = 0,
119 PiercingDamage = 0,
120 Missile = "missile-none",
121 Priority = 0,
122 Type = "land",
123 Building = true,
124 Vanishes = true
125 })
126
127
128 DefineAllow("unit-biggunturret", AllowAll)
129
130 DefineButton({
131 Pos = 2, Level = 3, Icon = "icon-biggunturret_b", Action = "build",
132 Value = "unit-biggunturret", Hint = "BUILD ~!BIG GUN TURRET",
133 ForUnit = {"unit-engineer"}})
134
135 -- DefineButton for the 'stop' and 'attack' actions like those
136 -- defined in buttons.lua.
137 DefineButton({
138 Pos = 2, Level = 0, Icon = "icon-stop",
139 Action = "stop", Hint = "~!STOP",
140 ForUnit = {"unit-biggunturret"}})
141
142
143 DefineButton({
144 Pos = 3, Level = 0, Icon = "icon-attack",
145 Action = "attack", Hint = "~!ATTACK",
146 ForUnit = {"unit-biggunturret"}})
147