Module AFTN.Game_loop

Main game loop and player actions

val win_game : unit -> 'a
val lose_game : ?game_over:bool -> string -> 'a
val setup_game : int -> bool -> unit

Set up the game state given user preferences

val complete_objective : Objective.objective_kind Objective.goal -> unit
val setup_final_mission : Character.character -> unit
val update_final_mission : unit -> unit

Check if final mission criteria have been met, win game if so

val update_objectives : Character.character -> unit

Check uncleared objectives and clear them if conditions are met

val see_objectives : unit -> unit
val reduce_morale : int -> bool -> unit

Reduce morale by n and check for morale-loss-reduction items and game over

val character_move : Character.character -> Map.room list -> bool -> Map.room option

Prompt player for room to move to, return None if action canceled

val flee : Character.character -> unit

Force a character to move 3 spaces away

val xeno_move : int -> int -> bool

Move the xenomorph closer to the closest team member

val check_ash_health : unit -> unit
val ash_move : int -> unit
type action =
  1. | Move
  2. | PickUp
  3. | Drop
  4. | Ability
  5. | ViewInventory
  6. | ViewTeam
  7. | Craft
  8. | UseItem
  9. | TradeItem
  10. | EndTurn
  11. | ViewRoom
  12. | SeeObjectives
  13. | DrawMap
  14. | Exit

Possible turn actions

val string_of_action : action -> string

Get printable string representation of an action

val actions : action list

List of actions to choose from

val single_player_actions : action list
val action_select_chars : char list
val single_player_action_select_chars : char list
val pickup : Character.character -> bool

Prompt player for item/scrap to pick up. If an item is selected, true is returned to indicate the turn is over, otherwise false.

val drop : Character.character -> bool

Prompt the user to drop an item in the room they are located in

val view_inventory : ?print_name:bool -> ?print_location:bool -> Character.character -> unit

Show the active character's inventory

val view_team : unit -> unit

Show the team's morale and inventories

val craft : Character.character -> bool

Prompt the user to craft an item with scrap and add it to the active character's inventory

val perform_trade : Character.character -> Character.character -> bool

Performs the trade action between two characters

val trade_item : Character.character -> bool

Prompt user to trade items with another character

val use : Character.character -> bool
val view_room : Character.character -> unit

Print out room information

val trigger_encounter : Character.character -> unit

Draw an encounter card and execute it

val use_ability : Character.character -> bool * bool

Prompt player to use a character's ability. Return whether the ability was used and whether it can be used again this turn

val game_start : unit -> unit

Main game entry point

val turn : int -> Character.character -> unit
val game_loop : unit -> unit

Main game loop