Debian Codegraph @

units/bomber/unit-bomber.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-bomber.lua - Define the bomber unit.
11 --
12 -- (c) Copyright 2005-2007 by Francois Beerten.
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-bomber", {
30 Still = {"frame 0", "wait 1", },
31 Attack = {"unbreakable begin",
32 "frame 0", "wait 5", "attack",
33 "frame 0", "wait 1", "frame 0","wait 35",
34 "unbreakable end", "wait 1", },
35 Move = {"unbreakable begin",
36 "frame 5", "move 3", "wait 1", "frame 5", "move 3", "wait 1",
37 "frame 5", "move 3", "wait 1", "frame 5", "move 3", "wait 1",
38 "frame 5", "move 3", "wait 1", "frame 5", "move 3", "wait 1",
39 "frame 5", "move 3", "wait 1", "frame 5", "move 3", "wait 1",
40 "frame 5", "move 3", "wait 1", "frame 5", "move 3", "wait 1",
41 "frame 5", "move 2", "wait 1",
42 "unbreakable end", "wait 1", },
43 Death = {"unbreakable begin", "frame 0", "wait 15","unbreakable end", "wait 1",},
44 })
45
46 DefineIcon({
47 Name = "icon-bomber",
48 Size = {46, 38},
49 Frame = 0,
50 File = "units/bomber/ico_bomber.png"})
51
52 DefineMissileType("missile-bomber", {
53 File = "units/bomber/missile.png",
54 Size = {32, 32}, Frames = 5, NumDirections = 8,
55 ImpactSound = "rocket-impact", DrawLevel = 150,
56 Class = "missile-class-point-to-point", Sleep = 1, Speed = 16, Range = 16})
57
58 MakeSound("bomber-ready", GetCurrentLuaPath().."/bomber.ready.wav")
59 MakeSound("bomber-help", GetCurrentLuaPath().."/bomber.underattack.wav")
60
61 DefineUnitType("unit-bomber", {
62 Name = "Bomber",
63 Image = {"file", "units/bomber/unit_bomber.png", "size", {128, 128}},
64 Shadow = {"file", "units/bomber/unit_bomber_s.png", "size", {128, 128}, "offset", {5, 128}},
65 Animations = "animations-bomber",
66 Icon = "icon-bomber",
67 EnergyValue = 10000,
68 MagmaValue = 7000,
69 HitPoints = 50,
70 DrawLevel = 125,
71 TileSize = {2, 2},
72 BoxSize = {64, 64},
73 SightRange = 7,
74 Armor = 20,
75 BasicDamage = 50,
76 PiercingDamage = 30,
77 Missile = "missile-bomber",
78 Priority = 20,
79 AnnoyComputerFactor = 65,
80 Points = 15,
81 ExplodeWhenKilled = "missile-64x64-explosion",
82 Type = "fly",
83 ComputerReactionRange = 10,
84 PersonReactionRange = 10,
85 RightMouseAction = "attack",
86 SelectableByRectangle = true,
87 CanAttack = true,
88 CanTargetLand = true,
89 CanTargetSea = true,
90 NumDirections = 8,
91 MaxAttackRange = 1,
92 Sounds = {
93 "selected", "grenadier-selected",
94 "acknowledge", "grenadier-acknowledge",
95 "ready", "bomber-ready",
96 "help", "bomber-help"
97 }
98 })
99
100 DefineAllow("unit-bomber", AllowAll)
101
102 DefineButton({
103 Pos = 2, Level = 0, Icon = "icon-bomber", Action = "train-unit",
104 Value = "unit-bomber", Hint = "BUILD ~!BOMBER",
105 ForUnit = {"unit-aircraftfactory"}})
106
107 DefineCommonButtons({"unit-bomber"})
108
109
110