void m_damage(struct monster *m, int dmg, int dtype) { m_status_set(m, AWAKE); m_status_set(m, HOSTILE); if(m_immunityp(m, dtype)) { if(los_p(Player.x, Player.y, m->x, m->y)) { if(m->uniqueness != COMMON) { strcpy(Str1, m->monstring); } else { strcpy(Str1, "The "); strcat(Str1, m->monstring); } strcat(Str1, " ignores the attack!"); mprint(Str1); } } else { m->hp -= dmg; if(m->hp < 1) { m_death(m); } } }
void weapon_tangle(int dmgmod, pob o, pmt m) { if ((random_range(2) == 1) && (! m_immunityp(m,NORMAL_DAMAGE))) { mprint("You entangle the monster!"); m_status_reset(m,MOBILE); } p_hit(m,Player.dmg+dmgmod,NORMAL_DAMAGE); }
void weapon_acidwhip(int dmgmod, Object* o, Monster* m) { if ((random_range(2) == 1) && (! m_immunityp(m,NORMAL_DAMAGE))) { mprint("You entangle the monster!"); m_status_reset(m,MOBILE); } p_hit(m,Player.dmg+dmgmod,ACID); }
void weapon_lightsabre(int dmgmod, pob o, pmt m) { if (! o->known) { mprint("Fumbling with the cylinder, you press the wrong stud...."); p_damage(100,UNSTOPPABLE,"fumbling with a lightsabre"); o->known = 1; } else { /* test prevents confusing immunity messages.... */ if (! m_immunityp(m,NORMAL_DAMAGE)) { mprint("Vzzzzmmm!"); m_damage(m,20,NORMAL_DAMAGE); } if ((m->hp>0) && (! m_immunityp(m,FLAME))) { mprint("Zzzzap!"); m_damage(m,20,FLAME); } } }
void weapon_vorpal(int dmgmod, pob o, pmt m) { if ((random_range(10) < 3) && (! m_immunityp(m,NORMAL_DAMAGE))) { o->known = 2; if (random_range(2) == 1) mprint("One Two! One Two! And through and through!"); else mprint("Your vorpal blade goes snicker-snack!"); m_death(m); } else weapon_normal_hit(dmgmod,o,m); }
void m_lava(struct monster *m) { char Str1[80]; if(!m_immunityp(m, FLAME) || (!m_statusp(m, SWIMMING) && !m_statusp(m, ONLYSWIM))) { if(los_p(m->x, m->y, Player.x, Player.y)) { if(m->uniqueness != COMMON) { strcpy(Str1, m->monstring); } else { strcpy(Str1, "The "); strcat(Str1, m->monstring); } strcat(Str1, " died in a pool of lava!"); mprint(Str1); } m_death(m); } }
void m_trap_sleepgas(struct monster *m) { char Str1[80]; if(los_p(m->x, m->y, Player.x, Player.y)) { if(m->uniqueness != COMMON) { strcpy(Str1, m->monstring); } else { strcpy(Str1, "The "); strcat(Str1, m->monstring); } strcat(Str1, " walked into a sleepgas trap!"); mprint(Str1); Level->site[m->x][m->y].locchar = TRAP; } if(!m_immunityp(m, SLEEP)) { m_status_reset(m, AWAKE); } }