Skip to content

AnimalService

Apodemus Erectus edited this page Sep 5, 2021 · 12 revisions

AnimalService is a class that you can use to modify animal objects.

Example Usage

-- ArluqTools1.1 example
-- This example turns all animals in the zoo into babies.
include "scenario/scripts/entity.lua"
include "scenario/scripts/token.lua"
include "scenario/scripts/ui.lua"
include "scenario/scripts/misc.lua"

include "scripts/ArluqTools1-1/services/AnimalService.lua"

function Main(args)
    local animalList = findType("animal")

    -- Loop over each animal
    local numAnimal = table.getn(animalList)
    for i = 1, numAnimal, 1 do
        local animal = resolveTable(animalList[i].value)

        -- use AnimalService to set age to Young
        AnimalService.setAge(animal, "Young")
    end
end

Methods

Adoption

  • getAdoptOption(animal) - Get whether or not an animal can be put up for adoption

    • Param: animal animal
    • Return: bool
  • setAdoptOption(animal, canBeAdopted) - Set whether or not an animal can be put up for adoption

    • Param: animal animal
    • Param: canBeAdopted bool

Age

  • getAge(animal) - Get animal age, returns true if adult, false if young

    • Param: animal animal
    • Return: bool
  • getAgeString(animal) - Get animal age as sting

    • Param: animal animal
    • Return: string
  • setAge(animal, age) - Set animal age

    • Param: animal animal
    • Param: age string

Bathroom

  • getBathroom(animal) - Get animal bathroom stat

    • Param: animal animal
    • Return: float
  • setBathroom(animal, bathroom) - Set animal bathroom stat

    • Param: animal animal
    • Param: bathroom float

Crate

  • setCrated(animal, isCrated) - Set animal crated status
    • Param: animal animal
    • Param: isCrated bool

Delete

  • delete(animal) - Delete animal
    • Param: animal animal

Enviroment

  • getEnviroment(animal) - Get animal enviroment suitability

    • Param: animal animal
    • Return: float
  • getEnviroment(animal, enviroment) - Set animal enviroment suitability

    • Param: animal animal
    • Param: enviroment float

Exercise

  • getExercise(animal) - Get animal exercise stat

    • Param: animal animal
    • Return: float
  • setExercise(animal, exercise) - Set animal exercise stat

    • Param: animal animal
    • Param: exercise float

Gender

  • getGender(animal) - Get animal gender, returns true if male, false if female

    • Param: animal animal
    • Return: bool
  • getGenderString(animal) - Get animal gender as sting

    • Param: animal animal
    • Return: string
  • setGender(animal, gender) - Set animal gender

    • Param: animal animal
    • Param: gender string

Health

  • getHealth(animal) - Get animal health

    • Param: animal animal
    • Return: float
  • setHealth(animal, health) - Set animal health

    • Param: animal animal
    • Param: health float

Hunger

  • getHunger(animal) - Get animal hunger

    • Param: animal animal
    • Return: float
  • setHunger(animal, hunger) - Set animal hunger

    • Param: animal animal
    • Param: hunger float

Hygiene

  • getHygiene(animal) - Get animal hygiene

    • Param: animal animal
    • Return: float
  • setHygiene(animal, hygiene) - Set animal hygiene

    • Param: animal animal
    • Param: hunger float

Pregnancy

  • getPregnant(animal) - Get if animal is pregnant

    • Param: animal animal
    • Return: bool
  • setPregnant(animal, isPregnant) - Set animal pregnancy

    • Param: animal animal
    • Param: isPregnant bool

Privacy

  • getPrivacy(animal) - Get animal privacy

    • Param: animal animal
    • Return: float
  • setPrivacy(animal, privacy) - Set animal privacy

    • Param: animal animal
    • Param: privacy float

Rampage

  • getRampage(animal) - Get animal rampage status

    • Param: animal animal
    • Return: bool
  • triggerRampage(animal) - Trigger a rampage

    • Param: animal animal

Release

  • getReleaseOption(animal) - Get whether or not an animal can be released to the wild

    • Param: animal animal
    • Return: bool
  • setReleaseOption(animal, canBeReleased) - Set whether or not an animal can be released to the wild

    • Param: animal animal
    • Param: canBeReleased bool

Rest

  • getRest(animal) - Get animal rest

    • Param: animal animal
    • Return: float
  • setRest(animal, rest) - Set animal rest

    • Param: animal animal
    • Param: rest float

Social

  • getSocial(animal) - Get animal social stat

    • Param: animal animal
    • Return: float
  • setSocial(animal, social) - Set animal social stat

    • Param: animal animal
    • Param: social float

Species

  • getSpecies(animal) - Get animal species

    • Param: animal animal
    • Return: string
  • setSpecies(animal, species) - Set animal species

    • Param: animal animal
    • Param: species string

Stimulation

  • getStimulation(animal) - Get animal stimulation

    • Param: animal animal
    • Return: float
  • setStimulation(animal, stimulation) - Set animal stimulation

    • Param: animal animal
    • Param: stimulation float

Super

  • getSuper(animal) - Get animal super status as a boolean

    • Param: animal animal
    • Return: bool
  • getSuperString(animal) - Get animal super status as sting

    • Param: animal animal
    • Return: string
  • setSuper(animal, isSuper) - Set animal super status

    • Param: animal animal
    • Param: isSuper bool

Thirst

  • getThirst(animal) - Get animal thirst

    • Param: animal animal
    • Return: float
  • setThirst(animal, thirst) - Set animal thirst

    • Param: animal animal
    • Param: thirst float