Index: object1.c
===================================================================
RCS file: /Home/stud/stig/hovedfag/CVS/angband/src/object1.c,v
retrieving revision 1.1
diff -u -r1.1 object1.c
--- object1.c	2001/05/04 18:09:41	1.1
+++ object1.c	2001/06/16 17:32:46
@@ -244,6 +244,58 @@
 
 
 
+struct slime_entry {
+    cptr desc;
+    byte colour;
+    cptr name;
+};
+
+#define MAX_SLIME_ENTRIES 31
+
+/* names are not connected to the flavour but the same table is used
+   for convenience */
+
+static struct slime_entry slime_entries[MAX_SLIME_ENTRIES] = {
+    { "Aubergine", TERM_RED , "Anastacia"},
+    { "Barbecue", TERM_L_UMBER, "Darth"},
+    { "Banana", TERM_YELLOW , "Aragorn"},
+    { "Blueberry" , TERM_BLUE , "Augustin"},
+    { "Caramel", TERM_UMBER, "Faust" },
+    { "Carrot", TERM_ORANGE, "Bugs" },
+    { "Cheese", TERM_YELLOW, "Jerry" },
+    { "Chocolate" , TERM_UMBER, "Anthony" },
+    { "Crunchy" , TERM_L_BLUE , "Gumby"},
+    { "Garlic", TERM_L_WHITE, "Vlad" }, 
+    { "Grape", TERM_BLUE, "Fufie"},
+    { "Lemon", TERM_YELLOW, "Wittgenstein" },
+    { "Meat", TERM_UMBER, "Muhammed" },
+    { "Mint" , TERM_L_BLUE, "James" },
+    { "Octopus", TERM_L_DARK, "Machiavelli" },
+    { "Orange", TERM_ORANGE, "Tom"},
+    { "Passionfruit", TERM_GREEN, "Buffy" }, 
+    { "Peanut", TERM_L_UMBER, "Descartes" },
+    { "Pear", TERM_GREEN, "Pavarotti"},
+    { "Pepperoni", TERM_UMBER, "Jesus" },
+    { "Pineapple", TERM_YELLOW, "St. Ignucius" },
+    { "Potato", TERM_UMBER, "Quayle"},
+    { "Prawn", TERM_L_RED, "John" },
+    { "Raspberry", TERM_RED, "Howard" },
+    { "Spinach", TERM_GREEN, "Popeye"},
+    { "Spearmint", TERM_L_BLUE, "Socrates" },
+    { "Sushi", TERM_L_WHITE, "Hara-kiri" },
+    { "Strawberry", TERM_RED, "Buzz" },
+    { "Tangy", TERM_YELLOW, "Dubya"},
+    { "Vanilla", TERM_L_WHITE, "Al"},
+    { "Yoghurt", TERM_WHITE, "ZsaZsa"}
+};
+    
+static void
+name_slime_mold(object_type *o_ptr) {
+
+    int value = rand_int(MAX_SLIME_ENTRIES);
+    o_ptr->note = quark_add(slime_entries[value].name);
+  
+}
 
 
 /*
@@ -1210,15 +1262,41 @@
 		/* Food */
 		case TV_FOOD:
 		{
-			/* Ordinary food is "boring" */
-			if (o_ptr->sval >= SV_FOOD_MIN_FOOD) break;
 
+		    /* Name molds */
+		    if (o_ptr->sval == SV_FOOD_SLIME_MOLD) {
+			int the_num = 0;
+			int def_nutr_val = 3000;
+			if (!(o_ptr->note)) {
+			    int col_num = rand_int(MAX_SLIME_ENTRIES);
+			    object_type *myo_ptr = (object_type *) o_ptr;
+			    myo_ptr->pval += col_num; /* hack*/
+			    name_slime_mold(myo_ptr);
+			}
+			
+			the_num = o_ptr->pval - def_nutr_val;
+			if (the_num < 0) {
+			    the_num = 0; /* should not happen */
+			}
+			flavor = TRUE;
+		
+			modstr = slime_entries[the_num].desc;
+			/*printf("modstr is %s\n", modstr);*/
+			k_ptr->x_attr = k_ptr->d_attr = slime_entries[the_num].colour;
+			basenm = "& # Slime Mold~";
+		    }
+		    
+		    /* Ordinary food is "boring" */
+		    else if (o_ptr->sval >= SV_FOOD_MIN_FOOD) {
+			break;
+		    }
+		    else {
 			/* Color the object */
 			modstr = food_adj[o_ptr->sval];
 			if (aware) append_name = TRUE;
 			basenm = (flavor ? "& # Mushroom~" : "& Mushroom~");
-
-			break;
+		    }
+		    break;
 		}
 
 		/* Magic Books */
Index: store.c
===================================================================
RCS file: /Home/stud/stig/hovedfag/CVS/angband/src/store.c,v
retrieving revision 1.1
diff -u -r1.1 store.c
--- store.c	2001/05/04 18:10:09	1.1
+++ store.c	2001/06/16 17:32:47
@@ -2853,6 +2853,78 @@
 }
 
 
+static void
+decorate_home() {
+    
+    int slot = 0;
+    int cnt = 0;
+    int decorate_count = 0;
+    int decorative_objs[4];
+    
+    if (store_num != STORE_HOME) {
+	msg_format("You can only decorate your own home. ");
+	return;
+    }
+    
+    /* Activate the home */
+    st_ptr = &store[store_num];
+
+    decorative_objs[0] = lookup_kind(TV_SKELETON, 6); /* elf skeleton, nice bone structure */
+    decorative_objs[1] = lookup_kind(TV_CROWN, SV_GOLDEN_CROWN); /* golden crown on the fire-place */
+    decorative_objs[2] = lookup_kind(TV_FOOD,SV_FOOD_SLIME_MOLD); /* juicy slime molds look _good_ */
+    decorative_objs[3] = lookup_kind(TV_CROWN, SV_JEWELED_CROWN); /* jeweled crown on the fire-place */
+    
+
+    for (slot = 0; slot < st_ptr->stock_num; slot++) {
+	int k_idx = st_ptr->stock[slot].k_idx;
+	
+	/* only remove decorative objects */
+	for (cnt = 0; cnt < 4; cnt++) {
+	    if (k_idx == decorative_objs[cnt]) {
+		int num = st_ptr->stock[slot].number;
+		/* increase counter with decorative value */
+		decorate_count += (cnt+1);
+		
+		/* remove the decoration */
+		store_item_increase(slot, -num);
+		store_item_optimize(slot);	
+		slot--;
+	    }
+	}
+    }
+    
+    
+    /* see if anything was used for decorations */
+    if (decorate_count > 0) {
+	int xp_reward = decorate_count;
+	if (decorate_count < 7) {
+	    msg_print("Your home looks quite decent now. ");
+	    xp_reward *= 2;
+	}
+	else if (decorate_count < 15) {
+	    msg_print("Your home is quite classy. ");
+	    xp_reward *= 3;
+	}
+	else if (decorate_count < 30) {
+	    msg_print("Your home is absolutely stunning. ");
+	    (void)set_stun(p_ptr->stun + 20); /* stun the player */
+	    xp_reward *= 4;
+	}
+	else {
+	    int social_class = p_ptr->sc + 15;
+	    msg_print("Your impressive home finds a place in interior decorating history. ");
+	    if (social_class > 100) social_class = 100;
+	    p_ptr->sc = social_class;
+	    do_inc_stat(A_CHR);
+	    xp_reward *= 5;
+	}
+	
+	gain_exp(xp_reward);
+    }
+    else {
+	msg_print("You don't have anything decorative. ");
+    }
+}
 
 /*
  * Hack -- set this to leave the store
@@ -2959,6 +3031,9 @@
 			break;
 		}
 
+	case 'D':
+	    decorate_home();
+	    break;
 
 		/*** Inventory Commands ***/
 
@@ -3298,6 +3373,11 @@
 		else
 			prt(" l) Look at an item.", 22, 56);
 
+
+		if (store_num == STORE_HOME) {
+		    prt(" D) Decorate home.", 23, 56);
+		}
+		
 		/* Prompt */
 		prt("You may: ", 21, 0);
 
