Crossfire Server, Trunk  R20513
Macros | Functions | Variables
shop.c File Reference

Those functions deal with shop handling, bargaining, things like that. More...

#include "global.h"
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "shop.h"
#include "sproto.h"
Include dependency graph for shop.c:

Go to the source code of this file.

Macros

#define DISAPPROVAL_RATIO   0.2
 Price a shopkeeper will give to someone they disapprove of. More...
 
#define LARGEST_COIN_GIVEN   2
 Never give amber or jade, but accept them. More...
 
#define NEUTRAL_RATIO   0.8
 Price a shopkeeper will give someone they neither like nor dislike. More...
 
#define NUM_COINS   5
 Number of coin types. More...
 
#define SPECIALISATION_EFFECT   0.5
 This is a measure of how effective store specialisation is. More...
 

Functions

static void add_value (object *coin_objs[], int64_t value)
 This function adds a given amount to a list of coins. More...
 
int can_pay (object *pl)
 Checks all unpaid items in op's inventory, adds up all the money they have, and checks that they can actually afford what they want to buy. More...
 
static bool coords_in_shop (mapstruct *map, int x, int y)
 Check if the given map coordinates are in a shop. More...
 
char * cost_approx_str (const object *tmp, object *who)
 Return a textual cost approximation in a newly-allocated string. More...
 
char * cost_str (uint64_t cost)
 
char * cost_string_from_value (uint64_t cost, int largest_coin)
 Converts a price to number of coins. More...
 
static void count_unpaid (object *pl, object *item, int *unpaid_count, uint64_t *unpaid_price, uint32_t *coincount)
 Helper function for can_pay(). More...
 
static archetypefind_next_coin (uint64_t c, int *cointype)
 Find the coin type that is worth more than 'c'. More...
 
static void insert_objects (object *pl, object *container, object *objects[], int objects_len)
 Insert a list of objects into a player object. More...
 
int pay_for_amount (uint64_t to_pay, object *pl)
 Takes the amount of money from the the player inventory and from it's various pouches using the pay_from_container() function. More...
 
int pay_for_item (object *op, object *pl)
 DAMN: This is now a wrapper for pay_from_container, which is called for the player, then for each active container that can hold money until op is paid for. More...
 
static uint64_t pay_from_container (object *pl, object *pouch, uint64_t to_pay)
 This pays for the item, and takes the proper amount of money off the player. More...
 
uint64_t price_approx (const object *tmp, object *who)
 Adjust the value of the given item based on the player's skills. More...
 
uint64_t price_base (const object *tmp)
 Determine the base (intrinsic) value of an item. More...
 
uint64_t query_money (const object *op)
 Determine the amount of money the given object contains, including what is inside containers. More...
 
static StringBufferreal_money_value (const object *coin, StringBuffer *buf)
 Returns a string representing the money's value, in plain coins. More...
 
static int64_t remove_value (object *coin_objs[], int64_t remain)
 This function removes a given amount from a list of coins. More...
 
void sell_item (object *op, object *pl)
 Player is selling an item. More...
 
double shop_approval (const mapstruct *map, const object *player)
 Return the approval ratio for a shop for a given player. More...
 
static float shop_bargain_multiplier (int lev_bargain)
 Calculate the buy price multiplier based on a player's bargaining skill. More...
 
static float shop_buy_multiplier (int charisma)
 Calculate the buy price multiplier based on a player's charisma. More...
 
bool shop_contains (object *ob)
 Check if an object is in a shop. More...
 
int shop_describe (const object *op)
 Give the player a description of the shop on their current map. More...
 
static double shop_greed (const mapstruct *map)
 Gets shop's greed. More...
 
int shop_pay_unpaid (object *pl, object *op)
 Pay for each unpaid item carried by a player, including those inside containers. More...
 
uint64_t shop_price_buy (const object *tmp, object *who)
 Adjust the value of an item to be bought based on the player's bargaining skill and charisma. More...
 
uint64_t shop_price_sell (const object *tmp, object *who)
 Adjust the value of an item to be sold based on the player's bargaining skill and charisma. More...
 
static double shop_specialisation_ratio (const object *item, const mapstruct *map)
 returns a double that is the ratio of the price that a shop will offer for item based on the shops specialisation. More...
 
static uint64_t value_limit (uint64_t val, int quantity, const object *who, int isshop)
 Limit the value of items based on the wealth of the shop. More...
 

Variables

static const char *const coins []
 Coins to use for shopping. More...
 

Detailed Description

Those functions deal with shop handling, bargaining, things like that.

Todo:
isn't there redundance with pay_for_item(), get_payment(), pay_for_amount()?

Definition in file shop.c.

Macro Definition Documentation

#define DISAPPROVAL_RATIO   0.2

Price a shopkeeper will give to someone they disapprove of.

Definition at line 42 of file shop.c.

#define LARGEST_COIN_GIVEN   2

Never give amber or jade, but accept them.

Definition at line 54 of file shop.c.

Referenced by add_value(), cost_approx_str(), cost_str(), and sell_item().

#define NEUTRAL_RATIO   0.8

Price a shopkeeper will give someone they neither like nor dislike.

Definition at line 45 of file shop.c.

Referenced by shop_approval().

#define NUM_COINS   5

Number of coin types.

Definition at line 52 of file shop.c.

Referenced by add_value(), can_pay(), cost_string_from_value(), count_unpaid(), pay_from_container(), and remove_value().

#define SPECIALISATION_EFFECT   0.5

This is a measure of how effective store specialisation is.

A general store will offer this proportion of the 'maximum' price, a specialised store will offer a range of prices around it such that the maximum price is always one therefore making this number higher, makes specialisation less effective. setting this value above 1 or to a negative value would have interesting, (though not useful) effects.

Definition at line 39 of file shop.c.

Referenced by shop_specialisation_ratio().

Function Documentation

static void add_value ( object coin_objs[],
int64_t  value 
)
static

This function adds a given amount to a list of coins.

Parameters
coin_objsthe list coins to add to; the list must be ordered from least to most valuable coin
valuethe value (in silver coins) to add

Definition at line 617 of file shop.c.

References LARGEST_COIN_GIVEN, obj::nrof, NUM_COINS, and obj::value.

Referenced by pay_from_container().

Here is the caller graph for this function:

int can_pay ( object pl)

Checks all unpaid items in op's inventory, adds up all the money they have, and checks that they can actually afford what they want to buy.

Prints appropriate messages to the player.

Parameters
plplayer trying to bug.
Return values
1player could buy the items.
0some items can't be bought.

Definition at line 812 of file shop.c.

References coins, cost_str(), count_unpaid(), draw_ext_info(), find_archetype(), obj::inv, llevError, LOG(), make_list_like(), MAX_BUF, MSG_TYPE_SHOP, MSG_TYPE_SHOP_PAYMENT, NDI_UNIQUE, NUM_COINS, PLAYER, query_money(), snprintf, and obj::type.

Referenced by cfapi_player_can_pay(), and shop_mat_type_move_on().

Here is the call graph for this function:

Here is the caller graph for this function:

static bool coords_in_shop ( mapstruct map,
int  x,
int  y 
)
static

Check if the given map coordinates are in a shop.

Definition at line 1232 of file shop.c.

References FOR_MAP_FINISH, FOR_MAP_PREPARE, and SHOP_FLOOR.

Referenced by shop_contains().

Here is the caller graph for this function:

char* cost_approx_str ( const object obj,
object who 
)

Return a textual cost approximation in a newly-allocated string.

Parameters
objitem to query the price of, must not be NULL.
whoplayer asking for the price, must not be NULL.
Returns
converted value the caller is responsible to free.

Definition at line 398 of file shop.c.

References archt::clone, cost_str(), find_next_coin(), find_skill_by_number(), get_typedata(), typedata::identifyskill, typedata::identifyskill2, LARGEST_COIN_GIVEN, MONEY, obj::name, obj::name_pl, price_approx(), real_money_value(), SK_BARGAINING, stringbuffer_append_printf(), stringbuffer_append_string(), stringbuffer_delete(), stringbuffer_finish(), stringbuffer_new(), obj::type, and obj::value.

Referenced by examine().

Here is the call graph for this function:

Here is the caller graph for this function:

char* cost_str ( uint64_t  cost)

Definition at line 394 of file shop.c.

References cost_string_from_value(), and LARGEST_COIN_GIVEN.

Referenced by can_pay(), cost_approx_str(), examine(), pick_up_object(), sell_item(), shop_describe(), and shop_pay_unpaid().

Here is the call graph for this function:

Here is the caller graph for this function:

char* cost_string_from_value ( uint64_t  cost,
int  largest_coin 
)

Converts a price to number of coins.

Return the textual representation of a cost in a newly-allocated string.

While cost is 64 bit, the number of any coin is still really limited to 32 bit (size of nrof field). If it turns out players have so much money that they have more than 2 billion platinum coins, there are certainly issues - the easiest fix at that time is to add a higher denomination (mithril piece with 10,000 silver or something)

Parameters
costvalue to transform to currency.
largest_coinmaximum coin to give the price into, should be between 0 and NUM_COINS - 1.
bufbuffer to append to, if NULL a new one is returned.
Returns
buffer containing the price, either buf or if NULL a new StringBuffer.

Definition at line 311 of file shop.c.

References archt::clone, find_next_coin(), obj::name, NUM_COINS, stringbuffer_append_printf(), stringbuffer_append_string(), stringbuffer_finish(), stringbuffer_new(), and obj::value.

Referenced by cfapi_cost_string_from_value(), and cost_str().

Here is the call graph for this function:

Here is the caller graph for this function:

static void count_unpaid ( object pl,
object item,
int *  unpaid_count,
uint64_t unpaid_price,
uint32_t coincount 
)
static

Helper function for can_pay().

Checks all items from item and item->below, and recurse if inventory found. coincount is supposed to be of size NUM_COINS. Parameters can't be NULL.

Parameters
plplayer.
itemitem to check for.
[out]unpaid_counthow many unpaid items are left.
[out]unpaid_pricetotal price unpaid.
coincountarray of NUM_COINS size, will contain how many coins of the type the player has.

Definition at line 778 of file shop.c.

References obj::arch, coins, FLAG_UNPAID, FOR_OB_AND_BELOW_FINISH, FOR_OB_AND_BELOW_PREPARE, obj::inv, archt::name, obj::nrof, NUM_COINS, QUERY_FLAG, and shop_price_buy().

Referenced by can_pay().

Here is the call graph for this function:

Here is the caller graph for this function:

static archetype* find_next_coin ( uint64_t  c,
int *  cointype 
)
static

Find the coin type that is worth more than 'c'.

Starts at the cointype placement.

Parameters
cvalue we're searching.
cointypefirst coin type to search.
Returns
coin archetype, NULL if none found.

Definition at line 277 of file shop.c.

References archt::clone, coins, find_archetype(), and obj::value.

Referenced by cost_approx_str(), and cost_string_from_value().

Here is the call graph for this function:

Here is the caller graph for this function:

static void insert_objects ( object pl,
object container,
object objects[],
int  objects_len 
)
static

Insert a list of objects into a player object.

Parameters
plthe player to add to
containerthe container (inside the player object) to add to
objectsthe list of objects to add; the objects will be either inserted into the player object or freed
objects_lenthe length of objects

Definition at line 641 of file shop.c.

References esrv_update_item(), object_free_drop_inventory(), object_insert_in_ob(), and UPD_WEIGHT.

Referenced by pay_from_container().

Here is the call graph for this function:

Here is the caller graph for this function:

int pay_for_amount ( uint64_t  to_pay,
object pl 
)

Takes the amount of money from the the player inventory and from it's various pouches using the pay_from_container() function.

Parameters
to_payamount to pay.
plplayer paying.
Returns
0 if not enough money, in which case nothing is removed, 1 if money was removed.
Todo:
check if pl is a player, as query_money() expects that. Check if fix_object() call is required.

Definition at line 490 of file shop.c.

References CONTAINER, fix_object(), FLAG_APPLIED, FMT64U, FOR_INV_FINISH, FOR_INV_PREPARE, llevError, LOG(), pay_from_container(), QUERY_FLAG, and query_money().

Referenced by cfapi_object_pay_amount().

Here is the call graph for this function:

Here is the caller graph for this function:

int pay_for_item ( object op,
object pl 
)

DAMN: This is now a wrapper for pay_from_container, which is called for the player, then for each active container that can hold money until op is paid for.

Change will be left wherever the last of the price was paid from.

Parameters
opobject to buy.
plplayer buying.
Returns
1 if object was bought, 0 else.
Todo:
check if pl is a player, as query_money() expects a player.

Definition at line 529 of file shop.c.

References change_exp(), CONTAINER, FALSE, fix_object(), FLAG_APPLIED, FLAG_WAS_WIZ, FMT64U, FOR_INV_FINISH, FOR_INV_PREPARE, llevError, LOG(), pay_from_container(), price_base(), QUERY_FLAG, query_money(), Settings::real_wiz, SET_FLAG, settings, shop_price_buy(), and SK_EXP_NONE.

Referenced by cfapi_object_pay_item(), and shop_pay_unpaid().

Here is the call graph for this function:

Here is the caller graph for this function:

static uint64_t pay_from_container ( object pl,
object pouch,
uint64_t  to_pay 
)
static

This pays for the item, and takes the proper amount of money off the player.

DAMN: This function is used for the player, then for any active containers that can hold money.

Parameters
plplayer paying.
pouchcontainer (pouch or player) to remove the coins from.
to_payrequired amount.
Returns
amount still not paid after using "pouch".

Definition at line 672 of file shop.c.

References add_value(), archt::clone, coins, CONTAINER, find_archetype(), FOR_INV_FINISH, FOR_INV_PREPARE, insert_objects(), llevError, LOG(), MONEY, obj::name, obj::nrof, NUM_COINS, object_copy(), object_free_drop_inventory(), object_new(), object_remove(), PLAYER, remove_value(), obj::type, and obj::value.

Referenced by pay_for_amount(), and pay_for_item().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t price_approx ( const object obj,
object who 
)

Adjust the value of the given item based on the player's skills.

This function should only be used when calculating "you reckon" prices.

Parameters
objitem in question. Must not be NULL.
whoplayer trying to judge the value of the item. Must not be NULL.
Returns
approximate value of tmp.

Definition at line 107 of file shop.c.

References obj::count, find_skill_by_number(), get_typedata(), typedata::identifyskill, typedata::identifyskill2, obj::level, llevError, LOG(), obj::name, price_base(), and obj::type.

Referenced by cost_approx_str().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t price_base ( const object obj)

Determine the base (intrinsic) value of an item.

This should not include adjustments such as bargaining, charisma, or shop specialization.

Parameters
objitem in question.
Returns
base price.

Definition at line 66 of file shop.c.

References obj::arch, archt::clone, FLAG_CURSED, FLAG_DAMNED, liv::food, GEM, obj::magic, MONEY, obj::nrof, object_get_value(), QUERY_FLAG, obj::stats, obj::type, obj::value, and WAND.

Referenced by alchemy_object(), attempt_do_alchemy(), check_pick(), pay_for_item(), price_approx(), sell_item(), shop_price_buy(), and shop_price_sell().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t query_money ( const object op)

Determine the amount of money the given object contains, including what is inside containers.

Parameters
opPlayer or container object
Returns
Total amount of money inside

Definition at line 459 of file shop.c.

References CONTAINER, FLAG_APPLIED, FOR_INV_FINISH, FOR_INV_PREPARE, llevError, LOG(), MONEY, PLAYER, QUERY_FLAG, and obj::type.

Referenced by can_pay(), cfapi_object_query_money(), pay_for_amount(), pay_for_item(), and shop_pay_unpaid().

Here is the call graph for this function:

Here is the caller graph for this function:

static StringBuffer* real_money_value ( const object coin,
StringBuffer buf 
)
static

Returns a string representing the money's value, in plain coins.

Parameters
coincoin. Must be of type MONEY.
bufbuffer to append to. Must not be NULL.
Returns
buf with the value.

Definition at line 386 of file shop.c.

References MONEY, obj::name, obj::name_pl, obj::nrof, stringbuffer_append_printf(), and obj::type.

Referenced by cost_approx_str().

Here is the call graph for this function:

Here is the caller graph for this function:

static int64_t remove_value ( object coin_objs[],
int64_t  remain 
)
static

This function removes a given amount from a list of coins.

Parameters
coin_objsthe list coins to remove from; the list must be ordered from least to most valuable coin.
remainthe value (in silver coins) to remove
Returns
the value remaining

Definition at line 576 of file shop.c.

References obj::nrof, NUM_COINS, and obj::value.

Referenced by pay_from_container().

Here is the caller graph for this function:

void sell_item ( object op,
object pl 
)

Player is selling an item.

Give money, print appropriate messages.

This function uses the coins[] array to know what coins are available.

Modified to fill available race: gold containers before dumping remaining coins in character's inventory.

Parameters
opobject to sell.
plplayer. Shouldn't be NULL or non player.

Definition at line 921 of file shop.c.

References change_exp(), archt::clone, coins, CONTAINER, cost_str(), obj::custom_name, draw_ext_info_format(), esrv_update_item(), EVENT_SELLING, execute_event(), find_archetype(), FLAG_APPLIED, FLAG_UNPAID, FOR_INV_FINISH, FOR_INV_PREPARE, FREE_AND_CLEAR_STR, identify(), LARGEST_COIN_GIVEN, llevDebug, llevError, LOG(), MAX_BUF, MSG_TYPE_SHOP, MSG_TYPE_SHOP_SELL, NDI_UNIQUE, obj::nrof, object_copy(), object_insert_in_ob(), object_new(), PLAYER, price_base(), QUERY_FLAG, query_name(), SCRIPT_FIX_ALL, SET_FLAG, shop_price_sell(), SK_EXP_NONE, obj::type, UPD_WEIGHT, obj::value, and obj::weight.

Referenced by drop_object().

Here is the call graph for this function:

Here is the caller graph for this function:

double shop_approval ( const mapstruct map,
const object player 
)

Return the approval ratio for a shop for a given player.

This is based on both the race of the shopkeeper and the player.

Parameters
mapMap with a shop
playerPlayer in question
Returns
Approval ratio between 0 and 1

Definition at line 1078 of file shop.c.

References NEUTRAL_RATIO, obj::race, and mapdef::shoprace.

Referenced by shop_describe(), shop_mat_type_move_on(), shop_price_buy(), and shop_price_sell().

Here is the caller graph for this function:

static float shop_bargain_multiplier ( int  lev_bargain)
static

Calculate the buy price multiplier based on a player's bargaining skill.

The reciprocal of this result can be used as a sell multiplier.

Parameters
lev_bargainplayer's bargaining level.
Returns
buy multiplier between 1 and 0.5.

Definition at line 167 of file shop.c.

References Settings::max_level, and settings.

Referenced by shop_price_buy().

Here is the caller graph for this function:

static float shop_buy_multiplier ( int  charisma)
static

Calculate the buy price multiplier based on a player's charisma.

Parameters
charismaplayer's charisma.
Returns
buy multiplier between 2 and 0.5.

Definition at line 148 of file shop.c.

Referenced by shop_price_buy().

Here is the caller graph for this function:

bool shop_contains ( object ob)

Check if an object is in a shop.

Definition at line 1239 of file shop.c.

References coords_in_shop(), obj::map, obj::x, and obj::y.

Referenced by convert_item(), drop_object(), examine(), kill_player_not_permadeath(), shop_mat_type_move_on(), and transport_type_apply().

Here is the call graph for this function:

Here is the caller graph for this function:

int shop_describe ( const object op)

Give the player a description of the shop on their current map.

This is used for the bargaining skill.

Parameters
opNon-null player to describe the shop to
Returns
Zero if the object is not a player, 1 otherwise

Definition at line 1137 of file shop.c.

References cost_str(), draw_ext_info(), draw_ext_info_format(), shopitem::index, make_list_like(), obj::map, MAX_BUF, MSG_TYPE_SHOP, MSG_TYPE_SHOP_LISTING, MSG_TYPE_SHOP_MISC, shopitem::name, shopitem::name_pl, NDI_UNIQUE, PLAYER, shop_approval(), mapdef::shopgreed, mapdef::shopitems, mapdef::shopmax, mapdef::shopmin, mapdef::shoprace, snprintf, shopitem::strength, and obj::type.

Referenced by do_skill().

Here is the call graph for this function:

Here is the caller graph for this function:

static double shop_greed ( const mapstruct map)
static

Gets shop's greed.

Parameters
mapmap to get greed.
Returns
greed of the shop on map, or 1 if it isn't specified.

Definition at line 1070 of file shop.c.

References mapdef::shopgreed.

Referenced by shop_price_buy(), and shop_price_sell().

Here is the caller graph for this function:

int shop_pay_unpaid ( object pl,
object op 
)

Pay for each unpaid item carried by a player, including those inside containers.

It is a good idea to call can_pay() before using this function, because items are paid for here in no particular order.

Parameters
plPlayer making purchase
opContainer to examine, usually the same player object
Return values
0Player still has unpaid items
1Player paid for all unpaid items

Definition at line 855 of file shop.c.

References obj::below, CLEAR_FLAG, cost_str(), draw_ext_info_format(), esrv_update_item(), FLAG_PLAYER_SOLD, FLAG_UNPAID, obj::inv, MAX_BUF, MSG_TYPE_SHOP, MSG_TYPE_SHOP_PAYMENT, NDI_UNIQUE, object_merge(), pay_for_item(), PLAYER, QUERY_FLAG, query_money(), query_name(), SET_FLAG, shop_price_buy(), obj::type, UPD_FLAGS, and UPD_NAME.

Referenced by shop_mat_type_move_on().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t shop_price_buy ( const object obj,
object who 
)

Adjust the value of an item to be bought based on the player's bargaining skill and charisma.

This should only be used if the player is in a shop.

Parameters
objitem in question. Must not be NULL.
whoplayer trying to judge the value of the item. Must not be NULL.
Returns
value of tmp.

Definition at line 171 of file shop.c.

References liv::Cha, find_skill_by_number(), FLAG_PLAYER_SOLD, GEM, obj::level, obj::map, object_get_value(), PLAYER, price_base(), QUERY_FLAG, shop_approval(), shop_bargain_multiplier(), shop_buy_multiplier(), shop_greed(), shop_specialisation_ratio(), SK_BARGAINING, obj::stats, and obj::type.

Referenced by count_unpaid(), examine(), pay_for_item(), pick_up_object(), and shop_pay_unpaid().

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t shop_price_sell ( const object obj,
object who 
)

Adjust the value of an item to be sold based on the player's bargaining skill and charisma.

This should only be used if the player is in a shop.

Parameters
objitem in question. Must not be NULL.
whoplayer trying to judge the value of the item. Must not be NULL.
Returns
value of tmp.

Definition at line 224 of file shop.c.

References obj::arch, FLAG_BEEN_APPLIED, FLAG_IDENTIFIED, GEM, obj::map, need_identify(), obj::nrof, object_get_value(), PLAYER, price_base(), QUERY_FLAG, shop_approval(), shop_greed(), shop_specialisation_ratio(), obj::type, and value_limit().

Referenced by examine(), sell_item(), and START_TEST().

Here is the call graph for this function:

Here is the caller graph for this function:

static double shop_specialisation_ratio ( const object item,
const mapstruct map 
)
static

returns a double that is the ratio of the price that a shop will offer for item based on the shops specialisation.

Does not take account of greed, returned value is between (2*SPECIALISATION_EFFECT-1) and 1 and in any event is never less than 0.1 (calling functions divide by it)

Parameters
itemitem to get ratio of.
mapshop map.
Returns
ratio specialisation for the item.

Definition at line 1025 of file shop.c.

References shopitem::index, llevDebug, llevError, LOG(), mapdef::path, mapdef::shopitems, SPECIALISATION_EFFECT, shopitem::strength, obj::type, and shopitem::typenum.

Referenced by shop_price_buy(), and shop_price_sell().

Here is the call graph for this function:

Here is the caller graph for this function:

static uint64_t value_limit ( uint64_t  val,
int  quantity,
const object who,
int  isshop 
)
static

Limit the value of items based on the wealth of the shop.

If the item is close to the maximum value a shop will offer, we start to reduce it, if the item is below the minimum value the shop is prepared to trade in, then we don't want it and offer nothing. If it isn't a shop, check whether we should do generic value reduction.

Parameters
valcurrent price.
quantitynumber of items.
whoplayer selling.
isshop0 if not a shop, 1 if a shop.
Returns
maximum global value.

Definition at line 1108 of file shop.c.

References isqrt(), llevError, LOG(), obj::map, MIN, obj::name, mapdef::shopmax, and mapdef::shopmin.

Referenced by shop_price_sell().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const char* const coins[]
static
Initial value:
= {
"ambercoin",
"jadecoin",
"platinacoin",
"goldcoin",
"silvercoin",
NULL
}

Coins to use for shopping.

Definition at line 57 of file shop.c.

Referenced by can_pay(), count_unpaid(), find_next_coin(), pay_from_container(), and sell_item().