Nimbin[12]?Games / Entropie / entropie/src/world/injury.h

Entropie git · main

Entropie festival game; first steps

sdl c game entropie cmake · first commit 2026-10-10 · last commit 2026-11-02 (18 hours ago) · synced 10 hours ago

C 88.5% Markdown 9.1% GLSL 2.3%
git clone https://git.christianimmanuel.de/games/Entropie.gitwget https://git.christianimmanuel.de/games/Entropie/archive/Entropie.tar.gz
entropie/src/world/injury.h 1.3 KB · 28 lines raw
#ifndef WORLD_INJURY_H
#define WORLD_INJURY_H

/*
 * Broken bones: something heavy coming down on somebody (a falling tree), a
 * bad fall from high up. They stay lying there till the ambulance has them
 * (game_injury.c); back from the hospital they wear a cast for a while - an
 * arm: weaker and slower at work; a leg: slow on their feet, no jumping.
 */

#include "world/world.h"

/* Breaks it (INJ_ARM / INJ_LEG): down they go and stay down. False: already hurt (or nobody to hurt). */
bool Injury_break(World *world, Object *who, int kind);
/* A hit that breaks something this often (0..1): which (INJ_ARM / INJ_LEG), or INJ_NONE (lucky). */
int  Injury_roll(World *world, float chance);
/* The cast on (what it does to them) or off again. */
void Injury_setCast(Object *who, int kind, int side, bool on);
/* A twisted ankle: limping for some hours (slower, hardly a jump), then fine. False: already. */
bool Injury_sprain(World *world, Object *who);
/* Every frame: the sprain wearing off. */
void Injury_update(Object *who, float game_dt);
/* All well again (dev): the sprain, the cast, a break they're lying with, the scrapes. */
void Injury_heal(Object *who);
/* What they have on: INJ_* of the cast (from look.cast). */
int  Injury_castKind(const Object *who);

#endif /* WORLD_INJURY_H */