Crossfire Server, Trunk  R20576
Go to the documentation of this file.
1 #ifndef _SHOP_H
2 #define _SHOP_H
12 uint64_t price_approx(const object *obj, object *who);
21 uint64_t price_base(const object *obj);
31 uint64_t shop_price_buy(const object *obj, object *who);
41 uint64_t shop_price_sell(const object *obj, object *who);
49 char* cost_string_from_value(uint64_t cost, int largest_coin);
50 char *cost_str(uint64_t cost);
59 char *cost_approx_str(const object *obj, object *who);
68 uint64_t query_money(const object *op);
70 int pay_for_amount(uint64_t to_pay, object *pl);
71 int can_pay(object *pl);
83 int shop_pay_unpaid(object *pl, object *op);
85 int pay_for_item(object *op, object *pl);
86 void sell_item(object *op, object *pl);
96 double shop_approval(const mapstruct *map, const object *player);
101 bool shop_contains(object *ob);
110 int shop_describe(const object *op);
112 #endif
Main Crossfire structure, one ingame object.
Definition: object.h:274
void sell_item(object *op, object *pl)
Player is selling an item.
Definition: shop.c:940
One player.
Definition: player.h:92
bool shop_contains(object *ob)
Check if an object is in a shop.
Definition: shop.c:1258
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.
Definition: shop.c:548
int shop_describe(const object *op)
Give the player a description of the shop on their current map.
Definition: shop.c:1156
double shop_approval(const mapstruct *map, const object *player)
Return the approval ratio for a shop for a given player.
Definition: shop.c:1097
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...
Definition: shop.c:190
char * cost_approx_str(const object *obj, object *who)
Return a textual cost approximation in a newly-allocated string.
Definition: shop.c:417
uint64_t query_money(const object *op)
Determine the amount of money the given object contains, including what is inside containers...
Definition: shop.c:478
uint64_t price_base(const object *obj)
Determine the base (intrinsic) value of an item.
Definition: shop.c:66
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_f...
Definition: shop.c:509
char * cost_str(uint64_t cost)
Definition: shop.c:413
unsigned __int64 uint64_t
Definition: win32.h:167
uint64_t price_approx(const object *obj, object *who)
Adjust the value of the given item based on the player's skills.
Definition: shop.c:126
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...
Definition: shop.c:243
char * cost_string_from_value(uint64_t cost, int largest_coin)
Return the textual representation of a cost in a newly-allocated string.
Definition: shop.c:330
int shop_pay_unpaid(object *pl, object *op)
Pay for each unpaid item carried by a player, including those inside containers.
Definition: shop.c:874
This is a game-map.
Definition: map.h:325
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 ...
Definition: shop.c:831