Skip to content

Commit 77892bd

Browse files
authored
Merge pull request #25 from ZtModArchive/bigarluq
Bigarluq
2 parents 68713be + b01fab5 commit 77892bd

5 files changed

Lines changed: 121 additions & 8 deletions

File tree

castor.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"ArchiveName": "zzz-ArluqTools",
33
"RepoName": "ZtModArchive/ArluqTools",
44
"Author": "Apodemus",
5-
"Version": "v2.4",
5+
"Version": "v2.5",
66
"Type": "package",
77
"License": "MIT License",
88
"Description": "This is a lua library that is an abstraction layer around ZT2's libraries.",

scripts/arluq.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ include "modules/ZtModArchive/ArluqTools/scripts/services/AnimalService.lua"
55
include "modules/ZtModArchive/ArluqTools/scripts/services/CollectionService.lua"
66
include "modules/ZtModArchive/ArluqTools/scripts/services/FenceService.lua"
77
include "modules/ZtModArchive/ArluqTools/scripts/services/GuestService.lua"
8+
include "modules/ZtModArchive/ArluqTools/scripts/services/TimeService.lua"
9+
include "modules/ZtModArchive/ArluqTools/scripts/services/ZooService.lua"
810

911
--- Big Daddy Arluq class
1012
aq = {}
@@ -16,4 +18,6 @@ aq.tryCatch = tryCatch
1618
aq.collection = CollectionService
1719
aq.animal = AnimalService
1820
aq.fence = FenceService
19-
aq.guest = GuestService
21+
aq.guest = GuestService
22+
aq.time = TimeService
23+
aq.zoo = ZooService

scripts/services/AnimalService.lua

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
--- @todo
2-
-- suppressing rampage
3-
-- get/set variations
4-
-- get/set skin variations
5-
-- get/set deletable
6-
71
-- Include Zoo Tycoon 2 libraries
82
include "scenario/scripts/entity.lua"
93
include "scenario/scripts/misc.lua"
@@ -100,6 +94,15 @@ function AnimalService.setOld (animal, isOld)
10094
animal:BFG_ENTITY_MORPH_TO_NEW_ENTITY(species .. age .. gender .. old .. super, false, 0, false, 1)
10195
end
10296

97+
---- ATTACK ----
98+
99+
--- Get if animal is attacked
100+
--- @param animal animal
101+
--- @return bool
102+
function AnimalService.getAttacked (animal)
103+
return animal:BFG_GET_ATTR_BOOLEAN("b_Attacked")
104+
end
105+
103106
---- BATHROOM ----
104107

105108
--- Get animal bathroom stat
@@ -206,6 +209,15 @@ function AnimalService.setEnviroment (animal, enviroment)
206209
setNeed(animal, "enviroment", enviroment)
207210
end
208211

212+
---- ESCAPE ----
213+
214+
--- Get if animal is escaped
215+
--- @param animal animal
216+
--- @return bool
217+
function AnimalService.getEscaped (animal)
218+
return animal:BFG_GET_ATTR_BOOLEAN("b_Escaped")
219+
end
220+
209221
---- EXERCISE ----
210222

211223
--- Get animal exercise stat

scripts/services/TimeService.lua

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
include "scenario/scripts/misc.lua"
2+
3+
--- Service for time properties
4+
TimeService = {}
5+
6+
---- MONTH ----
7+
8+
--- Get current month
9+
--- @return float
10+
function TimeService.getMonth ()
11+
return getCurrentMonth()
12+
end
13+
14+
---- TIME ----
15+
16+
--- Get current time of day
17+
--- @return float
18+
function TimeService.getTime ()
19+
return getCurrentTimeOfDay()
20+
end
21+
22+
--- Get real time
23+
--- @return float
24+
function TimeService.getRealTime ()
25+
return getRealTime()
26+
end
27+
28+
--- Get sim time
29+
--- @return float
30+
function TimeService.getSimTime ()
31+
return getCurrentSimTime()
32+
end

scripts/services/ZooService.lua

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
include "scenario/scripts/misc.lua"
2+
3+
--- Service for zoo management
4+
ZooService = {}
5+
6+
---- ANIMALS ----
7+
8+
--- Get number of animals put up for adoption
9+
--- @return float
10+
function ZooService.getAnimalsPutUpForAdoption ()
11+
return getAnimalsPutUpForAdoption()
12+
end
13+
14+
--- Get number of released animals
15+
--- @return float
16+
function ZooService.getAnimalsReleased ()
17+
return getAnimalsReleased()
18+
end
19+
20+
---- BALLOONS ----
21+
22+
--- Give balloons
23+
function ZooService.giveBalloons ()
24+
giveBalloons ()
25+
end
26+
27+
---- ENTRANCE ----
28+
29+
--- Get zoo entrance position
30+
--- @return table
31+
function ZooService.getZooEntrancePos ()
32+
return getZooEntrancePos()
33+
end
34+
35+
---- FAME ----
36+
37+
--- Get zoo fame
38+
--- @return float
39+
function ZooService.getZooFame (cash)
40+
return getZooFame(cash)
41+
end
42+
43+
---- FINANCE ----
44+
45+
--- Give cash
46+
--- @param cash float
47+
function ZooService.giveCash (cash)
48+
giveCash(cash)
49+
end
50+
51+
---- GUESTS ----
52+
53+
--- Get total guest count
54+
--- @return float
55+
function ZooService.getNumGuests ()
56+
return getNumGuests()
57+
end
58+
59+
---- NAME ----
60+
61+
--- Get zoo name
62+
--- @return string
63+
function ZooService.getZooName ()
64+
return getZooName ()
65+
end

0 commit comments

Comments
 (0)