AFTN.Game_state
Tracking the state of the currently-running game
type state = {
map : Map.map;
Game map
*)num_scrap : Map.room -> int;
How much scrap is in this room
has_event : Map.room -> bool;
Whether the room
has an event
room_items : Map.room -> Item.item list;
Items in the room
characters : Character.character list;
characters
s in play
active_character : Character.character option;
Currently-playing character
character_rooms : Character.character -> int;
Location of character
s in play - index into map.rooms
xeno_room : int;
Location of xenomorph - index into map.rooms
ash_room : int option;
Location of Ash, if in play - index into map.rooms
ash_health : int;
Ash's health for final mission "You Have My Sympathies"
*)ash_killed : bool;
jonesy_caught : bool;
Whether Jonesy has been caught
*)round_count : int;
How many rounds have passed
*)turn_idx : int;
How many turns have passed on this round
*)self_destruct_count : int option;
How many turns until self destruct
*)self_destruct_character : Character.character option;
On which character's turn does self-destruct counter decrease?
*)character_scraps : Character.character -> int;
Scrap per character
character_items : Character.character -> Item.item list;
Items per character
encounters : Encounter.encounter list;
Un-drawn encounter
s
discarded_encounters : Encounter.encounter list;
Discarded encounter
s
morale : int;
Team morale
*)objectives : Objective.objective list;
objective
s to complete before the final mission is revealed
cleared_objectives : Objective.objective list;
objective
s that have been cleared
final_mission : Objective.final_mission option;
What the game's final objective
is
}
Running game state
val game_state : state Stdlib.ref
Reference to the global game state
val locate_character : Character.character -> Map.room
Get room
a character
is in
val add_character : Character.character -> Map.room -> unit
Add a character
to a room
val set_character_room : Character.character -> Map.room -> unit
Set the position of a character
val get_character_scrap : Character.character -> int
Determine the number of scrap a character
has
val set_character_scrap : Character.character -> int -> unit
Set the number of scrap a character
has
val get_character_items : Character.character -> Item.item list
Get the items in a character
's inventory
val add_character_item : Character.character -> Item.item -> unit
Add an item to a character
's inventory
val remove_character_item : Character.character -> Item.item -> unit
Remove an item
from a character
's inventory
val pop_character_item : Character.character -> int -> Item.item option
Remove an item
from a character
and return it
val character_has_item : Item.item -> Character.character -> bool
Whether a character
has a specific item
in their inventory
val character_locations : unit -> (Character.character * Map.room) list
List of characters and their locations
val set_room_scrap : Map.room -> int -> unit
Set the number of scrap in a room
val set_room_has_event : Map.room -> bool -> unit
Set whether a room has an event
val has_coolant : Map.room -> bool
Check whether a room
contains coolant
Remove an item
from a room
and return it, if one exists
val discard_encounter : unit -> Encounter.encounter option
Remove the top encounter
from the list of random encounter
s
Take the top encounter
from the discarded encounter
s list and replace it in the list of random encounter
s
val get_xeno_room : unit -> Map.room
val set_xeno_room : Map.room -> unit
val set_ash_room : Map.room -> unit
val add_objective : Objective.objective -> unit
val clear_objective : Objective.objective -> unit
val start_self_destruct : int -> Character.character -> unit
val set_final_mission : Objective.final_mission -> unit
val set_turn : int -> Character.character -> unit