Debian Codegraph @

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