[Package Index | Mudlib Index | Effect Index]

File /obj/state_peddler.c

It's a walking, talking, singing, dancing, state engine of selling +5!

Written by Terano

Started 12/07/2003

Inherits

This class inherits the following classes /obj/monster.c

Includes

This class includes the following files /include/money.h and /include/shops/bank.h

Class Index

Method index

Public Functions

These are functions that everyone can access.

add_buy_triggers
void add_buy_triggers(mixed arg)
add_collect_triggers
void add_collect_triggers(mixed arg)
add_list_triggers
void add_list_triggers(mixed arg)
add_option
int add_option(string sales_name,
               string sales_text,
               string * responses)
add_stop_triggers
void add_stop_triggers(mixed arg)
calculate_cost
int calculate_cost(mapping _data)
confirm_order
void confirm_order(object speaker,
                   string info)
end_free_text_edit
void end_free_text_edit(string mess)
event_death
void event_death(object thing,
                 object * arr,
                 object killer,
                 string room_mess,
                 string killer_mess)
event_exit
void event_exit(object ob,
                string message,
                object to)
flavour_abort_sale
void flavour_abort_sale(object speaker)
flavour_bad_free_text
void flavour_bad_free_text(object writer)
flavour_buy_ordered
void flavour_buy_ordered(object speaker)
flavour_collect_busy
void flavour_collect_busy(object speaker)
flavour_could_not_give
void flavour_could_not_give(object thing)
flavour_end_collection
void flavour_end_collection(object speaker)
flavour_end_sale
void flavour_end_sale(int cost)
flavour_fetch_item
void flavour_fetch_item(mapping _data)
flavour_finalize_sale
void flavour_finalize_sale(object speaker)
flavour_list
void flavour_list()
flavour_next_stage
void flavour_next_stage(object speaker)
flavour_no_money
void flavour_no_money(object speaker,
                      int cost)
flavour_no_order
void flavour_no_order(object speaker)
flavour_not_ready
void flavour_not_ready(object speaker,
                       mapping _data)
flavour_offer_choices
void flavour_offer_choices(string choice_name,
                           string * all_choices)
flavour_offer_free_text
void flavour_offer_free_text(string choice_name)
flavour_request_confirmation
void flavour_request_confirmation(object speaker,
                                  mapping _data)
flavour_selection_made
void flavour_selection_made(string selection)
flavour_set_free_text
void flavour_set_free_text(object writer,
                           string mess)
flavour_short_free_text
void flavour_short_free_text(object writer)
flavour_start_busy
void flavour_start_busy(object speaker)
flavour_start_buy
void flavour_start_buy(object speaker)
flavour_start_dead
void flavour_start_dead(object speaker)
flavour_stop_not_buyer
void flavour_stop_not_buyer(object speaker)
flavour_user_died
void flavour_user_died(object speaker)
flavour_user_left
void flavour_user_left()
generate_object
object generate_object(mapping _data,
                       object speaker)
initialise_peddler
void initialise_peddler()
prepare_confirmation
void prepare_confirmation()
query_current_choices
string * query_current_choices()
query_options
class option * query_options()
query_spiel_position
int query_spiel_position()
remove_buy_trigger
void remove_buy_trigger(mixed trigger)

This function will remove a buy trigger from the peddler - the argument is the trigger to remove, either as an array or a string (which will be converted).

This is useful e.g. if you have two peddlers in the same room and don't want them both to respond to someone saying 'buy'. You'll have to specify more exactly what will trigger the start_buy() function, though, e.g. with add_buy_triggers( ".*buy.*vegetables.*" ); in one of the peddlers and add_buy_triggers( ".*buy.*fruit.*" ); in the other.



Parameters:
trigger - This is the trigger, e.g. ".*buy.*".

See also:
nothing .c


remove_collect_trigger
void remove_collect_trigger(mixed trigger)

This function will remove a collect trigger from the peddler - the argument is the trigger to remove, either as an array or a string (which will be converted).

This is useful e.g. if you have two peddlers in the same room and don't want them both to respond to someone saying 'collect'. You'll have to specify more exactly what will trigger the start_collect() function, though, e.g. with add_collect_triggers( ".*collect.*vegetables.*" ); in one of the peddlers and add_collect_triggers( ".*collect.*fruit.*" ); in the other.



Parameters:
trigger - This is the trigger, e.g. ".*collect.*".

See also:
nothing .c


remove_list_trigger
void remove_list_trigger(mixed trigger)

This function will remove a list trigger from the peddler - the argument is the trigger to remove, either as an array or a string (which will be converted).

This is useful e.g. if you have two peddlers in the same room and don't want them both to respond to someone saying 'list'. You'll have to specify more exactly what will trigger the start_list() function, though, e.g. with add_list_triggers( ".*list.*vegetables.*" ); in one of the peddlers and add_list_triggers( ".*list.*fruit.*" ); in the other.



Parameters:
trigger - This is the trigger, e.g. ".*list.*".

See also:
nothing .c


remove_stop_trigger
void remove_stop_trigger(mixed trigger)

This function will remove a stop trigger from the peddler - the argument is the trigger to remove, either as an array or a string (which will be converted).

This is useful e.g. if you have two peddlers in the same room and don't want them both to respond to someone saying 'stop'. You'll have to specify more exactly what will trigger the start_stop() function, though, e.g. with add_stop_triggers( ".*stop.*vegetables.*" ); in one of the peddlers and add_stop_triggers( ".*stop.*fruit.*" ); in the other.



Parameters:
trigger - This is the trigger, e.g. ".*stop.*".

See also:
nothing .c


response
void response(object speaker,
              string info)
set_for_option
void set_for_option(int pos)
set_location
string set_location(string loc)
set_peddler_time
void set_peddler_time(int number)
sort_stuff
int sort_stuff(mixed arg1,
               mixed arg2)
start_buy
void start_buy(object speaker)
start_collect
void start_collect(object speaker,
                   string info)
start_list
void start_list(object speaker,
                string info)
stop
void stop(object speaker)
test_serve_customer
int test_serve_customer(object customer)

Classes

These are nice data types for dealing with... Data!