Debian Codegraph @

units/magmapump/unit-magmapump.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-magmapump.lua - Define the magmapump
11 --
12 -- (c) Copyright 2001-2007 by Fran�is Beerten, Lutz Sammer and Crestez Leonard
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 DefineIcon({
30 Name = "icon-magmapump",
31 Size = {46, 38},
32 Frame = 0,
33 File = GetCurrentLuaPath().."/magmapump_i.png"})
34
35 DefineConstruction("construction-magmapump", {
36 Constructions = {
37 {Percent = 0, File = "main", Frame = 32},
38 {Percent = 10, File = "main", Frame = 33},
39 {Percent = 30, File = "main", Frame = 34},
40 {Percent = 40, File = "main", Frame = 35},
41 {Percent = 50, File = "main", Frame = 36},
42 {Percent = 70, File = "main", Frame = 37},
43 {Percent = 80, File = "main", Frame = 38}
44 }
45 })
46
47 DefineAnimations("animations-magmapump", {
48 Still = {"frame 0", "wait 2", "frame 1", "wait 2", "frame 2", "wait 2",
49 "frame 3", "wait 2", "frame 4", "wait 2", "frame 5", "wait 2",
50 "frame 6", "wait 2", "frame 7", "wait 2", "frame 8", "wait 2",
51 "frame 9", "wait 2", "frame 10", "wait 2", "frame 11", "wait 2",
52 "frame 12", "wait 2", "frame 13", "wait 2", "frame 14", "wait 2",
53 "frame 15", "wait 2", "frame 16", "wait 2", "frame 17", "wait 2",
54 "frame 18", "wait 2", "frame 19", "wait 2", "frame 20", "wait 2",
55 "frame 21", "wait 2", "frame 22", "wait 2", "frame 23", "wait 2",
56 "frame 24", "wait 2", "frame 25", "wait 2", "frame 26", "wait 2",
57 "frame 27", "wait 2", "wait 2", },
58 })
59
60 MakeSound("magmapump-selected", GetCurrentLuaPath().."/magmapump.select.wav")
61 MakeSound("magmapump-ready", GetCurrentLuaPath().."/magmapump.completed.wav")
62 MakeSound("magmapump-help", GetCurrentLuaPath().."/magmapump.underattack.wav")
63 MakeSound("magmapump-dead", GetCurrentLuaPath().."/sfx_pplnt.die.wav")
64
65 DefineUnitType("unit-magmapump", {
66 Name = "Magma Pump",
67 Image = {"file", GetCurrentLuaPath().."/magmapump.png", "size", {64, 64}},
68 Shadow = {"file", GetCurrentLuaPath().."/magmapump_s.png", "size", {64, 64}},
69 Animations = "animations-magmapump",
70 Icon = "icon-magmapump",
71 EnergyValue = 800,
72 MagmaValue = 150,
73 RepairHp = 2,
74 Construction = "construction-magmapump",
75 HitPoints = 250,
76 DrawLevel = 25,
77 TileSize = {2, 2},
78 BoxSize = {60, 60},
79 SightRange = 1,
80 Armor = 10,
81 BasicDamage = 0,
82 PiercingDamage = 0,
83 Missile = "missile-none",
84 Priority = 20,
85 AnnoyComputerFactor = 45,
86 Points = 100,
87 ExplodeWhenKilled = "missile-160x128-explosion",
88 Corpse = "build-dead-magmapump",
89 Type = "land",
90 Building = true,
91 VisibleUnderFog = true,
92 MagmaProductionRate = 12,
93 BuildingRules = {{"ontop",
94 {Type = "unit-hotspot"}},{"ontop",
95 {Type = "unit-weakhotspot"}}},
96 CanHarvestFrom = true,
97 Sounds = {
98 "selected", "magmapump-selected",
99 "ready", "magmapump-ready",
100 "help", "magmapump-help",
101 "dead", "magmapump-dead"}
102 })
103
104 DefineAnimations("animations-dead-magmapump", {
105 Death = {"unbreakable begin", "wait 1", "frame 0", "wait 2000",
106 "frame 1", "wait 200", "frame 2", "wait 200", "frame 2", "wait 1",
107 "unbreakable end", "wait 1", },
108 })
109
110 DefineUnitType("build-dead-magmapump", {
111 Name = "Pump Crater",
112 Image = {"file", GetCurrentLuaPath().."/magmapump_c.png", "size", {64, 64}},
113 Animations = "animations-dead-magmapump",
114 Icon = "icon-cancel",
115 HitPoints = 999,
116 DrawLevel = 10,
117 TileSize = {2, 2},
118 BoxSize = {220, 156},
119 SightRange = 1,
120 BasicDamage = 0,
121 PiercingDamage = 0,
122 Missile = "missile-none",
123 Priority = 0,
124 Type = "land",
125 Building = true,
126 Vanishes = true
127 })
128
129
130
131 DefineAllow("unit-magmapump", AllowAll)
132
133 DefineButton({
134 Pos = 2, Level = 1, Icon = "icon-magmapump_b", Action = "build",
135 Value = "unit-magmapump", Hint = "BUILD ~!MAGMA PUMP",
136 ForUnit = {"unit-engineer"}})
137