|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T n
Length: 26980 (0x6964) Types: TextFile Names: »new1.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/General/Abermud/new1.c«
/* ** Extensions section 1 */ #include "kernel.h" #ifdef RCSID static char RCS[] = "$Header: new1.c,v 1.1 89/03/13 09:37:07 rsalz Exp $"; #endif /* RCSID */ bouncecom() { sillycom("\001s%s\001%s bounces around\n\001"); bprintf("B O I N G !!\n"); } nodcom() { sillycom("\001s%s\001%s nods\n\001"); bprintf("Ok.\n"); } sniffcom() { sillycom("\001s%s\001%s sniffs rudely\n\001"); bprintf("Ok.\n"); } strutcom() { sillycom("\001s%s\001%s struts proudly.\n\001"); bprintf("Ok.\n"); } begcom() { char x[128]; char z[128]; char y[80]; strcpy(z, "["); getreinput(x); strcat(z, x); strcat(z, "]\n"); sprintf(y, "[Beg from \001p%s\001]\n", pname(mynum)); sendsys(pname(mynum), pname(mynum), -10113, ploc(mynum), y); sendsys(pname(mynum), pname(mynum), -10113, ploc(mynum), z); sillycom("\001s%s\001%s begs and grovels to the powers that be.\n\001"); } sighcom() { if (chkdumb()) return; sillycom("\001P%s\001\001d sighs loudly\n\001"); bprintf("You sigh\n"); } screamcom() { if (chkdumb()) return; sillycom("\001P%s\001\001d screams loudly\n\001"); bprintf("ARRRGGGGHHHHHHHHHHHH!!\n"); } ohereandget(onm) int *onm; { if (EMPTY(item1)) { bprintf("Tell me more ?\n"); return -1; } openworld(); if ((*onm = ob1) == -1) { bprintf("There isn't one of those here\n"); return -1; } return 1; } state(ob) { return objinfo[4 * ob + 1]; } setobjstate(o, v) int o, v; { objinfo[4 * o + 1] = v; if (otstbit(o, 1)) objinfo[4 * (o ^ 1) + 1] = v; } wavecom() { if (EMPTY(item1)) { if (isforce) { bprintf("Ooh, someone tried to force you to wave, the rotters!\n"); return; } if (in_fight) { bprintf("What you trying to do? Make 'em die laughing?\n"); return; } if (EQ(pname(mynum), "Brenda")) { /* Let em wave, only them though! */ sillycom("\001s%s\001%s waves at you.\n\001"); bprintf("You wave happily\n"); return; } if (plev(mynum) < 10) { sillycom("\001s%s\001%s sticks out a hand and is fried by a HT cable.\n\001"); bprintf("You stick out your hand to wave but unfortunately hit a nearby 10000V line\n"); loseme(); crapup("Fried for the ultimate sin of waving!"); return; } else { bprintf("No No No! I am not going to let you wave on any account!\n"); } } switch (ob1) { case -1: return; case 136: if ((state(151) == 1) && (oloc(151) == ploc(mynum))) { setobjstate(150, 0); bprintf("The drawbridge is lowered!\n"); return; } break; case 158: if (obyte(158, 1) == 3) { bprintf("The rod crumbles to dust!\n"); destroy(158); return; } osetbyte(158, 1, obyte(158, 1) + 1); bprintf("You are teleported!\n"); teletrap(-114); return; case 13: if (obyte(13, 1) != 0) { osetbyte(13, 1, obyte(13, 1) - 1); me_ivct = 50; setpvis(mynum, 10); bprintf("You seem to shimmer and blur.\n"); return; } } bprintf("Nothing happens\n"); } blowcom() { int a; if (ohereandget(&a) == -1) return; if (a == 40) { broad("\001dA hideous wailing sounds echos all around\n\001"); return; } if (a == 198) { broad("\001dA mighty horn blast echoes around you\n\001"); if (ploc(mynum) >= -999 && ploc(mynum) <= -900 && obyte(202, 1) == 0) { setoloc(202, ploc(mynum), 0); setobjstate(202, 1); bprintf("A hand breaks through the water holding up the sword excalibur!\n"); osetbyte(202, 1, 1); } return; } bprintf("You can't blow that\n"); } putcom() { int a; char ar[128]; int c; if (ohereandget(&a) == -1) return; if (EMPTY(item2)) { bprintf("where ?\n"); return; } if ((c = ob2) == -1) { bprintf("There isn't one of those here.\n"); return; } if (c == 10) { if (a < 4 || a > 6) { bprintf("You can't do that\n"); return; } if (state(10) != 2) { bprintf("There is already a candle in it!\n"); return; } bprintf("The candle fixes firmly into the candlestick\n"); setpscore(mynum, pscore(mynum) + 50); destroy(a); osetbyte(10, 1, a); osetbit(10, 9); osetbit(10, 10); if (otstbit(a, 13)) { osetbit(10, 13); setobjstate(10, 0); return; } setobjstate(10, 1); oclrbit(10, 13); return; } if (c == 14) { if (a == 13 && !obyte(a, 1)) { bprintf("The wand seems to soak up energy.\n"); osetbyte(a, 1, 4); return; } bprintf("Nothing happens\n"); return; } if (c == 137) { if (state(c) == 0) { setoloc(a, -162, 0); bprintf("Ok\n"); return; } destroy(a); bprintf("It dissappears with a fizzle into the slime\n"); if (a == 108) { bprintf("The soap dissolves the slime away!\n"); setobjstate(137, 0); } return; } if (c == 193) { bprintf("You can't do that, the chute leads up from here!\n"); return; } if (c == 192) { if (a == 32) { bprintf("You can't let go of it!\n"); return; } bprintf("It vanishes down the chute....\n"); sprintf(ar, "The %s comes out of the chute!\n", oname(a)); sendsys("", "", -10000, oloc(193), ar); setoloc(a, oloc(193), 0); return; } if (c == 23) { if (a == 19 && state(21) == 1) { bprintf("The door clicks open!\n"); setobjstate(20, 0); return; } bprintf("Nothing happens\n"); return; } if (c == a) { bprintf("What do you think this is, the goon show ?\n"); return; } if (otstbit(c, 14) == 0) { bprintf("You can't do that\n"); return; } if (state(c) != 0) { bprintf("That's not open\n"); return; } if (oflannel(a)) { bprintf("You can't take that !\n"); return; } if ((ishere(a)) && (dragget())) return; if (a == 32) { bprintf("You can't let go of it!\n"); return; } if (otstbit(a, 13)) { bprintf("I'd try putting it out first!\n"); return; } if (!willhold(c, a)) { bprintf("It won't fit\n"); return; } if (ploc(mynum) == -1081 && state(20) == 0 && ishere(a)) { setobjstate(20, 1); bprintf("The door clicks shut....\n"); } setoloc(a, c, 3); bprintf("Ok.\n"); sprintf(ar, "\001D%s\001\001c puts the %s in the %s.\n\001", pname(mynum), oname(a), oname(c)); sendsys(pname(mynum), pname(mynum), -10000, ploc(mynum), ar); if (otstbit(a, 12)) setobjstate(a, 0); } lightcom() { int a; if (ohereandget(&a) == -1) return; if (!ohany(1 << 13)) { bprintf("You have nothing to light things from\n"); return; } if (!otstbit(a, 9)) bprintf("You can't light that!\n"); else if (state(a) == 0) bprintf("It is lit\n"); else { setobjstate(a, 0); osetbit(a, 13); bprintf("Ok\n"); } } extinguishcom() { int a; if (ohereandget(&a) == -1) return; if (!otstbit(a, 13)) bprintf("That isn't lit\n"); else if (!otstbit(a, 10)) bprintf("You can't extinguish that!\n"); else { setobjstate(a, 1); oclrbit(a, 13); bprintf("Ok\n"); } } pushcom() { int x; if (brkword() == -1) { bprintf("Push what ?\n"); return; } if ((x = fobna(wordbuf)) == -1) { bprintf("That is not here\n"); return; } switch (x) { case 126: bprintf("The tripwire moves and a huge stone crashes down from above!\n"); broad("\001dYou hear a thud and a squelch in the distance.\n\001"); loseme(); crapup(" S P L A T !"); case 162: bprintf("A trapdoor opens at your feet and you plumment downwards!\n"); setploc(mynum, -140); trapch(ploc(mynum)); return; case 130: if (state(132) == 1) { setobjstate(132, 0); bprintf("A secret panel opens in the east wall!\n"); break; } bprintf("Nothing happens\n"); break; case 131: bprintf("With a mighty heave you manage to move the boulder a few feet\n"); if (state(134) == 1) { bprintf("Uncovering a hole behind it.\n"); setobjstate(134, 0); } break; case 138: if (ptothlp(mynum) == -1) { bprintf("Its too stiff.\n"); return; } if (state(137) == 0) bprintf("Ok...\n"); else { bprintf("You hear a gurgling noise and then silence.\n"); setobjstate(137, 0); } break; case 146: ; case 147: setobjstate(146, 1 - state(146)); bprintf("Ok...\n"); break; case 30: setobjstate(28, 1 - state(28)); if (state(28)) { sendsys("", "", -10000, oloc(28), "\001cThe portcullis falls\n\001"); sendsys("", "", -10000, oloc(29), "\001cThe portcullis falls\n\001"); } else { sendsys("", "", -10000, oloc(28), "\001cThe portcullis rises\n\001"); sendsys("", "", -10000, oloc(29), "\001cThe portcullis rises\n\001"); } break; case 149: setobjstate(150, 1 - state(150)); if (state(150)) { sendsys("", "", -10000, oloc(150), "\001cThe drawbridge rises\n\001"); sendsys("", "", -10000, oloc(151), "\001cThe drawbridge rises\n\001"); } else { sendsys("", "", -10000, oloc(150), "\001cThe drawbridge is lowered\n\001"); sendsys("", "", -10000, oloc(151), "\001cThe drawbridge is lowered\n\001"); } break; case 24: if (state(26) == 1) { setobjstate(26, 0); bprintf("A secret door slides quietly open in the south wall!\n"); } else bprintf("It moves but nothing seems to happen\n"); return; case 49: broad("\001dChurch bells ring out around you\n\001"); osetbyte(49, 1, obyte(49, 1) + 1); if (obyte(49, 1) == 12) { bprintf("A strange ghostly guitarist shimmers briefly before you.\n"); setpscore(mynum, pscore(mynum) + 300); broad("\001dA faint ghostly guitar duet floats through the air.\n\001"); } break; case 104: if (ptothlp(mynum) == -1) { bprintf("You can't shift it alone, maybe you need help\n"); break; } /* FALLTHROUGH */ default: if (otstbit(x, 4)) { setobjstate(x, 0); oplong(x); return; } if (otstbit(x, 5)) { setobjstate(x, 1 - state(x)); oplong(x); return; } bprintf("Nothing happens\n"); } } cripplecom() { int a; if (victim(&a) != -1) sendsys(pname(a), pname(mynum), -10101, ploc(mynum), ""); } curecom() { int a; if (vicfb(&a) != -1) sendsys(pname(a), pname(mynum), -10100, ploc(mynum), ""); } dumbcom() { int a; if (victim(&a) != -1) sendsys(pname(a), pname(mynum), -10102, ploc(mynum), ""); } forcecom() { int a; char z[128]; if (victim(&a) == -1) return; if (a > 15) { bprintf("You can only force players to do things\n"); return; } getreinput(z); sendsys(pname(a), pname(mynum), -10103, ploc(mynum), z); } missilecom() { int a; char ar[8]; if (vichfb(&a) == -1) return; if (shimge[0]) { bprintf("Awww no thats violent!\n"); return; } if (ptstflg(a, 12)) { bprintf("The magic flashes harmlessly past.\n"); error(); return; } sprintf(ar, "%d", plev(mynum) * 2); sendsys(pname(a), pname(mynum), -10106, ploc(mynum), ar); if (plev(a) <= 9999 && pstr(a) - 2 * plev(mynum) < 0) { bprintf("Your last spell did the trick\n"); if (pstr(a) >= 0) { /* Bonus ? */ if (a < 16) setpscore(mynum, pscore(mynum) + (plev(a) * plev(a) * 100)); else setpscore(mynum, pscore(mynum) + 10 * damof(a)); } setpstr(a, -1); /* MARK ALREADY DEAD */ in_fight = 0; fighting = -1; setpfighting(mynum, -1); } if (a > 15) woundmn(a, 2 * plev(mynum)); } changecom() { int a; int vic_lev; char vislev[81]; int new_vis; int ar[4]; if (brkword() == -1) { bprintf("change what?\n"); return; } if (!EQ(wordbuf, "sex")) { if (!EQ(wordbuf, "vis")) { bprintf("I don't know how to change that\n"); return; } if (my_lev < 10) { bprintf("I don't know how to change that.\n"); return; } if (victim(&a) == -1) return; vic_lev = plev(a); if (vic_lev > 10000) vic_lev = 10000; else if (vic_lev > 10) vic_lev = 10; if (op(pname(mynum))) vic_lev = 0; if (vic_lev >= plev(mynum)) { bprintf("You can't do that to them."); return; } getreinput(vislev); sscanf(vislev, "%d", &new_vis); if (new_vis < 0) new_vis = 0; else if (plev(mynum) < 10000 && new_vis > 9) new_vis = 9; else if (op(pname(mynum))) new_vis = new_vis; else if (new_vis > 9999) new_vis = 9999; sprintf(vislev, "%d", new_vis); bprintf("Setting players visibility to %s.\n", vislev); setpvis(a, new_vis); ar[0] = mynum; ar[1] = pvis(mynum); sendsys("", "", -9900, 0, (char *)ar); return; } if (victim(&a) == -1) return; vic_lev = plev(a); if (vic_lev > 10000) vic_lev = 10000; else if (vic_lev > 10) vic_lev = 10; if (vic_lev > plev(mynum)) { bprintf("You can't do that\n"); return; } sendsys(pname(a), pname(mynum), -10107, ploc(mynum), ""); if (a >= 16) setpsex(a, 1 - psex(a)); } fireballcom() { int a; char ar[15]; if (shimge[0]) { bprintf("Awww no thats violent!\n"); return; } if (vichfb(&a) == -1) return; if (ptstflg(a, 12)) { bprintf("The spell has no effect!\n"); error(); return; } if (mynum == a) { bprintf("Seems rather dangerous to me....\n"); return; } sprintf(ar, "%d", 2 * plev(mynum)); if (plev(a) <= 9 && pstr(a) - (a == fpbns("yeti") ? 6 : 2) * plev(mynum) < 0) { bprintf("Your last spell did the trick\n"); if (pstr(a) >= 0) { /* Bonus ? */ if (a < 16) setpscore(mynum, pscore(mynum) + (plev(a) * plev(a) * 100)); else setpscore(mynum, pscore(mynum) + 10 * damof(a)); } setpstr(a, -1); /* MARK ALREADY DEAD */ in_fight = 0; fighting = -1; setpfighting(mynum, -1); } sendsys(pname(a), pname(mynum), -10109, ploc(mynum), ar); if (a == fpbns("yeti")) { woundmn(a, 6 * plev(mynum)); return; } if (a > 15) woundmn(a, 2 * plev(mynum)); } shockcom() { int a; char ar[15]; if (shimge[0]) { bprintf("Awww no thats violent!\n"); return; } if (vichfb(&a) == -1) return; if (ptstflg(a, 12)) { bprintf("They seem unharmed!\n"); error(); return; } if (a == mynum) { bprintf("You are supposed to be killing other people not yourself\n"); return; } if (plev(a) <= 9 && pstr(a) - 2 * plev(mynum) < 0) { bprintf("Your last spell did the trick\n"); if (pstr(a) >= 0) { /* Bonus ? */ if (a < 16) setpscore(mynum, pscore(mynum) + (plev(a) * plev(a) * 100)); else setpscore(mynum, pscore(mynum) + 10 * damof(a)); } setpstr(a, -1); /* MARK ALREADY DEAD */ in_fight = 0; fighting = -1; setpfighting(mynum, -1); } sprintf(ar, "%d", plev(mynum) * 2); sendsys(pname(a), pname(mynum), -10110, ploc(mynum), ar); if (a > 15) woundmn(a, 2 * plev(mynum)); } starecom() { int a; if (vichere(&a) == -1) return; if (a == mynum) { bprintf("That is pretty neat if you can do it!\n"); return; } sillytp(a, "stares deep into your eyes\n"); bprintf("You stare at \001p%s\001\n", pname(a)); } gropecom() { int a; if (isforce && !awizforce) { bprintf("You can't be forced to do that\n"); return; } if (vichere(&a) == -1) return; if (a == mynum) { bprintf("With a sudden attack of morality the machine edits your persona\n"); loseme(); crapup("Bye....... LINE TERMINATED - MORALITY REASONS"); } sillytp(a, "gropes you"); bprintf("<Well what sort of noise do you want here ?>\n"); if (a > 15) woundmn(a, 0); } squeezecom() { int a; if (vichere(&a) == -1) return; if (a == mynum) { bprintf("Ok....\n"); return; } if (a == -1) return; sillytp(a, "gives you a squeeze\n"); bprintf("You give them a squeeze\n"); } kisscom() { int a; if (vichere(&a) == -1) return; if (a == mynum) { bprintf("Weird!\n"); return; } sillytp(a, "kisses you"); bprintf("Slurp!\n"); } thankcom() { int a; if (vichere(&a) == -1) return; if (a == mynum) { bprintf("Humm....\n"); return; } sillytp(a, "thanks you"); bprintf("Ok.\n"); } cuddlecom() { int a; if (vichere(&a) == -1) return; if (mynum == a) { bprintf("You aren't that lonely are you ?\n"); return; } sillytp(a, "cuddles you"); } hugcom() { int a; if (vichere(&a) == -1) return; if (mynum == a) { bprintf("Ohhh flowerr!\n"); return; } sillytp(a, "hugs you"); } slapcom() { int a; if (vichere(&a) == -1) return; if (mynum == a) { bprintf("You slap yourself\n"); return; } sillytp(a, "slaps you"); if (a > 15) woundmn(a, 0); } ticklecom() { int a; if (vichere(&a) == -1) return; if (a == mynum) { bprintf("You tickle yourself\n"); return; } sillytp(a, "tickles you"); } /* This one isnt for magic */ vicbase(x) int *x; { int a, b; do { if (brkword() == -1) { bprintf("Who ?\n"); return -1; } b = openworld() != NULL; } while (EQ(wordbuf, "at")); if ((a = fpbn(wordbuf)) == -1) { bprintf("Who ?\n"); return -1; } *x = a; return b; } vichere(x) int *x; { int a; if ((a = vicbase(x)) == -1) return a; if (ploc(*x) != ploc(mynum)) { bprintf("They are not here\n"); return -1; } return a; } vicf2(x, f1) int *x; int f1; { int a; int i; if ((a = vicbase(x)) == -1) return -1; if (pstr(mynum) < 10) { bprintf("You are too weak to cast magic\n"); return -1; } if (plev(mynum) < 10) setpstr(mynum, pstr(mynum)); i = 5; if (iscarrby(111, mynum)) i++; if (iscarrby(121, mynum)) i++; if (iscarrby(163, mynum)) i++; if (plev(mynum) < 10 && randperc() > i * plev(mynum)) { bprintf("You fumble the magic\n"); if (f1 == 1) { *x = mynum; bprintf("The spell reflects back\n"); return a; } return -1; } if (plev(mynum) < 10) bprintf("The spell succeeds!\n"); return a; } vicfb(x) int *x; { return vicf2(x, 0); } vichfb(x) int *x; { int a; if ((a = vicfb(x)) == -1) return -1; if (ploc(*x) != ploc(mynum)) { bprintf("They are not here\n"); return -1; } return a; } victim(x) int *x; { return vicf2(x, 1); } sillytp(per, msg) int per; char *msg; { char bk[256]; if (strncmp(msg, "star", 4) == 0) sprintf(bk, "%s%s%s%s%s%s%s", "\001s", pname(mynum), "\001", pname(mynum), " ", msg, "\n\001"); else sprintf(bk, "%s%s%s%s%s", "\001p", pname(mynum), "\001 ", msg, "\n"); sendsys(pname(per), pname(mynum), -10111, ploc(mynum), bk); } new1rcv(isme, chan, to, from, code, text) char *to, *from, *text; int isme, chan, code; { switch (code) { case -10100: if (isme == 1) { bprintf("All your ailments have been cured\n"); ail_dumb = 0; ail_crip = 0; ail_blind = 0; ail_deaf = 0; } break; case -10101: if (isme == 1) { if (plev(mynum) < 10) { bprintf("You have been magically crippled\n"); ail_crip = 1; } else bprintf("\001p%s\001 tried to cripple you\n", from); } break; case -10102: if (isme == 1) { if (plev(mynum) < 10) { bprintf("You have been struck magically dumb\n"); ail_dumb = 1; } else bprintf("\001p%s\001 tried to dumb you\n", from); } break; case -10103: if (fpbns(from) != -1 && plev(fpbns(from)) > 9999) { if (plev(mynum) < 10000) { if (isme) addforce(text); awizforce = 1; break; } } if (isme == 1) { if (plev(mynum) < 10) { bprintf("\001p%s\001 has forced you to %s\n", from, text); addforce(text); } else bprintf("\001p%s\001 tried to force you to %s\n", from, text); } else if (plev(mynum) > 9) bprintf("[ \001p%s\001 forced \001p%s\001 ]\n[Force:%s]\n", from, to, text); break; case -10104: if (isme != 1) bprintf("\001p%s\001 shouts '%s'\n", from, text); break; case -10105: if (isme == 1) { if (plev(mynum) < 10) { bprintf("You have been struck magically blind\n"); ail_blind = 1; } else bprintf("\001p%s\001 tried to blind you\n", from); } break; case -10106: if (iam(from)) break; if (ploc(mynum) == chan) { bprintf("Bolts of fire leap from the fingers of \001p%s\001\n", from); if (isme == 1) { bprintf("You are struck!\n"); wounded(atoi(text)); } else bprintf("\001p%s\001 is struck\n", to); } break; case -10107: if (isme == 1) { bprintf("Your sex has been magically changed!\n"); setpsex(mynum, 1 - psex(mynum)); bprintf("You are now "); if (psex(mynum)) bprintf("Female\n"); else bprintf("Male\n"); calibme(); } break; case -10108: if (isme == 1) { /* I have just gone invisible */ } break; case -10109: if (iam(from)) break; if (ploc(mynum) == chan) { bprintf("\001p%s\001 casts a fireball\n", from); if (isme == 1) { bprintf("You are struck!\n"); wounded(atoi(text)); } else bprintf("\001p%s\001 is struck\n", to); } break; case -10110: if (iam(from)) break; if (isme == 1) { bprintf("\001p%s\001 touches you giving you a sudden electric shock!\n", from); wounded(atoi(text)); } break; case -10111: if (isme == 1) bprintf("%s\n", text); break; case -10113: if (strchr(text, '[') && shurrup) break; if (plev(mynum) > 9) bprintf("%s", text); break; case -10114: if (plev(mynum) >= pvis(fpbn(from)) && ploc(mynum) == chan && !isme) bprintf("%s %s\n", from, text); break; case -10125: if (plev(mynum) > 9999) bprintf("%s", text); break; case -10120: if (isme == 1) { if (plev(mynum) > 9) { bprintf("\001p%s\001 tried to deafen you\n", from); break; } bprintf("You have been magically deafened\n"); ail_deaf = 1; break; } } } destroy(ob) int ob; { osetbit(ob, 0); } tscale() { int a, b; for (a = 0, b = 0; b < 16; b++) if (!EMPTY(pname(b))) a++; switch (a) { case 1: return 1; case 2: case 3: return 2; case 4: case 5: return 3; case 6: return 4; case 7: return 5; } return 6; } chkdumb() { if (!ail_dumb) return 0; bprintf("You are dumb...\n"); return 1; } chkcrip() { if (!ail_crip) return 0; bprintf("You are crippled\n"); return 1; } wounded(n) int n; { char ms[128]; if (plev(mynum) > 9) return; setpstr(mynum, pstr(mynum) - n); me_cal = 1; if (pstr(mynum) >= 0) return; closeworld(); mudlog("%s slain magically", pname(mynum)); delpers(pname(mynum)); zapped = 1; openworld(); dumpitems(); sprintf(ms, "%s has just died\n", pname(mynum)); sendsys(pname(mynum), pname(mynum), -10000, ploc(mynum), ms); sprintf(ms, "[ %s has just died ]\n", pname(mynum)); sendsys(pname(mynum), pname(mynum), -10113, ploc(mynum), ms); loseme(); crapup("Oh dear you just died\n"); } woundmn(mon, am) int mon, am; { int a; char ms[128]; a = pstr(mon) - am; setpstr(mon, a); if (a >= 0) mhitplayer(mon); else { dumpstuff(mon, ploc(mon)); sprintf(ms, "%s has just died\n", pname(mon)); sendsys(" ", " ", -10000, ploc(mon), ms); sprintf(ms, "[ %s has just died ]\n", pname(mon)); setploc(mon, -20); sendsys(pname(mynum), pname(mynum), -10113, ploc(mon), ms); } } mhitplayer(mon) int mon; { int a, b, x[4]; if (testpeace() || ploc(mon) != ploc(mynum) || mon < 0 || mon > 127) return; if (mon == fpbns("hermit") && randperc() < 20) { bprintf("Bolts of fire leap from the fingers of The Hermit\n"); bprintf("You are struck !\n"); wounded(10); return; } a = randperc(); b = 3 * (15 - plev(mynum)) + 20; if (iswornby(89, mynum) || iswornby(113, mynum) || iswornby(114, mynum)) b -= 10; x[0] = mon; x[1] = a < b ? randperc() % damof(mon) : -1; x[2] = -1; sendsys(pname(mynum), pname(mon), -10021, ploc(mon), (char *)x); } resetplayers() { int a, c; for (c = 0, a = 16; a < numchars; a++, c++) { strcpy(pname(a), pinit[c].p_name); setploc(a, pinit[c].p_loc); setpstr(a, pinit[c].p_str); setphelping(a, -1); setpsex(a, pinit[c].p_sex); setpwpn(a, -1); setpvis(a, 0); setplev(a, pinit[c].p_lev); } for (; a < 64; a++) /* CHAGE iF GO PAST 48 MOBILES */ strcpy(pname(a), ""); } wearcom() { int a; if (ohereandget(&a) == -1) return; if (!iscarrby(a, mynum)) { bprintf("You are not carrying this\n"); return; } if (iswornby(a, mynum)) { bprintf("You are wearing this\n"); return; } if ((iswornby(89, mynum) || iswornby(113, mynum) || iswornby(114, mynum)) && (a == 89 || a == 113 || a == 114)) { bprintf("You can't use TWO shields at once...\n"); return; } if (!canwear(a)) { bprintf("Is this a new fashion ?\n"); return; } setcarrf(a, 2); bprintf("OK\n"); } removecom() { int a; if (ohereandget(&a) == -1) return; if (!iswornby(a, mynum)) { bprintf("You are not wearing this\n"); return; } setcarrf(a, 1); } setcarrf(o, n) { objinfo[4 * o + 3] = n; } iswornby(item, chr) { if (!iscarrby(item, chr) || ocarrf(item) != 2) return 0; return 1; } addforce(x) char *x; { if (forf == 1) bprintf("The compulsion to %s is overridden\n", acfor); forf = 1; strcpy(acfor, x); } forchk() { isforce = 1; if (forf == 1) gamecom(acfor); isforce = 0; forf = 0; } damof(n) int n; { switch (n) { case 18: case 19: case 20: case 21: case 22: return 6; case 23: return 32; case 24: return 8; case 28: return 6; case 30: return 20; case 31: return 14; case 32: return 15; case 33: return 10; } return 10; } canwear(a) int a; { return otstbit(a, 8); } iam(x) char *x; { char a[64], b[64]; strcpy(a, x); strcpy(b, pname(mynum)); if (EQ(lowercase(a), lowercase(b))) return 1; if (strncmp(b, "the ", 4) == 0) { if (EQ(a, b + 4)) return 1; } return 0; } deafcom() { int a; if (victim(&a) != -1) sendsys(pname(a), pname(mynum), -10120, ploc(mynum), ""); } blindcom() { int a; if (victim(&a) != -1) sendsys(pname(a), pname(mynum), -10105, ploc(mynum), ""); } teletrap(newch) int newch; { char block[200]; sprintf(block, "%s%s%s%s%s", "\001s", pname(mynum), "\001", pname(mynum), " has left.\n\001"); sendsys(pname(mynum), pname(mynum), -10000, ploc(mynum), block); setploc(mynum, newch); sprintf(block, "%s%s%s%s%s", "\001s", pname(mynum), "\001", pname(mynum), " has arrived.\n\001"); sendsys(pname(mynum), pname(mynum), -10000, newch, block); trapch(ploc(mynum)); } on_flee_event() { int ct; for (ct = 0; ct < numobs; ct++) if (iscarrby(ct, mynum) && !iswornby(ct, mynum) && pwpn(mynum) != ct) setoloc(ct, ploc(mynum), 0); } on_flee_mob(n) int n; { int ct; for (ct = 0; ct < numobs; ct++) if (iscarrby(ct, n) && !iswornby(ct, n) && pwpn(n) != ct) setoloc(ct, ploc(n), 0); }