/* * The implementation of lizard monsters. */ #include #include #include "mon.h" #include "vars.h" #include "dice.h" #include "damage.h" #include "structs.h" /* * The lizard tick method. Just use the standard animal tick. */ static void lizard_tick(MONST *m) { std_animal_tick(m); } /* * The lizard bemoved method. Nothing to do here. */ static void lizard_bemoved(MONST *m __attribute__((__unused__))) { } /* * The lizard name method. */ static const char *lizard_name(MONST *m __attribute__((__unused__))) { return("the lizard"); } /* * The lizard Name method. */ static const char *lizard_Name(MONST *m __attribute__((__unused__))) { return("The lizard"); } /* * The lizard attack method. They don't have all that good a hit * chance. */ static int lizard_attack(MONST *m __attribute__((__unused__))) { return(rnd(25)); } /* * The lizard defend method. They have semi-decent defense (not as * good as a rat's, but that's because they're slower). */ static int lizard_defend(MONST *m __attribute__((__unused__))) { return(rnd(20)); } /* * The lizard damage method. They do minor damage, a bit less than a * rat's. */ static DAMAGE lizard_givedamage(MONST *m __attribute__((__unused__)), int dd __attribute__((__unused__))) { return(damage_simple(roll("d800"),DK_ORDINARY,0)); } /* * The lizard MONOPS vector. */ static MONOPS ops = { &lizard_tick, &lizard_bemoved, &lizard_name, &lizard_Name, &lizard_attack, &lizard_defend, &lizard_givedamage, &std_takedamage, &std_kill, &std_destroy }; /* * Create a new lizard. */ static MONST *new_l(MONST *m, LEVEL *lv __attribute__((__unused__))) { m->symbol = 'l'; m->hp = 3000; m->maxhp = 3000; m->baseflags = Z_mad ? MBF_TRACKING : 0; m->ops = &ops; return(m); } /* * The lizard ctl method. */ static void monctl_l(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->baseflags |= MBF_TRACKING; else m->baseflags &= ~MBF_TRACKING; } break; } va_end(ap); } /* * The lizard MTINFO. They're a bit slow. */ #define basespeed_l (TIMESCALE * 1.2) #define baseheal_l 3 #define exp_l 800 MTINFO mtinfo_l = MTINFO_INIT(l);