Debian Codegraph @

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