User talk:Wikid/Sandbox

From NetHackWiki
Jump to navigation Jump to search

Code excerpts used to confirm player‑facing behaviour.

Primordial Waters

Boon implementation (pray.c)

case YOGBOON_WATERS:
    cost = 25;
    otmp = mksobj(POT_PRIMORDIAL_WATERS, MKOBJ_NOINIT);
    otmp->blessed = otmp->cursed = 0;
    otmp->quan = 20L;
    otmp->blessed = greater_boon;
    (void) peffects(otmp, TRUE);
    obfree(otmp, (struct obj *)0);
    break;

Effects of primordial waters potions (potion.c)

u.yog_sothoth_mutagen++;
if (Acid_resistance)
    pline("This tastes like water.");
else {
    pline("This burns%s!", otmp->blessed ? " a little" : otmp->cursed ? " a lot" : " like acid");
    losehp(d(otmp->cursed ? 2 : 1, otmp->blessed ? 4 : 8),
           "primordial water", KILLED_BY);
    exercise(A_CON, FALSE);
}
...
u.uen += (otmp->cursed) ? -100 : (otmp->blessed) ? 200 : 100;

Escape from curses

Unequip and drop cursed worn items (pray.c)

case YOGBOON_TELEP_CURSED:{
    cost = 10;
    for(otmp = invent; otmp; otmp = nobj){
        nobj = otmp->nobj;
        if((otmp->owornmask || otmp->otyp == LOADSTONE) && otmp->cursed){
            obj_extract_and_unequip_self(otmp);
            Your("%s is teleported to the %s at your %s.", xname(otmp), surface(u.ux, u.uy), makeplural(body_part(FOOT)));
            dropy(otmp);
        }
    }
} break;

Return of memory

Boost known spells' recall; also unforgets spells (pray.c)

case YOGBOON_MEMORY:{
    cost = 50;
    pline("The angle through your mind is tweaked!");
    for (i = 0; i < MAXSPELL; i++)  {
        if (spellid(i) != NO_SPELL)  {
            spl_book[i].sp_know = min(spl_book[i].sp_know + KEEN/10, KEEN);
            exercise(A_WIS,TRUE);
            exercise(A_INT,TRUE);
        }
    }
} break;

Continued companionship

Extend spirit timers (pray.c)

case YOGBOON_COMPANION:{
    cost = 50;
    pline("The angle through your soul is tweaked!");
    for(i=0;i<QUEST_SPIRIT && u.spirit[i];i++){
        u.spiritT[i] = min(u.spiritT[i]+1000, monstermoves + 5000);
    }
    ...
} break;

Cost of boons

Credit and sanity deduction (pray.c)

u.yog_sothoth_credit -= cost;
change_usanity(-(cost+4)/5, TRUE);

Sources

Excerpts from Github dNAO compat-3.24.0 branch, as at 3 January 2026.

Wikid (talk) 20:08, 4 January 2026 (UTC)