#ifndef GAME_GAME_INTERNAL_H #define GAME_GAME_INTERNAL_H /* * Inside the game (game.c, game_actions.c, game_talk.c): what the frame * loop, the player's actions and talking share. Not for use outside. */ #include "game/game.h" #include "world/camp.h" #include "people/dog.h" #include "world/ladder.h" #include "world/site.h" #include "game/player.h" #include "world/scene.h" #include "world/course.h" #include "world/forestry.h" #include #include #include #define MESSAGE_TIME 2.5f /* seconds a hint stays on screen */ /* game_arrival.c: in by car at the start; still in it (no walking, no hands); the boot clicked. */ void game_arrivalStart(Game *game); void game_arrival(Game *game, float dt); bool game_arriving(const Game *game); bool game_unloadCar(Game *game); const char *game_task(Game *game); void game_skipArrival(Game *game); /* The way in by car, sampled (once); where on it s meters along, which way it heads. */ bool game_drivePath(Game *game); void game_driveAt(const Arrival *a, float s, Vec3 *pos, Vec3 *dir); /* game_shop.c: the shopping run - the one with the car keys off with the list, back an hour later, the boot full. */ void game_shopStart(Game *game, Object *driver, const int list[SHOP_ITEMS]); void game_shop(Game *game, float dt); /* After loading: a run that was on its way picked up again. */ void game_shopLoaded(Game *game); /* game_meeting.c: the meetings in Berlin and the weekends between them. Start: a new game (Grossbeerenstrasse); every frame; the answers offered; a line about it for the hint; after loading. */ void game_meetingStart(Game *game); void game_meeting(Game *game, const Input *input, float dt); int Game_meetingChoices(const Game *game, const char *out[TALK_CHOICES]); const char *game_meetingTask(const Game *game); void game_meetingLoaded(Game *game); /* Dev: the meetings at the start skipped (the first answers): on to the drive in. */ void game_meetingSkipStart(Game *game); /* game_why.c: looking round for what makes you wonder (the why questions coming up). */ void game_why(Game *game, float dt); /* game_festival.c: the festival weekend (the last on the ground): every frame; is it this weekend (or after); the weekend starting (Friday morning); dev: on to it, or on to what's next in it; the storm shouted; the notebook's lines about it. */ /* game_bigtree.c: the big old tree around Enrico's work - the throw line, the rope, the pullers, which way it falls; left click (the rope: pull it down again / take hold); how far it is (said plainly). */ void game_bigTree(Game *game, float dt); bool game_bigTreeClick(Game *game); const char *game_bigTreeStatus(const Game *game); void game_bigTreeJump(Game *game); /* game_injury.c: somebody hurt - the ambulance, the hospital, back with a cast, the cast off; the ambulance here (no saving). */ void game_injury(Game *game, float dt); /* Dev: somebody all well again (whatever they had: the ambulance, the hospital, the cast, the sprain). */ void game_injuryHeal(Game *game, Object *o); bool game_ambulanceHere(const Game *game); /* game_touch.c: your hands and other people - E / Q (used: handled there), holding somebody (the answers 1 - 5), every frame (catching, holding on, who saw what, the place's awareness). */ void game_touchKeys(Game *game, const Input *input, bool used[2]); int game_touchChoices(const Game *game, const char *out[TALK_CHOICES]); void game_touchAnswer(Game *game, int choice); void game_touch(Game *game, float dt); #define FESTIVAL_WEEKEND 6 void game_festival(Game *game, float dt); /* game_cleanup.c: the supporters' shifts, Monday's clean-up, Kurti's look round, the drive home. */ enum { CLEAN_NONE, CLEAN_SHIFT, CLEAN_WAIT, CLEAN_ON, CLEAN_LOOK, CLEAN_TO_CAR, CLEAN_DRIVING, CLEAN_HOME }; void game_cleanup(Game *game, float dt); const char *game_cleanupTask(const Game *game); int game_cleanupNotes(const Game *game, char lines[][128], int max); /* game_meeting.c: the drive home's over - back in Grossbeerenstrasse, the end. */ void game_meetingHome(Game *game); bool game_festivalWeekend(const Game *game); void game_festivalStart(Game *game); void game_festivalJump(Game *game); const char *game_festivalJumpText(const Game *game); int game_shoutStorm(Game *game); int game_festivalNotes(const Game *game, char lines[][128], int max); const char *game_festivalTask(const Game *game); void game_callHelp(Game *game); void game_callOver(Game *game); Object *game_personInFront(const Game *game); void game_talk(Game *game, const Input *input, float dt); void game_climb(Game *game, const Input *in, float dt); void game_climbLadder(Game *game, const Input *in, float dt); void game_holdHose(Game *game); void game_handleActions(Game *game, const Input *input); void game_dev(Game *game, const Input *input); /* The story: hours on the ground counted, the crew turning up when they're due (game_story.c). */ void game_story(Game *game, float game_dt); /* H: everybody stops helping. */ static inline void dismissHelp(Game *game) { for (int i = 0; i < game->world.count; i++) { Object *o = game->world.objects[i]; if (o->type == OBJ_HUMAN && Ai_isHelping(o)) Ai_stopHelping(o); } } /* A short message in the middle of the screen. */ static inline void say(Game *game, const char *text) { game->message = text; game->message_time = MESSAGE_TIME; } /* A short line about what you're dealing with. */ static inline void tell(Game *game, const Object *o) { if (!o) return; Object_describe(o, game->info, sizeof(game->info)); game->info_about = o; say(game, game->info); } /* Adds a hint to the line shown right now. */ static inline void tellMore(Game *game, const char *more) { size_t n = game->message == game->info ? strlen(game->info) : 0; snprintf(game->info + n, sizeof(game->info) - n, "%s%s", n ? " - " : "", more); say(game, game->info); } /* Someone following the player to be shown something (SHOW_PLACE / SHOW_HOW). */ static inline Object *follower(const Game *game, Showing what) { for (int i = 0; i < game->world.count; i++) { Object *o = game->world.objects[i]; if (o->type == OBJ_HUMAN && o->ai.mode == AI_FOLLOW && o->ai.showing == what) return o; } return NULL; } #endif /* GAME_GAME_INTERNAL_H */