Crossfire Server, Trunk  1.75.0
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 
22 uint64_t shop_price_buy(const object *obj, object *who);
23 
32 uint64_t shop_price_sell(const object *obj, object *who);
33 
51 char* cost_string_from_value(uint64_t cost, int largest_coin);
52 char *cost_str(uint64_t cost);
53 
61 char *cost_approx_str(const object *obj, object *who);
62 
70 uint64_t query_money(const object *op);
71 
72 int pay_for_amount(uint64_t to_pay, object *pl);
73 int can_pay(object *pl);
74 
85 int shop_pay_unpaid(object *pl, object *op);
86 
87 int pay_for_item(object *op, object *pl, uint64_t reduction);
88 void sell_item(object *op, object *pl);
89 
98 double shop_approval(const mapstruct *map, const object *player);
99 
107 int shop_describe(const object *op);
108 
109 #endif
player
One player.
Definition: player.h:105
shop_price_buy
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.cpp:128
price_approx
uint64_t price_approx(const object *obj, object *who)
Adjust the value of the given item based on the player's skills.
Definition: shop.cpp:71
shop_describe
int shop_describe(const object *op)
Give the player a description of the shop on their current map.
Definition: shop.cpp:1144
shop_pay_unpaid
int shop_pay_unpaid(object *pl, object *op)
Pay for each unpaid item carried by a player, including those inside containers.
Definition: shop.cpp:896
cost_approx_str
char * cost_approx_str(const object *obj, object *who)
Return a textual cost approximation in a newly-allocated string.
Definition: shop.cpp:312
cost_str
char * cost_str(uint64_t cost)
Definition: shop.cpp:308
mapstruct
This is a game-map.
Definition: map.h:315
pay_for_item
int pay_for_item(object *op, object *pl, uint64_t reduction)
Player attemps to buy an item, if she has enough money then remove coins as needed from active contai...
Definition: shop.cpp:444
query_money
uint64_t query_money(const object *op)
Determine the amount of money the given object contains, including what is inside containers.
Definition: shop.cpp:373
can_pay
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.cpp:784
shop_approval
double shop_approval(const mapstruct *map, const object *player)
Return the approval ratio for a shop for a given player.
Definition: shop.cpp:1081
sell_item
void sell_item(object *op, object *pl)
Player is selling an item.
Definition: shop.cpp:915
pay_for_amount
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.cpp:404
shop_price_sell
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.cpp:154
cost_string_from_value
char * cost_string_from_value(uint64_t cost, int largest_coin)
Converts a price to number of coins.
Definition: shop.cpp:220