Debian Codegraph @

units/missilesilo/unit-missilesilo.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-missilesilo.lua - Define the missile silo unit
11 --
12 -- (c) Copyright 2001 - 2010 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-msilo",
31 Size = {46, 38},
32 Frame = 0,
33 File = GetCurrentLuaPath().."/missile_silo_i.png"})
34
35 DefineConstruction("construction-msilo", {
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 DefineAnimations("animations-msilo", {
50 Still = {"frame 15", "wait 5", "frame 16", "wait 5", "frame 17", "wait 5",
51 "frame 18", "wait 5", "frame 19", "wait 5", },
52 Train = {"frame 15", "wait 5", "frame 16", },
53 Attack = {"unbreakable begin", "frame 11", "wait 4",
54 "frame 12", "wait 2", "attack",
55 "frame 13", "wait 2", "frame 14", "wait 10", "frame 15",
56 "unbreakable end", "wait 25", },
57 })
58 DefineUnitType("unit-msilo", {
59 Name = "Missile Silo",
60 Image = {"file", GetCurrentLuaPath().."/missile_silo.png", "size", {256, 256}},
61 Shadow = {"file", GetCurrentLuaPath().."/missile_silo_s.png", "size", {256, 256}},
62 Animations = "animations-msilo",
63 Icon = "icon-msilo",
64 EnergyValue = 12000,
65 MagmaValue = 8000,
66 RepairHp = 2,
67 Construction = "construction-msilo",
68 HitPoints = 450,
69 DrawLevel = 25,
70 TileSize = {5, 5},
71 BoxSize = {168, 168},
72 SightRange = 3,
73 Armor = 10,
74 BasicDamage = 0,
75 PiercingDamage = 0,
76 Missile = "missile-none",
77 Priority = 20,
78 AnnoyComputerFactor = 45,
79 Points = 100,
80 DeathExplosion = largeExplosion,
81 Corpse = "build-dead-msilo",
82 Type = land,
83 MaxCharge = 1000,
84 CanCastSpell = {"spell-nuke"},
85 Building = true,
86 VisibleUnderFog = true,
87 CanHarvestFrom = true,
88 })
89 DefineAnimations("animations-dead-msilo", {
90 Death = {"unbreakable begin", "wait 1", "frame 0", "wait 2000",
91 "frame 1", "wait 200", "frame 2", "wait 200", "frame 2", "wait 1",
92 "unbreakable end", "wait 1", },
93 })
94
95 DefineUnitType("build-dead-msilo", {
96 Name = "SiloCrater",
97 Image = {"file", GetCurrentLuaPath().."/missile_silo_c.png", "size", {256, 256}},
98 Animations = "animations-dead-msilo",
99 Icon = "icon-cancel",
100 HitPoints = 999,
101 DrawLevel = 10,
102 TileSize = {5, 5},
103 BoxSize = {124, 124},
104 SightRange = 1,
105 BasicDamage = 0,
106 PiercingDamage = 0,
107 Missile = "missile-none",
108 Priority = 0,
109 Type = "land",
110 Building = true,
111 Vanishes = true
112 })
113
114 DefineAllow("unit-msilo", AllowAll)
115
116 DefineButton({
117 Pos = 4, Level = 3, Icon = "icon-msilo_b", Action = "build",
118 Value = "unit-msilo", Hint = "BUILD ~!MISSILE SILO",
119 ForUnit = {"unit-engineer"}})
120