File shop.c

* The entire shop rewrite for Circle 3.0 was done by Jeff Fink. Thanks Jeff!


Included Files


Global Variable shop_index

struct shop_data* shop_index
Visible in:  shop.c
Used in: assign_the_shopkeepers()shop.c
  boot_the_shops()shop.c
  buy_price()shop.c
  customer_string()shop.c
  get_purchase_obj()shop.c
  get_selling_obj()shop.c
  is_ok_char()shop.c
  is_open()shop.c
  list_all_shops()shop.c
  list_detailed_shop()shop.c
  ok_damage_shopkeeper()shop.c
  ok_shop_room()shop.c
  read_line()shop.c
  sell_price()shop.c
  shop_keeper()shop.c
  shop_producing()shop.c
  shopping_buy()shop.c
  shopping_list()shop.c
  shopping_sell()shop.c
  slide_obj()shop.c
  sort_keeper_objs()shop.c
  trade_with()shop.c

Global Variable top_shop

int top_shop
Visible in:  shop.c
Used in: assign_the_shopkeepers()shop.c
  boot_the_shops()shop.c
  list_all_shops()shop.c
  ok_damage_shopkeeper()shop.c
  read_line()shop.c
  shop_keeper()shop.c
  show_shops()shop.c

Global Variable cmd_say

int cmd_say
Visible in:  shop.c
Used in: assign_the_shopkeepers()shop.c
  is_ok_char()shop.c

Global Variable cmd_tell

int cmd_tell
Visible in:  shop.c
Used in: assign_the_shopkeepers()shop.c
  get_purchase_obj()shop.c
  get_selling_obj()shop.c
  is_ok_char()shop.c
  is_open()shop.c
  ok_damage_shopkeeper()shop.c
  shopping_buy()shop.c
  shopping_sell()shop.c
  shopping_value()shop.c

Global Variable cmd_emote

int cmd_emote
Visible in:  shop.c
Used in: assign_the_shopkeepers()shop.c
  shopping_buy()shop.c

Global Variable cmd_slap

int cmd_slap
Visible in:  shop.c
Used in: assign_the_shopkeepers()shop.c
  ok_damage_shopkeeper()shop.c
  shop_keeper()shop.c

Global Variable cmd_puke

int cmd_puke
Visible in:  shop.c
Used in: assign_the_shopkeepers()shop.c
  shopping_buy()shop.c

Global Variable shop_keeper

int ( shop_keeper)(struct char_data* ch,void* me,int cmd,char* argument)
Visible in:  act.other.c
   shop.c
Used in: assign_the_shopkeepers()shop.c
  do_steal()act.other.c
  ok_damage_shopkeeper()shop.c

Global Variable operator_str

const char* operator_str[]
Visible in:  shop.c
Used in: find_oper_num()shop.c

Global Variable trade_letters

const char* trade_letters[]
Visible in:  shop.c
Used in: customer_string()shop.c

Global Variable shop_bits

const char* shop_bits[]
Visible in:  shop.c
Used in: list_detailed_shop()shop.c

External Variables

mob_index
extern struct index_data* mob_index
Defined in: db.c

obj_index
extern struct index_data* obj_index
Defined in: db.c

mob_proto
extern struct char_data* mob_proto
Defined in: db.c

obj_proto
extern struct obj_data* obj_proto
Defined in: db.c

world
extern struct room_data* world
Defined in: db.c

time_info
extern struct time_info_data time_info
Defined in: db.c


Global Function add_to_list()

int add_to_list ( struct shop_buy_data* list, int type, int* len, int* val )
Prototyped in: shop.c
Calls: real_object()db.c
Called by: read_list()shop.c
  read_type_list()shop.c

Global Function assign_the_shopkeepers()

void assign_the_shopkeepers ( void )
Prototyped in: shop.c
Calls: find_command()interpreter.c
Called by: boot_db()db.c
References Variables: cmd_emoteshop.c
  cmd_pukeshop.c
  cmd_sayshop.c
  cmd_slapshop.c
  cmd_tellshop.c
  mob_indexdb.c
  shop_indexshop.c
  shop_keepershop.c
  top_shopshop.c

Global Function boot_the_shops()

void boot_the_shops ( FILE* shop_f, char* filename, int rec_count )
Prototyped in: shop.c
Calls: basic_mud_log()utils.c
  fread_string()db.c
  read_line()shop.c
  read_list()shop.c
  read_shop_message()shop.c
  read_type_list()shop.c
  real_mobile()db.c
  abort(), calloc(), free(), perror(), sprintf(), sscanf(), strstr()
Called by: index_boot()db.c
References Variables: shop_indexshop.c
  top_shopshop.c

Global Function buy_price()

int buy_price ( struct obj_data* obj, int shop_nr )
Prototyped in: shop.c
Called by: list_object()shop.c
  shopping_buy()shop.c
References Variables: shop_indexshop.c

Global Function customer_string()

char* customer_string ( int shop_nr, int detailed )
Prototyped in: shop.c
Calls: sprintf(), strcat(), strlen()
Called by: list_all_shops()shop.c
  list_detailed_shop()shop.c
References Variables: shop_indexshop.c
  trade_lettersshop.c

Global Function end_read_list()

int end_read_list ( struct shop_buy_data* list, int len, int error )
Prototyped in: shop.c
Calls: basic_mud_log()utils.c
Called by: read_list()shop.c
  read_type_list()shop.c

Global Function evaluate_expression()

int evaluate_expression ( struct obj_data* obj, char* expr )
Prototyped in: shop.c
Calls: basic_mud_log()utils.c
  evaluate_operation()shop.c
  find_oper_num()shop.c
  isname()handler.c
  pop()shop.c
  push()shop.c
  str_cmp()utils.c
  top()shop.c
  strncpy()
Called by: trade_with()shop.c
References Variables: extra_bitsconstants.c

Global Function evaluate_operation()

void evaluate_operation ( struct stack_data* ops, struct stack_data* vals )
Prototyped in: shop.c
Calls: pop()shop.c
  push()shop.c
Called by: evaluate_expression()shop.c

Global Function find_oper_num()

int find_oper_num ( char token )
Prototyped in: shop.c
Calls: strchr()
Called by: evaluate_expression()shop.c
References Variables: operator_strshop.c

Global Function get_hash_obj_vis()

struct obj_data* get_hash_obj_vis ( struct char_data* ch, char* name, struct obj_data* list )
Prototyped in: shop.c
Calls: basic_mud_log()utils.c
  is_number()interpreter.c
  same_obj()shop.c
  atoi()
Called by: get_purchase_obj()shop.c
References Variables: dummy_mobdb.c
  weather_infodb.c
  worlddb.c

Global Function get_purchase_obj()

struct obj_data* get_purchase_obj ( struct char_data* ch, char* arg, struct char_data* keeper, int shop_nr, int msg )
Prototyped in: shop.c
Calls: do_tell()act.comm.c
  extract_obj()handler.c
  get_hash_obj_vis()shop.c
  get_slide_obj_vis()shop.c
  is_number()interpreter.c
  one_argument()interpreter.c
  sprintf()
Called by: shopping_buy()shop.c
References Variables: cmd_tellshop.c
  shop_indexshop.c

Global Function get_selling_obj()

struct obj_data* get_selling_obj ( struct char_data* ch, char* name, struct char_data* keeper, int shop_nr, int msg )
Prototyped in: shop.c
Calls: basic_mud_log()utils.c
  do_tell()act.comm.c
  get_obj_in_list_vis()handler.c
  trade_with()shop.c
  sprintf()
Called by: shopping_sell()shop.c
  shopping_value()shop.c
References Variables: cmd_tellshop.c
  shop_indexshop.c

Global Function get_slide_obj_vis()

struct obj_data* get_slide_obj_vis ( struct char_data* ch, char* name, struct obj_data* list )
Prototyped in: shop.c
Calls: basic_mud_log()utils.c
  get_number()handler.c
  isname()handler.c
  same_obj()shop.c
  strcpy()
Called by: get_purchase_obj()shop.c
References Variables: dummy_mobdb.c
  weather_infodb.c
  worlddb.c

Global Function handle_detailed_list()

void handle_detailed_list ( char* buf, char* buf1, struct char_data* ch )
Prototyped in: shop.c
Calls: send_to_char()comm.c
  sprintf(), strcat(), strlen()
Called by: list_detailed_shop()shop.c

Global Function is_ok()

int is_ok ( struct char_data* keeper, struct char_data* ch, int shop_nr )
Prototyped in: shop.c
Calls: is_ok_char()shop.c
  is_open()shop.c
Called by: shopping_buy()shop.c
  shopping_list()shop.c
  shopping_sell()shop.c
  shopping_value()shop.c

Global Function is_ok_char()

int is_ok_char ( struct char_data* keeper, struct char_data* ch, int shop_nr )
Prototyped in: shop.c
Calls: basic_mud_log()utils.c
  do_say()act.comm.c
  do_tell()act.comm.c
  sprintf()
Called by: is_ok()shop.c
References Variables: cmd_sayshop.c
  cmd_tellshop.c
  dummy_mobdb.c
  shop_indexshop.c
  weather_infodb.c
  worlddb.c

Global Function is_open()

int is_open ( struct char_data* keeper, int shop_nr, int msg )
Prototyped in: shop.c
Calls: do_say()act.comm.c
  strcpy()
Called by: is_ok()shop.c
References Variables: cmd_tellshop.c
  shop_indexshop.c
  time_infodb.c

Global Function list_all_shops()

void list_all_shops ( struct char_data* ch )
Prototyped in: shop.c
Calls: customer_string()shop.c
  page_string()modify.c
  sprintf(), strcat(), strcpy(), strlen()
Called by: show_shops()shop.c
References Variables: bufdb.c
  buf1db.c
  buf2db.c
  mob_indexdb.c
  shop_indexshop.c
  top_shopshop.c

Global Function list_detailed_shop()

void list_detailed_shop ( struct char_data* ch, int shop_nr )
Prototyped in: shop.c
Calls: customer_string()shop.c
  get_char_num()handler.c
  handle_detailed_list()shop.c
  real_room()db.c
  send_to_char()comm.c
  sprintbit()utils.c
  sprintf(), strcat(), strcpy(), strlen()
Called by: show_shops()shop.c
References Variables: bufdb.c
  buf1db.c
  item_typesconstants.c
  mob_indexdb.c
  mob_protodb.c
  obj_indexdb.c
  obj_protodb.c
  shop_bitsshop.c
  shop_indexshop.c
  top_of_worlddb.c
  worlddb.c

Global Function list_object()

char* list_object ( struct obj_data* obj, int cnt, int index, int shop_nr )
Prototyped in: shop.c
Calls: CAP()utils.c
  buy_price()shop.c
  shop_producing()shop.c
  sprintf(), strcat(), strcpy(), strlen()
Called by: shopping_list()shop.c
References Variables: drinksconstants.c

Global Function ok_damage_shopkeeper()

int ok_damage_shopkeeper ( struct char_data* ch, struct char_data* victim )
Prototyped in: shop.c
Calls: do_action()act.social.c
  do_tell()act.comm.c
  sprintf()
Called by: damage()fight.c
References Variables: cmd_slapshop.c
  cmd_tellshop.c
  mob_indexdb.c
  shop_indexshop.c
  shop_keepershop.c
  top_shopshop.c

Global Function ok_shop_room()

int ok_shop_room ( int shop_nr, int room )
Prototyped in: shop.c
Called by: shop_keeper()shop.c
  show_shops()shop.c
References Variables: shop_indexshop.c

Global Function pop()

int pop ( struct stack_data* stack )
Prototyped in: shop.c
Calls: basic_mud_log()utils.c
Called by: evaluate_expression()shop.c
  evaluate_operation()shop.c

Global Function push()

void push ( struct stack_data* stack, int pushval )
Prototyped in: shop.c
Called by: evaluate_expression()shop.c
  evaluate_operation()shop.c

Global Function read_line()

void read_line ( FILE* shop_f, const char* string, void* data )
Prototyped in: shop.c
Calls: basic_mud_log()utils.c
  get_line()utils.c
  exit(), sscanf()
Called by: boot_the_shops()shop.c
  read_list()shop.c
References Variables: bufdb.c
  shop_indexshop.c
  top_shopshop.c

Global Function read_list()

int read_list ( FILE* shop_f, struct shop_buy_data* list, int new_format, int max, int type )
Prototyped in: shop.c
Calls: add_to_list()shop.c
  end_read_list()shop.c
  read_line()shop.c
Called by: boot_the_shops()shop.c
  read_type_list()shop.c

Global Function read_shop_message()

char* read_shop_message ( int mnum, room_vnum shr, FILE* shop_f, const char* why )
Calls: basic_mud_log()utils.c
  fread_string()db.c
  free()
Called by: boot_the_shops()shop.c

Global Function read_type_list()

int read_type_list ( FILE* shop_f, struct shop_buy_data* list, int new_format, int max )
Prototyped in: shop.c
Calls: add_to_list()shop.c
  end_read_list()shop.c
  read_list()shop.c
  str_dup()utils.c
  strn_cmp()utils.c
  fgets(), sscanf(), strchr(), strcpy(), strlen()
Called by: boot_the_shops()shop.c
References Variables: bufdb.c
  item_typesconstants.c

Global Function same_obj()

int same_obj ( struct obj_data* obj1, struct obj_data* obj2 )
Prototyped in: shop.c
Called by: get_hash_obj_vis()shop.c
  get_slide_obj_vis()shop.c
  shop_producing()shop.c
  shopping_buy()shop.c
  shopping_list()shop.c
  slide_obj()shop.c

Global Function sell_price()

int sell_price ( struct char_data* ch, struct obj_data* obj, int shop_nr )
Prototyped in: shop.c
Called by: shopping_sell()shop.c
  shopping_value()shop.c
References Variables: shop_indexshop.c

Global Function shop_keeper()

int ( shop_keeper) ( struct char_data* ch, void* me, int cmd, char* argument )
Calls: act()comm.c
  do_action()act.social.c
  ok_shop_room()shop.c
  shopping_buy()shop.c
  shopping_list()shop.c
  shopping_sell()shop.c
  shopping_value()shop.c
  sprintf(), strcmp()
References Variables: argdb.c
  cmd_infointerpreter.c
  cmd_slapshop.c
  shop_indexshop.c
  top_of_worlddb.c
  top_shopshop.c
  worlddb.c

Global Function shop_producing()

int shop_producing ( struct obj_data* item, int shop_nr )
Prototyped in: shop.c
Calls: same_obj()shop.c
Called by: list_object()shop.c
  shopping_buy()shop.c
  slide_obj()shop.c
  sort_keeper_objs()shop.c
References Variables: obj_protodb.c
  shop_indexshop.c

Global Function shopping_buy()

void shopping_buy ( char* arg, struct char_data* ch, struct char_data* keeper, int shop_nr )
Prototyped in: shop.c
Calls: act()comm.c
  buy_price()shop.c
  do_action()act.social.c
  do_echo()act.wizard.c
  do_tell()act.comm.c
  fname()handler.c
  get_purchase_obj()shop.c
  is_ok()shop.c
  obj_from_char()handler.c
  obj_to_char()handler.c
  read_object()db.c
  same_obj()shop.c
  send_to_char()comm.c
  shop_producing()shop.c
  sort_keeper_objs()shop.c
  times_message()shop.c
  transaction_amt()shop.c
  sprintf()
Called by: shop_keeper()shop.c
References Variables: cmd_emoteshop.c
  cmd_pukeshop.c
  cmd_tellshop.c
  shop_indexshop.c
  str_appconstants.c

Global Function shopping_list()

void shopping_list ( char* arg, struct char_data* ch, struct char_data* keeper, int shop_nr )
Prototyped in: shop.c
Calls: basic_mud_log()utils.c
  is_ok()shop.c
  isname()handler.c
  list_object()shop.c
  one_argument()interpreter.c
  page_string()modify.c
  same_obj()shop.c
  sort_keeper_objs()shop.c
  strcat(), strcpy()
Called by: shop_keeper()shop.c
References Variables: dummy_mobdb.c
  shop_indexshop.c
  weather_infodb.c
  worlddb.c

Global Function shopping_sell()

void shopping_sell ( char* arg, struct char_data* ch, struct char_data* keeper, int shop_nr )
Prototyped in: shop.c
Calls: MIN()utils.c
  act()comm.c
  do_tell()act.comm.c
  get_selling_obj()shop.c
  is_ok()shop.c
  obj_from_char()handler.c
  one_argument()interpreter.c
  sell_price()shop.c
  send_to_char()comm.c
  slide_obj()shop.c
  times_message()shop.c
  transaction_amt()shop.c
  sprintf(), strcpy()
Called by: shop_keeper()shop.c
References Variables: cmd_tellshop.c
  shop_indexshop.c

Global Function shopping_value()

void shopping_value ( char* arg, struct char_data* ch, struct char_data* keeper, int shop_nr )
Prototyped in: shop.c
Calls: do_tell()act.comm.c
  get_selling_obj()shop.c
  is_ok()shop.c
  one_argument()interpreter.c
  sell_price()shop.c
  sprintf()
Called by: shop_keeper()shop.c
References Variables: cmd_tellshop.c

Global Function show_shops()

void show_shops ( struct char_data* ch, char* arg )
Prototyped in: shop.c
Calls: is_number()interpreter.c
  list_all_shops()shop.c
  list_detailed_shop()shop.c
  ok_shop_room()shop.c
  send_to_char()comm.c
  str_cmp()utils.c
  atoi()
Called by: do_show()act.wizard.c
References Variables: top_of_worlddb.c
  top_shopshop.c
  worlddb.c

Global Function slide_obj()

struct obj_data* slide_obj ( struct obj_data* obj, struct char_data* keeper, int shop_nr )
Prototyped in: shop.c
Calls: extract_obj()handler.c
  obj_to_char()handler.c
  same_obj()shop.c
  shop_producing()shop.c
  sort_keeper_objs()shop.c
Called by: shopping_sell()shop.c
  sort_keeper_objs()shop.c
References Variables: obj_protodb.c
  shop_indexshop.c

Global Function sort_keeper_objs()

void sort_keeper_objs ( struct char_data* keeper, int shop_nr )
Prototyped in: shop.c
Calls: get_obj_in_list_num()handler.c
  obj_from_char()handler.c
  obj_to_char()handler.c
  shop_producing()shop.c
  slide_obj()shop.c
Called by: shopping_buy()shop.c
  shopping_list()shop.c
  slide_obj()shop.c
References Variables: shop_indexshop.c

Global Function times_message()

char* times_message ( struct obj_data* obj, char* name, int num )
Prototyped in: shop.c
Calls: sprintf(), strchr(), strcpy(), strlen()
Called by: shopping_buy()shop.c
  shopping_sell()shop.c

Global Function top()

int top ( struct stack_data* stack )
Prototyped in: shop.c
Called by: evaluate_expression()shop.c

Global Function trade_with()

int trade_with ( struct obj_data* item, int shop_nr )
Prototyped in: shop.c
Calls: evaluate_expression()shop.c
Called by: get_selling_obj()shop.c
References Variables: shop_indexshop.c

Global Function transaction_amt()

int transaction_amt ( char* arg )
Prototyped in: shop.c
Calls: is_number()interpreter.c
  one_argument()interpreter.c
  atoi(), strcpy(), strlen()
Called by: shopping_buy()shop.c
  shopping_sell()shop.c
References Variables: bufdb.c