Debian Codegraph @

CorsixTH/Lua/objects/rathole.lua

raw
1 --[[ Copyright (c) 2016 Albert "Alberth" Hofkamp
2
3 Permission is hereby granted, free of charge, to any person obtaining a copy of
4 this software and associated documentation files (the "Software"), to deal in
5 the Software without restriction, including without limitation the rights to
6 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7 of the Software, and to permit persons to whom the Software is furnished to do
8 so, subject to the following conditions:
9
10 The above copyright notice and this permission notice shall be included in all
11 copies or substantial portions of the Software.
12
13 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 SOFTWARE. --]]
20
21 local object = {}
22 object.id = "rathole"
23 object.thob = 64
24 object.name = _S.object.rathole
25 object.class = "Rathole"
26 object.tooltip = _S.tooltip.objects.rathole
27 object.ticks = false
28 object.idle_animations = {
29 north = 1904,
30 }
31 object.orientations = {
32 -- Empty footprint, so you can build any other object on top of it.
33 north = { footprint = {} },
34 south = { footprint = {} },
35 west = { footprint = {} },
36 east = { footprint = {} },
37 }
38
39 -- For ratholes:
40 -- 1904: hole in north wall
41 -- 1908: rat moving north
42 -- 1910: rat moving north-east
43 -- 1912: rat moving east
44 -- 1914: rat moving south-east
45 -- 1916: rat moving south
46 -- 1918: rat moving south-west
47 -- 1920: rat moving west
48 -- 1922: rat moving north-west
49 -- 1924: rat entering hole north wall
50 -- 1926: rat entering hole west wall
51 -- 1928: rat leaving hole north wall
52
53 class "Rathole" (Object)
54
55 ---@type Rathole
56 local Rathole = _G["Rathole"]
57
58 function Rathole:Rathole(hospital, oject_type, x, y, direction, etc)
59 self:Object(hospital, oject_type, x, y, direction, etc)
60 end
61
62 function Rathole:getDrawingLayer()
63 return DrawingLayers.RatHole
64 end
65
66 return object