Skip to main content

Wintertreegiftable

Overview

This component manages the timing state for gift-giving events to Wintertrees by recording the last world cycle a gift was given and providing methods to query the elapsed time or update the recorded day.

Dependencies & Tags

None identified.

Properties

PropertyTypeDefault ValueDescription
instEntityThe entity instance the component is attached to (assigned in constructor).
previousgiftdaynumber-100The last world cycle (day count) when a gift was given to the Wintertree.

Main Functions

GetDaysSinceLastGift()

  • Description: Returns the number of world cycles that have passed since the last gift was given.
  • Parameters: None.

OnGiftGiven()

  • Description: Updates the internal timestamp to the current world cycle, recording that a gift was just given.
  • Parameters: None.

OnSave()

  • Description: Returns a serializable table containing the previousgiftday value for world save persistence.
  • Parameters: None.

OnLoad(data)

  • Description: Restores the previousgiftday value from saved data during world load.
  • Parameters:
    • data (table?): A table containing the previousgiftday field; may be nil if no prior data exists.

Events & Listeners

None.