view srogue/rogue.ext @ 305:3900f3cfe07d

Rogue V4: fix arithmetic operations on boolean variables. Monsters created by scrolls should now have their placement randomized correctly again.
author John "Elwin" Edwards
date Thu, 15 Apr 2021 20:55:34 -0400
parents d3968e9cb98d
children 057c5114e244
line wrap: on
line source

EXTTHG player;
EXTWEP weaps[];
EXTARM armors[];
EXTMON monsters[], *mtlev[];
EXTTRAP traps[];
EXTROOM *oldrp, rooms[];
EXTCORD delta, stairs, oldpos, rndspot;
EXTLKL *mlist, *lvl_obj;
EXTOBJ *cur_armor, *cur_weapon, *cur_ring[];
EXTMAG r_magic[], s_magic[], ws_magic[], p_magic[];
EXTMAG things[], a_magic[], w_magic[];
EXTINT max_hp, quiet, food_left, hungry_state, level, max_level;
EXTINT foodlev, total, count, demoncnt, fung_hit, ntraps;
EXTINT lastscore, purse, mpos, seed, dnum, no_food, packvol, playuid;
EXTINT curprice, trader, group, levcount, levtype, ringfood, playgid;
EXTINT chkstairs(), notfight();
EXTINT prntfile();
EXTBOOL running, nochange, after, inwhgt, isfight, firstmove, nlmove;
EXTBOOL wizard, waswizard, in_shell, amulet, door_stop, playing, use_savedir;
EXTBOOL notify, ws_know[], p_know[], s_know[], r_know[], inpool;
EXTCHAR home[], file_name[], whoami[], fruit[], curpurch[], scorefile[];
EXTCHAR *r_stones[], *p_colors[], *s_names[], *ws_type[], *ws_made[];
EXTCHAR *ws_guess[], *s_guess[], *r_guess[], *p_guess[];/*, *unctrl();*/
EXTCHAR morestr[], prbuf[], huh[];
EXTCHAR *release, take, runch;
EXTCHAR retstr[], wizstr[], spacemsg[], illegal[], callit[], starlist[];
EXTSTAT max_stats, *him;
extern struct magic_info thnginfo[];
extern struct real re_stats;
extern long e_levels[];
extern struct rod ws_stuff[];
extern struct sgttyb _tty;

extern struct coord nh;
extern struct delayed_action d_list[MAXDAEMONS];
extern int between;

extern char *rainbow[NCOLORS];
extern char *sylls[NSYLS];
extern char *stones[NSTONES];
extern char *wood[NWOOD];
extern char *metal[NMETAL];

void    _attach(struct linked_list **list, struct linked_list *item);
void    _detach(struct linked_list **list, struct linked_list *item);
void    _free_list(struct linked_list **ptr);
void    activity(void);
int     add_dam(struct stats *who);
void    add_haste(bool potion);
void    add_mon(struct room *rm, bool treas);
bool    add_pack(struct linked_list *item, bool silent);
void    add_pass(void);
void    addmsg(char *fmt, ...);
void    aggravate(void);
int     attack(struct thing *mp);
bool    author(void);
void    auto_save(int a);
int     be_trapped(struct coord *tc, struct thing *th);
void    buy_it(void);
void    byebye(int how);
bool    cansee(int y, int x);
char   *charge_str(struct object *obj);
void    check_level(void);
void    chg_abil(int what, int amt, int how);
void    chg_hpt(int howmany, bool alsomax, char what);
void    command(void);
bool    cordok(int y, int x);
void    create_obj(bool fscr);
void    cur_null(struct object *op);
void    dbotline(WINDOW *scr, char *message);
bool    dead_end(char ch);
void    death(char monst);
void    del_pack(struct linked_list *what);
bool    diag_ok(struct coord *sp, struct coord *ep);
void    dip_it(void);
void    discard(struct linked_list *item);
void    displevl(void);
void    dispmax(void);
void    dispmons(void);
void    do_daemons(int flag);
void    do_fuses(void);
void    do_maze(void);
void    do_motion(struct object *obj, int ydelta, int xdelta);
void    do_move(int dy, int dx);
void    do_passages(void);
void    do_post(void);
void    do_rooms(void);
void    do_run(char ch);
void    do_zap(bool gotdir);
void    doctor(int fromfuse);
void    draw_room(struct room *rp);
int     drop(struct linked_list *item);
bool    dropcheck(struct object *op);
void    eat(void);
int     encread(void *starta, unsigned int size, FILE *inf);
void    encwrite(void *starta, unsigned int size, FILE *outf);
void    endit(int a);
void    endmsg(void);
void    extinguish(void (*func)());
int     extras(void);
void    fall(struct linked_list *item, bool pr);
bool    fallpos(struct coord *pos, struct coord *newpos, bool passages);
void    fatal(char *s);
bool    fight(struct coord *mp, struct object *weap, bool thrown);
struct linked_list *find_mons(int y, int x);
struct linked_list *find_obj(int y, int x);
void    fix_stick(struct object *cur);
void    fuse(void (*func)(), int arg, int time);
void    game_err(int a);
void    genocide(void);
bool    get_dir(void);
struct linked_list *get_item(char *purpose, int type);
int     get_str(char *opt, WINDOW *awin);
int     get_worth(struct object *obj);
int     getbless(void);
int     getindex(char what);
int     getpcon(struct stats *who);
int     getpdex(struct stats *who, bool heave);
int     getpwis(struct stats *who);
void    heal_self(int factor, bool updmaxhp);
bool    hit_monster(struct coord *mp, struct object *obj);
int     hitweight(void);
bool    hurt_armor(struct object *obj);
void    idenpack(void);
char   *identify(int what);
void    ignore(void);
bool    illeg_ch(unsigned char ch);
void    init_everything(void);
void    init_ring(struct object *what, bool fromwiz);
void    init_weapon(struct object *weap, int type);
void    initarmor(struct object *obj, int what);
void    initfood(struct object *what);
char   *inv_name(struct object *obj, bool drop);
bool    inventory(struct linked_list *list, int type);
int     itemvol(struct object *wh);
int     itemweight(struct object *wh);
bool    is_current(struct object *obj);
bool    is_magic(struct object *obj);
bool    isatrap(char ch);
bool    isring(int hand, int ring);
bool    iswearing(int ring);
void    killed(struct linked_list *item, bool pr);
void    lengthen(void (*func)(), int xtime);
void    lev_mon(void);
void    light(struct coord *cp);
void    look(bool wakeup);
bool    magring(struct object *what);
bool    makemons(int what);
int     midx(char whichmon);
void    missile(int ydelta, int xdelta);
void    money(void);
bool    monhurt(struct thing *th);
void    msg(char *fmt, ...);
char   *new(int size);
struct linked_list *new_item(int size);
void    new_level(int ltype);
struct linked_list *new_monster(char type, struct coord *cp, bool treas);
struct linked_list *new_thing(bool treas, int type, int which);
void    nohaste(int fromfuse);
void    noteth(int fromfuse);
void    notinvinc(int fromfuse);
void    notregen(int fromfuse);
void    notslow(int fromfuse);
char    npch(char ch);
char   *num(int n1, int n2);
bool    o_off(struct object *what, long bit);
bool    o_on(struct object *what, long bit);
void    option(void);
char    pack_char(struct object *obj);
void    parse_opts(char *str);
bool    passwd(void);
int     pick_one(struct magic_item *mag);
void    pick_up(char ch);
void    picky_inven(void);
bool    pl_off(long what);
bool    pl_on(long what);
void    playit(void);
bool    price_it(void);
void    quaff(void);
void    quit(int a);
void    raise_level(void);
void    rchg_str(int amt);
void    read_scroll(void);
int     readchar(void);
void    remove_monster(struct coord *mp, struct linked_list *item);
void    resoflg(struct object *what, long bit);
bool    restore(char *file, char **envp);
void    restscr(WINDOW *scr);
bool    rf_on(struct room *rm, long bit);
char   *ring_num(struct object *what);
void    ring_off(void);
void    ring_on(void);
void    ringabil(void);
int     ringex(int rtype);
int     rnd(int range);
char    rnd_mon(bool wander, bool baddie);
struct coord *rnd_pos(struct room *rp);
int     rnd_room(void);
struct coord *rndmove(struct thing *who);
int     roll(int number, int sides);
void    rollwand(int fromfuse);
struct room *roomin(struct coord *cp);
int     rs_restore_file(FILE *inf);
int     rs_save_file(FILE *savef);
void    runners(void);
void    runto(struct coord *runner, struct coord *spot);
void    sapem(int fromfuse);
bool    save(int which);
bool    save_game(void);
bool    save_throw(int which, struct thing *tp);
void    score(int amount, int aflag, char monst);
void    sell_it(void);
void    setoflg(struct object *what, long bit);
void    setup(void);
char    show(int y, int x);
bool    showtop(int showname);
void    sight(int fromfuse);
void    start_daemon(void (*func)(), int arg, int type);
void    status(int fromfuse);
bool    step_ok(unsigned char ch);
void    stomach(int fromfuse);
int     str_plus(struct stats *who);
void    strucpy(char *s1, char *s2, int len);
void    swander(int fromfuse);
bool    swing(int at_lvl, int op_arm, int wplus);
void    take_off(void);
int     teleport(struct coord spot, struct thing *th);
void    toss_ring(struct object *what);
void    total_winner(void);
int     totalenc(void);
char   *tr_name(char ch);
struct trap *trap_at(int y, int x);
void    unconfuse(int fromfuse);
void    unhold(char whichmon);
void    unsee(int fromfuse);
void    updpack(void);
char   *vowelstr(char *str);
void    wait_for(WINDOW *win, char ch);
struct linked_list *wake_monster(int y, int x);
void    wanderer(void);
void    waste_time(void);
void    wear(void);
void    wghtchk(int fromfuse);
void    whatis(struct linked_list *what);
void    wield(void);
char    winat(int y, int x);
void    writelog(int amount, int aflag, char monst);