Debian Codegraph @

units/assault/unit-assault.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-assault.lua - Define the assault 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-assault",
31 Size = {46, 38},
32 Frame = 0,
33 File = GetCurrentLuaPath().."/ico_assault.png"})
34
35 DefineAnimations("animations-assault", {
36 Still = {"frame 0", "wait 1", },
37 Move = {"unbreakable begin", "frame 5", "move 2", "wait 1",
38 "frame 5", "move 2", "wait 1", "frame 10", "move 2", "wait 1",
39 "frame 10", "move 2", "wait 1", "frame 15", "move 2", "wait 1",
40 "frame 15", "move 2", "wait 1", "frame 20", "move 2", "wait 1",
41 "frame 20", "move 2", "wait 1", "frame 5", "move 2", "wait 1",
42 "frame 5", "move 2", "wait 1", "frame 10", "move 2", "wait 1",
43 "frame 10", "move 2", "wait 1", "frame 15", "move 2", "wait 1",
44 "frame 15", "move 2", "wait 1", "frame 20", "move 2", "wait 1",
45 "frame 20", "move 2", "wait 1", "frame 20", "unbreakable end", "wait 1", },
46 Attack = {"unbreakable begin",
47 "frame 25", "sound assault-attack", "attack", "wait 1",
48 "frame 0", "wait 1", "frame 25", "wait 1", "frame 0", "wait 1",
49 "frame 25", "wait 1", "frame 0", "wait 1", "frame 25", "wait 1",
50 "frame 0", "wait 1", "frame 25", "wait 1", "frame 0", "wait 1",
51 "frame 25", "attack", "wait 1", "frame 0", "wait 24",
52 "frame 0", "unbreakable end", "wait 1", },
53 Death = {"unbreakable begin", "frame 30", "wait 5", "frame 35", "wait 5",
54 "frame 40", "wait 5", "frame 45", "unbreakable end", "wait 5", },
55 })
56
57 MakeSound("assault-selected", GetCurrentLuaPath().."/assault_select.wav")
58 MakeSound("assault-acknowledge", GetCurrentLuaPath().."/assault_action.wav")
59 MakeSound("assault-ready", GetCurrentLuaPath().."/assault.unit.ready.wav")
60 MakeSound("assault-help", GetCurrentLuaPath().."/assault.unit.underattack.wav")
61 MakeSound("assault-die", GetCurrentLuaPath().."/assault_die.wav")
62 MakeSound("assault-attack", GetCurrentLuaPath().."/assault_attack.wav")
63
64 DefineUnitType("unit-assault", {
65 Name = "Assault Unit",
66 Image = {"file", GetCurrentLuaPath().."/unit_assault.png", "size", {64, 64}},
67 Shadow = {"file", GetCurrentLuaPath().."/unit_assault_s.png", "size", {64, 64}},
68 Animations = "animations-assault",
69 Icon = "icon-assault",
70 Flip = true,
71 EnergyValue = 1000,
72 MagmaValue = 250,
73 HitPoints = 30,
74 DrawLevel = 25,
75 TileSize = {1, 1},
76 BoxSize = {17, 28},
77 RightMouseAction = "attack",
78 SightRange = 6,
79 ComputerReactionRange = 6,
80 PersonReactionRange = 6,
81 Armor = 3,
82 BasicDamage = 4,
83 PiercingDamage = 0,
84 Missile = "missile-none",
85 MaxAttackRange = 5,
86 Priority = 60,
87 Points = 50,
88 Corpse = "unit-dead-body1",
89 Type = "land",
90 CanAttack = true,
91 CanTargetLand = true,
92 CanTargetAir = true,
93 CanTargetSea = true,
94 Organic = true,
95 SelectableByRectangle = true,
96 Sounds = {
97 "selected", "assault-selected",
98 "acknowledge", "assault-acknowledge",
99 "ready", "assault-ready",
100 "help", "assault-help",
101 "dead", "assault-die"}
102 })
103 DefineHumanCorpse("assault", nil, true)
104
105 DefineAllow("unit-assault", AllowAll)