Shared definition of the cw_plant entity: its entity fields and the getters for the time it was planted, the time it ripens and the unique ID of the seed item it grew from.

Summary

Methods

Draw()client
Draws the plant's model.
Returns when the plant is ripe.
GetItem()shared
Returns the unique ID of the seed item the plant grew from.
Returns when the plant was planted.
Draws the plant's name and, for players with over 25 farming, its maturity percentage.
Sets up the plant's default pot model and physics.
Destroys the plant when a player damages it.
Sets when the plant is ripe.
Sets the seed item the plant grew from, which decides its name and harvest.
Sets when the plant was planted.
Sets up the networked plant time, grow time and seed item ID.
Think()shared
Scales the plant up from a quarter of its size as it grows, checking every five seconds.
Starts harvesting the ripe plant for a crouching, untied player.

Methods

Draws the plant's model.

Returns when the plant is ripe.

Returns

  • Number The CurTime the plant ripens at

Returns the unique ID of the seed item the plant grew from.

Returns

  • String The seed item's unique ID

Returns when the plant was planted.

Returns

  • Number The CurTime the seeds were planted at

Draws the plant's name and, for players with over 25 farming, its maturity percentage.

Parameters

  • x
  • y
  • alpha

On the server

Sets up the plant's default pot model and physics.

On the client

Does nothing on the client.

Defined in

Destroys the plant when a player damages it.

Parameters

  • dmg

Sets when the plant is ripe.

Parameters

  • time Number The CurTime the plant ripens at

Sets the seed item the plant grew from, which decides its name and harvest.

Parameters

  • uniqueID String The seed item's unique ID

Sets when the plant was planted.

Parameters

  • time Number The CurTime the seeds were planted at

Sets up the networked plant time, grow time and seed item ID.

On the server

Scales the plant up from a quarter of its size as it grows, checking every five seconds.

On the client

Does nothing on the client.

Defined in

Starts harvesting the ripe plant for a crouching, untied player.

The harvest takes 11 to 25 seconds, less with the farming attribute, during which the player must stay crouched and near the plant. On success it fires PlayerHarvest and removes the plant.

Parameters

  • activator

Defined in