Attachments
Utility functions related to attachments are stored in this module. Mostly used to retrieve attachment items and definitions.
Holds utility functions related to the attachment system of horses.
Require: require("HorseMod/attachments/Attachments")
-
HorseMod.attachments.Attachments.ATTACHMENTS_MOD_DATA:
HorseMod.ModDataKind<HorseMod.AttachmentsModData>
-
HorseMod.attachments.Attachments.canEquipWithRider(fullType:
string, slot:HorseMod.AttachmentSlot):boolean Checks if the given accessory full type can be equipped with a rider on the horse.
-
HorseMod.attachments.Attachments.isAttachment(fullType:
string, _slot?:HorseMod.AttachmentSlot):boolean Checks if the given item full type is an attachment, and optionally if it has a slot (_slot).
-
HorseMod.attachments.Attachments.isSlot(slot:
HorseMod.AttachmentSlot):boolean Checks if the given slot is a valid attachment slot.
-
HorseMod.attachments.Attachments.getSlots(fullType:
string):HorseMod.AttachmentSlot[] Retrieve the attachment slot of a given item fullType.
-
HorseMod.attachments.Attachments.getMainSlot(fullType:
string):HorseMod.AttachmentSlot
-
HorseMod.attachments.Attachments.getManeDefinition(breedName:
string):HorseMod.ManeDefinition Retrieve the mane definition for a specific horse breed.
-
HorseMod.attachments.Attachments.getAttachmentDefinition(fullType:
string, slot:HorseMod.AttachmentSlot):HorseMod.AttachmentDefinition? Retrieves the attachments associated to the given item full type.
-
HorseMod.attachments.Attachments.get(animal:
IsoAnimal, slot:HorseMod.AttachmentSlot): (attachment?:string) Gets the equipped attachment in a specific slot.
- Returns:
attachment? (
string) – Full type of the equipped attachment item. Nil if there is no attachment in that slot.
-
HorseMod.attachments.Attachments.isLightSource(slot:
HorseMod.AttachmentSlot, fullType:string):boolean
-
HorseMod.attachments.Attachments.getLightBehavior(slot:
HorseMod.AttachmentSlot, fullType:string):HorseMod.LightBehavior?
-
HorseMod.attachments.Attachments.getAll(animal:
IsoAnimal): (
attachments: {item:string, slot:HorseMod.AttachmentSlot}[]
) Gets all currently equipped attachments.
- Returns:
attachments ({item:
string, slot:HorseMod.AttachmentSlot}[]) – Full type of equipped attachment items and the slot they are attached to.
-
HorseMod.attachments.Attachments.predicateHorseAccessory(item):
boolean
-
HorseMod.attachments.Attachments.getAvailableGear(player:
IsoPlayer):ArrayList<InventoryItem> Retrieve every available attachments in the player inventory.
-
HorseMod.attachments.Attachments.getAttachedAndDef(animal:
IsoAnimal, slot:HorseMod.AttachmentSlot):string?,HorseMod.AttachmentDefinition?
-
HorseMod.attachments.Attachments.getReins(animal:
IsoAnimal):string?,HorseMod.AttachmentDefinition? Retrieve the reins attachment item and its definition from the horse.
-
HorseMod.attachments.Attachments.getSaddle(animal:
IsoAnimal):string?,HorseMod.AttachmentDefinition? Retrieve the reins attachment item and its definition from the horse.
-
HorseMod.attachments.Attachments.getHorseContainerData(worldItem:
IsoWorldInventoryObject):HorseMod.ContainerInformation? Retrieve possible container information from the world item mod data. If it isn’t a horse container, then nil should be returned.
-
HorseMod.attachments.Attachments.verifyRequirements(
horse:IsoAnimal,
fullType:string,
slot:HorseMod.AttachmentSlot
): (
boolean,
missing?: {allOf:HorseMod.AttachmentSlot[], oneOf:HorseMod.AttachmentSlot[]}
) Verifies that the requirements of the provided fullType item on slot are satisfied. If not satisfied, returns false and a table containing which requirements are missing.
-
HorseMod.attachments.Attachments.findDependentAttachments(
horse:IsoAnimal,
fullType:string,
slot:HorseMod.AttachmentSlot
): (
hasDependencies:boolean,
dependentAttachments: {allOf: {item:string, slot:HorseMod.AttachmentSlot}[], oneOf: {item:string, slot:HorseMod.AttachmentSlot}[]}
) Finds the accessories needed for the provided fullType item on slot. These items need to be removed in order for the attachment to be removed.