Game-Xomb

 view release on metacpan or  search on metacpan

lib/Game/Xomb.pm  view on Meta::CPAN


=item B<at> B<at_col> B<at_row>

These routines move the cursor around the terminal. B<at> takes
arguments in col,row (x,y) form.

=item B<apply_passives>

Floor tiles can have passive effects that can vary depending on the
duration the player is within the cell, or could be a message to the
player. See B<passive_burn>, B<passive_msg_maker>.

=item B<await_quit>

Waits for the player to quit usually from a submenu. C<$RKFN> holds the
function that read keys; these could either come from C<STDIN> or from a
save game file.

=item B<bad_terminal>

Indicates whether a terminal exists and is of suitable dimensions.

=item B<bail_out>

Called when something goes horribly wrong, usually on fatal signal or
internal error.

=item B<between>

Like C<clamp> from the Common LISP Alexandria library.

=item B<bypair> I<callback> I<list ...>

Calls the I<callback> function with pairs of items from the given
list of items.

=item B<coinflip>

Returns C<0> or C<1>. Uses the JSF random number generator (see
C<src/jsf.c>).

=item B<display_cellobjs>

Returns a string usually shown in the status bar consisting of the
C<VEGGIE> (item, if any) and C<MINERAL> (floor tile) of the cell the
player is in.

=item B<display_hitpoints>

Returns a string that prints the player's shield points in the status bar.

=item B<display_shieldup>

Returns a string that prints whether and if so what C<VEGGIE> is being
used to regenerate the shield.

=item B<distance>

Pythagorean distance between two cells, with rounding. Will differ in
some cases from the Chebyshev distance that the B<linecb> and B<walkcb>
line functions use for an iterations count.

=item B<does_hit>

Whether or not the given weapon hits at the given B<distance>, and
what the cost of that move was. The cost will be higher if the target
is out of range so that the animate will not wake up until the player
can be in range.

=item B<extract>

Removes a random element from the given array reference and returns it.
Uses the JSF random number generator (see C<src/jsf.c>).

Note that the original order of the array reference will not be
preserved. If that order is important, do not use this call. Order
preserving extraction can be done with:

  ... = splice @array, irand(scalar @array), 1;

=item B<fisher_yates_shuffle>

Shuffles an array reference in place. Uses the JSF random number
generator (see C<src/jsf.c>).

=item B<game_loop>

Entry point to the game, see C<bin/xomb> for how this gets called and
what needs to be setup before that. Loops using a simple integer
based energy system over active animates and calls the update
function for each on that gets a go, plus some complications to
change the level, etc.

=item B<game_over>

Called when the game needs to exit for various reasons mostly unrelated
to gameplay (terminal size too small, fatal signal).

=item B<generate_map>

Generates a level map around where the player is. Various knobs can be
found in C<@Level_Features>.

=item B<getkey>

Reads a key from the terminal until one in the hash of valid choices
is entered. See also C<$RKFN>.

=item B<has_amulet>

Whether the player is carrying (or has equiped) the Amulet.

=item B<has_lost>

Exits game with death screen and score.

=item B<has_won>

Exits game with win screen and score. Should be the only C<0> exit
status of the game.



( run in 0.688 second using v1.01-cache-2.11-cpan-71847e10f99 )