DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T m

⟦fd27c91f4⟧ TextFile

    Length: 5022 (0x139e)
    Types: TextFile
    Names: »magic.c«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Abermud/magic.c« 

TextFile

#include "kernel.h"
#ifdef	RCSID
static char RCS[] =
	"$Header: magic.c,v 1.1 89/03/13 09:36:47 rsalz Exp $";
#endif	/* RCSID */


randperc()
{
    return (rand() >> 3) % 100;
}

sumcom()
{
    sumb(1);
}

transcom()
{
    if (plev(mynum) < 11)
	bprintf("You practise your transcendental meditation\n");
    else
	sumb(0);
}

sumb(n)
    int n;
{
    int a;
    char seg[128];
    char ms[128];
    int c, d, x;

    if (EMPTY(item1)) {
	bprintf("Summon who ?\n");
	return;
    }
    if ((a = fobn(item1)) != -1) {
	if (plev(mynum) < 10) {
	    bprintf("You can only summon people\n");
	    return;
	}
	x = oloc(a);
	if (ocarrf(a) > 0)
	    x = ploc(x);
	sprintf(ms, "\001p%s\001 has summoned the %s\n",
	    pname(mynum), oname(a));
	sendsys(pname(mynum), pname(mynum), -10000, x, ms);
	bprintf("The %s flies into your hand\nIt was :", oname(a));
	desrm(oloc(a), ocarrf(a));
	setoloc(a, mynum, 1);
        return;
    }
    if ((a = pl1) == -1) {
	bprintf("I dont know who that is\n");
	return;
    }
    if (plev(mynum) <= 9) {
	if (pstr(mynum) < 10) {
	    bprintf("You are too weak\n");
	    return;
	}
	if (plev(mynum) < 10)
	    setpstr(mynum, pstr(mynum) - 2);
	c = plev(mynum) * 2;
	if (plev(mynum) > 9)
	    c = 101;
	if (iscarrby(111, mynum))
	    c += plev(mynum);
	if (iscarrby(121, mynum))
	    c += plev(mynum);
	if (iscarrby(163, mynum))
	    c += plev(mynum);
	d = randperc();
	if (ploc(mynum) == -1067) {
	    bprintf("It is too small in here!\n");
	    return;
	}
	if (ploc(mynum) >= -999 && ploc(mynum) <= -900) {
	    bprintf("The boat is rolling too much.\n");
	    return;
	}
	if (iswornby(90, a) || c < d) {
	    bprintf("The spell fails....\n");
	    return;
	}
	if ((a == fpbns("hermit")) == -1 || (a == fpbns("wraith")) == -1
         || (iscarrby(32,a) || iscarrby(159,a) || iscarrby(174,a)
         || ploc(a) == -8)) {
	    bprintf("Something stops your summoning from succeeding\n");
	    return;
	}
	if (a == mynum) {
	    bprintf("Seems a waste of effort to me....\n");
	    return;
	}
	if (ploc(mynum) >= -1082 && ploc(mynum) <= -1076) {
	    bprintf("Something about this place makes you fumble the magic\n");
	    return;
	}
    }

    bprintf("You cast the summoning......\n");
    if (a < 16) {
	sendsys(pname(a), pname(mynum), -10020, ploc(mynum), n ? "1" : "0");
	return;
    }
    if (n)
	on_flee_mob(a);
    sprintf(seg, "\001s%s\001%s has arrived\n\001", pname(a), pname(a));
    sendsys("", "", -10000, ploc(mynum), seg);
    setploc(a, ploc(mynum));
    if (plev(mynum) < 10)
	/* Monster regards summoning as a hostile action */
	woundmn(a, 0);
    return;

}

goloccom()
{
    char n1[128];
    char bf[128];
    int a;

    if (plev(mynum) < 10) {
	bprintf("huh ?\n");
	return;
    }
    if (brkword() == -1) {
	bprintf("Go where ?\n");
	return;
    }
    strcpy(n1, wordbuf);
    if (brkword() == -1)
	strcpy(wordbuf, "");
    if ((a = roomnum(n1, wordbuf)) >= 0 || !exists(a)) {
	bprintf("Unknown Room\n");
	return;
    }
    sendsys(pname(mynum), pname(mynum), -10114, ploc(mynum), mout_ms);
    setploc(mynum, a);
    trapch(a);
    sendsys(pname(mynum), pname(mynum), -10114, ploc(mynum), min_ms);
}


wizcom()
{
    char bf[128];

    if (plev(mynum) < 10) {
	bprintf("Such advanced conversation is beyond you\n");
	return;
    }
    getreinput(wordbuf);
    sprintf(bf, "\001p%s\001 : %s\n", pname(mynum), wordbuf);
    sendsys(pname(mynum), pname(mynum), -10113, ploc(mynum), bf);
    rd_qd = 1;
}

viscom()
{
    int ar[4];

    if (plev(mynum) < 10) {
	bprintf("You can't just do that sort of thing at will you know.\n");
	return;
    }
    if (!pvis(mynum)) {
	bprintf("You already are visible\n");
	return;
    }
    setpvis(mynum, 0);
    ar[0] = mynum;
    ar[1] = pvis(mynum);
    sendsys("", "", -9900, 0, (char *)ar);
    bprintf("Ok\n");
    pclrflg(mynum, 9);
    sillycom("\001s%s\001%s suddenly appears in a puff of smoke\n\001");
}

inviscom()
{
    int x;
    int ar[4];

    if (plev(mynum) < 10) {
	bprintf("You can't just turn invisible like that!\n");
	return;
    }
    x = plev(mynum) > 9999 ? 10000 : 10;
	x = 10000;
    if (op(pname(mynum)) && brkword() != -1)
	x = atoi(wordbuf);
    if (EQ(pname(mynum), "Wraistlyn") && brkword() != -1)
	x = atoi(wordbuf);
    if (pvis(mynum) == x) {
	bprintf("You are already invisible\n");
	return;
    }
    setpvis(mynum, x);
    ar[0] = mynum;
    ar[1] = pvis(mynum);
    sendsys("", "", -9900, 0, (char *)ar);
    bprintf("Ok\n");
    psetflg(mynum, 9);
    sillycom("\001c%s vanishes!\n\001");
}

ressurcom()
{
    char bf[80];
    int a;

    if (plev(mynum) < 10) {
	bprintf("Huh ?\n");
	return;
    }
    if (EMPTY(item1)) {
	bprintf("Yes but what ?\n");
	return;
    }
    if ((a = fobn(item1)) == -1) {
	bprintf("You can only ressurect objects\n");
	return;
    }
    if (ospare(a) != -1) {
	bprintf("That already exists\n");
	return;
    }
    oclrbit(a, 0);
    setoloc(a, ploc(mynum), 0);
    sprintf(bf, "The %s suddenly appears\n", oname(a));
    sendsys("", "", -10000, ploc(mynum), bf);
}