#include #include #include "mon.h" #include "vars.h" #include "dice.h" #include "structs.h" static void rat_tick(MONST *m) { std_animal_tick(m); } static void rat_bemoved(MONST *m __attribute__((__unused__))) { } static const char *rat_name(MONST *m __attribute__((__unused__))) { return("the rat"); } static const char *rat_Name(MONST *m __attribute__((__unused__))) { return("The rat"); } static int rat_attack(MONST *m __attribute__((__unused__))) { return(rnd(25)); } static int rat_defend(MONST *m __attribute__((__unused__))) { return(rnd(50)); } static int rat_givedamage(MONST *m __attribute__((__unused__)), int dd __attribute__((__unused__))) { return(roll("d1000")); } static MONOPS ops = { &rat_tick, &rat_bemoved, &rat_name, &rat_Name, &rat_attack, &rat_defend, &rat_givedamage, &std_takedamage, &std_kill, &std_destroy }; static MONST *new(MONST *m, LEVEL *lv __attribute__((__unused__))) { m->symbol = 'r'; m->hp = 3000; m->maxhp = 3000; m->heal = 3; m->flags = Z_mad ? MF_TRACKING : 0; m->ops = &ops; return(m); } static void ctl(MONST *m, int op, ...) { va_list ap; va_start(ap,op); switch (op) { case MCTL_AGGR: { int ag; ag = va_arg(ap,int); if (ag) m->flags |= MF_TRACKING; else m->flags &= ~MF_TRACKING; } break; } va_end(ap); } static PROBINIT probs[] = { PROBALL(1), PROBELEM(0), PROBEND() }; extern MTINFO mtinfo_r; MTINFO mtinfo_r = { &probs[0], &new, &ctl };