Pizza Delivery, implemented by Jim Crawford (pfister_@mindspring.com) This patch adds two items to the game: the cell phone, and the pizza. The concept and behavior of cell phone was described as part of a proposed Student character class in a rgrn post which I've lost, so I don't know to whom to credit the idea. Please note, I have not added graphics for the new items, so tiled mode will not work with the patch turned on. diff -rc nethack-3.3.0/include/config.h sullied/include/config.h *** nethack-3.3.0/include/config.h Fri Dec 10 21:20:50 1999 --- sullied/include/config.h Sat Apr 8 11:38:30 2000 *************** *** 289,294 **** --- 289,296 ---- #define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ #define STEED /* Riding steeds */ #define TOURIST /* Tourist players with cameras and Hawaiian shirts */ + #define PIZZA_DELIVERY /* Cell phones which order pizzas - Jim Crawford */ + /* difficulty */ #define ELBERETH /* Engraving the E-word repels monsters */ /* I/O */ diff -rc nethack-3.3.0/include/mail.h sullied/include/mail.h *** nethack-3.3.0/include/mail.h Fri Dec 10 21:20:50 1999 --- sullied/include/mail.h Sat Apr 8 10:07:20 2000 *************** *** 6,14 **** --- 6,19 ---- #ifndef MAIL_H #define MAIL_H + #include "config.h" + #define MSG_OTHER 0 /* catch-all; none of the below... */ #define MSG_MAIL 1 /* unimportant, uninteresting mail message */ #define MSG_CALL 2 /* annoying phone/talk/chat-type interruption */ + #ifdef PIZZA_DELIVERY + #define MSG_PIZZA 3 /* a pizza! */ + #endif struct mail_info { int message_typ; /* MSG_foo value */ *************** *** 17,20 **** --- 22,29 ---- const char *response_cmd; /* command to eventually execute */ }; + #ifdef PIZZA_DELIVERY + extern void FDECL(newmail, (struct mail_info *)); + #endif + #endif /* MAIL_H */ diff -rc nethack-3.3.0/include/you.h sullied/include/you.h *** nethack-3.3.0/include/you.h Fri Dec 10 21:20:52 1999 --- sullied/include/you.h Sat Apr 8 09:48:02 2000 *************** *** 250,256 **** int uhunger; /* refd only in eat.c and shk.c */ unsigned uhs; /* hunger state - see eat.c */ ! struct prop uprops[LAST_PROP+1]; unsigned umconf; --- 250,259 ---- int uhunger; /* refd only in eat.c and shk.c */ unsigned uhs; /* hunger state - see eat.c */ ! #ifdef PIZZA_DELIVERY ! int upizzaprice; /* price of pizza, or <0 if they won't deliver */ ! int upizzatimeout; /* time left until pizza delivered */ ! #endif struct prop uprops[LAST_PROP+1]; unsigned umconf; diff -rc nethack-3.3.0/src/apply.c sullied/src/apply.c *** nethack-3.3.0/src/apply.c Fri Dec 10 21:20:54 1999 --- sullied/src/apply.c Sat Apr 8 10:52:18 2000 *************** *** 83,88 **** --- 83,120 ---- } #endif + #ifdef PIZZA_DELIVERY + STATIC_OVL int use_cell_phone(struct obj *obj) + { if(obj->spe<=0) + { pline_The("batteries appear to be dead."); + return 1; + } + obj->spe--; + + if(obj->cursed) + { You("get a busy signal."); + return 1; + } + + pline("A voice crackles."); + if(u.upizzatimeout) + { verbalize("Hold your horses! Our guy is on his way!"); + return 1; + } + + if(u.upizzaprice<0) /* won't deliver any more */ + { verbalize("No way! Not after last time!"); + return 1; + } + + u.upizzaprice=d(10, 3); + u.upizzatimeout=d(3, 10); + verbalize("Be there in a jiffy! That'll be %d zorkmids!", u.upizzaprice); + + return 1; + } + #endif + STATIC_OVL int use_towel(obj) struct obj *obj; *************** *** 2460,2465 **** --- 2492,2502 ---- res = use_camera(obj); break; #endif + #ifdef PIZZA_DELIVERY + case CELL_PHONE: + res = use_cell_phone(obj); + break; + #endif case TOWEL: res = use_towel(obj); break; diff -rc nethack-3.3.0/src/dothrow.c sullied/src/dothrow.c *** nethack-3.3.0/src/dothrow.c Fri Dec 10 21:20:54 1999 --- sullied/src/dothrow.c Sat Apr 8 12:28:44 2000 *************** *** 1211,1216 **** --- 1211,1219 ---- #ifdef TOURIST case EXPENSIVE_CAMERA: #endif + #ifdef PIZZA_DELIVERY + case CELL_PHONE: + #endif case POT_WATER: /* really, all potions */ case EGG: case CREAM_PIE: *************** *** 1236,1241 **** --- 1239,1247 ---- #ifdef TOURIST case EXPENSIVE_CAMERA: #endif + #ifdef PIZZA_DELIVERY + case CELL_PHONE: + #endif to_pieces = " into a thousand pieces"; /*FALLTHRU*/ case POT_WATER: /* really, all potions */ diff -rc nethack-3.3.0/src/mail.c sullied/src/mail.c *** nethack-3.3.0/src/mail.c Fri Dec 10 21:20:54 1999 --- sullied/src/mail.c Sat Apr 8 11:28:54 2000 *************** *** 34,40 **** --- 34,42 ---- STATIC_DCL boolean FDECL(md_start,(coord *)); STATIC_DCL boolean FDECL(md_stop,(coord *, coord *)); STATIC_DCL boolean FDECL(md_rush,(struct monst *,int,int)); + #ifndef PIZZA_DELIVERY STATIC_DCL void FDECL(newmail, (struct mail_info *)); + #endif extern char *viz_rmin, *viz_rmax; /* line-of-sight limits (vision.c) */ *************** *** 361,369 **** return TRUE; } ! /* Deliver a scroll of mail. */ /*ARGSUSED*/ ! STATIC_OVL void newmail(info) struct mail_info *info; { --- 363,374 ---- return TRUE; } ! /* Deliver a scroll of mail. Or a pizza. */ /*ARGSUSED*/ ! #ifndef PIZZA_DELIVERY ! STATIC_OVL ! #endif ! void newmail(info) struct mail_info *info; { *************** *** 380,389 **** if (!md_rush(md, stop.x, stop.y)) goto go_back; message_seen = TRUE; verbalize("%s, %s! %s.", Hello(), plname, info->display_txt); if (info->message_typ) { ! struct obj *obj = mksobj(SCR_MAIL, FALSE, FALSE); if (distu(md->mx,md->my) > 2) verbalize("Catch!"); display_nhwindow(WIN_MESSAGE, FALSE); --- 385,411 ---- if (!md_rush(md, stop.x, stop.y)) goto go_back; message_seen = TRUE; + + #ifdef PIZZA_DELIVERY + if(info->message_typ==MSG_PIZZA) + { if(u.ugolddisplay_txt); if (info->message_typ) { ! struct obj *obj; ! #ifdef PIZZA_DELIVERY ! if(info->message_typ==MSG_PIZZA) obj=mksobj(PIZZA, FALSE, FALSE); ! else ! #endif ! obj = mksobj(SCR_MAIL, FALSE, FALSE); if (distu(md->mx,md->my) > 2) verbalize("Catch!"); display_nhwindow(WIN_MESSAGE, FALSE); diff -rc nethack-3.3.0/src/makemon.c sullied/src/makemon.c *** nethack-3.3.0/src/makemon.c Fri Dec 10 21:20:54 1999 --- sullied/src/makemon.c Sat Apr 8 10:59:34 2000 *************** *** 901,906 **** --- 901,909 ---- } else if (mndx == PM_VLAD_THE_IMPALER) { mitem = CANDELABRUM_OF_INVOCATION; } else if (mndx == PM_CROESUS) { + #ifdef PIZZA_DELIVERY + mongets(mtmp, CELL_PHONE); + #endif mitem = TWO_HANDED_SWORD; } else if (ptr->msound == MS_NEMESIS) { mitem = BELL_OF_OPENING; diff -rc nethack-3.3.0/src/mkobj.c sullied/src/mkobj.c *** nethack-3.3.0/src/mkobj.c Fri Dec 10 21:20:54 1999 --- sullied/src/mkobj.c Sat Apr 8 09:36:28 2000 *************** *** 456,461 **** --- 456,464 ---- } case BELL_OF_OPENING: otmp->spe = 3; break; + #ifdef PIZZA_DELIVERY + case CELL_PHONE: + #endif case MAGIC_FLUTE: case MAGIC_HARP: case FROST_HORN: diff -rc nethack-3.3.0/src/objects.c sullied/src/objects.c *** nethack-3.3.0/src/objects.c Fri Dec 10 21:20:56 1999 --- sullied/src/objects.c Sat Apr 8 09:05:16 2000 *************** *** 619,625 **** --- 619,630 ---- #endif TOOL("stethoscope", (char *)0, 1, 0, 0, 0, 25, 4, 75, IRON, HI_METAL), TOOL("tinning kit", (char *)0, 1, 0, 0, 1, 15,100, 30, IRON, HI_METAL), + #ifdef PIZZA_DELIVERY + TOOL("cell phone", (char *)0, 1, 0, 0, 1, 5, 12, 100, PLASTIC, CLR_BLACK), + TOOL("tin opener", (char *)0, 1, 0, 0, 0, 30, 4, 30, IRON, HI_METAL), + #else TOOL("tin opener", (char *)0, 1, 0, 0, 0, 35, 4, 30, IRON, HI_METAL), + #endif TOOL("can of grease", (char *)0,1, 0, 0, 1, 15, 15, 20, IRON, HI_METAL), TOOL("figurine", (char *)0, 1, 0, 1, 0, 25, 50, 80, MINERAL, HI_MINERAL), TOOL("magic marker", (char *)0, 1, 0, 1, 1, 15, 2, 50, PLASTIC, CLR_RED), *************** *** 706,712 **** --- 711,722 ---- FOOD("cream pie", 25, 1, 10, 0, VEGGY, 100, CLR_WHITE), FOOD("candy bar", 13, 1, 2, 0, VEGGY, 100, CLR_BROWN), FOOD("fortune cookie", 55, 1, 1, 0, VEGGY, 40, CLR_YELLOW), + #ifdef PIZZA_DELIVERY + FOOD("pizza", 5, 4, 15, 0, VEGGY, 400, CLR_WHITE), + FOOD("pancake", 20, 2, 2, 0, VEGGY, 200, CLR_YELLOW), + #else FOOD("pancake", 25, 2, 2, 0, VEGGY, 200, CLR_YELLOW), + #endif FOOD("lembas wafer", 20, 2, 5, 0, VEGGY, 800, CLR_WHITE), FOOD("cram ration", 20, 3, 15, 0, VEGGY, 600, HI_ORGANIC), FOOD("food ration", 380, 5, 20, 0, VEGGY, 800, HI_ORGANIC), diff -rc nethack-3.3.0/src/objnam.c sullied/src/objnam.c *** nethack-3.3.0/src/objnam.c Fri Dec 10 21:20:56 1999 --- sullied/src/objnam.c Sat Apr 8 10:41:58 2000 *************** *** 1408,1413 **** --- 1408,1416 ---- { "camera", EXPENSIVE_CAMERA }, { "tee shirt", T_SHIRT }, #endif + #ifdef PIZZA_DELIVERY + { "phone", CELL_PHONE }, + #endif { "can", TIN }, { "can opener", TIN_OPENER }, { "kelp", KELP_FROND }, diff -rc nethack-3.3.0/src/read.c sullied/src/read.c *** nethack-3.3.0/src/read.c Fri Dec 10 21:20:56 1999 --- sullied/src/read.c Sat Apr 8 10:34:20 2000 *************** *** 450,455 **** --- 450,458 ---- } else pline(nothing_happens); } break; + #ifdef PIZZA_DELIVERY + case CELL_PHONE: + #endif case HORN_OF_PLENTY: case BAG_OF_TRICKS: case CAN_OF_GREASE: diff -rc nethack-3.3.0/src/shk.c sullied/src/shk.c *** nethack-3.3.0/src/shk.c Fri Dec 10 21:20:56 1999 --- sullied/src/shk.c Sat Apr 8 10:37:30 2000 *************** *** 3389,3394 **** --- 3389,3397 ---- /* price per use. */ tmp /= 2L; } else if(otmp->otyp == BAG_OF_TRICKS || /* 1 - 20 */ + #ifdef PIZZA_DELIVERY + otmp->otyp == CELL_PHONE || + #endif otmp->otyp == HORN_OF_PLENTY) { tmp /= 5L; } else if(otmp->otyp == CRYSTAL_BALL || /* 1 - 5 */ diff -rc nethack-3.3.0/src/timeout.c sullied/src/timeout.c *** nethack-3.3.0/src/timeout.c Fri Dec 10 21:20:56 1999 --- sullied/src/timeout.c Sat Apr 8 10:16:04 2000 *************** *** 4,9 **** --- 4,12 ---- #include "hack.h" #include "lev.h" /* for checking save modes */ + #ifdef PIZZA_DELIVERY + #include "mail.h" + #endif STATIC_DCL void NDECL(stoned_dialogue); STATIC_DCL void NDECL(vomiting_dialogue); *************** *** 185,190 **** --- 188,199 ---- } } + #ifdef PIZZA_DELIVERY + if(u.upizzatimeout && !--u.upizzatimeout) + { static struct mail_info deliver={MSG_PIZZA, "I have a pizza for you", 0, 0}; + newmail(&deliver); + } + #endif #ifdef STEED if (u.ugallop) { if (--u.ugallop == 0L && u.usteed) diff -rc nethack-3.3.0/src/u_init.c sullied/src/u_init.c *** nethack-3.3.0/src/u_init.c Fri Dec 10 21:20:56 1999 --- sullied/src/u_init.c Sat Apr 8 10:46:22 2000 *************** *** 139,145 **** --- 139,150 ---- static struct trobj Tourist[] = { #define T_DARTS 0 { DART, 2, WEAPON_CLASS, 25, UNDEF_BLESS }, /* quan is variable */ + #ifdef PIZZA_DELIVERY + { CELL_PHONE, 5, TOOL_CLASS, 1, 0 }, + { UNDEF_TYP, UNDEF_SPE, FOOD_CLASS, 5, 0 }, + #else { UNDEF_TYP, UNDEF_SPE, FOOD_CLASS, 10, 0 }, + #endif { POT_EXTRA_HEALING, 0, POTION_CLASS, 2, UNDEF_BLESS }, { SCR_MAGIC_MAPPING, 0, SCROLL_CLASS, 4, UNDEF_BLESS }, { HAWAIIAN_SHIRT, 0, ARMOR_CLASS, 1, UNDEF_BLESS },