Debian Codegraph @

units/hospital/unit-hospital.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-hospital.lua - Define the hospital building
11 --
12 -- (c) Copyright 2001 - 2005 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-hosp",
31 Size = {46, 38},
32 Frame = 0,
33 File = GetCurrentLuaPath().."/hospital_i.png"})
34
35 DefineConstruction("construction-hosp", {
36 Constructions = {
37 {Percent = 0, File = "main", Frame = 0},
38 {Percent = 10, File = "main", Frame = 1},
39 {Percent = 20, File = "main", Frame = 2},
40 {Percent = 30, File = "main", Frame = 3},
41 {Percent = 40, File = "main", Frame = 4},
42 {Percent = 50, File = "main", Frame = 5},
43 {Percent = 60, File = "main", Frame = 6},
44 {Percent = 70, File = "main", Frame = 7},
45 {Percent = 80, File = "main", Frame = 8},
46 {Percent = 90, File = "main", Frame = 9}
47 }
48 })
49
50 DefineAnimations("animations-hosp", {
51 Still = {"frame 10", "wait 2", "frame 10", "wait 2", "frame 10", "wait 2",
52 "frame 10", "wait 2", },
53 })
54
55 MakeSound("hosp-selected", GetCurrentLuaPath().."/sfx_hosp.select.wav")
56 MakeSound("hosp-ready", GetCurrentLuaPath().."/hospital.completed.wav")
57 MakeSound("hosp-help", GetCurrentLuaPath().."/hospital.underattack.wav")
58 MakeSound("hosp-dead", GetCurrentLuaPath().."/sfx_hosp.die.wav")
59
60 DefineUnitType("unit-hosp", {
61 Name = "Hospital",
62 Image = {"file", GetCurrentLuaPath().."/hospital.png", "size", {256, 256}},
63 Shadow = {"file", GetCurrentLuaPath().."/hospital_s.png", "size", {256, 256}},
64 Animations = "animations-hosp",
65 Icon = "icon-hosp",
66 EnergyValue = 9000,
67 MagmaValue = 1500,
68 RepairHp = 2,
69 Construction = "construction-hosp",
70 HitPoints = 350,
71 DrawLevel = 25,
72 TileSize = {6, 5},
73 BoxSize = {192, 160},
74 SightRange = 2,
75 Armor = 30,
76 BasicDamage = 0,
77 PiercingDamage = 0,
78 Missile = "missile-none",
79 Priority = 35,
80 AnnoyComputerFactor = 45,
81 Points = 200,
82 ExplodeWhenKilled = "missile-160x128-explosion",
83 Corpse = "build-dead-hosp",
84 Type = "land",
85 Building = true,
86 VisibleUnderFog = true,
87 MaxEnergyUtilizationRate = 20,
88 MaxMagmaUtilizationRate = 10,
89 CanHarvestFrom = true,
90 Sounds = {
91 "selected", "hosp-selected",
92 "ready", "hosp-ready",
93 "help", "hosp-help",
94 "dead", "hosp-dead"}
95 })
96
97 DefineAnimations("animations-dead-hosp", {
98 Death = {"unbreakable begin", "wait 1", "frame 0", "wait 2000",
99 "frame 1", "wait 200", "frame 2", "wait 200", "unbreakable end", "wait 1", },
100 })
101
102 DefineUnitType("build-dead-hosp", {
103 Name = "HospCrater",
104 Image = {"file", GetCurrentLuaPath().."/hospital_c.png", "size", {256, 256}},
105 Animations = "animations-dead-hosp",
106 Icon = "icon-cancel",
107 HitPoints = 999,
108 DrawLevel = 10,
109 TileSize = {6, 5},
110 BoxSize = {124, 92},
111 SightRange = 1,
112 BasicDamage = 0,
113 PiercingDamage = 0,
114 Missile = "missile-none",
115 Priority = 0,
116 Type = "land",
117 Building = true,
118 Vanishes = true
119 })
120
121 DefineAllow("unit-hosp", AllowAll)
122
123 DefineButton({
124 Pos = 2, Level = 2, Icon = "icon-hosp_b", Action = "build",
125 Value = "unit-hosp", Hint = "BUILD ~!HOSPITAL",
126 ForUnit = {"unit-engineer"}})