1 | |
|
|
2 | /* |
|
|
3 | * static char *rcsid_shop_c = |
|
|
4 | * "$Id: shop.C,v 1.14 2006/09/12 19:20:08 root Exp $"; |
|
|
5 | */ |
|
|
6 | |
|
|
7 | /* |
1 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
2 | CrossFire, A Multiplayer game for X-windows |
9 | |
3 | |
10 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
4 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
11 | Copyright (C) 1992 Frank Tore Johansen |
5 | Copyright (C) 1992 Frank Tore Johansen |
… | |
… | |
22 | |
16 | |
23 | You should have received a copy of the GNU General Public License |
17 | You should have received a copy of the GNU General Public License |
24 | along with this program; if not, write to the Free Software |
18 | along with this program; if not, write to the Free Software |
25 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | |
20 | |
27 | The authors can be reached via e-mail at crossfire-devel@real-time.com |
21 | The authors can be reached via e-mail at <crossfire@schmorp.de> |
28 | */ |
22 | */ |
29 | |
23 | |
30 | #include <global.h> |
24 | #include <global.h> |
31 | #include <spells.h> |
25 | #include <spells.h> |
32 | #include <skills.h> |
26 | #include <skills.h> |
… | |
… | |
334 | |
328 | |
335 | do |
329 | do |
336 | { |
330 | { |
337 | if (coins[*cointype] == NULL) |
331 | if (coins[*cointype] == NULL) |
338 | return NULL; |
332 | return NULL; |
339 | coin = find_archetype (coins[*cointype]); |
333 | coin = archetype::find (coins[*cointype]); |
340 | if (coin == NULL) |
334 | if (coin == NULL) |
341 | return NULL; |
335 | return NULL; |
342 | *cointype += 1; |
336 | *cointype += 1; |
343 | } |
337 | } |
344 | while (coin->clone.value > c); |
338 | while (coin->clone.value > c); |
… | |
… | |
625 | /* Fill in any gaps in the coin_objs array - needed to make change. */ |
619 | /* Fill in any gaps in the coin_objs array - needed to make change. */ |
626 | /* Note that the coin_objs array goes from least value to greatest value */ |
620 | /* Note that the coin_objs array goes from least value to greatest value */ |
627 | for (i = 0; i < NUM_COINS; i++) |
621 | for (i = 0; i < NUM_COINS; i++) |
628 | if (!coin_objs[i]) |
622 | if (!coin_objs[i]) |
629 | { |
623 | { |
630 | at = find_archetype (coins[NUM_COINS - 1 - i]); |
624 | at = archetype::find (coins[NUM_COINS - 1 - i]); |
631 | |
625 | |
632 | if (at == NULL) |
626 | if (at == NULL) |
633 | LOG (llevError, "Could not find %s archetype\n", coins[NUM_COINS - 1 - i]); |
627 | LOG (llevError, "Could not find %s archetype\n", coins[NUM_COINS - 1 - i]); |
634 | |
628 | |
635 | coin_objs[i] = arch_to_object (at); |
629 | coin_objs[i] = arch_to_object (at); |
… | |
… | |
800 | archetype *at = 0; |
794 | archetype *at = 0; |
801 | object *pouch = 0, *tmp = 0; |
795 | object *pouch = 0, *tmp = 0; |
802 | |
796 | |
803 | for (count = 0; coins[count] != NULL; count++) |
797 | for (count = 0; coins[count] != NULL; count++) |
804 | { |
798 | { |
805 | at = find_archetype (coins[count]); |
799 | at = archetype::find (coins[count]); |
806 | |
800 | |
807 | if (at == NULL) |
801 | if (at == NULL) |
808 | LOG (llevError, "Could not find %s archetype\n", coins[count]); |
802 | LOG (llevError, "Could not find %s archetype\n", coins[count]); |
809 | else if ((amount / at->clone.value) > 0) |
803 | else if ((amount / at->clone.value) > 0) |
810 | { |
804 | { |
… | |
… | |
857 | |
851 | |
858 | /* elmex: this is for the bank plugin :( */ |
852 | /* elmex: this is for the bank plugin :( */ |
859 | sint64 |
853 | sint64 |
860 | pay_player_arch (object *pl, const char *arch, sint64 amount) |
854 | pay_player_arch (object *pl, const char *arch, sint64 amount) |
861 | { |
855 | { |
862 | archetype *at = find_archetype (arch); |
856 | archetype *at = archetype::find (arch); |
863 | object *tmp = NULL; |
857 | object *tmp = NULL; |
864 | |
858 | |
865 | if (at == NULL) |
859 | if (at == NULL) |
866 | return 0; |
860 | return 0; |
867 | |
861 | |