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
| Property | Type | Default Value | Description |
|---|---|---|---|
inst | Entity | — | The entity instance the component is attached to (assigned in constructor). |
previousgiftday | number | -100 | The 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
previousgiftdayvalue for world save persistence. - Parameters: None.
OnLoad(data)
- Description: Restores the
previousgiftdayvalue from saved data during world load. - Parameters:
data(table?): A table containing thepreviousgiftdayfield; may benilif no prior data exists.
Events & Listeners
None.