Fixed a bunch of compile warnings

This commit is contained in:
Rob Pearce 2023-10-11 12:56:18 +11:00
parent 17461f9c24
commit ec6a86a0b2
3 changed files with 93 additions and 93 deletions

140
god.c
View File

@ -103,15 +103,15 @@ void angergod(enum RACE rid, int amt, enum GODANGERREASON why) {
case R_GODMAGIC: sprintf(buf, "One does not comprehend the danger of One's find!"); break; case R_GODMAGIC: sprintf(buf, "One does not comprehend the danger of One's find!"); break;
default: break; default: break;
} }
godsay(rid, B_TRUE, buf); godsay(rid, B_TRUE, buf);
break; break;
case GA_HERESY: case GA_HERESY:
if (rid == R_GODFIRE) { if (rid == R_GODFIRE) {
godsay(rid, B_TRUE, "HERESY!"); godsay(rid, B_TRUE, "HERESY!");
} else if (rid == R_GODMAGIC) { } else if (rid == R_GODMAGIC) {
godsay(rid, B_TRUE, "One's mundanity is offensive!"); godsay(rid, B_TRUE, "One's mundanity is offensive!");
} else { } else {
godsay(rid, B_TRUE, "Heresy!"); godsay(rid, B_TRUE, "Heresy!");
} }
break; break;
case GA_MERCY: case GA_MERCY:
@ -208,7 +208,7 @@ void angergod(enum RACE rid, int amt, enum GODANGERREASON why) {
case R_GODBATTLE: case R_GODBATTLE:
// rust your armour // rust your armour
for (o = player->pack->first ; o ; o = o->next) { for (o = player->pack->first ; o ; o = o->next) {
if (isarmour(o) && (o->type->material->id == MT_METAL)) { if (isarmour(o) && (o->type->material->id == MT_METAL)) {
poss[nposs++] = o; poss[nposs++] = o;
} }
} }
@ -276,7 +276,7 @@ void angergod(enum RACE rid, int amt, enum GODANGERREASON why) {
// remove blessings // remove blessings
nposs = 0; nposs = 0;
for (o = player->pack->first ; o ; o = o->next) { for (o = player->pack->first ; o ; o = o->next) {
if (isblessed(o)) { if (isblessed(o)) {
poss[nposs++] = o; poss[nposs++] = o;
} }
} }
@ -399,7 +399,7 @@ void angergod(enum RACE rid, int amt, enum GODANGERREASON why) {
msg("\"Allow me to lighten your load a little...\""); msg("\"Allow me to lighten your load a little...\"");
if (o) { // take player's weapon if (o) { // take player's weapon
castspell(god, OT_S_CONFISCATE, player, o, player->cell, NULL, NULL); castspell(god, OT_S_CONFISCATE, player, o, player->cell, NULL, NULL);
} else { // take 3 objects } else { // take 3 objects
int i; int i;
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
castspell(god, OT_S_CONFISCATE, player, NULL, player->cell, NULL, NULL); castspell(god, OT_S_CONFISCATE, player, NULL, player->cell, NULL, NULL);
@ -411,7 +411,7 @@ void angergod(enum RACE rid, int amt, enum GODANGERREASON why) {
while (rollagain) { while (rollagain) {
flag_t *retflag[MAXCANDIDATES]; flag_t *retflag[MAXCANDIDATES];
int nretflags; int nretflags;
rollagain = B_FALSE; rollagain = B_FALSE;
switch (rnd(1,3)) { switch (rnd(1,3)) {
case 1: // lose all spells case 1: // lose all spells
msg("\"I forbid you my gifts!\""); msg("\"I forbid you my gifts!\"");
@ -472,7 +472,7 @@ void angergod(enum RACE rid, int amt, enum GODANGERREASON why) {
msg("\"Time for a lesson in materialism!\""); msg("\"Time for a lesson in materialism!\"");
nposs = 0; nposs = 0;
for (o = player->pack->first ; o ; o = o->next) { for (o = player->pack->first ; o ; o = o->next) {
if (hasflag(o->flags, F_DAMAGABLE) && !hasflag(o->flags, F_DEAD)) { if (hasflag(o->flags, F_DAMAGABLE) && !hasflag(o->flags, F_DEAD)) {
poss[nposs++] = o; poss[nposs++] = o;
} }
} }
@ -484,10 +484,10 @@ void angergod(enum RACE rid, int amt, enum GODANGERREASON why) {
// damage it // damage it
getobname(o, obname, o->amt); getobname(o, obname, o->amt);
msg("Your %s %s struck by divine force!", OB1(o, "is", "are"), noprefix(obname)); msg("Your %s %s struck by divine force!", OB1(o, "is", "are"), noprefix(obname));
takedamage(o, rnd(10,40), DT_DIRECT, NULL); takedamage(o, rnd(10,40), DT_DIRECT, NULL);
} }
break; break;
case 2: case 2:
// summon holy creautes // summon holy creautes
msg("\"Destroy him, my pets!\""); msg("\"Destroy him, my pets!\"");
summonlfs(god, player->cell, R_NONE, RC_ANY, SZ_ANY, AL_GOOD, 3, PERMENANT, B_FALSE); summonlfs(god, player->cell, R_NONE, RC_ANY, SZ_ANY, AL_GOOD, 3, PERMENANT, B_FALSE);
@ -659,7 +659,7 @@ void dooffer(void) {
validcorpse = B_FALSE; validcorpse = B_FALSE;
} }
} }
if (validcorpse) { if (validcorpse) {
ok = B_TRUE; ok = B_TRUE;
thispiety = f->val[2]; thispiety = f->val[2];
@ -694,7 +694,7 @@ void dooffer(void) {
ok = B_FALSE; ok = B_FALSE;
thispiety = 0; thispiety = 0;
} }
} }
if (ok) { if (ok) {
char *p; char *p;
@ -712,7 +712,7 @@ void dooffer(void) {
// } // }
} }
// special effect sacrificing flora to ekrub makes it turn into a // special effect sacrificing flora to ekrub makes it turn into a
// butterfly // butterfly
if ((god->race->id == R_GODNATURE) && (o->type->obclass->id == OC_FLORA)) { if ((god->race->id == R_GODNATURE) && (o->type->obclass->id == OC_FLORA)) {
newcell = getrandomadjcell(player->cell, &ccwalkable, B_NOEXPAND); newcell = getrandomadjcell(player->cell, &ccwalkable, B_NOEXPAND);
@ -720,7 +720,7 @@ void dooffer(void) {
if (haslos(player, player->cell)) { if (haslos(player, player->cell)) {
getobname(o, obname, ALL); getobname(o, obname, ALL);
if ((god->race->id == R_GODNATURE) && if ((god->race->id == R_GODNATURE) &&
(o->type->obclass->id == OC_FLORA) && (o->type->obclass->id == OC_FLORA) &&
!newcell) { !newcell) {
// couldn't create a butterfly // couldn't create a butterfly
@ -736,12 +736,12 @@ void dooffer(void) {
strrep(&p, "IS", "are", NULL); strrep(&p, "IS", "are", NULL);
strrep(&p, "#S", "", NULL); strrep(&p, "#S", "", NULL);
} }
msg("%s", p); msg("%s", p);
free(p); free(p);
} }
if ((god->race->id == R_GODNATURE) && if ((god->race->id == R_GODNATURE) &&
(o->type->obclass->id == OC_FLORA) && (o->type->obclass->id == OC_FLORA) &&
newcell) { newcell) {
addmonster(newcell, R_BUTTERFLY, NULL, B_FALSE, 1, B_FALSE, B_NOEXTRA, NULL); addmonster(newcell, R_BUTTERFLY, NULL, B_FALSE, 1, B_FALSE, B_NOEXTRA, NULL);
@ -919,7 +919,7 @@ int getprayedgods(lifeform_t **retgod, int *nretgods) {
retgod[*nretgods] = godlf[i]; retgod[*nretgods] = godlf[i];
(*nretgods)++; (*nretgods)++;
} }
} }
return *nretgods; return *nretgods;
} }
@ -954,13 +954,13 @@ enum OBTYPE getrelatedgodstone(enum RACE rid) {
void givegodbonus(enum RACE rid, flag_t *bf, int announce) { void givegodbonus(enum RACE rid, flag_t *bf, int announce) {
flag_t *f; flag_t *f;
lifeform_t *god; lifeform_t *god;
int targ[3], arg = NA; int targ[3], arg = NA;
enum PIETYLEV bonuslev; enum PIETYLEV bonuslev;
enum GODBONUS bonusid; enum GODBONUS bonusid;
god = findgod(rid); god = findgod(rid);
if (!god) return; if (!god) return;
// god announcement. // god announcement.
if (announce) { if (announce) {
godsay(rid, B_TRUE, getflagtext(god->flags, F_GODBONUSTEXT)); godsay(rid, B_TRUE, getflagtext(god->flags, F_GODBONUSTEXT));
@ -1036,14 +1036,14 @@ int prayedtoany(void) {
} }
void removegodbonus(enum RACE rid, flag_t *bf, int announce) { void removegodbonus(enum RACE rid, flag_t *bf, int announce) {
int targ[3], arg = NA; int targ[3], arg = NA;
enum PIETYLEV bonuslev; enum PIETYLEV bonuslev;
enum GODBONUS bonusid; enum GODBONUS bonusid;
lifeform_t *god; lifeform_t *god;
god = findgod(rid); god = findgod(rid);
if (!god) return; if (!god) return;
// god announcement. // god announcement.
if (announce) { if (announce) {
godsay(rid, B_TRUE, getflagtext(god->flags, F_GODNOBONUSTEXT)); godsay(rid, B_TRUE, getflagtext(god->flags, F_GODNOBONUSTEXT));
@ -1129,7 +1129,7 @@ lifeform_t *godappears(enum RACE rid, cell_t *where) {
if (haslos(player, where) && strlen(killedname)) { if (haslos(player, where) && strlen(killedname)) {
msg("%s transforms into %s!", killedname, godname); msg("%s transforms into %s!", killedname, godname);
} }
} else { } else {
teleportto(god, where, B_TRUE); teleportto(god, where, B_TRUE);
// visual effect for some gods // visual effect for some gods
@ -1148,7 +1148,7 @@ lifeform_t *godappears(enum RACE rid, cell_t *where) {
default: break; default: break;
} }
} }
return god; return god;
} }
@ -1214,7 +1214,7 @@ int godgiftmaybe(enum RACE rid, int fromtemple, int announce) {
if (timerflag && (timerflag->val[0] > 0)) { if (timerflag && (timerflag->val[0] > 0)) {
timerflag->val[0]--; timerflag->val[0]--;
return B_FALSE; return B_FALSE;
} }
if (pctchance(chance)) { // if this is true, you get a gift. if (pctchance(chance)) { // if this is true, you get a gift.
char obtogive[BUFLEN]; char obtogive[BUFLEN];
@ -1303,7 +1303,7 @@ int godgiftmaybe(enum RACE rid, int fromtemple, int announce) {
// change the race. // change the race.
setrace(player, R_VAMPIRE, B_FALSE); // ie. don't set origrace! setrace(player, R_VAMPIRE, B_FALSE); // ie. don't set origrace!
// restore stats // restore stats
player->maxhp = orighp; player->maxhp = orighp;
player->hp = orighp; player->hp = orighp;
@ -1334,7 +1334,7 @@ int godgiftmaybe(enum RACE rid, int fromtemple, int announce) {
if (wep) { if (wep) {
if (!hasobmod(wep, findobmod(OM_FLAMING))) { if (!hasobmod(wep, findobmod(OM_FLAMING))) {
applyobmod(wep, findobmod(OM_FLAMING)); applyobmod(wep, findobmod(OM_FLAMING));
} else if (!hasflag(wep->flags, F_HASBRAND)) { } else if (!hasflag(wep->flags, F_HASBRAND)) {
char obname[BUFLEN]; char obname[BUFLEN];
// already burning. gains pyromania // already burning. gains pyromania
addflag(wep->flags, F_FLAMESTRIKE, B_TRUE, NA, NA, NULL); addflag(wep->flags, F_FLAMESTRIKE, B_TRUE, NA, NA, NULL);
@ -1342,7 +1342,7 @@ int godgiftmaybe(enum RACE rid, int fromtemple, int announce) {
msg("Your %s glows with a brilliant heat!", noprefix(obname)); msg("Your %s glows with a brilliant heat!", noprefix(obname));
} else { // already has pyromania. } else { // already has pyromania.
rollagain = B_TRUE; rollagain = B_TRUE;
} }
} else { } else {
rollagain = B_TRUE; rollagain = B_TRUE;
} }
@ -1374,17 +1374,17 @@ int godgiftmaybe(enum RACE rid, int fromtemple, int announce) {
rollagain = B_TRUE; rollagain = B_TRUE;
} }
} }
break; break;
case 4: // grant immolation power case 4: // grant immolation power
if (lfhasflagval(player, F_CANWILL, OT_S_IMMOLATE, NA, NA, NULL)) { if (lfhasflagval(player, F_CANWILL, OT_S_IMMOLATE, NA, NA, NULL)) {
rollagain = B_TRUE; rollagain = B_TRUE;
} else { } else {
flag_t *f; flag_t *f;
f = addflag(player->flags, F_CANWILL, OT_S_IMMOLATE, 20, 20, f = addflag(player->flags, F_CANWILL, OT_S_IMMOLATE, 20, 20,
"pw:10;"); "pw:10;");
f->obfrom = god->race->id; f->obfrom = god->race->id;
} }
break; break;
} }
} }
break; break;
@ -1423,7 +1423,7 @@ int godgiftmaybe(enum RACE rid, int fromtemple, int announce) {
rollagain = B_TRUE; rollagain = B_TRUE;
} }
} }
break; break;
case 4: // increase max hp case 4: // increase max hp
player->maxhp += rollhitdice(player, B_TRUE); player->maxhp += rollhitdice(player, B_TRUE);
statdirty = B_TRUE; statdirty = B_TRUE;
@ -1602,7 +1602,7 @@ int godgiftmaybe(enum RACE rid, int fromtemple, int announce) {
object_t *wep; object_t *wep;
rollagain = B_FALSE; rollagain = B_FALSE;
wep = getweapon(player); wep = getweapon(player);
if (wep && !hasflag(wep->flags, F_HASBRAND)) { if (wep && !hasflag(wep->flags, F_HASBRAND)) {
char obname[BUFLEN]; char obname[BUFLEN];
brand_t *br; brand_t *br;
flag_t *f; flag_t *f;
@ -1634,16 +1634,16 @@ int godgiftmaybe(enum RACE rid, int fromtemple, int announce) {
case 3: case 3:
snprintf(obtogive, BUFLEN, "safebox"); snprintf(obtogive, BUFLEN, "safebox");
break; break;
case 4: case 4:
snprintf(obtogive, BUFLEN, "wand of opening"); snprintf(obtogive, BUFLEN, "wand of opening");
break; break;
case 5: case 5:
snprintf(obtogive, BUFLEN, "wand of invisibility"); snprintf(obtogive, BUFLEN, "wand of invisibility");
break; break;
case 6: case 6:
snprintf(obtogive, BUFLEN, "3-6 potions of invisibility"); snprintf(obtogive, BUFLEN, "3-6 potions of invisibility");
break; break;
case 7: case 7:
snprintf(obtogive, BUFLEN, "leather boots of stealth"); snprintf(obtogive, BUFLEN, "leather boots of stealth");
break; break;
} }
@ -1872,7 +1872,7 @@ void godstone_pickup_effects(lifeform_t *god, lifeform_t *opposegod, object_t *o
wprintw(mainwin, "forgiven.\"\n"); wprintw(mainwin, "forgiven.\"\n");
break; break;
case R_GODNATURE: case R_GODNATURE:
wprintw(mainwin, "\"%s! You hold the Godstone of Rage!\n\n", toupper(player->race->name[0]), (player->race->name + 1)); wprintw(mainwin, "\"%c%s! You hold the Godstone of Rage!\n\n", toupper(player->race->name[0]), (player->race->name + 1));
wprintw(mainwin, "Long have I sought this ancient artifact - it is from this stone that the\n"); wprintw(mainwin, "Long have I sought this ancient artifact - it is from this stone that the\n");
wprintw(mainwin, "insane God of Fire draws his destructive power.\n"); wprintw(mainwin, "insane God of Fire draws his destructive power.\n");
wprintw(mainwin, "If you can just deliver this stone to me, Klikirak's reign could be ended!\n\n"); wprintw(mainwin, "If you can just deliver this stone to me, Klikirak's reign could be ended!\n\n");
@ -1927,7 +1927,7 @@ void godstone_pickup_effects(lifeform_t *god, lifeform_t *opposegod, object_t *o
if (!godprayedto(god->race->id)) { if (!godprayedto(god->race->id)) {
addflag(god->flags, F_PRAYEDTO, B_TRUE, NA, NA, NULL); addflag(god->flags, F_PRAYEDTO, B_TRUE, NA, NA, NULL);
} }
// related god screams and gets furios/enraged at you. // related god screams and gets furios/enraged at you.
// (you lose prayedto if you have it?) // (you lose prayedto if you have it?)
if (getpietylev(god->race->id, NULL, NULL) == PL_FURIOUS) { if (getpietylev(god->race->id, NULL, NULL) == PL_FURIOUS) {
// becomes enraged // becomes enraged
@ -1983,7 +1983,7 @@ void pleasegod(enum RACE rid, int amt) {
// don't please/anger gods while enraged. // don't please/anger gods while enraged.
if (lfhasflag(player, F_RAGE)) return; if (lfhasflag(player, F_RAGE)) return;
// if you haven't praeyd to anyone yet, piety // if you haven't praeyd to anyone yet, piety
// gain is boosted heaps. // gain is boosted heaps.
/* /*
if (!prayedtoany()) { if (!prayedtoany()) {
@ -2076,9 +2076,9 @@ void pleasegodmaybe(enum RACE rid, int amt) {
// the angrier or more happy the god gets, the harder it // the angrier or more happy the god gets, the harder it
// is to please them. // is to please them.
// ie. INDIFFERENT = 1 in 1 (always) // ie. INDIFFERENT = 1 in 1 (always)
// ie. PLEASED/TOLERATED = 1 in 2 // ie. PLEASED/TOLERATED = 1 in 2
// ie. DELIGHTED/ANGRY = 1 in 3 // ie. DELIGHTED/ANGRY = 1 in 3
// ie. ECSTATIC/FURIOUS = 1 in 4 // ie. ECSTATIC/FURIOUS = 1 in 4
// ie. ENRAGED = 1 in 5 // ie. ENRAGED = 1 in 5
chance = modplev + 1; chance = modplev + 1;
if (hasequippedobid(player->pack, OT_AMU_PIETY)) { if (hasequippedobid(player->pack, OT_AMU_PIETY)) {
@ -2120,7 +2120,7 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
// get even more angry // get even more angry
angergod(god->race->id, PIETYPRAYLOSS, GA_PRAY); angergod(god->race->id, PIETYPRAYLOSS, GA_PRAY);
return B_FALSE; return B_FALSE;
} }
if (piety <= 99) { if (piety <= 99) {
// piety between 0 and 99 = ignored // piety between 0 and 99 = ignored
@ -2129,9 +2129,9 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
angergod(god->race->id, 0, GA_PRAY); angergod(god->race->id, 0, GA_PRAY);
modpiety(god->race->id, -30); modpiety(god->race->id, -30);
return B_FALSE; return B_FALSE;
} }
// if we get here, piety is >= 100. // if we get here, piety is >= 100.
// you get some help... // you get some help...
plev = getpietylev(god->race->id, NULL, NULL); plev = getpietylev(god->race->id, NULL, NULL);
@ -2241,7 +2241,7 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
// at this point, remember that we have now prayed to // at this point, remember that we have now prayed to
// this god. ie. player is expected to follow the god's rules. // this god. ie. player is expected to follow the god's rules.
if (!hasflag(god->flags, F_PRAYEDTO)) { if (!hasflag(god->flags, F_PRAYEDTO)) {
addflag(god->flags, F_PRAYEDTO, B_TRUE, NA, NA, NULL); addflag(god->flags, F_PRAYEDTO, B_TRUE, NA, NA, NULL);
@ -2297,11 +2297,11 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
abilityeffects(player, OT_A_RAGE, player->cell, player, NULL); abilityeffects(player, OT_A_RAGE, player->cell, player, NULL);
} }
break; break;
case 3: // case 3: //
msg("\"I will guide your blade!\""); msg("\"I will guide your blade!\"");
dospelleffects(god, OT_S_TRUESTRIKE, 10, lf, NULL, lf->cell, B_UNCURSED, NULL, B_TRUE, NULL); dospelleffects(god, OT_S_TRUESTRIKE, 10, lf, NULL, lf->cell, B_UNCURSED, NULL, B_TRUE, NULL);
break; break;
case 4: // case 4: //
msg("\"Your blows will be as lightning!\""); msg("\"Your blows will be as lightning!\"");
dospelleffects(god, OT_S_HASTE, 10, lf, NULL, lf->cell, B_UNCURSED, NULL, B_TRUE, NULL); dospelleffects(god, OT_S_HASTE, 10, lf, NULL, lf->cell, B_UNCURSED, NULL, B_TRUE, NULL);
break; break;
@ -2315,7 +2315,7 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
if (uncurse_one_equipped(lf, "\"Be free of your curse!\"")){ if (uncurse_one_equipped(lf, "\"Be free of your curse!\"")){
done = B_TRUE; done = B_TRUE;
} }
if (!done) { if (!done) {
// try to repair armour or undull weapons // try to repair armour or undull weapons
@ -2362,7 +2362,7 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
if (c) { if (c) {
dospelleffects(god, OT_S_LIGHT, 10, NULL, NULL, c, B_BLESSED, NULL, B_TRUE, NULL); dospelleffects(god, OT_S_LIGHT, 10, NULL, NULL, c, B_BLESSED, NULL, B_TRUE, NULL);
} }
// uncurse ALL equipped obs // uncurse ALL equipped obs
for (o = lf->pack->first ; o ; o = o->next) { for (o = lf->pack->first ; o ; o = o->next) {
if (iscursed(o) && isequipped(o)) { if (iscursed(o) && isequipped(o)) {
blessob(o); blessob(o);
@ -2393,9 +2393,9 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
} }
} }
} }
} }
// remove all temporary bad status effects // remove all temporary bad status effects
getflags(player->flags, retflag, &nretflags, F_BLIND, F_CONFUSED, F_DEAF, F_CAFFEINATED, F_DRUNK, F_FROZEN, getflags(player->flags, retflag, &nretflags, F_BLIND, F_CONFUSED, F_DEAF, F_CAFFEINATED, F_DRUNK, F_FROZEN,
F_GRABBEDBY, F_NAUSEATED, F_PAIN, F_POISONED, F_SLOWACT, F_SLOWMOVE, F_SLOWACTMOVE, F_NONE); F_GRABBEDBY, F_NAUSEATED, F_PAIN, F_POISONED, F_SLOWACT, F_SLOWMOVE, F_SLOWACTMOVE, F_NONE);
for (i = 0; i < nretflags; i++) { for (i = 0; i < nretflags; i++) {
@ -2431,15 +2431,15 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
if (!dospelleffects(god, OT_S_PURIFYFOOD, 10, lf, NULL, lf->cell, B_UNCURSED, NULL, B_TRUE, NULL)) { if (!dospelleffects(god, OT_S_PURIFYFOOD, 10, lf, NULL, lf->cell, B_UNCURSED, NULL, B_TRUE, NULL)) {
donesomething = B_TRUE; donesomething = B_TRUE;
} }
} }
// bless your weapon // bless your weapon
if (!donesomething) { if (!donesomething) {
wep = getweapon(player); wep = getweapon(player);
if (wep && !isblessed(wep)) { if (wep && !isblessed(wep)) {
blessob(wep); blessob(wep);
donesomething = B_TRUE; donesomething = B_TRUE;
} }
} }
// bless 1-3 random obs // bless 1-3 random obs
@ -2537,13 +2537,13 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
c = getcellat(player->cell->map, x, y); c = getcellat(player->cell->map, x, y);
if (c && cellhaslos(c, player->cell)) { if (c && cellhaslos(c, player->cell)) {
if (c->lf && (c->lf != player)) { if (c->lf && (c->lf != player)) {
dospelleffects(NULL, OT_S_FLAMEPILLAR, 10, NULL, NULL, dospelleffects(NULL, OT_S_FLAMEPILLAR, 10, NULL, NULL,
c, B_BLESSED, NULL, B_TRUE, NULL); c, B_BLESSED, NULL, B_TRUE, NULL);
} else if (countnoncosmeticobs(c->obpile, B_FALSE, B_FALSE)) { } else if (countnoncosmeticobs(c->obpile, B_FALSE, B_FALSE)) {
addobfast(c->obpile, OT_FIRESMALL); addobfast(c->obpile, OT_FIRESMALL);
i++; i++;
} }
} }
} }
} }
@ -2568,13 +2568,13 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
castspell(god, OT_S_HEALINGMAJ, player, NULL, player->cell, NULL, NULL); castspell(god, OT_S_HEALINGMAJ, player, NULL, player->cell, NULL, NULL);
donesomething = B_TRUE; donesomething = B_TRUE;
} }
if (lf->hp < lf->maxhp) { if (lf->hp < lf->maxhp) {
gainhp(lf, lf->maxhp); gainhp(lf, lf->maxhp);
donesomething = B_TRUE; donesomething = B_TRUE;
statdirty = B_TRUE; statdirty = B_TRUE;
} }
if (isinbattle(lf, B_INCLUDEDISTANT, B_FALSE)) { if (isinbattle(lf, B_INCLUDEDISTANT, B_FALSE)) {
// turn undead // turn undead
castspell(god, OT_S_TURNUNDEAD, lf, NULL, NULL, NULL, NULL); castspell(god, OT_S_TURNUNDEAD, lf, NULL, NULL, NULL, NULL);
if (plev >= PL_INDIFFERENT) { if (plev >= PL_INDIFFERENT) {
@ -2706,9 +2706,9 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
getobname(o,oldname,o->amt); getobname(o,oldname,o->amt);
identify(o); identify(o);
getobname(o,newname,o->amt); getobname(o,newname,o->amt);
msg("\"%s %s you are carrying %s %s!\"", msg("\"%s %s you are carrying %s %s!\"",
(o->amt == 1) ? "That" : "Those", (o->amt == 1) ? "That" : "Those",
noprefix(oldname), noprefix(oldname),
(o->amt == 1) ? "is" : "are", (o->amt == 1) ? "is" : "are",
newname); newname);
} else { } else {
@ -2773,7 +2773,7 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
int donesomething = B_FALSE; int donesomething = B_FALSE;
int preventstoning = B_FALSE; int preventstoning = B_FALSE;
int preventparalysis = B_FALSE; int preventparalysis = B_FALSE;
// if something nearby could stone/petrify you, confer temporary immunity. // if something nearby could stone/petrify you, confer temporary immunity.
for (l = lf->cell->map->lf ; l ; l = l->next) { for (l = lf->cell->map->lf ; l ; l = l->next) {
if ((l != lf) && areenemies(l, lf) && cansee(l, lf)) { if ((l != lf) && areenemies(l, lf) && cansee(l, lf)) {
@ -2784,7 +2784,7 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
int lastweaponidx; int lastweaponidx;
if (l->race->id == R_COCKATRICE) { if (l->race->id == R_COCKATRICE) {
preventstoning = B_TRUE; preventstoning = B_TRUE;
} }
getweapons(l, B_MELEEONLY, wep, damflag, &lastweaponidx, &op, &nweps); getweapons(l, B_MELEEONLY, wep, damflag, &lastweaponidx, &op, &nweps);
for (i = 0; i < nweps; i++) { for (i = 0; i < nweps; i++) {
if (hasflagval(wep[i]->flags, F_HITCONFER, F_PARALYZED, NA, NA, NULL)) { if (hasflagval(wep[i]->flags, F_HITCONFER, F_PARALYZED, NA, NA, NULL)) {
@ -2827,7 +2827,7 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
donesomething = B_TRUE; donesomething = B_TRUE;
} }
} }
// uncurse one equipped ob // uncurse one equipped ob
uncurse_one_equipped(lf, "\"Let thy curse be ended!\""); uncurse_one_equipped(lf, "\"Let thy curse be ended!\"");
break; break;
@ -2869,14 +2869,14 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
godappears(god->race->id, NULL); godappears(god->race->id, NULL);
aiattack(god, lf->los[i]->lf, PERMENANT); aiattack(god, lf->los[i]->lf, PERMENANT);
donesomething = B_TRUE; donesomething = B_TRUE;
break; break;
} }
} }
} else {// not in battle } else {// not in battle
int donesomething = B_FALSE; int donesomething = B_FALSE;
flag_t *f; flag_t *f;
// fix any poison potions // fix any poison potions
dospelleffects(god, OT_S_PURIFYFOOD, 10, lf, NULL, lf->cell, B_UNCURSED, NULL, B_TRUE, NULL); dospelleffects(god, OT_S_PURIFYFOOD, 10, lf, NULL, lf->cell, B_UNCURSED, NULL, B_TRUE, NULL);
if (ispoisoned(lf)) { if (ispoisoned(lf)) {
@ -2976,13 +2976,13 @@ int prayto(lifeform_t *lf, lifeform_t *god) {
} }
} }
// 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
modpiety(god->race->id, -PIETYPRAYLOSS); modpiety(god->race->id, -PIETYPRAYLOSS);
// } // }
// lower piety for other related gods // lower piety for other related gods
for (i = 0; i < ngodlfs; i++) { for (i = 0; i < ngodlfs; i++) {
if (godlf[i] != god) { if (godlf[i] != god) {
modpiety(godlf[i]->race->id, -25); modpiety(godlf[i]->race->id, -25);

28
io.c
View File

@ -587,7 +587,7 @@ char askchar(char *prompt, char *validchars, char *def, int showchars, int mayca
} }
strcat(buf, "? "); strcat(buf, "? ");
mvwprintw(msgwin, 0, 0, buf); mvwprintw(msgwin, 0, 0, "%s", buf);
_wr(msgwin); _wr(msgwin);
cset(1); cset(1);
@ -1301,7 +1301,7 @@ char *askstring(char *prompt, char punc, char *retbuf, int retbuflen, char *def)
asprintf(&ending, "%c ",punc); asprintf(&ending, "%c ",punc);
strcat(buf, ending); strcat(buf, ending);
free(ending); free(ending);
mvwprintw(msgwin, 0, 0, buf); mvwprintw(msgwin, 0, 0, "%s", buf);
_wr(msgwin); _wr(msgwin);
echo(); echo();
wgetnstr(msgwin, retbuf, retbuflen); wgetnstr(msgwin, retbuf, retbuflen);
@ -4328,7 +4328,7 @@ void describegod(lifeform_t *god) {
// title // title
snprintf(buf, BUFLEN, "God::%s %s",godname, goddesc); snprintf(buf, BUFLEN, "God::%s %s",godname, goddesc);
wattron(mainwin, A_BOLD); wattron(mainwin, A_BOLD);
mvwprintw(mainwin, 0, 0, buf); mvwprintw(mainwin, 0, 0, "%s", buf);
wattroff(mainwin, A_BOLD); wattroff(mainwin, A_BOLD);
wmove(mainwin, 2, 0); wmove(mainwin, 2, 0);
@ -4357,7 +4357,7 @@ void describejob(enum JOB jid) {
// title // title
snprintf(buf, BUFLEN, "%s",j->name); snprintf(buf, BUFLEN, "%s",j->name);
capitalise(buf); capitalise(buf);
mvwprintw(mainwin, 0, 0, buf); mvwprintw(mainwin, 0, 0, "%s", buf);
wmove(mainwin, 2, 0); wmove(mainwin, 2, 0);
@ -4387,7 +4387,7 @@ void describeob(object_t *o) {
getobname(o, buf,o->amt); getobname(o, buf,o->amt);
} }
wattron(mainwin, A_BOLD); wattron(mainwin, A_BOLD);
mvwprintw(mainwin, 0, 0, buf); mvwprintw(mainwin, 0, 0, "%s", buf);
wattroff(mainwin, A_BOLD); wattroff(mainwin, A_BOLD);
wmove(mainwin, 2, 0); wmove(mainwin, 2, 0);
@ -4486,7 +4486,7 @@ void describespell(objecttype_t *ot) {
// title // title
snprintf(buf, BUFLEN, "%s",ot->name); snprintf(buf, BUFLEN, "%s",ot->name);
capitalise(buf); capitalise(buf);
mvwprintw(mainwin, 0, 0, buf); mvwprintw(mainwin, 0, 0, "%s", buf);
wmove(mainwin, 2, 0); wmove(mainwin, 2, 0);
@ -10139,7 +10139,7 @@ void doheading(WINDOW *win, int *y, int x, char *what) {
wmove(win, *y, x); wmove(win, *y, x);
textwithcol(win, what); (*y)++; textwithcol(win, what); (*y)++;
setcol(win, C_WHITE); setcol(win, C_WHITE);
mvwprintw(win, *y, x, underline); (*y)++; mvwprintw(win, *y, x, "%s", underline); (*y)++;
unsetcol(win, C_WHITE); unsetcol(win, C_WHITE);
free(underline); free(underline);
} }
@ -11881,7 +11881,7 @@ void drawstatus(void) {
wattron(statwin, A_BOLD); wprintw(statwin, "AR:"); wattroff(statwin, A_BOLD); wattron(statwin, A_BOLD); wprintw(statwin, "AR:"); wattroff(statwin, A_BOLD);
snprintf(buf, BUFLEN, "%d ", getarmourrating(player, NULL, NULL, NULL, NULL)); snprintf(buf, BUFLEN, "%d ", getarmourrating(player, NULL, NULL, NULL, NULL));
wprintw(statwin, buf); wprintw(statwin, "%s", buf);
wattron(statwin, A_BOLD); wprintw(statwin, "EV:"); wattroff(statwin, A_BOLD); wattron(statwin, A_BOLD); wprintw(statwin, "EV:"); wattroff(statwin, A_BOLD);
wprintw(statwin, "%d ", getevasion(player)); wprintw(statwin, "%d ", getevasion(player));
@ -11889,16 +11889,16 @@ void drawstatus(void) {
wattron(statwin, A_BOLD); wprintw(statwin, "$:"); wattroff(statwin, A_BOLD); wattron(statwin, A_BOLD); wprintw(statwin, "$:"); wattroff(statwin, A_BOLD);
snprintf(buf, BUFLEN, "%d ", countmoney(player->pack)); snprintf(buf, BUFLEN, "%d ", countmoney(player->pack));
wprintw(statwin, buf); wprintw(statwin, "%s", buf);
wattron(statwin, A_BOLD); wprintw(statwin, "Xp:"); wattroff(statwin, A_BOLD); wattron(statwin, A_BOLD); wprintw(statwin, "Xp:"); wattroff(statwin, A_BOLD);
snprintf(buf, BUFLEN, "%d", player->level); snprintf(buf, BUFLEN, "%d", player->level);
wprintw(statwin, buf); wprintw(statwin, "%s", buf);
if (lfhasflag(player, F_HASNEWLEVEL)) { if (lfhasflag(player, F_HASNEWLEVEL)) {
wattron(statwin, A_BOLD); wprintw(statwin, "/"); wattroff(statwin, A_BOLD); wattron(statwin, A_BOLD); wprintw(statwin, "/"); wattroff(statwin, A_BOLD);
setcol(statwin, C_LIGHTGREEN); setcol(statwin, C_LIGHTGREEN);
wprintw(statwin, "LevUp",xpleft); wprintw(statwin, "LevUp");
unsetcol(statwin, C_LIGHTGREEN); unsetcol(statwin, C_LIGHTGREEN);
} else { } else {
wattron(statwin, A_BOLD); wprintw(statwin, "/"); wattroff(statwin, A_BOLD); wattron(statwin, A_BOLD); wprintw(statwin, "/"); wattroff(statwin, A_BOLD);
@ -13666,11 +13666,11 @@ void showlfstats(lifeform_t *lf, int showall) {
} }
setcol(mainwin, C_GREEN); setcol(mainwin, C_GREEN);
snprintf(buf, BUFLEN, "%-12s", ot->name); snprintf(buf, BUFLEN, "%-12s", ot->name);
mvwprintw(mainwin, y, 0, buf); mvwprintw(mainwin, y, 0, "%s", buf);
unsetcol(mainwin, C_GREEN); unsetcol(mainwin, C_GREEN);
snprintf(buf, BUFLEN, "%s%s", ot->desc, eb2); snprintf(buf, BUFLEN, "%s%s", ot->desc, eb2);
wprintw(mainwin, buf); wprintw(mainwin, "%s", buf);
if (downline(&y, h, headinglines, &nextoffset)) { if (downline(&y, h, headinglines, &nextoffset)) {
nextoffset += offset; nextoffset += offset;
@ -15050,7 +15050,7 @@ void showlfstats(lifeform_t *lf, int showall) {
getflagsourcetext(f,source); getflagsourcetext(f,source);
effectline(&stopnow, &count, offset, &nextoffset, headinglines, mainwin, &y, &x, 0, "%s %s protected from missiles by a cyclonic shield", you(lf), is(lf)); effectline(&stopnow, &count, offset, &nextoffset, headinglines, mainwin, &y, &x, 0, "%s %s protected from missiles by a cyclonic shield", you(lf), is(lf));
if (isplayer(lf)) { if (isplayer(lf)) {
wprintw(mainwin, " (power %d).%s",roman(f->val[0]),source); wprintw(mainwin, " (power %s).%s",roman(f->val[0]),source);
} else { } else {
wprintw(mainwin, ".%s",source); wprintw(mainwin, ".%s",source);
} }

18
shops.c
View File

@ -228,7 +228,7 @@ void shop(lifeform_t *lf, object_t *vm) {
cls(); cls();
mvwprintw(mainwin, 0, 0, toptext); mvwprintw(mainwin, 0, 0, "%s", toptext);
y = 2; y = 2;
centre(mainwin,C_WHITE, y, noprefix(shopname)); centre(mainwin,C_WHITE, y, noprefix(shopname));
y += 2; y += 2;
@ -435,11 +435,11 @@ enum SHOPRETURN shopdetectcurse(lifeform_t *lf, object_t *vm, int starty, char *
if (cost) { if (cost) {
mvwprintw(mainwin, y, 0, "It will cost $%d to perform an divination on your items.", cost); mvwprintw(mainwin, y, 0, "It will cost $%d to perform an divination on your items.", cost);
} else { } else {
mvwprintw(mainwin, y, 0, "For a fellow worshipper, we will perform divinations on your items for free.", cost); mvwprintw(mainwin, y, 0, "%s", "For a fellow worshipper, we will perform divinations on your items for free.");
} }
y += 2; y += 2;
if (countmoney(lf->pack) < cost) { if (countmoney(lf->pack) < cost) {
mvwprintw(mainwin, y, 0, "Unfortunately, you cannot afford this.", cost); mvwprintw(mainwin, y, 0, "%s", "Unfortunately, you cannot afford this.");
y += 2; y += 2;
possible = B_FALSE; possible = B_FALSE;
} }
@ -655,7 +655,7 @@ enum SHOPRETURN shopbless(lifeform_t *lf, object_t *vm, int starty, char *toptex
mvwprintw(mainwin, y, 0, "So long as their aura is known, we can bestow a blessing on most items."); y += 2; mvwprintw(mainwin, y, 0, "So long as their aura is known, we can bestow a blessing on most items."); y += 2;
if (remcursecost == 0) { if (remcursecost == 0) {
mvwprintw(mainwin, y, 0, "Curse removal - FREE",remcursecost); y++; mvwprintw(mainwin, y, 0, "Curse removal - FREE"); y++;
} else { } else {
mvwprintw(mainwin, y, 0, "Curse removal - $%d each",remcursecost); y++; mvwprintw(mainwin, y, 0, "Curse removal - $%d each",remcursecost); y++;
} }
@ -737,11 +737,11 @@ enum SHOPRETURN shopid(lifeform_t *lf, object_t *vm, int starty, char *toptext,
*nid = 0; *nid = 0;
mvwprintw(mainwin, y, 0, "We can help inspect your items for a small fee."); y += 2; mvwprintw(mainwin, y, 0, "%s", "We can help inspect your items for a small fee."); y += 2;
mvwprintw(mainwin, y, 0, "For just $%d per item we can reveal their general purpose,", cost); y++; mvwprintw(mainwin, y, 0, "For just $%d per item we can reveal their general purpose,", cost); y++;
mvwprintw(mainwin, y, 0, "however please note that we are unable to detect magical"); y++; mvwprintw(mainwin, y, 0, "%s", "however please note that we are unable to detect magical"); y++;
mvwprintw(mainwin, y, 0, "enchantments or blessings.", cost); y += 2; mvwprintw(mainwin, y, 0, "%s", "enchantments or blessings."); y += 2;
mvwprintw(mainwin, y, 0, "Identify items [y/n]? ", countmoney(lf->pack)); mvwprintw(mainwin, y, 0, "%s", "Identify items [y/n]? ");
ch = getch(); ch = getch();
if (ch != 'y') { if (ch != 'y') {
@ -1334,7 +1334,7 @@ enum SHOPRETURN shopsell(lifeform_t *lf, object_t *vm, int starty, char *toptext
*nsold = 0; *nsold = 0;
mvwprintw(mainwin, y, 0, "We offer good prices for quality items."); y += 2; mvwprintw(mainwin, y, 0, "We offer good prices for quality items."); y += 2;
mvwprintw(mainwin, y, 0, "Sell items [y/n]? ", countmoney(lf->pack)); mvwprintw(mainwin, y, 0, "Sell items [y/n]? ");
ch = getch(); ch = getch();
if (ch != 'y') { if (ch != 'y') {