- [+] show varpower spell effects in @E
- [+] don't say "you hear xxx" for your pet's footsteps - [+] when hungry, ekrub likes eating animal corpses, rather than killing animals - [+] failed spells now always make spelleffect() return B_TRUE. - [+] stickstosnakes now works on non-wood objects. - [+] light spell can only blind people at high level - [+] amberon shouls accept sacfirice of evil corpses - [+] tweak potion rarity - [+] attacking helpless evil creatures shoudln't anger amberon
This commit is contained in:
parent
5506fdcc86
commit
660481c27e
35
attack.c
35
attack.c
|
@ -220,6 +220,39 @@ int attackcell(lifeform_t *lf, cell_t *c, int force) {
|
||||||
attackedpeaceful = B_TRUE;
|
attackedpeaceful = B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// above average wisdom will prvent you from annoying your god
|
||||||
|
if (getattrbracket(getattr(lf, A_WIS), A_WIS, NULL) >= AT_GTAVERAGE) {
|
||||||
|
if (!force && isplayer(lf)) {
|
||||||
|
enum HELPLESSTYPE how;
|
||||||
|
if (ishelplessvictim(c->lf, lf, &how)) {
|
||||||
|
int dowarning = B_FALSE;
|
||||||
|
if (godprayedto(R_GODPURITY) && (getalignment(c->lf) != AL_EVIL)) {
|
||||||
|
dowarning = B_TRUE;
|
||||||
|
} else if (godprayedto(R_GODMERCY)) {
|
||||||
|
dowarning = B_TRUE;
|
||||||
|
}
|
||||||
|
if (dowarning) {
|
||||||
|
char victimname[BUFLEN],buf[BUFLEN];
|
||||||
|
getlfname(c->lf, victimname);
|
||||||
|
snprintf(buf, BUFLEN, "Really attack the %s %s?",
|
||||||
|
(how == HL_FLEEING) ? "fleeing" : "helpless",
|
||||||
|
noprefix(victimname));
|
||||||
|
if (!warnabout(buf)) {
|
||||||
|
return B_TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!force && isplayer(lf) && (getraceclass(c->lf) == RC_PLANT) && godprayedto(R_GODNATURE)) {
|
||||||
|
char victimname[BUFLEN],buf[BUFLEN];
|
||||||
|
getlfname(c->lf, victimname);
|
||||||
|
snprintf(buf, BUFLEN, "Really attack %s?",victimname);
|
||||||
|
if (!warnabout(buf)) {
|
||||||
|
return B_TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!force && isplayer(lf) && lfhasflag(lf, F_HASNEWLEVEL)) {
|
if (!force && isplayer(lf) && lfhasflag(lf, F_HASNEWLEVEL)) {
|
||||||
if (!warnabout(TEXT_WARN_ATTACK_NOXP)) {
|
if (!warnabout(TEXT_WARN_ATTACK_NOXP)) {
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
|
@ -510,8 +543,8 @@ int attackcell(lifeform_t *lf, cell_t *c, int force) {
|
||||||
}
|
}
|
||||||
} else if (attackedhelpless) {
|
} else if (attackedhelpless) {
|
||||||
angergodmaybe(R_GODMERCY, 50, GA_ATTACKHELPLESS);
|
angergodmaybe(R_GODMERCY, 50, GA_ATTACKHELPLESS);
|
||||||
angergodmaybe(R_GODPURITY, 50, GA_ATTACKHELPLESS);
|
|
||||||
if (getalignment(attacktarget) != AL_EVIL) {
|
if (getalignment(attacktarget) != AL_EVIL) {
|
||||||
|
angergodmaybe(R_GODPURITY, 50, GA_ATTACKHELPLESS);
|
||||||
pleasegodmaybe(R_GODTHIEVES, 5);
|
pleasegodmaybe(R_GODTHIEVES, 5);
|
||||||
pleasegodmaybe(R_GODDEATH, 10);
|
pleasegodmaybe(R_GODDEATH, 10);
|
||||||
}
|
}
|
||||||
|
|
16
data.c
16
data.c
|
@ -2326,10 +2326,10 @@ void initobjects(void) {
|
||||||
addflag(lastot->flags, F_VALUE, 75, NA, NA, NULL);
|
addflag(lastot->flags, F_VALUE, 75, NA, NA, NULL);
|
||||||
|
|
||||||
addot(OT_POT_ETHEREALNESS, "potion of etherealness", "Allows the walker to temporarily pass through walls.", MT_GLASS, 1, OC_POTION, SZ_TINY);
|
addot(OT_POT_ETHEREALNESS, "potion of etherealness", "Allows the walker to temporarily pass through walls.", MT_GLASS, 1, OC_POTION, SZ_TINY);
|
||||||
addflag(lastot->flags, F_RARITY, H_ALL, 70, NA, NULL);
|
addflag(lastot->flags, F_RARITY, H_ALL, 70, RR_RARE, NULL);
|
||||||
addflag(lastot->flags, F_VALUE, 140, NA, NA, NULL);
|
addflag(lastot->flags, F_VALUE, 140, NA, NA, NULL);
|
||||||
addot(OT_POT_EXPERIENCE, "potion of experience", "Instantly grants the imbiber the next experience level.", MT_GLASS, 1, OC_POTION, SZ_TINY);
|
addot(OT_POT_EXPERIENCE, "potion of experience", "Instantly grants the imbiber the next experience level.", MT_GLASS, 1, OC_POTION, SZ_TINY);
|
||||||
addflag(lastot->flags, F_RARITY, H_ALL, 100, NA, NULL);
|
addflag(lastot->flags, F_RARITY, H_ALL, 100, RR_RARE, NULL);
|
||||||
addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, 40, NA, NULL);
|
addflag(lastot->flags, F_AIBOOSTITEM, B_TRUE, 40, NA, NULL);
|
||||||
addflag(lastot->flags, F_VALUE, 210, NA, NA, NULL);
|
addflag(lastot->flags, F_VALUE, 210, NA, NA, NULL);
|
||||||
|
|
||||||
|
@ -3554,6 +3554,7 @@ void initobjects(void) {
|
||||||
addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL);
|
addflag(lastot->flags, F_LOSLOF, B_TRUE, LOF_DONTNEED, NA, NULL);
|
||||||
addot(OT_S_LIGHT, "light area", "Creates a temporary light source centred on the caster.", MT_NOTHING, 0, OC_SPELL, SZ_TINY);
|
addot(OT_S_LIGHT, "light area", "Creates a temporary light source centred on the caster.", MT_NOTHING, 0, OC_SPELL, SZ_TINY);
|
||||||
addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At Power III, you can control where the light appears.");
|
addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At Power III, you can control where the light appears.");
|
||||||
|
addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At Power V, the light will blind creatures with night vision.");
|
||||||
addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At Power VIII, the light becomes permenant.");
|
addflag(lastot->flags, F_EXTRADESC, NA, NA, NA, "At Power VIII, the light becomes permenant.");
|
||||||
addflag(lastot->flags, F_SPELLSCHOOL, SS_MODIFICATION, NA, NA, NULL);
|
addflag(lastot->flags, F_SPELLSCHOOL, SS_MODIFICATION, NA, NA, NULL);
|
||||||
addflag(lastot->flags, F_SPELLSCHOOL, SS_LIFE, NA, NA, NULL);
|
addflag(lastot->flags, F_SPELLSCHOOL, SS_LIFE, NA, NA, NULL);
|
||||||
|
@ -6130,7 +6131,7 @@ void initobjects(void) {
|
||||||
addflag(lastot->flags, F_ARMOURPIERCE, 90, NA, NA, "");
|
addflag(lastot->flags, F_ARMOURPIERCE, 90, NA, NA, "");
|
||||||
addflag(lastot->flags, F_DAM, DT_TOUCH, 1, NA, NULL);
|
addflag(lastot->flags, F_DAM, DT_TOUCH, 1, NA, NULL);
|
||||||
addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL);
|
addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL);
|
||||||
addflag(lastot->flags, F_HITCONFER, F_PARALYZED, SC_CON, 22, "2-4");
|
addflag(lastot->flags, F_HITCONFER, F_PARALYZED, SC_CON, 22, "1-2");
|
||||||
addflag(lastot->flags, F_HITCONFERVALS, B_TRUE, NA, NA, NULL);
|
addflag(lastot->flags, F_HITCONFERVALS, B_TRUE, NA, NA, NULL);
|
||||||
addflag(lastot->flags, F_NOSTRDAMMOD, B_TRUE, NA, NA, NULL);
|
addflag(lastot->flags, F_NOSTRDAMMOD, B_TRUE, NA, NA, NULL);
|
||||||
addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL);
|
addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL);
|
||||||
|
@ -6139,7 +6140,7 @@ void initobjects(void) {
|
||||||
addflag(lastot->flags, F_ARMOURPIERCE, 90, NA, NA, "");
|
addflag(lastot->flags, F_ARMOURPIERCE, 90, NA, NA, "");
|
||||||
addflag(lastot->flags, F_DAM, DT_TOUCH, 1, NA, NULL);
|
addflag(lastot->flags, F_DAM, DT_TOUCH, 1, NA, NULL);
|
||||||
addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL);
|
addflag(lastot->flags, F_ACCURACY, 100, NA, NA, NULL);
|
||||||
addflag(lastot->flags, F_HITCONFER, F_PARALYZED, SC_CON, 30, "5-10");
|
addflag(lastot->flags, F_HITCONFER, F_PARALYZED, SC_CON, 30, "3-5");
|
||||||
addflag(lastot->flags, F_HITCONFERVALS, B_TRUE, NA, NA, NULL);
|
addflag(lastot->flags, F_HITCONFERVALS, B_TRUE, NA, NA, NULL);
|
||||||
addflag(lastot->flags, F_NOSTRDAMMOD, B_TRUE, NA, NA, NULL);
|
addflag(lastot->flags, F_NOSTRDAMMOD, B_TRUE, NA, NA, NULL);
|
||||||
addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL);
|
addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL);
|
||||||
|
@ -6592,8 +6593,8 @@ void initobjects(void) {
|
||||||
addflag(lastot->flags, F_ATTREQ, A_AGI, 65, 80, "10");
|
addflag(lastot->flags, F_ATTREQ, A_AGI, 65, 80, "10");
|
||||||
addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL);
|
addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL);
|
||||||
addot(OT_PITCHFORK, "pitchfork", "A multi-pronged agricultural tool designed to lift loose material. Works as a makeshift weapon.", MT_METAL, 5, OC_WEAPON, SZ_HUMAN);
|
addot(OT_PITCHFORK, "pitchfork", "A multi-pronged agricultural tool designed to lift loose material. Works as a makeshift weapon.", MT_METAL, 5, OC_WEAPON, SZ_HUMAN);
|
||||||
addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, RR_FREQUENT, NULL);
|
addflag(lastot->flags, F_RARITY, H_DUNGEON, 85, RR_COMMON, NULL);
|
||||||
addflag(lastot->flags, F_RARITY, H_FOREST, 85, RR_FREQUENT, NULL);
|
addflag(lastot->flags, F_RARITY, H_FOREST, 85, RR_COMMON, NULL);
|
||||||
addflag(lastot->flags, F_DAM, DT_SLASH, 3, NA, NULL);
|
addflag(lastot->flags, F_DAM, DT_SLASH, 3, NA, NULL);
|
||||||
addflag(lastot->flags, F_ALTDAM, DT_BASH, 3, NA, NULL);
|
addflag(lastot->flags, F_ALTDAM, DT_BASH, 3, NA, NULL);
|
||||||
addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL);
|
addflag(lastot->flags, F_ACCURACY, 80, NA, NA, NULL);
|
||||||
|
@ -7653,6 +7654,7 @@ void initrace(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addflag(lastrace->flags, F_SACRIFICEOBBLESSED, B_CURSED, NA, 5, "OB explode#S in a shower of sparks!");
|
addflag(lastrace->flags, F_SACRIFICEOBBLESSED, B_CURSED, NA, 5, "OB explode#S in a shower of sparks!");
|
||||||
|
addflag(lastrace->flags, F_SACRIFICEOB, OT_CORPSE, NA, 10, "OB IS consumed by a shaft of holy light.");
|
||||||
|
|
||||||
addflag(lastrace->flags, F_CANWILL, OT_S_WISHLIMITED, NA, NA, "pw:10;");
|
addflag(lastrace->flags, F_CANWILL, OT_S_WISHLIMITED, NA, NA, "pw:10;");
|
||||||
addflag(lastrace->flags, F_CANWILL, OT_S_PLANESHIFT, NA, NA, "pw:1;");
|
addflag(lastrace->flags, F_CANWILL, OT_S_PLANESHIFT, NA, NA, "pw:1;");
|
||||||
|
@ -7764,7 +7766,7 @@ void initrace(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addflag(lastrace->flags, F_GODPOISON, B_FALSE, 25, NA, NULL);
|
addflag(lastrace->flags, F_GODPOISON, B_FALSE, 25, NA, NULL);
|
||||||
addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "killing animals when hungry");
|
addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "eating animals when hungry");
|
||||||
addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "killing dragons");
|
addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "killing dragons");
|
||||||
addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "cooking");
|
addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "cooking");
|
||||||
addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "creating objects");
|
addflag(lastrace->flags, F_GODLIKES, NA, NA, NA, "creating objects");
|
||||||
|
|
BIN
data/hiscores.db
BIN
data/hiscores.db
Binary file not shown.
117
god.c
117
god.c
|
@ -464,6 +464,16 @@ void dooffer(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// special case - amberon only accepts evil corpses
|
||||||
|
if (validcorpse && (god->race->id == R_GODPURITY) && (o->type->id == OT_CORPSE)) {
|
||||||
|
flag_t *ff;
|
||||||
|
ff = hasflag(o->flags, F_ALIGNMENT);
|
||||||
|
if (!ff || (ff->val[0] != AL_EVIL)) {
|
||||||
|
validcorpse = B_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (validcorpse) {
|
if (validcorpse) {
|
||||||
ok = B_TRUE;
|
ok = B_TRUE;
|
||||||
thispiety = f->val[2];
|
thispiety = f->val[2];
|
||||||
|
@ -634,14 +644,10 @@ lifeform_t *getrandomgod(void) {
|
||||||
|
|
||||||
// get a random god which player has prayed to
|
// get a random god which player has prayed to
|
||||||
lifeform_t *getrandomprayedgod(void) {
|
lifeform_t *getrandomprayedgod(void) {
|
||||||
int i,nposs = 0;
|
int nposs;
|
||||||
lifeform_t *god,*poss[MAXGODS];
|
lifeform_t *poss[MAXGODS];
|
||||||
for (i = 0; i < ngodlfs; i++) {
|
|
||||||
god = godlf[i];
|
getprayedgods(poss, &nposs);
|
||||||
if (lfhasflag(god, F_PRAYEDTO)) {
|
|
||||||
poss[nposs++] = god;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (nposs == 0) {
|
if (nposs == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -950,12 +956,9 @@ int godgiftmaybe(enum RACE rid, int fromtemple) {
|
||||||
break;
|
break;
|
||||||
case R_GODPURITY:
|
case R_GODPURITY:
|
||||||
while (rollagain) {
|
while (rollagain) {
|
||||||
int n,nposs,i;
|
|
||||||
object_t *poss[MAXCANDIDATES],*o;
|
|
||||||
flag_t *f;
|
flag_t *f;
|
||||||
object_t *wep;
|
|
||||||
rollagain = B_FALSE;
|
rollagain = B_FALSE;
|
||||||
switch (rnd(1,6)) {
|
switch (rnd(1,4)) {
|
||||||
case 1:
|
case 1:
|
||||||
snprintf(obtogive, BUFLEN, "2-4 blessed potions of water");
|
snprintf(obtogive, BUFLEN, "2-4 blessed potions of water");
|
||||||
break;
|
break;
|
||||||
|
@ -965,15 +968,7 @@ int godgiftmaybe(enum RACE rid, int fromtemple) {
|
||||||
case 3:
|
case 3:
|
||||||
snprintf(obtogive, BUFLEN, "wand of turn undead");
|
snprintf(obtogive, BUFLEN, "wand of turn undead");
|
||||||
break;
|
break;
|
||||||
case 4: // bless your weapon
|
case 4: // holy aura
|
||||||
wep = getweapon(player);
|
|
||||||
if (wep && !isblessed(wep)) {
|
|
||||||
blessob(wep);
|
|
||||||
} else {
|
|
||||||
rollagain = B_TRUE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 5: // holy aura
|
|
||||||
if (lfhasflag(player, F_HOLYAURA)) {
|
if (lfhasflag(player, F_HOLYAURA)) {
|
||||||
rollagain = B_TRUE;
|
rollagain = B_TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
@ -983,23 +978,7 @@ int godgiftmaybe(enum RACE rid, int fromtemple) {
|
||||||
f->obfrom = god->race->id;
|
f->obfrom = god->race->id;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6: // bless 1-3 obs
|
|
||||||
nposs = 0;
|
|
||||||
n = rnd(1,3); // num to bless
|
|
||||||
for (o = player->pack->first ; o ; o = o->next) {
|
|
||||||
if (!isblessed(o)) {
|
|
||||||
poss[nposs++] = o;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (nposs < n) n = nposs;
|
|
||||||
for (i = 0; i < n; i++) {
|
|
||||||
o = poss[rnd(0,nposs-1)];
|
|
||||||
while (isblessed(o)) {
|
|
||||||
o = poss[rnd(0,nposs-1)];
|
|
||||||
}
|
|
||||||
blessob(o);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1377,18 +1356,55 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
|
||||||
blessob(o);
|
blessob(o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// smite evil
|
|
||||||
for (l = lf->cell->map->lf ; l ; l = l->next) {
|
// cure poison
|
||||||
if (getalignment(l) == AL_EVIL) {
|
if (ispoisoned(lf)) {
|
||||||
if (haslof(lf->cell, l->cell, LOF_WALLSTOP, NULL)) {
|
dospelleffects(god, OT_S_CUREPOISON, 10, lf, NULL, lf->cell, B_UNCURSED, NULL, B_FALSE);
|
||||||
// smite them
|
}
|
||||||
castspell(god, OT_S_SMITEEVIL, l, NULL, l->cell, NULL, NULL);
|
|
||||||
|
if (isinbattle(lf, B_TRUE)) {
|
||||||
|
// smite evil
|
||||||
|
for (l = lf->cell->map->lf ; l ; l = l->next) {
|
||||||
|
if (getalignment(l) == AL_EVIL) {
|
||||||
|
if (haslof(lf->cell, l->cell, LOF_WALLSTOP, NULL)) {
|
||||||
|
// smite them
|
||||||
|
castspell(god, OT_S_SMITEEVIL, l, NULL, l->cell, NULL, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// turn undead
|
||||||
|
castspell(god, OT_S_TURNUNDEAD, lf, NULL, NULL, NULL, NULL);
|
||||||
|
} else {
|
||||||
|
object_t *wep;
|
||||||
|
int donesomething = B_FALSE;
|
||||||
|
wep = getweapon(player);
|
||||||
|
if (wep && !isblessed(wep)) {
|
||||||
|
blessob(wep);
|
||||||
|
donesomething = B_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!donesomething) {
|
||||||
|
int nposs = 0, n;
|
||||||
|
object_t *o,*poss[MAXCANDIDATES];
|
||||||
|
// bless 1-3 obs
|
||||||
|
nposs = 0;
|
||||||
|
n = rnd(1,3); // num to bless
|
||||||
|
for (o = player->pack->first ; o ; o = o->next) {
|
||||||
|
if (!isblessed(o) && !hasflag(o->flags, F_NOBLESS)) {
|
||||||
|
poss[nposs++] = o;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nposs < n) n = nposs;
|
||||||
|
for (i = 0; i < n; i++) {
|
||||||
|
o = poss[rnd(0,nposs-1)];
|
||||||
|
while (isblessed(o)) {
|
||||||
|
o = poss[rnd(0,nposs-1)];
|
||||||
|
}
|
||||||
|
blessob(o);
|
||||||
|
donesomething = B_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// turn undead
|
|
||||||
castspell(god, OT_S_TURNUNDEAD, lf, NULL, NULL, NULL, NULL);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case R_GODDEATH:
|
case R_GODDEATH:
|
||||||
msg("\"Behold, the power of death!\"");
|
msg("\"Behold, the power of death!\"");
|
||||||
|
@ -1727,6 +1743,13 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (god->race->id == R_GODNATURE) {
|
||||||
|
addob(lf->cell->obpile, "flower");
|
||||||
|
if (haslos(player, lf->cell)) {
|
||||||
|
msg("A beautiful flower grows from the ground.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!godgiftmaybe(god->race->id, B_FALSE)) {
|
if (!godgiftmaybe(god->race->id, B_FALSE)) {
|
||||||
// if you didn't get a gift, lower piety for this god
|
// if you didn't get a gift, lower piety for this god
|
||||||
|
|
21
io.c
21
io.c
|
@ -4848,8 +4848,15 @@ char *makedesc_god(lifeform_t *god, char *retbuf) {
|
||||||
|
|
||||||
if (retflag[i]->val[1] == NA) {
|
if (retflag[i]->val[1] == NA) {
|
||||||
objecttype_t *ot;
|
objecttype_t *ot;
|
||||||
|
char *text;
|
||||||
ot = findot(retflag[i]->val[0]);
|
ot = findot(retflag[i]->val[0]);
|
||||||
sprintf(thisline, "- %s\n", ot->name);
|
text = makeplural(ot->name);
|
||||||
|
sprintf(thisline, "- %s", text);
|
||||||
|
free(text);
|
||||||
|
if ((god->race->id == R_GODPURITY) && (retflag[i]->val[0] == OT_CORPSE)){
|
||||||
|
strcat(thisline, " of evil creatures");
|
||||||
|
}
|
||||||
|
strcat(thisline, "\n");
|
||||||
strncat(retbuf, thisline, HUGEBUFLEN);
|
strncat(retbuf, thisline, HUGEBUFLEN);
|
||||||
} else {
|
} else {
|
||||||
raceclass_t *rc;
|
raceclass_t *rc;
|
||||||
|
@ -11399,12 +11406,22 @@ void showlfstats(lifeform_t *lf, int showall) {
|
||||||
objecttype_t *sp;
|
objecttype_t *sp;
|
||||||
sp = findot(f->val[0]);
|
sp = findot(f->val[0]);
|
||||||
if (sp) {
|
if (sp) {
|
||||||
|
char thisline[BUFLEN];
|
||||||
|
char desc[BUFLEN];
|
||||||
if (nfound == 0) {
|
if (nfound == 0) {
|
||||||
mvwprintw(mainwin, y, 0, "%s %s the following spells active:", you(lf),
|
mvwprintw(mainwin, y, 0, "%s %s the following spells active:", you(lf),
|
||||||
isplayer(lf) ? "have" : "has");
|
isplayer(lf) ? "have" : "has");
|
||||||
y++;
|
y++;
|
||||||
}
|
}
|
||||||
mvwprintw(mainwin, y, 0, " - %s %s (consuming %d MP)", sp->name, roman(f->val[2]), f->val[1]);
|
sprintf(thisline, " - %s %s (consuming %d MP", sp->name, roman(f->val[2]), f->val[1]);
|
||||||
|
getspelldesc(f->val[0], f->val[2], desc);
|
||||||
|
if (strlen(desc)) {
|
||||||
|
strcat(thisline, ", ");
|
||||||
|
strcat(thisline, desc);
|
||||||
|
}
|
||||||
|
strcat(thisline, ")");
|
||||||
|
|
||||||
|
mvwprintw(mainwin, y, 0, "%s", desc);
|
||||||
y++;
|
y++;
|
||||||
nfound++;
|
nfound++;
|
||||||
}
|
}
|
||||||
|
|
29
lf.c
29
lf.c
|
@ -1603,7 +1603,7 @@ int castspell(lifeform_t *lf, enum OBTYPE sid, lifeform_t *targlf, object_t *tar
|
||||||
thiscost = getmpcost(lf, sid) * i;
|
thiscost = getmpcost(lf, sid) * i;
|
||||||
if (lf->mp >= thiscost) {
|
if (lf->mp >= thiscost) {
|
||||||
snprintf(buf, BUFLEN, "Power %s (%d MP)", roman(i), thiscost);
|
snprintf(buf, BUFLEN, "Power %s (%d MP)", roman(i), thiscost);
|
||||||
getvarpowerspelldesc(sp->id, i, desc);
|
getspelldesc(sp->id, i, desc);
|
||||||
if (strlen(desc)) {
|
if (strlen(desc)) {
|
||||||
strcat(buf, "\t");
|
strcat(buf, "\t");
|
||||||
strcat(buf, desc);
|
strcat(buf, desc);
|
||||||
|
@ -2551,11 +2551,6 @@ void die(lifeform_t *lf) {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (lf->race->raceclass->id) {
|
switch (lf->race->raceclass->id) {
|
||||||
case RC_ANIMAL:
|
|
||||||
if (gethungerlevel(gethungerval(player)) > H_NONE) {
|
|
||||||
pleasegodmaybe(R_GODNATURE, 3);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case RC_DRAGON:
|
case RC_DRAGON:
|
||||||
pleasegodmaybe(R_GODNATURE, 50);
|
pleasegodmaybe(R_GODNATURE, 50);
|
||||||
break;
|
break;
|
||||||
|
@ -2695,6 +2690,8 @@ void die(lifeform_t *lf) {
|
||||||
copyflag(corpse->flags, lf->flags, F_DTVULN);
|
copyflag(corpse->flags, lf->flags, F_DTVULN);
|
||||||
copyflag(corpse->flags, lf->flags, F_DTRESIST);
|
copyflag(corpse->flags, lf->flags, F_DTRESIST);
|
||||||
copyflag(corpse->flags, lf->flags, F_DTIMMUNE);
|
copyflag(corpse->flags, lf->flags, F_DTIMMUNE);
|
||||||
|
// inherit alighnment
|
||||||
|
copyflag(corpse->flags, lf->flags, F_ALIGNMENT);
|
||||||
|
|
||||||
// some corpses will regenerate...
|
// some corpses will regenerate...
|
||||||
if (copyflag(corpse->flags, lf->flags, F_REVIVETIMER)) {
|
if (copyflag(corpse->flags, lf->flags, F_REVIVETIMER)) {
|
||||||
|
@ -3537,6 +3534,21 @@ int eat(lifeform_t *lf, object_t *o) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isplayer(lf)) makeknown(o->type->id);
|
if (isplayer(lf)) makeknown(o->type->id);
|
||||||
|
|
||||||
|
if (isplayer(lf)) {
|
||||||
|
flag_t *f;
|
||||||
|
f = hasflag(o->flags, F_CORPSEOF);
|
||||||
|
if (f) {
|
||||||
|
race_t *r;
|
||||||
|
r = findrace(f->val[0]);
|
||||||
|
if (r && (r->raceclass->id == RC_ANIMAL)) {
|
||||||
|
if (gethungerlevel(gethungerval(lf)) > H_NONE) {
|
||||||
|
pleasegodmaybe(R_GODNATURE, 5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // end if fullyeaten
|
} // end if fullyeaten
|
||||||
|
|
||||||
// take time
|
// take time
|
||||||
|
@ -13712,6 +13724,8 @@ int noise(cell_t *c, lifeform_t *noisemaker, enum NOISECLASS nclass, int volume,
|
||||||
msg("%s", seetext);
|
msg("%s", seetext);
|
||||||
rv = B_TRUE;
|
rv = B_TRUE;
|
||||||
}
|
}
|
||||||
|
} else if (noisemaker && ispetof(noisemaker, player)) {
|
||||||
|
rv = B_FALSE;
|
||||||
} else if (text && !isdeaf(l) && ((nclass != NC_MOVEMENT) || !lfhasflag(l, F_DONELISTEN))) {
|
} else if (text && !isdeaf(l) && ((nclass != NC_MOVEMENT) || !lfhasflag(l, F_DONELISTEN))) {
|
||||||
// this means you can only hear one 'walk' sound per turn
|
// this means you can only hear one 'walk' sound per turn
|
||||||
char textnopunc[BUFLEN];
|
char textnopunc[BUFLEN];
|
||||||
|
@ -16096,7 +16110,8 @@ int real_skillcheck(lifeform_t *lf, enum CHECKTYPE ct, int diff, int mod, int *r
|
||||||
}
|
}
|
||||||
|
|
||||||
// level modifier
|
// level modifier
|
||||||
levmod = (gethitdice(lf) / 3);
|
//levmod = (gethitdice(lf) / 3);
|
||||||
|
levmod = (gethitdice(lf) / 2);
|
||||||
|
|
||||||
// other modifiers
|
// other modifiers
|
||||||
if (ct == SC_CLIMB) {
|
if (ct == SC_CLIMB) {
|
||||||
|
|
238
spell.c
238
spell.c
|
@ -2812,6 +2812,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
||||||
msg("%s is now a %s.", lfname, j->name);
|
msg("%s is now a %s.", lfname, j->name);
|
||||||
} else {
|
} else {
|
||||||
fizzle(user);
|
fizzle(user);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
msg("There is nobody there!");
|
msg("There is nobody there!");
|
||||||
|
@ -3475,6 +3476,17 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// worshipers of ekrub gain power from piety
|
||||||
|
if (isplayer(caster) && godprayedto(R_GODNATURE) &&
|
||||||
|
(hasflagval(sp->flags, F_SPELLSCHOOL, SS_NATURE, NA, NA, NULL))) {
|
||||||
|
enum PIETYLEV pl;
|
||||||
|
pl = getpietylev(R_GODNATURE, NULL, NULL);
|
||||||
|
if (pl >= PL_PLEASED) {
|
||||||
|
power += pl;
|
||||||
|
limit(&power, NA, 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// special: spit attacks need an animation
|
// special: spit attacks need an animation
|
||||||
casttype = lfhasflag(caster, F_CASTTYPE);
|
casttype = lfhasflag(caster, F_CASTTYPE);
|
||||||
if (casttype && (casttype->val[0] == CT_EYESPIT)) {
|
if (casttype && (casttype->val[0] == CT_EYESPIT)) {
|
||||||
|
@ -3601,6 +3613,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
gainmp(caster, howmuch);
|
gainmp(caster, howmuch);
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_AIRBLAST) {
|
} else if (spellid == OT_S_AIRBLAST) {
|
||||||
int dir;
|
int dir;
|
||||||
|
@ -3695,6 +3708,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_ANIMATEMETAL) {
|
} else if (spellid == OT_S_ANIMATEMETAL) {
|
||||||
object_t *o;
|
object_t *o;
|
||||||
|
@ -3710,6 +3724,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
msg("Your %s is not metal, therefore unaffected.", noprefix(obname));
|
msg("Your %s is not metal, therefore unaffected.", noprefix(obname));
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
return B_FALSE;
|
return B_FALSE;
|
||||||
} else if (o->amt != 1) {
|
} else if (o->amt != 1) {
|
||||||
|
@ -3717,6 +3732,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
msg("Your %s wobbles a little.", obname);
|
msg("Your %s wobbles a little.", obname);
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
return B_FALSE;
|
return B_FALSE;
|
||||||
}
|
}
|
||||||
|
@ -3733,9 +3749,11 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_ANIMATESTATUE) {
|
} else if (spellid == OT_S_ANIMATESTATUE) {
|
||||||
object_t *o;
|
object_t *o;
|
||||||
|
@ -3749,7 +3767,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
return B_FALSE;
|
return B_FALSE;
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3763,7 +3781,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
f = hasflag(o->flags, F_CORPSEOF);
|
f = hasflag(o->flags, F_CORPSEOF);
|
||||||
if (!f) {
|
if (!f) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
// add it!
|
// add it!
|
||||||
getobname(o, obname, 1);
|
getobname(o, obname, 1);
|
||||||
|
@ -3782,7 +3800,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (isplayer(caster)) pleasegodmaybe(R_GODNATURE, 25);
|
if (isplayer(caster)) pleasegodmaybe(R_GODNATURE, 25);
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_APPORTATION) {
|
} else if (spellid == OT_S_APPORTATION) {
|
||||||
int failed = B_FALSE;
|
int failed = B_FALSE;
|
||||||
|
@ -3847,6 +3865,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (failed) {
|
if (failed) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_AWARENESS) {
|
} else if (spellid == OT_S_AWARENESS) {
|
||||||
flag_t *f;
|
flag_t *f;
|
||||||
|
@ -3888,14 +3907,14 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// does caster have a weapon?
|
// does caster have a weapon?
|
||||||
wep = getweapon(target);
|
wep = getweapon(target);
|
||||||
if (!wep) {
|
if (!wep) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
if (isplayer(target)) {
|
if (isplayer(target)) {
|
||||||
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
||||||
|
@ -3910,7 +3929,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (isblind(target)) {
|
if (isblind(target)) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spellresisted(target, caster, spellid, power, seenbyplayer, B_FALSE)) {
|
if (spellresisted(target, caster, spellid, power, seenbyplayer, B_FALSE)) {
|
||||||
|
@ -3936,6 +3955,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_BLINK) {
|
} else if (spellid == OT_S_BLINK) {
|
||||||
cell_t *poss[MAXCANDIDATES];
|
cell_t *poss[MAXCANDIDATES];
|
||||||
|
@ -4086,6 +4106,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
nothinghappens();
|
nothinghappens();
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
howlong = getspellduration(20,30,blessed) + (power*10);
|
howlong = getspellduration(20,30,blessed) + (power*10);
|
||||||
|
@ -4104,7 +4125,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// which object to take?
|
// which object to take?
|
||||||
|
@ -4153,6 +4174,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
moveob(targob, caster->pack, ALL);
|
moveob(targob, caster->pack, ALL);
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_CALLLIGHTNING) {
|
} else if (spellid == OT_S_CALLLIGHTNING) {
|
||||||
int failed = B_FALSE;
|
int failed = B_FALSE;
|
||||||
|
@ -4182,6 +4204,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (failed) {
|
if (failed) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_CALLWIND) {
|
} else if (spellid == OT_S_CALLWIND) {
|
||||||
int failed = B_FALSE;
|
int failed = B_FALSE;
|
||||||
|
@ -4239,6 +4262,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (failed) {
|
if (failed) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_CALMANIMALS) {
|
} else if (spellid == OT_S_CALMANIMALS) {
|
||||||
int i,ncalmed = 0;
|
int i,ncalmed = 0;
|
||||||
|
@ -4289,6 +4313,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (!donesomething) {
|
if (!donesomething) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_CALMINGSCENT) {
|
} else if (spellid == OT_S_CALMINGSCENT) {
|
||||||
// just announce
|
// just announce
|
||||||
|
@ -4410,7 +4435,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (targcell->type->solid) {
|
if (targcell->type->solid) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
radius = (power/4)+1;
|
radius = (power/4)+1;
|
||||||
|
|
||||||
|
@ -4427,7 +4452,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
getlfname(target, targetname);
|
getlfname(target, targetname);
|
||||||
|
|
||||||
|
@ -4461,13 +4486,13 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (getallegiance(caster) == AL_PEACEFUL) {
|
if (getallegiance(caster) == AL_PEACEFUL) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
if (ispetof(target, caster)) {
|
if (ispetof(target, caster)) {
|
||||||
if (isplayer(caster)) {
|
if (isplayer(caster)) {
|
||||||
msg("%s is already allied with you!",targetname);
|
msg("%s is already allied with you!",targetname);
|
||||||
}
|
}
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spellresisted(target, caster, spellid, power, seenbyplayer, B_TRUE)) {
|
if (spellresisted(target, caster, spellid, power, seenbyplayer, B_TRUE)) {
|
||||||
|
@ -4494,14 +4519,14 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
getlfname(target, targetname);
|
getlfname(target, targetname);
|
||||||
|
|
||||||
// only animals
|
// only animals
|
||||||
if (getraceclass(target) != RC_ANIMAL) {
|
if (getraceclass(target) != RC_ANIMAL) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ischarmable(target)) {
|
if (!ischarmable(target)) {
|
||||||
|
@ -4526,13 +4551,13 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (getallegiance(caster) == AL_PEACEFUL) {
|
if (getallegiance(caster) == AL_PEACEFUL) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
if (ispetof(target, caster)) {
|
if (ispetof(target, caster)) {
|
||||||
if (isplayer(caster)) {
|
if (isplayer(caster)) {
|
||||||
msg("%s is already allied with you!",targetname);
|
msg("%s is already allied with you!",targetname);
|
||||||
}
|
}
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// no saving throw, just depends on hit dice.
|
// no saving throw, just depends on hit dice.
|
||||||
|
@ -4564,7 +4589,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
getlfname(target, lfname);
|
getlfname(target, lfname);
|
||||||
|
|
||||||
|
@ -4887,7 +4912,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (!donesomething) {
|
if (!donesomething) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
stopspell(caster, spellid);
|
stopspell(caster, spellid);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (spellid == OT_S_CRYSTALSHIELD) {
|
} else if (spellid == OT_S_CRYSTALSHIELD) {
|
||||||
|
@ -4897,7 +4922,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (getequippedob(target->pack, BP_SECWEAPON)) {
|
if (getequippedob(target->pack, BP_SECWEAPON)) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
stopspell(caster, spellid);
|
stopspell(caster, spellid);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
o = addob(target->pack, "ice crystal shield");
|
o = addob(target->pack, "ice crystal shield");
|
||||||
if (o) {
|
if (o) {
|
||||||
|
@ -4931,17 +4956,18 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
killob(o);
|
killob(o);
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
stopspell(caster, spellid);
|
stopspell(caster, spellid);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
stopspell(caster, spellid);
|
stopspell(caster, spellid);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_CUREPOISON) {
|
} else if (spellid == OT_S_CUREPOISON) {
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
killflagsofid(target->flags, F_POISONED);
|
killflagsofid(target->flags, F_POISONED);
|
||||||
|
|
||||||
|
@ -5370,6 +5396,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
msg("Some nearby liquid evaporates!");
|
msg("Some nearby liquid evaporates!");
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (spellid == OT_S_EXPLODEMETAL) {
|
} else if (spellid == OT_S_EXPLODEMETAL) {
|
||||||
|
@ -5401,6 +5428,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_DISPERSAL) {
|
} else if (spellid == OT_S_DISPERSAL) {
|
||||||
cell_t *c = NULL;
|
cell_t *c = NULL;
|
||||||
|
@ -5486,7 +5514,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
getlfname(target, lfname);
|
getlfname(target, lfname);
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isimmuneto(target->flags, DT_NECROTIC, B_FALSE)) {
|
if (!isimmuneto(target->flags, DT_NECROTIC, B_FALSE)) {
|
||||||
|
@ -5619,6 +5647,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_FLASH) {
|
} else if (spellid == OT_S_FLASH) {
|
||||||
if (isplayer(caster) || cansee(player, caster)) {
|
if (isplayer(caster) || cansee(player, caster)) {
|
||||||
|
@ -5719,6 +5748,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (failed) {
|
if (failed) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_FORCESPHERE) {
|
} else if (spellid == OT_S_FORCESPHERE) {
|
||||||
cell_t *retcell[MAXRETCELLS];
|
cell_t *retcell[MAXRETCELLS];
|
||||||
|
@ -5895,6 +5925,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (failed) {
|
if (failed) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_FIREDART) {
|
} else if (spellid == OT_S_FIREDART) {
|
||||||
char lfname[BUFLEN];
|
char lfname[BUFLEN];
|
||||||
|
@ -5993,6 +6024,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (failed) {
|
if (failed) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_EARTHQUAKE) {
|
} else if (spellid == OT_S_EARTHQUAKE) {
|
||||||
cell_t *retcell[MAXRETCELLS],*c;
|
cell_t *retcell[MAXRETCELLS],*c;
|
||||||
|
@ -6080,7 +6112,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
f = addtempflag(caster->flags, F_DTRESIST, DT_FIRE, NA, NA, NULL, FROMSPELL);
|
f = addtempflag(caster->flags, F_DTRESIST, DT_FIRE, NA, NA, NULL, FROMSPELL);
|
||||||
|
@ -6281,7 +6313,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
getlfname(target, lfname);
|
getlfname(target, lfname);
|
||||||
|
|
||||||
|
@ -6347,7 +6379,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
int radius;
|
int radius;
|
||||||
if (targcell->type->solid) {
|
if (targcell->type->solid) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
radius = power/2;
|
radius = power/2;
|
||||||
if (radius < 1) radius = 1;
|
if (radius < 1) radius = 1;
|
||||||
|
@ -6419,6 +6451,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (failed) {
|
if (failed) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_HASTE) {
|
} else if (spellid == OT_S_HASTE) {
|
||||||
int howlong = 15;
|
int howlong = 15;
|
||||||
|
@ -6426,7 +6459,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (haslos(player, target->cell)) {
|
if (haslos(player, target->cell)) {
|
||||||
|
@ -6450,7 +6483,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// cure certain bad effects
|
// cure certain bad effects
|
||||||
|
@ -6656,6 +6689,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
nothinghappens();
|
nothinghappens();
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_HOLDPORTAL) {
|
} else if (spellid == OT_S_HOLDPORTAL) {
|
||||||
|
@ -6665,7 +6699,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (!o) {
|
if (!o) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// move any objects which are in the way (but not lfs)
|
// move any objects which are in the way (but not lfs)
|
||||||
|
@ -6689,7 +6723,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isplayer(target)) {
|
if (isplayer(target)) {
|
||||||
|
@ -6722,14 +6756,14 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// does caster have a weapon?
|
// does caster have a weapon?
|
||||||
wep = getweapon(target);
|
wep = getweapon(target);
|
||||||
if (!wep) {
|
if (!wep) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
getobname(wep, obname, wep->amt);
|
getobname(wep, obname, wep->amt);
|
||||||
|
@ -6797,7 +6831,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (!donesomething) {
|
if (!donesomething) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (spellid == OT_S_IDENTIFY) {
|
} else if (spellid == OT_S_IDENTIFY) {
|
||||||
|
@ -6957,7 +6991,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
msg("Your %s pulls away from you a little.", noprefix(buf));
|
msg("Your %s pulls away from you a little.", noprefix(buf));
|
||||||
}
|
}
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7060,6 +7094,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
gainhp(caster, howmuch);
|
gainhp(caster, howmuch);
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_MINDSCAN) {
|
} else if (spellid == OT_S_MINDSCAN) {
|
||||||
int failed = B_FALSE;
|
int failed = B_FALSE;
|
||||||
|
@ -7095,6 +7130,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (failed) {
|
if (failed) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_NULLIFY) {
|
} else if (spellid == OT_S_NULLIFY) {
|
||||||
flag_t *retflag[MAXCANDIDATES],*poss[MAXCANDIDATES],*f;
|
flag_t *retflag[MAXCANDIDATES],*poss[MAXCANDIDATES],*f;
|
||||||
|
@ -7102,6 +7138,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isplayer(target)) {
|
if (isplayer(target)) {
|
||||||
|
@ -7373,7 +7410,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (lfhasflag(target, F_PAIN)) {
|
if (lfhasflag(target, F_PAIN)) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spellresisted(target, caster, spellid, power, seenbyplayer, B_FALSE)) {
|
if (spellresisted(target, caster, spellid, power, seenbyplayer, B_FALSE)) {
|
||||||
|
@ -7401,6 +7438,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_PETRIFY) {
|
} else if (spellid == OT_S_PETRIFY) {
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
|
@ -7408,10 +7446,10 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
// some thigns can't be stoned
|
// some thigns can't be stoned
|
||||||
if (!lfcanbestoned(target)) {
|
if (!lfcanbestoned(target)) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
} else if (lfhasflag(target, F_BEINGSTONED)) {
|
} else if (lfhasflag(target, F_BEINGSTONED)) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// savingthrow
|
// savingthrow
|
||||||
|
@ -7461,7 +7499,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
getlfname(target, targname);
|
getlfname(target, targname);
|
||||||
|
|
||||||
|
@ -7632,6 +7670,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (!donesomething) {
|
if (!donesomething) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (targcell->obpile->first) { // no lifeform there
|
} else if (targcell->obpile->first) { // no lifeform there
|
||||||
targob = NULL;
|
targob = NULL;
|
||||||
|
@ -7654,9 +7693,11 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_GATE) {
|
} else if (spellid == OT_S_GATE) {
|
||||||
|
@ -7679,6 +7720,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if ((newdepth < min) || (newdepth > max)) {
|
if ((newdepth < min) || (newdepth > max)) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
} else {
|
} else {
|
||||||
cell_t *srccell;
|
cell_t *srccell;
|
||||||
object_t *srcportal,*dstportal;
|
object_t *srcportal,*dstportal;
|
||||||
|
@ -7687,7 +7729,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
srccell = real_getrandomadjcell(caster->cell, WE_WALKABLE, B_ALLOWEXPAND, LOF_NEED, NULL, caster);
|
srccell = real_getrandomadjcell(caster->cell, WE_WALKABLE, B_ALLOWEXPAND, LOF_NEED, NULL, caster);
|
||||||
if (!srccell) {
|
if (!srccell) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
// create the source portal
|
// create the source portal
|
||||||
srcportal = addobfast(srccell->obpile, OT_PORTAL);
|
srcportal = addobfast(srccell->obpile, OT_PORTAL);
|
||||||
|
@ -7816,10 +7858,10 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
} else if ( lfhasflag(target, F_INVISIBLE) ) {
|
} else if ( lfhasflag(target, F_INVISIBLE) ) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
getlfname(target, targname);
|
getlfname(target, targname);
|
||||||
|
|
||||||
|
@ -7851,6 +7893,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
losehp(target, dam, DT_ELECTRIC, caster, "a jolt of electricity");
|
losehp(target, dam, DT_ELECTRIC, caster, "a jolt of electricity");
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_KNOCK) {
|
} else if (spellid == OT_S_KNOCK) {
|
||||||
object_t *o;
|
object_t *o;
|
||||||
|
@ -7903,6 +7946,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (isplayer(caster)) pleasegodmaybe(R_GODTHIEVES, 5);
|
if (isplayer(caster)) pleasegodmaybe(R_GODTHIEVES, 5);
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -7949,11 +7993,13 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
// (player last)
|
// (player last)
|
||||||
for (l = caster->cell->map->lf ; l ; l = l->next) {
|
for (l = caster->cell->map->lf ; l ; l = l->next) {
|
||||||
if (!isplayer(l) && haslos(l, caster->cell)) {
|
if (!isplayer(l) && haslos(l, caster->cell)) {
|
||||||
if (lfhasflag(l, F_SEEINDARK)) {
|
if (power >= 5) {
|
||||||
// if you don't have eyes, your'e safe!
|
if (lfhasflag(l, F_SEEINDARK)) {
|
||||||
if (!lfhasflagval(l, F_NOBODYPART, BP_EYES, NA, NA, NULL)) {
|
// if you don't have eyes, your'e safe!
|
||||||
// blind for 1-3 turns
|
if (!lfhasflagval(l, F_NOBODYPART, BP_EYES, NA, NA, NULL)) {
|
||||||
addtempflag(l->flags, F_BLIND, B_TRUE, NA, NA, NULL, rnd(3,5));
|
// blind for 1-3 turns
|
||||||
|
addtempflag(l->flags, F_BLIND, B_TRUE, NA, NA, NULL, rnd(3,5));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// undead will flee from light
|
// undead will flee from light
|
||||||
|
@ -8079,6 +8125,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_LOCATEOBJECT) {
|
} else if (spellid == OT_S_LOCATEOBJECT) {
|
||||||
char wantname[BUFLEN];
|
char wantname[BUFLEN];
|
||||||
|
@ -8088,7 +8135,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (!isplayer(caster)) {
|
if (!isplayer(caster)) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
// ask for object
|
// ask for object
|
||||||
askstring("Locate what kind of object", '?', wantname, BUFLEN, NULL);
|
askstring("Locate what kind of object", '?', wantname, BUFLEN, NULL);
|
||||||
|
@ -8189,7 +8236,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
}
|
}
|
||||||
if (prompt.nchoices == 0) {
|
if (prompt.nchoices == 0) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
getchoice(&prompt);
|
getchoice(&prompt);
|
||||||
|
@ -8202,7 +8249,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
msg("New knowledge floods into your mind!");
|
msg("New knowledge floods into your mind!");
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_GRAVBOOST) {
|
} else if (spellid == OT_S_GRAVBOOST) {
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
|
@ -8243,6 +8290,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
addtempflag(target->flags, F_GRAVBOOSTED, B_TRUE, NA, NA, NULL, howlong);
|
addtempflag(target->flags, F_GRAVBOOSTED, B_TRUE, NA, NA, NULL, howlong);
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_GRAVLOWER) {
|
} else if (spellid == OT_S_GRAVLOWER) {
|
||||||
flag_t *f;
|
flag_t *f;
|
||||||
|
@ -8433,7 +8481,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
getlfname(target, targetname);
|
getlfname(target, targetname);
|
||||||
|
|
||||||
|
@ -8754,12 +8802,14 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
}
|
}
|
||||||
if (!donesomething) {
|
if (!donesomething) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_QUENCH) {
|
} else if (spellid == OT_S_QUENCH) {
|
||||||
object_t *o,*nexto;
|
object_t *o,*nexto;
|
||||||
int ndone = 0;
|
int ndone = 0;
|
||||||
if (!targcell) {
|
if (!targcell) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targcell->lf) {
|
if (targcell->lf) {
|
||||||
|
@ -8807,6 +8857,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
}
|
}
|
||||||
if (!ndone) {
|
if (!ndone) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_QUICKENSTONE) {
|
} else if (spellid == OT_S_QUICKENSTONE) {
|
||||||
int howmany,i,n,sel,nposs = 0,nseen = 0;
|
int howmany,i,n,sel,nposs = 0,nseen = 0;
|
||||||
|
@ -8857,7 +8908,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (f = target->flags->first ; f ; f = f->next) {
|
for (f = target->flags->first ; f ; f = f->next) {
|
||||||
|
@ -8878,6 +8929,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
if (ndone && isplayer(caster) && !frompot) {
|
if (ndone && isplayer(caster) && !frompot) {
|
||||||
pleasegodmaybe(R_GODMERCY, 3);
|
pleasegodmaybe(R_GODMERCY, 3);
|
||||||
|
@ -8887,7 +8939,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
amttolose = power*2;
|
amttolose = power*2;
|
||||||
if (isplayer(target)) {
|
if (isplayer(target)) {
|
||||||
|
@ -9091,6 +9143,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
snprintf(buf, BUFLEN, "%s%s shatter spell", castername, getpossessive(castername));
|
snprintf(buf, BUFLEN, "%s%s shatter spell", castername, getpossessive(castername));
|
||||||
if (!shattercell(targcell, caster, buf)) {
|
if (!shattercell(targcell, caster, buf)) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_SIXTHSENSE) {
|
} else if (spellid == OT_S_SIXTHSENSE) {
|
||||||
if (isplayer(caster)) {
|
if (isplayer(caster)) {
|
||||||
|
@ -9185,6 +9238,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (failed) {
|
if (failed) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_SLIDE) {
|
} else if (spellid == OT_S_SLIDE) {
|
||||||
flag_t *f;
|
flag_t *f;
|
||||||
|
@ -9258,6 +9312,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_SNOWBALL) {
|
} else if (spellid == OT_S_SNOWBALL) {
|
||||||
int failed = B_FALSE;
|
int failed = B_FALSE;
|
||||||
|
@ -9315,6 +9370,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (failed) {
|
if (failed) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_SOFTENEARTH) {
|
} else if (spellid == OT_S_SOFTENEARTH) {
|
||||||
int seen = B_FALSE;
|
int seen = B_FALSE;
|
||||||
|
@ -9357,6 +9413,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_SPARK) {
|
} else if (spellid == OT_S_SPARK) {
|
||||||
object_t *o,*nexto;
|
object_t *o,*nexto;
|
||||||
|
@ -9531,8 +9588,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (cansee(caster, c->lf)) {
|
if (cansee(caster, c->lf)) {
|
||||||
for (o = c->lf->pack->first ; o ; o = nexto) {
|
for (o = c->lf->pack->first ; o ; o = nexto) {
|
||||||
nexto = o->next;
|
nexto = o->next;
|
||||||
if ((o->material->id == MT_WOOD) &&
|
if ( hasflag(o->flags, F_RODSHAPED) &&
|
||||||
hasflag(o->flags, F_RODSHAPED) &&
|
|
||||||
isequipped(o) &&
|
isequipped(o) &&
|
||||||
(o->blessed == B_UNCURSED) &&
|
(o->blessed == B_UNCURSED) &&
|
||||||
!hasflag(o->flags, F_HASBRAND)) {
|
!hasflag(o->flags, F_HASBRAND)) {
|
||||||
|
@ -9551,6 +9607,9 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
noprefix(obname));
|
noprefix(obname));
|
||||||
killflagsofid(snake->flags, F_XPVAL);
|
killflagsofid(snake->flags, F_XPVAL);
|
||||||
addflag(snake->flags, F_XPVAL, 0, NA, NA, NULL);
|
addflag(snake->flags, F_XPVAL, 0, NA, NA, NULL);
|
||||||
|
killflagsofid(snake->flags, F_FLEEONDAM);
|
||||||
|
killflagsofid(snake->flags, F_FLEEONHPPCT);
|
||||||
|
addflag(snake->flags, F_NOFLEE, B_TRUE, NA, NA, NULL);
|
||||||
makefriendly(snake, PERMENANT);
|
makefriendly(snake, PERMENANT);
|
||||||
if (c->lf == caster) {
|
if (c->lf == caster) {
|
||||||
char fullobname[BUFLEN];
|
char fullobname[BUFLEN];
|
||||||
|
@ -9571,10 +9630,10 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
}
|
}
|
||||||
} else { // ie. no lf there
|
} else { // ie. no lf there
|
||||||
for (o = c->obpile->first ; o ; o = nexto) {
|
for (o = c->obpile->first ; o ; o = nexto) {
|
||||||
|
lifeform_t *snake = NULL;
|
||||||
nexto = o->next;
|
nexto = o->next;
|
||||||
if ((o->material->id == MT_WOOD) && hasflag(o->flags, F_RODSHAPED) && !isblessed(o)) {
|
if (hasflag(o->flags, F_RODSHAPED) && !isblessed(o)) {
|
||||||
cell_t *newcell = NULL;
|
cell_t *newcell = NULL;
|
||||||
lifeform_t *snake;
|
|
||||||
char obname[BUFLEN];
|
char obname[BUFLEN];
|
||||||
|
|
||||||
getobname(o, obname, o->amt);
|
getobname(o, obname, o->amt);
|
||||||
|
@ -9593,6 +9652,9 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
killob(o);
|
killob(o);
|
||||||
killflagsofid(snake->flags, F_XPVAL);
|
killflagsofid(snake->flags, F_XPVAL);
|
||||||
addflag(snake->flags, F_XPVAL, 0, NA, NA, NULL);
|
addflag(snake->flags, F_XPVAL, 0, NA, NA, NULL);
|
||||||
|
killflagsofid(snake->flags, F_FLEEONDAM);
|
||||||
|
killflagsofid(snake->flags, F_FLEEONHPPCT);
|
||||||
|
addflag(snake->flags, F_NOFLEE, B_TRUE, NA, NA, NULL);
|
||||||
makefriendly(snake, PERMENANT);
|
makefriendly(snake, PERMENANT);
|
||||||
ndone++;
|
ndone++;
|
||||||
}
|
}
|
||||||
|
@ -9609,6 +9671,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_STUN) {
|
} else if (spellid == OT_S_STUN) {
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
|
@ -9654,6 +9717,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (!donesomething) {
|
if (!donesomething) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_SUCK) {
|
} else if (spellid == OT_S_SUCK) {
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
|
@ -9683,6 +9747,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_SUPERHEAT) {
|
} else if (spellid == OT_S_SUPERHEAT) {
|
||||||
char obname[BUFLEN];
|
char obname[BUFLEN];
|
||||||
|
@ -9794,7 +9859,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
c = askcoords(buf, "Teleport->",TT_NONE, caster, UNLIMITED, LOF_DONTNEED, B_FALSE);
|
c = askcoords(buf, "Teleport->",TT_NONE, caster, UNLIMITED, LOF_DONTNEED, B_FALSE);
|
||||||
if (!c) {
|
if (!c) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
} else if (!c->known) {
|
} else if (!c->known) {
|
||||||
// confirm
|
// confirm
|
||||||
ch = askchar("Are you sure to want to teleport into the unknown?", "yn", "n", B_TRUE, B_FALSE);
|
ch = askchar("Are you sure to want to teleport into the unknown?", "yn", "n", B_TRUE, B_FALSE);
|
||||||
|
@ -9881,7 +9946,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
break;
|
break;
|
||||||
default: // should never happen
|
default: // should never happen
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xmin < 0) xmin = 0;
|
if (xmin < 0) xmin = 0;
|
||||||
|
@ -9901,7 +9966,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (nposs <= 0) {
|
if (nposs <= 0) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -9917,7 +9982,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
c = getrandomadjcell(c, WE_WALKABLE, B_ALLOWEXPAND);
|
c = getrandomadjcell(c, WE_WALKABLE, B_ALLOWEXPAND);
|
||||||
if (!c) {
|
if (!c) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10051,6 +10116,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (failed) {
|
if (failed) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_THORNS) {
|
} else if (spellid == OT_S_THORNS) {
|
||||||
flag_t *f;
|
flag_t *f;
|
||||||
|
@ -10064,7 +10130,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
if (!target) {
|
if (!target) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
f = addtempflag(target->flags, F_TRUESTRIKE, power, NA, NA, NULL, FROMSPELL);
|
f = addtempflag(target->flags, F_TRUESTRIKE, power, NA, NA, NULL, FROMSPELL);
|
||||||
f->obfrom = spellid;
|
f->obfrom = spellid;
|
||||||
|
@ -10236,7 +10302,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (getequippedob(target->pack, BP_WEAPON)) {
|
if (getequippedob(target->pack, BP_WEAPON)) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
stopspell(caster, spellid);
|
stopspell(caster, spellid);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
o = addob(target->pack, "energy blade");
|
o = addob(target->pack, "energy blade");
|
||||||
if (o) {
|
if (o) {
|
||||||
|
@ -10268,11 +10334,12 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
killob(o);
|
killob(o);
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
stopspell(caster, spellid);
|
stopspell(caster, spellid);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
stopspell(caster, spellid);
|
stopspell(caster, spellid);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_WALLOFICE) {
|
} else if (spellid == OT_S_WALLOFICE) {
|
||||||
object_t *o;
|
object_t *o;
|
||||||
|
@ -10299,7 +10366,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if ((vdist == 0) && (hdist == 0)) {
|
if ((vdist == 0) && (hdist == 0)) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
return B_FALSE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// select direction
|
// select direction
|
||||||
|
@ -10448,6 +10515,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
|
|
||||||
if (!targcell) {
|
if (!targcell) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targcell->lf) {
|
if (targcell->lf) {
|
||||||
|
@ -10493,6 +10561,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
}
|
}
|
||||||
if (!ndone) {
|
if (!ndone) {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_WEAKEN) {
|
} else if (spellid == OT_S_WEAKEN) {
|
||||||
target = targcell->lf;
|
target = targcell->lf;
|
||||||
|
@ -10529,6 +10598,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
||||||
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
||||||
} else {
|
} else {
|
||||||
fizzle(caster);
|
fizzle(caster);
|
||||||
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_WEB) {
|
} else if (spellid == OT_S_WEB) {
|
||||||
char numbuf[BUFLEN];
|
char numbuf[BUFLEN];
|
||||||
|
@ -11251,7 +11321,9 @@ char *getspellname(enum OBTYPE spellid, lifeform_t *lf, char *buf, int forcepowe
|
||||||
}
|
}
|
||||||
} else if (spellid == OT_S_LIGHT) {
|
} else if (spellid == OT_S_LIGHT) {
|
||||||
if (power >= 8) {
|
if (power >= 8) {
|
||||||
strcat(buf, "(perm,ctrl)");
|
strcat(buf, "(perm,ctrl,blind)");
|
||||||
|
} else if (power >= 5) {
|
||||||
|
strcat(buf, "(ctrl,blind)");
|
||||||
} else if (power >= 3) {
|
} else if (power >= 3) {
|
||||||
strcat(buf, "(ctrl)");
|
strcat(buf, "(ctrl)");
|
||||||
}
|
}
|
||||||
|
@ -11552,16 +11624,51 @@ int getstamcost(lifeform_t *lf, enum OBTYPE oid) {
|
||||||
return stamcost;
|
return stamcost;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *getvarpowerspelldesc(enum OBTYPE spellid, int power, char *buf) {
|
// provides a description for f_ongoing spells.
|
||||||
|
char *getspelldesc(enum OBTYPE spellid, int power, char *buf) {
|
||||||
// default
|
// default
|
||||||
strcpy(buf, "");
|
strcpy(buf, "");
|
||||||
switch (spellid) {
|
switch (spellid) {
|
||||||
|
case OT_S_ALARM:
|
||||||
|
snprintf(buf, BUFLEN, "warnings about nearby enemies");
|
||||||
|
break;
|
||||||
|
case OT_S_BARKSKIN:
|
||||||
|
snprintf(buf, BUFLEN, "%d damage reduction, vuln to fire", gethardness(MT_WOOD));
|
||||||
|
break;
|
||||||
|
case OT_S_ENDUREELEMENTS:
|
||||||
|
snprintf(buf, BUFLEN, "resist fire, resist cold");
|
||||||
|
break;
|
||||||
|
case OT_S_EQANDOP:
|
||||||
|
snprintf(buf, BUFLEN, "reflects missile attacks");
|
||||||
|
break;
|
||||||
|
case OT_S_GRAVLOWER:
|
||||||
|
snprintf(buf, BUFLEN, "reduces load by %dkg", power*15);
|
||||||
|
break;
|
||||||
|
case OT_S_HOLYAURA:
|
||||||
|
snprintf(buf, BUFLEN, "weapons deal holy damage");
|
||||||
|
break;
|
||||||
|
case OT_S_LOWERMETAB:
|
||||||
|
if (power >= 5) {
|
||||||
|
snprintf(buf, BUFLEN, "reduces hunger");
|
||||||
|
} else {
|
||||||
|
snprintf(buf, BUFLEN, "reduces hunger and speed");
|
||||||
|
}
|
||||||
|
break;
|
||||||
case OT_S_PSYARMOUR:
|
case OT_S_PSYARMOUR:
|
||||||
snprintf(buf, BUFLEN, "+%d Armour Rating", power*4);
|
snprintf(buf, BUFLEN, "+%d Armour Rating", power*4);
|
||||||
break;
|
break;
|
||||||
|
case OT_S_SIXTHSENSE:
|
||||||
|
snprintf(buf, BUFLEN, "warnings about adjacent enemies");
|
||||||
|
break;
|
||||||
case OT_S_SUMMONWEAPON:
|
case OT_S_SUMMONWEAPON:
|
||||||
snprintf(buf, BUFLEN, "Create a %d damage rating magical weapon",2+(power*2));
|
snprintf(buf, BUFLEN, "Create a %d damage rating magical weapon",2+(power*2));
|
||||||
break;
|
break;
|
||||||
|
case OT_S_TAILWIND:
|
||||||
|
snprintf(buf, BUFLEN, "Speed boost when moving fowards");
|
||||||
|
break;
|
||||||
|
case OT_S_THORNS:
|
||||||
|
snprintf(buf, BUFLEN, "1d4 piercing damage to attackers");
|
||||||
|
break;
|
||||||
case OT_S_TRUESTRIKE:
|
case OT_S_TRUESTRIKE:
|
||||||
if (power == 1) {
|
if (power == 1) {
|
||||||
snprintf(buf, BUFLEN, "Next attack automatically hits");
|
snprintf(buf, BUFLEN, "Next attack automatically hits");
|
||||||
|
@ -11569,6 +11676,9 @@ char *getvarpowerspelldesc(enum OBTYPE spellid, int power, char *buf) {
|
||||||
snprintf(buf, BUFLEN, "Next %d attacks automatically hit",power);
|
snprintf(buf, BUFLEN, "Next %d attacks automatically hit",power);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case OT_S_WHATGOESUP:
|
||||||
|
snprintf(buf, BUFLEN, "missiles return to source");
|
||||||
|
break;
|
||||||
case OT_S_WINDSHIELD:
|
case OT_S_WINDSHIELD:
|
||||||
snprintf(buf, BUFLEN, "Protection from missiles <= %d km/h",speedtokph(power));
|
snprintf(buf, BUFLEN, "Protection from missiles <= %d km/h",speedtokph(power));
|
||||||
break;
|
break;
|
||||||
|
|
2
spell.h
2
spell.h
|
@ -28,7 +28,7 @@ enum SPELLSCHOOL getspellschoolknown(lifeform_t *lf, enum OBTYPE spellid);
|
||||||
enum SKILLLEVEL getspellskill(lifeform_t *lf, enum OBTYPE spellid);
|
enum SKILLLEVEL getspellskill(lifeform_t *lf, enum OBTYPE spellid);
|
||||||
int getspellrange(lifeform_t *lf, enum OBTYPE spellid, int power);
|
int getspellrange(lifeform_t *lf, enum OBTYPE spellid, int power);
|
||||||
int getstamcost(lifeform_t *lf, enum OBTYPE oid);
|
int getstamcost(lifeform_t *lf, enum OBTYPE oid);
|
||||||
char *getvarpowerspelldesc(enum OBTYPE spellid, int power, char *buf);
|
char *getspelldesc(enum OBTYPE spellid, int power, char *buf);
|
||||||
int getworkablematerials(lifeform_t *lf, enum SKILL skid , enum MATERIAL *repairablemats, int *cutoffpct, int *nmats);
|
int getworkablematerials(lifeform_t *lf, enum SKILL skid , enum MATERIAL *repairablemats, int *cutoffpct, int *nmats);
|
||||||
object_t *getworkhelpob(obpile_t *op, enum MATERIAL mat);
|
object_t *getworkhelpob(obpile_t *op, enum MATERIAL mat);
|
||||||
void pullobto(object_t *o, lifeform_t *lf);
|
void pullobto(object_t *o, lifeform_t *lf);
|
||||||
|
|
Loading…
Reference in New Issue