1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-04-02 22:50:44 +01:00

Merge remote-tracking branch 'notdnethack/master'

With some minor whitespace adjustments (removing some random spaces in
the middle of tab indentation and some trailing tabs), and replacing a
K&R-style declaration with an ANSI-style one (please stop using those
already).
This commit is contained in:
Ron Nazarov 2024-09-14 11:55:49 +01:00
commit 45f5eb935d
Signed by: noisytoot
GPG key ID: 1D43EF4F4492268B
15 changed files with 152 additions and 4 deletions

View file

@ -497,3 +497,7 @@ Dungeon Changes
General changes
Red dragon scale based armor now grants flying.
Upgrade kits now work on tools.
Artifacts' birthplace is now tracked.
When an artiwish fails for an arti that already exists, you will be told where it was born.
The Oracle can now be consulted for a list of generated artifacts, and you can query an artifact's birthplace.
Starting spellbooks, potions, and wands for less than medium sized players are scaled down to player size.

View file

@ -357,6 +357,8 @@ struct artinstance{
#define C_CROWN_AURA_ADD 10
#define C_CROWN_AURA_DIVISOR 100
#define C_CROWN_AURA_MAX 333
int spawn_dnum;
int spawn_dlevel;
};

View file

@ -108,6 +108,7 @@ extern void copy_oprop_list(struct obj *, unsigned long int *);
extern const char *artifact_name(const char *,short *, int *);
extern boolean art_already_exists(int);
extern boolean art_already_exists_byname(int,const char *);
extern int get_already_exists_byname(int,const char *);
extern void flag_existance(int, int);
extern void artifact_exists(struct obj *,const char *,boolean);
extern struct obj * mksartifact(int);
@ -782,6 +783,7 @@ extern int induced_align(int);
extern boolean Invocation_lev(d_level *);
extern int level_difficulty(void);
extern schar lev_by_name(const char *);
extern void name_by_lev(char *, d_level *);
#ifdef WIZARD
extern boolean print_dungeon(boolean,boolean,schar *,int *);
#endif

View file

@ -2051,6 +2051,19 @@ art_already_exists_byname(int otyp, const char *artiname)
return FALSE;
}
int
get_already_exists_byname(int otyp, const char * artiname)
{
int i;
if (otyp && *artiname){
for (i = 1; artilist[i].otyp; i++){
if (artinstance[i].exists && !strcmp(artilist[i].name, artiname))
return i;
}
}
return 0;
}
void
flag_existance(int m, int mod)
{
@ -2072,6 +2085,8 @@ artifact_exists(struct obj *otmp, const char *name, boolean mod)
/* for "summoned" temporary artifacts, artinstance things are skipped, such as declaring the artifact extant */
if (!get_ox(otmp, OX_ESUM)) {
flag_existance(m, mod);
artinstance[m].spawn_dnum = u.uz.dnum;
artinstance[m].spawn_dlevel = u.uz.dlevel;
// artinstance[m].exists = mod;
if(otmp->oartifact == ART_ROD_OF_SEVEN_PARTS){
artinstance[ART_ROD_OF_SEVEN_PARTS].RoSPkills = 7;//number of hits untill you gain a +

View file

@ -1876,6 +1876,12 @@ level_difficulty(void)
return max(1, dpth);
}
void
name_by_lev(char *buf, d_level *lev){
Sprintf(buf, "level %d of %s", lev->dlevel, dungeons[lev->dnum].dname);
}
/* Take one word and try to match it to a level.
* Recognized levels are as shown by print_dungeon().
*/

View file

@ -519,6 +519,19 @@ show_enlightenment(
}
if(u.uencouraged) you_have(enlght_combatinc("morale", u.uencouraged, 1, buf));
if(u.utats){
int i, tat;
Sprintf(buf, "Tattoos: ");
for(i = 0; i < NUM_TATS; i++){
tat = 1 << i;
if(u.utats & tat){
Strcat(buf, tat_to_name(tat));
Strcat(buf, ", ");
}
}
buf[strlen(buf)-2] = '\0';
enl_msg(buf,"","","");
}
if(u.sealsActive || u.specialSealsActive){
int i,j,numBound,numFound=0;

View file

@ -1348,6 +1348,8 @@ human_initweap(register struct monst *mtmp, int mkobjflags, int faction, int goo
set_material_gm(otmp, GOLD);
fix_object(otmp);
(void) mpickobj(mtmp,otmp);
(void)mongets(mtmp, POT_MIDAS, mkobjflags);
(void)mongets(mtmp, POT_MIDAS, mkobjflags);
} else if(ptr->mtyp == PM_DOOM_KNIGHT) {
otmp = mongets(mtmp, ARMORED_BOOTS, mkobjflags);
if(otmp) otmp->obj_color = CLR_GRAY;

View file

@ -5182,7 +5182,7 @@ corpse_chance(
if(!cansee(mon->mx,mon->my)) map_invisible(mon->mx, mon->my);
}
/* bypass anything about templates, etc. just always make a corpse*/
if (is_rider(mdat)) return TRUE;
if (is_rider(mdat) && mdat->mtyp != PM_JACK) return TRUE;
/* Liches and Vlad and his wives have a fancy death message, and leave no corpse */
if ((mdat->mlet == S_LICH) ||

View file

@ -1477,6 +1477,7 @@ POTION(("goat's milk", "black"), 1, 0, 900, CLR_BLACK),
POTION(("primordial waters", "clear"), 1, 0, 900, CLR_CYAN),
POTION(("space mead", "golden"), 1, 0, 900, CLR_YELLOW),
POTION(("starlight", "dimly-shining"), 1, 4, 250, CLR_BRIGHT_CYAN),
POTION(("midas", "aureate"), 1, 0, 900, CLR_YELLOW),
POTION(("water", "clear"), 0, 80, 100, CLR_CYAN),
POTION(("blood", "blood-red"), 0, 18, 50, CLR_RED, O_USKWN(1)), /* each potion of blood must be ID-ed */
#undef POTION

View file

@ -5820,6 +5820,16 @@ typfnd:
if (otmp->oartifact) {
isartifact = TRUE;
} else {
/* Bad kludge that seems to go against the design of this function to print where an arti was created, because I don't want to rewrite this function to return arbitrary wish context. */
if(!(wishflags&WISH_QUIET)){
char tbuf[BUFSZ];
int arti = get_already_exists_byname(otmp->otyp, aname);
d_level lev;
lev.dnum = artinstance[arti].spawn_dnum;
lev.dlevel = artinstance[arti].spawn_dlevel;
name_by_lev(tbuf, &lev);
verbalize("Born of %s.", tbuf);
}
obfree(otmp, (struct obj *) 0); // Is this necessary?
otmp = &zeroobj; // Is this necessary?
*wishreturn = WISH_ARTEXISTS;

View file

@ -1358,6 +1358,18 @@ as_extra_healing:
else
pline("Magical energies course through your body.");
}break;
case POT_MIDAS:
if (!Golded && !(Stone_resistance && youracedata->mtyp != PM_STONE_GOLEM)
&& !is_gold(youracedata)
&& !(poly_when_golded(youracedata) && polymon(PM_GOLD_GOLEM))
) {
Golded = 9;
delayed_killer = "the draught of Midas";
killer_format = KILLED_BY;
You("are turning to gold!");
} else
You_feel("shiny inside.");
break;
case POT_POLYMORPH:
You_feel("a little %s.", Hallucination ? "normal" : "strange");
if (!Unchanging) polyself(FALSE);
@ -1600,6 +1612,18 @@ potionhit(register struct monst *mon, register struct obj *obj, boolean your_fau
rn2(10 - (uarmh->cursed? 8 : 0)))
get_wet(uarmh, TRUE);
break;
case POT_MIDAS:
if (!Golded && !(Stone_resistance && youracedata->mtyp != PM_STONE_GOLEM)
&& !is_gold(youracedata)
&& !(poly_when_golded(youracedata) && polymon(PM_GOLD_GOLEM))
) {
Golded = 9;
delayed_killer = "the draught of Midas";
killer_format = KILLED_BY;
You("are turning to gold!");
} else
You_feel("shiny inside.");
break;
}
} else {
boolean angermon = TRUE;
@ -1930,6 +1954,11 @@ potionhit(register struct monst *mon, register struct obj *obj, boolean your_fau
case POT_POLYMORPH:
(void) bhitm(mon, obj);
break;
case POT_MIDAS:
if (!resists_ston(mon) && !is_gold(mon->data)) {
minstagoldify(mon, TRUE);
}
break;
/*
case POT_GAIN_LEVEL:
case POT_LEVITATION:
@ -2119,6 +2148,10 @@ potionbreathe(register struct obj *obj)
You_feel("tender.");
exercise(A_CON, FALSE);
break;
case POT_MIDAS:
You("taste gold flakes.");
exercise(A_CON, FALSE);
break;
case POT_BLOOD:
if (is_vampire(youracedata)) {
exercise(A_WIS, FALSE);
@ -2996,6 +3029,11 @@ dodip(void)
goto poof;
}
#endif
if(potion->otyp == POT_MIDAS && obj->obj_material != GOLD){
pline("%s %s into gold.", The(xname(obj)), obj->quan != 1 ? "turn" : "turns");
set_material(obj, GOLD);
goto poof;
}
if( (potion->otyp == POT_ACID ||
(potion->otyp == POT_BLOOD && acidic(&mons[potion->corpsenm])))

View file

@ -492,7 +492,7 @@ fix_worst_trouble(int trouble)
goto decurse;
}
}
if (nohands(youracedata) || !freehand())
if ((nohands(youracedata) || !freehand()) && !Race_if(PM_SNOW_CLOUD))
impossible("fix_worst_trouble: couldn't cure hands.");
break;
case TROUBLE_CURSED_BLINDFOLD:

View file

@ -5,6 +5,8 @@
#include "hack.h"
#include "lev.h"
#include "dlb.h"
#include "artifact.h"
/* [note: this comment is fairly old, but still accurate for 3.1]
* Rumors have been entirely rewritten to speed up the access. This is
@ -333,6 +335,9 @@ outgmaster(void)
#define GLIMPSE_OOONA 5
#define GLIMPSE_ABYSS 6
#define GLIMPSE_HELLL 7
#define GLIMPSE_ARTIS 8
#define arti_selector(c) (('a' + c%52 > 'z') ? 'A' + ((c%52) - 26) : 'a' + c % 52)
int
doconsult(register struct monst *oracl)
@ -528,6 +533,12 @@ doconsult(register struct monst *oracl)
'h', 0, ATR_NONE, buf,
MENU_UNSELECTED);
Sprintf(buf, "Knowledge of artifact birthplaces");
any.a_int = GLIMPSE_ARTIS; /* must be non-zero */
add_menu(tmpwin, NO_GLYPH, &any,
'A', 0, ATR_NONE, buf,
MENU_UNSELECTED);
end_menu(tmpwin, "What glimpses dost thou ask for?");
how = PICK_ONE;
@ -537,7 +548,7 @@ doconsult(register struct monst *oracl)
n = selected[0].item.a_int;
free(selected);
}
else n = rnd(7);
else n = rnd(8);
switch (n){
case GLIMPSE_ELDRN:
switch(dungeon_topology.alt_tulani){
@ -706,6 +717,43 @@ doconsult(register struct monst *oracl)
}
}
break;
case GLIMPSE_ARTIS:{
int arti_count = 0;
char tbuf[BUFSZ];
int i;
d_level lev;
tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin);
any.a_void = 0; /* zero out all bits */
for (i = 1; artilist[i].otyp; i++){
if(!artinstance[i].exists)
continue;
Sprintf(buf, "%s", artilist[i].name);
any.a_int = i; /* must be non-zero */
add_menu(tmpwin, NO_GLYPH, &any,
arti_selector(arti_count), 0, ATR_NONE, buf,
MENU_UNSELECTED);
arti_count++;
}
end_menu(tmpwin, "Know the birthplace of which artifact?");
how = PICK_ONE;
n = select_menu(tmpwin, how, &selected);
destroy_nhwindow(tmpwin);
if(n <= 0){
free(selected);
break;
}
n = selected[0].item.a_int;
free(selected);
lev.dnum = artinstance[n].spawn_dnum;
lev.dlevel = artinstance[n].spawn_dlevel;
name_by_lev(tbuf, &lev);
pline("%s was born on %s.", artilist[n].name, tbuf);
}
break;
default:
impossible("Oracle rolled a non-existent dungeon hint? :(");
break;
@ -742,4 +790,5 @@ doconsult(register struct monst *oracl)
#undef GLIMPSE_OOONA
#undef GLIMPSE_ABYSS
#undef GLIMPSE_HELLL
#undef arti_selector
/*rumors.c*/

View file

@ -3272,7 +3272,7 @@ dotatmenu(const char *prompt)
if(!(u.utats & TAT_HYPHEN) && mvitals[PM_ASPECT_OF_THE_SILENCE].died > 0){
any.a_int = TAT_HYPHEN; /* must be non-zero */
add_menu(tmpwin, NO_GLYPH, &any,
'h', 0, ATR_NONE, tat_to_name(TAT_HYPHEN),
'H', 0, ATR_NONE, tat_to_name(TAT_HYPHEN),
MENU_UNSELECTED);
}
if(!(u.utats & TAT_FLAMING_WHIP) && mvitals[PM_LUNGORTHIN].died > 0){
@ -6405,6 +6405,10 @@ dobinding(int tx, int ty)
|| carrying_art(ART_SILVER_KEY)
){
You("percieve a great BEING beyond the gate, and it addresses you with waves of thunderous and burning power.");
if(Role_if(PM_ANACHRONOUNBINDER)){
pline("It cannot pass through the askew gate.");
return MOVE_STANDARD;
}
You("are smote and changed by the unendurable violence of its voice!");
exercise(A_CON, FALSE);
bindspirit(ep->ward_id);

View file

@ -3381,6 +3381,8 @@ ini_inv(register struct trobj *trop)
if (obj->otyp == STRAITJACKET ) {
obj->cursed = TRUE;
}
if((obj->oclass == SPBOOK_CLASS || obj->oclass == POTION_CLASS || obj->oclass == WAND_CLASS) && youracedata->msize < MZ_MEDIUM)
set_obj_size(obj, youracedata->msize);
if (obj->otyp == AMULET_OF_NULLIFY_MAGIC && Role_if(PM_MADMAN) ) {
obj->cursed = TRUE;
}