[crossfire] Some pending patches on tracker

Lalo Martins lalo.martins at gmail.com
Mon Jul 31 08:10:37 CDT 2006


On Sun, 30 Jul 2006 22:38:44 -0700, Mark Wedel wrote:
> Andrew Fuchs wrote:
>> On 7/29/06, Nicolas Weeger (Laposte) <nicolas.weeger at laposte.net> wrote:
>>> New coins.
>>>
>>> I see no reason to not commit'em, it makes it easier to carry money :)
>> 
>> The new coins where not meant to be given out by stores as change
>> (except possibly if the store is very rich), which happens with this
>> patch.  Before the new coins can be used someone has to modify the
>> code so the new coins are not normaly given out by stores.

There were a number of suggestions; one was what you say, another was what
Mark describes below, there was even a vague idea of national coinage.

The alternative patch that does what you ask is attached; I'm pretty sure
I put it on sourceforge somewhere, but it's easier to attach here than
look for it there.  (It probably won't attach cleanly; my crossfire tree
is months outdated, as I've been really busy.)

>   I wonder if this could be added as a new attribute to the map header, like the 
> shopitems stuff?  Something like max_denomination or the like (and if that isn't 
> set, keep the current setting of platinum/gold/silver).

I think that's a sweet idea.  It could be argued that gem shops would
usually have the higher-denomination coins in stock, at least.

>   A question could be whether that should control both what currency it
>   takes and what it gives out.

I think they should accept all kinds.  Realistically, it would be
reasonable for them to "not have change" as you say, but then again you're
always saying we don't want to get too realistic and spoil the fun :-)

best,
                                               Lalo Martins
--
      So many of our dreams at first seem impossible,
       then they seem improbable, and then, when we summon the will, they
       soon become inevitable.
--
personal:                              http://www.laranja.org/ technical:
                  http://lalo.revisioncontrol.net/ GNU: never give up
freedom                 http://www.gnu.org/



Index: server/shop.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/server/shop.c,v
retrieving revision 1.50
diff -u -r1.50 shop.c
--- server/shop.c	19 Nov 2005 21:05:30 -0000	1.50
+++ server/shop.c	27 Dec 2005 18:15:17 -0000
@@ -54,8 +54,11 @@
 static uint64 pay_from_container(object *pl, object *pouch, uint64 to_pay);
 static uint64 value_limit(uint64 val, int quantity, object *who, int isshop);
 
-#define NUM_COINS 3	/* number of coin types */
-static char *coins[] = {"platinacoin", "goldcoin", "silvercoin", NULL};
+#define NUM_COINS 5	/* number of coin types */
+#define LARGEST_COIN_GIVEN 2 /* never give amber or jade, but accept them */
+static char *coins[] = {"ambercoin", "jadecoin",
+                        "platinacoin", "goldcoin",
+                        "silvercoin", NULL};
 
 /* Added F_TRUE flag to define.h to mean that the price should not
  * be adjusted by players charisma. With F_TRUE, it returns the amount
@@ -335,7 +338,8 @@
     static char buf[MAX_BUF];
     archetype *coin, *next_coin;
     char *endbuf;
-    int num, cointype = 0;
+    int num;
+    int cointype = LARGEST_COIN_GIVEN;
 
     coin = find_next_coin(cost, &cointype);
     if (coin == NULL)
@@ -412,7 +416,8 @@
 	    if (!idskill2 || !find_skill_by_number(who, idskill2)) {
 		if (!find_skill_by_number(who,SK_BARGAINING)) {
 		    static char buf[MAX_BUF];
-		    int num, cointype = 0;
+		    int num;
+                    int cointype = LARGEST_COIN_GIVEN;
 		    archetype *coin = find_next_coin(real_value, &cointype);
 	
 		    if (coin == NULL) return "nothing";





More information about the crossfire mailing list