Crossfire Server, Trunk  R20513
shop.h
Go to the documentation of this file.
1 #ifndef _SHOP_H
2 #define _SHOP_H
3 
12 uint64_t price_approx(const object *obj, object *who);
13 
21 uint64_t price_base(const object *obj);
22 
31 uint64_t shop_price_buy(const object *obj, object *who);
32 
41 uint64_t shop_price_sell(const object *obj, object *who);
42 
49 char* cost_string_from_value(uint64_t cost, int largest_coin);
50 char *cost_str(uint64_t cost);
51 
59 char *cost_approx_str(const object *obj, object *who);
60 
68 uint64_t query_money(const object *op);
69 
70 int pay_for_amount(uint64_t to_pay, object *pl);
71 int can_pay(object *pl);
72 
83 int shop_pay_unpaid(object *pl, object *op);
84 
85 int pay_for_item(object *op, object *pl);
86 void sell_item(object *op, object *pl);
87 
96 double shop_approval(const mapstruct *map, const object *player);
97 
101 bool shop_contains(object *ob);
102 
110 int shop_describe(const object *op);
111 
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:921
One player.
Definition: player.h:92
bool shop_contains(object *ob)
Check if an object is in a shop.
Definition: shop.c:1239
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:529
int shop_describe(const object *op)
Give the player a description of the shop on their current map.
Definition: shop.c:1137
double shop_approval(const mapstruct *map, const object *player)
Return the approval ratio for a shop for a given player.
Definition: shop.c:1078
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:171
char * cost_approx_str(const object *obj, object *who)
Return a textual cost approximation in a newly-allocated string.
Definition: shop.c:398
uint64_t query_money(const object *op)
Determine the amount of money the given object contains, including what is inside containers...
Definition: shop.c:459
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:490
char * cost_str(uint64_t cost)
Definition: shop.c:394
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:107
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:224
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:311
int shop_pay_unpaid(object *pl, object *op)
Pay for each unpaid item carried by a player, including those inside containers.
Definition: shop.c:855
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:812