-
Notifications
You must be signed in to change notification settings - Fork 7
Plant Properties and Types
There will be many types of plants in the game which can be harvested. Once harvested plants will drop items that a player can pick up and add to their inventory, which can later be consumed or used to aid them in other areas of the game.
Plants will have each of the following properties:
Represented as an integer. If a plant's health reaches 0 it dies. Health can decrease due to receiving damage from other entities in the game. Health increases on plant growth, or can be increased if the player uses growth-purpose consumables on the plant. Each plant type is assigned a maximum health.
An integer representing the maximum health that a plant has at each stage of growth.
Represented as a float between 0 and 2. The ideal water level will determine the growth rate of the plant, depending on the water level of the tile the plant is placed on.
Represented as a float. Starts at 0 when a seedling is first planted onto a tile on the map. Every 6 minutes (half day) the age is incremented by 0.5. The age will be used to .....
A plant has 7 stages of growth each represented by an integer. At each stage the plant has a percentage of the maximum health of the fully grown plant.
1 Seedling: initial stage of a plant. Can be planted on the tile. 5% maximum health.
2 Sprout: a plant in the first stages of growth. Not harvestable. 10% maximum health.
3 Juvenile: the plant is showing signs of growth. Has 30% maximum health.
4 Producing: the plant is starting to grow its produce and can soon be harvested. 60% maximum health.
5 Adult: the plant is fully grown and is harvestable. The plant will no longer grow at this stage. When harvested the plant will drop its items. Plants can stay at this stage depending on their adult lifespan. 100% maximum health.
6 Decaying: after the plant has exhausted their adult lifespan the plant's health is reduced by 10% every 3 minutes.
7 Dead: the plant's health reaches 0 after decay. The plant is no longer harvestable and can only be removed from the tile.
Growth will be determined by the type of plant and the state of the tile at which it is placed.
When a grown plant is harvested it will drop items a player can add to their inventory. (To be designed and implemented sprint 2).
An integer representing the number of cycles a plant can exist at the Adult Growth Stage before its Growth Stage is changed to 6 Decaying.
New plants are created using the PlantFactory
. Each factory method accepts a reference to the CropTileComponent
that the plant is being planted on and returns a new plant entity. The CropTileComponent
is required to be attached to an entity, since the factory method handles positioning the plant at the position of the crop tile entity. The plant entity returned by the factory needs to be registered to the entity service by the caller.
Plant entities (which have an attached PlantComponent
) listen out for events triggered on the entity. Plant entities have a sensor collider component so that any object (such as a player or animal) wanting to interact with the plant can acquire a reference to the plant entity.
Plants will listen out for three events:
-
"harvest"
- Triggers harvesting of the plant (not yet implemented). -
"destroyPlant"
- Tells the plant to destroy itself. The plant will handle informing theCropTileComponent
it is planted on that it has been destroyed. -
"attack"
- Applies damage to the plant. When triggered, expects an integer value containing how much damage to apply.
Due to the flexibility of this interaction system, more events can be easily added to add more interactions with the plant if other components of the game wish to do so.
See these crop tile sequence diagrams for more detail on the plant's interaction with the crop tile.
Name: Cosmic Cob
Type: FOOD
Description: Nutritious space corn!
Ideal water level: 0.7
Adult lifespan: 5
Maximum health: 400
Name: Aloe Vera
Type: HEALTH
Description: Produces gel that can be used for healing.
Ideal water level: 0.7
Adult lifespan: 5
Maximum health: 300:
Name: Hammer Plant
Type: REPAIR
Description: Repairs plants within its healing radius.
Ideal water level: 0.7
Adult lifespan: 5
Maximum health: 200:
Name: Space Snapper
Type: DEFENCE
Description: I eat the fauna!
Ideal water level: 0.7
Adult lifespan: 5
Maximum health: 400:
Name: Atmoic Algae
Type: PRODUCTION
Description: (Unknown)
Ideal water level: 0.7
Adult lifespan: 5
Maximum health: 100:
Name: Deadly Nightshade
Type: DEADLY
Description: grows deadly poisonous berries.
Ideal water level: 0.7
Adult lifespan: 5
Maximum health: 200
Name: Horticultural Heater
Type: PRODUCTION
Description: Warms up the nearby area.
Ideal water level: 0.7
Adult lifespan: 5
Maximum health: 100