- move all definitions into data.c / data.h
- [+] monsters should start sprinting if targetlf is sprinting && we can sprint && we aren't sprinting * [+] The kobold throws a potion of sleep at you. A potion of sleep hits you. A potion of sleep shatters! You are showered in glass shards! * [+] in getchoicestr, when there is only one valid choice, show its description below! - [+] in getchoicestr: - [+] remember desc_end_y - [+] if our typed text doesn't match, and desc_end_y is set - [+] blank out those lines - [+] in ], show letters and let you view amrour - [+] Still occasionally have bugs where no up stairs are placed in the first level!!!!! - [+] put in debugging to show if we ever destroy a staircase - [+] test when it happens again..... - [+] for "pentagram pulses black", if you can't see the estination, still say "your xxx flies away" - [+] change listen code: you can only hear one _footstep_ noise per turn, but any number of other things. - [+] instead of jobs replaceing hitdice, make them _modify_ maxhp by a certain %age. ie. f_modmaxhp 80% to get lower. - [+] jobs can no longer have F_HITDICE - [+] instead, they have F_MAXHPMOD - [+] why am i getting wet and drowning while flying?? - [+] show f_canwill SPELLS under abilities, not spells?? - More playable races - [+] need f_playablerace - [+] can pick when you start the game (before you pick job) - [+] human - [+] implement f_jobattrmod - [+] MOST JOBS SHOULD USE F_JOBATTRMOD instead of F_STARTATT. - [+] ALL PLAYABLE RACES must have FULL sets of STARTATT * [+] elf * [+] dwarf - [+] aviad (birdfolk) - [+] can fly - [+] vuln to electric attacks - [+] vuln++ to fire - [+] ---str - [+] cyborg - [+] +str, +int, +dex, +con - [+] ---cha - [+] -wis - [+] vulnerable to lightning, water,cold - [+] cannot use any magic, or med-high chance of spell failure - [+] bleeds oil rather than water - [+] see exact hp damage (f_extrainfo) - [+] tech usage. - [+] remember race in highscores.
This commit is contained in:
parent
b200e3acf7
commit
7f33b6351c
6
ai.c
6
ai.c
|
@ -677,6 +677,12 @@ int aimovetolf(lifeform_t *lf, lifeform_t *target, int wantattack) {
|
|||
if (db) {
|
||||
dblog(".oO { moving towards target. }");
|
||||
}
|
||||
|
||||
// do we need to sprint got catch up?
|
||||
if (lfhasflag(target, F_SPRINTING) && !lfhasflag(lf, F_SPRINTING) && cancast(lf, OT_A_SPRINT, NULL)) {
|
||||
useability(lf, OT_A_SPRINT, NULL,NULL); // doesn't matter if it fails
|
||||
}
|
||||
|
||||
if (!movetowards(lf, target->cell, DT_ORTH, B_FALSE)) {
|
||||
turntoface(lf, target->cell);
|
||||
// success
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#include "defs.h"
|
||||
|
||||
command_t *addcommand(enum COMMAND id, char c, char *desc);
|
||||
void initcommands(void);
|
||||
void initjobs(void);
|
||||
void initobjects(void);
|
||||
void initrace(void);
|
||||
void initskills(void);
|
||||
void sortcommands(void);
|
BIN
data/hiscores.db
BIN
data/hiscores.db
Binary file not shown.
27
defs.h
27
defs.h
|
@ -251,7 +251,7 @@ enum RELATIVEDIR {
|
|||
#define SAVEDIR "data/save"
|
||||
#define VAULTDIR "vaults"
|
||||
// rank, score, name, job, killer
|
||||
#define HISCOREFORMAT "%-6s%-7s%-14s%-18s%s"
|
||||
#define HISCOREFORMAT "%-6s%-7s%-10s%-18s%s"
|
||||
|
||||
// game strings
|
||||
#define MORESTRING "--More--"
|
||||
|
@ -364,8 +364,9 @@ enum CASTTYPE {
|
|||
|
||||
enum NOISECLASS {
|
||||
NC_NONE = 0,
|
||||
NC_SPEECH = 1,
|
||||
NC_OTHER = 2,
|
||||
NC_WALK = 1,
|
||||
NC_SPEECH = 2,
|
||||
NC_OTHER = 3,
|
||||
};
|
||||
|
||||
enum QUADRANT {
|
||||
|
@ -755,8 +756,13 @@ enum RACE {
|
|||
R_RANDOM, R_SPECIFIED,
|
||||
// unique monstesr
|
||||
R_JAILER,
|
||||
// human monsters
|
||||
// playable races
|
||||
R_AVIAD,
|
||||
R_CYBORG,
|
||||
R_DWARF,
|
||||
R_ELF,
|
||||
R_HUMAN,
|
||||
// human monsters
|
||||
R_BANDITLDR,
|
||||
R_BANDIT,
|
||||
R_BEGGAR,
|
||||
|
@ -2026,6 +2032,7 @@ enum FLAG {
|
|||
F_COUNTER, // generic counter flag for race abilities.
|
||||
F_DEBUG, // debugging enabled
|
||||
F_ACCURACYMOD, // modify your accuracy by val0
|
||||
F_PLAYABLE, // player can select to be this race.
|
||||
F_VAMPIRIC, // successful bite attacks form this lf will heal it
|
||||
F_VEGETARIAN, // this lf will not eat meat.
|
||||
F_PARTVEGETARIAN,// this lf will only eat if hunger >= 'hungry'
|
||||
|
@ -2038,6 +2045,7 @@ enum FLAG {
|
|||
// v0 is accuracy penalty, v1 is evasion penalty.
|
||||
F_LEVRACE, // at level v0, this race is promoted to race v1
|
||||
// must apply this to the BASE race.
|
||||
F_JOBATTRMOD, // add v1 to attr v0. only used in jobs.
|
||||
F_ATTRMOD, // modify attribute val0 by val1. ie. 0=A_STR,1=-3
|
||||
F_ATTRSET, // forces attribute val0 to be val1. ie. 0=A_STR,1=18
|
||||
F_SIZE, // val0 = lf size (enum LFSIZE)
|
||||
|
@ -2212,6 +2220,7 @@ enum FLAG {
|
|||
F_NUMAPPEAR, // when randomly appearing, can have > 1. val[0] = min, val[1] = max
|
||||
F_MINIONS, // val0 % chance of appearing with v1-v2 lf of type text
|
||||
F_HITDICE, // text = xdy+z to roll for maxhp per level.
|
||||
F_MAXHPMOD, // maxhp = pctof(v0, maxhp)
|
||||
F_MPDICE, // val0: # d4 to roll for maxmp per level. val1: +xx
|
||||
F_JOB, // val0 = player's class/job
|
||||
F_GODOF, // text = what this lf is the god of. use capitals.
|
||||
|
@ -2276,7 +2285,9 @@ enum FLAG {
|
|||
F_MAGICARMOUR,// armour is magically boosted. f->text is the description
|
||||
// ie 'magic armour', 'force field'
|
||||
// v0 is power left.
|
||||
F_ASLEEP, // is asleep. if v2 is set, means we are sleeping on
|
||||
F_ASLEEP, // lf is asleep.
|
||||
// if v1 is set, means we are 'meditating' instead
|
||||
// if v2 is set, means we are sleeping on
|
||||
// purpose and will wake up when at full hp/mp/etc.
|
||||
F_ATTACHEDTO, // you are attached to lf id v0, and will move with it
|
||||
F_AWARENESS, // you can see 360 degrees around yourself
|
||||
|
@ -2352,6 +2363,7 @@ enum FLAG {
|
|||
// (bypasses armour)
|
||||
F_GRAVBOOSTED,// cannot walk or throw stuff
|
||||
F_GRAVLESSENED,// knockback maeks you go further, can jump further
|
||||
F_MEDITATES, // meditates instead of sleeping.
|
||||
F_NEEDSWATER, // cannot survive out of deep water
|
||||
F_PAIN, // take damage if you walk. v0=damtype,text is damage (xdy+z).
|
||||
// if text not set, default dam is 1d2
|
||||
|
@ -3202,8 +3214,9 @@ typedef struct obmod_s {
|
|||
|
||||
typedef struct choice_s {
|
||||
char ch;
|
||||
char *text;
|
||||
char *desc;
|
||||
char *text; // what you type to select this one
|
||||
char *desc; // what is displayed on the screen
|
||||
char *longdesc; // what to display once you've selected this
|
||||
void *data;
|
||||
int heading;
|
||||
int valid; // used in askchoicestr
|
||||
|
|
|
@ -27,6 +27,7 @@ x = small creature/monster
|
|||
q = quadraped
|
||||
Q = large quadraped
|
||||
r = rodent
|
||||
R = robot
|
||||
s = snake
|
||||
S = spider
|
||||
h = humanoid
|
||||
|
@ -37,6 +38,7 @@ V = vampire
|
|||
z = lizard-like creature
|
||||
Z = undead
|
||||
|
||||
|
||||
---
|
||||
C
|
||||
hybrid human animal?
|
||||
|
|
6
io.h
6
io.h
|
@ -1,6 +1,6 @@
|
|||
#include <ncurses.h>
|
||||
#include "defs.h"
|
||||
void addchoice(prompt_t *p, char ch, char *text, char *desc, void *data);
|
||||
void addchoice(prompt_t *p, char ch, char *text, char *desc, void *data, char *longdesc);
|
||||
void addheading(prompt_t *p, char *text);
|
||||
void addmsghist(char *text);
|
||||
void addpromptq(prompt_t *p, char *q);
|
||||
|
@ -96,6 +96,10 @@ void initgfx(void);
|
|||
void initprompt(prompt_t *p, char *q1);
|
||||
int keycodetokey(int keycode);
|
||||
void listobs(WINDOW *win, object_t **mylist, int *sellist, int *selcount, int firstob, int *counter, int lastline, int *y, char *myletters, int forpickup, int showpoints);
|
||||
char *makedesc_god(lifeform_t *god, char *retbuf);
|
||||
char *makedesc_ob(object_t *o, char *retbuf);
|
||||
char *makedesc_skill(enum SKILL skid, char *retbuf);
|
||||
char *makedesc_spell(objecttype_t *ot, char *retbuf);
|
||||
void makespellchoicelist(prompt_t *pr, lifeform_t *lf, char *ques, char *ques2, enum SPELLSCHOOL wantschool, int wantunknown, int wantlowmp, int wanttoohard,int mpcutoff);
|
||||
void more(void);
|
||||
void warn(char *format, ... );
|
||||
|
|
427
lf.c
427
lf.c
|
@ -1266,7 +1266,7 @@ int castspell(lifeform_t *lf, enum OBTYPE sid, lifeform_t *targlf, object_t *tar
|
|||
strcat(buf, "\t");
|
||||
strcat(buf, desc);
|
||||
}
|
||||
addchoice(&prompt, '0' + i, buf, buf, NULL);
|
||||
addchoice(&prompt, '0' + i, buf, buf, NULL, NULL);
|
||||
}
|
||||
ch = getchoice(&prompt);
|
||||
power = ch - '0';
|
||||
|
@ -1506,6 +1506,10 @@ int checkfordrowning(lifeform_t *lf, object_t *o) {
|
|||
flag_t *f;
|
||||
enum SKILLLEVEL slev;
|
||||
|
||||
if (!isairborne(lf)) {
|
||||
return B_FALSE;
|
||||
}
|
||||
|
||||
i = getskill(lf, SK_SWIMMING) - isburdened(lf);
|
||||
limit(&i, 0, NA);
|
||||
slev = i;
|
||||
|
@ -1593,44 +1597,6 @@ int checkfordrowning(lifeform_t *lf, object_t *o) {
|
|||
return didsomething;
|
||||
}
|
||||
|
||||
/*
|
||||
void checkxp(enum RACE rid) {
|
||||
int i,xp;
|
||||
race_t *r;
|
||||
|
||||
r = findrace(rid);
|
||||
if (!r) {
|
||||
dblog("checkxp(): can't find race for rid %d",rid);
|
||||
return;
|
||||
}
|
||||
xp = calcxprace(rid);
|
||||
|
||||
|
||||
if (xp < xpposs[0]) {
|
||||
dblog("** Recommended rarity for %s: 100 (before %s/%d)",
|
||||
r->name,
|
||||
raceposs[0]->name, getracerarity(raceposs[0]->id));
|
||||
} else if (xp > xpposs[xplistlen-1]) {
|
||||
dblog("** Recommended rarity for %s: above %d (after %s/%d)",
|
||||
r->name, getracerarity(raceposs[xplistlen-1]->id),
|
||||
raceposs[xplistlen-1]->name, getracerarity(raceposs[xplistlen-1]->id));
|
||||
} else {
|
||||
for (i = 0; i < xplistlen-1; i++) {
|
||||
if ((raceposs[i]->d != r->id) && (raceposs[i+1] != r->id))
|
||||
if ((xp >= xpposs[i]) && (xp <= xpposs[i+1])) {
|
||||
dblog("** Recommended rarity for %s: %d (between %s/%d and %s/%d)",
|
||||
r->name, (int)((float)xpposs[i] + (float)xpposs[i+1])/2,
|
||||
raceposs[i]->name, getracerarity(raceposs[i]->id),
|
||||
raceposs[i+1]->name, getracerarity(raceposs[i+1]->id)
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
int check_rest_ok(lifeform_t *lf) {
|
||||
if (!safetorest(lf)) {
|
||||
if (isplayer(lf)) {
|
||||
|
@ -2675,12 +2641,6 @@ int eat(lifeform_t *lf, object_t *o) {
|
|||
pcteaten = (eateachturn / nutrition) * 100;
|
||||
|
||||
// announce
|
||||
/*
|
||||
msg("totnutr:%0.0lf,startpcteaten:%0.0lf,endpcteaten:%0.0f,eatperturn:%0.0f,turnstoeat:%0.0lf,fullyeaten:%s",
|
||||
nutrition,
|
||||
startpcteaten,pcteaten,
|
||||
eateachturn,turnstoeat,fullyeaten ? "YES" : "NO");
|
||||
*/
|
||||
snprintf(buf, BUFLEN, "%ld",o->id);
|
||||
alreadyeating = lfhasflagval(lf, F_EATING, NA, NA, NA, buf);
|
||||
|
||||
|
@ -3032,13 +2992,15 @@ void enhanceskills(lifeform_t *lf) {
|
|||
cost = getskilllevcost(f->val[1] + 1);
|
||||
if (lf->skillpoints >= cost) {
|
||||
char buf[BUFLEN];
|
||||
char buf2[HUGEBUFLEN];
|
||||
snprintf(buf, BUFLEN, "%s (%s, cost:%d points)", getskillname(f->val[0]),
|
||||
getskilllevelname(f->val[1] + 1), cost);
|
||||
addchoice(&prompt, ch++, getskillname(f->val[0]), buf, f);
|
||||
makedesc_skill(f->val[0], buf2);
|
||||
addchoice(&prompt, ch++, getskillname(f->val[0]), buf, f, buf2);
|
||||
}
|
||||
}
|
||||
}
|
||||
addchoice(&prompt, '-', "None", "None", NULL);
|
||||
addchoice(&prompt, '-', "None", "None", NULL, NULL);
|
||||
|
||||
while (!done) {
|
||||
getchoicestr(&prompt, B_FALSE, B_TRUE);
|
||||
|
@ -3079,11 +3041,13 @@ void enhanceskills(lifeform_t *lf) {
|
|||
for (sk = firstskill ; sk ; sk = sk->next) {
|
||||
if (!getskill(player, sk->id) && canlearn(player, sk->id)) {
|
||||
char buf[BUFLEN];
|
||||
char buf2[HUGEBUFLEN];
|
||||
snprintf(buf, BUFLEN, "%-18s(%s)", getskillname(sk->id), getskilldesc(sk->id));
|
||||
addchoice(&prompt, ch++, getskillname(sk->id), buf, sk);
|
||||
makedesc_skill(sk->id, buf2);
|
||||
addchoice(&prompt, ch++, getskillname(sk->id), buf, sk, buf2);
|
||||
}
|
||||
}
|
||||
addchoice(&prompt, '-', "None", "None", NULL);
|
||||
addchoice(&prompt, '-', "None", "None", NULL, NULL);
|
||||
while (!done) {
|
||||
getchoicestr(&prompt, B_FALSE, B_TRUE);
|
||||
sk = (skill_t *)prompt.result;
|
||||
|
@ -3841,13 +3805,6 @@ void gainlevel(lifeform_t *lf) {
|
|||
lf->skillpoints++;
|
||||
}
|
||||
|
||||
//if (postready && !preready) {
|
||||
/*
|
||||
} else {
|
||||
killflagsofid(lf->flags, F_HASNEWLEVEL);
|
||||
}
|
||||
*/
|
||||
|
||||
if (isplayer(lf)) {
|
||||
msg("^GYou are ready to train a new experience level!");
|
||||
more();
|
||||
|
@ -4871,17 +4828,6 @@ object_t *getbestweapon(lifeform_t *lf) {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (op && (bestwep == op->first)) {
|
||||
// ie. use no weapon
|
||||
bestwep = NULL;
|
||||
}
|
||||
|
||||
if (op) {
|
||||
killobpile(op);
|
||||
}
|
||||
*/
|
||||
|
||||
if (bestwep && (bestwep->pile->owner == NULL)) {
|
||||
// ie. best weapon is an innate attack
|
||||
bestwep = NULL;
|
||||
|
@ -5034,22 +4980,6 @@ int getguntargetid(lifeform_t *lf) {
|
|||
return f->val[0];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
// get time to heal 1 hp
|
||||
int gethealtime(lifeform_t *lf) {
|
||||
int healtime;
|
||||
flag_t *f;
|
||||
f = lfhasflag(lf, F_HEALTIME);
|
||||
if (f) {
|
||||
healtime = f->val[0];
|
||||
} else {
|
||||
healtime = DEF_HEALTIME;
|
||||
}
|
||||
return healtime;
|
||||
}
|
||||
*/
|
||||
|
||||
int gethearingrange(lifeform_t *lf) {
|
||||
int range = 8; // deafult
|
||||
range = 2 + (getskill(lf, SK_LISTEN)*2);
|
||||
|
@ -5557,12 +5487,6 @@ char *getseenlfconditionname(lifeform_t *lf, lifeform_t *viewer) {
|
|||
|
||||
glyph_t *getlfglyph(lifeform_t *lf) {
|
||||
flag_t *f;
|
||||
/*
|
||||
if (isplayer(lf) && !ispolymorphed(lf)) {
|
||||
return &playerglyph;
|
||||
}
|
||||
*/
|
||||
|
||||
if (lfhasflag(lf, F_FEIGNINGDEATH)) {
|
||||
// look like a corpse
|
||||
tempglyph.ch = '%';
|
||||
|
@ -6951,9 +6875,12 @@ void givejob(lifeform_t *lf, enum JOB jobid) {
|
|||
job_t *j;
|
||||
flag_t *f;
|
||||
int i;
|
||||
int rollhp = B_FALSE, rollmp = B_FALSE;
|
||||
//int rollhp = B_FALSE;
|
||||
int rollmp = B_FALSE;
|
||||
int rollatt[MAXATTS];
|
||||
int db = B_FALSE;
|
||||
flag_t *retflag[MAXCANDIDATES];
|
||||
int nretflags;
|
||||
|
||||
if (db) dblog("givejob() starting.\n");
|
||||
|
||||
|
@ -6965,13 +6892,11 @@ void givejob(lifeform_t *lf, enum JOB jobid) {
|
|||
addflag(lf->flags, F_JOB, jobid, NA, NA, NULL);
|
||||
j = findjob(jobid);
|
||||
|
||||
// override hitdice from race
|
||||
if (hasflag(j->flags, F_HITDICE)) {
|
||||
rollhp = B_TRUE;
|
||||
f = lfhasflag(lf, F_HITDICE);
|
||||
// apply job's maxhp mod
|
||||
f = hasflag(j->flags, F_MAXHPMOD);
|
||||
if (f) {
|
||||
killflag(f);
|
||||
}
|
||||
lf->maxhp = pctof(f->val[0], lf->maxhp);
|
||||
lf->hp = lf->maxhp;
|
||||
}
|
||||
// override mpdice from race
|
||||
if (hasflag(j->flags, F_MPDICE)) {
|
||||
|
@ -6982,7 +6907,15 @@ void givejob(lifeform_t *lf, enum JOB jobid) {
|
|||
}
|
||||
}
|
||||
|
||||
// inherit all flags except startob ones
|
||||
// apply attrib mods from this job
|
||||
getflags(j->flags, retflag, &nretflags, F_JOBATTRMOD, F_NONE);
|
||||
for (i = 0; i < nretflags; i++) {
|
||||
f = retflag[i];
|
||||
modattr(lf, f->val[0], f->val[1]);
|
||||
}
|
||||
|
||||
// inherit all flags except:
|
||||
// - hpmod ones
|
||||
for (f = j->flags->first ; f ; f = f->next) {
|
||||
int ignorethis = B_FALSE;
|
||||
int val[3];
|
||||
|
@ -7018,10 +6951,19 @@ void givejob(lifeform_t *lf, enum JOB jobid) {
|
|||
ignorethis = B_TRUE;
|
||||
}
|
||||
|
||||
switch (f->id) {
|
||||
case F_MAXHPMOD:
|
||||
case F_JOBATTRMOD:
|
||||
ignorethis = B_TRUE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!ignorethis) {
|
||||
if (db) dblog("inheriting flagid %d.", f->id);
|
||||
addflag_real(lf->flags, id, val[0], val[1], val[2], text, FROMJOB,B_TRUE, -1);
|
||||
if (id == F_STARTATT) {
|
||||
if (id == F_STARTATT) { // need to reroll attribs if we override them.
|
||||
rollatt[val[0]] = B_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -7035,6 +6977,7 @@ void givejob(lifeform_t *lf, enum JOB jobid) {
|
|||
|
||||
|
||||
// override hp/mp from race
|
||||
/*
|
||||
if (rollhp) {
|
||||
lf->maxhp = 0;
|
||||
for (i = 0; i < lf->level; i++) {
|
||||
|
@ -7043,6 +6986,7 @@ void givejob(lifeform_t *lf, enum JOB jobid) {
|
|||
}
|
||||
lf->hp = lf->maxhp;
|
||||
}
|
||||
*/
|
||||
|
||||
if (rollmp) {
|
||||
f = hasflag(lf->flags, F_MPDICE);
|
||||
|
@ -7461,7 +7405,7 @@ void givestartobs(lifeform_t *lf, object_t *targob, flagpile_t *fp) {
|
|||
initprompt(&prompt, buf);
|
||||
|
||||
for (i = 0; i < nposs; i++) {
|
||||
addchoice(&prompt, ch++, poss[i]->name, NULL, poss[i]);
|
||||
addchoice(&prompt, ch++, poss[i]->name, NULL, poss[i], NULL);
|
||||
}
|
||||
|
||||
if (prompt.nchoices == 1) {
|
||||
|
@ -7684,7 +7628,7 @@ int gotosleep(lifeform_t *lf, int onpurpose) {
|
|||
return B_TRUE;
|
||||
}
|
||||
if (onpurpose) taketime(lf, getactspeed(lf));
|
||||
addflag(lf->flags, F_ASLEEP, B_TRUE, NA, onpurpose ? B_TRUE : NA, NULL);
|
||||
addflag(lf->flags, F_ASLEEP, B_TRUE, lfhasflag(lf, F_MEDITATES) ? B_TRUE : NA, onpurpose ? B_TRUE : NA, NULL);
|
||||
return B_FALSE;
|
||||
}
|
||||
|
||||
|
@ -7923,48 +7867,6 @@ int lfcanbestoned(lifeform_t *lf) {
|
|||
// conferred by a held/equipped object?
|
||||
flag_t *lfhasflag(lifeform_t *lf, enum FLAG fid) {
|
||||
flag_t *f;
|
||||
|
||||
// note: we check conferred flags first because we want
|
||||
// these to override ones direclty on the player.
|
||||
|
||||
// does a held object give us this flag?
|
||||
/*
|
||||
o = hasobwithflagval(lf->pack, F_HOLDCONFER, fid, NA, NA, NULL);
|
||||
if (o) {
|
||||
// return the flag, not the objcet
|
||||
f = hasflagval(o->flags, F_HOLDCONFER, fid, NA, NA, NULL);
|
||||
if (f) return f;
|
||||
}
|
||||
|
||||
for (o = lf->pack->first ; o ; o = o->next) {
|
||||
f = hasflagval(o->flags, F_HOLDCONFER, fid, NA, NA, NULL);
|
||||
if (f) {
|
||||
if (f->val[2] == B_IFIDENT) {
|
||||
if (isknown(o)) return f;
|
||||
} else {
|
||||
return f;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// does an equipped object give us this flag?
|
||||
for (o = lf->pack->first ; o ; o = o->next) {
|
||||
if (hasflag(o->flags, F_EQUIPPED)) {
|
||||
f = hasflagval(o->flags, F_EQUIPCONFER, fid, NA, NA, NULL);
|
||||
if (f) {
|
||||
if (f->val[2] == B_IFIDENT) {
|
||||
if (isknown(o)) return f;
|
||||
} else {
|
||||
return f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// do we have this flag directly?
|
||||
f = hasflag(lf->flags, fid);
|
||||
if (f) return f;
|
||||
return NULL;
|
||||
|
@ -7974,86 +7876,12 @@ flag_t *lfhasflagval(lifeform_t *lf, enum FLAG fid, int val0, int val1, int val2
|
|||
flag_t *f;
|
||||
f = hasflagval(lf->flags, fid, val0, val1, val2, text);
|
||||
if (f) return f;
|
||||
|
||||
// does a held object give us this flag?
|
||||
/*
|
||||
o = hasobwithflagval(lf->pack, F_HOLDCONFER, fid, val0, val1, text);
|
||||
if (o) {
|
||||
// return the flag, not the objcet
|
||||
f = hasflagval(o->flags, F_HOLDCONFER, fid, val0, val1, text);
|
||||
if (f) return f;
|
||||
}
|
||||
|
||||
for (o = lf->pack->first ; o ; o = o->next) {
|
||||
f = hasflagval(o->flags, F_HOLDCONFER, fid, val0, val1, text);
|
||||
if (f) {
|
||||
if (f->val[2] == B_IFIDENT) {
|
||||
if (isknown(o)) return f;
|
||||
} else {
|
||||
return f;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// does an equipped object give us this flag?
|
||||
/*
|
||||
for (o = lf->pack->first ; o ; o = o->next) {
|
||||
if (hasflag(o->flags, F_EQUIPPED)) {
|
||||
f = hasflagval(o->flags, F_EQUIPCONFER, fid, val0, val1, NULL);
|
||||
if (f) {
|
||||
if (f->val[2] == B_IFIDENT) {
|
||||
if (isknown(o)) return f;
|
||||
} else {
|
||||
return f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
return NULL;
|
||||
}
|
||||
|
||||
flag_t *lfhasknownflag(lifeform_t *lf, enum FLAG fid) {
|
||||
flag_t *f;
|
||||
|
||||
// note: we check conferred flags first because we want
|
||||
// these to override ones direclty on the player.
|
||||
|
||||
/*
|
||||
|
||||
for (o = lf->pack->first ; o ; o = o->next) {
|
||||
if (isknown(o)) {
|
||||
f = hasflagval(o->flags, F_HOLDCONFER, fid, NA, NA, NULL);
|
||||
if (f && f->known) {
|
||||
if (f->val[2] == B_IFIDENT) {
|
||||
if (isknown(o)) return f;
|
||||
} else {
|
||||
return f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
// does an equipped object give us this flag?
|
||||
/*
|
||||
for (o = lf->pack->first ; o ; o = o->next) {
|
||||
if (isknown(o)) {
|
||||
if (hasflag(o->flags, F_EQUIPPED)) {
|
||||
f = hasflagval(o->flags, F_EQUIPCONFER, fid, NA, NA, NULL);
|
||||
if (f && f->known) {
|
||||
if (f->val[2] == B_IFIDENT) {
|
||||
if (isknown(o)) return f;
|
||||
} else {
|
||||
return f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// do we have this flag directly?
|
||||
f = hasflagknown(lf->flags, fid);
|
||||
if (f && f->known) return f;
|
||||
|
@ -8062,38 +7890,6 @@ flag_t *lfhasknownflag(lifeform_t *lf, enum FLAG fid) {
|
|||
|
||||
flag_t *lfhasknownflagval(lifeform_t *lf, enum FLAG fid, int val0, int val1, int val2, char *text) {
|
||||
flag_t *f;
|
||||
|
||||
/*
|
||||
for (o = lf->pack->first ; o ; o = o->next) {
|
||||
if (isknown(o)) {
|
||||
f = hasflagval(o->flags, F_HOLDCONFER, fid, val0, val1, text);
|
||||
if (f && f->known) {
|
||||
if (f->val[2] == B_IFIDENT) {
|
||||
if (isknown(o)) return f;
|
||||
} else {
|
||||
return f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// does an equipped object give us this flag?
|
||||
for (o = lf->pack->first ; o ; o = o->next) {
|
||||
if (isknown(o)) {
|
||||
if (hasflag(o->flags, F_EQUIPPED)) {
|
||||
f = hasflagval(o->flags, F_EQUIPCONFER, fid, val0, val1, NULL);
|
||||
if (f && f->known) {
|
||||
if (f->val[2] == B_IFIDENT) {
|
||||
if (isknown(o)) return f;
|
||||
} else {
|
||||
return f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// got the flag directly?
|
||||
f = hasflagvalknown(lf->flags, fid, val0, val1, val2, text);
|
||||
if (f && f->known) return f;
|
||||
|
@ -8583,9 +8379,11 @@ int isbleeding(lifeform_t *lf) {
|
|||
}
|
||||
|
||||
int isblind(lifeform_t *lf) {
|
||||
flag_t *f;
|
||||
if (!lf) return B_FALSE;
|
||||
|
||||
if (lfhasflag(lf, F_ASLEEP)) {
|
||||
f = lfhasflag(lf, F_ASLEEP);
|
||||
if (f && (f->val[1] == NA)) {
|
||||
return B_TRUE;
|
||||
}
|
||||
if (lfhasflag(lf, F_BLIND)) {
|
||||
|
@ -9267,7 +9065,6 @@ void addtrail(lifeform_t *lf, int dir) {
|
|||
// footprints first
|
||||
if (!isairborne(lf) && !lfhasflag(lf, F_NONCORPOREAL)) {
|
||||
int fpdir;
|
||||
|
||||
if (getskill(lf, SK_PERCEPTION) >= PR_EXPERT) {
|
||||
// no footprints!
|
||||
return;
|
||||
|
@ -9613,11 +9410,6 @@ int areallies(lifeform_t *lf1, lifeform_t *lf2) {
|
|||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
if (getallegiance(lf1) == getallegiance(lf2)) {
|
||||
return B_TRUE;
|
||||
}
|
||||
*/
|
||||
return B_FALSE;
|
||||
}
|
||||
|
||||
|
@ -10419,7 +10211,7 @@ void makenoise(lifeform_t *lf, enum NOISETYPE nid) {
|
|||
if (nid == N_WALK) {
|
||||
volume += getarmournoise(lf);
|
||||
}
|
||||
noise(lf->cell, lf, NC_OTHER, volume, noisetext, verb);
|
||||
noise(lf->cell, lf, (nid == N_WALK) ? NC_WALK : NC_OTHER, volume, noisetext, verb);
|
||||
} else {
|
||||
// some defaults
|
||||
if (nid == N_WALK) {
|
||||
|
@ -10462,7 +10254,7 @@ void makenoise(lifeform_t *lf, enum NOISETYPE nid) {
|
|||
}
|
||||
volume += getarmournoise(lf);
|
||||
if (strlen(movetext)) {
|
||||
noise(lf->cell, lf, NC_OTHER, volume, movetext, NULL);
|
||||
noise(lf->cell, lf, (nid == N_WALK) ? NC_WALK : NC_OTHER, volume, movetext, NULL);
|
||||
}
|
||||
} else if (nid == N_WARCRY) {
|
||||
noise(lf->cell, lf, NC_OTHER, 4, "a blood-curdling war cry!", "shouts a blood-curdling war-cry!");
|
||||
|
@ -10837,7 +10629,8 @@ int noise(cell_t *c, lifeform_t *noisemaker, enum NOISECLASS nt, int volume, cha
|
|||
msg("%s %s.", lfname, realseetext);
|
||||
rv = B_TRUE;
|
||||
}
|
||||
} else if (text && !lfhasflag(l, F_DEAF) && ((nt == NC_SPEECH) || !lfhasflag(l, F_DONELISTEN))) {
|
||||
} else if (text && !lfhasflag(l, F_DEAF) && ((nt != NC_WALK) || !lfhasflag(l, F_DONELISTEN))) {
|
||||
// this means you can only hear one 'walk' sound per turn
|
||||
char textnopunc[BUFLEN];
|
||||
char punc;
|
||||
int dist;
|
||||
|
@ -10922,8 +10715,8 @@ int noise(cell_t *c, lifeform_t *noisemaker, enum NOISECLASS nt, int volume, cha
|
|||
msg("You hear %s", text);
|
||||
rv = B_TRUE;
|
||||
}
|
||||
// only hear one thing per turn.
|
||||
if (isplayer(l)) {
|
||||
// can only hear one 'walk' sound per turn.
|
||||
if (isplayer(l) && (nt == NC_WALK)) {
|
||||
addflag(l->flags, F_DONELISTEN, B_TRUE, NA, NA, NULL);
|
||||
practice(l, SK_LISTEN, 1);
|
||||
}
|
||||
|
@ -11127,9 +10920,6 @@ int pickup(lifeform_t *lf, object_t *what, int howmany, int fromground, int want
|
|||
msg("%s picks up %s.",buf, obname);
|
||||
}
|
||||
}
|
||||
/*
|
||||
taketime(lf, (SPEED_PICKUP * howmany));
|
||||
*/
|
||||
taketime(lf, SPEED_PICKUP);
|
||||
|
||||
// TODO: update burdened status
|
||||
|
@ -11367,16 +11157,6 @@ void precalclos_new(lifeform_t *lf) {
|
|||
calcbresnham(lf->cell->map, lf->cell->x, lf->cell->y, endx[nn], endy[nn], retcell, &numpixels );
|
||||
// keep going until we lose los
|
||||
for (n = 0; keepgoing && (n < numpixels); n++) {
|
||||
/*
|
||||
// calc x/y change
|
||||
xd = precos[ang];
|
||||
yd = presin[ang];
|
||||
//limitd(&xd, -1, 1);
|
||||
//limitd(&yd, -1, 1);
|
||||
// get new cell
|
||||
x += xd;
|
||||
y += yd;
|
||||
*/
|
||||
c = retcell[n];
|
||||
if (n != 0) currange++;
|
||||
if (currange > maxvisrange) c = NULL;
|
||||
|
@ -11419,33 +11199,6 @@ void precalclos_new(lifeform_t *lf) {
|
|||
}
|
||||
assert(nlos < (MAX_MAPW * MAX_MAPH));
|
||||
|
||||
// deal with enhanced smell - do a second sweep in all directions.
|
||||
/*
|
||||
if (enhancesmell) {
|
||||
int n;
|
||||
get_circular_fov_endpoints(lf, enhancesmell->val[0], endx, endy, &nendcells);
|
||||
|
||||
for (i = 0;i < nendcells; i++) {
|
||||
calcbresnham(lf->cell->map, lf->cell->x, lf->cell->y, endx[i], endy[i], retcell, &numpixels );
|
||||
// keep going until we lose los
|
||||
for (n = 0; n < numpixels; n++) {
|
||||
if ((retcell[n]->lf && (retcell[n]->lf->race->raceclass->id != RC_UNDEAD)) ||
|
||||
hasobwithflag(retcell[n]->obpile, F_SMELLY) ) { // && (endcell[i]->lf != lf)) {
|
||||
int nn,found = B_FALSE;
|
||||
for (nn = 0; nn < nlos; nn++) { // can we already see this cell?
|
||||
if (los[nn] == retcell[n]) {
|
||||
found = B_TRUE; break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
los[nlos++] = retcell[n];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// now fill in lifeform structure
|
||||
lf->los = malloc(sizeof(cell_t *) * nlos);
|
||||
for (i = 0; i < nlos; i++) {
|
||||
|
@ -12333,25 +12086,6 @@ void interrupt(lifeform_t *lf) {
|
|||
killflagsofid(lf->flags, F_AUTOCMD);
|
||||
}
|
||||
|
||||
/*j
|
||||
void setlftarget(lifeform_t *lf, lifeform_t *victim) {
|
||||
// first remove existing targets
|
||||
killflagsofid(lf->flags, F_TARGET);
|
||||
killflagsofid(lf->flags, F_TARGETCELL);
|
||||
|
||||
// set new target
|
||||
addflag(lf->flags, F_TARGET, victim->id, victim->cell->x, victim->cell->x, NULL);
|
||||
|
||||
if (!areenemies(lf, victim)) {
|
||||
if (getallegiance(victim) == AL_FRIENDLY) {
|
||||
if (!hasflag(lf->flags, F_HOSTILE)) {
|
||||
addflag(lf->flags, F_HOSTILE, B_TRUE, NA, NA, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
int setlfmaterial(lifeform_t *lf, enum MATERIAL id) {
|
||||
if (getlfmaterial(lf) == id) {
|
||||
return B_TRUE;
|
||||
|
@ -13689,12 +13423,12 @@ int steal(lifeform_t *lf, obpile_t *op, enum FLAG wantflag) {
|
|||
}
|
||||
if (ok) {
|
||||
getobname(o, buf, 1);
|
||||
addchoice(&prompt, fromground ? letter++ : o->letter, buf, NULL, o);
|
||||
addchoice(&prompt, fromground ? letter++ : o->letter, buf, NULL, o, NULL);
|
||||
}
|
||||
}
|
||||
if (prompt.nchoices > 1) {
|
||||
if (isplayer(lf) && (slev >= PR_ADEPT)) {
|
||||
addchoice(&prompt, '-', "Nothing", NULL, NULL);
|
||||
addchoice(&prompt, '-', "Nothing", NULL, NULL, NULL);
|
||||
// pick what you want
|
||||
getchoice(&prompt);
|
||||
o = (object_t *)prompt.result;
|
||||
|
@ -13808,11 +13542,11 @@ void stopresting(lifeform_t *lf) {
|
|||
if (f) {
|
||||
killflag(f);
|
||||
if (isplayer(lf)) {
|
||||
msg("Your rest is interrupted!");
|
||||
msg("Your %s is interrupted!", (f->val[1] == NA) ? "rest" : "meditation");
|
||||
} else if (cansee(player, lf)) {
|
||||
char buf[BUFLEN];
|
||||
getlfname(lf, buf);
|
||||
msg("%s stops resting.",buf);
|
||||
msg("%s stops %s.",buf, (f->val[1] == NA) ? "resting" : "meditating");
|
||||
}
|
||||
statdirty = B_TRUE;
|
||||
}
|
||||
|
@ -13960,12 +13694,6 @@ void taketime(lifeform_t *lf, long howlong) {
|
|||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
if (isplayer(lf)) {
|
||||
statdirty = B_TRUE;
|
||||
}
|
||||
*/
|
||||
|
||||
map = lf->cell->map;
|
||||
|
||||
assert(howlong > 0);
|
||||
|
@ -14845,6 +14573,15 @@ int validateraces(void) {
|
|||
printf("ERROR in race '%s' - F_HITCONFER, but no HITCONFERVALS defined.\n", r->name);
|
||||
goterror = B_TRUE;
|
||||
}
|
||||
} else if (f->id == F_PLAYABLE) {
|
||||
// playable races must have fully defined stats
|
||||
enum ATTRIB a;
|
||||
for (a = 0 ; a < MAXATTS; a++) {
|
||||
if (!hasflagval(r->flags, F_STARTATT, a, NA, NA, NULL)) {
|
||||
printf("ERROR in race '%s' - race is f_playable but has no f_startatt %s\n", r->name, getattrname(a));
|
||||
goterror = B_TRUE;
|
||||
}
|
||||
}
|
||||
} else if (f->id == F_STARTATT) {
|
||||
if (strlen(f->text) && (f->val[1] != NA)) {
|
||||
printf("ERROR in race '%s' - F_STARTATT has both text range and val1.", r->name);
|
||||
|
@ -15212,9 +14949,9 @@ int wear(lifeform_t *lf, object_t *o) {
|
|||
} else {
|
||||
snprintf(buf, BUFLEN, "%s", getbodypartname(possbp[i]));
|
||||
}
|
||||
addchoice(&prompt, ch++, buf, NULL, &possbp[i]);
|
||||
addchoice(&prompt, ch++, buf, NULL, &possbp[i], NULL);
|
||||
}
|
||||
addchoice(&prompt, '-', "(cancel)", NULL, NULL);
|
||||
addchoice(&prompt, '-', "(cancel)", NULL, NULL, NULL);
|
||||
ch = getchoice(&prompt);
|
||||
|
||||
if (ch == '-') {
|
||||
|
@ -15336,20 +15073,6 @@ int wear(lifeform_t *lf, object_t *o) {
|
|||
|
||||
maketried(o->type->id);
|
||||
|
||||
/*
|
||||
if (isplayer(lf)) {
|
||||
// equipping unknown objects makes them known
|
||||
if (!isknown(o)) {
|
||||
// announce
|
||||
announceob(o->type->id);
|
||||
|
||||
// make the obejct type known
|
||||
makeknown(o->type->id);
|
||||
getobname(o, obname, 1);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// when you wear armour, you find out
|
||||
// its bonuses.
|
||||
if (isplayer(lf) && (o->type->obclass->id == OC_ARMOUR)) {
|
||||
|
@ -15562,20 +15285,6 @@ int weild(lifeform_t *lf, object_t *o) {
|
|||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
// this weapon is two handed and uses the other hand
|
||||
if (hasflag(oo->flags, F_TWOHANDED)) {
|
||||
f = hasflagval(oo->flags, F_EQUIPPED, otherloc, -1, -1, NULL);
|
||||
if (f) {
|
||||
// unweild it
|
||||
if (unweild(lf, oo)) {
|
||||
// if we can't unweild old weapon, stop
|
||||
return B_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// new weapon is two handed? check other hand too.
|
||||
if (twohanded) {
|
||||
f = hasflagval(oo->flags, F_EQUIPPED, otherloc, -1, -1, NULL);
|
||||
|
|
19
map.c
19
map.c
|
@ -1519,6 +1519,19 @@ int calcroompos(map_t *map, int w, int h, int xmargin, int ymargin, int *bx, int
|
|||
for (rx = x; (rx < x+w) && valid; rx++) {
|
||||
int includethiscell = B_FALSE;
|
||||
cell = getcellat(map, rx,ry);
|
||||
|
||||
|
||||
// NEVER create a vault whcih will:
|
||||
// - be on top of the player (normally this can't happen,
|
||||
// but debugging via 'create vault' could do it)
|
||||
if (cell->lf && isplayer(cell->lf)) {
|
||||
valid = B_FALSE;
|
||||
}
|
||||
// - be on top of an existing staircase
|
||||
if (hasobwithflag(cell->obpile, F_CLIMBABLE)) {
|
||||
valid = B_FALSE;
|
||||
}
|
||||
|
||||
// is this cell adjacent to an empty cell and not a
|
||||
// corner (ie. a valid door location)
|
||||
if (countcellexits(cell)) {
|
||||
|
@ -1548,12 +1561,6 @@ int calcroompos(map_t *map, int w, int h, int xmargin, int ymargin, int *bx, int
|
|||
valid = B_FALSE;
|
||||
}
|
||||
}
|
||||
// NEVER create it on top of the player!
|
||||
// (normally this can't happen, but debugging via 'create
|
||||
// vault' could do it)
|
||||
if (cell->lf && isplayer(cell->lf)) {
|
||||
valid = B_FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
52
nexus.c
52
nexus.c
|
@ -108,7 +108,7 @@ int main(int argc, char **argv) {
|
|||
char welcomemsg[BUFLEN];
|
||||
int ch;
|
||||
FILE *playerfile = NULL;
|
||||
int x,y;
|
||||
int x,y,i;
|
||||
cell_t *c;
|
||||
vault_t *v;
|
||||
enum SKILLLEVEL slev;
|
||||
|
@ -150,11 +150,21 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
}
|
||||
|
||||
// init prompt
|
||||
for (i = 0; i < MAXCHOICES; i++) {
|
||||
choice_t *c;
|
||||
c = &prompt.choice[i];
|
||||
c->text = NULL;
|
||||
c->desc = NULL;
|
||||
c->longdesc = NULL;
|
||||
}
|
||||
|
||||
|
||||
// if no player (ie. didn't load a game), add them
|
||||
if (!player) {
|
||||
char *user,pname[BUFLEN],buf[BUFLEN];
|
||||
job_t *j = NULL;
|
||||
race_t *startrace = NULL;
|
||||
char ch;
|
||||
object_t *o;
|
||||
cell_t *where;
|
||||
|
@ -166,7 +176,7 @@ int main(int argc, char **argv) {
|
|||
// populate scroll, potion, etc names
|
||||
genhiddennames();
|
||||
|
||||
// read from input file if required
|
||||
// read from rc file if required
|
||||
if (playerfile) {
|
||||
char *p;
|
||||
while (!feof(playerfile)) {
|
||||
|
@ -181,13 +191,31 @@ int main(int argc, char **argv) {
|
|||
fseek(playerfile, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
if (!j) {
|
||||
|
||||
if (!startrace) {
|
||||
race_t *r;
|
||||
// ask for race
|
||||
initprompt(&prompt, "Select your race:");
|
||||
ch = 'a';
|
||||
for (r = firstrace ; r ; r = r->next) {
|
||||
if (hasflag(r->flags, F_PLAYABLE)) {
|
||||
addchoice(&prompt, ch++, r->name, NULL, r, NULL);
|
||||
}
|
||||
}
|
||||
startrace = NULL;
|
||||
while (!startrace) {
|
||||
getchoicestr(&prompt, B_FALSE, B_TRUE);
|
||||
startrace = prompt.result;
|
||||
}
|
||||
}
|
||||
|
||||
if (!j) {
|
||||
// ask for job
|
||||
initprompt(&prompt, "Select your job:");
|
||||
ch = 'a';
|
||||
for (j = firstjob ; j ; j = j->next) {
|
||||
if (!hasflag(j->flags, F_NOPLAYER)) {
|
||||
addchoice(&prompt, ch++, j->name, NULL, j);
|
||||
addchoice(&prompt, ch++, j->name, NULL, j, NULL);
|
||||
}
|
||||
}
|
||||
j = NULL;
|
||||
|
@ -232,7 +260,7 @@ int main(int argc, char **argv) {
|
|||
more();
|
||||
exit(1);
|
||||
}
|
||||
real_addlf(where, R_HUMAN, 1, C_PLAYER); // this will assign 'player'
|
||||
real_addlf(where, startrace->id, 1, C_PLAYER); // this will assign 'player'
|
||||
addflag(player->flags, F_CANWILL, OT_A_PRAY, NA, NA, NULL);
|
||||
addflag(player->flags, F_CANWILL, OT_A_TRAIN, NA, NA, NULL);
|
||||
addflag(player->flags, F_CANWILL, OT_A_DEBUG, NA, NA, NULL); /////////
|
||||
|
@ -252,9 +280,9 @@ int main(int argc, char **argv) {
|
|||
if (j->id == J_WIZARD) {
|
||||
skill_t *sk;
|
||||
initprompt(&prompt, "Select your primary spell specialty:");
|
||||
addchoice(&prompt, 'a', getskillname(SK_SS_AIR), NULL, findskill(SK_SS_AIR));
|
||||
addchoice(&prompt, 'c', getskillname(SK_SS_COLD), NULL, findskill(SK_SS_COLD));
|
||||
addchoice(&prompt, 'f', getskillname(SK_SS_FIRE), NULL, findskill(SK_SS_FIRE));
|
||||
addchoice(&prompt, 'a', getskillname(SK_SS_AIR), NULL, findskill(SK_SS_AIR), NULL);
|
||||
addchoice(&prompt, 'c', getskillname(SK_SS_COLD), NULL, findskill(SK_SS_COLD), NULL);
|
||||
addchoice(&prompt, 'f', getskillname(SK_SS_FIRE), NULL, findskill(SK_SS_FIRE), NULL);
|
||||
getchoice(&prompt);
|
||||
sk = (skill_t *) prompt.result;
|
||||
giveskilllev(player, sk->id, PR_BEGINNER);
|
||||
|
@ -272,10 +300,10 @@ int main(int argc, char **argv) {
|
|||
break;
|
||||
}
|
||||
initprompt(&prompt, "Select your secondary spell school:");
|
||||
addchoice(&prompt, 'd', getskillname(SK_SS_DIVINATION), NULL, findskill(SK_SS_DIVINATION));
|
||||
addchoice(&prompt, 'm', getskillname(SK_SS_MODIFICATION), NULL, findskill(SK_SS_MODIFICATION));
|
||||
addchoice(&prompt, 's', getskillname(SK_SS_SUMMONING), NULL, findskill(SK_SS_SUMMONING));
|
||||
addchoice(&prompt, 't', getskillname(SK_SS_TRANSLOCATION), NULL, findskill(SK_SS_TRANSLOCATION));
|
||||
addchoice(&prompt, 'd', getskillname(SK_SS_DIVINATION), NULL, findskill(SK_SS_DIVINATION), NULL);
|
||||
addchoice(&prompt, 'm', getskillname(SK_SS_MODIFICATION), NULL, findskill(SK_SS_MODIFICATION), NULL);
|
||||
addchoice(&prompt, 's', getskillname(SK_SS_SUMMONING), NULL, findskill(SK_SS_SUMMONING), NULL);
|
||||
addchoice(&prompt, 't', getskillname(SK_SS_TRANSLOCATION), NULL, findskill(SK_SS_TRANSLOCATION), NULL);
|
||||
getchoice(&prompt);
|
||||
sk = (skill_t *) prompt.result;
|
||||
giveskilllev(player, sk->id, PR_NOVICE);
|
||||
|
|
188
objects.c
188
objects.c
|
@ -1739,19 +1739,9 @@ objecttype_t *addot(enum OBTYPE id, char *name, char *description, int material,
|
|||
a->obclass = findoc(obclassid);
|
||||
a->flags = addflagpile(NULL, NULL);
|
||||
// inherit flags from object class
|
||||
/*
|
||||
for (f = a->obclass->flags->first ; f ; f = f->next) {
|
||||
addflag(a->flags, f->id, f->val[0], f->val[1], f->val[2], f->text);
|
||||
}
|
||||
*/
|
||||
copyflags(a->flags, a->obclass->flags, NA);
|
||||
if (a->material) {
|
||||
// inherit flags from material
|
||||
/*
|
||||
for (f = a->material->flags->first ; f ; f = f->next) {
|
||||
addflag(a->flags, f->id, f->val[0], f->val[1], f->val[2], f->text);
|
||||
}
|
||||
*/
|
||||
copyflags(a->flags, a->material->flags, FROMMAT);
|
||||
}
|
||||
|
||||
|
@ -1959,17 +1949,6 @@ void adjustdamob(object_t *o, unsigned int *dam, enum DAMTYPE damtype) {
|
|||
adjustdamhardness(dam, damtype, o->material->id);
|
||||
}
|
||||
|
||||
// adjust price for magical effects etc
|
||||
/*
|
||||
void adjustprice(objecttype_t *ot, float *price) {
|
||||
int min,max;
|
||||
flag_t *f;
|
||||
|
||||
// bonuses/penalties
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
// adjusts armour's ac//evasion penalty based on skill
|
||||
int adjustarmourpenalty(lifeform_t *lf, float amt) {
|
||||
enum SKILLLEVEL slev;
|
||||
|
@ -2113,15 +2092,6 @@ void brightflash(cell_t *centre, int range, lifeform_t *immunelf) {
|
|||
msg("You see an intense flash of light!");
|
||||
more();
|
||||
}
|
||||
/*
|
||||
if (getcelldist(player->cell, centre) <= range) {
|
||||
// player is in range but can't see - announce it beacuse it
|
||||
// will make you deaf!
|
||||
youhear(centre, "a deafening bang!");
|
||||
} else { // not in range of the flash
|
||||
youhear(centre, "a loud bang!");
|
||||
}
|
||||
*/
|
||||
// blind monsters
|
||||
for (y = centre->y - range; y <= centre->y + range; y++) {
|
||||
for (x = centre->x - range; x <= centre->x + range; x++) {
|
||||
|
@ -2616,19 +2586,6 @@ void explodeob(object_t *o, flag_t *f, int bigness) {
|
|||
}
|
||||
explodecells(c, dam * o->amt, bigness ? B_TRUE : B_FALSE, o, bigness ? 1 : 0, DT_COMPASS, B_FALSE);
|
||||
|
||||
// hurt everything!
|
||||
/*
|
||||
if (bigness) {
|
||||
int dir;
|
||||
cell_t *cc;
|
||||
explodecell(c, dam, (bigness) ? B_TRUE : B_FALSE, NULL);
|
||||
for (dir = DC_N; dir <= DC_NW; dir++) {
|
||||
cc = getcellindir(c, dir);
|
||||
}
|
||||
} else {
|
||||
explodecell(c, dam, (bigness) ? B_TRUE : B_FALSE, NULL);
|
||||
}
|
||||
*/
|
||||
// object dies.
|
||||
removeob(o, o->amt);
|
||||
}
|
||||
|
@ -3350,18 +3307,6 @@ int getobvalue(object_t *o) {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
/*
|
||||
if (rarity >= 70) {
|
||||
price /= 1.5;
|
||||
} else if (rarity <= 40) {
|
||||
price *= 1.5;
|
||||
} else if (rarity <= 20) {
|
||||
price *= 2;
|
||||
} else if (rarity <= 10) {
|
||||
price *= 5;
|
||||
}
|
||||
*/
|
||||
|
||||
// blessed/cursed
|
||||
if (isblessed(o) || iscursed(o)) price *= 1.25;
|
||||
|
||||
|
@ -3372,20 +3317,6 @@ int getobvalue(object_t *o) {
|
|||
return (int) price;
|
||||
}
|
||||
|
||||
/*
|
||||
int getobtypevalue(objecttype_t *ot) {
|
||||
float price;
|
||||
if (ot->id == OT_GOLD) {
|
||||
return 1;
|
||||
}
|
||||
// base value: weight * material value
|
||||
price = (float)ot->weight * (float)getmaterialvalue(ot->material->id);
|
||||
|
||||
adjustprice(ot, &price);
|
||||
return (int) price;
|
||||
}
|
||||
*/
|
||||
|
||||
char *getoperateverb(object_t *o) {
|
||||
if (hasflag(o->flags, F_CONTAINER) && (o->type->id != OT_VENDINGMACHINE)) {
|
||||
return "open";
|
||||
|
@ -3397,12 +3328,6 @@ char *getoperateverb(object_t *o) {
|
|||
// ie if you call this on a gem inside a bag inside
|
||||
// a barrel, will return the barrel.
|
||||
object_t *getoutercontainer(object_t *o) {
|
||||
/*
|
||||
while (o->pile->parentob) {
|
||||
o = o->pile->parentob;
|
||||
}
|
||||
return o;
|
||||
*/
|
||||
return getoutercontainerop(o->pile);
|
||||
}
|
||||
|
||||
|
@ -4073,20 +3998,6 @@ char *getobextrainfo(object_t *o, char *buf) {
|
|||
|
||||
cell_t *getoblocation(object_t *o) {
|
||||
return getobpilelocation(o->pile);
|
||||
/*
|
||||
if (o->pile->owner) { // held by someone
|
||||
return o->pile->owner->cell;
|
||||
} else if (o->pile->where) { // on the ground
|
||||
return o->pile->where;
|
||||
} else if (o->pile->parentob) { // inside another object
|
||||
object_t *outerob;
|
||||
// get outside object
|
||||
outerob = getoutercontainer(o);
|
||||
return getoblocation(outerob);
|
||||
}
|
||||
// in a dummy cell
|
||||
return NULL;
|
||||
*/
|
||||
}
|
||||
|
||||
cell_t *getobpilelocation(obpile_t *op) {
|
||||
|
@ -5592,14 +5503,6 @@ int isbetterwepthan(object_t *a, object_t *b) {
|
|||
if (!a) return B_FALSE;
|
||||
if (!b) return B_TRUE;
|
||||
|
||||
/* if (a->pile->owner && lfhasflag(a->pile->owner, F_DEBUG)) {
|
||||
db = B_TRUE;
|
||||
}
|
||||
if (b->pile->owner && lfhasflag(b->pile->owner, F_DEBUG)) {
|
||||
db = B_TRUE;
|
||||
} */
|
||||
|
||||
|
||||
if (db) {
|
||||
getobname(a, namea, a->amt);
|
||||
getobname(b, nameb, b->amt);
|
||||
|
@ -7300,17 +7203,6 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
|
|||
return B_TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
if (lf->controller != C_PLAYER) {
|
||||
|
||||
if (haslos(player, lf->cell)) {
|
||||
getlfname(lf, buf);
|
||||
capitalise(buf);
|
||||
msg("%s operates %s.", buf, obname);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (hasflag(o->flags, F_CONTAINER) && (o->type->id != OT_VENDINGMACHINE)) { // loot it
|
||||
if (isplayer(lf)) { // only player can loot.
|
||||
char ch;
|
||||
|
@ -7318,16 +7210,16 @@ int operate(lifeform_t *lf, object_t *o, cell_t *where) {
|
|||
initprompt(&prompt, buf);
|
||||
if (countobs(lf->pack, B_FALSE)) {
|
||||
snprintf(buf, BUFLEN, "Put items in %s",obname);
|
||||
addchoice(&prompt, 'i', buf, NULL, NULL);
|
||||
addchoice(&prompt, 'i', buf, NULL, NULL, NULL);
|
||||
}
|
||||
if (countobs(o->contents, B_FALSE)) {
|
||||
snprintf(buf, BUFLEN, "Take items out of %s",obname);
|
||||
addchoice(&prompt, 'o', buf, NULL, NULL);
|
||||
addchoice(&prompt, 'o', buf, NULL, NULL, NULL);
|
||||
}
|
||||
snprintf(buf, BUFLEN, "Both");
|
||||
addchoice(&prompt, 'b', buf, NULL, NULL);
|
||||
addchoice(&prompt, 'b', buf, NULL, NULL, NULL);
|
||||
snprintf(buf, BUFLEN, "Neither");
|
||||
addchoice(&prompt, 'n', buf, NULL, NULL);
|
||||
addchoice(&prompt, 'n', buf, NULL, NULL, NULL);
|
||||
ch = getchoice(&prompt);
|
||||
switch (ch) {
|
||||
case 'i':
|
||||
|
@ -9561,7 +9453,6 @@ int shatter(object_t *o, int hitlf, char *damstring, lifeform_t *fromlf) {
|
|||
strcpy(prefix, "");
|
||||
}
|
||||
|
||||
|
||||
msg("%s%s shatter%s!",prefix, strlen(prefix) ? noprefix(obname) : obname,
|
||||
(o->amt == 1) ? "s" : "");
|
||||
|
||||
|
@ -9582,7 +9473,6 @@ int shatter(object_t *o, int hitlf, char *damstring, lifeform_t *fromlf) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// place shards
|
||||
if (o->material->id == MT_GLASS) {
|
||||
int numshards;
|
||||
|
@ -9648,6 +9538,7 @@ int shatter(object_t *o, int hitlf, char *damstring, lifeform_t *fromlf) {
|
|||
case OT_POT_POLYMORPH:
|
||||
case OT_POT_INVIS:
|
||||
case OT_POT_SANCTUARY: // apply regular potion effects, and make them known
|
||||
case OT_POT_SLEEP:
|
||||
if (target) {
|
||||
if (seen) {
|
||||
makeknown(o->type->id);
|
||||
|
@ -10236,7 +10127,7 @@ int fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int speed,
|
|||
// identify as cursed!
|
||||
}
|
||||
|
||||
if (haslos(player, where)) {
|
||||
if (haslos(player, where) || haslos(player, srcloc)) { // can see the src/dst location
|
||||
seen = B_TRUE;
|
||||
} else {
|
||||
seen = B_FALSE;
|
||||
|
@ -10296,14 +10187,6 @@ int fireat(lifeform_t *thrower, object_t *o, int amt, cell_t *where, int speed,
|
|||
} else if (seen) {
|
||||
char throwstring[BUFLEN];
|
||||
// an object is moving on its own
|
||||
|
||||
/*
|
||||
if (target) {
|
||||
msg("Something %ss %s at %s.", throwverbpres, obname, targetname);
|
||||
} else {
|
||||
msg("Something %ss %s.",throwverbpres, obname);
|
||||
}
|
||||
*/
|
||||
if (o->pile->owner && cansee(player, o->pile->owner)) {
|
||||
char ownername[BUFLEN];
|
||||
getlfname(o->pile->owner, ownername);
|
||||
|
@ -10708,14 +10591,6 @@ void timeeffectsob(object_t *o) {
|
|||
getobname(o, obname, o->amt);
|
||||
|
||||
location = getoblocation(o);
|
||||
/*
|
||||
if (o->pile->where) {
|
||||
location = o->pile->where;
|
||||
} else {
|
||||
location = NULL;
|
||||
}
|
||||
*/
|
||||
|
||||
if (o->pile->owner) {
|
||||
owner = o->pile->owner;
|
||||
getlfname(owner, ownername);
|
||||
|
@ -10775,15 +10650,6 @@ void timeeffectsob(object_t *o) {
|
|||
if (!glowflag) {
|
||||
// start glowing
|
||||
glowflag = addtempflag(o->flags, F_PRODUCESLIGHT, 2, NA, NA, NULL, FROMBLESSING);
|
||||
/*
|
||||
if (isplayer(o->pile->owner)) {
|
||||
msg("Your %s start%s glowing!",noprefix(obname), (o->amt == 1) ? "s" : "");
|
||||
if (!o->blessknown) o->blessknown = B_TRUE;
|
||||
} else if (haslos(player, ourcell)) {
|
||||
msg("%s start%s glowing!",obname, (o->amt == 1) ? "s" : "");
|
||||
if (!o->blessknown) o->blessknown = B_TRUE;
|
||||
}
|
||||
*/
|
||||
if (haslos(player, ourcell)) {
|
||||
if (!o->blessknown) o->blessknown = B_TRUE;
|
||||
}
|
||||
|
@ -10795,15 +10661,6 @@ void timeeffectsob(object_t *o) {
|
|||
if (glowflag) {
|
||||
killflag(glowflag);
|
||||
glowflag = NULL;
|
||||
/*
|
||||
if (isplayer(o->pile->owner)) {
|
||||
msg("Your %s stop%s glowing.",noprefix(obname), (o->amt == 1) ? "s" : "");
|
||||
if (!o->blessknown) o->blessknown = B_TRUE;
|
||||
} else if (haslos(player, ourcell)) {
|
||||
msg("%s stop%s glowing.",obname, (o->amt == 1) ? "s" : "");
|
||||
if (!o->blessknown) o->blessknown = B_TRUE;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11542,13 +11399,6 @@ int validateobs(void) {
|
|||
printf("ERROR - spell %s doesn't have F_SPELLSCHOOL.\n", ot->name);
|
||||
goterror = B_TRUE;
|
||||
}
|
||||
/*
|
||||
if (!hasflag(ot->flags, F_SPELLLETTER)) {
|
||||
printf("ERROR - spell %s doesn't have F_SPELLLETTER.\n", ot->name);
|
||||
goterror = B_TRUE;
|
||||
}
|
||||
*/
|
||||
|
||||
if ((ot->obclass->id == OC_SPELL) && !hasflag(ot->flags, F_SPELLLEVEL)) {
|
||||
printf("ERROR - spell %s doesn't have F_SPELLLEVEL.\n", ot->name);
|
||||
goterror = B_TRUE;
|
||||
|
@ -11661,23 +11511,6 @@ int validateobs(void) {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
for (sk = firstskill ; sk ; sk = sk->next) {
|
||||
int found = B_FALSE;
|
||||
// make sure every skill have an object providing it
|
||||
for (ot = objecttype ; ot ; ot = ot->next) {
|
||||
if (hasflagval(ot->flags, F_MANUALOF, sk->id, NA, NA, NULL)) {
|
||||
found = B_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
printf("ERROR - skill '%s' has no matching manual.\n", sk->name);
|
||||
goterror = B_TRUE;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
return goterror;
|
||||
}
|
||||
|
||||
|
@ -11870,15 +11703,6 @@ int getmissileaccuracy(lifeform_t *thrower, cell_t *where, object_t *missile, ob
|
|||
rangemod = 30 - ((int) (((float)howfar / (float)maxrange) * 60.0));
|
||||
acc += rangemod;
|
||||
}
|
||||
/*
|
||||
if (howfar == 1) {
|
||||
acc += 30;
|
||||
} else if (howfar == maxrange) {
|
||||
if (slev != PR_MASTER) {
|
||||
acc -= 30;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// modify for dexterity
|
||||
if (whichatt != A_NONE) {
|
||||
|
|
5
save.c
5
save.c
|
@ -1085,6 +1085,7 @@ int writehiscore(lifeform_t *lf, int *rank) {
|
|||
int rc;
|
||||
char filename[BUFLEN],*cmd;
|
||||
char pname[BUFLEN];
|
||||
char racename[BUFLEN];
|
||||
char jobname[BUFLEN];
|
||||
char killedby[BUFLEN];
|
||||
char *errmsg = NULL;
|
||||
|
@ -1106,7 +1107,9 @@ int writehiscore(lifeform_t *lf, int *rank) {
|
|||
|
||||
getplayername(pname);
|
||||
j = getjob(player);
|
||||
snprintf(jobname, BUFLEN, "Lv%d %s", player->level, j->name);
|
||||
strcpy(racename, player->race->name);
|
||||
capitalise(racename);
|
||||
snprintf(jobname, BUFLEN, "Lv%d %s %s", player->level, racename, j->name);
|
||||
|
||||
makekillertext(killedby, lf->lastdam, B_FALSE);
|
||||
|
||||
|
|
53
spell.c
53
spell.c
|
@ -858,7 +858,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
|||
// 1.compile a list of repairable objects
|
||||
// sk_armour lets you repair armour up to xx% (depends on skill)
|
||||
initprompt(&prompt, "Repair which object?");
|
||||
addchoice(&prompt, '-', "Cancel", "Cancel", NULL);
|
||||
addchoice(&prompt, '-', "Cancel", "Cancel", NULL, NULL);
|
||||
for (o = user->pack->first ; o ; o = o->next) {
|
||||
int ok = B_FALSE;
|
||||
int cutoff = 0;
|
||||
|
@ -877,7 +877,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
|||
char buf[BUFLEN];
|
||||
getobname(o, buf, o->amt);
|
||||
// we can repair this object
|
||||
addchoice(&prompt, o->letter, buf, buf, o);
|
||||
addchoice(&prompt, o->letter, buf, buf, o, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1002,7 +1002,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
|||
}
|
||||
|
||||
// ask what to inspect
|
||||
initprompt(&prompt, "Study which scroll");
|
||||
initprompt(&prompt, "Study which scroll?");
|
||||
for (o = user->pack->first ; o ; o = o->next) {
|
||||
if ((o->type->obclass->id == OC_SCROLL) && isknown(o)) {
|
||||
f = hasflag(o->flags, F_LINKSPELL);
|
||||
|
@ -1011,10 +1011,15 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
|||
getobname(o, buf, o->amt);
|
||||
difficulty = 20 + (getspelllevel(f->val[0])*3);
|
||||
sprintf(buf2, "%s (%d%% success chance)", buf, difficulty);
|
||||
addchoice(&prompt, o->letter, buf, NULL, f);
|
||||
addchoice(&prompt, o->letter, buf, NULL, f, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!prompt.nchoices) {
|
||||
msg("You have no scrolls which you need to study.");
|
||||
return B_TRUE;
|
||||
}
|
||||
getchoice(&prompt);
|
||||
f = (flag_t *)prompt.result;
|
||||
if (!f) {
|
||||
|
@ -1348,8 +1353,10 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
|||
initprompt(&prompt, "Which skill will you learn?");
|
||||
ch = 'a';
|
||||
for (sk = firstskill ; sk ; sk = sk->next) {
|
||||
char buf2[HUGEBUFLEN];
|
||||
snprintf(buf, BUFLEN, "%s (%s)",getskillname(sk->id), getskilldesc(sk->id));
|
||||
addchoice(&prompt, ch++, getskillname(sk->id), buf, sk);
|
||||
makedesc_skill(sk->id, buf2);
|
||||
addchoice(&prompt, ch++, getskillname(sk->id), buf, sk, buf2);
|
||||
}
|
||||
getchoicestr(&prompt, B_FALSE, B_TRUE);
|
||||
sk = (skill_t *)prompt.result;
|
||||
|
@ -1359,7 +1366,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
|||
initprompt(&prompt, "How much will you learn this skill?");
|
||||
for (i = getskill(user, sk->id) + 1 ; i <= PR_MASTER; i++) {
|
||||
snprintf(buf, BUFLEN, "%s",getskilllevelname(i));
|
||||
addchoice(&prompt, ch++, buf, buf, NULL);
|
||||
addchoice(&prompt, ch++, buf, buf, NULL, NULL);
|
||||
}
|
||||
if (prompt.nchoices <= 0) {
|
||||
msg("You have already mastered this skill!");
|
||||
|
@ -1890,7 +1897,7 @@ int abilityeffects(lifeform_t *user, enum OBTYPE abilid, cell_t *targcell, lifef
|
|||
if (classok && !isknown(o)) {
|
||||
char buf[BUFLEN];
|
||||
getobname(o, buf, o->amt);
|
||||
addchoice(&prompt, o->letter, buf, NULL, o);
|
||||
addchoice(&prompt, o->letter, buf, NULL, o, NULL);
|
||||
}
|
||||
}
|
||||
getchoice(&prompt);
|
||||
|
@ -2576,10 +2583,10 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
|||
|
||||
// which object to take?
|
||||
initprompt(&prompt, "Confiscate which object?");
|
||||
addchoice(&prompt, '-', "(Cancel)", NULL, NULL);
|
||||
addchoice(&prompt, '-', "(Cancel)", NULL, NULL, NULL);
|
||||
for (o = target->pack->first ; o ; o = o->next) {
|
||||
getobname(o, obname, o->amt);
|
||||
addchoice(&prompt, ch, obname, NULL, o);
|
||||
addchoice(&prompt, ch, obname, NULL, o, NULL);
|
||||
if (ch == 'z') {
|
||||
ch = 'A';
|
||||
} else {
|
||||
|
@ -4899,7 +4906,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
|||
for (l = caster->cell->map->lf ; l ; l = l->next) {
|
||||
if (l != caster) {
|
||||
if (isimmuneto(l->flags, DT_NECROTIC) ||
|
||||
spellresisted(target, caster, spellid, power, seenbyplayer, B_FALSE)) {
|
||||
spellresisted(l, caster, spellid, power, seenbyplayer, B_FALSE)) {
|
||||
if (isplayer(l)) {
|
||||
msg("Luckily, the evil doesn't seem to harm you.");
|
||||
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
||||
|
@ -4915,7 +4922,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
|||
}
|
||||
|
||||
// now hit the caster!
|
||||
if (isimmuneto(caster->flags, DT_NECROTIC) || spellresisted(target, caster, spellid, power, seenbyplayer, B_FALSE)) {
|
||||
if (isimmuneto(caster->flags, DT_NECROTIC) || spellresisted(caster, caster, spellid, power, seenbyplayer, B_FALSE)) {
|
||||
if (isplayer(caster)) {
|
||||
msg("Luckily, the evil doesn't seem to harm you.");
|
||||
if (seenbyplayer) *seenbyplayer = B_TRUE;
|
||||
|
@ -5161,7 +5168,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
|||
for (r = firstregion ; r ; r = r->next) {
|
||||
regiontype_t *rt;
|
||||
rt = r->rtype;
|
||||
addchoice(&prompt, ch++, rt->name, NULL, r);
|
||||
addchoice(&prompt, ch++, rt->name, NULL, r, NULL);
|
||||
}
|
||||
|
||||
ch = getchoice(&prompt);
|
||||
|
@ -5944,7 +5951,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
|||
char obname[BUFLEN];
|
||||
real_getobname(o, obname, o->amt, B_TRUE, B_TRUE, B_FALSE, B_FALSE, B_FALSE);
|
||||
if (strcasestr(obname, wantname)) {
|
||||
addchoice(&prompt, ch++, obname, NULL, o);
|
||||
addchoice(&prompt, ch++, obname, NULL, o, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5966,7 +5973,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
|||
strcat(obname, lfname);
|
||||
strcat(obname, ")");
|
||||
|
||||
addchoice(&prompt, ch++, obname, NULL, o);
|
||||
addchoice(&prompt, ch++, obname, NULL, o, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6009,7 +6016,7 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
|||
sk = findskill(skid);
|
||||
if (sk && isloreskill(skid)) {
|
||||
if (!getskill(caster, skid)) {
|
||||
addchoice(&prompt, ch++, sk->name, NULL, sk);
|
||||
addchoice(&prompt, ch++, sk->name, NULL, sk, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7013,8 +7020,8 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
|||
getobname(corpse, corpsename, 1);
|
||||
snprintf(buf, BUFLEN, "What will you ask %s?", corpsename);
|
||||
initprompt(&prompt, buf);
|
||||
addchoice(&prompt, 'a', "How did you die?", NULL, NULL);
|
||||
addchoice(&prompt, '-', "(nothing)", NULL, NULL);
|
||||
addchoice(&prompt, 'a', "How did you die?", NULL, NULL, NULL);
|
||||
addchoice(&prompt, '-', "(nothing)", NULL, NULL, NULL);
|
||||
|
||||
ch = getchoice(&prompt);
|
||||
if (ch == 'a') {
|
||||
|
@ -8062,12 +8069,12 @@ int dospelleffects(lifeform_t *caster, enum OBTYPE spellid, int power, lifeform_
|
|||
char ch;
|
||||
if (!target) target = caster;
|
||||
initprompt(&prompt, "For what do you wish?");
|
||||
addchoice(&prompt, 'a', "Wealth", NULL, NULL);
|
||||
addchoice(&prompt, 'b', "Power", NULL, NULL);
|
||||
addchoice(&prompt, 'c', "Protection", NULL, NULL);
|
||||
addchoice(&prompt, 'd', "Fame", NULL, NULL);
|
||||
addchoice(&prompt, 'e', "Knowledge", NULL, NULL);
|
||||
addchoice(&prompt, 'f', "Magic", NULL, NULL);
|
||||
addchoice(&prompt, 'a', "Wealth", NULL, NULL, NULL);
|
||||
addchoice(&prompt, 'b', "Power", NULL, NULL, NULL);
|
||||
addchoice(&prompt, 'c', "Protection", NULL, NULL, NULL);
|
||||
addchoice(&prompt, 'd', "Fame", NULL, NULL, NULL);
|
||||
addchoice(&prompt, 'e', "Knowledge", NULL, NULL, NULL);
|
||||
addchoice(&prompt, 'f', "Magic", NULL, NULL, NULL);
|
||||
if (isplayer(target)) {
|
||||
ch = getchoice(&prompt);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue