Debian Codegraph @

units/vehiclefactory/vehiclefactory.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 -- vehiculefactory.lua - Define the vehiculefactory
11 --
12 -- (c) Copyright 2001 - 2008 by Francois 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-vfac",
31 Size = {46, 38},
32 Frame = 0,
33 File = GetCurrentLuaPath().."/vehicle_factory_i.png"})
34
35 DefineConstruction("construction-vfac", {
36 Constructions = {
37 {Percent = 0, File = "main", Frame = 1},
38 {Percent = 10, File = "main", Frame = 2},
39 {Percent = 20, File = "main", Frame = 3},
40 {Percent = 30, File = "main", Frame = 4},
41 {Percent = 40, File = "main", Frame = 5},
42 {Percent = 50, File = "main", Frame = 6},
43 {Percent = 60, File = "main", Frame = 7},
44 {Percent = 70, File = "main", Frame = 8},
45 {Percent = 80, File = "main", Frame = 9},
46 {Percent = 90, File = "main", Frame = 9},
47 }
48 })
49
50 DefineAnimations("animations-vfac", {
51 Still = {"frame 15", "wait 5", "frame 16", "wait 5", "frame 17", "wait 5", "frame 18", "wait 5", "frame 19",
52 "wait 100", "frame 18", "wait 5", "frame 17", "wait 5", "frame 16", "wait 5", "frame 15", "wait 300", },
53 Train = {"frame 10", "wait 5", "frame 11", "wait 5", "frame 12", "wait 5", "frame 13", "wait 5", "frame 14",
54 "wait 15", },
55 })
56
57 MakeSound("vfac-selected", GetCurrentLuaPath().."/sfx_vfac.select.wav")
58 MakeSound("vfac-ready", GetCurrentLuaPath().."/vehicle.factory.completed.wav")
59 MakeSound("vfac-help", GetCurrentLuaPath().."/vehicle.factory.underattack.wav")
60 MakeSound("vfac-dead", GetCurrentLuaPath().."/sfx_vfac.die.wav")
61
62 DefineUnitType("unit-vfac", {
63 Name = "Vehicle Factory",
64 Image = {"file", GetCurrentLuaPath().."/vehicle_factory.png", "size", {256, 254}},
65 Shadow = {"file", GetCurrentLuaPath().."/vehicle_factory_s.png", "size", {256, 254}},
66 Animations = "animations-vfac",
67 Icon = "icon-vfac",
68 EnergyValue = 6000,
69 MagmaValue = 4000,
70 RepairHp = 2,
71 Construction = "construction-vfac",
72 HitPoints = 550,
73 DrawLevel = 25,
74 TileSize = {7, 5},
75 BoxSize = {220, 156},
76 SightRange = 2,
77 Armor = 30,
78 BasicDamage = 0,
79 PiercingDamage = 0,
80 Missile = "missile-none",
81 Priority = 35,
82 AnnoyComputerFactor = 45,
83 Points = 200,
84 DeathExplosion = largeExplosion,
85 Corpse = "build-dead-vfac",
86 Type = "land",
87 Building = true,
88 VisibleUnderFog = true,
89 MaxEnergyUtilizationRate = 60,
90 MaxMagmaUtilizationRate = 30,
91 CanHarvestFrom = true,
92 Sounds = {
93 "selected", "vfac-selected",
94 "ready", "vfac-ready",
95 "help", "vfac-help",
96 "dead", "vfac-dead"}
97 })
98
99 DefineAnimations("animations-dead-vfac", {
100 Death = {"unbreakable begin", "wait 1", "frame 0", "wait 2000",
101 "frame 1", "wait 200", "frame 2", "wait 200", "frame 2", "wait 1",
102 "unbreakable end", "wait 1", },
103 })
104
105 DefineUnitType("build-dead-vfac", {
106 Name = "FactoryCrater",
107 Image = {"file", GetCurrentLuaPath().."/vehicle_c.png", "size", {256, 254}},
108 Animations = "animations-dead-vfac",
109 Icon = "icon-cancel",
110 HitPoints = 999,
111 DrawLevel = 10,
112 TileSize = {7, 5},
113 BoxSize = {220, 156},
114 SightRange = 1,
115 BasicDamage = 0,
116 PiercingDamage = 0,
117 Missile = "missile-none",
118 Priority = 0,
119 Type = "land",
120 Building = true,
121 Vanishes = true
122 })
123
124 DefineAllow("unit-vfac", AllowAll)
125
126 DefineButton({
127 Pos = 3, Level = 2, Icon = "icon-vfac_b", Action = "build",
128 Value = "unit-vfac", Hint = "BUILD ~!VEHICLE FACTORY",
129 ForUnit = {"unit-engineer"}})