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 
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 
60 char* cost_string_from_value(uint64_t cost, int largest_coin);
61 char *cost_str(uint64_t cost);
62 
70 char *cost_approx_str(const object *obj, object *who);
71 
79 uint64_t query_money(const object *op);
80 
81 int pay_for_amount(uint64_t to_pay, object *pl);
82 int can_pay(object *pl);
83 
94 int shop_pay_unpaid(object *pl, object *op);
95 
96 int pay_for_item(object *op, object *pl, uint64_t reduction);
97 void sell_item(object *op, object *pl);
98 
107 double shop_approval(const mapstruct *map, const object *player);
108 
112 bool shop_contains(object *ob);
113 
121 int shop_describe(const object *op);
122 
123 #endif
player
One player.
Definition: player.h:105
price_base
uint64_t price_base(const object *obj)
Determine the base (intrinsic) value of an item.
Definition: shop.cpp:75
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:190
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:133
shop_describe
int shop_describe(const object *op)
Give the player a description of the shop on their current map.
Definition: shop.cpp:1198
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:949
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:369
cost_str
char * cost_str(uint64_t cost)
Definition: shop.cpp:365
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:501
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:430
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:841
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:1135
sell_item
void sell_item(object *op, object *pl)
Player is selling an item.
Definition: shop.cpp:968
shop_contains
bool shop_contains(object *ob)
Check if an object is in a shop.
Definition: shop.cpp:1300
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:461
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:211
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:277