Skip to content

Commit 05a92b6

Browse files
committed
trying to fix commands
1 parent 8422f39 commit 05a92b6

3 files changed

Lines changed: 59 additions & 25 deletions

File tree

Arluq-github-social-preview.png

24.7 KB
Loading

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<img src="Arluq-logo.png" alt="Arluq logo" width="200"/>
1+
<img src="Arluq-github-social-preview.png" alt="Arluq logo"/>
22

33
# ArluqTools
44
Abstraction layer for Zoo Tycoon 2's Lua libraries. Modify your entities in a way that makes sense.

services/AnimalService.lua

Lines changed: 58 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ function AnimalService.delete (animal)
1313
deleteEntity(animal)
1414
end
1515

16+
--- Get animal age, returns true if adult, false if young
17+
--- @param animal animal
18+
--- @return bool
19+
function AnimalService.getAge (animal)
20+
return animal:BFG_GET_ATTR_BOOLEAN("b_Adult")
21+
end
22+
1623
--- Get animal age as sting
1724
--- @param animal animal
1825
--- @return string
@@ -24,6 +31,13 @@ function AnimalService.getAgeString (animal)
2431
return "Young"
2532
end
2633

34+
--- Get animal gender, returns true if male, false if female
35+
--- @param animal animal
36+
--- @return bool
37+
function AnimalService.getGender (animal)
38+
return animal:BFG_GET_ATTR_BOOLEAN("b_Male")
39+
end
40+
2741
--- Get animal gender as sting
2842
--- @param animal animal
2943
--- @return string
@@ -35,6 +49,27 @@ function AnimalService.getGenderString (animal)
3549
return "F"
3650
end
3751

52+
--- Get animal rampage status
53+
--- @param animal animal
54+
--- @return bool
55+
function AnimalService.getRampage (animal)
56+
return animal:BFG_GET_ATTR_BOOLEAN("b_Rampage")
57+
end
58+
59+
--- Get animal rest status
60+
--- @param animal animal
61+
--- @return float
62+
function AnimalService.getRest (animal)
63+
return animal:BFG_GET_ATTR_FLOAT("b_Rest")
64+
end
65+
66+
--- Get animal species
67+
--- @param animal animal
68+
--- @return string
69+
function AnimalService.getSpecies (animal)
70+
return animal:BFG_GET_ATTR_STRING("s_Species")
71+
end
72+
3873
--- Get animal super status as sting
3974
--- @param animal animal
4075
--- @return string
@@ -46,6 +81,13 @@ function AnimalService.getSuperString (animal)
4681
return ""
4782
end
4883

84+
--- Get animal thirst
85+
--- @param animal animal
86+
--- @return float
87+
function AnimalService.getThirst (animal)
88+
return animal:BFG_GET_ATTR_FLOAT("b_Thirst")
89+
end
90+
4991
--- Set whether or not an animal can be put up for adoption
5092
--- @param animal animal
5193
--- @param canBeAdopted bool
@@ -77,35 +119,28 @@ end
77119

78120
--- Set animal enviroment suitability
79121
--- @param animal animal
80-
--- @param enviroment int
122+
--- @param enviroment float
81123
function AnimalService.setEnviroment (animal, enviroment)
82124
setNeed(animal, "enviroment", enviroment)
83125
end
84126

85127
--- Set animal exercise stat
86128
--- @param animal animal
87-
--- @param exercise int
129+
--- @param exercise float
88130
function AnimalService.setExercise (animal, exercise)
89131
setNeed(animal, "exercise", exercise)
90132
end
91133

92-
--- Set animal happiness
93-
--- @param animal animal
94-
--- @param happiness int
95-
function AnimalService.setHappiness (animal, happiness)
96-
setNeed(animal, "happiness", happiness)
97-
end
98-
99134
--- Set animal hunger
100135
--- @param animal animal
101-
--- @param hunger int
136+
--- @param hunger float
102137
function AnimalService.setHunger (animal, hunger)
103138
setNeed(animal, "hunger", hunger)
104139
end
105140

106141
--- Set animal hygiene
107142
--- @param animal animal
108-
--- @param hygiene int
143+
--- @param hygiene float
109144
function AnimalService.setHygiene (animal, hygiene)
110145
setNeed(animal, "hygiene", hygiene)
111146
end
@@ -141,19 +176,11 @@ end
141176

142177
--- Set animal privacy
143178
--- @param animal animal
144-
--- @param privacy int
179+
--- @param privacy float
145180
function AnimalService.setPrivacy (animal, privacy)
146181
setNeed(animal, "privacy", privacy)
147182
end
148183

149-
--- Set animal rampage status
150-
--- @param animal animal
151-
--- @param isRampaging bool
152-
function AnimalService.setRampage (animal, isRampaging)
153-
local rampageManager = queryObject("BFGRampageMgr")
154-
rampageManager:BFG_FORCE_RAMPAGE(animal)
155-
end
156-
157184
--- Set whether or not an animal can be released to the wild
158185
--- @param animal animal
159186
--- @param canBeReleased bool
@@ -163,21 +190,21 @@ end
163190

164191
--- Set animal rest
165192
--- @param animal animal
166-
--- @param rest int
193+
--- @param rest float
167194
function AnimalService.setRest (animal, rest)
168195
setNeed(animal, "rest", rest)
169196
end
170197

171198
--- Set animal social stat
172199
--- @param animal animal
173-
--- @param social int
200+
--- @param social float
174201
function AnimalService.setSocial (animal, social)
175202
setNeed(animal, "social", social)
176203
end
177204

178205
--- Set animal stimulation stat
179206
--- @param animal animal
180-
--- @param stimulation int
207+
--- @param stimulation float
181208
function AnimalService.setStimulation (animal, stimulation)
182209
setNeed(animal, "stimulation", stimulation)
183210
end
@@ -210,7 +237,14 @@ end
210237

211238
--- Set animal thirst
212239
--- @param animal animal
213-
--- @param thirst int
240+
--- @param thirst float
214241
function AnimalService.setThirst (animal, thirst)
215242
setNeed(animal, "thirst", thirst)
243+
end
244+
245+
--- Trigger a rampage
246+
--- @param animal animal
247+
function AnimalService.triggerRampage (animal)
248+
local rampageManager = queryObject("BFGRampageMgr")
249+
rampageManager:BFG_FORCE_RAMPAGE(animal)
216250
end

0 commit comments

Comments
 (0)