Implements player combat functionality. More...
#include <player.h>#include <sound.h>#include <random.h>#include <interactable.h>#include <interactable_crate.h>Functions | |
| void | Player_Shoot () |
| [Utility] Makes the player shoot their current weapon | |
| void | Player_SwitchGun () |
| [Utility] Changes the player's active weapon | |
| void | Player_PickUpGun (void *data, int interactableIndex) |
| Picks up a gun. | |
| void | Player_PickUpHealth (void *data, int interactableIndex) |
| void | Player_PickUpSkill (void *data, int interactableIndex) |
| void | Player_OpenCrate (void *data, int interactableIndex) |
| Opens a crate This function is a callback when the player interacts with a closed crate. | |
| void | Player_ReadLog (void *data, int interactableIndex) |
| void | Player_TakeDamage (int damage) |
| void | Player_RenderDamageEffect () |
Variables | |
| float | damageEffectOpacity = 0 |
Implements player combat functionality.
Handles player attacks, weapon use, and combat interactions with enemies and the environment.
| void Player_OpenCrate | ( | void * | data, |
| int | interactableIndex | ||
| ) |
Opens a crate This function is a callback when the player interacts with a closed crate.
| data | The gun data |
| interactableIndex | The index of the interactable crate. |
| void Player_PickUpGun | ( | void * | data, |
| int | interactableIndex | ||
| ) |
Picks up a gun.
This function is a callback when the player interacts with a gun on the ground.
| data | The gun data |
| interactableIndex | The index of the interactable gun on the ground. |
| void Player_PickUpHealth | ( | void * | data, |
| int | interactableIndex | ||
| ) |
| void Player_PickUpSkill | ( | void * | data, |
| int | interactableIndex | ||
| ) |
| void Player_ReadLog | ( | void * | data, |
| int | interactableIndex | ||
| ) |
| void Player_RenderDamageEffect | ( | ) |
| void Player_Shoot | ( | ) |
[Utility] Makes the player shoot their current weapon
Makes player shoot current weapon.
Activates the shooting sequence, including sound effects, particle effects for muzzle flash and casings, and creating bullet projectiles.
| void Player_SwitchGun | ( | ) |
[Utility] Changes the player's active weapon
Changes player's current weapon.
| void Player_TakeDamage | ( | int | damage | ) |
| float damageEffectOpacity = 0 |