Debian Codegraph @

units/vault/vault.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-vault.lua - Define the vault unit.
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 DefineAnimations("animations-vault", {
30 Train = {"frame 10", "wait 5", "frame 11", "wait 5", "frame 12", "wait 5",
31 "frame 13", "wait 5", "frame 14", "wait 5", "frame 13", "wait 5",
32 "frame 12", "wait 5", "frame 11", "wait 5", "frame 10", "wait 30", },
33 Still = {"frame 15", "wait 5", "frame 16", "wait 5", "frame 17", "wait 5",
34 "frame 18", "wait 5", "frame 19", "wait 5", "frame 18", "wait 5",
35 "frame 17", "wait 5", "frame 16", "wait 5", "frame 15", "wait 10", },
36 })
37
38 DefineIcon({
39 Name = "icon-vault",
40 Size = {46, 38},
41 Frame = 0,
42 File = "units/vault/vault-i.png"})
43
44 DefineConstruction("construction-vault", {
45 Constructions = {
46 {Percent = 0, File = "main", Frame = 0},
47 {Percent = 10, File = "main", Frame = 1},
48 {Percent = 20, File = "main", Frame = 2},
49 {Percent = 30, File = "main", Frame = 3},
50 {Percent = 40, File = "main", Frame = 4},
51 {Percent = 50, File = "main", Frame = 5},
52 {Percent = 60, File = "main", Frame = 6},
53 {Percent = 70, File = "main", Frame = 7},
54 {Percent = 80, File = "main", Frame = 8},
55 {Percent = 90, File = "main", Frame = 9}
56 }
57 })
58
59 MakeSound("vault-selected", GetCurrentLuaPath().."/sfx_fort.select.wav")
60 MakeSound("vault-ready", GetCurrentLuaPath().."/vault.completed.wav")
61 MakeSound("vault-help", GetCurrentLuaPath().."/vault.underattack.wav")
62 MakeSound("vault-dead", GetCurrentLuaPath().."/sfx_fort.die.wav")
63
64 DefineUnitType("unit-vault", {
65 Name = "Vault",
66 Image = {"file", "units/vault/vault.png", "size", {236, 208}},
67 Shadow = {"file", GetCurrentLuaPath().."/vault_s.png", "size", {236, 208}},
68 Animations = "animations-vault",
69 Icon = "icon-vault",
70 EnergyValue = 7500,
71 MagmaValue = 3800,
72 RepairHp = 4,
73 Construction = "construction-vault",
74 HitPoints = 600,
75 DrawLevel = 25,
76 TileSize = {6, 6},
77 BoxSize = {196, 164},
78 SightRange = 4,
79 Armor = 30,
80 BasicDamage = 0,
81 PiercingDamage = 0,
82 Missile = "missile-none",
83 Priority = 35,
84 AnnoyComputerFactor = 45,
85 Points = 200,
86 DeathExplosion = largeExplosion,
87 Corpse = "build-dead-vault",
88 Type = "land",
89 Building = true,
90 VisibleUnderFog = true,
91 EnergyStorageCapacity = 10000,
92 MagmaStorageCapacity = 2000,
93 MaxEnergyUtilizationRate = 40,
94 MaxMagmaUtilizationRate = 20,
95 CanHarvestFrom = true,
96 Sounds = {
97 "selected", "vault-selected",
98 "ready", "vault-ready",
99 "help", "vault-help",
100 "dead", "vault-dead"}
101 })
102
103 DefineAnimations("animations-dead-vault", {
104 Death = {"unbreakable begin", "wait 1", "frame 0", "wait 2000",
105 "frame 1", "wait 200", "frame 2", "wait 200", "unbreakable end", "wait 1", },
106 })
107
108 DefineUnitType("build-dead-vault", {
109 Name = "vaultCrater",
110 Image = {"file", GetCurrentLuaPath().."/vault_c.png", "size", {236, 208}},
111 Animations = "animations-dead-vault",
112 Icon = "icon-cancel",
113 HitPoints = 999,
114 DrawLevel = 10,
115 TileSize = {6, 6},
116 BoxSize = {196, 164},
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-vault", AllowAll)