Get Health

Description

The get_health() function retrieves Gizmo's current and maximum health points. Use this function to monitor Gizmo's condition throughout the game.

Syntax

health_data = get_health()

Parameters

None.

Return

The function returns an object with two properties:

  • current_health: An integer representing Gizmo's current health points.
  • max_health: An integer representing Gizmo's maximum health points.

Examples

Here's an example of how to use the get_health() function:

# Get Gizmo's health information
health_data = get_health()

# Print Gizmo's current health and maximum health
print(f"Gizmo's current health: {health_data.current_health}")
print(f"Gizmo's maximum health: {health_data.max_health}")

# Calculate health percentage
health_percentage = (health_data.current_health / health_data.max_health) * 100
print(f"Gizmo's health is at {health_percentage:.2f}%")

This example demonstrates how to retrieve Gizmo's health information, display the current and maximum health, and calculate the health percentage.

Notes

  • The get_health() function is available from the start of the game (UnlocksAtLevel: 0).
  • It's a good practice to regularly check Gizmo's health to make informed decisions in your code.
  • Remember that Gizmo's health may change due to various factors in the game, so calling this function frequently can help you keep track of Gizmo's condition.