mirror of
https://codeberg.org/noisytoot/notnotdnethack.git
synced 2025-07-28 16:32:27 +01:00
Revise amnesia and lethe
amnesia causes damage to known spells Don't do special bitcodes in the forget() function Lethe water is back, but much less damaging
This commit is contained in:
parent
f0f74f4100
commit
157cde82bf
13 changed files with 83 additions and 107 deletions
|
@ -2271,7 +2271,7 @@ E int NDECL(dospirit);
|
|||
E int FDECL(spell_skilltype, (int));
|
||||
E int FDECL(spiriteffects, (int,BOOLEAN_P));
|
||||
E int FDECL(spelleffects, (int,BOOLEAN_P,int));
|
||||
E void NDECL(losespells);
|
||||
E void FDECL(losespells, (int));
|
||||
E int NDECL(dovspell);
|
||||
E void FDECL(initialspell, (struct obj *));
|
||||
E void FDECL(initialward, (struct obj *));
|
||||
|
|
|
@ -11,10 +11,6 @@ struct spell {
|
|||
int sp_know; /* knowlege of spell */
|
||||
};
|
||||
|
||||
/* levels of memory destruction with a scroll of amnesia */
|
||||
#define ALL_MAP 0x1
|
||||
#define ALL_SPELLS 0x2
|
||||
|
||||
#define decrnknow(spell) spl_book[spell].sp_know--
|
||||
#define spellid(spell) spl_book[spell].sp_id
|
||||
#define spellknow(spell) spl_book[spell].sp_know
|
||||
|
|
|
@ -2891,7 +2891,7 @@ struct obj *hypo;
|
|||
if (!Unchanging) polyself(FALSE);
|
||||
break;
|
||||
case POT_AMNESIA:
|
||||
forget((!amp->blessed? ALL_SPELLS : 0) | ALL_MAP);
|
||||
forget(amp->cursed ? 25 : amp->blessed ? 0 : 10);
|
||||
if (Hallucination)
|
||||
pline("Hakuna matata!");
|
||||
else
|
||||
|
|
2
src/do.c
2
src/do.c
|
@ -1388,7 +1388,7 @@ boolean at_stairs, falling, portal;
|
|||
movebubbles();
|
||||
|
||||
if (level_info[new_ledger].flags & FORGOTTEN) {
|
||||
forget_map(ALL_MAP); /* forget the map */
|
||||
forget_map(100); /* forget the map */
|
||||
forget_traps(); /* forget all traps too */
|
||||
familiar = TRUE;
|
||||
level_info[new_ledger].flags &= ~FORGOTTEN;
|
||||
|
|
|
@ -3513,7 +3513,7 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
|
|||
}
|
||||
}
|
||||
else if(otmp->opoisoned & OPOISON_AMNES){
|
||||
forget((!otmp->blessed? ALL_SPELLS : 0) | ALL_MAP);
|
||||
forget(otmp->cursed ? 25 : otmp->blessed ? 0 : 10);
|
||||
if (Hallucination)
|
||||
pline("Hakuna matata!");
|
||||
else
|
||||
|
|
35
src/mhitu.c
35
src/mhitu.c
|
@ -2018,16 +2018,14 @@ dopois:
|
|||
|
||||
/* adjattrib gives dunce cap message when appropriate */
|
||||
//(void) adjattrib(A_INT, -rnd(2), FALSE);
|
||||
//forget_levels(25); /* lose memory of 25% of levels */
|
||||
//forget_objects(25); /* lose memory of 25% of objects */
|
||||
// forget(25); /* lose 25% of memory per point lost*/
|
||||
//exercise(A_WIS, FALSE);
|
||||
if(u.sealsActive&SEAL_HUGINN_MUNINN){
|
||||
unbind(SEAL_HUGINN_MUNINN,TRUE);
|
||||
} else {
|
||||
(void) adjattrib(A_INT, -dmg, FALSE);
|
||||
while(dmg--){
|
||||
forget_levels(10); /* lose memory of 10% of levels per point lost*/
|
||||
forget_objects(10); /* lose memory of 10% of objects per point lost*/
|
||||
forget(10); /* lose 10% of memory per point lost*/
|
||||
exercise(A_WIS, FALSE);
|
||||
}
|
||||
}
|
||||
|
@ -2312,7 +2310,7 @@ dopois:
|
|||
!Is_medusa_level(&u.uz) &&
|
||||
!Is_waterlevel(&u.uz);
|
||||
|
||||
water_damage(invent, FALSE, FALSE, FALSE, &youmonst);
|
||||
water_damage(invent, FALSE, FALSE, level.flags.lethe, &youmonst);
|
||||
|
||||
if(u.divetimer > 0){
|
||||
pline("%s pulls you into the %s!", Monnam(mtmp), moat ? "moat" : "pool of water");
|
||||
|
@ -3080,8 +3078,7 @@ dopois:
|
|||
while( ABASE(A_WIS) > ATTRMIN(A_WIS) && wdmg > 0){
|
||||
wdmg--;
|
||||
(void) adjattrib(A_WIS, -1, TRUE);
|
||||
forget_levels(10); /* lose memory of 10% of levels per point lost*/
|
||||
forget_objects(10); /* lose memory of 10% of objects per point lost*/
|
||||
forget(10);
|
||||
exercise(A_WIS, FALSE);
|
||||
}
|
||||
if(AMAX(A_WIS) > ATTRMIN(A_WIS) &&
|
||||
|
@ -3504,8 +3501,7 @@ gulpmu(mtmp, mattk) /* monster swallows you, or damage if u.uswallow */
|
|||
unbind(SEAL_HUGINN_MUNINN,TRUE);
|
||||
} else {
|
||||
(void) adjattrib(A_INT, -tmp, FALSE);
|
||||
forget_levels(25); /* lose memory of 25% of levels*/
|
||||
forget_objects(25); /* lose memory of 25% of objects*/
|
||||
forget(25);
|
||||
water_damage(invent, FALSE, FALSE, TRUE, &youmonst);
|
||||
|
||||
exercise(A_WIS, FALSE);
|
||||
|
@ -3927,8 +3923,7 @@ gazemu(mtmp, mattk) /* monster gazes at you */
|
|||
if(u.sealsActive&SEAL_HUGINN_MUNINN){
|
||||
unbind(SEAL_HUGINN_MUNINN,TRUE);
|
||||
} else {
|
||||
forget_levels(13);
|
||||
forget_objects(13);
|
||||
forget(13);
|
||||
}
|
||||
succeeded=1;
|
||||
}
|
||||
|
@ -3940,8 +3935,7 @@ gazemu(mtmp, mattk) /* monster gazes at you */
|
|||
&& !is_blind(mtmp) && canseemon(mtmp)) {
|
||||
You("feel your life force whither before the gaze of %s!", mon_nam(mtmp));
|
||||
losexp("life force drain",TRUE,FALSE,FALSE);
|
||||
// forget_levels(10);
|
||||
// forget_objects(10);
|
||||
// forget(10);
|
||||
succeeded=1;
|
||||
}
|
||||
break;
|
||||
|
@ -4439,8 +4433,7 @@ gazemu(mtmp, mattk) /* monster gazes at you */
|
|||
while( !(ABASE(A_WIS) <= ATTRMIN(A_WIS)) && dmg > 0){
|
||||
dmg--;
|
||||
(void) adjattrib(A_WIS, -1, TRUE);
|
||||
forget_levels(10); /* lose memory of 10% of levels per point lost*/
|
||||
forget_objects(10); /* lose memory of 10% of objects per point lost*/
|
||||
forget(10); /* lose 10% of memory per point lost*/
|
||||
exercise(A_WIS, FALSE);
|
||||
if(mtmp->data == &mons[PM_GREAT_CTHULHU]
|
||||
&& AMAX(A_WIS) > ATTRMIN(A_WIS)) AMAX(A_WIS) -= 1; //permanently drain wisdom
|
||||
|
@ -5846,8 +5839,7 @@ register struct monst *mon;
|
|||
} else {
|
||||
(void) adjattrib(A_INT, -3, TRUE);
|
||||
(void) adjattrib(A_WIS, -3, TRUE);
|
||||
forget_levels(30);
|
||||
forget_objects(30);
|
||||
forget(30);
|
||||
exercise(A_WIS, FALSE);
|
||||
exercise(A_WIS, FALSE);
|
||||
exercise(A_WIS, FALSE);
|
||||
|
@ -6599,8 +6591,7 @@ register struct monst *mon;
|
|||
unbind(SEAL_HUGINN_MUNINN,TRUE);
|
||||
} else {
|
||||
if(AMAX(A_WIS) > ABASE(A_WIS)) AMAX(A_WIS) = (int)((AMAX(A_WIS) - ABASE(A_WIS))/2 + 1); //permanently drain wisdom
|
||||
forget_levels(25); /* lose memory of 25% of levels */
|
||||
forget_objects(25); /* lose memory of 25% of objects */
|
||||
forget(25); /* lose 25% of memory */
|
||||
}
|
||||
} else {
|
||||
You("hang back from the %s form beneath the shroud. It poses enticingly.", fem ? "voluptuous feminine" : "muscular masculine");
|
||||
|
@ -6807,8 +6798,7 @@ register struct monst *mon;
|
|||
You("%s.", chg ? "are freaked out" : "seem unaffected");
|
||||
}
|
||||
(void) adjattrib(A_INT, -1, FALSE);
|
||||
forget_levels(5);
|
||||
forget_objects(5);
|
||||
forget(5);
|
||||
exercise(A_WIS, FALSE);
|
||||
exercise(A_WIS, FALSE);
|
||||
exercise(A_INT, FALSE);
|
||||
|
@ -7158,8 +7148,7 @@ int dmg;
|
|||
(void) adjattrib(A_INT, -i, 1);
|
||||
while(i-- > 0){
|
||||
if(i%2) losexp("brain damage",FALSE,TRUE,FALSE);
|
||||
forget_levels(10); /* lose memory of 10% of levels per point lost*/
|
||||
forget_objects(10); /* lose memory of 10% of objects per point lost*/
|
||||
forget(10); /* lose 10% of memory per point lost*/
|
||||
exercise(A_WIS, FALSE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -818,7 +818,7 @@ register struct monst *mtmp;
|
|||
if (mtmp->data == &mons[PM_GREMLIN] && (inpool || infountain) && rn2(3)) {
|
||||
if (split_mon(mtmp, (struct monst *)0))
|
||||
dryup(mtmp->mx, mtmp->my, FALSE);
|
||||
if (inpool) water_damage(mtmp->minvent, FALSE, FALSE, FALSE, mtmp);
|
||||
if (inpool) water_damage(mtmp->minvent, FALSE, FALSE, level.flags.lethe, mtmp);
|
||||
return (0);
|
||||
} else if (mtmp->data == &mons[PM_IRON_GOLEM] && inpool && !rn2(5)) {
|
||||
int dam = d(2,6);
|
||||
|
@ -830,7 +830,7 @@ register struct monst *mtmp;
|
|||
mondead(mtmp);
|
||||
if (mtmp->mhp < 1) return (1);
|
||||
}
|
||||
water_damage(mtmp->minvent, FALSE, FALSE, FALSE, mtmp);
|
||||
water_damage(mtmp->minvent, FALSE, FALSE, level.flags.lethe, mtmp);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -884,7 +884,7 @@ register struct monst *mtmp;
|
|||
mondead(mtmp);
|
||||
if (mtmp->mhp > 0) {
|
||||
(void) rloc(mtmp, FALSE);
|
||||
water_damage(mtmp->minvent, FALSE, FALSE, FALSE, mtmp);
|
||||
water_damage(mtmp->minvent, FALSE, FALSE, level.flags.lethe, mtmp);
|
||||
return 0;
|
||||
}
|
||||
return (1);
|
||||
|
@ -3909,8 +3909,7 @@ int typ, fatal, opoistype;
|
|||
if(u.sealsActive&SEAL_HUGINN_MUNINN){
|
||||
unbind(SEAL_HUGINN_MUNINN,TRUE);
|
||||
} else {
|
||||
forget_levels(1); /* lose memory of 1% of levels*/
|
||||
forget_objects(1); /* lose memory of 1% of objects*/
|
||||
forget(1); /* lose 1% of memory per point lost*/
|
||||
forget_traps(); /* lose memory of all traps*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3308,7 +3308,7 @@ srch:
|
|||
del_engr_ward_at(u.ux, u.uy);
|
||||
pline("A pool.");
|
||||
/* Must manually make kelp! */
|
||||
water_damage(level.objects[u.ux][u.uy], FALSE, TRUE, FALSE, (struct monst *) 0);
|
||||
water_damage(level.objects[u.ux][u.uy], FALSE, TRUE, level.flags.lethe, (struct monst *) 0);
|
||||
newsym(u.ux, u.uy);
|
||||
return &zeroobj;
|
||||
}
|
||||
|
|
|
@ -463,7 +463,7 @@ peffects(otmp)
|
|||
case POT_AMNESIA:
|
||||
pline(Hallucination? "This tastes like champagne!" :
|
||||
"This liquid bubbles and fizzes as you drink it.");
|
||||
forget((!otmp->blessed? ALL_SPELLS : 0) | ALL_MAP);
|
||||
forget(otmp->cursed ? 25 : otmp->blessed ? 0 : 10);
|
||||
if (Hallucination)
|
||||
pline("Hakuna matata!");
|
||||
else
|
||||
|
|
11
src/read.c
11
src/read.c
|
@ -949,7 +949,7 @@ forget_map(howmuch)
|
|||
|
||||
known = TRUE;
|
||||
for(zx = 0; zx < COLNO; zx++) for(zy = 0; zy < ROWNO; zy++)
|
||||
if (howmuch & ALL_MAP || rn2(7)) {
|
||||
if (howmuch >= 100 || rn2(100) < howmuch) {
|
||||
/* Zonk all memory of this location. */
|
||||
levl[zx][zy].seenv = 0;
|
||||
levl[zx][zy].waslit = 0;
|
||||
|
@ -1048,12 +1048,12 @@ int howmuch;
|
|||
forget_traps();
|
||||
|
||||
/* 1 in 3 chance of forgetting some levels */
|
||||
if (!rn2(3)) forget_levels(rn2(25));
|
||||
if (howmuch && !rn2(3)) forget_levels(howmuch);
|
||||
|
||||
/* 1 in 3 chance of forgeting some objects */
|
||||
if (!rn2(3)) forget_objects(rn2(25));
|
||||
if (howmuch && !rn2(3)) forget_objects(howmuch);
|
||||
|
||||
if (howmuch & ALL_SPELLS) losespells();
|
||||
if (howmuch) losespells(howmuch);
|
||||
/*
|
||||
* Make sure that what was seen is restored correctly. To do this,
|
||||
* we need to go blind for an instant --- turn off the display,
|
||||
|
@ -1668,8 +1668,7 @@ struct obj *sobj;
|
|||
break;
|
||||
case SCR_AMNESIA:
|
||||
known = TRUE;
|
||||
forget( (!sobj->blessed ? ALL_SPELLS : 0) |
|
||||
(!confused || sobj->cursed ? ALL_MAP : 0) );
|
||||
forget(sobj->cursed ? 25 : sobj->blessed ? 0 : 10);
|
||||
if (Hallucination) /* Ommmmmm! */
|
||||
Your("mind releases itself from mundane concerns.");
|
||||
else if (!strncmpi(plname, "Maud", 4))
|
||||
|
|
19
src/spell.c
19
src/spell.c
|
@ -16,6 +16,7 @@ static NEARDATA int RoSbook; /* Read spell or Study Wards?" */
|
|||
#define READ_SPELL 1
|
||||
#define STUDY_WARD 2
|
||||
#define incrnknow(spell) spl_book[spell].sp_know = KEEN
|
||||
#define ndecrnknow(spell, knw) spl_book[spell].sp_know = max(0, spl_book[spell].sp_know - (KEEN*knw)/100)
|
||||
|
||||
#define spellev(spell) spl_book[spell].sp_lev
|
||||
#define spellname(spell) OBJ_NAME(objects[spellid(spell)])
|
||||
|
@ -3796,21 +3797,13 @@ throwgaze()
|
|||
}
|
||||
|
||||
void
|
||||
losespells()
|
||||
losespells(howmuch)
|
||||
int howmuch;
|
||||
{
|
||||
boolean confused = (Confusion != 0);
|
||||
int n, nzap, i;
|
||||
int n;
|
||||
|
||||
book = 0;
|
||||
for (n = 0; n < MAXSPELL && spellid(n) != NO_SPELL; n++)
|
||||
continue;
|
||||
if (n) {
|
||||
nzap = rnd(n) + confused ? 1 : 0;
|
||||
if (nzap > n) nzap = n;
|
||||
for (i = n - nzap; i < n; i++) {
|
||||
spellid(i) = NO_SPELL;
|
||||
exercise(A_WIS, FALSE); /* ouch! */
|
||||
}
|
||||
for (n = 0; n < MAXSPELL && spellid(n) != NO_SPELL; n++){
|
||||
ndecrnknow(n, howmuch);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
96
src/trap.c
96
src/trap.c
|
@ -2797,19 +2797,19 @@ xchar x, y;
|
|||
|
||||
/* returns TRUE if obj is destroyed */
|
||||
boolean
|
||||
water_damage(obj, force, here, forcelethe, owner)
|
||||
water_damage(obj, force, here, lethe, owner)
|
||||
struct obj *obj;
|
||||
boolean force, here, forcelethe;
|
||||
boolean force, here, lethe;
|
||||
struct monst *owner;
|
||||
{
|
||||
/* Dips in the Lethe are a very poor idea Lethe patch*/
|
||||
// int luckpenalty = level.flags.lethe? 7 : 0;
|
||||
int luckpenalty = 0;
|
||||
int luckpenalty = lethe ? 7 : 0;
|
||||
// int luckpenalty = 0;
|
||||
struct obj *otmp;
|
||||
struct obj *obj_original = obj;
|
||||
boolean obj_destroyed = FALSE;
|
||||
// int is_lethe = level.flags.lethe || forcelethe;
|
||||
int is_lethe = 0;
|
||||
// int is_lethe = level.flags.lethe || lethe;
|
||||
int is_lethe = lethe;
|
||||
if(owner == &youmonst){
|
||||
if((uarmc
|
||||
&& (uarmc->otyp == OILSKIN_CLOAK || uarmc->greased)
|
||||
|
@ -2944,40 +2944,40 @@ struct monst *owner;
|
|||
obj->odiluted++;
|
||||
break;
|
||||
case GEM_CLASS:
|
||||
if (is_lethe && (obj->otyp == LUCKSTONE
|
||||
|| obj->otyp == LOADSTONE
|
||||
|| obj->otyp == TOUCHSTONE))
|
||||
obj->otyp = FLINT;
|
||||
// if (is_lethe && (obj->otyp == LUCKSTONE
|
||||
// || obj->otyp == LOADSTONE
|
||||
// || obj->otyp == TOUCHSTONE))
|
||||
// obj->otyp = FLINT;
|
||||
break;
|
||||
case TOOL_CLASS:
|
||||
if (is_lethe) {
|
||||
switch (obj->otyp) {
|
||||
case MAGIC_LAMP:
|
||||
obj->otyp = OIL_LAMP;
|
||||
break;
|
||||
case MAGIC_WHISTLE:
|
||||
obj->otyp = TIN_WHISTLE;
|
||||
break;
|
||||
case MAGIC_FLUTE:
|
||||
obj->otyp = WOODEN_FLUTE;
|
||||
obj->spe = 0;
|
||||
break;
|
||||
case MAGIC_HARP:
|
||||
obj->otyp = WOODEN_HARP;
|
||||
obj->spe = 0;
|
||||
break;
|
||||
case FIRE_HORN:
|
||||
case FROST_HORN:
|
||||
case HORN_OF_PLENTY:
|
||||
obj->otyp = TOOLED_HORN;
|
||||
obj->spe = 0;
|
||||
break;
|
||||
case DRUM_OF_EARTHQUAKE:
|
||||
obj->otyp = LEATHER_DRUM;
|
||||
obj->spe = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if (is_lethe) {
|
||||
// switch (obj->otyp) {
|
||||
// case MAGIC_LAMP:
|
||||
// obj->otyp = OIL_LAMP;
|
||||
// break;
|
||||
// case MAGIC_WHISTLE:
|
||||
// obj->otyp = TIN_WHISTLE;
|
||||
// break;
|
||||
// case MAGIC_FLUTE:
|
||||
// obj->otyp = WOODEN_FLUTE;
|
||||
// obj->spe = 0;
|
||||
// break;
|
||||
// case MAGIC_HARP:
|
||||
// obj->otyp = WOODEN_HARP;
|
||||
// obj->spe = 0;
|
||||
// break;
|
||||
// case FIRE_HORN:
|
||||
// case FROST_HORN:
|
||||
// case HORN_OF_PLENTY:
|
||||
// obj->otyp = TOOLED_HORN;
|
||||
// obj->spe = 0;
|
||||
// break;
|
||||
// case DRUM_OF_EARTHQUAKE:
|
||||
// obj->otyp = LEATHER_DRUM;
|
||||
// obj->spe = 0;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
/* Drop through */
|
||||
/* Weapons, armor and tools may be disenchanted... */
|
||||
|
@ -3012,9 +3012,9 @@ struct monst *owner;
|
|||
(obj->blessed && rnl(100) < 25)))
|
||||
obj->oeroded++;
|
||||
/* The Lethe may unfooproof the item... */
|
||||
if (is_lethe
|
||||
&& obj->oerodeproof && !rn2(5))
|
||||
obj->oerodeproof = FALSE;
|
||||
// if (is_lethe
|
||||
// && obj->oerodeproof && !rn2(5))
|
||||
// obj->oerodeproof = FALSE;
|
||||
}
|
||||
}
|
||||
obj_destroyed = FALSE;
|
||||
|
@ -3127,14 +3127,14 @@ drown()
|
|||
You("sink like %s.",
|
||||
Hallucination ? "the Titanic" : "a rock");
|
||||
|
||||
// if (level.flags.lethe) {
|
||||
// /* Bad idea */
|
||||
// You_feel("the sparkling waters of the Lethe sweep away your "
|
||||
// "cares!");
|
||||
// forget(25);
|
||||
// }
|
||||
if (level.flags.lethe) {
|
||||
/* Bad idea */
|
||||
You_feel("the sparkling waters of the Lethe sweep away your "
|
||||
"cares!");
|
||||
forget(10);
|
||||
}
|
||||
|
||||
water_damage(invent, FALSE, FALSE, FALSE, &youmonst);
|
||||
water_damage(invent, FALSE, FALSE, level.flags.lethe, &youmonst);
|
||||
|
||||
if (u.umonnum == PM_GREMLIN && rn2(3))
|
||||
(void)split_mon(&youmonst, (struct monst *)0);
|
||||
|
|
|
@ -639,7 +639,7 @@ dowizgush() /* Gushing forth along LOS from (u.ux, u.uy) and random other spots
|
|||
yprime = u.uy;
|
||||
do_clear_area(u.ux, u.uy, 9, wizgush, (genericptr_t)&madepool);
|
||||
pline("Water sprays all over you.");
|
||||
water_damage(invent, FALSE, FALSE, FALSE, &youmonst);
|
||||
water_damage(invent, FALSE, FALSE, level.flags.lethe, &youmonst);
|
||||
for(cx = 0; cx < COLNO; cx++){
|
||||
for(cy = 0; cy < ROWNO; cy++){
|
||||
if(!rn2(100)){
|
||||
|
@ -673,7 +673,7 @@ genericptr_t poolcnt;
|
|||
levl[cx][cy].typ = POOL;
|
||||
/* No kelp! */
|
||||
del_engr_ward_at(cx, cy);
|
||||
water_damage(level.objects[cx][cy], FALSE, TRUE, FALSE, (struct monst *) 0);
|
||||
water_damage(level.objects[cx][cy], FALSE, TRUE, level.flags.lethe, (struct monst *) 0);
|
||||
|
||||
if ((mtmp = m_at(cx, cy)) != 0){
|
||||
(void) minliquid(mtmp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue