[Package Index | Mudlib Index | Effect Index]

File /obj/music/sheet_music.c

An inherit for sheet music. Can be used with books or paper and the actual skills testing is handled by the musical instrument.

Written by Kaylar

Started July 2004

Method index

Public Functions

These are functions that everyone can access.

add_music
void add_music(int page_number,
               string * messages)

This function adds music to the sheet music

Parameters:
page_number - If used with paper the page number should be set to 0, if used with a book the number should correspond to the page you wish the music to appear on
*messages - An array of eight messages and one difficulty level. Firstly successes from marginal to critical then failures from marginal to critical. Should suit "Womble plays from on his guitar.". All eight messages need to be included. The last part of the array should be the difficulty level of the music, either "easy", "medium", "difficult" or "expert". Tunes in primers will automatically be less difficult than other types of music

See also:
query_music()

Example:
 add_music( 4, ({ "a bar of Three Blind Mice", "Three Blind Mice",
   "an upbeat version of Three Blind Mice", "an moving rendition of "
   "Three Blind Mice", "something that sounds similar to Three Blind "
   "Mice", "a terrible noise", "a few horrible bars of something",
   "something that could be Three Blind Mice wishing they were Three "
   "Deaf Mice", "easy" }) );
query_instrument
string query_instrument()

This returns the name or the path of the instrument the sheet music can be played with

Returns:
the path or name of the instrument

See also:
set_instrument()

query_instrument_type
string query_instrument_type()

This returns the type of instrument that can be used with the sheet music

Returns:
the type of instrument; percussion, wind, stringed or keyboard

See also:
set_instrument_type()

query_music
string * query_music(int page_number)

This returns the messages associated with the page number.

Returns:
the musical messages associated with that page

See also:
add_music()

query_primer
int query_primer()

This returns a non-zero if the sheet music is a primer.

Returns:
1 if the book is a primer.

See also:
set_primer()

query_sheet_music
int query_sheet_music()

This is always true.

Returns:
1, it is sheet music.

set_instrument
void set_instrument(string instrument)

This function sets a specific instrument the sheet music can be used with

Parameters:
instrument - The name or path of the instrument the sheet music can be used with

See also:
query_instrument()

Example:
set_instrument( "/obj/music/instruments/wind/flute" );

set_instrument( "drum" );
set_instrument_type
void set_instrument_type(string type)

This function sets the instrument type the sheet music can be played by. This must be set. If you then want to limit it to one instrument, use set_instrument()

Parameters:
type - The type of instrument the sheet music can be used with, should be percussion, wind, stringed or keyboard

See also:
query_instrument_type()

Example:
set_instrument_type( "wind" );
set_primer
void set_primer(int i)

This function sets whether the sheet music is a primer.

See also:
query_primer()