Debian Codegraph @

units/harvester/unit-harvester.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-harvester.lua - Define the harvester 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-harvester",
31 Size = {46, 38},
32 Frame = 0,
33 File = GetCurrentLuaPath().."/ico_harv.png"})
34
35 DefineAnimations("animations-harvester", {
36 Still = {"frame 0", "wait 1", },
37 Move = {"unbreakable begin", "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", "wait 1", "frame 0", "move 1", "wait 1",
48 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
49 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
50 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
51 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
52 "frame 0", "move 1", "wait 1", "frame 0", "move 1", "wait 1",
53 "frame 0", "move 1", "unbreakable end", "wait 1", },
54 Harvest = {"frame 5", "sound harvester-harvest", "wait 6",
55 "frame 10", "wait 3", "frame 15", "wait 3", "frame 20", "wait 3",
56 "frame 25", "sound harvester-harvest", "wait 6", "frame 20", "wait 3",
57 "frame 15", "wait 3", "frame 10", "wait 3", },
58 Death = {"unbreakable begin", "frame 0", "wait 5", "frame 0", "wait 5",
59 "frame 0", "wait 5", "frame 0", "unbreakable end", "wait 5", },
60 })
61
62 MakeSound("harvester-selected", GetCurrentLuaPath().."/harvester_select.wav")
63 MakeSound("harvester-acknowledge", GetCurrentLuaPath().."/harvester_action.wav")
64 MakeSound("harvester-ready", GetCurrentLuaPath().."/harvester.completed.wav")
65 MakeSound("harvester-help", GetCurrentLuaPath().."/harvester.underattack.wav")
66 MakeSound("harvester-die", GetCurrentLuaPath().."/harvester_die.wav")
67 MakeSound("harvester-harvest", GetCurrentLuaPath().."/harvester_attack.wav")
68
69 DefineUnitType("unit-harvester", {
70 Name = "Harvester",
71 Image = {"file", GetCurrentLuaPath().."/unit_harv.png", "size", {96, 96}},
72 Shadow = {"file", GetCurrentLuaPath().."/unit_harv_s.png", "size", {96, 96}},
73 Animations = "animations-harvester",
74 Icon = "icon-harvester",
75 Flip = true,
76 EnergyValue = 3200,
77 MagmaValue = 1600,
78 MaxEnergyUtilizationRate = 40,
79 MaxMagmaUtilizationRate = 20,
80 RepairHp = 2,
81 ExplodeWhenKilled = "missile-160x128-explosion",
82 HitPoints = 200,
83 DrawLevel = 25,
84 TileSize = {1, 1},
85 BoxSize = {63, 63},
86 SightRange = 5,
87 ComputerReactionRange = 6,
88 PersonReactionRange = 4,
89 Armor = 25,
90 BasicDamage = 0,
91 PiercingDamage = 0,
92 Missile = "missile-none",
93 MaxAttackRange = 0,
94 Priority = 50,
95 Points = 30,
96 Type = "land",
97 RightMouseAction = "harvest",
98 CanAttack = true,
99 CanTargetLand = true,
100 Coward = true,
101 Harvester = true,
102 SelectableByRectangle = true,
103 Sounds = {
104 "selected", "harvester-selected",
105 "acknowledge", "harvester-acknowledge",
106 "ready", "harvester-ready",
107 "help", "harvester-help",
108 "dead", "harvester-die"}
109 })
110 DefineAllow("unit-harvester", AllowAll)