Debian Codegraph @

units/artil/unit-artil.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-artil.lua - Define the artil unit.
11 --
12 -- (c) Copyright 2005-2012 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-artil", {
30 Still = {"frame 0", "wait 1", },
31 Move = {"unbreakable begin", "frame 0", "move 1", "wait 1",
32 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
33 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
34 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
35 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
36 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
37 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
38 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
39 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
40 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
41 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
42 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
43 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
44 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
45 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
46 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
47 "frame 0", "move 1", "unbreakable end", "wait 1", },
48 Attack = {"unbreakable begin", "frame 0", "wait 10",
49 "frame 0", "sound bazoo-attack", "attack", "wait 1",
50 "frame 5", "wait 10",
51 "frame 0", "wait 25", "unbreakable end", "wait 1", },
52 Death = {"unbreakable begin", "frame 10", "wait 10", "unbreakable end",
53 "wait 1",},
54 })
55
56
57 DefineIcon({
58 Name = "icon-artil",
59 Size = {46, 38},
60 Frame = 0,
61 File = "units/artil/ico_artil.png"})
62
63 MakeSound("artil-selected", GetCurrentLuaPath().."/artil.select.wav")
64 MakeSound("artil-acknowledge", GetCurrentLuaPath().."/artil.action.wav")
65 MakeSound("artil-dead", GetCurrentLuaPath().."/artil.die.wav")
66 MakeSound("artil-ready", GetCurrentLuaPath().."/artil.ready.wav")
67 MakeSound("artil-help", GetCurrentLuaPath().."/artil.underattack.wav")
68
69 DefineUnitType("unit-artil", {
70 Name = "Artil",
71 Image = {"file", "units/artil/unit_artil.png", "size", {160, 160}},
72 Offset = {0, -10},
73 Shadow = {"file", "units/artil/unit_artil_s.png", "size", {160, 160}},
74 Animations = "animations-artil",
75 Icon = "icon-artil",
76 EnergyValue = 10000,
77 MagmaValue = 10000,
78 RepairHp = 1,
79 HitPoints = 250,
80 DrawLevel = 25,
81 TileSize = {1, 1},
82 BoxSize = {64, 64},
83 SightRange = 5,
84 Armor = 25,
85 BasicDamage = 10,
86 PiercingDamage = 50,
87 Missile = "missile-bazoo",
88 Priority = 20,
89 AnnoyComputerFactor = 65,
90 Points = 25,
91 ExplodeWhenKilled = "missile-64x64-explosion",
92 Type = "land",
93 ComputerReactionRange = 10,
94 PersonReactionRange = 10,
95 RightMouseAction = "attack",
96 SelectableByRectangle = true,
97 CanAttack = true,
98 CanTargetLand = true,
99 CanTargetSea = true,
100 NumDirections = 8,
101 MaxAttackRange = 8,
102 Sounds = {
103 "ready", "artil-ready",
104 "acknowledge", "artil-acknowledge",
105 "selected", "artil-selected",
106 "help", "artil-help",
107 "dead", "artil-dead",
108 }
109 })
110
111 DefineAllow("unit-artil", AllowAll)
112
113 DefineCommonButtons({"unit-artil"})
114
115 DefineButton({
116 Pos = 6, Level = 0, Icon = "icon-artil", Action = "train-unit",
117 Value = "unit-artil", Hint = "BUILD ARTI~!L",
118 ForUnit = {"unit-vfac"}})
119
120